@cleocode/core 2026.9.26 → 2026.10.2

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 (410) hide show
  1. package/dist/build-provenance.json +2 -2
  2. package/dist/cloud/journal.d.ts +9 -5
  3. package/dist/cloud/journal.d.ts.map +1 -1
  4. package/dist/cloud/journal.js +29 -8
  5. package/dist/cloud/journal.js.map +1 -1
  6. package/dist/cloud/manifest-check.d.ts +140 -4
  7. package/dist/cloud/manifest-check.d.ts.map +1 -1
  8. package/dist/cloud/manifest-check.js +309 -10
  9. package/dist/cloud/manifest-check.js.map +1 -1
  10. package/dist/cloud/nexus-attach.d.ts +119 -0
  11. package/dist/cloud/nexus-attach.d.ts.map +1 -0
  12. package/dist/cloud/nexus-attach.js +267 -0
  13. package/dist/cloud/nexus-attach.js.map +1 -0
  14. package/dist/cloud/nexus-auth.d.ts +15 -3
  15. package/dist/cloud/nexus-auth.d.ts.map +1 -1
  16. package/dist/cloud/nexus-auth.js +90 -6
  17. package/dist/cloud/nexus-auth.js.map +1 -1
  18. package/dist/cloud/nexus-cloud-activity.d.ts +37 -0
  19. package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -0
  20. package/dist/cloud/nexus-cloud-activity.js +79 -0
  21. package/dist/cloud/nexus-cloud-activity.js.map +1 -0
  22. package/dist/cloud/nexus-cloud-status.d.ts +132 -0
  23. package/dist/cloud/nexus-cloud-status.d.ts.map +1 -0
  24. package/dist/cloud/nexus-cloud-status.js +476 -0
  25. package/dist/cloud/nexus-cloud-status.js.map +1 -0
  26. package/dist/cloud/nexus-cloud.d.ts +179 -0
  27. package/dist/cloud/nexus-cloud.d.ts.map +1 -0
  28. package/dist/cloud/nexus-cloud.js +296 -0
  29. package/dist/cloud/nexus-cloud.js.map +1 -0
  30. package/dist/cloud/nexus-device.d.ts +32 -7
  31. package/dist/cloud/nexus-device.d.ts.map +1 -1
  32. package/dist/cloud/nexus-device.js +54 -7
  33. package/dist/cloud/nexus-device.js.map +1 -1
  34. package/dist/cloud/nexus-enrol.d.ts +35 -4
  35. package/dist/cloud/nexus-enrol.d.ts.map +1 -1
  36. package/dist/cloud/nexus-enrol.js +192 -47
  37. package/dist/cloud/nexus-enrol.js.map +1 -1
  38. package/dist/cloud/nexus-home.d.ts +74 -0
  39. package/dist/cloud/nexus-home.d.ts.map +1 -0
  40. package/dist/cloud/nexus-home.js +97 -0
  41. package/dist/cloud/nexus-home.js.map +1 -0
  42. package/dist/cloud/nexus-link.d.ts +8 -1
  43. package/dist/cloud/nexus-link.d.ts.map +1 -1
  44. package/dist/cloud/nexus-link.js +138 -11
  45. package/dist/cloud/nexus-link.js.map +1 -1
  46. package/dist/cloud/nexus-logout.d.ts +114 -0
  47. package/dist/cloud/nexus-logout.d.ts.map +1 -0
  48. package/dist/cloud/nexus-logout.js +429 -0
  49. package/dist/cloud/nexus-logout.js.map +1 -0
  50. package/dist/cloud/nexus-vault-keys.d.ts +129 -0
  51. package/dist/cloud/nexus-vault-keys.d.ts.map +1 -0
  52. package/dist/cloud/nexus-vault-keys.js +277 -0
  53. package/dist/cloud/nexus-vault-keys.js.map +1 -0
  54. package/dist/cloud/nexus-vault-state.d.ts +121 -0
  55. package/dist/cloud/nexus-vault-state.d.ts.map +1 -0
  56. package/dist/cloud/nexus-vault-state.js +274 -0
  57. package/dist/cloud/nexus-vault-state.js.map +1 -0
  58. package/dist/cloud/nexus-vault.d.ts +160 -0
  59. package/dist/cloud/nexus-vault.d.ts.map +1 -0
  60. package/dist/cloud/nexus-vault.js +1733 -0
  61. package/dist/cloud/nexus-vault.js.map +1 -0
  62. package/dist/cloud/signing.d.ts +24 -8
  63. package/dist/cloud/signing.d.ts.map +1 -1
  64. package/dist/cloud/signing.js +61 -15
  65. package/dist/cloud/signing.js.map +1 -1
  66. package/dist/docs/export-document.js +8341 -3317
  67. package/dist/docs/export-document.js.map +3 -3
  68. package/dist/doctor/migrations.d.ts +75 -0
  69. package/dist/doctor/migrations.d.ts.map +1 -0
  70. package/dist/doctor/migrations.js +136 -0
  71. package/dist/doctor/migrations.js.map +1 -0
  72. package/dist/doctor/sync-sealer.d.ts +48 -0
  73. package/dist/doctor/sync-sealer.d.ts.map +1 -0
  74. package/dist/doctor/sync-sealer.js +109 -0
  75. package/dist/doctor/sync-sealer.js.map +1 -0
  76. package/dist/doctor/sync-triggers.d.ts +53 -0
  77. package/dist/doctor/sync-triggers.d.ts.map +1 -0
  78. package/dist/doctor/sync-triggers.js +157 -0
  79. package/dist/doctor/sync-triggers.js.map +1 -0
  80. package/dist/init.d.ts.map +1 -1
  81. package/dist/init.js +5 -1
  82. package/dist/init.js.map +1 -1
  83. package/dist/internal.d.ts +1 -1
  84. package/dist/internal.d.ts.map +1 -1
  85. package/dist/internal.js +1 -1
  86. package/dist/internal.js.map +1 -1
  87. package/dist/llm/plugin-facade.js +8668 -3644
  88. package/dist/llm/plugin-facade.js.map +3 -3
  89. package/dist/nexus/projects-clean.d.ts +3 -0
  90. package/dist/nexus/projects-clean.d.ts.map +1 -1
  91. package/dist/nexus/projects-clean.js +9 -3
  92. package/dist/nexus/projects-clean.js.map +1 -1
  93. package/dist/nexus/registry-roots.d.ts +3 -1
  94. package/dist/nexus/registry-roots.d.ts.map +1 -1
  95. package/dist/nexus/registry-roots.js +5 -2
  96. package/dist/nexus/registry-roots.js.map +1 -1
  97. package/dist/nexus/registry.d.ts +8 -1
  98. package/dist/nexus/registry.d.ts.map +1 -1
  99. package/dist/nexus/registry.js +24 -10
  100. package/dist/nexus/registry.js.map +1 -1
  101. package/dist/nexus/workspace.d.ts +4 -1
  102. package/dist/nexus/workspace.d.ts.map +1 -1
  103. package/dist/nexus/workspace.js +10 -4
  104. package/dist/nexus/workspace.js.map +1 -1
  105. package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
  106. package/dist/orchestrate/spawn-ops.js +7 -2
  107. package/dist/orchestrate/spawn-ops.js.map +1 -1
  108. package/dist/orchestrate/worker-verify.d.ts +121 -12
  109. package/dist/orchestrate/worker-verify.d.ts.map +1 -1
  110. package/dist/orchestrate/worker-verify.js +172 -21
  111. package/dist/orchestrate/worker-verify.js.map +1 -1
  112. package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
  113. package/dist/orchestration/spawn-prompt.js +15 -9
  114. package/dist/orchestration/spawn-prompt.js.map +1 -1
  115. package/dist/release/ci-evidence.d.ts +9 -0
  116. package/dist/release/ci-evidence.d.ts.map +1 -1
  117. package/dist/release/ci-evidence.js +9 -2
  118. package/dist/release/ci-evidence.js.map +1 -1
  119. package/dist/resources/backend.d.ts +15 -3
  120. package/dist/resources/backend.d.ts.map +1 -1
  121. package/dist/resources/backend.js +7 -3
  122. package/dist/resources/backend.js.map +1 -1
  123. package/dist/resources/darwin-backend.d.ts +142 -0
  124. package/dist/resources/darwin-backend.d.ts.map +1 -0
  125. package/dist/resources/darwin-backend.js +288 -0
  126. package/dist/resources/darwin-backend.js.map +1 -0
  127. package/dist/resources/governor.d.ts +44 -1
  128. package/dist/resources/governor.d.ts.map +1 -1
  129. package/dist/resources/governor.js +100 -36
  130. package/dist/resources/governor.js.map +1 -1
  131. package/dist/resources/heavy-command.d.ts +132 -0
  132. package/dist/resources/heavy-command.d.ts.map +1 -0
  133. package/dist/resources/heavy-command.js +768 -0
  134. package/dist/resources/heavy-command.js.map +1 -0
  135. package/dist/resources/monitor.d.ts +50 -1
  136. package/dist/resources/monitor.d.ts.map +1 -1
  137. package/dist/resources/monitor.js +83 -1
  138. package/dist/resources/monitor.js.map +1 -1
  139. package/dist/resources/run-admission.d.ts +303 -0
  140. package/dist/resources/run-admission.d.ts.map +1 -0
  141. package/dist/resources/run-admission.js +648 -0
  142. package/dist/resources/run-admission.js.map +1 -0
  143. package/dist/resources/run-class.d.ts +111 -0
  144. package/dist/resources/run-class.d.ts.map +1 -0
  145. package/dist/resources/run-class.js +658 -0
  146. package/dist/resources/run-class.js.map +1 -0
  147. package/dist/resources/run-governed.d.ts +158 -0
  148. package/dist/resources/run-governed.d.ts.map +1 -0
  149. package/dist/resources/run-governed.js +406 -0
  150. package/dist/resources/run-governed.js.map +1 -0
  151. package/dist/resources/slot-holder.d.ts +267 -0
  152. package/dist/resources/slot-holder.d.ts.map +1 -0
  153. package/dist/resources/slot-holder.js +505 -0
  154. package/dist/resources/slot-holder.js.map +1 -0
  155. package/dist/resources/tool-groups.d.ts +74 -0
  156. package/dist/resources/tool-groups.d.ts.map +1 -0
  157. package/dist/resources/tool-groups.js +118 -0
  158. package/dist/resources/tool-groups.js.map +1 -0
  159. package/dist/routing/build-command-groups.d.ts.map +1 -1
  160. package/dist/routing/build-command-groups.js +1 -0
  161. package/dist/routing/build-command-groups.js.map +1 -1
  162. package/dist/selfimprove/fix-gen.js +8676 -3652
  163. package/dist/selfimprove/fix-gen.js.map +3 -3
  164. package/dist/sentient/cross-project-hygiene.d.ts +3 -2
  165. package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
  166. package/dist/sentient/cross-project-hygiene.js +5 -2
  167. package/dist/sentient/cross-project-hygiene.js.map +1 -1
  168. package/dist/sentient/state.d.ts +7 -0
  169. package/dist/sentient/state.d.ts.map +1 -1
  170. package/dist/sentient/state.js.map +1 -1
  171. package/dist/sentient/tick.d.ts +14 -2
  172. package/dist/sentient/tick.d.ts.map +1 -1
  173. package/dist/sentient/tick.js +63 -4
  174. package/dist/sentient/tick.js.map +1 -1
  175. package/dist/setup/sections/nexus-account.d.ts +8 -6
  176. package/dist/setup/sections/nexus-account.d.ts.map +1 -1
  177. package/dist/setup/sections/nexus-account.js +53 -9
  178. package/dist/setup/sections/nexus-account.js.map +1 -1
  179. package/dist/store/backup-recover.d.ts.map +1 -1
  180. package/dist/store/backup-recover.js +5 -0
  181. package/dist/store/backup-recover.js.map +1 -1
  182. package/dist/store/data-accessor.d.ts +1 -0
  183. package/dist/store/data-accessor.d.ts.map +1 -1
  184. package/dist/store/data-accessor.js +7 -0
  185. package/dist/store/data-accessor.js.map +1 -1
  186. package/dist/store/dual-scope-db.d.ts +23 -1
  187. package/dist/store/dual-scope-db.d.ts.map +1 -1
  188. package/dist/store/dual-scope-db.js +126 -36
  189. package/dist/store/dual-scope-db.js.map +1 -1
  190. package/dist/store/exodus/recovery.d.ts.map +1 -1
  191. package/dist/store/exodus/recovery.js +15 -0
  192. package/dist/store/exodus/recovery.js.map +1 -1
  193. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
  194. package/dist/store/legacy-tasks-lineage.js +5 -0
  195. package/dist/store/legacy-tasks-lineage.js.map +1 -1
  196. package/dist/store/lock.d.ts +8 -1
  197. package/dist/store/lock.d.ts.map +1 -1
  198. package/dist/store/lock.js +10 -2
  199. package/dist/store/lock.js.map +1 -1
  200. package/dist/store/migration-manager.d.ts +5 -0
  201. package/dist/store/migration-manager.d.ts.map +1 -1
  202. package/dist/store/migration-manager.js +11 -0
  203. package/dist/store/migration-manager.js.map +1 -1
  204. package/dist/store/migration-runner.d.ts +158 -0
  205. package/dist/store/migration-runner.d.ts.map +1 -0
  206. package/dist/store/migration-runner.js +493 -0
  207. package/dist/store/migration-runner.js.map +1 -0
  208. package/dist/store/portable-bundle-import.d.ts +15 -1
  209. package/dist/store/portable-bundle-import.d.ts.map +1 -1
  210. package/dist/store/portable-bundle-import.js +24 -4
  211. package/dist/store/portable-bundle-import.js.map +1 -1
  212. package/dist/store/portable-bundle-relocate.d.ts +43 -0
  213. package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
  214. package/dist/store/portable-bundle-relocate.js +79 -5
  215. package/dist/store/portable-bundle-relocate.js.map +1 -1
  216. package/dist/store/portable-bundle-scan.d.ts +20 -0
  217. package/dist/store/portable-bundle-scan.d.ts.map +1 -1
  218. package/dist/store/portable-bundle-scan.js +38 -3
  219. package/dist/store/portable-bundle-scan.js.map +1 -1
  220. package/dist/store/portable-bundle.d.ts +33 -0
  221. package/dist/store/portable-bundle.d.ts.map +1 -1
  222. package/dist/store/portable-bundle.js +34 -7
  223. package/dist/store/portable-bundle.js.map +1 -1
  224. package/dist/store/row-identity-registry.d.ts +137 -7
  225. package/dist/store/row-identity-registry.d.ts.map +1 -1
  226. package/dist/store/row-identity-registry.js +364 -9
  227. package/dist/store/row-identity-registry.js.map +1 -1
  228. package/dist/store/row-identity.d.ts.map +1 -1
  229. package/dist/store/row-identity.js +9 -10
  230. package/dist/store/row-identity.js.map +1 -1
  231. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  232. package/dist/store/sqlite-data-accessor.js +10 -0
  233. package/dist/store/sqlite-data-accessor.js.map +1 -1
  234. package/dist/store/sqlite.d.ts +31 -0
  235. package/dist/store/sqlite.d.ts.map +1 -1
  236. package/dist/store/sqlite.js +5 -1
  237. package/dist/store/sqlite.js.map +1 -1
  238. package/dist/store/sync/capture.d.ts +203 -0
  239. package/dist/store/sync/capture.d.ts.map +1 -0
  240. package/dist/store/sync/capture.js +562 -0
  241. package/dist/store/sync/capture.js.map +1 -0
  242. package/dist/store/sync/clock-store.d.ts.map +1 -1
  243. package/dist/store/sync/clock-store.js +2 -0
  244. package/dist/store/sync/clock-store.js.map +1 -1
  245. package/dist/store/sync/fk-orphans.d.ts +133 -0
  246. package/dist/store/sync/fk-orphans.d.ts.map +1 -0
  247. package/dist/store/sync/fk-orphans.js +265 -0
  248. package/dist/store/sync/fk-orphans.js.map +1 -0
  249. package/dist/store/sync/flags.d.ts +7 -0
  250. package/dist/store/sync/flags.d.ts.map +1 -1
  251. package/dist/store/sync/flags.js +16 -0
  252. package/dist/store/sync/flags.js.map +1 -1
  253. package/dist/store/sync/hlc.d.ts.map +1 -1
  254. package/dist/store/sync/hlc.js +4 -0
  255. package/dist/store/sync/hlc.js.map +1 -1
  256. package/dist/store/sync/identity-fill.d.ts +45 -0
  257. package/dist/store/sync/identity-fill.d.ts.map +1 -0
  258. package/dist/store/sync/identity-fill.js +85 -0
  259. package/dist/store/sync/identity-fill.js.map +1 -0
  260. package/dist/store/sync/machinery.d.ts +27 -0
  261. package/dist/store/sync/machinery.d.ts.map +1 -0
  262. package/dist/store/sync/machinery.js +44 -0
  263. package/dist/store/sync/machinery.js.map +1 -0
  264. package/dist/store/sync/netting.d.ts +120 -0
  265. package/dist/store/sync/netting.d.ts.map +1 -0
  266. package/dist/store/sync/netting.js +336 -0
  267. package/dist/store/sync/netting.js.map +1 -0
  268. package/dist/store/sync/replica.d.ts +59 -3
  269. package/dist/store/sync/replica.d.ts.map +1 -1
  270. package/dist/store/sync/replica.js +84 -3
  271. package/dist/store/sync/replica.js.map +1 -1
  272. package/dist/store/sync/schema.d.ts +18 -3
  273. package/dist/store/sync/schema.d.ts.map +1 -1
  274. package/dist/store/sync/schema.js +27 -3
  275. package/dist/store/sync/schema.js.map +1 -1
  276. package/dist/store/sync/seal-backlog.d.ts +21 -0
  277. package/dist/store/sync/seal-backlog.d.ts.map +1 -0
  278. package/dist/store/sync/seal-backlog.js +24 -0
  279. package/dist/store/sync/seal-backlog.js.map +1 -0
  280. package/dist/store/sync/sealer-values.d.ts +34 -0
  281. package/dist/store/sync/sealer-values.d.ts.map +1 -0
  282. package/dist/store/sync/sealer-values.js +53 -0
  283. package/dist/store/sync/sealer-values.js.map +1 -0
  284. package/dist/store/sync/sealer.d.ts +145 -0
  285. package/dist/store/sync/sealer.d.ts.map +1 -0
  286. package/dist/store/sync/sealer.js +906 -0
  287. package/dist/store/sync/sealer.js.map +1 -0
  288. package/dist/store/sync/structural.d.ts +63 -0
  289. package/dist/store/sync/structural.d.ts.map +1 -0
  290. package/dist/store/sync/structural.js +180 -0
  291. package/dist/store/sync/structural.js.map +1 -0
  292. package/dist/store/sync/timestamps.d.ts +92 -0
  293. package/dist/store/sync/timestamps.d.ts.map +1 -0
  294. package/dist/store/sync/timestamps.js +228 -0
  295. package/dist/store/sync/timestamps.js.map +1 -0
  296. package/dist/store/sync/tombstones.d.ts +75 -0
  297. package/dist/store/sync/tombstones.d.ts.map +1 -0
  298. package/dist/store/sync/tombstones.js +103 -0
  299. package/dist/store/sync/tombstones.js.map +1 -0
  300. package/dist/store/sync/trigger-classes.d.ts +221 -0
  301. package/dist/store/sync/trigger-classes.d.ts.map +1 -0
  302. package/dist/store/sync/trigger-classes.js +441 -0
  303. package/dist/store/sync/trigger-classes.js.map +1 -0
  304. package/dist/store/sync/trigger-suspend-at-path.d.ts +23 -0
  305. package/dist/store/sync/trigger-suspend-at-path.d.ts.map +1 -0
  306. package/dist/store/sync/trigger-suspend-at-path.js +44 -0
  307. package/dist/store/sync/trigger-suspend-at-path.js.map +1 -0
  308. package/dist/store/sync/writer-version.d.ts +43 -0
  309. package/dist/store/sync/writer-version.d.ts.map +1 -0
  310. package/dist/store/sync/writer-version.js +90 -0
  311. package/dist/store/sync/writer-version.js.map +1 -0
  312. package/dist/store/table-classification.d.ts.map +1 -1
  313. package/dist/store/table-classification.js +102 -0
  314. package/dist/store/table-classification.js.map +1 -1
  315. package/dist/store/trigger-suspend-schema.d.ts +44 -0
  316. package/dist/store/trigger-suspend-schema.d.ts.map +1 -0
  317. package/dist/store/trigger-suspend-schema.js +25 -0
  318. package/dist/store/trigger-suspend-schema.js.map +1 -0
  319. package/dist/store/vault-manifest.d.ts +365 -0
  320. package/dist/store/vault-manifest.d.ts.map +1 -0
  321. package/dist/store/vault-manifest.js +812 -0
  322. package/dist/store/vault-manifest.js.map +1 -0
  323. package/dist/store/writer-lease.d.ts +31 -0
  324. package/dist/store/writer-lease.d.ts.map +1 -1
  325. package/dist/store/writer-lease.js +65 -2
  326. package/dist/store/writer-lease.js.map +1 -1
  327. package/dist/system/health.d.ts.map +1 -1
  328. package/dist/system/health.js +21 -0
  329. package/dist/system/health.js.map +1 -1
  330. package/dist/system/project-health.d.ts.map +1 -1
  331. package/dist/system/project-health.js +3 -1
  332. package/dist/system/project-health.js.map +1 -1
  333. package/dist/tasks/affected-packages.d.ts +58 -0
  334. package/dist/tasks/affected-packages.d.ts.map +1 -1
  335. package/dist/tasks/affected-packages.js +75 -6
  336. package/dist/tasks/affected-packages.js.map +1 -1
  337. package/dist/tasks/affected-scope.d.ts +150 -23
  338. package/dist/tasks/affected-scope.d.ts.map +1 -1
  339. package/dist/tasks/affected-scope.js +320 -32
  340. package/dist/tasks/affected-scope.js.map +1 -1
  341. package/dist/tasks/change-set.d.ts +96 -0
  342. package/dist/tasks/change-set.d.ts.map +1 -1
  343. package/dist/tasks/change-set.js +169 -4
  344. package/dist/tasks/change-set.js.map +1 -1
  345. package/dist/tasks/complete-ci.d.ts +115 -0
  346. package/dist/tasks/complete-ci.d.ts.map +1 -0
  347. package/dist/tasks/complete-ci.js +171 -0
  348. package/dist/tasks/complete-ci.js.map +1 -0
  349. package/dist/tasks/complete.d.ts.map +1 -1
  350. package/dist/tasks/complete.js +50 -17
  351. package/dist/tasks/complete.js.map +1 -1
  352. package/dist/tasks/compute-task-view.d.ts.map +1 -1
  353. package/dist/tasks/compute-task-view.js +7 -0
  354. package/dist/tasks/compute-task-view.js.map +1 -1
  355. package/dist/tasks/done-plan.d.ts.map +1 -1
  356. package/dist/tasks/done-plan.js +51 -30
  357. package/dist/tasks/done-plan.js.map +1 -1
  358. package/dist/tasks/done-record.d.ts +6 -0
  359. package/dist/tasks/done-record.d.ts.map +1 -1
  360. package/dist/tasks/done-record.js +9 -3
  361. package/dist/tasks/done-record.js.map +1 -1
  362. package/dist/tasks/evidence.d.ts +3 -2
  363. package/dist/tasks/evidence.d.ts.map +1 -1
  364. package/dist/tasks/evidence.js +143 -12
  365. package/dist/tasks/evidence.js.map +1 -1
  366. package/dist/tasks/gate-notes.d.ts +22 -0
  367. package/dist/tasks/gate-notes.d.ts.map +1 -0
  368. package/dist/tasks/gate-notes.js +33 -0
  369. package/dist/tasks/gate-notes.js.map +1 -0
  370. package/dist/tasks/index.d.ts +2 -1
  371. package/dist/tasks/index.d.ts.map +1 -1
  372. package/dist/tasks/index.js +2 -1
  373. package/dist/tasks/index.js.map +1 -1
  374. package/dist/tasks/test-run-binding.d.ts +117 -0
  375. package/dist/tasks/test-run-binding.d.ts.map +1 -0
  376. package/dist/tasks/test-run-binding.js +365 -0
  377. package/dist/tasks/test-run-binding.js.map +1 -0
  378. package/dist/tasks/tool-cache-env.d.ts +123 -0
  379. package/dist/tasks/tool-cache-env.d.ts.map +1 -0
  380. package/dist/tasks/tool-cache-env.js +287 -0
  381. package/dist/tasks/tool-cache-env.js.map +1 -0
  382. package/dist/tasks/tool-cache-failed-first.d.ts +155 -0
  383. package/dist/tasks/tool-cache-failed-first.d.ts.map +1 -0
  384. package/dist/tasks/tool-cache-failed-first.js +285 -0
  385. package/dist/tasks/tool-cache-failed-first.js.map +1 -0
  386. package/dist/tasks/tool-cache.d.ts +375 -55
  387. package/dist/tasks/tool-cache.d.ts.map +1 -1
  388. package/dist/tasks/tool-cache.js +912 -303
  389. package/dist/tasks/tool-cache.js.map +1 -1
  390. package/dist/tasks/tool-resolver.d.ts +4 -3
  391. package/dist/tasks/tool-resolver.d.ts.map +1 -1
  392. package/dist/tasks/tool-resolver.js +15 -4
  393. package/dist/tasks/tool-resolver.js.map +1 -1
  394. package/dist/tasks/tool-semaphore.d.ts +67 -7
  395. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  396. package/dist/tasks/tool-semaphore.js +134 -56
  397. package/dist/tasks/tool-semaphore.js.map +1 -1
  398. package/dist/upgrade.d.ts.map +1 -1
  399. package/dist/upgrade.js +4 -0
  400. package/dist/upgrade.js.map +1 -1
  401. package/dist/validation/engine-ops.d.ts +6 -0
  402. package/dist/validation/engine-ops.d.ts.map +1 -1
  403. package/dist/validation/engine-ops.js +8 -0
  404. package/dist/validation/engine-ops.js.map +1 -1
  405. package/migrations/drizzle-cleo-project/20260930170000_t12819-trigger-suspend-clause/migration.sql +367 -0
  406. package/migrations/sync-journal/20260930120000_t12343-capture/migration.sql +47 -0
  407. package/migrations/sync-journal/20261001170000_t12984-sealer/migration.sql +101 -0
  408. package/package.json +13 -13
  409. package/templates/CLEO-INJECTION.md +5 -5
  410. package/templates/CLEO-REFERENCE.md +8 -4
@@ -0,0 +1 @@
1
+ {"version":3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C/E,IAAI,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAC;QACpF,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,gDAAgD;IAClD,CAAC;IACD,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,OAAO,IAAI,IAAI;QAC1B,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACxB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI;YACxB,QAAQ,EAAE,CAAC,CAAC,aAAa,IAAI,IAAI;YACjC,UAAU,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;YACzE,UAAU,EAAE,CAAC,CAAC,aAAa,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ;SACrD,CAAC,CAAC;QACH,UAAU;QACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACxB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * `cleo cloud status`: the agent's single verification call (cleo-nexus
3
+ * device contract v2.15, §4.4, E3 `GET /v1/status`, §3.7).
4
+ *
5
+ * It reads local facts first (the device credential, the project, its
6
+ * `.cleo/nexus-link.json` entry, the store's replica id), then asks E3, and
7
+ * returns `{ verdict, summary, local, remote, warnings }`:
8
+ *
9
+ * - no credential: verdict `not-signed-in`, and no network call is made;
10
+ * - the server's verdict is downgraded to `not-linked` when the current
11
+ * project has no local link entry or no bound replica;
12
+ * - unreachable: `E_NEXUS_UNREACHABLE`, its `publicDetails` (the envelope's `error.details`) carrying `local` and a
13
+ * summary whose remote fields are null ({@link NexusCloudOfflineError});
14
+ * - outside a project (or `--project` naming an unknown id) the device and
15
+ * account parts are still reported and the verdict comes from the device
16
+ * checks only.
17
+ *
18
+ * Every request is a GET. Getting the credential may still upgrade a 9.24
19
+ * session (E1) and retry unsettled logouts (E9/E10), as every device-credential
20
+ * command does (§3.4, §3.5). The replica id is read through
21
+ * `activeReplica(db, 'project')` on a read-only snapshot handle
22
+ * (`openCleoDbSnapshot`, no migrations, no pragmas): this command never binds
23
+ * a replica or writes `cleo.db`. When the store cannot be read that way,
24
+ * `replicaId` is `null` with `W_NEXUS_REPLICA_UNREADABLE` and the verdict is
25
+ * `attention`, never `not-linked`: unknown is not unbound.
26
+ *
27
+ * A server without E3 (404 `E_NOT_FOUND` on `/v1/status`) gets the same
28
+ * `NexusStatus` shape composed client-side from E2, E14 and E15 with the
29
+ * contract's check and verdict rules, plus a `W_NEXUS_STATUS_COMPOSED`
30
+ * warning.
31
+ *
32
+ * TODO(T12905): `cleo cloud status --report` (send presence before E3) is not
33
+ * implemented here; it is the one write this command will gain.
34
+ *
35
+ * @task T12871
36
+ * @epic T12323
37
+ */
38
+ import { type CloudStatusOfflineDetails, type CloudStatusResult, type CloudWarning, type NexusCloudStatus, type NexusCloudStatusCheck } from '@cleocode/contracts';
39
+ import { NexusAccountError } from './nexus-auth.js';
40
+ import { type NexusCloudConnection, type NexusCloudOptions } from './nexus-cloud.js';
41
+ /** Warning: the server has no E3, so the status was composed from E2, E14 and E15. */
42
+ export declare const W_NEXUS_STATUS_COMPOSED = "W_NEXUS_STATUS_COMPOSED";
43
+ /** Warning: the current project has no `.cleo/nexus-link.json` entry for the origin. */
44
+ export declare const W_NEXUS_NOT_LINKED_LOCALLY = "W_NEXUS_NOT_LINKED_LOCALLY";
45
+ /** Warning: the current project's store has no bound replica (or none could be read). */
46
+ export declare const W_NEXUS_NO_REPLICA = "W_NEXUS_NO_REPLICA";
47
+ /** Warning: the store exists but could not be read read-only, so `replicaId` is null. */
48
+ export declare const W_NEXUS_REPLICA_UNREADABLE = "W_NEXUS_REPLICA_UNREADABLE";
49
+ /** Warning: `--project` names an id the server does not show; only the device was checked. */
50
+ export declare const W_NEXUS_PROJECT_UNKNOWN = "W_NEXUS_PROJECT_UNKNOWN";
51
+ /** Options for {@link getNexusCloudStatus}. */
52
+ export interface NexusCloudStatusOptions extends NexusCloudOptions {
53
+ /** `--project`: the project to check; defaults to the current project. */
54
+ projectId?: string;
55
+ /** Clock for presence freshness when the status is composed (tests). */
56
+ now?: () => Date;
57
+ }
58
+ /**
59
+ * `E_NEXUS_UNREACHABLE` from `cleo cloud status`, carrying the local facts
60
+ * (§4.4 "Offline"). Holds no secret.
61
+ */
62
+ export declare class NexusCloudOfflineError extends NexusAccountError {
63
+ /**
64
+ * Local state, a summary with every remote field null, and the warnings
65
+ * collected so far. Named `publicDetails`: the CLI forwards only this
66
+ * explicitly secret-free field into the error envelope.
67
+ */
68
+ readonly publicDetails: CloudStatusOfflineDetails;
69
+ /**
70
+ * @param message - Human message.
71
+ * @param publicDetails - Local state, summary and warnings.
72
+ * @param fix - Remedy.
73
+ */
74
+ constructor(message: string, publicDetails: CloudStatusOfflineDetails, fix?: string);
75
+ }
76
+ /**
77
+ * The verdict of a set of checks (E3 rules, §4.2): the first matching rule wins.
78
+ *
79
+ * @param checks - The checks that apply.
80
+ * @returns `not-registered`, `not-linked`, `attention` or `ok`.
81
+ */
82
+ export declare function nexusStatusVerdict(checks: readonly NexusCloudStatusCheck[]): NexusCloudStatus['verdict'];
83
+ /** What {@link readNexusLocalReplicaId} learned about the store's replica. */
84
+ export interface NexusLocalReplicaRead {
85
+ /** The active replica id, or `null` (no store, no bound replica, or unreadable). */
86
+ readonly replicaId: string | null;
87
+ /**
88
+ * `true` when the store exists but could not be read: `replicaId: null` then
89
+ * means "unknown", not "unbound", so the caller must not conclude not-linked.
90
+ */
91
+ readonly unreadable: boolean;
92
+ /** `W_NEXUS_REPLICA_UNREADABLE` when `unreadable`. */
93
+ readonly warning: CloudWarning | null;
94
+ }
95
+ /**
96
+ * The active replica id of a project store, read-only: a snapshot handle with
97
+ * no migrations and no pragmas, closed before returning. Never binds and never
98
+ * writes a row.
99
+ *
100
+ * SQLite side effect: a read-only open of a WAL-mode store needs the `-wal`
101
+ * and `-shm` sidecars, and SQLite creates them (empty) when they are missing
102
+ * and the directory is writable. Run as another user (for example under
103
+ * `sudo`), those sidecars would be left owned by that user, so when the store
104
+ * has no `-wal` and the directory is not writable by the caller the open is
105
+ * skipped and the store reported unreadable instead.
106
+ *
107
+ * @param projectRoot - Project root.
108
+ * @returns The replica id, whether the store was unreadable, and a warning.
109
+ */
110
+ export declare function readNexusLocalReplicaId(projectRoot: string): Promise<NexusLocalReplicaRead>;
111
+ /**
112
+ * The `NexusStatus` of E3, composed from E2, E14 and E15 with the contract's
113
+ * check rules (§4.2 E3), for a server without E3.
114
+ *
115
+ * @param conn - Connection.
116
+ * @param projectId - Project to check, or `null`.
117
+ * @param replicaId - Replica to check, or `null`.
118
+ * @param now - Clock for presence freshness.
119
+ * @returns The composed status.
120
+ */
121
+ export declare function composeNexusStatus(conn: NexusCloudConnection, projectId: string | null, replicaId: string | null, now?: () => Date): Promise<NexusCloudStatus>;
122
+ /**
123
+ * `cleo cloud status [--project <id>]`.
124
+ *
125
+ * @param opts - Project, API URL, stores and test overrides.
126
+ * @returns The verdict, summary, local and remote facts, and warnings.
127
+ * @throws {NexusCloudOfflineError} `E_NEXUS_UNREACHABLE` when the server does not answer.
128
+ * @throws {NexusAccountError} `E_NEXUS_DEVICE_REQUIRED`, `E_NEXUS_ACCOUNT_AMBIGUOUS`,
129
+ * or a mapped API refusal (§4.0.4).
130
+ */
131
+ export declare function getNexusCloudStatus(opts?: NexusCloudStatusOptions): Promise<CloudStatusResult>;
132
+ //# sourceMappingURL=nexus-cloud-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-cloud-status.d.ts","sourceRoot":"","sources":["../../src/cloud/nexus-cloud-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAIH,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAGtB,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAK3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAGvB,MAAM,kBAAkB,CAAC;AAK1B,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,yFAAyF;AACzF,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,8FAA8F;AAC9F,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,+CAA+C;AAC/C,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,iBAAiB;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,yBAAyB,CAAC;IAElD;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,yBAAyB,EAAE,GAAG,CAAC,EAAE,MAAM;CAKpF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,qBAAqB,EAAE,GACvC,gBAAgB,CAAC,SAAS,CAAC,CAO7B;AAOD,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAcD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAsBjG;AAgFD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,oBAAoB,EAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,GAAG,GAAE,MAAM,IAAuB,GACjC,OAAO,CAAC,gBAAgB,CAAC,CA8F3B;AA0FD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,GAAE,uBAA4B,GACjC,OAAO,CAAC,iBAAiB,CAAC,CA8E5B"}
@@ -0,0 +1,476 @@
1
+ /**
2
+ * `cleo cloud status`: the agent's single verification call (cleo-nexus
3
+ * device contract v2.15, §4.4, E3 `GET /v1/status`, §3.7).
4
+ *
5
+ * It reads local facts first (the device credential, the project, its
6
+ * `.cleo/nexus-link.json` entry, the store's replica id), then asks E3, and
7
+ * returns `{ verdict, summary, local, remote, warnings }`:
8
+ *
9
+ * - no credential: verdict `not-signed-in`, and no network call is made;
10
+ * - the server's verdict is downgraded to `not-linked` when the current
11
+ * project has no local link entry or no bound replica;
12
+ * - unreachable: `E_NEXUS_UNREACHABLE`, its `publicDetails` (the envelope's `error.details`) carrying `local` and a
13
+ * summary whose remote fields are null ({@link NexusCloudOfflineError});
14
+ * - outside a project (or `--project` naming an unknown id) the device and
15
+ * account parts are still reported and the verdict comes from the device
16
+ * checks only.
17
+ *
18
+ * Every request is a GET. Getting the credential may still upgrade a 9.24
19
+ * session (E1) and retry unsettled logouts (E9/E10), as every device-credential
20
+ * command does (§3.4, §3.5). The replica id is read through
21
+ * `activeReplica(db, 'project')` on a read-only snapshot handle
22
+ * (`openCleoDbSnapshot`, no migrations, no pragmas): this command never binds
23
+ * a replica or writes `cleo.db`. When the store cannot be read that way,
24
+ * `replicaId` is `null` with `W_NEXUS_REPLICA_UNREADABLE` and the verdict is
25
+ * `attention`, never `not-linked`: unknown is not unbound.
26
+ *
27
+ * A server without E3 (404 `E_NOT_FOUND` on `/v1/status`) gets the same
28
+ * `NexusStatus` shape composed client-side from E2, E14 and E15 with the
29
+ * contract's check and verdict rules, plus a `W_NEXUS_STATUS_COMPOSED`
30
+ * warning.
31
+ *
32
+ * TODO(T12905): `cleo cloud status --report` (send presence before E3) is not
33
+ * implemented here; it is the one write this command will gain.
34
+ *
35
+ * @task T12871
36
+ * @epic T12323
37
+ */
38
+ import { accessSync, existsSync, constants as fsConstants } from 'node:fs';
39
+ import { join } from 'node:path';
40
+ import { NEXUS_PRESENCE_FRESH_SECONDS, nexusCloudProjectDetailSchema, nexusCloudStatusSchema, nexusCloudWhoamiSchema, } from '@cleocode/contracts';
41
+ import { resolveCleoDir } from '../paths.js';
42
+ import { NexusAccountError, resolveNexusApiUrl } from './nexus-auth.js';
43
+ import { assertNexusCloudDeviceMode, connectNexusCloud, currentNexusCloudProject, listNexusCloudReplicas, nexusQueryPath, } from './nexus-cloud.js';
44
+ import { FileNexusTokenStore, nexusOriginKey } from './nexus-credentials.js';
45
+ import { NexusDeviceStore, UnreadableNexusDevice } from './nexus-device.js';
46
+ import { nexusHomeReplicaListSchema } from './nexus-home.js';
47
+ /** Warning: the server has no E3, so the status was composed from E2, E14 and E15. */
48
+ export const W_NEXUS_STATUS_COMPOSED = 'W_NEXUS_STATUS_COMPOSED';
49
+ /** Warning: the current project has no `.cleo/nexus-link.json` entry for the origin. */
50
+ export const W_NEXUS_NOT_LINKED_LOCALLY = 'W_NEXUS_NOT_LINKED_LOCALLY';
51
+ /** Warning: the current project's store has no bound replica (or none could be read). */
52
+ export const W_NEXUS_NO_REPLICA = 'W_NEXUS_NO_REPLICA';
53
+ /** Warning: the store exists but could not be read read-only, so `replicaId` is null. */
54
+ export const W_NEXUS_REPLICA_UNREADABLE = 'W_NEXUS_REPLICA_UNREADABLE';
55
+ /** Warning: `--project` names an id the server does not show; only the device was checked. */
56
+ export const W_NEXUS_PROJECT_UNKNOWN = 'W_NEXUS_PROJECT_UNKNOWN';
57
+ /**
58
+ * `E_NEXUS_UNREACHABLE` from `cleo cloud status`, carrying the local facts
59
+ * (§4.4 "Offline"). Holds no secret.
60
+ */
61
+ export class NexusCloudOfflineError extends NexusAccountError {
62
+ /**
63
+ * Local state, a summary with every remote field null, and the warnings
64
+ * collected so far. Named `publicDetails`: the CLI forwards only this
65
+ * explicitly secret-free field into the error envelope.
66
+ */
67
+ publicDetails;
68
+ /**
69
+ * @param message - Human message.
70
+ * @param publicDetails - Local state, summary and warnings.
71
+ * @param fix - Remedy.
72
+ */
73
+ constructor(message, publicDetails, fix) {
74
+ super('E_NEXUS_UNREACHABLE', message, fix);
75
+ this.name = 'NexusCloudOfflineError';
76
+ this.publicDetails = publicDetails;
77
+ }
78
+ }
79
+ /**
80
+ * The verdict of a set of checks (E3 rules, §4.2): the first matching rule wins.
81
+ *
82
+ * @param checks - The checks that apply.
83
+ * @returns `not-registered`, `not-linked`, `attention` or `ok`.
84
+ */
85
+ export function nexusStatusVerdict(checks) {
86
+ const failed = (id) => checks.some((c) => c.id === id && !c.ok);
87
+ if (failed('device.registered') || failed('device.active'))
88
+ return 'not-registered';
89
+ if (failed('project.registered') || failed('replica.attached'))
90
+ return 'not-linked';
91
+ if (checks.some((c) => c.required && !c.ok))
92
+ return 'attention';
93
+ return 'ok';
94
+ }
95
+ /** The device and credential checks only (for "outside a project"). */
96
+ function deviceOnly(checks) {
97
+ return checks.filter((c) => c.id.startsWith('credential.') || c.id.startsWith('device.'));
98
+ }
99
+ /** An unreadable-store result with its warning. */
100
+ function unreadableStore(reason) {
101
+ return {
102
+ replicaId: null,
103
+ unreadable: true,
104
+ warning: {
105
+ code: W_NEXUS_REPLICA_UNREADABLE,
106
+ message: `could not read the project store read-only, so the replica id is unknown: ${reason}`,
107
+ },
108
+ };
109
+ }
110
+ /**
111
+ * The active replica id of a project store, read-only: a snapshot handle with
112
+ * no migrations and no pragmas, closed before returning. Never binds and never
113
+ * writes a row.
114
+ *
115
+ * SQLite side effect: a read-only open of a WAL-mode store needs the `-wal`
116
+ * and `-shm` sidecars, and SQLite creates them (empty) when they are missing
117
+ * and the directory is writable. Run as another user (for example under
118
+ * `sudo`), those sidecars would be left owned by that user, so when the store
119
+ * has no `-wal` and the directory is not writable by the caller the open is
120
+ * skipped and the store reported unreadable instead.
121
+ *
122
+ * @param projectRoot - Project root.
123
+ * @returns The replica id, whether the store was unreadable, and a warning.
124
+ */
125
+ export async function readNexusLocalReplicaId(projectRoot) {
126
+ // The project store path, as resolveDualScopeDbPath('project', root) builds it.
127
+ const dir = resolveCleoDir(projectRoot);
128
+ const path = join(dir, 'cleo.db');
129
+ if (!existsSync(path))
130
+ return { replicaId: null, unreadable: false, warning: null };
131
+ if (!existsSync(`${path}-wal`) && !isWritable(dir)) {
132
+ return unreadableStore('the store has no -wal file and its directory is not writable, so a read-only open would fail or leave sidecars behind');
133
+ }
134
+ const { openCleoDbSnapshot } = await import('../store/open-cleo-db.js');
135
+ const { activeReplica } = await import('../store/sync/replica.js');
136
+ let snap;
137
+ try {
138
+ snap = openCleoDbSnapshot(path, { readOnly: true, applyPragmas: false });
139
+ const replicaId = activeReplica(snap.db, 'project')?.replicaId ?? null;
140
+ return { replicaId, unreadable: false, warning: null };
141
+ }
142
+ catch (err) {
143
+ return unreadableStore(err instanceof Error ? err.message : String(err));
144
+ }
145
+ finally {
146
+ snap?.close();
147
+ }
148
+ }
149
+ /** True when the caller may write into `dir`. */
150
+ function isWritable(dir) {
151
+ try {
152
+ accessSync(dir, fsConstants.W_OK);
153
+ return true;
154
+ }
155
+ catch {
156
+ return false;
157
+ }
158
+ }
159
+ /** True when a device credential (or a 9.24 session to upgrade) is stored for the origin. */
160
+ async function hasLocalCredential(apiUrl, devices, sessions) {
161
+ const origin = nexusOriginKey(apiUrl);
162
+ for (const d of await devices.list()) {
163
+ if (d instanceof UnreadableNexusDevice || d.origin !== origin)
164
+ continue;
165
+ if (d.currentBearer() !== null || d.unseal().raceCandidate)
166
+ return true;
167
+ }
168
+ return (await sessions.get(apiUrl)) !== null;
169
+ }
170
+ /** A summary with no remote facts. */
171
+ function emptySummary(local) {
172
+ return {
173
+ signedIn: local.signedIn,
174
+ registered: false,
175
+ profile: local.profile,
176
+ linked: false,
177
+ replicaAttached: false,
178
+ devices: 0,
179
+ lastPresenceAt: null,
180
+ lastSyncAt: null,
181
+ headSeq: null,
182
+ openConflicts: null,
183
+ };
184
+ }
185
+ /** One check. */
186
+ function check(id, ok, required, detail) {
187
+ return { id, ok, required, detail };
188
+ }
189
+ /** E2's device and credential checks. */
190
+ function deviceChecks(whoami) {
191
+ const d = whoami.device;
192
+ const out = [
193
+ check('credential.valid', true, true, `${whoami.credential.kind} credential accepted`),
194
+ check('device.registered', d !== null, true, d ? `device ${d.deviceId}` : 'no device'),
195
+ check('device.active', d?.state === 'active', true, `state ${d?.state ?? 'none'}`),
196
+ ];
197
+ if (d && d.certificate !== undefined) {
198
+ out.push(check('device.certified', d.certificate !== null, false, 'device certificate'));
199
+ }
200
+ return out;
201
+ }
202
+ /** The replica row of `replicaId`, from E14's list or, when that was cut, from E15. */
203
+ async function findReplica(conn, projectId, replicaId, listed, truncated) {
204
+ const hit = listed.find((r) => r.replicaId === replicaId);
205
+ if (hit || !truncated)
206
+ return hit ?? null;
207
+ const all = await listNexusCloudReplicas(conn, projectId);
208
+ return all.replicas.find((r) => r.replicaId === replicaId) ?? null;
209
+ }
210
+ /**
211
+ * The `NexusStatus` of E3, composed from E2, E14 and E15 with the contract's
212
+ * check rules (§4.2 E3), for a server without E3.
213
+ *
214
+ * @param conn - Connection.
215
+ * @param projectId - Project to check, or `null`.
216
+ * @param replicaId - Replica to check, or `null`.
217
+ * @param now - Clock for presence freshness.
218
+ * @returns The composed status.
219
+ */
220
+ export async function composeNexusStatus(conn, projectId, replicaId, now = () => new Date()) {
221
+ const whoami = await conn.get('/v1/whoami', nexusCloudWhoamiSchema);
222
+ const checks = deviceChecks(whoami);
223
+ const base = { user: whoami.user, credential: whoami.credential, device: whoami.device };
224
+ if (projectId === null) {
225
+ return {
226
+ ...base,
227
+ project: null,
228
+ replica: null,
229
+ stream: null,
230
+ checks,
231
+ verdict: nexusStatusVerdict(checks),
232
+ };
233
+ }
234
+ const detail = await conn.find(`/v1/projects/${encodeURIComponent(projectId)}`, nexusCloudProjectDetailSchema);
235
+ checks.push(check('project.registered', detail !== null, true, detail ? 'visible' : 'not visible'));
236
+ if (detail === null) {
237
+ const project = {
238
+ projectId,
239
+ registered: false,
240
+ organizationId: null,
241
+ organizationName: null,
242
+ role: null,
243
+ };
244
+ return {
245
+ ...base,
246
+ project,
247
+ replica: null,
248
+ stream: null,
249
+ checks,
250
+ verdict: nexusStatusVerdict(checks),
251
+ };
252
+ }
253
+ const writable = detail.role === 'writer' || detail.role === 'owner';
254
+ const writeRequired = whoami.credential.kind === 'device' && whoami.credential.profile === 'device';
255
+ checks.push(check('project.writable', writable, writeRequired, `role ${detail.role}`));
256
+ let replica = null;
257
+ if (replicaId !== null) {
258
+ const row = await findReplica(conn, projectId, replicaId, detail.replicas, detail.truncated);
259
+ const mine = row !== null && row.deviceId === whoami.device?.deviceId;
260
+ replica = {
261
+ replicaId,
262
+ attached: mine,
263
+ attachedElsewhere: row !== null && !mine,
264
+ attachedAt: row?.attachedAt ?? null,
265
+ lastSyncAt: row?.lastSyncAt ?? null,
266
+ presenceAt: row?.presenceAt ?? null,
267
+ lastReplicaSeq: null,
268
+ };
269
+ const fresh = replica.presenceAt !== null &&
270
+ now().getTime() - Date.parse(replica.presenceAt) <= NEXUS_PRESENCE_FRESH_SECONDS * 1000;
271
+ const syncOn = row?.presence?.sync?.enabled === true;
272
+ checks.push(check('replica.attached', mine, true, mine ? 'attached from this device' : row ? 'attached from another device' : 'not attached'), check('presence.fresh', fresh, false, replica.presenceAt ?? 'no presence'), check('replica.synced', replica.lastSyncAt !== null, syncOn, replica.lastSyncAt ?? 'never synced'));
273
+ }
274
+ checks.push(check('conflicts.none', detail.openConflicts === 0, true, `${detail.openConflicts} open`));
275
+ return {
276
+ ...base,
277
+ project: {
278
+ projectId,
279
+ registered: true,
280
+ organizationId: detail.project.organizationId,
281
+ organizationName: detail.project.organizationName ?? null,
282
+ role: detail.role,
283
+ },
284
+ replica,
285
+ stream: detail.stream
286
+ ? { ...detail.stream, openConflicts: detail.openConflicts, devices: detail.devices }
287
+ : null,
288
+ checks,
289
+ verdict: nexusStatusVerdict(checks),
290
+ };
291
+ }
292
+ /** E3, or the composed status when the server has no E3. */
293
+ async function remoteStatus(conn, projectId, replicaId, now, warnings) {
294
+ const path = nexusQueryPath('/v1/status', {
295
+ projectId: projectId ?? undefined,
296
+ // E3 refuses a replicaId without a projectId.
297
+ replicaId: projectId !== null && replicaId !== null ? replicaId : undefined,
298
+ });
299
+ const status = await conn.find(path, nexusCloudStatusSchema);
300
+ if (status !== null)
301
+ return status;
302
+ warnings.push({
303
+ code: W_NEXUS_STATUS_COMPOSED,
304
+ message: 'the server has no GET /v1/status yet; the status was composed from /v1/whoami and the project reads',
305
+ });
306
+ return composeNexusStatus(conn, projectId, replicaId, now);
307
+ }
308
+ /** Apply the local downgrades (§4.4) to the remote verdict. */
309
+ function localVerdict(remote, project, isLocal, replica, warnings) {
310
+ if (remote.project !== null && !remote.project.registered && !isLocal) {
311
+ warnings.push({
312
+ code: W_NEXUS_PROJECT_UNKNOWN,
313
+ message: `project ${remote.project.projectId} is not registered or not visible; only the device was checked`,
314
+ });
315
+ return nexusStatusVerdict(deviceOnly(remote.checks));
316
+ }
317
+ if (!isLocal || project === null || (remote.verdict !== 'ok' && remote.verdict !== 'attention')) {
318
+ return remote.verdict;
319
+ }
320
+ if (project.link === null) {
321
+ warnings.push({
322
+ code: W_NEXUS_NOT_LINKED_LOCALLY,
323
+ message: 'this project has no .cleo/nexus-link.json entry for the origin; run `cleo project link`',
324
+ });
325
+ return 'not-linked';
326
+ }
327
+ if (replica.unreadable) {
328
+ // Unknown is not unbound: never conclude not-linked from an unreadable
329
+ // store (W_NEXUS_REPLICA_UNREADABLE already says why).
330
+ return 'attention';
331
+ }
332
+ if (replica.replicaId === null) {
333
+ warnings.push({
334
+ code: W_NEXUS_NO_REPLICA,
335
+ message: "this project's store has no bound replica; run `cleo project link`",
336
+ });
337
+ return 'not-linked';
338
+ }
339
+ return remote.verdict;
340
+ }
341
+ /** The summary of a remote status. */
342
+ function summaryOf(remote, local, project, isLocal) {
343
+ const ok = (id) => remote.checks.some((c) => c.id === id && c.ok);
344
+ const registeredRemotely = remote.project?.registered === true;
345
+ return {
346
+ signedIn: true,
347
+ registered: ok('device.registered') && ok('device.active'),
348
+ profile: remote.credential.profile ?? local.profile,
349
+ linked: registeredRemotely && (!isLocal || (project?.link ?? null) !== null),
350
+ replicaAttached: remote.replica?.attached === true,
351
+ devices: remote.stream?.devices.active ?? 0,
352
+ lastPresenceAt: remote.replica?.presenceAt ?? null,
353
+ lastSyncAt: remote.replica?.lastSyncAt ?? null,
354
+ headSeq: remote.stream?.headSeq ?? null,
355
+ openConflicts: remote.stream?.openConflicts ?? null,
356
+ };
357
+ }
358
+ /**
359
+ * `cleo cloud status [--project <id>]`.
360
+ *
361
+ * @param opts - Project, API URL, stores and test overrides.
362
+ * @returns The verdict, summary, local and remote facts, and warnings.
363
+ * @throws {NexusCloudOfflineError} `E_NEXUS_UNREACHABLE` when the server does not answer.
364
+ * @throws {NexusAccountError} `E_NEXUS_DEVICE_REQUIRED`, `E_NEXUS_ACCOUNT_AMBIGUOUS`,
365
+ * or a mapped API refusal (§4.0.4).
366
+ */
367
+ export async function getNexusCloudStatus(opts = {}) {
368
+ assertNexusCloudDeviceMode();
369
+ const apiUrl = resolveNexusApiUrl(opts.apiUrl);
370
+ const devices = opts.deviceStore ?? new NexusDeviceStore();
371
+ const sessions = opts.store ?? new FileNexusTokenStore();
372
+ const warnings = [];
373
+ const project = currentNexusCloudProject(apiUrl, opts.projectRoot);
374
+ const projectHere = project ? (project.link?.remoteProjectId ?? project.projectId) : null;
375
+ const isLocal = project !== null &&
376
+ (opts.projectId === undefined ||
377
+ opts.projectId === project.projectId ||
378
+ opts.projectId === project.link?.remoteProjectId);
379
+ // The current project (bare, or named by its local or remote id) is asked
380
+ // about by its linked remote id, like the bare command.
381
+ const projectId = isLocal ? projectHere : (opts.projectId ?? null);
382
+ let replica = { replicaId: null, unreadable: false, warning: null };
383
+ if (isLocal && project !== null) {
384
+ replica = await readNexusLocalReplicaId(project.root);
385
+ if (replica.warning)
386
+ warnings.push(replica.warning);
387
+ }
388
+ const replicaId = replica.replicaId;
389
+ const local = {
390
+ apiUrl,
391
+ signedIn: false,
392
+ nexusDeviceId: null,
393
+ profile: null,
394
+ projectId,
395
+ replicaId,
396
+ linkPath: isLocal && project?.link ? project.linkPath : null,
397
+ credentialsPath: devices.location,
398
+ };
399
+ const notSignedIn = () => ({
400
+ verdict: 'not-signed-in',
401
+ summary: emptySummary(local),
402
+ local,
403
+ remote: null,
404
+ warnings,
405
+ });
406
+ if (!(await hasLocalCredential(apiUrl, devices, sessions)))
407
+ return notSignedIn();
408
+ try {
409
+ const conn = await connectNexusCloud({
410
+ ...opts,
411
+ apiUrl,
412
+ deviceStore: devices,
413
+ store: sessions,
414
+ });
415
+ warnings.push(...conn.warnings);
416
+ local.signedIn = true;
417
+ local.nexusDeviceId = conn.device.deviceId;
418
+ local.profile = conn.device.unseal().current?.profile ?? null;
419
+ const remote = await remoteStatus(conn, projectId, replicaId, opts.now, warnings);
420
+ const verdict = localVerdict(remote, project, isLocal, replica, warnings);
421
+ return {
422
+ verdict,
423
+ summary: summaryOf(remote, local, project, isLocal),
424
+ local,
425
+ remote,
426
+ global: await globalStoreOf(conn, warnings),
427
+ warnings,
428
+ };
429
+ }
430
+ catch (err) {
431
+ if (err instanceof NexusAccountError &&
432
+ err.code === 'E_NEXUS_NOT_SIGNED_IN' &&
433
+ !local.signedIn) {
434
+ return notSignedIn();
435
+ }
436
+ if (err instanceof NexusAccountError && err.code === 'E_NEXUS_UNREACHABLE') {
437
+ throw new NexusCloudOfflineError(err.message, { local, summary: emptySummary(local), warnings }, err.fix);
438
+ }
439
+ throw err;
440
+ }
441
+ }
442
+ /**
443
+ * This device's global store (the main brain) on the account's home stream
444
+ * (T12952): attached or not, its presence, and how many devices attach one.
445
+ * A server without the home-replica endpoints yields `supported: false`.
446
+ */
447
+ async function globalStoreOf(conn, warnings) {
448
+ try {
449
+ const list = await conn.find('/v1/account/home/replicas', nexusHomeReplicaListSchema);
450
+ if (list === null) {
451
+ return { supported: false, attached: false, replicaId: null, presenceAt: null, devices: 0 };
452
+ }
453
+ const mine = list.replicas.find((r) => r.deviceId === conn.device.deviceId) ?? null;
454
+ if (mine === null) {
455
+ warnings.push({
456
+ code: 'W_NEXUS_GLOBAL_NOT_ATTACHED',
457
+ message: "this device's global store is not attached to the account; run `cleo login nexus`",
458
+ });
459
+ }
460
+ return {
461
+ supported: true,
462
+ attached: mine !== null,
463
+ replicaId: mine?.replicaId ?? null,
464
+ presenceAt: mine?.presenceAt ?? null,
465
+ devices: new Set(list.replicas.map((r) => r.deviceId)).size,
466
+ };
467
+ }
468
+ catch (err) {
469
+ warnings.push({
470
+ code: 'W_NEXUS_GLOBAL_UNREADABLE',
471
+ message: `could not read the global store attachments: ${err instanceof Error ? err.message : String(err)}`,
472
+ });
473
+ return { supported: false, attached: false, replicaId: null, presenceAt: null, devices: 0 };
474
+ }
475
+ }
476
+ //# sourceMappingURL=nexus-cloud-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-cloud-status.js","sourceRoot":"","sources":["../../src/cloud/nexus-cloud-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAQL,4BAA4B,EAK5B,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EAItB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAwB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,yFAAyF;AACzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD,yFAAyF;AACzF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAUjE;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SA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