@skrr-ai/cli 0.1.118 → 0.1.120

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 (285) hide show
  1. package/dist/base-command.d.ts +32 -0
  2. package/dist/base-command.js +113 -5
  3. package/dist/commands/commands.js +11 -0
  4. package/dist/commands/commitments/action-proposal.d.ts +13 -0
  5. package/dist/commands/commitments/action-proposal.js +39 -0
  6. package/dist/commands/commitments/action-proposals/decide.js +8 -1
  7. package/dist/commands/commitments/action-proposals/execute.js +11 -1
  8. package/dist/commands/commitments/create.js +2 -2
  9. package/dist/commands/commitments/doctor.d.ts +8 -0
  10. package/dist/commands/commitments/doctor.js +22 -0
  11. package/dist/commands/commitments/execute-remediation.js +12 -1
  12. package/dist/commands/commitments/observations.js +2 -2
  13. package/dist/commands/commitments/pack/bind.d.ts +18 -1
  14. package/dist/commands/commitments/pack/bind.js +66 -8
  15. package/dist/commands/commitments/pack/plan.d.ts +4 -1
  16. package/dist/commands/commitments/pack/plan.js +30 -2
  17. package/dist/commands/commitments/update.js +8 -2
  18. package/dist/commands/completion/index.js +1 -1
  19. package/dist/commands/completion/values.js +1 -1
  20. package/dist/commands/computer-use/audio.d.ts +1 -0
  21. package/dist/commands/computer-use/audio.js +1 -0
  22. package/dist/commands/computer-use/browser.d.ts +1 -0
  23. package/dist/commands/computer-use/browser.js +1 -0
  24. package/dist/commands/computer-use/disable.d.ts +1 -0
  25. package/dist/commands/computer-use/disable.js +1 -0
  26. package/dist/commands/computer-use/enable.d.ts +1 -0
  27. package/dist/commands/computer-use/enable.js +1 -0
  28. package/dist/commands/computer-use/index.d.ts +1 -0
  29. package/dist/commands/computer-use/index.js +1 -0
  30. package/dist/commands/computer-use/install.d.ts +1 -0
  31. package/dist/commands/computer-use/install.js +1 -0
  32. package/dist/commands/computer-use/recover.d.ts +1 -0
  33. package/dist/commands/computer-use/recover.js +1 -0
  34. package/dist/commands/computer-use/status.d.ts +1 -0
  35. package/dist/commands/computer-use/status.js +1 -0
  36. package/dist/commands/computer-use/stop.d.ts +1 -0
  37. package/dist/commands/computer-use/stop.js +1 -0
  38. package/dist/commands/context.js +16 -11
  39. package/dist/commands/convos/recovery.js +1 -1
  40. package/dist/commands/daemon/diagnostics.d.ts +9 -0
  41. package/dist/commands/daemon/diagnostics.js +53 -0
  42. package/dist/commands/daemon/index.js +2 -0
  43. package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
  44. package/dist/commands/daemon/maintenance/attest.js +52 -0
  45. package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
  46. package/dist/commands/daemon/maintenance/hold.js +70 -0
  47. package/dist/commands/daemon/maintenance/index.d.ts +12 -0
  48. package/dist/commands/daemon/maintenance/index.js +30 -0
  49. package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
  50. package/dist/commands/daemon/maintenance/resume.js +36 -0
  51. package/dist/commands/daemon/maintenance/status.d.ts +13 -0
  52. package/dist/commands/daemon/maintenance/status.js +36 -0
  53. package/dist/commands/doctor.d.ts +4 -1
  54. package/dist/commands/doctor.js +50 -6
  55. package/dist/commands/followups/plans/cancel-batch.js +6 -3
  56. package/dist/commands/followups/plans/capacity.js +7 -3
  57. package/dist/commands/followups/plans/observability.js +11 -3
  58. package/dist/commands/followups/plans/preferences/set.js +26 -8
  59. package/dist/commands/followups/plans/preferences.js +1 -1
  60. package/dist/commands/followups/plans/show.js +1 -1
  61. package/dist/commands/goals/key-results/assess.d.ts +36 -0
  62. package/dist/commands/goals/key-results/assess.js +110 -0
  63. package/dist/commands/goals/key-results/history.d.ts +30 -0
  64. package/dist/commands/goals/key-results/history.js +104 -0
  65. package/dist/commands/goals/key-results/list.d.ts +5 -4
  66. package/dist/commands/goals/key-results/list.js +12 -6
  67. package/dist/commands/goals/key-results/show.d.ts +4 -2
  68. package/dist/commands/goals/key-results/show.js +25 -4
  69. package/dist/commands/goals/key-results/update.d.ts +4 -0
  70. package/dist/commands/goals/key-results/update.js +18 -24
  71. package/dist/commands/goals/plan-now.js +12 -1
  72. package/dist/commands/goals/planner-compare.d.ts +30 -0
  73. package/dist/commands/goals/planner-compare.js +136 -0
  74. package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
  75. package/dist/commands/machines/dedicated/service/exec.js +70 -11
  76. package/dist/commands/machines/hosted/destroy.d.ts +1 -0
  77. package/dist/commands/machines/hosted/destroy.js +11 -1
  78. package/dist/commands/machines/hosted/exec.d.ts +1 -0
  79. package/dist/commands/machines/hosted/exec.js +12 -1
  80. package/dist/commands/machines/hosted/index.js +1 -0
  81. package/dist/commands/machines/hosted/operation.d.ts +14 -0
  82. package/dist/commands/machines/hosted/operation.js +51 -0
  83. package/dist/commands/machines/hosted/pull.js +1 -1
  84. package/dist/commands/machines/hosted/start.js +6 -2
  85. package/dist/commands/memory/versions/list.d.ts +2 -0
  86. package/dist/commands/memory/versions/list.js +3 -2
  87. package/dist/commands/memory/versions/show.d.ts +2 -0
  88. package/dist/commands/memory/versions/show.js +3 -2
  89. package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
  90. package/dist/commands/spaces/auto-executor/compare.js +139 -0
  91. package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
  92. package/dist/commands/spaces/auto-executor/runs.js +13 -1
  93. package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
  94. package/dist/commands/spaces/charter/create-from-description.js +77 -0
  95. package/dist/commands/spaces/charter/show.d.ts +22 -0
  96. package/dist/commands/spaces/charter/show.js +61 -0
  97. package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
  98. package/dist/commands/spaces/heartbeats/list.js +13 -0
  99. package/dist/commands/spaces/install-template.js +3 -0
  100. package/dist/commands/spaces/loops/migrate.d.ts +32 -0
  101. package/dist/commands/spaces/loops/migrate.js +103 -0
  102. package/dist/commands/spaces/loops/release.d.ts +14 -0
  103. package/dist/commands/spaces/loops/release.js +59 -0
  104. package/dist/commands/spaces/notebook.d.ts +25 -0
  105. package/dist/commands/spaces/notebook.js +75 -0
  106. package/dist/commands/spaces/proposals/discard.d.ts +17 -0
  107. package/dist/commands/spaces/proposals/discard.js +17 -0
  108. package/dist/commands/spaces/proposals/keep.d.ts +17 -0
  109. package/dist/commands/spaces/proposals/keep.js +17 -0
  110. package/dist/commands/spaces/proposals/list.d.ts +24 -0
  111. package/dist/commands/spaces/proposals/list.js +89 -0
  112. package/dist/commands/spaces/skills/propose.d.ts +29 -0
  113. package/dist/commands/spaces/skills/propose.js +82 -0
  114. package/dist/commands/spaces/templates/fork.js +3 -0
  115. package/dist/commands/spaces/triggers/show.js +6 -0
  116. package/dist/commands/spaces/workflows/retry.d.ts +1 -0
  117. package/dist/commands/spaces/workflows/retry.js +8 -1
  118. package/dist/commands/spaces/workflows/triggers/create.js +3 -2
  119. package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
  120. package/dist/commands/spaces/workflows/triggers/update.js +2 -1
  121. package/dist/commands/spaces/write-policy/set.d.ts +22 -0
  122. package/dist/commands/spaces/write-policy/set.js +82 -0
  123. package/dist/commands/spaces/write-policy/show.d.ts +19 -0
  124. package/dist/commands/spaces/write-policy/show.js +49 -0
  125. package/dist/commands/store/artifacts/receipt.d.ts +14 -0
  126. package/dist/commands/store/artifacts/receipt.js +34 -0
  127. package/dist/commands/store/artifacts/release.d.ts +2 -0
  128. package/dist/commands/store/artifacts/release.js +11 -0
  129. package/dist/commands/store/governance/publish-release.d.ts +2 -0
  130. package/dist/commands/store/governance/publish-release.js +30 -1
  131. package/dist/commands/store/governance/release-receipt.d.ts +12 -0
  132. package/dist/commands/store/governance/release-receipt.js +32 -0
  133. package/dist/commands/tasks/approvals/list.d.ts +11 -5
  134. package/dist/commands/tasks/approvals/list.js +13 -6
  135. package/dist/commands/tasks/attachments/facts.d.ts +12 -0
  136. package/dist/commands/tasks/attachments/facts.js +29 -0
  137. package/dist/commands/tasks/attachments/upload.d.ts +1 -0
  138. package/dist/commands/tasks/attachments/upload.js +16 -0
  139. package/dist/commands/tasks/bulk-update.js +35 -1
  140. package/dist/commands/tasks/context.d.ts +15 -0
  141. package/dist/commands/tasks/context.js +69 -0
  142. package/dist/commands/tasks/copy.d.ts +18 -0
  143. package/dist/commands/tasks/copy.js +85 -0
  144. package/dist/commands/tasks/create-tree.js +97 -23
  145. package/dist/commands/tasks/create.js +9 -1
  146. package/dist/commands/tasks/deliverable/add.js +20 -10
  147. package/dist/commands/tasks/move.js +8 -1
  148. package/dist/commands/tasks/operations/show.d.ts +16 -0
  149. package/dist/commands/tasks/operations/show.js +98 -0
  150. package/dist/commands/tasks/operations/wait.d.ts +22 -0
  151. package/dist/commands/tasks/operations/wait.js +114 -0
  152. package/dist/commands/tasks/preflight.d.ts +1 -0
  153. package/dist/commands/tasks/preflight.js +11 -1
  154. package/dist/commands/tasks/rearm-recurrence.js +4 -0
  155. package/dist/commands/tasks/result/show.js +22 -0
  156. package/dist/commands/tasks/result/submit.d.ts +1 -0
  157. package/dist/commands/tasks/result/submit.js +3 -0
  158. package/dist/commands/tasks/retry-receipt.d.ts +15 -0
  159. package/dist/commands/tasks/retry-receipt.js +89 -0
  160. package/dist/commands/tasks/retry-review.d.ts +16 -0
  161. package/dist/commands/tasks/retry-review.js +66 -0
  162. package/dist/commands/tasks/retry.d.ts +4 -8
  163. package/dist/commands/tasks/retry.js +34 -68
  164. package/dist/commands/tasks/runs.d.ts +21 -0
  165. package/dist/commands/tasks/runs.js +95 -0
  166. package/dist/commands/tasks/show.d.ts +2 -0
  167. package/dist/commands/tasks/show.js +15 -1
  168. package/dist/commands/tasks/start-receipt.d.ts +15 -0
  169. package/dist/commands/tasks/start-receipt.js +95 -0
  170. package/dist/commands/tasks/start.d.ts +4 -0
  171. package/dist/commands/tasks/start.js +49 -3
  172. package/dist/commands/tasks/update.js +3 -0
  173. package/dist/commands/tasks/upsert.js +17 -3
  174. package/dist/commands/tasks/watch.d.ts +3 -0
  175. package/dist/commands/tasks/watch.js +85 -20
  176. package/dist/commands/wiki/history.d.ts +33 -0
  177. package/dist/commands/wiki/history.js +134 -0
  178. package/dist/commands/wiki/ls.d.ts +2 -0
  179. package/dist/commands/wiki/ls.js +8 -0
  180. package/dist/commands/wiki/update.d.ts +3 -1
  181. package/dist/commands/wiki/update.js +24 -2
  182. package/dist/commands/wiki/write.d.ts +22 -0
  183. package/dist/commands/wiki/write.js +144 -6
  184. package/dist/generated/agent-guides.json +81 -81
  185. package/dist/generated/managed-instruction-guides.json +1 -1
  186. package/dist/lib/agent-guides.d.ts +9 -0
  187. package/dist/lib/agent-guides.js +23 -1
  188. package/dist/lib/agentic-stream.d.ts +5 -0
  189. package/dist/lib/agentic-stream.js +122 -3
  190. package/dist/lib/api-fetch.d.ts +4 -0
  191. package/dist/lib/api-fetch.js +25 -7
  192. package/dist/lib/auth-diagnostics.d.ts +39 -0
  193. package/dist/lib/auth-diagnostics.js +71 -0
  194. package/dist/lib/cli-client-identity.d.ts +6 -0
  195. package/dist/lib/cli-client-identity.js +16 -0
  196. package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
  197. package/dist/lib/cli-installation-diagnostics.js +254 -0
  198. package/dist/lib/command-hygiene.d.ts +45 -0
  199. package/dist/lib/command-hygiene.js +413 -0
  200. package/dist/lib/commitments.d.ts +64 -3
  201. package/dist/lib/commitments.js +34 -6
  202. package/dist/lib/completion-index.d.ts +16 -4
  203. package/dist/lib/completion-index.js +50 -14
  204. package/dist/lib/config.js +7 -1
  205. package/dist/lib/daemon-maintenance-command.d.ts +22 -0
  206. package/dist/lib/daemon-maintenance-command.js +39 -0
  207. package/dist/lib/daemon-maintenance.d.ts +275 -0
  208. package/dist/lib/daemon-maintenance.js +1035 -0
  209. package/dist/lib/dedicated-service.d.ts +3 -2
  210. package/dist/lib/dedicated-service.js +11 -3
  211. package/dist/lib/governed-store.d.ts +8 -0
  212. package/dist/lib/governed-store.js +5 -0
  213. package/dist/lib/hosted-machines.d.ts +33 -2
  214. package/dist/lib/hosted-machines.js +19 -1
  215. package/dist/lib/json-output.d.ts +1 -1
  216. package/dist/lib/machines.d.ts +9 -1
  217. package/dist/lib/machines.js +15 -1
  218. package/dist/lib/memory-history-session.d.ts +14 -0
  219. package/dist/lib/memory-history-session.js +60 -0
  220. package/dist/lib/node-adapter.js +13 -0
  221. package/dist/lib/record-output.d.ts +22 -0
  222. package/dist/lib/record-output.js +78 -0
  223. package/dist/lib/roles.d.ts +3 -3
  224. package/dist/lib/scoped-memory-command.d.ts +24 -0
  225. package/dist/lib/scoped-memory-command.js +87 -5
  226. package/dist/lib/space-charter.d.ts +49 -0
  227. package/dist/lib/space-charter.js +78 -0
  228. package/dist/lib/space-loop-migration.d.ts +18 -0
  229. package/dist/lib/space-loop-migration.js +128 -0
  230. package/dist/lib/space-notebook.d.ts +22 -0
  231. package/dist/lib/space-notebook.js +140 -0
  232. package/dist/lib/space-proposal-decision-command.d.ts +36 -0
  233. package/dist/lib/space-proposal-decision-command.js +108 -0
  234. package/dist/lib/space-proposals.d.ts +44 -0
  235. package/dist/lib/space-proposals.js +186 -0
  236. package/dist/lib/space-templates.d.ts +8 -0
  237. package/dist/lib/space-templates.js +17 -0
  238. package/dist/lib/space-write-policy.d.ts +24 -0
  239. package/dist/lib/space-write-policy.js +103 -0
  240. package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
  241. package/dist/lib/task-agent-context-capabilities.js +22 -0
  242. package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
  243. package/dist/lib/task-agent-context-compatibility.js +30 -0
  244. package/dist/lib/task-asset-upload.d.ts +22 -0
  245. package/dist/lib/task-asset-upload.js +257 -29
  246. package/dist/lib/task-batch.d.ts +15 -1
  247. package/dist/lib/task-batch.js +35 -2
  248. package/dist/lib/task-operation-watch.d.ts +66 -0
  249. package/dist/lib/task-operation-watch.js +159 -0
  250. package/dist/lib/task-resolver.d.ts +1 -1
  251. package/dist/lib/task-resolver.js +4 -3
  252. package/dist/lib/task-runtime-headers.js +13 -3
  253. package/dist/lib/task-work.d.ts +1 -1
  254. package/dist/lib/task-work.js +35 -1
  255. package/dist/lib/task-write-attribution.d.ts +14 -0
  256. package/dist/lib/task-write-attribution.js +35 -2
  257. package/dist/lib/triggers.d.ts +11 -0
  258. package/dist/lib/triggers.js +7 -0
  259. package/dist/lib/wiki-update.d.ts +1 -0
  260. package/dist/lib/wiki-update.js +10 -1
  261. package/dist/lib/wiki.js +4 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
  271. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
  272. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
  273. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
  274. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
  275. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
  276. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
  277. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
  278. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
  279. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
  280. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
  281. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
  282. package/dist/node_modules/@skrr-ai/auth-core/package.json +20 -0
  283. package/dist/node_modules/@skrr-ai/data-provider/index.js +27085 -20250
  284. package/oclif.manifest.json +10570 -7247
  285. package/package.json +20 -2
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const task_resolver_1 = require("../../../lib/task-resolver");
7
+ const task_operation_watch_1 = require("../../../lib/task-operation-watch");
8
+ /**
9
+ * Wait on a Task Operation's server-owned projection. This is intentionally a
10
+ * read-only command: it never retries, redrives, changes Task workflow, or
11
+ * reconstructs an action from the operation's intent.
12
+ */
13
+ class TasksOperationsWait extends base_command_1.BaseCommand {
14
+ static description = 'Wait read-only for one immutable Task Operation; never retries or dispatches another run';
15
+ static examples = [
16
+ '<%= config.bin %> tasks operations wait <task-id> --operation task-retry:deploy-42',
17
+ '<%= config.bin %> tasks operations wait <task-id> --operation task-start:deploy-42 --timeout 10m --json',
18
+ ];
19
+ static args = {
20
+ id: core_1.Args.string({
21
+ description: 'Task ID; defaults to OVERSKY_SESSION_TASK_ID in task runtimes',
22
+ required: false,
23
+ ignoreStdin: true,
24
+ }),
25
+ };
26
+ static flags = {
27
+ task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
28
+ operation: core_1.Flags.string({ description: 'Immutable Task Operation ID to observe', required: true }),
29
+ interval: core_1.Flags.integer({ description: 'Polling interval in seconds', default: 5 }),
30
+ timeout: core_1.Flags.string({ description: 'Timeout such as 30s, 10m, 2h' }),
31
+ json: core_1.Flags.boolean({ description: 'Emit newline-delimited JSON operation checkpoints' }),
32
+ };
33
+ async run() {
34
+ this.requireAuth();
35
+ const { args, flags } = await this.parse(TasksOperationsWait);
36
+ let taskIdentity;
37
+ try {
38
+ taskIdentity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
39
+ }
40
+ catch (error) {
41
+ const failure = (0, task_resolver_1.taskResolutionFailure)(error);
42
+ this.failWithCliError({
43
+ code: failure.code,
44
+ message: failure.message,
45
+ exit: 2,
46
+ retryable: false,
47
+ details: failure.suggestion ? { suggestion: failure.suggestion } : undefined,
48
+ });
49
+ }
50
+ const taskId = await this.resolveTaskReference(taskIdentity.id);
51
+ let timeoutMs;
52
+ try {
53
+ timeoutMs = (0, task_operation_watch_1.parseTaskOperationWatchDuration)(flags.timeout);
54
+ }
55
+ catch (error) {
56
+ this.error(error.message, { exit: 2 });
57
+ return;
58
+ }
59
+ const operationId = flags.operation.trim();
60
+ if (!operationId || operationId.length > 200) {
61
+ this.error('--operation must be a non-empty operation ID of at most 200 characters.', { exit: 2 });
62
+ return;
63
+ }
64
+ const getTaskOperation = data_provider_1.dataService.getTaskOperation;
65
+ if (!getTaskOperation) {
66
+ this.failWithCliError({
67
+ code: 'TASK_OPERATION_READER_UNAVAILABLE',
68
+ message: 'This CLI build cannot read Task Operations. Update skrr before waiting on this operation.',
69
+ exit: 2,
70
+ retryable: false,
71
+ });
72
+ }
73
+ try {
74
+ const result = await (0, task_operation_watch_1.watchTaskOperation)({
75
+ taskId,
76
+ operationId,
77
+ intervalMs: Math.max(1, flags.interval) * 1000,
78
+ timeoutMs,
79
+ read: getTaskOperation,
80
+ onCheckpoint: (checkpoint) => this.printCheckpoint(checkpoint, Boolean(flags.json)),
81
+ });
82
+ if (result.result === 'failed')
83
+ this.exit(1);
84
+ }
85
+ catch (error) {
86
+ const candidate = error;
87
+ if (candidate?.code === 'TASK_OPERATION_WAIT_TIMEOUT') {
88
+ this.exit(124);
89
+ return;
90
+ }
91
+ if (candidate?.code === 'TASK_OPERATION_TERMINAL_UNKNOWN') {
92
+ this.failWithCliError({
93
+ code: 'TASK_OPERATION_TERMINAL_UNKNOWN',
94
+ message: 'The Task Operation is terminal but does not report a recognized outcome. Inspect it; do not issue a fresh operation by guesswork.',
95
+ exit: 2,
96
+ retryable: false,
97
+ details: { taskId, operationId },
98
+ });
99
+ return;
100
+ }
101
+ this.handleApiError(error, { subject: `Task operation ${operationId}` });
102
+ }
103
+ }
104
+ printCheckpoint(checkpoint, json) {
105
+ if (json) {
106
+ this.log(JSON.stringify(checkpoint));
107
+ return;
108
+ }
109
+ if (checkpoint.changed || checkpoint.terminal || checkpoint.observation === 'timeout') {
110
+ this.log((0, task_operation_watch_1.taskOperationCheckpointLine)(checkpoint));
111
+ }
112
+ }
113
+ }
114
+ exports.default = TasksOperationsWait;
@@ -8,6 +8,7 @@ export default class TasksPreflight extends BaseCommand {
8
8
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
9
  task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  skill: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ capability: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  };
12
13
  static examples: string[];
13
14
  run(): Promise<void>;
@@ -14,6 +14,10 @@ class TasksPreflight extends base_command_1.BaseCommand {
14
14
  json: core_1.Flags.boolean({ description: 'Output native observations, uncertainty, and CLI verification metadata as JSON' }),
15
15
  task: core_1.Flags.string({ description: 'Task ID/ref; overrides current Task runtime context' }),
16
16
  skill: core_1.Flags.string({ description: 'Skill ID for the existing server execution preview' }),
17
+ capability: core_1.Flags.string({
18
+ multiple: true,
19
+ description: 'Capability required of the execution target. Repeat for every requirement.',
20
+ }),
17
21
  };
18
22
  static examples = [
19
23
  '<%= config.bin %> tasks preflight OSK-123',
@@ -56,7 +60,13 @@ class TasksPreflight extends base_command_1.BaseCommand {
56
60
  }
57
61
  const report = await (0, task_preflight_1.readTaskPreflight)(taskId, {
58
62
  workflow: () => data_provider_1.dataService.getTaskActionability(taskId),
59
- execution: () => data_provider_1.dataService.previewTaskStart(taskId, flags.skill ? { skillId: flags.skill } : undefined),
63
+ execution: () => {
64
+ const options = {
65
+ ...(flags.skill ? { skillId: flags.skill } : {}),
66
+ ...(flags.capability?.length ? { requestedCapabilities: flags.capability } : {}),
67
+ };
68
+ return data_provider_1.dataService.previewTaskStart(taskId, Object.keys(options).length ? options : undefined);
69
+ },
60
70
  });
61
71
  // Only native diagnostic responses establish an identity for _cli; a
62
72
  // requested ref is not itself a confirmed Task record.
@@ -56,6 +56,10 @@ class TasksRearmRecurrence extends base_command_1.BaseCommand {
56
56
  }, null, 2));
57
57
  return;
58
58
  }
59
+ if (result.pending === true) {
60
+ this.log(result.message);
61
+ return;
62
+ }
59
63
  const finished = result.task;
60
64
  const from = finished.identifier || finished.id || taskRef;
61
65
  const next = result.successor.identifier || result.successor.id;
@@ -13,10 +13,32 @@ const task_legacy_1 = require("../../../lib/task-legacy");
13
13
  */
14
14
  function describeResultDetail(current, all = []) {
15
15
  const lines = [];
16
+ if (current.sourceFacts?.length) {
17
+ lines.push('Source declarations (referenced artifacts and inferred semantics unverified):');
18
+ for (const receipt of current.sourceFacts) {
19
+ lines.push(` ${receipt.source.id} · SHA-256 ${receipt.source.digest} · ${receipt.facts.length} declarations`);
20
+ for (const fact of receipt.facts)
21
+ lines.push(` ${JSON.stringify(fact.pointer)}: ${JSON.stringify(fact.literal)}`);
22
+ }
23
+ lines.push('Result interpretation is reported by its submitter.');
24
+ }
16
25
  if (current.supersedesResultId) {
17
26
  const previous = all.find((row) => row.id === current.supersedesResultId);
18
27
  lines.push(`Supersedes: ${current.supersedesResultId}${previous ? ` (v${previous.version})` : ''}`);
19
28
  }
29
+ const sourceRuns = Array.from(new Set([current.runId, ...(current.sourceRunIds ?? [])].filter((runId) => typeof runId === 'string' && runId.length > 0)));
30
+ // A Result describes the work that produced it, not whether that work is
31
+ // still current after a later input. `execution-state` evaluates that latter
32
+ // question against the current server heads, so keep the link visible but do
33
+ // not manufacture an applicability claim here.
34
+ if (sourceRuns.length > 0)
35
+ lines.push(`Source run${sourceRuns.length === 1 ? '' : 's'}: ${sourceRuns.join(', ')}`);
36
+ const coverage = current.inputCoverage;
37
+ if (coverage && Number.isInteger(coverage.throughWorkInputRevision)) {
38
+ lines.push(`Work coverage: through input revision ${coverage.throughWorkInputRevision}` +
39
+ `${Number.isInteger(coverage.workflowGeneration) ? ` (generation ${coverage.workflowGeneration})` : ''}` +
40
+ '; current applicability is reported by tasks execution-state.');
41
+ }
20
42
  const links = current.resourceLinkIds ?? [];
21
43
  lines.push(`Deliverables: ${links.length > 0 ? links.join(', ') : 'none linked'}`);
22
44
  const evidence = current.evidenceRefs ?? [];
@@ -14,6 +14,7 @@ export default class TasksResultSubmit extends BaseCommand {
14
14
  'conclusion-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
15
  'structured-schema': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  'structured-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'source-attachment': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
18
  deliverable: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
19
  evidence: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  attach: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -37,6 +37,8 @@ class TasksResultSubmit extends base_command_1.BaseCommand {
37
37
  'conclusion-json': core_1.Flags.string({ description: 'JSON value for the domain conclusion' }),
38
38
  'structured-schema': core_1.Flags.string({ description: 'Schema name for --structured-json' }),
39
39
  'structured-json': core_1.Flags.string({ description: 'Task-type-specific structured Result JSON' }),
40
+ 'source-attachment': core_1.Flags.string({ multiple: true,
41
+ description: 'Exact Task JSON attachment ID; server records its literal declarations separately from this Result interpretation (up to four)' }),
40
42
  deliverable: core_1.Flags.string({
41
43
  multiple: true,
42
44
  description: 'Task Resource link id (repeatable)',
@@ -129,6 +131,7 @@ class TasksResultSubmit extends base_command_1.BaseCommand {
129
131
  expectedSpecVersion: flags['spec-version'],
130
132
  runId: flags['run-id'],
131
133
  sourceRunIds: flags['source-run'],
134
+ sourceAttachmentIds: flags['source-attachment'],
132
135
  resourceLinkIds: flags.deliverable,
133
136
  evidenceRefs,
134
137
  remainingWork: (flags.remaining || []).map((summary) => ({ summary })),
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** Read-only recovery for one server-owned compound Task retry. */
3
+ export default class TasksRetryReceipt extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'request-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../base-command");
6
+ const task_resolver_1 = require("../../lib/task-resolver");
7
+ /** Read-only recovery for one server-owned compound Task retry. */
8
+ class TasksRetryReceipt extends base_command_1.BaseCommand {
9
+ static description = 'Read a task retry receipt without changing status or dispatching another run.';
10
+ static examples = [
11
+ '<%= config.bin %> tasks retry-receipt <task-id> --request-id task-retry:deploy-42',
12
+ '<%= config.bin %> tasks retry-receipt <task-id> --request-id task-retry:deploy-42 --json',
13
+ ];
14
+ static args = {
15
+ id: core_1.Args.string({
16
+ description: 'Task ID; defaults to OVERSKY_SESSION_TASK_ID in task runtimes',
17
+ required: false,
18
+ ignoreStdin: true,
19
+ }),
20
+ };
21
+ static flags = {
22
+ task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
23
+ 'request-id': core_1.Flags.string({
24
+ description: 'The request id printed by tasks retry',
25
+ required: true,
26
+ }),
27
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
28
+ };
29
+ async run() {
30
+ this.requireAuth();
31
+ const { args, flags } = await this.parse(TasksRetryReceipt);
32
+ let taskIdentity;
33
+ try {
34
+ taskIdentity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
35
+ }
36
+ catch (err) {
37
+ const failure = (0, task_resolver_1.taskResolutionFailure)(err);
38
+ this.failWithCliError({
39
+ message: failure.message,
40
+ code: failure.code,
41
+ exit: 2,
42
+ retryable: false,
43
+ details: { suggestion: failure.suggestion, context: failure.details },
44
+ });
45
+ }
46
+ // `resolveTaskIdentity` decides which INPUT wins; it does no lookup. This
47
+ // turns whatever it picked into something the API can resolve — a UUID and
48
+ // an OSK-2423 ref pass through untouched, a title is searched.
49
+ const taskId = await this.resolveTaskReference(taskIdentity.id);
50
+ const getTaskRetryReceipt = data_provider_1.dataService
51
+ .getTaskRetryReceipt;
52
+ let receipt;
53
+ try {
54
+ receipt = await getTaskRetryReceipt(taskId, flags['request-id']);
55
+ }
56
+ catch (err) {
57
+ this.handleApiError(err, { subject: `Task ${taskId} retry receipt` });
58
+ }
59
+ if (flags.json) {
60
+ this.printJsonResult(receipt);
61
+ return;
62
+ }
63
+ this.log(`Retry request ${receipt.requestId}: ${receipt.state}`);
64
+ if (receipt.responseStatus !== undefined)
65
+ this.log(`Response status: ${receipt.responseStatus}`);
66
+ if (receipt.statusTransition?.state) {
67
+ this.log(`Status transition: ${receipt.statusTransition.state}`);
68
+ }
69
+ if (receipt.statusTransition?.task?.status) {
70
+ this.log(`Transitioned status: ${receipt.statusTransition.task.status}`);
71
+ }
72
+ if (receipt.dispatch?.state)
73
+ this.log(`Dispatch: ${receipt.dispatch.state}`);
74
+ if (receipt.dispatch?.code)
75
+ this.log(`Dispatch code: ${receipt.dispatch.code}`);
76
+ if (receipt.dispatch?.run?.runId)
77
+ this.log(`Run: ${receipt.dispatch.run.runId}`);
78
+ if (receipt.dispatch?.run?.autonomousRunId) {
79
+ this.log(`Autonomous Run: ${receipt.dispatch.run.autonomousRunId}`);
80
+ }
81
+ if (receipt.dispatch?.run?.conversationId) {
82
+ this.log(`Conversation: ${receipt.dispatch.run.conversationId}`);
83
+ }
84
+ if (receipt.dispatch?.run?.sessionId)
85
+ this.log(`Session: ${receipt.dispatch.run.sessionId}`);
86
+ this.log('This is inspect-only. Do not resend the retry from this receipt.');
87
+ }
88
+ }
89
+ exports.default = TasksRetryReceipt;
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** Explicit DRI continuation; never composes move-to-todo with a leaf start. */
3
+ export default class TasksRetryReview extends BaseCommand {
4
+ static description: string;
5
+ static args: {
6
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ execute: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ 'run-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'expected-manifest': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const node_crypto_1 = require("node:crypto");
4
+ const core_1 = require("@oclif/core");
5
+ const base_command_1 = require("../../base-command");
6
+ const api_fetch_1 = require("../../lib/api-fetch");
7
+ /** Explicit DRI continuation; never composes move-to-todo with a leaf start. */
8
+ class TasksRetryReview extends base_command_1.BaseCommand {
9
+ static description = 'Preview or explicitly retry exact blocked DRI review work on the same Task';
10
+ static args = {
11
+ id: core_1.Args.string({ required: true, ignoreStdin: true, description: 'Review Task id or ref' }),
12
+ };
13
+ static flags = {
14
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
15
+ execute: core_1.Flags.boolean({
16
+ description: 'Request one fresh genuine DRI Run using the exact preview below',
17
+ }),
18
+ 'run-id': core_1.Flags.string({
19
+ description: 'Original blocked DRI Run returned by the preview',
20
+ dependsOn: ['execute'],
21
+ }),
22
+ 'expected-manifest': core_1.Flags.string({
23
+ description: 'Exact preview manifest SHA-256',
24
+ dependsOn: ['execute'],
25
+ }),
26
+ 'request-id': core_1.Flags.string({
27
+ description: 'Stable request UUID; retain it when retrying an ambiguous response',
28
+ dependsOn: ['execute'],
29
+ }),
30
+ };
31
+ async run() {
32
+ this.requireAuth();
33
+ const { args, flags } = await this.parse(TasksRetryReview);
34
+ const taskId = await this.resolveEntityRef('task', args.id);
35
+ const endpoint = `/api/tasks/${encodeURIComponent(taskId)}/dri-review-retry`;
36
+ if (flags.execute && (!flags['run-id'] || !flags['expected-manifest'] || !flags['request-id']))
37
+ this.error('Execution requires --run-id, --expected-manifest and --request-id from the reviewed preview.');
38
+ let result;
39
+ try {
40
+ result = await (0, api_fetch_1.apiFetch)(endpoint, flags.execute
41
+ ? {
42
+ method: 'POST',
43
+ body: {
44
+ runId: flags['run-id'],
45
+ expectedManifest: flags['expected-manifest'],
46
+ requestId: flags['request-id'],
47
+ },
48
+ headers: { 'X-Idempotency-Key': `dri-review-retry:${flags['request-id']}` },
49
+ }
50
+ : undefined);
51
+ }
52
+ catch (error) {
53
+ this.handleApiError(error);
54
+ }
55
+ if (flags.json)
56
+ return this.printJsonResult(result);
57
+ if (flags.execute) {
58
+ this.log(`Requested DRI review retry on ${taskId}. Request: ${result.requestId}; phase: ${result.phase}.`);
59
+ this.log('The server owns admission and delivery. An accepted request is not a completed Review.');
60
+ return;
61
+ }
62
+ this.log(JSON.stringify(result, null, 2));
63
+ this.log(`After reviewing the exact obligations, run: ${this.config.bin} tasks retry-review ${taskId} --execute --run-id ${result.runId} --expected-manifest ${result.manifestSha256} --request-id ${(0, node_crypto_1.randomUUID)()}`);
64
+ }
65
+ }
66
+ exports.default = TasksRetryReview;
@@ -14,13 +14,9 @@ import { BaseCommand } from '../../base-command';
14
14
  * locally-running coding agent) was told an action existed and given no verb —
15
15
  * exactly the gap the CLI↔API parity contract exists to prevent.
16
16
  *
17
- * `retry_task` has no dedicated endpoint: it is a NAME for the documented
18
- * recovery, which is to return the task to a startable status and start it. So
19
- * this command composes the two existing endpoints rather than inventing a
20
- * third. The value it adds is that the advertised action is now reachable, and
21
- * that the status write is attached to the intent ("retry this") instead of
22
- * being an operator hand-editing a status field and hoping that was the right
23
- * one.
17
+ * The server owns the compound mutation. A status move and a Run admission are
18
+ * not independently replayable after a lost response, so the CLI sends one
19
+ * stable request id and offers an inspect-only receipt command for recovery.
24
20
  */
25
21
  export default class TasksRetry extends BaseCommand {
26
22
  static description: string;
@@ -31,8 +27,8 @@ export default class TasksRetry extends BaseCommand {
31
27
  static flags: {
32
28
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
33
29
  task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
34
- 'no-start': import("@oclif/core/interfaces").BooleanFlag<boolean>;
35
30
  skill: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
31
+ 'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
36
32
  };
37
33
  run(): Promise<void>;
38
34
  }
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const node_crypto_1 = require("node:crypto");
4
5
  const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
6
7
  const task_resolver_1 = require("../../lib/task-resolver");
7
- const start_1 = require("./start");
8
+ const TASK_RETRY_REQUEST_ID_PATTERN = /^[A-Za-z0-9._:/-]{1,200}$/;
8
9
  /**
9
10
  * OSK-3815 — the CLI verb for the `retry_task` action.
10
11
  *
@@ -20,19 +21,14 @@ const start_1 = require("./start");
20
21
  * locally-running coding agent) was told an action existed and given no verb —
21
22
  * exactly the gap the CLI↔API parity contract exists to prevent.
22
23
  *
23
- * `retry_task` has no dedicated endpoint: it is a NAME for the documented
24
- * recovery, which is to return the task to a startable status and start it. So
25
- * this command composes the two existing endpoints rather than inventing a
26
- * third. The value it adds is that the advertised action is now reachable, and
27
- * that the status write is attached to the intent ("retry this") instead of
28
- * being an operator hand-editing a status field and hoping that was the right
29
- * one.
24
+ * The server owns the compound mutation. A status move and a Run admission are
25
+ * not independently replayable after a lost response, so the CLI sends one
26
+ * stable request id and offers an inspect-only receipt command for recovery.
30
27
  */
31
28
  class TasksRetry extends base_command_1.BaseCommand {
32
29
  static description = 'Retry a failed task — returns it to a startable status and starts it again (the `retry_task` action from `tasks actionability`)';
33
30
  static examples = [
34
31
  '<%= config.bin %> tasks retry <task-id>',
35
- '<%= config.bin %> tasks retry <task-id> --no-start',
36
32
  '<%= config.bin %> tasks retry <task-id> --json',
37
33
  ];
38
34
  static args = {
@@ -45,12 +41,12 @@ class TasksRetry extends base_command_1.BaseCommand {
45
41
  static flags = {
46
42
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
47
43
  task: core_1.Flags.string({ description: 'Task ID; overrides daemon runtime context' }),
48
- 'no-start': core_1.Flags.boolean({
49
- description: 'Only clear the failed state, do not dispatch. Use when you want to edit the task before it runs again.',
50
- }),
51
44
  skill: core_1.Flags.string({
52
45
  description: "Skill ID to inject into the retried run. Must be pinned to the task's space.",
53
46
  }),
47
+ 'request-id': core_1.Flags.string({
48
+ description: 'Stable idempotency key for this logical retry. Reuse it only to inspect the retry receipt after a lost response.',
49
+ }),
54
50
  };
55
51
  async run() {
56
52
  this.requireAuth();
@@ -70,74 +66,44 @@ class TasksRetry extends base_command_1.BaseCommand {
70
66
  });
71
67
  }
72
68
  const taskRef = await this.resolveEntityRef('task', taskIdentity.id);
73
- // Step 1 — clear the terminal state. `todo` rather than `backlog`: the task
74
- // was already triaged into the working set once, and a retry is not a
75
- // decision to deprioritise it.
76
- let movedTask;
77
- try {
78
- movedTask = await data_provider_1.dataService.moveTask({
79
- taskId: taskRef,
80
- status: 'todo',
81
- });
82
- }
83
- catch (err) {
84
- this.handleApiError(err, { subject: `Task ${taskRef}` });
85
- }
86
- // This receipt describes the first committed transition. Dispatch may
87
- // change the Task again, so it is not an overall current-state snapshot.
88
- const statusTransition = { requestedStatus: 'todo', task: movedTask };
89
- if (flags['no-start']) {
90
- if (flags.json) {
91
- this.log(JSON.stringify({
92
- taskId: taskRef,
93
- status: movedTask?.status,
94
- started: false,
95
- statusTransition,
96
- }));
97
- return;
98
- }
99
- this.log(`Cleared failed state on ${taskRef}; execution was not requested.`);
100
- if (typeof movedTask?.status === 'string')
101
- this.log(`Status: ${movedTask.status}`);
102
- this.log(`Start it with: ${this.config.bin} tasks start ${taskRef}`);
103
- return;
69
+ if (flags['request-id'] !== undefined &&
70
+ !TASK_RETRY_REQUEST_ID_PATTERN.test(flags['request-id'])) {
71
+ this.error('--request-id must be 1-200 characters of letters, digits and . _ : / - (it is sent as an idempotency key).', { exit: 2 });
104
72
  }
73
+ const requestId = flags['request-id'] || `task-retry:${(0, node_crypto_1.randomUUID)()}`;
105
74
  let result;
106
75
  try {
107
- result = await data_provider_1.dataService.startTask(taskRef, flags.skill ? { skillId: flags.skill } : undefined);
76
+ result = await data_provider_1.dataService.retryTask(taskRef, { requestId, ...(flags.skill ? { skillId: flags.skill } : {}) });
108
77
  }
109
78
  catch (err) {
110
- const waiting = (0, start_1.waitingForMachine)(err);
111
- if (waiting) {
112
- if (flags.json) {
113
- this.log(JSON.stringify({
114
- waiting: true,
115
- code: 'TASK_WAITING_FOR_MACHINE',
116
- taskId: taskRef,
117
- started: false,
118
- statusTransition,
119
- ...waiting,
120
- }, null, 2));
121
- return;
122
- }
123
- this.log(`Task ${taskRef} is waiting for the machine to start; the task will run by itself once it is ready.`);
124
- if (waiting.message)
125
- this.log(waiting.message);
126
- return;
127
- }
128
- const observedStatus = typeof movedTask?.status === 'string' ? ` (returned status '${movedTask.status}')` : '';
129
79
  this.handleApiError(err, {
130
- subject: `Task ${taskRef} (status transition committed${observedStatus}; start was not confirmed. ` +
131
- `Check ${this.config.bin} tasks show ${taskRef}, then use ${this.config.bin} tasks start ${taskRef} if needed)`,
80
+ subject: `Task ${taskRef} retry was not confirmed. Inspect ${this.config.bin} tasks retry-receipt ` +
81
+ `${taskRef} --request-id ${requestId}; do not issue a new retry id by guesswork.`,
132
82
  });
133
83
  }
134
84
  if (flags.json) {
135
- this.log(JSON.stringify({ ...result, taskId: taskRef, started: true, statusTransition }, null, 2));
85
+ this.log(JSON.stringify({ ...result, taskId: taskRef, requestId }, null, 2));
86
+ return;
87
+ }
88
+ if (!result.started) {
89
+ this.log(`Retry request ${requestId} is ${result.state}; dispatch is not confirmed.`);
90
+ if (result.dispatch?.code)
91
+ this.log(`Dispatch code: ${result.dispatch.code}`);
92
+ this.log(`Inspect only: ${this.config.bin} tasks retry-receipt ${taskRef} --request-id ${requestId}`);
136
93
  return;
137
94
  }
138
95
  this.log(`Retried task ${taskRef}`);
139
- this.log(`Conversation: ${result.conversationId}`);
140
- this.log(`Session: ${result.sessionId}`);
96
+ this.log(`Retry receipt: ${requestId}`);
97
+ if (result.runId)
98
+ this.log(`Run: ${result.runId}`);
99
+ if (result.autonomousRunId)
100
+ this.log(`Autonomous Run: ${result.autonomousRunId}`);
101
+ if (result.conversationId)
102
+ this.log(`Conversation: ${result.conversationId}`);
103
+ if (result.sessionId)
104
+ this.log(`Session: ${result.sessionId}`);
105
+ if (result.responseMessageId)
106
+ this.log(`Response message: ${result.responseMessageId}`);
141
107
  }
142
108
  }
143
109
  exports.default = TasksRetry;
@@ -6,6 +6,27 @@ import { type RunFailure } from './activity';
6
6
  * daemon id was not recorded). `-` when the row predates executor stamping.
7
7
  */
8
8
  export declare function formatRunExecutor(run: Record<string, unknown>): string;
9
+ /**
10
+ * The executor attempt is the recovery fence, not a coordinator or terminal
11
+ * identity. Keep it in the Task run listing because it lets a person tell a
12
+ * current retry from an old report without requiring them to discover an
13
+ * executor-specific UI.
14
+ */
15
+ export declare function formatRunAttempt(ref: unknown): string | null;
16
+ /** The latest exact attempt is enough for a compact historical row. */
17
+ export declare function formatRunAttemptState(run: Record<string, unknown>): string | null;
18
+ /**
19
+ * A terminal report, Task finalization and resource cleanup are deliberately
20
+ * separate receipts. This compact text preserves that order instead of calling
21
+ * any one of them "done" for the whole Task.
22
+ */
23
+ export declare function formatRunSettlement(run: Record<string, unknown>): string | null;
24
+ /**
25
+ * The public cleanup projection intentionally excludes reservation/fence
26
+ * coordinates. It is diagnostic evidence only; it never grants a CLI caller a
27
+ * release operation.
28
+ */
29
+ export declare function formatRunCleanup(run: Record<string, unknown>): string | null;
9
30
  /**
10
31
  * Whether this run row is one whose reason the caller cannot see. (S3 dogfood finding)
11
32
  *