@skrr-ai/cli 0.1.21 → 0.1.23

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 (245) hide show
  1. package/README.md +83 -73
  2. package/bin/dev-fallback.js +221 -0
  3. package/bin/run.js +43 -0
  4. package/dist/base-command.d.ts +15 -0
  5. package/dist/base-command.js +71 -10
  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/create.d.ts +1 -0
  43. package/dist/commands/commitments/create.js +19 -5
  44. package/dist/commands/commitments/preflight.js +18 -4
  45. package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
  46. package/dist/commands/commitments/receipt-metrics.js +78 -0
  47. package/dist/commands/convos/search.js +5 -5
  48. package/dist/commands/harnesses/leases/list.d.ts +3 -0
  49. package/dist/commands/harnesses/leases/list.js +59 -12
  50. package/dist/commands/harnesses/leases/show.js +36 -0
  51. package/dist/commands/harnesses/list.d.ts +18 -0
  52. package/dist/commands/harnesses/list.js +30 -0
  53. package/dist/commands/harnesses/products.js +48 -3
  54. package/dist/commands/harnesses/quota.d.ts +16 -0
  55. package/dist/commands/harnesses/quota.js +26 -1
  56. package/dist/commands/harnesses/usage.js +17 -0
  57. package/dist/commands/inbox/index.d.ts +2 -1
  58. package/dist/commands/inbox/index.js +27 -4
  59. package/dist/commands/login.js +4 -1
  60. package/dist/commands/machines/list.d.ts +1 -0
  61. package/dist/commands/machines/list.js +33 -5
  62. package/dist/commands/memory/approvals/issue.d.ts +18 -0
  63. package/dist/commands/memory/approvals/issue.js +63 -0
  64. package/dist/commands/memory/commit.js +5 -2
  65. package/dist/commands/memory/context.d.ts +3 -2
  66. package/dist/commands/memory/context.js +9 -11
  67. package/dist/commands/memory/delete.d.ts +1 -1
  68. package/dist/commands/memory/list.d.ts +1 -1
  69. package/dist/commands/memory/list.js +1 -1
  70. package/dist/commands/memory/mounts/resolve.d.ts +10 -0
  71. package/dist/commands/memory/mounts/resolve.js +27 -0
  72. package/dist/commands/memory/proposals/commit.d.ts +18 -0
  73. package/dist/commands/memory/proposals/commit.js +32 -0
  74. package/dist/commands/memory/proposals/create.d.ts +18 -0
  75. package/dist/commands/memory/proposals/create.js +56 -0
  76. package/dist/commands/memory/proposals/list.d.ts +13 -0
  77. package/dist/commands/memory/proposals/list.js +31 -0
  78. package/dist/commands/memory/proposals/promote.d.ts +22 -0
  79. package/dist/commands/memory/proposals/promote.js +33 -0
  80. package/dist/commands/memory/proposals/reject.d.ts +16 -0
  81. package/dist/commands/memory/proposals/reject.js +28 -0
  82. package/dist/commands/memory/rebuild-index.d.ts +20 -0
  83. package/dist/commands/memory/rebuild-index.js +25 -0
  84. package/dist/commands/memory/save.d.ts +1 -1
  85. package/dist/commands/memory/save.js +1 -1
  86. package/dist/commands/memory/search.d.ts +6 -3
  87. package/dist/commands/memory/search.js +27 -3
  88. package/dist/commands/memory/show.d.ts +1 -1
  89. package/dist/commands/memory/stores/archive.d.ts +14 -0
  90. package/dist/commands/memory/stores/archive.js +31 -0
  91. package/dist/commands/memory/stores/create.d.ts +12 -0
  92. package/dist/commands/memory/stores/create.js +30 -0
  93. package/dist/commands/memory/stores/delete.d.ts +15 -0
  94. package/dist/commands/memory/stores/delete.js +38 -0
  95. package/dist/commands/memory/stores/list.d.ts +10 -0
  96. package/dist/commands/memory/stores/list.js +29 -0
  97. package/dist/commands/memory/stores/show.d.ts +12 -0
  98. package/dist/commands/memory/stores/show.js +14 -0
  99. package/dist/commands/memory/stores/update.d.ts +15 -0
  100. package/dist/commands/memory/stores/update.js +39 -0
  101. package/dist/commands/memory/sync/delete.d.ts +13 -0
  102. package/dist/commands/memory/sync/delete.js +35 -0
  103. package/dist/commands/memory/sync/pull.d.ts +19 -0
  104. package/dist/commands/memory/sync/pull.js +52 -0
  105. package/dist/commands/memory/sync/push.d.ts +18 -0
  106. package/dist/commands/memory/sync/push.js +115 -0
  107. package/dist/commands/memory/sync/resolve.d.ts +23 -0
  108. package/dist/commands/memory/sync/resolve.js +27 -0
  109. package/dist/commands/memory/sync/status.d.ts +9 -0
  110. package/dist/commands/memory/sync/status.js +22 -0
  111. package/dist/commands/memory/topics/archive.d.ts +20 -0
  112. package/dist/commands/memory/topics/archive.js +29 -0
  113. package/dist/commands/memory/topics/create.d.ts +23 -0
  114. package/dist/commands/memory/topics/create.js +46 -0
  115. package/dist/commands/memory/topics/delete.d.ts +22 -0
  116. package/dist/commands/memory/topics/delete.js +30 -0
  117. package/dist/commands/memory/topics/forget.d.ts +22 -0
  118. package/dist/commands/memory/topics/forget.js +29 -0
  119. package/dist/commands/memory/topics/list.d.ts +13 -0
  120. package/dist/commands/memory/topics/list.js +22 -0
  121. package/dist/commands/memory/topics/move.d.ts +22 -0
  122. package/dist/commands/memory/topics/move.js +26 -0
  123. package/dist/commands/memory/topics/show.d.ts +17 -0
  124. package/dist/commands/memory/topics/show.js +21 -0
  125. package/dist/commands/memory/topics/update.d.ts +23 -0
  126. package/dist/commands/memory/topics/update.js +27 -0
  127. package/dist/commands/memory/tree.d.ts +5 -2
  128. package/dist/commands/memory/tree.js +20 -2
  129. package/dist/commands/memory/update.d.ts +1 -1
  130. package/dist/commands/memory/versions/list.d.ts +16 -0
  131. package/dist/commands/memory/versions/list.js +22 -0
  132. package/dist/commands/memory/versions/redact.d.ts +21 -0
  133. package/dist/commands/memory/versions/redact.js +22 -0
  134. package/dist/commands/memory/versions/restore.d.ts +20 -0
  135. package/dist/commands/memory/versions/restore.js +16 -0
  136. package/dist/commands/memory/versions/show.d.ts +15 -0
  137. package/dist/commands/memory/versions/show.js +17 -0
  138. package/dist/commands/messages/list.js +25 -8
  139. package/dist/commands/messages/show.js +10 -0
  140. package/dist/commands/store/install.js +5 -1
  141. package/dist/commands/store/releases.js +1 -1
  142. package/dist/commands/store/update.js +5 -1
  143. package/dist/commands/subscriptions/cancel.js +5 -1
  144. package/dist/commands/subscriptions/health.js +5 -1
  145. package/dist/commands/subscriptions/status.js +5 -1
  146. package/dist/commands/subscriptions/subscribe.js +5 -1
  147. package/dist/commands/tasks/activity.d.ts +2 -3
  148. package/dist/commands/tasks/activity.js +15 -5
  149. package/dist/commands/tasks/complete.d.ts +18 -150
  150. package/dist/commands/tasks/complete.js +161 -600
  151. package/dist/commands/tasks/create.d.ts +5 -0
  152. package/dist/commands/tasks/create.js +107 -4
  153. package/dist/commands/tasks/deliverable/add.d.ts +8 -0
  154. package/dist/commands/tasks/deliverable/add.js +41 -8
  155. package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
  156. package/dist/commands/tasks/deliverable/confirm.js +9 -18
  157. package/dist/commands/tasks/deliverable/list.d.ts +12 -0
  158. package/dist/commands/tasks/deliverable/list.js +37 -0
  159. package/dist/commands/tasks/events/append.d.ts +2 -0
  160. package/dist/commands/tasks/events/append.js +11 -4
  161. package/dist/commands/tasks/events/list.d.ts +1 -0
  162. package/dist/commands/tasks/events/list.js +1 -0
  163. package/dist/commands/tasks/events/tail.d.ts +1 -0
  164. package/dist/commands/tasks/events/tail.js +1 -0
  165. package/dist/commands/tasks/expectations/assess.d.ts +21 -0
  166. package/dist/commands/tasks/expectations/assess.js +77 -0
  167. package/dist/commands/tasks/expectations.js +14 -18
  168. package/dist/commands/tasks/judge.d.ts +1 -0
  169. package/dist/commands/tasks/judge.js +2 -1
  170. package/dist/commands/tasks/output.d.ts +2 -11
  171. package/dist/commands/tasks/output.js +64 -145
  172. package/dist/commands/tasks/report.d.ts +3 -3
  173. package/dist/commands/tasks/report.js +64 -41
  174. package/dist/commands/tasks/resource/add.d.ts +23 -0
  175. package/dist/commands/tasks/resource/add.js +76 -0
  176. package/dist/commands/tasks/resource/list.d.ts +13 -0
  177. package/dist/commands/tasks/resource/list.js +41 -0
  178. package/dist/commands/tasks/result/show.d.ts +13 -0
  179. package/dist/commands/tasks/result/show.js +46 -0
  180. package/dist/commands/tasks/result/submit.d.ts +26 -0
  181. package/dist/commands/tasks/result/submit.js +134 -0
  182. package/dist/commands/tasks/resume/save.d.ts +16 -0
  183. package/dist/commands/tasks/resume/save.js +59 -0
  184. package/dist/commands/tasks/resume/show.d.ts +13 -0
  185. package/dist/commands/tasks/resume/show.js +35 -0
  186. package/dist/commands/tasks/review.d.ts +17 -0
  187. package/dist/commands/tasks/review.js +54 -0
  188. package/dist/commands/tasks/runs.js +5 -0
  189. package/dist/commands/tasks/timeline.d.ts +2 -2
  190. package/dist/commands/tasks/timeline.js +10 -23
  191. package/dist/commands/tasks/updates/add.d.ts +22 -0
  192. package/dist/commands/tasks/updates/add.js +101 -0
  193. package/dist/commands/tasks/updates/list.d.ts +15 -0
  194. package/dist/commands/tasks/updates/list.js +57 -0
  195. package/dist/commands/tasks/waive.d.ts +1 -0
  196. package/dist/commands/tasks/waive.js +2 -1
  197. package/dist/lib/agentic-stream.d.ts +257 -0
  198. package/dist/lib/agentic-stream.js +490 -33
  199. package/dist/lib/balance.d.ts +8 -0
  200. package/dist/lib/commitment-product.d.ts +10 -1
  201. package/dist/lib/commitment-product.js +66 -2
  202. package/dist/lib/commitments.d.ts +4 -1
  203. package/dist/lib/commitments.js +32 -1
  204. package/dist/lib/conversation-search.d.ts +3 -0
  205. package/dist/lib/conversation-search.js +75 -0
  206. package/dist/lib/execution-target.d.ts +21 -0
  207. package/dist/lib/execution-target.js +22 -6
  208. package/dist/lib/harnesses.d.ts +82 -6
  209. package/dist/lib/harnesses.js +30 -2
  210. package/dist/lib/hosted-machines.js +9 -0
  211. package/dist/lib/inbox.d.ts +2 -1
  212. package/dist/lib/machines.d.ts +17 -0
  213. package/dist/lib/machines.js +29 -0
  214. package/dist/lib/managed-agent-keys.d.ts +104 -0
  215. package/dist/lib/managed-agent-keys.js +50 -0
  216. package/dist/lib/memory-scope.d.ts +4 -3
  217. package/dist/lib/memory-scope.js +9 -9
  218. package/dist/lib/memory-sync.d.ts +114 -0
  219. package/dist/lib/memory-sync.js +730 -0
  220. package/dist/lib/message-provenance.d.ts +42 -0
  221. package/dist/lib/message-provenance.js +89 -0
  222. package/dist/lib/scoped-memory-command.d.ts +68 -0
  223. package/dist/lib/scoped-memory-command.js +183 -0
  224. package/dist/lib/session-task-endpoints.d.ts +1 -1
  225. package/dist/lib/session-task-endpoints.js +7 -0
  226. package/dist/lib/sky-code-broker.d.ts +47 -0
  227. package/dist/lib/sky-code-broker.js +50 -0
  228. package/dist/lib/sky-code-doctor.js +10 -1
  229. package/dist/lib/task-artifact-flags.d.ts +2 -0
  230. package/dist/lib/task-artifact-flags.js +7 -0
  231. package/dist/lib/task-execution.d.ts +4 -5
  232. package/dist/lib/task-execution.js +4 -5
  233. package/dist/lib/task-extras.d.ts +1 -5
  234. package/dist/lib/task-extras.js +1 -5
  235. package/dist/lib/task-transcript.d.ts +5 -7
  236. package/dist/lib/task-transcript.js +8 -16
  237. package/dist/lib/tasks.d.ts +7 -21
  238. package/dist/lib/tasks.js +17 -20
  239. package/dist/lib/triggers.d.ts +39 -1
  240. package/dist/lib/triggers.js +70 -2
  241. package/dist/lib/usage-discovery.d.ts +17 -1
  242. package/dist/lib/usage-discovery.js +17 -1
  243. package/dist/node_modules/@skrr-ai/data-provider/index.js +3733 -3618
  244. package/oclif.manifest.json +25726 -19886
  245. package/package.json +26 -5
@@ -21,25 +21,21 @@ const STATE_LABEL = {
21
21
  unverified: 'needs a look',
22
22
  underway: 'on its way',
23
23
  owed: 'not yet',
24
- unjudged: 'needs a person',
24
+ unassessed: 'needs assessment',
25
25
  };
26
26
  function line(expectation) {
27
27
  const label = STATE_LABEL[expectation.state] || expectation.state;
28
- // A judged expectation is stated as NOT a gate. A list that reads like a
29
- // contract while enforcing nothing is worse than no list, because it is
30
- // trusted.
31
- const gate = expectation.gating ? '' : ' (does not block completion)';
32
28
  const from = expectation.source === 'space' ? ' [space default]' : '';
33
29
  // Only shown when the work exists and the evidence is short — stating the
34
30
  // required authority on every row would be noise on the rows where it is
35
31
  // already satisfied or not yet relevant.
36
32
  const evidence = expectation.state === 'unverified'
37
- ? ` (has ${expectation.evidenceAuthority}, needs ${expectation.requiredAuthority})`
33
+ ? ` (has ${expectation.evidenceLevel}, needs ${expectation.requiredEvidence})`
38
34
  : '';
39
- return ` ${expectation.id.padEnd(18)} ${label.padEnd(14)} ${expectation.sentence}${evidence}${gate}${from}`;
35
+ return ` ${expectation.id.padEnd(18)} ${label.padEnd(18)} ${expectation.text}${evidence}${from}`;
40
36
  }
41
37
  class TasksExpectations extends base_command_1.BaseCommand {
42
- static description = 'Show what a task must produce and how far each expectation got ("Done when")';
38
+ static description = 'Show what must be true before the Task can close and the evidence-backed assessment state';
43
39
  static examples = [
44
40
  '<%= config.bin %> tasks expectations <task-id>',
45
41
  '<%= config.bin %> tasks expectations <task-id> --json',
@@ -68,7 +64,7 @@ class TasksExpectations extends base_command_1.BaseCommand {
68
64
  if (acceptance.expectations.length === 0) {
69
65
  // An empty contract is a real answer, not an unfilled field. Say so
70
66
  // plainly rather than prompting for something most tasks do not owe.
71
- this.log('Nothing durable is expected of this task.');
67
+ this.log('No Expectations were declared for this Task.');
72
68
  return;
73
69
  }
74
70
  // The evidence read fails OPEN by design, so "produced nothing" and "we
@@ -78,7 +74,7 @@ class TasksExpectations extends base_command_1.BaseCommand {
78
74
  this.warn('Could not read what this task produced — the states below may understate it. ' +
79
75
  'This is not a claim that nothing was produced.');
80
76
  }
81
- this.log('Done when:');
77
+ this.log('Expectations:');
82
78
  for (const expectation of acceptance.expectations) {
83
79
  this.log(line(expectation));
84
80
  }
@@ -86,12 +82,12 @@ class TasksExpectations extends base_command_1.BaseCommand {
86
82
  const met = gating.filter((e) => e.met).length;
87
83
  this.log('');
88
84
  this.log(`${met} of ${gating.length} met · overall: ${acceptance.state}`);
89
- // Only the ones actually stored on the task can be judged. A space default
90
- // is synthesised per read, so pointing at `tasks judge` for one would send
91
- // the reader at a command that can only refuse it.
92
- const settleable = acceptance.expectations.filter((e) => e.state === 'unjudged' && e.source !== 'space').length;
85
+ // Space defaults are copied into the Task at creation. `source=space`
86
+ // remains useful provenance, but these are Task-owned Expectations now and
87
+ // are assessed exactly like explicitly declared ones.
88
+ const settleable = acceptance.expectations.filter((e) => e.state === 'unassessed').length;
93
89
  if (settleable > 0) {
94
- this.log(`${settleable} awaiting a person settle with \`${this.config.bin} tasks judge\`.`);
90
+ this.log(`${settleable} awaiting assessmentuse \`${this.config.bin} tasks expectations assess\`.`);
95
91
  }
96
92
  // Named separately from `unjudged`, and with a different command, because
97
93
  // the two look alike on the board and are not: one needs a verdict on prose,
@@ -102,9 +98,9 @@ class TasksExpectations extends base_command_1.BaseCommand {
102
98
  `\`${this.config.bin} tasks deliverable confirm\`, or lower the bar with ` +
103
99
  `\`${this.config.bin} tasks trust\`.`);
104
100
  }
105
- const inherited = acceptance.unjudged - settleable;
106
- if (inherited > 0) {
107
- this.log(`${inherited} inherited from the space default declare them on the task to settle them.`);
101
+ if (gating.length > met) {
102
+ this.log('');
103
+ this.log('The current Result cannot be accepted while these Expectations remain unmet.');
108
104
  }
109
105
  }
110
106
  }
@@ -14,6 +14,7 @@ import { BaseCommand } from '../../base-command';
14
14
  * expectation is that somebody actually looked.
15
15
  */
16
16
  export default class TasksJudge extends BaseCommand {
17
+ static hidden: boolean;
17
18
  static description: string;
18
19
  static examples: string[];
19
20
  static args: {
@@ -18,7 +18,8 @@ const base_command_1 = require("../../base-command");
18
18
  * expectation is that somebody actually looked.
19
19
  */
20
20
  class TasksJudge extends base_command_1.BaseCommand {
21
- static description = 'Settle a judged expectation with a verdict and a stated reason';
21
+ static hidden = true;
22
+ static description = 'Compatibility alias for `tasks expectations assess`';
22
23
  static examples = [
23
24
  '<%= config.bin %> tasks judge <task-id> e2 --verdict met --reason "Read it end to end; a non-engineer follows it."',
24
25
  '<%= config.bin %> tasks judge <task-id> e2 --verdict unmet --reason "Still assumes the reader knows the schema."',
@@ -1,16 +1,8 @@
1
1
  import { BaseCommand } from '../../base-command';
2
- /**
3
- * "What did the agent produce for this task?" in one call.
4
- *
5
- * Answering that used to mean three commands and a jq hop: `tasks comments list`
6
- * for the canonical TASK_OUTPUT block, `tasks runs` / `execution-summary` for
7
- * whether the run even finished, and `tasks show --json | jq .conversationId`
8
- * piped into `messages list` for the agent's actual words. This command joins
9
- * them and states plainly when a piece is missing.
10
- */
2
+ /** Compatibility command name. The authoritative object is Result, not output. */
11
3
  export default class TasksOutput extends BaseCommand {
4
+ static hidden: boolean;
12
5
  static description: string;
13
- static examples: string[];
14
6
  static args: {
15
7
  id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
16
8
  };
@@ -20,5 +12,4 @@ export default class TasksOutput extends BaseCommand {
20
12
  full: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
13
  };
22
14
  run(): Promise<void>;
23
- private renderHuman;
24
15
  }
@@ -6,200 +6,119 @@ const base_command_1 = require("../../base-command");
6
6
  const task_resolver_1 = require("../../lib/task-resolver");
7
7
  const web_url_1 = require("../../lib/web-url");
8
8
  const task_transcript_1 = require("../../lib/task-transcript");
9
- /**
10
- * "What did the agent produce for this task?" in one call.
11
- *
12
- * Answering that used to mean three commands and a jq hop: `tasks comments list`
13
- * for the canonical TASK_OUTPUT block, `tasks runs` / `execution-summary` for
14
- * whether the run even finished, and `tasks show --json | jq .conversationId`
15
- * piped into `messages list` for the agent's actual words. This command joins
16
- * them and states plainly when a piece is missing.
17
- */
9
+ /** Compatibility command name. The authoritative object is Result, not output. */
18
10
  class TasksOutput extends base_command_1.BaseCommand {
19
- static description = 'Show a task report, verdict, and final agent reply';
20
- static examples = [
21
- '<%= config.bin %> tasks output <task-id>',
22
- '<%= config.bin %> tasks output',
23
- '<%= config.bin %> tasks output <task-id> --json',
24
- '<%= config.bin %> tasks output <task-id> --full',
25
- ];
11
+ static hidden = true;
12
+ static description = 'Show the current Result, Review, Deliverables, and final Run reply';
26
13
  static args = {
27
14
  id: core_1.Args.string({
28
- description: 'Task ID; defaults to OVERSKY_SESSION_TASK_ID in task runtimes',
15
+ description: 'Task ID; defaults to the task runtime context',
29
16
  required: false,
30
17
  ignoreStdin: true,
31
18
  }),
32
19
  };
33
20
  static flags = {
34
- json: core_1.Flags.boolean({ description: 'Output as JSON' }),
35
- task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
36
- full: core_1.Flags.boolean({
37
- description: "Print the agent's final message in full instead of a 40-line preview",
38
- default: false,
39
- }),
21
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
22
+ task: core_1.Flags.string({ description: 'Task ID; overrides runtime context' }),
23
+ full: core_1.Flags.boolean({ description: 'Print the final Run message in full', default: false }),
40
24
  };
41
25
  async run() {
42
26
  this.requireAuth();
43
27
  const { args, flags } = await this.parse(TasksOutput);
44
- let taskIdentity;
28
+ let identity;
45
29
  try {
46
- taskIdentity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
30
+ identity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
47
31
  }
48
- catch (err) {
49
- const failure = (0, task_resolver_1.taskResolutionFailure)(err);
32
+ catch (error) {
33
+ const failure = (0, task_resolver_1.taskResolutionFailure)(error);
50
34
  this.failWithCliError({
51
35
  message: failure.message,
52
36
  code: failure.code,
53
37
  exit: 2,
54
38
  retryable: false,
55
- details: { suggestion: failure.suggestion, context: failure.details },
39
+ details: { suggestion: failure.suggestion },
56
40
  });
57
41
  }
58
42
  let task;
59
43
  try {
60
- task = (await data_provider_1.dataService.getTask(taskIdentity.id, { enrich: false }));
44
+ task = (await data_provider_1.dataService.getTask(identity.id, { enrich: false }));
61
45
  }
62
- catch (err) {
63
- this.handleApiError(err);
46
+ catch (error) {
47
+ this.handleApiError(error);
64
48
  }
65
49
  const conversationId = task.conversationId ? String(task.conversationId) : null;
66
- // Every source is independently optional a task can have a verdict with no
67
- // surviving run row, or a transcript with no verdict. Never let one missing
68
- // surface blank the other two.
69
- const [outputComment, latestRun, messages, workEvents] = await Promise.all([
70
- (0, task_transcript_1.fetchLatestTaskOutputComment)(taskIdentity.id).catch(() => null),
71
- (0, task_transcript_1.fetchLatestRun)(taskIdentity.id).catch(() => null),
50
+ const [resultBundle, resources, updates, latestRun, messages] = await Promise.all([
51
+ data_provider_1.dataService.listTaskResults(identity.id).catch(() => ({
52
+ currentResultId: null,
53
+ currentSpecVersion: 1,
54
+ results: [],
55
+ reviews: [],
56
+ })),
57
+ data_provider_1.dataService.listTaskResources(identity.id).catch(() => ({ data: [] })),
58
+ data_provider_1.dataService.listTaskUpdates(identity.id, { limit: 10 }).catch(() => ({
59
+ data: [],
60
+ nextCursor: null,
61
+ })),
62
+ (0, task_transcript_1.fetchLatestRun)(identity.id).catch(() => null),
72
63
  conversationId
73
64
  ? (0, task_transcript_1.fetchTranscript)(conversationId).catch(() => [])
74
65
  : Promise.resolve([]),
75
- data_provider_1.dataService.listTaskWorkEvents(taskIdentity.id, { limit: 50 }).catch(() => ({ data: [] })),
76
66
  ]);
67
+ const result = resultBundle.results.find((item) => item.id === resultBundle.currentResultId) || null;
68
+ const review = result
69
+ ? resultBundle.reviews.find((item) => item.resultId === result.id) || null
70
+ : null;
77
71
  const finalMessage = (0, task_transcript_1.lastAssistantMessage)(messages);
78
- const latestReportEvent = workEvents.data.find((event) => Boolean((0, data_provider_1.taskReportFromWorkEvent)(event)));
79
- const latestReport = latestReportEvent ? (0, data_provider_1.taskReportFromWorkEvent)(latestReportEvent) : null;
72
+ const url = (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, task);
80
73
  if (flags.json) {
81
74
  this.log(JSON.stringify({
82
- object: 'sky.task_output',
83
- task: {
84
- id: String(task.id ?? taskIdentity.id),
85
- identifier: task.identifier ?? null,
86
- title: task.title ?? null,
87
- status: task.status ?? null,
88
- assigneeAgentIds: task.assigneeAgentIds ?? [],
89
- conversationId,
90
- url: (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, task),
91
- },
75
+ object: 'skrr.task_result',
76
+ task: { ...task, url },
77
+ result,
78
+ review,
79
+ deliverables: resources.data.filter((item) => item.role === 'deliverable'),
80
+ recentUpdates: updates.data,
92
81
  latestRun,
93
- taskReport: latestReport
94
- ? { report: latestReport, occurredAt: latestReportEvent?.occurredAt }
95
- : null,
96
- taskOutput: outputComment,
97
- // Present in JSON as well, so a script can detect a task closed
98
- // more than once without diffing comment bodies.
99
- completionCount: outputComment ? outputComment.supersededCount + 1 : 0,
100
82
  finalMessage,
101
- messageCount: messages.length,
102
83
  }, null, 2));
103
84
  return;
104
85
  }
105
- this.renderHuman({
106
- task: task,
107
- conversationId,
108
- latestRun,
109
- latestReport,
110
- latestReportAt: latestReportEvent?.occurredAt ? String(latestReportEvent.occurredAt) : null,
111
- outputComment,
112
- finalMessage,
113
- full: flags.full,
114
- });
115
- }
116
- renderHuman({ task, conversationId, latestRun, latestReport, latestReportAt, outputComment, finalMessage, full, }) {
117
- const ref = String(task.identifier ?? task.id ?? '-');
118
- const agents = Array.isArray(task.assigneeAgentIds) ? task.assigneeAgentIds : [];
119
- this.log(`Task: ${ref} — ${task.title ?? '-'}`);
120
- this.log(`Status: ${task.status ?? '-'}`);
121
- this.log(`Agent: ${agents.length > 0 ? agents.join(', ') : '-'}`);
122
- this.log(`Last run: ${latestRun
123
- ? `${latestRun.status} (${(0, task_transcript_1.formatTime)(latestRun.startedAt)}${latestRun.durationMs != null ? `, ${latestRun.durationMs}ms` : ''})`
124
- : 'never executed'}`);
86
+ this.log(`Task: ${task.identifier ?? task.id} — ${task.title ?? '-'}`);
87
+ this.log(`Status: ${task.status ?? '-'}`);
88
+ this.log(`Run: ${latestRun ? `${latestRun.status} · ${(0, task_transcript_1.formatTime)(latestRun.startedAt)}` : 'none'}`);
125
89
  this.log('');
126
- if (latestReport) {
127
- // Timestamped like the Verdict below it. These two blocks are selected
128
- // independently — the newest task-report work event and the newest
129
- // TASK_OUTPUT comment — so on a task completed more than once they can
130
- // come from different completions and disagree. Undated, that was
131
- // invisible.
132
- const reportAt = latestReportAt ? ` · ${(0, task_transcript_1.formatTime)(latestReportAt)}` : '';
133
- this.log(`Outcome (task report${reportAt}):`);
134
- this.log(` ${latestReport.outcome}`);
135
- this.log(' findings:');
136
- for (const finding of latestReport.findings)
137
- this.log(` - ${finding}`);
138
- if (latestReport.evidence.length > 0) {
139
- this.log(' evidence:');
140
- for (const evidence of latestReport.evidence)
141
- this.log(` - ${evidence}`);
142
- }
143
- if (latestReport.nextActions.length > 0) {
144
- this.log(' next actions:');
145
- for (const next of latestReport.nextActions)
146
- this.log(` - ${next}`);
147
- }
148
- this.log('');
149
- }
150
- if (outputComment) {
151
- const { parsed } = outputComment;
152
- this.log(`Verdict (TASK_OUTPUT · ${(0, task_transcript_1.formatTime)(outputComment.createdAt)}):`);
153
- this.log(` status: ${parsed.status || '-'}`);
154
- this.log(` verdict: ${parsed.verdict || '-'}`);
155
- this.log(` artifacts: ${parsed.artifacts || '-'}`);
156
- if (parsed.summary) {
157
- this.log(' summary:');
158
- for (const line of parsed.summary.split('\n'))
159
- this.log(` ${line}`);
160
- }
161
- // The field parser is single-line per field (see task-transcript.ts). If the
162
- // block carried anything else, say so rather than presenting a partial verdict.
163
- if (outputComment.unattributed.length > 0) {
164
- this.log(` (+${outputComment.unattributed.length} unparsed block line(s) — see \`skrr tasks comments list\`)`);
90
+ if (result) {
91
+ this.log(`Result v${result.version} · ${(0, task_transcript_1.formatTime)(result.submittedAt)}`);
92
+ this.log(` ${result.summary}`);
93
+ if (result.conclusion) {
94
+ this.log(` conclusion (${result.conclusion.type}): ${JSON.stringify(result.conclusion.value)}`);
165
95
  }
166
- // Reconcile the three signals a parked run shows — `completed`,
167
- // `UNVERIFIED`, and `Last run: failed` — which otherwise read as a
168
- // contradiction. (OSK-4945)
169
- if (outputComment.supersededCount > 0) {
170
- // `tasks complete` succeeds on an already-done task and posts another
171
- // block, so the canonical-looking screen can be assembled from several
172
- // closeouts. Say so rather than presenting it as one record.
173
- const total = outputComment.supersededCount + 1;
174
- const earlier = outputComment.supersededCount === 1 ? 'block' : 'blocks';
175
- this.log(` note: completed ${total} times — ${outputComment.supersededCount} earlier TASK_OUTPUT ${earlier} exist.`);
176
- this.log(' The Outcome above may come from a different completion than this');
177
- this.log(' Verdict. `skrr tasks comments list` shows every one.');
178
- }
179
- const note = (0, task_transcript_1.unverifiedOutcomeNote)(parsed.verdict);
180
- if (note)
181
- this.log(` note: ${note}`);
96
+ this.log(`Review: ${review?.decision || 'awaiting review'}`);
97
+ if (review?.rationale)
98
+ this.log(` ${review.rationale}`);
182
99
  }
183
100
  else {
184
- this.log('Verdict: no TASK_OUTPUT comment posted yet.');
101
+ this.log('Result: none submitted');
185
102
  }
103
+ const deliverables = resources.data.filter((item) => item.role === 'deliverable');
186
104
  this.log('');
105
+ this.log(`Deliverables: ${deliverables.length}`);
106
+ for (const item of deliverables) {
107
+ this.log(` ${item.title || item.identity || item.kind} · ${item.location || 'no locator'} · ${item.status}/${item.evidenceLevel}`);
108
+ }
187
109
  if (finalMessage) {
188
110
  const lines = (finalMessage.text || '(empty message)').split('\n');
189
- const preview = full ? lines : lines.slice(0, 40);
190
- this.log(`Final agent message (${finalMessage.sender} · ${(0, task_transcript_1.formatTime)(finalMessage.createdAt)}):`);
111
+ const preview = flags.full ? lines : lines.slice(0, 40);
112
+ this.log('');
113
+ this.log(`Final Run reply (${(0, task_transcript_1.formatTime)(finalMessage.createdAt)}):`);
191
114
  for (const line of preview)
192
115
  this.log(` ${line}`);
193
- if (preview.length < lines.length) {
194
- this.log('');
195
- this.log(` … ${lines.length - preview.length} more line(s). Use --full, or \`skrr tasks transcript ${task.id ?? ref}\`.`);
196
- }
116
+ if (preview.length < lines.length)
117
+ this.log(` … ${lines.length - preview.length} more line(s)`);
197
118
  }
198
- else if (conversationId) {
199
- this.log('Final agent message: none yet in the execution conversation.');
200
- }
201
- else {
202
- this.log('Final agent message: task has no execution conversation yet.');
119
+ if (url) {
120
+ this.log('');
121
+ this.log(`Task: ${url}#task-result`);
203
122
  }
204
123
  }
205
124
  }
@@ -1,10 +1,9 @@
1
1
  import { BaseCommand } from '../../base-command';
2
2
  /**
3
- * Record a concise, self-contained decision record in the task work ledger.
4
- * It deliberately does not finish the task: reports can be checkpoints,
5
- * proposals, or the handoff immediately before `tasks complete`.
3
+ * Compatibility spelling for submitting a versioned Task Result.
6
4
  */
7
5
  export default class TasksReport extends BaseCommand {
6
+ static hidden: boolean;
8
7
  static description: string;
9
8
  static examples: string[];
10
9
  static args: {
@@ -19,6 +18,7 @@ export default class TasksReport extends BaseCommand {
19
18
  evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
19
  next: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
20
  deliverable: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ artifact: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
22
  };
23
23
  run(): Promise<void>;
24
24
  }
@@ -3,23 +3,21 @@ 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 api_fetch_1 = require("../../lib/api-fetch");
7
6
  const outbox_1 = require("../../lib/outbox");
8
7
  const task_report_1 = require("../../lib/task-report");
9
8
  const task_resolver_1 = require("../../lib/task-resolver");
10
9
  const tasks_1 = require("../../lib/tasks");
11
- const session_task_endpoints_1 = require("../../lib/session-task-endpoints");
10
+ const task_artifact_flags_1 = require("../../lib/task-artifact-flags");
12
11
  const web_url_1 = require("../../lib/web-url");
13
12
  /**
14
- * Record a concise, self-contained decision record in the task work ledger.
15
- * It deliberately does not finish the task: reports can be checkpoints,
16
- * proposals, or the handoff immediately before `tasks complete`.
13
+ * Compatibility spelling for submitting a versioned Task Result.
17
14
  */
18
15
  class TasksReport extends base_command_1.BaseCommand {
19
- static description = 'Record a self-contained outcome, findings, evidence, and next actions';
16
+ static hidden = true;
17
+ static description = 'Submit a versioned Result with findings, evidence, and next actions';
20
18
  static examples = [
21
- '<%= config.bin %> tasks report <task-id> --outcome "Adopt the event ledger" --finding "The task page omits work-event details" --evidence "Task detail reads only legacy activity" --next "Add an Outcome section"',
22
- '<%= config.bin %> tasks report <task-id> --kind handoff --outcome "Ready for review" --finding "All acceptance criteria are met" --deliverable "src/task.ts" --json',
19
+ '<%= config.bin %> tasks report <task-id> --outcome "Adopt the event ledger" --finding "The task page omits work-event details" --evidence "Task detail reads only legacy activity" --next "Add a Result section"',
20
+ '<%= config.bin %> tasks report <task-id> --kind handoff --outcome "Ready for review" --finding "All expectations are met" --deliverable "file:src/task.ts" --json',
23
21
  ];
24
22
  static args = {
25
23
  id: core_1.Args.string({
@@ -32,7 +30,7 @@ class TasksReport extends base_command_1.BaseCommand {
32
30
  task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
33
31
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
34
32
  kind: core_1.Flags.string({
35
- description: 'Whether this is a decision or a handoff',
33
+ description: 'Deprecated compatibility option; every report is now a Result submission',
36
34
  options: ['decision', 'handoff'],
37
35
  default: 'decision',
38
36
  }),
@@ -53,6 +51,10 @@ class TasksReport extends base_command_1.BaseCommand {
53
51
  description: 'Durable file, commit, PR, or URL (repeatable)',
54
52
  multiple: true,
55
53
  }),
54
+ artifact: core_1.Flags.string({
55
+ description: 'Compatibility alias for --deliverable used by older managed instruction blocks',
56
+ multiple: true,
57
+ }),
56
58
  };
57
59
  async run() {
58
60
  this.requireAuth();
@@ -88,56 +90,77 @@ class TasksReport extends base_command_1.BaseCommand {
88
90
  retryable: false,
89
91
  });
90
92
  }
91
- const kind = flags.kind;
92
- const event = {
93
- idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-report', task.id, JSON.stringify({ report, kind: flags.kind })),
94
- kind,
95
- ...(0, task_report_1.taskReportEventFields)(report),
96
- artifacts: flags.deliverable?.map((ref) => ({ label: 'deliverable', ref })),
97
- };
98
- // THE SAME BRIDGE `tasks complete` CARRIES, for the same reason.
99
- //
100
- // `--deliverable` here is prose for a work event's `artifacts` list, and
101
- // the ledger the completion gate reads is written by `tasks deliverable
102
- // add`. Three commands in this CLI answer to the word and only one of them
103
- // writes the ledger — and the project's own operating instructions teach
104
- // this spelling. So a value that is unambiguously a coordinate is forwarded
105
- // to the ledger too; prose is left exactly as it was, because guessing a
106
- // coordinate out of prose fills the ledger with rows nobody can look up.
107
- for (const ref of flags.deliverable ?? []) {
93
+ const deliverables = (0, task_artifact_flags_1.mergeTaskArtifactFlags)(flags.deliverable, flags.artifact);
94
+ const resourceLinkIds = [];
95
+ for (const ref of deliverables) {
108
96
  const parsed = (0, tasks_1.parseDeliverableCoordinate)(ref);
109
97
  if (!parsed.ok) {
98
+ this.failWithCliError({
99
+ message: parsed.error,
100
+ code: 'INVALID_DELIVERABLE_COORDINATE',
101
+ exit: 1,
102
+ retryable: false,
103
+ details: { deliverable: ref },
104
+ });
110
105
  continue;
111
106
  }
112
107
  try {
113
- await data_provider_1.dataService.addTaskDeliverable(task.id, parsed.value);
108
+ const recorded = await data_provider_1.dataService.addTaskDeliverable(task.id, {
109
+ ...parsed.value,
110
+ idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-deliverable', task.id, ref),
111
+ });
112
+ resourceLinkIds.push(recorded.link.id);
114
113
  }
115
- catch {
116
- // Best-effort: a report must still be posted when the ledger write
117
- // fails, and the completion gate's refusal names the command that
118
- // writes it.
114
+ catch (error) {
115
+ this.handleApiError(error);
119
116
  }
120
117
  }
121
- const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('event');
118
+ const payload = {
119
+ summary: report.outcome,
120
+ body: [
121
+ report.findings.length
122
+ ? `Findings\n${report.findings.map((item) => `- ${item}`).join('\n')}`
123
+ : '',
124
+ report.evidence.length
125
+ ? `Evidence\n${report.evidence.map((item) => `- ${item}`).join('\n')}`
126
+ : '',
127
+ report.nextActions.length
128
+ ? `Next\n${report.nextActions.map((item) => `- ${item}`).join('\n')}`
129
+ : '',
130
+ ]
131
+ .filter(Boolean)
132
+ .join('\n\n'),
133
+ structuredContent: {
134
+ schema: 'skrr.task-report/v1',
135
+ value: {
136
+ findings: report.findings,
137
+ evidence: report.evidence,
138
+ nextActions: report.nextActions,
139
+ },
140
+ },
141
+ resourceLinkIds,
142
+ remainingWork: [],
143
+ };
122
144
  let result;
123
145
  try {
124
- result = sessionPath
125
- ? await (0, api_fetch_1.apiFetch)(sessionPath, { method: 'POST', body: event })
126
- : await data_provider_1.dataService.appendTaskWorkEvent({ taskId: task.id, data: event });
146
+ result = await data_provider_1.dataService.submitTaskResult({
147
+ taskId: task.id,
148
+ data: {
149
+ ...payload,
150
+ idempotencyKey: (0, outbox_1.idempotencyKeyFor)('task-result', task.id, JSON.stringify(payload)),
151
+ },
152
+ });
127
153
  }
128
154
  catch (error) {
129
155
  this.handleApiError(error);
130
156
  }
131
- if (sessionPath && result && typeof result === 'object' && 'entry' in result) {
132
- result = result.entry;
133
- }
134
157
  const taskUrl = (0, web_url_1.taskUrlFrom)(this.cliConfig.baseURL, { id: task.id });
135
- const url = taskUrl ? `${taskUrl}#task-outcome` : null;
158
+ const url = taskUrl ? `${taskUrl}#task-result` : null;
136
159
  if (flags.json) {
137
- this.log(JSON.stringify({ entry: result, url }, null, 2));
160
+ this.log(JSON.stringify({ ...result, url }, null, 2));
138
161
  return;
139
162
  }
140
- this.log(`Recorded ${kind} report on task ${task.id}.${url ? ` ${url}` : ''}`);
163
+ this.log(`Submitted Result v${result.result.version} on task ${task.id}.${url ? ` ${url}` : ''}`);
141
164
  }
142
165
  }
143
166
  exports.default = TasksReport;
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class TasksResourceAdd extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ task: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ role: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ coordinate: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ static flags: {
11
+ status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ provider: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'content-digest': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ expectation: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ 'result-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ }