@skrr-ai/cli 0.1.215 → 0.1.217

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 (48) hide show
  1. package/dist/commands/agent/message/no-reply.d.ts +4 -0
  2. package/dist/commands/agent/message/no-reply.js +5 -1
  3. package/dist/commands/agents/always-on/recovery-review.d.ts +12 -0
  4. package/dist/commands/agents/always-on/recovery-review.js +52 -2
  5. package/dist/commands/agents/permissions/list.d.ts +12 -0
  6. package/dist/commands/agents/permissions/list.js +42 -0
  7. package/dist/commands/agents/permissions/remove.d.ts +15 -0
  8. package/dist/commands/agents/permissions/remove.js +68 -0
  9. package/dist/commands/dm/work.js +2 -0
  10. package/dist/commands/duties/action-proposal.js +7 -1
  11. package/dist/commands/duties/action-proposals.d.ts +9 -0
  12. package/dist/commands/duties/action-proposals.js +30 -12
  13. package/dist/commands/duties/check-now.d.ts +7 -0
  14. package/dist/commands/duties/check-now.js +36 -1
  15. package/dist/commands/duties/create.d.ts +15 -0
  16. package/dist/commands/duties/create.js +93 -5
  17. package/dist/commands/duties/pause.js +20 -2
  18. package/dist/commands/duties/trigger-status.js +6 -1
  19. package/dist/commands/duties/update.js +22 -7
  20. package/dist/commands/spaces/auto-executor/preview.d.ts +7 -0
  21. package/dist/commands/spaces/auto-executor/preview.js +21 -2
  22. package/dist/commands/tasks/chat/index.d.ts +11 -0
  23. package/dist/commands/tasks/chat/index.js +27 -0
  24. package/dist/commands/tasks/input/answer.d.ts +12 -0
  25. package/dist/commands/tasks/input/answer.js +59 -5
  26. package/dist/commands/tasks/operations/show.js +5 -6
  27. package/dist/commands/tasks/result/show.js +2 -4
  28. package/dist/commands/tasks/retry-receipt.js +1 -3
  29. package/dist/commands/wiki/write.js +7 -2
  30. package/dist/generated/agent-guides.json +24 -24
  31. package/dist/lib/compasses.d.ts +5 -0
  32. package/dist/lib/compasses.js +6 -1
  33. package/dist/lib/duties.d.ts +29 -0
  34. package/dist/lib/duties.js +122 -16
  35. package/dist/lib/permission-rules.d.ts +21 -0
  36. package/dist/lib/permission-rules.js +75 -0
  37. package/dist/lib/space-proposals.js +8 -1
  38. package/dist/lib/space-write-policy.js +18 -2
  39. package/dist/lib/task-extras.d.ts +19 -0
  40. package/dist/lib/task-extras.js +13 -0
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.d.ts +43 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/ownerChatDutyHarnesses.js +36 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.d.ts +43 -0
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/ownerChatDutyHarnesses.js +48 -0
  45. package/dist/node_modules/@skrr-ai/auth-core/package.json +10 -0
  46. package/dist/node_modules/@skrr-ai/data-provider/index.js +12658 -12041
  47. package/oclif.manifest.json +201 -4
  48. package/package.json +5 -2
@@ -29,8 +29,26 @@ class DutiesPause extends base_command_1.BaseCommand {
29
29
  this.log(JSON.stringify((0, web_url_1.withDutyUrl)(this.cliConfig.baseURL, duty), null, 2));
30
30
  return;
31
31
  }
32
- this.log(`Paused duty ${args.id}.`);
33
- this.log('Stops new work. A turn already running may continue until it finishes or reaches its deadline.');
32
+ // A Duty that is already a full stop is not paused again (OSK-33447): the server writes nothing, so its
33
+ // version, and every proposal and approval pinned to it, stay as they were. Say that, rather than
34
+ // "Paused", which reads as a new stop. A Duty paused for new observation only is still written, since
35
+ // this pause also withdraws the work that pause let finish.
36
+ const outcome = duty;
37
+ const runningTurn = 'A turn already running may continue until it finishes or reaches its deadline.';
38
+ if (outcome.alreadyPaused !== true) {
39
+ this.log(`Paused duty ${args.id}.`);
40
+ this.log(`Stops new work. ${runningTurn}`);
41
+ }
42
+ else {
43
+ let already = `Duty ${args.id} was already paused.`;
44
+ if (outcome.changed === false)
45
+ already += ' Nothing changed.';
46
+ else if (outcome.revokedExecution === true) {
47
+ already += ' This pause also revoked the authority of work accepted before it.';
48
+ }
49
+ this.log(already);
50
+ this.log(`New work stays stopped. ${runningTurn}`);
51
+ }
34
52
  // The status write is the fence and it has landed. The teardown of the
35
53
  // wake tree behind it is best-effort, and used to be silent — so a pause
36
54
  // that left triggers live looked exactly like one that did not. Say which
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.safeTriggerStatus = safeTriggerStatus;
4
4
  exports.formatTriggerStatus = formatTriggerStatus;
5
5
  const core_1 = require("@oclif/core");
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../base-command");
7
8
  const duties_1 = require("../../lib/duties");
8
9
  const duty_event_wakes_1 = require("../../lib/duty-event-wakes");
@@ -143,7 +144,11 @@ function formatTriggerStatus(status) {
143
144
  lines.push(`Recent fires (${fires.length}):`);
144
145
  for (const fire of fires) {
145
146
  lines.push(` ${fmtTime(fire.firedAt)} ${fire.outcome ?? '?'}` +
146
- (fire.reason ? ` — ${fire.reason}` : '') +
147
+ // A viewer who is not the Duty's owner is sent the marker in place of a prose reason
148
+ // (OSK-33457); say whose it is rather than print the marker.
149
+ (fire.reason
150
+ ? ` — ${(0, data_provider_1.isDutyReasonWithheld)(fire.reason) ? '(owner only)' : fire.reason}`
151
+ : '') +
147
152
  (fire.triggerId ? ` (${fire.triggerId})` : ''));
148
153
  }
149
154
  }
@@ -330,9 +330,13 @@ JSON
330
330
  }
331
331
  if (wantsCadence) {
332
332
  if (flags['restore-saved-cadence']) {
333
- if (flags.cadence !== undefined || flags['cadence-mode'] !== undefined ||
334
- flags.timezone !== undefined || payload.cadence !== undefined) {
335
- this.error('--restore-saved-cadence cannot be combined with other cadence edits.', { exit: 1 });
333
+ if (flags.cadence !== undefined ||
334
+ flags['cadence-mode'] !== undefined ||
335
+ flags.timezone !== undefined ||
336
+ payload.cadence !== undefined) {
337
+ this.error('--restore-saved-cadence cannot be combined with other cadence edits.', {
338
+ exit: 1,
339
+ });
336
340
  }
337
341
  if (current?.cadence?.mode !== 'manual' || !current?.savedCadence) {
338
342
  this.error('There is no saved schedule to restore on this manual Duty. Run `skrr duties show` to inspect it.', { exit: 1 });
@@ -396,7 +400,8 @@ JSON
396
400
  if (cadence.mode !== 'daily' && !Object.hasOwn(authoredCadence ?? {}, 'times')) {
397
401
  delete cadence.times;
398
402
  }
399
- if (cadence.mode !== 'sampled' && !Object.hasOwn(authoredCadence ?? {}, 'jitterRatio')) {
403
+ if (cadence.mode !== 'sampled' &&
404
+ !Object.hasOwn(authoredCadence ?? {}, 'jitterRatio')) {
400
405
  delete cadence.jitterRatio;
401
406
  }
402
407
  }
@@ -474,10 +479,16 @@ JSON
474
479
  catch (err) {
475
480
  this.handleApiError(err);
476
481
  }
477
- // A replacement edit is accepted as written; these say what it removed.
482
+ // An Agent's cadence change to a non-draft Duty is a request for the owner, not a write
483
+ // (OSK-33445): the answer says so, and its cadence is the one the Duty still has.
484
+ const cadenceRequest = (0, duties_1.readDutyCadenceRequest)(duty);
485
+ const pendingCadence = cadenceRequest?.status === 'awaiting_approval';
486
+ // A replacement edit is accepted as written; these say what it removed. A cadence still waiting
487
+ // for the owner removed nothing yet.
488
+ const { cadence: _pendingCadence, ...writtenPayload } = payload;
478
489
  const warnings = (0, duties_1.dutyWriteWarnings)(duty, {
479
490
  before: current,
480
- payload,
491
+ payload: pendingCadence ? writtenPayload : payload,
481
492
  });
482
493
  if (flags.json) {
483
494
  this.log(JSON.stringify((0, web_url_1.withDutyUrl)(this.cliConfig.baseURL, {
@@ -486,7 +497,11 @@ JSON
486
497
  }), null, 2));
487
498
  return;
488
499
  }
489
- this.log((0, duties_1.describeDutyRevision)(duty?.revision));
500
+ if (cadenceRequest)
501
+ this.log((0, duties_1.describeDutyCadenceRequest)(cadenceRequest, duty?.id ?? args.id));
502
+ // A request alone changed nothing else, so "No change" would contradict the line above.
503
+ if (!pendingCadence || duty?.revision?.changed !== false)
504
+ this.log((0, duties_1.describeDutyRevision)(duty?.revision));
490
505
  (0, duties_1.renderDutySummary)(duty, (line) => this.log(line));
491
506
  (0, duties_1.renderDutyWriteWarnings)(warnings, (line) => this.warn(line));
492
507
  }
@@ -1,6 +1,13 @@
1
1
  import { type SpaceAutoExecutorPreviewResponse, type SpaceAutoExecutorRefillState } from '@skrr-ai/data-provider';
2
2
  import { BaseCommand } from '../../../base-command';
3
3
  type PreviewSpace = SpaceAutoExecutorPreviewResponse['space'];
4
+ type PlanSummary = SpaceAutoExecutorPreviewResponse['plan']['summary'];
5
+ /**
6
+ * The board in one line. "Running" counts the started Tasks something executes (OSK-33478); a
7
+ * started Task that only waits on something else, or that nothing carries, is said as what it is,
8
+ * and an older server that reports no split prints the line it always did.
9
+ */
10
+ export declare function boardLine(summary: Pick<PlanSummary, 'readyCount' | 'unassignedCount' | 'runningCount' | 'startedWaitingCount' | 'startedUncarriedCount' | 'failedCount' | 'scheduledCount'>): string;
4
11
  /**
5
12
  * "Can start" is a capacity figure, not a forecast. Printed bare next to a disabled autopilot
6
13
  * it read as "one task will start now" (dogfooded: `Autopilot: disabled` / `Can start: 1 now`).
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.boardLine = boardLine;
3
4
  exports.canStartLine = canStartLine;
4
5
  exports.principalLine = principalLine;
5
6
  exports.refillLines = refillLines;
@@ -9,6 +10,22 @@ const base_command_1 = require("../../../base-command");
9
10
  const api_fetch_1 = require("../../../lib/api-fetch");
10
11
  const space_output_1 = require("../../../lib/space-output");
11
12
  const PRINCIPAL_LINE_RE = /_/g;
13
+ /**
14
+ * The board in one line. "Running" counts the started Tasks something executes (OSK-33478); a
15
+ * started Task that only waits on something else, or that nothing carries, is said as what it is,
16
+ * and an older server that reports no split prints the line it always did.
17
+ */
18
+ function boardLine(summary) {
19
+ const started = [
20
+ summary.startedWaitingCount ? `${summary.startedWaitingCount} started and waiting` : null,
21
+ summary.startedUncarriedCount
22
+ ? `${summary.startedUncarriedCount} started with nothing carrying ${summary.startedUncarriedCount === 1 ? 'it' : 'them'}`
23
+ : null,
24
+ ].filter(Boolean);
25
+ return (`Board: ${summary.readyCount} ready · ${summary.unassignedCount} unassigned · ` +
26
+ `${summary.runningCount} running · ${started.map((part) => `${part} · `).join('')}` +
27
+ `${summary.failedCount} failed · ${summary.scheduledCount} scheduled`);
28
+ }
12
29
  /**
13
30
  * "Can start" is a capacity figure, not a forecast. Printed bare next to a disabled autopilot
14
31
  * it read as "one task will start now" (dogfooded: `Autopilot: disabled` / `Can start: 1 now`).
@@ -94,12 +111,14 @@ class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
94
111
  this.log(line);
95
112
  const { actions, summary } = plan;
96
113
  this.log('');
97
- this.log(`Board: ${summary.readyCount} ready · ${summary.unassignedCount} unassigned · ` +
98
- `${summary.runningCount} running · ${summary.failedCount} failed · ${summary.scheduledCount} scheduled`);
114
+ this.log(boardLine(summary));
99
115
  section(this.log.bind(this), 'Would start now', actions.startNow, (a) => taskLine(a.task));
100
116
  section(this.log.bind(this), 'Would assign', actions.assignments, (a) => `${taskLine(a.task)} → ${a.suggestedAgentName ?? a.suggestedAgentId ?? 'no eligible agent'}`);
101
117
  section(this.log.bind(this), 'Would schedule later', actions.scheduleLater, (a) => `${taskLine(a.task)} @ ${a.scheduledFor}`);
102
118
  section(this.log.bind(this), 'Failures to review', actions.failureReviews, (a) => taskLine(a.task));
119
+ // In Progress on the board, and nothing will move them: not running, and not this Space's to
120
+ // start. Listed so the person reading this can decide what moves each one.
121
+ section(this.log.bind(this), 'Started, nothing carrying it', result.context.buckets.startedUncarried, (task) => taskLine(task));
103
122
  // The single most useful diagnostic in the payload: a ready task that is
104
123
  // not starting because ITS agent is saturated elsewhere, not because this
105
124
  // space is full. Without it the board just looks stuck.
@@ -11,6 +11,14 @@ import { BaseCommand } from '../../../base-command';
11
11
  * projection across EVERY source that ever fed this task. `skrr tasks transcript`
12
12
  * renders one run's conversation — what the agent said on an attempt; this is
13
13
  * the whole relationship, including the parts a rotated epoch moved out of view.
14
+ *
15
+ * `--launch-input`, `--run-input <run-id>` and `--handled-output <run-id>` are
16
+ * what the Task page shows beside a run: the brief the launching Agent chat
17
+ * handed the Task, what one run was actually given (specification, brief,
18
+ * messages, files, and how much history), and the reply and Result one handled
19
+ * round produced. They are the same Task-chat VIEW reads the page makes, so a
20
+ * headless operator can answer "what did the Agent see, and what did it say"
21
+ * without opening a browser.
14
22
  */
15
23
  export default class TasksChat extends BaseCommand {
16
24
  static description: string;
@@ -25,6 +33,9 @@ export default class TasksChat extends BaseCommand {
25
33
  runs: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
34
  'transfer-preview': import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
35
  history: import("@oclif/core/interfaces").BooleanFlag<boolean>;
36
+ 'launch-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
37
+ 'run-input': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
38
+ 'handled-output': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
39
  limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
29
40
  };
30
41
  run(): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
4
5
  const base_command_1 = require("../../../base-command");
5
6
  const task_extras_1 = require("../../../lib/task-extras");
6
7
  /**
@@ -15,6 +16,14 @@ const task_extras_1 = require("../../../lib/task-extras");
15
16
  * projection across EVERY source that ever fed this task. `skrr tasks transcript`
16
17
  * renders one run's conversation — what the agent said on an attempt; this is
17
18
  * the whole relationship, including the parts a rotated epoch moved out of view.
19
+ *
20
+ * `--launch-input`, `--run-input <run-id>` and `--handled-output <run-id>` are
21
+ * what the Task page shows beside a run: the brief the launching Agent chat
22
+ * handed the Task, what one run was actually given (specification, brief,
23
+ * messages, files, and how much history), and the reply and Result one handled
24
+ * round produced. They are the same Task-chat VIEW reads the page makes, so a
25
+ * headless operator can answer "what did the Agent see, and what did it say"
26
+ * without opening a browser.
18
27
  */
19
28
  class TasksChat extends base_command_1.BaseCommand {
20
29
  static description = "Show a task's chat epoch, exchanges, sources or execution runs";
@@ -24,6 +33,9 @@ class TasksChat extends base_command_1.BaseCommand {
24
33
  '<%= config.bin %> tasks chat task_abc123 --sources',
25
34
  '<%= config.bin %> tasks chat task_abc123 --runs',
26
35
  '<%= config.bin %> tasks chat task_abc123 --history',
36
+ '<%= config.bin %> tasks chat task_abc123 --launch-input',
37
+ '<%= config.bin %> tasks chat task_abc123 --run-input run_abc123',
38
+ '<%= config.bin %> tasks chat task_abc123 --handled-output run_abc123',
27
39
  ];
28
40
  static args = {
29
41
  id: core_1.Args.string({ ignoreStdin: true, description: 'Task ID', required: true }),
@@ -39,6 +51,15 @@ class TasksChat extends base_command_1.BaseCommand {
39
51
  history: core_1.Flags.boolean({
40
52
  description: "The full task-history projection across every source (not one run's transcript)",
41
53
  }),
54
+ 'launch-input': core_1.Flags.boolean({
55
+ description: 'The brief the launching Agent chat handed this task (null when none)',
56
+ }),
57
+ 'run-input': core_1.Flags.string({
58
+ description: 'What the execution run with this id was given: specification, brief, messages, files and history',
59
+ }),
60
+ 'handled-output': core_1.Flags.string({
61
+ description: 'The reply and Result id the handled Agent round with this run id produced',
62
+ }),
42
63
  limit: core_1.Flags.integer({ description: 'Max rows', min: 1, max: 200 }),
43
64
  };
44
65
  async run() {
@@ -57,6 +78,12 @@ class TasksChat extends base_command_1.BaseCommand {
57
78
  result = await task_extras_1.taskChatApi.transferPreview(taskId);
58
79
  else if (flags.history)
59
80
  result = await task_extras_1.taskChatApi.taskHistory(taskId, { limit: flags.limit });
81
+ else if (flags['launch-input'])
82
+ result = await data_provider_1.dataService.getTaskChatLaunchInput(taskId);
83
+ else if (flags['run-input'])
84
+ result = await data_provider_1.dataService.getTaskExecutionRunInput(taskId, flags['run-input']);
85
+ else if (flags['handled-output'])
86
+ result = await data_provider_1.dataService.getTaskExecutionRunHandledOutput(taskId, flags['handled-output']);
60
87
  else
61
88
  result = await task_extras_1.taskChatApi.chat(taskId);
62
89
  }
@@ -1,4 +1,15 @@
1
1
  import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `--select` picks option labels: `questionId=Label` (repeat to pick several), or a bare `Label`
4
+ * for a request with one question. An approval ("Allow once" / "Deny") is answered only this way:
5
+ * the server reads the decision from `selectedOptions`, never from text. An approval may also offer
6
+ * "Always allow …": choosing it here allows the call once and saves no rule, which is granted only on
7
+ * the card in the app (OSK-33440); the command prints what came of it.
8
+ */
9
+ export declare function parseSelections(values: string[] | undefined, onlyQuestionId: string | undefined): Array<{
10
+ questionId: string;
11
+ selectedOptions: string[];
12
+ }>;
2
13
  export default class TasksInputAnswer extends BaseCommand {
3
14
  static description: string;
4
15
  static args: {
@@ -9,6 +20,7 @@ export default class TasksInputAnswer extends BaseCommand {
9
20
  request: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
21
  text: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
22
  answer: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ select: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
24
  'command-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
25
  };
14
26
  run(): Promise<void>;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseSelections = parseSelections;
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");
8
+ const permission_rules_1 = require("../../../lib/permission-rules");
7
9
  function parseAnswers(values) {
8
10
  return (values || []).map((value) => {
9
11
  const separator = value.indexOf('=');
@@ -15,6 +17,27 @@ function parseAnswers(values) {
15
17
  };
16
18
  });
17
19
  }
20
+ /**
21
+ * `--select` picks option labels: `questionId=Label` (repeat to pick several), or a bare `Label`
22
+ * for a request with one question. An approval ("Allow once" / "Deny") is answered only this way:
23
+ * the server reads the decision from `selectedOptions`, never from text. An approval may also offer
24
+ * "Always allow …": choosing it here allows the call once and saves no rule, which is granted only on
25
+ * the card in the app (OSK-33440); the command prints what came of it.
26
+ */
27
+ function parseSelections(values, onlyQuestionId) {
28
+ const byQuestion = new Map();
29
+ for (const raw of values || []) {
30
+ const separator = raw.indexOf('=');
31
+ const questionId = separator > 0 ? raw.slice(0, separator) : onlyQuestionId;
32
+ const option = (separator > 0 ? raw.slice(separator + 1) : raw).trim();
33
+ if (!questionId)
34
+ throw new Error('--select needs questionId=option when the request has several questions');
35
+ if (!option)
36
+ throw new Error('--select needs an option label');
37
+ byQuestion.set(questionId, [...(byQuestion.get(questionId) || []), option]);
38
+ }
39
+ return [...byQuestion].map(([questionId, selectedOptions]) => ({ questionId, selectedOptions }));
40
+ }
18
41
  class TasksInputAnswer extends base_command_1.BaseCommand {
19
42
  static description = 'Answer an open Human-input request. A Run-carried question starts the next exchange; a question asked outside a Run is answered in place';
20
43
  static args = {
@@ -28,6 +51,10 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
28
51
  description: 'Structured answer as questionId=text (repeatable)',
29
52
  multiple: true,
30
53
  }),
54
+ select: core_1.Flags.string({
55
+ description: 'Choose an option by label: questionId=Label, or just Label for a one-question request (repeatable). An approval is answered this way, e.g. --select "Allow once" or --select Deny',
56
+ multiple: true,
57
+ }),
31
58
  'command-id': core_1.Flags.string({ description: 'Stable idempotency key for retries' }),
32
59
  };
33
60
  async run() {
@@ -41,16 +68,39 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
41
68
  catch (err) {
42
69
  this.error(err.message, { exit: 2 });
43
70
  }
44
- if (!flags.text && answers.length === 0) {
45
- this.error('Pass --text or at least one --answer questionId=text', { exit: 2 });
71
+ if (!flags.text && answers.length === 0 && !flags.select?.length) {
72
+ this.error('Pass --text, --select, or at least one --answer questionId=text', { exit: 2 });
46
73
  }
47
74
  let requestId = flags.request;
48
- if (!requestId) {
49
- const current = await data_provider_1.dataService.getTaskHumanInput(taskId);
50
- requestId = current.data?.requestId;
75
+ let current;
76
+ try {
77
+ if (!requestId) {
78
+ current = await data_provider_1.dataService.getTaskHumanInput(taskId);
79
+ requestId = current.data?.requestId;
80
+ }
81
+ else if (flags.select?.length) {
82
+ current = await data_provider_1.dataService.getTaskHumanInputRequest(taskId, requestId);
83
+ }
84
+ }
85
+ catch (err) {
86
+ this.handleApiError(err);
51
87
  }
52
88
  if (!requestId)
53
89
  this.error('No open Human-input request exists for this task', { exit: 4 });
90
+ const questions = current?.data?.questions || [];
91
+ try {
92
+ for (const selection of parseSelections(flags.select, questions.length === 1 ? questions[0].questionId : undefined)) {
93
+ // One entry per question: a selection joins the text given for the same question.
94
+ const existing = answers.find((a) => a.questionId === selection.questionId);
95
+ if (existing)
96
+ existing.selectedOptions = selection.selectedOptions;
97
+ else
98
+ answers.push(selection);
99
+ }
100
+ }
101
+ catch (err) {
102
+ this.error(err.message, { exit: 2 });
103
+ }
54
104
  let result;
55
105
  try {
56
106
  result = await data_provider_1.dataService.answerTaskHumanInput(taskId, requestId, {
@@ -72,6 +122,10 @@ class TasksInputAnswer extends base_command_1.BaseCommand {
72
122
  (('replyRoute' in result &&
73
123
  data_provider_1.TASK_HUMAN_INPUT_REPLY_ROUTE_LABELS[result.replyRoute]) ||
74
124
  ''));
125
+ // An approval answered "Always allow …": whether a rule was saved.
126
+ const rule = flags.json ? null : (0, data_provider_1.parsePermissionRuleGrantOutcome)(result.alwaysAllow);
127
+ if (rule)
128
+ this.log((0, permission_rules_1.ruleOutcomeLine)(rule));
75
129
  }
76
130
  }
77
131
  exports.default = TasksInputAnswer;
@@ -53,15 +53,14 @@ class TasksOperationsShow extends base_command_1.BaseCommand {
53
53
  // turns whatever it picked into something the API can resolve — a UUID and
54
54
  // an OSK-2423 ref pass through untouched, a title is searched.
55
55
  const taskId = await this.resolveTaskReference(taskIdentity.id);
56
- // Published CLI builds can lag the data-provider declaration during an
57
- // additive rollout. The methods are still runtime functions exported by
58
- // this same package, so this narrow cast preserves compatibility.
59
- const service = data_provider_1.dataService;
56
+ // Called directly, not through a compatibility cast: the CLI ships its
57
+ // data-provider vendored (scripts/vendor-monorepo-deps.js), so the declaration
58
+ // cannot lag the runtime, and a cast hides these reads from the parity checks.
60
59
  let operation;
61
60
  try {
62
61
  operation = operationId
63
- ? await service.getTaskOperation(taskId, operationId)
64
- : await service.getTaskOperationByRequest(taskId, requestId);
62
+ ? await data_provider_1.dataService.getTaskOperation(taskId, operationId)
63
+ : await data_provider_1.dataService.getTaskOperationByRequest(taskId, requestId);
65
64
  }
66
65
  catch (error) {
67
66
  this.handleApiError(error, { subject: `Task ${taskId} operation` });
@@ -6,7 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
6
6
  const base_command_1 = require("../../../base-command");
7
7
  const task_resolver_1 = require("../../../lib/task-resolver");
8
8
  const task_legacy_1 = require("../../../lib/task-legacy");
9
- const api_fetch_1 = require("../../../lib/api-fetch");
9
+ const task_extras_1 = require("../../../lib/task-extras");
10
10
  /**
11
11
  * What a reviewer needs to accept ONE exact Result (OSK-15430). `result show` printed the summary and
12
12
  * the conclusion, and kept the Result id (the value `tasks review --result-id` requires), the linked
@@ -84,10 +84,8 @@ class TasksResultShow extends base_command_1.BaseCommand {
84
84
  const spaceId = process.env.OVERSKY_SESSION_SPACE_ID;
85
85
  if (scopeKey && !spaceId)
86
86
  this.error('This evidence read requires a bound Space.', { exit: 2 });
87
- const query = scopeKey && spaceId ? `?${new URLSearchParams({ [scopeKey]: spaceId })}` : '';
88
- const path = `/api/tasks/${encodeURIComponent(task.id)}/results/${encodeURIComponent(flags.result)}`;
89
87
  try {
90
- const exact = await (0, api_fetch_1.apiFetch)(`${path}${query}`);
88
+ const exact = await (0, task_extras_1.readExactTaskResult)(task.id, flags.result, scopeKey && spaceId ? { [scopeKey]: spaceId } : {});
91
89
  if (flags.json)
92
90
  return this.printJsonResult(exact);
93
91
  return this.log([
@@ -47,11 +47,9 @@ class TasksRetryReceipt extends base_command_1.BaseCommand {
47
47
  // turns whatever it picked into something the API can resolve — a UUID and
48
48
  // an OSK-2423 ref pass through untouched, a title is searched.
49
49
  const taskId = await this.resolveTaskReference(taskIdentity.id);
50
- const getTaskRetryReceipt = data_provider_1.dataService
51
- .getTaskRetryReceipt;
52
50
  let receipt;
53
51
  try {
54
- receipt = await getTaskRetryReceipt(taskId, flags['request-id']);
52
+ receipt = await data_provider_1.dataService.getTaskRetryReceipt(taskId, flags['request-id']);
55
53
  }
56
54
  catch (err) {
57
55
  this.handleApiError(err, { subject: `Task ${taskId} retry receipt` });
@@ -190,7 +190,8 @@ class WikiWrite extends base_command_1.BaseCommand {
190
190
  }),
191
191
  note: core_1.Flags.string({
192
192
  description: 'Why you are making the change. When the Space holds the write for approval it becomes a ' +
193
- 'suggestion on the page, and this is its first comment; otherwise it is not stored',
193
+ 'suggestion (on the page, or a proposal to create it), and this is its first comment; ' +
194
+ 'otherwise it is not stored',
194
195
  }),
195
196
  };
196
197
  async run() {
@@ -284,6 +285,9 @@ class WikiWrite extends base_command_1.BaseCommand {
284
285
  content,
285
286
  format,
286
287
  ...(flags.kind ? { kind: flags.kind } : {}),
288
+ // The first comment of the proposal when the Space holds the
289
+ // create for approval (OSK-33418); never stored on the page.
290
+ ...(flags.note ? { note: flags.note } : {}),
287
291
  // Never let the server rename an EXACTLY addressed path. Without
288
292
  // this it answers 201 having created `x-2` beside `x`, and the
289
293
  // write the user asked for silently did not happen.
@@ -324,7 +328,8 @@ class WikiWrite extends base_command_1.BaseCommand {
324
328
  // write policy (`202 pending_approval`): a journal entry or report create,
325
329
  // or an append to the one it created (`--append`, OSK-17995), in its Run's
326
330
  // approval bundle (OSK-17994); an edit of any other page's body as a
327
- // suggestion on the page (OSK-17997). Nothing was written yet.
331
+ // suggestion on the page (OSK-17997); a new page of any other kind as a
332
+ // proposal to create it (OSK-33418). Nothing was written yet.
328
333
  if (this.reportHeldSpaceWrite(page, { json: flags.json }))
329
334
  return;
330
335
  // Fallback for a server predating `conflict: 'fail'`, which answers 201