@skrr-ai/cli 0.1.22 → 0.1.24

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 (281) hide show
  1. package/README.md +83 -73
  2. package/bin/dev-fallback.js +221 -0
  3. package/bin/run.js +96 -0
  4. package/dist/base-command.d.ts +15 -0
  5. package/dist/base-command.js +145 -11
  6. package/dist/commands/agents/attach-harness.d.ts +37 -0
  7. package/dist/commands/agents/attach-harness.js +102 -3
  8. package/dist/commands/agents/chat.d.ts +69 -1
  9. package/dist/commands/agents/chat.js +202 -22
  10. package/dist/commands/agents/create.d.ts +38 -0
  11. package/dist/commands/agents/create.js +95 -2
  12. package/dist/commands/agents/schedule-trace.js +11 -0
  13. package/dist/commands/agents/show.js +29 -1
  14. package/dist/commands/api-keys/create.d.ts +24 -0
  15. package/dist/commands/api-keys/create.js +80 -0
  16. package/dist/commands/api-keys/list.d.ts +11 -0
  17. package/dist/commands/api-keys/list.js +42 -0
  18. package/dist/commands/api-keys/revoke.d.ts +14 -0
  19. package/dist/commands/api-keys/revoke.js +33 -0
  20. package/dist/commands/api-keys/rotate.d.ts +19 -0
  21. package/dist/commands/api-keys/rotate.js +42 -0
  22. package/dist/commands/balance/index.d.ts +18 -0
  23. package/dist/commands/balance/index.js +29 -0
  24. package/dist/commands/balance/show.d.ts +25 -0
  25. package/dist/commands/balance/show.js +60 -0
  26. package/dist/commands/balance/statement.d.ts +19 -0
  27. package/dist/commands/balance/statement.js +52 -0
  28. package/dist/commands/browser/doctor.d.ts +11 -0
  29. package/dist/commands/browser/doctor.js +11 -0
  30. package/dist/commands/code/jobs/approve.d.ts +25 -0
  31. package/dist/commands/code/jobs/approve.js +52 -0
  32. package/dist/commands/code/jobs/cancel.d.ts +12 -0
  33. package/dist/commands/code/jobs/cancel.js +39 -0
  34. package/dist/commands/code/jobs/index.d.ts +19 -0
  35. package/dist/commands/code/jobs/index.js +38 -0
  36. package/dist/commands/code/jobs/list.d.ts +12 -0
  37. package/dist/commands/code/jobs/list.js +87 -0
  38. package/dist/commands/code/jobs/run.d.ts +32 -0
  39. package/dist/commands/code/jobs/run.js +151 -0
  40. package/dist/commands/code/jobs/show.d.ts +12 -0
  41. package/dist/commands/code/jobs/show.js +86 -0
  42. package/dist/commands/commitments/preflight.js +18 -4
  43. package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
  44. package/dist/commands/commitments/receipt-metrics.js +78 -0
  45. package/dist/commands/convos/search.js +5 -5
  46. package/dist/commands/harnesses/leases/list.d.ts +3 -0
  47. package/dist/commands/harnesses/leases/list.js +59 -12
  48. package/dist/commands/harnesses/leases/show.js +36 -0
  49. package/dist/commands/harnesses/list.d.ts +18 -0
  50. package/dist/commands/harnesses/list.js +30 -0
  51. package/dist/commands/harnesses/products.js +49 -3
  52. package/dist/commands/harnesses/quota.d.ts +16 -0
  53. package/dist/commands/harnesses/quota.js +26 -1
  54. package/dist/commands/harnesses/usage.js +17 -0
  55. package/dist/commands/inbox/index.d.ts +2 -1
  56. package/dist/commands/inbox/index.js +27 -4
  57. package/dist/commands/login.js +4 -1
  58. package/dist/commands/machines/dedicated/create.d.ts +18 -0
  59. package/dist/commands/machines/dedicated/create.js +90 -0
  60. package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
  61. package/dist/commands/machines/dedicated/destroy.js +56 -0
  62. package/dist/commands/machines/dedicated/grow.d.ts +13 -0
  63. package/dist/commands/machines/dedicated/grow.js +46 -0
  64. package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
  65. package/dist/commands/machines/dedicated/health-check.js +42 -0
  66. package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
  67. package/dist/commands/machines/dedicated/incident-close.js +42 -0
  68. package/dist/commands/machines/dedicated/index.d.ts +6 -0
  69. package/dist/commands/machines/dedicated/index.js +39 -0
  70. package/dist/commands/machines/dedicated/list.d.ts +11 -0
  71. package/dist/commands/machines/dedicated/list.js +58 -0
  72. package/dist/commands/machines/dedicated/restart.d.ts +12 -0
  73. package/dist/commands/machines/dedicated/restart.js +42 -0
  74. package/dist/commands/machines/dedicated/show.d.ts +12 -0
  75. package/dist/commands/machines/dedicated/show.js +58 -0
  76. package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
  77. package/dist/commands/machines/dedicated/snapshot.js +42 -0
  78. package/dist/commands/machines/dedicated/start.d.ts +12 -0
  79. package/dist/commands/machines/dedicated/start.js +42 -0
  80. package/dist/commands/machines/dedicated/stop.d.ts +12 -0
  81. package/dist/commands/machines/dedicated/stop.js +42 -0
  82. package/dist/commands/machines/hosted/index.js +4 -1
  83. package/dist/commands/machines/list.d.ts +1 -0
  84. package/dist/commands/machines/list.js +33 -5
  85. package/dist/commands/memory/approvals/issue.d.ts +18 -0
  86. package/dist/commands/memory/approvals/issue.js +63 -0
  87. package/dist/commands/memory/commit.js +5 -2
  88. package/dist/commands/memory/context.d.ts +3 -2
  89. package/dist/commands/memory/context.js +9 -11
  90. package/dist/commands/memory/delete.d.ts +1 -1
  91. package/dist/commands/memory/list.d.ts +1 -1
  92. package/dist/commands/memory/list.js +1 -1
  93. package/dist/commands/memory/mounts/resolve.d.ts +10 -0
  94. package/dist/commands/memory/mounts/resolve.js +27 -0
  95. package/dist/commands/memory/proposals/commit.d.ts +18 -0
  96. package/dist/commands/memory/proposals/commit.js +32 -0
  97. package/dist/commands/memory/proposals/create.d.ts +18 -0
  98. package/dist/commands/memory/proposals/create.js +56 -0
  99. package/dist/commands/memory/proposals/list.d.ts +13 -0
  100. package/dist/commands/memory/proposals/list.js +31 -0
  101. package/dist/commands/memory/proposals/promote.d.ts +22 -0
  102. package/dist/commands/memory/proposals/promote.js +33 -0
  103. package/dist/commands/memory/proposals/reject.d.ts +16 -0
  104. package/dist/commands/memory/proposals/reject.js +28 -0
  105. package/dist/commands/memory/rebuild-index.d.ts +20 -0
  106. package/dist/commands/memory/rebuild-index.js +25 -0
  107. package/dist/commands/memory/save.d.ts +1 -1
  108. package/dist/commands/memory/save.js +1 -1
  109. package/dist/commands/memory/search.d.ts +6 -3
  110. package/dist/commands/memory/search.js +27 -3
  111. package/dist/commands/memory/show.d.ts +1 -1
  112. package/dist/commands/memory/stores/archive.d.ts +14 -0
  113. package/dist/commands/memory/stores/archive.js +31 -0
  114. package/dist/commands/memory/stores/create.d.ts +12 -0
  115. package/dist/commands/memory/stores/create.js +30 -0
  116. package/dist/commands/memory/stores/delete.d.ts +15 -0
  117. package/dist/commands/memory/stores/delete.js +38 -0
  118. package/dist/commands/memory/stores/list.d.ts +10 -0
  119. package/dist/commands/memory/stores/list.js +29 -0
  120. package/dist/commands/memory/stores/show.d.ts +12 -0
  121. package/dist/commands/memory/stores/show.js +14 -0
  122. package/dist/commands/memory/stores/update.d.ts +15 -0
  123. package/dist/commands/memory/stores/update.js +39 -0
  124. package/dist/commands/memory/sync/delete.d.ts +13 -0
  125. package/dist/commands/memory/sync/delete.js +35 -0
  126. package/dist/commands/memory/sync/pull.d.ts +19 -0
  127. package/dist/commands/memory/sync/pull.js +52 -0
  128. package/dist/commands/memory/sync/push.d.ts +18 -0
  129. package/dist/commands/memory/sync/push.js +115 -0
  130. package/dist/commands/memory/sync/resolve.d.ts +23 -0
  131. package/dist/commands/memory/sync/resolve.js +27 -0
  132. package/dist/commands/memory/sync/status.d.ts +9 -0
  133. package/dist/commands/memory/sync/status.js +22 -0
  134. package/dist/commands/memory/topics/archive.d.ts +20 -0
  135. package/dist/commands/memory/topics/archive.js +29 -0
  136. package/dist/commands/memory/topics/create.d.ts +23 -0
  137. package/dist/commands/memory/topics/create.js +46 -0
  138. package/dist/commands/memory/topics/delete.d.ts +22 -0
  139. package/dist/commands/memory/topics/delete.js +30 -0
  140. package/dist/commands/memory/topics/forget.d.ts +22 -0
  141. package/dist/commands/memory/topics/forget.js +29 -0
  142. package/dist/commands/memory/topics/list.d.ts +13 -0
  143. package/dist/commands/memory/topics/list.js +22 -0
  144. package/dist/commands/memory/topics/move.d.ts +22 -0
  145. package/dist/commands/memory/topics/move.js +26 -0
  146. package/dist/commands/memory/topics/show.d.ts +17 -0
  147. package/dist/commands/memory/topics/show.js +21 -0
  148. package/dist/commands/memory/topics/update.d.ts +23 -0
  149. package/dist/commands/memory/topics/update.js +27 -0
  150. package/dist/commands/memory/tree.d.ts +5 -2
  151. package/dist/commands/memory/tree.js +20 -2
  152. package/dist/commands/memory/update.d.ts +1 -1
  153. package/dist/commands/memory/versions/list.d.ts +16 -0
  154. package/dist/commands/memory/versions/list.js +22 -0
  155. package/dist/commands/memory/versions/redact.d.ts +21 -0
  156. package/dist/commands/memory/versions/redact.js +22 -0
  157. package/dist/commands/memory/versions/restore.d.ts +20 -0
  158. package/dist/commands/memory/versions/restore.js +16 -0
  159. package/dist/commands/memory/versions/show.d.ts +15 -0
  160. package/dist/commands/memory/versions/show.js +17 -0
  161. package/dist/commands/messages/list.js +25 -8
  162. package/dist/commands/messages/show.js +10 -0
  163. package/dist/commands/spaces/update.js +16 -12
  164. package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
  165. package/dist/commands/spaces/work-sync/reconcile.js +90 -0
  166. package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
  167. package/dist/commands/spaces/work-sync/telemetry.js +96 -0
  168. package/dist/commands/store/install.js +5 -1
  169. package/dist/commands/store/releases.js +1 -1
  170. package/dist/commands/store/update.js +5 -1
  171. package/dist/commands/subscriptions/cancel.js +5 -1
  172. package/dist/commands/subscriptions/health.js +5 -1
  173. package/dist/commands/subscriptions/status.js +5 -1
  174. package/dist/commands/subscriptions/subscribe.js +5 -1
  175. package/dist/commands/tasks/activity.d.ts +2 -3
  176. package/dist/commands/tasks/activity.js +20 -6
  177. package/dist/commands/tasks/complete.d.ts +22 -150
  178. package/dist/commands/tasks/complete.js +174 -599
  179. package/dist/commands/tasks/create.d.ts +6 -0
  180. package/dist/commands/tasks/create.js +114 -4
  181. package/dist/commands/tasks/deliverable/add.d.ts +8 -0
  182. package/dist/commands/tasks/deliverable/add.js +62 -11
  183. package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
  184. package/dist/commands/tasks/deliverable/confirm.js +9 -18
  185. package/dist/commands/tasks/deliverable/list.d.ts +12 -0
  186. package/dist/commands/tasks/deliverable/list.js +58 -0
  187. package/dist/commands/tasks/events/append.d.ts +2 -0
  188. package/dist/commands/tasks/events/append.js +41 -6
  189. package/dist/commands/tasks/events/list.d.ts +1 -0
  190. package/dist/commands/tasks/events/list.js +1 -0
  191. package/dist/commands/tasks/events/tail.d.ts +1 -0
  192. package/dist/commands/tasks/events/tail.js +1 -0
  193. package/dist/commands/tasks/expectations/assess.d.ts +21 -0
  194. package/dist/commands/tasks/expectations/assess.js +103 -0
  195. package/dist/commands/tasks/expectations.js +121 -25
  196. package/dist/commands/tasks/judge.d.ts +1 -0
  197. package/dist/commands/tasks/judge.js +2 -1
  198. package/dist/commands/tasks/output.d.ts +1 -11
  199. package/dist/commands/tasks/output.js +80 -141
  200. package/dist/commands/tasks/report.d.ts +3 -3
  201. package/dist/commands/tasks/report.js +66 -41
  202. package/dist/commands/tasks/resource/add.d.ts +23 -0
  203. package/dist/commands/tasks/resource/add.js +76 -0
  204. package/dist/commands/tasks/resource/list.d.ts +13 -0
  205. package/dist/commands/tasks/resource/list.js +41 -0
  206. package/dist/commands/tasks/result/show.d.ts +13 -0
  207. package/dist/commands/tasks/result/show.js +64 -0
  208. package/dist/commands/tasks/result/submit.d.ts +26 -0
  209. package/dist/commands/tasks/result/submit.js +134 -0
  210. package/dist/commands/tasks/resume/save.d.ts +16 -0
  211. package/dist/commands/tasks/resume/save.js +69 -0
  212. package/dist/commands/tasks/resume/show.d.ts +13 -0
  213. package/dist/commands/tasks/resume/show.js +35 -0
  214. package/dist/commands/tasks/review.d.ts +17 -0
  215. package/dist/commands/tasks/review.js +54 -0
  216. package/dist/commands/tasks/runs.js +5 -0
  217. package/dist/commands/tasks/self-schedule.js +7 -4
  218. package/dist/commands/tasks/show.js +19 -0
  219. package/dist/commands/tasks/timeline.d.ts +2 -2
  220. package/dist/commands/tasks/timeline.js +19 -24
  221. package/dist/commands/tasks/updates/add.d.ts +22 -0
  222. package/dist/commands/tasks/updates/add.js +122 -0
  223. package/dist/commands/tasks/updates/list.d.ts +15 -0
  224. package/dist/commands/tasks/updates/list.js +57 -0
  225. package/dist/commands/tasks/waive.d.ts +1 -0
  226. package/dist/commands/tasks/waive.js +2 -1
  227. package/dist/lib/agentic-stream.d.ts +257 -0
  228. package/dist/lib/agentic-stream.js +490 -33
  229. package/dist/lib/balance.d.ts +8 -0
  230. package/dist/lib/commitment-product.d.ts +10 -1
  231. package/dist/lib/commitment-product.js +66 -2
  232. package/dist/lib/commitments.d.ts +2 -1
  233. package/dist/lib/commitments.js +1 -0
  234. package/dist/lib/conversation-search.d.ts +3 -0
  235. package/dist/lib/conversation-search.js +75 -0
  236. package/dist/lib/dedicated-machines.d.ts +66 -0
  237. package/dist/lib/dedicated-machines.js +161 -0
  238. package/dist/lib/execution-target.d.ts +21 -0
  239. package/dist/lib/execution-target.js +22 -6
  240. package/dist/lib/harnesses.d.ts +87 -6
  241. package/dist/lib/harnesses.js +32 -1
  242. package/dist/lib/hosted-machines.js +9 -0
  243. package/dist/lib/inbox.d.ts +2 -1
  244. package/dist/lib/machines.d.ts +17 -0
  245. package/dist/lib/machines.js +29 -0
  246. package/dist/lib/managed-agent-keys.d.ts +104 -0
  247. package/dist/lib/managed-agent-keys.js +50 -0
  248. package/dist/lib/memory-scope.d.ts +4 -3
  249. package/dist/lib/memory-scope.js +9 -9
  250. package/dist/lib/memory-sync.d.ts +114 -0
  251. package/dist/lib/memory-sync.js +730 -0
  252. package/dist/lib/message-provenance.d.ts +42 -0
  253. package/dist/lib/message-provenance.js +89 -0
  254. package/dist/lib/scoped-memory-command.d.ts +68 -0
  255. package/dist/lib/scoped-memory-command.js +183 -0
  256. package/dist/lib/session-task-endpoints.d.ts +1 -1
  257. package/dist/lib/session-task-endpoints.js +7 -0
  258. package/dist/lib/sky-code-broker.d.ts +47 -0
  259. package/dist/lib/sky-code-broker.js +50 -0
  260. package/dist/lib/sky-code-doctor.js +10 -1
  261. package/dist/lib/task-artifact-flags.d.ts +2 -0
  262. package/dist/lib/task-artifact-flags.js +7 -0
  263. package/dist/lib/task-execution.d.ts +4 -5
  264. package/dist/lib/task-execution.js +4 -5
  265. package/dist/lib/task-extras.d.ts +1 -5
  266. package/dist/lib/task-extras.js +1 -5
  267. package/dist/lib/task-legacy.d.ts +24 -0
  268. package/dist/lib/task-legacy.js +48 -0
  269. package/dist/lib/task-transcript.d.ts +5 -7
  270. package/dist/lib/task-transcript.js +8 -16
  271. package/dist/lib/tasks.d.ts +39 -21
  272. package/dist/lib/tasks.js +64 -21
  273. package/dist/lib/triggers.d.ts +39 -1
  274. package/dist/lib/triggers.js +70 -2
  275. package/dist/lib/usage-discovery.d.ts +17 -1
  276. package/dist/lib/usage-discovery.js +17 -1
  277. package/dist/lib/work-sync.d.ts +70 -0
  278. package/dist/lib/work-sync.js +29 -0
  279. package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
  280. package/oclif.manifest.json +14653 -7813
  281. package/package.json +26 -5
package/README.md CHANGED
@@ -12,50 +12,54 @@ observability), and shared links.
12
12
 
13
13
  ### Command Catalog
14
14
 
15
- | Topic | Commands |
16
- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | **auth** | `login`, `logout`, `whoami` |
18
- | **convos** | `list` (`--agent`, `--search`, `--tag`, `--archived`, `--order`), `show`, `update`, `delete`, `archive`, `unarchive`, `fork`, `duplicate`, `import` |
19
- | **messages** | `list` (`--limit`, `--head`), `show`, `update`, `update-content`, `feedback`, `edit-artifact` |
20
- | **agent call** | `request`, `show`, `cancel` — autonomous Agent → owner app voice-call invites; the owner must accept before a LiveKit call starts |
21
- | **shares** (conversation share links) | `list`, `get`, `link-for`, `create`, `update`, `delete` |
22
- | **agents** | `list`, `show`, `overview`, `chat`, `create`, `update`, `attach-harness`, `delete`, `duplicate`, `revert`, `versions`, `visibility`, `schedule`, `upcoming`, `plan-day`, `reflect`, `schedule-overview`, `activity` |
23
- | **agents triggers** | `list`, `create`, `show`, `update`, `enable`, `disable`, `fire`, `delete`, `runs`, `replay`, `policy` (agent-scoped facade over the universal trigger engine) |
24
- | **agents todos** | `list`, `create`, `cancel` (the day-plan feed; Smart Schedule = `agents plan-day`) |
25
- | **agent-groups** | `list`, `show`, `create`, `update`, `delete`, `add`, `remove` |
26
- | **agent-shares** | `received`, `sent`, `with`, `list-for`, `create`, `accept`, `decline`, `revoke`, `leave` |
27
- | **triggers** | `list`, `show`, `create`, `update`, `delete`, `enable`, `disable`, `fire`, `fire-detail`, `replay`, `audit`, `capabilities`, `event-catalog`, `parse-intent`, `rotate-secret` |
28
- | **spaces** | `list`, `show`, `create`, `update`, `delete`, `archive`, `unarchive`, `tasks`, `conversations`, `snapshot`, `goals`, `revisions`, `subspaces`, `move`, `reorder`, `pin`, `summary`, `bootstrap`, `capacity`, `auto-executor update/preview/run` |
29
- | **spaces members** | `list`, `search`, `add`, `remove` |
30
- | **spaces briefs** | `list`, `get`, `set`, `delete` |
31
- | **spaces files** | `list`, `upload`, `rename`, `move`, `delete`, `folders list/create/update/delete` |
32
- | **spaces actions** | `list`, `add`, `update`, `delete`, `replace` |
33
- | **spaces views** | `list`, `create`, `update`, `delete`, `duplicate`, `reorder` |
34
- | **spaces live** | `scene`, `cards list/create/update/delete/reorder` |
35
- | **spaces preferences** | `show`, `tabs` |
36
- | **spaces heartbeats** | `list`, `create`, `update`, `delete`, `status` |
37
- | **spaces triggers** | `show`, `set`, `delete` |
38
- | **spaces widgets** | `list`, `add`, `remove` |
39
- | **spaces skills** | `list`, `add`, `remove`, `pin` |
40
- | **spaces labels** | `list`, `add`, `remove` (attach/detach; filter with `spaces list --label`) |
41
- | **labels** | `list`, `palette`, `create`, `update`, `archive`, `restore`, `delete`, `reorder` (unified labels across `user`, `space`, and `workspace` scopes) |
42
- | **chats triggers** | `show`, `set` |
43
- | **dm** | `list`, `show`, `messages`, `threads`, `thread show/messages/follow/mute/share`, `send` (agent 1:1 main chat and Slack-style Thread controls) |
44
- | **diagnostics** | `context`, `doctor`, `usage`, `commands` (agent-friendly runtime identity, readiness, progressive token-budgeted discovery, and complete machine-readable schemas) |
45
- | **goals** | `list`, `show`, `create`, `update`, `delete`, `descendants`, `tasks`, `archive`, `revisions` |
46
- | **commitments** | `list`, `show`, `create`, `plan`, `preflight`, `update`, `checks`, `check-now`, `action-proposals`, `autonomy`, `pause`, `resume`, `complete`, `subject`, `attach`, `detach`, `reports`, `export`, `import`, `fork` (durable agent commitment contracts) |
47
- | **goals briefing** | `enable`, `disable`, `preview` |
48
- | **tasks** | `list`, `show`, `create`, `upsert`, `create-tree`, `bulk-update`, `tree`, `update`, `delete`, `actionability`, `ready`, `start`, `active`, `monitor`, `watch`, `wait`, `continue-ready`, `move`, `complete`, `children`, `ancestors`, `descendants`, `activity`, `runs`, `execution-summary`, `execution-timeline`, `replay`, `checkout`, `release`, `start-all`, `cancel-cascade`, `cascade-status`, `dri-status`, `duplicate-pipeline`, `archive`, `today`, `prompt-log`, `revisions`, `transcript`, `output` |
49
- | **tasks input** | `show`, `answer`, `dismiss` (durable Human-input handoff) |
50
- | **tasks comments** | `list`, `add`, `anchor`, `delete`, `resolve`, `reopen` (human collaboration threads) |
51
- | **tasks events** | `append`, `list`, `tail` (canonical typed append-only task facts) |
52
- | **tasks labels** | `list`, `create`, `delete` |
53
- | **tasks approvals** | `list`, `create`, `delete`, `resolve` |
54
- | **tasks attachments** | `list`, `delete`, `upload`, `download` |
55
- | **integrations** | `toolkits`, `search`, `execute`, `tools list`, `tools allow`, `connections connect`, `connections list`, `connections finalize`, `connections disconnect`, `connections reconnect` |
56
- | **runtimes** | `start`, `list`, `status`, `exec`, `pull`, `connect`, `pause`, `resume`, `destroy` (OverSky Hosted Machine workspaces backed by the server runtime engine) |
57
- | **github** | `connect`, `finalize`, `connections`, `tools`, `run`, `allow-tools`, `reconnect`, `disconnect` |
58
- | **slack** | `send-as-agent`, `list-channels`, `list-users`, `read-channel`, `read-thread`, `tools`, `run` |
15
+ | Topic | Commands |
16
+ | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | **auth** | `login`, `logout`, `whoami` |
18
+ | **convos** | `list` (`--agent`, `--search`, `--tag`, `--archived`, `--order`), `show`, `update`, `delete`, `archive`, `unarchive`, `fork`, `duplicate`, `import` |
19
+ | **messages** | `list` (`--limit`, `--head`), `show`, `update`, `update-content`, `feedback`, `edit-artifact` |
20
+ | **agent call** | `request`, `show`, `cancel` — autonomous Agent → owner app voice-call invites; the owner must accept before a LiveKit call starts |
21
+ | **shares** (conversation share links) | `list`, `get`, `link-for`, `create`, `update`, `delete` |
22
+ | **agents** | `list`, `show`, `overview`, `chat`, `create`, `update`, `attach-harness`, `delete`, `duplicate`, `revert`, `versions`, `visibility`, `schedule`, `upcoming`, `plan-day`, `reflect`, `schedule-overview`, `activity` |
23
+ | **agents triggers** | `list`, `create`, `show`, `update`, `enable`, `disable`, `fire`, `delete`, `runs`, `replay`, `policy` (agent-scoped facade over the universal trigger engine) |
24
+ | **agents todos** | `list`, `create`, `cancel` (the day-plan feed; Smart Schedule = `agents plan-day`) |
25
+ | **agent-groups** | `list`, `show`, `create`, `update`, `delete`, `add`, `remove` |
26
+ | **agent-shares** | `received`, `sent`, `with`, `list-for`, `create`, `accept`, `decline`, `revoke`, `leave` |
27
+ | **triggers** | `list`, `show`, `create`, `update`, `delete`, `enable`, `disable`, `fire`, `fire-detail`, `replay`, `audit`, `capabilities`, `event-catalog`, `parse-intent`, `rotate-secret` |
28
+ | **spaces** | `list`, `show`, `create`, `update`, `delete`, `archive`, `unarchive`, `tasks`, `conversations`, `snapshot`, `goals`, `revisions`, `subspaces`, `move`, `reorder`, `pin`, `summary`, `bootstrap`, `capacity`, `auto-executor update/preview/run` |
29
+ | **spaces members** | `list`, `search`, `add`, `remove` |
30
+ | **spaces briefs** | `list`, `get`, `set`, `delete` |
31
+ | **spaces files** | `list`, `upload`, `rename`, `move`, `delete`, `folders list/create/update/delete` |
32
+ | **spaces actions** | `list`, `add`, `update`, `delete`, `replace` |
33
+ | **spaces views** | `list`, `create`, `update`, `delete`, `duplicate`, `reorder` |
34
+ | **spaces live** | `scene`, `cards list/create/update/delete/reorder` |
35
+ | **spaces preferences** | `show`, `tabs` |
36
+ | **spaces heartbeats** | `list`, `create`, `update`, `delete`, `status` |
37
+ | **spaces triggers** | `show`, `set`, `delete` |
38
+ | **spaces widgets** | `list`, `add`, `remove` |
39
+ | **spaces skills** | `list`, `add`, `remove`, `pin` |
40
+ | **spaces labels** | `list`, `add`, `remove` (attach/detach; filter with `spaces list --label`) |
41
+ | **labels** | `list`, `palette`, `create`, `update`, `archive`, `restore`, `delete`, `reorder` (unified labels across `user`, `space`, and `workspace` scopes) |
42
+ | **chats triggers** | `show`, `set` |
43
+ | **dm** | `list`, `show`, `messages`, `threads`, `thread show/messages/follow/mute/share`, `send` (agent 1:1 main chat and Slack-style Thread controls) |
44
+ | **diagnostics** | `context`, `doctor`, `usage`, `commands` (agent-friendly runtime identity, readiness, progressive token-budgeted discovery, and complete machine-readable schemas) |
45
+ | **goals** | `list`, `show`, `create`, `update`, `delete`, `descendants`, `tasks`, `archive`, `revisions` |
46
+ | **commitments** | `list`, `show`, `create`, `plan`, `preflight`, `update`, `checks`, `check-now`, `action-proposals`, `autonomy`, `pause`, `resume`, `complete`, `subject`, `attach`, `detach`, `reports`, `export`, `import`, `fork` (durable agent commitment contracts) |
47
+ | **goals briefing** | `enable`, `disable`, `preview` |
48
+ | **tasks** | `list`, `show`, `create`, `upsert`, `create-tree`, `bulk-update`, `tree`, `update`, `delete`, `actionability`, `ready`, `start`, `active`, `monitor`, `watch`, `wait`, `continue-ready`, `move`, `complete`, `children`, `ancestors`, `descendants`, `activity`, `runs`, `execution-summary`, `execution-timeline`, `replay`, `checkout`, `release`, `start-all`, `cancel-cascade`, `cascade-status`, `dri-status`, `duplicate-pipeline`, `archive`, `today`, `prompt-log`, `revisions`, `transcript` |
49
+ | **tasks input** | `show`, `answer`, `dismiss` (durable Human-input handoff) |
50
+ | **tasks comments** | `list`, `add`, `anchor`, `delete`, `resolve`, `reopen` (human collaboration threads) |
51
+ | **tasks updates** | `add`, `list` (meaningful, typed, append-only progress, findings, decisions, blockers, and verification) |
52
+ | **tasks resume** | `save`, `show` (Run- and Task-spec-bound recovery snapshots) |
53
+ | **tasks result** | `submit`, `show` (immutable Result versions and exact Review state) |
54
+ | **tasks resource** | `add`, `list` (versioned inputs, references, evidence, attachments, and Deliverables) |
55
+ | **tasks deliverable** | `add`, `list`, `confirm` (the user-facing produced-Resource workflow) |
56
+ | **tasks labels** | `list`, `create`, `delete` |
57
+ | **tasks approvals** | `list`, `create`, `delete`, `resolve` |
58
+ | **tasks attachments** | `list`, `delete`, `upload`, `download` |
59
+ | **integrations** | `toolkits`, `search`, `execute`, `tools list`, `tools allow`, `connections connect`, `connections list`, `connections finalize`, `connections disconnect`, `connections reconnect` |
60
+ | **runtimes** | `start`, `list`, `status`, `exec`, `pull`, `connect`, `pause`, `resume`, `destroy` (OverSky Hosted Machine workspaces backed by the server runtime engine) |
61
+ | **github** | `connect`, `finalize`, `connections`, `tools`, `run`, `allow-tools`, `reconnect`, `disconnect` |
62
+ | **slack** | `send-as-agent`, `list-channels`, `list-users`, `read-channel`, `read-thread`, `tools`, `run` |
59
63
 
60
64
  ### Reading history (conversations, tasks, agent output)
61
65
 
@@ -74,7 +78,7 @@ Tasks, and what the agent actually produced:
74
78
  ```bash
75
79
  sky tasks list --assignee-agent <agent-id> # what this agent is working on
76
80
  sky tasks show <task-id> # includes the Convo: pointer
77
- sky tasks output <task-id> # verdict + last-run + final agent message
81
+ sky tasks result show <task-id> # current Result + exact Review
78
82
  sky tasks transcript <task-id> --assistant-only # full agent transcript, no prompt
79
83
  sky tasks comments list <task-id> # raw comment thread
80
84
  ```
@@ -1004,7 +1008,7 @@ Create persistent, personalized Task Views that can select exact task IDs or
1004
1008
  apply criteria across one or more Spaces. The create/show JSON response includes
1005
1009
  a durable `url`; opening it displays the view in a focused modal.
1006
1010
 
1007
- ```bash
1011
+ ````bash
1008
1012
  sky views create --name "Launch scope" --task-id <task-id> --task-id <task-id>
1009
1013
  sky views create --name "Cross-space blockers" \
1010
1014
  --space <space-id> --space <space-id> --status blocked --group-by space
@@ -1023,7 +1027,7 @@ sky space-directory-views list --json
1023
1027
  sky space-directory-views create --name "Active delivery" --config '{"schemaVersion":1,"layout":"list"}' --json
1024
1028
  sky space-directory-views update <view-id> --version 3 --from-json ./space-view-patch.json
1025
1029
  sky space-directory-views delete <view-id> --version 3 --yes
1026
- ```
1030
+ ````
1027
1031
 
1028
1032
  ### `sky work-views ...`
1029
1033
 
@@ -1036,7 +1040,8 @@ sky work-views update <view-id> --version 2 --from-json ./work-view-patch.json
1036
1040
  sky work-views result <view-id> --json
1037
1041
  sky work-views delete <view-id> --version 2 --yes
1038
1042
  ```
1039
- ```
1043
+
1044
+ ````
1040
1045
 
1041
1046
  ### `sky spaces live ...`
1042
1047
 
@@ -1050,7 +1055,7 @@ sky spaces live cards create <space-id> --kind tasks --title Tasks --slot top
1050
1055
  sky spaces live cards update <space-id> <card-id> --enabled
1051
1056
  sky spaces live cards reorder <space-id> --card <card-id> --card <other-card-id>
1052
1057
  sky spaces live cards delete <space-id> <card-id> --yes
1053
- ```
1058
+ ````
1054
1059
 
1055
1060
  ### `sky spaces preferences ...`
1056
1061
 
@@ -1296,8 +1301,8 @@ positional when the current task is obvious:
1296
1301
  ```bash
1297
1302
  sky tasks show --json
1298
1303
  sky tasks comments add --body "Done investigating." --json # human discussion comment
1299
- sky tasks events append --kind checkpoint --summary "Done investigating." --idempotency-key investigation-1 --json
1300
- sky tasks complete --summary "Shipped the fix." --artifacts none --verdict approved --json
1304
+ sky tasks updates add --type progress --summary "Done investigating." --data '{"completedSinceLast":["Root cause confirmed"],"nextActions":["Implement fix"]}' --json
1305
+ sky tasks complete --summary "Shipped and verified the fix." --json
1301
1306
  sky tasks move --status in_progress --json
1302
1307
  ```
1303
1308
 
@@ -1508,19 +1513,21 @@ to transition between states like `todo`, `in_progress`, `blocked`, or
1508
1513
 
1509
1514
  ### `sky tasks complete [id]`
1510
1515
 
1511
- Post the canonical `---TASK_OUTPUT---` closeout comment and move the task to a
1512
- terminal status. In a task daemon session, omit the id to complete the current
1513
- task.
1516
+ Submit one versioned Result and advance the Task workflow. An Agent-submitted
1517
+ Result stops in review until an independent reviewer accepts that exact Result;
1518
+ a machine Comment is never used as the closeout record. In a task daemon
1519
+ session, omit the id to use the bound Task and Run.
1514
1520
 
1515
1521
  ```bash
1516
- sky tasks complete --summary "Shipped the fix." --artifacts none --verdict approved --json
1517
- sky tasks complete <task-id> --summary "Shipped the fix." --verdict approved
1518
- sky tasks complete --task <task-id> --status failed --summary "Blocked by missing access" --verdict blocked
1519
- sky tasks complete --from-json task-output.json --json
1522
+ sky tasks complete --summary "Shipped and verified the fix" --deliverable <resource-link-id> --json
1523
+ sky tasks complete <task-id> --summary "Do not ship" --conclusion-type release_recommendation --conclusion-json '{"posture":"no_ship"}'
1524
+ sky tasks complete --task <task-id> --status blocked --summary "Waiting for access" --remaining "A workspace owner must grant access"
1525
+ sky tasks complete --from-json task-result.json --json
1520
1526
  ```
1521
1527
 
1522
- `--status completed` moves the task to `done`; `--status failed` moves it to
1523
- `failed`. Pass `--no-move` when another runner owns the status transition.
1528
+ Use `sky tasks result submit` when the Result should be recorded without a
1529
+ workflow transition. Use `sky tasks review` to accept or request changes on an
1530
+ exact Result version.
1524
1531
 
1525
1532
  ### `sky tasks delete <id>`
1526
1533
 
@@ -1824,19 +1831,22 @@ sky tasks list --space <space-id> --json | jq '.data[] | select(.priority == "hi
1824
1831
 
1825
1832
  The commands that move a task through its lifecycle, most to least common:
1826
1833
 
1827
- | Action | Command |
1828
- | ------------------- | ------------------------------------------------------------------ |
1829
- | Complete task | `sky tasks complete [id] --summary "..." --verdict approved` |
1830
- | Change status | `sky tasks move [id] --status <new-status>` |
1831
- | Start execution | `sky tasks start [id]` (optionally `--skill <id>`) |
1832
- | Stop a running task | `sky tasks interrupt <id>` |
1833
- | Run via DRI agent | `sky tasks dri-run <id>` / `sky tasks dri-plan <id>` |
1834
- | Schedule a fire | `sky tasks schedule <id> --at <iso>` (`--cron …` for recurring) |
1835
- | Pause / resume cron | `sky tasks pause-schedule <id>` / `sky tasks resume-schedule <id>` |
1836
- | Forward to chats | `sky tasks forward <id> --to <group-chat-id>` |
1837
- | Incremental tags | `sky tasks tags add/remove <id> --tag …` |
1838
- | Pin/unpin skills | `sky tasks skills pin/unpin <id> <skill-id>` |
1839
- | Delete | `sky tasks delete <id>` |
1834
+ | Action | Command |
1835
+ | ------------------- | --------------------------------------------------------------------------- |
1836
+ | Submit and advance | `sky tasks complete [id] --summary "..."` |
1837
+ | Record an update | `sky tasks updates add [id] --type progress --summary "..." --data '{...}'` |
1838
+ | Link a deliverable | `sky tasks deliverable add <id> <coordinate>` |
1839
+ | Review a Result | `sky tasks review [id] --result-id <id> --decision accepted` |
1840
+ | Change status | `sky tasks move [id] --status <new-status>` |
1841
+ | Start execution | `sky tasks start [id]` (optionally `--skill <id>`) |
1842
+ | Stop a running task | `sky tasks interrupt <id>` |
1843
+ | Run via DRI agent | `sky tasks dri-run <id>` / `sky tasks dri-plan <id>` |
1844
+ | Schedule a fire | `sky tasks schedule <id> --at <iso>` (`--cron …` for recurring) |
1845
+ | Pause / resume cron | `sky tasks pause-schedule <id>` / `sky tasks resume-schedule <id>` |
1846
+ | Forward to chats | `sky tasks forward <id> --to <group-chat-id>` |
1847
+ | Incremental tags | `sky tasks tags add/remove <id> --tag …` |
1848
+ | Pin/unpin skills | `sky tasks skills pin/unpin <id> <skill-id>` |
1849
+ | Delete | `sky tasks delete <id>` |
1840
1850
 
1841
1851
  `tasks update` handles every other field (title, description, priority,
1842
1852
  assignees, due date, goal) but explicitly does NOT touch status — use
@@ -0,0 +1,221 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const crypto = require('node:crypto');
6
+
7
+ const COMMAND_BUILD_MANIFEST = 'command-source-digests.json';
8
+
9
+ function sourceDigest(fileSystem, source) {
10
+ return crypto.createHash('sha256').update(fileSystem.readFileSync(source)).digest('hex');
11
+ }
12
+
13
+ function buildSourceFiles(fileSystem, sourceRoot) {
14
+ const files = [];
15
+ const pending = [sourceRoot];
16
+ while (pending.length) {
17
+ const directory = pending.shift();
18
+ let entries;
19
+ try {
20
+ entries = fileSystem.readdirSync(directory, { withFileTypes: true });
21
+ } catch {
22
+ continue;
23
+ }
24
+ for (const entry of entries) {
25
+ if (entry.name === '__tests__') continue;
26
+ const candidate = path.join(directory, entry.name);
27
+ if (entry.isDirectory()) pending.push(candidate);
28
+ else if (
29
+ entry.isFile() &&
30
+ /\.(?:ts|tsx)$/.test(entry.name) &&
31
+ !/\.(?:spec|test)\.(?:ts|tsx)$/.test(entry.name)
32
+ ) {
33
+ files.push(candidate);
34
+ }
35
+ }
36
+ }
37
+ return files.sort();
38
+ }
39
+
40
+ function sourceTreeDigest(fileSystem, sourceRoot) {
41
+ const hash = crypto.createHash('sha256');
42
+ for (const source of buildSourceFiles(fileSystem, sourceRoot)) {
43
+ hash.update(path.relative(sourceRoot, source).split(path.sep).join('/'));
44
+ hash.update('\0');
45
+ hash.update(fileSystem.readFileSync(source));
46
+ hash.update('\0');
47
+ }
48
+ return hash.digest('hex');
49
+ }
50
+
51
+ function findAlternateCli({
52
+ commandName,
53
+ currentEntry,
54
+ requiredCommand,
55
+ pathValue = process.env.PATH || '',
56
+ fileSystem = fs,
57
+ }) {
58
+ let currentRealPath;
59
+ try {
60
+ currentRealPath = fileSystem.realpathSync(currentEntry);
61
+ } catch {
62
+ currentRealPath = path.resolve(currentEntry);
63
+ }
64
+
65
+ for (const directory of pathValue.split(path.delimiter).filter(Boolean)) {
66
+ const candidate = path.join(directory, commandName);
67
+ try {
68
+ if (!fileSystem.existsSync(candidate)) continue;
69
+ fileSystem.accessSync(candidate, fileSystem.constants?.X_OK ?? fs.constants.X_OK);
70
+ const candidateRealPath = fileSystem.realpathSync(candidate);
71
+ if (candidateRealPath === currentRealPath) continue;
72
+ const candidateCommands = path.resolve(path.dirname(candidateRealPath), '../dist/commands');
73
+ if (
74
+ path.basename(candidateRealPath) === 'run.js' &&
75
+ !fileSystem.existsSync(candidateCommands)
76
+ ) {
77
+ continue;
78
+ }
79
+ if (
80
+ requiredCommand &&
81
+ !fileSystem.existsSync(path.join(candidateCommands, requiredCommand))
82
+ ) {
83
+ continue;
84
+ }
85
+ if (requiredCommand) {
86
+ const candidateRoot = path.resolve(path.dirname(candidateRealPath), '..');
87
+ const candidateSourceCommands = path.join(candidateRoot, 'src', 'commands');
88
+ const sourceStem = path.join(candidateSourceCommands, requiredCommand.replace(/\.js$/, ''));
89
+ const candidateSource = ['.ts', '.tsx']
90
+ .map((extension) => `${sourceStem}${extension}`)
91
+ .find((source) => fileSystem.existsSync(source));
92
+ // An alternate development checkout must prove that its requested
93
+ // command matches its own source too. Published CLIs omit `src`, so
94
+ // their packaged dist remains a valid fallback.
95
+ if (!candidateSource && fileSystem.existsSync(candidateSourceCommands)) {
96
+ continue;
97
+ }
98
+ if (candidateSource) {
99
+ let candidateManifest;
100
+ try {
101
+ candidateManifest = JSON.parse(
102
+ fileSystem.readFileSync(
103
+ path.join(candidateRoot, 'dist', COMMAND_BUILD_MANIFEST),
104
+ 'utf8',
105
+ ),
106
+ );
107
+ } catch {
108
+ continue;
109
+ }
110
+ if (
111
+ candidateManifest?.sourceTreeDigest !==
112
+ sourceTreeDigest(fileSystem, path.join(candidateRoot, 'src'))
113
+ ) {
114
+ continue;
115
+ }
116
+ const relative = path
117
+ .relative(path.join(candidateRoot, 'src', 'commands'), candidateSource)
118
+ .split(path.sep)
119
+ .join('/');
120
+ if (
121
+ candidateManifest?.commands?.[relative] !== sourceDigest(fileSystem, candidateSource)
122
+ ) {
123
+ continue;
124
+ }
125
+ }
126
+ }
127
+ return candidate;
128
+ } catch {
129
+ // A stale PATH entry is not a startup failure; keep looking.
130
+ }
131
+ }
132
+ return null;
133
+ }
134
+
135
+ function missingLocalCommandBuild({ cliRoot, argv, fileSystem = fs, verifySourceIdentity = true }) {
136
+ const commandsDirectory = path.join(cliRoot, 'dist', 'commands');
137
+ const sourceCommandsDirectory = path.join(cliRoot, 'src', 'commands');
138
+ let commandBuildManifest;
139
+ try {
140
+ commandBuildManifest = JSON.parse(
141
+ fileSystem.readFileSync(path.join(cliRoot, 'dist', COMMAND_BUILD_MANIFEST), 'utf8'),
142
+ );
143
+ } catch {
144
+ commandBuildManifest = null;
145
+ }
146
+ const currentSourceTreeDigest = commandBuildManifest
147
+ ? sourceTreeDigest(fileSystem, path.join(cliRoot, 'src'))
148
+ : null;
149
+ const commandParts = [];
150
+ for (const value of argv) {
151
+ if (String(value).startsWith('-')) break;
152
+ commandParts.push(...String(value).split(':').filter(Boolean));
153
+ }
154
+ const compiledForSource = (source) => {
155
+ const relative = path.relative(sourceCommandsDirectory, source).replace(/\.(?:ts|tsx)$/, '.js');
156
+ return path.join(commandsDirectory, relative);
157
+ };
158
+ const missingOrStale = (source) => {
159
+ const compiled = compiledForSource(source);
160
+ if (!fileSystem.existsSync(compiled)) return compiled;
161
+ // CI creates dist from a clean checkout immediately before executing it.
162
+ // Source identity is a development-checkout guard; re-hashing the live
163
+ // source tree inside CLI integration tests adds no proof and can make test
164
+ // fixtures that intentionally exercise the launcher affect one another.
165
+ if (!verifySourceIdentity) return null;
166
+ try {
167
+ const relative = path.relative(sourceCommandsDirectory, source).split(path.sep).join('/');
168
+ const builtDigest = commandBuildManifest?.commands?.[relative];
169
+ // Git checkouts and partial builds can make old JS newer than its source.
170
+ // Content identity is authoritative; no digest means the development
171
+ // build is unproved and the installed CLI is safer.
172
+ return commandBuildManifest?.sourceTreeDigest === currentSourceTreeDigest &&
173
+ typeof builtDigest === 'string' &&
174
+ builtDigest === sourceDigest(fileSystem, source)
175
+ ? null
176
+ : compiled;
177
+ } catch {
178
+ return compiled;
179
+ }
180
+ };
181
+ for (let length = commandParts.length; length > 0; length -= 1) {
182
+ const relative = path.join(...commandParts.slice(0, length));
183
+ const source = ['.ts', '.tsx']
184
+ .map((extension) => path.join(cliRoot, 'src', 'commands', `${relative}${extension}`))
185
+ .find((candidate) => fileSystem.existsSync(candidate));
186
+ if (!source) continue;
187
+ const incomplete = missingOrStale(source);
188
+ if (incomplete) return incomplete;
189
+ break;
190
+ }
191
+ if (argv.some((value) => value === '--help' || value === '-h')) {
192
+ const sourceDirectory = path.join(sourceCommandsDirectory, ...commandParts);
193
+ const pending = [sourceDirectory];
194
+ while (pending.length) {
195
+ const current = pending.shift();
196
+ let entries;
197
+ try {
198
+ entries = fileSystem.readdirSync(current, { withFileTypes: true });
199
+ } catch {
200
+ continue;
201
+ }
202
+ for (const entry of entries) {
203
+ if (entry.name === '__tests__') continue;
204
+ const candidate = path.join(current, entry.name);
205
+ if (entry.isDirectory()) pending.push(candidate);
206
+ else if (entry.isFile() && /\.(?:ts|tsx)$/.test(entry.name)) {
207
+ const incomplete = missingOrStale(candidate);
208
+ if (incomplete) return incomplete;
209
+ }
210
+ }
211
+ }
212
+ }
213
+ return fileSystem.existsSync(commandsDirectory) ? null : commandsDirectory;
214
+ }
215
+
216
+ module.exports = {
217
+ COMMAND_BUILD_MANIFEST,
218
+ findAlternateCli,
219
+ missingLocalCommandBuild,
220
+ sourceTreeDigest,
221
+ };
package/bin/run.js CHANGED
@@ -1,5 +1,101 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const path = require('node:path');
4
+ const { spawnSync } = require('node:child_process');
5
+ const { findAlternateCli, missingLocalCommandBuild } = require('./dev-fallback');
6
+
7
+ /**
8
+ * The version a CLI entry point would run, for the fallback notice. Best effort:
9
+ * a version we cannot read must never be the reason a command fails.
10
+ */
11
+ function describeCliVersion(startPath) {
12
+ const fsModule = require('node:fs');
13
+ // Resolve through the symlink first. An installed CLI is almost always a link
14
+ // in a bin directory, and walking up from THAT finds nothing — which is how
15
+ // the version, the one fact this message exists to report, came back unknown.
16
+ let resolved = startPath;
17
+ try {
18
+ resolved = fsModule.realpathSync(startPath);
19
+ } catch {
20
+ // fall through to the path as given
21
+ }
22
+ let dir =
23
+ fsModule.existsSync(resolved) && fsModule.statSync(resolved).isDirectory()
24
+ ? resolved
25
+ : path.dirname(resolved);
26
+ for (let depth = 0; depth < 6; depth += 1) {
27
+ try {
28
+ const pkg = JSON.parse(
29
+ require('node:fs').readFileSync(path.join(dir, 'package.json'), 'utf8'),
30
+ );
31
+ if (pkg?.version) return `v${pkg.version}`;
32
+ } catch {
33
+ // keep walking
34
+ }
35
+ const parent = path.dirname(dir);
36
+ if (parent === dir) break;
37
+ dir = parent;
38
+ }
39
+ return 'version unknown';
40
+ }
41
+
42
+ const cliRoot = path.resolve(__dirname, '..');
43
+ const missingBuildPath = missingLocalCommandBuild({
44
+ cliRoot,
45
+ argv: process.argv.slice(2),
46
+ verifySourceIdentity: process.env.CI !== 'true',
47
+ });
48
+ if (missingBuildPath) {
49
+ const invokedName = path.basename(process.argv[1] || 'skrr');
50
+ const commandName = invokedName === 'run.js' ? 'skrr' : invokedName;
51
+ const fallback =
52
+ process.env.SKRR_DEV_FALLBACK_ACTIVE === '1'
53
+ ? null
54
+ : findAlternateCli({
55
+ commandName,
56
+ currentEntry: __filename,
57
+ requiredCommand: path.relative(path.join(cliRoot, 'dist', 'commands'), missingBuildPath),
58
+ });
59
+ if (fallback) {
60
+ // A developer verifying a change is the one caller for whom this fallback is
61
+ // not a safety net: it silently substitutes a DIFFERENT BUILD of the thing
62
+ // under test. The loop that trips it is exactly fix -> commit -> verify,
63
+ // because the pre-commit hook reformats staged sources and that invalidates
64
+ // the whole-tree digest for every command, not just the one edited.
65
+ //
66
+ // So name the substitution rather than just the fact, and let anyone who is
67
+ // verifying turn the fallback off outright.
68
+ if (process.env.SKRR_NO_DEV_FALLBACK === '1') {
69
+ console.error(
70
+ `[skrr] Refusing to fall back: SKRR_NO_DEV_FALLBACK=1 and the local build is stale at ` +
71
+ `${missingBuildPath}. Run "npm --prefix cli run build".`,
72
+ );
73
+ process.exit(1);
74
+ }
75
+ console.error(
76
+ `[skrr] Local development build is incomplete (${missingBuildPath}).\n` +
77
+ `[skrr] Running ${fallback} (${describeCliVersion(fallback)}) INSTEAD OF ` +
78
+ `this checkout (${describeCliVersion(cliRoot)}). Run "npm --prefix cli run build" to use ` +
79
+ `your own changes, or set SKRR_NO_DEV_FALLBACK=1 to make this an error.`,
80
+ );
81
+ const delegated = spawnSync(fallback, process.argv.slice(2), {
82
+ stdio: 'inherit',
83
+ shell: process.platform === 'win32',
84
+ env: { ...process.env, SKRR_DEV_FALLBACK_ACTIVE: '1' },
85
+ });
86
+ if (delegated.error) {
87
+ console.error(`[skrr] Could not start installed CLI ${fallback}: ${delegated.error.message}`);
88
+ process.exit(1);
89
+ }
90
+ process.exit(Number.isInteger(delegated.status) ? delegated.status : 1);
91
+ }
92
+ console.error(
93
+ `[skrr] CLI build output is missing or stale at ${missingBuildPath}. Run "npm --prefix cli run build" ` +
94
+ 'or install @skrr-ai/cli so this development launcher has a stable fallback.',
95
+ );
96
+ process.exit(1);
97
+ }
98
+
3
99
  const oclif = require('@oclif/core');
4
100
 
5
101
  // The workspace this machine works in (`sky workspaces use`) becomes