@skrr-ai/cli 0.1.208 → 0.1.210

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 (105) hide show
  1. package/dist/base-command.js +2 -1
  2. package/dist/commands/agent/message/no-reply.js +1 -1
  3. package/dist/commands/agent/message/react.d.ts +23 -0
  4. package/dist/commands/agent/message/react.js +128 -0
  5. package/dist/commands/agent/message/resolve.js +1 -1
  6. package/dist/commands/agent/message/retract.js +1 -1
  7. package/dist/commands/agent/message/send.d.ts +8 -13
  8. package/dist/commands/agent/message/send.js +60 -28
  9. package/dist/commands/agents/access/approve.js +1 -1
  10. package/dist/commands/agents/access/deny.js +1 -1
  11. package/dist/commands/agents/access/list.js +3 -1
  12. package/dist/commands/agents/access/reach.js +1 -1
  13. package/dist/commands/agents/access/revoke.js +1 -1
  14. package/dist/commands/agents/always-on/recovery-review.d.ts +10 -0
  15. package/dist/commands/agents/always-on/recovery-review.js +45 -0
  16. package/dist/commands/agents/chat.d.ts +22 -0
  17. package/dist/commands/agents/chat.js +400 -90
  18. package/dist/commands/agents/import.js +3 -3
  19. package/dist/commands/agents/manager/status.js +7 -6
  20. package/dist/commands/agents/not-for-task.d.ts +24 -0
  21. package/dist/commands/agents/not-for-task.js +64 -0
  22. package/dist/commands/agents/schedule-overview.d.ts +20 -0
  23. package/dist/commands/agents/schedule-overview.js +35 -2
  24. package/dist/commands/agents/shared-memory.js +1 -1
  25. package/dist/commands/agents/stop.d.ts +23 -0
  26. package/dist/commands/agents/stop.js +61 -0
  27. package/dist/commands/agents/update.d.ts +7 -0
  28. package/dist/commands/agents/update.js +45 -2
  29. package/dist/commands/convos/messages.js +5 -0
  30. package/dist/commands/convos/transcript.js +2 -2
  31. package/dist/commands/daemon/logs.d.ts +3 -1
  32. package/dist/commands/daemon/logs.js +6 -2
  33. package/dist/commands/dm/work.js +38 -9
  34. package/dist/commands/duties/advance-next.js +1 -1
  35. package/dist/commands/duties/preflight.js +17 -13
  36. package/dist/commands/duties/show.js +5 -0
  37. package/dist/commands/followups/watch-pr.js +2 -1
  38. package/dist/commands/harnesses/evaluations/evidence.js +2 -2
  39. package/dist/commands/harnesses/evaluations/grant.js +1 -1
  40. package/dist/commands/harnesses/evaluations/revoke.js +1 -1
  41. package/dist/commands/harnesses/evaluations/show.js +1 -1
  42. package/dist/commands/harnesses/rollouts/grant.js +1 -1
  43. package/dist/commands/harnesses/rollouts/revoke.js +1 -1
  44. package/dist/commands/machines/hosted/identity-evaluations/revoke.js +1 -1
  45. package/dist/commands/machines/hosted/identity-evaluations/show.js +1 -1
  46. package/dist/commands/memory/consolidation/undo.js +1 -0
  47. package/dist/commands/messages/list.js +9 -1
  48. package/dist/commands/slack/mutes.js +1 -1
  49. package/dist/commands/slack/unmute.js +1 -1
  50. package/dist/commands/tasks/actionability.js +1 -0
  51. package/dist/commands/tasks/ask.d.ts +2 -0
  52. package/dist/commands/tasks/ask.js +7 -1
  53. package/dist/commands/tasks/bulk-update.js +12 -0
  54. package/dist/commands/tasks/deliverable/add.d.ts +2 -0
  55. package/dist/commands/tasks/deliverable/add.js +25 -6
  56. package/dist/commands/tasks/input/show.d.ts +2 -0
  57. package/dist/commands/tasks/input/show.js +18 -3
  58. package/dist/commands/tasks/list.d.ts +8 -0
  59. package/dist/commands/tasks/list.js +50 -9
  60. package/dist/commands/tasks/move.d.ts +2 -10
  61. package/dist/commands/tasks/move.js +7 -18
  62. package/dist/commands/tasks/resource/add.d.ts +2 -0
  63. package/dist/commands/tasks/resource/add.js +11 -1
  64. package/dist/commands/tasks/result/show.js +19 -7
  65. package/dist/commands/tasks/show.d.ts +4 -3
  66. package/dist/commands/tasks/show.js +20 -8
  67. package/dist/commands/tasks/start.js +35 -16
  68. package/dist/commands/tasks/update.js +3 -0
  69. package/dist/commands/tasks/wait.js +2 -2
  70. package/dist/generated/agent-guides.json +483 -183
  71. package/dist/lib/agent-proactive-baseline.js +4 -1
  72. package/dist/lib/chat-stop.d.ts +17 -0
  73. package/dist/lib/chat-stop.js +70 -0
  74. package/dist/lib/cloud-reply.d.ts +21 -0
  75. package/dist/lib/cloud-reply.js +52 -0
  76. package/dist/lib/duties.d.ts +10 -0
  77. package/dist/lib/duties.js +111 -7
  78. package/dist/lib/duty-ledgers.js +19 -2
  79. package/dist/lib/file-mime.js +8 -0
  80. package/dist/lib/inbound-messages.d.ts +156 -0
  81. package/dist/lib/inbound-messages.js +375 -0
  82. package/dist/lib/message-intent.d.ts +18 -2
  83. package/dist/lib/message-intent.js +23 -1
  84. package/dist/lib/preflight-copy.d.ts +16 -1
  85. package/dist/lib/preflight-copy.js +33 -1
  86. package/dist/lib/space-resolver.d.ts +9 -0
  87. package/dist/lib/space-resolver.js +13 -0
  88. package/dist/lib/task-operations.d.ts +2 -0
  89. package/dist/lib/task-operations.js +28 -4
  90. package/dist/lib/task-preflight.js +1 -0
  91. package/dist/lib/task-review-notice.d.ts +21 -0
  92. package/dist/lib/task-review-notice.js +46 -0
  93. package/dist/lib/task-version.d.ts +9 -0
  94. package/dist/lib/task-version.js +16 -0
  95. package/dist/lib/task-work.js +5 -0
  96. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -1
  97. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.d.ts +5 -0
  98. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/managedWorkRuntime.js +21 -4
  99. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +45 -15
  100. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.d.ts +5 -0
  101. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/managedWorkRuntime.js +31 -5
  102. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  103. package/dist/node_modules/@skrr-ai/data-provider/index.js +12307 -11838
  104. package/oclif.manifest.json +307 -23
  105. package/package.json +6 -2
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RESOURCE_ADD_FIELD_FLAGS = void 0;
3
4
  const node_crypto_1 = require("node:crypto");
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../../base-command");
7
8
  const tasks_1 = require("../../../lib/tasks");
8
9
  const RESOURCE_ROLES = ['input', 'reference', 'evidence', 'attachment', 'deliverable'];
10
+ /** The body paths `resource add` writes from a flag, as `handleApiError` reads them back. */
11
+ exports.RESOURCE_ADD_FIELD_FLAGS = Object.freeze({
12
+ runId: '--run-id',
13
+ });
9
14
  class TasksResourceAdd extends base_command_1.BaseCommand {
10
15
  static description = 'Link an exact input, reference, evidence item, attachment, or deliverable to a task';
11
16
  static examples = [
@@ -37,7 +42,9 @@ class TasksResourceAdd extends base_command_1.BaseCommand {
37
42
  'content-digest': core_1.Flags.string({ description: 'Integrity digest for this exact version' }),
38
43
  expectation: core_1.Flags.string({ multiple: true, description: 'Expectation id this supports' }),
39
44
  'result-id': core_1.Flags.string({ description: 'Result version this Resource supports' }),
40
- 'run-id': core_1.Flags.string({ description: 'Run that produced or observed it' }),
45
+ 'run-id': core_1.Flags.string({
46
+ description: 'Task Run that produced or observed it. Not the id `tasks checkout` prints: a checkout is not a Task Run',
47
+ }),
41
48
  'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
42
49
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
43
50
  };
@@ -60,6 +67,9 @@ class TasksResourceAdd extends base_command_1.BaseCommand {
60
67
  runId: flags['run-id'],
61
68
  idempotencyKey: flags['idempotency-key'] || `task-resource_${(0, node_crypto_1.randomUUID)()}`,
62
69
  };
70
+ // A refusal about the cited Run names `runId`; the person typed --run-id (OSK-33349).
71
+ if (flags['run-id'])
72
+ this.requestFieldFlags = exports.RESOURCE_ADD_FIELD_FLAGS;
63
73
  let result;
64
74
  try {
65
75
  result = await data_provider_1.dataService.recordTaskResource(args.task, payload);
@@ -65,7 +65,10 @@ class TasksResultShow extends base_command_1.BaseCommand {
65
65
  static flags = {
66
66
  task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
67
67
  history: core_1.Flags.boolean({ description: 'Include superseded Result versions' }),
68
- result: core_1.Flags.string({ description: 'Read one immutable Result by id', exclusive: ['history'] }),
68
+ result: core_1.Flags.string({
69
+ description: 'Read one immutable Result by id',
70
+ exclusive: ['history'],
71
+ }),
69
72
  json: core_1.Flags.boolean({ description: 'Output JSON' }),
70
73
  };
71
74
  async run() {
@@ -73,8 +76,11 @@ class TasksResultShow extends base_command_1.BaseCommand {
73
76
  const { args, flags } = await this.parse(TasksResultShow);
74
77
  const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
75
78
  if (flags.result) {
76
- const scopeKey = process.env.OVERSKY_SPACE_REVIEW_WORK === '1' || process.env.OVERSKY_SPACE_GOAL_WORK === '1' ? 'reviewSpaceId'
77
- : process.env.OVERSKY_SPACE_NOTEBOOK_RESULT === '1' ? 'notebookSpaceId' : undefined;
79
+ const scopeKey = process.env.OVERSKY_SPACE_REVIEW_WORK === '1' || process.env.OVERSKY_SPACE_GOAL_WORK === '1'
80
+ ? 'reviewSpaceId'
81
+ : process.env.OVERSKY_SPACE_NOTEBOOK_RESULT === '1'
82
+ ? 'notebookSpaceId'
83
+ : undefined;
78
84
  const spaceId = process.env.OVERSKY_SESSION_SPACE_ID;
79
85
  if (scopeKey && !spaceId)
80
86
  this.error('This evidence read requires a bound Space.', { exit: 2 });
@@ -83,9 +89,15 @@ class TasksResultShow extends base_command_1.BaseCommand {
83
89
  try {
84
90
  const exact = await (0, api_fetch_1.apiFetch)(`${path}${query}`);
85
91
  if (flags.json)
86
- return this.log(JSON.stringify(exact));
87
- return this.log([`Result v${exact.version} ${exact.id}`, exact.summary, exact.body,
88
- ...describeResultDetail(exact)].filter(Boolean).join('\n'));
92
+ return this.printJsonResult(exact);
93
+ return this.log([
94
+ `Result v${exact.version} ${exact.id}`,
95
+ exact.summary,
96
+ exact.body,
97
+ ...describeResultDetail(exact),
98
+ ]
99
+ .filter(Boolean)
100
+ .join('\n'));
89
101
  }
90
102
  catch (error) {
91
103
  return this.handleApiError(error);
@@ -99,7 +111,7 @@ class TasksResultShow extends base_command_1.BaseCommand {
99
111
  this.handleApiError(error);
100
112
  }
101
113
  if (flags.json)
102
- return this.log(JSON.stringify(result, null, 2));
114
+ return this.printJsonResult(result);
103
115
  const current = result.results.find((row) => row.id === result.currentResultId);
104
116
  if (!current)
105
117
  return this.log(await (0, task_legacy_1.emptyCanonicalView)(task.id, 'Result'));
@@ -73,11 +73,12 @@ export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: stri
73
73
  * The `Next step:` lines for a Task that nobody has been chosen to do.
74
74
  *
75
75
  * `Why:` said "Choose an executor and assignee before this Task can start" (or,
76
- * for a started Task, that it "has no assigned executor") and nothing said how
76
+ * for a started Task, that nobody is assigned) and nothing said how
77
77
  * to do that (OSK-24355). The commands come from the one action→command map
78
78
  * (`taskActionRemedies`), keyed by the actions the server declared, with the
79
- * Task's ref filled in. Only the assignment actions print here; the rest are
80
- * listed by `tasks actionability`.
79
+ * Task's ref filled in. Only the assignment actions print here (and closing, for a
80
+ * started Task nobody is assigned to that carries a Result); the rest are listed by
81
+ * `tasks actionability`.
81
82
  *
82
83
  * Pure and exported so the wording is testable without an oclif runtime.
83
84
  */
@@ -160,15 +160,21 @@ function taskExecutorLabel(t, bin = 'skrr') {
160
160
  }
161
161
  /** The server actions whose commands `tasks show` prints under `Why:`: who does the Task. */
162
162
  const ASSIGNMENT_ACTIONS = new Set(['assign_task', 'set_execution_mode']);
163
+ /**
164
+ * Reasons whose next step is an assignment: nobody has been chosen to do the Task, or it was
165
+ * started with nobody assigned (OSK-20258), where the assignment says who is doing it.
166
+ */
167
+ const ASSIGNMENT_REASONS = new Set(['assignment_required', 'started_without_assignee']);
163
168
  /**
164
169
  * The `Next step:` lines for a Task that nobody has been chosen to do.
165
170
  *
166
171
  * `Why:` said "Choose an executor and assignee before this Task can start" (or,
167
- * for a started Task, that it "has no assigned executor") and nothing said how
172
+ * for a started Task, that nobody is assigned) and nothing said how
168
173
  * to do that (OSK-24355). The commands come from the one action→command map
169
174
  * (`taskActionRemedies`), keyed by the actions the server declared, with the
170
- * Task's ref filled in. Only the assignment actions print here; the rest are
171
- * listed by `tasks actionability`.
175
+ * Task's ref filled in. Only the assignment actions print here (and closing, for a
176
+ * started Task nobody is assigned to that carries a Result); the rest are listed by
177
+ * `tasks actionability`.
172
178
  *
173
179
  * Pure and exported so the wording is testable without an oclif runtime.
174
180
  */
@@ -177,15 +183,22 @@ function nextStepLines(t, bin = 'skrr') {
177
183
  if (!actionability || actionability.state === 'terminal')
178
184
  return [];
179
185
  const allowed = (Array.isArray(actionability.allowedActions) ? actionability.allowedActions : []).filter((row) => Boolean(row) && typeof row.action === 'string');
180
- const actions = allowed.filter((row) => ASSIGNMENT_ACTIONS.has(row.action));
181
- if (actionability.reasonCode === 'assignment_required' &&
186
+ // A started Task nobody is assigned to that carries a Result may simply be done: the server
187
+ // offers closing it beside the assignment, and its reason names closing first (OSK-20258).
188
+ const closable = actionability.reasonCode === 'started_without_assignee';
189
+ const actions = allowed.filter((row) => ASSIGNMENT_ACTIONS.has(row.action) || (closable && row.action === 'complete_task'));
190
+ if (ASSIGNMENT_REASONS.has(String(actionability.reasonCode)) &&
182
191
  !actions.some((row) => row.action === 'assign_task')) {
183
192
  actions.unshift({ action: 'assign_task' });
184
193
  }
185
194
  const ref = (typeof t.identifier === 'string' && t.identifier) ||
186
195
  (typeof t.id === 'string' && t.id) ||
187
196
  '<task-id>';
188
- const rows = (0, task_operations_1.taskActionRemedyRows)(actions.flatMap((row) => (0, task_operations_1.taskActionRemedies)(row.action, ref, row.targetId, bin, { allowedActions: allowed, task: t })));
197
+ const rows = (0, task_operations_1.taskActionRemedyRows)(actions.flatMap((row) => (0, task_operations_1.taskActionRemedies)(row.action, ref, row.targetId, bin, {
198
+ allowedActions: allowed,
199
+ task: t,
200
+ reasonCode: actionability.reasonCode,
201
+ })));
189
202
  return rows.map((row, index) => `${index === 0 ? 'Next step:' : ''}`.padEnd(13) + row);
190
203
  }
191
204
  function resolverLabel(by, names) {
@@ -487,8 +500,7 @@ class TasksShow extends base_command_1.BaseCommand {
487
500
  this.log(`Status: ${t.status ?? '-'}`);
488
501
  // The read a version-checked write is fenced on. Printed with the flag that
489
502
  // uses it, because a number on its own does not say what it is for.
490
- const version = (0, task_version_1.taskVersionOf)(t);
491
- this.log(`Version: ${version} (update only from this read: --expected-version ${version})`);
503
+ this.log((0, task_version_1.taskVersionLine)((0, task_version_1.taskVersionOf)(t)));
492
504
  // Immediately under Status, because "failed" is the row that raises the
493
505
  // question and this is the answer to it.
494
506
  for (const line of taskFailureLines(t, this.config.bin))
@@ -13,8 +13,7 @@ const task_admission_1 = require("../../lib/task-admission");
13
13
  const http_error_1 = require("../../lib/http-error");
14
14
  const TASK_START_REQUEST_ID_PATTERN = /^[A-Za-z0-9._:/-]{1,200}$/;
15
15
  class TasksStart extends base_command_1.BaseCommand {
16
- static description = 'Request execution of a Task by its assigned Agent. ' +
17
- 'Alias: tasks execute';
16
+ static description = 'Request execution of a Task by its assigned Agent. ' + 'Alias: tasks execute';
18
17
  // `tasks execute` is the verb a first-time user reaches for, and it was
19
18
  // "not a command" (OSK-12128). One command, two names.
20
19
  static aliases = ['tasks:execute'];
@@ -38,7 +37,10 @@ class TasksStart extends base_command_1.BaseCommand {
38
37
  };
39
38
  static flags = {
40
39
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
41
- 'dry-run': core_1.Flags.boolean({ description: 'Preview effective unattended execution prerequisites without creating a Run or checking out a branch', exclusive: ['branch'] }),
40
+ 'dry-run': core_1.Flags.boolean({
41
+ description: 'Preview effective unattended execution prerequisites without creating a Run or checking out a branch',
42
+ exclusive: ['branch'],
43
+ }),
42
44
  task: core_1.Flags.string({
43
45
  description: 'Task ID; overrides daemon runtime context',
44
46
  }),
@@ -56,8 +58,15 @@ class TasksStart extends base_command_1.BaseCommand {
56
58
  description: 'Stable idempotency key for this logical start. Reuse it after a lost response; inspect it with tasks start-receipt.',
57
59
  }),
58
60
  'orchestration-version': core_1.Flags.integer({ hidden: true, min: 0 }),
59
- 'orchestration-assign-agent': core_1.Flags.string({ hidden: true, dependsOn: ['orchestration-version'] }),
60
- 'orchestration-failed-run': core_1.Flags.string({ hidden: true, dependsOn: ['orchestration-version'], exclusive: ['orchestration-assign-agent'] }),
61
+ 'orchestration-assign-agent': core_1.Flags.string({
62
+ hidden: true,
63
+ dependsOn: ['orchestration-version'],
64
+ }),
65
+ 'orchestration-failed-run': core_1.Flags.string({
66
+ hidden: true,
67
+ dependsOn: ['orchestration-version'],
68
+ exclusive: ['orchestration-assign-agent'],
69
+ }),
61
70
  };
62
71
  async run() {
63
72
  this.requireAuth();
@@ -65,8 +74,13 @@ class TasksStart extends base_command_1.BaseCommand {
65
74
  const orchestrationVersion = flags['orchestration-version'];
66
75
  const assignAgentId = flags['orchestration-assign-agent'];
67
76
  const failedRunId = flags['orchestration-failed-run'];
68
- if (orchestrationVersion !== undefined && (process.env.OVERSKY_SPACE_ORCHESTRATION_WORK !== '1' ||
69
- !flags['request-id'] || flags.branch || flags['dry-run'] || flags.skill || flags.capability?.length)) {
77
+ if (orchestrationVersion !== undefined &&
78
+ (process.env.OVERSKY_SPACE_ORCHESTRATION_WORK !== '1' ||
79
+ !flags['request-id'] ||
80
+ flags.branch ||
81
+ flags['dry-run'] ||
82
+ flags.skill ||
83
+ flags.capability?.length)) {
70
84
  this.error('A scoped orchestration start requires the Duty runtime, a Task version and a request id.', { exit: 2 });
71
85
  }
72
86
  let taskIdentity;
@@ -106,7 +120,9 @@ class TasksStart extends base_command_1.BaseCommand {
106
120
  if (!(0, task_admission_1.isAdmissionPreview)(preview)) {
107
121
  this.failWithCliError({
108
122
  message: 'The server did not return a confirmed execution preview. Update the server before using --dry-run.',
109
- code: 'TASK_START_PREVIEW_UNSUPPORTED', exit: 2, retryable: false,
123
+ code: 'TASK_START_PREVIEW_UNSUPPORTED',
124
+ exit: 2,
125
+ retryable: false,
110
126
  });
111
127
  }
112
128
  const blocked = (0, task_admission_1.isAdmissionBlocked)(preview.executionAdmission);
@@ -175,19 +191,20 @@ class TasksStart extends base_command_1.BaseCommand {
175
191
  : null;
176
192
  if (prior && prior.state !== 'unknown') {
177
193
  if (flags.json)
178
- this.log(JSON.stringify(prior, null, 2));
194
+ this.printJsonResult(prior);
179
195
  else
180
196
  this.log(`Start request ${requestId} is ${prior.state}. Inspect it with ${this.config.bin} tasks start-receipt ${taskId} --request-id ${requestId}.`);
181
197
  return;
182
198
  }
183
199
  const input = await data_provider_1.dataService.submitTaskConversationInput(taskId, {
184
- action: 'start', commandKey: requestId,
200
+ action: 'start',
201
+ commandKey: requestId,
185
202
  expectedWorkflowGeneration: chat.workflowGeneration,
186
203
  expectedAuthorizationGeneration: chat.authorizationGeneration,
187
204
  expectedSpecVersion: chat.startInput.specVersion,
188
205
  });
189
206
  if (flags.json) {
190
- this.log(JSON.stringify({ taskId, requestId, input, ...(branch ? { branch } : {}) }, null, 2));
207
+ this.printJsonResult({ taskId, requestId, input, ...(branch ? { branch } : {}) });
191
208
  }
192
209
  else {
193
210
  if (branch)
@@ -202,7 +219,9 @@ class TasksStart extends base_command_1.BaseCommand {
202
219
  result = await data_provider_1.dataService.startTask(taskId, {
203
220
  ...(flags.skill ? { skillId: flags.skill } : {}),
204
221
  ...(flags.capability?.length ? { requestedCapabilities: flags.capability } : {}),
205
- ...(orchestrationVersion !== undefined ? { orchestration: { expectedVersion: orchestrationVersion, assignAgentId, failedRunId } } : {}),
222
+ ...(orchestrationVersion !== undefined
223
+ ? { orchestration: { expectedVersion: orchestrationVersion, assignAgentId, failedRunId } }
224
+ : {}),
206
225
  requestId,
207
226
  });
208
227
  }
@@ -213,7 +232,7 @@ class TasksStart extends base_command_1.BaseCommand {
213
232
  const waiting = waitingForMachine(err);
214
233
  if (waiting) {
215
234
  if (flags.json) {
216
- this.log(JSON.stringify({
235
+ this.printJsonResult({
217
236
  waiting: true,
218
237
  code: 'TASK_WAITING_FOR_MACHINE',
219
238
  taskId,
@@ -221,7 +240,7 @@ class TasksStart extends base_command_1.BaseCommand {
221
240
  requestId,
222
241
  ...(branch ? { branch } : {}),
223
242
  ...waiting,
224
- }, null, 2));
243
+ });
225
244
  return;
226
245
  }
227
246
  if (branch) {
@@ -243,13 +262,13 @@ class TasksStart extends base_command_1.BaseCommand {
243
262
  }
244
263
  if (flags.json) {
245
264
  const receipt = result.receipt || { requestId, state: 'accepted' };
246
- this.log(JSON.stringify({
265
+ this.printJsonResult({
247
266
  ...result,
248
267
  receipt,
249
268
  taskId,
250
269
  task: { ...taskIdentity, id: taskId },
251
270
  ...(branch ? { branch } : {}),
252
- }, null, 2));
271
+ });
253
272
  return;
254
273
  }
255
274
  this.log(`Accepted start request for task ${taskId}${flags.skill ? ` with skill ${flags.skill}` : ''}`);
@@ -627,6 +627,9 @@ class TasksUpdate extends base_command_1.BaseCommand {
627
627
  return;
628
628
  }
629
629
  this.log(`Updated task ${label} — ${t.title ?? '(no title)'}`);
630
+ const versionLine = (0, task_version_1.writtenTaskVersionLine)(t);
631
+ if (versionLine)
632
+ this.log(versionLine);
630
633
  if (flags.unassigned)
631
634
  this.log(`Executor intent: ${(0, tasks_2.taskAssignmentPreview)(t).executor.mode || 'unspecified'}; assignment: unassigned. No Run requested.`);
632
635
  if (unchanged)
@@ -137,7 +137,7 @@ class TasksWait extends base_command_1.BaseCommand {
137
137
  snapshot.tasks.every((task) => (0, task_execution_1.satisfiesWaitTarget)(task, flags.until));
138
138
  if (failed || satisfied) {
139
139
  if (flags.json) {
140
- this.log(JSON.stringify(snapshot, null, 2));
140
+ this.printJsonResult(snapshot, { ok: !failed });
141
141
  }
142
142
  else {
143
143
  this.log(formatProgress(snapshot));
@@ -194,7 +194,7 @@ class TasksWait extends base_command_1.BaseCommand {
194
194
  return;
195
195
  }
196
196
  if (flags.json) {
197
- this.log(JSON.stringify(response, null, 2));
197
+ this.printJsonResult(response);
198
198
  return;
199
199
  }
200
200
  for (const line of armedWaitLines(shownRef, response))