@wjarka/cezarion 0.10.0-pr30.54

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 (478) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +838 -0
  3. package/dist/agent-config/account-identity.d.ts +44 -0
  4. package/dist/agent-config/account-identity.js +128 -0
  5. package/dist/agent-config/account-identity.js.map +1 -0
  6. package/dist/agent-config/catalog.d.ts +72 -0
  7. package/dist/agent-config/catalog.js +223 -0
  8. package/dist/agent-config/catalog.js.map +1 -0
  9. package/dist/agent-config/files.d.ts +46 -0
  10. package/dist/agent-config/files.js +119 -0
  11. package/dist/agent-config/files.js.map +1 -0
  12. package/dist/agent-config/model-settings/claude.d.ts +2 -0
  13. package/dist/agent-config/model-settings/claude.js +11 -0
  14. package/dist/agent-config/model-settings/claude.js.map +1 -0
  15. package/dist/agent-config/model-settings/codex.d.ts +2 -0
  16. package/dist/agent-config/model-settings/codex.js +16 -0
  17. package/dist/agent-config/model-settings/codex.js.map +1 -0
  18. package/dist/agent-config/model-settings/opencode.d.ts +2 -0
  19. package/dist/agent-config/model-settings/opencode.js +8 -0
  20. package/dist/agent-config/model-settings/opencode.js.map +1 -0
  21. package/dist/agent-config/model-settings/pi.d.ts +12 -0
  22. package/dist/agent-config/model-settings/pi.js +18 -0
  23. package/dist/agent-config/model-settings/pi.js.map +1 -0
  24. package/dist/agent-config/model-settings/shared.d.ts +9 -0
  25. package/dist/agent-config/model-settings/shared.js +93 -0
  26. package/dist/agent-config/model-settings/shared.js.map +1 -0
  27. package/dist/agent-config/model-settings/types.d.ts +9 -0
  28. package/dist/agent-config/model-settings/types.js +2 -0
  29. package/dist/agent-config/model-settings/types.js.map +1 -0
  30. package/dist/agent-config/models.d.ts +9 -0
  31. package/dist/agent-config/models.js +32 -0
  32. package/dist/agent-config/models.js.map +1 -0
  33. package/dist/agent-config/seed.d.ts +7 -0
  34. package/dist/agent-config/seed.js +90 -0
  35. package/dist/agent-config/seed.js.map +1 -0
  36. package/dist/agent-config/service.d.ts +44 -0
  37. package/dist/agent-config/service.js +71 -0
  38. package/dist/agent-config/service.js.map +1 -0
  39. package/dist/agent-config/validate.d.ts +21 -0
  40. package/dist/agent-config/validate.js +76 -0
  41. package/dist/agent-config/validate.js.map +1 -0
  42. package/dist/automations/coordinator.d.ts +26 -0
  43. package/dist/automations/coordinator.js +66 -0
  44. package/dist/automations/coordinator.js.map +1 -0
  45. package/dist/automations/github-poller.d.ts +74 -0
  46. package/dist/automations/github-poller.js +234 -0
  47. package/dist/automations/github-poller.js.map +1 -0
  48. package/dist/automations/scheduler.d.ts +42 -0
  49. package/dist/automations/scheduler.js +192 -0
  50. package/dist/automations/scheduler.js.map +1 -0
  51. package/dist/automations/store.d.ts +65 -0
  52. package/dist/automations/store.js +298 -0
  53. package/dist/automations/store.js.map +1 -0
  54. package/dist/automations/task-template.d.ts +18 -0
  55. package/dist/automations/task-template.js +95 -0
  56. package/dist/automations/task-template.js.map +1 -0
  57. package/dist/automations/types.d.ts +255 -0
  58. package/dist/automations/types.js +159 -0
  59. package/dist/automations/types.js.map +1 -0
  60. package/dist/config.d.ts +77 -0
  61. package/dist/config.js +242 -0
  62. package/dist/config.js.map +1 -0
  63. package/dist/contract/agent-config.d.ts +153 -0
  64. package/dist/contract/agent-profiles.d.ts +347 -0
  65. package/dist/contract/automations.d.ts +935 -0
  66. package/dist/contract/events.d.ts +104 -0
  67. package/dist/contract/github.d.ts +556 -0
  68. package/dist/contract/health.d.ts +102 -0
  69. package/dist/contract/index.d.ts +16 -0
  70. package/dist/contract/index.js +1895 -0
  71. package/dist/contract/projects.d.ts +210 -0
  72. package/dist/contract/repo.d.ts +234 -0
  73. package/dist/contract/runs.d.ts +1473 -0
  74. package/dist/contract/skills.d.ts +232 -0
  75. package/dist/contract/workflows.d.ts +218 -0
  76. package/dist/contract/workspace.d.ts +579 -0
  77. package/dist/core/agent-env.d.ts +31 -0
  78. package/dist/core/agent-env.js +371 -0
  79. package/dist/core/agent-env.js.map +1 -0
  80. package/dist/core/agent-model-policy.d.ts +10 -0
  81. package/dist/core/agent-model-policy.js +36 -0
  82. package/dist/core/agent-model-policy.js.map +1 -0
  83. package/dist/core/agent-profiles.d.ts +62 -0
  84. package/dist/core/agent-profiles.js +90 -0
  85. package/dist/core/agent-profiles.js.map +1 -0
  86. package/dist/core/agent-runner.d.ts +211 -0
  87. package/dist/core/agent-runner.js +68 -0
  88. package/dist/core/agent-runner.js.map +1 -0
  89. package/dist/core/ask.d.ts +105 -0
  90. package/dist/core/ask.js +187 -0
  91. package/dist/core/ask.js.map +1 -0
  92. package/dist/core/backend-detect.d.ts +16 -0
  93. package/dist/core/backend-detect.js +155 -0
  94. package/dist/core/backend-detect.js.map +1 -0
  95. package/dist/core/claude-cli-runner.d.ts +59 -0
  96. package/dist/core/claude-cli-runner.js +483 -0
  97. package/dist/core/claude-cli-runner.js.map +1 -0
  98. package/dist/core/claude-ui-mapper.d.ts +80 -0
  99. package/dist/core/claude-ui-mapper.js +598 -0
  100. package/dist/core/claude-ui-mapper.js.map +1 -0
  101. package/dist/core/codex-app-server-runner.d.ts +41 -0
  102. package/dist/core/codex-app-server-runner.js +584 -0
  103. package/dist/core/codex-app-server-runner.js.map +1 -0
  104. package/dist/core/codex-app-server-transport.d.ts +35 -0
  105. package/dist/core/codex-app-server-transport.js +150 -0
  106. package/dist/core/codex-app-server-transport.js.map +1 -0
  107. package/dist/core/codex-model-catalog.d.ts +10 -0
  108. package/dist/core/codex-model-catalog.js +110 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -0
  110. package/dist/core/codex-ui-mapper.d.ts +112 -0
  111. package/dist/core/codex-ui-mapper.js +766 -0
  112. package/dist/core/codex-ui-mapper.js.map +1 -0
  113. package/dist/core/model-identity.d.ts +125 -0
  114. package/dist/core/model-identity.js +132 -0
  115. package/dist/core/model-identity.js.map +1 -0
  116. package/dist/core/model-presets.d.ts +21 -0
  117. package/dist/core/model-presets.js +81 -0
  118. package/dist/core/model-presets.js.map +1 -0
  119. package/dist/core/ndjson.d.ts +6 -0
  120. package/dist/core/ndjson.js +23 -0
  121. package/dist/core/ndjson.js.map +1 -0
  122. package/dist/core/opencode-model-catalog.d.ts +32 -0
  123. package/dist/core/opencode-model-catalog.js +153 -0
  124. package/dist/core/opencode-model-catalog.js.map +1 -0
  125. package/dist/core/opencode-server-runner.d.ts +32 -0
  126. package/dist/core/opencode-server-runner.js +882 -0
  127. package/dist/core/opencode-server-runner.js.map +1 -0
  128. package/dist/core/opencode-ui-mapper.d.ts +137 -0
  129. package/dist/core/opencode-ui-mapper.js +800 -0
  130. package/dist/core/opencode-ui-mapper.js.map +1 -0
  131. package/dist/core/pi-model-catalog.d.ts +31 -0
  132. package/dist/core/pi-model-catalog.js +152 -0
  133. package/dist/core/pi-model-catalog.js.map +1 -0
  134. package/dist/core/pi-runner.d.ts +24 -0
  135. package/dist/core/pi-runner.js +403 -0
  136. package/dist/core/pi-runner.js.map +1 -0
  137. package/dist/core/pi-ui-mapper.d.ts +36 -0
  138. package/dist/core/pi-ui-mapper.js +304 -0
  139. package/dist/core/pi-ui-mapper.js.map +1 -0
  140. package/dist/core/process-usage.d.ts +66 -0
  141. package/dist/core/process-usage.js +193 -0
  142. package/dist/core/process-usage.js.map +1 -0
  143. package/dist/core/provider-auth.d.ts +154 -0
  144. package/dist/core/provider-auth.js +509 -0
  145. package/dist/core/provider-auth.js.map +1 -0
  146. package/dist/core/provider-availability.d.ts +3 -0
  147. package/dist/core/provider-availability.js +14 -0
  148. package/dist/core/provider-availability.js.map +1 -0
  149. package/dist/core/runner-factory.d.ts +8 -0
  150. package/dist/core/runner-factory.js +25 -0
  151. package/dist/core/runner-factory.js.map +1 -0
  152. package/dist/core/runner-model-catalog.d.ts +29 -0
  153. package/dist/core/runner-model-catalog.js +78 -0
  154. package/dist/core/runner-model-catalog.js.map +1 -0
  155. package/dist/core/secret-redaction.d.ts +37 -0
  156. package/dist/core/secret-redaction.js +115 -0
  157. package/dist/core/secret-redaction.js.map +1 -0
  158. package/dist/core/shell-env.d.ts +28 -0
  159. package/dist/core/shell-env.js +56 -0
  160. package/dist/core/shell-env.js.map +1 -0
  161. package/dist/core/tool-display.d.ts +31 -0
  162. package/dist/core/tool-display.js +179 -0
  163. package/dist/core/tool-display.js.map +1 -0
  164. package/dist/core/ui-events.d.ts +335 -0
  165. package/dist/core/ui-events.js +25 -0
  166. package/dist/core/ui-events.js.map +1 -0
  167. package/dist/core/usage-limit.d.ts +42 -0
  168. package/dist/core/usage-limit.js +209 -0
  169. package/dist/core/usage-limit.js.map +1 -0
  170. package/dist/core/usage.d.ts +11 -0
  171. package/dist/core/usage.js +15 -0
  172. package/dist/core/usage.js.map +1 -0
  173. package/dist/core/v1-text-coalescer.d.ts +36 -0
  174. package/dist/core/v1-text-coalescer.js +72 -0
  175. package/dist/core/v1-text-coalescer.js.map +1 -0
  176. package/dist/git-diff-base.d.ts +85 -0
  177. package/dist/git-diff-base.js +180 -0
  178. package/dist/git-diff-base.js.map +1 -0
  179. package/dist/git-refs.d.ts +11 -0
  180. package/dist/git-refs.js +14 -0
  181. package/dist/git-refs.js.map +1 -0
  182. package/dist/git-worktree.d.ts +161 -0
  183. package/dist/git-worktree.js +508 -0
  184. package/dist/git-worktree.js.map +1 -0
  185. package/dist/handoff.d.ts +62 -0
  186. package/dist/handoff.js +154 -0
  187. package/dist/handoff.js.map +1 -0
  188. package/dist/index.d.ts +2 -0
  189. package/dist/index.js +680 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/install-as-command.d.ts +40 -0
  192. package/dist/install-as-command.js +52 -0
  193. package/dist/install-as-command.js.map +1 -0
  194. package/dist/pack-check.d.ts +17 -0
  195. package/dist/pack-check.js +27 -0
  196. package/dist/pack-check.js.map +1 -0
  197. package/dist/paths.d.ts +140 -0
  198. package/dist/paths.js +192 -0
  199. package/dist/paths.js.map +1 -0
  200. package/dist/planner.d.ts +27 -0
  201. package/dist/planner.js +268 -0
  202. package/dist/planner.js.map +1 -0
  203. package/dist/release/manifests.d.ts +81 -0
  204. package/dist/release/manifests.js +74 -0
  205. package/dist/release/manifests.js.map +1 -0
  206. package/dist/release/snapshot.d.ts +67 -0
  207. package/dist/release/snapshot.js +97 -0
  208. package/dist/release/snapshot.js.map +1 -0
  209. package/dist/release/stable.d.ts +38 -0
  210. package/dist/release/stable.js +55 -0
  211. package/dist/release/stable.js.map +1 -0
  212. package/dist/runs/agent-tmpdir.d.ts +41 -0
  213. package/dist/runs/agent-tmpdir.js +183 -0
  214. package/dist/runs/agent-tmpdir.js.map +1 -0
  215. package/dist/runs/auto-name.d.ts +75 -0
  216. package/dist/runs/auto-name.js +179 -0
  217. package/dist/runs/auto-name.js.map +1 -0
  218. package/dist/runs/event-history.d.ts +50 -0
  219. package/dist/runs/event-history.js +613 -0
  220. package/dist/runs/event-history.js.map +1 -0
  221. package/dist/runs/retention.d.ts +60 -0
  222. package/dist/runs/retention.js +86 -0
  223. package/dist/runs/retention.js.map +1 -0
  224. package/dist/runs/review-gate.d.ts +18 -0
  225. package/dist/runs/review-gate.js +21 -0
  226. package/dist/runs/review-gate.js.map +1 -0
  227. package/dist/runs/run-index.d.ts +19 -0
  228. package/dist/runs/run-index.js +43 -0
  229. package/dist/runs/run-index.js.map +1 -0
  230. package/dist/runs/store.d.ts +446 -0
  231. package/dist/runs/store.js +1118 -0
  232. package/dist/runs/store.js.map +1 -0
  233. package/dist/runs/task-markers.d.ts +28 -0
  234. package/dist/runs/task-markers.js +74 -0
  235. package/dist/runs/task-markers.js.map +1 -0
  236. package/dist/runs/task-refs.d.ts +25 -0
  237. package/dist/runs/task-refs.js +74 -0
  238. package/dist/runs/task-refs.js.map +1 -0
  239. package/dist/runs/ui-event-sink.d.ts +81 -0
  240. package/dist/runs/ui-event-sink.js +210 -0
  241. package/dist/runs/ui-event-sink.js.map +1 -0
  242. package/dist/server/app-type.d.ts +21 -0
  243. package/dist/server/app-type.js +2 -0
  244. package/dist/server/app-type.js.map +1 -0
  245. package/dist/server/capabilities.d.ts +70 -0
  246. package/dist/server/capabilities.js +152 -0
  247. package/dist/server/capabilities.js.map +1 -0
  248. package/dist/server/checkout.d.ts +128 -0
  249. package/dist/server/checkout.js +296 -0
  250. package/dist/server/checkout.js.map +1 -0
  251. package/dist/server/forge/github.d.ts +513 -0
  252. package/dist/server/forge/github.js +2364 -0
  253. package/dist/server/forge/github.js.map +1 -0
  254. package/dist/server/forge/index.d.ts +40 -0
  255. package/dist/server/forge/index.js +72 -0
  256. package/dist/server/forge/index.js.map +1 -0
  257. package/dist/server/forge/types.d.ts +242 -0
  258. package/dist/server/forge/types.js +2 -0
  259. package/dist/server/forge/types.js.map +1 -0
  260. package/dist/server/fs-browse.d.ts +105 -0
  261. package/dist/server/fs-browse.js +182 -0
  262. package/dist/server/fs-browse.js.map +1 -0
  263. package/dist/server/git-changes.d.ts +213 -0
  264. package/dist/server/git-changes.js +555 -0
  265. package/dist/server/git-changes.js.map +1 -0
  266. package/dist/server/git.d.ts +28 -0
  267. package/dist/server/git.js +112 -0
  268. package/dist/server/git.js.map +1 -0
  269. package/dist/server/github.d.ts +9 -0
  270. package/dist/server/github.js +8 -0
  271. package/dist/server/github.js.map +1 -0
  272. package/dist/server/launch-key.d.ts +7 -0
  273. package/dist/server/launch-key.js +33 -0
  274. package/dist/server/launch-key.js.map +1 -0
  275. package/dist/server/open-in-app.d.ts +66 -0
  276. package/dist/server/open-in-app.js +211 -0
  277. package/dist/server/open-in-app.js.map +1 -0
  278. package/dist/server/open-in-terminal.d.ts +70 -0
  279. package/dist/server/open-in-terminal.js +179 -0
  280. package/dist/server/open-in-terminal.js.map +1 -0
  281. package/dist/server/pr.d.ts +7 -0
  282. package/dist/server/pr.js +7 -0
  283. package/dist/server/pr.js.map +1 -0
  284. package/dist/server/project-context.d.ts +120 -0
  285. package/dist/server/project-context.js +182 -0
  286. package/dist/server/project-context.js.map +1 -0
  287. package/dist/server/provider-action-gate.d.ts +8 -0
  288. package/dist/server/provider-action-gate.js +56 -0
  289. package/dist/server/provider-action-gate.js.map +1 -0
  290. package/dist/server/provider-auth-runtime.d.ts +21 -0
  291. package/dist/server/provider-auth-runtime.js +66 -0
  292. package/dist/server/provider-auth-runtime.js.map +1 -0
  293. package/dist/server/server.d.ts +13138 -0
  294. package/dist/server/server.js +5263 -0
  295. package/dist/server/server.js.map +1 -0
  296. package/dist/server/static-ui.d.ts +49 -0
  297. package/dist/server/static-ui.js +92 -0
  298. package/dist/server/static-ui.js.map +1 -0
  299. package/dist/server/validators.d.ts +97 -0
  300. package/dist/server/validators.js +86 -0
  301. package/dist/server/validators.js.map +1 -0
  302. package/dist/server/ws.d.ts +85 -0
  303. package/dist/server/ws.js +218 -0
  304. package/dist/server/ws.js.map +1 -0
  305. package/dist/server/wsl.d.ts +25 -0
  306. package/dist/server/wsl.js +92 -0
  307. package/dist/server/wsl.js.map +1 -0
  308. package/dist/server-install/engine.d.ts +50 -0
  309. package/dist/server-install/engine.js +324 -0
  310. package/dist/server-install/engine.js.map +1 -0
  311. package/dist/server-install/platforms/macosx-ngrok.d.ts +6 -0
  312. package/dist/server-install/platforms/macosx-ngrok.js +345 -0
  313. package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
  314. package/dist/server-install/platforms/ubuntu-vps.d.ts +78 -0
  315. package/dist/server-install/platforms/ubuntu-vps.js +1016 -0
  316. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
  317. package/dist/server-install/state.d.ts +52 -0
  318. package/dist/server-install/state.js +182 -0
  319. package/dist/server-install/state.js.map +1 -0
  320. package/dist/server-install/steps.d.ts +109 -0
  321. package/dist/server-install/steps.js +334 -0
  322. package/dist/server-install/steps.js.map +1 -0
  323. package/dist/server-install/strategies.d.ts +4 -0
  324. package/dist/server-install/strategies.js +20 -0
  325. package/dist/server-install/strategies.js.map +1 -0
  326. package/dist/server-install/types.d.ts +287 -0
  327. package/dist/server-install/types.js +121 -0
  328. package/dist/server-install/types.js.map +1 -0
  329. package/dist/server-install/ui.d.ts +42 -0
  330. package/dist/server-install/ui.js +130 -0
  331. package/dist/server-install/ui.js.map +1 -0
  332. package/dist/skills-banner.d.ts +22 -0
  333. package/dist/skills-banner.js +41 -0
  334. package/dist/skills-banner.js.map +1 -0
  335. package/dist/skills-remote.d.ts +84 -0
  336. package/dist/skills-remote.js +468 -0
  337. package/dist/skills-remote.js.map +1 -0
  338. package/dist/skills-update.d.ts +88 -0
  339. package/dist/skills-update.js +392 -0
  340. package/dist/skills-update.js.map +1 -0
  341. package/dist/skills.d.ts +82 -0
  342. package/dist/skills.js +251 -0
  343. package/dist/skills.js.map +1 -0
  344. package/dist/todos.d.ts +48 -0
  345. package/dist/todos.js +201 -0
  346. package/dist/todos.js.map +1 -0
  347. package/dist/ui-state.d.ts +26 -0
  348. package/dist/ui-state.js +38 -0
  349. package/dist/ui-state.js.map +1 -0
  350. package/dist/update-check.d.ts +12 -0
  351. package/dist/update-check.js +41 -0
  352. package/dist/update-check.js.map +1 -0
  353. package/dist/workflows/load.d.ts +15 -0
  354. package/dist/workflows/load.js +56 -0
  355. package/dist/workflows/load.js.map +1 -0
  356. package/dist/workflows/run.d.ts +758 -0
  357. package/dist/workflows/run.js +3389 -0
  358. package/dist/workflows/run.js.map +1 -0
  359. package/dist/workflows/types.d.ts +153 -0
  360. package/dist/workflows/types.js +212 -0
  361. package/dist/workflows/types.js.map +1 -0
  362. package/dist/workspace/agent-accounts.d.ts +153 -0
  363. package/dist/workspace/agent-accounts.js +304 -0
  364. package/dist/workspace/agent-accounts.js.map +1 -0
  365. package/dist/workspace/agent-profiles.d.ts +78 -0
  366. package/dist/workspace/agent-profiles.js +115 -0
  367. package/dist/workspace/agent-profiles.js.map +1 -0
  368. package/dist/workspace/config.d.ts +169 -0
  369. package/dist/workspace/config.js +379 -0
  370. package/dist/workspace/config.js.map +1 -0
  371. package/dist/workspace/migrations.d.ts +45 -0
  372. package/dist/workspace/migrations.js +147 -0
  373. package/dist/workspace/migrations.js.map +1 -0
  374. package/dist/workspace/projects-cli.d.ts +25 -0
  375. package/dist/workspace/projects-cli.js +172 -0
  376. package/dist/workspace/projects-cli.js.map +1 -0
  377. package/dist/workspace/projects.d.ts +109 -0
  378. package/dist/workspace/projects.js +250 -0
  379. package/dist/workspace/projects.js.map +1 -0
  380. package/dist/workspace/semaphore.d.ts +179 -0
  381. package/dist/workspace/semaphore.js +195 -0
  382. package/dist/workspace/semaphore.js.map +1 -0
  383. package/dist/workspace/ui-state.d.ts +34 -0
  384. package/dist/workspace/ui-state.js +53 -0
  385. package/dist/workspace/ui-state.js.map +1 -0
  386. package/package.json +70 -0
  387. package/scripts/check-pack.mjs +46 -0
  388. package/scripts/inline-contract.mjs +112 -0
  389. package/scripts/install-as-command.mjs +120 -0
  390. package/scripts/mock-claude.mjs +520 -0
  391. package/scripts/mock-pi-rpc.mjs +83 -0
  392. package/scripts/sync-readme.mjs +20 -0
  393. package/scripts/test-process-usage.mjs +47 -0
  394. package/web/dist/assets/alert-dialog-B4Ofsgv7.js +1 -0
  395. package/web/dist/assets/arrow-down-Dy8dup7j.js +1 -0
  396. package/web/dist/assets/arrow-left-BJaucbhn.js +1 -0
  397. package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
  398. package/web/dist/assets/centered-state-duPW0phQ.js +43 -0
  399. package/web/dist/assets/chevron-right-Be4A5TCS.js +1 -0
  400. package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
  401. package/web/dist/assets/collapsible-DdcNBdSk.js +1 -0
  402. package/web/dist/assets/commit-list-CgvN9vec.js +1 -0
  403. package/web/dist/assets/compare-variants-CQA2nd65.js +1 -0
  404. package/web/dist/assets/core-BCsw8oQw.js +12 -0
  405. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  406. package/web/dist/assets/diff-B6Agp5Hl.js +3 -0
  407. package/web/dist/assets/diff-stat-BoXuGkgq.js +1 -0
  408. package/web/dist/assets/diff-view-CD8XI-fj.js +6 -0
  409. package/web/dist/assets/diff-woXpYk--.js +1 -0
  410. package/web/dist/assets/dropdown-menu-B3SYw-k5.js +1 -0
  411. package/web/dist/assets/editable-title-B-hjp5wl.js +1 -0
  412. package/web/dist/assets/ellipsis-vertical-BYwzw0xl.js +1 -0
  413. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  414. package/web/dist/assets/file-BRj5eISx.js +1 -0
  415. package/web/dist/assets/folder-z4oT5981.js +1 -0
  416. package/web/dist/assets/git-toolbar-owSEkYld.js +1 -0
  417. package/web/dist/assets/github-Bz2VgRX3.js +1 -0
  418. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  419. package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
  420. package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
  421. package/web/dist/assets/html-BY76lXLH.js +1 -0
  422. package/web/dist/assets/image-preview-h3WFluuy.js +1 -0
  423. package/web/dist/assets/index-BbcQNT92.css +2 -0
  424. package/web/dist/assets/index-EtQQQ6Kj.js +7 -0
  425. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  426. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  427. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  428. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  429. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  430. package/web/dist/assets/json-qhed-kSA.js +1 -0
  431. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  432. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  433. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  434. package/web/dist/assets/lib-BxQXEXDF.js +1 -0
  435. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  436. package/web/dist/assets/markdown-DqBKYPiB.js +2 -0
  437. package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
  438. package/web/dist/assets/new-task-form-BdJKRBJX.js +1 -0
  439. package/web/dist/assets/pill-BQfmfpYp.js +1 -0
  440. package/web/dist/assets/project-router-DxgFZY1l.js +1 -0
  441. package/web/dist/assets/prompt-templates-B6m16gq-.js +15 -0
  442. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  443. package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
  444. package/web/dist/assets/refresh-cw-mhSpxf2a.js +1 -0
  445. package/web/dist/assets/repo-git-CUNRxR3_.js +1 -0
  446. package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  447. package/web/dist/assets/run-diff-DsmmDVfx.js +3 -0
  448. package/web/dist/assets/run-header-BkhrseLJ.js +1 -0
  449. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  450. package/web/dist/assets/search-x-BqDMB2g8.js +1 -0
  451. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  452. package/web/dist/assets/skill-empty-hint-BWEvTggc.js +1 -0
  453. package/web/dist/assets/skills-9oR_oHse.js +1 -0
  454. package/web/dist/assets/skills-DwIxnnWO.js +1 -0
  455. package/web/dist/assets/sparkles-DIoTQpyx.js +1 -0
  456. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  457. package/web/dist/assets/square-terminal-Cc7CuQxc.js +1 -0
  458. package/web/dist/assets/tab-link-D1fQgpmO.js +1 -0
  459. package/web/dist/assets/task-changes-BKeLlDpK.js +1 -0
  460. package/web/dist/assets/task-commits-gcEFZIa5.js +1 -0
  461. package/web/dist/assets/task-files-BGAqoXTW.js +2 -0
  462. package/web/dist/assets/task-thread-DT8aUYTS.js +9 -0
  463. package/web/dist/assets/textarea-BOVbfy5C.js +1 -0
  464. package/web/dist/assets/thread-loading-CypW73KD.js +1 -0
  465. package/web/dist/assets/toml-CcmNWLt0.js +1 -0
  466. package/web/dist/assets/trash-2-CJq6LHWn.js +1 -0
  467. package/web/dist/assets/triangle-alert-CjDFvU27.js +1 -0
  468. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  469. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  470. package/web/dist/assets/upload-CPDZlJeK.js +1 -0
  471. package/web/dist/assets/use-desktop-5JsLmi0a.js +1 -0
  472. package/web/dist/assets/use-submit-shortcut-CHVFevty.js +1 -0
  473. package/web/dist/assets/utils-DiO6zyJd.js +64 -0
  474. package/web/dist/assets/workflows-rQDFzWRt.js +11 -0
  475. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  476. package/web/dist/assets/zoomable-image-COWqb11v.js +1 -0
  477. package/web/dist/index.html +80 -0
  478. package/web/dist/open-mercato.svg +11 -0
@@ -0,0 +1,34 @@
1
+ import type { WorkspaceUiState } from '../contract/index.js';
2
+ /**
3
+ * `~/.cezar/ui-state.json` — global GUI state, the workspace twin of the
4
+ * per-repo `.ai/cezar/ui-state.json` (spec 2026-07-20-multi-project-workspace,
5
+ * Data Model). Same split as `src/ui-state.ts`: this module owns the tolerant
6
+ * read and the atomic write; the schema and key cap live at the route boundary
7
+ * (`GET/PUT /api/workspace/ui-state`, step 2.7). The state is an opaque
8
+ * `.passthrough()`-style bag — cross-project prefs (appearance, notifications,
9
+ * curated skills) live here; project-scoped prefs stay in each repo's own file,
10
+ * and prefs that describe the BROWSER rather than the workspace (sidebar
11
+ * collapse, the last visited location) stay in that browser's localStorage.
12
+ */
13
+ /** Read `~/.cezar/ui-state.json` on demand — never cached, never throws.
14
+ * Missing, unreadable, malformed, or non-object all degrade to `{}`.
15
+ *
16
+ * Typed by the CONTRACT (`WorkspaceUiState`) for the same reason as its per-repo twin in
17
+ * `src/ui-state.ts`: `GET /api/v1/workspace/ui-state` answers this value verbatim, so a loose
18
+ * record left the route naming no key. The schema is a `z.looseObject`, so unknown prefs keep
19
+ * round-tripping (BACKWARD_COMPATIBILITY.md §3) — the type only adds the known names. */
20
+ export declare function readWorkspaceUiState(path?: string): Promise<WorkspaceUiState>;
21
+ /**
22
+ * Read-modify-write for `~/.cezar/ui-state.json`, written with the same atomic
23
+ * per-writer tmp+rename `0600` pattern (dir `0700`) as
24
+ * `mergeWriteWorkspaceConfig` (`atomicWriteJsonSync` — one shared writer, so
25
+ * the unique-tmp rule cannot drift between the two files). A missing or
26
+ * corrupt file merges from `{}`. The mutator may mutate its argument in place
27
+ * or return a replacement. Throws on write failure (e.g. a read-only home) —
28
+ * degrading is the caller's policy, per house rules.
29
+ *
30
+ * Path resolved once, before the `await`, for the same reason as
31
+ * `mergeWriteWorkspaceConfig`: a `CEZ_HOME` that changes mid-flight must not be
32
+ * able to send the read and the write to two different files.
33
+ */
34
+ export declare function mergeWriteWorkspaceUiState(mutator: (state: WorkspaceUiState) => WorkspaceUiState | void): Promise<WorkspaceUiState>;
@@ -0,0 +1,53 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { workspaceUiStatePath } from '../paths.js';
3
+ import { atomicWriteJsonSync } from './config.js';
4
+ /**
5
+ * `~/.cezar/ui-state.json` — global GUI state, the workspace twin of the
6
+ * per-repo `.ai/cezar/ui-state.json` (spec 2026-07-20-multi-project-workspace,
7
+ * Data Model). Same split as `src/ui-state.ts`: this module owns the tolerant
8
+ * read and the atomic write; the schema and key cap live at the route boundary
9
+ * (`GET/PUT /api/workspace/ui-state`, step 2.7). The state is an opaque
10
+ * `.passthrough()`-style bag — cross-project prefs (appearance, notifications,
11
+ * curated skills) live here; project-scoped prefs stay in each repo's own file,
12
+ * and prefs that describe the BROWSER rather than the workspace (sidebar
13
+ * collapse, the last visited location) stay in that browser's localStorage.
14
+ */
15
+ /** Read `~/.cezar/ui-state.json` on demand — never cached, never throws.
16
+ * Missing, unreadable, malformed, or non-object all degrade to `{}`.
17
+ *
18
+ * Typed by the CONTRACT (`WorkspaceUiState`) for the same reason as its per-repo twin in
19
+ * `src/ui-state.ts`: `GET /api/v1/workspace/ui-state` answers this value verbatim, so a loose
20
+ * record left the route naming no key. The schema is a `z.looseObject`, so unknown prefs keep
21
+ * round-tripping (BACKWARD_COMPATIBILITY.md §3) — the type only adds the known names. */
22
+ export async function readWorkspaceUiState(path = workspaceUiStatePath()) {
23
+ try {
24
+ const parsed = JSON.parse(await readFile(path, 'utf8'));
25
+ return parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)
26
+ ? parsed
27
+ : {};
28
+ }
29
+ catch {
30
+ return {};
31
+ }
32
+ }
33
+ /**
34
+ * Read-modify-write for `~/.cezar/ui-state.json`, written with the same atomic
35
+ * per-writer tmp+rename `0600` pattern (dir `0700`) as
36
+ * `mergeWriteWorkspaceConfig` (`atomicWriteJsonSync` — one shared writer, so
37
+ * the unique-tmp rule cannot drift between the two files). A missing or
38
+ * corrupt file merges from `{}`. The mutator may mutate its argument in place
39
+ * or return a replacement. Throws on write failure (e.g. a read-only home) —
40
+ * degrading is the caller's policy, per house rules.
41
+ *
42
+ * Path resolved once, before the `await`, for the same reason as
43
+ * `mergeWriteWorkspaceConfig`: a `CEZ_HOME` that changes mid-flight must not be
44
+ * able to send the read and the write to two different files.
45
+ */
46
+ export async function mergeWriteWorkspaceUiState(mutator) {
47
+ const path = workspaceUiStatePath();
48
+ const current = await readWorkspaceUiState(path);
49
+ const next = mutator(current) ?? current;
50
+ atomicWriteJsonSync(path, next);
51
+ return next;
52
+ }
53
+ //# sourceMappingURL=ui-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../src/workspace/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;GAUG;AAEH;;;;;;0FAM0F;AAC1F,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAI,GAAW,oBAAoB,EAAE;IAErC,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC5E,CAAC,CAAE,MAA2B;YAC9B,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAA6D;IAE7D,MAAM,IAAI,GAAG,oBAAoB,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@wjarka/cezarion",
3
+ "version": "0.10.0-pr30.54",
4
+ "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "cezarion": "dist/index.js",
9
+ "cez": "dist/index.js"
10
+ },
11
+ "exports": {
12
+ ".": "./dist/index.js",
13
+ "./app-type": "./dist/server/app-type.js",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "web/dist",
19
+ "scripts",
20
+ "README.md"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "scripts": {
26
+ "prebuild": "node scripts/sync-readme.mjs",
27
+ "build": "tsc",
28
+ "check:pack": "node scripts/check-pack.mjs",
29
+ "dev": "tsx src/index.ts",
30
+ "install-as-command": "node scripts/install-as-command.mjs --mode link",
31
+ "install-as-command:global": "node scripts/install-as-command.mjs --mode global",
32
+ "uninstall-as-command": "node scripts/install-as-command.mjs --mode uninstall",
33
+ "server-install": "tsx src/index.ts server-install",
34
+ "server-deploy": "tsx src/index.ts server-deploy",
35
+ "server-uninstall": "tsx src/index.ts server-uninstall",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest",
38
+ "test:unit": "node --import tsx --test test/unit/*.test.ts",
39
+ "test:package": "node --import tsx --test test/e2e/*.test.ts",
40
+ "typecheck": "tsc --noEmit -p tsconfig.test.json",
41
+ "postbuild": "node scripts/inline-contract.mjs"
42
+ },
43
+ "dependencies": {
44
+ "@clack/prompts": "^0.11.0",
45
+ "@hono/node-server": "^1.13.0",
46
+ "hono": "^4.6.0",
47
+ "smol-toml": "^1.7.0",
48
+ "ws": "^8.21.1",
49
+ "yaml": "^2.5.0",
50
+ "zod": "^4.4.3"
51
+ },
52
+ "devDependencies": {
53
+ "@open-mercato/cezar-api-client": "0.10.0-pr30.54",
54
+ "@open-mercato/cezar-contract": "0.10.0-pr30.54",
55
+ "@types/node": "^20.14.0",
56
+ "@types/ws": "^8.18.1",
57
+ "esbuild": "^0.28.1",
58
+ "tsx": "^4.19.0",
59
+ "typescript": "^7.0.2",
60
+ "vitest": "^4.1.10"
61
+ },
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "https://github.com/wjarka/cezar",
65
+ "directory": "packages/cezar"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ }
70
+ }
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ // Tarball bundle check (`npm run check:pack`, last leg of `npm run build`):
3
+ // fail loudly when the published package would ship without the built UI —
4
+ // phase R1 of the cockpit redesign once published a tarball with no cockpit
5
+ // in it, and this pins that bug class before every publish (prepublishOnly →
6
+ // build → check:pack).
7
+ //
8
+ // Asks npm itself what it would pack (`npm pack --dry-run --json`) and hands
9
+ // the file list to the pure, unit-tested decision in src/pack-check.ts.
10
+ // Imports from dist/, so it must run AFTER `tsc` — `npm run build` orders
11
+ // tsc → build:web → check:pack, which also guarantees web/dist exists in a
12
+ // fresh checkout by the time the check looks for it.
13
+
14
+ import { execFileSync } from 'node:child_process';
15
+ import path from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+ import { findPackGaps } from '../dist/pack-check.js';
18
+
19
+ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
20
+
21
+ // Under `npm run`, npm_execpath is npm's own cli.js — running it through
22
+ // process.execPath works on every platform (no .cmd shim needed on Windows).
23
+ const npmExecpath = process.env.npm_execpath;
24
+ const packArgs = ['pack', '--dry-run', '--json'];
25
+ const npmCli = process.platform === 'win32' ? 'npm.cmd' : 'npm';
26
+ const stdout = npmExecpath
27
+ ? execFileSync(process.execPath, [npmExecpath, ...packArgs], { cwd: repoRoot, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 })
28
+ : execFileSync(npmCli, packArgs, { cwd: repoRoot, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, shell: process.platform === 'win32' });
29
+
30
+ /** @type {{ files?: { path: string }[] }[]} */
31
+ const reports = JSON.parse(stdout);
32
+ const files = (reports[0]?.files ?? []).map((f) => f.path);
33
+ if (files.length === 0) {
34
+ console.error('check:pack: `npm pack --dry-run --json` reported no files — refusing to publish an empty package');
35
+ process.exit(1);
36
+ }
37
+
38
+ const gaps = findPackGaps(files);
39
+ if (gaps.length > 0) {
40
+ console.error('check:pack: the npm tarball would ship a broken cockpit:');
41
+ for (const gap of gaps) console.error(` - ${gap}`);
42
+ process.exit(1);
43
+ }
44
+
45
+ const uiFiles = files.filter((f) => f.startsWith('web/dist/')).length;
46
+ console.log(`check:pack ok — ${files.length} files, ${uiFiles} under web/dist (shell + assets present)`);
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Bundle `@open-mercato/cezar-contract` into `dist` after `tsc`.
3
+ *
4
+ * The contract and the api-client are PRIVATE and ship no build of their own — they are linked as
5
+ * workspace packages and consumed as TypeScript source, which is what every other consumer wants:
6
+ * the cockpit's Vite bundles them, vitest transforms them.
7
+ *
8
+ * This package is the exception, because it is PUBLISHED. `workspace/migrations.ts` imports
9
+ * `workspaceUiStateSchema` — a zod value, not a type — so the installed CLI resolves the contract
10
+ * at runtime, and a tarball naming a package npm has never seen would fail on install. So the
11
+ * build folds it in: esbuild compiles the contract's source to one ESM file under `dist/contract/`,
12
+ * `tsc` emits its declarations beside it, and the emitted references are repointed at both.
13
+ *
14
+ * Nothing is copied at the SOURCE level — the package graph still states the dependency, and this
15
+ * runs only when `dist` actually names it. Delete this the day the contract is published, or the
16
+ * day nothing here imports a contract VALUE.
17
+ *
18
+ * DECLARATIONS ship next to the bundle, and that is not optional. The scan below matches `.d.ts`
19
+ * as well as `.js`, so emitted type imports get repointed too (`dist/ui-state.d.ts` names
20
+ * `WorkspaceUiState`). esbuild emits JavaScript only, so a bundle on its own leaves those
21
+ * declarations naming a module TypeScript cannot resolve — `TS7016`, and the type silently
22
+ * degrades to `any` for anyone consuming the published package. Every tsconfig here sets
23
+ * `skipLibCheck`, so nothing in this repo would have said a word. `tsc --emitDeclarationOnly`
24
+ * mirrors the contract's `src` tree into `dist/contract/`, which is what makes
25
+ * `./contract/index.js` resolve to a real `./contract/index.d.ts`.
26
+ */
27
+ import { execFileSync } from 'node:child_process';
28
+ import { createRequire } from 'node:module';
29
+ import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
30
+ import { dirname, join, relative } from 'node:path';
31
+ import { fileURLToPath } from 'node:url';
32
+ import { build } from 'esbuild';
33
+
34
+ const here = dirname(fileURLToPath(import.meta.url));
35
+ const dist = join(here, '..', 'dist');
36
+ const contractRoot = join(here, '..', '..', 'contract');
37
+ const entry = join(contractRoot, 'src', 'index.ts');
38
+ const outdir = join(dist, 'contract');
39
+ const SPEC = /(['"])@open-mercato\/cezar-contract\1/g;
40
+
41
+ /** Emitted files that name the package — the copy happens only if it is really used. */
42
+ const referrers = [];
43
+ const scan = (dir) => {
44
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
45
+ const p = join(dir, entry.name);
46
+ if (entry.isDirectory()) {
47
+ if (p !== outdir) scan(p);
48
+ } else if (/\.(js|d\.ts|js\.map)$/.test(entry.name)) {
49
+ SPEC.lastIndex = 0;
50
+ if (SPEC.test(readFileSync(p, 'utf8'))) referrers.push(p);
51
+ }
52
+ }
53
+ };
54
+ scan(dist);
55
+
56
+ rmSync(outdir, { recursive: true, force: true });
57
+ if (referrers.length === 0) {
58
+ console.log('inline-contract ok — nothing in dist references the contract, nothing bundled');
59
+ process.exit(0);
60
+ }
61
+
62
+ // `zod` stays external: it is a real dependency of this package, so npm resolves it normally and
63
+ // the tarball does not carry a second copy.
64
+ await build({
65
+ entryPoints: [entry],
66
+ outfile: join(outdir, 'index.js'),
67
+ bundle: true,
68
+ format: 'esm',
69
+ platform: 'neutral',
70
+ target: 'es2022',
71
+ external: ['zod'],
72
+ });
73
+
74
+ // `tsc` is located through the module graph rather than a guessed `node_modules` path, because
75
+ // `typescript` is a devDependency of THIS package and may sit here or be hoisted to the workspace
76
+ // root. Via the manifest's own `bin` entry: TypeScript 7's `exports` map does not publish
77
+ // `./bin/tsc`, so resolving that subpath directly is ERR_PACKAGE_PATH_NOT_EXPORTED.
78
+ const require_ = createRequire(import.meta.url);
79
+ const tsManifest = require_.resolve('typescript/package.json');
80
+ const tscBin = join(dirname(tsManifest), require_(tsManifest).bin.tsc);
81
+
82
+ // The declarations for the bundle above. `tsc` mirrors `src/**` into `outdir`, so `index.d.ts`
83
+ // lands beside `index.js` and its relative siblings (`./health.js` → `./health.d.ts`) resolve as
84
+ // TypeScript expects. Those siblings have no runtime twin, which is correct: the bundle is
85
+ // self-contained and nothing imports those paths at runtime.
86
+ execFileSync(
87
+ process.execPath,
88
+ [
89
+ tscBin,
90
+ '--project',
91
+ join(contractRoot, 'tsconfig.json'),
92
+ '--emitDeclarationOnly',
93
+ '--declarationMap',
94
+ 'false',
95
+ '--sourceMap',
96
+ 'false',
97
+ '--outDir',
98
+ outdir,
99
+ ],
100
+ { stdio: 'inherit' },
101
+ );
102
+ if (!existsSync(join(outdir, 'index.d.ts'))) {
103
+ console.error('inline-contract: tsc emitted no index.d.ts — the bundled contract would ship untyped');
104
+ process.exit(1);
105
+ }
106
+
107
+ for (const p of referrers) {
108
+ let rel = relative(dirname(p), join(outdir, 'index.js')).replaceAll('\\', '/');
109
+ if (!rel.startsWith('.')) rel = `./${rel}`;
110
+ writeFileSync(p, readFileSync(p, 'utf8').replace(SPEC, `'${rel}'`), 'utf8');
111
+ }
112
+ console.log(`inline-contract ok — contract bundled with declarations, ${referrers.length} file(s) repointed`);
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+ // `npm run install-as-command` (+ `:global` and the `uninstall-as-command`
3
+ // counterpart): build this checkout and put a global `cezarion`/`cez`
4
+ // command on PATH pointing at THIS working tree — the local-dev equivalent of
5
+ // `npx cezarion`, with no publish and no `npx` download. Spec 013.
6
+ //
7
+ // --mode link build → `npm link` (live; `npm run build` refreshes it)
8
+ // --mode global build → `npm install --global .` (self-contained snapshot)
9
+ // --mode uninstall `npm rm --global @wjarka/cezarion`
10
+ // --no-build skip the build (relink an already-built dist)
11
+ //
12
+ // The install decisions live in the unit-tested src/install-as-command.ts
13
+ // (compiled to dist by the build); this script owns spawning + exit codes.
14
+ // npm is invoked through process.execPath + npm_execpath — same cross-platform
15
+ // pattern as scripts/dev.mjs / scripts/check-pack.mjs (no .cmd shim assumptions).
16
+
17
+ import { spawnSync, execFileSync } from 'node:child_process';
18
+ import { existsSync } from 'node:fs';
19
+ import path from 'node:path';
20
+ import { fileURLToPath, pathToFileURL } from 'node:url';
21
+
22
+ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
23
+ const argv = process.argv.slice(2);
24
+
25
+ const modeIdx = argv.indexOf('--mode');
26
+ const mode = modeIdx >= 0 ? argv[modeIdx + 1] : 'link';
27
+ const noBuild = argv.includes('--no-build');
28
+ if (!['link', 'global', 'uninstall'].includes(mode)) {
29
+ console.error(`install-as-command: unknown --mode "${mode}" (expected link | global | uninstall)`);
30
+ process.exit(1);
31
+ }
32
+
33
+ // npm invocation shim (identical to dev.mjs / check-pack.mjs).
34
+ const npmExecpath = process.env.npm_execpath;
35
+ const npmCli = process.platform === 'win32' ? 'npm.cmd' : 'npm';
36
+ function npm(args, { capture = false } = {}) {
37
+ const viaNode = Boolean(npmExecpath);
38
+ const file = viaNode ? process.execPath : npmCli;
39
+ const full = viaNode ? [npmExecpath, ...args] : args;
40
+ const shell = !viaNode && process.platform === 'win32';
41
+ if (capture) {
42
+ return execFileSync(file, full, { cwd: repoRoot, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, shell });
43
+ }
44
+ const res = spawnSync(file, full, { cwd: repoRoot, stdio: 'inherit', shell });
45
+ return res.status ?? 1;
46
+ }
47
+
48
+ const distDir = path.join(repoRoot, 'dist');
49
+ const build = mode !== 'uninstall' && !noBuild;
50
+
51
+ if (mode !== 'uninstall' && noBuild && !existsSync(path.join(distDir, 'index.js'))) {
52
+ console.error('install-as-command: --no-build was set but dist/ is missing — run once without --no-build first.');
53
+ process.exit(1);
54
+ }
55
+
56
+ if (build) {
57
+ console.log('install-as-command: building (npm run build)…');
58
+ const code = npm(['run', 'build']);
59
+ if (code !== 0) {
60
+ console.error('install-as-command: build failed — nothing installed.');
61
+ process.exit(code);
62
+ }
63
+ }
64
+
65
+ // Load the tested planner from dist. Present after any build; for uninstall on a
66
+ // never-built checkout it may be absent, so fall back to the known command.
67
+ let planner = null;
68
+ const plannerPath = path.join(distDir, 'install-as-command.js');
69
+ if (existsSync(plannerPath)) {
70
+ planner = await import(pathToFileURL(plannerPath).href);
71
+ }
72
+ const PACKAGE_NAME = planner?.PACKAGE_NAME ?? '@wjarka/cezarion';
73
+ const steps = planner
74
+ ? planner.planInstall({ mode, build }).steps
75
+ : [{ args: ['rm', '--global', PACKAGE_NAME], label: `remove global ${PACKAGE_NAME}` }];
76
+
77
+ for (const step of steps) {
78
+ console.log(`install-as-command: npm ${step.args.join(' ')} (${step.label})`);
79
+ const code = npm(step.args);
80
+ if (code !== 0) {
81
+ if (mode === 'uninstall') {
82
+ // Idempotent: `npm rm -g` of an absent package is a no-op success.
83
+ console.log('install-as-command: nothing to uninstall (already absent).');
84
+ break;
85
+ }
86
+ console.error(`install-as-command: \`npm ${step.args.join(' ')}\` failed (see npm output above).`);
87
+ console.error(
88
+ ' If this is an EACCES on a root-owned global prefix, set a user-writable one\n' +
89
+ ' (e.g. `npm config set prefix ~/.npm-global`) and retry — do NOT use sudo.',
90
+ );
91
+ process.exit(code);
92
+ }
93
+ }
94
+
95
+ if (mode === 'uninstall') {
96
+ console.log('install-as-command: global cezarion / cez removed.');
97
+ process.exit(0);
98
+ }
99
+
100
+ // Verify the shims and print a PATH hint.
101
+ let prefix = '';
102
+ try {
103
+ prefix = npm(['prefix', '--global'], { capture: true }).trim();
104
+ } catch {
105
+ // best-effort — the install already succeeded above
106
+ }
107
+ if (planner && prefix) {
108
+ const binDir = planner.globalBinDir(prefix, process.platform);
109
+ const present = planner.globalShimPaths(prefix, process.platform).filter((p) => existsSync(p));
110
+ const names = planner.BIN_NAMES.join(', ');
111
+ if (present.length === planner.BIN_NAMES.length) {
112
+ console.log(`\ninstall-as-command: installed ${names} → ${binDir}`);
113
+ } else {
114
+ console.log(`\ninstall-as-command: done, but only ${present.length}/${planner.BIN_NAMES.length} shims found in ${binDir}`);
115
+ }
116
+ console.log(` Ensure this is on your PATH:\n ${binDir}`);
117
+ console.log(' Then, from any repo: cez --help');
118
+ } else {
119
+ console.log('\ninstall-as-command: done. Ensure your npm global bin dir is on PATH, then run `cez --help`.');
120
+ }