@skrr-ai/cli 0.1.214 → 0.1.216

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 (51) 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/pause.js +20 -2
  14. package/dist/commands/duties/trigger-status.js +6 -1
  15. package/dist/commands/duties/update.js +22 -7
  16. package/dist/commands/tasks/ask.d.ts +3 -2
  17. package/dist/commands/tasks/ask.js +4 -3
  18. package/dist/commands/tasks/chat/exchange.d.ts +3 -2
  19. package/dist/commands/tasks/chat/exchange.js +18 -6
  20. package/dist/commands/tasks/chat/index.d.ts +11 -0
  21. package/dist/commands/tasks/chat/index.js +27 -0
  22. package/dist/commands/tasks/chat/rotate.js +5 -2
  23. package/dist/commands/tasks/input/answer.d.ts +12 -0
  24. package/dist/commands/tasks/input/answer.js +59 -5
  25. package/dist/commands/tasks/operations/show.js +5 -6
  26. package/dist/commands/tasks/result/show.js +2 -4
  27. package/dist/commands/tasks/retry-receipt.js +1 -3
  28. package/dist/commands/tasks/show.d.ts +6 -1
  29. package/dist/commands/tasks/show.js +19 -5
  30. package/dist/generated/agent-guides.json +41 -41
  31. package/dist/lib/compasses.d.ts +5 -0
  32. package/dist/lib/compasses.js +6 -1
  33. package/dist/lib/duties.d.ts +27 -0
  34. package/dist/lib/duties.js +81 -14
  35. package/dist/lib/permission-rules.d.ts +18 -0
  36. package/dist/lib/permission-rules.js +62 -0
  37. package/dist/lib/task-asset-upload.d.ts +7 -0
  38. package/dist/lib/task-asset-upload.js +114 -44
  39. package/dist/lib/task-extras.d.ts +19 -0
  40. package/dist/lib/task-extras.js +13 -0
  41. package/dist/lib/task-operations.d.ts +16 -0
  42. package/dist/lib/task-operations.js +39 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.d.ts +16 -2
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +110 -15
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/runtime.d.ts +7 -2
  46. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.d.ts +16 -2
  47. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +179 -17
  48. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/runtime.d.ts +7 -2
  49. package/dist/node_modules/@skrr-ai/data-provider/index.js +12697 -12082
  50. package/oclif.manifest.json +224 -9
  51. package/package.json +5 -2
@@ -4,6 +4,10 @@ import { BaseCommand } from '../../../base-command';
4
4
  * acknowledged something, or the work speaks for itself. The server records it on the turn
5
5
  * (`declared_silent`), and the turn's marker still shows that the turn happened.
6
6
  *
7
+ * In a scheduled wake (an autonomous session: a heartbeat, check-in or watch) the same command
8
+ * declares that the wake needs no message. The server records it on the wake's Run, bound to the
9
+ * attempt it resolves from the session, and the scheduled executor reads it after the turn.
10
+ *
7
11
  * Only inside a daemon session, for that session's own running turn: the server proves the
8
12
  * turn from the session token, exactly as it does for a send.
9
13
  */
@@ -10,11 +10,15 @@ const message_intent_1 = require("../../../lib/message-intent");
10
10
  * acknowledged something, or the work speaks for itself. The server records it on the turn
11
11
  * (`declared_silent`), and the turn's marker still shows that the turn happened.
12
12
  *
13
+ * In a scheduled wake (an autonomous session: a heartbeat, check-in or watch) the same command
14
+ * declares that the wake needs no message. The server records it on the wake's Run, bound to the
15
+ * attempt it resolves from the session, and the scheduled executor reads it after the turn.
16
+ *
13
17
  * Only inside a daemon session, for that session's own running turn: the server proves the
14
18
  * turn from the session token, exactly as it does for a send.
15
19
  */
16
20
  class AgentMessageNoReply extends base_command_1.BaseCommand {
17
- static description = 'Declare that this interactive turn needs no message in Main Chat (recorded on the turn; Main Chat does not act on it yet). Only inside a daemon session, for its own running turn';
21
+ static description = 'Declare that this turn needs no message: in an interactive turn, none in Main Chat (recorded on the turn; Main Chat does not act on it yet); in a scheduled wake (heartbeat, check-in, watch), that the wake stays silent (recorded on its run, replacing the HEARTBEAT_SILENT word). Only inside a daemon session, for its own running turn';
18
22
  static examples = ['<%= config.bin %> agent message no-reply'];
19
23
  static flags = {
20
24
  json: core_1.Flags.boolean({
@@ -47,3 +47,15 @@ export declare function autoRecoveryLines(review: DutyRunRecoveryReview): string
47
47
  * sent. Nothing for a Run with no record, or an older server.
48
48
  */
49
49
  export declare function unprovenLine(review: DutyRunRecoveryReview): string | undefined;
50
+ /**
51
+ * The Run's stored status, and what it means while held (OSK-33272). A held Run's record stays `running` on purpose:
52
+ * nothing may finish it but its owner's close, and later Checks wait on it. `Status: running` beside
53
+ * `Executor: quiescent` read as a turn still working, so the line says it is held, and whether its turn has stopped.
54
+ */
55
+ export declare function statusText(review: DutyRunRecoveryReview): string;
56
+ /**
57
+ * Why the result is held, as its hold writer recorded it (OSK-33272), and what to do next. A reason or cause this CLI
58
+ * has no words for is printed as the code, marked. A Run stopped at its effect boundary says why on its own line
59
+ * (`unprovenLine`), so nothing here. An older server names no reason: say so, never fall silent.
60
+ */
61
+ export declare function heldBecauseLines(review: DutyRunRecoveryReview): string[];
@@ -5,6 +5,8 @@ exports.recoveryCode = recoveryCode;
5
5
  exports.closeLines = closeLines;
6
6
  exports.autoRecoveryLines = autoRecoveryLines;
7
7
  exports.unprovenLine = unprovenLine;
8
+ exports.statusText = statusText;
9
+ exports.heldBecauseLines = heldBecauseLines;
8
10
  const core_1 = require("@oclif/core");
9
11
  const data_provider_1 = require("@skrr-ai/data-provider");
10
12
  const base_command_1 = require("../../../base-command");
@@ -98,8 +100,10 @@ class AgentsAlwaysOnRecoveryReview extends base_command_1.BaseCommand {
98
100
  this.log(`Run: ${review.runId}`);
99
101
  if (review.source === 'unverified')
100
102
  this.log("Duty: not shown; this run's link to its Duty could not be verified");
101
- this.log(`Status: ${review.status}; generation: ${review.generation ?? 'unknown'}; attempt: ${review.attempt ?? 'unknown'}`);
103
+ this.log(`Status: ${statusText(review)}; generation: ${review.generation ?? 'unknown'}; attempt: ${review.attempt ?? 'unknown'}`);
102
104
  this.log(`Recovery: ${recoveryCode(review.hold, exports.RECOVERY_HOLD_CODES)}; stored result: ${review.result}`);
105
+ for (const line of heldBecauseLines(review))
106
+ this.log(line);
103
107
  this.log(`Executor: ${recoveryCode(review.executor, exports.RECOVERY_EXECUTOR_CODES)}; effects: ${review.effects}`);
104
108
  const basis = stopBasisLine(review);
105
109
  if (basis)
@@ -308,19 +312,65 @@ function unprovenLine(review) {
308
312
  ...workspace,
309
313
  ].join(' ');
310
314
  }
315
+ /**
316
+ * The Run's stored status, and what it means while held (OSK-33272). A held Run's record stays `running` on purpose:
317
+ * nothing may finish it but its owner's close, and later Checks wait on it. `Status: running` beside
318
+ * `Executor: quiescent` read as a turn still working, so the line says it is held, and whether its turn has stopped.
319
+ */
320
+ function statusText(review) {
321
+ if (review.hold !== 'review_required' || review.status !== 'running')
322
+ return review.status;
323
+ if (review.executor === 'quiescent')
324
+ return 'running (held for review; its turn has stopped)';
325
+ if (review.executor === 'stop_unconfirmed')
326
+ return 'running (held for review; its turn is not confirmed stopped)';
327
+ return 'running (held for review)';
328
+ }
329
+ /**
330
+ * Why the result is held, as its hold writer recorded it (OSK-33272), and what to do next. A reason or cause this CLI
331
+ * has no words for is printed as the code, marked. A Run stopped at its effect boundary says why on its own line
332
+ * (`unprovenLine`), so nothing here. An older server names no reason: say so, never fall silent.
333
+ */
334
+ function heldBecauseLines(review) {
335
+ if (review.hold !== 'review_required' || review.effectReceipts !== undefined)
336
+ return [];
337
+ const reason = isNonEmptyString(review.holdReason) ? review.holdReason : undefined;
338
+ if (!reason)
339
+ return ['Held because: not reported by this server.'];
340
+ const words = (0, data_provider_1.describeDutyResultHoldReason)(reason);
341
+ const lines = [
342
+ `Held because: ${words ? `${reason}. ${words}` : recoveryCode(reason, data_provider_1.DUTY_RESULT_HOLD_REASONS)}`,
343
+ ];
344
+ const cause = isNonEmptyString(review.holdCause) ? review.holdCause : undefined;
345
+ const remedy = cause ? (0, data_provider_1.describeRunFailureRemedy)(cause) : null;
346
+ if (cause) {
347
+ const causeWords = Object.hasOwn(data_provider_1.DUTY_RESULT_HOLD_CAUSE_SENTENCES, cause)
348
+ ? data_provider_1.DUTY_RESULT_HOLD_CAUSE_SENTENCES[cause]
349
+ : undefined;
350
+ lines.push(`Cause: ${causeWords ? `${cause}. ${causeWords}` : cause}`);
351
+ }
352
+ lines.push(`Next: ${remedy ? `${remedy.replace(/\.?$/, '.')} Then: ` : ''}${data_provider_1.DUTY_RESULT_HOLD_NEXT_STEP}`);
353
+ return lines;
354
+ }
311
355
  /** One line per held result: what a person needs to choose which one to open. */
312
356
  function reviewLine(review) {
313
357
  const stored = review.resultCapture === 'unsealable'
314
358
  ? `${review.result} (could not be sealed)`
315
359
  : review.result;
360
+ const reason = isNonEmptyString(review.holdReason)
361
+ ? `held because: ${recoveryCode(review.holdReason, data_provider_1.DUTY_RESULT_HOLD_REASONS)}${isNonEmptyString(review.holdCause) ? ` (${review.holdCause})` : ''}`
362
+ : '';
316
363
  return [
317
364
  review.runId,
318
365
  review.source === 'unverified' ? 'duty unverified' : `duty ${review.dutyId ?? 'unknown'}`,
319
366
  `recovery: ${recoveryCode(review.hold, exports.RECOVERY_HOLD_CODES)}`,
367
+ reason,
320
368
  `stored result: ${stored}`,
321
369
  `run status: ${review.status}`,
322
370
  `attempt: ${review.attempt ?? 'unknown'}`,
323
- ].join(' ');
371
+ ]
372
+ .filter(Boolean)
373
+ .join(' ');
324
374
  }
325
375
  const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
326
376
  function parseReviewPage(value) {
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class AgentsPermissionsList extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,42 @@
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 permission_rules_1 = require("../../../lib/permission-rules");
7
+ class AgentsPermissionsList extends base_command_1.BaseCommand {
8
+ static description = 'List the "Always allow" rules you granted this agent: what each covers, where it applies, where you granted it from, and how often it has run. Calls a rule covers run without asking you. Only your own rules are listed. Rules are granted on a permission card, never from the CLI.';
9
+ static examples = [
10
+ '<%= config.bin %> agents permissions list <agent-id>',
11
+ '<%= config.bin %> agents permissions list <agent-id> --json',
12
+ ];
13
+ static args = { agentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
14
+ static flags = { json: core_1.Flags.boolean({ description: 'Output JSON' }) };
15
+ async run() {
16
+ this.requireAuth();
17
+ const { args, flags } = await this.parse(AgentsPermissionsList);
18
+ let result;
19
+ try {
20
+ result = await data_provider_1.dataService.listAgentPermissionRules(args.agentId);
21
+ }
22
+ catch (err) {
23
+ this.handleApiError(err);
24
+ }
25
+ const rules = result.rules ?? [];
26
+ if (flags.json)
27
+ return this.log(this.agentJson(args.agentId, { rules }));
28
+ if (rules.length === 0) {
29
+ this.log(`Agent ${args.agentId}: no Always allow rules. It asks you before each call.`);
30
+ return;
31
+ }
32
+ this.log(`Agent ${args.agentId}: ${rules.length === 1 ? '1 Always allow rule' : `${rules.length} Always allow rules`}`);
33
+ for (const rule of rules) {
34
+ this.log('');
35
+ for (const line of (0, permission_rules_1.ruleLines)(rule))
36
+ this.log(line);
37
+ }
38
+ this.log('');
39
+ this.log(`Remove one: ${this.config.bin} agents permissions remove ${args.agentId} <rule-id>`);
40
+ }
41
+ }
42
+ exports.default = AgentsPermissionsList;
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class AgentsPermissionsRemove extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ agentId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
7
+ ruleId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,68 @@
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 prompt_1 = require("../../../lib/prompt");
7
+ class AgentsPermissionsRemove extends base_command_1.BaseCommand {
8
+ static description = 'Remove one of your "Always allow" rules for this agent, or all of them with --all. The next call a removed rule covered asks you again. This only takes permission away: rules are granted on a permission card, never from the CLI.';
9
+ static examples = [
10
+ '<%= config.bin %> agents permissions remove <agent-id> <rule-id>',
11
+ '<%= config.bin %> agents permissions remove <agent-id> --all',
12
+ '<%= config.bin %> agents permissions remove <agent-id> --all --yes',
13
+ ];
14
+ static args = {
15
+ agentId: core_1.Args.string({ required: true, ignoreStdin: true }),
16
+ ruleId: core_1.Args.string({
17
+ required: false,
18
+ ignoreStdin: true,
19
+ description: 'The rule to remove (from `agents permissions list`)',
20
+ }),
21
+ };
22
+ static flags = {
23
+ all: core_1.Flags.boolean({ description: 'Remove every rule you granted this agent: always ask' }),
24
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Skip the confirmation for --all' }),
25
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
26
+ };
27
+ async run() {
28
+ this.requireAuth();
29
+ const { args, flags } = await this.parse(AgentsPermissionsRemove);
30
+ const all = Boolean(flags.all);
31
+ if (Boolean(args.ruleId) === all) {
32
+ this.error('Name one rule to remove, or pass --all to remove every rule.', { exit: 2 });
33
+ }
34
+ let result;
35
+ if (all) {
36
+ const ok = await (0, prompt_1.confirmDestructive)(`Remove every Always allow rule you granted agent ${args.agentId}? It will ask you before each call again.`, flags.yes);
37
+ if (!ok) {
38
+ this.log('Nothing removed.');
39
+ return;
40
+ }
41
+ try {
42
+ result = await data_provider_1.dataService.revokeAllAgentPermissionRules(args.agentId);
43
+ }
44
+ catch (err) {
45
+ this.handleApiError(err);
46
+ }
47
+ }
48
+ else {
49
+ try {
50
+ result = await data_provider_1.dataService.revokeAgentPermissionRule(args.agentId, args.ruleId);
51
+ }
52
+ catch (err) {
53
+ this.handleApiError(err);
54
+ }
55
+ }
56
+ const revoked = result.revoked ?? 0;
57
+ if (flags.json)
58
+ return this.log(this.agentJson(args.agentId, { revoked }));
59
+ if (all) {
60
+ this.log(revoked === 0
61
+ ? `Agent ${args.agentId}: you had no Always allow rules. It asks you before each call.`
62
+ : `Agent ${args.agentId}: removed ${revoked === 1 ? '1 rule' : `${revoked} rules`}. It asks you before each call again.`);
63
+ return;
64
+ }
65
+ this.log(`Agent ${args.agentId}: rule ${args.ruleId} removed. The next call it covered asks you again.`);
66
+ }
67
+ }
68
+ exports.default = AgentsPermissionsRemove;
@@ -71,6 +71,8 @@ class DmWork extends base_command_1.BaseCommand {
71
71
  const handling = (0, data_provider_1.readCoordinatorSignalReason)(task.lastReturn?.reason);
72
72
  if (task.lastReturn && handling) {
73
73
  this.log(` Last update (${task.lastReturn.kind.replaceAll('_', ' ')}): ${(0, data_provider_1.describeCoordinatorHandling)(handling)}`);
74
+ if (handling.outcome === 'held' && task.lastReturn.heldText)
75
+ this.log(` Held message: ${task.lastReturn.heldText}`);
74
76
  }
75
77
  }
76
78
  this.log(`${page.items.length} shown; ${page.total} authorized Task(s)${page.hasMore ? `; next cursor ${page.nextCursor}` : ''}.`);
@@ -41,7 +41,13 @@ class DutiesActionProposal extends base_command_1.BaseCommand {
41
41
  this.log(`Action Bundle: ${proposal?.status ? (0, action_proposals_1.proposalStatusLabel)(proposal) : 'unknown'}`);
42
42
  this.log(`Operation: ${String(execution?.operationId || 'unavailable')}`);
43
43
  const receipt = execution?.receipt;
44
- this.log(`Receipt: ${String(receipt?.state || 'unknown')}`);
44
+ // A void bundle's receipt still reads `accepted`, because its status is still held (OSK-33446). Say
45
+ // beside it that the plan will not run, and that its expiry and reminders no longer apply.
46
+ const isVoid = proposal ? (0, action_proposals_1.proposalVoidedBy)(proposal) !== undefined : false;
47
+ this.log(`Receipt: ${String(receipt?.state || 'unknown')}${isVoid ? ' (void: will not run)' : ''}`);
48
+ if (isVoid) {
49
+ this.log("Expiry and reminders: not applicable; the Duty's next check can propose the work again.");
50
+ }
45
51
  }
46
52
  }
47
53
  }
@@ -1,4 +1,13 @@
1
1
  import { BaseCommand } from '../../base-command';
2
+ /**
3
+ * Why a held bundle can never be approved or run, or `undefined` when it is not void. The server keeps
4
+ * `status` at `proposed` or `approved` and adds `voidedBy`, so this, not `status`, says whether a decision
5
+ * or a run is still possible (OSK-33415). Only a held bundle can be void: a finished one keeps its status.
6
+ */
7
+ export declare function proposalVoidedBy(proposal: {
8
+ status?: unknown;
9
+ voidedBy?: unknown;
10
+ }): string | undefined;
2
11
  /**
3
12
  * An approved bundle waiting out the owner's quiet hours reads as held, with
4
13
  * the instant it sends, never as a bare `approved` that looks stuck.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proposalVoidedBy = proposalVoidedBy;
3
4
  exports.proposalStatusLabel = proposalStatusLabel;
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
@@ -11,14 +12,26 @@ const VOIDED_BY_LABEL = {
11
12
  duty_not_active: 'void: Duty not active',
12
13
  duty_version_changed: 'void: Duty changed since',
13
14
  };
15
+ /**
16
+ * Why a held bundle can never be approved or run, or `undefined` when it is not void. The server keeps
17
+ * `status` at `proposed` or `approved` and adds `voidedBy`, so this, not `status`, says whether a decision
18
+ * or a run is still possible (OSK-33415). Only a held bundle can be void: a finished one keeps its status.
19
+ */
20
+ function proposalVoidedBy(proposal) {
21
+ if (typeof proposal.voidedBy !== 'string' || !proposal.voidedBy)
22
+ return undefined;
23
+ return proposal.status === 'proposed' || proposal.status === 'approved'
24
+ ? proposal.voidedBy
25
+ : undefined;
26
+ }
14
27
  /**
15
28
  * An approved bundle waiting out the owner's quiet hours reads as held, with
16
29
  * the instant it sends, never as a bare `approved` that looks stuck.
17
30
  */
18
31
  function proposalStatusLabel(proposal) {
19
- if (proposal.voidedBy && (proposal.status === 'proposed' || proposal.status === 'approved')) {
20
- return VOIDED_BY_LABEL[proposal.voidedBy] || `void: ${proposal.voidedBy}`;
21
- }
32
+ const voidedBy = proposalVoidedBy(proposal);
33
+ if (voidedBy)
34
+ return VOIDED_BY_LABEL[voidedBy] || `void: ${voidedBy}`;
22
35
  const hold = proposal.executionReceipt?.hold;
23
36
  if (proposal.status === 'approved' && hold?.until) {
24
37
  return `held until ${hold.untilLabel || hold.until}`;
@@ -66,15 +79,20 @@ class DutiesActionProposals extends base_command_1.BaseCommand {
66
79
  for (const peer of proposal.overlaps || [])
67
80
  this.log(`${proposal.id} overlaps ${peer.proposalId} (${peer.agentId}) ${peer.repoFullName}: ${peer.paths.join(', ')}`);
68
81
  }
69
- (0, format_1.renderTable)(response.data.map((proposal) => ({
70
- id: proposal.id,
71
- actions: String(proposal.actionSnapshots?.length || 1),
72
- digest: proposal.snapshotDigest || 'legacy',
73
- status: proposalStatusLabel(proposal),
74
- attempt: `${proposal.attempt || 0}/${proposal.maxAttempts || 3}`,
75
- expires: proposal.expiresAt || '—',
76
- notices: (0, data_provider_1.describeProposalNotices)(proposal.notices),
77
- })), [
82
+ (0, format_1.renderTable)(response.data.map((proposal) => {
83
+ // A void bundle will never run, so its expiry and its approver reminders no longer apply
84
+ // (OSK-33446): showing them would read as a decision still waiting on someone.
85
+ const isVoid = proposalVoidedBy(proposal) !== undefined;
86
+ return {
87
+ id: proposal.id,
88
+ actions: String(proposal.actionSnapshots?.length || 1),
89
+ digest: proposal.snapshotDigest || 'legacy',
90
+ status: proposalStatusLabel(proposal),
91
+ attempt: `${proposal.attempt || 0}/${proposal.maxAttempts || 3}`,
92
+ expires: isVoid ? '—' : proposal.expiresAt || '—',
93
+ notices: isVoid ? '—' : (0, data_provider_1.describeProposalNotices)(proposal.notices),
94
+ };
95
+ }), [
78
96
  { key: 'id', header: 'PROPOSAL', verbatim: true },
79
97
  { key: 'actions', header: 'ACTIONS' },
80
98
  { key: 'digest', header: 'DIGEST', maxWidth: 64, verbatim: true },
@@ -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
  }
@@ -2,8 +2,9 @@ import { type AskTaskHumanInputBody } from '@skrr-ai/data-provider';
2
2
  import { BaseCommand } from '../../base-command';
3
3
  /**
4
4
  * `--expires`: an ISO date-time, or a length of time from now (`30m`, `4h`, `2d`).
5
- * The server keeps the workspace's longest wait and refuses a later deadline
6
- * with the limit in its words; this only turns the flag into a time.
5
+ * The server keeps the workspace's longest wait, when it set one, and refuses a
6
+ * later deadline with the limit in its words; this only turns the flag into a
7
+ * time. Without the flag a question waits until it is answered (OSK-33441).
7
8
  */
8
9
  export declare function parseAskExpiry(value: string | undefined, now?: number): string | undefined;
9
10
  /**
@@ -11,8 +11,9 @@ const RELATIVE_EXPIRY_RE = /^(\d+)\s*(m|h|d)$/i;
11
11
  const UNIT_MS = { m: 60_000, h: 3_600_000, d: 86_400_000 };
12
12
  /**
13
13
  * `--expires`: an ISO date-time, or a length of time from now (`30m`, `4h`, `2d`).
14
- * The server keeps the workspace's longest wait and refuses a later deadline
15
- * with the limit in its words; this only turns the flag into a time.
14
+ * The server keeps the workspace's longest wait, when it set one, and refuses a
15
+ * later deadline with the limit in its words; this only turns the flag into a
16
+ * time. Without the flag a question waits until it is answered (OSK-33441).
16
17
  */
17
18
  function parseAskExpiry(value, now = Date.now()) {
18
19
  if (value === undefined)
@@ -133,7 +134,7 @@ class TasksAsk extends base_command_1.BaseCommand {
133
134
  header: core_1.Flags.string({ description: 'A short label for the question (80 characters)' }),
134
135
  'no-free-text': core_1.Flags.boolean({ description: 'Only the options may be chosen, not words' }),
135
136
  expires: core_1.Flags.string({
136
- description: "When it stops waiting: an ISO date-time or 30m, 4h, 2d (default and maximum: the workspace's policy)",
137
+ description: 'When it stops waiting: an ISO date-time or 30m, 4h, 2d (default: it waits until answered, unless the workspace set a longest wait, which is also the maximum)',
137
138
  }),
138
139
  key: core_1.Flags.string({
139
140
  description: 'Your key for this question: the same key returns the same question, and names only one',
@@ -7,8 +7,8 @@ import { BaseCommand } from '../../../base-command';
7
7
  *
8
8
  * --close-input stop collecting more user messages into this exchange; the
9
9
  * agent responds to what it already has.
10
- * --interrupt stop the CURRENT generation; the exchange survives and can
11
- * take a follow-up.
10
+ * --interrupt inject --text into the RUNNING response; the server refuses an
11
+ * interrupt that carries no text.
12
12
  * --cancel terminate the exchange.
13
13
  */
14
14
  export default class TasksChatExchange extends BaseCommand {
@@ -23,6 +23,7 @@ export default class TasksChatExchange extends BaseCommand {
23
23
  'close-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
24
  interrupt: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
25
  cancel: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
+ text: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
27
  reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
27
28
  'command-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
29
  };
@@ -12,15 +12,16 @@ const task_extras_1 = require("../../../lib/task-extras");
12
12
  *
13
13
  * --close-input stop collecting more user messages into this exchange; the
14
14
  * agent responds to what it already has.
15
- * --interrupt stop the CURRENT generation; the exchange survives and can
16
- * take a follow-up.
15
+ * --interrupt inject --text into the RUNNING response; the server refuses an
16
+ * interrupt that carries no text.
17
17
  * --cancel terminate the exchange.
18
18
  */
19
19
  class TasksChatExchange extends base_command_1.BaseCommand {
20
20
  static description = 'Close input on, interrupt, or cancel a task chat exchange';
21
21
  static examples = [
22
22
  '<%= config.bin %> tasks chat exchange task_abc ex_123 --close-input',
23
- '<%= config.bin %> tasks chat exchange task_abc ex_123 --interrupt --reason "wrong file"',
23
+ '<%= config.bin %> tasks chat exchange task_abc ex_123 --interrupt --text "stop, wrong file; use src/a.ts"',
24
+ '<%= config.bin %> tasks chat exchange task_abc ex_123 --cancel --reason "wrong file"',
24
25
  '<%= config.bin %> tasks chat exchange task_abc ex_123 --cancel',
25
26
  ];
26
27
  static args = {
@@ -34,14 +35,21 @@ class TasksChatExchange extends base_command_1.BaseCommand {
34
35
  exclusive: ['cancel', 'interrupt'],
35
36
  }),
36
37
  interrupt: core_1.Flags.boolean({
37
- description: 'Stop the current generation; the exchange survives',
38
+ description: 'Inject --text into the running response',
38
39
  exclusive: ['cancel', 'close-input'],
39
40
  }),
40
41
  cancel: core_1.Flags.boolean({
41
42
  description: 'Terminate the exchange',
42
43
  exclusive: ['interrupt', 'close-input'],
43
44
  }),
44
- reason: core_1.Flags.string({ description: 'Why — recorded on the exchange' }),
45
+ text: core_1.Flags.string({
46
+ description: 'What to tell the running response (required with --interrupt)',
47
+ dependsOn: ['interrupt'],
48
+ }),
49
+ reason: core_1.Flags.string({
50
+ description: 'Why the exchange is cancelled (--cancel only; the other two record none)',
51
+ dependsOn: ['cancel'],
52
+ }),
45
53
  'command-id': core_1.Flags.string({
46
54
  description: 'Actor-scoped command id for idempotency (generated when omitted)',
47
55
  }),
@@ -52,6 +60,9 @@ class TasksChatExchange extends base_command_1.BaseCommand {
52
60
  if (!flags['close-input'] && !flags.interrupt && !flags.cancel) {
53
61
  this.error('Pass --close-input, --interrupt, or --cancel.');
54
62
  }
63
+ if (flags.interrupt && !flags.text?.trim()) {
64
+ this.error('--interrupt needs --text: the server injects it into the running response.');
65
+ }
55
66
  const taskId = await this.resolveTaskReference(args.id);
56
67
  // Every mutation on this surface requires an actor-scoped command id; the
57
68
  // server refuses to generate one, because a server-minted id cannot make a
@@ -59,7 +70,8 @@ class TasksChatExchange extends base_command_1.BaseCommand {
59
70
  const commandId = flags['command-id'] ?? `cli-${(0, node_crypto_1.randomUUID)()}`;
60
71
  const body = {
61
72
  commandId,
62
- ...(flags.reason ? { reason: flags.reason } : {}),
73
+ ...(flags.interrupt ? { text: flags.text } : {}),
74
+ ...(flags.cancel && flags.reason ? { reason: flags.reason } : {}),
63
75
  };
64
76
  let result;
65
77
  try {