@skrr-ai/cli 0.1.177 → 0.1.179
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/harnesses/evaluations/evidence.d.ts +20 -0
- package/dist/commands/harnesses/evaluations/evidence.js +72 -0
- package/dist/commands/harnesses/evaluations/grant.d.ts +30 -0
- package/dist/commands/harnesses/evaluations/grant.js +109 -0
- package/dist/commands/harnesses/evaluations/list.d.ts +18 -0
- package/dist/commands/harnesses/evaluations/list.js +73 -0
- package/dist/commands/harnesses/evaluations/revoke.d.ts +19 -0
- package/dist/commands/harnesses/evaluations/revoke.js +45 -0
- package/dist/commands/harnesses/evaluations/show.d.ts +14 -0
- package/dist/commands/harnesses/evaluations/show.js +46 -0
- package/dist/commands/harnesses/list.d.ts +1 -0
- package/dist/commands/harnesses/list.js +11 -2
- package/dist/commands/harnesses/show.js +5 -0
- package/dist/lib/harness-evaluations.d.ts +166 -0
- package/dist/lib/harness-evaluations.js +58 -0
- package/dist/lib/harness-labels.d.ts +10 -0
- package/dist/lib/harness-labels.js +23 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.d.ts +12 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.js +12 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.d.ts +12 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.js +21 -7
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.d.ts +9 -9
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +58 -5
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.d.ts +9 -9
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +78 -9
- package/oclif.manifest.json +477 -1
- package/package.json +5 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* What the platform recorded for each turn a harness evaluation admitted (OSK-24597): the
|
|
4
|
+
* reservation, the relay's calls (`x-litellm-call-id`), and with `--gateway` the gateway's own spend
|
|
5
|
+
* row for each call. The platform-machine H9 runner reads its gateway-side facts from this.
|
|
6
|
+
*/
|
|
7
|
+
export default class HarnessesEvaluationsEvidence extends BaseCommand {
|
|
8
|
+
static aliases: string[];
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static args: {
|
|
12
|
+
grantId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
gateway: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
conversation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../../base-command");
|
|
5
|
+
const harness_evaluations_1 = require("../../../lib/harness-evaluations");
|
|
6
|
+
/**
|
|
7
|
+
* What the platform recorded for each turn a harness evaluation admitted (OSK-24597): the
|
|
8
|
+
* reservation, the relay's calls (`x-litellm-call-id`), and with `--gateway` the gateway's own spend
|
|
9
|
+
* row for each call. The platform-machine H9 runner reads its gateway-side facts from this.
|
|
10
|
+
*/
|
|
11
|
+
class HarnessesEvaluationsEvidence extends base_command_1.BaseCommand {
|
|
12
|
+
static aliases = ['harnesses:evaluations:evidence'];
|
|
13
|
+
static description = 'Show the reservations, relay calls and gateway rows of a harness evaluation (platform admins)';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> harnesses evaluations evidence hevg_<id> --gateway --json',
|
|
16
|
+
];
|
|
17
|
+
static args = {
|
|
18
|
+
grantId: core_1.Args.string({ ignoreStdin: true, description: 'Grant id (hevg_...)', required: true }),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
22
|
+
gateway: core_1.Flags.boolean({ description: "Also read each call's gateway spend row" }),
|
|
23
|
+
conversation: core_1.Flags.string({
|
|
24
|
+
description: 'Also read prompt-free persisted pointers for one of your own conversations',
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
this.requireAuth();
|
|
29
|
+
const { args, flags } = await this.parse(HarnessesEvaluationsEvidence);
|
|
30
|
+
let result;
|
|
31
|
+
try {
|
|
32
|
+
result = await (0, harness_evaluations_1.harnessEvaluationEvidence)(args.grantId, {
|
|
33
|
+
gateway: flags.gateway,
|
|
34
|
+
conversationId: flags.conversation,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
this.handleApiError(err);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (flags.json) {
|
|
42
|
+
this.log(JSON.stringify(result, null, 2));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.log(`${result.grant.grantId}: ${result.turns.length} turns`);
|
|
46
|
+
this.log(`Machine: ${result.machine.machineProduct ?? 'unknown'} ${result.machine.daemonId}; image ${result.machine.image ?? `unavailable (${result.machine.unavailable ?? 'unproven'})`}`);
|
|
47
|
+
if (result.continuity) {
|
|
48
|
+
const receipt = result.continuity.receipt;
|
|
49
|
+
this.log(receipt
|
|
50
|
+
? `Native turn: ${receipt.platformSessionId}; ${receipt.resumed ? 'resumed' : 'started'}`
|
|
51
|
+
: 'Native continuity: no current grant-bound backend receipt');
|
|
52
|
+
}
|
|
53
|
+
for (const turn of result.turns) {
|
|
54
|
+
const r = turn.reservation;
|
|
55
|
+
this.log(` ${turn.claimedAt} ${turn.model} ${r ? `${r.status} settled $${r.settledUsd ?? '-'} (harness ${r.harnessVersion ?? '?'})` : 'no reservation'}`);
|
|
56
|
+
for (const call of turn.calls) {
|
|
57
|
+
const g = call.gateway;
|
|
58
|
+
const gw = g === undefined
|
|
59
|
+
? ''
|
|
60
|
+
: g === null
|
|
61
|
+
? ' gateway: no row'
|
|
62
|
+
: 'readError' in g
|
|
63
|
+
? ` gateway: ${g.readError}`
|
|
64
|
+
: ` gateway: ${g.status ?? '?'} ${g.errorClass ?? ''}`.trimEnd();
|
|
65
|
+
this.log(` call ${call.providerRequestId} ${call.observation}${gw}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (result.gateway?.unavailable)
|
|
69
|
+
this.log(`Gateway rows unavailable: ${result.gateway.unavailable}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.default = HarnessesEvaluationsEvidence;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Let a harness still evaluating on platform machines run on one of your own platform machines,
|
|
4
|
+
* for your own turns only (OSK-24597).
|
|
5
|
+
*
|
|
6
|
+
* The harness, its exact image version, the models and the machine are all named here, and the
|
|
7
|
+
* grant ends at `--ttl-minutes` (at most 360) or `--max-spend-usd` (at most 10), whichever comes
|
|
8
|
+
* first. Its turns run through the machine's daemon, broker, relay and gateway lease, exactly as an
|
|
9
|
+
* admitted harness's would. After granting, the command asks the daemon to re-register so the
|
|
10
|
+
* harness appears on the machine now (`--no-rescan` skips it; the next reconnect does the same).
|
|
11
|
+
*/
|
|
12
|
+
export default class HarnessesEvaluationsGrant extends BaseCommand {
|
|
13
|
+
static aliases: string[];
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
harness: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
version: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
model: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
daemon: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
'ttl-minutes': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
'max-spend-usd': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
reason: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
'no-rescan': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
28
|
+
};
|
|
29
|
+
run(): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../../base-command");
|
|
5
|
+
const harness_evaluations_1 = require("../../../lib/harness-evaluations");
|
|
6
|
+
/**
|
|
7
|
+
* Let a harness still evaluating on platform machines run on one of your own platform machines,
|
|
8
|
+
* for your own turns only (OSK-24597).
|
|
9
|
+
*
|
|
10
|
+
* The harness, its exact image version, the models and the machine are all named here, and the
|
|
11
|
+
* grant ends at `--ttl-minutes` (at most 360) or `--max-spend-usd` (at most 10), whichever comes
|
|
12
|
+
* first. Its turns run through the machine's daemon, broker, relay and gateway lease, exactly as an
|
|
13
|
+
* admitted harness's would. After granting, the command asks the daemon to re-register so the
|
|
14
|
+
* harness appears on the machine now (`--no-rescan` skips it; the next reconnect does the same).
|
|
15
|
+
*/
|
|
16
|
+
class HarnessesEvaluationsGrant extends base_command_1.BaseCommand {
|
|
17
|
+
static aliases = ['harnesses:evaluations:grant'];
|
|
18
|
+
static description = 'Let a harness evaluating on platform machines run on one of your own (platform admins)';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> harnesses evaluations grant pi --version 1.5.2 --model claude-sonnet-5 --daemon <daemon-id> --reason "H9 for pi on a Hosted Machine (OSK-24468)"',
|
|
21
|
+
'<%= config.bin %> harnesses evaluations grant copilot-sdk --version 1.0.112 --model claude-sonnet-5 --model gpt-5.6-terra --daemon <daemon-id> --ttl-minutes 90 --max-spend-usd 3 --reason "H9 for copilot-sdk (OSK-24469)" --json',
|
|
22
|
+
];
|
|
23
|
+
static args = {
|
|
24
|
+
harness: core_1.Args.string({
|
|
25
|
+
ignoreStdin: true,
|
|
26
|
+
description: 'Registry harness id evaluating at platform-machine (for example pi, copilot-sdk)',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
static flags = {
|
|
31
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
32
|
+
version: core_1.Flags.string({
|
|
33
|
+
description: 'The exact harness version the machine image reports (its Harness row cliVersion)',
|
|
34
|
+
required: true,
|
|
35
|
+
}),
|
|
36
|
+
model: core_1.Flags.string({
|
|
37
|
+
description: 'A catalog model alias the evaluation may run (1-4; repeat the flag)',
|
|
38
|
+
required: true,
|
|
39
|
+
multiple: true,
|
|
40
|
+
}),
|
|
41
|
+
daemon: core_1.Flags.string({
|
|
42
|
+
description: 'Daemon id of your Hosted Machine or Dedicated Runtime (from `skrr harnesses list`)',
|
|
43
|
+
required: true,
|
|
44
|
+
}),
|
|
45
|
+
'ttl-minutes': core_1.Flags.integer({ description: 'How long it lasts (5-360, default 120)' }),
|
|
46
|
+
'max-spend-usd': core_1.Flags.string({
|
|
47
|
+
description: 'Cap on what its turns may commit, in USD (0.5-10, default 4): settled turns count what they settled, unsettled ones their worst case',
|
|
48
|
+
}),
|
|
49
|
+
reason: core_1.Flags.string({
|
|
50
|
+
description: 'Why (8-512 characters). Recorded on the grant with your account.',
|
|
51
|
+
required: true,
|
|
52
|
+
}),
|
|
53
|
+
'no-rescan': core_1.Flags.boolean({
|
|
54
|
+
description: 'Do not ask the daemon to re-register now',
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
this.requireAuth();
|
|
59
|
+
const { args, flags } = await this.parse(HarnessesEvaluationsGrant);
|
|
60
|
+
const maxSpendUsd = flags['max-spend-usd'] === undefined ? undefined : Number(flags['max-spend-usd']);
|
|
61
|
+
if (maxSpendUsd !== undefined && !Number.isFinite(maxSpendUsd)) {
|
|
62
|
+
this.error('--max-spend-usd must be a number', { exit: 2 });
|
|
63
|
+
}
|
|
64
|
+
let result;
|
|
65
|
+
try {
|
|
66
|
+
result = await (0, harness_evaluations_1.grantHarnessEvaluation)({
|
|
67
|
+
harness: args.harness,
|
|
68
|
+
version: flags.version,
|
|
69
|
+
models: flags.model,
|
|
70
|
+
daemonId: flags.daemon,
|
|
71
|
+
reason: flags.reason,
|
|
72
|
+
...(flags['ttl-minutes'] !== undefined ? { ttlMinutes: flags['ttl-minutes'] } : {}),
|
|
73
|
+
...(maxSpendUsd !== undefined ? { maxSpendUsd } : {}),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
this.handleApiError(err);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let rescan = null;
|
|
81
|
+
if (!flags['no-rescan']) {
|
|
82
|
+
try {
|
|
83
|
+
const response = await (0, harness_evaluations_1.rescanDaemonHarnesses)(result.grant.daemonId);
|
|
84
|
+
rescan =
|
|
85
|
+
response.success === false
|
|
86
|
+
? { ok: false, message: 'The daemon did not confirm its harness rescan' }
|
|
87
|
+
: { ok: true };
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
rescan = { ok: false, message: err.message };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (flags.json) {
|
|
94
|
+
this.log(JSON.stringify({ ...result, rescan }, null, 2));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const { grant } = result;
|
|
98
|
+
this.log(`Granted ${grant.grantId}: ${grant.harness} ${grant.version} may run ${grant.models.join(', ')} ` +
|
|
99
|
+
`on daemon ${grant.daemonId} for your turns until ${grant.expiresAt}, up to $${grant.maxSpendUsd.toFixed(2)}.`);
|
|
100
|
+
if (rescan?.ok) {
|
|
101
|
+
this.log('The daemon re-registered; `skrr harnesses list --daemon <id>` should show the row as evaluating.');
|
|
102
|
+
}
|
|
103
|
+
else if (rescan) {
|
|
104
|
+
this.log(`The daemon did not re-register (${rescan.message}). The grant takes effect at its next successful registration; retry the harness rescan when the machine is available.`);
|
|
105
|
+
}
|
|
106
|
+
this.log('Pin an agent to that Harness row to run it; nobody else, and no other machine, is admitted.');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.default = HarnessesEvaluationsGrant;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
import { type HarnessEvaluationGrant } from '../../../lib/harness-evaluations';
|
|
3
|
+
/** One table row per grant. */
|
|
4
|
+
export declare function evaluationRows(grants: HarnessEvaluationGrant[]): Array<Record<string, string>>;
|
|
5
|
+
/** Your harness evaluations on platform machines (OSK-24597). */
|
|
6
|
+
export default class HarnessesEvaluationsList extends BaseCommand {
|
|
7
|
+
static aliases: string[];
|
|
8
|
+
static description: string;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static flags: {
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
harness: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
daemon: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'include-ended': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluationRows = evaluationRows;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const format_1 = require("../../../lib/format");
|
|
7
|
+
const list_output_1 = require("../../../lib/list-output");
|
|
8
|
+
const harness_evaluations_1 = require("../../../lib/harness-evaluations");
|
|
9
|
+
/** One table row per grant. */
|
|
10
|
+
function evaluationRows(grants) {
|
|
11
|
+
return grants.map((grant) => ({
|
|
12
|
+
grant: grant.grantId,
|
|
13
|
+
harness: `${grant.harness} ${grant.version}`,
|
|
14
|
+
models: grant.models.join(', '),
|
|
15
|
+
daemon: grant.daemonId,
|
|
16
|
+
state: (0, harness_evaluations_1.harnessEvaluationStateLabel)(grant),
|
|
17
|
+
turns: String(grant.admissions.length),
|
|
18
|
+
cap: `$${grant.maxSpendUsd.toFixed(2)}`,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
/** Your harness evaluations on platform machines (OSK-24597). */
|
|
22
|
+
class HarnessesEvaluationsList extends base_command_1.BaseCommand {
|
|
23
|
+
static aliases = ['harnesses:evaluations:list'];
|
|
24
|
+
static description = 'List your harness evaluations on platform machines (platform admins)';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> harnesses evaluations list',
|
|
27
|
+
'<%= config.bin %> harnesses evaluations list --harness pi --include-ended --json',
|
|
28
|
+
];
|
|
29
|
+
static flags = {
|
|
30
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
31
|
+
harness: core_1.Flags.string({ description: 'Only this harness (for example pi)' }),
|
|
32
|
+
daemon: core_1.Flags.string({ description: 'Only this daemon id' }),
|
|
33
|
+
'include-ended': core_1.Flags.boolean({ description: 'Include expired and withdrawn grants' }),
|
|
34
|
+
limit: core_1.Flags.integer({ description: 'At most this many grants (default 50, up to 200)' }),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
this.requireAuth();
|
|
38
|
+
const { flags } = await this.parse(HarnessesEvaluationsList);
|
|
39
|
+
let result;
|
|
40
|
+
try {
|
|
41
|
+
result = await (0, harness_evaluations_1.listHarnessEvaluations)({
|
|
42
|
+
harness: flags.harness,
|
|
43
|
+
daemonId: flags.daemon,
|
|
44
|
+
includeEnded: flags['include-ended'],
|
|
45
|
+
limit: flags.limit,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
this.handleApiError(err);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (flags.json) {
|
|
53
|
+
this.printJsonResult((0, list_output_1.listResult)(result.grants));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (result.grants.length === 0) {
|
|
57
|
+
this.log(flags['include-ended']
|
|
58
|
+
? 'You have no harness evaluations.'
|
|
59
|
+
: 'You have no harness evaluation in force; --include-ended lists ended ones.');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
(0, format_1.renderTable)(evaluationRows(result.grants), [
|
|
63
|
+
{ key: 'grant', header: 'GRANT' },
|
|
64
|
+
{ key: 'harness', header: 'HARNESS' },
|
|
65
|
+
{ key: 'models', header: 'MODELS', maxWidth: 32 },
|
|
66
|
+
{ key: 'daemon', header: 'DAEMON' },
|
|
67
|
+
{ key: 'state', header: 'STATE' },
|
|
68
|
+
{ key: 'turns', header: 'TURNS' },
|
|
69
|
+
{ key: 'cap', header: 'CAP' },
|
|
70
|
+
], (line) => this.log(line));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = HarnessesEvaluationsList;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Withdraw a harness evaluation (OSK-24597). The next registration stops offering the harness,
|
|
4
|
+
* and the next plan and admission refuse it; a turn already running keeps its lease until that
|
|
5
|
+
* lease ends. Any platform admin may withdraw any grant.
|
|
6
|
+
*/
|
|
7
|
+
export default class HarnessesEvaluationsRevoke extends BaseCommand {
|
|
8
|
+
static aliases: string[];
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static args: {
|
|
12
|
+
grantId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
reason: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../../base-command");
|
|
5
|
+
const harness_evaluations_1 = require("../../../lib/harness-evaluations");
|
|
6
|
+
/**
|
|
7
|
+
* Withdraw a harness evaluation (OSK-24597). The next registration stops offering the harness,
|
|
8
|
+
* and the next plan and admission refuse it; a turn already running keeps its lease until that
|
|
9
|
+
* lease ends. Any platform admin may withdraw any grant.
|
|
10
|
+
*/
|
|
11
|
+
class HarnessesEvaluationsRevoke extends base_command_1.BaseCommand {
|
|
12
|
+
static aliases = ['harnesses:evaluations:revoke'];
|
|
13
|
+
static description = 'Withdraw a harness evaluation (platform admins)';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> harnesses evaluations revoke hevg_<id> --reason "H9 cells recorded"',
|
|
16
|
+
];
|
|
17
|
+
static args = {
|
|
18
|
+
grantId: core_1.Args.string({ ignoreStdin: true, description: 'Grant id (hevg_...)', required: true }),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
22
|
+
reason: core_1.Flags.string({
|
|
23
|
+
description: 'Why (8-512 characters). Recorded on the grant with your account.',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
this.requireAuth();
|
|
29
|
+
const { args, flags } = await this.parse(HarnessesEvaluationsRevoke);
|
|
30
|
+
let result;
|
|
31
|
+
try {
|
|
32
|
+
result = await (0, harness_evaluations_1.revokeHarnessEvaluation)(args.grantId, flags.reason);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
this.log(JSON.stringify(result, null, 2));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.log(`Withdrew ${result.grant.grantId} (${result.grant.harness} on daemon ${result.grant.daemonId}) after ${result.grant.admissions.length} turns.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = HarnessesEvaluationsRevoke;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** One of your harness evaluations, with every turn it admitted (OSK-24597). */
|
|
3
|
+
export default class HarnessesEvaluationsShow extends BaseCommand {
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static args: {
|
|
8
|
+
grantId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../../base-command");
|
|
5
|
+
const harness_evaluations_1 = require("../../../lib/harness-evaluations");
|
|
6
|
+
/** One of your harness evaluations, with every turn it admitted (OSK-24597). */
|
|
7
|
+
class HarnessesEvaluationsShow extends base_command_1.BaseCommand {
|
|
8
|
+
static aliases = ['harnesses:evaluations:show'];
|
|
9
|
+
static description = 'Show one of your harness evaluations (platform admins)';
|
|
10
|
+
static examples = ['<%= config.bin %> harnesses evaluations show hevg_<id>'];
|
|
11
|
+
static args = {
|
|
12
|
+
grantId: core_1.Args.string({ ignoreStdin: true, description: 'Grant id (hevg_...)', required: true }),
|
|
13
|
+
};
|
|
14
|
+
static flags = {
|
|
15
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireAuth();
|
|
19
|
+
const { args, flags } = await this.parse(HarnessesEvaluationsShow);
|
|
20
|
+
let result;
|
|
21
|
+
try {
|
|
22
|
+
result = await (0, harness_evaluations_1.showHarnessEvaluation)(args.grantId);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
this.handleApiError(err);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
this.log(JSON.stringify(result, null, 2));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const { grant } = result;
|
|
33
|
+
this.log(`${grant.grantId} ${grant.harness} ${grant.version} on daemon ${grant.daemonId}`);
|
|
34
|
+
this.log(` state ${(0, harness_evaluations_1.harnessEvaluationStateLabel)(grant)}`);
|
|
35
|
+
this.log(` models ${grant.models.join(', ')}`);
|
|
36
|
+
this.log(` cap $${grant.maxSpendUsd.toFixed(2)}`);
|
|
37
|
+
this.log(` reason ${grant.grantReason}`);
|
|
38
|
+
if (grant.revokeReason)
|
|
39
|
+
this.log(` revoked ${grant.revokeReason}`);
|
|
40
|
+
this.log(` turns ${grant.admissions.length}`);
|
|
41
|
+
for (const turn of grant.admissions) {
|
|
42
|
+
this.log(` ${turn.at} ${turn.model} up to $${turn.authorizedUsd.toFixed(2)} reservation ${turn.reservationId}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = HarnessesEvaluationsShow;
|
|
@@ -130,7 +130,13 @@ const MANAGED_REGISTRATION_SOURCES = new Set([
|
|
|
130
130
|
* machine replaced; the filter accepted only online|offline, so the one value
|
|
131
131
|
* that says "never coming back" could be read and never selected.
|
|
132
132
|
*/
|
|
133
|
-
exports.HARNESS_STATUS_FILTERS = [
|
|
133
|
+
exports.HARNESS_STATUS_FILTERS = [
|
|
134
|
+
'online',
|
|
135
|
+
'offline',
|
|
136
|
+
'unconfirmed',
|
|
137
|
+
'unknown',
|
|
138
|
+
'superseded',
|
|
139
|
+
];
|
|
134
140
|
/**
|
|
135
141
|
* The status to ask the SERVER for. Only `online` narrows there.
|
|
136
142
|
*
|
|
@@ -530,7 +536,10 @@ class HarnessesList extends base_command_1.BaseCommand {
|
|
|
530
536
|
const tableRows = selection.visible.map((r) => ({
|
|
531
537
|
id: (0, format_1.formatCell)(r._id),
|
|
532
538
|
name: harnessNameCell(r),
|
|
533
|
-
|
|
539
|
+
// OSK-24597 — a row offered under an evaluation grant says so beside its provider.
|
|
540
|
+
provider: (0, harness_labels_1.harnessEvaluationLabel)(r)
|
|
541
|
+
? `${(0, harness_labels_1.harnessProviderLabel)(r.provider)} (evaluating)`
|
|
542
|
+
: (0, harness_labels_1.harnessProviderLabel)(r.provider),
|
|
534
543
|
status: (0, harness_labels_1.harnessStatusLabel)(r),
|
|
535
544
|
readiness: readiness?.lookup(r)?.label ?? '-',
|
|
536
545
|
default: defaultMarker(r._id, res),
|
|
@@ -122,6 +122,11 @@ class HarnessesShow extends base_command_1.BaseCommand {
|
|
|
122
122
|
}
|
|
123
123
|
this.log(` mode ${harness.harnessLocation ?? 'unknown'}`);
|
|
124
124
|
this.log(` status ${(0, harness_labels_1.harnessStatusLabel)(harness)}`);
|
|
125
|
+
// OSK-24597 — a harness still evaluating on platform machines, offered here
|
|
126
|
+
// under its owner's evaluation grant.
|
|
127
|
+
const evaluation = (0, harness_labels_1.harnessEvaluationLabel)(harness);
|
|
128
|
+
if (evaluation)
|
|
129
|
+
this.log(` evaluation ${evaluation}`);
|
|
125
130
|
// Only for the claude provider. The daemon stamps `claudeEngine` on every
|
|
126
131
|
// harness it registers, so printing it whenever it is set labels a
|
|
127
132
|
// first-party harness or `codex` row with how CLAUDE Code would run — a fact about a
|