@skrr-ai/cli 0.1.199 → 0.1.201

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 (55) hide show
  1. package/dist/commands/agents/always-on/recovery-close.d.ts +3 -4
  2. package/dist/commands/agents/always-on/recovery-close.js +5 -5
  3. package/dist/commands/agents/always-on/recovery-review.d.ts +1 -1
  4. package/dist/commands/agents/always-on/recovery-review.js +4 -3
  5. package/dist/commands/agents/create.d.ts +4 -2
  6. package/dist/commands/agents/create.js +29 -4
  7. package/dist/commands/duties/check-now.d.ts +1 -0
  8. package/dist/commands/duties/check-now.js +17 -1
  9. package/dist/commands/duties/create.js +74 -7
  10. package/dist/commands/duties/observations.d.ts +1 -0
  11. package/dist/commands/duties/observations.js +12 -3
  12. package/dist/commands/duties/operating-review.js +34 -2
  13. package/dist/commands/duties/pack/plan.d.ts +1 -0
  14. package/dist/commands/duties/pack/plan.js +30 -0
  15. package/dist/commands/duties/plan.d.ts +1 -0
  16. package/dist/commands/duties/plan.js +24 -0
  17. package/dist/commands/duties/preflight.d.ts +3 -3
  18. package/dist/commands/duties/preflight.js +36 -12
  19. package/dist/commands/duties/receipt.d.ts +1 -0
  20. package/dist/commands/duties/receipt.js +35 -11
  21. package/dist/commands/duties/roster.js +29 -6
  22. package/dist/commands/duties/status.js +19 -11
  23. package/dist/commands/duties/update.js +1 -1
  24. package/dist/commands/goals/create.js +1 -1
  25. package/dist/commands/goals/key-results/create.js +1 -1
  26. package/dist/commands/machines/computer-adoption.js +1 -1
  27. package/dist/commands/machines/dedicated/audit.js +1 -1
  28. package/dist/commands/machines/dedicated/catalog.js +1 -1
  29. package/dist/commands/machines/dedicated/current.js +1 -1
  30. package/dist/commands/machines/dedicated/git-status.js +1 -1
  31. package/dist/commands/machines/dedicated/health-check.js +1 -1
  32. package/dist/commands/machines/dedicated/logs.js +1 -1
  33. package/dist/commands/machines/dedicated/price-book.js +1 -1
  34. package/dist/commands/machines/dedicated/sign-in-status.js +1 -1
  35. package/dist/commands/machines/dedicated/stat.js +1 -1
  36. package/dist/commands/machines/services/ls.js +1 -1
  37. package/dist/commands/machines/shared.js +1 -1
  38. package/dist/commands/machines/shares.js +1 -1
  39. package/dist/commands/triggers/fire-detail.js +7 -0
  40. package/dist/generated/agent-guides.json +36 -36
  41. package/dist/lib/daemon-setup.js +1 -1
  42. package/dist/lib/duties.d.ts +7 -5
  43. package/dist/lib/duties.js +32 -19
  44. package/dist/lib/duty-loop-status.d.ts +2 -0
  45. package/dist/lib/duty-loop-status.js +26 -1
  46. package/dist/lib/duty-product.js +52 -3
  47. package/dist/lib/tasks.js +11 -3
  48. package/dist/lib/usage-discovery.js +2 -2
  49. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.d.ts +3 -1
  50. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +6 -2
  51. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +3 -1
  52. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +6 -4
  53. package/dist/node_modules/@skrr-ai/data-provider/index.js +10384 -10375
  54. package/oclif.manifest.json +40 -7
  55. package/package.json +5 -2
@@ -36,12 +36,14 @@ const preflight_copy_1 = require("../../lib/preflight-copy");
36
36
  * next?" opposite to `show` ("no wake observed yet"). While the run is blocked they are what the
37
37
  * cadence WOULD do, so they are labelled that way instead of reading as a promise.
38
38
  */
39
- function nextRunsLines(report) {
39
+ function nextRunsLines(report, projectedActivation = false) {
40
40
  if (!report.nextRuns?.length)
41
41
  return ['', 'Next runs: none scheduled'];
42
- const header = report.verdict === 'blocked'
43
- ? 'Next runs (the cadence\u2019s times; none will fire while the run is blocked above):'
44
- : 'Next runs:';
42
+ const header = projectedActivation
43
+ ? 'Projected runs if activated:'
44
+ : report.verdict === 'blocked'
45
+ ? 'Next runs (the cadence\u2019s times; none will fire while the run is blocked above):'
46
+ : 'Next runs:';
45
47
  return ['', header, ...report.nextRuns.map((run) => ` ${run}`)];
46
48
  }
47
49
  /**
@@ -56,14 +58,23 @@ function preflightHeadline(report, persisted) {
56
58
  if (report.sourcePolicy?.reason === 'current_contract_only') {
57
59
  return `${label}: Current contract checked. Historical evidence and activation readiness are unavailable.`;
58
60
  }
61
+ const permissionsNeedReview = Boolean(report.permissions?.warnings?.length);
62
+ if (!persisted && report.activation?.canActivate === true) {
63
+ const permissionNote = permissionsNeedReview ? ' Unattended permissions need review.' : '';
64
+ return `${label}: Activation checks passed.${permissionNote}`;
65
+ }
66
+ if (!persisted && report.activation?.canActivate === false) {
67
+ return `${label}: Activation would be refused.`;
68
+ }
59
69
  if (report.verdict === 'blocked') {
60
70
  if (report.activation?.canActivate === true) {
61
71
  const status = report.gates?.find((gate) => gate.id === 'status')?.reason;
72
+ const permissionNote = permissionsNeedReview ? ' Unattended permissions need review.' : '';
62
73
  if (status === 'status_draft') {
63
- return `${label}: Activation checks passed. The Duty is still a draft.`;
74
+ return `${label}: Activation checks passed. The Duty is still a draft.${permissionNote}`;
64
75
  }
65
76
  if (status === 'status_paused') {
66
- return `${label}: Activation checks passed. The Duty is paused.`;
77
+ return `${label}: Activation checks passed. The Duty is paused.${permissionNote}`;
67
78
  }
68
79
  }
69
80
  return `${label}: Run is blocked`;
@@ -87,11 +98,21 @@ function preflightHeadline(report, persisted) {
87
98
  if (attention?.verdict === 'block' && attention.reason === 'policy_nudge_muted') {
88
99
  caveats.push('its daily nudge limit is 0, so it never contacts you');
89
100
  }
101
+ if (permissionsNeedReview)
102
+ caveats.push('its unattended permissions need review');
90
103
  return caveats.length
91
104
  ? `${label}: Ready to run, but ${caveats.join(', and ')}`
92
105
  : `${label}: Ready to run`;
93
106
  }
94
- function preflightGateLines(gate, verbose = false, refusesActivation = false) {
107
+ function preflightGateLines(gate, verbose = false, refusesActivation = false, unsavedDraft = false) {
108
+ if (unsavedDraft &&
109
+ !refusesActivation &&
110
+ ((gate.id === 'status' && gate.reason === 'status_draft') ||
111
+ (gate.id === 'execution_contract' && gate.reason === 'duty_not_active'))) {
112
+ return [
113
+ ` info ${gate.label} — the unsaved draft cannot run${verbose ? ` (${gate.reason})` : ''}.`,
114
+ ];
115
+ }
95
116
  // "Could it contact you now?" is not a Run gate. It answers whether a message
96
117
  // would reach the owner, and a limit the owner set themselves (zero nudges a day,
97
118
  // quiet hours) is a chosen quiet, not a defect. It carried the same BLOCK tag, a
@@ -251,7 +272,7 @@ function attentionFooterLines(attention, policy, verbose = false) {
251
272
  return lines;
252
273
  }
253
274
  class DutiesPreflight extends base_command_1.BaseCommand {
254
- static description = 'Dry-run a duty: current runtime gates, activation readiness, capabilities, attention policy and upcoming runs (runs nothing). Text mode exits 1 when current execution is blocked.';
275
+ static description = 'Dry-run a duty: current runtime gates, activation readiness, capabilities, attention policy and upcoming runs (runs nothing). Text mode exits 1 for a blocked current run or a refused pre-create activation.';
255
276
  static examples = [
256
277
  '<%= config.bin %> duties preflight <duty-id>',
257
278
  '<%= config.bin %> duties preflight <duty-id> --next 5',
@@ -334,7 +355,9 @@ class DutiesPreflight extends base_command_1.BaseCommand {
334
355
  this.log(JSON.stringify(fixtureNote ? { ...report, eventFixturePreview: fixtureNote } : report, null, 2));
335
356
  return;
336
357
  }
337
- this.log(preflightHeadline(report, Boolean(args.id)));
358
+ const persisted = Boolean(args.id);
359
+ const activation = persisted ? undefined : report.activation?.canActivate;
360
+ this.log(preflightHeadline(report, persisted));
338
361
  if (fixtureNote)
339
362
  this.log(`Event fixture: ${fixtureNote}`);
340
363
  for (const line of (0, duties_1.activationRefusalLines)(report.activation))
@@ -352,7 +375,7 @@ class DutiesPreflight extends base_command_1.BaseCommand {
352
375
  this.log('\nCurrent-state gates:');
353
376
  for (const gate of report.gates || []) {
354
377
  const refusesActivation = (0, duties_1.gateRefusesActivation)(report.activation, gate);
355
- for (const line of preflightGateLines(gate, flags.verbose, refusesActivation))
378
+ for (const line of preflightGateLines(gate, flags.verbose, refusesActivation, activation !== undefined))
356
379
  this.log(line);
357
380
  }
358
381
  if (report.capabilities?.length) {
@@ -371,7 +394,7 @@ class DutiesPreflight extends base_command_1.BaseCommand {
371
394
  this.log(' Machine-attested; not platform-attested.');
372
395
  }
373
396
  }
374
- for (const line of nextRunsLines(report))
397
+ for (const line of nextRunsLines(report, activation === true))
375
398
  this.log(line);
376
399
  this.log('\nEndpoints:');
377
400
  for (const endpoint of report.endpoints || []) {
@@ -382,8 +405,9 @@ class DutiesPreflight extends base_command_1.BaseCommand {
382
405
  }
383
406
  for (const line of attentionFooterLines(report.attention, policy, flags.verbose))
384
407
  this.log(line);
385
- if (report.verdict === 'blocked')
408
+ if (activation === false || (activation === undefined && report.verdict === 'blocked')) {
386
409
  process.exitCode = 1;
410
+ }
387
411
  }
388
412
  }
389
413
  exports.default = DutiesPreflight;
@@ -10,6 +10,7 @@ export default class DutiesReceipt extends BaseCommand {
10
10
  limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  check: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  run: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ observation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -5,6 +5,8 @@ const base_command_1 = require("../../base-command");
5
5
  const duties_1 = require("../../lib/duties");
6
6
  const duty_product_1 = require("../../lib/duty-product");
7
7
  const duty_receipt_source_1 = require("../../lib/duty-receipt-source");
8
+ const OBSERVATION_UNAVAILABLE_MESSAGE = 'The selected observation could not be verified for this Run. ' +
9
+ 'Rerun the same command without --observation to request the Run receipt.';
8
10
  class DutiesReceipt extends base_command_1.BaseCommand {
9
11
  static description = 'Explain what happened from the event through work, delivery, and verification';
10
12
  static examples = [
@@ -22,34 +24,56 @@ class DutiesReceipt extends base_command_1.BaseCommand {
22
24
  run: core_1.Flags.string({
23
25
  description: 'Explain the run — resolves to the receipt of the check that minted it',
24
26
  }),
27
+ observation: core_1.Flags.string({
28
+ description: 'Open a specific observation from the selected run',
29
+ dependsOn: ['run'],
30
+ }),
25
31
  json: core_1.Flags.boolean({ description: 'Output projected receipts as JSON' }),
26
32
  verbose: core_1.Flags.boolean({ description: 'Include source IDs and diagnostic traces' }),
27
33
  };
28
34
  async run() {
29
35
  this.requireAuth();
30
36
  const { args, flags } = await this.parse(DutiesReceipt);
37
+ const unavailableMessage = flags.observation
38
+ ? OBSERVATION_UNAVAILABLE_MESSAGE
39
+ : duty_receipt_source_1.RECEIPT_UNAVAILABLE_MESSAGE;
40
+ let result;
31
41
  try {
32
- const result = await duties_1.dutyApi.receipts(args.id, {
42
+ result = await duties_1.dutyApi.receipts(args.id, {
33
43
  limit: flags.latest ? 1 : flags.limit || 1,
34
44
  checkId: flags.check,
35
45
  runId: flags.run,
46
+ observationId: flags.observation,
36
47
  });
37
- if (!(0, duty_receipt_source_1.hasVerifiedReceiptSource)(result)) {
38
- this.error(duty_receipt_source_1.RECEIPT_UNAVAILABLE_MESSAGE, { code: duty_receipt_source_1.RECEIPT_SOURCE_UNVERIFIED });
39
- }
40
- if (flags.json)
41
- return this.log(JSON.stringify(result, null, 2));
42
- if (!result.receipts.length)
43
- return this.log('No wake has been observed yet.');
44
- for (const receipt of result.receipts)
45
- (0, duty_product_1.renderExecutionReceipt)(receipt, (line) => this.log(line), flags.verbose);
46
48
  }
47
49
  catch (error) {
50
+ const { code, body } = (0, base_command_1.apiRefusal)(error);
51
+ if (flags.observation && code === duty_receipt_source_1.RECEIPT_SOURCE_UNVERIFIED) {
52
+ const { status, requestId } = error;
53
+ this.failWithCliError({
54
+ message: unavailableMessage,
55
+ code,
56
+ status,
57
+ requestId,
58
+ exit: 1,
59
+ retryable: false,
60
+ details: body,
61
+ });
62
+ }
48
63
  if ((0, duty_receipt_source_1.isReceiptSourceUnverified)(error)) {
49
- this.error(duty_receipt_source_1.RECEIPT_UNAVAILABLE_MESSAGE, { code: duty_receipt_source_1.RECEIPT_SOURCE_UNVERIFIED });
64
+ this.error(unavailableMessage, { code: duty_receipt_source_1.RECEIPT_SOURCE_UNVERIFIED });
50
65
  }
51
66
  this.handleApiError(error);
52
67
  }
68
+ if (!(0, duty_receipt_source_1.hasVerifiedReceiptSource)(result)) {
69
+ this.error(unavailableMessage, { code: duty_receipt_source_1.RECEIPT_SOURCE_UNVERIFIED });
70
+ }
71
+ if (flags.json)
72
+ return this.log(JSON.stringify(result, null, 2));
73
+ if (!result.receipts.length)
74
+ return this.log('No wake has been observed yet.');
75
+ for (const receipt of result.receipts)
76
+ (0, duty_product_1.renderExecutionReceipt)(receipt, (line) => this.log(line), flags.verbose);
53
77
  }
54
78
  }
55
79
  exports.default = DutiesReceipt;
@@ -9,7 +9,7 @@ const duties_1 = require("../../lib/duties");
9
9
  * whether the last check was stopped, and what it ran today.
10
10
  */
11
11
  class DutiesRoster extends base_command_1.BaseCommand {
12
- static description = "List an agent's duties with each one's loop state (healthy, blocked, paused, unarmed, degraded, inactive, unknown)";
12
+ static description = "List verified current Duty contracts and the Agent's Always-On setting";
13
13
  static examples = [
14
14
  '<%= config.bin %> duties roster --agent agent_abc123',
15
15
  '<%= config.bin %> duties roster --agent agent_abc123 --json',
@@ -22,13 +22,36 @@ class DutiesRoster extends base_command_1.BaseCommand {
22
22
  this.requireAuth();
23
23
  const { flags } = await this.parse(DutiesRoster);
24
24
  try {
25
- // A successful old-server response can include history joined by
26
- // logical ID. Do not expose those rows, including in --json.
27
- await duties_1.dutyApi.roster(flags.agent);
25
+ const roster = await duties_1.dutyApi.roster(flags.agent);
26
+ // Old servers may return 200 without attributing their rows.
27
+ if (roster.sourcePolicy?.status === 'partial' &&
28
+ roster.sourcePolicy.reason === 'physical_agent_current_contracts_only') {
29
+ if (flags.json) {
30
+ this.log(JSON.stringify(roster, null, 2));
31
+ return;
32
+ }
33
+ this.log(`Always-On ${roster.alwaysOn ? 'on' : 'off'}`);
34
+ this.log('Only verified current contracts are shown. Historical coverage is unconfirmed.');
35
+ for (const duty of roster.duties) {
36
+ this.log(`${duty.title} (${duty.dutyId}) · ${duty.lifecycleStatus}`);
37
+ }
38
+ if (roster.configuredSystemRoles?.length) {
39
+ this.log(`Configured system roles: ${roster.configuredSystemRoles.join(', ')}`);
40
+ }
41
+ return;
42
+ }
28
43
  }
29
44
  catch (err) {
30
- const code = err
31
- ?.response?.data;
45
+ const error = err;
46
+ const code = error?.response?.data;
47
+ const details = code?.details ?? (0, base_command_1.apiRefusal)(err).body?.details;
48
+ if ((error?.response?.status ?? error?.status) === 400 &&
49
+ Array.isArray(details) && details.length === 1 &&
50
+ details[0]?.code === 'unrecognized_keys' &&
51
+ Array.isArray(details[0].keys) && details[0].keys.length === 1 &&
52
+ details[0].keys[0] === 'coverage') {
53
+ this.error('This server version cannot verify current Agent Duty rosters. Open a known Duty by ID to inspect its Activity.', { code: 'DUTY_ROSTER_CURRENT_COVERAGE_UNSUPPORTED' });
54
+ }
32
55
  if (code?.error === 'DUTY_ROSTER_SOURCE_UNVERIFIED' ||
33
56
  code?.code === 'DUTY_ROSTER_SOURCE_UNVERIFIED') {
34
57
  this.error('Duty roster is unavailable because its historical source identity cannot be verified.', {
@@ -5,7 +5,7 @@ const base_command_1 = require("../../base-command");
5
5
  const duties_1 = require("../../lib/duties");
6
6
  const duty_history_source_1 = require("../../lib/duty-history-source");
7
7
  const duty_loop_status_1 = require("../../lib/duty-loop-status");
8
- const LOOP_STATUS_UNAVAILABLE = 'Loop status is unavailable because its historical source identity cannot be verified.';
8
+ const LOOP_STATUS_UNVERIFIED = 'DUTY_LOOP_STATUS_SOURCE_UNVERIFIED';
9
9
  /**
10
10
  * Is this duty's loop installed and working? Names the loop state and
11
11
  * why, the next wakes, each watched source's access, the last stop and its
@@ -26,29 +26,37 @@ class DutiesStatus extends base_command_1.BaseCommand {
26
26
  async run() {
27
27
  this.requireAuth();
28
28
  const { args, flags } = await this.parse(DutiesStatus);
29
+ const unavailable = 'Loop status is unavailable because its historical source identity cannot be verified. ' +
30
+ `Read the scoped history with skrr duties cycles ${args.dutyId}.`;
29
31
  let status;
30
32
  try {
31
- status = await duties_1.dutyApi.loopStatus(args.dutyId);
33
+ status = await duties_1.dutyApi.loopStatus(args.dutyId, true);
32
34
  }
33
35
  catch (err) {
34
- const code = err?.response
36
+ const legacy = err?.response
35
37
  ?.data;
36
- if (code?.error === 'DUTY_LOOP_STATUS_SOURCE_UNVERIFIED' ||
37
- code?.code === 'DUTY_LOOP_STATUS_SOURCE_UNVERIFIED') {
38
- this.error(LOOP_STATUS_UNAVAILABLE, { code: 'DUTY_LOOP_STATUS_SOURCE_UNVERIFIED' });
38
+ if ((0, base_command_1.apiRefusal)(err).code === LOOP_STATUS_UNVERIFIED ||
39
+ legacy?.error === LOOP_STATUS_UNVERIFIED ||
40
+ legacy?.code === LOOP_STATUS_UNVERIFIED) {
41
+ this.error(unavailable, { code: LOOP_STATUS_UNVERIFIED });
39
42
  }
40
43
  this.handleApiError(err);
41
44
  }
42
- // An older server answered 200 from the logical Duty id alone and said nothing about its
43
- // sources. Print a response only when the server declares its coverage, in JSON too.
44
- if (!(0, duty_history_source_1.hasVerifiedDutyHistorySource)(status)) {
45
- this.error(LOOP_STATUS_UNAVAILABLE, { code: 'DUTY_LOOP_STATUS_SOURCE_UNVERIFIED' });
45
+ // An older server also answered 200 without declaring what was attributed.
46
+ // Only use the full or current-contract projection when it is explicitly declared.
47
+ const current = status.sourcePolicy?.status === 'partial' &&
48
+ status.sourcePolicy.reason === 'current_contract_only' && status.currentContract;
49
+ if (!current && !(0, duty_history_source_1.hasVerifiedDutyHistorySource)(status)) {
50
+ this.error(unavailable, { code: LOOP_STATUS_UNVERIFIED });
46
51
  }
47
52
  if (flags.json) {
48
53
  this.log(JSON.stringify(status, null, 2));
49
54
  return;
50
55
  }
51
- for (const line of (0, duty_loop_status_1.formatDutyLoopStatus)(status))
56
+ const lines = current
57
+ ? (0, duty_loop_status_1.formatCurrentDutyLoopContract)(status, current)
58
+ : (0, duty_loop_status_1.formatDutyLoopStatus)(status);
59
+ for (const line of lines)
52
60
  this.log(line);
53
61
  }
54
62
  }
@@ -80,7 +80,7 @@ JSON
80
80
  description: 'Skip the confirmation prompt for an irreversible status change',
81
81
  }),
82
82
  'from-json': core_1.Flags.string({
83
- description: `JSON patch file (or "-" for stdin). See examples below. JSON cadence and watchedSources replace those fields; policy is deep-merged. ${duty_attention_copy_1.QUIET_HOURS_HELP} ${duty_attention_copy_1.EVENT_SOURCES_HELP}`,
83
+ description: `JSON patch file (or "-" for stdin). See examples below. JSON cadence and watchedSources replace those fields; policy is deep-merged. The Duty owner can set policy.resultRecoveryMode to "resume_on_confirmed_stop" to let future Runs recover automatically after a confirmed stop. "manual_review" restores the default. ${duty_attention_copy_1.QUIET_HOURS_HELP} ${duty_attention_copy_1.EVENT_SOURCES_HELP}`,
84
84
  }),
85
85
  'if-version': core_1.Flags.integer({
86
86
  description: 'Only update this observed contract version; returns a conflict if it changed',
@@ -170,7 +170,7 @@ class GoalsCreate extends base_command_1.BaseCommand {
170
170
  // carry spaceId — fall back to the requested --space for the canonical URL.
171
171
  const url = (0, web_url_1.goalUrlFrom)(this.cliConfig.baseURL, { ...g, spaceId: g.spaceId ?? flags.space });
172
172
  if (flags.json) {
173
- this.log(JSON.stringify({ ...g, url }, null, 2));
173
+ this.printJsonResult({ ...g, url });
174
174
  return;
175
175
  }
176
176
  this.log((0, created_line_1.createdLine)('goal', { id: (g.id ?? g._id), title: g.title }));
@@ -86,7 +86,7 @@ class GoalsKeyResultsCreate extends base_command_1.BaseCommand {
86
86
  this.handleApiError(err);
87
87
  }
88
88
  if (flags.json) {
89
- this.log(JSON.stringify(created, null, 2));
89
+ this.printJsonResult(created);
90
90
  return;
91
91
  }
92
92
  const k = created;
@@ -24,7 +24,7 @@ class MachinesComputerAdoption extends base_command_1.BaseCommand {
24
24
  const { flags } = await this.parse(MachinesComputerAdoption);
25
25
  const read = await (0, computer_adoption_1.getComputerAdoption)();
26
26
  if (flags.json) {
27
- this.log(JSON.stringify(read, null, 2));
27
+ this.printJsonResult(read);
28
28
  return;
29
29
  }
30
30
  for (const line of (0, computer_adoption_1.computerAdoptionLines)(read))
@@ -82,7 +82,7 @@ class DedicatedMachinesAudit extends dedicated_lease_command_1.DedicatedLeaseCom
82
82
  limit: flags.limit,
83
83
  }));
84
84
  if (flags.json) {
85
- this.log(JSON.stringify(page, null, 2));
85
+ this.printJsonResult(page);
86
86
  return;
87
87
  }
88
88
  const events = page?.events ?? [];
@@ -30,7 +30,7 @@ class DedicatedMachinesCatalog extends dedicated_lease_command_1.DedicatedLeaseC
30
30
  this.error('This server does not offer Dedicated Runtime.', { exit: 1 });
31
31
  }
32
32
  if (flags.json) {
33
- this.log(JSON.stringify({ catalog }, null, 2));
33
+ this.printJsonResult({ catalog });
34
34
  return;
35
35
  }
36
36
  this.log(`Dedicated Runtime — ${catalog.availability}`);
@@ -34,7 +34,7 @@ class DedicatedMachinesCurrent extends dedicated_lease_command_1.DedicatedLeaseC
34
34
  }
35
35
  const response = await this.callDedicated(() => (0, dedicated_machines_1.getDedicatedRuntime)(leaseId));
36
36
  if (flags.json) {
37
- this.log(JSON.stringify(response, null, 2));
37
+ this.printJsonResult(response);
38
38
  return;
39
39
  }
40
40
  const lease = response?.lease;
@@ -46,7 +46,7 @@ class DedicatedMachinesGitStatus extends dedicated_lease_command_1.DedicatedLeas
46
46
  this.handleApiError(err);
47
47
  }
48
48
  if (flags.json) {
49
- this.log(JSON.stringify(result, null, 2));
49
+ this.printJsonResult(result);
50
50
  return;
51
51
  }
52
52
  for (const line of (0, computer_files_1.computerFileGitStatusLines)(result))
@@ -25,7 +25,7 @@ class DedicatedMachinesHealthCheck extends dedicated_lease_command_1.DedicatedLe
25
25
  const leaseId = await this.resolveLeaseArg(args.lease);
26
26
  const response = await this.callDedicated(() => (0, dedicated_machines_1.performDedicatedLeaseAction)(leaseId, 'health-check', this.scopeFrom(flags)));
27
27
  if (flags.json) {
28
- this.log(JSON.stringify(response, null, 2));
28
+ this.printJsonResult(response);
29
29
  return;
30
30
  }
31
31
  const lease = response?.lease;
@@ -76,7 +76,7 @@ class DedicatedMachinesLogs extends dedicated_lease_command_1.DedicatedLeaseComm
76
76
  });
77
77
  }
78
78
  if (flags.json) {
79
- this.log(JSON.stringify(result, null, 2));
79
+ this.printJsonResult(result);
80
80
  return;
81
81
  }
82
82
  if (result.lines.length === 0) {
@@ -25,7 +25,7 @@ class DedicatedMachinesPriceBook extends dedicated_lease_command_1.DedicatedLeas
25
25
  const { flags } = await this.parse(DedicatedMachinesPriceBook);
26
26
  const read = await this.callDedicated(() => (0, dedicated_machines_1.getDedicatedOperatorPriceBook)());
27
27
  if (flags.json) {
28
- this.log(JSON.stringify(read, null, 2));
28
+ this.printJsonResult(read);
29
29
  return;
30
30
  }
31
31
  for (const line of (0, dedicated_machines_1.dedicatedOperatorPriceBookLines)(read))
@@ -36,7 +36,7 @@ class DedicatedMachinesSignInStatus extends dedicated_lease_command_1.DedicatedL
36
36
  const leaseId = await this.resolveLeaseArg(args.lease);
37
37
  const response = await this.callDedicated(() => (0, dedicated_machines_1.getDedicatedRuntimeSignInStatus)(leaseId, this.scopeFrom(flags)));
38
38
  if (flags.json) {
39
- this.log(JSON.stringify(response, null, 2));
39
+ this.printJsonResult(response);
40
40
  return;
41
41
  }
42
42
  const statuses = response?.statuses ?? [];
@@ -82,7 +82,7 @@ class DedicatedMachinesStat extends dedicated_lease_command_1.DedicatedLeaseComm
82
82
  this.handleApiError(err);
83
83
  }
84
84
  if (flags.json) {
85
- this.log(JSON.stringify(result, null, 2));
85
+ this.printJsonResult(result);
86
86
  return;
87
87
  }
88
88
  for (const line of computerFileStatLines(result))
@@ -36,7 +36,7 @@ class MachinesServicesLs extends base_command_1.BaseCommand {
36
36
  this.handleApiError(err);
37
37
  }
38
38
  if (flags.json) {
39
- this.log(JSON.stringify(result, null, 2));
39
+ this.printJsonResult(result);
40
40
  return;
41
41
  }
42
42
  const services = result?.services ?? [];
@@ -34,7 +34,7 @@ class MachinesShared extends base_command_1.BaseCommand {
34
34
  this.handleApiError(err);
35
35
  }
36
36
  if (flags.json) {
37
- this.log(JSON.stringify(result, null, 2));
37
+ this.printJsonResult(result);
38
38
  return;
39
39
  }
40
40
  const machines = result?.machines ?? [];
@@ -46,7 +46,7 @@ class MachinesShares extends base_command_1.BaseCommand {
46
46
  this.handleApiError(err);
47
47
  }
48
48
  if (flags.json) {
49
- this.log(JSON.stringify(result, null, 2));
49
+ this.printJsonResult(result);
50
50
  return;
51
51
  }
52
52
  const grants = result?.grants ?? [];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.describeFireAuditDetail = describeFireAuditDetail;
4
+ const node_util_1 = require("node:util");
4
5
  const core_1 = require("@oclif/core");
5
6
  const data_provider_1 = require("@skrr-ai/data-provider");
6
7
  const base_command_1 = require("../../base-command");
@@ -90,6 +91,12 @@ function describeFireAuditDetail(detail, fireId, triggerId) {
90
91
  }
91
92
  // Tool calls refused during a turn that was delivered: `triggers show` points here for the facts.
92
93
  lines.push(...(0, triggers_1.fireRefusalLines)(detail.metadata));
94
+ if (detail.publicProjection === 'bound_to_trigger_run') {
95
+ const output = detail.output;
96
+ if (typeof output?.excerpt === 'string' && output.excerpt) {
97
+ lines.push('Output:', (0, node_util_1.stripVTControlCharacters)(output.excerpt));
98
+ }
99
+ }
93
100
  return lines;
94
101
  }
95
102
  class TriggersFireDetail extends base_command_1.BaseCommand {