@skrr-ai/cli 0.1.199 → 0.1.202
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.
- package/dist/commands/agents/always-on/recovery-close.d.ts +3 -4
- package/dist/commands/agents/always-on/recovery-close.js +5 -5
- package/dist/commands/agents/always-on/recovery-review.d.ts +1 -1
- package/dist/commands/agents/always-on/recovery-review.js +4 -3
- package/dist/commands/agents/create.d.ts +4 -2
- package/dist/commands/agents/create.js +29 -4
- package/dist/commands/duties/check-now.d.ts +1 -0
- package/dist/commands/duties/check-now.js +17 -1
- package/dist/commands/duties/create.js +95 -9
- package/dist/commands/duties/observations.d.ts +1 -0
- package/dist/commands/duties/observations.js +12 -3
- package/dist/commands/duties/operating-review.js +34 -2
- package/dist/commands/duties/pack/plan.d.ts +1 -0
- package/dist/commands/duties/pack/plan.js +30 -0
- package/dist/commands/duties/plan.d.ts +1 -0
- package/dist/commands/duties/plan.js +24 -0
- package/dist/commands/duties/preflight.d.ts +3 -3
- package/dist/commands/duties/preflight.js +36 -12
- package/dist/commands/duties/receipt.d.ts +1 -0
- package/dist/commands/duties/receipt.js +35 -11
- package/dist/commands/duties/roster.js +29 -6
- package/dist/commands/duties/status.js +19 -11
- package/dist/commands/duties/update.js +1 -1
- package/dist/commands/goals/create.js +1 -1
- package/dist/commands/goals/key-results/create.js +1 -1
- package/dist/commands/machines/computer-adoption.js +1 -1
- package/dist/commands/machines/dedicated/audit.js +1 -1
- package/dist/commands/machines/dedicated/catalog.js +1 -1
- package/dist/commands/machines/dedicated/current.js +1 -1
- package/dist/commands/machines/dedicated/git-status.js +1 -1
- package/dist/commands/machines/dedicated/health-check.js +1 -1
- package/dist/commands/machines/dedicated/logs.js +1 -1
- package/dist/commands/machines/dedicated/price-book.js +1 -1
- package/dist/commands/machines/dedicated/sign-in-status.js +1 -1
- package/dist/commands/machines/dedicated/stat.js +1 -1
- package/dist/commands/machines/services/ls.js +1 -1
- package/dist/commands/machines/shared.js +1 -1
- package/dist/commands/machines/shares.js +1 -1
- package/dist/commands/tasks/result/show.d.ts +1 -0
- package/dist/commands/tasks/result/show.js +19 -1
- package/dist/commands/triggers/capabilities.js +11 -2
- package/dist/commands/triggers/create.d.ts +1 -1
- package/dist/commands/triggers/create.js +15 -6
- package/dist/commands/triggers/fire-detail.js +7 -0
- package/dist/generated/agent-guides.json +36 -36
- package/dist/lib/daemon-setup.js +1 -1
- package/dist/lib/duties.d.ts +7 -5
- package/dist/lib/duties.js +32 -19
- package/dist/lib/duty-loop-status.d.ts +2 -0
- package/dist/lib/duty-loop-status.js +26 -1
- package/dist/lib/duty-product.js +52 -3
- package/dist/lib/task-runtime-headers.d.ts +2 -0
- package/dist/lib/task-runtime-headers.js +26 -9
- package/dist/lib/tasks.js +11 -3
- package/dist/lib/usage-discovery.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +6 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +3 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +6 -4
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10384 -10375
- package/oclif.manifest.json +54 -11
- 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 =
|
|
43
|
-
? '
|
|
44
|
-
:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
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
|
-
|
|
26
|
-
//
|
|
27
|
-
|
|
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
|
|
31
|
-
|
|
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
|
|
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
|
|
36
|
+
const legacy = err?.response
|
|
35
37
|
?.data;
|
|
36
|
-
if (code
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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.
|
|
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 }));
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
28
|
+
this.printJsonResult(response);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
const lease = response?.lease;
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
85
|
+
this.printJsonResult(result);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
for (const line of computerFileStatLines(result))
|
|
@@ -14,6 +14,7 @@ export default class TasksResultShow extends BaseCommand {
|
|
|
14
14
|
static flags: {
|
|
15
15
|
task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
16
|
history: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
result: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
};
|
|
19
20
|
run(): Promise<void>;
|
|
@@ -6,6 +6,7 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
6
6
|
const base_command_1 = require("../../../base-command");
|
|
7
7
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
8
|
const task_legacy_1 = require("../../../lib/task-legacy");
|
|
9
|
+
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
9
10
|
/**
|
|
10
11
|
* What a reviewer needs to accept ONE exact Result (OSK-15430). `result show` printed the summary and
|
|
11
12
|
* the conclusion, and kept the Result id (the value `tasks review --result-id` requires), the linked
|
|
@@ -57,19 +58,36 @@ function describeResultDetail(current, all = []) {
|
|
|
57
58
|
return lines;
|
|
58
59
|
}
|
|
59
60
|
class TasksResultShow extends base_command_1.BaseCommand {
|
|
60
|
-
static description = 'Show the current Task Result and its exact
|
|
61
|
+
static description = 'Show the current Task Result and its Review, or read an exact Result version';
|
|
61
62
|
static args = {
|
|
62
63
|
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
63
64
|
};
|
|
64
65
|
static flags = {
|
|
65
66
|
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
66
67
|
history: core_1.Flags.boolean({ description: 'Include superseded Result versions' }),
|
|
68
|
+
result: core_1.Flags.string({ description: 'Read one immutable Result by id', exclusive: ['history'] }),
|
|
67
69
|
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
68
70
|
};
|
|
69
71
|
async run() {
|
|
70
72
|
this.requireAuth();
|
|
71
73
|
const { args, flags } = await this.parse(TasksResultShow);
|
|
72
74
|
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
75
|
+
if (flags.result) {
|
|
76
|
+
const reviewSpaceId = process.env.OVERSKY_SPACE_REVIEW_WORK === '1'
|
|
77
|
+
? process.env.OVERSKY_SESSION_SPACE_ID : undefined;
|
|
78
|
+
const query = reviewSpaceId ? `?${new URLSearchParams({ reviewSpaceId })}` : '';
|
|
79
|
+
const path = `/api/tasks/${encodeURIComponent(task.id)}/results/${encodeURIComponent(flags.result)}`;
|
|
80
|
+
try {
|
|
81
|
+
const exact = await (0, api_fetch_1.apiFetch)(`${path}${query}`);
|
|
82
|
+
if (flags.json)
|
|
83
|
+
return this.log(JSON.stringify(exact));
|
|
84
|
+
return this.log([`Result v${exact.version} ${exact.id}`, exact.summary, exact.body,
|
|
85
|
+
...describeResultDetail(exact)].filter(Boolean).join('\n'));
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
return this.handleApiError(error);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
73
91
|
let result;
|
|
74
92
|
try {
|
|
75
93
|
result = await data_provider_1.dataService.listTaskResults(task.id, { includeSuperseded: flags.history });
|
|
@@ -31,7 +31,16 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
this.log(`Scope: ${String(capabilities.scopeKind ?? args.scope)}`);
|
|
34
|
-
|
|
34
|
+
const kinds = Array.isArray(capabilities.kinds) ? capabilities.kinds : null;
|
|
35
|
+
const authorableKinds = kinds?.filter((kind) => kind.executable && kind.authoringSurface === 'user').map((kind) => kind.kind) ??
|
|
36
|
+
capabilities.allowedKinds;
|
|
37
|
+
this.log(`Kinds: ${Array.isArray(authorableKinds) ? authorableKinds.join(', ') || '-' : '-'}`);
|
|
38
|
+
for (const kind of kinds ?? []) {
|
|
39
|
+
if (kind.executable && kind.authoringSurface === 'user')
|
|
40
|
+
continue;
|
|
41
|
+
const label = kind.authoringSurface === 'domain' ? 'Domain-managed' : 'Unavailable';
|
|
42
|
+
this.log(`${label} (${kind.kind})${kind.reason ? `: ${kind.reason}` : ''}`);
|
|
43
|
+
}
|
|
35
44
|
// The modes `triggers create --mode` will accept. `allowedExecutorModes` is longer: it keeps the
|
|
36
45
|
// modes only an internal producer may mint, which create refuses, so listing it here offered
|
|
37
46
|
// choices that fail on submit (OSK-22489). A server that predates the field only has the long
|
|
@@ -39,7 +48,7 @@ class TriggersCapabilities extends base_command_1.BaseCommand {
|
|
|
39
48
|
const authorable = Array.isArray(capabilities.authorableExecutorModes)
|
|
40
49
|
? capabilities.authorableExecutorModes
|
|
41
50
|
: capabilities.allowedExecutorModes;
|
|
42
|
-
this.log(`Modes: ${Array.isArray(authorable) ? authorable.join(', ') : '-'}`);
|
|
51
|
+
this.log(`Modes: ${Array.isArray(authorable) ? authorable.join(', ') || '-' : '-'}`);
|
|
43
52
|
// The mode names say nothing about side effects; describe the ones an author usually picks
|
|
44
53
|
// between (OSK-21766).
|
|
45
54
|
if (Array.isArray(authorable)) {
|
|
@@ -80,7 +80,7 @@ export default class TriggersCreate extends BaseCommand {
|
|
|
80
80
|
run(): Promise<void>;
|
|
81
81
|
/** How a saved working / quiet window will be read, when that is not what it looks like (OSK-22530). */
|
|
82
82
|
private warnWindowAdvice;
|
|
83
|
-
private
|
|
83
|
+
private warnSelfSchedule;
|
|
84
84
|
/**
|
|
85
85
|
* The server creates the trigger and then says whether something already
|
|
86
86
|
* watches the same thing. Printed AFTER the summary, and the sentence itself
|