@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
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const work_sync_1 = require("../../../lib/work-sync");
6
+ /**
7
+ * `skrr spaces work-sync telemetry <space>` — Work Sync's own exit criteria.
8
+ *
9
+ * Work Sync v1 is ON at 100% (owner decision, 2026-09-08) with two criteria
10
+ * knowingly overridden rather than satisfied. The server has computed the verdict
11
+ * the whole time, and nothing outside the API could read it — so checking the
12
+ * criteria meant querying the production database by hand, which is why nobody
13
+ * did. An exit criterion that can only be read by hand is one that does not get
14
+ * read.
15
+ *
16
+ * The verdict is printed as the server decided it. This command does not
17
+ * re-derive it: the same rule that keeps `tasks expectations` reading the server's
18
+ * judgement rather than computing its own applies here, and for the same reason —
19
+ * a CLI that reached a different conclusion from the service would leave the
20
+ * reader unable to tell which was lying.
21
+ */
22
+ class SpacesWorkSyncTelemetry extends base_command_1.BaseCommand {
23
+ static description = "Show Work Sync's convergence telemetry for a Space and the server's rollout verdict";
24
+ static examples = [
25
+ '<%= config.bin %> spaces work-sync telemetry <space-id>',
26
+ '<%= config.bin %> spaces work-sync telemetry <space-id> --json',
27
+ ];
28
+ static args = {
29
+ space: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
30
+ };
31
+ static flags = {
32
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
33
+ limit: core_1.Flags.integer({
34
+ description: 'Most recent telemetry rows to summarize (1-10000, default 5000)',
35
+ }),
36
+ };
37
+ async run() {
38
+ this.requireAuth();
39
+ const { args, flags } = await this.parse(SpacesWorkSyncTelemetry);
40
+ let summary;
41
+ try {
42
+ summary = await (0, work_sync_1.fetchWorkSyncTelemetrySummary)(args.space, { limit: flags.limit });
43
+ }
44
+ catch (err) {
45
+ this.handleApiError(err);
46
+ return;
47
+ }
48
+ if (flags.json) {
49
+ this.log(JSON.stringify(summary, null, 2));
50
+ return;
51
+ }
52
+ this.log(`Verdict: ${summary.rollout.verdict}`);
53
+ this.log(`Sampled rows: ${summary.sampledEvents}`);
54
+ this.log(`Repair backlog: ${summary.repairBacklog}`);
55
+ // Zero sampled rows is a REAL answer and the most misread one: it means
56
+ // nothing has been measured in this Space, not that everything is fine. The
57
+ // server already distinguishes it (`insufficient_evidence`); say so here too
58
+ // rather than printing an empty table under a clean-looking verdict.
59
+ if (summary.sampledEvents === 0) {
60
+ this.log('');
61
+ this.log('No telemetry has been recorded for this Space. That is not evidence of health — ' +
62
+ 'it means no board in this Space has reported, so nothing has been measured.');
63
+ return;
64
+ }
65
+ const rows = Object.entries(summary.events).sort(([a], [b]) => a.localeCompare(b));
66
+ if (rows.length > 0) {
67
+ this.log('');
68
+ this.log('Events:');
69
+ for (const [event, stats] of rows) {
70
+ const parts = [`count ${stats.count}`];
71
+ if (stats.mismatchCount > 0)
72
+ parts.push(`mismatches ${stats.mismatchCount}`);
73
+ if (stats.p50DurationMs !== null) {
74
+ parts.push(`p50 ${stats.p50DurationMs}ms`, `p95 ${stats.p95DurationMs}ms`);
75
+ }
76
+ if (stats.p50Bytes !== null) {
77
+ parts.push(`p50 ${stats.p50Bytes}B`, `p95 ${stats.p95Bytes}B`);
78
+ }
79
+ this.log(` ${event.padEnd(20)} ${parts.join(' · ')}`);
80
+ }
81
+ }
82
+ if (summary.rollout.reasons.length > 0) {
83
+ this.log('');
84
+ this.log('Holding because:');
85
+ for (const reason of summary.rollout.reasons) {
86
+ // An unexplained code is the thing this command exists to avoid: the
87
+ // reader is being told a rollout is held and needs to know by what.
88
+ this.log(` ${reason}`);
89
+ const explanation = work_sync_1.WORK_SYNC_HOLD_REASONS[reason];
90
+ if (explanation)
91
+ this.log(` ${explanation}`);
92
+ }
93
+ }
94
+ }
95
+ }
96
+ exports.default = SpacesWorkSyncTelemetry;
@@ -11,7 +11,11 @@ class StoreInstall extends base_command_1.BaseCommand {
11
11
  '<%= config.bin %> store install agent_abc123 --json',
12
12
  ];
13
13
  static args = {
14
- agentId: core_1.Args.string({ description: 'The store agent to install', required: true }),
14
+ agentId: core_1.Args.string({
15
+ description: 'The store agent to install',
16
+ required: true,
17
+ ignoreStdin: true,
18
+ }),
15
19
  };
16
20
  static flags = {
17
21
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -18,7 +18,7 @@ class StoreReleases extends base_command_1.BaseCommand {
18
18
  '<%= config.bin %> store releases agent_abc123 --json',
19
19
  ];
20
20
  static args = {
21
- agentId: core_1.Args.string({ description: 'The store agent', required: true }),
21
+ agentId: core_1.Args.string({ description: 'The store agent', required: true, ignoreStdin: true }),
22
22
  };
23
23
  static flags = {
24
24
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -11,7 +11,11 @@ class StoreUpdate extends base_command_1.BaseCommand {
11
11
  '<%= config.bin %> store update agent_abc123 --strategy replace',
12
12
  ];
13
13
  static args = {
14
- agentId: core_1.Args.string({ description: 'The store agent you installed', required: true }),
14
+ agentId: core_1.Args.string({
15
+ description: 'The store agent you installed',
16
+ required: true,
17
+ ignoreStdin: true,
18
+ }),
15
19
  };
16
20
  static flags = {
17
21
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -11,7 +11,11 @@ class SubscriptionsCancel extends base_command_1.BaseCommand {
11
11
  '<%= config.bin %> subscriptions cancel agent_abc123 --expected-version 3',
12
12
  ];
13
13
  static args = {
14
- agentId: core_1.Args.string({ description: 'The service to unsubscribe from', required: true }),
14
+ agentId: core_1.Args.string({
15
+ description: 'The service to unsubscribe from',
16
+ required: true,
17
+ ignoreStdin: true,
18
+ }),
15
19
  };
16
20
  static flags = {
17
21
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -22,7 +22,11 @@ class SubscriptionsHealth extends base_command_1.BaseCommand {
22
22
  '<%= config.bin %> subscriptions health agent_abc123 --json',
23
23
  ];
24
24
  static args = {
25
- agentId: core_1.Args.string({ description: 'The service to check', required: true }),
25
+ agentId: core_1.Args.string({
26
+ description: 'The service to check',
27
+ required: true,
28
+ ignoreStdin: true,
29
+ }),
26
30
  };
27
31
  static flags = {
28
32
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -10,7 +10,11 @@ class SubscriptionsStatus extends base_command_1.BaseCommand {
10
10
  '<%= config.bin %> subscriptions status agent_abc123 --json',
11
11
  ];
12
12
  static args = {
13
- agentId: core_1.Args.string({ description: 'The service to check', required: true }),
13
+ agentId: core_1.Args.string({
14
+ description: 'The service to check',
15
+ required: true,
16
+ ignoreStdin: true,
17
+ }),
14
18
  };
15
19
  static flags = {
16
20
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -11,7 +11,11 @@ class SubscriptionsSubscribe extends base_command_1.BaseCommand {
11
11
  '<%= config.bin %> subscriptions subscribe agent_abc123 --space space_xyz --json',
12
12
  ];
13
13
  static args = {
14
- agentId: core_1.Args.string({ description: 'The published service to subscribe to', required: true }),
14
+ agentId: core_1.Args.string({
15
+ description: 'The published service to subscribe to',
16
+ required: true,
17
+ ignoreStdin: true,
18
+ }),
15
19
  };
16
20
  static flags = {
17
21
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
@@ -1,8 +1,7 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
- * One row of `GET /api/tasks/:taskId/activity`, which returns the task's raw
4
- * persisted `ITaskActivityLog` entries `{ action, timestamp, userId, details }`
5
- * (packages/data-schemas/src/types/task.ts:162, api/models/Task.js:2239).
3
+ * One row of the canonical Activity endpoint. Field fallbacks remain so this
4
+ * CLI can still read an older deployment's embedded Task activity entries.
6
5
  *
7
6
  * OSK-2044: this renderer read `event` / `actorId` / `createdAt`, none of which
8
7
  * that document has, so EVENT and ACTOR were `-` on every row while `details`
@@ -6,12 +6,23 @@ const core_1 = require("@oclif/core");
6
6
  const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../base-command");
8
8
  const format_1 = require("../../lib/format");
9
+ const task_legacy_1 = require("../../lib/task-legacy");
9
10
  function activityRow(entry) {
11
+ const actor = entry.actor;
12
+ const actorText = actor
13
+ ? actor.kind === 'agent'
14
+ ? `agent:${actor.agentId}`
15
+ : actor.kind === 'human'
16
+ ? `human:${actor.userId}`
17
+ : actor.kind === 'integration'
18
+ ? `integration:${actor.provider}`
19
+ : `system:${actor.service}`
20
+ : (entry.userId ?? entry.actorId);
10
21
  return {
11
- time: formatTime(entry.timestamp ?? entry.createdAt),
22
+ time: formatTime(entry.occurredAt ?? entry.timestamp ?? entry.createdAt),
12
23
  event: (0, format_1.formatCell)(entry.action ?? entry.event ?? entry.type),
13
- actor: (0, format_1.formatCell)(entry.userId ?? entry.actorId ?? entry.actor),
14
- details: (0, format_1.formatCell)(entry.details ?? entry.metadata),
24
+ actor: (0, format_1.formatCell)(actorText),
25
+ details: (0, format_1.formatCell)(entry.data ?? entry.details ?? entry.metadata),
15
26
  };
16
27
  }
17
28
  /**
@@ -70,7 +81,7 @@ function formatTime(value) {
70
81
  return date.toISOString().slice(0, 19).replace('T', ' ');
71
82
  }
72
83
  class TasksActivity extends base_command_1.BaseCommand {
73
- static description = 'Show activity log for a task';
84
+ static description = 'Show the immutable, multi-actor Activity ledger for a Task';
74
85
  static examples = [
75
86
  '<%= config.bin %> tasks activity <task-id>',
76
87
  '<%= config.bin %> tasks activity <task-id> --limit 50',
@@ -88,7 +99,7 @@ class TasksActivity extends base_command_1.BaseCommand {
88
99
  const { args, flags } = await this.parse(TasksActivity);
89
100
  let response;
90
101
  try {
91
- response = await data_provider_1.dataService.getTaskActivity(args.id, flags.limit);
102
+ response = await data_provider_1.dataService.listTaskActivityEvents(args.id, { limit: flags.limit });
92
103
  }
93
104
  catch (err) {
94
105
  this.handleApiError(err);
@@ -100,7 +111,10 @@ class TasksActivity extends base_command_1.BaseCommand {
100
111
  const r = response;
101
112
  const items = r?.data ?? [];
102
113
  if (items.length === 0) {
103
- this.log('No activity.');
114
+ // "No activity." was a claim about the TASK. It is only ever a claim about
115
+ // this VIEW: a Task predating the canonical model has its history in the
116
+ // legacy activity log, which this endpoint does not read.
117
+ this.log(await (0, task_legacy_1.emptyCanonicalView)(args.id, 'Activity'));
104
118
  return;
105
119
  }
106
120
  (0, format_1.renderTable)(items.map(activityRow), [
@@ -1,144 +1,14 @@
1
- import { dataService } from '@skrr-ai/data-provider';
2
- import type { TaskReport } from '@skrr-ai/data-provider';
3
1
  import { BaseCommand } from '../../base-command';
4
- import { type TaskDeliveryReceipt } from '../../lib/git-task';
5
- type CompletionStatus = 'completed' | 'failed';
6
- type TaskCommentResult = Awaited<ReturnType<typeof dataService.addTaskComment>>;
7
- type MovedTaskResult = Awaited<ReturnType<typeof dataService.moveTask>>;
8
- /** Wire shape of POST /api/tasks/:taskId/complete (OSK-1969). */
9
- /** One thing a completion did not have. Never a refusal — `done` has none. */
10
- export interface CompletionAdvisory {
11
- code: string;
12
- message: string;
13
- }
14
- export interface CompleteEndpointResponse {
15
- task: MovedTaskResult | null;
16
- comment: TaskCommentResult | null;
17
- commentFailed?: boolean;
18
- /** What the completion was missing. `done` has no preconditions, so every
19
- * condition that used to refuse one now travels with it instead. The task
20
- * reached the requested terminal state regardless. */
21
- advisories?: CompletionAdvisory[];
22
- }
23
- export interface CompleteTransport {
24
- /** POST /api/tasks/:taskId/complete — atomic move + TASK_OUTPUT comment. */
25
- postComplete: (taskId: string, payload: {
26
- status: CompletionStatus;
27
- summary: string;
28
- deliverables: string;
29
- verdict: string;
30
- report?: TaskReport;
31
- deliveryReceipt?: TaskDeliveryReceipt;
32
- }) => Promise<CompleteEndpointResponse>;
33
- /** Legacy step 1 — POST /api/tasks/:taskId/comments. */
34
- addComment: (taskId: string, body: string) => Promise<TaskCommentResult>;
35
- /** Legacy step 2 — PATCH /api/tasks/:taskId/move. */
36
- moveTask: (taskId: string, status: 'done' | 'failed') => Promise<MovedTaskResult>;
37
- /** Session credentials must never fall back to broad user-grain endpoints. */
38
- allowLegacyFallback?: boolean;
39
- }
40
- export interface DurableCompletionResult {
41
- comment: TaskCommentResult | null;
42
- movedTask: MovedTaskResult | null;
43
- moved: boolean;
44
- commentFailed: boolean;
45
- advisories?: CompletionAdvisory[];
46
- /** true when the atomic /complete endpoint handled the finalization. */
47
- usedAtomicEndpoint: boolean;
48
- }
49
- /**
50
- * Mutation endpoints require the task's canonical UUID even though the CLI
51
- * accepts human-readable refs and titles. Resolve the display reference before
52
- * writing anything so a 404 from `POST /complete` cannot be mistaken for an
53
- * old server and fall through to the legacy comment-first path.
54
- */
55
- export declare function resolveCanonicalCompletionTaskId(taskRef: string, lookup: (taskRef: string) => Promise<unknown>): Promise<string>;
56
- /**
57
- * The canonical id AND the status it is in.
58
- *
59
- * The status comes free: this lookup already happens on the user path, so the
60
- * re-completion guard below costs no extra round trip on the common case. It is
61
- * also the only way to make the success line honest — `tasks complete` printed
62
- * "Moved task X to done" unconditionally, so a task that was ALREADY done got a
63
- * report of a state transition that did not happen.
64
- */
65
- export declare function resolveCompletionTarget(taskRef: string, lookup: (taskRef: string) => Promise<unknown>): Promise<{
66
- id: string;
67
- status: string | null;
68
- }>;
69
- /**
70
- * What a second `tasks complete` on an already-closed task should do.
71
- *
72
- * The repo contract calls this "the only terminal closeout", and a task has one
73
- * canonical outcome — but a second run used to succeed silently, post another
74
- * TASK_OUTPUT block, and leave `tasks output` rendering the throwaway one as
75
- * authoritative. The real summary and its deliverables link were still on the task
76
- * but no longer canonical, which is the worst of the available failures: no
77
- * error, no warning, exit 0, and a record that now says something different.
78
- *
79
- * Refusing outright would break the case that makes retries safe. A completion
80
- * whose response is lost — a flaky connection, a re-run script — SHOULD be able
81
- * to run again, and today it collapses server-side on the shared
82
- * `X-Idempotency-Key`. Turning that into a hard failure would force every
83
- * caller to write its own is-it-already-done check.
84
- *
85
- * So the axis is not "again or not", it is "the SAME again, or something
86
- * different":
87
- *
88
- * - identical report → `noop`, exit 0. Nothing to do, and saying so is more
89
- * honest than re-posting an identical block.
90
- * - differing report → `refuse`. Superseding a canonical outcome is a real
91
- * decision, so it takes `--amend` and says so.
92
- * - not yet terminal → `proceed`, unchanged.
93
- *
94
- * Pure, so the rule is testable without a server.
95
- */
96
- export declare function decideRecompletion(opts: {
97
- priorStatus: string | null;
98
- canonicalBody: string | null;
99
- incomingBody: string;
100
- amend: boolean;
101
- }): 'proceed' | 'noop' | 'refuse';
102
- /** A 404 from the /complete endpoint means an old server without the route. */
103
- export declare function isCompleteEndpointMissing(err: unknown): boolean;
104
- /**
105
- * The server finalized a different task than the one we were asked to finalize.
106
- *
107
- * The session-scoped completion endpoint derives its task from the run claim
108
- * and deliberately ignores any client-supplied id — that is what stops a
109
- * compromised agent process finishing a sibling task. The corollary is that the
110
- * id resolved on this side is not necessarily the one that moved, so reporting
111
- * ours would print a success line (and a `--json` `taskId`) for a task that is
112
- * still open.
113
- */
114
- export declare class TaskCompletionMismatchError extends Error {
115
- readonly requestedTaskId: string;
116
- readonly completedTaskId: string;
117
- constructor(requestedTaskId: string, completedTaskId: string);
118
- }
119
- /**
120
- * Finalize a task durably (OSK-1969).
121
- *
122
- * Prefers the server's atomic POST /:taskId/complete (CAS move first, then
123
- * the TASK_OUTPUT comment — no half-finished state if this process dies).
124
- * Falls back to the legacy client-side two-step (comment, then move) when the
125
- * server predates the endpoint (HTTP 404). `noMove` keeps the historical
126
- * comment-only behavior and never touches the endpoint. All transport errors
127
- * other than the endpoint-missing 404 are rethrown for the caller's uniform
128
- * error handling.
129
- */
130
- export declare function completeTaskDurably(opts: {
2
+ export declare function describePendingReview({ statusType, taskId, resultId, bin, advisories, }: {
3
+ statusType: unknown;
131
4
  taskId: string;
132
- status: CompletionStatus;
133
- body: string;
134
- summary: string;
135
- deliverables: string;
136
- verdict: string;
137
- report?: TaskReport;
138
- deliveryReceipt?: TaskDeliveryReceipt;
139
- noMove: boolean;
140
- transport: CompleteTransport;
141
- }): Promise<DurableCompletionResult>;
5
+ resultId?: string;
6
+ bin: string;
7
+ advisories?: Array<{
8
+ code: string;
9
+ message: string;
10
+ }>;
11
+ }): string | null;
142
12
  export default class TasksComplete extends BaseCommand {
143
13
  static description: string;
144
14
  static examples: string[];
@@ -146,21 +16,23 @@ export default class TasksComplete extends BaseCommand {
146
16
  id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
147
17
  };
148
18
  static flags: {
149
- json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
150
19
  task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
151
- 'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
152
- amend: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
153
- status: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
154
21
  summary: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
155
- deliverables: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
+ 'conclusion-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ 'conclusion-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ 'structured-schema': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
26
+ 'structured-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
156
27
  deliverable: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
157
- verdict: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
158
- outcome: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
159
- finding: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
160
28
  evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
161
- next: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
162
- 'no-move': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
29
+ remaining: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
30
+ 'source-run': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
31
+ 'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
32
+ 'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
33
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
34
+ 'from-json': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
35
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
163
36
  };
164
37
  run(): Promise<void>;
165
38
  }
166
- export {};