@skrr-ai/cli 0.1.119 → 0.1.121

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 (336) hide show
  1. package/dist/base-command.d.ts +31 -0
  2. package/dist/base-command.js +117 -6
  3. package/dist/commands/agent/message/context.d.ts +1 -0
  4. package/dist/commands/agent/message/context.js +3 -2
  5. package/dist/commands/commands.js +11 -0
  6. package/dist/commands/commitments/action-proposal.d.ts +13 -0
  7. package/dist/commands/commitments/action-proposal.js +39 -0
  8. package/dist/commands/commitments/action-proposals/decide.js +8 -1
  9. package/dist/commands/commitments/action-proposals/execute.js +11 -1
  10. package/dist/commands/commitments/create.js +2 -2
  11. package/dist/commands/commitments/doctor.d.ts +8 -0
  12. package/dist/commands/commitments/doctor.js +22 -0
  13. package/dist/commands/commitments/execute-remediation.js +12 -1
  14. package/dist/commands/commitments/observations.js +2 -2
  15. package/dist/commands/commitments/pack/bind.d.ts +18 -1
  16. package/dist/commands/commitments/pack/bind.js +66 -8
  17. package/dist/commands/commitments/pack/plan.d.ts +4 -1
  18. package/dist/commands/commitments/pack/plan.js +30 -2
  19. package/dist/commands/commitments/update.js +8 -2
  20. package/dist/commands/completion/index.js +1 -1
  21. package/dist/commands/completion/values.js +1 -1
  22. package/dist/commands/computer-use/audio.d.ts +1 -0
  23. package/dist/commands/computer-use/audio.js +1 -0
  24. package/dist/commands/computer-use/browser.d.ts +1 -0
  25. package/dist/commands/computer-use/browser.js +1 -0
  26. package/dist/commands/computer-use/disable.d.ts +1 -0
  27. package/dist/commands/computer-use/disable.js +1 -0
  28. package/dist/commands/computer-use/enable.d.ts +1 -0
  29. package/dist/commands/computer-use/enable.js +1 -0
  30. package/dist/commands/computer-use/index.d.ts +1 -0
  31. package/dist/commands/computer-use/index.js +1 -0
  32. package/dist/commands/computer-use/install.d.ts +1 -0
  33. package/dist/commands/computer-use/install.js +1 -0
  34. package/dist/commands/computer-use/recover.d.ts +1 -0
  35. package/dist/commands/computer-use/recover.js +1 -0
  36. package/dist/commands/computer-use/status.d.ts +1 -0
  37. package/dist/commands/computer-use/status.js +1 -0
  38. package/dist/commands/computer-use/stop.d.ts +1 -0
  39. package/dist/commands/computer-use/stop.js +1 -0
  40. package/dist/commands/context.js +16 -11
  41. package/dist/commands/convos/recovery.js +1 -1
  42. package/dist/commands/daemon/diagnostics.d.ts +9 -0
  43. package/dist/commands/daemon/diagnostics.js +53 -0
  44. package/dist/commands/daemon/index.js +2 -0
  45. package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
  46. package/dist/commands/daemon/maintenance/attest.js +52 -0
  47. package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
  48. package/dist/commands/daemon/maintenance/hold.js +70 -0
  49. package/dist/commands/daemon/maintenance/index.d.ts +12 -0
  50. package/dist/commands/daemon/maintenance/index.js +30 -0
  51. package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
  52. package/dist/commands/daemon/maintenance/resume.js +36 -0
  53. package/dist/commands/daemon/maintenance/status.d.ts +13 -0
  54. package/dist/commands/daemon/maintenance/status.js +36 -0
  55. package/dist/commands/doctor.d.ts +4 -1
  56. package/dist/commands/doctor.js +50 -6
  57. package/dist/commands/followups/plans/cancel-batch.js +6 -3
  58. package/dist/commands/followups/plans/capacity.js +7 -3
  59. package/dist/commands/followups/plans/observability.js +11 -3
  60. package/dist/commands/followups/plans/preferences/set.js +26 -8
  61. package/dist/commands/followups/plans/preferences.js +1 -1
  62. package/dist/commands/followups/plans/show.js +1 -1
  63. package/dist/commands/goals/key-results/assess.d.ts +36 -0
  64. package/dist/commands/goals/key-results/assess.js +110 -0
  65. package/dist/commands/goals/key-results/history.d.ts +30 -0
  66. package/dist/commands/goals/key-results/history.js +104 -0
  67. package/dist/commands/goals/key-results/list.d.ts +5 -4
  68. package/dist/commands/goals/key-results/list.js +12 -6
  69. package/dist/commands/goals/key-results/show.d.ts +4 -2
  70. package/dist/commands/goals/key-results/show.js +25 -4
  71. package/dist/commands/goals/key-results/update.d.ts +4 -0
  72. package/dist/commands/goals/key-results/update.js +18 -24
  73. package/dist/commands/goals/plan-now.js +12 -1
  74. package/dist/commands/goals/planner-compare.d.ts +30 -0
  75. package/dist/commands/goals/planner-compare.js +136 -0
  76. package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
  77. package/dist/commands/machines/dedicated/service/exec.js +70 -11
  78. package/dist/commands/machines/hosted/destroy.d.ts +1 -0
  79. package/dist/commands/machines/hosted/destroy.js +11 -1
  80. package/dist/commands/machines/hosted/exec.d.ts +1 -0
  81. package/dist/commands/machines/hosted/exec.js +12 -1
  82. package/dist/commands/machines/hosted/index.js +1 -0
  83. package/dist/commands/machines/hosted/operation.d.ts +14 -0
  84. package/dist/commands/machines/hosted/operation.js +51 -0
  85. package/dist/commands/machines/hosted/pull.js +1 -1
  86. package/dist/commands/machines/hosted/start.js +6 -2
  87. package/dist/commands/search/agents.js +5 -1
  88. package/dist/commands/search/all.js +74 -22
  89. package/dist/commands/search/skills.d.ts +1 -0
  90. package/dist/commands/search/skills.js +12 -1
  91. package/dist/commands/search/spaces.d.ts +8 -1
  92. package/dist/commands/search/spaces.js +50 -12
  93. package/dist/commands/search/tasks.d.ts +13 -2
  94. package/dist/commands/search/tasks.js +78 -14
  95. package/dist/commands/search/teams.js +5 -1
  96. package/dist/commands/search/workspace.d.ts +19 -0
  97. package/dist/commands/search/workspace.js +126 -0
  98. package/dist/commands/skills/browse.d.ts +1 -0
  99. package/dist/commands/skills/browse.js +8 -1
  100. package/dist/commands/skills/search.d.ts +1 -0
  101. package/dist/commands/skills/search.js +12 -1
  102. package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
  103. package/dist/commands/spaces/auto-executor/compare.js +139 -0
  104. package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
  105. package/dist/commands/spaces/auto-executor/runs.js +13 -1
  106. package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
  107. package/dist/commands/spaces/charter/create-from-description.js +77 -0
  108. package/dist/commands/spaces/charter/show.d.ts +22 -0
  109. package/dist/commands/spaces/charter/show.js +61 -0
  110. package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
  111. package/dist/commands/spaces/heartbeats/list.js +13 -0
  112. package/dist/commands/spaces/install-template.js +3 -0
  113. package/dist/commands/spaces/list.d.ts +1 -0
  114. package/dist/commands/spaces/list.js +12 -3
  115. package/dist/commands/spaces/loops/migrate.d.ts +32 -0
  116. package/dist/commands/spaces/loops/migrate.js +103 -0
  117. package/dist/commands/spaces/loops/release.d.ts +14 -0
  118. package/dist/commands/spaces/loops/release.js +59 -0
  119. package/dist/commands/spaces/notebook.d.ts +25 -0
  120. package/dist/commands/spaces/notebook.js +75 -0
  121. package/dist/commands/spaces/proposals/discard.d.ts +17 -0
  122. package/dist/commands/spaces/proposals/discard.js +17 -0
  123. package/dist/commands/spaces/proposals/keep.d.ts +17 -0
  124. package/dist/commands/spaces/proposals/keep.js +17 -0
  125. package/dist/commands/spaces/proposals/list.d.ts +24 -0
  126. package/dist/commands/spaces/proposals/list.js +89 -0
  127. package/dist/commands/spaces/search.d.ts +1 -0
  128. package/dist/commands/spaces/search.js +9 -0
  129. package/dist/commands/spaces/skills/propose.d.ts +29 -0
  130. package/dist/commands/spaces/skills/propose.js +82 -0
  131. package/dist/commands/spaces/templates/fork.js +3 -0
  132. package/dist/commands/spaces/triggers/show.js +6 -0
  133. package/dist/commands/spaces/workflows/retry.d.ts +1 -0
  134. package/dist/commands/spaces/workflows/retry.js +8 -1
  135. package/dist/commands/spaces/workflows/triggers/create.js +3 -2
  136. package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
  137. package/dist/commands/spaces/workflows/triggers/update.js +2 -1
  138. package/dist/commands/spaces/write-policy/set.d.ts +22 -0
  139. package/dist/commands/spaces/write-policy/set.js +82 -0
  140. package/dist/commands/spaces/write-policy/show.d.ts +19 -0
  141. package/dist/commands/spaces/write-policy/show.js +49 -0
  142. package/dist/commands/store/artifacts/receipt.d.ts +14 -0
  143. package/dist/commands/store/artifacts/receipt.js +34 -0
  144. package/dist/commands/store/artifacts/release.d.ts +2 -0
  145. package/dist/commands/store/artifacts/release.js +11 -0
  146. package/dist/commands/store/governance/publish-release.d.ts +2 -0
  147. package/dist/commands/store/governance/publish-release.js +30 -1
  148. package/dist/commands/store/governance/release-receipt.d.ts +12 -0
  149. package/dist/commands/store/governance/release-receipt.js +32 -0
  150. package/dist/commands/tasks/approvals/list.d.ts +11 -5
  151. package/dist/commands/tasks/approvals/list.js +13 -6
  152. package/dist/commands/tasks/attachments/facts.d.ts +12 -0
  153. package/dist/commands/tasks/attachments/facts.js +29 -0
  154. package/dist/commands/tasks/attachments/upload.d.ts +1 -0
  155. package/dist/commands/tasks/attachments/upload.js +16 -0
  156. package/dist/commands/tasks/bulk-update.js +35 -1
  157. package/dist/commands/tasks/context.d.ts +15 -0
  158. package/dist/commands/tasks/context.js +69 -0
  159. package/dist/commands/tasks/copy.d.ts +18 -0
  160. package/dist/commands/tasks/copy.js +85 -0
  161. package/dist/commands/tasks/create-tree.js +97 -23
  162. package/dist/commands/tasks/create.js +9 -1
  163. package/dist/commands/tasks/deliverable/add.js +20 -10
  164. package/dist/commands/tasks/move.js +8 -1
  165. package/dist/commands/tasks/operations/show.d.ts +16 -0
  166. package/dist/commands/tasks/operations/show.js +98 -0
  167. package/dist/commands/tasks/operations/wait.d.ts +22 -0
  168. package/dist/commands/tasks/operations/wait.js +114 -0
  169. package/dist/commands/tasks/preflight.d.ts +1 -0
  170. package/dist/commands/tasks/preflight.js +11 -1
  171. package/dist/commands/tasks/rearm-recurrence.js +4 -0
  172. package/dist/commands/tasks/result/show.js +22 -0
  173. package/dist/commands/tasks/result/submit.d.ts +1 -0
  174. package/dist/commands/tasks/result/submit.js +3 -0
  175. package/dist/commands/tasks/retry-receipt.d.ts +15 -0
  176. package/dist/commands/tasks/retry-receipt.js +89 -0
  177. package/dist/commands/tasks/retry-review.d.ts +16 -0
  178. package/dist/commands/tasks/retry-review.js +66 -0
  179. package/dist/commands/tasks/retry.d.ts +4 -8
  180. package/dist/commands/tasks/retry.js +34 -68
  181. package/dist/commands/tasks/runs.d.ts +21 -0
  182. package/dist/commands/tasks/runs.js +95 -0
  183. package/dist/commands/tasks/search.d.ts +1 -0
  184. package/dist/commands/tasks/search.js +9 -0
  185. package/dist/commands/tasks/show.d.ts +2 -0
  186. package/dist/commands/tasks/show.js +15 -1
  187. package/dist/commands/tasks/start-receipt.d.ts +15 -0
  188. package/dist/commands/tasks/start-receipt.js +95 -0
  189. package/dist/commands/tasks/start.d.ts +4 -0
  190. package/dist/commands/tasks/start.js +49 -3
  191. package/dist/commands/tasks/update.js +3 -0
  192. package/dist/commands/tasks/upsert.js +17 -3
  193. package/dist/commands/tasks/watch.d.ts +3 -0
  194. package/dist/commands/tasks/watch.js +85 -20
  195. package/dist/commands/wiki/history.d.ts +33 -0
  196. package/dist/commands/wiki/history.js +134 -0
  197. package/dist/commands/wiki/ls.d.ts +2 -0
  198. package/dist/commands/wiki/ls.js +8 -0
  199. package/dist/commands/wiki/update.d.ts +3 -1
  200. package/dist/commands/wiki/update.js +24 -2
  201. package/dist/commands/wiki/write.d.ts +22 -0
  202. package/dist/commands/wiki/write.js +144 -6
  203. package/dist/generated/agent-guides.json +81 -81
  204. package/dist/generated/managed-instruction-guides.json +1 -1
  205. package/dist/lib/agent-guides.d.ts +9 -0
  206. package/dist/lib/agent-guides.js +23 -1
  207. package/dist/lib/agentic-stream.d.ts +5 -0
  208. package/dist/lib/agentic-stream.js +122 -3
  209. package/dist/lib/api-error-reason.d.ts +2 -0
  210. package/dist/lib/api-error-reason.js +14 -0
  211. package/dist/lib/api-fetch.js +3 -0
  212. package/dist/lib/auth-diagnostics.d.ts +39 -0
  213. package/dist/lib/auth-diagnostics.js +71 -0
  214. package/dist/lib/cli-client-identity.d.ts +6 -0
  215. package/dist/lib/cli-client-identity.js +16 -0
  216. package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
  217. package/dist/lib/cli-installation-diagnostics.js +254 -0
  218. package/dist/lib/command-hygiene.d.ts +45 -0
  219. package/dist/lib/command-hygiene.js +413 -0
  220. package/dist/lib/commitments.d.ts +64 -3
  221. package/dist/lib/commitments.js +34 -6
  222. package/dist/lib/completion-index.d.ts +16 -4
  223. package/dist/lib/completion-index.js +50 -14
  224. package/dist/lib/config.js +7 -1
  225. package/dist/lib/daemon-maintenance-command.d.ts +22 -0
  226. package/dist/lib/daemon-maintenance-command.js +39 -0
  227. package/dist/lib/daemon-maintenance.d.ts +275 -0
  228. package/dist/lib/daemon-maintenance.js +1035 -0
  229. package/dist/lib/dedicated-service.d.ts +3 -2
  230. package/dist/lib/dedicated-service.js +11 -3
  231. package/dist/lib/governed-store.d.ts +8 -0
  232. package/dist/lib/governed-store.js +5 -0
  233. package/dist/lib/hosted-machines.d.ts +33 -2
  234. package/dist/lib/hosted-machines.js +19 -1
  235. package/dist/lib/json-output.d.ts +1 -1
  236. package/dist/lib/machines.d.ts +9 -1
  237. package/dist/lib/machines.js +15 -1
  238. package/dist/lib/node-adapter.js +13 -0
  239. package/dist/lib/record-output.d.ts +22 -0
  240. package/dist/lib/record-output.js +78 -0
  241. package/dist/lib/roles.d.ts +3 -3
  242. package/dist/lib/scoped-memory-command.d.ts +18 -0
  243. package/dist/lib/scoped-memory-command.js +53 -2
  244. package/dist/lib/search-display.d.ts +7 -0
  245. package/dist/lib/search-display.js +31 -0
  246. package/dist/lib/skill-store-pagination.d.ts +8 -0
  247. package/dist/lib/skill-store-pagination.js +35 -0
  248. package/dist/lib/space-charter.d.ts +49 -0
  249. package/dist/lib/space-charter.js +78 -0
  250. package/dist/lib/space-loop-migration.d.ts +18 -0
  251. package/dist/lib/space-loop-migration.js +128 -0
  252. package/dist/lib/space-notebook.d.ts +22 -0
  253. package/dist/lib/space-notebook.js +140 -0
  254. package/dist/lib/space-proposal-decision-command.d.ts +36 -0
  255. package/dist/lib/space-proposal-decision-command.js +108 -0
  256. package/dist/lib/space-proposals.d.ts +44 -0
  257. package/dist/lib/space-proposals.js +186 -0
  258. package/dist/lib/space-templates.d.ts +8 -0
  259. package/dist/lib/space-templates.js +17 -0
  260. package/dist/lib/space-write-policy.d.ts +24 -0
  261. package/dist/lib/space-write-policy.js +103 -0
  262. package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
  263. package/dist/lib/task-agent-context-capabilities.js +22 -0
  264. package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
  265. package/dist/lib/task-agent-context-compatibility.js +30 -0
  266. package/dist/lib/task-asset-upload.d.ts +22 -0
  267. package/dist/lib/task-asset-upload.js +257 -29
  268. package/dist/lib/task-batch.d.ts +15 -1
  269. package/dist/lib/task-batch.js +35 -2
  270. package/dist/lib/task-operation-watch.d.ts +66 -0
  271. package/dist/lib/task-operation-watch.js +159 -0
  272. package/dist/lib/task-resolver.d.ts +1 -1
  273. package/dist/lib/task-resolver.js +4 -3
  274. package/dist/lib/task-work.d.ts +1 -1
  275. package/dist/lib/task-work.js +35 -1
  276. package/dist/lib/task-write-attribution.d.ts +14 -0
  277. package/dist/lib/task-write-attribution.js +35 -2
  278. package/dist/lib/triggers.d.ts +11 -0
  279. package/dist/lib/triggers.js +7 -0
  280. package/dist/lib/wiki-update.d.ts +1 -0
  281. package/dist/lib/wiki-update.js +10 -1
  282. package/dist/lib/wiki.js +4 -1
  283. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
  284. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
  285. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.d.ts +10 -0
  286. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +147 -0
  287. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.d.ts +20 -0
  288. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +72 -0
  289. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
  290. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
  291. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.d.ts +21 -0
  292. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +96 -0
  293. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +2 -3
  294. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +102 -20
  295. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
  296. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
  297. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.d.ts +27 -0
  298. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +161 -0
  299. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineScopes.d.ts +26 -0
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineScopes.js +41 -0
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -1
  302. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +15 -0
  303. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +20 -4
  304. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
  305. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
  306. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
  307. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
  308. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
  309. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
  310. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.d.ts +10 -0
  311. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +172 -1
  312. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.d.ts +20 -0
  313. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +43 -0
  314. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
  315. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
  316. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.d.ts +21 -0
  317. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +62 -0
  318. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +2 -3
  319. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +133 -25
  320. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
  321. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
  322. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.d.ts +27 -0
  323. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +132 -0
  324. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineScopes.d.ts +26 -0
  325. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineScopes.js +15 -0
  326. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -1
  327. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -1
  328. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +28 -15
  329. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
  330. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
  331. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
  332. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
  333. package/dist/node_modules/@skrr-ai/auth-core/package.json +51 -1
  334. package/dist/node_modules/@skrr-ai/data-provider/index.js +27181 -20293
  335. package/oclif.manifest.json +5745 -1813
  336. package/package.json +20 -2
@@ -5,6 +5,8 @@ import { dataService } from '@skrr-ai/data-provider';
5
5
  import { type WriteTarget } from './lib/write-target';
6
6
  import { type AssigneeResolution, type MemberKind, type SpaceMember } from './lib/assignee-resolver';
7
7
  import { type CliConfig } from './lib/config';
8
+ import { type AuthResolutionDiagnostic } from './lib/auth-diagnostics';
9
+ import { type CompletionCacheScope } from './lib/completion-index';
8
10
  import { type OutboxMethod } from './lib/outbox';
9
11
  import { type CredentialProvenance, type ResolvedCredential } from './lib/credential-resolver';
10
12
  import { type BrokerRefusalDescription } from './lib/daemonBrokerRefusal';
@@ -82,6 +84,15 @@ export declare abstract class BaseCommand extends Command {
82
84
  protected printJsonResult(value: unknown, options?: {
83
85
  ok?: boolean;
84
86
  }): void;
87
+ /**
88
+ * A task write the Space write policy HELD for approval (OSK-17988): the
89
+ * server answered `202 { status: 'pending_approval' }` and wrote nothing.
90
+ * Prints it as that, never as a created or updated task, and returns true so
91
+ * the command stops there (exit 0: the request was accepted, not refused).
92
+ */
93
+ protected reportHeldSpaceWrite(result: unknown, { json }?: {
94
+ json?: boolean;
95
+ }): boolean;
85
96
  private jsonOperationContext?;
86
97
  /** Opt in at the command boundary, including its existing structured errors. */
87
98
  protected setJsonOperation(options: Partial<CliOperationOptions>): void;
@@ -97,6 +108,8 @@ export declare abstract class BaseCommand extends Command {
97
108
  * from here.
98
109
  */
99
110
  protected resolvedCredential: ResolvedCredential;
111
+ /** Completion references follow the same principal and workspace as requests. */
112
+ protected completionCacheScope(): CompletionCacheScope | null;
100
113
  /** Re-authorize a long-lived transport using this command's credential
101
114
  * source. A daemon handoff is redeemed again; its refresh family is never
102
115
  * borrowed or written into the CLI's own login. */
@@ -109,6 +122,8 @@ export declare abstract class BaseCommand extends Command {
109
122
  */
110
123
  protected credentialProvenance: CredentialProvenance | null;
111
124
  protected bareMode: boolean;
125
+ /** Managed runtimes must never suggest a human's local credential store. */
126
+ private authManagedRuntime;
112
127
  /**
113
128
  * Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
114
129
  * `requireAuth()` reports it instead of a bare "Not signed in", because the
@@ -351,6 +366,11 @@ export declare abstract class BaseCommand extends Command {
351
366
  * Returns `null` when not signed in.
352
367
  */
353
368
  protected credentialSourceLabel(): string | null;
369
+ /**
370
+ * A machine-readable explanation of credential resolution. This carries
371
+ * source metadata only; neither token material nor raw URLs may escape.
372
+ */
373
+ protected authResolution(): AuthResolutionDiagnostic;
354
374
  protected catch(err: Error & {
355
375
  code?: string;
356
376
  exitCode?: number;
@@ -636,6 +656,10 @@ type UnsupportedFlagRemedy = {
636
656
  fix: string;
637
657
  targets: readonly UnsupportedFlagRemedyTarget[];
638
658
  };
659
+ type MissingFlagRemedy = {
660
+ fix: string;
661
+ targets: readonly UnsupportedFlagRemedyTarget[];
662
+ };
639
663
  /**
640
664
  * Specific corrections for habitual flags that look plausible but do not belong
641
665
  * to the command that received them. Keep the replacement command and every
@@ -643,6 +667,13 @@ type UnsupportedFlagRemedy = {
643
667
  * manifest, so a useful refusal cannot slowly point at a removed form.
644
668
  */
645
669
  export declare const UNSUPPORTED_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, UnsupportedFlagRemedy>>>>;
670
+ /**
671
+ * Required flags normally share a generic repair. A few have a meaningful
672
+ * choice that cannot be recovered from `<value>` alone; keep those remedies
673
+ * declarative and validate their referenced command flags alongside the
674
+ * habitual unsupported-flag corrections.
675
+ */
676
+ export declare const MISSING_FLAG_REMEDIES: Readonly<Record<string, Readonly<Record<string, MissingFlagRemedy>>>>;
646
677
  /**
647
678
  * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
648
679
  * - a flag retired from THIS command, which this command does not define again: where it went;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Flags = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
3
+ exports.Flags = exports.MISSING_FLAG_REMEDIES = exports.UNSUPPORTED_FLAG_REMEDIES = exports.BaseCommand = exports.resolveProfileFromArgv = void 0;
4
4
  exports.assigneePayloadNeedsResolution = assigneePayloadNeedsResolution;
5
5
  exports.parseGlobalFlags = parseGlobalFlags;
6
6
  exports.refusalCodeOf = refusalCodeOf;
@@ -22,6 +22,7 @@ exports.errorBodyMessage = errorBodyMessage;
22
22
  exports.envelopeDetails = envelopeDetails;
23
23
  exports.retiredFlagHint = retiredFlagHint;
24
24
  exports.parseErrorRemedy = parseErrorRemedy;
25
+ const space_write_policy_1 = require("./lib/space-write-policy");
25
26
  const node_fs_1 = require("node:fs");
26
27
  const core_1 = require("@oclif/core");
27
28
  Object.defineProperty(exports, "Flags", { enumerable: true, get: function () { return core_1.Flags; } });
@@ -32,6 +33,7 @@ const json_mode_1 = require("./lib/json-mode");
32
33
  const failed_lookup_1 = require("./lib/failed-lookup");
33
34
  const internal_id_1 = require("./lib/internal-id");
34
35
  const http_error_1 = require("./lib/http-error");
36
+ const api_error_reason_1 = require("./lib/api-error-reason");
35
37
  const guide_pointer_1 = require("./lib/guide-pointer");
36
38
  // Re-exported from its home in `lib/keychain`, beside the other profile
37
39
  // functions. It lived here while `init()` was its only caller; a lib module
@@ -40,6 +42,7 @@ const guide_pointer_1 = require("./lib/guide-pointer");
40
42
  var keychain_1 = require("./lib/keychain");
41
43
  Object.defineProperty(exports, "resolveProfileFromArgv", { enumerable: true, get: function () { return keychain_1.resolveProfileFromArgv; } });
42
44
  const data_provider_1 = require("@skrr-ai/data-provider");
45
+ const cli_client_identity_1 = require("./lib/cli-client-identity");
43
46
  const auth_core_1 = require("@skrr-ai/auth-core");
44
47
  const auth_failure_1 = require("./lib/auth-failure");
45
48
  const list_output_1 = require("./lib/list-output");
@@ -49,6 +52,9 @@ const task_ref_resolver_1 = require("./lib/task-ref-resolver");
49
52
  const space_resolver_1 = require("./lib/space-resolver");
50
53
  const projects_1 = require("./lib/projects");
51
54
  const config_1 = require("./lib/config");
55
+ const auth_diagnostics_1 = require("./lib/auth-diagnostics");
56
+ const completion_index_1 = require("./lib/completion-index");
57
+ const workspace_header_1 = require("./lib/workspace-header");
52
58
  const cli_id_1 = require("./lib/cli-id");
53
59
  const keychain_2 = require("./lib/keychain");
54
60
  const outbox_1 = require("./lib/outbox");
@@ -205,6 +211,25 @@ class BaseCommand extends core_1.Command {
205
211
  printJsonResult(value, options = {}) {
206
212
  this.log(JSON.stringify((0, json_output_1.withOk)(value, options.ok ?? true), null, 2));
207
213
  }
214
+ /**
215
+ * A task write the Space write policy HELD for approval (OSK-17988): the
216
+ * server answered `202 { status: 'pending_approval' }` and wrote nothing.
217
+ * Prints it as that, never as a created or updated task, and returns true so
218
+ * the command stops there (exit 0: the request was accepted, not refused).
219
+ */
220
+ reportHeldSpaceWrite(result, { json } = {}) {
221
+ if (!(0, space_write_policy_1.isSpaceWritePendingResponse)(result))
222
+ return false;
223
+ if (json) {
224
+ this.printJsonOperation(result, { writeState: 'not_attempted' });
225
+ }
226
+ else {
227
+ for (const line of (0, space_write_policy_1.spaceWritePendingLines)(result, { binName: this.config.bin })) {
228
+ this.log(line);
229
+ }
230
+ }
231
+ return true;
232
+ }
208
233
  jsonOperationContext;
209
234
  /** Opt in at the command boundary, including its existing structured errors. */
210
235
  setJsonOperation(options) {
@@ -236,6 +261,16 @@ class BaseCommand extends core_1.Command {
236
261
  * from here.
237
262
  */
238
263
  resolvedCredential;
264
+ /** Completion references follow the same principal and workspace as requests. */
265
+ completionCacheScope() {
266
+ return (0, completion_index_1.createCompletionCacheScope)({
267
+ configRoot: (0, config_1.configRoot)(),
268
+ profile: (0, keychain_2.getActiveProfile)(),
269
+ baseURL: this.cliConfig.baseURL,
270
+ workspaceId: (0, workspace_header_1.withWorkspaceHeader)({})['X-Workspace-Id'],
271
+ token: this.resolvedCredential?.token,
272
+ });
273
+ }
239
274
  /** Re-authorize a long-lived transport using this command's credential
240
275
  * source. A daemon handoff is redeemed again; its refresh family is never
241
276
  * borrowed or written into the CLI's own login. */
@@ -268,6 +303,8 @@ class BaseCommand extends core_1.Command {
268
303
  */
269
304
  credentialProvenance = null;
270
305
  bareMode = false;
306
+ /** Managed runtimes must never suggest a human's local credential store. */
307
+ authManagedRuntime = false;
271
308
  /**
272
309
  * Set when the auto-broker reached a live daemon and it REFUSED the hand-off.
273
310
  * `requireAuth()` reports it instead of a bare "Not signed in", because the
@@ -276,6 +313,11 @@ class BaseCommand extends core_1.Command {
276
313
  brokerRefusal = null;
277
314
  async init() {
278
315
  await super.init();
316
+ // Task Agent Context compatibility is meaningful only when the API can
317
+ // distinguish a real CLI build from a generic HTTP caller. This is still
318
+ // telemetry/presentation metadata: the server must never treat it as an
319
+ // execution or authorization claim.
320
+ (0, cli_client_identity_1.configureCliClientIdentity)(this.config.pjson?.version);
279
321
  // The profile is resolved from raw argv, BEFORE oclif parses anything.
280
322
  //
281
323
  // It has to be. `parseBaseFlags()` runs far below, after migration and
@@ -392,6 +434,7 @@ class BaseCommand extends core_1.Command {
392
434
  // from the daemon and never owns the person's stored session, so the
393
435
  // commands that create, replace or end that session are not its to run.
394
436
  const harnessContext = (0, harness_context_1.isHarnessCliContext)();
437
+ this.authManagedRuntime = harnessContext;
395
438
  if (harnessContext && this.id && harness_context_1.HARNESS_REFUSED_AUTH_COMMANDS.has(this.id)) {
396
439
  this.failWithCliError({
397
440
  message: `\`${this.config.bin} ${this.id}\` is not available here: this process was started by the skrr ` +
@@ -424,7 +467,12 @@ class BaseCommand extends core_1.Command {
424
467
  // us `bare` and `token` without each subclass having to re-plumb
425
468
  // them.
426
469
  const parsed = await this.parseBaseFlags();
427
- this.bareMode = parsed.bare;
470
+ // Keep the orchestration path aligned with credential-resolver: an
471
+ // environment-enabled bare invocation skips stored credentials just as an
472
+ // explicit `--bare` invocation does, so its diagnostic and broker policy
473
+ // must say the same thing.
474
+ this.bareMode =
475
+ parsed.bare || ['1', 'true', 'TRUE', 'yes'].includes(process.env.OVERSKY_BARE_MODE ?? '');
428
476
  if (parsed.workspace)
429
477
  process.env.OVERSKY_WORKSPACE_ID = parsed.workspace;
430
478
  this.cliConfig = (0, config_1.loadConfig)();
@@ -997,6 +1045,7 @@ class BaseCommand extends core_1.Command {
997
1045
  /** Abort the command with a helpful message if the user isn't signed in. */
998
1046
  requireAuth() {
999
1047
  if (!this.resolvedCredential?.token) {
1048
+ const diagnostic = this.authResolution();
1000
1049
  const refusal = this.brokerRefusal;
1001
1050
  if (refusal) {
1002
1051
  // Same code as the plain case — scripts branch on NOT_SIGNED_IN — with
@@ -1010,14 +1059,24 @@ class BaseCommand extends core_1.Command {
1010
1059
  code: 'NOT_SIGNED_IN',
1011
1060
  exit: 2,
1012
1061
  retryable: refusal.transient,
1013
- details: { broker: refusal.broker, suggestion: refusal.remedy },
1062
+ details: {
1063
+ broker: refusal.broker,
1064
+ auth: diagnostic,
1065
+ server: diagnostic.server,
1066
+ suggestion: refusal.remedy,
1067
+ },
1014
1068
  });
1015
1069
  }
1016
1070
  this.failWithCliError({
1017
- message: `Not signed in. Run \`${this.config.bin} login\` first.`,
1071
+ message: (0, auth_diagnostics_1.describeMissingCredential)(diagnostic, this.config.bin),
1018
1072
  code: 'NOT_SIGNED_IN',
1019
1073
  exit: 2,
1020
1074
  retryable: false,
1075
+ details: {
1076
+ auth: diagnostic,
1077
+ server: diagnostic.server,
1078
+ suggestion: diagnostic.suggestion,
1079
+ },
1021
1080
  });
1022
1081
  }
1023
1082
  const incompatibleScope = incompatibleCliCredentialScope(this.resolvedCredential.token);
@@ -1275,6 +1334,19 @@ class BaseCommand extends core_1.Command {
1275
1334
  return null;
1276
1335
  return (0, credential_resolver_1.describeCredentialSource)(this.resolvedCredential.source, this.credentialProvenance);
1277
1336
  }
1337
+ /**
1338
+ * A machine-readable explanation of credential resolution. This carries
1339
+ * source metadata only; neither token material nor raw URLs may escape.
1340
+ */
1341
+ authResolution() {
1342
+ return (0, auth_diagnostics_1.authResolutionDiagnostic)({
1343
+ credential: this.resolvedCredential,
1344
+ bareMode: this.bareMode,
1345
+ managedRuntime: this.authManagedRuntime,
1346
+ baseURL: this.cliConfig?.baseURL,
1347
+ bin: this.config?.bin ?? 'skrr',
1348
+ });
1349
+ }
1278
1350
  async catch(err) {
1279
1351
  if (isOclifExitError(err)) {
1280
1352
  return super.catch(err);
@@ -1291,6 +1363,10 @@ class BaseCommand extends core_1.Command {
1291
1363
  if (unsupportedFlagHint && !err.message.includes(unsupportedFlagHint.fix)) {
1292
1364
  err.message = `${err.message}\n\n${unsupportedFlagHint.fix}`;
1293
1365
  }
1366
+ const missingFlagHint = missingFlagRemedyForMessage(err.message || '', this.id);
1367
+ if (missingFlagHint && !err.message.includes(missingFlagHint.fix)) {
1368
+ err.message = `${err.message}\n\n${missingFlagHint.fix}`;
1369
+ }
1294
1370
  // Sibling domains spell one lifecycle differently (`in_progress` for a
1295
1371
  // space, `active` for a goal), and oclif's enum refusal named neither the
1296
1372
  // difference nor the value to use (OSK-9735).
@@ -1556,11 +1632,14 @@ class BaseCommand extends core_1.Command {
1556
1632
  const renewal = refreshRefusal
1557
1633
  ? refreshRefusal.message.replace(/\s*Run `[^`]+` to sign in again\.$/, '')
1558
1634
  : "This CLI's own sign-in could not be renewed.";
1635
+ const authDiagnostic = this.authResolution();
1559
1636
  const details = {
1560
1637
  ...(refreshRefusal && bodyCode ? { accessTokenCode: bodyCode } : {}),
1561
1638
  ...(brokerRefusal
1562
1639
  ? { broker: brokerRefusal.broker, suggestion: brokerRefusal.remedy }
1563
1640
  : {}),
1641
+ auth: authDiagnostic,
1642
+ server: authDiagnostic.server,
1564
1643
  };
1565
1644
  let authMessage;
1566
1645
  if (presentedCiToken) {
@@ -1644,7 +1723,7 @@ class BaseCommand extends core_1.Command {
1644
1723
  code: bodyCode || 'FORBIDDEN',
1645
1724
  status: e.status,
1646
1725
  exit: 3,
1647
- retryable: edgeRefusal,
1726
+ retryable: typeof body?.retryable === 'boolean' ? body.retryable : edgeRefusal,
1648
1727
  });
1649
1728
  }
1650
1729
  else if (e.status === 404) {
@@ -2151,6 +2230,12 @@ function refusalCodeOf(body) {
2151
2230
  const direct = stringProp(body ?? null, 'code') || stringProp(body ?? null, 'errorType');
2152
2231
  if (direct)
2153
2232
  return direct;
2233
+ // Session-scoped Task routes return `{ok:false, reason}`. This is an
2234
+ // application refusal, not a bodyless edge error. Preserve its spelling so
2235
+ // an Agent can distinguish a stale session from a Task authorization stop.
2236
+ const reason = (0, api_error_reason_1.reasonOnlyCode)(body);
2237
+ if (reason)
2238
+ return reason;
2154
2239
  const legacy = stringProp(body ?? null, 'error');
2155
2240
  return legacy && LEGACY_ERROR_FIELD_CODE.test(legacy) ? legacy.toUpperCase() : undefined;
2156
2241
  }
@@ -2618,7 +2703,9 @@ function errorBodyMessage(body) {
2618
2703
  const nested = record.error && typeof record.error === 'object' && !Array.isArray(record.error)
2619
2704
  ? record.error.message
2620
2705
  : undefined;
2621
- return text(record.message) ?? text(record.error) ?? text(nested);
2706
+ const reason = (0, api_error_reason_1.reasonOnlyCode)(record);
2707
+ return text(record.message) ?? text(record.error) ?? text(nested) ??
2708
+ (reason ? `Request refused: ${reason}` : undefined);
2622
2709
  }
2623
2710
  /**
2624
2711
  * The `details` of a CLI error envelope, in ONE shape. The server's refusal body becomes the
@@ -2677,13 +2764,35 @@ exports.UNSUPPORTED_FLAG_REMEDIES = {
2677
2764
  },
2678
2765
  },
2679
2766
  };
2767
+ /**
2768
+ * Required flags normally share a generic repair. A few have a meaningful
2769
+ * choice that cannot be recovered from `<value>` alone; keep those remedies
2770
+ * declarative and validate their referenced command flags alongside the
2771
+ * habitual unsupported-flag corrections.
2772
+ */
2773
+ exports.MISSING_FLAG_REMEDIES = {
2774
+ 'tasks:ready': {
2775
+ for: {
2776
+ fix: 'Choose who can move the work: pass `--for agent` or `--for human`. ' +
2777
+ 'For a Space, run `skrr tasks ready --for agent --space <space-id>`.',
2778
+ targets: [{ command: 'tasks:ready', flags: ['for', 'space'] }],
2779
+ },
2780
+ },
2781
+ };
2680
2782
  function unsupportedFlagRemedy(commandId, flag) {
2681
2783
  return commandId ? exports.UNSUPPORTED_FLAG_REMEDIES[commandId]?.[flag] : undefined;
2682
2784
  }
2785
+ function missingFlagRemedy(commandId, flag) {
2786
+ return commandId ? exports.MISSING_FLAG_REMEDIES[commandId]?.[flag] : undefined;
2787
+ }
2683
2788
  function unsupportedFlagRemedyForMessage(message, commandId) {
2684
2789
  const match = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)/i.exec(message);
2685
2790
  return match ? unsupportedFlagRemedy(commandId, match[1].replace(/^-+/, '')) : undefined;
2686
2791
  }
2792
+ function missingFlagRemedyForMessage(message, commandId) {
2793
+ const match = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
2794
+ return match ? missingFlagRemedy(commandId, match[1]) : undefined;
2795
+ }
2687
2796
  /**
2688
2797
  * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
2689
2798
  * - a flag retired from THIS command, which this command does not define again: where it went;
@@ -2728,9 +2837,11 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
2728
2837
  const missingFlag = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i.exec(message);
2729
2838
  if (missingFlag) {
2730
2839
  const flag = missingFlag[1];
2840
+ const missingFlagHint = missingFlagRemedy(commandId, flag);
2731
2841
  return {
2732
2842
  flag,
2733
2843
  fix: suggestion ??
2844
+ missingFlagHint?.fix ??
2734
2845
  `Pass --${flag} <value>. Run \`${helpCommand}\` for its description and accepted values.`,
2735
2846
  };
2736
2847
  }
@@ -14,6 +14,7 @@ export default class AgentMessageContext extends BaseCommand {
14
14
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
15
  task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  run: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
18
  };
18
19
  run(): Promise<void>;
19
20
  }
@@ -26,8 +26,9 @@ class AgentMessageContext extends base_command_1.BaseCommand {
26
26
  run: core_1.Flags.string({
27
27
  description: 'Optional run context to narrow recent updates (refused inside a daemon session — the session path is already bound to its own run)',
28
28
  }),
29
- // No `--json` flag: these observations exist to be parsed, so JSON is the
30
- // only output. A flag that cannot be turned off is a lie in `--help`.
29
+ json: core_1.Flags.boolean({
30
+ description: 'Accepted for consistency; this command always outputs JSON',
31
+ }),
31
32
  };
32
33
  async run() {
33
34
  const { args, flags } = await this.parse(AgentMessageContext);
@@ -60,6 +60,17 @@ class Commands extends base_command_1.BaseCommand {
60
60
  else {
61
61
  this.log(`Command hygiene: ${report.ok ? 'OK' : 'FAILED'} ` +
62
62
  `(${report.counts.errors} error(s), ${report.counts.warnings} warning(s))`);
63
+ this.log('Execution contracts: ' +
64
+ report.execution.classified +
65
+ '/' +
66
+ report.execution.candidates +
67
+ ' classified, ' +
68
+ report.execution.humanOnlyExemptions +
69
+ ' human-only exemption(s), ' +
70
+ report.execution.missingReceipts +
71
+ ' receipt gap(s), ' +
72
+ report.execution.missingRecoveryGuidance +
73
+ ' recovery gap(s).');
63
74
  for (const issue of report.issues) {
64
75
  const location = issue.command ? ` ${issue.command}` : '';
65
76
  this.log(`[${issue.severity}] ${issue.code}${location}: ${issue.message}`);
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** Read the exact Action Bundle execution receipt before any retry. */
3
+ export default class CommitmentsActionProposal extends BaseCommand {
4
+ static description: string;
5
+ static args: {
6
+ commitmentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ proposalId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const commitments_1 = require("../../lib/commitments");
6
+ /** Read the exact Action Bundle execution receipt before any retry. */
7
+ class CommitmentsActionProposal extends base_command_1.BaseCommand {
8
+ static description = 'Show one frozen Action Bundle and its execution receipt';
9
+ static args = {
10
+ commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
11
+ proposalId: core_1.Args.string({
12
+ ignoreStdin: true,
13
+ description: 'Action Proposal ID',
14
+ required: true,
15
+ }),
16
+ };
17
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args, flags } = await this.parse(CommitmentsActionProposal);
21
+ try {
22
+ const result = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
23
+ if (flags.json)
24
+ this.printJsonResult(result);
25
+ else {
26
+ const proposal = result.proposal;
27
+ const execution = result.execution;
28
+ this.log(`Action Bundle: ${String(proposal?.status || 'unknown')}`);
29
+ this.log(`Operation: ${String(execution?.operationId || 'unavailable')}`);
30
+ const receipt = execution?.receipt;
31
+ this.log(`Receipt: ${String(receipt?.state || 'unknown')}`);
32
+ }
33
+ }
34
+ catch (error) {
35
+ this.handleApiError(error);
36
+ }
37
+ }
38
+ }
39
+ exports.default = CommitmentsActionProposal;
@@ -50,7 +50,14 @@ class CommitmentsActionProposalsDecide extends base_command_1.BaseCommand {
50
50
  : {}),
51
51
  });
52
52
  const execution = decision === 'approve' && decided.status === 'approved'
53
- ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId)
53
+ ? await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, proposal.snapshotDigest && Number.isInteger(proposal.bundleVersion)
54
+ ? {
55
+ // Keep the automatic hand-off fenced to the same Action
56
+ // Bundle the human decision just approved.
57
+ expectedBundleVersion: proposal.bundleVersion,
58
+ expectedSnapshotDigest: proposal.snapshotDigest,
59
+ }
60
+ : {})
54
61
  : undefined;
55
62
  result = { decision: decided, ...(execution ? { execution } : {}) };
56
63
  }
@@ -19,7 +19,17 @@ class CommitmentsActionProposalsExecute extends base_command_1.BaseCommand {
19
19
  const { args, flags } = await this.parse(CommitmentsActionProposalsExecute);
20
20
  let result;
21
21
  try {
22
- result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId);
22
+ // Read the frozen bundle first. The server compares both coordinates in
23
+ // its claim CAS, so a re-proposed bundle cannot inherit this nudge.
24
+ const inspected = await commitments_1.commitmentApi.actionProposal(args.commitmentId, args.proposalId);
25
+ const proposal = inspected.proposal;
26
+ if (!proposal || typeof proposal.bundleVersion !== 'number' || typeof proposal.snapshotDigest !== 'string') {
27
+ throw new Error('The Action Bundle inspection did not include its reviewed revision.');
28
+ }
29
+ result = await commitments_1.commitmentApi.executeActionProposal(args.commitmentId, args.proposalId, {
30
+ expectedBundleVersion: proposal.bundleVersion,
31
+ expectedSnapshotDigest: proposal.snapshotDigest,
32
+ });
23
33
  }
24
34
  catch (error) {
25
35
  this.handleApiError(error);
@@ -183,7 +183,7 @@ function commitmentActivationRefusal(err, { id, bin }) {
183
183
  */
184
184
  class CommitmentsCreate extends base_command_1.BaseCommand {
185
185
  static description = 'Create a commitment (a durable agent contract). Its cadence is manual, an interval or daily clock times; ' +
186
- 'it has no weekday, holiday, business-day or trading-calendar fields';
186
+ 'activeHours and daysOfWeek in --from-json select hours and weekdays. No holiday, business-day or trading-calendar fields';
187
187
  static examples = [
188
188
  '<%= config.bin %> commitments create --agent <agent-id> --title "Ship v2" --outcome "v2 is live for all users" --cadence 6h --activate',
189
189
  '<%= config.bin %> commitments create --agent <agent-id> --title "Hiring loop" --outcome "Every candidate hears back in 48h" --watch tasks --watch email --cadence 12h',
@@ -199,7 +199,7 @@ cat > commitment.json <<'JSON'
199
199
  "title": "Daily queue review",
200
200
  "status": "draft",
201
201
  "target": { "outcome": "Queue changes are reviewed" },
202
- "cadence": { "mode": "daily", "times": ["09:15", "17:45"], "timezone": "Asia/Shanghai" },
202
+ "cadence": { "mode": "interval", "intervalMs": 3600000, "activeHours": { "start": "09:00", "end": "22:00" }, "daysOfWeek": ["mon", "tue", "wed", "thu", "fri"], "timezone": "Asia/Shanghai" },
203
203
  "watchedSources": [{
204
204
  "source": "agent_run",
205
205
  "config": { "keys": [
@@ -8,6 +8,14 @@ export declare function doctorVerdict(input: {
8
8
  next: string;
9
9
  why?: string;
10
10
  };
11
+ /**
12
+ * The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
13
+ * that Space's execution principal admits it. Empty for a Commitment that is not
14
+ * a loop. A refused loop is also the operating state's first blocker, so the
15
+ * verdict and next step above already say what to do; this line says which
16
+ * Space and why.
17
+ */
18
+ export declare function spaceLoopLine(value: unknown): string;
11
19
  export default class CommitmentsDoctor extends BaseCommand {
12
20
  static description: string;
13
21
  static args: {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doctorVerdict = doctorVerdict;
4
+ exports.spaceLoopLine = spaceLoopLine;
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../base-command");
@@ -69,6 +70,24 @@ function doctorVerdict(input) {
69
70
  ...(typeof stop?.detail === 'string' && stop.detail ? { why: stop.detail } : {}),
70
71
  };
71
72
  }
73
+ /**
74
+ * The Space loop line (OSK-17989): a Commitment homed in a Space runs only while
75
+ * that Space's execution principal admits it. Empty for a Commitment that is not
76
+ * a loop. A refused loop is also the operating state's first blocker, so the
77
+ * verdict and next step above already say what to do; this line says which
78
+ * Space and why.
79
+ */
80
+ function spaceLoopLine(value) {
81
+ if (!value || typeof value !== 'object')
82
+ return '';
83
+ const loop = value;
84
+ const status = loop.status || 'unreadable';
85
+ let detail = loop.reason ? ` (${loop.reason})` : '';
86
+ if (status === 'admitted') {
87
+ detail = loop.principalVersion ? ` (principal v${loop.principalVersion})` : '';
88
+ }
89
+ return `Space loop: ${status}${loop.spaceId ? ` · ${loop.spaceId}` : ''}${detail}`;
90
+ }
72
91
  class CommitmentsDoctor extends base_command_1.BaseCommand {
73
92
  static description = 'Summarize commitment readiness and the next operator action';
74
93
  static args = {
@@ -106,6 +125,9 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
106
125
  const knowledge = operatingState.knowledge;
107
126
  this.log(`Space knowledge: ${knowledge.status || 'unavailable'}${knowledge.spaceId ? ` · ${knowledge.spaceId}` : ''}${knowledge.source ? ` (${knowledge.source})` : ''}; prospective scope, not a completed memory mount`);
108
127
  }
128
+ const loopLine = spaceLoopLine(operatingState.spaceLoop);
129
+ if (!flags.json && loopLine)
130
+ this.log(loopLine);
109
131
  if (flags.json)
110
132
  this.log(JSON.stringify(report, null, 2));
111
133
  else {
@@ -18,7 +18,18 @@ class CommitmentsExecuteRemediation extends base_command_1.BaseCommand {
18
18
  const { args, flags } = await this.parse(CommitmentsExecuteRemediation);
19
19
  let result;
20
20
  try {
21
- result = await commitments_1.commitmentApi.executeRemediationProposal(args.commitmentId, args.proposalId, flags['retry-executing'] === true);
21
+ const inspected = await commitments_1.commitmentApi.remediationProposal(args.commitmentId, args.proposalId);
22
+ const proposal = inspected.proposal;
23
+ if (!proposal || typeof proposal.proposalVersion !== 'number') {
24
+ throw new Error('The remediation proposal inspection did not include its reviewed revision.');
25
+ }
26
+ result = await commitments_1.commitmentApi.executeRemediationProposal(args.commitmentId, args.proposalId, {
27
+ retryExecuting: flags['retry-executing'] === true,
28
+ expectedRevision: proposal.proposalVersion,
29
+ ...(typeof proposal.updatedAt === 'string'
30
+ ? { expectedUpdatedAt: proposal.updatedAt }
31
+ : {}),
32
+ });
22
33
  }
23
34
  catch (error) {
24
35
  this.handleApiError(error);
@@ -131,7 +131,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
131
131
  this.handleApiError(err);
132
132
  }
133
133
  if (flags.json)
134
- this.log(JSON.stringify(response, null, 2));
134
+ this.printJsonResult(response);
135
135
  else
136
136
  renderObservationWindow(response, (line) => this.log(line));
137
137
  return;
@@ -152,7 +152,7 @@ class CommitmentsObservations extends base_command_1.BaseCommand {
152
152
  this.handleApiError(err);
153
153
  }
154
154
  if (flags.json) {
155
- this.log(JSON.stringify(response, null, 2));
155
+ this.printJsonResult(response);
156
156
  }
157
157
  else {
158
158
  // "The commitment has none" and "your filter matched none" are different
@@ -5,6 +5,11 @@ import { BaseCommand } from '../../../base-command';
5
5
  * Binding is idempotent by design — the API answers 200 with `reused: true`
6
6
  * rather than minting a second draft, because a retried bind used to leave
7
7
  * duplicate Commitments behind (OSK-5763).
8
+ *
9
+ * `--space` binds the Pack into a Space as that Space's loop: held by the
10
+ * Space's lead unless `--agent` names another member, owned by the person
11
+ * binding, who must be the Space's execution-principal user and hold SHARE on
12
+ * it. The server refuses, and writes nothing, when the Space cannot take it.
8
13
  */
9
14
  export default class CommitmentsPackBind extends BaseCommand {
10
15
  static description: string;
@@ -13,7 +18,10 @@ export default class CommitmentsPackBind extends BaseCommand {
13
18
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
19
  pack: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
20
  'pack-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- agent: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
21
+ agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ space: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ goal: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ 'interval-minutes': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
25
  repository: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
26
  'required-check': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
27
  'installation-id': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -22,3 +30,12 @@ export default class CommitmentsPackBind extends BaseCommand {
22
30
  };
23
31
  run(): Promise<void>;
24
32
  }
33
+ /**
34
+ * The Space knowledge default a loop's home link reports
35
+ * (`CommitmentSpaceLoop.KNOWLEDGE_DEFAULT_OUTCOMES`), in words. Empty for an
36
+ * outcome this CLI does not know, rather than a guess.
37
+ */
38
+ export declare function describeKnowledgeDefault(scope: {
39
+ default?: string;
40
+ enabled?: boolean;
41
+ } | undefined): string;