@skrr-ai/cli 0.1.109 → 0.1.111

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 (434) hide show
  1. package/bin/run.js +15 -1
  2. package/dist/base-command.d.ts +44 -1
  3. package/dist/base-command.js +194 -33
  4. package/dist/commands/actions/list.js +2 -1
  5. package/dist/commands/agenda/trigger/create.js +1 -1
  6. package/dist/commands/agenda/trigger/list.js +2 -1
  7. package/dist/commands/agent-groups/list.js +2 -1
  8. package/dist/commands/agents/actions/list.js +2 -1
  9. package/dist/commands/agents/always-on/status.js +5 -0
  10. package/dist/commands/agents/chat.js +4 -1
  11. package/dist/commands/agents/duplicate.js +4 -0
  12. package/dist/commands/agents/eval/list.js +2 -1
  13. package/dist/commands/agents/files/list.js +2 -1
  14. package/dist/commands/agents/folders/list.js +2 -1
  15. package/dist/commands/agents/goals/list.js +2 -1
  16. package/dist/commands/agents/intuitions/list.js +8 -5
  17. package/dist/commands/agents/list.d.ts +12 -0
  18. package/dist/commands/agents/list.js +45 -8
  19. package/dist/commands/agents/releases/known-issues/list.js +2 -1
  20. package/dist/commands/agents/releases/list.js +5 -1
  21. package/dist/commands/agents/releases/trusted-publishers/list.js +2 -1
  22. package/dist/commands/agents/roles/list.js +2 -1
  23. package/dist/commands/agents/skills/list.js +2 -1
  24. package/dist/commands/agents/todos/list.js +2 -1
  25. package/dist/commands/agents/triggers/create.js +1 -1
  26. package/dist/commands/agents/triggers/list.js +2 -1
  27. package/dist/commands/agents/triggers/update.js +1 -1
  28. package/dist/commands/agents/update.d.ts +11 -0
  29. package/dist/commands/agents/update.js +58 -2
  30. package/dist/commands/api-keys/list.js +2 -1
  31. package/dist/commands/apps/channel.d.ts +20 -0
  32. package/dist/commands/apps/channel.js +64 -0
  33. package/dist/commands/apps/check-draft.d.ts +12 -0
  34. package/dist/commands/apps/check-draft.js +41 -0
  35. package/dist/commands/apps/check.d.ts +42 -0
  36. package/dist/commands/apps/check.js +91 -0
  37. package/dist/commands/apps/create.d.ts +15 -0
  38. package/dist/commands/apps/create.js +59 -0
  39. package/dist/commands/apps/data/put.d.ts +18 -0
  40. package/dist/commands/apps/data/put.js +72 -0
  41. package/dist/commands/apps/data/query.d.ts +20 -0
  42. package/dist/commands/apps/data/query.js +88 -0
  43. package/dist/commands/apps/disclosure.d.ts +16 -0
  44. package/dist/commands/apps/disclosure.js +71 -0
  45. package/dist/commands/apps/file/cat.d.ts +15 -0
  46. package/dist/commands/apps/file/cat.js +50 -0
  47. package/dist/commands/apps/file/ls.d.ts +13 -0
  48. package/dist/commands/apps/file/ls.js +47 -0
  49. package/dist/commands/apps/file/mv.d.ts +15 -0
  50. package/dist/commands/apps/file/mv.js +49 -0
  51. package/dist/commands/apps/file/rm.d.ts +15 -0
  52. package/dist/commands/apps/file/rm.js +53 -0
  53. package/dist/commands/apps/file/write.d.ts +17 -0
  54. package/dist/commands/apps/file/write.js +81 -0
  55. package/dist/commands/apps/install.d.ts +19 -0
  56. package/dist/commands/apps/install.js +136 -0
  57. package/dist/commands/apps/installations/list.d.ts +11 -0
  58. package/dist/commands/apps/installations/list.js +49 -0
  59. package/dist/commands/apps/installations/show.d.ts +12 -0
  60. package/dist/commands/apps/installations/show.js +61 -0
  61. package/dist/commands/apps/layout/set.d.ts +11 -0
  62. package/dist/commands/apps/layout/set.js +125 -0
  63. package/dist/commands/apps/layout/show.d.ts +9 -0
  64. package/dist/commands/apps/layout/show.js +33 -0
  65. package/dist/commands/apps/list.d.ts +10 -0
  66. package/dist/commands/apps/list.js +45 -0
  67. package/dist/commands/apps/logs.d.ts +13 -0
  68. package/dist/commands/apps/logs.js +55 -0
  69. package/dist/commands/apps/preview.d.ts +12 -0
  70. package/dist/commands/apps/preview.js +39 -0
  71. package/dist/commands/apps/publish/propose.d.ts +14 -0
  72. package/dist/commands/apps/publish/propose.js +45 -0
  73. package/dist/commands/apps/pull.d.ts +14 -0
  74. package/dist/commands/apps/pull.js +56 -0
  75. package/dist/commands/apps/push.d.ts +15 -0
  76. package/dist/commands/apps/push.js +75 -0
  77. package/dist/commands/apps/reconsent.d.ts +13 -0
  78. package/dist/commands/apps/reconsent.js +67 -0
  79. package/dist/commands/apps/report.d.ts +20 -0
  80. package/dist/commands/apps/report.js +63 -0
  81. package/dist/commands/apps/resume.d.ts +12 -0
  82. package/dist/commands/apps/resume.js +36 -0
  83. package/dist/commands/apps/settings/set.d.ts +13 -0
  84. package/dist/commands/apps/settings/set.js +54 -0
  85. package/dist/commands/apps/settings/show.d.ts +11 -0
  86. package/dist/commands/apps/settings/show.js +31 -0
  87. package/dist/commands/apps/show.d.ts +12 -0
  88. package/dist/commands/apps/show.js +49 -0
  89. package/dist/commands/apps/suspend.d.ts +12 -0
  90. package/dist/commands/apps/suspend.js +35 -0
  91. package/dist/commands/apps/uninstall.d.ts +13 -0
  92. package/dist/commands/apps/uninstall.js +43 -0
  93. package/dist/commands/apps/upgrade.d.ts +14 -0
  94. package/dist/commands/apps/upgrade.js +49 -0
  95. package/dist/commands/apps/version/create.d.ts +14 -0
  96. package/dist/commands/apps/version/create.js +53 -0
  97. package/dist/commands/apps/version/show.d.ts +12 -0
  98. package/dist/commands/apps/version/show.js +39 -0
  99. package/dist/commands/apps/versions.d.ts +12 -0
  100. package/dist/commands/apps/versions.js +40 -0
  101. package/dist/commands/apps/webhooks/list.d.ts +12 -0
  102. package/dist/commands/apps/webhooks/list.js +47 -0
  103. package/dist/commands/characters/list.js +2 -1
  104. package/dist/commands/chats/files/list.js +2 -1
  105. package/dist/commands/chats/folders/list.js +2 -1
  106. package/dist/commands/chats/list.js +2 -1
  107. package/dist/commands/chats/spaces/list.js +2 -1
  108. package/dist/commands/chats/widgets/list.js +2 -1
  109. package/dist/commands/code/jobs/list.js +4 -1
  110. package/dist/commands/commerce/incidents/list.js +2 -1
  111. package/dist/commands/commitments/accounting.js +3 -0
  112. package/dist/commands/commitments/action-proposals.d.ts +8 -0
  113. package/dist/commands/commitments/action-proposals.js +17 -2
  114. package/dist/commands/commitments/cost.d.ts +11 -0
  115. package/dist/commands/commitments/cost.js +25 -0
  116. package/dist/commands/commitments/create.js +6 -1
  117. package/dist/commands/commitments/endpoints/list.js +2 -1
  118. package/dist/commands/commitments/links/list.js +2 -1
  119. package/dist/commands/commitments/list.js +2 -1
  120. package/dist/commands/commitments/liveness.d.ts +30 -0
  121. package/dist/commands/commitments/liveness.js +22 -5
  122. package/dist/commands/commitments/pack/list.js +2 -1
  123. package/dist/commands/commitments/preflight.js +6 -2
  124. package/dist/commands/commitments/update.js +10 -1
  125. package/dist/commands/compass/list.js +2 -1
  126. package/dist/commands/context.js +7 -1
  127. package/dist/commands/convos/list.js +3 -2
  128. package/dist/commands/daemon/install.js +17 -1
  129. package/dist/commands/daemon/login.js +14 -0
  130. package/dist/commands/dm/list.js +2 -1
  131. package/dist/commands/dm/work.d.ts +19 -0
  132. package/dist/commands/dm/work.js +54 -0
  133. package/dist/commands/feeds/list.js +2 -1
  134. package/dist/commands/followups/list.js +2 -1
  135. package/dist/commands/followups/plans/cancel.d.ts +13 -0
  136. package/dist/commands/followups/plans/cancel.js +26 -0
  137. package/dist/commands/followups/plans/create.d.ts +11 -0
  138. package/dist/commands/followups/plans/create.js +35 -0
  139. package/dist/commands/followups/plans/list.d.ts +13 -0
  140. package/dist/commands/followups/plans/list.js +50 -0
  141. package/dist/commands/followups/plans/observability.d.ts +11 -0
  142. package/dist/commands/followups/plans/observability.js +46 -0
  143. package/dist/commands/followups/plans/revise.d.ts +13 -0
  144. package/dist/commands/followups/plans/revise.js +35 -0
  145. package/dist/commands/followups/plans/show.d.ts +11 -0
  146. package/dist/commands/followups/plans/show.js +32 -0
  147. package/dist/commands/goals/key-results/list.js +2 -1
  148. package/dist/commands/goals/labels/list.js +3 -2
  149. package/dist/commands/goals/list.js +3 -2
  150. package/dist/commands/grants/list.js +2 -1
  151. package/dist/commands/harnesses/grants/list.js +2 -1
  152. package/dist/commands/harnesses/leases/list.js +2 -1
  153. package/dist/commands/harnesses/list.js +10 -1
  154. package/dist/commands/harnesses/prune.d.ts +26 -0
  155. package/dist/commands/harnesses/prune.js +172 -0
  156. package/dist/commands/ingress/list.js +2 -1
  157. package/dist/commands/initiatives/list.js +2 -1
  158. package/dist/commands/instruction-blocks/list.js +2 -1
  159. package/dist/commands/instructions/list.js +2 -1
  160. package/dist/commands/integrations/connections/list.js +2 -1
  161. package/dist/commands/integrations/tools/list.js +2 -1
  162. package/dist/commands/labels/list.js +3 -2
  163. package/dist/commands/learning/adapters.d.ts +16 -0
  164. package/dist/commands/learning/adapters.js +44 -0
  165. package/dist/commands/login.js +11 -0
  166. package/dist/commands/machines/dedicated/list.js +2 -1
  167. package/dist/commands/machines/hosted/list.js +2 -1
  168. package/dist/commands/machines/list.js +2 -1
  169. package/dist/commands/machines/show.js +5 -2
  170. package/dist/commands/measures/list.js +2 -1
  171. package/dist/commands/memory/list.js +2 -1
  172. package/dist/commands/memory/proposals/list.js +2 -1
  173. package/dist/commands/memory/stores/list.js +2 -1
  174. package/dist/commands/memory/topics/list.js +2 -1
  175. package/dist/commands/memory/versions/list.js +2 -1
  176. package/dist/commands/messages/list.js +2 -1
  177. package/dist/commands/northstars/intents/list.js +2 -1
  178. package/dist/commands/northstars/list.js +2 -1
  179. package/dist/commands/northstars/recommendations/list.js +2 -1
  180. package/dist/commands/outbox/list.js +2 -1
  181. package/dist/commands/profiles/list.js +2 -1
  182. package/dist/commands/projects/docs/list.js +8 -1
  183. package/dist/commands/projects/updates/list.js +2 -1
  184. package/dist/commands/proposals/list.js +2 -1
  185. package/dist/commands/requests/comments/list.js +2 -1
  186. package/dist/commands/requests/list.js +2 -1
  187. package/dist/commands/shares/list.js +2 -1
  188. package/dist/commands/shortcuts/list.js +2 -1
  189. package/dist/commands/signals/monitors/list.js +2 -1
  190. package/dist/commands/signals/schemas/list.js +2 -1
  191. package/dist/commands/signals/sources/list.js +2 -1
  192. package/dist/commands/space-directory-views/list.js +2 -1
  193. package/dist/commands/spaces/actions/list.js +4 -3
  194. package/dist/commands/spaces/briefs/list.js +2 -1
  195. package/dist/commands/spaces/cycles/list.js +2 -1
  196. package/dist/commands/spaces/files/folders/list.js +2 -1
  197. package/dist/commands/spaces/files/list.js +3 -2
  198. package/dist/commands/spaces/heartbeats/list.js +3 -2
  199. package/dist/commands/spaces/labels/list.js +3 -2
  200. package/dist/commands/spaces/list.d.ts +3 -18
  201. package/dist/commands/spaces/list.js +28 -35
  202. package/dist/commands/spaces/live/cards/list.js +2 -1
  203. package/dist/commands/spaces/members/list.d.ts +1 -0
  204. package/dist/commands/spaces/members/list.js +4 -1
  205. package/dist/commands/spaces/show.js +2 -2
  206. package/dist/commands/spaces/skills/list.js +6 -2
  207. package/dist/commands/spaces/states/list.js +2 -1
  208. package/dist/commands/spaces/views/list.js +2 -1
  209. package/dist/commands/spaces/widgets/list.js +3 -2
  210. package/dist/commands/spaces/workflow-templates/list.js +2 -1
  211. package/dist/commands/spaces/workflows/fixtures/list.js +2 -1
  212. package/dist/commands/spaces/workflows/list.js +3 -2
  213. package/dist/commands/spaces/workflows/proposals/list.js +2 -1
  214. package/dist/commands/spaces/workflows/start.js +3 -1
  215. package/dist/commands/spaces/workflows/triggers/list.js +2 -1
  216. package/dist/commands/spaces/workflows/validate.js +12 -2
  217. package/dist/commands/store/acquisitions/list.js +2 -1
  218. package/dist/commands/store/admissions/list.js +17 -1
  219. package/dist/commands/store/advisories/list.js +2 -1
  220. package/dist/commands/store/follows/list.js +2 -1
  221. package/dist/commands/store/publishers/domains/list.js +2 -1
  222. package/dist/commands/store/reports/list.js +2 -1
  223. package/dist/commands/subscriptions/list.js +2 -1
  224. package/dist/commands/tasks/actionability.js +7 -30
  225. package/dist/commands/tasks/activity.js +14 -8
  226. package/dist/commands/tasks/approvals/list.js +2 -1
  227. package/dist/commands/tasks/assign.d.ts +1 -0
  228. package/dist/commands/tasks/assign.js +43 -7
  229. package/dist/commands/tasks/attachments/list.js +2 -1
  230. package/dist/commands/tasks/chat/send.js +34 -0
  231. package/dist/commands/tasks/comments/add.js +6 -1
  232. package/dist/commands/tasks/comments/list.js +2 -1
  233. package/dist/commands/tasks/complete.js +26 -2
  234. package/dist/commands/tasks/continue.d.ts +18 -0
  235. package/dist/commands/tasks/continue.js +54 -0
  236. package/dist/commands/tasks/create-tree.d.ts +5 -0
  237. package/dist/commands/tasks/create-tree.js +399 -219
  238. package/dist/commands/tasks/create.d.ts +1 -0
  239. package/dist/commands/tasks/create.js +63 -11
  240. package/dist/commands/tasks/deliverable/add.js +10 -3
  241. package/dist/commands/tasks/deliverable/list.js +2 -1
  242. package/dist/commands/tasks/events/list.js +2 -1
  243. package/dist/commands/tasks/execution-state.d.ts +12 -0
  244. package/dist/commands/tasks/execution-state.js +28 -0
  245. package/dist/commands/tasks/expectations/assess.js +40 -5
  246. package/dist/commands/tasks/guide.d.ts +10 -0
  247. package/dist/commands/tasks/guide.js +20 -0
  248. package/dist/commands/tasks/labels/list.js +2 -1
  249. package/dist/commands/tasks/list.d.ts +19 -0
  250. package/dist/commands/tasks/list.js +103 -6
  251. package/dist/commands/tasks/move.js +10 -2
  252. package/dist/commands/tasks/preflight.d.ts +14 -0
  253. package/dist/commands/tasks/preflight.js +77 -0
  254. package/dist/commands/tasks/rearm-recurrence.js +22 -3
  255. package/dist/commands/tasks/resource/list.js +2 -1
  256. package/dist/commands/tasks/result/submit.js +10 -1
  257. package/dist/commands/tasks/review.js +6 -1
  258. package/dist/commands/tasks/revisions.d.ts +2 -0
  259. package/dist/commands/tasks/revisions.js +8 -1
  260. package/dist/commands/tasks/show.d.ts +8 -0
  261. package/dist/commands/tasks/show.js +81 -43
  262. package/dist/commands/tasks/start.d.ts +1 -0
  263. package/dist/commands/tasks/start.js +35 -0
  264. package/dist/commands/tasks/templates/list.js +2 -1
  265. package/dist/commands/tasks/timeline.d.ts +5 -0
  266. package/dist/commands/tasks/timeline.js +9 -1
  267. package/dist/commands/tasks/unschedule.js +5 -1
  268. package/dist/commands/tasks/update.d.ts +1 -0
  269. package/dist/commands/tasks/update.js +36 -3
  270. package/dist/commands/tasks/updates/add.js +6 -1
  271. package/dist/commands/tasks/updates/list.js +2 -1
  272. package/dist/commands/tasks/upsert.d.ts +1 -0
  273. package/dist/commands/tasks/upsert.js +8 -1
  274. package/dist/commands/token/list.js +2 -1
  275. package/dist/commands/tokens/list.js +2 -1
  276. package/dist/commands/tones/list.js +4 -2
  277. package/dist/commands/triggers/audit.js +12 -3
  278. package/dist/commands/triggers/create.js +1 -1
  279. package/dist/commands/triggers/fire-detail.d.ts +7 -0
  280. package/dist/commands/triggers/fire-detail.js +30 -12
  281. package/dist/commands/triggers/fire.js +13 -3
  282. package/dist/commands/triggers/list.js +2 -1
  283. package/dist/commands/triggers/parse-intent.js +1 -1
  284. package/dist/commands/triggers/update.js +1 -1
  285. package/dist/commands/views/list.js +2 -1
  286. package/dist/commands/webhooks/list.js +2 -1
  287. package/dist/commands/whoami.js +1 -1
  288. package/dist/commands/widgets/list.js +2 -1
  289. package/dist/commands/widgets/save-as-app.d.ts +13 -0
  290. package/dist/commands/widgets/save-as-app.js +65 -0
  291. package/dist/commands/work-views/list.js +2 -1
  292. package/dist/commands/worklog/list.js +2 -1
  293. package/dist/commands/workspaces/grants.js +1 -4
  294. package/dist/commands/workspaces/list.js +3 -2
  295. package/dist/commands/workspaces/members.d.ts +1 -0
  296. package/dist/commands/workspaces/members.js +10 -7
  297. package/dist/generated/managed-instruction-guides.json +2 -2
  298. package/dist/help.js +7 -0
  299. package/dist/lib/agent-proactive-baseline.d.ts +9 -0
  300. package/dist/lib/agent-proactive-baseline.js +44 -0
  301. package/dist/lib/agentic-stream.d.ts +4 -1
  302. package/dist/lib/agentic-stream.js +29 -4
  303. package/dist/lib/appData.d.ts +75 -0
  304. package/dist/lib/appData.js +274 -0
  305. package/dist/lib/appInstallations.d.ts +117 -0
  306. package/dist/lib/appInstallations.js +960 -0
  307. package/dist/lib/appSettings.d.ts +3 -0
  308. package/dist/lib/appSettings.js +71 -0
  309. package/dist/lib/appWebhooks.d.ts +7 -0
  310. package/dist/lib/appWebhooks.js +59 -0
  311. package/dist/lib/apps-command.d.ts +44 -0
  312. package/dist/lib/apps-command.js +164 -0
  313. package/dist/lib/apps.d.ts +45 -0
  314. package/dist/lib/apps.js +148 -0
  315. package/dist/lib/appsCheck.d.ts +12 -0
  316. package/dist/lib/appsCheck.js +173 -0
  317. package/dist/lib/appsFs.d.ts +58 -0
  318. package/dist/lib/appsFs.js +384 -0
  319. package/dist/lib/auth-failure.d.ts +20 -0
  320. package/dist/lib/auth-failure.js +40 -3
  321. package/dist/lib/cli-installers.d.ts +9 -2
  322. package/dist/lib/command-miss.js +107 -0
  323. package/dist/lib/commitment-loop-status.js +25 -3
  324. package/dist/lib/commitment-product.js +5 -2
  325. package/dist/lib/commitments.d.ts +45 -3
  326. package/dist/lib/commitments.js +139 -41
  327. package/dist/lib/compasses.d.ts +4 -0
  328. package/dist/lib/compasses.js +11 -0
  329. package/dist/lib/daemon-machine-identity-copy.d.ts +14 -0
  330. package/dist/lib/daemon-machine-identity-copy.js +27 -0
  331. package/dist/lib/daemon-machine-identity.d.ts +27 -0
  332. package/dist/lib/daemon-machine-identity.js +61 -0
  333. package/dist/lib/daemon-setup.js +7 -7
  334. package/dist/lib/daemonHandoff.d.ts +19 -1
  335. package/dist/lib/daemonHandoff.js +62 -2
  336. package/dist/lib/dedicated-ssh.d.ts +2 -0
  337. package/dist/lib/dedicated-ssh.js +98 -28
  338. package/dist/lib/harnesses.d.ts +71 -0
  339. package/dist/lib/harnesses.js +70 -0
  340. package/dist/lib/json-output.d.ts +33 -0
  341. package/dist/lib/json-output.js +37 -0
  342. package/dist/lib/list-output.d.ts +9 -4
  343. package/dist/lib/list-output.js +38 -9
  344. package/dist/lib/lookbackPlans.d.ts +13 -0
  345. package/dist/lib/lookbackPlans.js +68 -0
  346. package/dist/lib/machines.d.ts +27 -6
  347. package/dist/lib/machines.js +25 -14
  348. package/dist/lib/member-output.d.ts +20 -0
  349. package/dist/lib/member-output.js +57 -0
  350. package/dist/lib/preflight-copy.d.ts +7 -0
  351. package/dist/lib/preflight-copy.js +31 -0
  352. package/dist/lib/profile-machine-identity-guard.js +11 -1
  353. package/dist/lib/roles.d.ts +2 -2
  354. package/dist/lib/task-admission.d.ts +9 -0
  355. package/dist/lib/task-admission.js +35 -0
  356. package/dist/lib/task-batch.d.ts +4 -0
  357. package/dist/lib/task-batch.js +2 -0
  358. package/dist/lib/task-economics.d.ts +10 -0
  359. package/dist/lib/task-economics.js +24 -2
  360. package/dist/lib/task-operations.d.ts +25 -0
  361. package/dist/lib/task-operations.js +123 -0
  362. package/dist/lib/task-preflight.d.ts +35 -0
  363. package/dist/lib/task-preflight.js +121 -0
  364. package/dist/lib/task-resource-references.d.ts +23 -0
  365. package/dist/lib/task-resource-references.js +119 -0
  366. package/dist/lib/task-spec-verification.d.ts +42 -0
  367. package/dist/lib/task-spec-verification.js +101 -0
  368. package/dist/lib/task-work.d.ts +11 -0
  369. package/dist/lib/task-work.js +41 -0
  370. package/dist/lib/task-write-attribution.d.ts +26 -0
  371. package/dist/lib/task-write-attribution.js +47 -0
  372. package/dist/lib/tasks.d.ts +13 -0
  373. package/dist/lib/tasks.js +61 -8
  374. package/dist/lib/triggers.d.ts +18 -0
  375. package/dist/lib/triggers.js +97 -5
  376. package/dist/lib/usage-discovery.d.ts +4 -0
  377. package/dist/lib/usage-discovery.js +14 -4
  378. package/dist/lib/widgetApps.d.ts +10 -0
  379. package/dist/lib/widgetApps.js +47 -0
  380. package/dist/lib/widgetStaticScan.js +25 -1
  381. package/dist/lib/workflow-run-view.d.ts +4 -0
  382. package/dist/lib/workflow-run-view.js +5 -0
  383. package/dist/lib/workspaces.d.ts +33 -9
  384. package/dist/lib/workspaces.js +19 -3
  385. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +14 -1
  386. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +47 -2
  387. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.d.ts +49 -1
  388. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +26 -0
  389. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.d.ts +118 -0
  390. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +614 -0
  391. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  392. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +5 -3
  393. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.d.ts +60 -0
  394. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +130 -6
  395. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +2 -0
  396. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +15 -2
  397. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.d.ts +5 -0
  398. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refreshClassification.js +3 -1
  399. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.d.ts +177 -0
  400. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.js +484 -0
  401. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.d.ts +11 -0
  402. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +46 -7
  403. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +232 -0
  404. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +372 -0
  405. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +17 -1
  406. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.js +12 -1
  407. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +14 -1
  408. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +45 -2
  409. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.d.ts +49 -1
  410. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +24 -0
  411. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.d.ts +118 -0
  412. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +608 -0
  413. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  414. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  415. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.d.ts +60 -0
  416. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +128 -6
  417. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +2 -0
  418. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +15 -2
  419. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.d.ts +5 -0
  420. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refreshClassification.js +3 -1
  421. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.d.ts +177 -0
  422. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.js +472 -0
  423. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.d.ts +11 -0
  424. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +44 -6
  425. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +232 -0
  426. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +360 -0
  427. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +17 -1
  428. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.js +12 -1
  429. package/dist/node_modules/@skrr-ai/auth-core/package.json +31 -1
  430. package/dist/node_modules/@skrr-ai/data-provider/index.js +25255 -18711
  431. package/docs/v1/operations.md +52 -0
  432. package/docs/v1/space-search.md +19 -0
  433. package/oclif.manifest.json +4843 -513
  434. package/package.json +32 -2
package/bin/run.js CHANGED
@@ -33,7 +33,21 @@ try {
33
33
  fs.chmodSync(temporary, 0o600);
34
34
  fs.renameSync(temporary, bootstrap);
35
35
  }
36
- require(bootstrap).registerSession(packageRoot);
36
+ const updateRuntime = require(bootstrap);
37
+ const admissionDeadline = Date.now() + 60000;
38
+ while (true) {
39
+ try {
40
+ updateRuntime.registerSession(packageRoot, Math.max(0, admissionDeadline - Date.now()));
41
+ break;
42
+ } catch (error) {
43
+ // Protocol-1 bootstraps already cached outside node_modules can time
44
+ // out their one-second bakery lock while another reader enters. Retry
45
+ // through that same gate within the normal admission budget: never
46
+ // load package modules while npm may be replacing them.
47
+ if (error?.code !== 'CLI_UPDATE_BUSY' || Date.now() >= admissionDeadline) throw error;
48
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 25);
49
+ }
50
+ }
37
51
  process.env.SKRR_CLI_UPDATE_SESSION_REGISTERED = String(process.pid);
38
52
  } catch (error) {
39
53
  if (error && error.code === 'CLI_UPDATE_BUSY') {
@@ -1,4 +1,5 @@
1
1
  import { Command, Flags, type Interfaces } from '@oclif/core';
2
+ import { type CliOperationOptions } from './lib/json-output';
2
3
  export { resolveProfileFromArgv } from './lib/keychain';
3
4
  import { dataService } from '@skrr-ai/data-provider';
4
5
  import { type WriteTarget } from './lib/write-target';
@@ -7,6 +8,7 @@ import { type CliConfig } from './lib/config';
7
8
  import { type OutboxMethod } from './lib/outbox';
8
9
  import { type CredentialProvenance, type ResolvedCredential } from './lib/credential-resolver';
9
10
  import { type BrokerRefusalDescription } from './lib/daemonBrokerRefusal';
11
+ import { type TaskResourceReferenceCache } from './lib/task-resource-references';
10
12
  import { type DefaultAgentResolution } from './lib/tasks';
11
13
  export declare function assigneePayloadNeedsResolution(payload: Record<string, unknown>): boolean;
12
14
  /**
@@ -79,6 +81,13 @@ export declare abstract class BaseCommand extends Command {
79
81
  protected printJsonResult(value: unknown, options?: {
80
82
  ok?: boolean;
81
83
  }): void;
84
+ private jsonOperationContext?;
85
+ /** Opt in at the command boundary, including its existing structured errors. */
86
+ protected setJsonOperation(options: Partial<CliOperationOptions>): void;
87
+ /** Decorate an object when a command owns its own JSON/signal serializer. */
88
+ protected jsonOperationResult(value: unknown, options?: Partial<CliOperationOptions>): unknown;
89
+ protected printJsonOperation(value: unknown, options?: Partial<CliOperationOptions>): void;
90
+ private jsonOperationError;
82
91
  protected cliConfig: CliConfig;
83
92
  /**
84
93
  * Resolved credential for this process. Populated in `init()` and
@@ -123,6 +132,12 @@ export declare abstract class BaseCommand extends Command {
123
132
  * instead of the resolution being quietly wrong.
124
133
  */
125
134
  static resolveSpaceFlag: boolean;
135
+ private taskResourceReferenceCache?;
136
+ protected resolveTaskResourceReferences(payload: Record<string, unknown>, options?: {
137
+ existingTask?: Record<string, unknown>;
138
+ taskId?: string;
139
+ cache?: TaskResourceReferenceCache;
140
+ }): Promise<void>;
126
141
  /**
127
142
  * Turn a space reference into a space id, or fail the command.
128
143
  *
@@ -300,7 +315,9 @@ export declare abstract class BaseCommand extends Command {
300
315
  * caller that cannot watch: it is checked HERE, before the first write, and a
301
316
  * mismatch is a non-retryable usage error.
302
317
  */
303
- protected assertWriteTarget(expected?: readonly string[]): Promise<WriteTarget>;
318
+ protected assertWriteTarget(expected?: readonly string[], options?: {
319
+ preview?: boolean;
320
+ }): Promise<WriteTarget>;
304
321
  /**
305
322
  * Turn free-text assignee references ("frank", "frank@example.com", "me",
306
323
  * or a raw id) into ids, failing the command if ANY of them can't be pinned
@@ -585,6 +602,32 @@ export declare function isTypedServerRefusal(body: Record<string, unknown> | nul
585
602
  */
586
603
  export declare function isApplicationCodedUnavailable(status: number | undefined, body: Record<string, unknown> | null): boolean;
587
604
  export declare function isRetryableFailure(status: number | undefined, body: Record<string, unknown> | null): boolean;
605
+ /**
606
+ * The human text of an API error body (OSK-16986). The server's error envelope guarantees
607
+ * `message`; the legacy `error` string and the nested `{ error: { message } }` (`/v1`) are read
608
+ * only for a server or a proxy that did not pass that boundary. Same order as
609
+ * `errorBodyMessage` in `@skrr-ai/data-provider`, kept here because the CLI's specs replace that
610
+ * package with partial mocks and this runs on every API failure.
611
+ */
612
+ export declare function errorBodyMessage(body: unknown): string | undefined;
613
+ /**
614
+ * The `details` of a CLI error envelope, in ONE shape. The server's refusal body becomes the
615
+ * envelope's details; when that body carries its own `details` object (a typed refusal's
616
+ * findings, e.g. `signalableNodeKeys`), those fields are lifted to the same level instead of
617
+ * arriving as `error.details.details`, a depth no other error used (OSK-16494).
618
+ *
619
+ * The human text is always `details.message` (OSK-16986): the server's error envelope guarantees
620
+ * it, and for an older server that wrote only `error` (or the nested `/v1` shape) it is filled
621
+ * from there, so no caller reads two places. A lifted `details.message` cannot replace it.
622
+ */
623
+ export declare function envelopeDetails(body: Record<string, unknown> | null | undefined): unknown;
624
+ /**
625
+ * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
626
+ * - a flag retired from THIS command, which this command does not define again: where it went;
627
+ * - a flag token holding a space (`"--outcome failed"` passed as one argument): what happened,
628
+ * which oclif reports only as an unknown flag.
629
+ */
630
+ export declare function retiredFlagHint(message: string, commandId?: string, definedFlags?: readonly string[]): string | null;
588
631
  /**
589
632
  * P6: a parse error used to say what was wrong and drop the remedy that text
590
633
  * mode (and every domain error) carries. Adds `fix` (one imperative line an
@@ -17,6 +17,9 @@ exports.describeDaemonScopedCredential = describeDaemonScopedCredential;
17
17
  exports.isTypedServerRefusal = isTypedServerRefusal;
18
18
  exports.isApplicationCodedUnavailable = isApplicationCodedUnavailable;
19
19
  exports.isRetryableFailure = isRetryableFailure;
20
+ exports.errorBodyMessage = errorBodyMessage;
21
+ exports.envelopeDetails = envelopeDetails;
22
+ exports.retiredFlagHint = retiredFlagHint;
20
23
  exports.parseErrorRemedy = parseErrorRemedy;
21
24
  const node_fs_1 = require("node:fs");
22
25
  const core_1 = require("@oclif/core");
@@ -61,6 +64,7 @@ const step_up_1 = require("./lib/step-up");
61
64
  const delegated_cli_1 = require("./lib/delegated-cli");
62
65
  const dedicated_guest_1 = require("./lib/dedicated-guest");
63
66
  const harness_context_1 = require("./lib/harness-context");
67
+ const task_resource_references_1 = require("./lib/task-resource-references");
64
68
  const tasks_1 = require("./lib/tasks");
65
69
  function assigneePayloadNeedsResolution(payload) {
66
70
  const fields = [
@@ -197,6 +201,26 @@ class BaseCommand extends core_1.Command {
197
201
  printJsonResult(value, options = {}) {
198
202
  this.log(JSON.stringify((0, json_output_1.withOk)(value, options.ok ?? true), null, 2));
199
203
  }
204
+ jsonOperationContext;
205
+ /** Opt in at the command boundary, including its existing structured errors. */
206
+ setJsonOperation(options) {
207
+ this.jsonOperationContext = { ...this.jsonOperationContext, ...options };
208
+ }
209
+ /** Decorate an object when a command owns its own JSON/signal serializer. */
210
+ jsonOperationResult(value, options = {}) {
211
+ return (0, json_output_1.withCliOperation)(value, {
212
+ command: this.id ?? '', mode: 'execute', outcome: 'succeeded',
213
+ ...this.jsonOperationContext, ...options,
214
+ });
215
+ }
216
+ printJsonOperation(value, options = {}) {
217
+ this.printJsonResult(this.jsonOperationResult(value, options));
218
+ }
219
+ jsonOperationError(value) {
220
+ return this.jsonOperationContext
221
+ ? this.jsonOperationResult(value, { outcome: 'failed', writeState: 'unknown' })
222
+ : value;
223
+ }
200
224
  cliConfig;
201
225
  /**
202
226
  * Resolved credential for this process. Populated in `init()` and
@@ -614,6 +638,43 @@ class BaseCommand extends core_1.Command {
614
638
  * instead of the resolution being quietly wrong.
615
639
  */
616
640
  static resolveSpaceFlag = true;
641
+ taskResourceReferenceCache;
642
+ async resolveTaskResourceReferences(payload, options = {}) {
643
+ const cache = options.cache ?? (this.taskResourceReferenceCache ??= new Map());
644
+ let existingTask = options.existingTask;
645
+ // An ordinary UUID patch must keep its old request count. Only a readable
646
+ // scoped reference needs a current Task read to discover its Space.
647
+ const needsScope = ['projectId', 'goalId'].some(field => {
648
+ const value = payload[field];
649
+ return typeof value === 'string' && value.trim() &&
650
+ !/^[\da-f-]{36}$/i.test(value) && !/^[\da-f]{24}$/i.test(value);
651
+ });
652
+ try {
653
+ if (needsScope && !payload.spaceId && !existingTask && options.taskId) {
654
+ const key = `task:${options.taskId}`;
655
+ if (!cache.has(key))
656
+ cache.set(key, data_provider_1.dataService.getTask(options.taskId, { enrich: false }));
657
+ existingTask = await cache.get(key);
658
+ }
659
+ await (0, task_resource_references_1.resolveTaskResourceReferences)(payload, {
660
+ existingTask,
661
+ cache,
662
+ resolveSpace: value => this.resolveSpaceReference(value),
663
+ });
664
+ }
665
+ catch (error) {
666
+ if (error instanceof task_resource_references_1.TaskResourceReferenceError) {
667
+ this.failWithCliError({
668
+ message: error.message,
669
+ code: error.code,
670
+ exit: 2,
671
+ retryable: false,
672
+ details: { context: { candidates: error.candidates } },
673
+ });
674
+ }
675
+ this.handleApiError(error);
676
+ }
677
+ }
617
678
  /**
618
679
  * Turn a space reference into a space id, or fail the command.
619
680
  *
@@ -648,7 +709,14 @@ class BaseCommand extends core_1.Command {
648
709
  catch (err) {
649
710
  this.handleApiError(err);
650
711
  }
651
- const rows = (response?.data ?? []);
712
+ const envelope = response;
713
+ if (!Array.isArray(envelope?.data) || envelope?.has_more === true) {
714
+ this.failWithCliError({
715
+ message: 'The Space lookup is incomplete or unavailable, so a unique match cannot be established. Use a canonical Space id, or narrow the search with spaces list --q <name>.',
716
+ code: 'SPACE_REF_LOOKUP_INCOMPLETE', exit: 2, retryable: false,
717
+ });
718
+ }
719
+ const rows = envelope.data;
652
720
  return rows.map(space_resolver_1.spaceRefFrom).filter((s) => s !== null);
653
721
  };
654
722
  let outcome = (0, space_resolver_1.resolveSpaceRef)(normalizedQuery, await load(false));
@@ -722,7 +790,7 @@ class BaseCommand extends core_1.Command {
722
790
  // both contracts.
723
791
  if (!(0, projects_1.looksLikeCanonicalProjectId)(projectRef)) {
724
792
  this.failWithCliError({
725
- message: 'Name the space: pass --space, or use the qualified ref `<space>/<project>` that `projects list` prints.',
793
+ message: 'Name the space: pass --space <space-id-or-ref>, or qualify the project ref as <space-id-or-ref>/<project-ref> (for example OSK-S-3/OSK-P-12).',
726
794
  code: 'PROJECT_REF_REQUIRES_SPACE',
727
795
  exit: 2,
728
796
  retryable: false,
@@ -750,7 +818,7 @@ class BaseCommand extends core_1.Command {
750
818
  // A server that predates the lookup. The caller's old remedy still
751
819
  // works there, so the error names it rather than a server upgrade only.
752
820
  this.failWithCliError({
753
- message: 'This skrr server cannot look a project up by id — name the space: pass --space, or use the qualified ref `<space>/<project>` that `projects list` prints.',
821
+ message: 'This skrr server cannot look a project up by id — name the space: pass --space <space-id-or-ref>, or qualify the project as <space-id-or-ref>/<project-id>.',
754
822
  code: 'PROJECT_REF_REQUIRES_SPACE',
755
823
  exit: 2,
756
824
  retryable: false,
@@ -822,7 +890,14 @@ class BaseCommand extends core_1.Command {
822
890
  catch (err) {
823
891
  this.handleApiError(err);
824
892
  }
825
- const rows = (response?.data ?? []);
893
+ const envelope = response;
894
+ if (!Array.isArray(envelope?.data) || envelope?.has_more === true) {
895
+ this.failWithCliError({
896
+ message: 'The Task-title lookup is incomplete or unavailable, so a unique match cannot be established. Use a Task id/ref from tasks list --q <title>.',
897
+ code: 'TASK_REF_LOOKUP_INCOMPLETE', exit: 2, retryable: false,
898
+ });
899
+ }
900
+ const rows = envelope.data;
826
901
  const candidates = rows.map(task_ref_resolver_1.taskRefFrom).filter((t) => t !== null);
827
902
  const outcome = (0, task_ref_resolver_1.resolveTaskRef)(query, candidates);
828
903
  if (outcome.ok)
@@ -1074,7 +1149,7 @@ class BaseCommand extends core_1.Command {
1074
1149
  * caller that cannot watch: it is checked HERE, before the first write, and a
1075
1150
  * mismatch is a non-retryable usage error.
1076
1151
  */
1077
- async assertWriteTarget(expected) {
1152
+ async assertWriteTarget(expected, options = {}) {
1078
1153
  const target = await this.describeWriteTarget();
1079
1154
  const unmet = (0, write_target_1.firstUnmetExpectation)(target, expected);
1080
1155
  if (unmet !== undefined) {
@@ -1091,7 +1166,7 @@ class BaseCommand extends core_1.Command {
1091
1166
  });
1092
1167
  }
1093
1168
  if (process.stderr.isTTY) {
1094
- process.stderr.write(`Writing to ${(0, write_target_1.formatWriteTarget)(target)}\n`);
1169
+ process.stderr.write(`${options.preview ? 'Dry run target:' : 'Writing to'} ${(0, write_target_1.formatWriteTarget)(target)}\n`);
1095
1170
  }
1096
1171
  return target;
1097
1172
  }
@@ -1191,7 +1266,7 @@ class BaseCommand extends core_1.Command {
1191
1266
  // so a caller following older instructions — including the managed block the
1192
1267
  // platform itself installed — got a bare `Nonexistent flags:` with no hint
1193
1268
  // that the capability moved rather than vanished. Name where each went.
1194
- const retiredHint = retiredFlagHint(err.message || '');
1269
+ const retiredHint = retiredFlagHint(err.message || '', this.id, Object.keys(this.constructor.flags ?? {}));
1195
1270
  if (retiredHint) {
1196
1271
  err.message = `${err.message}\n\n${retiredHint}`;
1197
1272
  }
@@ -1223,7 +1298,7 @@ class BaseCommand extends core_1.Command {
1223
1298
  const exit = err.exitCode ?? err.oclif?.exit ?? 1;
1224
1299
  process.exitCode = exit;
1225
1300
  const details = detailsFromCaughtError(err) ?? httpBody;
1226
- this.log(JSON.stringify({
1301
+ this.log(JSON.stringify(this.jsonOperationError({
1227
1302
  ok: false,
1228
1303
  error: {
1229
1304
  code: err.code ?? parseCliErrorCode(err),
@@ -1234,7 +1309,7 @@ class BaseCommand extends core_1.Command {
1234
1309
  ...parseErrorRemedy(err, this.id, this.config?.bin),
1235
1310
  ...(details ? { details } : {}),
1236
1311
  },
1237
- }, null, 2));
1312
+ }), null, 2));
1238
1313
  return;
1239
1314
  }
1240
1315
  return super.catch(err);
@@ -1308,7 +1383,9 @@ class BaseCommand extends core_1.Command {
1308
1383
  const body = parseErrorBody(e.body);
1309
1384
  const bodyCode = stringProp(body, 'code') || stringProp(body, 'errorType');
1310
1385
  // A body path the person never typed is read back as the flag that wrote it (OSK-15313).
1311
- const bodyMessage = (0, request_field_flags_1.translateRequestFieldPaths)(stringProp(body, 'message') || stringProp(body, 'error'), this.requestFieldFlags);
1386
+ // The server answers every error with `message` (OSK-16986); `errorBodyMessage` keeps the
1387
+ // older `error` string and the nested `/v1` shape as fallbacks for a server without it.
1388
+ const bodyMessage = (0, request_field_flags_1.translateRequestFieldPaths)(errorBodyMessage(body), this.requestFieldFlags);
1312
1389
  // `requireAuth()` catches this before requests for normal commands, but
1313
1390
  // keep the API-error check too: a handful of commands make a direct
1314
1391
  // request and a supplied `--token` can bypass their normal preflight.
@@ -1336,7 +1413,7 @@ class BaseCommand extends core_1.Command {
1336
1413
  status: e.status,
1337
1414
  exit: 2,
1338
1415
  retryable: false,
1339
- details: body ?? undefined,
1416
+ details: envelopeDetails(body),
1340
1417
  });
1341
1418
  }
1342
1419
  else if (bodyCode === 'AGENT_RUNTIME_UNAVAILABLE') {
@@ -1350,7 +1427,7 @@ class BaseCommand extends core_1.Command {
1350
1427
  status: e.status,
1351
1428
  exit: 1,
1352
1429
  retryable: false,
1353
- details: body ?? undefined,
1430
+ details: envelopeDetails(body),
1354
1431
  });
1355
1432
  }
1356
1433
  else if (bodyCode === 'GITHUB_APP_NOT_CONFIGURED') {
@@ -1360,7 +1437,7 @@ class BaseCommand extends core_1.Command {
1360
1437
  status: e.status,
1361
1438
  exit: 2,
1362
1439
  retryable: false,
1363
- details: body ?? undefined,
1440
+ details: envelopeDetails(body),
1364
1441
  });
1365
1442
  }
1366
1443
  else if (bodyCode === 'GITHUB_UNAVAILABLE') {
@@ -1376,7 +1453,7 @@ class BaseCommand extends core_1.Command {
1376
1453
  status: e.status,
1377
1454
  exit: 5,
1378
1455
  retryable: true,
1379
- details: body ?? undefined,
1456
+ details: envelopeDetails(body),
1380
1457
  });
1381
1458
  }
1382
1459
  else if (bodyCode === 'LABEL_SUGGESTION_UNAVAILABLE') {
@@ -1390,7 +1467,7 @@ class BaseCommand extends core_1.Command {
1390
1467
  status: e.status,
1391
1468
  exit: 1,
1392
1469
  retryable: false,
1393
- details: body ?? undefined,
1470
+ details: envelopeDetails(body),
1394
1471
  });
1395
1472
  }
1396
1473
  else if (bodyCode === 'ASSIGNEE_NOT_IN_SPACE') {
@@ -1403,7 +1480,7 @@ class BaseCommand extends core_1.Command {
1403
1480
  status: e.status,
1404
1481
  exit: 2,
1405
1482
  retryable: false,
1406
- details: body ?? undefined,
1483
+ details: envelopeDetails(body),
1407
1484
  });
1408
1485
  }
1409
1486
  else if (e.status === 401) {
@@ -1432,7 +1509,7 @@ class BaseCommand extends core_1.Command {
1432
1509
  // latched refresh refusal names the half the reader can act on.
1433
1510
  const refreshRefusal = presentedCiToken || presentedPat
1434
1511
  ? null
1435
- : (0, auth_failure_1.describeRefreshRefusal)(readRefreshRefusal(), {
1512
+ : (0, auth_failure_1.describeRefreshRefusal)((0, auth_failure_1.refusalFromResponse)(body, readRefreshRefusal()), {
1436
1513
  bin: this.config.bin,
1437
1514
  cliId: this.cliConfig ? (0, cli_id_1.resolveCliId)(this.cliConfig) : undefined,
1438
1515
  });
@@ -1552,6 +1629,10 @@ class BaseCommand extends core_1.Command {
1552
1629
  status: e.status,
1553
1630
  exit: 4,
1554
1631
  retryable: false,
1632
+ // A typed 404 carries what the server found (a workflow signal names the nodes it CAN
1633
+ // resolve); dropping the body here made the 404 the one refusal with no machine-readable
1634
+ // details while every 409 kept them (OSK-16473).
1635
+ ...(body ? { details: envelopeDetails(body) } : {}),
1555
1636
  });
1556
1637
  }
1557
1638
  else if (e.code === 'ECONNREFUSED' ||
@@ -1584,7 +1665,7 @@ class BaseCommand extends core_1.Command {
1584
1665
  status: e.status,
1585
1666
  exit: 1,
1586
1667
  retryable: isRetryableFailure(e.status, body),
1587
- details: body ?? undefined,
1668
+ details: envelopeDetails(body),
1588
1669
  requestId: stringProp(body, 'requestId') || e.requestId,
1589
1670
  });
1590
1671
  }
@@ -1623,7 +1704,7 @@ class BaseCommand extends core_1.Command {
1623
1704
  status: e.status,
1624
1705
  exit: retryable ? 5 : 1,
1625
1706
  retryable,
1626
- details: body ?? undefined,
1707
+ details: envelopeDetails(body),
1627
1708
  ...(requestId ? { requestId } : {}),
1628
1709
  });
1629
1710
  }
@@ -1661,7 +1742,7 @@ class BaseCommand extends core_1.Command {
1661
1742
  status: e.status,
1662
1743
  exit: 5,
1663
1744
  retryable: true,
1664
- details: body ?? undefined,
1745
+ details: envelopeDetails(body),
1665
1746
  });
1666
1747
  }
1667
1748
  else if (typeof e.status === 'number' && e.status >= 500) {
@@ -1689,7 +1770,7 @@ class BaseCommand extends core_1.Command {
1689
1770
  status: e.status,
1690
1771
  exit: 1,
1691
1772
  retryable: isRetryableFailure(e.status, body),
1692
- details: body ?? undefined,
1773
+ details: envelopeDetails(body),
1693
1774
  });
1694
1775
  }
1695
1776
  else {
@@ -1699,7 +1780,7 @@ class BaseCommand extends core_1.Command {
1699
1780
  status: e.status,
1700
1781
  exit: 1,
1701
1782
  retryable: isRetryableFailure(e.status, body),
1702
- details: body ?? undefined,
1783
+ details: envelopeDetails(body),
1703
1784
  });
1704
1785
  }
1705
1786
  }
@@ -1802,7 +1883,7 @@ class BaseCommand extends core_1.Command {
1802
1883
  // that. Lead with the sign-in, name the refused refresh when one is latched,
1803
1884
  // and give the order the fix has to happen in: sign in, THEN replay.
1804
1885
  if (e.status === 401) {
1805
- const refusal = (0, auth_failure_1.describeRefreshRefusal)(readRefreshRefusal(), {
1886
+ const refusal = (0, auth_failure_1.describeRefreshRefusal)((0, auth_failure_1.refusalFromResponse)(parseErrorBody(err.body), readRefreshRefusal()), {
1806
1887
  bin: this.config.bin,
1807
1888
  cliId: this.cliConfig ? (0, cli_id_1.resolveCliId)(this.cliConfig) : undefined,
1808
1889
  });
@@ -1897,7 +1978,7 @@ class BaseCommand extends core_1.Command {
1897
1978
  /** E6: the server's `Retry-After` for the refused call, when it was a 429. */
1898
1979
  lastRetryAfterMs;
1899
1980
  writeJsonCliError({ message, code, status, exit, retryable, details, requestId, }) {
1900
- this.log(JSON.stringify({
1981
+ this.log(JSON.stringify(this.jsonOperationError({
1901
1982
  ok: false,
1902
1983
  error: {
1903
1984
  code,
@@ -1916,7 +1997,7 @@ class BaseCommand extends core_1.Command {
1916
1997
  ...(this.lastRetryAfterMs !== undefined ? { retryAfterMs: this.lastRetryAfterMs } : {}),
1917
1998
  ...(details ? { details } : {}),
1918
1999
  },
1919
- }, null, 2));
2000
+ }), null, 2));
1920
2001
  this.exit(exit);
1921
2002
  }
1922
2003
  /**
@@ -1982,7 +2063,13 @@ function parseGlobalFlags(argv) {
1982
2063
  function readRefreshRefusal() {
1983
2064
  try {
1984
2065
  const state = (0, auth_core_1.needsReauthState)();
1985
- return state.needed ? { reason: state.reason, message: state.message } : null;
2066
+ return state.needed
2067
+ ? {
2068
+ reason: state.reason,
2069
+ message: state.message,
2070
+ ...(state.revocationReason ? { revocationReason: state.revocationReason } : {}),
2071
+ }
2072
+ : null;
1986
2073
  }
1987
2074
  catch {
1988
2075
  return null;
@@ -2016,7 +2103,7 @@ function apiRefusal(err) {
2016
2103
  const body = parseErrorBody(err.body);
2017
2104
  return {
2018
2105
  code: stringProp(body, 'code') || stringProp(body, 'errorType'),
2019
- message: stringProp(body, 'message') || stringProp(body, 'error'),
2106
+ message: errorBodyMessage(body),
2020
2107
  ...(body ? { body } : {}),
2021
2108
  };
2022
2109
  }
@@ -2454,13 +2541,78 @@ const RETIRED_FLAG_REPLACEMENTS = {
2454
2541
  '`tasks deliverable add`.',
2455
2542
  '--supersede': '--supersede is implicit: submitting again creates a new Result version.',
2456
2543
  };
2457
- function retiredFlagHint(message) {
2544
+ /**
2545
+ * The human text of an API error body (OSK-16986). The server's error envelope guarantees
2546
+ * `message`; the legacy `error` string and the nested `{ error: { message } }` (`/v1`) are read
2547
+ * only for a server or a proxy that did not pass that boundary. Same order as
2548
+ * `errorBodyMessage` in `@skrr-ai/data-provider`, kept here because the CLI's specs replace that
2549
+ * package with partial mocks and this runs on every API failure.
2550
+ */
2551
+ function errorBodyMessage(body) {
2552
+ if (!body || typeof body !== 'object' || Array.isArray(body))
2553
+ return undefined;
2554
+ const record = body;
2555
+ const text = (value) => typeof value === 'string' && value.trim() !== '' ? value : undefined;
2556
+ const nested = record.error && typeof record.error === 'object' && !Array.isArray(record.error)
2557
+ ? record.error.message
2558
+ : undefined;
2559
+ return text(record.message) ?? text(record.error) ?? text(nested);
2560
+ }
2561
+ /**
2562
+ * The `details` of a CLI error envelope, in ONE shape. The server's refusal body becomes the
2563
+ * envelope's details; when that body carries its own `details` object (a typed refusal's
2564
+ * findings, e.g. `signalableNodeKeys`), those fields are lifted to the same level instead of
2565
+ * arriving as `error.details.details`, a depth no other error used (OSK-16494).
2566
+ *
2567
+ * The human text is always `details.message` (OSK-16986): the server's error envelope guarantees
2568
+ * it, and for an older server that wrote only `error` (or the nested `/v1` shape) it is filled
2569
+ * from there, so no caller reads two places. A lifted `details.message` cannot replace it.
2570
+ */
2571
+ function envelopeDetails(body) {
2572
+ if (!body)
2573
+ return undefined;
2574
+ const message = errorBodyMessage(body);
2575
+ const nested = body.details;
2576
+ const lifted = !nested || typeof nested !== 'object' || Array.isArray(nested)
2577
+ ? body
2578
+ : (() => {
2579
+ const { details: _nested, ...rest } = body;
2580
+ return { ...rest, ...nested };
2581
+ })();
2582
+ return message === undefined ? lifted : { ...lifted, message };
2583
+ }
2584
+ /**
2585
+ * The commands those flags were retired FROM. The table was applied to every command, so a
2586
+ * mis-quoted `"--outcome failed"` on `triggers audit` (where --outcome is a live flag) was told
2587
+ * "--outcome is now --summary" (OSK-16494). A rename is a fact about one command.
2588
+ */
2589
+ const RETIRED_FLAG_COMMANDS = new Set(['tasks:complete', 'tasks:result:submit']);
2590
+ /**
2591
+ * The hint for a `Nonexistent flags:` refusal, or null. Two cases:
2592
+ * - a flag retired from THIS command, which this command does not define again: where it went;
2593
+ * - a flag token holding a space (`"--outcome failed"` passed as one argument): what happened,
2594
+ * which oclif reports only as an unknown flag.
2595
+ */
2596
+ function retiredFlagHint(message, commandId, definedFlags = []) {
2458
2597
  if (!/nonexistent flag/i.test(message))
2459
2598
  return null;
2460
- const hits = Object.keys(RETIRED_FLAG_REPLACEMENTS).filter((flag) => new RegExp(`${flag}(?![\\w-])`).test(message));
2461
- if (hits.length === 0)
2462
- return null;
2463
- return hits.map((flag) => ` ${RETIRED_FLAG_REPLACEMENTS[flag]}`).join('\n');
2599
+ const lines = [];
2600
+ const quoted = /(?:^|[\s,:])(--[a-z][\w-]*)[ =]([^\s,][^,\n]*)/i.exec(message.slice(message.search(/nonexistent flag/i)));
2601
+ const quotedFlag = quoted?.[1];
2602
+ if (quotedFlag && definedFlags.includes(quotedFlag.replace(/^--/, ''))) {
2603
+ lines.push(` "${quoted[0].trim()}" reached the command as ONE argument, so it was read as a flag named ` +
2604
+ `"${quoted[0].trim()}". Pass the flag and its value separately: ${quotedFlag} ${quoted[2].trim()}`);
2605
+ }
2606
+ if (commandId && RETIRED_FLAG_COMMANDS.has(commandId)) {
2607
+ for (const flag of Object.keys(RETIRED_FLAG_REPLACEMENTS)) {
2608
+ if (definedFlags.includes(flag.replace(/^--/, '')))
2609
+ continue;
2610
+ if (new RegExp(`${flag}(?![\\w-])`).test(message)) {
2611
+ lines.push(` ${RETIRED_FLAG_REPLACEMENTS[flag]}`);
2612
+ }
2613
+ }
2614
+ }
2615
+ return lines.length ? lines.join('\n') : null;
2464
2616
  }
2465
2617
  /**
2466
2618
  * P6: a parse error used to say what was wrong and drop the remedy that text
@@ -2485,7 +2637,16 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
2485
2637
  `Pass --${flag} <value>. Run \`${helpCommand}\` for its description and accepted values.`,
2486
2638
  };
2487
2639
  }
2488
- const nonexistent = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)/i.exec(message);
2640
+ const nonexistent = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)(?:[ =]([^\s,][^,\n]*))?/i.exec(message);
2641
+ if (nonexistent?.[2]) {
2642
+ // `"--outcome failed"` arrived as ONE argument: the flag may well exist, so
2643
+ // "remove it" would be wrong advice. Same case retiredFlagHint explains in text.
2644
+ return {
2645
+ flag: nonexistent[1].replace(/^-+/, ''),
2646
+ fix: suggestion ??
2647
+ `Pass the flag and its value as separate arguments: ${nonexistent[1]} ${nonexistent[2].trim()}`,
2648
+ };
2649
+ }
2489
2650
  if (nonexistent) {
2490
2651
  return {
2491
2652
  flag: nonexistent[1].replace(/^-+/, ''),
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const list_output_1 = require("../../lib/list-output");
3
4
  const core_1 = require("@oclif/core");
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
@@ -38,7 +39,7 @@ class ActionsList extends base_command_1.BaseCommand {
38
39
  this.handleApiError(err);
39
40
  }
40
41
  if (flags.json) {
41
- this.log(JSON.stringify(response, null, 2));
42
+ this.printJsonResult((0, list_output_1.listResult)(response));
42
43
  return;
43
44
  }
44
45
  (0, action_listings_1.renderActionListings)(response.data, (line) => this.log(line));
@@ -38,7 +38,7 @@ class AgendaTriggerCreate extends base_command_1.BaseCommand {
38
38
  required: true,
39
39
  }),
40
40
  prompt: core_1.Flags.string({
41
- description: 'The instruction the agent receives when the trigger fires (max 4000 chars). Write in second person.',
41
+ description: `The instruction the agent receives when the trigger fires (max ${data_provider_1.TRIGGER_PROMPT_TEMPLATE_MAX_CHARS} chars). Write in second person.`,
42
42
  required: true,
43
43
  }),
44
44
  cron: core_1.Flags.string({
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isUnconfirmedTurnCapture = isUnconfirmedTurnCapture;
4
+ const list_output_1 = require("../../../lib/list-output");
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../../base-command");
@@ -55,7 +56,7 @@ class AgendaTriggerList extends base_command_1.BaseCommand {
55
56
  this.handleApiError(err);
56
57
  }
57
58
  if (flags.json) {
58
- this.log(JSON.stringify(response, null, 2));
59
+ this.printJsonResult((0, list_output_1.listResult)(response));
59
60
  return;
60
61
  }
61
62
  const r = response;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const list_output_1 = require("../../lib/list-output");
3
4
  const core_1 = require("@oclif/core");
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
@@ -24,7 +25,7 @@ class AgentGroupsList extends base_command_1.BaseCommand {
24
25
  this.handleApiError(err);
25
26
  }
26
27
  if (flags.json) {
27
- this.log(JSON.stringify(response, null, 2));
28
+ this.printJsonResult((0, list_output_1.listResult)(response));
28
29
  return;
29
30
  }
30
31
  // Defensive shape handling — accept either { data: [...] } or a plain array.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const list_output_1 = require("../../../lib/list-output");
3
4
  const core_1 = require("@oclif/core");
4
5
  const base_command_1 = require("../../../base-command");
5
6
  const agent_actions_1 = require("../../../lib/agent-actions");
@@ -27,7 +28,7 @@ class AgentsActionsList extends base_command_1.BaseCommand {
27
28
  this.handleApiError(err);
28
29
  }
29
30
  if (flags.json) {
30
- this.log(JSON.stringify(actions, null, 2));
31
+ this.printJsonResult((0, list_output_1.listResult)(actions));
31
32
  return;
32
33
  }
33
34
  (0, agent_actions_1.renderActions)(actions, (line) => this.log(line));
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
5
  const base_command_1 = require("../../../base-command");
6
+ const agent_proactive_baseline_1 = require("../../../lib/agent-proactive-baseline");
6
7
  /**
7
8
  * `skrr agents always-on status <agent-id>` — read the composed generation-aware
8
9
  * Always-On status envelope via the single control endpoint
@@ -62,6 +63,10 @@ class AgentsAlwaysOnStatus extends base_command_1.BaseCommand {
62
63
  const reasons = (status.messaging.degradedReasons || []).join(', ') || 'unknown';
63
64
  this.log(`Messaging: degraded (${reasons})`);
64
65
  }
66
+ // Read-only setup facts: who wrote the policy/Compass, which system loops
67
+ // and watchers exist, and the command that repairs each gap.
68
+ for (const line of (0, agent_proactive_baseline_1.proactiveBaselineLines)(status.proactiveBaseline))
69
+ this.log(line);
65
70
  }
66
71
  }
67
72
  exports.default = AgentsAlwaysOnStatus;