@skrr-ai/cli 0.1.178 → 0.1.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/commands/code/index.js +5 -0
  2. package/dist/commands/diagnostics/inference-smoke.d.ts +13 -0
  3. package/dist/commands/diagnostics/inference-smoke.js +50 -0
  4. package/dist/commands/harnesses/evaluations/evidence.d.ts +22 -0
  5. package/dist/commands/harnesses/evaluations/evidence.js +92 -0
  6. package/dist/commands/harnesses/evaluations/fixed-tool.d.ts +10 -0
  7. package/dist/commands/harnesses/evaluations/fixed-tool.js +189 -0
  8. package/dist/commands/harnesses/evaluations/grant.d.ts +30 -0
  9. package/dist/commands/harnesses/evaluations/grant.js +109 -0
  10. package/dist/commands/harnesses/evaluations/list.d.ts +18 -0
  11. package/dist/commands/harnesses/evaluations/list.js +73 -0
  12. package/dist/commands/harnesses/evaluations/platform-h9-turn.d.ts +13 -0
  13. package/dist/commands/harnesses/evaluations/platform-h9-turn.js +322 -0
  14. package/dist/commands/harnesses/evaluations/revoke.d.ts +19 -0
  15. package/dist/commands/harnesses/evaluations/revoke.js +45 -0
  16. package/dist/commands/harnesses/evaluations/show.d.ts +14 -0
  17. package/dist/commands/harnesses/evaluations/show.js +46 -0
  18. package/dist/commands/harnesses/list.d.ts +1 -0
  19. package/dist/commands/harnesses/list.js +11 -2
  20. package/dist/commands/harnesses/show.js +5 -0
  21. package/dist/commands/machines/hosted/identity-evaluations/issue.d.ts +12 -0
  22. package/dist/commands/machines/hosted/identity-evaluations/issue.js +40 -0
  23. package/dist/commands/machines/hosted/identity-evaluations/revoke.d.ts +11 -0
  24. package/dist/commands/machines/hosted/identity-evaluations/revoke.js +21 -0
  25. package/dist/commands/machines/hosted/identity-evaluations/show.d.ts +8 -0
  26. package/dist/commands/machines/hosted/identity-evaluations/show.js +20 -0
  27. package/dist/commands/machines/hosted/start.d.ts +1 -0
  28. package/dist/commands/machines/hosted/start.js +6 -0
  29. package/dist/lib/agentic-stream.d.ts +3 -0
  30. package/dist/lib/agentic-stream.js +63 -1
  31. package/dist/lib/copilot-fixed-probe-runner.d.ts +72 -0
  32. package/dist/lib/copilot-fixed-probe-runner.js +213 -0
  33. package/dist/lib/copilot-fixed-probe.d.ts +61 -0
  34. package/dist/lib/copilot-fixed-probe.js +223 -0
  35. package/dist/lib/first-party-harness-broker.d.ts +5 -0
  36. package/dist/lib/first-party-harness-broker.js +99 -0
  37. package/dist/lib/h9-platform-stream.d.ts +63 -0
  38. package/dist/lib/h9-platform-stream.js +317 -0
  39. package/dist/lib/h9-prior-stream.d.ts +44 -0
  40. package/dist/lib/h9-prior-stream.js +217 -0
  41. package/dist/lib/harness-evaluations.d.ts +251 -0
  42. package/dist/lib/harness-evaluations.js +66 -0
  43. package/dist/lib/harness-labels.d.ts +10 -0
  44. package/dist/lib/harness-labels.js +23 -0
  45. package/dist/lib/hosted-identity-evaluations.d.ts +26 -0
  46. package/dist/lib/hosted-identity-evaluations.js +18 -0
  47. package/dist/lib/hosted-machines.d.ts +1 -0
  48. package/dist/lib/inference-overload-smoke-contract.d.ts +53 -0
  49. package/dist/lib/inference-overload-smoke-contract.js +192 -0
  50. package/dist/lib/inference-overload-smoke.d.ts +78 -0
  51. package/dist/lib/inference-overload-smoke.js +350 -0
  52. package/dist/lib/operator-probe-files.d.ts +6 -0
  53. package/dist/lib/operator-probe-files.js +68 -0
  54. package/dist/lib/platform-h9-plan.d.ts +47 -0
  55. package/dist/lib/platform-h9-plan.js +78 -0
  56. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/codex-model-catalog.json +150 -0
  57. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.d.ts +12 -2
  58. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/inferenceBrokerHarnesses.js +12 -5
  59. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.d.ts +12 -2
  60. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/inferenceBrokerHarnesses.js +21 -7
  61. package/dist/node_modules/@skrr-ai/data-provider/index.js +6 -6
  62. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.d.ts +3 -1
  63. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/index.js +23 -1
  64. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-haiku-none.d.ts +8 -0
  65. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-haiku-none.js +40 -0
  66. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.d.ts +11 -20
  67. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +88 -9
  68. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/overload-smoke.d.ts +56 -0
  69. package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/overload-smoke.js +277 -0
  70. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.d.ts +3 -1
  71. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/index.js +3 -1
  72. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-haiku-none.d.ts +8 -0
  73. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-haiku-none.js +20 -0
  74. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.d.ts +11 -20
  75. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +105 -12
  76. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/overload-smoke.d.ts +56 -0
  77. package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/overload-smoke.js +261 -0
  78. package/oclif.manifest.json +1391 -443
  79. package/package.json +5 -2
@@ -0,0 +1,322 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const node_path_1 = require("node:path");
5
+ const node_stream_1 = require("node:stream");
6
+ const data_provider_1 = require("@skrr-ai/data-provider");
7
+ const base_command_1 = require("../../../base-command");
8
+ const agentic_stream_1 = require("../../../lib/agentic-stream");
9
+ const api_fetch_1 = require("../../../lib/api-fetch");
10
+ const harnesses_1 = require("../../../lib/harnesses");
11
+ const harness_evaluations_1 = require("../../../lib/harness-evaluations");
12
+ const h9_platform_stream_1 = require("../../../lib/h9-platform-stream");
13
+ const h9_prior_stream_1 = require("../../../lib/h9-prior-stream");
14
+ const copilot_fixed_probe_1 = require("../../../lib/copilot-fixed-probe");
15
+ const operator_probe_files_1 = require("../../../lib/operator-probe-files");
16
+ const platform_h9_plan_1 = require("../../../lib/platform-h9-plan");
17
+ const id = (value) => typeof value === 'string' && /^[A-Za-z0-9][A-Za-z0-9_.:@-]{0,239}$/.test(value);
18
+ /** Internal adapter for the checked-in fixed platform scenarios. */
19
+ class HarnessesEvaluationsPlatformH9Turn extends base_command_1.BaseCommand {
20
+ static hidden = true;
21
+ static description = 'Submit one fixed turn of a reviewed platform qualification';
22
+ static flags = {
23
+ plan: core_1.Flags.string({ required: true }),
24
+ go: core_1.Flags.string({ required: true }),
25
+ label: core_1.Flags.string({ required: true, options: [...h9_platform_stream_1.H9_TURN_LABELS] }),
26
+ conversation: core_1.Flags.string(),
27
+ };
28
+ async run() {
29
+ const { flags } = await this.parse(HarnessesEvaluationsPlatformH9Turn);
30
+ const file = (0, operator_probe_files_1.privatePlan)(flags.plan);
31
+ if ((0, operator_probe_files_1.sha)(file.raw) !== flags.go)
32
+ throw new Error('H9_EXACT_PLAN_DIGEST_REQUIRED');
33
+ const plan = (0, platform_h9_plan_1.platformH9Plan)(JSON.parse(file.raw.toString('utf8')));
34
+ const expectedHarness = (0, platform_h9_plan_1.platformH9Harness)(plan);
35
+ const workspaceId = plan.workspaceId;
36
+ const scopeHeaders = { 'X-Workspace-Id': workspaceId ?? '' };
37
+ const label = flags.label;
38
+ const labels = (0, platform_h9_plan_1.platformH9Labels)(plan);
39
+ const ordinal = labels.indexOf(label);
40
+ if (ordinal < 0) {
41
+ throw new Error(plan.priorStream ? 'H9_PRIOR_STREAM_ALREADY_COVERED' : 'H9_LABEL_OUTSIDE_PLAN');
42
+ }
43
+ const requestId = (0, platform_h9_plan_1.platformH9RequestId)(plan, label);
44
+ if (['interrupt', 'recall'].includes(label)
45
+ ? !id(flags.conversation)
46
+ : flags.conversation !== undefined)
47
+ throw new Error('H9_CONVERSATION_SCOPE');
48
+ this.requireAuth();
49
+ if (new URL(this.cliConfig.baseURL).origin !== plan.origin ||
50
+ process.env.OVERSKY_AUTONOMOUS_SESSION === '1')
51
+ throw new Error('H9_EXACT_HUMAN_ORIGIN_REQUIRED');
52
+ const cancelled = new AbortController();
53
+ const interrupt = () => cancelled.abort();
54
+ const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
55
+ for (const signal of signals)
56
+ process.on(signal, interrupt);
57
+ const sink = new node_stream_1.Writable({
58
+ write(_chunk, _encoding, done) {
59
+ done();
60
+ },
61
+ });
62
+ const emit = (event) => process.stdout.write(JSON.stringify(event) + '\n');
63
+ try {
64
+ const [principal, agent, { harness }, { machine }, readback] = await Promise.all([
65
+ this.resolveCurrentUserId(),
66
+ workspaceId
67
+ ? (0, api_fetch_1.apiFetch)(`/api/agents/${encodeURIComponent(plan.agentId)}`, {
68
+ headers: scopeHeaders,
69
+ credential: this.resolvedCredential,
70
+ singleAttempt: true,
71
+ })
72
+ : data_provider_1.dataService.getAgentById({ agent_id: plan.agentId }),
73
+ (0, harnesses_1.getHarness)(plan.harnessId),
74
+ (0, harness_evaluations_1.harnessEvaluationEvidence)(plan.grantId),
75
+ (0, harness_evaluations_1.harnessEvaluationFinancialEvidence)(plan.grantId, workspaceId),
76
+ ]);
77
+ const { grant, financial } = readback;
78
+ const a = agent, h = harness;
79
+ const targets = a?.executionPolicy?.targets?.filter((target) => target.enabled !== false);
80
+ const grantBinding = grant.modelBindings?.[0];
81
+ if (principal !== plan.ownerUserId ||
82
+ grant.ownerUserId !== principal ||
83
+ grant.grantId !== plan.grantId ||
84
+ grant.harness !== expectedHarness ||
85
+ grant.version !== plan.version ||
86
+ grant.daemonId !== plan.daemonId ||
87
+ grant.maxSpendUsd !== 2 ||
88
+ !grant.active ||
89
+ grant.models?.length !== 1 ||
90
+ grant.models[0] !== plan.model ||
91
+ grant.modelBindings?.length !== 1 ||
92
+ grantBinding?.requestedAlias !== plan.model ||
93
+ grantBinding.gatewayAlias !== plan.model ||
94
+ grantBinding.upstreamProvider !== 'anthropic' ||
95
+ !/^[a-f0-9]{64}$/.test(grantBinding.bindingDigest) ||
96
+ (a?.id ?? a?.agent_id) !== plan.agentId ||
97
+ a.author !== principal ||
98
+ a.model !== plan.model ||
99
+ (workspaceId
100
+ ? a.workspaceId !== workspaceId ||
101
+ (a.homeWorkspaceId != null && a.homeWorkspaceId !== workspaceId) ||
102
+ a.isPublic !== false
103
+ : a.workspaceId != null || a.homeWorkspaceId != null) ||
104
+ a.executionPolicy?.mode !== 'ordered' ||
105
+ targets?.length !== 1 ||
106
+ targets[0].kind !== 'harness' ||
107
+ targets[0].harnessId !== plan.harnessId ||
108
+ (targets[0].advanceOn?.length ?? 0) !== 0 ||
109
+ (h?.id ?? h?._id) !== plan.harnessId ||
110
+ h.provider !== expectedHarness ||
111
+ h.daemonId !== plan.daemonId ||
112
+ h.metadata?.cliVersion !== plan.version ||
113
+ h.metadata?.evaluation?.grantId !== plan.grantId ||
114
+ h.metadata?.evaluation?.version !== plan.version ||
115
+ machine.daemonId !== plan.daemonId ||
116
+ machine.image !== plan.image ||
117
+ machine.unavailable ||
118
+ !['hosted-machine', 'dedicated-machine'].includes(machine.machineProduct ?? '') ||
119
+ ((plan.completionOnly || expectedHarness === 'copilot-sdk') &&
120
+ machine.machineProduct !== 'dedicated-machine') ||
121
+ !id(machine.machineUuid) ||
122
+ machine.machineUuid !== grant.machineUuid)
123
+ throw new Error('H9_EXACT_OWNER_GRANT_RUNTIME_REQUIRED');
124
+ const committed = financial.totals?.providerSettledUsd;
125
+ if (grant.admissions?.length !== ordinal ||
126
+ financial.grantId !== plan.grantId ||
127
+ financial.workspaceId !== workspaceId ||
128
+ financial.bindingDigest !== grantBinding.bindingDigest ||
129
+ financial.state !== 'closed' ||
130
+ financial.outstandingReservations !== 0 ||
131
+ financial.turns?.length !== ordinal ||
132
+ financial.turns.some((turn, i) => turn.state !== 'closed' ||
133
+ turn.closure !== 'provider_spend_reconciled' ||
134
+ turn.reservationId !== grant.admissions[i]?.reservationId ||
135
+ turn.sessionId !== grant.admissions[i]?.sessionId) ||
136
+ financial.providerAuthorizationUsd !== 1 ||
137
+ financial.customerQuoteUsageMicros !== 1_250_000 ||
138
+ !financial.priceBookVersion ||
139
+ typeof committed !== 'number' ||
140
+ !Number.isFinite(committed) ||
141
+ committed < 0 ||
142
+ committed + 1 > 2 + 1e-9)
143
+ throw new Error('H9_PREVIOUS_EXPOSURE_OR_QUOTE_UNPROVEN');
144
+ const receiptPath = (turn) => (0, node_path_1.join)((0, node_path_1.dirname)(file.absolute), `${plan.operationId}.${turn}.recovery.json`);
145
+ if (plan.priorStream || plan.completionOnly) {
146
+ for (const [index, previous] of labels.slice(0, ordinal).entries()) {
147
+ const receipt = JSON.parse((0, operator_probe_files_1.privatePlan)(receiptPath(previous)).raw.toString('utf8'));
148
+ if (receipt?.planSha256 !== flags.go ||
149
+ receipt.label !== previous ||
150
+ receipt.requestId !== (0, platform_h9_plan_1.platformH9RequestId)(plan, previous) ||
151
+ receipt.grantId !== plan.grantId ||
152
+ receipt.agentId !== plan.agentId ||
153
+ receipt.workspaceId !== workspaceId ||
154
+ receipt.state !== 'terminal_observed' ||
155
+ receipt.successful !== true ||
156
+ receipt.sessionId !== financial.turns[index].sessionId ||
157
+ (previous === 'toolCalls' &&
158
+ (receipt.permissionRecorded !== true || receipt.toolVerified !== true)) ||
159
+ (['remember', 'interrupt'].includes(previous) &&
160
+ ['interrupt', 'recall'].includes(label) &&
161
+ receipt.conversationId !== flags.conversation))
162
+ throw new Error('H9_PREVIOUS_ORDERED_TURN_UNPROVEN');
163
+ }
164
+ }
165
+ if (plan.priorStream && ordinal === 0) {
166
+ const stream = (0, h9_prior_stream_1.capturedH9Stream)(plan, expectedHarness, machine.machineProduct);
167
+ const [priorFinance, priorEvidence] = await Promise.all([
168
+ (0, harness_evaluations_1.harnessEvaluationFinancialEvidence)(stream.grantId, workspaceId),
169
+ (0, harness_evaluations_1.harnessEvaluationEvidence)(stream.grantId, { gateway: true }),
170
+ ]);
171
+ emit({
172
+ type: 'h9.prior_stream_verified',
173
+ ...(0, h9_prior_stream_1.bindH9PriorStreamSettlement)(plan, stream, priorFinance, priorEvidence, grantBinding),
174
+ });
175
+ }
176
+ const deadline = Math.min(Date.now() + 60_000, Date.parse(grant.expiresAt ?? ''), Date.parse(plan.expiresAt));
177
+ if (cancelled.signal.aborted || !Number.isFinite(deadline) || deadline <= Date.now() + 10_000)
178
+ throw new Error('H9_TIMELINE_EXHAUSTED');
179
+ const recover = receiptPath(label);
180
+ const identity = {
181
+ planSha256: flags.go,
182
+ label,
183
+ requestId,
184
+ agentId: plan.agentId,
185
+ grantId: plan.grantId,
186
+ ...(workspaceId ? { workspaceId } : {}),
187
+ ...(expectedHarness === 'copilot-sdk' && label === 'toolCalls'
188
+ ? { scratchDirectory: (0, copilot_fixed_probe_1.copilotPlatformScratchDirectory)(plan.nonce) }
189
+ : {}),
190
+ };
191
+ (0, operator_probe_files_1.durable)(recover, { ...identity, state: 'start_may_be_unacknowledged' }, true);
192
+ // Issue exactly one normal start with no credential, transport or idempotency retry.
193
+ const accepted = await (0, api_fetch_1.apiFetch)('/api/agentic/chat', {
194
+ method: 'POST',
195
+ singleAttempt: true,
196
+ headers: scopeHeaders,
197
+ credential: this.resolvedCredential,
198
+ signal: AbortSignal.any([
199
+ cancelled.signal,
200
+ AbortSignal.timeout(Math.max(1, deadline - Date.now())),
201
+ ]),
202
+ body: {
203
+ endpoint: 'agents',
204
+ endpointType: 'agents',
205
+ agent_id: plan.agentId,
206
+ endpointOption: { endpoint: 'agents', agent_id: plan.agentId },
207
+ conversationId: flags.conversation ?? 'new',
208
+ clientRequestId: requestId,
209
+ executionEnvironment: 'local',
210
+ preferredDaemonId: plan.daemonId,
211
+ permissionMode: 'default',
212
+ text: (0, h9_platform_stream_1.h9FixedPrompt)(label, plan.nonce, expectedHarness),
213
+ },
214
+ });
215
+ const admittedIds = {
216
+ sessionId: id(accepted.sessionId) ? accepted.sessionId : null,
217
+ conversationId: id(accepted.conversationId) ? accepted.conversationId : null,
218
+ responseMessageId: id(accepted.responseMessageId) ? accepted.responseMessageId : null,
219
+ };
220
+ const scope = {
221
+ agentId: plan.agentId,
222
+ harnessId: plan.harnessId,
223
+ harness: expectedHarness,
224
+ workspaceId,
225
+ daemonId: plan.daemonId,
226
+ conversationId: flags.conversation,
227
+ };
228
+ try {
229
+ (0, operator_probe_files_1.durable)(recover, { ...identity, ...admittedIds, state: 'accepted' });
230
+ (0, h9_platform_stream_1.validateH9Acceptance)(accepted, scope);
231
+ emit({ type: 'run.accepted', ...admittedIds });
232
+ const summary = await (0, h9_platform_stream_1.streamH9PlatformTurn)({
233
+ label,
234
+ nonce: plan.nonce,
235
+ accepted,
236
+ scope,
237
+ deadline,
238
+ baseURL: this.cliConfig.baseURL,
239
+ token: this.resolvedCredential.token,
240
+ signal: cancelled.signal,
241
+ replayEnvelopes: (from) => (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(accepted.sessionId)}/envelopes?from=${from}&limit=500`, {
242
+ credential: this.resolvedCredential,
243
+ headers: scopeHeaders,
244
+ signal: AbortSignal.timeout(5000),
245
+ }),
246
+ readResponseMessage: () => (0, api_fetch_1.apiFetch)(`/api/messages/${encodeURIComponent(accepted.conversationId)}/${encodeURIComponent(accepted.responseMessageId)}`, {
247
+ credential: this.resolvedCredential,
248
+ headers: scopeHeaders,
249
+ signal: AbortSignal.timeout(5000),
250
+ singleAttempt: true,
251
+ }),
252
+ onEvent: emit,
253
+ });
254
+ const observed = {
255
+ successful: summary.successful,
256
+ cancelledAtMs: summary.cancelRequestedAtMs,
257
+ permissionRecorded: summary.permission?.permissionRecorded === true,
258
+ toolVerified: summary.permission?.toolVerified === true,
259
+ status: summary.result.status,
260
+ };
261
+ const permission = summary.permission;
262
+ (0, operator_probe_files_1.durable)(recover, {
263
+ ...identity,
264
+ ...admittedIds,
265
+ state: 'terminal_observed',
266
+ ...observed,
267
+ ...(permission?.permissionRecorded && permission.toolUseId && permission.requestId
268
+ ? {
269
+ permissionReceipt: {
270
+ toolUseId: permission.toolUseId,
271
+ requestId: permission.requestId,
272
+ scope: 'once',
273
+ },
274
+ }
275
+ : {}),
276
+ });
277
+ emit({ type: 'h9.turn.result', ...observed });
278
+ if (!summary.successful)
279
+ process.exitCode = 1;
280
+ }
281
+ catch (error) {
282
+ // A normal start may already have launched. Bind interruption to its actual returned session.
283
+ if (admittedIds.sessionId) {
284
+ const client = new agentic_stream_1.AgenticStreamClient({
285
+ baseURL: this.cliConfig.baseURL,
286
+ token: this.resolvedCredential.token,
287
+ sessionId: admittedIds.sessionId,
288
+ conversationId: admittedIds.conversationId ?? undefined,
289
+ workspaceId: workspaceId ?? '',
290
+ quiet: true,
291
+ output: sink,
292
+ statusOutput: sink,
293
+ attachTimeoutMs: 5000,
294
+ onEvent: (event) => {
295
+ if (event.type === 'session.joined')
296
+ client.cancel('H9 acceptance or completion unproved');
297
+ },
298
+ });
299
+ let timer;
300
+ try {
301
+ await Promise.race([
302
+ client.run(),
303
+ new Promise((resolve) => {
304
+ timer = setTimeout(resolve, 6000);
305
+ }),
306
+ ]);
307
+ }
308
+ finally {
309
+ clearTimeout(timer);
310
+ client.close();
311
+ }
312
+ }
313
+ throw error;
314
+ }
315
+ }
316
+ finally {
317
+ for (const signal of signals)
318
+ process.off(signal, interrupt);
319
+ }
320
+ }
321
+ }
322
+ exports.default = HarnessesEvaluationsPlatformH9Turn;
@@ -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;
@@ -19,6 +19,7 @@ export type HarnessRow = {
19
19
  metadata?: {
20
20
  machineProduct?: string;
21
21
  source?: string;
22
+ evaluation?: unknown;
22
23
  };
23
24
  /**
24
25
  * The name everyone else sees, when YOUR alias is covering it.
@@ -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 = ['online', 'offline', 'unconfirmed', 'unknown', 'superseded'];
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
- provider: (0, harness_labels_1.harnessProviderLabel)(r.provider),
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
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../../base-command';
2
+ export default class Issue extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ build: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
6
+ 'start-request': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ 'ttl-minutes': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
+ reason: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,40 @@
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 hosted_identity_evaluations_1 = require("../../../../lib/hosted-identity-evaluations");
6
+ class Issue extends base_command_1.BaseCommand {
7
+ static description = 'Explicitly authorize one fresh ordinary Hosted identity evaluation (signed-in platform admin)';
8
+ static flags = {
9
+ build: core_1.Flags.string({ description: 'Exact approved ordinary image build id', required: true }),
10
+ 'start-request': core_1.Flags.string({
11
+ description: 'Exact --request-id of the future start; never reusable for another authorization',
12
+ required: true,
13
+ }),
14
+ 'ttl-minutes': core_1.Flags.integer({
15
+ description: 'Expiry before initial bootstrap (1-30 minutes)',
16
+ default: 15,
17
+ }),
18
+ reason: core_1.Flags.string({ description: 'Recorded reason for this qualification', required: true }),
19
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
20
+ };
21
+ async run() {
22
+ this.requireAuth();
23
+ const { flags } = await this.parse(Issue);
24
+ try {
25
+ const result = await (0, hosted_identity_evaluations_1.issueHostedIdentityEvaluation)({
26
+ buildId: flags.build,
27
+ startRequestId: flags['start-request'],
28
+ ttlMinutes: flags['ttl-minutes'],
29
+ reason: flags.reason,
30
+ });
31
+ this.log(flags.json
32
+ ? JSON.stringify(result, null, 2)
33
+ : `Prepared ${result.capability.capabilityId} for request ${result.capability.startRequestId}; expires ${result.capability.expiresAt}. No machine was started.`);
34
+ }
35
+ catch (error) {
36
+ this.handleApiError(error);
37
+ }
38
+ }
39
+ }
40
+ exports.default = Issue;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../../base-command';
2
+ export default class Revoke extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ reason: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,21 @@
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 hosted_identity_evaluations_1 = require("../../../../lib/hosted-identity-evaluations");
6
+ class Revoke extends base_command_1.BaseCommand {
7
+ static description = 'Withdraw your Hosted identity evaluation authorization (never changes an already split machine)';
8
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
9
+ static flags = { reason: core_1.Flags.string({ required: true }) };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args, flags } = await this.parse(Revoke);
13
+ try {
14
+ this.log(JSON.stringify(await (0, hosted_identity_evaluations_1.revokeHostedIdentityEvaluation)(args.id, flags.reason), null, 2));
15
+ }
16
+ catch (error) {
17
+ this.handleApiError(error);
18
+ }
19
+ }
20
+ }
21
+ exports.default = Revoke;
@@ -0,0 +1,8 @@
1
+ import { BaseCommand } from '../../../../base-command';
2
+ export default class Show extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,20 @@
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 hosted_identity_evaluations_1 = require("../../../../lib/hosted-identity-evaluations");
6
+ class Show extends base_command_1.BaseCommand {
7
+ static description = 'Read your explicit Hosted identity evaluation authorization';
8
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
9
+ async run() {
10
+ this.requireAuth();
11
+ const { args } = await this.parse(Show);
12
+ try {
13
+ this.log(JSON.stringify(await (0, hosted_identity_evaluations_1.readHostedIdentityEvaluation)(args.id), null, 2));
14
+ }
15
+ catch (error) {
16
+ this.handleApiError(error);
17
+ }
18
+ }
19
+ }
20
+ exports.default = Show;
@@ -3,6 +3,7 @@ export default class HostedMachinesStart extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
+ 'identity-evaluation': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
7
  agent: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  conversation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -12,6 +12,9 @@ class HostedMachinesStart extends base_command_1.BaseCommand {
12
12
  '<%= config.bin %> machines hosted start --egress-policy open --idle-timeout 45m --json',
13
13
  ];
14
14
  static flags = {
15
+ 'identity-evaluation': core_1.Flags.string({
16
+ description: 'Explicit owner-bound admin-issued fresh identity evaluation capability',
17
+ }),
15
18
  agent: core_1.Flags.string({
16
19
  description: "Agent id (an agent you can view): applies that agent's declared network access. Use `agents attach-harness` to make it the agent default.",
17
20
  }),
@@ -64,6 +67,9 @@ class HostedMachinesStart extends base_command_1.BaseCommand {
64
67
  }
65
68
  const body = {
66
69
  clientRequestId: flags['request-id'] || newRequestId(),
70
+ ...(flags['identity-evaluation']
71
+ ? { identityEvaluationId: flags['identity-evaluation'] }
72
+ : {}),
67
73
  ...(flags.agent ? { agentId: flags.agent } : {}),
68
74
  ...(flags.conversation ? { conversationId: flags.conversation } : {}),
69
75
  ...(flags.environment ? { environmentId: flags.environment } : {}),