@skrr-ai/cli 0.1.198 → 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.
- 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 +74 -7
- 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/submit.d.ts +1 -0
- package/dist/commands/tasks/result/submit.js +2 -0
- package/dist/commands/tasks/start-receipt.js +5 -0
- package/dist/commands/tasks/start.js +40 -1
- 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/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 +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +15 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +18 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +10381 -10365
- package/oclif.manifest.json +47 -8
- package/package.json +6 -3
|
@@ -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))
|
|
@@ -9,6 +9,7 @@ export default class TasksResultSubmit extends BaseCommand {
|
|
|
9
9
|
static flags: {
|
|
10
10
|
task: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
summary: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'request-completion': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
'conclusion-type': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
'conclusion-json': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -33,6 +33,7 @@ class TasksResultSubmit extends base_command_1.BaseCommand {
|
|
|
33
33
|
static flags = {
|
|
34
34
|
task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
|
|
35
35
|
summary: core_1.Flags.string({ required: true, description: 'The answer in one readable paragraph' }),
|
|
36
|
+
'request-completion': core_1.Flags.boolean({ description: 'Request workflow completion after the active Task Run ends' }),
|
|
36
37
|
body: core_1.Flags.string({ description: 'Long-form Result body' }),
|
|
37
38
|
'conclusion-type': core_1.Flags.string({ description: 'Domain conclusion type' }),
|
|
38
39
|
'conclusion-json': core_1.Flags.string({ description: 'JSON value for the domain conclusion' }),
|
|
@@ -129,6 +130,7 @@ class TasksResultSubmit extends base_command_1.BaseCommand {
|
|
|
129
130
|
}
|
|
130
131
|
const payload = {
|
|
131
132
|
summary: flags.summary,
|
|
133
|
+
...(flags['request-completion'] ? { completionIntent: 'request_completion' } : {}),
|
|
132
134
|
body: flags.body,
|
|
133
135
|
expectedSpecVersion: flags['spec-version'],
|
|
134
136
|
runId: flags['run-id'],
|
|
@@ -67,6 +67,11 @@ class TasksStartReceipt extends base_command_1.BaseCommand {
|
|
|
67
67
|
this.log(`Start request ${receipt.requestId} has an accepted server response.`);
|
|
68
68
|
if (receipt.responseStatus !== undefined)
|
|
69
69
|
this.log(`Response status: ${receipt.responseStatus}`);
|
|
70
|
+
if (receipt.input) {
|
|
71
|
+
this.log(`Task input: ${receipt.input.commandId} (${receipt.input.phase})`);
|
|
72
|
+
if (receipt.input.exchangeId)
|
|
73
|
+
this.log(`Exchange: ${receipt.input.exchangeId}`);
|
|
74
|
+
}
|
|
70
75
|
if (receipt.run?.runId)
|
|
71
76
|
this.log(`Run: ${receipt.run.runId}`);
|
|
72
77
|
if (receipt.run?.autonomousRunId)
|
|
@@ -10,9 +10,10 @@ const base_command_1 = require("../../base-command");
|
|
|
10
10
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
11
11
|
const git_task_1 = require("../../lib/git-task");
|
|
12
12
|
const task_admission_1 = require("../../lib/task-admission");
|
|
13
|
+
const http_error_1 = require("../../lib/http-error");
|
|
13
14
|
const TASK_START_REQUEST_ID_PATTERN = /^[A-Za-z0-9._:/-]{1,200}$/;
|
|
14
15
|
class TasksStart extends base_command_1.BaseCommand {
|
|
15
|
-
static description = '
|
|
16
|
+
static description = 'Request execution of a Task by its assigned Agent. ' +
|
|
16
17
|
'Alias: tasks execute';
|
|
17
18
|
// `tasks execute` is the verb a first-time user reaches for, and it was
|
|
18
19
|
// "not a command" (OSK-12128). One command, two names.
|
|
@@ -150,6 +151,44 @@ class TasksStart extends base_command_1.BaseCommand {
|
|
|
150
151
|
}
|
|
151
152
|
let result;
|
|
152
153
|
try {
|
|
154
|
+
// Check capability before any mutation. Skill and capability overrides
|
|
155
|
+
// still use the existing endpoint that can honor them.
|
|
156
|
+
if (!flags.skill && !flags.capability?.length) {
|
|
157
|
+
const chat = await data_provider_1.dataService.getTaskChat(taskId).catch((error) => {
|
|
158
|
+
if ([404, 405].includes((0, http_error_1.httpStatusOf)(error) ?? 0))
|
|
159
|
+
return null;
|
|
160
|
+
throw error;
|
|
161
|
+
});
|
|
162
|
+
if (chat?.startInput && chat.authorizationGeneration != null) {
|
|
163
|
+
const prior = flags['request-id']
|
|
164
|
+
? await data_provider_1.dataService.getTaskStartReceipt(taskId, requestId)
|
|
165
|
+
: null;
|
|
166
|
+
if (prior && prior.state !== 'unknown') {
|
|
167
|
+
if (flags.json)
|
|
168
|
+
this.log(JSON.stringify(prior, null, 2));
|
|
169
|
+
else
|
|
170
|
+
this.log(`Start request ${requestId} is ${prior.state}. Inspect it with ${this.config.bin} tasks start-receipt ${taskId} --request-id ${requestId}.`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const input = await data_provider_1.dataService.submitTaskConversationInput(taskId, {
|
|
174
|
+
action: 'start', commandKey: requestId,
|
|
175
|
+
expectedWorkflowGeneration: chat.workflowGeneration,
|
|
176
|
+
expectedAuthorizationGeneration: chat.authorizationGeneration,
|
|
177
|
+
expectedSpecVersion: chat.startInput.specVersion,
|
|
178
|
+
});
|
|
179
|
+
if (flags.json) {
|
|
180
|
+
this.log(JSON.stringify({ taskId, requestId, input, ...(branch ? { branch } : {}) }, null, 2));
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
if (branch)
|
|
184
|
+
this.log(`${branch.created ? 'Created' : 'Checked out'} branch: ${branch.branch}`);
|
|
185
|
+
this.log(`Task ${taskId} start input: ${input.phase}.`);
|
|
186
|
+
this.log(`Start request: ${requestId}`);
|
|
187
|
+
this.log(`Inspect execution: ${this.config.bin} tasks execution-state ${taskId}`);
|
|
188
|
+
}
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
153
192
|
result = await data_provider_1.dataService.startTask(taskId, {
|
|
154
193
|
...(flags.skill ? { skillId: flags.skill } : {}),
|
|
155
194
|
...(flags.capability?.length ? { requestedCapabilities: flags.capability } : {}),
|
|
@@ -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 {
|