@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
@@ -78,6 +78,11 @@ class DutiesShow extends base_command_1.BaseCommand {
78
78
  // A latest Run the claim admitted without a Check dispatch proof, through an allowance the owner
79
79
  // accepted (2026-11-12), is held at its claim, or was ended by it before it started (OSK-24383).
80
80
  // The server records each on the Run; this is where a person reads it.
81
+ // Why the latest Run was started (OSK-20265): fixed at reservation, unlike its `reason`, which is
82
+ // its latest transition. An older server sends none, and then nothing is printed.
83
+ const latestRunStart = (0, duties_1.describeRunStart)(response.operatingState?.latestRun?.startedBecause);
84
+ if (latestRunStart)
85
+ this.log(`Latest run: Started because: ${latestRunStart}`);
81
86
  for (const line of (0, data_provider_1.describeLatestRunClaim)(response.operatingState?.latestRun))
82
87
  this.log(`Latest run: ${line}`);
83
88
  // A Run queued under an earlier contract version that is still held (OSK-24386); `Latest run`
@@ -30,6 +30,7 @@ class FollowupsWatchPr extends base_command_1.BaseCommand {
30
30
  ref: core_1.Args.string({
31
31
  description: 'The pull request: owner/repo#number or its github.com URL',
32
32
  required: true,
33
+ ignoreStdin: true,
33
34
  }),
34
35
  };
35
36
  static flags = {
@@ -108,7 +109,7 @@ class FollowupsWatchPr extends base_command_1.BaseCommand {
108
109
  return;
109
110
  }
110
111
  if (flags.json) {
111
- this.log(JSON.stringify(response, null, 2));
112
+ this.printJsonResult(response);
112
113
  return;
113
114
  }
114
115
  const notice = (0, followups_1.producerDowngradeNotice)(response);
@@ -40,7 +40,7 @@ class HarnessesEvaluationsEvidence extends base_command_1.BaseCommand {
40
40
  this.error('--financial requires --json and a standalone read', { exit: 2 });
41
41
  try {
42
42
  const result = await (0, harness_evaluations_1.harnessEvaluationFinancialEvidence)(args.grantId, flags['financial-workspace']);
43
- this.log(JSON.stringify(result, null, 2));
43
+ this.printJsonResult(result);
44
44
  }
45
45
  catch (err) {
46
46
  this.handleApiError(err);
@@ -59,7 +59,7 @@ class HarnessesEvaluationsEvidence extends base_command_1.BaseCommand {
59
59
  return;
60
60
  }
61
61
  if (flags.json) {
62
- this.log(JSON.stringify(result, null, 2));
62
+ this.printJsonResult(result);
63
63
  return;
64
64
  }
65
65
  this.log(`${result.grant.grantId}: ${result.turns.length} turns`);
@@ -91,7 +91,7 @@ class HarnessesEvaluationsGrant extends base_command_1.BaseCommand {
91
91
  }
92
92
  }
93
93
  if (flags.json) {
94
- this.log(JSON.stringify({ ...result, rescan }, null, 2));
94
+ this.printJsonResult({ ...result, rescan });
95
95
  return;
96
96
  }
97
97
  const { grant } = result;
@@ -36,7 +36,7 @@ class HarnessesEvaluationsRevoke extends base_command_1.BaseCommand {
36
36
  return;
37
37
  }
38
38
  if (flags.json) {
39
- this.log(JSON.stringify(result, null, 2));
39
+ this.printJsonResult(result);
40
40
  return;
41
41
  }
42
42
  this.log(`Withdrew ${result.grant.grantId} (${result.grant.harness} on daemon ${result.grant.daemonId}) after ${result.grant.admissions.length} turns.`);
@@ -26,7 +26,7 @@ class HarnessesEvaluationsShow extends base_command_1.BaseCommand {
26
26
  return;
27
27
  }
28
28
  if (flags.json) {
29
- this.log(JSON.stringify(result, null, 2));
29
+ this.printJsonResult(result);
30
30
  return;
31
31
  }
32
32
  const { grant } = result;
@@ -59,7 +59,7 @@ class HarnessesRolloutsGrant extends base_command_1.BaseCommand {
59
59
  return;
60
60
  }
61
61
  if (flags.json) {
62
- this.log(JSON.stringify(result, null, 2));
62
+ this.printJsonResult(result);
63
63
  return;
64
64
  }
65
65
  const { grant } = result;
@@ -60,7 +60,7 @@ class HarnessesRolloutsRevoke extends base_command_1.BaseCommand {
60
60
  return;
61
61
  }
62
62
  if (flags.json) {
63
- this.log(JSON.stringify(result, null, 2));
63
+ this.printJsonResult(result);
64
64
  return;
65
65
  }
66
66
  for (const grant of result.revoked) {
@@ -11,7 +11,7 @@ class Revoke extends base_command_1.BaseCommand {
11
11
  this.requireAuth();
12
12
  const { args, flags } = await this.parse(Revoke);
13
13
  try {
14
- this.log(JSON.stringify(await (0, hosted_identity_evaluations_1.revokeHostedIdentityEvaluation)(args.id, flags.reason), null, 2));
14
+ this.printJsonResult(await (0, hosted_identity_evaluations_1.revokeHostedIdentityEvaluation)(args.id, flags.reason));
15
15
  }
16
16
  catch (error) {
17
17
  this.handleApiError(error);
@@ -10,7 +10,7 @@ class Show extends base_command_1.BaseCommand {
10
10
  this.requireAuth();
11
11
  const { args } = await this.parse(Show);
12
12
  try {
13
- this.log(JSON.stringify(await (0, hosted_identity_evaluations_1.readHostedIdentityEvaluation)(args.id), null, 2));
13
+ this.printJsonResult(await (0, hosted_identity_evaluations_1.readHostedIdentityEvaluation)(args.id));
14
14
  }
15
15
  catch (error) {
16
16
  this.handleApiError(error);
@@ -18,6 +18,7 @@ class MemoryConsolidationUndo extends base_command_1.BaseCommand {
18
18
  cycleId: core_1.Args.string({
19
19
  description: 'Tidy-up id, from `skrr memory consolidation`',
20
20
  required: true,
21
+ ignoreStdin: true,
21
22
  }),
22
23
  };
23
24
  static flags = {
@@ -9,6 +9,14 @@ const format_1 = require("../../lib/format");
9
9
  const task_transcript_1 = require("../../lib/task-transcript");
10
10
  const message_provenance_1 = require("../../lib/message-provenance");
11
11
  const RUN_RE = /\s+/g;
12
+ /** What caused the row: an unattended run, an answer from the cloud while the machine could not. */
13
+ function viaLabel(m, provenance) {
14
+ if (provenance)
15
+ return (0, message_provenance_1.provenanceLabel)(provenance);
16
+ if (!m.isCreatedByUser && (0, data_provider_1.messageCloudReply)(m.metadata))
17
+ return 'cloud';
18
+ return '-';
19
+ }
12
20
  /**
13
21
  * OSK-2058 — resolve the conversation id from either calling convention.
14
22
  *
@@ -128,7 +136,7 @@ class MessagesList extends base_command_1.BaseCommand {
128
136
  return {
129
137
  when: m.createdAt ? new Date(String(m.createdAt)).toISOString().slice(11, 19) : '-',
130
138
  role: String(m.sender ?? m.role ?? (m.isCreatedByUser ? 'user' : 'assistant')),
131
- via: provenance ? (0, message_provenance_1.provenanceLabel)(provenance) : '-',
139
+ via: viaLabel(m, provenance),
132
140
  text: String(m.text ?? m.content ?? '')
133
141
  .replace(RUN_RE, ' ')
134
142
  .trim(),
@@ -35,7 +35,7 @@ class SlackMutes extends base_command_1.BaseCommand {
35
35
  this.handleApiError(err);
36
36
  }
37
37
  if (flags.json) {
38
- this.log(JSON.stringify({ mutes: mutes }, null, 2));
38
+ this.printJsonResult({ mutes: mutes });
39
39
  return;
40
40
  }
41
41
  if (mutes.length === 0) {
@@ -35,7 +35,7 @@ class SlackUnmute extends base_command_1.BaseCommand {
35
35
  this.handleApiError(err);
36
36
  }
37
37
  if (flags.json) {
38
- this.log(JSON.stringify(result, null, 2));
38
+ this.printJsonResult(result);
39
39
  return;
40
40
  }
41
41
  this.log(`The agent follows thread ${flags['thread-ts']} in ${flags.channel} again. Nothing was posted.`);
@@ -81,6 +81,7 @@ class TasksActionability extends base_command_1.BaseCommand {
81
81
  for (const { action, targetId } of a.allowedActions) {
82
82
  const rows = (0, task_operations_1.taskActionRemedyRows)((0, task_operations_1.taskActionRemedies)(action, task, targetId, this.config.bin, {
83
83
  allowedActions: a.allowedActions,
84
+ reasonCode: a.reasonCode,
84
85
  }));
85
86
  if (rows.length === 0)
86
87
  this.log(` ${action.padEnd(width)}`);
@@ -26,6 +26,7 @@ export declare function buildAskBody(flags: {
26
26
  'no-free-text'?: boolean;
27
27
  expires?: string;
28
28
  key?: string;
29
+ 'owner-only'?: boolean;
29
30
  }): AskTaskHumanInputBody;
30
31
  export default class TasksAsk extends BaseCommand {
31
32
  static description: string;
@@ -44,6 +45,7 @@ export default class TasksAsk extends BaseCommand {
44
45
  'no-free-text': import("@oclif/core/interfaces").BooleanFlag<boolean>;
45
46
  expires: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
46
47
  key: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
48
+ 'owner-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
47
49
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
48
50
  };
49
51
  run(): Promise<void>;
@@ -100,6 +100,7 @@ function buildAskBody(flags) {
100
100
  ],
101
101
  ...(expiresAt ? { expiresAt } : {}),
102
102
  ...(flags.key ? { askKey: flags.key } : {}),
103
+ ...(flags['owner-only'] ? { ownerOnly: true } : {}),
103
104
  };
104
105
  }
105
106
  class TasksAsk extends base_command_1.BaseCommand {
@@ -137,6 +138,9 @@ class TasksAsk extends base_command_1.BaseCommand {
137
138
  key: core_1.Flags.string({
138
139
  description: 'Your key for this question: the same key returns the same question, and names only one',
139
140
  }),
141
+ 'owner-only': core_1.Flags.boolean({
142
+ description: data_provider_1.TASK_HUMAN_INPUT_OWNER_ONLY_RULE.replace('ownerOnly to true', '--owner-only'),
143
+ }),
140
144
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
141
145
  };
142
146
  async run() {
@@ -163,7 +167,7 @@ class TasksAsk extends base_command_1.BaseCommand {
163
167
  this.handleApiError(err);
164
168
  }
165
169
  if (flags.json) {
166
- this.log(JSON.stringify(response, null, 2));
170
+ this.printJsonResult(response);
167
171
  return;
168
172
  }
169
173
  const request = response.data;
@@ -181,6 +185,8 @@ class TasksAsk extends base_command_1.BaseCommand {
181
185
  }
182
186
  if (request.expiresAt)
183
187
  this.log(` Expires: ${new Date(request.expiresAt).toISOString()}`);
188
+ for (const line of (0, show_1.humanInputAuthorshipLines)(request))
189
+ this.log(` ${line}`);
184
190
  this.log(data_provider_1.TASK_HUMAN_INPUT_REPLY_ROUTE_LABELS[route]);
185
191
  this.log(`Read the answer: ${this.config.bin} tasks input show ${args.id} --request ${request.requestId} --wait`);
186
192
  if (response.advice?.tip)
@@ -9,6 +9,7 @@ const dry_run_plans_1 = require("../../lib/dry-run-plans");
9
9
  const task_batch_1 = require("../../lib/task-batch");
10
10
  const space_write_policy_1 = require("../../lib/space-write-policy");
11
11
  const write_target_1 = require("../../lib/write-target");
12
+ const task_review_notice_1 = require("../../lib/task-review-notice");
12
13
  const tasks_1 = require("../../lib/tasks");
13
14
  class TasksBulkUpdate extends base_command_1.BaseCommand {
14
15
  static description = 'Apply partial updates to many tasks from JSON';
@@ -113,6 +114,8 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
113
114
  }
114
115
  const usedBatch = batchByRow.size > 0;
115
116
  let stopped = false;
117
+ // Rows whose status move landed them in review that nobody owes a Review (OSK-33194).
118
+ const parkedInReview = [];
116
119
  for (const [index, row] of rows.entries()) {
117
120
  try {
118
121
  let task = null;
@@ -181,6 +184,9 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
181
184
  });
182
185
  continue;
183
186
  }
187
+ if ((0, task_review_notice_1.waitsForUnowedReview)(task)) {
188
+ parkedInReview.push((0, tasks_1.taskRef)(task) || (0, tasks_1.taskId)(task) || row.id);
189
+ }
184
190
  }
185
191
  if (!task) {
186
192
  task = await data_provider_1.dataService.getTask(row.id, { enrich: false });
@@ -212,7 +218,11 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
212
218
  failed: errors.length,
213
219
  results,
214
220
  };
221
+ const reviewNotice = (0, task_review_notice_1.unowedReviewSummary)(parkedInReview, this.config.bin);
215
222
  if (flags.json) {
223
+ // stderr, so the JSON on stdout stays one document (as `tasks move` does).
224
+ if (reviewNotice)
225
+ this.logToStderr(reviewNotice);
216
226
  const base = this.cliConfig.baseURL;
217
227
  const enriched = {
218
228
  ...summary,
@@ -243,6 +253,8 @@ class TasksBulkUpdate extends base_command_1.BaseCommand {
243
253
  this.log(`- failed ${result.id}: ${result.error}`);
244
254
  }
245
255
  }
256
+ if (reviewNotice)
257
+ this.log(reviewNotice);
246
258
  }
247
259
  if (errors.length > 0) {
248
260
  this.exit(1);
@@ -1,4 +1,6 @@
1
1
  import { BaseCommand } from '../../../base-command';
2
+ /** The body paths `deliverable add` writes from a flag, as `handleApiError` reads them back. */
3
+ export declare const DELIVERABLE_ADD_FIELD_FLAGS: Readonly<Record<string, string>>;
2
4
  export declare function defaultDeliverableIdempotencyKey(): string;
3
5
  /**
4
6
  * `skrr tasks deliverable add <task> <kind>:<identity>[@<location>]`
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DELIVERABLE_ADD_FIELD_FLAGS = void 0;
36
37
  exports.defaultDeliverableIdempotencyKey = defaultDeliverableIdempotencyKey;
37
38
  exports.statusNotApplied = statusNotApplied;
38
39
  const fs = __importStar(require("node:fs"));
@@ -46,6 +47,10 @@ const api_fetch_1 = require("../../../lib/api-fetch");
46
47
  const session_task_write_1 = require("../../../lib/session-task-write");
47
48
  const tasks_1 = require("../../../lib/tasks");
48
49
  const ASSERT_ARCHIVED_DELIVERABLE_RECEIPT_RE = /^[a-f0-9]{64}$/i;
50
+ /** The body paths `deliverable add` writes from a flag, as `handleApiError` reads them back. */
51
+ exports.DELIVERABLE_ADD_FIELD_FLAGS = Object.freeze({
52
+ runId: '--run-id',
53
+ });
49
54
  function defaultDeliverableIdempotencyKey() {
50
55
  return `task-deliverable_${(0, node_crypto_1.randomUUID)()}`;
51
56
  }
@@ -109,7 +114,9 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
109
114
  version: core_1.Flags.string({ description: 'Exact provider version, such as a full commit SHA' }),
110
115
  'content-digest': core_1.Flags.string({ description: 'Integrity digest for this exact version' }),
111
116
  expectation: core_1.Flags.string({ multiple: true, description: 'Expectation id this satisfies' }),
112
- 'run-id': core_1.Flags.string({ description: 'Run that produced it' }),
117
+ 'run-id': core_1.Flags.string({
118
+ description: 'Task Run that produced it. Not the id `tasks checkout` prints: a checkout is not a Task Run',
119
+ }),
113
120
  'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
114
121
  file: core_1.Flags.string({
115
122
  description: "Archive THIS file as the Deliverable's exact content, when the bytes are somewhere " +
@@ -193,6 +200,10 @@ class TasksDeliverableAdd extends base_command_1.BaseCommand {
193
200
  ...observation,
194
201
  idempotencyKey: flags['idempotency-key'] || defaultDeliverableIdempotencyKey(),
195
202
  };
203
+ // A refusal about the cited Run names `runId`; the person typed --run-id
204
+ // (OSK-33349: "Leave out runId" reads "Leave out --run-id").
205
+ if (flags['run-id'])
206
+ this.requestFieldFlags = exports.DELIVERABLE_ADD_FIELD_FLAGS;
196
207
  const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('deliverable', args.task);
197
208
  result = sessionWrite
198
209
  ? await (0, api_fetch_1.apiFetch)(sessionWrite.path, {
@@ -308,13 +319,21 @@ exports.default = TasksDeliverableAdd;
308
319
  /** Availability and a named Resource version require the server's complete archive receipt. */
309
320
  function assertArchivedDeliverableReceipt(asset) {
310
321
  const receipt = asset?.resourceReceipt;
311
- const ids = [asset?.id, receipt?.resource?.id, receipt?.version?.id, receipt?.link?.id,
312
- receipt?.observation?.id];
322
+ const ids = [
323
+ asset?.id,
324
+ receipt?.resource?.id,
325
+ receipt?.version?.id,
326
+ receipt?.link?.id,
327
+ receipt?.observation?.id,
328
+ ];
313
329
  const stored = asset?.digest;
314
330
  const versionDigest = receipt?.version?.contentDigest;
315
- if (asset?.status !== 'ready' || ids.some((id) => typeof id !== 'string' || !id.trim()) ||
316
- receipt?.observation?.status !== 'available' || typeof stored !== 'string' ||
317
- !ASSERT_ARCHIVED_DELIVERABLE_RECEIPT_RE.test(stored) || typeof versionDigest !== 'string' ||
331
+ if (asset?.status !== 'ready' ||
332
+ ids.some((id) => typeof id !== 'string' || !id.trim()) ||
333
+ receipt?.observation?.status !== 'available' ||
334
+ typeof stored !== 'string' ||
335
+ !ASSERT_ARCHIVED_DELIVERABLE_RECEIPT_RE.test(stored) ||
336
+ typeof versionDigest !== 'string' ||
318
337
  versionDigest.toLowerCase() !== `sha256:${stored.toLowerCase()}`) {
319
338
  throw new Error('The server did not confirm a ready archived Deliverable with its exact Resource receipt. ' +
320
339
  'Re-read the Task attachments and Deliverables before retrying.');
@@ -18,6 +18,8 @@ export declare function humanInputContextLines(question: Pick<TaskHumanInputQues
18
18
  export declare function humanInputOptionDescriptionLines(question: Pick<TaskHumanInputQuestion, 'options' | 'optionDescriptions'>, indent: string): string[];
19
19
  /** `--timeout` for `--wait`: 90s, 10m, 2h (a bare number is seconds). */
20
20
  export declare function parseWaitTimeoutMs(value: string | undefined): number | null;
21
+ /** Who may answer, and who did when it was not a person. */
22
+ export declare function humanInputAuthorshipLines(request: Pick<TaskHumanInputRequest, 'ownerOnly' | 'answeredByAgentId' | 'answerBasis' | 'answerCitedMessageId'>): string[];
21
23
  /** Each answer as the asker reads it, beside the question it answers. */
22
24
  export declare function humanInputAnswerLines(request: TaskHumanInputRequest): string[];
23
25
  export default class TasksInputShow extends BaseCommand {
@@ -4,6 +4,7 @@ exports.humanInputOptionsLine = humanInputOptionsLine;
4
4
  exports.humanInputContextLines = humanInputContextLines;
5
5
  exports.humanInputOptionDescriptionLines = humanInputOptionDescriptionLines;
6
6
  exports.parseWaitTimeoutMs = parseWaitTimeoutMs;
7
+ exports.humanInputAuthorshipLines = humanInputAuthorshipLines;
7
8
  exports.humanInputAnswerLines = humanInputAnswerLines;
8
9
  const core_1 = require("@oclif/core");
9
10
  const data_provider_1 = require("@skrr-ai/data-provider");
@@ -56,9 +57,23 @@ function parseWaitTimeoutMs(value) {
56
57
  const unit = (match[2] || 's').toLowerCase();
57
58
  return Number(match[1]) * (unit === 'h' ? 3_600_000 : unit === 'm' ? 60_000 : 1000);
58
59
  }
60
+ /** Who may answer, and who did when it was not a person. */
61
+ function humanInputAuthorshipLines(request) {
62
+ const lines = [];
63
+ if (request.ownerOnly)
64
+ lines.push(data_provider_1.TASK_HUMAN_INPUT_OWNER_ONLY_LABEL);
65
+ if (request.answeredByAgentId) {
66
+ const basis = request.answerBasis
67
+ ? data_provider_1.TASK_HUMAN_INPUT_ANSWER_BASIS_LABELS[request.answerBasis]
68
+ : 'an unrecorded basis';
69
+ const cited = request.answerCitedMessageId ? ` (message ${request.answerCitedMessageId})` : '';
70
+ lines.push(`Answered for you by agent ${request.answeredByAgentId}, based on ${basis}${cited}. To change it, send the Task a new instruction.`);
71
+ }
72
+ return lines;
73
+ }
59
74
  /** Each answer as the asker reads it, beside the question it answers. */
60
75
  function humanInputAnswerLines(request) {
61
- const lines = [];
76
+ const lines = humanInputAuthorshipLines(request);
62
77
  for (const [index, question] of request.questions.entries()) {
63
78
  lines.push(`${index + 1}. ${question.header ? `${question.header}: ` : ''}${question.prompt}`);
64
79
  lines.push(...humanInputContextLines(question, ' '));
@@ -123,7 +138,7 @@ class TasksInputShow extends base_command_1.BaseCommand {
123
138
  this.handleApiError(err);
124
139
  }
125
140
  if (flags.json) {
126
- this.log(JSON.stringify(response, null, 2));
141
+ this.printJsonResult(response);
127
142
  return;
128
143
  }
129
144
  if (!response.data) {
@@ -176,7 +191,7 @@ class TasksInputShow extends base_command_1.BaseCommand {
176
191
  const open = request.status === 'open';
177
192
  if (!flags.wait || !open) {
178
193
  if (flags.json)
179
- this.log(JSON.stringify({ data: request }, null, 2));
194
+ this.printJsonResult({ data: request }, { ok: !(flags.wait && request.status !== 'answered') });
180
195
  else {
181
196
  this.log(`Request: ${request.requestId} (${request.status})`);
182
197
  for (const line of humanInputAnswerLines(request))
@@ -32,6 +32,14 @@ export declare function agentSessionOpenDefault(flags: ListFlags, env?: NodeJS.P
32
32
  export declare function emptyTasksMessage(flags: ListFlags, bin?: string): string;
33
33
  /** An empty filtered page is evidence about this query, not an empty Space. */
34
34
  export declare function externalKeyPrefixWarnings(flags: ListFlags, rowCount: number): ListWarning[];
35
+ /**
36
+ * The server sets `spaceUnverified` when it could not confirm that `--space` names a Space this caller
37
+ * can VIEW (OSK-24327): the Space does not exist, the caller cannot see it, or the check itself failed.
38
+ * It deliberately does not say which, so neither can this, and the note names all three rather than
39
+ * calling the id wrong. The rows are still the caller's own grants in that id, so an empty list here
40
+ * is not "this Space has no tasks".
41
+ */
42
+ export declare function spaceScopeWarnings(flags: ListFlags, response: unknown, bin?: string): ListWarning[];
35
43
  /**
36
44
  * The NEXT column's text, computed once for the table and the `--json`
37
45
  * `nextAction` alias. `reason` is the sentence the server wrote for a person;
@@ -4,6 +4,7 @@ exports.resolveListWorkspace = exports.lookupDefaultWorkspace = void 0;
4
4
  exports.agentSessionOpenDefault = agentSessionOpenDefault;
5
5
  exports.emptyTasksMessage = emptyTasksMessage;
6
6
  exports.externalKeyPrefixWarnings = externalKeyPrefixWarnings;
7
+ exports.spaceScopeWarnings = spaceScopeWarnings;
7
8
  exports.nextActionText = nextActionText;
8
9
  exports.nextColumnWidth = nextColumnWidth;
9
10
  exports.taskRef = taskRef;
@@ -175,6 +176,29 @@ function externalKeyPrefixWarnings(flags, rowCount) {
175
176
  },
176
177
  ];
177
178
  }
179
+ /**
180
+ * The server sets `spaceUnverified` when it could not confirm that `--space` names a Space this caller
181
+ * can VIEW (OSK-24327): the Space does not exist, the caller cannot see it, or the check itself failed.
182
+ * It deliberately does not say which, so neither can this, and the note names all three rather than
183
+ * calling the id wrong. The rows are still the caller's own grants in that id, so an empty list here
184
+ * is not "this Space has no tasks".
185
+ */
186
+ function spaceScopeWarnings(flags, response, bin = 'skrr') {
187
+ const space = flags.space;
188
+ if (typeof space !== 'string' || !space)
189
+ return [];
190
+ if (!response || typeof response !== 'object')
191
+ return [];
192
+ if (response.spaceUnverified !== true)
193
+ return [];
194
+ return [
195
+ {
196
+ code: 'SPACE_UNVERIFIED',
197
+ value: { space },
198
+ hint: `Space ${space} could not be verified for you (it may not exist, you may not be able to see it, or the check failed), so these results may be incomplete. Confirm the id with \`${bin} spaces list\`, or retry.`,
199
+ },
200
+ ];
201
+ }
178
202
  /**
179
203
  * `--status` is repeatable, so the flag value is a list; callers that predate
180
204
  * that and tests that pass a bare string both normalize through here.
@@ -301,7 +325,8 @@ function taskPageSummary(items, hasMore) {
301
325
  (Array.isArray(t.assigneeUserIds) && t.assigneeUserIds.length > 0))
302
326
  return 'assigned';
303
327
  return Array.isArray(t.assigneeAgentIds) && Array.isArray(t.assigneeUserIds)
304
- ? 'unassigned' : 'unknown';
328
+ ? 'unassigned'
329
+ : 'unknown';
305
330
  };
306
331
  return {
307
332
  scope: 'fetched_page',
@@ -321,11 +346,16 @@ function taskPageSummary(items, hasMore) {
321
346
  function taskExecutionText(t) {
322
347
  const execution = taskExecution(t);
323
348
  switch (execution.state) {
324
- case 'run_active': return `Run ${String(execution.runStatus ?? 'active')}${execution.agentId ? ` (${String(execution.agentId)})` : ''}`;
325
- case 'checkout_held': return 'Checkout held; Run unverified';
326
- case 'terminal': return 'Terminal';
327
- case 'not_observed': return 'No active Run observed';
328
- default: return 'Unknown';
349
+ case 'run_active':
350
+ return `Run ${String(execution.runStatus ?? 'active')}${execution.agentId ? ` (${String(execution.agentId)})` : ''}`;
351
+ case 'checkout_held':
352
+ return 'Checkout held; Run unverified';
353
+ case 'terminal':
354
+ return 'Terminal';
355
+ case 'not_observed':
356
+ return 'No active Run observed';
357
+ default:
358
+ return 'Unknown';
329
359
  }
330
360
  }
331
361
  /**
@@ -697,6 +727,9 @@ class TasksList extends base_command_1.BaseCommand {
697
727
  `(your default). Every workspace you belong to: ${this.config.bin} tasks list --all-workspaces`);
698
728
  }
699
729
  }
730
+ // A refused `spaceId` (400 SPACE_ID_INVALID, OSK-24327) is read back as the flag that sent it.
731
+ if (flags.space)
732
+ this.requestFieldFlags = { spaceId: '--space' };
700
733
  let response;
701
734
  try {
702
735
  response = calendarRange
@@ -731,9 +764,10 @@ class TasksList extends base_command_1.BaseCommand {
731
764
  const list = response;
732
765
  const rowCount = Array.isArray(list?.data) ? list.data.length : 0;
733
766
  const prefixWarnings = calendarRange ? [] : externalKeyPrefixWarnings(flags, rowCount);
767
+ const spaceWarnings = calendarRange ? [] : spaceScopeWarnings(flags, response, this.config.bin);
734
768
  const statusWarnings = calendarRange
735
769
  ? []
736
- : [...statusFilterWarnings(flags, rowCount), ...prefixWarnings];
770
+ : [...statusFilterWarnings(flags, rowCount), ...prefixWarnings, ...spaceWarnings];
737
771
  if (flags.strict && statusWarnings.some((w) => w.code === 'STATUS_NOT_BUILTIN')) {
738
772
  const bad = statusWarnings.find((w) => w.code === 'STATUS_NOT_BUILTIN');
739
773
  this.failWithCliError({
@@ -837,7 +871,12 @@ class TasksList extends base_command_1.BaseCommand {
837
871
  }
838
872
  const r = response;
839
873
  const items = r?.data ?? [];
840
- if (flags.q && (r?.degraded || r?.incomplete || r?.truncated || r?.search?.candidates_may_be_truncated || r?.search?.comment_search_incomplete)) {
874
+ if (flags.q &&
875
+ (r?.degraded ||
876
+ r?.incomplete ||
877
+ r?.truncated ||
878
+ r?.search?.candidates_may_be_truncated ||
879
+ r?.search?.comment_search_incomplete)) {
841
880
  this.warn('Search may be incomplete. Inspect --json diagnostics.');
842
881
  }
843
882
  if (flags.q && r?.search?.semantics === 'case_insensitive_substring') {
@@ -845,7 +884,7 @@ class TasksList extends base_command_1.BaseCommand {
845
884
  }
846
885
  if (items.length === 0) {
847
886
  this.log(emptyTasksMessage(flags, this.config.bin));
848
- for (const line of (0, list_output_1.warningLines)(prefixWarnings))
887
+ for (const line of (0, list_output_1.warningLines)([...prefixWarnings, ...spaceWarnings]))
849
888
  this.log(line);
850
889
  if (r?.next_cursor)
851
890
  this.log(`Next page: --cursor ${r.next_cursor}`);
@@ -925,6 +964,8 @@ class TasksList extends base_command_1.BaseCommand {
925
964
  const note = (0, list_output_1.limitNote)(flags.limit, items.length, Boolean(r?.has_more));
926
965
  for (const line of (0, list_output_1.warningLines)(note.warning ? [note.warning] : []))
927
966
  this.log(line);
967
+ for (const line of (0, list_output_1.warningLines)(spaceWarnings))
968
+ this.log(line);
928
969
  for (const line of (0, list_output_1.textModeProjectionNotes)(flags))
929
970
  this.log(line);
930
971
  }
@@ -1,14 +1,6 @@
1
1
  import { BaseCommand } from '../../base-command';
2
- /**
3
- * The notice for a Task moved into review that no Review is owed for.
4
- *
5
- * Review is where a Review the Task's own `reviewPolicy` requires is waited
6
- * for. Under `none` (the default) nobody owes one, so a Task parked there
7
- * waits on a person who was never asked: thousands sat in review that way
8
- * (OSK-33196). The move still lands; this says what it means, at the moment
9
- * an agent made it.
10
- */
11
- export declare function unowedReviewNotice(task: unknown, bin: string): string | null;
2
+ import { unowedReviewNotice } from '../../lib/task-review-notice';
3
+ export { unowedReviewNotice };
12
4
  /**
13
5
  * `tasks move` is the documented way to change a task's status. The data
14
6
  * provider's `TaskUpdateParams` (used by `tasks update`) does not expose a
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unowedReviewNotice = unowedReviewNotice;
3
+ exports.unowedReviewNotice = void 0;
4
4
  const core_1 = require("@oclif/core");
5
5
  const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const api_fetch_1 = require("../../lib/api-fetch");
@@ -14,22 +14,8 @@ const task_closure_1 = require("../../lib/task-closure");
14
14
  const web_url_1 = require("../../lib/web-url");
15
15
  const task_resolver_1 = require("../../lib/task-resolver");
16
16
  const projects_1 = require("../../lib/projects");
17
- /**
18
- * The notice for a Task moved into review that no Review is owed for.
19
- *
20
- * Review is where a Review the Task's own `reviewPolicy` requires is waited
21
- * for. Under `none` (the default) nobody owes one, so a Task parked there
22
- * waits on a person who was never asked: thousands sat in review that way
23
- * (OSK-33196). The move still lands; this says what it means, at the moment
24
- * an agent made it.
25
- */
26
- function unowedReviewNotice(task, bin) {
27
- const t = (task ?? {});
28
- if (t.statusType !== 'review' || t.reviewPolicy === 'required')
29
- return null;
30
- return ('Nobody owes this Task a Review: its reviewPolicy is not `required`, so it waits in review ' +
31
- `for a person who was never asked. Close finished work with \`${bin} tasks complete\`.`);
32
- }
17
+ const task_review_notice_1 = require("../../lib/task-review-notice");
18
+ Object.defineProperty(exports, "unowedReviewNotice", { enumerable: true, get: function () { return task_review_notice_1.unowedReviewNotice; } });
33
19
  /**
34
20
  * `tasks move` is the documented way to change a task's status. The data
35
21
  * provider's `TaskUpdateParams` (used by `tasks update`) does not expose a
@@ -224,7 +210,7 @@ class TasksMove extends base_command_1.BaseCommand {
224
210
  }
225
211
  this.handleApiError(err);
226
212
  }
227
- const reviewNotice = flags.status ? unowedReviewNotice(updated, this.config.bin) : null;
213
+ const reviewNotice = flags.status ? (0, task_review_notice_1.unowedReviewNotice)(updated, this.config.bin) : null;
228
214
  if (flags.json) {
229
215
  // stderr, so the JSON on stdout stays one document.
230
216
  if (reviewNotice)
@@ -247,6 +233,9 @@ class TasksMove extends base_command_1.BaseCommand {
247
233
  destinations.push(await this.describeProjectDestination(projectId, t));
248
234
  }
249
235
  this.log(`Moved task ${t.id ?? t._id ?? taskRef}${ref ? ` (${ref})` : ''} → ${destinations.join(', ')}`);
236
+ const versionLine = (0, task_version_1.writtenTaskVersionLine)(t);
237
+ if (versionLine)
238
+ this.log(` ${versionLine}`);
250
239
  /*
251
240
  * Closing is the actor's call — the server does not refuse outstanding
252
241
  * work, it records it on `resolution.closure`. If the close just written
@@ -1,4 +1,6 @@
1
1
  import { BaseCommand } from '../../../base-command';
2
+ /** The body paths `resource add` writes from a flag, as `handleApiError` reads them back. */
3
+ export declare const RESOURCE_ADD_FIELD_FLAGS: Readonly<Record<string, string>>;
2
4
  export default class TasksResourceAdd extends BaseCommand {
3
5
  static description: string;
4
6
  static examples: string[];