@skrr-ai/cli 0.1.202 → 0.1.204

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 (63) hide show
  1. package/dist/base-command.js +1 -1
  2. package/dist/commands/agent/message/context.d.ts +3 -0
  3. package/dist/commands/agent/message/context.js +33 -1
  4. package/dist/commands/agent/message/no-reply.d.ts +17 -0
  5. package/dist/commands/agent/message/no-reply.js +54 -0
  6. package/dist/commands/agent/message/retract.d.ts +24 -0
  7. package/dist/commands/agent/message/retract.js +167 -0
  8. package/dist/commands/agent/message/send.d.ts +47 -3
  9. package/dist/commands/agent/message/send.js +135 -4
  10. package/dist/commands/agents/chat.d.ts +12 -0
  11. package/dist/commands/agents/chat.js +258 -25
  12. package/dist/commands/agents/manager/status.d.ts +9 -0
  13. package/dist/commands/agents/manager/status.js +84 -0
  14. package/dist/commands/agents/queue/clear.d.ts +13 -0
  15. package/dist/commands/agents/queue/clear.js +31 -0
  16. package/dist/commands/agents/queue/list.d.ts +10 -0
  17. package/dist/commands/agents/queue/list.js +34 -0
  18. package/dist/commands/agents/queue/move.d.ts +16 -0
  19. package/dist/commands/agents/queue/move.js +33 -0
  20. package/dist/commands/agents/queue/pause.d.ts +7 -0
  21. package/dist/commands/agents/queue/pause.js +24 -0
  22. package/dist/commands/agents/queue/resume.d.ts +7 -0
  23. package/dist/commands/agents/queue/resume.js +24 -0
  24. package/dist/commands/agents/queue/steer.d.ts +14 -0
  25. package/dist/commands/agents/queue/steer.js +38 -0
  26. package/dist/commands/agents/queue/withdraw.d.ts +10 -0
  27. package/dist/commands/agents/queue/withdraw.js +27 -0
  28. package/dist/commands/agents/supervision.d.ts +1 -0
  29. package/dist/commands/agents/supervision.js +28 -9
  30. package/dist/commands/duties/advance-next.d.ts +17 -0
  31. package/dist/commands/duties/advance-next.js +122 -0
  32. package/dist/commands/duties/pack/plan.js +45 -0
  33. package/dist/commands/duties/preflight.d.ts +1 -0
  34. package/dist/commands/duties/preflight.js +18 -2
  35. package/dist/commands/spaces/auto-executor/preview.js +6 -2
  36. package/dist/commands/spaces/charter/revise.d.ts +16 -0
  37. package/dist/commands/spaces/charter/revise.js +84 -0
  38. package/dist/commands/spaces/skills/propose.d.ts +1 -0
  39. package/dist/commands/spaces/skills/propose.js +5 -0
  40. package/dist/commands/tasks/create.js +16 -1
  41. package/dist/commands/tasks/result/show.js +6 -3
  42. package/dist/commands/tasks/start.d.ts +3 -0
  43. package/dist/commands/tasks/start.js +12 -1
  44. package/dist/commands/triggers/capabilities.js +14 -4
  45. package/dist/generated/agent-guides.json +258 -24
  46. package/dist/lib/agent-chat-queue-command.d.ts +29 -0
  47. package/dist/lib/agent-chat-queue-command.js +75 -0
  48. package/dist/lib/agent-chat-queue.d.ts +77 -0
  49. package/dist/lib/agent-chat-queue.js +245 -0
  50. package/dist/lib/agent-chat-start.d.ts +101 -0
  51. package/dist/lib/agent-chat-start.js +151 -6
  52. package/dist/lib/duties.d.ts +5 -1
  53. package/dist/lib/duties.js +16 -5
  54. package/dist/lib/duty-product.js +6 -0
  55. package/dist/lib/input-queue.d.ts +18 -0
  56. package/dist/lib/input-queue.js +59 -0
  57. package/dist/lib/message-intent.d.ts +26 -3
  58. package/dist/lib/message-intent.js +7 -1
  59. package/dist/lib/task-runtime-headers.d.ts +5 -0
  60. package/dist/lib/task-runtime-headers.js +28 -8
  61. package/dist/node_modules/@skrr-ai/data-provider/index.js +10464 -10221
  62. package/oclif.manifest.json +1956 -765
  63. package/package.json +6 -3
@@ -7,6 +7,19 @@ const data_provider_1 = require("@skrr-ai/data-provider");
7
7
  const base_command_1 = require("../../../base-command");
8
8
  const prompt_1 = require("../../../lib/prompt");
9
9
  const duties_1 = require("../../../lib/duties");
10
+ function formatVerificationDuration(ms) {
11
+ if (ms > 0) {
12
+ if (ms % 86_400_000 === 0)
13
+ return `${ms / 86_400_000}d`;
14
+ if (ms % 3_600_000 === 0)
15
+ return `${ms / 3_600_000}h`;
16
+ if (ms % 60_000 === 0)
17
+ return `${ms / 60_000}m`;
18
+ if (ms % 1000 === 0)
19
+ return `${ms / 1000}s`;
20
+ }
21
+ return `${ms}ms`;
22
+ }
10
23
  function formatPlanPreview(duty) {
11
24
  if (!duty)
12
25
  return [];
@@ -19,6 +32,38 @@ function formatPlanPreview(duty) {
19
32
  lines.push(`Outcome ${duty.target.outcome}`);
20
33
  if (duty.cadence?.mode)
21
34
  lines.push(`Checks ${(0, duties_1.cadenceLabel)(duty)}`);
35
+ const policy = duty.evaluationPolicy;
36
+ if (policy) {
37
+ const verification = [];
38
+ if (policy.delayMs != null) {
39
+ verification.push(`Initial delay ${formatVerificationDuration(policy.delayMs)}`);
40
+ }
41
+ if (policy.settleDelayMs != null) {
42
+ verification.push(`settling delay ${formatVerificationDuration(policy.settleDelayMs)}`);
43
+ }
44
+ if (policy.maxAttempts != null) {
45
+ verification.push(`up to ${policy.maxAttempts} ${policy.maxAttempts === 1 ? 'attempt' : 'attempts'}`);
46
+ }
47
+ if (verification.length)
48
+ lines.push(`Verification ${verification.join(' · ')}`);
49
+ const evidence = [];
50
+ if (policy.windowMs != null) {
51
+ evidence.push(policy.windowMs === 0
52
+ ? 'No fixed observation window'
53
+ : `Observation window ${formatVerificationDuration(policy.windowMs)}`);
54
+ }
55
+ const freshness = [...new Set([...(policy.criteria || []), ...(policy.guardrails || [])]
56
+ .map((criterion) => criterion.minimumFreshnessMs)
57
+ .filter((value) => typeof value === 'number'))].map(formatVerificationDuration);
58
+ if (freshness.length === 1) {
59
+ evidence.push(`collected within ${freshness[0]} of verification`);
60
+ }
61
+ else if (freshness.length > 1) {
62
+ evidence.push(`collection age limits vary by criterion (${freshness.join(', ')})`);
63
+ }
64
+ if (evidence.length)
65
+ lines.push(`Evidence ${evidence.join(' · ')}`);
66
+ }
22
67
  if (duty.delivery?.mode) {
23
68
  const mode = duty.delivery.mode.replaceAll('_', ' ');
24
69
  const destinations = [...new Set((duty.reports || [])
@@ -34,6 +34,7 @@ type PreflightGate = DutyPreflightReport['gates'][number];
34
34
  export declare function nextRunsLines(report: {
35
35
  verdict?: string;
36
36
  nextRuns?: string[];
37
+ nextRunsSource?: DutyPreflightReport['nextRunsSource'];
37
38
  }, projectedActivation?: boolean): string[];
38
39
  /**
39
40
  * The first line of a preflight. `Ready to run` is a statement about activation (no blocking gate),
@@ -37,13 +37,29 @@ const preflight_copy_1 = require("../../lib/preflight-copy");
37
37
  * cadence WOULD do, so they are labelled that way instead of reading as a promise.
38
38
  */
39
39
  function nextRunsLines(report, projectedActivation = false) {
40
+ if (report.nextRunsSource === 'unconfirmed')
41
+ return ['', 'Next scheduled check is unconfirmed'];
42
+ if (report.nextRunsSource === 'not_scheduled')
43
+ return ['', 'No recurring check scheduled'];
44
+ if (report.nextRunsSource === 'scheduler' && report.nextRuns?.length) {
45
+ const [next, ...projected] = report.nextRuns;
46
+ return [
47
+ '',
48
+ `Next scheduled check: ${next}`,
49
+ ...(projected.length
50
+ ? ['Projected checks after that:', ...projected.map((at) => ` ${at}`)]
51
+ : []),
52
+ ];
53
+ }
40
54
  if (!report.nextRuns?.length)
41
55
  return ['', 'Next runs: none scheduled'];
42
56
  const header = projectedActivation
43
57
  ? 'Projected runs if activated:'
44
58
  : report.verdict === 'blocked'
45
59
  ? 'Next runs (the cadence\u2019s times; none will fire while the run is blocked above):'
46
- : 'Next runs:';
60
+ : report.nextRunsSource === 'cadence_projection'
61
+ ? 'Projected checks from cadence:'
62
+ : 'Next runs:';
47
63
  return ['', header, ...report.nextRuns.map((run) => ` ${run}`)];
48
64
  }
49
65
  /**
@@ -288,7 +304,7 @@ class DutiesPreflight extends base_command_1.BaseCommand {
288
304
  static flags = {
289
305
  json: core_1.Flags.boolean({ description: 'Output the complete preflight report as JSON' }),
290
306
  verbose: core_1.Flags.boolean({ description: 'Include diagnostic gate codes' }),
291
- next: core_1.Flags.integer({ description: 'Number of upcoming runs to project (1–10)' }),
307
+ next: core_1.Flags.integer({ description: 'Number of upcoming check times to show (1–10)' }),
292
308
  'from-json': core_1.Flags.string({
293
309
  description: 'Unsaved Duty create body file, or - for stdin',
294
310
  }),
@@ -6,6 +6,7 @@ exports.refillLines = refillLines;
6
6
  const core_1 = require("@oclif/core");
7
7
  const data_provider_1 = require("@skrr-ai/data-provider");
8
8
  const base_command_1 = require("../../../base-command");
9
+ const api_fetch_1 = require("../../../lib/api-fetch");
9
10
  const space_output_1 = require("../../../lib/space-output");
10
11
  const PRINCIPAL_LINE_RE = /_/g;
11
12
  /**
@@ -53,10 +54,13 @@ class SpacesAutoExecutorPreview extends base_command_1.BaseCommand {
53
54
  // ignored, and raw JSON printed unconditionally. There was no readable
54
55
  // rendering of a preview anywhere in the CLI.
55
56
  const { args, flags } = await this.parse(SpacesAutoExecutorPreview);
56
- const spaceRef = await this.resolveEntityRef('space', args.id);
57
+ const orchestration = process.env.OVERSKY_SPACE_ORCHESTRATION_WORK === '1';
58
+ const spaceRef = orchestration ? args.id : await this.resolveEntityRef('space', args.id);
57
59
  let result;
58
60
  try {
59
- result = (await data_provider_1.dataService.previewSpaceAutoExecutor(spaceRef));
61
+ result = orchestration
62
+ ? await (0, api_fetch_1.apiFetch)(`/api/spaces/${encodeURIComponent(spaceRef)}/auto-executor/preview?runtime=space-orchestration`, { credential: this.resolvedCredential })
63
+ : await data_provider_1.dataService.previewSpaceAutoExecutor(spaceRef);
60
64
  }
61
65
  catch (err) {
62
66
  this.handleApiError(err);
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class SpacesCharterRevise extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ space: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ 'page-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ section: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ lead: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ append: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ note: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const wiki_1 = require("../../../lib/wiki");
7
+ class SpacesCharterRevise extends base_command_1.BaseCommand {
8
+ static description = 'Submit a bounded change to the existing Charter through the Space write policy';
9
+ static args = {
10
+ space: core_1.Args.string({ description: 'Space ID', required: true, ignoreStdin: true }),
11
+ };
12
+ static flags = {
13
+ 'page-id': core_1.Flags.string({ required: true, description: 'Page ID of the Charter you read' }),
14
+ section: core_1.Flags.string({ description: 'Replace the body under an exact Markdown heading', exclusive: ['lead', 'append'] }),
15
+ lead: core_1.Flags.boolean({ description: 'Replace the lead', exclusive: ['section', 'append'] }),
16
+ append: core_1.Flags.boolean({ description: 'Append to the end', exclusive: ['section', 'lead'] }),
17
+ note: core_1.Flags.string({ required: true, description: 'Reason and evidence for the change' }),
18
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
19
+ };
20
+ async run() {
21
+ this.requireAuth();
22
+ const { args, flags } = await this.parse(SpacesCharterRevise);
23
+ if (!(flags.section || flags.lead || flags.append)) {
24
+ this.error('Choose --section, --lead, or --append.', { exit: 2 });
25
+ }
26
+ let content = await (0, wiki_1.readContentInput)({ stdin: true });
27
+ if (!content.trim())
28
+ this.error('Supply the replacement or appended Markdown on stdin.', { exit: 2 });
29
+ const charter = await data_provider_1.dataService.getSpaceWikiCharter(args.space)
30
+ .catch((error) => this.handleApiError(error));
31
+ if (charter.charter?.pageId !== flags['page-id']) {
32
+ this.failWithCliError({
33
+ code: 'WIKI_CHARTER_CHANGED',
34
+ message: 'Read the current Charter before revising it.',
35
+ status: 409,
36
+ exit: 2,
37
+ retryable: false,
38
+ });
39
+ }
40
+ const section = flags.section?.trim();
41
+ if (section) {
42
+ const selected = (0, data_provider_1.parsePageSectionSelector)(section);
43
+ if (!selected.ok || !selected.anchor.level || !charter.charter.content?.split(/\r?\n/).includes(section)) {
44
+ this.failWithCliError({
45
+ code: 'WIKI_CHARTER_SECTION_HEADING_REQUIRED',
46
+ message: 'Use the exact Markdown heading line from the current Charter, including its # markers.',
47
+ status: 409,
48
+ exit: 2,
49
+ retryable: false,
50
+ });
51
+ }
52
+ // The existing Wiki section writer replaces the heading and its body.
53
+ if (content.trimStart().split(/\r?\n/, 1)[0] !== section) {
54
+ content = `${section}\n\n${content}`;
55
+ }
56
+ }
57
+ try {
58
+ const result = await data_provider_1.dataService.writeSpaceWikiPageContent({
59
+ spaceId: args.space,
60
+ pageId: flags['page-id'],
61
+ data: {
62
+ content,
63
+ expectedKind: 'charter',
64
+ mode: flags.append ? 'append' : 'replace',
65
+ section,
66
+ lead: flags.lead || undefined,
67
+ note: flags.note,
68
+ },
69
+ });
70
+ if (flags.json) {
71
+ this.printJsonResult(result);
72
+ }
73
+ else {
74
+ this.log('status' in result && result.status === 'pending_approval'
75
+ ? 'Charter revision submitted for approval.'
76
+ : 'Charter revised.');
77
+ }
78
+ }
79
+ catch (error) {
80
+ this.handleApiError(error);
81
+ }
82
+ }
83
+ }
84
+ exports.default = SpacesCharterRevise;
@@ -23,6 +23,7 @@ export default class SpacesSkillsPropose extends BaseCommand {
23
23
  applies: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
24
  except: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
25
  key: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
+ 'task-result': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
27
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
28
  };
28
29
  run(): Promise<void>;
@@ -43,6 +43,10 @@ class SpacesSkillsPropose extends base_command_1.BaseCommand {
43
43
  key: core_1.Flags.string({
44
44
  description: 'Idempotency key: a retry with the same key returns the first proposal',
45
45
  }),
46
+ 'task-result': core_1.Flags.string({
47
+ description: 'Exact Task Result ID from this Space’s Notebook (repeatable)',
48
+ multiple: true,
49
+ }),
46
50
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
47
51
  };
48
52
  async run() {
@@ -65,6 +69,7 @@ class SpacesSkillsPropose extends base_command_1.BaseCommand {
65
69
  ...(flags.summary ? { summary: flags.summary } : {}),
66
70
  ...(flags.applies?.length ? { applicability: flags.applies } : {}),
67
71
  ...(flags.except?.length ? { exclusions: flags.except } : {}),
72
+ ...(flags['task-result']?.length ? { notebookTaskResultIds: flags['task-result'] } : {}),
68
73
  idempotencyKey: flags.key || `space-skill:${(0, node_crypto_1.randomUUID)()}`,
69
74
  });
70
75
  }
@@ -15,7 +15,9 @@ const tasks_1 = require("../../lib/tasks");
15
15
  const task_instruction_offer_1 = require("../../lib/task-instruction-offer");
16
16
  const list_workspace_1 = require("../../lib/list-workspace");
17
17
  const web_url_1 = require("../../lib/web-url");
18
+ const write_outcome_1 = require("../../lib/write-outcome");
18
19
  const TASK_CREATE_MAY_HAVE_COMMITTED_RE = /fetch failed|socket hang up|timed? ?out/i;
20
+ const TASK_CREATE_PRE_WRITE_REFUSALS = { SPACE_GOAL_WORK_CAPACITY_FULL: 409 };
19
21
  /**
20
22
  * Whether the estimate we asked for survived the write. (S3 dogfood finding)
21
23
  *
@@ -705,7 +707,20 @@ class TasksCreate extends base_command_1.BaseCommand {
705
707
  */
706
708
  failTaskCreate(err, payload, goalFromFlag) {
707
709
  const goalId = payload.goalId;
708
- if ((0, base_command_1.apiRefusal)(err).code === tasks_1.TASK_GOAL_NOT_FOUND && typeof goalId === 'string' && goalId) {
710
+ const refusal = (0, base_command_1.apiRefusal)(err);
711
+ const request = (0, write_outcome_1.requestOfError)(err);
712
+ if (request.method?.toUpperCase() === 'POST' &&
713
+ request.path === '/api/tasks' &&
714
+ refusal.body?.phase === 'before_write' &&
715
+ (0, write_outcome_1.classifyRequestOutcome)({
716
+ request,
717
+ status: err?.status,
718
+ body: refusal.body,
719
+ refusals: TASK_CREATE_PRE_WRITE_REFUSALS,
720
+ }).kind === 'rejected') {
721
+ this.setJsonOperation({ writeState: 'not_attempted' });
722
+ }
723
+ if (refusal.code === tasks_1.TASK_GOAL_NOT_FOUND && typeof goalId === 'string' && goalId) {
709
724
  this.failWithCliError({
710
725
  message: (0, tasks_1.describeTaskGoalNotFound)({
711
726
  goalId,
@@ -73,9 +73,12 @@ class TasksResultShow extends base_command_1.BaseCommand {
73
73
  const { args, flags } = await this.parse(TasksResultShow);
74
74
  const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
75
75
  if (flags.result) {
76
- const reviewSpaceId = process.env.OVERSKY_SPACE_REVIEW_WORK === '1'
77
- ? process.env.OVERSKY_SESSION_SPACE_ID : undefined;
78
- const query = reviewSpaceId ? `?${new URLSearchParams({ reviewSpaceId })}` : '';
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;
78
+ const spaceId = process.env.OVERSKY_SESSION_SPACE_ID;
79
+ if (scopeKey && !spaceId)
80
+ this.error('This evidence read requires a bound Space.', { exit: 2 });
81
+ const query = scopeKey && spaceId ? `?${new URLSearchParams({ [scopeKey]: spaceId })}` : '';
79
82
  const path = `/api/tasks/${encodeURIComponent(task.id)}/results/${encodeURIComponent(flags.result)}`;
80
83
  try {
81
84
  const exact = await (0, api_fetch_1.apiFetch)(`${path}${query}`);
@@ -14,6 +14,9 @@ export default class TasksStart extends BaseCommand {
14
14
  capability: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
15
  branch: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'orchestration-version': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'orchestration-assign-agent': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'orchestration-failed-run': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
20
  };
18
21
  run(): Promise<void>;
19
22
  }
@@ -55,10 +55,20 @@ class TasksStart extends base_command_1.BaseCommand {
55
55
  'request-id': core_1.Flags.string({
56
56
  description: 'Stable idempotency key for this logical start. Reuse it after a lost response; inspect it with tasks start-receipt.',
57
57
  }),
58
+ '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'] }),
58
61
  };
59
62
  async run() {
60
63
  this.requireAuth();
61
64
  const { args, flags } = await this.parse(TasksStart);
65
+ const orchestrationVersion = flags['orchestration-version'];
66
+ const assignAgentId = flags['orchestration-assign-agent'];
67
+ 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)) {
70
+ this.error('A scoped orchestration start requires the Duty runtime, a Task version and a request id.', { exit: 2 });
71
+ }
62
72
  let taskIdentity;
63
73
  try {
64
74
  taskIdentity = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.id, flagTask: flags.task });
@@ -153,7 +163,7 @@ class TasksStart extends base_command_1.BaseCommand {
153
163
  try {
154
164
  // Check capability before any mutation. Skill and capability overrides
155
165
  // still use the existing endpoint that can honor them.
156
- if (!flags.skill && !flags.capability?.length) {
166
+ if (orchestrationVersion === undefined && !flags.skill && !flags.capability?.length) {
157
167
  const chat = await data_provider_1.dataService.getTaskChat(taskId).catch((error) => {
158
168
  if ([404, 405].includes((0, http_error_1.httpStatusOf)(error) ?? 0))
159
169
  return null;
@@ -192,6 +202,7 @@ class TasksStart extends base_command_1.BaseCommand {
192
202
  result = await data_provider_1.dataService.startTask(taskId, {
193
203
  ...(flags.skill ? { skillId: flags.skill } : {}),
194
204
  ...(flags.capability?.length ? { requestedCapabilities: flags.capability } : {}),
205
+ ...(orchestrationVersion !== undefined ? { orchestration: { expectedVersion: orchestrationVersion, assignAgentId, failedRunId } } : {}),
195
206
  requestId,
196
207
  });
197
208
  }
@@ -45,10 +45,11 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
45
45
  // modes only an internal producer may mint, which create refuses, so listing it here offered
46
46
  // choices that fail on submit (OSK-22489). A server that predates the field only has the long
47
47
  // list, and a person on it may be offered one refused choice.
48
- const authorable = Array.isArray(capabilities.authorableExecutorModes)
49
- ? capabilities.authorableExecutorModes
50
- : capabilities.allowedExecutorModes;
51
- this.log(`Modes: ${Array.isArray(authorable) ? authorable.join(', ') || '-' : '-'}`);
48
+ const { allowedExecutorModes, authorableExecutorModes } = capabilities;
49
+ const hasAuthoringPolicy = Array.isArray(authorableExecutorModes);
50
+ const authorable = hasAuthoringPolicy ? authorableExecutorModes : allowedExecutorModes;
51
+ const modesLabel = hasAuthoringPolicy ? 'Modes you can create' : 'Modes';
52
+ this.log(`${modesLabel}: ${Array.isArray(authorable) ? authorable.join(', ') || 'none' : '-'}`);
52
53
  // The mode names say nothing about side effects; describe the ones an author usually picks
53
54
  // between (OSK-21766).
54
55
  if (Array.isArray(authorable)) {
@@ -58,6 +59,15 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
58
59
  this.log(` ${String(mode)}: ${effect}`);
59
60
  }
60
61
  }
62
+ if (Array.isArray(authorableExecutorModes) && Array.isArray(allowedExecutorModes)) {
63
+ const managed = allowedExecutorModes.filter((mode) => !authorableExecutorModes.includes(mode));
64
+ if (managed.length > 0) {
65
+ this.log(`Platform-managed modes: ${managed.join(', ')}`);
66
+ if (args.scope === 'duty_watcher') {
67
+ this.log('Manage the schedule on the Duty. To check now, run skrr duties check-now <duty-id>.');
68
+ }
69
+ }
70
+ }
61
71
  const vars = Array.isArray(capabilities.templateVariables)
62
72
  ? capabilities.templateVariables.map((v) => typeof v === 'object' && v !== null ? String(v.name) : String(v))
63
73
  : capabilities.templateVariableNames;