@skrr-ai/cli 0.1.46 → 0.1.48

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 (305) hide show
  1. package/README.md +1 -1
  2. package/dist/base-command.d.ts +18 -0
  3. package/dist/base-command.js +61 -1
  4. package/dist/commands/agents/chat.d.ts +21 -0
  5. package/dist/commands/agents/chat.js +26 -9
  6. package/dist/commands/balance/usage/breakdown.d.ts +14 -0
  7. package/dist/commands/balance/usage/breakdown.js +68 -0
  8. package/dist/commands/balance/usage.js +24 -0
  9. package/dist/commands/code/handover.d.ts +2 -2
  10. package/dist/commands/code/handover.js +12 -13
  11. package/dist/commands/code/install.js +31 -0
  12. package/dist/commands/code/update.d.ts +46 -0
  13. package/dist/commands/code/update.js +242 -0
  14. package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
  15. package/dist/commands/commerce/entitlements/explain.js +40 -0
  16. package/dist/commands/commerce/incidents/audit.d.ts +20 -0
  17. package/dist/commands/commerce/incidents/audit.js +37 -0
  18. package/dist/commands/commerce/incidents/list.d.ts +22 -0
  19. package/dist/commands/commerce/incidents/list.js +49 -0
  20. package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
  21. package/dist/commands/commerce/incidents/resolve.js +45 -0
  22. package/dist/commands/commerce/incidents/retry.d.ts +22 -0
  23. package/dist/commands/commerce/incidents/retry.js +45 -0
  24. package/dist/commands/commerce/incidents/show.d.ts +13 -0
  25. package/dist/commands/commerce/incidents/show.js +30 -0
  26. package/dist/commands/commerce/offers/approve.d.ts +17 -0
  27. package/dist/commands/commerce/offers/approve.js +33 -0
  28. package/dist/commands/commerce/offers/create.d.ts +18 -0
  29. package/dist/commands/commerce/offers/create.js +34 -0
  30. package/dist/commands/commerce/offers/publish.d.ts +13 -0
  31. package/dist/commands/commerce/offers/publish.js +28 -0
  32. package/dist/commands/commerce/offers/retire.d.ts +17 -0
  33. package/dist/commands/commerce/offers/retire.js +32 -0
  34. package/dist/commands/commerce/offers/validate.d.ts +18 -0
  35. package/dist/commands/commerce/offers/validate.js +33 -0
  36. package/dist/commands/commerce/products/create.d.ts +10 -0
  37. package/dist/commands/commerce/products/create.js +25 -0
  38. package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
  39. package/dist/commands/commerce/promotions/redeem.js +32 -0
  40. package/dist/commands/commerce/terms/accept.d.ts +18 -0
  41. package/dist/commands/commerce/terms/accept.js +39 -0
  42. package/dist/commands/commerce/terms/show.d.ts +10 -0
  43. package/dist/commands/commerce/terms/show.js +34 -0
  44. package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
  45. package/dist/commands/commerce/trials/conversion-preview.js +39 -0
  46. package/dist/commands/commerce/trials/start.d.ts +23 -0
  47. package/dist/commands/commerce/trials/start.js +58 -0
  48. package/dist/commands/commitments/accounting.d.ts +39 -0
  49. package/dist/commands/commitments/accounting.js +116 -0
  50. package/dist/commands/commitments/action-history.d.ts +1 -0
  51. package/dist/commands/commitments/action-history.js +8 -1
  52. package/dist/commands/commitments/case.d.ts +1 -0
  53. package/dist/commands/commitments/case.js +19 -3
  54. package/dist/commands/commitments/cases.d.ts +1 -0
  55. package/dist/commands/commitments/cases.js +11 -1
  56. package/dist/commands/commitments/checks.d.ts +1 -0
  57. package/dist/commands/commitments/checks.js +5 -1
  58. package/dist/commands/commitments/cost.d.ts +62 -0
  59. package/dist/commands/commitments/cost.js +130 -0
  60. package/dist/commands/commitments/create.js +1 -1
  61. package/dist/commands/commitments/delete.d.ts +1 -0
  62. package/dist/commands/commitments/delete.js +56 -6
  63. package/dist/commands/commitments/feedback.js +9 -1
  64. package/dist/commands/commitments/handover.js +16 -0
  65. package/dist/commands/commitments/hypotheses.d.ts +1 -0
  66. package/dist/commands/commitments/hypotheses.js +17 -2
  67. package/dist/commands/commitments/links/list.js +4 -1
  68. package/dist/commands/commitments/liveness.d.ts +18 -0
  69. package/dist/commands/commitments/liveness.js +80 -0
  70. package/dist/commands/commitments/metrics.d.ts +1 -0
  71. package/dist/commands/commitments/metrics.js +8 -1
  72. package/dist/commands/commitments/next-tick.d.ts +39 -0
  73. package/dist/commands/commitments/next-tick.js +122 -0
  74. package/dist/commands/commitments/observations.d.ts +1 -0
  75. package/dist/commands/commitments/observations.js +19 -2
  76. package/dist/commands/commitments/pause.js +12 -0
  77. package/dist/commands/commitments/receipt.d.ts +2 -0
  78. package/dist/commands/commitments/receipt.js +16 -2
  79. package/dist/commands/commitments/remediation-proposal.js +6 -2
  80. package/dist/commands/commitments/remediation-proposals.js +5 -1
  81. package/dist/commands/commitments/restore.d.ts +25 -0
  82. package/dist/commands/commitments/restore.js +46 -0
  83. package/dist/commands/commitments/show.js +32 -0
  84. package/dist/commands/commitments/trigger-status.js +33 -0
  85. package/dist/commands/commitments/update.d.ts +1 -0
  86. package/dist/commands/commitments/update.js +31 -5
  87. package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
  88. package/dist/commands/commitments/wake-capabilities.js +8 -4
  89. package/dist/commands/convos/handover.d.ts +1 -0
  90. package/dist/commands/convos/handover.js +4 -0
  91. package/dist/commands/daemon/index.js +2 -0
  92. package/dist/commands/daemon/update.d.ts +19 -0
  93. package/dist/commands/daemon/update.js +48 -0
  94. package/dist/commands/enterprise/budgets/create.d.ts +11 -0
  95. package/dist/commands/enterprise/budgets/create.js +27 -0
  96. package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
  97. package/dist/commands/enterprise/budgets/evaluate.js +32 -0
  98. package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
  99. package/dist/commands/enterprise/budgets/publish.js +30 -0
  100. package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
  101. package/dist/commands/enterprise/contracts/activate.js +30 -0
  102. package/dist/commands/enterprise/contracts/create.d.ts +14 -0
  103. package/dist/commands/enterprise/contracts/create.js +32 -0
  104. package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
  105. package/dist/commands/enterprise/contracts/issue.js +34 -0
  106. package/dist/commands/enterprise/domains/begin.d.ts +20 -0
  107. package/dist/commands/enterprise/domains/begin.js +39 -0
  108. package/dist/commands/enterprise/domains/verify.d.ts +14 -0
  109. package/dist/commands/enterprise/domains/verify.js +32 -0
  110. package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
  111. package/dist/commands/enterprise/external-config/activate.js +49 -0
  112. package/dist/commands/enterprise/external-config/set.d.ts +25 -0
  113. package/dist/commands/enterprise/external-config/set.js +123 -0
  114. package/dist/commands/enterprise/external-config/show.d.ts +12 -0
  115. package/dist/commands/enterprise/external-config/show.js +39 -0
  116. package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
  117. package/dist/commands/enterprise/external-config/suspend.js +41 -0
  118. package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
  119. package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
  120. package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
  121. package/dist/commands/enterprise/finance/record-document.js +35 -0
  122. package/dist/commands/enterprise/profile.d.ts +20 -0
  123. package/dist/commands/enterprise/profile.js +38 -0
  124. package/dist/commands/login.d.ts +13 -0
  125. package/dist/commands/login.js +77 -0
  126. package/dist/commands/machines/dedicated/index.js +3 -0
  127. package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
  128. package/dist/commands/machines/dedicated/service/apply.js +99 -0
  129. package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
  130. package/dist/commands/machines/dedicated/service/approve.js +52 -0
  131. package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
  132. package/dist/commands/machines/dedicated/service/create.js +222 -0
  133. package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
  134. package/dist/commands/machines/dedicated/service/edit.js +146 -0
  135. package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
  136. package/dist/commands/machines/dedicated/service/exec.js +92 -0
  137. package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
  138. package/dist/commands/machines/dedicated/service/export.js +106 -0
  139. package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
  140. package/dist/commands/machines/dedicated/service/index.js +49 -0
  141. package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
  142. package/dist/commands/machines/dedicated/service/logs.js +148 -0
  143. package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
  144. package/dist/commands/machines/dedicated/service/ls.js +80 -0
  145. package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
  146. package/dist/commands/machines/dedicated/service/restart.js +29 -0
  147. package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
  148. package/dist/commands/machines/dedicated/service/rm.js +33 -0
  149. package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
  150. package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
  151. package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
  152. package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
  153. package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
  154. package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
  155. package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
  156. package/dist/commands/machines/dedicated/service/start.js +29 -0
  157. package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
  158. package/dist/commands/machines/dedicated/service/status.js +85 -0
  159. package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
  160. package/dist/commands/machines/dedicated/service/stop.js +35 -0
  161. package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
  162. package/dist/commands/machines/dedicated/service/top.js +120 -0
  163. package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
  164. package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
  165. package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
  166. package/dist/commands/machines/dedicated/ssh-config.js +66 -0
  167. package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
  168. package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
  169. package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
  170. package/dist/commands/machines/dedicated/ssh.js +121 -0
  171. package/dist/commands/native/allow-all.d.ts +14 -0
  172. package/dist/commands/native/allow-all.js +25 -0
  173. package/dist/commands/native/allow.d.ts +24 -0
  174. package/dist/commands/native/allow.js +45 -0
  175. package/dist/commands/native/deny.d.ts +24 -0
  176. package/dist/commands/native/deny.js +43 -0
  177. package/dist/commands/native/disable.d.ts +17 -0
  178. package/dist/commands/native/disable.js +28 -0
  179. package/dist/commands/native/enable.d.ts +12 -0
  180. package/dist/commands/native/enable.js +29 -0
  181. package/dist/commands/native/list-apps.d.ts +19 -0
  182. package/dist/commands/native/list-apps.js +30 -0
  183. package/dist/commands/native/restrict-to.d.ts +22 -0
  184. package/dist/commands/native/restrict-to.js +41 -0
  185. package/dist/commands/native/status.d.ts +19 -0
  186. package/dist/commands/native/status.js +33 -0
  187. package/dist/commands/native.d.ts +39 -0
  188. package/dist/commands/native.js +76 -0
  189. package/dist/commands/service/index.d.ts +14 -0
  190. package/dist/commands/service/index.js +31 -0
  191. package/dist/commands/service/logs.d.ts +18 -0
  192. package/dist/commands/service/logs.js +53 -0
  193. package/dist/commands/service/ls.d.ts +13 -0
  194. package/dist/commands/service/ls.js +48 -0
  195. package/dist/commands/service/propose.d.ts +34 -0
  196. package/dist/commands/service/propose.js +113 -0
  197. package/dist/commands/service/status.d.ts +17 -0
  198. package/dist/commands/service/status.js +56 -0
  199. package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
  200. package/dist/commands/spaces/auto-executor/runs.js +56 -0
  201. package/dist/commands/spaces/briefs/get.js +8 -0
  202. package/dist/commands/spaces/briefs/list.js +2 -0
  203. package/dist/commands/spaces/briefs/set.d.ts +3 -0
  204. package/dist/commands/spaces/briefs/set.js +78 -13
  205. package/dist/commands/spaces/expertise-suggestions.d.ts +12 -0
  206. package/dist/commands/spaces/expertise-suggestions.js +71 -0
  207. package/dist/commands/spaces/members/add.d.ts +1 -0
  208. package/dist/commands/spaces/members/add.js +11 -3
  209. package/dist/commands/spaces/members/list.js +11 -0
  210. package/dist/commands/store/governance/artifacts.d.ts +25 -0
  211. package/dist/commands/store/governance/artifacts.js +55 -0
  212. package/dist/commands/store/governance/assign.d.ts +16 -0
  213. package/dist/commands/store/governance/assign.js +54 -0
  214. package/dist/commands/store/governance/create-license.d.ts +18 -0
  215. package/dist/commands/store/governance/create-license.js +35 -0
  216. package/dist/commands/store/governance/install-plan.d.ts +25 -0
  217. package/dist/commands/store/governance/install-plan.js +56 -0
  218. package/dist/commands/store/governance/license-policy.d.ts +30 -0
  219. package/dist/commands/store/governance/license-policy.js +69 -0
  220. package/dist/commands/store/governance/policy.d.ts +25 -0
  221. package/dist/commands/store/governance/policy.js +65 -0
  222. package/dist/commands/store/governance/publish-release.d.ts +17 -0
  223. package/dist/commands/store/governance/publish-release.js +34 -0
  224. package/dist/commands/tasks/assign.d.ts +9 -0
  225. package/dist/commands/tasks/assign.js +108 -1
  226. package/dist/commands/tasks/deliverable/add.d.ts +15 -0
  227. package/dist/commands/tasks/deliverable/add.js +174 -0
  228. package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
  229. package/dist/commands/tasks/deliverable/archive.js +205 -0
  230. package/dist/commands/tasks/labels/detach.js +3 -0
  231. package/dist/commands/tasks/labels/suggest.d.ts +24 -0
  232. package/dist/commands/tasks/labels/suggest.js +69 -0
  233. package/dist/commands/tasks/list.d.ts +16 -2
  234. package/dist/commands/tasks/list.js +100 -24
  235. package/dist/commands/tasks/show.d.ts +23 -0
  236. package/dist/commands/tasks/show.js +51 -1
  237. package/dist/commands/wiki/rm.d.ts +22 -1
  238. package/dist/commands/wiki/rm.js +52 -3
  239. package/dist/lib/agentic-stream.js +10 -2
  240. package/dist/lib/assignee-resolver.d.ts +22 -0
  241. package/dist/lib/assignee-resolver.js +26 -0
  242. package/dist/lib/balance.d.ts +6 -1
  243. package/dist/lib/balance.js +15 -0
  244. package/dist/lib/code-handover.d.ts +0 -10
  245. package/dist/lib/code-handover.js +20 -5
  246. package/dist/lib/commerce-command.d.ts +48 -0
  247. package/dist/lib/commerce-command.js +70 -0
  248. package/dist/lib/commerce.d.ts +93 -0
  249. package/dist/lib/commerce.js +129 -0
  250. package/dist/lib/commitment-product.js +1 -1
  251. package/dist/lib/commitments.d.ts +202 -29
  252. package/dist/lib/commitments.js +300 -33
  253. package/dist/lib/dedicated-lease-command.js +10 -0
  254. package/dist/lib/dedicated-machines.d.ts +37 -0
  255. package/dist/lib/dedicated-machines.js +47 -0
  256. package/dist/lib/dedicated-service-command.d.ts +60 -0
  257. package/dist/lib/dedicated-service-command.js +182 -0
  258. package/dist/lib/dedicated-service.d.ts +342 -0
  259. package/dist/lib/dedicated-service.js +741 -0
  260. package/dist/lib/dedicated-ssh.d.ts +136 -0
  261. package/dist/lib/dedicated-ssh.js +387 -0
  262. package/dist/lib/delegated-cli.js +51 -13
  263. package/dist/lib/enterprise-commerce.d.ts +67 -0
  264. package/dist/lib/enterprise-commerce.js +112 -0
  265. package/dist/lib/enterprise-external-configuration.d.ts +60 -0
  266. package/dist/lib/enterprise-external-configuration.js +58 -0
  267. package/dist/lib/first-party-harness.js +17 -3
  268. package/dist/lib/governed-store.d.ts +110 -0
  269. package/dist/lib/governed-store.js +79 -0
  270. package/dist/lib/guest-service-command.d.ts +16 -0
  271. package/dist/lib/guest-service-command.js +32 -0
  272. package/dist/lib/guest-service.d.ts +67 -0
  273. package/dist/lib/guest-service.js +112 -0
  274. package/dist/lib/prompt.d.ts +1 -0
  275. package/dist/lib/prompt.js +1 -0
  276. package/dist/lib/task-asset-upload.d.ts +20 -0
  277. package/dist/lib/task-asset-upload.js +30 -8
  278. package/dist/lib/task-extras.d.ts +23 -0
  279. package/dist/lib/task-extras.js +6 -0
  280. package/dist/lib/update-check.d.ts +80 -7
  281. package/dist/lib/update-check.js +365 -33
  282. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
  283. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
  284. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +9 -1
  285. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +8 -0
  286. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  287. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -5
  288. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
  289. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
  290. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
  291. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
  292. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
  293. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
  294. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +9 -1
  295. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +8 -0
  296. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  297. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  298. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
  299. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
  302. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  303. package/dist/node_modules/@skrr-ai/data-provider/index.js +5067 -4821
  304. package/oclif.manifest.json +34877 -28659
  305. package/package.json +43 -1
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatAccountingReadout = formatAccountingReadout;
4
+ const core_1 = require("@oclif/core");
5
+ const base_command_1 = require("../../base-command");
6
+ const commitments_1 = require("../../lib/commitments");
7
+ /**
8
+ * `skrr commitments accounting <id>` — the allowance-accounting SHADOW readout.
9
+ *
10
+ * Allowance accounting replaces "count the attempts" with "count what the
11
+ * attempts advanced", and it may only be activated once there is enough CLOSED
12
+ * evidence to derive the attempt multiplier. Until then the requested mode is
13
+ * held at `shadow` and nothing says so anywhere an operator can read — the
14
+ * workspace looks configured, and the behaviour is unchanged.
15
+ *
16
+ * This is that read: what the shadow window observed, what multiplier it
17
+ * derives, and — the field that matters — whether it can activate yet and what
18
+ * is blocking it.
19
+ *
20
+ * WORKSPACE-scoped despite taking a commitment id: the readout aggregates every
21
+ * closed daily metric in the commitment's workspace. `commitments cost` is the
22
+ * per-commitment spend question.
23
+ */
24
+ class CommitmentsAccounting extends base_command_1.BaseCommand {
25
+ static description = "Show the workspace's allowance-accounting shadow readout and whether it can activate";
26
+ static examples = [
27
+ '<%= config.bin %> commitments accounting obj_abc123',
28
+ '<%= config.bin %> commitments accounting obj_abc123 --json',
29
+ ];
30
+ static args = {
31
+ id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
32
+ };
33
+ static flags = {
34
+ json: core_1.Flags.boolean({ description: 'Output the complete readout as JSON' }),
35
+ };
36
+ async run() {
37
+ this.requireAuth();
38
+ const { args, flags } = await this.parse(CommitmentsAccounting);
39
+ let readout;
40
+ try {
41
+ readout = await commitments_1.commitmentApi.accountingReadout(args.id);
42
+ }
43
+ catch (err) {
44
+ this.handleApiError(err);
45
+ }
46
+ if (flags.json) {
47
+ this.log(JSON.stringify(readout, null, 2));
48
+ return;
49
+ }
50
+ for (const line of formatAccountingReadout(readout))
51
+ this.log(line);
52
+ }
53
+ }
54
+ exports.default = CommitmentsAccounting;
55
+ /**
56
+ * Pure renderer for the accounting readout.
57
+ *
58
+ * `requestedMode` and `canActivate` are printed together because the gap
59
+ * between them IS the finding: a workspace that asked for `on` and reads
60
+ * `canActivate: false` is running on the old attempt accounting and has no
61
+ * other surface that says so.
62
+ */
63
+ function formatAccountingReadout(readout) {
64
+ const requested = readout.requestedMode ?? 'off';
65
+ const canActivate = readout.canActivate === true;
66
+ const lines = [
67
+ 'Allowance accounting (workspace shadow readout)',
68
+ '',
69
+ `Requested mode: ${requested}`,
70
+ `Can activate: ${canActivate ? 'yes' : 'no'}`,
71
+ ];
72
+ if (!canActivate && readout.activationBlocker) {
73
+ lines.push(`Blocked by: ${readout.activationBlocker}`);
74
+ }
75
+ if (requested === 'on' && !canActivate) {
76
+ // Say the consequence, not just the state. "Held at shadow" is the fact an
77
+ // operator needs; "canActivate: false" is the fact the server reports.
78
+ lines.push('Effective mode: shadow — the requested mode is withheld until evidence closes.');
79
+ }
80
+ lines.push('');
81
+ lines.push(`Window: ${Number(readout.evidenceDays || 0)} of ${Number(readout.windowDays || 0)} closed day(s)`);
82
+ lines.push(`Source: ${readout.source ?? '-'}`);
83
+ lines.push('');
84
+ lines.push(`Attempts: ${Number(readout.attempts || 0)}`);
85
+ // These two count different units — `advancements` is advancing CHECKS while
86
+ // `netAdvancements` is advancement KIND ENTRIES (one check can mint several).
87
+ // Rendered as "4 vs 5" without the labels, they read as a contradiction.
88
+ lines.push(`Advancing checks: ${Number(readout.advancements || 0)}`);
89
+ lines.push(` advancement kinds, net of self-minted: ${Number(readout.netAdvancements || 0)}`);
90
+ lines.push(`Divergence: ${Number(readout.allowanceAttemptDivergence || 0)}`);
91
+ // Same attribution caveat as `commitments cost`: a bare dollar figure lets
92
+ // a priced window and an unpriced one read alike (OSK-10940).
93
+ const costStatus = readout.costStatus ?? 'not_applicable';
94
+ const costCaveat = {
95
+ reported: 'every run reported a cost',
96
+ partial: 'some runs reported no cost — the total is a FLOOR',
97
+ unavailable: 'no run reported a cost — the total is meaningless',
98
+ not_applicable: 'no closed runs in the window',
99
+ };
100
+ lines.push(`Window cost: $${(Number(readout.costUsdMicros || 0) / 1_000_000).toFixed(4)}` +
101
+ ` — ${costStatus}: ${costCaveat[costStatus] ?? 'unrecognized cost status'}` +
102
+ ` (${Number(readout.costReportedRunCount || 0)} of ${Number(readout.costRunCount || 0)} runs priced)`);
103
+ const multiplier = readout.recommendedAttemptMultiplier;
104
+ lines.push('');
105
+ lines.push(`Attempt multiplier: ${multiplier == null ? 'not derivable yet' : multiplier}` +
106
+ (readout.multiplierDerivation ? ` — ${readout.multiplierDerivation}` : ''));
107
+ const none = readout.noneByReason ?? {};
108
+ const reasons = Object.entries(none);
109
+ if (reasons.length > 0) {
110
+ lines.push('');
111
+ lines.push('Checks that advanced nothing, by reason:');
112
+ for (const [reason, count] of reasons)
113
+ lines.push(` ${reason}: ${Number(count || 0)}`);
114
+ }
115
+ return lines;
116
+ }
@@ -16,6 +16,7 @@ export default class CommitmentsActionHistory extends BaseCommand {
16
16
  static flags: {
17
17
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
18
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
20
  };
20
21
  run(): Promise<void>;
21
22
  }
@@ -23,18 +23,25 @@ class CommitmentsActionHistory extends base_command_1.BaseCommand {
23
23
  static flags = {
24
24
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
25
  limit: core_1.Flags.integer({ description: 'Max rows', min: 1, max: 200 }),
26
+ cursor: core_1.Flags.string({
27
+ description: 'Continue from the next_cursor emitted by a previous page',
28
+ }),
26
29
  };
27
30
  async run() {
28
31
  this.requireAuth();
29
32
  const { args, flags } = await this.parse(CommitmentsActionHistory);
30
33
  let response;
31
34
  try {
32
- response = await commitments_1.commitmentApi.actionHistory(args.commitmentId, flags.limit);
35
+ response = await commitments_1.commitmentApi.actionHistory(args.commitmentId, {
36
+ limit: flags.limit,
37
+ cursor: flags.cursor,
38
+ });
33
39
  }
34
40
  catch (err) {
35
41
  this.handleApiError(err);
36
42
  }
37
43
  this.log(JSON.stringify(response, null, 2));
44
+ (0, commitments_1.renderListPageHint)(response, (line) => this.log(line));
38
45
  }
39
46
  }
40
47
  exports.default = CommitmentsActionHistory;
@@ -7,6 +7,7 @@ export default class CommitmentsCase extends BaseCommand {
7
7
  };
8
8
  static flags: {
9
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ entries: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
11
  };
11
12
  run(): Promise<void>;
12
13
  }
@@ -9,10 +9,17 @@ class CommitmentsCase extends base_command_1.BaseCommand {
9
9
  commitmentId: core_1.Args.string({ ignoreStdin: true, description: 'Commitment ID', required: true }),
10
10
  caseId: core_1.Args.string({ ignoreStdin: true, description: 'Case ID', required: true }),
11
11
  };
12
- static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
12
+ static flags = {
13
+ json: core_1.Flags.boolean({ description: 'Output the full case document as JSON' }),
14
+ entries: core_1.Flags.integer({
15
+ description: 'Latest facts and receipts to show (the full document is --json)',
16
+ min: 1,
17
+ max: 100,
18
+ }),
19
+ };
13
20
  async run() {
14
21
  this.requireAuth();
15
- const { args } = await this.parse(CommitmentsCase);
22
+ const { args, flags } = await this.parse(CommitmentsCase);
16
23
  let result;
17
24
  try {
18
25
  result = await commitments_1.commitmentApi.caseDetail(args.commitmentId, args.caseId);
@@ -20,7 +27,16 @@ class CommitmentsCase extends base_command_1.BaseCommand {
20
27
  catch (error) {
21
28
  this.handleApiError(error);
22
29
  }
23
- this.log(JSON.stringify(result, null, 2));
30
+ if (flags.json) {
31
+ this.log(JSON.stringify(result, null, 2));
32
+ return;
33
+ }
34
+ // A case document has no size bound — 93k lines was observed — so the
35
+ // human view is a digest with the most recent entries, and --json stays
36
+ // the opt-in for the full document (OSK-10952).
37
+ (0, commitments_1.renderCommitmentCaseDetail)(result, (line) => this.log(line), {
38
+ maxEntries: flags.entries ?? 10,
39
+ });
24
40
  }
25
41
  }
26
42
  exports.default = CommitmentsCase;
@@ -8,6 +8,7 @@ export default class CommitmentsCases extends BaseCommand {
8
8
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
9
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  };
12
13
  run(): Promise<void>;
13
14
  }
@@ -12,6 +12,9 @@ class CommitmentsCases extends base_command_1.BaseCommand {
12
12
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
13
13
  limit: core_1.Flags.integer({ description: 'Cases to return (1..200)', min: 1, max: 200 }),
14
14
  status: core_1.Flags.string({ description: 'Case lifecycle status to include' }),
15
+ cursor: core_1.Flags.string({
16
+ description: 'Continue from the next_cursor emitted by a previous page',
17
+ }),
15
18
  };
16
19
  async run() {
17
20
  this.requireAuth();
@@ -21,12 +24,19 @@ class CommitmentsCases extends base_command_1.BaseCommand {
21
24
  result = await commitments_1.commitmentApi.cases(args.commitmentId, {
22
25
  limit: flags.limit,
23
26
  status: flags.status,
27
+ cursor: flags.cursor,
24
28
  });
25
29
  }
26
30
  catch (error) {
27
31
  this.handleApiError(error);
28
32
  }
29
- this.log(JSON.stringify(result, null, 2));
33
+ if (flags.json) {
34
+ this.log(JSON.stringify(result, null, 2));
35
+ }
36
+ else {
37
+ (0, commitments_1.renderCommitmentCases)(result, (line) => this.log(line));
38
+ }
39
+ (0, commitments_1.renderListPageHint)(result, (line) => this.log(line));
30
40
  }
31
41
  }
32
42
  exports.default = CommitmentsCases;
@@ -16,6 +16,7 @@ export default class CommitmentsChecks extends BaseCommand {
16
16
  static flags: {
17
17
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
18
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
20
  };
20
21
  run(): Promise<void>;
21
22
  }
@@ -23,13 +23,16 @@ class CommitmentsChecks extends base_command_1.BaseCommand {
23
23
  static flags = {
24
24
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
25
  limit: core_1.Flags.integer({ description: 'Max checks to return (1..100)', min: 1, max: 100 }),
26
+ cursor: core_1.Flags.string({
27
+ description: 'Continue from the next_cursor emitted by a previous page',
28
+ }),
26
29
  };
27
30
  async run() {
28
31
  this.requireAuth();
29
32
  const { args, flags } = await this.parse(CommitmentsChecks);
30
33
  let response;
31
34
  try {
32
- response = await commitments_1.commitmentApi.checks(args.id, flags.limit);
35
+ response = await commitments_1.commitmentApi.checks(args.id, { limit: flags.limit, cursor: flags.cursor });
33
36
  }
34
37
  catch (err) {
35
38
  this.handleApiError(err);
@@ -39,6 +42,7 @@ class CommitmentsChecks extends base_command_1.BaseCommand {
39
42
  return;
40
43
  }
41
44
  (0, commitments_1.renderCheckList)(response.data ?? [], (line) => this.log(line));
45
+ (0, commitments_1.renderListPageHint)(response, (line) => this.log(line));
42
46
  }
43
47
  }
44
48
  exports.default = CommitmentsChecks;
@@ -0,0 +1,62 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ import { type CommitmentCostWindow } from '../../lib/commitments';
3
+ /**
4
+ * Resolve a cost window to UTC day boundaries.
5
+ *
6
+ * `CommitmentPeriodClose.readCostWindow` REFUSES a window that is not exactly
7
+ * on UTC day starts (`RangeError: cost windows must use UTC day boundaries`),
8
+ * because the closed daily metrics it sums are bucketed that way — a window
9
+ * that started mid-day would silently include or exclude a whole bucket. So the
10
+ * CLI snaps to the boundary itself rather than forwarding a wall-clock time and
11
+ * letting the operator meet a 500 they cannot act on.
12
+ *
13
+ * Snapping is a real change to what was asked for, so it is deliberately
14
+ * TRUNCATION in both directions — `--to 2026-09-19T18:00Z` reports through the
15
+ * start of the 19th, not the end of it. The command prints the window it
16
+ * actually used for that reason.
17
+ *
18
+ * The default window ends at TODAY's UTC day start, not now: today's metrics
19
+ * are not closed yet, so including the partial day would report a cost that
20
+ * changes when you re-run the same command.
21
+ */
22
+ export declare function resolveCostWindow(input?: {
23
+ from?: string;
24
+ to?: string;
25
+ }, now?: Date): {
26
+ from: string;
27
+ to: string;
28
+ };
29
+ /**
30
+ * `skrr commitments cost <id>` — closed-period spend for one commitment.
31
+ *
32
+ * Money on this path has no other bound the operator can read: a Commitment's
33
+ * agent turns are `AgentOutcome` rows carrying no cost fields, so
34
+ * `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
35
+ * (see `autonomyEnvelope.maxRunsPerDay` in the API's own schema note). This is
36
+ * the read that says what those runs actually cost.
37
+ *
38
+ * `metrics` shows the daily rows; this sums the closed ones over a window and,
39
+ * critically, reports how much of the window was ATTRIBUTABLE.
40
+ */
41
+ export default class CommitmentsCost extends BaseCommand {
42
+ static description: string;
43
+ static examples: string[];
44
+ static args: {
45
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
46
+ };
47
+ static flags: {
48
+ from: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
49
+ to: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
50
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
51
+ };
52
+ run(): Promise<void>;
53
+ }
54
+ /**
55
+ * Pure renderer for the cost window.
56
+ *
57
+ * `costStatus` is printed BEFORE the dollar figure, on purpose. `partial` and
58
+ * `unavailable` mean some runs reported no cost attribution at all, so the
59
+ * total understates the spend; a reader who sees the number first has already
60
+ * formed a belief by the time they reach the caveat.
61
+ */
62
+ export declare function formatCostWindow(data: CommitmentCostWindow): string[];
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveCostWindow = resolveCostWindow;
4
+ exports.formatCostWindow = formatCostWindow;
5
+ const core_1 = require("@oclif/core");
6
+ const base_command_1 = require("../../base-command");
7
+ const commitments_1 = require("../../lib/commitments");
8
+ const DAY_MS = 24 * 60 * 60 * 1000;
9
+ const DEFAULT_WINDOW_DAYS = 7;
10
+ /**
11
+ * Resolve a cost window to UTC day boundaries.
12
+ *
13
+ * `CommitmentPeriodClose.readCostWindow` REFUSES a window that is not exactly
14
+ * on UTC day starts (`RangeError: cost windows must use UTC day boundaries`),
15
+ * because the closed daily metrics it sums are bucketed that way — a window
16
+ * that started mid-day would silently include or exclude a whole bucket. So the
17
+ * CLI snaps to the boundary itself rather than forwarding a wall-clock time and
18
+ * letting the operator meet a 500 they cannot act on.
19
+ *
20
+ * Snapping is a real change to what was asked for, so it is deliberately
21
+ * TRUNCATION in both directions — `--to 2026-09-19T18:00Z` reports through the
22
+ * start of the 19th, not the end of it. The command prints the window it
23
+ * actually used for that reason.
24
+ *
25
+ * The default window ends at TODAY's UTC day start, not now: today's metrics
26
+ * are not closed yet, so including the partial day would report a cost that
27
+ * changes when you re-run the same command.
28
+ */
29
+ function resolveCostWindow(input = {}, now = new Date()) {
30
+ const dayStart = (date) => new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));
31
+ const parse = (value, flag) => {
32
+ const parsed = new Date(value);
33
+ if (Number.isNaN(parsed.getTime())) {
34
+ throw new Error(`${flag} is not a date: ${value}`);
35
+ }
36
+ return parsed;
37
+ };
38
+ const to = input.to ? dayStart(parse(input.to, '--to')) : dayStart(now);
39
+ const from = input.from
40
+ ? dayStart(parse(input.from, '--from'))
41
+ : new Date(to.getTime() - DEFAULT_WINDOW_DAYS * DAY_MS);
42
+ if (to.getTime() <= from.getTime()) {
43
+ throw new Error('--to must be a later UTC day than --from.');
44
+ }
45
+ return { from: from.toISOString(), to: to.toISOString() };
46
+ }
47
+ /**
48
+ * `skrr commitments cost <id>` — closed-period spend for one commitment.
49
+ *
50
+ * Money on this path has no other bound the operator can read: a Commitment's
51
+ * agent turns are `AgentOutcome` rows carrying no cost fields, so
52
+ * `spendLimitDailyUsd` cannot see them and `maxRunsPerDay` IS the spend control
53
+ * (see `autonomyEnvelope.maxRunsPerDay` in the API's own schema note). This is
54
+ * the read that says what those runs actually cost.
55
+ *
56
+ * `metrics` shows the daily rows; this sums the closed ones over a window and,
57
+ * critically, reports how much of the window was ATTRIBUTABLE.
58
+ */
59
+ class CommitmentsCost extends base_command_1.BaseCommand {
60
+ static description = "Sum a commitment's closed-period run cost over a UTC day window";
61
+ static examples = [
62
+ '<%= config.bin %> commitments cost obj_abc123',
63
+ '<%= config.bin %> commitments cost obj_abc123 --from 2026-09-01 --to 2026-09-15',
64
+ '<%= config.bin %> commitments cost obj_abc123 --json',
65
+ ];
66
+ static args = {
67
+ id: core_1.Args.string({ description: 'Commitment ID', required: true, ignoreStdin: true }),
68
+ };
69
+ static flags = {
70
+ from: core_1.Flags.string({
71
+ description: `Window start, truncated to its UTC day (default: ${DEFAULT_WINDOW_DAYS} days before --to)`,
72
+ }),
73
+ to: core_1.Flags.string({
74
+ description: "Window end, truncated to its UTC day (default: today's UTC day start)",
75
+ }),
76
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
77
+ };
78
+ async run() {
79
+ this.requireAuth();
80
+ const { args, flags } = await this.parse(CommitmentsCost);
81
+ let window;
82
+ try {
83
+ window = resolveCostWindow({ from: flags.from, to: flags.to });
84
+ }
85
+ catch (err) {
86
+ this.error(err.message, { exit: 1 });
87
+ }
88
+ let data;
89
+ try {
90
+ data = await commitments_1.commitmentApi.cost(args.id, window);
91
+ }
92
+ catch (err) {
93
+ this.handleApiError(err);
94
+ }
95
+ if (flags.json) {
96
+ this.log(JSON.stringify(data, null, 2));
97
+ return;
98
+ }
99
+ for (const line of formatCostWindow(data))
100
+ this.log(line);
101
+ }
102
+ }
103
+ exports.default = CommitmentsCost;
104
+ /**
105
+ * Pure renderer for the cost window.
106
+ *
107
+ * `costStatus` is printed BEFORE the dollar figure, on purpose. `partial` and
108
+ * `unavailable` mean some runs reported no cost attribution at all, so the
109
+ * total understates the spend; a reader who sees the number first has already
110
+ * formed a belief by the time they reach the caveat.
111
+ */
112
+ function formatCostWindow(data) {
113
+ const micros = Number(data.costUsdMicros || 0);
114
+ const runs = Number(data.runCount || 0);
115
+ const unattributed = Number(data.unavailableRunCount || 0);
116
+ const status = data.costStatus ?? 'not_applicable';
117
+ const caveat = {
118
+ reported: 'every run in the window reported a cost',
119
+ partial: 'some runs reported no cost — the total below is a FLOOR',
120
+ unavailable: 'no run in the window reported a cost — the total below is meaningless',
121
+ not_applicable: 'no closed runs in the window',
122
+ };
123
+ return [
124
+ `Cost for ${data.commitmentId ?? '-'}`,
125
+ `Window: ${data.from ?? '-'} → ${data.to ?? '-'} (${Number(data.dayCount || 0)} closed day(s))`,
126
+ `Attribution: ${status} — ${caveat[status] ?? 'unrecognized cost status'}`,
127
+ `Cost: $${(micros / 1_000_000).toFixed(4)}`,
128
+ `Runs: ${runs} (${Number(data.reportedRunCount || 0)} with cost, ${unattributed} without)`,
129
+ ];
130
+ }
@@ -197,7 +197,7 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
197
197
  agent: core_1.Flags.string({ description: 'Agent that owns and watches this commitment (required)' }),
198
198
  kind: core_1.Flags.string({
199
199
  description: 'Lifecycle kind: achieve is terminal-capable; maintain is perpetual',
200
- options: ['achieve', 'maintain'],
200
+ options: [...commitments_1.COMMITMENT_KIND_VALUES],
201
201
  }),
202
202
  title: core_1.Flags.string({ description: 'Short commitment title (required)' }),
203
203
  outcome: core_1.Flags.string({
@@ -22,6 +22,7 @@ export default class CommitmentsDelete extends BaseCommand {
22
22
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
23
  reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
24
  yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
+ 'stop-open-work': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
26
  };
26
27
  run(): Promise<void>;
27
28
  }
@@ -30,16 +30,43 @@ class CommitmentsDelete extends base_command_1.BaseCommand {
30
30
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
31
31
  reason: core_1.Flags.string({ description: 'Why it was deleted (recorded on the boundary ledger)' }),
32
32
  yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt' }),
33
+ 'stop-open-work': core_1.Flags.boolean({
34
+ description: 'Cancel the open Tasks this Commitment produced. Without it they KEEP RUNNING — deleting the producer has never stopped the product.',
35
+ allowNo: true,
36
+ }),
33
37
  };
34
38
  async run() {
35
39
  this.requireAuth();
36
40
  const { args, flags } = await this.parse(CommitmentsDelete);
37
- // The repo's own destructive-confirm helper rather than a second prompt:
38
- // it also refuses to hang on a non-TTY, exiting 7 with an instruction to
39
- // pass --yes, which is what makes this safe to call from a script.
41
+ let preview = null;
42
+ try {
43
+ preview = (await commitments_1.commitmentApi.deletionPreview(args.id));
44
+ }
45
+ catch {
46
+ // An older server has no preview route. Proceed — the delete itself
47
+ // still refuses to guess when there is open work.
48
+ }
49
+ // The API refuses to delete an active Commitment, and rightly so. But a
50
+ // deliberate step is not the same as a dead end: the person has already
51
+ // said what they want, so the step becomes part of THIS gesture rather
52
+ // than a second command they have to go and find. Same rule the web
53
+ // dialog applies, so the two surfaces cannot drift.
54
+ const mustPauseFirst = preview?.requiresStopFirst === true;
55
+ const openTasks = Number(preview?.openTaskCount || 0);
56
+ if (openTasks > 0 && flags['stop-open-work'] === undefined) {
57
+ this.error(`${args.id} has ${openTasks} open task(s), and deleting it does NOT stop them.\n` +
58
+ ` skrr commitments delete ${args.id} --stop-open-work # cancel them too\n` +
59
+ ` skrr commitments delete ${args.id} --no-stop-open-work # leave them running`, { exit: 1 });
60
+ }
61
+ const fate = openTasks === 0
62
+ ? 'Its checks, runs and cases stay readable.'
63
+ : flags['stop-open-work']
64
+ ? `Its ${openTasks} open task(s) will be CANCELLED.`
65
+ : `Its ${openTasks} open task(s) will KEEP RUNNING.`;
66
+ const verb = mustPauseFirst ? 'Pause and delete' : 'Delete';
40
67
  let confirmed;
41
68
  try {
42
- confirmed = await (0, prompt_1.confirmDestructive)(`Delete commitment ${args.id}? Its checks, runs and cases stay readable.`, flags.yes);
69
+ confirmed = await (0, prompt_1.confirmDestructive)(`${verb} commitment ${args.id}? ${fate}`, flags.yes);
43
70
  }
44
71
  catch (err) {
45
72
  if (err.exit === 7) {
@@ -51,9 +78,23 @@ class CommitmentsDelete extends base_command_1.BaseCommand {
51
78
  this.log('Cancelled.');
52
79
  return;
53
80
  }
81
+ if (mustPauseFirst) {
82
+ try {
83
+ await commitments_1.commitmentApi.pause(args.id);
84
+ this.log(`Paused ${args.id}.`);
85
+ }
86
+ catch (err) {
87
+ // Report WHICH half failed. "Could not delete" would be wrong and
88
+ // would send the reader looking in the wrong place.
89
+ this.log(`Could not pause ${args.id} — it was not deleted.`);
90
+ this.handleApiError(err);
91
+ }
92
+ }
54
93
  let result;
55
94
  try {
56
- result = await commitments_1.commitmentApi.remove(args.id, flags.reason);
95
+ result = await commitments_1.commitmentApi.remove(args.id, flags.reason, {
96
+ stopOpenWork: flags['stop-open-work'],
97
+ });
57
98
  }
58
99
  catch (err) {
59
100
  this.handleApiError(err);
@@ -66,7 +107,16 @@ class CommitmentsDelete extends base_command_1.BaseCommand {
66
107
  this.log(`Deleted ${String(commitment.id ?? args.id)}.`);
67
108
  if (commitment.title)
68
109
  this.log(` ${String(commitment.title)}`);
69
- this.log(' Its checks, runs, cases and linked Tasks remain readable.');
110
+ const work = (result.work ?? {});
111
+ // Lead with what still ACTS. What remains readable is reassurance; what
112
+ // remains running is the fact the reader needs.
113
+ if (work.openTasksStopped)
114
+ this.log(` ${work.openTasksStopped} open task(s) cancelled.`);
115
+ if (work.openTasksLeftRunning) {
116
+ this.log(` ${work.openTasksLeftRunning} open task(s) are STILL RUNNING.`);
117
+ }
118
+ this.log(' Its checks, runs and cases remain readable.');
119
+ this.log(` Restore it with: skrr commitments restore ${String(commitment.id ?? args.id)}`);
70
120
  }
71
121
  }
72
122
  exports.default = CommitmentsDelete;
@@ -53,7 +53,15 @@ class CommitmentsFeedback extends base_command_1.BaseCommand {
53
53
  this.log(JSON.stringify(result, null, 2));
54
54
  return;
55
55
  }
56
- this.log(`Recorded "${flags.kind}" on ${args.checkId}. Reflection will weigh it next cycle.`);
56
+ // A contradictory click used to acknowledge identically to a fresh verdict
57
+ // (OSK-10955) — the server reports what already stands on the check, and
58
+ // this copy keeps it visible.
59
+ const prior = Array.isArray(result?.priorFeedbackKinds)
60
+ ? result.priorFeedbackKinds.filter(Boolean)
61
+ : [];
62
+ const priorClause = prior.length ? ` Earlier feedback on this check: ${prior.join(', ')}.` : '';
63
+ const reaffirmClause = result?.reaffirmed ? ' (reaffirmed — same verdict as before)' : '';
64
+ this.log(`Recorded "${flags.kind}" on ${args.checkId}.${reaffirmClause} Reflection will weigh it next cycle.${priorClause}`);
57
65
  }
58
66
  }
59
67
  exports.default = CommitmentsFeedback;
@@ -78,6 +78,22 @@ class CommitmentsHandover extends base_command_1.BaseCommand {
78
78
  }
79
79
  const agentLabel = target.name ? `${target.name} (${target.id})` : target.id;
80
80
  this.log(`Handed commitment ${args.id} over to ${agentLabel}`);
81
+ // The transition summary — without it a mid-check/mid-run handover reads
82
+ // as a silent success and the operator cannot tell whether in-flight work
83
+ // kept the old executor or was fenced.
84
+ const inFlight = result?.inFlight;
85
+ if (inFlight) {
86
+ const claimed = Number(inFlight.claimedRuns) || 0;
87
+ const fencedRuns = Number(inFlight.fencedRuns) || 0;
88
+ const fencedChecks = Number(inFlight.fencedChecks) || 0;
89
+ if (claimed > 0) {
90
+ this.log(` ${claimed} claimed run(s) keep the old executor until they finish`);
91
+ }
92
+ if (fencedRuns > 0 || fencedChecks > 0) {
93
+ this.log(` fenced ${fencedRuns} unclaimed run(s) and ${fencedChecks} in-flight check(s) — cancelled before start`);
94
+ }
95
+ this.log(` the new executor takes over from the next wake`);
96
+ }
81
97
  // The audit entry the server appended — echo it so "from whom" is answered
82
98
  // without a second call. Absent on a server that predates the trail.
83
99
  const commitment = result?.commitment ??
@@ -22,6 +22,7 @@ export default class CommitmentsHypotheses extends BaseCommand {
22
22
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
23
  status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
24
  'investigation-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
26
  };
26
27
  run(): Promise<void>;
27
28
  }