@skrr-ai/cli 0.1.201 → 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 (67) 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/create.js +22 -3
  33. package/dist/commands/duties/pack/plan.js +45 -0
  34. package/dist/commands/duties/preflight.d.ts +1 -0
  35. package/dist/commands/duties/preflight.js +18 -2
  36. package/dist/commands/spaces/auto-executor/preview.js +6 -2
  37. package/dist/commands/spaces/charter/revise.d.ts +16 -0
  38. package/dist/commands/spaces/charter/revise.js +84 -0
  39. package/dist/commands/spaces/skills/propose.d.ts +1 -0
  40. package/dist/commands/spaces/skills/propose.js +5 -0
  41. package/dist/commands/tasks/create.js +16 -1
  42. package/dist/commands/tasks/result/show.d.ts +1 -0
  43. package/dist/commands/tasks/result/show.js +22 -1
  44. package/dist/commands/tasks/start.d.ts +3 -0
  45. package/dist/commands/tasks/start.js +12 -1
  46. package/dist/commands/triggers/capabilities.js +24 -5
  47. package/dist/commands/triggers/create.d.ts +1 -1
  48. package/dist/commands/triggers/create.js +15 -6
  49. package/dist/generated/agent-guides.json +258 -24
  50. package/dist/lib/agent-chat-queue-command.d.ts +29 -0
  51. package/dist/lib/agent-chat-queue-command.js +75 -0
  52. package/dist/lib/agent-chat-queue.d.ts +77 -0
  53. package/dist/lib/agent-chat-queue.js +245 -0
  54. package/dist/lib/agent-chat-start.d.ts +101 -0
  55. package/dist/lib/agent-chat-start.js +151 -6
  56. package/dist/lib/duties.d.ts +5 -1
  57. package/dist/lib/duties.js +16 -5
  58. package/dist/lib/duty-product.js +6 -0
  59. package/dist/lib/input-queue.d.ts +18 -0
  60. package/dist/lib/input-queue.js +59 -0
  61. package/dist/lib/message-intent.d.ts +26 -3
  62. package/dist/lib/message-intent.js +7 -1
  63. package/dist/lib/task-runtime-headers.d.ts +7 -0
  64. package/dist/lib/task-runtime-headers.js +46 -9
  65. package/dist/node_modules/@skrr-ai/data-provider/index.js +10464 -10221
  66. package/oclif.manifest.json +1288 -87
  67. package/package.json +6 -3
@@ -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 duties_1 = require("../../../lib/duties");
7
+ const duty_history_source_1 = require("../../../lib/duty-history-source");
8
+ const web_url_1 = require("../../../lib/web-url");
9
+ class AgentsManagerStatus extends base_command_1.BaseCommand {
10
+ static description = 'Show your Agent Manager, staffing review Duty, and latest check';
11
+ static examples = [
12
+ '<%= config.bin %> agents manager status',
13
+ '<%= config.bin %> agents manager status --workspace <workspace-id> --json',
14
+ ];
15
+ static flags = {
16
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
17
+ };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { flags } = await this.parse(AgentsManagerStatus);
21
+ try {
22
+ const { workspaceId, agent: manager, duty: staffingDuty } = await data_provider_1.dataService.getAgentManagerStatus();
23
+ const agent = manager && (0, web_url_1.withAgentUrl)(this.cliConfig.baseURL, manager);
24
+ const detail = staffingDuty ? await duties_1.dutyApi.get(staffingDuty.id) : null;
25
+ const duty = staffingDuty && (0, web_url_1.withDutyUrl)(this.cliConfig.baseURL, {
26
+ ...staffingDuty,
27
+ status: detail?.duty?.status ?? staffingDuty.status,
28
+ });
29
+ const historyAvailable = detail ? (0, duty_history_source_1.hasVerifiedDutyHistorySource)(detail) : null;
30
+ const operatingTrigger = historyAvailable ? detail?.operatingState?.trigger : null;
31
+ const trigger = operatingTrigger
32
+ ? { status: operatingTrigger.status, nextWake: operatingTrigger.nextWake ?? null }
33
+ : null;
34
+ const check = historyAvailable ? detail?.latestCheck : null;
35
+ const latestCheck = check
36
+ ? {
37
+ id: check.id,
38
+ status: check.status,
39
+ completedAt: check.completedAt ?? null,
40
+ url: duty?.url
41
+ ? `${duty.url}?view=activity&checkId=${encodeURIComponent(check.id)}`
42
+ : null,
43
+ }
44
+ : null;
45
+ if (flags.json) {
46
+ this.log(JSON.stringify({ workspaceId, agent, duty, trigger, historyAvailable, latestCheck }, null, 2));
47
+ return;
48
+ }
49
+ if (!agent) {
50
+ this.log(workspaceId
51
+ ? 'You do not have an Agent Manager in this workspace.'
52
+ : 'Your Personal Workspace is unavailable.');
53
+ return;
54
+ }
55
+ this.log(`Agent Manager: ${agent.name} (${agent.id})`);
56
+ if (agent.url)
57
+ this.log(agent.url);
58
+ this.log(`Always-On: ${agent.alwaysOn ? 'enabled' : 'Standby'}`);
59
+ if (!duty) {
60
+ this.log('Staffing review: no Duty configured');
61
+ return;
62
+ }
63
+ this.log(`Staffing review: ${duty.status}`);
64
+ if (duty.url)
65
+ this.log(duty.url);
66
+ if (trigger)
67
+ this.log(`Trigger: ${trigger.status}`);
68
+ if (trigger?.nextWake?.at)
69
+ this.log(`Next check: ${trigger.nextWake.at}`);
70
+ if (latestCheck) {
71
+ this.log(`Latest check: ${latestCheck.status}${latestCheck.completedAt ? ` · ${latestCheck.completedAt}` : ''}`);
72
+ if (latestCheck.url)
73
+ this.log(latestCheck.url);
74
+ }
75
+ else {
76
+ this.log(historyAvailable ? 'Latest check: none recorded' : 'Check history is unavailable.');
77
+ }
78
+ }
79
+ catch (err) {
80
+ this.handleApiError(err);
81
+ }
82
+ }
83
+ }
84
+ exports.default = AgentsManagerStatus;
@@ -0,0 +1,13 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /**
3
+ * `skrr agents queue clear --conversation <id> --yes` — withdraw every waiting message. A message
4
+ * already being sent is not withdrawn.
5
+ */
6
+ export default class AgentsQueueClear extends AgentChatQueueCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
5
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
6
+ /**
7
+ * `skrr agents queue clear --conversation <id> --yes` — withdraw every waiting message. A message
8
+ * already being sent is not withdrawn.
9
+ */
10
+ class AgentsQueueClear extends agent_chat_queue_command_1.AgentChatQueueCommand {
11
+ static description = 'Withdraw every waiting message from a conversation queue';
12
+ static examples = [
13
+ '<%= config.bin %> agents queue clear --conversation <conversation-id> --yes',
14
+ ];
15
+ static flags = {
16
+ yes: core_1.Flags.boolean({ description: 'Confirm: nothing withdrawn is sent', required: true }),
17
+ };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { flags } = await this.parse(AgentsQueueClear);
21
+ let snapshot;
22
+ try {
23
+ snapshot = await (0, agent_chat_queue_1.clearQueue)(flags.conversation);
24
+ }
25
+ catch (err) {
26
+ this.failQueue(err, flags.conversation);
27
+ }
28
+ this.printQueue(snapshot, flags.json, 'Withdrew every waiting message. Nothing was sent.');
29
+ }
30
+ }
31
+ exports.default = AgentsQueueClear;
@@ -0,0 +1,10 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /**
3
+ * `skrr agents queue list --conversation <id>` — the messages queued on a conversation while its
4
+ * agent works (G1), in the order they will be sent, with any pause and why a card is held.
5
+ */
6
+ export default class AgentsQueueList extends AgentChatQueueCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
4
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
5
+ const list_output_1 = require("../../../lib/list-output");
6
+ /**
7
+ * `skrr agents queue list --conversation <id>` — the messages queued on a conversation while its
8
+ * agent works (G1), in the order they will be sent, with any pause and why a card is held.
9
+ */
10
+ class AgentsQueueList extends agent_chat_queue_command_1.AgentChatQueueCommand {
11
+ static description = 'List the messages queued on a conversation while its agent works';
12
+ static examples = [
13
+ '<%= config.bin %> agents queue list --conversation <conversation-id>',
14
+ '<%= config.bin %> agents queue list --conversation <conversation-id> --json',
15
+ ];
16
+ async run() {
17
+ this.requireAuth();
18
+ const { flags } = await this.parse(AgentsQueueList);
19
+ let read;
20
+ try {
21
+ read = await (0, agent_chat_queue_1.readQueue)(flags.conversation);
22
+ }
23
+ catch (err) {
24
+ this.failQueue(err, flags.conversation);
25
+ }
26
+ if (flags.json) {
27
+ // The list envelope (`data` is the cards in order), with the snapshot's own fields beside it.
28
+ this.printJsonResult((0, list_output_1.listResult)(read, 'cards'));
29
+ return;
30
+ }
31
+ this.printQueue(read, false);
32
+ }
33
+ }
34
+ exports.default = AgentsQueueList;
@@ -0,0 +1,16 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /**
3
+ * `skrr agents queue move <card> --to <position> --conversation <id>` — change the order the
4
+ * queued messages are sent in. A message being sent stays first.
5
+ */
6
+ export default class AgentsQueueMove extends AgentChatQueueCommand {
7
+ static description: string;
8
+ static examples: string[];
9
+ static args: {
10
+ card: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
12
+ static flags: {
13
+ to: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
5
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
6
+ /**
7
+ * `skrr agents queue move <card> --to <position> --conversation <id>` — change the order the
8
+ * queued messages are sent in. A message being sent stays first.
9
+ */
10
+ class AgentsQueueMove extends agent_chat_queue_command_1.AgentChatQueueCommand {
11
+ static description = 'Move a queued message to another position';
12
+ static examples = [
13
+ '<%= config.bin %> agents queue move "#3" --to 1 --conversation <conversation-id>',
14
+ ];
15
+ static args = agent_chat_queue_command_1.AgentChatQueueCommand.cardArg;
16
+ static flags = {
17
+ to: core_1.Flags.integer({ description: 'New position, 1 is sent next', required: true, min: 1 }),
18
+ };
19
+ async run() {
20
+ this.requireAuth();
21
+ const { args, flags } = await this.parse(AgentsQueueMove);
22
+ const { card, read } = await this.findCard(flags.conversation, args.card);
23
+ let snapshot;
24
+ try {
25
+ snapshot = await (0, agent_chat_queue_1.moveCard)(flags.conversation, card.cardId, flags.to - 1, read.version);
26
+ }
27
+ catch (err) {
28
+ this.failQueue(err, flags.conversation);
29
+ }
30
+ this.printQueue(snapshot, flags.json);
31
+ }
32
+ }
33
+ exports.default = AgentsQueueMove;
@@ -0,0 +1,7 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /** `skrr agents queue pause --conversation <id>`. */
3
+ export default class AgentsQueuePause extends AgentChatQueueCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ run(): Promise<void>;
7
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
4
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
5
+ /** `skrr agents queue pause --conversation <id>`. */
6
+ class AgentsQueuePause extends agent_chat_queue_command_1.AgentChatQueueCommand {
7
+ static description = 'Pause a conversation queue: nothing more is sent until it is resumed';
8
+ static examples = [
9
+ '<%= config.bin %> agents queue pause --conversation <conversation-id>',
10
+ ];
11
+ async run() {
12
+ this.requireAuth();
13
+ const { flags } = await this.parse(AgentsQueuePause);
14
+ let snapshot;
15
+ try {
16
+ snapshot = await (0, agent_chat_queue_1.setQueuePaused)(flags.conversation, true);
17
+ }
18
+ catch (err) {
19
+ this.failQueue(err, flags.conversation);
20
+ }
21
+ this.printQueue(snapshot, flags.json, 'Paused. Nothing more is sent until you resume.');
22
+ }
23
+ }
24
+ exports.default = AgentsQueuePause;
@@ -0,0 +1,7 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /** `skrr agents queue resume --conversation <id>`. */
3
+ export default class AgentsQueueResume extends AgentChatQueueCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ run(): Promise<void>;
7
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
4
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
5
+ /** `skrr agents queue resume --conversation <id>`. */
6
+ class AgentsQueueResume extends agent_chat_queue_command_1.AgentChatQueueCommand {
7
+ static description = 'Resume a paused conversation queue, retrying a held message at its head';
8
+ static examples = [
9
+ '<%= config.bin %> agents queue resume --conversation <conversation-id>',
10
+ ];
11
+ async run() {
12
+ this.requireAuth();
13
+ const { flags } = await this.parse(AgentsQueueResume);
14
+ let snapshot;
15
+ try {
16
+ snapshot = await (0, agent_chat_queue_1.setQueuePaused)(flags.conversation, false);
17
+ }
18
+ catch (err) {
19
+ this.failQueue(err, flags.conversation);
20
+ }
21
+ this.printQueue(snapshot, flags.json, 'Resumed. The next message is sent when the running turn ends.');
22
+ }
23
+ }
24
+ exports.default = AgentsQueueResume;
@@ -0,0 +1,14 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /**
3
+ * `skrr agents queue steer <card> --conversation <id>` — send a queued message into the running
4
+ * turn instead of after it (G3). A command, or a message with files, never steers; a turn that
5
+ * takes no input keeps it queued; with no turn running it is sent now.
6
+ */
7
+ export default class AgentsQueueSteer extends AgentChatQueueCommand {
8
+ static description: string;
9
+ static examples: string[];
10
+ static args: {
11
+ card: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
4
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
5
+ /**
6
+ * `skrr agents queue steer <card> --conversation <id>` — send a queued message into the running
7
+ * turn instead of after it (G3). A command, or a message with files, never steers; a turn that
8
+ * takes no input keeps it queued; with no turn running it is sent now.
9
+ */
10
+ class AgentsQueueSteer extends agent_chat_queue_command_1.AgentChatQueueCommand {
11
+ static description = 'Send a queued message into the running turn instead of after it';
12
+ static examples = [
13
+ '<%= config.bin %> agents queue steer "#1" --conversation <conversation-id>',
14
+ ];
15
+ static args = agent_chat_queue_command_1.AgentChatQueueCommand.cardArg;
16
+ async run() {
17
+ this.requireAuth();
18
+ const { args, flags } = await this.parse(AgentsQueueSteer);
19
+ const { card, read } = await this.findCard(flags.conversation, args.card);
20
+ let steered;
21
+ try {
22
+ steered = await (0, agent_chat_queue_1.steerCard)(flags.conversation, card.cardId, read.version);
23
+ }
24
+ catch (err) {
25
+ this.failQueue(err, flags.conversation);
26
+ }
27
+ if (flags.json) {
28
+ this.printJsonResult({
29
+ outcome: steered.outcome,
30
+ cardId: card.cardId,
31
+ snapshot: steered.snapshot,
32
+ });
33
+ return;
34
+ }
35
+ this.printQueue({ ...steered.snapshot, turn: null }, false, (0, agent_chat_queue_1.steerOutcomeSentence)(steered.outcome));
36
+ }
37
+ }
38
+ exports.default = AgentsQueueSteer;
@@ -0,0 +1,10 @@
1
+ import { AgentChatQueueCommand } from '../../../lib/agent-chat-queue-command';
2
+ /** `skrr agents queue withdraw <card> --conversation <id>` — take a message out before it is sent. */
3
+ export default class AgentsQueueWithdraw extends AgentChatQueueCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ card: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agent_chat_queue_command_1 = require("../../../lib/agent-chat-queue-command");
4
+ const agent_chat_queue_1 = require("../../../lib/agent-chat-queue");
5
+ /** `skrr agents queue withdraw <card> --conversation <id>` — take a message out before it is sent. */
6
+ class AgentsQueueWithdraw extends agent_chat_queue_command_1.AgentChatQueueCommand {
7
+ static description = 'Take a queued message out of the queue before it is sent';
8
+ static examples = [
9
+ '<%= config.bin %> agents queue withdraw "#2" --conversation <conversation-id>',
10
+ '<%= config.bin %> agents queue withdraw card_3f9a1c --conversation <conversation-id>',
11
+ ];
12
+ static args = agent_chat_queue_command_1.AgentChatQueueCommand.cardArg;
13
+ async run() {
14
+ this.requireAuth();
15
+ const { args, flags } = await this.parse(AgentsQueueWithdraw);
16
+ const { card } = await this.findCard(flags.conversation, args.card);
17
+ let snapshot;
18
+ try {
19
+ snapshot = await (0, agent_chat_queue_1.withdrawCard)(flags.conversation, card.cardId);
20
+ }
21
+ catch (err) {
22
+ this.failQueue(err, flags.conversation);
23
+ }
24
+ this.printQueue(snapshot, flags.json, `Withdrew ${card.cardId}. Nothing was sent.`);
25
+ }
26
+ }
27
+ exports.default = AgentsQueueWithdraw;
@@ -21,6 +21,7 @@ export default class AgentSupervision extends BaseCommand {
21
21
  reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
22
  'recheck-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
23
  };
24
+ private printScope;
24
25
  private printStatus;
25
26
  private printCheck;
26
27
  private printChats;
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const base_command_1 = require("../../base-command");
5
5
  const api_fetch_1 = require("../../lib/api-fetch");
6
+ const web_url_1 = require("../../lib/web-url");
6
7
  const chat_supervision_1 = require("../../lib/chat-supervision");
8
+ const scopeDescription = 'Follow-up covers this Agent’s Main Chat and its Agent Chat Threads.';
7
9
  const chatStates = {
8
10
  observing: 'Awaiting a fresh check',
9
11
  waiting: 'Waiting',
@@ -14,6 +16,7 @@ const chatStates = {
14
16
  settled: 'Checked',
15
17
  };
16
18
  const chatReasons = {
19
+ interruption_not_automatically_resumable: 'The last execution failed and could not be resumed automatically.',
17
20
  no_execution_to_follow: 'No work has started in this chat yet.',
18
21
  execution_completed: 'The chat’s last execution completed.',
19
22
  person_stopped: 'You stopped this work. It will stay stopped.',
@@ -37,7 +40,7 @@ const chatReasons = {
37
40
  waiting_for_runtime: 'The chat is waiting for its runtime.',
38
41
  };
39
42
  class AgentSupervision extends base_command_1.BaseCommand {
40
- static description = 'Manage this Agent’s chat follow-through, inspect current state, or schedule a condition check.';
43
+ static description = `Manage this Agent’s chat follow-through, inspect current state, or schedule a condition check. ${scopeDescription}`;
41
44
  static args = {
42
45
  id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
43
46
  action: core_1.Args.string({
@@ -99,6 +102,11 @@ class AgentSupervision extends base_command_1.BaseCommand {
99
102
  reason: core_1.Flags.string({ description: 'Why this chat needs this condition check' }),
100
103
  'recheck-id': core_1.Flags.string({ description: 'Exact current recheck.id to cancel' }),
101
104
  };
105
+ printScope(agentId) {
106
+ this.log(scopeDescription);
107
+ this.log('Starting agents chat without a chat target opens a standalone conversation.');
108
+ this.log(`To continue in Main Chat, run ${this.config.bin} dm show ${agentId} --json and pass its agentChat.activeConversationId as --conversation <activeConversationId>.`);
109
+ }
102
110
  printStatus(view) {
103
111
  const { configuration, operational } = view;
104
112
  const readiness = operational.recoveryReadiness ??
@@ -107,17 +115,18 @@ class AgentSupervision extends base_command_1.BaseCommand {
107
115
  const mode = configuration.mode === 'shadow' ? 'monitoring only' : 'automatic recovery';
108
116
  this.log(`Chat follow-up is ${configuration.enabled ? 'on' : 'off'}.`);
109
117
  this.log(`Configuration revision ${configuration.revision}.`);
118
+ this.printScope(view.agentId);
110
119
  if (operational.backgroundPaused)
111
120
  this.log('Turn on Always-On from the Agent profile for chat checks to run.');
121
+ if (operational.recoveryReadinessReason === 'platform_recovery_unavailable')
122
+ this.log('Automatic recovery is currently disabled on this platform.');
123
+ else if (fallsBack)
124
+ this.log(`Automatic recovery is ${readiness}.`);
112
125
  if (configuration.enabled) {
113
126
  this.log(`Saved mode is ${mode}.`);
114
- if (fallsBack)
115
- this.log(`Automatic recovery is ${readiness}.`);
116
127
  return;
117
128
  }
118
129
  this.log(`Turning it on will use ${fallsBack ? 'monitoring only' : mode}.`);
119
- if (fallsBack)
120
- this.log(`Automatic recovery is ${readiness}.`);
121
130
  this.log('Enable follow-up with the current revision and a fresh request ID.');
122
131
  this.log(` ${this.config.bin} agents supervision ${view.agentId} enable --revision ${configuration.revision} --request-id <new-id>`);
123
132
  }
@@ -136,9 +145,11 @@ class AgentSupervision extends base_command_1.BaseCommand {
136
145
  ? 'A previous check is preventing a new chat check.'
137
146
  : 'No chat check was started. Read supervision status before trying again.');
138
147
  }
139
- printChats(page) {
140
- if (!page.items.length)
148
+ printChats(page, agentId) {
149
+ if (!page.items.length) {
141
150
  this.log('No followed chats are listed yet.');
151
+ this.printScope(agentId);
152
+ }
142
153
  for (const chat of page.items) {
143
154
  const title = chat.title?.replace(/\s+/g, ' ').trim() ||
144
155
  (chat.chatRef.kind === 'agent_main' ? 'Main chat' : 'Thread');
@@ -147,11 +158,19 @@ class AgentSupervision extends base_command_1.BaseCommand {
147
158
  if (page.nextCursor)
148
159
  this.log(`More chats are available. Continue with --cursor ${page.nextCursor}`);
149
160
  }
150
- printExplanation({ chat }) {
161
+ printExplanation({ chat, executionReview }) {
151
162
  const title = chat.chatRef.kind === 'agent_main' ? 'Main chat' : 'Thread';
152
163
  this.log(`${title} · ${chatStates[chat.state] ?? 'Status unconfirmed'}`);
153
164
  if (chat.reason)
154
165
  this.log(chatReasons[chat.reason] ?? 'Use --json to see the recorded reason.');
166
+ if (executionReview) {
167
+ const url = (0, web_url_1.webUrl)(this.cliConfig.baseURL, {
168
+ kind: 'conversation',
169
+ conversationId: executionReview.conversationId,
170
+ });
171
+ if (url)
172
+ this.log(`Review the execution in chat: ${url}`);
173
+ }
155
174
  if (chat.lastCheckedAt)
156
175
  this.log(`Last checked ${chat.lastCheckedAt}`);
157
176
  if (chat.nextCheckAt)
@@ -195,7 +214,7 @@ class AgentSupervision extends base_command_1.BaseCommand {
195
214
  else if (args.action === 'chats') {
196
215
  const page = await (0, api_fetch_1.apiFetch)((0, chat_supervision_1.chatSupervisionPath)(args.id, `/chats${flags.cursor ? `?cursor=${encodeURIComponent(flags.cursor)}` : ''}`));
197
216
  if (interactive)
198
- return this.printChats(page);
217
+ return this.printChats(page, args.id);
199
218
  receipt = page;
200
219
  }
201
220
  else {
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class DutiesAdvanceNext extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ at: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ confirm: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ fresh: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ 'request-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ cancel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const node_crypto_1 = require("node:crypto");
4
+ const core_1 = require("@oclif/core");
5
+ const base_command_1 = require("../../base-command");
6
+ const duties_1 = require("../../lib/duties");
7
+ const web_url_1 = require("../../lib/web-url");
8
+ class DutiesAdvanceNext extends base_command_1.BaseCommand {
9
+ static description = 'Move one scheduled Duty check earlier and keep the regular cadence';
10
+ static examples = [
11
+ '<%= config.bin %> duties advance-next <duty-id> --at 2026-12-01T04:30:00Z',
12
+ '<%= config.bin %> duties advance-next <duty-id> --at 2026-12-01T04:30:00Z --fresh --confirm',
13
+ '<%= config.bin %> duties advance-next <duty-id> --cancel <advance-id>',
14
+ ];
15
+ static args = {
16
+ id: core_1.Args.string({ description: 'Duty ID', required: true, ignoreStdin: true }),
17
+ };
18
+ static flags = {
19
+ at: core_1.Flags.string({ description: 'Earlier time in ISO 8601 with a timezone' }),
20
+ confirm: core_1.Flags.boolean({ description: 'Schedule the earlier check after checking the current slot' }),
21
+ fresh: core_1.Flags.boolean({ description: 'Request a refresh of declared Agent observations for this Check' }),
22
+ 'request-id': core_1.Flags.string({ description: 'UUID to reuse when retrying a confirmed request' }),
23
+ cancel: core_1.Flags.string({ description: 'Cancel a pending advance by its ID' }),
24
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
25
+ };
26
+ async run() {
27
+ this.requireAuth();
28
+ const { args: { id }, flags } = await this.parse(DutiesAdvanceNext);
29
+ if (flags.cancel && (flags.at || flags.confirm || flags.fresh || flags['request-id'])) {
30
+ this.error('Use --cancel by itself.');
31
+ }
32
+ if (((flags.confirm || flags.fresh) && !flags.at) ||
33
+ (flags['request-id'] && !flags.confirm)) {
34
+ this.error('Provide --at with --confirm or --fresh. Use --request-id with --confirm.');
35
+ }
36
+ let result;
37
+ try {
38
+ if (flags.cancel) {
39
+ result = await duties_1.dutyApi.cancelNextCheckAdvance(id, flags.cancel);
40
+ }
41
+ else if (flags['request-id'] && flags.at) {
42
+ const existing = await duties_1.dutyApi.nextCheckAdvance(id);
43
+ if (existing.current?.id !== flags['request-id']) {
44
+ this.error('This request is no longer current. Preview the schedule to start a new advance.');
45
+ }
46
+ if (Date.parse(existing.current.at) !== Date.parse(flags.at) ||
47
+ Boolean(existing.current.verificationVersion) !== Boolean(flags.fresh)) {
48
+ this.error('This request ID already names another change.');
49
+ }
50
+ result = existing;
51
+ }
52
+ else {
53
+ result = await duties_1.dutyApi.nextCheckAdvance(id, flags.at);
54
+ }
55
+ if (result.proposal && flags.fresh && !result.allowsFresh) {
56
+ this.error('Enable a declared Agent observation before requesting fresh evidence.');
57
+ }
58
+ if (flags.confirm && result.proposal) {
59
+ const { at, originalAt, scheduleVersion, previousAdvance } = result.proposal;
60
+ const accepted = await duties_1.dutyApi.advanceNextCheck(id, {
61
+ id: flags['request-id'] || (0, node_crypto_1.randomUUID)(),
62
+ at,
63
+ originalAt,
64
+ scheduleVersion,
65
+ previousAdvance,
66
+ dutyVersion: result.dutyVersion,
67
+ fresh: flags.fresh,
68
+ });
69
+ result = { ...accepted, allowance: result.allowance };
70
+ }
71
+ }
72
+ catch (error) {
73
+ this.handleApiError(error);
74
+ }
75
+ const url = (0, web_url_1.dutyUrlFrom)(this.cliConfig.baseURL, { id });
76
+ if (flags.json) {
77
+ this.log(JSON.stringify({ ...result, url }, null, 2));
78
+ return;
79
+ }
80
+ if (result.proposal) {
81
+ this.log(`Earlier check ${result.proposal.at}`);
82
+ this.log(`Original slot ${result.proposal.originalAt}`);
83
+ this.log(`Following regular check ${result.proposal.nextRegularAt}`);
84
+ this.log(flags.fresh
85
+ ? 'Evidence Fresh declared Agent observations'
86
+ : 'Evidence Use the Duty’s configured evidence');
87
+ }
88
+ if (result.current) {
89
+ const { status, id: advanceId, at, originalAt, occurrenceId, checkId, reason } = result.current;
90
+ this.log(`Advance ${status} (${advanceId})`);
91
+ this.log(`Earlier check ${at}`);
92
+ this.log(`Original slot ${originalAt}`);
93
+ if (result.current.verificationVersion)
94
+ this.log('Evidence Fresh declared Agent observations');
95
+ if (occurrenceId)
96
+ this.log(`Occurrence ${occurrenceId}`);
97
+ if (checkId && url) {
98
+ const receipt = new URL(url);
99
+ receipt.searchParams.set('view', 'activity');
100
+ receipt.searchParams.set('checkId', checkId);
101
+ this.log(`Check receipt ${receipt.toString()}`);
102
+ }
103
+ if (result.current.handoff === 'coalesced' && !checkId) {
104
+ this.log('The wake is recorded for a Duty Check.');
105
+ }
106
+ if (result.current.handoff === 'check_unconfirmed') {
107
+ this.log('The scheduler has a terminal result. A Duty Check receipt is unavailable.');
108
+ }
109
+ if (reason)
110
+ this.log(`Reason ${reason}`);
111
+ }
112
+ else if (!result.proposal) {
113
+ this.log('There is no earlier check scheduled.');
114
+ }
115
+ if (result.allowance?.runsToday != null && result.allowance.maxRunsPerDay != null) {
116
+ this.log(`Agent Runs used today ${result.allowance.runsToday}/${result.allowance.maxRunsPerDay}`);
117
+ }
118
+ if (url)
119
+ this.log(url);
120
+ }
121
+ }
122
+ exports.default = DutiesAdvanceNext;