@wjarka/cezarion 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1158) hide show
  1. package/bin.js +2 -0
  2. package/cez.js +2 -0
  3. package/cezarion.js +2 -0
  4. package/dist/cez.js +2 -0
  5. package/dist/cezarion.js +2 -0
  6. package/dist/hsq.js +2 -0
  7. package/dist/index.js +1 -835
  8. package/dist/server/app-type.d.ts +1 -6
  9. package/dist/server/app-type.js +1 -2
  10. package/hsq.js +2 -0
  11. package/package.json +21 -59
  12. package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
  13. package/web/dist/assets/activity-motion-hhx0e841.js +2 -0
  14. package/web/dist/assets/activity-route-De0BnSrc.js +1 -0
  15. package/web/dist/assets/agent-accounts-BCg-578Q.js +18 -0
  16. package/web/dist/assets/alert-dialog-Dj464rjk.js +1 -0
  17. package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
  18. package/web/dist/assets/button-CHUAMTHK.js +3 -0
  19. package/web/dist/assets/centered-state-DGyy0SuA.js +1 -0
  20. package/web/dist/assets/cez-idle-BT0U4GN_.js +1 -0
  21. package/web/dist/assets/commit-diff-panel-DYtYc_dH.js +1 -0
  22. package/web/dist/assets/control-locations-CA9TMupq.js +1 -0
  23. package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
  24. package/web/dist/assets/diff-controls-BR2uqhwG.js +1 -0
  25. package/web/dist/assets/diff-tVGVhYyc.js +3 -0
  26. package/web/dist/assets/diff-view-CNM3u77o.js +11 -0
  27. package/web/dist/assets/dropdown-menu-DhrBcVgr.js +1 -0
  28. package/web/dist/assets/es2015-D345RR4o.js +41 -0
  29. package/web/dist/assets/file-preview-C1eTdJLJ.js +2 -0
  30. package/web/dist/assets/git-toolbar-Dwz8p8GW.js +1 -0
  31. package/web/dist/assets/github-BSezqH6f.js +1 -0
  32. package/web/dist/assets/github-sidebar-model-Ct0DltOv.js +1 -0
  33. package/web/dist/assets/global-activity-route-BZiYz-B0.js +1 -0
  34. package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
  35. package/web/dist/assets/{image-preview-C_t9q45f.js → image-preview-Cq1vDiEo.js} +1 -1
  36. package/web/dist/assets/index-B18AqW0Z.css +1 -0
  37. package/web/dist/assets/index-D489J7QW.js +14 -0
  38. package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
  39. package/web/dist/assets/live-protocol-BDY7JJpT.js +64 -0
  40. package/web/dist/assets/live-refetch-C0kQc3-z.js +1 -0
  41. package/web/dist/assets/{live-worker-BizfZSoh.ts → live-worker-BWdeGzQX.ts} +2 -1
  42. package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
  43. package/web/dist/assets/markdown-D7DUNWcJ.js +6 -0
  44. package/web/dist/assets/mermaid.min-3O9YjB2l.js +1 -0
  45. package/web/dist/assets/message-square-B-MD-8rD.js +1 -0
  46. package/web/dist/assets/{nav-row-styles-AoIhhIwf.js → nav-row-styles-BZUUavOF.js} +1 -1
  47. package/web/dist/assets/popover-DRcRI46x.js +1 -0
  48. package/web/dist/assets/preview-pane-connected-DGkEs_L3.js +3 -0
  49. package/web/dist/assets/project-router-1m_VlC22.js +1 -0
  50. package/web/dist/assets/project-scope-context-CaUqlAd7.js +4 -0
  51. package/web/dist/assets/queries-DYfIpJ-d.js +1 -0
  52. package/web/dist/assets/repo-git-CU1S5P-y.js +1 -0
  53. package/web/dist/assets/report-reader-DlZol2Ux.js +1 -0
  54. package/web/dist/assets/report-title-D4Mbu2Er.js +1 -0
  55. package/web/dist/assets/reports-B7QAzibP.css +1 -0
  56. package/web/dist/assets/reports-DIGGjk7C.js +1 -0
  57. package/web/dist/assets/run-header-DPjiPKRe.js +2 -0
  58. package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
  59. package/web/dist/assets/skills-BMwanop_.js +1 -0
  60. package/web/dist/assets/skills-DFBiAuJG.js +1 -0
  61. package/web/dist/assets/skills-workflows-C21NystW.css +1 -0
  62. package/web/dist/assets/sortable.esm-zp_qkYGV.js +5 -0
  63. package/web/dist/assets/tab-link-DCUifQ46.js +1 -0
  64. package/web/dist/assets/task-changes-BZXWvQN3.js +1 -0
  65. package/web/dist/assets/task-commits-ByI9MSfc.js +1 -0
  66. package/web/dist/assets/task-files-LJbenpiH.js +1 -0
  67. package/web/dist/assets/task-github-item-B0CU9lGR.js +1 -0
  68. package/web/dist/assets/task-thread-CXCN__1a.js +9 -0
  69. package/web/dist/assets/textarea-DlVUfdWG.js +1 -0
  70. package/web/dist/assets/thread-state-BLaCzqeX.js +4 -0
  71. package/web/dist/assets/toaster-B1MyeHiE.js +1 -0
  72. package/web/dist/assets/use-hand-to-agent-state-BkmKad8x.js +1 -0
  73. package/web/dist/assets/useInfiniteQuery-qEY8OhKb.js +1 -0
  74. package/web/dist/assets/useQuery-DOJQOEBO.js +1 -0
  75. package/web/dist/assets/workflows-Dbxb-d-6.js +7 -0
  76. package/web/dist/assets/ws-DvGmrP4z.js +1 -0
  77. package/web/dist/assets/zoomable-image-5pOUaPEg.js +1 -0
  78. package/web/dist/index.html +31 -15
  79. package/web/dist/live-worker.js +2 -2
  80. package/LICENSE +0 -22
  81. package/README.md +0 -1725
  82. package/dist/agent-config/account-identity.d.ts +0 -28
  83. package/dist/agent-config/account-identity.js +0 -131
  84. package/dist/agent-config/account-identity.js.map +0 -1
  85. package/dist/agent-config/catalog.d.ts +0 -70
  86. package/dist/agent-config/catalog.js +0 -383
  87. package/dist/agent-config/catalog.js.map +0 -1
  88. package/dist/agent-config/files.d.ts +0 -42
  89. package/dist/agent-config/files.js +0 -115
  90. package/dist/agent-config/files.js.map +0 -1
  91. package/dist/agent-config/model-settings/claude.d.ts +0 -2
  92. package/dist/agent-config/model-settings/claude.js +0 -11
  93. package/dist/agent-config/model-settings/claude.js.map +0 -1
  94. package/dist/agent-config/model-settings/codex.d.ts +0 -2
  95. package/dist/agent-config/model-settings/codex.js +0 -16
  96. package/dist/agent-config/model-settings/codex.js.map +0 -1
  97. package/dist/agent-config/model-settings/opencode.d.ts +0 -2
  98. package/dist/agent-config/model-settings/opencode.js +0 -8
  99. package/dist/agent-config/model-settings/opencode.js.map +0 -1
  100. package/dist/agent-config/model-settings/pi.d.ts +0 -2
  101. package/dist/agent-config/model-settings/pi.js +0 -38
  102. package/dist/agent-config/model-settings/pi.js.map +0 -1
  103. package/dist/agent-config/model-settings/shared.d.ts +0 -12
  104. package/dist/agent-config/model-settings/shared.js +0 -100
  105. package/dist/agent-config/model-settings/shared.js.map +0 -1
  106. package/dist/agent-config/model-settings/types.d.ts +0 -9
  107. package/dist/agent-config/model-settings/types.js +0 -2
  108. package/dist/agent-config/model-settings/types.js.map +0 -1
  109. package/dist/agent-config/models.d.ts +0 -9
  110. package/dist/agent-config/models.js +0 -40
  111. package/dist/agent-config/models.js.map +0 -1
  112. package/dist/agent-config/seed.d.ts +0 -15
  113. package/dist/agent-config/seed.js +0 -94
  114. package/dist/agent-config/seed.js.map +0 -1
  115. package/dist/agent-config/service.d.ts +0 -44
  116. package/dist/agent-config/service.js +0 -72
  117. package/dist/agent-config/service.js.map +0 -1
  118. package/dist/agent-config/validate.d.ts +0 -18
  119. package/dist/agent-config/validate.js +0 -82
  120. package/dist/agent-config/validate.js.map +0 -1
  121. package/dist/application-update/bin-recovery.d.ts +0 -5
  122. package/dist/application-update/bin-recovery.js +0 -96
  123. package/dist/application-update/bin-recovery.js.map +0 -1
  124. package/dist/application-update/discovery.d.ts +0 -22
  125. package/dist/application-update/discovery.js +0 -91
  126. package/dist/application-update/discovery.js.map +0 -1
  127. package/dist/application-update/helper.d.ts +0 -57
  128. package/dist/application-update/helper.js +0 -369
  129. package/dist/application-update/helper.js.map +0 -1
  130. package/dist/application-update/launcher.d.ts +0 -12
  131. package/dist/application-update/launcher.js +0 -59
  132. package/dist/application-update/launcher.js.map +0 -1
  133. package/dist/application-update/lock.d.ts +0 -4
  134. package/dist/application-update/lock.js +0 -70
  135. package/dist/application-update/lock.js.map +0 -1
  136. package/dist/application-update/npm-process.d.ts +0 -17
  137. package/dist/application-update/npm-process.js +0 -133
  138. package/dist/application-update/npm-process.js.map +0 -1
  139. package/dist/application-update/service.d.ts +0 -69
  140. package/dist/application-update/service.js +0 -456
  141. package/dist/application-update/service.js.map +0 -1
  142. package/dist/archive-on-merge-setting.d.ts +0 -15
  143. package/dist/archive-on-merge-setting.js +0 -14
  144. package/dist/archive-on-merge-setting.js.map +0 -1
  145. package/dist/artifacts/cli.d.ts +0 -9
  146. package/dist/artifacts/cli.js +0 -59
  147. package/dist/artifacts/cli.js.map +0 -1
  148. package/dist/artifacts/lifecycle.d.ts +0 -4
  149. package/dist/artifacts/lifecycle.js +0 -42
  150. package/dist/artifacts/lifecycle.js.map +0 -1
  151. package/dist/artifacts/resolve.d.ts +0 -18
  152. package/dist/artifacts/resolve.js +0 -103
  153. package/dist/artifacts/resolve.js.map +0 -1
  154. package/dist/artifacts/store.d.ts +0 -8
  155. package/dist/artifacts/store.js +0 -323
  156. package/dist/artifacts/store.js.map +0 -1
  157. package/dist/automations/automation-cli.d.ts +0 -59
  158. package/dist/automations/automation-cli.js +0 -509
  159. package/dist/automations/automation-cli.js.map +0 -1
  160. package/dist/automations/builtin-skill.d.ts +0 -7
  161. package/dist/automations/builtin-skill.js +0 -14
  162. package/dist/automations/builtin-skill.js.map +0 -1
  163. package/dist/automations/coordinator.d.ts +0 -33
  164. package/dist/automations/coordinator.js +0 -86
  165. package/dist/automations/coordinator.js.map +0 -1
  166. package/dist/automations/github-baseline.d.ts +0 -3
  167. package/dist/automations/github-baseline.js +0 -17
  168. package/dist/automations/github-baseline.js.map +0 -1
  169. package/dist/automations/github-poller.d.ts +0 -93
  170. package/dist/automations/github-poller.js +0 -303
  171. package/dist/automations/github-poller.js.map +0 -1
  172. package/dist/automations/prompts.d.ts +0 -12
  173. package/dist/automations/prompts.js +0 -160
  174. package/dist/automations/prompts.js.map +0 -1
  175. package/dist/automations/schedule-runner.d.ts +0 -149
  176. package/dist/automations/schedule-runner.js +0 -513
  177. package/dist/automations/schedule-runner.js.map +0 -1
  178. package/dist/automations/scheduler.d.ts +0 -87
  179. package/dist/automations/scheduler.js +0 -434
  180. package/dist/automations/scheduler.js.map +0 -1
  181. package/dist/automations/service.d.ts +0 -777
  182. package/dist/automations/service.js +0 -444
  183. package/dist/automations/service.js.map +0 -1
  184. package/dist/automations/store.d.ts +0 -160
  185. package/dist/automations/store.js +0 -738
  186. package/dist/automations/store.js.map +0 -1
  187. package/dist/automations/task-template.d.ts +0 -59
  188. package/dist/automations/task-template.js +0 -273
  189. package/dist/automations/task-template.js.map +0 -1
  190. package/dist/automations/tool-adapter.d.ts +0 -6
  191. package/dist/automations/tool-adapter.js +0 -108
  192. package/dist/automations/tool-adapter.js.map +0 -1
  193. package/dist/automations/types.d.ts +0 -1
  194. package/dist/automations/types.js +0 -2
  195. package/dist/automations/types.js.map +0 -1
  196. package/dist/autosave-cleanup.d.ts +0 -26
  197. package/dist/autosave-cleanup.js +0 -87
  198. package/dist/autosave-cleanup.js.map +0 -1
  199. package/dist/autosave-git.d.ts +0 -21
  200. package/dist/autosave-git.js +0 -204
  201. package/dist/autosave-git.js.map +0 -1
  202. package/dist/autosave-group.d.ts +0 -8
  203. package/dist/autosave-group.js +0 -61
  204. package/dist/autosave-group.js.map +0 -1
  205. package/dist/autosave-holders.d.ts +0 -34
  206. package/dist/autosave-holders.js +0 -204
  207. package/dist/autosave-holders.js.map +0 -1
  208. package/dist/autosave-windows.d.ts +0 -25
  209. package/dist/autosave-windows.js +0 -156
  210. package/dist/autosave-windows.js.map +0 -1
  211. package/dist/ci-wait/client.d.ts +0 -28
  212. package/dist/ci-wait/client.js +0 -105
  213. package/dist/ci-wait/client.js.map +0 -1
  214. package/dist/ci-wait/controller.d.ts +0 -756
  215. package/dist/ci-wait/controller.js +0 -334
  216. package/dist/ci-wait/controller.js.map +0 -1
  217. package/dist/ci-wait/errors.d.ts +0 -27
  218. package/dist/ci-wait/errors.js +0 -252
  219. package/dist/ci-wait/errors.js.map +0 -1
  220. package/dist/ci-wait/github.d.ts +0 -87
  221. package/dist/ci-wait/github.js +0 -278
  222. package/dist/ci-wait/github.js.map +0 -1
  223. package/dist/ci-wait/injection.d.ts +0 -3
  224. package/dist/ci-wait/injection.js +0 -26
  225. package/dist/ci-wait/injection.js.map +0 -1
  226. package/dist/ci-wait/mcp.d.ts +0 -3
  227. package/dist/ci-wait/mcp.js +0 -30
  228. package/dist/ci-wait/mcp.js.map +0 -1
  229. package/dist/ci-wait/resources.d.ts +0 -7
  230. package/dist/ci-wait/resources.js +0 -32
  231. package/dist/ci-wait/resources.js.map +0 -1
  232. package/dist/ci-wait/supervisor.d.ts +0 -29
  233. package/dist/ci-wait/supervisor.js +0 -260
  234. package/dist/ci-wait/supervisor.js.map +0 -1
  235. package/dist/ci-wait/tools.d.ts +0 -827
  236. package/dist/ci-wait/tools.js +0 -208
  237. package/dist/ci-wait/tools.js.map +0 -1
  238. package/dist/config.d.ts +0 -68
  239. package/dist/config.js +0 -209
  240. package/dist/config.js.map +0 -1
  241. package/dist/contract/active-provider.d.ts +0 -12
  242. package/dist/contract/agent-config.d.ts +0 -160
  243. package/dist/contract/agent-profiles.d.ts +0 -369
  244. package/dist/contract/application-update.d.ts +0 -32
  245. package/dist/contract/artifacts.d.ts +0 -83
  246. package/dist/contract/ask-schema.d.ts +0 -50
  247. package/dist/contract/ask.d.ts +0 -9
  248. package/dist/contract/attachments.d.ts +0 -35
  249. package/dist/contract/attention.d.ts +0 -90
  250. package/dist/contract/automation-requests.d.ts +0 -308
  251. package/dist/contract/automation-schedule.d.ts +0 -89
  252. package/dist/contract/automation-storage.d.ts +0 -512
  253. package/dist/contract/automations.d.ts +0 -1542
  254. package/dist/contract/ci-wait.d.ts +0 -222
  255. package/dist/contract/config-requests.d.ts +0 -36
  256. package/dist/contract/conversations.d.ts +0 -351
  257. package/dist/contract/defined.d.ts +0 -8
  258. package/dist/contract/delegation.d.ts +0 -1882
  259. package/dist/contract/discovery.d.ts +0 -141
  260. package/dist/contract/effort.d.ts +0 -18
  261. package/dist/contract/events.d.ts +0 -292
  262. package/dist/contract/github-requests.d.ts +0 -26
  263. package/dist/contract/github.d.ts +0 -732
  264. package/dist/contract/handoff.d.ts +0 -43
  265. package/dist/contract/health.d.ts +0 -124
  266. package/dist/contract/image-path.d.ts +0 -6
  267. package/dist/contract/index.d.ts +0 -59
  268. package/dist/contract/index.js +0 -5887
  269. package/dist/contract/live-coordination.d.ts +0 -158
  270. package/dist/contract/live-limits.d.ts +0 -8
  271. package/dist/contract/live.d.ts +0 -123
  272. package/dist/contract/pending-ask.d.ts +0 -58
  273. package/dist/contract/permissions.d.ts +0 -54
  274. package/dist/contract/preview.d.ts +0 -541
  275. package/dist/contract/project-limits.d.ts +0 -33
  276. package/dist/contract/projects.d.ts +0 -716
  277. package/dist/contract/provider-requests.d.ts +0 -77
  278. package/dist/contract/query-requests.d.ts +0 -52
  279. package/dist/contract/repo-requests.d.ts +0 -12
  280. package/dist/contract/repo.d.ts +0 -496
  281. package/dist/contract/run-labels.d.ts +0 -8
  282. package/dist/contract/run-limits.d.ts +0 -8
  283. package/dist/contract/run-predicates.d.ts +0 -32
  284. package/dist/contract/run-requests.d.ts +0 -33
  285. package/dist/contract/run-search.d.ts +0 -193
  286. package/dist/contract/runs.d.ts +0 -5340
  287. package/dist/contract/scheduled-tasks.d.ts +0 -187
  288. package/dist/contract/skills.d.ts +0 -56
  289. package/dist/contract/team-skill-ref.d.ts +0 -10
  290. package/dist/contract/tool-display.d.ts +0 -25
  291. package/dist/contract/ui-state-requests.d.ts +0 -60
  292. package/dist/contract/version.d.ts +0 -3
  293. package/dist/contract/voice.d.ts +0 -213
  294. package/dist/contract/waits.d.ts +0 -1204
  295. package/dist/contract/workflow-file.d.ts +0 -37
  296. package/dist/contract/workflow-requests.d.ts +0 -7
  297. package/dist/contract/workflows.d.ts +0 -250
  298. package/dist/contract/workspace.d.ts +0 -631
  299. package/dist/contract/zoned-time.d.ts +0 -26
  300. package/dist/core/agent-env.d.ts +0 -30
  301. package/dist/core/agent-env.js +0 -400
  302. package/dist/core/agent-env.js.map +0 -1
  303. package/dist/core/agent-model-policy.d.ts +0 -10
  304. package/dist/core/agent-model-policy.js +0 -36
  305. package/dist/core/agent-model-policy.js.map +0 -1
  306. package/dist/core/agent-profiles.d.ts +0 -50
  307. package/dist/core/agent-profiles.js +0 -105
  308. package/dist/core/agent-profiles.js.map +0 -1
  309. package/dist/core/agent-runner.d.ts +0 -394
  310. package/dist/core/agent-runner.js +0 -96
  311. package/dist/core/agent-runner.js.map +0 -1
  312. package/dist/core/ask.d.ts +0 -79
  313. package/dist/core/ask.js +0 -232
  314. package/dist/core/ask.js.map +0 -1
  315. package/dist/core/backend-detect.d.ts +0 -17
  316. package/dist/core/backend-detect.js +0 -209
  317. package/dist/core/backend-detect.js.map +0 -1
  318. package/dist/core/claude-cli-runner.d.ts +0 -72
  319. package/dist/core/claude-cli-runner.js +0 -910
  320. package/dist/core/claude-cli-runner.js.map +0 -1
  321. package/dist/core/claude-model-catalog.d.ts +0 -16
  322. package/dist/core/claude-model-catalog.js +0 -198
  323. package/dist/core/claude-model-catalog.js.map +0 -1
  324. package/dist/core/claude-ui-mapper.d.ts +0 -80
  325. package/dist/core/claude-ui-mapper.js +0 -696
  326. package/dist/core/claude-ui-mapper.js.map +0 -1
  327. package/dist/core/codex-app-server-runner.d.ts +0 -61
  328. package/dist/core/codex-app-server-runner.js +0 -1278
  329. package/dist/core/codex-app-server-runner.js.map +0 -1
  330. package/dist/core/codex-app-server-transport.d.ts +0 -52
  331. package/dist/core/codex-app-server-transport.js +0 -199
  332. package/dist/core/codex-app-server-transport.js.map +0 -1
  333. package/dist/core/codex-approvals.d.ts +0 -12
  334. package/dist/core/codex-approvals.js +0 -161
  335. package/dist/core/codex-approvals.js.map +0 -1
  336. package/dist/core/codex-model-catalog.d.ts +0 -10
  337. package/dist/core/codex-model-catalog.js +0 -110
  338. package/dist/core/codex-model-catalog.js.map +0 -1
  339. package/dist/core/codex-permissions.d.ts +0 -6
  340. package/dist/core/codex-permissions.js +0 -27
  341. package/dist/core/codex-permissions.js.map +0 -1
  342. package/dist/core/codex-stream-error.d.ts +0 -2
  343. package/dist/core/codex-stream-error.js +0 -12
  344. package/dist/core/codex-stream-error.js.map +0 -1
  345. package/dist/core/codex-turn-outcome.d.ts +0 -8
  346. package/dist/core/codex-turn-outcome.js +0 -30
  347. package/dist/core/codex-turn-outcome.js.map +0 -1
  348. package/dist/core/codex-ui-mapper.d.ts +0 -112
  349. package/dist/core/codex-ui-mapper.js +0 -808
  350. package/dist/core/codex-ui-mapper.js.map +0 -1
  351. package/dist/core/cursor-acp-runner.d.ts +0 -34
  352. package/dist/core/cursor-acp-runner.js +0 -777
  353. package/dist/core/cursor-acp-runner.js.map +0 -1
  354. package/dist/core/cursor-cli-flags.d.ts +0 -19
  355. package/dist/core/cursor-cli-flags.js +0 -47
  356. package/dist/core/cursor-cli-flags.js.map +0 -1
  357. package/dist/core/cursor-config-options.d.ts +0 -18
  358. package/dist/core/cursor-config-options.js +0 -31
  359. package/dist/core/cursor-config-options.js.map +0 -1
  360. package/dist/core/cursor-model-catalog.d.ts +0 -45
  361. package/dist/core/cursor-model-catalog.js +0 -300
  362. package/dist/core/cursor-model-catalog.js.map +0 -1
  363. package/dist/core/cursor-print-capabilities.d.ts +0 -16
  364. package/dist/core/cursor-print-capabilities.js +0 -141
  365. package/dist/core/cursor-print-capabilities.js.map +0 -1
  366. package/dist/core/cursor-print-process.d.ts +0 -31
  367. package/dist/core/cursor-print-process.js +0 -117
  368. package/dist/core/cursor-print-process.js.map +0 -1
  369. package/dist/core/cursor-print-runner.d.ts +0 -31
  370. package/dist/core/cursor-print-runner.js +0 -555
  371. package/dist/core/cursor-print-runner.js.map +0 -1
  372. package/dist/core/cursor-print-tool-catalog.d.ts +0 -10
  373. package/dist/core/cursor-print-tool-catalog.js +0 -91
  374. package/dist/core/cursor-print-tool-catalog.js.map +0 -1
  375. package/dist/core/cursor-print-ui-mapper.d.ts +0 -47
  376. package/dist/core/cursor-print-ui-mapper.js +0 -553
  377. package/dist/core/cursor-print-ui-mapper.js.map +0 -1
  378. package/dist/core/cursor-provider-error.d.ts +0 -33
  379. package/dist/core/cursor-provider-error.js +0 -68
  380. package/dist/core/cursor-provider-error.js.map +0 -1
  381. package/dist/core/cursor-runner.d.ts +0 -24
  382. package/dist/core/cursor-runner.js +0 -149
  383. package/dist/core/cursor-runner.js.map +0 -1
  384. package/dist/core/cursor-ui-mapper.d.ts +0 -29
  385. package/dist/core/cursor-ui-mapper.js +0 -275
  386. package/dist/core/cursor-ui-mapper.js.map +0 -1
  387. package/dist/core/defined.d.ts +0 -1
  388. package/dist/core/defined.js +0 -2
  389. package/dist/core/defined.js.map +0 -1
  390. package/dist/core/hook-items.d.ts +0 -14
  391. package/dist/core/hook-items.js +0 -13
  392. package/dist/core/hook-items.js.map +0 -1
  393. package/dist/core/host-model-catalog.d.ts +0 -7
  394. package/dist/core/host-model-catalog.js +0 -21
  395. package/dist/core/host-model-catalog.js.map +0 -1
  396. package/dist/core/input-submissions.d.ts +0 -14
  397. package/dist/core/input-submissions.js +0 -26
  398. package/dist/core/input-submissions.js.map +0 -1
  399. package/dist/core/managed-session.d.ts +0 -6
  400. package/dist/core/managed-session.js +0 -116
  401. package/dist/core/managed-session.js.map +0 -1
  402. package/dist/core/model-identity.d.ts +0 -108
  403. package/dist/core/model-identity.js +0 -137
  404. package/dist/core/model-identity.js.map +0 -1
  405. package/dist/core/model-presets.d.ts +0 -10
  406. package/dist/core/model-presets.js +0 -77
  407. package/dist/core/model-presets.js.map +0 -1
  408. package/dist/core/ndjson.d.ts +0 -6
  409. package/dist/core/ndjson.js +0 -23
  410. package/dist/core/ndjson.js.map +0 -1
  411. package/dist/core/omp-model-catalog.d.ts +0 -43
  412. package/dist/core/omp-model-catalog.js +0 -205
  413. package/dist/core/omp-model-catalog.js.map +0 -1
  414. package/dist/core/omp-runner.d.ts +0 -72
  415. package/dist/core/omp-runner.js +0 -1049
  416. package/dist/core/omp-runner.js.map +0 -1
  417. package/dist/core/omp-ui-mapper.d.ts +0 -106
  418. package/dist/core/omp-ui-mapper.js +0 -882
  419. package/dist/core/omp-ui-mapper.js.map +0 -1
  420. package/dist/core/opencode-model-catalog.d.ts +0 -32
  421. package/dist/core/opencode-model-catalog.js +0 -215
  422. package/dist/core/opencode-model-catalog.js.map +0 -1
  423. package/dist/core/opencode-permissions.d.ts +0 -52
  424. package/dist/core/opencode-permissions.js +0 -101
  425. package/dist/core/opencode-permissions.js.map +0 -1
  426. package/dist/core/opencode-server-runner.d.ts +0 -61
  427. package/dist/core/opencode-server-runner.js +0 -1692
  428. package/dist/core/opencode-server-runner.js.map +0 -1
  429. package/dist/core/opencode-session-error.d.ts +0 -19
  430. package/dist/core/opencode-session-error.js +0 -42
  431. package/dist/core/opencode-session-error.js.map +0 -1
  432. package/dist/core/opencode-ui-mapper.d.ts +0 -137
  433. package/dist/core/opencode-ui-mapper.js +0 -768
  434. package/dist/core/opencode-ui-mapper.js.map +0 -1
  435. package/dist/core/pi-model-catalog.d.ts +0 -38
  436. package/dist/core/pi-model-catalog.js +0 -249
  437. package/dist/core/pi-model-catalog.js.map +0 -1
  438. package/dist/core/pi-runner.d.ts +0 -43
  439. package/dist/core/pi-runner.js +0 -827
  440. package/dist/core/pi-runner.js.map +0 -1
  441. package/dist/core/pi-ui-mapper.d.ts +0 -52
  442. package/dist/core/pi-ui-mapper.js +0 -395
  443. package/dist/core/pi-ui-mapper.js.map +0 -1
  444. package/dist/core/process-usage.d.ts +0 -74
  445. package/dist/core/process-usage.js +0 -218
  446. package/dist/core/process-usage.js.map +0 -1
  447. package/dist/core/provider-auth.d.ts +0 -168
  448. package/dist/core/provider-auth.js +0 -660
  449. package/dist/core/provider-auth.js.map +0 -1
  450. package/dist/core/provider-availability.d.ts +0 -3
  451. package/dist/core/provider-availability.js +0 -14
  452. package/dist/core/provider-availability.js.map +0 -1
  453. package/dist/core/runner-factory.d.ts +0 -11
  454. package/dist/core/runner-factory.js +0 -31
  455. package/dist/core/runner-factory.js.map +0 -1
  456. package/dist/core/runner-model-catalog.d.ts +0 -34
  457. package/dist/core/runner-model-catalog.js +0 -109
  458. package/dist/core/runner-model-catalog.js.map +0 -1
  459. package/dist/core/runner-runtime.d.ts +0 -40
  460. package/dist/core/runner-runtime.js +0 -88
  461. package/dist/core/runner-runtime.js.map +0 -1
  462. package/dist/core/runner-stderr.d.ts +0 -2
  463. package/dist/core/runner-stderr.js +0 -20
  464. package/dist/core/runner-stderr.js.map +0 -1
  465. package/dist/core/runner-tool-grants.d.ts +0 -21
  466. package/dist/core/runner-tool-grants.js +0 -64
  467. package/dist/core/runner-tool-grants.js.map +0 -1
  468. package/dist/core/secret-redaction.d.ts +0 -20
  469. package/dist/core/secret-redaction.js +0 -98
  470. package/dist/core/secret-redaction.js.map +0 -1
  471. package/dist/core/session-process.d.ts +0 -42
  472. package/dist/core/session-process.js +0 -360
  473. package/dist/core/session-process.js.map +0 -1
  474. package/dist/core/shell-env.d.ts +0 -17
  475. package/dist/core/shell-env.js +0 -51
  476. package/dist/core/shell-env.js.map +0 -1
  477. package/dist/core/ui-events.d.ts +0 -348
  478. package/dist/core/ui-events.js +0 -2
  479. package/dist/core/ui-events.js.map +0 -1
  480. package/dist/core/usage-limit.d.ts +0 -42
  481. package/dist/core/usage-limit.js +0 -152
  482. package/dist/core/usage-limit.js.map +0 -1
  483. package/dist/core/usage.d.ts +0 -11
  484. package/dist/core/usage.js +0 -15
  485. package/dist/core/usage.js.map +0 -1
  486. package/dist/core/v1-text-coalescer.d.ts +0 -36
  487. package/dist/core/v1-text-coalescer.js +0 -72
  488. package/dist/core/v1-text-coalescer.js.map +0 -1
  489. package/dist/data-gitignore.d.ts +0 -6
  490. package/dist/data-gitignore.js +0 -59
  491. package/dist/data-gitignore.js.map +0 -1
  492. package/dist/delegation/capacity.d.ts +0 -15
  493. package/dist/delegation/capacity.js +0 -30
  494. package/dist/delegation/capacity.js.map +0 -1
  495. package/dist/delegation/cli.d.ts +0 -4
  496. package/dist/delegation/cli.js +0 -481
  497. package/dist/delegation/cli.js.map +0 -1
  498. package/dist/delegation/context.d.ts +0 -40
  499. package/dist/delegation/context.js +0 -378
  500. package/dist/delegation/context.js.map +0 -1
  501. package/dist/delegation/conversations.d.ts +0 -9
  502. package/dist/delegation/conversations.js +0 -66
  503. package/dist/delegation/conversations.js.map +0 -1
  504. package/dist/delegation/credentials.d.ts +0 -21
  505. package/dist/delegation/credentials.js +0 -66
  506. package/dist/delegation/credentials.js.map +0 -1
  507. package/dist/delegation/destroy-observation.d.ts +0 -42
  508. package/dist/delegation/destroy-observation.js +0 -115
  509. package/dist/delegation/destroy-observation.js.map +0 -1
  510. package/dist/delegation/effort.d.ts +0 -1
  511. package/dist/delegation/effort.js +0 -11
  512. package/dist/delegation/effort.js.map +0 -1
  513. package/dist/delegation/execution-identity.d.ts +0 -180
  514. package/dist/delegation/execution-identity.js +0 -154
  515. package/dist/delegation/execution-identity.js.map +0 -1
  516. package/dist/delegation/idle-test-app.d.ts +0 -4
  517. package/dist/delegation/idle-test-app.js +0 -174
  518. package/dist/delegation/idle-test-app.js.map +0 -1
  519. package/dist/delegation/input.d.ts +0 -12
  520. package/dist/delegation/input.js +0 -50
  521. package/dist/delegation/input.js.map +0 -1
  522. package/dist/delegation/park-notice.d.ts +0 -42
  523. package/dist/delegation/park-notice.js +0 -71
  524. package/dist/delegation/park-notice.js.map +0 -1
  525. package/dist/delegation/policy.d.ts +0 -22
  526. package/dist/delegation/policy.js +0 -95
  527. package/dist/delegation/policy.js.map +0 -1
  528. package/dist/delegation/process-liveness.d.ts +0 -98
  529. package/dist/delegation/process-liveness.js +0 -213
  530. package/dist/delegation/process-liveness.js.map +0 -1
  531. package/dist/delegation/provision.d.ts +0 -32
  532. package/dist/delegation/provision.js +0 -177
  533. package/dist/delegation/provision.js.map +0 -1
  534. package/dist/delegation/questions.d.ts +0 -21
  535. package/dist/delegation/questions.js +0 -50
  536. package/dist/delegation/questions.js.map +0 -1
  537. package/dist/delegation/readiness.d.ts +0 -13
  538. package/dist/delegation/readiness.js +0 -19
  539. package/dist/delegation/readiness.js.map +0 -1
  540. package/dist/delegation/results.d.ts +0 -13
  541. package/dist/delegation/results.js +0 -154
  542. package/dist/delegation/results.js.map +0 -1
  543. package/dist/delegation/retry-backoff.d.ts +0 -31
  544. package/dist/delegation/retry-backoff.js +0 -26
  545. package/dist/delegation/retry-backoff.js.map +0 -1
  546. package/dist/delegation/routes.d.ts +0 -953
  547. package/dist/delegation/routes.js +0 -74
  548. package/dist/delegation/routes.js.map +0 -1
  549. package/dist/delegation/scratch-cleanup.d.ts +0 -28
  550. package/dist/delegation/scratch-cleanup.js +0 -145
  551. package/dist/delegation/scratch-cleanup.js.map +0 -1
  552. package/dist/delegation/service.d.ts +0 -211
  553. package/dist/delegation/service.js +0 -946
  554. package/dist/delegation/service.js.map +0 -1
  555. package/dist/delegation/transport.d.ts +0 -931
  556. package/dist/delegation/transport.js +0 -22
  557. package/dist/delegation/transport.js.map +0 -1
  558. package/dist/delegation/wait.d.ts +0 -14
  559. package/dist/delegation/wait.js +0 -72
  560. package/dist/delegation/wait.js.map +0 -1
  561. package/dist/delegation/windows-test-app.d.ts +0 -5
  562. package/dist/delegation/windows-test-app.js +0 -63
  563. package/dist/delegation/windows-test-app.js.map +0 -1
  564. package/dist/delegation/windows-workspace-identity.d.ts +0 -3
  565. package/dist/delegation/windows-workspace-identity.js +0 -22
  566. package/dist/delegation/windows-workspace-identity.js.map +0 -1
  567. package/dist/delegation/workspace.d.ts +0 -33
  568. package/dist/delegation/workspace.js +0 -556
  569. package/dist/delegation/workspace.js.map +0 -1
  570. package/dist/detached-process.d.ts +0 -103
  571. package/dist/detached-process.js +0 -301
  572. package/dist/detached-process.js.map +0 -1
  573. package/dist/discovery/catalog.d.ts +0 -15
  574. package/dist/discovery/catalog.js +0 -31
  575. package/dist/discovery/catalog.js.map +0 -1
  576. package/dist/discovery/cli.d.ts +0 -8
  577. package/dist/discovery/cli.js +0 -106
  578. package/dist/discovery/cli.js.map +0 -1
  579. package/dist/git-diff-base.d.ts +0 -41
  580. package/dist/git-diff-base.js +0 -116
  581. package/dist/git-diff-base.js.map +0 -1
  582. package/dist/git-index-copy.d.ts +0 -4
  583. package/dist/git-index-copy.js +0 -10
  584. package/dist/git-index-copy.js.map +0 -1
  585. package/dist/git-refs.d.ts +0 -11
  586. package/dist/git-refs.js +0 -14
  587. package/dist/git-refs.js.map +0 -1
  588. package/dist/git-worktree-lock-helper.d.ts +0 -7
  589. package/dist/git-worktree-lock-helper.js +0 -158
  590. package/dist/git-worktree-lock-helper.js.map +0 -1
  591. package/dist/git-worktree-lock.d.ts +0 -17
  592. package/dist/git-worktree-lock.js +0 -90
  593. package/dist/git-worktree-lock.js.map +0 -1
  594. package/dist/git-worktree-release.d.ts +0 -20
  595. package/dist/git-worktree-release.js +0 -27
  596. package/dist/git-worktree-release.js.map +0 -1
  597. package/dist/git-worktree.d.ts +0 -154
  598. package/dist/git-worktree.js +0 -858
  599. package/dist/git-worktree.js.map +0 -1
  600. package/dist/handoff.d.ts +0 -72
  601. package/dist/handoff.js +0 -206
  602. package/dist/handoff.js.map +0 -1
  603. package/dist/index.d.ts +0 -2
  604. package/dist/index.js.map +0 -1
  605. package/dist/install-as-command.d.ts +0 -40
  606. package/dist/install-as-command.js +0 -52
  607. package/dist/install-as-command.js.map +0 -1
  608. package/dist/merge-observations.d.ts +0 -13
  609. package/dist/merge-observations.js +0 -55
  610. package/dist/merge-observations.js.map +0 -1
  611. package/dist/open-url.d.ts +0 -2
  612. package/dist/open-url.js +0 -10
  613. package/dist/open-url.js.map +0 -1
  614. package/dist/pack-check.d.ts +0 -17
  615. package/dist/pack-check.js +0 -27
  616. package/dist/pack-check.js.map +0 -1
  617. package/dist/paths.d.ts +0 -138
  618. package/dist/paths.js +0 -220
  619. package/dist/paths.js.map +0 -1
  620. package/dist/planner.d.ts +0 -28
  621. package/dist/planner.js +0 -271
  622. package/dist/planner.js.map +0 -1
  623. package/dist/preview/agent-address.d.ts +0 -34
  624. package/dist/preview/agent-address.js +0 -51
  625. package/dist/preview/agent-address.js.map +0 -1
  626. package/dist/preview/agent-marker.d.ts +0 -17
  627. package/dist/preview/agent-marker.js +0 -71
  628. package/dist/preview/agent-marker.js.map +0 -1
  629. package/dist/preview/cdp-proxy.d.ts +0 -54
  630. package/dist/preview/cdp-proxy.js +0 -151
  631. package/dist/preview/cdp-proxy.js.map +0 -1
  632. package/dist/preview/cdp.d.ts +0 -49
  633. package/dist/preview/cdp.js +0 -167
  634. package/dist/preview/cdp.js.map +0 -1
  635. package/dist/preview/chromium.d.ts +0 -87
  636. package/dist/preview/chromium.js +0 -481
  637. package/dist/preview/chromium.js.map +0 -1
  638. package/dist/preview/dev-server.d.ts +0 -68
  639. package/dist/preview/dev-server.js +0 -317
  640. package/dist/preview/dev-server.js.map +0 -1
  641. package/dist/preview/host.d.ts +0 -221
  642. package/dist/preview/host.js +0 -967
  643. package/dist/preview/host.js.map +0 -1
  644. package/dist/preview/registration.d.ts +0 -68
  645. package/dist/preview/registration.js +0 -111
  646. package/dist/preview/registration.js.map +0 -1
  647. package/dist/preview/session.d.ts +0 -75
  648. package/dist/preview/session.js +0 -357
  649. package/dist/preview/session.js.map +0 -1
  650. package/dist/preview/url.d.ts +0 -6
  651. package/dist/preview/url.js +0 -17
  652. package/dist/preview/url.js.map +0 -1
  653. package/dist/process-wait/exit-file.d.ts +0 -29
  654. package/dist/process-wait/exit-file.js +0 -67
  655. package/dist/process-wait/exit-file.js.map +0 -1
  656. package/dist/process-wait/supervisor.d.ts +0 -30
  657. package/dist/process-wait/supervisor.js +0 -71
  658. package/dist/process-wait/supervisor.js.map +0 -1
  659. package/dist/release/manifests.d.ts +0 -103
  660. package/dist/release/manifests.js +0 -90
  661. package/dist/release/manifests.js.map +0 -1
  662. package/dist/release/snapshot.d.ts +0 -67
  663. package/dist/release/snapshot.js +0 -97
  664. package/dist/release/snapshot.js.map +0 -1
  665. package/dist/release/stable.d.ts +0 -38
  666. package/dist/release/stable.js +0 -55
  667. package/dist/release/stable.js.map +0 -1
  668. package/dist/runs/agent-tmpdir-removal.d.ts +0 -15
  669. package/dist/runs/agent-tmpdir-removal.js +0 -60
  670. package/dist/runs/agent-tmpdir-removal.js.map +0 -1
  671. package/dist/runs/agent-tmpdir.d.ts +0 -119
  672. package/dist/runs/agent-tmpdir.js +0 -829
  673. package/dist/runs/agent-tmpdir.js.map +0 -1
  674. package/dist/runs/arm-repo-handle.d.ts +0 -9
  675. package/dist/runs/arm-repo-handle.js +0 -45
  676. package/dist/runs/arm-repo-handle.js.map +0 -1
  677. package/dist/runs/auto-name.d.ts +0 -75
  678. package/dist/runs/auto-name.js +0 -179
  679. package/dist/runs/auto-name.js.map +0 -1
  680. package/dist/runs/client-request.d.ts +0 -11
  681. package/dist/runs/client-request.js +0 -26
  682. package/dist/runs/client-request.js.map +0 -1
  683. package/dist/runs/delegation-state.d.ts +0 -400
  684. package/dist/runs/delegation-state.js +0 -22
  685. package/dist/runs/delegation-state.js.map +0 -1
  686. package/dist/runs/event-history-agent-context.d.ts +0 -14
  687. package/dist/runs/event-history-agent-context.js +0 -105
  688. package/dist/runs/event-history-agent-context.js.map +0 -1
  689. package/dist/runs/event-history-context.d.ts +0 -15
  690. package/dist/runs/event-history-context.js +0 -109
  691. package/dist/runs/event-history-context.js.map +0 -1
  692. package/dist/runs/event-history.d.ts +0 -53
  693. package/dist/runs/event-history.js +0 -535
  694. package/dist/runs/event-history.js.map +0 -1
  695. package/dist/runs/history-compressor.d.ts +0 -29
  696. package/dist/runs/history-compressor.js +0 -116
  697. package/dist/runs/history-compressor.js.map +0 -1
  698. package/dist/runs/history-file.d.ts +0 -36
  699. package/dist/runs/history-file.js +0 -463
  700. package/dist/runs/history-file.js.map +0 -1
  701. package/dist/runs/history-stream.d.ts +0 -2
  702. package/dist/runs/history-stream.js +0 -62
  703. package/dist/runs/history-stream.js.map +0 -1
  704. package/dist/runs/legacy-index.d.ts +0 -49
  705. package/dist/runs/legacy-index.js +0 -155
  706. package/dist/runs/legacy-index.js.map +0 -1
  707. package/dist/runs/live-item-snapshots.d.ts +0 -13
  708. package/dist/runs/live-item-snapshots.js +0 -79
  709. package/dist/runs/live-item-snapshots.js.map +0 -1
  710. package/dist/runs/loaded-run-healing.d.ts +0 -3
  711. package/dist/runs/loaded-run-healing.js +0 -17
  712. package/dist/runs/loaded-run-healing.js.map +0 -1
  713. package/dist/runs/outcome-commit.d.ts +0 -98
  714. package/dist/runs/outcome-commit.js +0 -132
  715. package/dist/runs/outcome-commit.js.map +0 -1
  716. package/dist/runs/pull-requests.d.ts +0 -14
  717. package/dist/runs/pull-requests.js +0 -96
  718. package/dist/runs/pull-requests.js.map +0 -1
  719. package/dist/runs/raw-record.d.ts +0 -40
  720. package/dist/runs/raw-record.js +0 -133
  721. package/dist/runs/raw-record.js.map +0 -1
  722. package/dist/runs/retention.d.ts +0 -91
  723. package/dist/runs/retention.js +0 -182
  724. package/dist/runs/retention.js.map +0 -1
  725. package/dist/runs/review-gate.d.ts +0 -18
  726. package/dist/runs/review-gate.js +0 -21
  727. package/dist/runs/review-gate.js.map +0 -1
  728. package/dist/runs/run-claims.d.ts +0 -16
  729. package/dist/runs/run-claims.js +0 -24
  730. package/dist/runs/run-claims.js.map +0 -1
  731. package/dist/runs/run-database.d.ts +0 -380
  732. package/dist/runs/run-database.js +0 -1008
  733. package/dist/runs/run-database.js.map +0 -1
  734. package/dist/runs/run-index.d.ts +0 -26
  735. package/dist/runs/run-index.js +0 -212
  736. package/dist/runs/run-index.js.map +0 -1
  737. package/dist/runs/run-row.d.ts +0 -15
  738. package/dist/runs/run-row.js +0 -59
  739. package/dist/runs/run-row.js.map +0 -1
  740. package/dist/runs/store-open-error.d.ts +0 -24
  741. package/dist/runs/store-open-error.js +0 -61
  742. package/dist/runs/store-open-error.js.map +0 -1
  743. package/dist/runs/store.d.ts +0 -3090
  744. package/dist/runs/store.js +0 -4693
  745. package/dist/runs/store.js.map +0 -1
  746. package/dist/runs/task-markers.d.ts +0 -29
  747. package/dist/runs/task-markers.js +0 -78
  748. package/dist/runs/task-markers.js.map +0 -1
  749. package/dist/runs/task-refs.d.ts +0 -25
  750. package/dist/runs/task-refs.js +0 -74
  751. package/dist/runs/task-refs.js.map +0 -1
  752. package/dist/runs/transcript-facts-fold.d.ts +0 -64
  753. package/dist/runs/transcript-facts-fold.js +0 -109
  754. package/dist/runs/transcript-facts-fold.js.map +0 -1
  755. package/dist/runs/transcript-facts-load.d.ts +0 -11
  756. package/dist/runs/transcript-facts-load.js +0 -66
  757. package/dist/runs/transcript-facts-load.js.map +0 -1
  758. package/dist/runs/transcript-facts-queue.d.ts +0 -30
  759. package/dist/runs/transcript-facts-queue.js +0 -227
  760. package/dist/runs/transcript-facts-queue.js.map +0 -1
  761. package/dist/runs/transcript-facts-worker.d.ts +0 -15
  762. package/dist/runs/transcript-facts-worker.js +0 -26
  763. package/dist/runs/transcript-facts-worker.js.map +0 -1
  764. package/dist/runs/transcript-facts.d.ts +0 -39
  765. package/dist/runs/transcript-facts.js +0 -186
  766. package/dist/runs/transcript-facts.js.map +0 -1
  767. package/dist/runs/ui-event-sink.d.ts +0 -56
  768. package/dist/runs/ui-event-sink.js +0 -188
  769. package/dist/runs/ui-event-sink.js.map +0 -1
  770. package/dist/runs/webhook.d.ts +0 -191
  771. package/dist/runs/webhook.js +0 -360
  772. package/dist/runs/webhook.js.map +0 -1
  773. package/dist/runs/worker-execution.d.ts +0 -22
  774. package/dist/runs/worker-execution.js +0 -30
  775. package/dist/runs/worker-execution.js.map +0 -1
  776. package/dist/server/app-type.js.map +0 -1
  777. package/dist/server/archive-on-merge.d.ts +0 -35
  778. package/dist/server/archive-on-merge.js +0 -202
  779. package/dist/server/archive-on-merge.js.map +0 -1
  780. package/dist/server/capabilities.d.ts +0 -59
  781. package/dist/server/capabilities.js +0 -141
  782. package/dist/server/capabilities.js.map +0 -1
  783. package/dist/server/checkout-progress.d.ts +0 -10
  784. package/dist/server/checkout-progress.js +0 -27
  785. package/dist/server/checkout-progress.js.map +0 -1
  786. package/dist/server/checkout.d.ts +0 -129
  787. package/dist/server/checkout.js +0 -304
  788. package/dist/server/checkout.js.map +0 -1
  789. package/dist/server/cockpit-ownership.d.ts +0 -31
  790. package/dist/server/cockpit-ownership.js +0 -191
  791. package/dist/server/cockpit-ownership.js.map +0 -1
  792. package/dist/server/cold-repo-handles.d.ts +0 -14
  793. package/dist/server/cold-repo-handles.js +0 -78
  794. package/dist/server/cold-repo-handles.js.map +0 -1
  795. package/dist/server/completion-actions.d.ts +0 -30
  796. package/dist/server/completion-actions.js +0 -204
  797. package/dist/server/completion-actions.js.map +0 -1
  798. package/dist/server/create-project.d.ts +0 -71
  799. package/dist/server/create-project.js +0 -448
  800. package/dist/server/create-project.js.map +0 -1
  801. package/dist/server/forge/github-filters.d.ts +0 -22
  802. package/dist/server/forge/github-filters.js +0 -127
  803. package/dist/server/forge/github-filters.js.map +0 -1
  804. package/dist/server/forge/github-merge-requirements.d.ts +0 -18
  805. package/dist/server/forge/github-merge-requirements.js +0 -137
  806. package/dist/server/forge/github-merge-requirements.js.map +0 -1
  807. package/dist/server/forge/github.d.ts +0 -535
  808. package/dist/server/forge/github.js +0 -3200
  809. package/dist/server/forge/github.js.map +0 -1
  810. package/dist/server/forge/index.d.ts +0 -40
  811. package/dist/server/forge/index.js +0 -72
  812. package/dist/server/forge/index.js.map +0 -1
  813. package/dist/server/forge/types.d.ts +0 -244
  814. package/dist/server/forge/types.js +0 -2
  815. package/dist/server/forge/types.js.map +0 -1
  816. package/dist/server/fs-browse.d.ts +0 -80
  817. package/dist/server/fs-browse.js +0 -182
  818. package/dist/server/fs-browse.js.map +0 -1
  819. package/dist/server/git-changes.d.ts +0 -203
  820. package/dist/server/git-changes.js +0 -508
  821. package/dist/server/git-changes.js.map +0 -1
  822. package/dist/server/git.d.ts +0 -52
  823. package/dist/server/git.js +0 -170
  824. package/dist/server/git.js.map +0 -1
  825. package/dist/server/github.d.ts +0 -9
  826. package/dist/server/github.js +0 -8
  827. package/dist/server/github.js.map +0 -1
  828. package/dist/server/launch-key.d.ts +0 -5
  829. package/dist/server/launch-key.js +0 -31
  830. package/dist/server/launch-key.js.map +0 -1
  831. package/dist/server/live-routes.d.ts +0 -68
  832. package/dist/server/live-routes.js +0 -147
  833. package/dist/server/live-routes.js.map +0 -1
  834. package/dist/server/open-in-app.d.ts +0 -57
  835. package/dist/server/open-in-app.js +0 -177
  836. package/dist/server/open-in-app.js.map +0 -1
  837. package/dist/server/open-in-targets.d.ts +0 -42
  838. package/dist/server/open-in-targets.js +0 -110
  839. package/dist/server/open-in-targets.js.map +0 -1
  840. package/dist/server/open-in-terminal.d.ts +0 -73
  841. package/dist/server/open-in-terminal.js +0 -159
  842. package/dist/server/open-in-terminal.js.map +0 -1
  843. package/dist/server/pr.d.ts +0 -7
  844. package/dist/server/pr.js +0 -7
  845. package/dist/server/pr.js.map +0 -1
  846. package/dist/server/preview-cdp-socket.d.ts +0 -21
  847. package/dist/server/preview-cdp-socket.js +0 -112
  848. package/dist/server/preview-cdp-socket.js.map +0 -1
  849. package/dist/server/preview-socket.d.ts +0 -36
  850. package/dist/server/preview-socket.js +0 -126
  851. package/dist/server/preview-socket.js.map +0 -1
  852. package/dist/server/preview-sockets.d.ts +0 -14
  853. package/dist/server/preview-sockets.js +0 -18
  854. package/dist/server/preview-sockets.js.map +0 -1
  855. package/dist/server/project-context.d.ts +0 -192
  856. package/dist/server/project-context.js +0 -444
  857. package/dist/server/project-context.js.map +0 -1
  858. package/dist/server/provider-action-gate.d.ts +0 -5
  859. package/dist/server/provider-action-gate.js +0 -27
  860. package/dist/server/provider-action-gate.js.map +0 -1
  861. package/dist/server/provider-auth-runtime.d.ts +0 -32
  862. package/dist/server/provider-auth-runtime.js +0 -116
  863. package/dist/server/provider-auth-runtime.js.map +0 -1
  864. package/dist/server/repo-branches.d.ts +0 -99
  865. package/dist/server/repo-branches.js +0 -620
  866. package/dist/server/repo-branches.js.map +0 -1
  867. package/dist/server/repo-pull.d.ts +0 -18
  868. package/dist/server/repo-pull.js +0 -96
  869. package/dist/server/repo-pull.js.map +0 -1
  870. package/dist/server/run-event-feed.d.ts +0 -20
  871. package/dist/server/run-event-feed.js +0 -190
  872. package/dist/server/run-event-feed.js.map +0 -1
  873. package/dist/server/server-deps.d.ts +0 -37
  874. package/dist/server/server-deps.js +0 -114
  875. package/dist/server/server-deps.js.map +0 -1
  876. package/dist/server/server.d.ts +0 -28587
  877. package/dist/server/server.js +0 -5466
  878. package/dist/server/server.js.map +0 -1
  879. package/dist/server/start-run-options.d.ts +0 -82
  880. package/dist/server/start-run-options.js +0 -111
  881. package/dist/server/start-run-options.js.map +0 -1
  882. package/dist/server/static-ui.d.ts +0 -49
  883. package/dist/server/static-ui.js +0 -98
  884. package/dist/server/static-ui.js.map +0 -1
  885. package/dist/server/upgrade-router.d.ts +0 -23
  886. package/dist/server/upgrade-router.js +0 -53
  887. package/dist/server/upgrade-router.js.map +0 -1
  888. package/dist/server/validators.d.ts +0 -80
  889. package/dist/server/validators.js +0 -85
  890. package/dist/server/validators.js.map +0 -1
  891. package/dist/server/ws.d.ts +0 -65
  892. package/dist/server/ws.js +0 -200
  893. package/dist/server/ws.js.map +0 -1
  894. package/dist/server/wsl.d.ts +0 -25
  895. package/dist/server/wsl.js +0 -92
  896. package/dist/server/wsl.js.map +0 -1
  897. package/dist/server-install/engine.d.ts +0 -47
  898. package/dist/server-install/engine.js +0 -317
  899. package/dist/server-install/engine.js.map +0 -1
  900. package/dist/server-install/npx-cache.d.ts +0 -36
  901. package/dist/server-install/npx-cache.js +0 -104
  902. package/dist/server-install/npx-cache.js.map +0 -1
  903. package/dist/server-install/platforms/macosx-ngrok.d.ts +0 -6
  904. package/dist/server-install/platforms/macosx-ngrok.js +0 -371
  905. package/dist/server-install/platforms/macosx-ngrok.js.map +0 -1
  906. package/dist/server-install/platforms/ubuntu-vps.d.ts +0 -54
  907. package/dist/server-install/platforms/ubuntu-vps.js +0 -1066
  908. package/dist/server-install/platforms/ubuntu-vps.js.map +0 -1
  909. package/dist/server-install/state.d.ts +0 -50
  910. package/dist/server-install/state.js +0 -180
  911. package/dist/server-install/state.js.map +0 -1
  912. package/dist/server-install/steps.d.ts +0 -108
  913. package/dist/server-install/steps.js +0 -332
  914. package/dist/server-install/steps.js.map +0 -1
  915. package/dist/server-install/strategies.d.ts +0 -4
  916. package/dist/server-install/strategies.js +0 -20
  917. package/dist/server-install/strategies.js.map +0 -1
  918. package/dist/server-install/types.d.ts +0 -284
  919. package/dist/server-install/types.js +0 -118
  920. package/dist/server-install/types.js.map +0 -1
  921. package/dist/server-install/ui.d.ts +0 -36
  922. package/dist/server-install/ui.js +0 -130
  923. package/dist/server-install/ui.js.map +0 -1
  924. package/dist/session-context.d.ts +0 -64
  925. package/dist/session-context.js +0 -264
  926. package/dist/session-context.js.map +0 -1
  927. package/dist/skills-provision.d.ts +0 -62
  928. package/dist/skills-provision.js +0 -325
  929. package/dist/skills-provision.js.map +0 -1
  930. package/dist/skills-remote.d.ts +0 -129
  931. package/dist/skills-remote.js +0 -782
  932. package/dist/skills-remote.js.map +0 -1
  933. package/dist/skills.d.ts +0 -71
  934. package/dist/skills.js +0 -249
  935. package/dist/skills.js.map +0 -1
  936. package/dist/subcommands.d.ts +0 -11
  937. package/dist/subcommands.js +0 -24
  938. package/dist/subcommands.js.map +0 -1
  939. package/dist/task-cli/cli.d.ts +0 -38
  940. package/dist/task-cli/cli.js +0 -710
  941. package/dist/task-cli/cli.js.map +0 -1
  942. package/dist/task-cli/discovery.d.ts +0 -25
  943. package/dist/task-cli/discovery.js +0 -98
  944. package/dist/task-cli/discovery.js.map +0 -1
  945. package/dist/task-cli/hint.d.ts +0 -20
  946. package/dist/task-cli/hint.js +0 -14
  947. package/dist/task-cli/hint.js.map +0 -1
  948. package/dist/task-cli/http.d.ts +0 -49
  949. package/dist/task-cli/http.js +0 -109
  950. package/dist/task-cli/http.js.map +0 -1
  951. package/dist/task-cli/projections.d.ts +0 -68
  952. package/dist/task-cli/projections.js +0 -76
  953. package/dist/task-cli/projections.js.map +0 -1
  954. package/dist/task-cli/watch.d.ts +0 -119
  955. package/dist/task-cli/watch.js +0 -475
  956. package/dist/task-cli/watch.js.map +0 -1
  957. package/dist/ui-state.d.ts +0 -41
  958. package/dist/ui-state.js +0 -90
  959. package/dist/ui-state.js.map +0 -1
  960. package/dist/update-check.d.ts +0 -2
  961. package/dist/update-check.js +0 -26
  962. package/dist/update-check.js.map +0 -1
  963. package/dist/voice/decide.d.ts +0 -32
  964. package/dist/voice/decide.js +0 -297
  965. package/dist/voice/decide.js.map +0 -1
  966. package/dist/voice/decision-log.d.ts +0 -52
  967. package/dist/voice/decision-log.js +0 -107
  968. package/dist/voice/decision-log.js.map +0 -1
  969. package/dist/voice/engine.d.ts +0 -119
  970. package/dist/voice/engine.js +0 -60
  971. package/dist/voice/engine.js.map +0 -1
  972. package/dist/voice/fake-engine.d.ts +0 -10
  973. package/dist/voice/fake-engine.js +0 -192
  974. package/dist/voice/fake-engine.js.map +0 -1
  975. package/dist/voice/jev-engine.d.ts +0 -17
  976. package/dist/voice/jev-engine.js +0 -110
  977. package/dist/voice/jev-engine.js.map +0 -1
  978. package/dist/voice/pending-ask.d.ts +0 -17
  979. package/dist/voice/pending-ask.js +0 -50
  980. package/dist/voice/pending-ask.js.map +0 -1
  981. package/dist/voice/routes.d.ts +0 -115
  982. package/dist/voice/routes.js +0 -91
  983. package/dist/voice/routes.js.map +0 -1
  984. package/dist/voice/sentence.d.ts +0 -21
  985. package/dist/voice/sentence.js +0 -61
  986. package/dist/voice/sentence.js.map +0 -1
  987. package/dist/voice/thresholds.d.ts +0 -28
  988. package/dist/voice/thresholds.js +0 -29
  989. package/dist/voice/thresholds.js.map +0 -1
  990. package/dist/webhooks/cli.d.ts +0 -18
  991. package/dist/webhooks/cli.js +0 -145
  992. package/dist/webhooks/cli.js.map +0 -1
  993. package/dist/webhooks/prompt.d.ts +0 -5
  994. package/dist/webhooks/prompt.js +0 -26
  995. package/dist/webhooks/prompt.js.map +0 -1
  996. package/dist/workflows/active-run.d.ts +0 -167
  997. package/dist/workflows/active-run.js +0 -21
  998. package/dist/workflows/active-run.js.map +0 -1
  999. package/dist/workflows/attachment-path.d.ts +0 -6
  1000. package/dist/workflows/attachment-path.js +0 -40
  1001. package/dist/workflows/attachment-path.js.map +0 -1
  1002. package/dist/workflows/continuation-admission.d.ts +0 -913
  1003. package/dist/workflows/continuation-admission.js +0 -265
  1004. package/dist/workflows/continuation-admission.js.map +0 -1
  1005. package/dist/workflows/execution-account.d.ts +0 -13
  1006. package/dist/workflows/execution-account.js +0 -18
  1007. package/dist/workflows/execution-account.js.map +0 -1
  1008. package/dist/workflows/grouped-command.d.ts +0 -31
  1009. package/dist/workflows/grouped-command.js +0 -143
  1010. package/dist/workflows/grouped-command.js.map +0 -1
  1011. package/dist/workflows/input-acknowledgement.d.ts +0 -152
  1012. package/dist/workflows/input-acknowledgement.js +0 -38
  1013. package/dist/workflows/input-acknowledgement.js.map +0 -1
  1014. package/dist/workflows/line-order.d.ts +0 -5
  1015. package/dist/workflows/line-order.js +0 -25
  1016. package/dist/workflows/line-order.js.map +0 -1
  1017. package/dist/workflows/load.d.ts +0 -17
  1018. package/dist/workflows/load.js +0 -61
  1019. package/dist/workflows/load.js.map +0 -1
  1020. package/dist/workflows/outcome-batches.d.ts +0 -20
  1021. package/dist/workflows/outcome-batches.js +0 -25
  1022. package/dist/workflows/outcome-batches.js.map +0 -1
  1023. package/dist/workflows/question-routing.d.ts +0 -8
  1024. package/dist/workflows/question-routing.js +0 -18
  1025. package/dist/workflows/question-routing.js.map +0 -1
  1026. package/dist/workflows/run-scheduling.d.ts +0 -35
  1027. package/dist/workflows/run-scheduling.js +0 -61
  1028. package/dist/workflows/run-scheduling.js.map +0 -1
  1029. package/dist/workflows/run-states.d.ts +0 -190
  1030. package/dist/workflows/run-states.js +0 -295
  1031. package/dist/workflows/run-states.js.map +0 -1
  1032. package/dist/workflows/run.d.ts +0 -2405
  1033. package/dist/workflows/run.js +0 -10745
  1034. package/dist/workflows/run.js.map +0 -1
  1035. package/dist/workflows/turn-end.d.ts +0 -116
  1036. package/dist/workflows/turn-end.js +0 -68
  1037. package/dist/workflows/turn-end.js.map +0 -1
  1038. package/dist/workflows/types.d.ts +0 -83
  1039. package/dist/workflows/types.js +0 -192
  1040. package/dist/workflows/types.js.map +0 -1
  1041. package/dist/workflows/waits.d.ts +0 -74
  1042. package/dist/workflows/waits.js +0 -197
  1043. package/dist/workflows/waits.js.map +0 -1
  1044. package/dist/workspace/agent-accounts.d.ts +0 -128
  1045. package/dist/workspace/agent-accounts.js +0 -280
  1046. package/dist/workspace/agent-accounts.js.map +0 -1
  1047. package/dist/workspace/agent-profiles.d.ts +0 -124
  1048. package/dist/workspace/agent-profiles.js +0 -190
  1049. package/dist/workspace/agent-profiles.js.map +0 -1
  1050. package/dist/workspace/config.d.ts +0 -181
  1051. package/dist/workspace/config.js +0 -389
  1052. package/dist/workspace/config.js.map +0 -1
  1053. package/dist/workspace/migrations.d.ts +0 -35
  1054. package/dist/workspace/migrations.js +0 -147
  1055. package/dist/workspace/migrations.js.map +0 -1
  1056. package/dist/workspace/projects-cli.d.ts +0 -25
  1057. package/dist/workspace/projects-cli.js +0 -172
  1058. package/dist/workspace/projects-cli.js.map +0 -1
  1059. package/dist/workspace/projects.d.ts +0 -129
  1060. package/dist/workspace/projects.js +0 -267
  1061. package/dist/workspace/projects.js.map +0 -1
  1062. package/dist/workspace/semaphore.d.ts +0 -145
  1063. package/dist/workspace/semaphore.js +0 -196
  1064. package/dist/workspace/semaphore.js.map +0 -1
  1065. package/dist/workspace/ui-state.d.ts +0 -36
  1066. package/dist/workspace/ui-state.js +0 -55
  1067. package/dist/workspace/ui-state.js.map +0 -1
  1068. package/dist/workspace/webhooks.d.ts +0 -40
  1069. package/dist/workspace/webhooks.js +0 -146
  1070. package/dist/workspace/webhooks.js.map +0 -1
  1071. package/dist/worktree-manifest.d.ts +0 -165
  1072. package/dist/worktree-manifest.js +0 -530
  1073. package/dist/worktree-manifest.js.map +0 -1
  1074. package/dist/worktree-setup.d.ts +0 -85
  1075. package/dist/worktree-setup.js +0 -164
  1076. package/dist/worktree-setup.js.map +0 -1
  1077. package/scripts/benchmark-run-store-fixture.ts +0 -432
  1078. package/scripts/benchmark-run-store.ts +0 -743
  1079. package/scripts/benchmark-stuck-destroys.ts +0 -143
  1080. package/scripts/check-pack.mjs +0 -48
  1081. package/scripts/inline-contract.mjs +0 -165
  1082. package/scripts/install-as-command.mjs +0 -122
  1083. package/scripts/measure-transcript-facts-health.mjs +0 -87
  1084. package/scripts/measure-transcript-facts-lag.mjs +0 -68
  1085. package/scripts/mock-autonomous.mjs +0 -11
  1086. package/scripts/mock-ci-tool.mjs +0 -111
  1087. package/scripts/mock-claude-model-refusal.mjs +0 -42
  1088. package/scripts/mock-claude.mjs +0 -1065
  1089. package/scripts/mock-codex-app-server.mjs +0 -905
  1090. package/scripts/mock-codex-coalesce-steer.mjs +0 -59
  1091. package/scripts/mock-codex-reverse-steer.mjs +0 -130
  1092. package/scripts/mock-cursor-acp.mjs +0 -423
  1093. package/scripts/mock-cursor-hang-stdin-late.mjs +0 -35
  1094. package/scripts/mock-cursor-hang-stdin.mjs +0 -30
  1095. package/scripts/mock-cursor-print.mjs +0 -256
  1096. package/scripts/mock-deferred-turn-start.mjs +0 -16
  1097. package/scripts/mock-delivery-control.d.mts +0 -23
  1098. package/scripts/mock-delivery-control.mjs +0 -80
  1099. package/scripts/mock-env-record.mjs +0 -11
  1100. package/scripts/mock-failure-control.d.mts +0 -13
  1101. package/scripts/mock-failure-control.mjs +0 -68
  1102. package/scripts/mock-multi-pr.mjs +0 -7
  1103. package/scripts/mock-nudge.mjs +0 -45
  1104. package/scripts/mock-omp-rpc.mjs +0 -779
  1105. package/scripts/mock-opencode-serve.mjs +0 -1230
  1106. package/scripts/mock-pi-rpc.mjs +0 -698
  1107. package/scripts/mock-runner-crash.mjs +0 -58
  1108. package/scripts/mock-session-context.d.mts +0 -5
  1109. package/scripts/mock-session-context.mjs +0 -56
  1110. package/scripts/mock-silent-tail.mjs +0 -85
  1111. package/scripts/mock-turn-messages.mjs +0 -5
  1112. package/scripts/omp-ci-wait.mjs +0 -29
  1113. package/scripts/omp-restrict-delegation.yml +0 -4
  1114. package/scripts/pi-ci-wait.mjs +0 -17
  1115. package/scripts/pi-default-tools.mjs +0 -22
  1116. package/scripts/pi-project-skills.mjs +0 -59
  1117. package/scripts/pi-retry-degraded-service.mjs +0 -16
  1118. package/scripts/probe-cursor-print.mjs +0 -627
  1119. package/scripts/seed-archive-profile.ts +0 -53
  1120. package/scripts/sync-readme.mjs +0 -20
  1121. package/scripts/test-process-usage.mjs +0 -47
  1122. package/scripts/transcript-facts-fixture.mjs +0 -53
  1123. package/scripts/voice-replay.ts +0 -50
  1124. package/scripts/windows-workspace-identity.cs +0 -208
  1125. package/scripts/windows-workspace-identity.ps1 +0 -10
  1126. package/web/dist/assets/alert-dialog-DfctKUMw.js +0 -1
  1127. package/web/dist/assets/button-CeupvoKG.js +0 -41
  1128. package/web/dist/assets/centered-state-hDsyXrnH.js +0 -1
  1129. package/web/dist/assets/cez-idle-D3aj_9lp.js +0 -1
  1130. package/web/dist/assets/diff-BnIXZK3i2.js +0 -3
  1131. package/web/dist/assets/diff-controls-GewpW9aF.js +0 -1
  1132. package/web/dist/assets/diff-view-Byo7gpvW.js +0 -11
  1133. package/web/dist/assets/dropdown-menu-COj_J5wd.js +0 -6
  1134. package/web/dist/assets/git-toolbar-DY0z0n4S.js +0 -1
  1135. package/web/dist/assets/github-DwU6ALRK.js +0 -1
  1136. package/web/dist/assets/index-BOfE8pyD.js +0 -34
  1137. package/web/dist/assets/index-D9HpsmdW.css +0 -1
  1138. package/web/dist/assets/lib-BQXq3kEf.js +0 -1
  1139. package/web/dist/assets/live-protocol-Uce2NwEX.js +0 -64
  1140. package/web/dist/assets/play-CmVAj_fu.js +0 -1
  1141. package/web/dist/assets/popover-D56fhiXj.js +0 -1
  1142. package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +0 -3
  1143. package/web/dist/assets/reference-chip-gQNk-4jc.js +0 -1
  1144. package/web/dist/assets/repo-git-B5ECDUuv.js +0 -1
  1145. package/web/dist/assets/run-header-C0Y1NvEM.js +0 -2
  1146. package/web/dist/assets/skill-empty-hint-oOtzR3v0.js +0 -1
  1147. package/web/dist/assets/skills-DUeTkZ9z.js +0 -1
  1148. package/web/dist/assets/status-dot-1PR0i69P.js +0 -1
  1149. package/web/dist/assets/tab-link-DmWk4l5O.js +0 -1
  1150. package/web/dist/assets/task-changes-DKZXuW89.js +0 -1
  1151. package/web/dist/assets/task-commits-BZ6KxWdF.js +0 -1
  1152. package/web/dist/assets/task-files-DlF7Apcn.js +0 -2
  1153. package/web/dist/assets/task-github-item-CVPo3geZ.js +0 -1
  1154. package/web/dist/assets/task-thread-mm4-ECyo.js +0 -9
  1155. package/web/dist/assets/thread-state-CIw2BlhT.js +0 -4
  1156. package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +0 -1
  1157. package/web/dist/assets/workflows-D8vYD-ql.js +0 -7
  1158. package/web/dist/assets/zoomable-image-CxQSsfcn.js +0 -1
@@ -1,1066 +0,0 @@
1
- import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
2
- import { randomUUID } from 'node:crypto';
3
- import { homedir, userInfo } from 'node:os';
4
- import { dirname, join, resolve } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import { CANCEL, PreflightError } from '../types.js';
7
- import { depCheckStep, generatePassword, owned, shared, shquote, StepAborted, StepCancelled, StepSkipped, sudoStep, verifyCommand } from '../steps.js';
8
- import { isForeignNpxExecStart, isNpxExecStart, refreshNpxCacheForRedeploy } from '../npx-cache.js';
9
- export { isForeignNpxExecStart, isNpxExecStart, refreshNpxCacheForRedeploy };
10
- /**
11
- * The `ubuntu-vps` strategy: stand up an authenticated, proxied cezar on a bare
12
- * Ubuntu/Debian VPS. cezar itself stays loopback-bound; nginx is the single
13
- * public surface (TLS + htpasswd identity) forwarding to 127.0.0.1:<port>.
14
- *
15
- * Phase 1 ships deps → nginx+htpasswd → identity-verify (and their `undo`s).
16
- * Phase 2 appends the optional SSL and autostart steps to `steps()`.
17
- */
18
- /**
19
- * Instance-scoped artifact paths. The `default` instance (a host with no
20
- * `--domain`, i.e. every pre-multi-instance install) keeps the original,
21
- * un-suffixed names so it upgrades in place; a named (domain-keyed) instance
22
- * suffixes the nginx site, htpasswd, and systemd unit with its slug so several
23
- * cockpits coexist on one host without colliding. `undefined`/`'default'` both
24
- * resolve to the legacy names.
25
- */
26
- function inst(ctx) {
27
- return ctx.instance && ctx.instance !== 'default' ? ctx.instance : 'default';
28
- }
29
- function vhostAvailable(ctx) {
30
- const i = inst(ctx);
31
- return i === 'default' ? '/etc/nginx/sites-available/cezar' : `/etc/nginx/sites-available/cezar-${i}`;
32
- }
33
- function vhostEnabled(ctx) {
34
- const i = inst(ctx);
35
- return i === 'default' ? '/etc/nginx/sites-enabled/cezar' : `/etc/nginx/sites-enabled/cezar-${i}`;
36
- }
37
- function htpasswdPath(ctx) {
38
- const i = inst(ctx);
39
- return i === 'default' ? '/etc/cezar/htpasswd' : `/etc/cezar/htpasswd-${i}`;
40
- }
41
- function unitName(ctx) {
42
- const i = inst(ctx);
43
- return i === 'default' ? 'cezar.service' : `cezar-${i}.service`;
44
- }
45
- /** Best-effort current OS username, suggested as the default cockpit login. */
46
- function currentUsername() {
47
- try {
48
- return userInfo().username || 'ops';
49
- }
50
- catch {
51
- return 'ops';
52
- }
53
- }
54
- /**
55
- * True when ufw is installed and enabled. `ufw status` needs root and the
56
- * installer is mandatorily non-root, so it always failed — instead read
57
- * `/etc/ufw/ufw.conf` (world-readable), whose `ENABLED=yes` is the same truth
58
- * `ufw enable` maintains.
59
- */
60
- async function ufwIsActive(ctx) {
61
- const r = await ctx.runner.capture('sh', [
62
- '-c',
63
- 'grep -qi "^ENABLED=yes" /etc/ufw/ufw.conf 2>/dev/null && echo ufw-enabled || true',
64
- ]);
65
- return r.stdout.includes('ufw-enabled');
66
- }
67
- /** The HTTP status curl saw for a request ("000" = could not connect / no response). */
68
- async function curlCode(ctx, args, opts) {
69
- const r = await ctx.runner.capture('curl', ['-s', '-o', '/dev/null', '-w', '%{http_code}', ...args], opts);
70
- return r.stdout.trim() || '000';
71
- }
72
- /**
73
- * Name of the process listening on `port`, or null when nothing is. Best effort
74
- * (`ss` output varies, and without root the process name may be hidden) — used
75
- * only to make a port collision explainable, never to gate the install.
76
- */
77
- export async function portListener(ctx, port) {
78
- if (ctx.dryRun)
79
- return null;
80
- const r = await ctx.runner.capture('ss', ['-ltnp', `( sport = :${port} )`]);
81
- if (r.code !== 0)
82
- return null;
83
- const line = r.stdout.split('\n').find((l) => /LISTEN/.test(l));
84
- if (!line)
85
- return null;
86
- // `users:(("docker-proxy",pid=123,fd=4))` → docker-proxy; unnamed → "another process".
87
- return /users:\(\("([^"]+)"/.exec(line)?.[1] ?? 'another process';
88
- }
89
- /** The interface the cockpit listens on — loopback unless an external-proxy
90
- * install bound it somewhere the proxy can reach (e.g. the docker bridge). */
91
- export function upstreamHost(ctx) {
92
- return ctx.state.bindHost?.trim() || '127.0.0.1';
93
- }
94
- /** True once cezar answers on <host>:<port> (any HTTP status = the process is up). */
95
- async function isCezarUp(ctx, port) {
96
- const code = await curlCode(ctx, [`http://${upstreamHost(ctx)}:${port}/`]);
97
- return code !== '000';
98
- }
99
- /** Poll the upstream until cezar responds or the attempts run out. */
100
- async function waitForCezar(ctx, port, attempts = 15) {
101
- for (let i = 0; i < attempts; i++) {
102
- if (await isCezarUp(ctx, port))
103
- return true;
104
- // `sleep 1` via the runner keeps this testable (no real timers in unit tests).
105
- if (i < attempts - 1)
106
- await ctx.runner.capture('sh', ['-c', 'sleep 1']);
107
- }
108
- return false;
109
- }
110
- /**
111
- * After a service is enabled, wait for cezar to actually answer on the loopback
112
- * port. A running unit that crash-loops (bad WorkingDirectory, missing build)
113
- * would otherwise leave nginx proxying to nothing (502) while the installer
114
- * claims success. On failure, point the operator at the service logs.
115
- */
116
- async function confirmCezarRunning(ctx, statusCmd, logsCmd) {
117
- if (ctx.dryRun) {
118
- ctx.ui.info(`DRY RUN — would wait for cezar on ${upstreamHost(ctx)}:${ctx.state.primaryPort}.`);
119
- return;
120
- }
121
- const sp = ctx.ui.spinner();
122
- sp.start(`Waiting for cezar to start on 127.0.0.1:${ctx.state.primaryPort}…`);
123
- const up = await waitForCezar(ctx, ctx.state.primaryPort);
124
- sp.stop(up ? 'cezar is running.' : 'cezar did not come up.');
125
- if (!up) {
126
- ctx.ui.warn(`cezar is not answering on 127.0.0.1:${ctx.state.primaryPort} yet — nginx will return 502 until it is.\n` +
127
- `Check the service:\n • ${statusCmd}\n • ${logsCmd}\n` +
128
- 'Common causes: the WorkingDirectory has no built cezar, or the port is wrong.');
129
- }
130
- }
131
- /** nginx -v prints its version banner on stderr. Unknown versions use the compatible syntax. */
132
- function supportsStandaloneHttp2(version) {
133
- const match = version && /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
134
- if (!match)
135
- return false;
136
- const [major, minor, patch] = match.slice(1).map(Number);
137
- return major > 1 || (major === 1 && (minor > 25 || (minor === 25 && patch >= 1)));
138
- }
139
- async function installedNginxVersion(ctx) {
140
- const result = await ctx.runner.capture('nginx', ['-v']);
141
- if (result.code !== 0)
142
- return null;
143
- return /nginx\/(\d+\.\d+\.\d+)/.exec(`${result.stderr}\n${result.stdout}`)?.[1] ?? null;
144
- }
145
- /** Add HTTP/2 only to Certbot's TLS listeners, preserving its trailing comments. */
146
- export function enableHttp2OnTlsListenerSed(vhostPath) {
147
- const program = `/^[[:space:]]*listen[[:space:]].*443.*[[:space:]]ssl([[:space:]]|;)/{/http2/!s/;/ http2;/;}`;
148
- return `sed -i -E ${shquote(program)} ${shquote(vhostPath)}`;
149
- }
150
- /** Roll back the file if validation or reload fails; mark only a completed edit. */
151
- export function enableHttp2OnTlsCommand(vhostPath, marker) {
152
- const backup = `${vhostPath}.cezar-http2-${randomUUID()}`;
153
- return `cp -p ${shquote(vhostPath)} ${shquote(backup)} && ` +
154
- `if ${enableHttp2OnTlsListenerSed(vhostPath)} && nginx -t && systemctl reload nginx && ` +
155
- `printf '\n%s\n' ${shquote(marker)} >> ${shquote(vhostPath)}; then ` +
156
- `rm -f ${shquote(backup)} || true; ` +
157
- `else cp -p ${shquote(backup)} ${shquote(vhostPath)} && rm -f ${shquote(backup)} && ` +
158
- `nginx -t && systemctl reload nginx; false; fi`;
159
- }
160
- /**
161
- * The nginx server block: auth_basic identity + SSE-safe proxy to loopback.
162
- * `serverName` defaults to the catch-all `_`; the SSL step rewrites it to the
163
- * real domain so the `certbot --nginx` plugin can find this vhost to edit.
164
- */
165
- export function nginxVhost(port, serverName = '_', htpasswd = '/etc/cezar/htpasswd', nginxVersion = null) {
166
- // Older nginx rejects `http2 on;` outright. Its SSL step adds `http2` to
167
- // Certbot's TLS listener instead, retaining multiplexing for SSE streams.
168
- const http2 = supportsStandaloneHttp2(nginxVersion)
169
- ? `\n # Multiplex long-lived SSE streams over one TLS connection.\n http2 on;\n`
170
- : '';
171
- return `# Managed by cezar server-install — do not edit by hand.
172
- server {
173
- listen 80;
174
- listen [::]:80;
175
- server_name ${serverName};
176
-
177
- ${http2}
178
- auth_basic "cezar";
179
- auth_basic_user_file ${htpasswd};
180
-
181
- location / {
182
- proxy_pass http://127.0.0.1:${port};
183
- proxy_http_version 1.1;
184
- proxy_set_header Host $host;
185
- proxy_set_header X-Real-IP $remote_addr;
186
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
187
- proxy_set_header X-Forwarded-Proto $scheme;
188
-
189
- # cezar streams SSE (run events). Never buffer it, or the cockpit goes mute.
190
- proxy_buffering off;
191
- proxy_read_timeout 3600s;
192
- proxy_set_header Connection '';
193
- }
194
- }
195
- `;
196
- }
197
- /** Build a privileged command that writes file content atomically (base64 → no quoting hell). */
198
- function writeRootFileCmd(path, content, extra = '') {
199
- const b64 = Buffer.from(content, 'utf8').toString('base64');
200
- const dir = path.slice(0, path.lastIndexOf('/')) || '/';
201
- return `install -d -m 0755 ${shquote(dir)} && printf %s ${shquote(b64)} | base64 --decode > ${shquote(path)}${extra ? ` && ${extra}` : ''}`;
202
- }
203
- /**
204
- * A sudoStep that writes a root-owned file. The command carries the content as
205
- * base64 (so quoting/newlines survive a copy-paste), which is unreadable — so we
206
- * always show the DECODED file content in a note first, so the operator can see
207
- * exactly what will land on disk and knows the base64 is not doing anything
208
- * hidden.
209
- */
210
- function writeFileStep(ctx, opts) {
211
- return sudoStep(ctx, {
212
- description: opts.description,
213
- note: `This writes ${opts.path} with exactly this content:\n\n${opts.content}`,
214
- command: writeRootFileCmd(opts.path, opts.content, opts.extra),
215
- verify: opts.verify,
216
- });
217
- }
218
- const nginxProxyStep = {
219
- id: 'nginx-proxy',
220
- title: 'Reverse proxy (nginx + htpasswd)',
221
- async check(ctx) {
222
- if (ctx.dryRun)
223
- return false;
224
- const nginxOk = await verifyCommand(ctx, 'nginx', ['-v']);
225
- const vhostOk = await verifyCommand(ctx, 'test', ['-f', vhostEnabled(ctx)]);
226
- return nginxOk && vhostOk;
227
- },
228
- async run(ctx) {
229
- // 1) nginx. Record the package as a `shared` artifact only when this run
230
- // installed it, so uninstall can list it for manual removal without
231
- // claiming a pre-existing nginx.
232
- const nginxWasPresent = await verifyCommand(ctx, 'nginx', ['-v']);
233
- await sudoStep(ctx, {
234
- description: 'Install nginx (the public TLS + auth front for cezar).',
235
- command: 'apt-get update && apt-get install -y nginx',
236
- verify: (c) => verifyCommand(c, 'nginx', ['-v']),
237
- });
238
- // 2) identity credentials. This is the HTTP Basic-Auth login nginx will
239
- // challenge for over HTTPS — i.e. what you type in the browser to reach
240
- // the cockpit. Suggest the current OS user as a sensible default.
241
- const suggestedUser = currentUsername();
242
- const userAnswer = await ctx.ui.text({
243
- message: 'Cockpit login username (HTTPS Basic-Auth — you type this in the browser to reach the cockpit)',
244
- placeholder: suggestedUser,
245
- initialValue: suggestedUser,
246
- // htpasswd's line format is `user:hash` — a ":" in the username would
247
- // silently corrupt it into a login that can never succeed.
248
- validate: (v) => {
249
- if (!v.trim())
250
- return 'username is required';
251
- if (/[:\s]/.test(v.trim()))
252
- return 'no ":" or whitespace — htpasswd uses ":" as its separator';
253
- return undefined;
254
- },
255
- });
256
- if (userAnswer === CANCEL)
257
- throw new StepCancelled();
258
- const user = String(userAnswer).trim();
259
- // Set the cockpit password. Interactive operators may auto-generate a strong
260
- // one (shown once) or type their own. Under `--yes` (no human) there is no
261
- // menu — the password comes straight from the UI, and the length backstop
262
- // below refuses an empty one rather than standing up an open cockpit (H1).
263
- let password;
264
- if (ctx.assumeYes) {
265
- const typed = await ctx.ui.password({
266
- message: `Set the HTTPS cockpit password for "${user}"`,
267
- validate: (v) => (v.length >= 6 ? undefined : 'use at least 6 characters'),
268
- });
269
- if (typed === CANCEL)
270
- throw new StepCancelled();
271
- password = String(typed);
272
- }
273
- else {
274
- const how = await ctx.ui.select({
275
- message: `Cockpit password for "${user}" (used with the username to log in over HTTPS)`,
276
- options: [
277
- { value: 'generate', label: 'Generate a strong password for me', hint: 'shown once — save it now' },
278
- { value: 'manual', label: 'Type my own password' },
279
- ],
280
- initialValue: 'generate',
281
- });
282
- if (how === CANCEL)
283
- throw new StepCancelled();
284
- if (how === 'generate') {
285
- password = generatePassword();
286
- ctx.ui.note(`Username: ${user}\nPassword: ${password}\n\nSave these now — this is your cockpit login. cezar stores only a hash; the plaintext is not written anywhere and cannot be recovered.`, 'Generated cockpit credentials');
287
- }
288
- else {
289
- const typed = await ctx.ui.password({
290
- message: `Set the HTTPS cockpit password for "${user}"`,
291
- validate: (v) => (v.length >= 6 ? undefined : 'use at least 6 characters'),
292
- });
293
- if (typed === CANCEL)
294
- throw new StepCancelled();
295
- password = String(typed);
296
- }
297
- }
298
- // The non-interactive UI (`--yes`) cannot invent a password and does not run
299
- // validators — refuse rather than write an empty-password htpasswd (a public
300
- // cockpit anyone can open). A real install must set a password interactively.
301
- if (!ctx.dryRun && String(password).length < 6) {
302
- throw new StepAborted('a cockpit password (≥6 chars) is required — run server-install without --yes to set one');
303
- }
304
- // Keep the credentials in memory (never persisted) so the final verify step
305
- // can prove an authenticated request actually reaches cezar over the proxy.
306
- ctx.prefs.cockpit = { user, password };
307
- // 3) htpasswd file. The hash (not the plaintext) is embedded in the write
308
- // command; the plaintext is fed to openssl via stdin so it never appears
309
- // in the process argv (visible to other users via `ps`). apr1 is what
310
- // nginx's auth_basic expects.
311
- let hash = '<dry-run-hash>';
312
- if (!ctx.dryRun) {
313
- const out = await ctx.runner.capture('openssl', ['passwd', '-apr1', '-stdin'], { input: `${String(password)}\n` });
314
- hash = out.stdout.trim();
315
- if (out.code !== 0 || !hash)
316
- throw new StepAborted('failed to hash the password (openssl) — cannot write htpasswd');
317
- }
318
- // nginx workers run as www-data and read auth_basic_user_file per request,
319
- // so the file must be group-readable by www-data — 0640 root:root would make
320
- // every request 500. 0640 root:www-data: readable by nginx, not by others.
321
- // The credential line travels on STDIN (`cat > file`), never in argv — the
322
- // apr1 hash is offline-crackable, and argv is world-readable via `ps`.
323
- const htpasswd = htpasswdPath(ctx);
324
- await sudoStep(ctx, {
325
- description: 'Write the htpasswd identity file that nginx checks on every request.',
326
- note: `${htpasswd}\n\n${user}:<apr1 hash of your password>`,
327
- command: `install -d -m 0755 /etc/cezar && cat > ${htpasswd} && chown root:www-data ${htpasswd} && chmod 0640 ${htpasswd}`,
328
- input: `${user}:${hash}\n`,
329
- inputLabel: 'credential line (username:hash)',
330
- verify: (c) => verifyCommand(c, 'test', ['-f', htpasswd]),
331
- });
332
- // Record whether the distro's default site was enabled *before* we disable
333
- // it, so undo only re-enables it if we were the one who removed it.
334
- const defaultWasEnabled = await verifyCommand(ctx, 'test', ['-L', '/etc/nginx/sites-enabled/default']);
335
- // 4) vhost + enable + reload. A named instance already knows its domain, so
336
- // stamp it into server_name from the start (Host-based routing works
337
- // immediately and certbot --nginx can find the vhost later). The default
338
- // instance keeps the catch-all `_` until the SSL step sets a domain.
339
- const vhostAvail = vhostAvailable(ctx);
340
- const vhostEnbl = vhostEnabled(ctx);
341
- const nginxVersion = await installedNginxVersion(ctx);
342
- const vhost = nginxVhost(ctx.state.primaryPort, ctx.state.domain ?? '_', htpasswd, nginxVersion);
343
- await writeFileStep(ctx, {
344
- description: 'Write the cezar nginx site, enable it, and reload nginx.',
345
- path: vhostAvail,
346
- content: vhost,
347
- extra: `ln -sf ${vhostAvail} ${vhostEnbl} && rm -f /etc/nginx/sites-enabled/default && nginx -t && systemctl reload nginx`,
348
- verify: (c) => verifyCommand(c, 'test', ['-f', vhostEnbl]),
349
- });
350
- // 5) firewall: if ufw is active, the cockpit is unreachable until 80/443 are
351
- // allowed — a common "installed fine but nothing loads" cause. This is a
352
- // best-effort sub-step of the (required) proxy step: skipping it must not
353
- // fail the whole install, so a StepSkipped is swallowed here.
354
- if (!ctx.dryRun && (await ufwIsActive(ctx))) {
355
- try {
356
- await sudoStep(ctx, {
357
- description: 'ufw is active — allow HTTP/HTTPS so the cockpit is reachable.',
358
- // Self-verifying: the trailing grep makes the (root) command itself
359
- // fail when the rule did not land — needed because rule listing also
360
- // requires root, so the unprivileged verify below can't always check.
361
- command: `ufw allow 'Nginx Full' && ufw status | grep -qi 'Nginx Full'`,
362
- skippable: true,
363
- skipHint: 'open ports 80 and 443 yourself, or via a cloud firewall',
364
- verify: async (c) => {
365
- if ((await c.runner.capture('sudo', ['-n', 'true'])).code === 0) {
366
- return ((await c.runner.capture('sudo', ['-n', 'bash', '-lc', "ufw status | grep -qi 'Nginx Full'"])).code === 0);
367
- }
368
- // No root and no human in the loop (`--yes`): nobody ran the
369
- // command, so it cannot have "verified itself" — fail, which the
370
- // skippable path converts into the loud firewall warning below.
371
- if (c.assumeYes)
372
- return false;
373
- // Interactive delegate: the operator confirmed running the
374
- // self-verifying command (the trailing grep fails their paste if
375
- // the rule is missing); we cannot re-check without root.
376
- c.ui.warn('Cannot list ufw rules without root — trusting the self-verifying command you just ran. ' +
377
- 'Double-check ports 80/443 are reachable.');
378
- return true;
379
- },
380
- });
381
- }
382
- catch (err) {
383
- if (!(err instanceof StepSkipped))
384
- throw err;
385
- ctx.ui.warn('Firewall left unchanged — make sure ports 80 and 443 are reachable, or the cockpit will not load.');
386
- }
387
- }
388
- const artifacts = [
389
- owned('file', { path: vhostAvail }),
390
- owned('symlink', { path: vhostEnbl }),
391
- owned('htpasswd', { path: htpasswd, name: user }),
392
- ];
393
- if (defaultWasEnabled)
394
- artifacts.push(owned('nginx-default', { path: '/etc/nginx/sites-enabled/default' }));
395
- if (!nginxWasPresent) {
396
- artifacts.push(shared('package', { name: 'nginx', removeHint: 'sudo apt-get remove -y nginx' }));
397
- }
398
- return { artifacts };
399
- },
400
- async undo(ctx, created) {
401
- // Remove the *known* cezar-owned paths (constants), so uninstall works even
402
- // if server.json was lost and the step was re-recorded with created=null.
403
- // Only re-enable the default site if the run recorded that it disabled it.
404
- const restoreDefault = (created?.artifacts ?? []).some((a) => a.type === 'nginx-default');
405
- const restoreClause = restoreDefault
406
- ? ` && { [ -e /etc/nginx/sites-available/default ] && ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default || true; }`
407
- : '';
408
- // `shared` packages (nginx, when this install added it) are listed, never
409
- // auto-removed — the operator may have started depending on them.
410
- const sharedPkgs = (created?.artifacts ?? []).filter((a) => a.kind === 'shared');
411
- if (sharedPkgs.length > 0) {
412
- ctx.ui.note(sharedPkgs.map((a) => a.removeHint ?? a.name ?? '').filter(Boolean).join('\n'), 'Installed for cezar but possibly used elsewhere — remove manually if unwanted');
413
- }
414
- // rmdir /etc/cezar only succeeds when empty, so removing one instance's
415
- // htpasswd never nukes another instance's credentials in the same dir.
416
- const vhostEnbl = vhostEnabled(ctx);
417
- await sudoStep(ctx, {
418
- description: 'Remove the cezar nginx site + htpasswd, reload nginx.',
419
- command: `rm -f ${vhostEnbl} ${vhostAvailable(ctx)} ${htpasswdPath(ctx)}` +
420
- restoreClause +
421
- ` && { rmdir /etc/cezar 2>/dev/null || true; }` +
422
- ` && { nginx -t && systemctl reload nginx || true; }`,
423
- verify: (c) => verifyCommand(c, 'sh', ['-c', `! test -f ${vhostEnbl}`]),
424
- });
425
- },
426
- };
427
- const HOSTNAME_RE = /^(?=.{1,253}$)([a-z0-9](-?[a-z0-9])*\.)+[a-z]{2,}$/i;
428
- const EMAIL_RE = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
429
- const sslStep = {
430
- id: 'ssl',
431
- title: 'Domain + SSL (Let’s Encrypt)',
432
- optional: true,
433
- async check() {
434
- return false; // optional — the engine gates it with a confirm; certbot is idempotent
435
- },
436
- async run(ctx) {
437
- // A named instance already captured its domain up front (it is the instance
438
- // key) — reuse it instead of asking again. The default instance still
439
- // prompts here, since it may be HTTP-only until this step runs.
440
- const domain = ctx.state.domain
441
- ? ctx.state.domain
442
- : await ctx.ui.text({
443
- message: 'Domain pointing at this server (an A/AAAA record must resolve here)',
444
- placeholder: 'cezar.example.com',
445
- validate: (v) => (HOSTNAME_RE.test(v.trim()) ? undefined : 'enter a valid domain'),
446
- });
447
- if (domain === CANCEL)
448
- throw new StepCancelled();
449
- const email = await ctx.ui.text({
450
- message: 'Email for Let’s Encrypt renewal notices',
451
- placeholder: 'you@example.com',
452
- validate: (v) => (EMAIL_RE.test(v.trim()) ? undefined : 'enter a valid email'),
453
- });
454
- if (email === CANCEL)
455
- throw new StepCancelled();
456
- const certbotWasPresent = await verifyCommand(ctx, 'certbot', ['--version']);
457
- await sudoStep(ctx, {
458
- description: 'Install certbot + its nginx plugin.',
459
- command: 'apt-get install -y certbot python3-certbot-nginx',
460
- verify: (c) => verifyCommand(c, 'certbot', ['--version']),
461
- });
462
- // Point the nginx site's server_name at the domain BEFORE running certbot.
463
- // The `certbot --nginx` plugin locates the vhost by matching `server_name`
464
- // against `-d <domain>`; with the catch-all `server_name _;` it fails with
465
- // "Unable to find a VirtualHost". Doing this first also means that if the
466
- // operator skips certbot now, a later manual `certbot --nginx -d <domain>`
467
- // just works — no "could not find a matching server" (issue #8).
468
- //
469
- // On a RE-RUN (--reconfigure ssl / --reinstall / resume) the vhost may
470
- // already carry certbot's TLS edits (`listen 443 ssl`, `ssl_certificate`).
471
- // Rewriting it with the plain-HTTP template would take working HTTPS down
472
- // BEFORE certbot runs again — and leave it down if certbot then fails. So
473
- // when TLS config is present, only the `server_name` lines are updated
474
- // in place; the hostname regex bars every sed/shell metacharacter.
475
- const trimmedDomain = String(domain).trim();
476
- // Record the domain on the instance record so a resume / redeploy / verify
477
- // (and the nginx server_name) all agree on it, even for the default instance
478
- // that entered its domain here rather than up front.
479
- ctx.state.domain = trimmedDomain;
480
- const vhostAvail = vhostAvailable(ctx);
481
- const vhostEnbl = vhostEnabled(ctx);
482
- const vhostHasTls = await verifyCommand(ctx, 'sh', ['-c', `grep -qs ssl_certificate ${vhostAvail}`]);
483
- const nginxVersion = await installedNginxVersion(ctx);
484
- if (vhostHasTls) {
485
- await sudoStep(ctx, {
486
- description: `Update server_name to ${trimmedDomain} in the existing TLS-enabled nginx site (certbot config preserved).`,
487
- command: `sed -i 's/^\\([[:space:]]*\\)server_name .*;/\\1server_name ${trimmedDomain};/' ${vhostAvail} && nginx -t && systemctl reload nginx`,
488
- verify: (c) => verifyCommand(c, 'sh', ['-c', `grep -qF ${shquote(`server_name ${trimmedDomain}`)} ${vhostAvail}`]),
489
- });
490
- }
491
- else {
492
- const domainVhost = nginxVhost(ctx.state.primaryPort, trimmedDomain, htpasswdPath(ctx), nginxVersion);
493
- await writeFileStep(ctx, {
494
- description: `Point the nginx site at ${trimmedDomain} so certbot can configure TLS for it.`,
495
- path: vhostAvail,
496
- content: domainVhost,
497
- extra: `ln -sf ${vhostAvail} ${vhostEnbl} && nginx -t && systemctl reload nginx`,
498
- verify: (c) => verifyCommand(c, 'sh', ['-c', `grep -qF ${shquote(`server_name ${trimmedDomain}`)} ${vhostAvail}`]),
499
- });
500
- }
501
- // certbot can legitimately fail on external state (DNS not pointed yet, LE
502
- // rate limit). Route it through sudoStep so it honors the sudo/delegate
503
- // choice (issue #7) and offers Skip on repeated failure (issue #8) — on
504
- // skip, nginx is already configured for a later manual certbot run.
505
- await sudoStep(ctx, {
506
- description: `Obtain and install a Let’s Encrypt certificate for ${String(domain).trim()} (adds HTTPS + redirect).`,
507
- command: `certbot --nginx -d ${shquote(String(domain).trim())} --non-interactive --agree-tos -m ${shquote(String(email).trim())} --redirect`,
508
- skippable: true,
509
- skipHint: `run later: sudo certbot --nginx -d ${String(domain).trim()}`,
510
- // Verify via the nginx vhost, NOT /etc/letsencrypt/live — that dir is 0700
511
- // root, so a non-root `test -d` (the operator ran certbot themselves) fails
512
- // with permission-denied and reports a false failure even when the cert was
513
- // issued. certbot --nginx writes `ssl_certificate …` into the vhost, which
514
- // is world-readable, so grepping it works without root.
515
- verify: (c) => verifyCommand(c, 'sh', ['-c', `grep -qs ssl_certificate ${vhostAvail} ${vhostEnbl}`]),
516
- });
517
- if (!supportsStandaloneHttp2(nginxVersion)) {
518
- // Certbot has now installed the TLS listeners. Keep the existing TLS site
519
- // intact on reconfiguration; the edit is idempotent and touches only :443.
520
- try {
521
- const marker = `# cezar-http2-validated ${randomUUID()}`;
522
- await sudoStep(ctx, {
523
- description: 'Enable HTTP/2 on the nginx TLS listeners.',
524
- command: enableHttp2OnTlsCommand(vhostAvail, marker),
525
- skippable: true,
526
- skipHint: `add http2 to the TLS listen lines in ${vhostAvail}, then reload nginx`,
527
- // A matching listener alone cannot prove `nginx -t` and reload ran:
528
- // sudoStep deliberately ignores a command's exit when verification
529
- // succeeds, and delegate mode has no exit status to inspect at all.
530
- verify: (c) => verifyCommand(c, 'sh', ['-c',
531
- `grep -qF ${shquote(marker)} ${shquote(vhostAvail)} && grep -Eqs '^[[:space:]]*listen.*443.*http2' ${shquote(vhostAvail)}`,
532
- ]),
533
- });
534
- }
535
- catch (error) {
536
- if (!(error instanceof StepSkipped))
537
- throw error;
538
- ctx.ui.warn('HTTPS is configured, but HTTP/2 is unavailable; long-lived SSE streams may exhaust the browser connection pool.');
539
- }
540
- }
541
- ctx.state.publicUrl = `https://${trimmedDomain}`;
542
- // The cert + its auto-renewal timer are `shared`: uninstall lists them, it
543
- // does not delete them (removing a cert can break other vhosts). Same for
544
- // the certbot packages when this run installed them.
545
- const artifacts = [
546
- shared('cert', { name: trimmedDomain, removeHint: `sudo certbot delete --cert-name ${trimmedDomain}` }),
547
- ];
548
- if (!certbotWasPresent) {
549
- artifacts.push(shared('package', {
550
- name: 'certbot + python3-certbot-nginx',
551
- removeHint: 'sudo apt-get remove -y certbot python3-certbot-nginx',
552
- }));
553
- }
554
- return { artifacts };
555
- },
556
- async undo(ctx, created) {
557
- const cert = (created?.artifacts ?? []).find((a) => a.type === 'cert');
558
- if (cert) {
559
- ctx.ui.note(`The TLS certificate for ${cert.name ?? 'your domain'} and its auto-renewal timer were left in place.\nRemove them yourself if you want them gone:\n${cert.removeHint ?? ''}`, 'SSL');
560
- }
561
- const pkgs = (created?.artifacts ?? []).filter((a) => a.type === 'package');
562
- if (pkgs.length > 0) {
563
- ctx.ui.note(pkgs.map((a) => a.removeHint ?? a.name ?? '').filter(Boolean).join('\n'), 'Installed for cezar but possibly used elsewhere — remove manually if unwanted');
564
- }
565
- // The vhost (with certbot’s edits) is removed by the nginx-proxy step’s undo.
566
- },
567
- };
568
- /**
569
- * systemd unit that runs cezar loopback-bound with CEZ_REMOTE=1.
570
- *
571
- * `execStart` must be an ABSOLUTE command — systemd resolves the ExecStart
572
- * executable against its OWN compiled-in PATH (/usr/local/bin:/usr/bin:…), NOT
573
- * the unit's `Environment=PATH`, so a bare `cezar` gives status=203/EXEC
574
- * ("Unable to locate executable"). `resolveExecStart` therefore returns an
575
- * absolute `"<node> <entry.js>"`. We still set `Environment=PATH` (with the
576
- * installer's node dir) for any child process the app spawns.
577
- */
578
- export function systemdUnit(repoRoot, port, scope, execStart, bindHost) {
579
- const userLine = scope === 'system' ? `User=${userInfo().username}\n` : '';
580
- const installTarget = scope === 'system' ? 'multi-user.target' : 'default.target';
581
- // Give the service the operator's own PATH (node dir + the login PATH the CLI
582
- // merged in, e.g. ~/.local/bin and nvm) so cezar can spawn claude / gh / codex
583
- // at runtime — systemd's default PATH has none of those.
584
- const pathDirs = [dirname(process.execPath), ...(process.env.PATH ?? '').split(':'), '/usr/local/bin', '/usr/bin', '/bin']
585
- .filter((d, i, a) => d && d !== '.' && a.indexOf(d) === i);
586
- // systemd expands `%` specifiers in Environment/ExecStart values — a literal
587
- // `%` (possible in an nvm dir name) must be doubled or the unit fails to load.
588
- const sysd = (s) => s.replace(/%/g, '%%');
589
- // Loopback stays the default (and stays flag-less, so existing units are
590
- // byte-identical); an external-proxy install binds an interface its proxy can
591
- // actually reach — a container-based proxy cannot dial the host's loopback.
592
- const bind = bindHost?.trim() && bindHost.trim() !== '127.0.0.1' ? ` --bind-host ${bindHost.trim()}` : '';
593
- return `# Managed by cezar server-install — do not edit by hand.
594
- [Unit]
595
- Description=cezar cockpit
596
- After=network-online.target
597
- Wants=network-online.target
598
-
599
- [Service]
600
- Type=simple
601
- ${userLine}WorkingDirectory=${repoRoot}
602
- Environment=CEZ_REMOTE=1
603
- Environment=PATH=${sysd(pathDirs.join(':'))}
604
- ExecStart=${sysd(execStart)} serve --no-open --port ${port}${sysd(bind)}
605
- Restart=on-failure
606
- RestartSec=5
607
-
608
- [Install]
609
- WantedBy=${installTarget}
610
- `;
611
- }
612
- /** Our official npm package/alias — what `npx <this>` reinstalls the CLI as. */
613
- const OFFICIAL_CLI_PKG = 'cezarion';
614
- /**
615
- * Decide the absolute ExecStart command for the service, mirroring how the
616
- * installer itself was launched so the box keeps running the same cezar:
617
- *
618
- * - Launched via `npx <alias>` (the CLI package lives in npm's ephemeral
619
- * `_npx` cache, which gets cleaned): the service can't point there, so it
620
- * reinstalls-and-runs the same way — `<abs npx> --yes cezarion` (bare `npx`
621
- * would 203/EXEC, so npx is made absolute).
622
- * - A stable install (a checkout, or a global `cezarion`/`cez`): run the
623
- * CLI's own built entry `<node> <pkg>/dist/index.js`, or a resolved global
624
- * bin. Absolute node + absolute script → systemd never resolves off PATH.
625
- */
626
- export function serviceExecStart(opts) {
627
- if (/[/\\]_npx[/\\]/.test(opts.pkgRoot))
628
- return `${opts.npxPath} --yes ${OFFICIAL_CLI_PKG}`;
629
- if (opts.entryExists)
630
- return `${opts.node} ${opts.entry}`;
631
- if (opts.globalBin)
632
- return `${opts.node} ${opts.globalBin}`;
633
- return `${opts.node} ${opts.entry}`;
634
- }
635
- async function resolveExecStart(ctx) {
636
- const node = process.execPath; // absolute node running this installer
637
- // The CLI's OWN package root (…/dist/server-install/platforms/ → up 3), NOT the
638
- // repo being operated on — `--repo` / cwd can differ from where cezar lives.
639
- const pkgRoot = resolve(fileURLToPath(new URL('../../..', import.meta.url)));
640
- const entry = join(pkgRoot, 'dist', 'index.js');
641
- let npxPath = join(dirname(node), 'npx');
642
- if (ctx.dryRun)
643
- return serviceExecStart({ node, pkgRoot, entry, entryExists: true, npxPath });
644
- // A standalone node binary has no adjacent npx — fall back to the login
645
- // shell's, or ExecStart would 203/EXEC (the exact bug 9fea263 fixed).
646
- if (!existsSync(npxPath)) {
647
- const found = (await ctx.runner.capture('bash', ['-lc', 'command -v npx'])).stdout.trim().split('\n').pop()?.trim();
648
- if (found)
649
- npxPath = found;
650
- }
651
- let globalBin;
652
- if (!existsSync(entry) && !/[/\\]_npx[/\\]/.test(pkgRoot)) {
653
- const out = (await ctx.runner.capture('bash', ['-lc', `command -v ${OFFICIAL_CLI_PKG} || command -v cez`])).stdout.trim();
654
- globalBin = out.split('\n').map((s) => s.trim()).filter(Boolean).pop();
655
- if (!globalBin) {
656
- ctx.ui.warn(`Could not locate a built cezar to run (${entry} missing, no global ${OFFICIAL_CLI_PKG}).\n` +
657
- `Install it (npm i -g ${OFFICIAL_CLI_PKG}) or build the checkout, then re-run with --reconfigure autostart.`);
658
- }
659
- }
660
- return serviceExecStart({ node, pkgRoot, entry, entryExists: existsSync(entry), npxPath, globalBin });
661
- }
662
- /** Read the unit's live `ExecStart` (read-only query; no sudo needed even for a
663
- * system unit). Empty string when it can't be read — callers then skip the
664
- * npx-cache refresh rather than guessing. */
665
- async function readExecStart(ctx, scope, unit) {
666
- const args = [...(scope === 'user' ? ['--user'] : []), 'show', unit, '-p', 'ExecStart'];
667
- const { stdout } = await ctx.runner.capture('systemctl', args);
668
- return stdout;
669
- }
670
- /** Read-only even for a system unit; no sudo prompt during diagnosis. */
671
- async function serviceSnapshot(ctx, scope, unit) {
672
- const args = [...(scope === 'user' ? ['--user'] : []), 'show', unit, '-p', 'ActiveState', '-p', 'ExecMainStartTimestampMonotonic'];
673
- const result = await ctx.runner.capture('systemctl', args);
674
- if (result.code !== 0)
675
- return { active: null, started: null };
676
- const fields = new Map(result.stdout.trim().split('\n').map((line) => {
677
- const at = line.indexOf('=');
678
- return [line.slice(0, at), line.slice(at + 1)];
679
- }));
680
- const raw = fields.get('ExecMainStartTimestampMonotonic');
681
- return {
682
- active: fields.get('ActiveState') ?? null,
683
- started: raw && /^\d+$/.test(raw) ? BigInt(raw) : null,
684
- };
685
- }
686
- async function failedRestart(ctx, scope, unit, reason, sudoUsed = false) {
687
- let recent = 'recent journal unavailable';
688
- const args = [...(scope === 'user' ? ['--user'] : []), '-u', unit, '-n', '30', '--no-pager', '--output=short'];
689
- try {
690
- const ordinary = await ctx.runner.capture('journalctl', args);
691
- if (ordinary.code === 0 && ordinary.stdout.trim())
692
- recent = ordinary.stdout.trim().split('\n').slice(-30).join('\n').slice(-6000);
693
- }
694
- catch { /* Diagnostics must not hide the restart failure. */ }
695
- // An unprivileged journalctl may exit 0 with "-- No entries --" and a
696
- // permission hint on stderr. Once this deploy used sudo for the restart,
697
- // prefer its noninteractive journal read; keep ordinary output on failure.
698
- if (scope === 'system' && sudoUsed) {
699
- try {
700
- const privileged = await ctx.runner.capture('sudo', ['-n', 'journalctl', ...args]);
701
- if (privileged.code === 0 && privileged.stdout.trim())
702
- recent = privileged.stdout.trim().split('\n').slice(-30).join('\n').slice(-6000);
703
- }
704
- catch { /* Never let journal access hide the restart failure. */ }
705
- }
706
- throw new StepAborted(`${unit}: ${reason}\nRecent journal:\n${recent}`);
707
- }
708
- const autostartStep = {
709
- id: 'autostart',
710
- // Required: after install the cockpit must actually be serving, so cezar runs
711
- // as a systemd service — started now AND enabled on boot. (id kept as
712
- // `autostart` for state compatibility.)
713
- title: 'Run cezar as a service (systemd — starts now + on boot)',
714
- async check() {
715
- return false; // always (re)assert the service is installed and running
716
- },
717
- async run(ctx) {
718
- const UNIT_NAME = unitName(ctx);
719
- const execStart = await resolveExecStart(ctx);
720
- // Prefer a rootless `systemd --user` service + linger; fall back to a system
721
- // unit (via sudoStep) when the user bus is not reachable. `show-environment`
722
- // exits 0 iff the user manager is up — on a headless SSH box with no session
723
- // it fails (exit 1, not 127), which the old `!== 127` test misread as "up".
724
- const userBus = ctx.dryRun ? true : (await ctx.runner.capture('systemctl', ['--user', 'show-environment'])).code === 0;
725
- if (userBus) {
726
- const unitPath = join(homedir(), '.config', 'systemd', 'user', UNIT_NAME);
727
- if (ctx.dryRun) {
728
- ctx.ui.info(`DRY RUN — would write ${unitPath} and enable it (systemctl --user enable --now cezar).`);
729
- }
730
- else {
731
- mkdirSync(join(homedir(), '.config', 'systemd', 'user'), { recursive: true });
732
- writeFileSync(unitPath, systemdUnit(ctx.repoRoot, ctx.state.primaryPort, 'user', execStart, ctx.state.bindHost), 'utf8');
733
- await ctx.runner.interactive('systemctl', ['--user', 'daemon-reload']);
734
- await ctx.runner.interactive('systemctl', ['--user', 'enable', '--now', UNIT_NAME]);
735
- if ((await ctx.runner.capture('systemctl', ['--user', 'is-enabled', UNIT_NAME])).code !== 0) {
736
- ctx.ui.warn('The user service did not enable cleanly — check `systemctl --user status cezar`.');
737
- }
738
- }
739
- // Linger lets the user service survive logout / start at boot — usually
740
- // needs root. Record it as owned only when THIS run turned it on, so
741
- // uninstall reverses exactly what install changed (a pre-existing linger
742
- // may serve other user services).
743
- const osUser = userInfo().username;
744
- const lingerWasOn = await verifyCommand(ctx, 'loginctl', ['show-user', osUser, '-p', 'Linger'], (r) => r.stdout.includes('Linger=yes'));
745
- await sudoStep(ctx, {
746
- description: 'Enable linger so the cockpit starts at boot without a login session.',
747
- command: `loginctl enable-linger ${shquote(osUser)}`,
748
- verify: (c) => verifyCommand(c, 'loginctl', ['show-user', osUser, '-p', 'Linger'], (r) => r.stdout.includes('Linger=yes')),
749
- });
750
- await confirmCezarRunning(ctx, 'systemctl --user status cezar', 'journalctl --user -u cezar -n 50 --no-pager');
751
- const artifacts = [owned('service', { name: UNIT_NAME, scope: 'user', path: unitPath })];
752
- if (!lingerWasOn)
753
- artifacts.push(owned('linger', { name: osUser }));
754
- return { artifacts };
755
- }
756
- // System unit fallback.
757
- await writeFileStep(ctx, {
758
- description: 'Install the cezar systemd unit, start it now, and enable it at boot.',
759
- path: `/etc/systemd/system/${UNIT_NAME}`,
760
- content: systemdUnit(ctx.repoRoot, ctx.state.primaryPort, 'system', execStart, ctx.state.bindHost),
761
- extra: `systemctl daemon-reload && systemctl enable --now ${UNIT_NAME}`,
762
- verify: (c) => verifyCommand(c, 'systemctl', ['is-enabled', UNIT_NAME]),
763
- });
764
- await confirmCezarRunning(ctx, 'sudo systemctl status cezar', 'sudo journalctl -u cezar -n 50 --no-pager');
765
- return { artifacts: [owned('service', { name: UNIT_NAME, scope: 'system', path: `/etc/systemd/system/${UNIT_NAME}` })] };
766
- },
767
- async undo(ctx, created) {
768
- const UNIT_NAME = unitName(ctx);
769
- const svc = (created?.artifacts ?? []).find((a) => a.type === 'service');
770
- // Reverse linger only when install recorded that it enabled it.
771
- const linger = (created?.artifacts ?? []).find((a) => a.type === 'linger');
772
- if (svc?.scope === 'user') {
773
- if (!ctx.dryRun) {
774
- await ctx.runner.interactive('systemctl', ['--user', 'disable', '--now', UNIT_NAME]);
775
- if (svc.path)
776
- rmSync(svc.path, { force: true });
777
- await ctx.runner.interactive('systemctl', ['--user', 'daemon-reload']);
778
- }
779
- else {
780
- ctx.ui.info('DRY RUN — would disable and remove the user service.');
781
- }
782
- }
783
- else if (svc) {
784
- await sudoStep(ctx, {
785
- description: 'Disable and remove the cezar systemd unit.',
786
- command: `systemctl disable --now ${UNIT_NAME}; rm -f /etc/systemd/system/${UNIT_NAME} && systemctl daemon-reload`,
787
- verify: (c) => verifyCommand(c, 'sh', ['-c', `! systemctl is-enabled ${UNIT_NAME}`]),
788
- });
789
- }
790
- if (linger?.name) {
791
- await sudoStep(ctx, {
792
- description: 'Disable linger (this install enabled it; nothing else needs it).',
793
- command: `loginctl disable-linger ${shquote(linger.name)}`,
794
- verify: (c) => verifyCommand(c, 'loginctl', ['show-user', linger.name ?? '', '-p', 'Linger'], (r) => r.stdout.includes('Linger=no')),
795
- });
796
- }
797
- },
798
- };
799
- /**
800
- * `--external-proxy` verification: confirm the cockpit is listening on the
801
- * interface the operator's proxy will dial, then hand them the routing snippet.
802
- * cezar ships no auth of its own, so this is also where we say — unmissably —
803
- * that the front they own has to enforce it.
804
- */
805
- async function verifyBehindExternalProxy(ctx) {
806
- const port = ctx.state.primaryPort;
807
- const host = upstreamHost(ctx);
808
- const target = `http://${host}:${port}`;
809
- const domain = ctx.state.domain ?? '<your-domain>';
810
- if (ctx.dryRun) {
811
- ctx.ui.info(`DRY RUN — would verify cezar answers on ${target} and print the proxy routing snippet.`);
812
- return { artifacts: [] };
813
- }
814
- if (!(await waitForCezar(ctx, port))) {
815
- ctx.ui.error(`cezar is not answering on ${target}.\n\n` +
816
- `Diagnostics on the server:\n` +
817
- ` • systemctl --user status ${unitName(ctx)} (or: sudo systemctl status ${unitName(ctx)})\n` +
818
- ` • sudo ss -ltnp | grep :${port}\n` +
819
- (host === '127.0.0.1'
820
- ? ''
821
- : ` • is ${host} a real local interface? (ip -brief addr) — a container-based proxy\n` +
822
- ` usually reaches the host on the docker bridge, commonly 172.17.0.1\n`));
823
- throw new StepAborted('cockpit verification failed — see the diagnostics above');
824
- }
825
- ctx.ui.success(`Cockpit is up and listening on ${target}.`);
826
- ctx.ui.warn('cezar has NO built-in authentication in this mode — your reverse proxy MUST enforce it. ' +
827
- 'Anyone who can reach ' + target + ' can run agents on this box.');
828
- ctx.ui.message([
829
- `Point your existing proxy at ${target} for ${domain}. For Dokploy / Traefik,`,
830
- `add a file-provider config (Traefik runs in a container, so it cannot use 127.0.0.1):`,
831
- ``,
832
- ` http:`,
833
- ` routers:`,
834
- ` cezar:`,
835
- ` rule: "Host(\`${domain}\`)"`,
836
- ` entryPoints: [websecure]`,
837
- ` middlewares: [cezar-auth]`,
838
- ` service: cezar`,
839
- ` tls: { certResolver: letsencrypt }`,
840
- ` services:`,
841
- ` cezar:`,
842
- ` loadBalancer:`,
843
- ` servers: [{ url: "${target}" }]`,
844
- ` middlewares:`,
845
- ` cezar-auth:`,
846
- ` basicAuth:`,
847
- ` users: ["USER:$$apr1$$...."] # htpasswd -nb user pass (double every $)`,
848
- ``,
849
- `Keep ${host}:${port} off the public internet (ufw / cloud firewall) — the proxy`,
850
- `should be the only thing that can reach it.`,
851
- ].join('\n'));
852
- return { artifacts: [] };
853
- }
854
- const identityStep = {
855
- id: 'identity',
856
- title: 'Verify the cockpit end-to-end (auth + HTTPS reach cezar)',
857
- async check() {
858
- return false; // always re-verify; it creates nothing
859
- },
860
- async run(ctx) {
861
- // External proxy: cezar installed no nginx, so there is no auth challenge of
862
- // ours to probe. All we can (and should) verify is that the cockpit is
863
- // actually listening where the operator's proxy will look for it.
864
- if (ctx.state.externalProxy)
865
- return verifyBehindExternalProxy(ctx);
866
- if (ctx.dryRun) {
867
- ctx.ui.info('DRY RUN — would verify auth (401 for anon) AND that an authenticated request reaches cezar.');
868
- return { artifacts: [] };
869
- }
870
- const port = ctx.state.primaryPort;
871
- const https = ctx.state.publicUrl?.startsWith('https://') ?? false;
872
- const base = https ? 'https://127.0.0.1/' : 'http://127.0.0.1/';
873
- const tls = https ? ['-k'] : [];
874
- // When several instances share nginx, a bare 127.0.0.1 request hits whatever
875
- // vhost nginx treats as default. Send this instance's own Host header so the
876
- // probe verifies THIS cockpit's vhost, not a sibling's.
877
- const host = ctx.state.domain ? ['-H', `Host: ${ctx.state.domain}`] : [];
878
- // 1) Is cezar actually listening on the loopback upstream? nginx challenges
879
- // auth *before* proxying, so an anonymous 401 alone does NOT prove the
880
- // backend is up — check the upstream directly.
881
- const upstreamUp = await isCezarUp(ctx, port);
882
- // 2) An anonymous request through nginx must be challenged (auth is active).
883
- const anonCode = await curlCode(ctx, [...tls, ...host, base]);
884
- const authEnforced = anonCode === '401';
885
- // 3) The real proof: an AUTHENTICATED request reaches cezar (2xx/3xx — not
886
- // 401/403 = bad creds, not 502/504 = upstream down). Credentials are read
887
- // from stdin (curl -K -) so they never land in argv. `null` = not testable
888
- // (a resume where the plaintext password is no longer in memory).
889
- let authedOk = null;
890
- const cred = ctx.prefs.cockpit;
891
- if (cred) {
892
- // curl's config format requires `\` and `"` escaped inside the quoted
893
- // value — both are legal password characters; unescaped they break the
894
- // config parse and fail a WORKING install with "bad credentials".
895
- const curlCfgQuote = (s) => s.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
896
- const code = await curlCode(ctx, [...tls, ...host, '-K', '-', base], {
897
- input: `user = "${curlCfgQuote(cred.user)}:${curlCfgQuote(cred.password)}"\n`,
898
- });
899
- authedOk = /^[23]\d\d$/.test(code);
900
- }
901
- const url = ctx.state.publicUrl ?? `http://<this-server>`;
902
- const coreOk = upstreamUp && authEnforced && authedOk !== false;
903
- if (coreOk) {
904
- ctx.ui.success(`Cockpit is live at ${url} — ${authedOk ? 'an authenticated request reached cezar' : 'auth is enforced and cezar is up'}. ` +
905
- 'Log in with the username and password you set.');
906
- if (!https) {
907
- ctx.ui.warn('This cockpit is HTTP-only (no domain/SSL configured). To serve it over HTTPS with this same auth, ' +
908
- 're-run: cez server-install --platform ubuntu-vps --reconfigure ssl');
909
- }
910
- return { artifacts: [] };
911
- }
912
- const problems = [];
913
- if (!upstreamUp)
914
- problems.push(`cezar is not listening on 127.0.0.1:${port} — the service is down, so nginx returns 502`);
915
- if (!authEnforced)
916
- problems.push(`nginx did not challenge an anonymous request (got "${anonCode}") — basic auth may not be active`);
917
- if (authedOk === false)
918
- problems.push('an authenticated request did not reach cezar (bad credentials, or the upstream is down)');
919
- ctx.ui.error(`The cockpit is NOT fully working yet:\n` +
920
- problems.map((p) => ` • ${p}`).join('\n') +
921
- `\n\nDiagnostics on the server:\n` +
922
- ` • systemctl --user status cezar (or: sudo systemctl status cezar)\n` +
923
- ` • sudo systemctl status nginx && sudo nginx -t\n` +
924
- ` • sudo ss -ltnp | grep -E ':80|:443|:${port}'\n` +
925
- ` • ports 80/443 open in ufw AND any cloud firewall (Hetzner/AWS)`);
926
- // Fail the run so `installed` stays false and the exit code is non-zero —
927
- // "complete" must mean the cockpit actually works. Re-run to resume (the
928
- // service/proxy steps are idempotent).
929
- throw new StepAborted('cockpit verification failed — see the diagnostics above');
930
- },
931
- async undo() {
932
- // nothing created
933
- },
934
- };
935
- export const ubuntuVps = {
936
- id: 'ubuntu-vps',
937
- label: 'Ubuntu/Debian VPS',
938
- async preflight(ctx) {
939
- if (ctx.dryRun) {
940
- ctx.ui.info('DRY RUN — skipping OS/privilege preflight.');
941
- return;
942
- }
943
- const uname = await ctx.runner.capture('uname', ['-s']);
944
- if (!uname.stdout.includes('Linux')) {
945
- throw new PreflightError('ubuntu-vps requires Linux. On macOS use --platform macosx-ngrok.');
946
- }
947
- if ((await ctx.runner.capture('apt-get', ['--version'])).code !== 0) {
948
- throw new PreflightError('ubuntu-vps requires apt (Debian/Ubuntu).');
949
- }
950
- if ((await ctx.runner.capture('id', ['-u'])).stdout.trim() === '0') {
951
- throw new PreflightError('run server-install as a normal sudo-capable user, not root.');
952
- }
953
- // Someone else already owns the HTTP front (Dokploy/Traefik, Coolify, Caddy,
954
- // a hand-rolled nginx)? Installing ours would fight it for :80/:443 and the
955
- // proxy step would fail with a confusing bind error — point at the mode that
956
- // actually fits instead.
957
- if (!ctx.state.externalProxy) {
958
- const holder = await portListener(ctx, 80);
959
- if (holder && !/nginx/i.test(holder)) {
960
- ctx.ui.warn(`Port 80 is already served by "${holder}" on this host.\n` +
961
- `cezar's ubuntu-vps install wants :80/:443 for its own nginx, so these will collide.\n\n` +
962
- `If that is a reverse proxy you rely on (Dokploy/Traefik, Coolify, Caddy), re-run with:\n` +
963
- ` cez server-install --platform ubuntu-vps --external-proxy${ctx.state.domain ? ` --domain ${ctx.state.domain}` : ''} [--bind-host 172.17.0.1]\n` +
964
- `That installs the cezar service only and lets your proxy front it.`);
965
- }
966
- }
967
- },
968
- steps(ctx) {
969
- // `--external-proxy`: the box already has a front owning :80/:443 (Dokploy/
970
- // Traefik, Coolify, Caddy, an existing nginx). Installing our own nginx
971
- // there would fight it for the ports, so we ship the service only and let
972
- // that proxy terminate TLS + auth.
973
- if (ctx.state.externalProxy)
974
- return [depCheckStep(), autostartStep, identityStep];
975
- // deps → proxy → (optional) ssl → autostart → identity.
976
- return [depCheckStep(), nginxProxyStep, sslStep, autostartStep, identityStep];
977
- },
978
- async redeploy(ctx) {
979
- const UNIT_NAME = unitName(ctx);
980
- // Restart the systemd service so it picks up the new cezar (a fresh local
981
- // build the unit runs from, or a newly published cezarion via npx), then
982
- // re-run the same end-to-end verify install uses.
983
- const svc = (ctx.state.steps['autostart']?.created?.artifacts ?? []).find((a) => a.type === 'service');
984
- // No recorded artifact (older record, or the step was check()-satisfied):
985
- // prefer the scope whose unit file actually exists — the user unit is the
986
- // install default, so defaulting to `system` would sudo-restart a unit
987
- // that was never installed.
988
- const userUnitExists = existsSync(join(homedir(), '.config', 'systemd', 'user', UNIT_NAME));
989
- const scope = svc?.scope === 'user' || svc?.scope === 'system' ? svc.scope : userUnitExists ? 'user' : 'system';
990
- // #696: an npx-launched unit re-execs its cached build on restart, so a
991
- // deploy that doesn't invalidate the npx cache never actually updates.
992
- // Clear the cezarion cache first (read the live ExecStart to know the
993
- // launch form); a checkout / global unit is left alone.
994
- refreshNpxCacheForRedeploy(ctx, await readExecStart(ctx, scope, UNIT_NAME));
995
- if (ctx.dryRun) {
996
- ctx.ui.info(`DRY RUN — would reload+restart the cezar ${scope} service and re-verify the cockpit.`);
997
- return;
998
- }
999
- const before = await serviceSnapshot(ctx, scope, UNIT_NAME);
1000
- let sudoUsed = false;
1001
- const fail = (reason) => failedRestart(ctx, scope, UNIT_NAME, reason, sudoUsed);
1002
- const assertFreshActive = async (snapshot) => {
1003
- if (snapshot.active !== 'active')
1004
- await fail(`service is ${snapshot.active ?? 'inactive or unreadable'}`);
1005
- if (before.started === null || snapshot.started === null || snapshot.started === 0n) {
1006
- await fail('start timestamp unavailable; cannot verify a fresh restart');
1007
- }
1008
- if (before.started !== null && snapshot.started !== null && snapshot.started <= before.started) {
1009
- await fail('start timestamp unchanged after restart');
1010
- }
1011
- };
1012
- ctx.ui.info(`Redeploying — restarting the cezar ${scope} service to pick up the new version.`);
1013
- let after;
1014
- if (scope === 'user') {
1015
- await ctx.runner.interactive('systemctl', ['--user', 'daemon-reload']);
1016
- const code = await ctx.runner.interactive('systemctl', ['--user', 'restart', UNIT_NAME]);
1017
- if (code !== 0)
1018
- await fail(`restart returned code ${code}`);
1019
- after = await serviceSnapshot(ctx, scope, UNIT_NAME);
1020
- }
1021
- else {
1022
- let verified;
1023
- let restartCode;
1024
- try {
1025
- await sudoStep(ctx, {
1026
- description: 'Reload systemd and restart the cezar service.',
1027
- command: `systemctl daemon-reload && systemctl restart ${UNIT_NAME}`,
1028
- verify: async (c, commandCode) => {
1029
- restartCode = commandCode;
1030
- if (commandCode !== undefined)
1031
- sudoUsed = true;
1032
- verified = await serviceSnapshot(c, scope, UNIT_NAME);
1033
- return (commandCode === undefined || commandCode === 0) &&
1034
- verified.active === 'active' && before.started !== null && verified.started !== null && verified.started > before.started;
1035
- },
1036
- });
1037
- }
1038
- catch (err) {
1039
- if (!(err instanceof StepAborted))
1040
- throw err;
1041
- const reason = restartCode !== undefined && restartCode !== 0
1042
- ? `restart returned code ${restartCode}`
1043
- : verified?.active !== 'active'
1044
- ? `service is ${verified?.active ?? 'inactive or unreadable'}`
1045
- : before.started === null || verified.started === null
1046
- ? 'start timestamp unavailable; cannot verify a fresh restart'
1047
- : 'start timestamp unchanged after restart';
1048
- await fail(reason);
1049
- }
1050
- after = verified ?? await serviceSnapshot(ctx, scope, UNIT_NAME);
1051
- }
1052
- await assertFreshActive(after);
1053
- await confirmCezarRunning(ctx, scope === 'user' ? `systemctl --user status ${UNIT_NAME}` : `sudo systemctl status ${UNIT_NAME}`, scope === 'user' ? `journalctl --user -u ${UNIT_NAME} -n 50 --no-pager` : `sudo journalctl -u ${UNIT_NAME} -n 50 --no-pager`);
1054
- try {
1055
- await identityStep.run(ctx);
1056
- }
1057
- catch (err) {
1058
- if (!(err instanceof StepAborted))
1059
- throw err;
1060
- const current = await serviceSnapshot(ctx, scope, UNIT_NAME);
1061
- await fail(`cockpit verification failed: ${err.message}; service is ${current.active ?? 'unreadable'}`);
1062
- }
1063
- await assertFreshActive(await serviceSnapshot(ctx, scope, UNIT_NAME));
1064
- },
1065
- };
1066
- //# sourceMappingURL=ubuntu-vps.js.map