@skrr-ai/cli 0.1.92 → 0.1.94

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 (323) hide show
  1. package/dist/base-command.d.ts +44 -0
  2. package/dist/base-command.js +96 -0
  3. package/dist/commands/agents/badge.d.ts +41 -0
  4. package/dist/commands/agents/badge.js +158 -0
  5. package/dist/commands/agents/create.d.ts +24 -0
  6. package/dist/commands/agents/create.js +212 -0
  7. package/dist/commands/agents/embed.d.ts +20 -0
  8. package/dist/commands/agents/embed.js +61 -0
  9. package/dist/commands/agents/operating-plan.d.ts +11 -0
  10. package/dist/commands/agents/operating-plan.js +54 -0
  11. package/dist/commands/agents/roles/example.d.ts +11 -0
  12. package/dist/commands/agents/roles/example.js +30 -0
  13. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  14. package/dist/commands/agents/roles/export.js +81 -0
  15. package/dist/commands/agents/roles/install.d.ts +12 -0
  16. package/dist/commands/agents/roles/install.js +48 -0
  17. package/dist/commands/agents/roles/list.d.ts +11 -0
  18. package/dist/commands/agents/roles/list.js +36 -0
  19. package/dist/commands/agents/roles/preview.d.ts +14 -0
  20. package/dist/commands/agents/roles/preview.js +49 -0
  21. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  22. package/dist/commands/agents/roles/withdraw.js +43 -0
  23. package/dist/commands/agents/share.d.ts +27 -0
  24. package/dist/commands/agents/share.js +100 -0
  25. package/dist/commands/agents/vanity.d.ts +21 -0
  26. package/dist/commands/agents/vanity.js +77 -0
  27. package/dist/commands/agents/visibility.d.ts +21 -1
  28. package/dist/commands/agents/visibility.js +112 -0
  29. package/dist/commands/commands.d.ts +1 -0
  30. package/dist/commands/commands.js +22 -9
  31. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  32. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  33. package/dist/commands/commitments/cost.d.ts +1 -1
  34. package/dist/commands/commitments/cost.js +1 -1
  35. package/dist/commands/commitments/create.d.ts +0 -7
  36. package/dist/commands/commitments/create.js +9 -98
  37. package/dist/commands/commitments/delivery.js +3 -21
  38. package/dist/commands/commitments/doctor.js +28 -27
  39. package/dist/commands/commitments/effective-policy.js +5 -36
  40. package/dist/commands/commitments/evaluations.d.ts +15 -0
  41. package/dist/commands/commitments/evaluations.js +54 -0
  42. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  43. package/dist/commands/commitments/pack/activate.js +22 -0
  44. package/dist/commands/commitments/pack/bind.js +1 -1
  45. package/dist/commands/commitments/remediate.js +2 -5
  46. package/dist/commands/commitments/show.js +1 -1
  47. package/dist/commands/commitments/update.js +9 -9
  48. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  49. package/dist/commands/commitments/wake-capabilities.js +5 -21
  50. package/dist/commands/earnings/attributions.d.ts +17 -0
  51. package/dist/commands/earnings/attributions.js +82 -0
  52. package/dist/commands/earnings/index.js +2 -1
  53. package/dist/commands/generate-recovery-code.js +4 -3
  54. package/dist/commands/github/allow-tools.d.ts +1 -0
  55. package/dist/commands/github/app/install.d.ts +1 -0
  56. package/dist/commands/github/app/status.d.ts +1 -0
  57. package/dist/commands/github/connect.d.ts +1 -0
  58. package/dist/commands/github/connections.d.ts +1 -0
  59. package/dist/commands/github/disconnect.d.ts +1 -0
  60. package/dist/commands/github/finalize.d.ts +1 -0
  61. package/dist/commands/github/reconnect.d.ts +1 -0
  62. package/dist/commands/github/run.d.ts +1 -0
  63. package/dist/commands/github/tools.d.ts +1 -0
  64. package/dist/commands/integrations/connections/connect.d.ts +1 -0
  65. package/dist/commands/integrations/connections/disconnect.d.ts +1 -0
  66. package/dist/commands/integrations/connections/finalize.d.ts +1 -0
  67. package/dist/commands/integrations/connections/list.d.ts +1 -0
  68. package/dist/commands/integrations/connections/reconnect.d.ts +1 -0
  69. package/dist/commands/integrations/execute.d.ts +1 -0
  70. package/dist/commands/integrations/search.d.ts +1 -0
  71. package/dist/commands/integrations/toolkits.d.ts +1 -0
  72. package/dist/commands/integrations/tools/allow.d.ts +1 -0
  73. package/dist/commands/integrations/tools/list.d.ts +1 -0
  74. package/dist/commands/login.js +12 -0
  75. package/dist/commands/machines/dedicated/logs.d.ts +19 -0
  76. package/dist/commands/machines/dedicated/logs.js +103 -0
  77. package/dist/commands/machines/dedicated/power/set.js +1 -1
  78. package/dist/commands/open.d.ts +24 -0
  79. package/dist/commands/open.js +74 -0
  80. package/dist/commands/projects/archive.d.ts +1 -0
  81. package/dist/commands/projects/archive.js +23 -0
  82. package/dist/commands/projects/delete.d.ts +1 -0
  83. package/dist/commands/projects/delete.js +23 -0
  84. package/dist/commands/projects/list.d.ts +3 -0
  85. package/dist/commands/projects/list.js +12 -2
  86. package/dist/commands/spaces/actions/add.js +4 -3
  87. package/dist/commands/spaces/actions/available.js +3 -2
  88. package/dist/commands/spaces/actions/list.js +5 -4
  89. package/dist/commands/spaces/actions/replace.js +6 -5
  90. package/dist/commands/spaces/archive.js +3 -2
  91. package/dist/commands/spaces/auto-executor/preview.js +4 -3
  92. package/dist/commands/spaces/auto-executor/run.js +4 -3
  93. package/dist/commands/spaces/auto-executor/runs.js +3 -2
  94. package/dist/commands/spaces/auto-executor/update.js +4 -3
  95. package/dist/commands/spaces/bootstrap.js +3 -2
  96. package/dist/commands/spaces/briefs/delete.js +3 -2
  97. package/dist/commands/spaces/briefs/get.js +3 -2
  98. package/dist/commands/spaces/briefs/list.js +3 -2
  99. package/dist/commands/spaces/briefs/set.js +5 -4
  100. package/dist/commands/spaces/capacity.js +5 -4
  101. package/dist/commands/spaces/conversations.js +3 -2
  102. package/dist/commands/spaces/cycles/create.js +3 -2
  103. package/dist/commands/spaces/cycles/graph.js +2 -1
  104. package/dist/commands/spaces/cycles/list.js +3 -2
  105. package/dist/commands/spaces/cycles/settings.js +4 -3
  106. package/dist/commands/spaces/cycles/show.js +3 -2
  107. package/dist/commands/spaces/cycles/update.js +3 -2
  108. package/dist/commands/spaces/delete.js +4 -3
  109. package/dist/commands/spaces/expertise-suggestions.js +4 -3
  110. package/dist/commands/spaces/files/delete.js +3 -2
  111. package/dist/commands/spaces/files/folders/create.js +3 -2
  112. package/dist/commands/spaces/files/folders/delete.js +3 -2
  113. package/dist/commands/spaces/files/folders/list.js +3 -2
  114. package/dist/commands/spaces/files/folders/update.js +3 -2
  115. package/dist/commands/spaces/files/list.js +3 -2
  116. package/dist/commands/spaces/files/move.js +3 -2
  117. package/dist/commands/spaces/files/rename.js +3 -2
  118. package/dist/commands/spaces/files/upload.js +6 -5
  119. package/dist/commands/spaces/github-automations/set.js +3 -2
  120. package/dist/commands/spaces/github-automations/show.js +3 -2
  121. package/dist/commands/spaces/goals.js +2 -1
  122. package/dist/commands/spaces/heartbeats/create.js +4 -3
  123. package/dist/commands/spaces/heartbeats/delete.js +4 -3
  124. package/dist/commands/spaces/heartbeats/list.js +4 -3
  125. package/dist/commands/spaces/heartbeats/status.js +3 -2
  126. package/dist/commands/spaces/heartbeats/update.js +4 -3
  127. package/dist/commands/spaces/insights.js +5 -4
  128. package/dist/commands/spaces/labels/add.js +4 -3
  129. package/dist/commands/spaces/labels/list.js +2 -1
  130. package/dist/commands/spaces/labels/remove.js +4 -3
  131. package/dist/commands/spaces/list.d.ts +3 -0
  132. package/dist/commands/spaces/list.js +11 -2
  133. package/dist/commands/spaces/live/cards/create.js +3 -2
  134. package/dist/commands/spaces/live/cards/list.js +3 -2
  135. package/dist/commands/spaces/live/cards/reorder.js +7 -2
  136. package/dist/commands/spaces/live/scene.js +4 -3
  137. package/dist/commands/spaces/members/add.js +7 -6
  138. package/dist/commands/spaces/members/list.js +4 -3
  139. package/dist/commands/spaces/members/remove.js +7 -6
  140. package/dist/commands/spaces/move.js +3 -2
  141. package/dist/commands/spaces/pin.js +5 -4
  142. package/dist/commands/spaces/preferences/show.js +4 -3
  143. package/dist/commands/spaces/preferences/tabs.js +4 -3
  144. package/dist/commands/spaces/revisions.js +3 -2
  145. package/dist/commands/spaces/room/ensure.js +5 -4
  146. package/dist/commands/spaces/room/messages.js +3 -2
  147. package/dist/commands/spaces/room/show.js +5 -4
  148. package/dist/commands/spaces/skills/add.js +4 -3
  149. package/dist/commands/spaces/skills/list.js +3 -2
  150. package/dist/commands/spaces/skills/pin.js +4 -3
  151. package/dist/commands/spaces/skills/remove.js +4 -3
  152. package/dist/commands/spaces/snapshot.js +3 -2
  153. package/dist/commands/spaces/states/archive.js +3 -2
  154. package/dist/commands/spaces/states/create.js +3 -2
  155. package/dist/commands/spaces/states/list.js +3 -2
  156. package/dist/commands/spaces/states/reorder.js +2 -1
  157. package/dist/commands/spaces/states/update.js +3 -2
  158. package/dist/commands/spaces/summary.js +4 -3
  159. package/dist/commands/spaces/tasks.d.ts +3 -0
  160. package/dist/commands/spaces/tasks.js +14 -3
  161. package/dist/commands/spaces/triggers/delete.js +5 -4
  162. package/dist/commands/spaces/triggers/set.js +4 -3
  163. package/dist/commands/spaces/triggers/show.js +4 -3
  164. package/dist/commands/spaces/unarchive.js +3 -2
  165. package/dist/commands/spaces/update.js +5 -4
  166. package/dist/commands/spaces/views/create.js +3 -2
  167. package/dist/commands/spaces/views/list.js +3 -2
  168. package/dist/commands/spaces/views/reorder.js +6 -3
  169. package/dist/commands/spaces/views/subscribe.js +2 -1
  170. package/dist/commands/spaces/views/subscriptions.js +1 -0
  171. package/dist/commands/spaces/views/unsubscribe.js +2 -1
  172. package/dist/commands/spaces/widgets/add.js +4 -3
  173. package/dist/commands/spaces/widgets/list.js +3 -2
  174. package/dist/commands/spaces/widgets/remove.js +5 -4
  175. package/dist/commands/spaces/work-graph.js +2 -1
  176. package/dist/commands/store/install.d.ts +1 -1
  177. package/dist/commands/store/install.js +24 -8
  178. package/dist/commands/store/show.d.ts +25 -0
  179. package/dist/commands/store/show.js +203 -0
  180. package/dist/commands/store/stats.d.ts +33 -0
  181. package/dist/commands/store/stats.js +258 -0
  182. package/dist/commands/tasks/actions/attach.js +1 -1
  183. package/dist/commands/tasks/actions/detach.js +4 -3
  184. package/dist/commands/tasks/activity.js +3 -2
  185. package/dist/commands/tasks/ancestors.js +2 -1
  186. package/dist/commands/tasks/approvals/create.js +2 -1
  187. package/dist/commands/tasks/approvals/delete.js +3 -2
  188. package/dist/commands/tasks/approvals/list.js +5 -4
  189. package/dist/commands/tasks/approvals/resolve.js +2 -1
  190. package/dist/commands/tasks/archive.js +3 -2
  191. package/dist/commands/tasks/assign.js +4 -3
  192. package/dist/commands/tasks/attachments/delete.js +3 -2
  193. package/dist/commands/tasks/attachments/download.d.ts +1 -0
  194. package/dist/commands/tasks/attachments/download.js +20 -1
  195. package/dist/commands/tasks/attachments/list.js +2 -1
  196. package/dist/commands/tasks/attachments/set-role.js +2 -1
  197. package/dist/commands/tasks/attachments/upload.js +2 -1
  198. package/dist/commands/tasks/bulk-update.d.ts +1 -0
  199. package/dist/commands/tasks/bulk-update.js +106 -15
  200. package/dist/commands/tasks/cancel-cascade.d.ts +1 -0
  201. package/dist/commands/tasks/cancel-cascade.js +13 -3
  202. package/dist/commands/tasks/cascade-status.js +2 -1
  203. package/dist/commands/tasks/checkout.js +3 -2
  204. package/dist/commands/tasks/children.js +2 -1
  205. package/dist/commands/tasks/comments/add.js +7 -6
  206. package/dist/commands/tasks/comments/anchor.js +8 -7
  207. package/dist/commands/tasks/comments/delete.js +3 -2
  208. package/dist/commands/tasks/comments/list.js +2 -1
  209. package/dist/commands/tasks/comments/reopen.js +3 -2
  210. package/dist/commands/tasks/comments/resolve.js +3 -2
  211. package/dist/commands/tasks/create-tree.d.ts +63 -0
  212. package/dist/commands/tasks/create-tree.js +197 -4
  213. package/dist/commands/tasks/delete.js +5 -4
  214. package/dist/commands/tasks/descendants.js +2 -1
  215. package/dist/commands/tasks/dri-plan.js +3 -2
  216. package/dist/commands/tasks/dri-run.js +3 -2
  217. package/dist/commands/tasks/dri-status.js +2 -1
  218. package/dist/commands/tasks/duplicate-pipeline.js +2 -1
  219. package/dist/commands/tasks/execution-summary.js +2 -1
  220. package/dist/commands/tasks/execution-timeline.js +2 -1
  221. package/dist/commands/tasks/fork.js +1 -0
  222. package/dist/commands/tasks/forward.js +4 -3
  223. package/dist/commands/tasks/handover.js +1 -0
  224. package/dist/commands/tasks/interrupt.js +3 -2
  225. package/dist/commands/tasks/labels/attach.js +4 -3
  226. package/dist/commands/tasks/labels/detach.js +4 -3
  227. package/dist/commands/tasks/labels/suggest.js +5 -4
  228. package/dist/commands/tasks/list.d.ts +27 -1
  229. package/dist/commands/tasks/list.js +101 -3
  230. package/dist/commands/tasks/move.js +4 -3
  231. package/dist/commands/tasks/output.js +6 -5
  232. package/dist/commands/tasks/pause-schedule.js +3 -2
  233. package/dist/commands/tasks/promote.js +1 -0
  234. package/dist/commands/tasks/prompt-log.js +2 -1
  235. package/dist/commands/tasks/release.js +5 -4
  236. package/dist/commands/tasks/remind.js +2 -1
  237. package/dist/commands/tasks/replay.js +3 -2
  238. package/dist/commands/tasks/report.js +1 -0
  239. package/dist/commands/tasks/resume-schedule.js +3 -2
  240. package/dist/commands/tasks/retry-schedule.js +3 -2
  241. package/dist/commands/tasks/retry.js +10 -9
  242. package/dist/commands/tasks/revisions.js +2 -1
  243. package/dist/commands/tasks/runs.js +6 -5
  244. package/dist/commands/tasks/schedule.js +3 -2
  245. package/dist/commands/tasks/self-schedule.js +6 -5
  246. package/dist/commands/tasks/skills/pin.js +3 -2
  247. package/dist/commands/tasks/skills/unpin.js +3 -2
  248. package/dist/commands/tasks/snooze.js +6 -5
  249. package/dist/commands/tasks/start-all.js +5 -4
  250. package/dist/commands/tasks/subscribe.js +1 -0
  251. package/dist/commands/tasks/tags/add.js +4 -3
  252. package/dist/commands/tasks/tags/remove.js +4 -3
  253. package/dist/commands/tasks/timeline.js +3 -2
  254. package/dist/commands/tasks/today.d.ts +4 -1
  255. package/dist/commands/tasks/today.js +12 -2
  256. package/dist/commands/tasks/transcript.js +6 -5
  257. package/dist/commands/tasks/unschedule.js +3 -2
  258. package/dist/commands/tasks/unsnooze.js +3 -2
  259. package/dist/commands/tasks/unsubscribe.js +2 -1
  260. package/dist/commands/tasks/update.js +5 -4
  261. package/dist/commands/tasks/wait.js +5 -4
  262. package/dist/lib/agent-distribution.d.ts +37 -0
  263. package/dist/lib/agent-distribution.js +63 -0
  264. package/dist/lib/agent-ref.d.ts +69 -0
  265. package/dist/lib/agent-ref.js +168 -0
  266. package/dist/lib/api-fetch.d.ts +2 -0
  267. package/dist/lib/api-fetch.js +14 -3
  268. package/dist/lib/command-hygiene.d.ts +13 -0
  269. package/dist/lib/command-hygiene.js +62 -2
  270. package/dist/lib/commitment-product.d.ts +0 -6
  271. package/dist/lib/commitment-product.js +1 -30
  272. package/dist/lib/commitments.d.ts +9 -45
  273. package/dist/lib/commitments.js +24 -95
  274. package/dist/lib/dedicated-power.d.ts +5 -0
  275. package/dist/lib/dedicated-power.js +30 -2
  276. package/dist/lib/dry-run-plans.d.ts +50 -0
  277. package/dist/lib/dry-run-plans.js +85 -0
  278. package/dist/lib/json-output.d.ts +31 -0
  279. package/dist/lib/json-output.js +78 -0
  280. package/dist/lib/list-output.d.ts +75 -0
  281. package/dist/lib/list-output.js +266 -0
  282. package/dist/lib/machine-daemon-log.d.ts +36 -0
  283. package/dist/lib/machine-daemon-log.js +78 -0
  284. package/dist/lib/node-adapter.js +10 -1
  285. package/dist/lib/northstars.js +1 -1
  286. package/dist/lib/open-target.d.ts +12 -0
  287. package/dist/lib/open-target.js +108 -0
  288. package/dist/lib/rate-limit-retry.d.ts +45 -0
  289. package/dist/lib/rate-limit-retry.js +88 -0
  290. package/dist/lib/roles.d.ts +98 -0
  291. package/dist/lib/roles.js +45 -0
  292. package/dist/lib/store-listing.d.ts +45 -0
  293. package/dist/lib/store-listing.js +186 -0
  294. package/dist/lib/task-batch.d.ts +67 -0
  295. package/dist/lib/task-batch.js +227 -0
  296. package/dist/lib/terminal-qr.d.ts +55 -0
  297. package/dist/lib/terminal-qr.js +119 -0
  298. package/dist/lib/web-url.d.ts +11 -0
  299. package/dist/lib/web-url.js +24 -0
  300. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  301. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  302. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +68 -0
  303. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -1
  304. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  305. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  306. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  307. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  308. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +68 -0
  309. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +46 -0
  310. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  311. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  312. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  313. package/dist/node_modules/@skrr-ai/data-provider/index.js +7285 -6673
  314. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  315. package/oclif.manifest.json +35937 -26820
  316. package/package.json +6 -2
  317. package/dist/commands/commitments/autonomy.d.ts +0 -30
  318. package/dist/commands/commitments/autonomy.js +0 -67
  319. package/dist/commands/commitments/mode.js +0 -58
  320. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  321. package/dist/commands/commitments/pack/promote.js +0 -46
  322. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  323. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMMITMENT_CLI_EVALUATORS = exports.COMMITMENT_CREATE_KEYS = exports.COMMITMENT_REMEDIATION_ACTIONS = exports.COMMITMENT_FEEDBACK_KINDS = exports.commitmentApi = exports.commitmentPackApi = exports.MAX_COMMITMENT_INTERVAL_MS = exports.MIN_COMMITMENT_INTERVAL_MS = exports.COMMITMENT_EXECUTION_ISOLATION_MODES = exports.COMMITMENT_AUTHORABLE_AUTONOMY_MODES = exports.COMMITMENT_AUTONOMY_MODES = exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = exports.COMMITMENT_KIND_VALUES = exports.COMMITMENT_STATUSES = exports.COMMITMENT_CADENCE_MAX_TIMES = exports.COMMITMENT_CADENCE_TIME_PATTERN = exports.COMMITMENT_CADENCE_MODES = exports.COMMITMENT_TEMPLATE_IDS = exports.COMMITMENT_WATCHED_SOURCES = void 0;
4
- exports.storedAutonomyModeForAuthoring = storedAutonomyModeForAuthoring;
5
- exports.authoringAutonomyModeForStored = authoringAutonomyModeForStored;
6
- exports.commitmentAutonomyLabel = commitmentAutonomyLabel;
3
+ exports.COMMITMENT_CLI_EVALUATORS = exports.COMMITMENT_CREATE_KEYS = exports.COMMITMENT_REMEDIATION_ACTIONS = exports.COMMITMENT_FEEDBACK_KINDS = exports.commitmentApi = exports.commitmentPackApi = exports.MAX_COMMITMENT_INTERVAL_MS = exports.MIN_COMMITMENT_INTERVAL_MS = exports.COMMITMENT_EXECUTION_ISOLATION_MODES = exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = exports.COMMITMENT_KIND_VALUES = exports.COMMITMENT_STATUSES = exports.COMMITMENT_CADENCE_MAX_TIMES = exports.COMMITMENT_CADENCE_TIME_PATTERN = exports.COMMITMENT_CADENCE_MODES = exports.COMMITMENT_TEMPLATE_IDS = exports.COMMITMENT_WATCHED_SOURCES = void 0;
7
4
  exports.permissionLines = permissionLines;
8
5
  exports.retiredFieldsLine = retiredFieldsLine;
9
6
  exports.readCommitmentAgentDirective = readCommitmentAgentDirective;
@@ -19,9 +16,7 @@ exports.describeIntervalMs = describeIntervalMs;
19
16
  exports.buildSuccessCriteria = buildSuccessCriteria;
20
17
  exports.cadenceLabel = cadenceLabel;
21
18
  exports.renderCommitmentList = renderCommitmentList;
22
- exports.effectiveAutonomyMode = effectiveAutonomyMode;
23
19
  exports.extractStandstillFromCheck = extractStandstillFromCheck;
24
- exports.describeAutonomyLine = describeAutonomyLine;
25
20
  exports.describeExecutorBlocked = describeExecutorBlocked;
26
21
  exports.renderCommitmentSummary = renderCommitmentSummary;
27
22
  exports.describeWakeDecision = describeWakeDecision;
@@ -63,7 +58,6 @@ Object.defineProperty(exports, "COMMITMENT_TEMPLATE_IDS", { enumerable: true, ge
63
58
  Object.defineProperty(exports, "COMMITMENT_CADENCE_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_MODES; } });
64
59
  Object.defineProperty(exports, "COMMITMENT_CADENCE_TIME_PATTERN", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_TIME_PATTERN; } });
65
60
  Object.defineProperty(exports, "COMMITMENT_CADENCE_MAX_TIMES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_CADENCE_MAX_TIMES; } });
66
- Object.defineProperty(exports, "COMMITMENT_AUTONOMY_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_AUTONOMY_MODES; } });
67
61
  Object.defineProperty(exports, "COMMITMENT_EXECUTION_ISOLATION_MODES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_EXECUTION_ISOLATION_MODES; } });
68
62
  Object.defineProperty(exports, "COMMITMENT_STATUSES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_STATUSES; } });
69
63
  Object.defineProperty(exports, "COMMITMENT_KIND_VALUES", { enumerable: true, get: function () { return data_provider_1.COMMITMENT_KIND_VALUES; } });
@@ -74,34 +68,6 @@ const triggers_1 = require("./triggers");
74
68
  /** Derived from the installed compatibility vocabulary so the CLI remains
75
69
  * safe even while data-provider and CLI packages roll out separately. */
76
70
  exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = data_provider_1.COMMITMENT_CADENCE_MODES.filter((mode) => mode !== 'sampled');
77
- exports.COMMITMENT_AUTHORABLE_AUTONOMY_MODES = ['monitor', 'prepare', 'execute'];
78
- function storedAutonomyModeForAuthoring(mode) {
79
- if (mode === 'monitor')
80
- return 'suggestions_only';
81
- if (mode === 'prepare')
82
- return 'ask_first';
83
- if (mode === 'execute')
84
- return 'auto_run';
85
- throw new Error(`Unsupported autonomy mode: ${mode}. Use monitor, prepare, or execute.`);
86
- }
87
- function authoringAutonomyModeForStored(mode) {
88
- if (mode === 'ask_first')
89
- return 'prepare';
90
- if (mode === 'auto_run' || mode === 'auto_run_limited')
91
- return 'execute';
92
- return 'monitor';
93
- }
94
- function commitmentAutonomyLabel(mode) {
95
- if (mode === 'suggestions_only')
96
- return 'Monitor';
97
- if (mode === 'ask_first')
98
- return 'Prepare';
99
- if (mode === 'auto_run' || mode === 'auto_run_limited')
100
- return 'Execute';
101
- if (mode === 'off')
102
- return 'Legacy off (pause the Commitment)';
103
- return mode || '-';
104
- }
105
71
  /**
106
72
  * Interval bounds for `cadence.intervalMs`.
107
73
  *
@@ -151,8 +117,7 @@ exports.commitmentPackApi = {
151
117
  preflight: (id, nextRunCount) => data_provider_1.request.post(`${packBase(id)}/preflight`, {
152
118
  ...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
153
119
  }),
154
- shadow: (id) => data_provider_1.request.post(`${packBase(id)}/shadow`, {}),
155
- promote: (id) => data_provider_1.request.post(`${packBase(id)}/promote`, {}),
120
+ activate: (id) => data_provider_1.request.post(`${packBase(id)}/activate`, {}),
156
121
  };
157
122
  exports.commitmentApi = {
158
123
  /**
@@ -217,8 +182,6 @@ exports.commitmentApi = {
217
182
  pause: (id) => data_provider_1.request.post(`${base(id)}/pause`, {}),
218
183
  resume: (id) => data_provider_1.request.post(`${base(id)}/resume`, {}),
219
184
  complete: (id) => data_provider_1.request.post(`${base(id)}/complete`, {}),
220
- autonomy: (id, body) => data_provider_1.request.post(`${base(id)}/autonomy`, body),
221
- mode: (id, body) => data_provider_1.request.post(`${base(id)}/mode`, body),
222
185
  delivery: (id, body) => data_provider_1.request.post(`${base(id)}/delivery`, body),
223
186
  receipts: (id, query = 1) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/receipts`, typeof query === 'number' ? { limit: query } : query)),
224
187
  receiptQuarterlyMetrics: (id, year, quarter) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/receipt-metrics/quarterly`, { year, quarter })),
@@ -325,6 +288,9 @@ exports.commitmentApi = {
325
288
  * investigation of the same drift most needs answered before it starts.
326
289
  */
327
290
  hypotheses: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/hypotheses`, query)),
291
+ evaluations: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/evaluations`, query)),
292
+ createEvaluation: (id, body) => data_provider_1.request.post(`${base(id)}/evaluations`, body),
293
+ retryEvaluationLearning: (id, scheduleId) => data_provider_1.request.post(`${base(id)}/evaluations/${encodeURIComponent(scheduleId)}/retry-learning`, {}),
328
294
  observations: (id, query = {}) => data_provider_1.request.get((0, triggers_1.withQuery)(`${base(id)}/observations`, query)),
329
295
  /* ------------------------------------------------------------------------ *
330
296
  * Steering
@@ -334,7 +300,7 @@ exports.commitmentApi = {
334
300
  /** Bounded, named corrections — never a free-form contract edit. */
335
301
  remediate: (id, body) => data_provider_1.request.post(`${base(id)}/remediation`, body),
336
302
  /** Approve/reject an Agent-proposed cadence change the server parked. */
337
- decideAutonomyRequest: (id, requestId, approved) => data_provider_1.request.post(`${base(id)}/autonomy-requests/${encodeURIComponent(requestId)}/decision`, {
303
+ decideCadenceRequest: (id, requestId, approved) => data_provider_1.request.post(`${base(id)}/cadence-requests/${encodeURIComponent(requestId)}/decision`, {
338
304
  approved,
339
305
  }),
340
306
  linkGoal: (id, goalId) => data_provider_1.request.put(`${base(id)}/goals/${encodeURIComponent(goalId)}`, {}),
@@ -351,7 +317,6 @@ exports.COMMITMENT_REMEDIATION_ACTIONS = [
351
317
  'pause_commitment',
352
318
  'mute_user_nudges',
353
319
  'reduce_nudge_frequency',
354
- 'tighten_policy',
355
320
  'mark_noop',
356
321
  ];
357
322
  /** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
@@ -427,8 +392,8 @@ function parseCommitmentConcurrencyLimit(input) {
427
392
  if (['unlimited', 'unbounded', 'none', 'null'].includes(raw))
428
393
  return null;
429
394
  const value = Number(raw);
430
- if (!Number.isSafeInteger(value) || value < 1 || value > 100) {
431
- throw new Error('--max-concurrent-runs must be "unlimited" or an integer from 1 to 100.');
395
+ if (!Number.isSafeInteger(value) || value < 0 || value > 100) {
396
+ throw new Error('--max-concurrent-runs must be "unlimited" or an integer from 0 to 100.');
432
397
  }
433
398
  return value;
434
399
  }
@@ -453,7 +418,7 @@ function commitmentConcurrencyEnvelopePatch({ rawValue, reason, autonomous = pro
453
418
  };
454
419
  }
455
420
  function describeCommitmentConcurrency(commitment) {
456
- const envelope = commitment.policy?.autonomyEnvelope;
421
+ const envelope = commitment.policy?.executionBudget;
457
422
  const limit = envelope?.maxConcurrentRuns;
458
423
  const decision = envelope?.maxConcurrentRunsDecision;
459
424
  if (limit == null) {
@@ -671,7 +636,7 @@ const STALLED_DIAGNOSES = {
671
636
  * no diagnosis to name.
672
637
  */
673
638
  function describeStalledHealth(commitment) {
674
- if (commitment.state?.health !== 'stalled')
639
+ if (!['blocked', 'failed'].includes(commitment.assessment?.operation || ''))
675
640
  return undefined;
676
641
  const liveness = (commitment.state?.liveness || {});
677
642
  const kind = typeof liveness.diagnosisKind === 'string' ? liveness.diagnosisKind : undefined;
@@ -777,16 +742,18 @@ function renderCommitmentList(commitments, log) {
777
742
  id: o.id ?? '-',
778
743
  title: o.title ?? '-',
779
744
  status: o.status ?? '-',
780
- health: o.state?.health ?? '-',
745
+ outcome: o.assessment?.label ?? 'Unknown',
746
+ evidence: o.assessment?.evidence ?? 'unavailable',
747
+ operation: o.assessment?.operation ?? 'blocked',
781
748
  cadence: cadenceLabel(o),
782
- autonomy: (0, commitment_product_1.productModeLabel)(o.policy?.autonomyMode),
783
749
  agent: o.agentId ?? '-',
784
750
  })), [
785
751
  { key: 'title', header: 'TITLE', maxWidth: 34 },
786
752
  { key: 'status', header: 'STATUS', maxWidth: 10 },
787
- { key: 'health', header: 'HEALTH', maxWidth: 16 },
753
+ { key: 'outcome', header: 'OUTCOME', maxWidth: 16 },
754
+ { key: 'evidence', header: 'EVIDENCE', maxWidth: 14 },
755
+ { key: 'operation', header: 'OPERATION', maxWidth: 12 },
788
756
  { key: 'cadence', header: 'CADENCE', maxWidth: 10 },
789
- { key: 'autonomy', header: 'MODE', maxWidth: 18 },
790
757
  { key: 'agent', header: 'AGENT', verbatim: true },
791
758
  // Commitment ids are routinely pasted into `check-now`, so this column
792
759
  // is never clipped. Widening the guess (28 → 44) fixed today's
@@ -794,32 +761,6 @@ function renderCommitmentList(commitments, log) {
794
761
  { key: 'id', header: 'ID', verbatim: true },
795
762
  ], log);
796
763
  }
797
- /**
798
- * The autonomy mode a check ACTUALLY ran at, read from its policy trace
799
- * (OSK-4881).
800
- *
801
- * A check records the Mode it actually used in `decision.policyTrace`. For the
802
- * v2 product contract, only an explicit Workspace-admin constraint may lower
803
- * the declared Mode; legacy checks may still carry older effective-mode traces.
804
- * Either `autonomyMode` or `effectiveAutonomyMode` answers what governed that
805
- * particular run. Returns undefined when the trace carries neither.
806
- *
807
- * Exported for tests.
808
- */
809
- function effectiveAutonomyMode(check) {
810
- const trace = check?.decision?.policyTrace;
811
- if (!Array.isArray(trace))
812
- return undefined;
813
- for (const entry of trace) {
814
- if (!entry || typeof entry !== 'object')
815
- continue;
816
- const e = entry;
817
- const mode = e.autonomyMode ?? e.effectiveAutonomyMode;
818
- if (typeof mode === 'string' && mode.length)
819
- return mode;
820
- }
821
- return undefined;
822
- }
823
764
  /**
824
765
  * A `commitment_standstill` policyTrace entry, extracted from the latest
825
766
  * check's decision. The arbiter appends it whenever a quiet posture is the
@@ -864,14 +805,6 @@ function extractStandstillFromCheck(check) {
864
805
  *
865
806
  * Exported for tests.
866
807
  */
867
- function describeAutonomyLine(commitment, latestCheck) {
868
- const stated = commitment.policy?.autonomyMode ?? '-';
869
- const effective = effectiveAutonomyMode(latestCheck);
870
- if (effective && effective !== stated) {
871
- return `${(0, commitment_product_1.productModeLabel)(stated)} (effective: ${(0, commitment_product_1.productModeLabel)(effective)} — constrained by configured policy)`;
872
- }
873
- return (0, commitment_product_1.productModeLabel)(stated);
874
- }
875
808
  /**
876
809
  * One-line rendering of `commitment.executorBlocked` — the B4/A7 signal that
877
810
  * the executor's targets are all unusable: `{reason:'quota'|'offline'|'waiting_for_machine', until?,
@@ -927,21 +860,17 @@ latestCheck) {
927
860
  if (commitment.target?.deadlineAt)
928
861
  log(`Deadline: ${commitment.target.deadlineAt}`);
929
862
  log(`Cadence: ${cadenceLabel(commitment)}`);
930
- log(`Mode: ${describeAutonomyLine(commitment, latestCheck)}`);
931
863
  log(`Delivery: ${(0, commitment_product_1.deliveryLabel)(commitment.delivery?.mode)}${commitment.delivery?.repo ? ` · ${commitment.delivery.repo}` : ''}${commitment.delivery?.baseBranch ? ` → ${commitment.delivery.baseBranch}` : ''}`);
932
864
  log(`Concurrency: ${describeCommitmentConcurrency(commitment)}`);
933
865
  const criteria = commitment.target?.successCriteria || [];
934
866
  const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
935
867
  const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
936
- const health = commitment.state?.health ?? 'unknown';
937
- const unevidenceableExplanation = health === 'unknown' && evidenceHealth?.state === 'unevidenceable_criteria'
938
- ? ' — evidence cannot establish a positive health verdict as configured'
939
- : '';
940
- // The two explanations are mutually exclusive by construction: one only fires
941
- // on `unknown`, the other only on `stalled`.
942
- const stalledExplanation = describeStalledHealth(commitment);
943
- const healthExplanation = unevidenceableExplanation || (stalledExplanation ? ` — ${stalledExplanation}` : '');
944
- log(`Health: ${health}${healthExplanation}`);
868
+ const assessment = commitment.assessment
869
+ ? (0, data_provider_1.readCommitmentAssessment)(commitment.assessment)
870
+ : undefined;
871
+ log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
872
+ log(`Evidence: ${assessment?.evidence ?? 'unavailable'}`);
873
+ log(`Operation: ${assessment?.operation ?? 'blocked'}${assessment?.operationReason ? ` — ${assessment.operationReason}` : ''}`);
945
874
  if (commitment.state?.lastCheckedAt)
946
875
  log(`Checked: ${commitment.state.lastCheckedAt}`);
947
876
  if (typeof commitment.state?.consecutiveUnresolvedChecks === 'number') {
@@ -1016,8 +945,8 @@ const INVOCATION_SKIP_REASONS = {
1016
945
  state_watch_intact: 'watch intact',
1017
946
  // NAMES THE ENVELOPE, not "autonomy", because they are different fields.
1018
947
  //
1019
- // The server sets this code from `autonomyEnvelope.enabled !== true`
1020
- // (`WakeIntentResolver.js:35`, `CommitmentAutonomyService.js:12`). It was
948
+ // The server sets this code from `executionBudget.enabled !== true`
949
+ // (`WakeIntentResolver.js:35`, `CommitmentCadenceService.js:12`). It was
1021
950
  // rendered as "autonomy off", which a reader maps onto `policy.autonomyMode`
1022
951
  // — the field the CLI prints as `Autonomy:` and the one `commitments autonomy`
1023
952
  // sets. So a commitment sitting at `suggestions_only` reported "autonomy off",
@@ -63,6 +63,11 @@ export declare function describeLastAutoStopLines(last: DedicatedRuntimePowerSum
63
63
  };
64
64
  /** The latest wake decision and who asked, as lines; empty when there is none. */
65
65
  export declare function describeLastWakeDecisionLines(wake: DedicatedRuntimePowerSummary['lastWakeDecision'], when?: WhenOptions): string[];
66
+ /**
67
+ * The announced-but-not-yet-done stop, in the shared words (`describePendingStop`). Empty when the
68
+ * summary carries none, which is also what an older server sends: absent is not "no stop coming".
69
+ */
70
+ export declare function describePendingStopLines(summary: Pick<DedicatedRuntimePowerSummary, 'leaseId' | 'pendingStop'>, when?: WhenOptions): string[];
66
71
  /** The lines of `power show`. */
67
72
  export declare function describePowerSummary(summary: DedicatedRuntimePowerSummary, when?: WhenOptions): string[];
68
73
  /** The lines of `power explain`; the fix is always last. */
@@ -12,6 +12,7 @@ exports.describePrewarm = describePrewarm;
12
12
  exports.describePowerDecisionLines = describePowerDecisionLines;
13
13
  exports.describeLastAutoStopLines = describeLastAutoStopLines;
14
14
  exports.describeLastWakeDecisionLines = describeLastWakeDecisionLines;
15
+ exports.describePendingStopLines = describePendingStopLines;
15
16
  exports.describePowerSummary = describePowerSummary;
16
17
  exports.describePowerExplanation = describePowerExplanation;
17
18
  exports.describeBudget = describeBudget;
@@ -50,7 +51,7 @@ async function setDedicatedPowerPolicy(leaseId, request, scope = {}) {
50
51
  return {
51
52
  ok: false,
52
53
  refusal: {
53
- error: String(body.error ?? 'on_demand is not available for this machine yet.'),
54
+ error: String(body.error ?? 'On demand is not available for this machine yet.'),
54
55
  code: 'ON_DEMAND_INELIGIBLE',
55
56
  reason: reason,
56
57
  detail: String(body.detail ?? copy?.detail ?? ''),
@@ -204,7 +205,10 @@ function describePrewarm(prewarm, when = {}) {
204
205
  function describePowerDecisionLines(decision) {
205
206
  const copy = (0, data_provider_1.describePowerReason)(decision.reason);
206
207
  const VERBS = { stay: 'Staying on', stop: 'Stopped', wake: 'Wake' };
207
- const verb = VERBS[decision.question] ?? decision.question;
208
+ // `stop_scheduled` answers the stop question for a machine that is still running.
209
+ const verb = decision.reason === 'stop_scheduled'
210
+ ? 'Scheduled to stop'
211
+ : (VERBS[decision.question] ?? decision.question);
208
212
  return {
209
213
  // The headline is the human label only; the reason token lives in `--json` and `power explain`.
210
214
  // With no shared copy and no server detail there is no sentence, so the token is the last resort.
@@ -275,6 +279,28 @@ function describeLastWakeDecisionLines(wake, when = {}) {
275
279
  lines.push(` ${wake.fix}`);
276
280
  return lines;
277
281
  }
282
+ /** What the Keep awake offered by the stop notice means in the CLI: two hours. */
283
+ const PENDING_STOP_KEEP_AWAKE_HOURS = 2;
284
+ /**
285
+ * The announced-but-not-yet-done stop, in the shared words (`describePendingStop`). Empty when the
286
+ * summary carries none, which is also what an older server sends: absent is not "no stop coming".
287
+ */
288
+ function describePendingStopLines(summary, when = {}) {
289
+ const pending = summary.pendingStop;
290
+ if (!pending)
291
+ return [];
292
+ const words = (0, data_provider_1.describePendingStop)(pending, {
293
+ nowMs: (when.now ?? new Date()).getTime(),
294
+ when: (0, format_1.formatWhen)(pending.stopsAt, when),
295
+ capWhen: pending.unreachableStopsAt ? (0, format_1.formatWhen)(pending.unreachableStopsAt, when) : null,
296
+ keepAwakeHours: PENDING_STOP_KEEP_AWAKE_HOURS,
297
+ });
298
+ const lines = [`Stop: ${words.headline}`];
299
+ if (words.detail)
300
+ lines.push(` ${words.detail}`);
301
+ lines.push(` ${words.fix} skrr machines dedicated power keep-awake ${summary.leaseId} --for ${PENDING_STOP_KEEP_AWAKE_HOURS}h`);
302
+ return lines;
303
+ }
278
304
  /** The lines of `power show`. */
279
305
  function describePowerSummary(summary, when = {}) {
280
306
  const { power } = summary;
@@ -303,6 +329,7 @@ function describePowerSummary(summary, when = {}) {
303
329
  lines.push('Decision: nothing to explain for this state');
304
330
  }
305
331
  }
332
+ lines.push(...describePendingStopLines(summary, when));
306
333
  lines.push(...describeLastAutoStopLines(summary.lastAutoStop, summary.decision?.detail, when).lines);
307
334
  lines.push(...describeLastWakeDecisionLines(summary.lastWakeDecision, when));
308
335
  if (summary.holders === null) {
@@ -347,6 +374,7 @@ function describePowerExplanation(summary, when = {}) {
347
374
  lines.push(`At: ${(0, format_1.formatWhen)(d.at, when)}`);
348
375
  if (text.detail)
349
376
  lines.push(`Detail: ${text.detail}`);
377
+ lines.push(...describePendingStopLines(summary, when));
350
378
  const stop = describeLastAutoStopLines(summary.lastAutoStop, d.detail, when);
351
379
  lines.push(...stop.lines);
352
380
  lines.push(...wakeLines);
@@ -0,0 +1,50 @@
1
+ type Row = Record<string, unknown>;
2
+ export type ProjectAction = 'archive' | 'unarchive' | 'delete';
3
+ export declare function planProjectChange(action: ProjectAction, project: Row, projectRef: string): {
4
+ object: string;
5
+ source: string;
6
+ ok: boolean;
7
+ action: ProjectAction;
8
+ project: {
9
+ id: unknown;
10
+ ref: {};
11
+ title: unknown;
12
+ archived: boolean;
13
+ };
14
+ changes: {
15
+ deletesProject: boolean;
16
+ detachedTasksEstimate: number | null;
17
+ reversible: boolean;
18
+ archived?: undefined;
19
+ } | {
20
+ archived: boolean;
21
+ reversible: boolean;
22
+ deletesProject?: undefined;
23
+ detachedTasksEstimate?: undefined;
24
+ };
25
+ errors: string[];
26
+ notes: string[];
27
+ };
28
+ export type BulkUpdateInput = {
29
+ id: string;
30
+ patch: Row;
31
+ };
32
+ export declare function planBulkUpdate(updates: BulkUpdateInput[], currentById: Record<string, Row | null | undefined>, failedReads?: Record<string, string>): {
33
+ object: string;
34
+ source: string;
35
+ ok: boolean;
36
+ requested: number;
37
+ wouldChange: number;
38
+ invalid: number;
39
+ results: {
40
+ id: string;
41
+ ok: boolean;
42
+ changes: Record<string, {
43
+ from: unknown;
44
+ to: unknown;
45
+ }>;
46
+ noop: boolean;
47
+ errors: string[];
48
+ }[];
49
+ };
50
+ export {};
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.planProjectChange = planProjectChange;
4
+ exports.planBulkUpdate = planBulkUpdate;
5
+ /**
6
+ * Client-side validated previews for `--dry-run` (audit P5).
7
+ *
8
+ * Each plan is built from READS only (a GET of the current row) and answers three
9
+ * things a caller needs before a destructive call: would it be accepted, what
10
+ * would change, and what is the blast radius. It is a preview, not a promise:
11
+ * the real call re-validates server-side, and a concurrent writer can still
12
+ * change the outcome. Where the server has no validate-only path the plan says
13
+ * `source: 'client_preview'` so nobody mistakes it for one.
14
+ */
15
+ const data_provider_1 = require("@skrr-ai/data-provider");
16
+ function planProjectChange(action, project, projectRef) {
17
+ const archived = Boolean(project.archivedAt);
18
+ const taskCounts = (project.taskCounts ?? {});
19
+ const errors = [];
20
+ const notes = [];
21
+ if (action === 'archive' && archived)
22
+ notes.push('Already archived; archiving again is a no-op.');
23
+ if (action === 'unarchive' && !archived)
24
+ notes.push('Not archived; unarchiving is a no-op.');
25
+ return {
26
+ object: 'project_change_dry_run',
27
+ source: 'client_preview',
28
+ ok: errors.length === 0,
29
+ action,
30
+ project: {
31
+ id: project.id,
32
+ ref: project.identifier ?? projectRef,
33
+ title: project.title,
34
+ archived,
35
+ },
36
+ changes: action === 'delete'
37
+ ? {
38
+ deletesProject: true,
39
+ // Member tasks are detached, never deleted (invariant P3).
40
+ detachedTasksEstimate: taskCounts.total ?? null,
41
+ reversible: false,
42
+ }
43
+ : { archived: action === 'archive', reversible: true },
44
+ errors,
45
+ notes,
46
+ };
47
+ }
48
+ function planBulkUpdate(updates, currentById, failedReads = {}) {
49
+ const rows = updates.map(({ id, patch }) => {
50
+ const errors = [];
51
+ const current = currentById[id];
52
+ if (failedReads[id])
53
+ errors.push(`could not read task: ${failedReads[id]}`);
54
+ else if (!current)
55
+ errors.push('task not found');
56
+ const status = patch.status;
57
+ if (status !== undefined && !data_provider_1.TASK_STATUSES.includes(status)) {
58
+ errors.push(`status must be one of: ${data_provider_1.TASK_STATUSES.join(', ')}`);
59
+ }
60
+ const changes = {};
61
+ for (const [field, to] of Object.entries(patch)) {
62
+ if (to === undefined)
63
+ continue;
64
+ const from = current?.[field];
65
+ if (JSON.stringify(from) !== JSON.stringify(to))
66
+ changes[field] = { from, to };
67
+ }
68
+ return {
69
+ id,
70
+ ok: errors.length === 0,
71
+ changes,
72
+ noop: errors.length === 0 && Object.keys(changes).length === 0,
73
+ errors,
74
+ };
75
+ });
76
+ return {
77
+ object: 'task_bulk_update_dry_run',
78
+ source: 'client_preview',
79
+ ok: rows.every((r) => r.ok),
80
+ requested: rows.length,
81
+ wouldChange: rows.filter((r) => r.ok && !r.noop).length,
82
+ invalid: rows.filter((r) => !r.ok).length,
83
+ results: rows,
84
+ };
85
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Storage-field stripping for `--json` output (audit P9).
3
+ *
4
+ * The API returns Mongo documents, so every row carries `_id` and `__v` beside
5
+ * the real `id`: 47 keys per task row, two of which are storage detail an agent
6
+ * pays tokens for and can mistake for the identifier (OSK-12205 was exactly
7
+ * that: a 24-hex `_id` passed where a task id was wanted).
8
+ *
9
+ * This runs at the CLI SERIALIZER only (`BaseCommand.log`), never in the API or
10
+ * the data layer, so no other consumer's payload changes. `--raw` (or
11
+ * `OVERSKY_CLI_RAW=1`) turns it off for the caller that does want them.
12
+ *
13
+ * Two rules, both conservative:
14
+ * - `__v` is the Mongoose version key and is always dropped.
15
+ * - `_id` is dropped only when the same object has a usable `id`. A row that
16
+ * has ONLY `_id` (some legacy collections) keeps it: removing the sole
17
+ * identifier would turn a cosmetic cleanup into data loss.
18
+ */
19
+ type Json = unknown;
20
+ /**
21
+ * Returns the SAME reference when nothing needed stripping, so a caller can tell
22
+ * "unchanged" apart from "rebuilt" and leave the original text alone.
23
+ */
24
+ export declare function stripStorageFields(value: Json): Json;
25
+ /**
26
+ * Apply {@link stripStorageFields} to one line of CLI output. Anything that is
27
+ * not a JSON object/array (prose, a bare string, malformed text) is returned
28
+ * untouched, as is JSON with nothing to strip, so existing formatting survives.
29
+ */
30
+ export declare function stripStorageFieldsFromText(text: string): string;
31
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /**
3
+ * Storage-field stripping for `--json` output (audit P9).
4
+ *
5
+ * The API returns Mongo documents, so every row carries `_id` and `__v` beside
6
+ * the real `id`: 47 keys per task row, two of which are storage detail an agent
7
+ * pays tokens for and can mistake for the identifier (OSK-12205 was exactly
8
+ * that: a 24-hex `_id` passed where a task id was wanted).
9
+ *
10
+ * This runs at the CLI SERIALIZER only (`BaseCommand.log`), never in the API or
11
+ * the data layer, so no other consumer's payload changes. `--raw` (or
12
+ * `OVERSKY_CLI_RAW=1`) turns it off for the caller that does want them.
13
+ *
14
+ * Two rules, both conservative:
15
+ * - `__v` is the Mongoose version key and is always dropped.
16
+ * - `_id` is dropped only when the same object has a usable `id`. A row that
17
+ * has ONLY `_id` (some legacy collections) keeps it: removing the sole
18
+ * identifier would turn a cosmetic cleanup into data loss.
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.stripStorageFields = stripStorageFields;
22
+ exports.stripStorageFieldsFromText = stripStorageFieldsFromText;
23
+ function usableId(value) {
24
+ return (typeof value === 'string' && value.length > 0) || typeof value === 'number';
25
+ }
26
+ /**
27
+ * Returns the SAME reference when nothing needed stripping, so a caller can tell
28
+ * "unchanged" apart from "rebuilt" and leave the original text alone.
29
+ */
30
+ function stripStorageFields(value) {
31
+ if (Array.isArray(value)) {
32
+ let changed = false;
33
+ const next = value.map((item) => {
34
+ const stripped = stripStorageFields(item);
35
+ if (stripped !== item)
36
+ changed = true;
37
+ return stripped;
38
+ });
39
+ return changed ? next : value;
40
+ }
41
+ if (value === null || typeof value !== 'object')
42
+ return value;
43
+ const source = value;
44
+ const dropId = '_id' in source && usableId(source.id);
45
+ const dropVersion = '__v' in source;
46
+ let changed = dropId || dropVersion;
47
+ const next = {};
48
+ for (const [key, child] of Object.entries(source)) {
49
+ if ((key === '_id' && dropId) || (key === '__v' && dropVersion))
50
+ continue;
51
+ const stripped = stripStorageFields(child);
52
+ if (stripped !== child)
53
+ changed = true;
54
+ next[key] = stripped;
55
+ }
56
+ return changed ? next : value;
57
+ }
58
+ /**
59
+ * Apply {@link stripStorageFields} to one line of CLI output. Anything that is
60
+ * not a JSON object/array (prose, a bare string, malformed text) is returned
61
+ * untouched, as is JSON with nothing to strip, so existing formatting survives.
62
+ */
63
+ function stripStorageFieldsFromText(text) {
64
+ const head = text.trimStart()[0];
65
+ if (head !== '{' && head !== '[')
66
+ return text;
67
+ let parsed;
68
+ try {
69
+ parsed = JSON.parse(text);
70
+ }
71
+ catch {
72
+ return text;
73
+ }
74
+ const stripped = stripStorageFields(parsed);
75
+ if (stripped === parsed)
76
+ return text;
77
+ return JSON.stringify(stripped, null, text.includes('\n') ? 2 : undefined);
78
+ }
@@ -0,0 +1,75 @@
1
+ export type ListWarning = {
2
+ code: string;
3
+ value?: unknown;
4
+ hint: string;
5
+ };
6
+ export type ListEnvelope = {
7
+ object: 'list';
8
+ data: Array<Record<string, unknown>>;
9
+ has_more: boolean;
10
+ next_cursor: string | null;
11
+ limit_applied?: number;
12
+ warnings?: ListWarning[];
13
+ } & Record<string, unknown>;
14
+ /**
15
+ * The navigation projection per resource: enough to identify a row, decide
16
+ * whether it matters and fetch it with `show`. Allowlists, not drop-lists, so a
17
+ * field the server adds tomorrow does not silently re-inflate every compact row.
18
+ * Documented in docs/cli/SKRR_TASKS.md (List output for agents).
19
+ */
20
+ export declare const COMPACT_FIELDS: {
21
+ readonly task: readonly ["id", "identifier", "ref", "title", "status", "statusType", "priority", "estimate", "assigneeAgentIds", "assigneeUserIds", "parentId", "spaceId", "projectId", "goalId", "dueDate", "scheduledFor", "labelIds", "tags", "externalKey", "version", "executionMode", "nextAction", "createdAt", "updatedAt", "url"];
22
+ readonly space: readonly ["id", "identifier", "title", "status", "parentSpaceId", "leadAgentId", "labelIds", "archivedAt", "createdAt", "updatedAt", "url"];
23
+ readonly project: readonly ["id", "identifier", "title", "spaceId", "externalKey", "taskCounts", "archivedAt", "createdAt", "updatedAt", "url"];
24
+ };
25
+ export type ListResource = keyof typeof COMPACT_FIELDS;
26
+ /** The three flags every projecting list command declares. */
27
+ export declare const listOutputFlags: {
28
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
29
+ compact: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
30
+ ndjson: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
31
+ };
32
+ export type ListOutputFlags = {
33
+ fields?: string;
34
+ compact?: boolean;
35
+ ndjson?: boolean;
36
+ };
37
+ /** `--fields a, b ,c` -> ['a','b','c']; empty/blank -> undefined. */
38
+ export declare function parseFields(raw: string | undefined): string[] | undefined;
39
+ export declare function projectRow(row: Record<string, unknown>, fields: readonly string[]): Record<string, unknown>;
40
+ /**
41
+ * Normalize any list response to the shared envelope. `data` is where rows live
42
+ * for every list command; `projects` (an older serialization) is folded into it.
43
+ * A response that is not list-shaped is returned untouched (never invent rows).
44
+ */
45
+ export declare function toListEnvelope(response: unknown): ListEnvelope | undefined;
46
+ export type ShapeListOptions = ListOutputFlags & {
47
+ resource: ListResource;
48
+ /** What the caller asked for with --limit (undefined when the command has none). */
49
+ requestedLimit?: number;
50
+ warnings?: ListWarning[];
51
+ /** A filter the CLI applied that the caller did not ask for (E12). Echoed as `filter_applied`. */
52
+ filterApplied?: Record<string, unknown>;
53
+ };
54
+ /** Pure: envelope + projection + notes. Returns the response untouched if not a list. */
55
+ export declare function shapeListResponse(response: unknown, options: ShapeListOptions): unknown;
56
+ /**
57
+ * E11: the server silently clamps `--limit` (cap) and coerces `0` to its default.
58
+ * Echo what was applied. `applied` is only reported when we can prove it: a full
59
+ * page that still has more rows means the cap is exactly the row count.
60
+ */
61
+ export declare function limitNote(requested: number | undefined, rowCount: number, hasMore: boolean): {
62
+ applied?: number;
63
+ warning?: ListWarning;
64
+ };
65
+ /** The text-mode twin of a warning: one `Note:` line a person can act on. */
66
+ export declare function warningLines(warnings: readonly ListWarning[] | undefined): string[];
67
+ export type ListOutput = {
68
+ stdout: string[];
69
+ stderr: string[];
70
+ };
71
+ /**
72
+ * Render a shaped list for `--json` (pretty envelope) or `--ndjson` (rows one per
73
+ * line, `_meta` on stderr). Pure; the caller writes the lines.
74
+ */
75
+ export declare function renderListOutput(shaped: unknown, ndjson: boolean): ListOutput;