@oro-ai/sdk 0.6.8
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/README.md +206 -0
- package/dist/index.d.mts +2715 -0
- package/dist/index.d.ts +2715 -0
- package/dist/index.js +737 -0
- package/dist/index.mjs +644 -0
- package/package.json +64 -0
- package/src/generated/index.ts +3 -0
- package/src/generated/sdk.gen.ts +481 -0
- package/src/generated/types.gen.ts +2361 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2715 @@
|
|
|
1
|
+
import * as _hey_api_client_fetch from '@hey-api/client-fetch';
|
|
2
|
+
import { OptionsLegacyParser } from '@hey-api/client-fetch';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Response for suite activation.
|
|
6
|
+
*/
|
|
7
|
+
type ActivateSuiteResponse = {
|
|
8
|
+
/**
|
|
9
|
+
* Activated suite ID
|
|
10
|
+
*/
|
|
11
|
+
suite_id: number;
|
|
12
|
+
/**
|
|
13
|
+
* Suite version number
|
|
14
|
+
*/
|
|
15
|
+
suite_version: number;
|
|
16
|
+
/**
|
|
17
|
+
* Whether this suite is active
|
|
18
|
+
*/
|
|
19
|
+
is_active: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Reason for rejection of agent submission.
|
|
23
|
+
*/
|
|
24
|
+
type AdmissionReason = 'COOLDOWN' | 'INVALID_FILE' | 'NOT_REGISTERED_ONCHAIN' | 'BANNED' | 'NO_ACTIVE_SUITE';
|
|
25
|
+
/**
|
|
26
|
+
* Status of agent submission admission.
|
|
27
|
+
*/
|
|
28
|
+
type AdmissionStatus = 'ACCEPTED' | 'REJECTED';
|
|
29
|
+
/**
|
|
30
|
+
* 404 - Agent not found.
|
|
31
|
+
*/
|
|
32
|
+
type AgentNotFoundError = {
|
|
33
|
+
/**
|
|
34
|
+
* Error message describing what went wrong
|
|
35
|
+
*/
|
|
36
|
+
detail: string;
|
|
37
|
+
/**
|
|
38
|
+
* Error code for programmatic handling
|
|
39
|
+
*/
|
|
40
|
+
error_code?: "AGENT_NOT_FOUND";
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Public representation of an agent.
|
|
44
|
+
*/
|
|
45
|
+
type AgentPublic = {
|
|
46
|
+
/**
|
|
47
|
+
* Unique identifier for the agent
|
|
48
|
+
*/
|
|
49
|
+
agent_id: string;
|
|
50
|
+
/**
|
|
51
|
+
* Owner's hotkey
|
|
52
|
+
*/
|
|
53
|
+
miner_hotkey: string;
|
|
54
|
+
/**
|
|
55
|
+
* Human-readable name for the agent
|
|
56
|
+
*/
|
|
57
|
+
agent_name: string;
|
|
58
|
+
/**
|
|
59
|
+
* When the agent was created
|
|
60
|
+
*/
|
|
61
|
+
created_at: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Entry in agent version history list.
|
|
65
|
+
*/
|
|
66
|
+
type AgentVersionHistoryEntry = {
|
|
67
|
+
/**
|
|
68
|
+
* Version ID
|
|
69
|
+
*/
|
|
70
|
+
agent_version_id: string;
|
|
71
|
+
/**
|
|
72
|
+
* Version number within this agent (v1, v2, etc.)
|
|
73
|
+
*/
|
|
74
|
+
version_number: number;
|
|
75
|
+
/**
|
|
76
|
+
* Submission timestamp
|
|
77
|
+
*/
|
|
78
|
+
submitted_at: string;
|
|
79
|
+
/**
|
|
80
|
+
* Current state
|
|
81
|
+
*/
|
|
82
|
+
state: AgentVersionState;
|
|
83
|
+
/**
|
|
84
|
+
* Final score if eligible
|
|
85
|
+
*/
|
|
86
|
+
final_score?: (number | null);
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* 404 - Agent version not found.
|
|
90
|
+
*/
|
|
91
|
+
type AgentVersionNotFoundError = {
|
|
92
|
+
/**
|
|
93
|
+
* Error message describing what went wrong
|
|
94
|
+
*/
|
|
95
|
+
detail: string;
|
|
96
|
+
/**
|
|
97
|
+
* Error code for programmatic handling
|
|
98
|
+
*/
|
|
99
|
+
error_code?: "AGENT_VERSION_NOT_FOUND";
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Response for agent version problem progress.
|
|
103
|
+
*/
|
|
104
|
+
type AgentVersionProblemsResponse = {
|
|
105
|
+
/**
|
|
106
|
+
* Agent version ID
|
|
107
|
+
*/
|
|
108
|
+
agent_version_id: string;
|
|
109
|
+
/**
|
|
110
|
+
* Suite ID
|
|
111
|
+
*/
|
|
112
|
+
suite_id?: (number | null);
|
|
113
|
+
/**
|
|
114
|
+
* Problem progress list
|
|
115
|
+
*/
|
|
116
|
+
problems: Array<ProblemProgressEntry>;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Public representation of an agent version.
|
|
120
|
+
*/
|
|
121
|
+
type AgentVersionPublic = {
|
|
122
|
+
/**
|
|
123
|
+
* Unique identifier for this version
|
|
124
|
+
*/
|
|
125
|
+
agent_version_id: string;
|
|
126
|
+
/**
|
|
127
|
+
* Parent agent ID
|
|
128
|
+
*/
|
|
129
|
+
agent_id: string;
|
|
130
|
+
/**
|
|
131
|
+
* Agent name
|
|
132
|
+
*/
|
|
133
|
+
agent_name: string;
|
|
134
|
+
/**
|
|
135
|
+
* Owner's hotkey
|
|
136
|
+
*/
|
|
137
|
+
miner_hotkey: string;
|
|
138
|
+
/**
|
|
139
|
+
* Version number within this agent (v1, v2, etc.)
|
|
140
|
+
*/
|
|
141
|
+
version_number: number;
|
|
142
|
+
/**
|
|
143
|
+
* Suite this version was submitted for
|
|
144
|
+
*/
|
|
145
|
+
suite_id?: (number | null);
|
|
146
|
+
/**
|
|
147
|
+
* When this version was submitted
|
|
148
|
+
*/
|
|
149
|
+
submitted_at: string;
|
|
150
|
+
/**
|
|
151
|
+
* Final score if eligible
|
|
152
|
+
*/
|
|
153
|
+
latest_final_score?: (number | null);
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* State of an agent version evaluation.
|
|
157
|
+
*/
|
|
158
|
+
type AgentVersionState = 'RECEIVED' | 'QUEUED' | 'RUNNING' | 'ELIGIBLE' | 'DISCARDED' | 'CANCELLED';
|
|
159
|
+
/**
|
|
160
|
+
* Status response for an agent version.
|
|
161
|
+
*/
|
|
162
|
+
type AgentVersionStatus = {
|
|
163
|
+
/**
|
|
164
|
+
* Unique identifier for this version
|
|
165
|
+
*/
|
|
166
|
+
agent_version_id: string;
|
|
167
|
+
/**
|
|
168
|
+
* Agent name
|
|
169
|
+
*/
|
|
170
|
+
agent_name: string;
|
|
171
|
+
/**
|
|
172
|
+
* Owner's hotkey
|
|
173
|
+
*/
|
|
174
|
+
miner_hotkey: string;
|
|
175
|
+
/**
|
|
176
|
+
* Version number within this agent (v1, v2, etc.)
|
|
177
|
+
*/
|
|
178
|
+
version_number: number;
|
|
179
|
+
/**
|
|
180
|
+
* Suite ID
|
|
181
|
+
*/
|
|
182
|
+
suite_id?: (number | null);
|
|
183
|
+
/**
|
|
184
|
+
* Submission timestamp
|
|
185
|
+
*/
|
|
186
|
+
submitted_at: string;
|
|
187
|
+
/**
|
|
188
|
+
* Current state of the version
|
|
189
|
+
*/
|
|
190
|
+
state: AgentVersionState;
|
|
191
|
+
/**
|
|
192
|
+
* Required successful evaluations
|
|
193
|
+
*/
|
|
194
|
+
required_successes?: number;
|
|
195
|
+
/**
|
|
196
|
+
* Number of successful evaluations
|
|
197
|
+
*/
|
|
198
|
+
success_count?: number;
|
|
199
|
+
/**
|
|
200
|
+
* Number of active evaluations
|
|
201
|
+
*/
|
|
202
|
+
active_count?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Whether evaluation is closed
|
|
205
|
+
*/
|
|
206
|
+
is_closed?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Final score if eligible
|
|
209
|
+
*/
|
|
210
|
+
final_score?: (number | null);
|
|
211
|
+
/**
|
|
212
|
+
* Whether artifacts are released
|
|
213
|
+
*/
|
|
214
|
+
release_state?: ArtifactReleaseState;
|
|
215
|
+
/**
|
|
216
|
+
* Per-validator scores on success
|
|
217
|
+
*/
|
|
218
|
+
per_validator_success_scores?: ({
|
|
219
|
+
[key: string]: (number);
|
|
220
|
+
} | null);
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* 409 - Resource is already invalidated.
|
|
224
|
+
*/
|
|
225
|
+
type AlreadyInvalidatedError = {
|
|
226
|
+
/**
|
|
227
|
+
* Error message describing what went wrong
|
|
228
|
+
*/
|
|
229
|
+
detail: string;
|
|
230
|
+
/**
|
|
231
|
+
* Error code for programmatic handling
|
|
232
|
+
*/
|
|
233
|
+
error_code?: "ALREADY_INVALIDATED";
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Request for artifact download URL.
|
|
237
|
+
*/
|
|
238
|
+
type ArtifactDownloadRequest = {
|
|
239
|
+
/**
|
|
240
|
+
* Type of artifact to download
|
|
241
|
+
*/
|
|
242
|
+
artifact_type: ArtifactType;
|
|
243
|
+
/**
|
|
244
|
+
* Agent version ID
|
|
245
|
+
*/
|
|
246
|
+
agent_version_id: string;
|
|
247
|
+
/**
|
|
248
|
+
* Run ID for run-scoped artifacts
|
|
249
|
+
*/
|
|
250
|
+
eval_run_id?: (string | null);
|
|
251
|
+
/**
|
|
252
|
+
* Problem ID for per-problem artifact downloads
|
|
253
|
+
*/
|
|
254
|
+
problem_id?: (string | null);
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Response with presigned download URL.
|
|
258
|
+
*/
|
|
259
|
+
type ArtifactDownloadResponse = {
|
|
260
|
+
/**
|
|
261
|
+
* Presigned download URL
|
|
262
|
+
*/
|
|
263
|
+
download_url: string;
|
|
264
|
+
/**
|
|
265
|
+
* URL expiration time
|
|
266
|
+
*/
|
|
267
|
+
expires_at: string;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* 404 - Artifact not found or not available.
|
|
271
|
+
*/
|
|
272
|
+
type ArtifactNotFoundError = {
|
|
273
|
+
/**
|
|
274
|
+
* Error message describing what went wrong
|
|
275
|
+
*/
|
|
276
|
+
detail: string;
|
|
277
|
+
/**
|
|
278
|
+
* Error code for programmatic handling
|
|
279
|
+
*/
|
|
280
|
+
error_code?: "ARTIFACT_NOT_FOUND";
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* 404 - Artifact exists but is not yet released.
|
|
284
|
+
*/
|
|
285
|
+
type ArtifactNotReleasedError = {
|
|
286
|
+
/**
|
|
287
|
+
* Error message describing what went wrong
|
|
288
|
+
*/
|
|
289
|
+
detail: string;
|
|
290
|
+
/**
|
|
291
|
+
* Error code for programmatic handling
|
|
292
|
+
*/
|
|
293
|
+
error_code?: "ARTIFACT_NOT_RELEASED";
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Release state of agent version artifacts.
|
|
297
|
+
*/
|
|
298
|
+
type ArtifactReleaseState = 'HIDDEN' | 'RELEASED';
|
|
299
|
+
/**
|
|
300
|
+
* Type of artifact for download.
|
|
301
|
+
*/
|
|
302
|
+
type ArtifactType = 'AGENT_CODE' | 'EVAL_LOGS_BUNDLE' | 'EVAL_PROBLEM_LOGS';
|
|
303
|
+
/**
|
|
304
|
+
* 409 - Validator is at maximum concurrent evaluation capacity.
|
|
305
|
+
*/
|
|
306
|
+
type AtCapacityError = {
|
|
307
|
+
/**
|
|
308
|
+
* Error message describing what went wrong
|
|
309
|
+
*/
|
|
310
|
+
detail: string;
|
|
311
|
+
/**
|
|
312
|
+
* Error code for programmatic handling
|
|
313
|
+
*/
|
|
314
|
+
error_code?: "AT_CAPACITY";
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Audit event log entry.
|
|
318
|
+
*/
|
|
319
|
+
type AuditEventEntry = {
|
|
320
|
+
/**
|
|
321
|
+
* Event ID
|
|
322
|
+
*/
|
|
323
|
+
event_id: string;
|
|
324
|
+
/**
|
|
325
|
+
* Action performed
|
|
326
|
+
*/
|
|
327
|
+
action: string;
|
|
328
|
+
/**
|
|
329
|
+
* Type of target entity
|
|
330
|
+
*/
|
|
331
|
+
target_type: string;
|
|
332
|
+
/**
|
|
333
|
+
* Target entity ID
|
|
334
|
+
*/
|
|
335
|
+
target_id: string;
|
|
336
|
+
/**
|
|
337
|
+
* Admin who performed the action
|
|
338
|
+
*/
|
|
339
|
+
actor_hotkey: string;
|
|
340
|
+
/**
|
|
341
|
+
* Reason provided
|
|
342
|
+
*/
|
|
343
|
+
reason?: (string | null);
|
|
344
|
+
/**
|
|
345
|
+
* Additional context
|
|
346
|
+
*/
|
|
347
|
+
details?: ({
|
|
348
|
+
[key: string]: unknown;
|
|
349
|
+
} | null);
|
|
350
|
+
/**
|
|
351
|
+
* When the event occurred
|
|
352
|
+
*/
|
|
353
|
+
created_at: string;
|
|
354
|
+
};
|
|
355
|
+
/**
|
|
356
|
+
* Response for audit events list.
|
|
357
|
+
*/
|
|
358
|
+
type AuditEventsResponse = {
|
|
359
|
+
/**
|
|
360
|
+
* Audit events
|
|
361
|
+
*/
|
|
362
|
+
events: Array<AuditEventEntry>;
|
|
363
|
+
/**
|
|
364
|
+
* Total events matching filter
|
|
365
|
+
*/
|
|
366
|
+
total: number;
|
|
367
|
+
/**
|
|
368
|
+
* Page size
|
|
369
|
+
*/
|
|
370
|
+
limit: number;
|
|
371
|
+
/**
|
|
372
|
+
* Page offset
|
|
373
|
+
*/
|
|
374
|
+
offset: number;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Request to ban a miner or validator.
|
|
378
|
+
*/
|
|
379
|
+
type BanRequest = {
|
|
380
|
+
/**
|
|
381
|
+
* Reason for the ban
|
|
382
|
+
*/
|
|
383
|
+
reason: string;
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* Response for ban/unban operations.
|
|
387
|
+
*/
|
|
388
|
+
type BanResponse = {
|
|
389
|
+
/**
|
|
390
|
+
* Affected hotkey
|
|
391
|
+
*/
|
|
392
|
+
hotkey: string;
|
|
393
|
+
/**
|
|
394
|
+
* New ban state
|
|
395
|
+
*/
|
|
396
|
+
is_banned: boolean;
|
|
397
|
+
};
|
|
398
|
+
type Body_submit_agent = {
|
|
399
|
+
/**
|
|
400
|
+
* Name for this agent (unique per miner)
|
|
401
|
+
*/
|
|
402
|
+
agent_name: string;
|
|
403
|
+
/**
|
|
404
|
+
* Python agent file (max 1MB)
|
|
405
|
+
*/
|
|
406
|
+
file: (Blob | File);
|
|
407
|
+
/**
|
|
408
|
+
* Chutes OAuth refresh token for miner-funded inference
|
|
409
|
+
*/
|
|
410
|
+
chutes_refresh_token?: (string | null);
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Request to cancel an agent version's evaluation.
|
|
414
|
+
*/
|
|
415
|
+
type CancelRequest = {
|
|
416
|
+
/**
|
|
417
|
+
* Reason for cancellation
|
|
418
|
+
*/
|
|
419
|
+
reason: string;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Response for cancel operation.
|
|
423
|
+
*/
|
|
424
|
+
type CancelResponse = {
|
|
425
|
+
/**
|
|
426
|
+
* Agent version ID
|
|
427
|
+
*/
|
|
428
|
+
agent_version_id: string;
|
|
429
|
+
/**
|
|
430
|
+
* Number of runs cancelled
|
|
431
|
+
*/
|
|
432
|
+
cancelled_runs: number;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Request body for challenge endpoint.
|
|
436
|
+
*/
|
|
437
|
+
type ChallengeRequest = {
|
|
438
|
+
/**
|
|
439
|
+
* SS58 hotkey address
|
|
440
|
+
*/
|
|
441
|
+
hotkey: string;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Response from challenge endpoint.
|
|
445
|
+
*/
|
|
446
|
+
type ChallengeResponse = {
|
|
447
|
+
/**
|
|
448
|
+
* Challenge string to sign
|
|
449
|
+
*/
|
|
450
|
+
challenge: string;
|
|
451
|
+
/**
|
|
452
|
+
* Unix timestamp when challenge expires
|
|
453
|
+
*/
|
|
454
|
+
expires_at: number;
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Response for successful work claim.
|
|
458
|
+
*/
|
|
459
|
+
type ClaimWorkResponse = {
|
|
460
|
+
/**
|
|
461
|
+
* Unique identifier for the evaluation run
|
|
462
|
+
*/
|
|
463
|
+
eval_run_id: string;
|
|
464
|
+
/**
|
|
465
|
+
* Agent version to evaluate
|
|
466
|
+
*/
|
|
467
|
+
agent_version_id: string;
|
|
468
|
+
/**
|
|
469
|
+
* Problem suite ID
|
|
470
|
+
*/
|
|
471
|
+
suite_id: number;
|
|
472
|
+
/**
|
|
473
|
+
* When the lease expires
|
|
474
|
+
*/
|
|
475
|
+
lease_expires_at: string;
|
|
476
|
+
/**
|
|
477
|
+
* Presigned URL to download agent code
|
|
478
|
+
*/
|
|
479
|
+
code_download_url: string;
|
|
480
|
+
/**
|
|
481
|
+
* Fresh Chutes access token for miner-funded inference
|
|
482
|
+
*/
|
|
483
|
+
chutes_access_token?: (string | null);
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* 422 - Static analysis found issues in submitted code.
|
|
487
|
+
*/
|
|
488
|
+
type CodeAnalysisError = {
|
|
489
|
+
/**
|
|
490
|
+
* Error message describing what went wrong
|
|
491
|
+
*/
|
|
492
|
+
detail: string;
|
|
493
|
+
/**
|
|
494
|
+
* Error code for programmatic handling
|
|
495
|
+
*/
|
|
496
|
+
error_code?: "CODE_ANALYSIS_ERROR";
|
|
497
|
+
/**
|
|
498
|
+
* List of violations found (rule, severity, message, line)
|
|
499
|
+
*/
|
|
500
|
+
violations?: Array<{
|
|
501
|
+
[key: string]: unknown;
|
|
502
|
+
}>;
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
505
|
+
* Request to complete an evaluation run.
|
|
506
|
+
*/
|
|
507
|
+
type CompleteRunRequest = {
|
|
508
|
+
/**
|
|
509
|
+
* Final status of the run
|
|
510
|
+
*/
|
|
511
|
+
terminal_status: TerminalStatus;
|
|
512
|
+
/**
|
|
513
|
+
* Score (required if SUCCESS)
|
|
514
|
+
*/
|
|
515
|
+
validator_score?: (number | null);
|
|
516
|
+
/**
|
|
517
|
+
* Score breakdown (required if SUCCESS)
|
|
518
|
+
*/
|
|
519
|
+
score_components?: ({
|
|
520
|
+
[key: string]: unknown;
|
|
521
|
+
} | null);
|
|
522
|
+
/**
|
|
523
|
+
* S3 key for run-level logs bundle (optional, per-problem logs preferred)
|
|
524
|
+
*/
|
|
525
|
+
results_s3_key?: (string | null);
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* Response for run completion.
|
|
529
|
+
*/
|
|
530
|
+
type CompleteRunResponse = {
|
|
531
|
+
/**
|
|
532
|
+
* Evaluation run ID
|
|
533
|
+
*/
|
|
534
|
+
eval_run_id: string;
|
|
535
|
+
/**
|
|
536
|
+
* New status of the run
|
|
537
|
+
*/
|
|
538
|
+
status: string;
|
|
539
|
+
/**
|
|
540
|
+
* Updated work item status
|
|
541
|
+
*/
|
|
542
|
+
work_item: WorkItemStatus;
|
|
543
|
+
/**
|
|
544
|
+
* Whether agent version just became eligible
|
|
545
|
+
*/
|
|
546
|
+
agent_version_became_eligible: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Final score if became eligible
|
|
549
|
+
*/
|
|
550
|
+
final_score?: (number | null);
|
|
551
|
+
};
|
|
552
|
+
/**
|
|
553
|
+
* 429 - Cooldown period is active.
|
|
554
|
+
*/
|
|
555
|
+
type CooldownActiveError = {
|
|
556
|
+
/**
|
|
557
|
+
* Error message describing what went wrong
|
|
558
|
+
*/
|
|
559
|
+
detail: string;
|
|
560
|
+
/**
|
|
561
|
+
* Error code for programmatic handling
|
|
562
|
+
*/
|
|
563
|
+
error_code?: "COOLDOWN_ACTIVE";
|
|
564
|
+
/**
|
|
565
|
+
* Seconds remaining until cooldown expires
|
|
566
|
+
*/
|
|
567
|
+
remaining_seconds: number;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Request to create a new problem suite.
|
|
571
|
+
*/
|
|
572
|
+
type CreateSuiteRequest = {
|
|
573
|
+
/**
|
|
574
|
+
* URI to the problem suite definition
|
|
575
|
+
*/
|
|
576
|
+
problem_suite_uri: string;
|
|
577
|
+
};
|
|
578
|
+
/**
|
|
579
|
+
* Response for suite creation.
|
|
580
|
+
*/
|
|
581
|
+
type CreateSuiteResponse = {
|
|
582
|
+
/**
|
|
583
|
+
* Created suite ID
|
|
584
|
+
*/
|
|
585
|
+
suite_id: number;
|
|
586
|
+
/**
|
|
587
|
+
* Suite version number
|
|
588
|
+
*/
|
|
589
|
+
suite_version: number;
|
|
590
|
+
/**
|
|
591
|
+
* Whether this suite is active
|
|
592
|
+
*/
|
|
593
|
+
is_active: boolean;
|
|
594
|
+
};
|
|
595
|
+
/**
|
|
596
|
+
* Request to discard an agent version.
|
|
597
|
+
*/
|
|
598
|
+
type DiscardRequest = {
|
|
599
|
+
/**
|
|
600
|
+
* Reason for discarding
|
|
601
|
+
*/
|
|
602
|
+
reason: string;
|
|
603
|
+
/**
|
|
604
|
+
* Suite ID (defaults to current suite)
|
|
605
|
+
*/
|
|
606
|
+
suite_id?: (number | null);
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* Response for discard/reinstate operations.
|
|
610
|
+
*/
|
|
611
|
+
type DiscardResponse = {
|
|
612
|
+
/**
|
|
613
|
+
* Affected agent version
|
|
614
|
+
*/
|
|
615
|
+
agent_version_id: string;
|
|
616
|
+
/**
|
|
617
|
+
* Suite ID for the operation
|
|
618
|
+
*/
|
|
619
|
+
suite_id: number;
|
|
620
|
+
/**
|
|
621
|
+
* New discard state
|
|
622
|
+
*/
|
|
623
|
+
is_discarded: boolean;
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* 404 - Evaluation run not found.
|
|
627
|
+
*/
|
|
628
|
+
type EvalRunNotFoundError = {
|
|
629
|
+
/**
|
|
630
|
+
* Error message describing what went wrong
|
|
631
|
+
*/
|
|
632
|
+
detail: string;
|
|
633
|
+
/**
|
|
634
|
+
* Error code for programmatic handling
|
|
635
|
+
*/
|
|
636
|
+
error_code?: "EVAL_RUN_NOT_FOUND";
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* Detailed representation of a single evaluation run.
|
|
640
|
+
*/
|
|
641
|
+
type EvaluationRunDetail = {
|
|
642
|
+
/**
|
|
643
|
+
* Unique identifier for this run
|
|
644
|
+
*/
|
|
645
|
+
eval_run_id: string;
|
|
646
|
+
/**
|
|
647
|
+
* Agent version being evaluated
|
|
648
|
+
*/
|
|
649
|
+
agent_version_id: string;
|
|
650
|
+
/**
|
|
651
|
+
* Name of the agent
|
|
652
|
+
*/
|
|
653
|
+
agent_name: string;
|
|
654
|
+
/**
|
|
655
|
+
* Validator performing evaluation
|
|
656
|
+
*/
|
|
657
|
+
validator_hotkey: string;
|
|
658
|
+
/**
|
|
659
|
+
* Current run status
|
|
660
|
+
*/
|
|
661
|
+
status: EvaluationRunStatus;
|
|
662
|
+
/**
|
|
663
|
+
* Score if completed successfully
|
|
664
|
+
*/
|
|
665
|
+
score?: (number | null);
|
|
666
|
+
/**
|
|
667
|
+
* Version number within this agent (v1, v2, etc.)
|
|
668
|
+
*/
|
|
669
|
+
version_number: number;
|
|
670
|
+
/**
|
|
671
|
+
* When the run was claimed
|
|
672
|
+
*/
|
|
673
|
+
claimed_at: string;
|
|
674
|
+
/**
|
|
675
|
+
* When the run completed
|
|
676
|
+
*/
|
|
677
|
+
completed_at?: (string | null);
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Public representation of an evaluation run.
|
|
681
|
+
*/
|
|
682
|
+
type EvaluationRunPublic = {
|
|
683
|
+
/**
|
|
684
|
+
* Unique identifier for this run
|
|
685
|
+
*/
|
|
686
|
+
eval_run_id: string;
|
|
687
|
+
/**
|
|
688
|
+
* Agent version being evaluated
|
|
689
|
+
*/
|
|
690
|
+
agent_version_id: string;
|
|
691
|
+
/**
|
|
692
|
+
* Suite ID
|
|
693
|
+
*/
|
|
694
|
+
suite_id: number;
|
|
695
|
+
/**
|
|
696
|
+
* Validator performing evaluation
|
|
697
|
+
*/
|
|
698
|
+
validator_hotkey: string;
|
|
699
|
+
/**
|
|
700
|
+
* Run status
|
|
701
|
+
*/
|
|
702
|
+
status: EvaluationRunStatus;
|
|
703
|
+
/**
|
|
704
|
+
* When the run was claimed
|
|
705
|
+
*/
|
|
706
|
+
claimed_at: string;
|
|
707
|
+
/**
|
|
708
|
+
* Lease expiration
|
|
709
|
+
*/
|
|
710
|
+
lease_expires_at: string;
|
|
711
|
+
/**
|
|
712
|
+
* Last heartbeat
|
|
713
|
+
*/
|
|
714
|
+
last_heartbeat_at?: (string | null);
|
|
715
|
+
/**
|
|
716
|
+
* Completion timestamp
|
|
717
|
+
*/
|
|
718
|
+
completed_at?: (string | null);
|
|
719
|
+
/**
|
|
720
|
+
* Whether run is included in aggregate
|
|
721
|
+
*/
|
|
722
|
+
is_included: boolean;
|
|
723
|
+
/**
|
|
724
|
+
* When run was invalidated
|
|
725
|
+
*/
|
|
726
|
+
invalidated_at?: (string | null);
|
|
727
|
+
/**
|
|
728
|
+
* Who invalidated the run
|
|
729
|
+
*/
|
|
730
|
+
invalidated_by?: (string | null);
|
|
731
|
+
/**
|
|
732
|
+
* Reason for invalidation
|
|
733
|
+
*/
|
|
734
|
+
invalidation_reason?: (string | null);
|
|
735
|
+
/**
|
|
736
|
+
* Score on success
|
|
737
|
+
*/
|
|
738
|
+
validator_score?: (number | null);
|
|
739
|
+
/**
|
|
740
|
+
* Score breakdown on success
|
|
741
|
+
*/
|
|
742
|
+
score_components_summary?: ({
|
|
743
|
+
[key: string]: unknown;
|
|
744
|
+
} | null);
|
|
745
|
+
/**
|
|
746
|
+
* Snapshot of validator service versions at claim time
|
|
747
|
+
*/
|
|
748
|
+
service_versions?: ({
|
|
749
|
+
[key: string]: (string);
|
|
750
|
+
} | null);
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* Status of an evaluation run through its lifecycle.
|
|
754
|
+
*/
|
|
755
|
+
type EvaluationRunStatus = 'CLAIMED' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'TIMED_OUT' | 'STALE' | 'CANCELLED';
|
|
756
|
+
/**
|
|
757
|
+
* Status representation of an evaluation run (for admin operations).
|
|
758
|
+
*/
|
|
759
|
+
type EvaluationRunStatusPublic = {
|
|
760
|
+
/**
|
|
761
|
+
* Unique identifier for this run
|
|
762
|
+
*/
|
|
763
|
+
eval_run_id: string;
|
|
764
|
+
/**
|
|
765
|
+
* Agent version being evaluated
|
|
766
|
+
*/
|
|
767
|
+
agent_version_id: string;
|
|
768
|
+
/**
|
|
769
|
+
* Suite ID
|
|
770
|
+
*/
|
|
771
|
+
suite_id: number;
|
|
772
|
+
/**
|
|
773
|
+
* Validator performing evaluation
|
|
774
|
+
*/
|
|
775
|
+
validator_hotkey: string;
|
|
776
|
+
/**
|
|
777
|
+
* Run status
|
|
778
|
+
*/
|
|
779
|
+
status: EvaluationRunStatus;
|
|
780
|
+
/**
|
|
781
|
+
* When the run was claimed
|
|
782
|
+
*/
|
|
783
|
+
claimed_at: string;
|
|
784
|
+
/**
|
|
785
|
+
* Lease expiration
|
|
786
|
+
*/
|
|
787
|
+
lease_expires_at: string;
|
|
788
|
+
/**
|
|
789
|
+
* Whether run is included in aggregate
|
|
790
|
+
*/
|
|
791
|
+
is_included: boolean;
|
|
792
|
+
/**
|
|
793
|
+
* Last heartbeat
|
|
794
|
+
*/
|
|
795
|
+
last_heartbeat_at?: (string | null);
|
|
796
|
+
/**
|
|
797
|
+
* Completion timestamp
|
|
798
|
+
*/
|
|
799
|
+
completed_at?: (string | null);
|
|
800
|
+
/**
|
|
801
|
+
* When run was invalidated
|
|
802
|
+
*/
|
|
803
|
+
invalidated_at?: (string | null);
|
|
804
|
+
/**
|
|
805
|
+
* Who invalidated the run
|
|
806
|
+
*/
|
|
807
|
+
invalidated_by?: (string | null);
|
|
808
|
+
/**
|
|
809
|
+
* Reason for invalidation
|
|
810
|
+
*/
|
|
811
|
+
invalidation_reason?: (string | null);
|
|
812
|
+
/**
|
|
813
|
+
* Score on success
|
|
814
|
+
*/
|
|
815
|
+
validator_score?: (number | null);
|
|
816
|
+
/**
|
|
817
|
+
* Score breakdown on success
|
|
818
|
+
*/
|
|
819
|
+
score_components_summary?: ({
|
|
820
|
+
[key: string]: unknown;
|
|
821
|
+
} | null);
|
|
822
|
+
};
|
|
823
|
+
/**
|
|
824
|
+
* 400 - Upload file exceeds size limit.
|
|
825
|
+
*/
|
|
826
|
+
type FileTooLargeError = {
|
|
827
|
+
/**
|
|
828
|
+
* Error message describing what went wrong
|
|
829
|
+
*/
|
|
830
|
+
detail: string;
|
|
831
|
+
/**
|
|
832
|
+
* Error code for programmatic handling
|
|
833
|
+
*/
|
|
834
|
+
error_code?: "FILE_TOO_LARGE";
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* Optional request body for heartbeat with service version info.
|
|
838
|
+
*/
|
|
839
|
+
type HeartbeatRequest = {
|
|
840
|
+
/**
|
|
841
|
+
* Docker image digests for validator stack services
|
|
842
|
+
*/
|
|
843
|
+
service_versions?: ({
|
|
844
|
+
[key: string]: (string);
|
|
845
|
+
} | null);
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* Response for heartbeat.
|
|
849
|
+
*/
|
|
850
|
+
type HeartbeatResponse = {
|
|
851
|
+
/**
|
|
852
|
+
* New lease expiration time
|
|
853
|
+
*/
|
|
854
|
+
lease_expires_at: string;
|
|
855
|
+
};
|
|
856
|
+
type HTTPValidationError = {
|
|
857
|
+
detail?: Array<ValidationError>;
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* 400 - Agent name validation failed.
|
|
861
|
+
*/
|
|
862
|
+
type InvalidAgentNameError = {
|
|
863
|
+
/**
|
|
864
|
+
* Error message describing what went wrong
|
|
865
|
+
*/
|
|
866
|
+
detail: string;
|
|
867
|
+
/**
|
|
868
|
+
* Error code for programmatic handling
|
|
869
|
+
*/
|
|
870
|
+
error_code?: "INVALID_AGENT_NAME";
|
|
871
|
+
};
|
|
872
|
+
/**
|
|
873
|
+
* 400 - Unknown or unsupported artifact type.
|
|
874
|
+
*/
|
|
875
|
+
type InvalidArtifactTypeError = {
|
|
876
|
+
/**
|
|
877
|
+
* Error message describing what went wrong
|
|
878
|
+
*/
|
|
879
|
+
detail: string;
|
|
880
|
+
/**
|
|
881
|
+
* Error code for programmatic handling
|
|
882
|
+
*/
|
|
883
|
+
error_code?: "INVALID_ARTIFACT_TYPE";
|
|
884
|
+
};
|
|
885
|
+
/**
|
|
886
|
+
* Request to invalidate an evaluation run (irreversible).
|
|
887
|
+
*/
|
|
888
|
+
type InvalidateRunRequest = {
|
|
889
|
+
/**
|
|
890
|
+
* Reason for invalidation
|
|
891
|
+
*/
|
|
892
|
+
reason: string;
|
|
893
|
+
};
|
|
894
|
+
/**
|
|
895
|
+
* 400 - File content validation failed.
|
|
896
|
+
*/
|
|
897
|
+
type InvalidFileError = {
|
|
898
|
+
/**
|
|
899
|
+
* Error message describing what went wrong
|
|
900
|
+
*/
|
|
901
|
+
detail: string;
|
|
902
|
+
/**
|
|
903
|
+
* Error code for programmatic handling
|
|
904
|
+
*/
|
|
905
|
+
error_code?: "INVALID_FILE";
|
|
906
|
+
};
|
|
907
|
+
/**
|
|
908
|
+
* 400 - Problem ID is not valid for this suite.
|
|
909
|
+
*/
|
|
910
|
+
type InvalidProblemIdError = {
|
|
911
|
+
/**
|
|
912
|
+
* Error message describing what went wrong
|
|
913
|
+
*/
|
|
914
|
+
detail: string;
|
|
915
|
+
/**
|
|
916
|
+
* Error code for programmatic handling
|
|
917
|
+
*/
|
|
918
|
+
error_code?: "INVALID_PROBLEM_ID";
|
|
919
|
+
};
|
|
920
|
+
/**
|
|
921
|
+
* Entry in the leaderboard.
|
|
922
|
+
*/
|
|
923
|
+
type LeaderboardEntry = {
|
|
924
|
+
/**
|
|
925
|
+
* Leaderboard rank
|
|
926
|
+
*/
|
|
927
|
+
rank: number;
|
|
928
|
+
/**
|
|
929
|
+
* Agent version ID
|
|
930
|
+
*/
|
|
931
|
+
agent_version_id: string;
|
|
932
|
+
/**
|
|
933
|
+
* Agent name
|
|
934
|
+
*/
|
|
935
|
+
agent_name: string;
|
|
936
|
+
/**
|
|
937
|
+
* Miner hotkey
|
|
938
|
+
*/
|
|
939
|
+
miner_hotkey: string;
|
|
940
|
+
/**
|
|
941
|
+
* Version number within this agent (v1, v2, etc.)
|
|
942
|
+
*/
|
|
943
|
+
version_number: number;
|
|
944
|
+
/**
|
|
945
|
+
* Final score
|
|
946
|
+
*/
|
|
947
|
+
final_score: number;
|
|
948
|
+
/**
|
|
949
|
+
* When eligibility was reached
|
|
950
|
+
*/
|
|
951
|
+
eligible_at?: (string | null);
|
|
952
|
+
/**
|
|
953
|
+
* Whether discarded by admin
|
|
954
|
+
*/
|
|
955
|
+
is_discarded?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Whether miner is banned
|
|
958
|
+
*/
|
|
959
|
+
is_miner_banned?: boolean;
|
|
960
|
+
/**
|
|
961
|
+
* Current top agent for emissions
|
|
962
|
+
*/
|
|
963
|
+
is_current_top?: boolean;
|
|
964
|
+
/**
|
|
965
|
+
* Previously held top agent status
|
|
966
|
+
*/
|
|
967
|
+
was_top?: boolean;
|
|
968
|
+
/**
|
|
969
|
+
* When this agent became top
|
|
970
|
+
*/
|
|
971
|
+
top_at?: (string | null);
|
|
972
|
+
};
|
|
973
|
+
/**
|
|
974
|
+
* Response for leaderboard endpoint.
|
|
975
|
+
*/
|
|
976
|
+
type LeaderboardResponse = {
|
|
977
|
+
/**
|
|
978
|
+
* Suite information
|
|
979
|
+
*/
|
|
980
|
+
suite: SuitePublic;
|
|
981
|
+
/**
|
|
982
|
+
* Leaderboard entries
|
|
983
|
+
*/
|
|
984
|
+
entries: Array<LeaderboardEntry>;
|
|
985
|
+
/**
|
|
986
|
+
* Total entries
|
|
987
|
+
*/
|
|
988
|
+
total: number;
|
|
989
|
+
/**
|
|
990
|
+
* Page size
|
|
991
|
+
*/
|
|
992
|
+
limit: number;
|
|
993
|
+
/**
|
|
994
|
+
* Page offset
|
|
995
|
+
*/
|
|
996
|
+
offset: number;
|
|
997
|
+
/**
|
|
998
|
+
* Score required to dethrone current top
|
|
999
|
+
*/
|
|
1000
|
+
challenge_threshold?: (number | null);
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* 409 - Evaluation run lease has expired.
|
|
1004
|
+
*/
|
|
1005
|
+
type LeaseExpiredError = {
|
|
1006
|
+
/**
|
|
1007
|
+
* Error message describing what went wrong
|
|
1008
|
+
*/
|
|
1009
|
+
detail: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* Error code for programmatic handling
|
|
1012
|
+
*/
|
|
1013
|
+
error_code?: "LEASE_EXPIRED";
|
|
1014
|
+
};
|
|
1015
|
+
/**
|
|
1016
|
+
* Response from logout endpoint.
|
|
1017
|
+
*/
|
|
1018
|
+
type LogoutResponse = {
|
|
1019
|
+
/**
|
|
1020
|
+
* Whether logout was successful
|
|
1021
|
+
*/
|
|
1022
|
+
success: boolean;
|
|
1023
|
+
};
|
|
1024
|
+
/**
|
|
1025
|
+
* Envelope response for GET /v1/miner/agents with cooldown status.
|
|
1026
|
+
*/
|
|
1027
|
+
type MinerAgentsResponse = {
|
|
1028
|
+
/**
|
|
1029
|
+
* Miner's agents
|
|
1030
|
+
*/
|
|
1031
|
+
agents: Array<AgentPublic>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Whether the miner can submit now
|
|
1034
|
+
*/
|
|
1035
|
+
can_submit: boolean;
|
|
1036
|
+
/**
|
|
1037
|
+
* When next submission is allowed (ISO 8601), null if no cooldown
|
|
1038
|
+
*/
|
|
1039
|
+
next_allowed_at?: (string | null);
|
|
1040
|
+
};
|
|
1041
|
+
/**
|
|
1042
|
+
* 404 - Miner not found.
|
|
1043
|
+
*/
|
|
1044
|
+
type MinerNotFoundError = {
|
|
1045
|
+
/**
|
|
1046
|
+
* Error message describing what went wrong
|
|
1047
|
+
*/
|
|
1048
|
+
detail: string;
|
|
1049
|
+
/**
|
|
1050
|
+
* Error code for programmatic handling
|
|
1051
|
+
*/
|
|
1052
|
+
error_code?: "MINER_NOT_FOUND";
|
|
1053
|
+
};
|
|
1054
|
+
/**
|
|
1055
|
+
* 400 - Required parameter is missing.
|
|
1056
|
+
*/
|
|
1057
|
+
type MissingParameterError = {
|
|
1058
|
+
/**
|
|
1059
|
+
* Error message describing what went wrong
|
|
1060
|
+
*/
|
|
1061
|
+
detail: string;
|
|
1062
|
+
/**
|
|
1063
|
+
* Error code for programmatic handling
|
|
1064
|
+
*/
|
|
1065
|
+
error_code?: "MISSING_PARAMETER";
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* 400 - Score is required for SUCCESS status.
|
|
1069
|
+
*/
|
|
1070
|
+
type MissingScoreError = {
|
|
1071
|
+
/**
|
|
1072
|
+
* Error message describing what went wrong
|
|
1073
|
+
*/
|
|
1074
|
+
detail: string;
|
|
1075
|
+
/**
|
|
1076
|
+
* Error code for programmatic handling
|
|
1077
|
+
*/
|
|
1078
|
+
error_code?: "MISSING_SCORE";
|
|
1079
|
+
};
|
|
1080
|
+
/**
|
|
1081
|
+
* 503 - No active problem suite available.
|
|
1082
|
+
*/
|
|
1083
|
+
type NoActiveSuiteError = {
|
|
1084
|
+
/**
|
|
1085
|
+
* Error message describing what went wrong
|
|
1086
|
+
*/
|
|
1087
|
+
detail: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Error code for programmatic handling
|
|
1090
|
+
*/
|
|
1091
|
+
error_code?: "NO_ACTIVE_SUITE";
|
|
1092
|
+
};
|
|
1093
|
+
/**
|
|
1094
|
+
* 409 - Caller does not own this evaluation run.
|
|
1095
|
+
*/
|
|
1096
|
+
type NotRunOwnerError = {
|
|
1097
|
+
/**
|
|
1098
|
+
* Error message describing what went wrong
|
|
1099
|
+
*/
|
|
1100
|
+
detail: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* Error code for programmatic handling
|
|
1103
|
+
*/
|
|
1104
|
+
error_code?: "NOT_RUN_OWNER";
|
|
1105
|
+
};
|
|
1106
|
+
/**
|
|
1107
|
+
* A work item awaiting validator evaluations.
|
|
1108
|
+
*/
|
|
1109
|
+
type PendingEvaluation = {
|
|
1110
|
+
/**
|
|
1111
|
+
* Unique work item identifier
|
|
1112
|
+
*/
|
|
1113
|
+
work_item_id: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* Name of the agent
|
|
1116
|
+
*/
|
|
1117
|
+
agent_name: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Version number within this agent
|
|
1120
|
+
*/
|
|
1121
|
+
version_number: number;
|
|
1122
|
+
/**
|
|
1123
|
+
* Miner who owns the agent
|
|
1124
|
+
*/
|
|
1125
|
+
miner_hotkey: string;
|
|
1126
|
+
/**
|
|
1127
|
+
* Problem suite ID
|
|
1128
|
+
*/
|
|
1129
|
+
suite_id: number;
|
|
1130
|
+
/**
|
|
1131
|
+
* Total successful evaluations needed
|
|
1132
|
+
*/
|
|
1133
|
+
required_successes: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* Successful evaluations completed so far
|
|
1136
|
+
*/
|
|
1137
|
+
completed_successes: number;
|
|
1138
|
+
/**
|
|
1139
|
+
* Currently CLAIMED or RUNNING evaluations
|
|
1140
|
+
*/
|
|
1141
|
+
active_runs: number;
|
|
1142
|
+
/**
|
|
1143
|
+
* Additional validator claims still needed
|
|
1144
|
+
*/
|
|
1145
|
+
remaining: number;
|
|
1146
|
+
/**
|
|
1147
|
+
* When this work item was created
|
|
1148
|
+
*/
|
|
1149
|
+
queued_at: string;
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* Response for pending evaluations endpoint.
|
|
1153
|
+
*/
|
|
1154
|
+
type PendingEvaluationsResponse = {
|
|
1155
|
+
/**
|
|
1156
|
+
* Aggregate queue statistics
|
|
1157
|
+
*/
|
|
1158
|
+
summary: PendingEvaluationSummary;
|
|
1159
|
+
/**
|
|
1160
|
+
* Individual pending work items
|
|
1161
|
+
*/
|
|
1162
|
+
items: Array<PendingEvaluation>;
|
|
1163
|
+
};
|
|
1164
|
+
/**
|
|
1165
|
+
* Aggregate statistics for pending evaluations.
|
|
1166
|
+
*/
|
|
1167
|
+
type PendingEvaluationSummary = {
|
|
1168
|
+
/**
|
|
1169
|
+
* Number of open work items
|
|
1170
|
+
*/
|
|
1171
|
+
total_pending: number;
|
|
1172
|
+
/**
|
|
1173
|
+
* Sum of remaining runs across all items
|
|
1174
|
+
*/
|
|
1175
|
+
total_runs_needed: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* Sum of active runs across all items
|
|
1178
|
+
*/
|
|
1179
|
+
total_runs_active: number;
|
|
1180
|
+
};
|
|
1181
|
+
/**
|
|
1182
|
+
* Request for presigned upload URL.
|
|
1183
|
+
*/
|
|
1184
|
+
type PresignUploadRequest = {
|
|
1185
|
+
/**
|
|
1186
|
+
* Content type of the upload
|
|
1187
|
+
*/
|
|
1188
|
+
content_type?: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* Size of the upload in bytes
|
|
1191
|
+
*/
|
|
1192
|
+
content_length: number;
|
|
1193
|
+
/**
|
|
1194
|
+
* Evaluation run ID
|
|
1195
|
+
*/
|
|
1196
|
+
eval_run_id: string;
|
|
1197
|
+
/**
|
|
1198
|
+
* Problem ID
|
|
1199
|
+
*/
|
|
1200
|
+
problem_id: string;
|
|
1201
|
+
};
|
|
1202
|
+
/**
|
|
1203
|
+
* Response with presigned upload URL.
|
|
1204
|
+
*/
|
|
1205
|
+
type PresignUploadResponse = {
|
|
1206
|
+
/**
|
|
1207
|
+
* Presigned S3 PUT URL
|
|
1208
|
+
*/
|
|
1209
|
+
upload_url: string;
|
|
1210
|
+
/**
|
|
1211
|
+
* HTTP method to use
|
|
1212
|
+
*/
|
|
1213
|
+
method?: string;
|
|
1214
|
+
/**
|
|
1215
|
+
* S3 key where the file will be stored
|
|
1216
|
+
*/
|
|
1217
|
+
results_s3_key: string;
|
|
1218
|
+
/**
|
|
1219
|
+
* When the presigned URL expires
|
|
1220
|
+
*/
|
|
1221
|
+
expires_at: string;
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* 404 - Problem not found in suite.
|
|
1225
|
+
*/
|
|
1226
|
+
type ProblemNotFoundError = {
|
|
1227
|
+
/**
|
|
1228
|
+
* Error message describing what went wrong
|
|
1229
|
+
*/
|
|
1230
|
+
detail: string;
|
|
1231
|
+
/**
|
|
1232
|
+
* Error code for programmatic handling
|
|
1233
|
+
*/
|
|
1234
|
+
error_code?: "PROBLEM_NOT_FOUND";
|
|
1235
|
+
};
|
|
1236
|
+
/**
|
|
1237
|
+
* Progress entry for a single problem showing results from all validators.
|
|
1238
|
+
*/
|
|
1239
|
+
type ProblemProgressEntry = {
|
|
1240
|
+
/**
|
|
1241
|
+
* Problem ID
|
|
1242
|
+
*/
|
|
1243
|
+
problem_id: string;
|
|
1244
|
+
/**
|
|
1245
|
+
* Problem category
|
|
1246
|
+
*/
|
|
1247
|
+
category?: (string | null);
|
|
1248
|
+
/**
|
|
1249
|
+
* Results from each validator that evaluated this problem
|
|
1250
|
+
*/
|
|
1251
|
+
validator_results?: Array<ValidatorProblemResult>;
|
|
1252
|
+
};
|
|
1253
|
+
/**
|
|
1254
|
+
* Progress update for a single problem.
|
|
1255
|
+
*/
|
|
1256
|
+
type ProblemProgressUpdate = {
|
|
1257
|
+
/**
|
|
1258
|
+
* Problem ID
|
|
1259
|
+
*/
|
|
1260
|
+
problem_id: string;
|
|
1261
|
+
/**
|
|
1262
|
+
* Current status of this problem
|
|
1263
|
+
*/
|
|
1264
|
+
status: ProblemStatus;
|
|
1265
|
+
/**
|
|
1266
|
+
* Score if available
|
|
1267
|
+
*/
|
|
1268
|
+
score?: (number | null);
|
|
1269
|
+
/**
|
|
1270
|
+
* Score breakdown if available
|
|
1271
|
+
*/
|
|
1272
|
+
score_components_summary?: ({
|
|
1273
|
+
[key: string]: unknown;
|
|
1274
|
+
} | null);
|
|
1275
|
+
/**
|
|
1276
|
+
* S3 key for this problem's logs
|
|
1277
|
+
*/
|
|
1278
|
+
logs_s3_key?: (string | null);
|
|
1279
|
+
};
|
|
1280
|
+
/**
|
|
1281
|
+
* Public representation of a problem.
|
|
1282
|
+
*/
|
|
1283
|
+
type ProblemPublic = {
|
|
1284
|
+
/**
|
|
1285
|
+
* Unique identifier for the problem
|
|
1286
|
+
*/
|
|
1287
|
+
problem_id: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* Parent suite ID
|
|
1290
|
+
*/
|
|
1291
|
+
suite_id: number;
|
|
1292
|
+
/**
|
|
1293
|
+
* Full problem metadata
|
|
1294
|
+
*/
|
|
1295
|
+
metadata?: {
|
|
1296
|
+
[key: string]: unknown;
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
/**
|
|
1300
|
+
* Status of problem evaluation.
|
|
1301
|
+
*/
|
|
1302
|
+
type ProblemStatus = 'PENDING' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'SKIPPED' | 'TIMED_OUT';
|
|
1303
|
+
/**
|
|
1304
|
+
* Request to update per-problem progress.
|
|
1305
|
+
*/
|
|
1306
|
+
type ProgressUpdateRequest = {
|
|
1307
|
+
/**
|
|
1308
|
+
* List of problem progress updates
|
|
1309
|
+
*/
|
|
1310
|
+
problems: Array<ProblemProgressUpdate>;
|
|
1311
|
+
};
|
|
1312
|
+
/**
|
|
1313
|
+
* Response for progress update.
|
|
1314
|
+
*/
|
|
1315
|
+
type ProgressUpdateResponse = {
|
|
1316
|
+
/**
|
|
1317
|
+
* Whether updates were accepted
|
|
1318
|
+
*/
|
|
1319
|
+
accepted?: boolean;
|
|
1320
|
+
};
|
|
1321
|
+
/**
|
|
1322
|
+
* 429 - Rate limit exceeded.
|
|
1323
|
+
*/
|
|
1324
|
+
type RateLimitExceededError = {
|
|
1325
|
+
/**
|
|
1326
|
+
* Error message describing what went wrong
|
|
1327
|
+
*/
|
|
1328
|
+
detail: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* Error code for programmatic handling
|
|
1331
|
+
*/
|
|
1332
|
+
error_code?: "RATE_LIMIT_EXCEEDED";
|
|
1333
|
+
};
|
|
1334
|
+
/**
|
|
1335
|
+
* Response for reaper service statistics.
|
|
1336
|
+
*/
|
|
1337
|
+
type ReaperStatsResponse = {
|
|
1338
|
+
/**
|
|
1339
|
+
* Whether the reaper service is enabled
|
|
1340
|
+
*/
|
|
1341
|
+
enabled: boolean;
|
|
1342
|
+
/**
|
|
1343
|
+
* Whether the reaper background task is running
|
|
1344
|
+
*/
|
|
1345
|
+
is_running: boolean;
|
|
1346
|
+
/**
|
|
1347
|
+
* Last reaper cycle timestamp
|
|
1348
|
+
*/
|
|
1349
|
+
last_run_at?: (string | null);
|
|
1350
|
+
/**
|
|
1351
|
+
* Total runs reaped since service start
|
|
1352
|
+
*/
|
|
1353
|
+
runs_reaped_total: number;
|
|
1354
|
+
/**
|
|
1355
|
+
* Runs reaped in the last cycle
|
|
1356
|
+
*/
|
|
1357
|
+
runs_reaped_last_cycle: number;
|
|
1358
|
+
/**
|
|
1359
|
+
* Duration of the last reaper cycle in ms
|
|
1360
|
+
*/
|
|
1361
|
+
last_cycle_duration_ms: number;
|
|
1362
|
+
/**
|
|
1363
|
+
* Number of reaper cycle errors encountered
|
|
1364
|
+
*/
|
|
1365
|
+
error_count: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* Number of Redis stats persistence errors
|
|
1368
|
+
*/
|
|
1369
|
+
redis_error_count: number;
|
|
1370
|
+
/**
|
|
1371
|
+
* Configured interval between reaper cycles
|
|
1372
|
+
*/
|
|
1373
|
+
interval_seconds: number;
|
|
1374
|
+
};
|
|
1375
|
+
/**
|
|
1376
|
+
* Request to re-evaluate an agent version.
|
|
1377
|
+
*/
|
|
1378
|
+
type ReevaluateRequest = {
|
|
1379
|
+
/**
|
|
1380
|
+
* Reason for re-evaluation
|
|
1381
|
+
*/
|
|
1382
|
+
reason: string;
|
|
1383
|
+
/**
|
|
1384
|
+
* Suite ID (defaults to current suite)
|
|
1385
|
+
*/
|
|
1386
|
+
suite_id?: (number | null);
|
|
1387
|
+
/**
|
|
1388
|
+
* Override required successes
|
|
1389
|
+
*/
|
|
1390
|
+
required_successes?: (number | null);
|
|
1391
|
+
};
|
|
1392
|
+
/**
|
|
1393
|
+
* Response for re-evaluation request.
|
|
1394
|
+
*/
|
|
1395
|
+
type ReevaluateResponse = {
|
|
1396
|
+
/**
|
|
1397
|
+
* Agent version ID
|
|
1398
|
+
*/
|
|
1399
|
+
agent_version_id: string;
|
|
1400
|
+
};
|
|
1401
|
+
/**
|
|
1402
|
+
* Request to reinstate an agent version.
|
|
1403
|
+
*/
|
|
1404
|
+
type ReinstateRequest = {
|
|
1405
|
+
/**
|
|
1406
|
+
* Suite ID (defaults to current suite)
|
|
1407
|
+
*/
|
|
1408
|
+
suite_id?: (number | null);
|
|
1409
|
+
};
|
|
1410
|
+
/**
|
|
1411
|
+
* 409 - Evaluation run is already complete.
|
|
1412
|
+
*/
|
|
1413
|
+
type RunAlreadyCompleteError = {
|
|
1414
|
+
/**
|
|
1415
|
+
* Error message describing what went wrong
|
|
1416
|
+
*/
|
|
1417
|
+
detail: string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Error code for programmatic handling
|
|
1420
|
+
*/
|
|
1421
|
+
error_code?: "RUN_ALREADY_COMPLETE";
|
|
1422
|
+
};
|
|
1423
|
+
/**
|
|
1424
|
+
* Representation of a currently running evaluation.
|
|
1425
|
+
*/
|
|
1426
|
+
type RunningEvaluation = {
|
|
1427
|
+
/**
|
|
1428
|
+
* Unique identifier for this run
|
|
1429
|
+
*/
|
|
1430
|
+
eval_run_id: string;
|
|
1431
|
+
/**
|
|
1432
|
+
* Agent version being evaluated
|
|
1433
|
+
*/
|
|
1434
|
+
agent_version_id: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* Name of the agent
|
|
1437
|
+
*/
|
|
1438
|
+
agent_name: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* Version number within this agent (v1, v2, etc.)
|
|
1441
|
+
*/
|
|
1442
|
+
version_number: number;
|
|
1443
|
+
/**
|
|
1444
|
+
* Miner who owns the agent
|
|
1445
|
+
*/
|
|
1446
|
+
miner_hotkey: string;
|
|
1447
|
+
/**
|
|
1448
|
+
* Validator performing evaluation
|
|
1449
|
+
*/
|
|
1450
|
+
validator_hotkey: string;
|
|
1451
|
+
/**
|
|
1452
|
+
* Current run status
|
|
1453
|
+
*/
|
|
1454
|
+
status: EvaluationRunStatus;
|
|
1455
|
+
/**
|
|
1456
|
+
* When evaluation started
|
|
1457
|
+
*/
|
|
1458
|
+
started_at: string;
|
|
1459
|
+
/**
|
|
1460
|
+
* Percentage of problems completed (0-100)
|
|
1461
|
+
*/
|
|
1462
|
+
progress_percent?: number;
|
|
1463
|
+
};
|
|
1464
|
+
/**
|
|
1465
|
+
* 400 - Candidate score does not exceed the challenge threshold.
|
|
1466
|
+
*/
|
|
1467
|
+
type ScoreBelowThresholdError = {
|
|
1468
|
+
/**
|
|
1469
|
+
* Error message describing what went wrong
|
|
1470
|
+
*/
|
|
1471
|
+
detail: string;
|
|
1472
|
+
/**
|
|
1473
|
+
* Error code for programmatic handling
|
|
1474
|
+
*/
|
|
1475
|
+
error_code?: "SCORE_BELOW_THRESHOLD";
|
|
1476
|
+
/**
|
|
1477
|
+
* Score of the candidate agent
|
|
1478
|
+
*/
|
|
1479
|
+
candidate_score: number;
|
|
1480
|
+
/**
|
|
1481
|
+
* Minimum score required to dethrone the current top
|
|
1482
|
+
*/
|
|
1483
|
+
required_score: number;
|
|
1484
|
+
/**
|
|
1485
|
+
* Score of the current top agent
|
|
1486
|
+
*/
|
|
1487
|
+
current_top_score: number;
|
|
1488
|
+
/**
|
|
1489
|
+
* Current challenge margin fraction
|
|
1490
|
+
*/
|
|
1491
|
+
margin: number;
|
|
1492
|
+
};
|
|
1493
|
+
/**
|
|
1494
|
+
* Request body for session creation endpoint.
|
|
1495
|
+
*/
|
|
1496
|
+
type SessionRequest = {
|
|
1497
|
+
/**
|
|
1498
|
+
* SS58 hotkey address
|
|
1499
|
+
*/
|
|
1500
|
+
hotkey: string;
|
|
1501
|
+
/**
|
|
1502
|
+
* Challenge that was signed
|
|
1503
|
+
*/
|
|
1504
|
+
challenge: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* Hex-encoded signature
|
|
1507
|
+
*/
|
|
1508
|
+
signature: string;
|
|
1509
|
+
};
|
|
1510
|
+
/**
|
|
1511
|
+
* Response from session creation endpoint.
|
|
1512
|
+
*/
|
|
1513
|
+
type SessionResponse = {
|
|
1514
|
+
/**
|
|
1515
|
+
* Session token for authenticated requests
|
|
1516
|
+
*/
|
|
1517
|
+
session_token: string;
|
|
1518
|
+
/**
|
|
1519
|
+
* Unix timestamp when session expires
|
|
1520
|
+
*/
|
|
1521
|
+
expires_at: number;
|
|
1522
|
+
/**
|
|
1523
|
+
* User role (miner, validator, admin)
|
|
1524
|
+
*/
|
|
1525
|
+
role: string;
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
* Request to set an agent version as the top agent for emissions.
|
|
1529
|
+
*/
|
|
1530
|
+
type SetTopRequest = {
|
|
1531
|
+
/**
|
|
1532
|
+
* Suite ID (defaults to current suite)
|
|
1533
|
+
*/
|
|
1534
|
+
suite_id?: (number | null);
|
|
1535
|
+
/**
|
|
1536
|
+
* Bypass the challenge threshold check (recorded in audit)
|
|
1537
|
+
*/
|
|
1538
|
+
force?: boolean;
|
|
1539
|
+
};
|
|
1540
|
+
/**
|
|
1541
|
+
* Response for set-top operation.
|
|
1542
|
+
*/
|
|
1543
|
+
type SetTopResponse = {
|
|
1544
|
+
/**
|
|
1545
|
+
* New top agent version
|
|
1546
|
+
*/
|
|
1547
|
+
agent_version_id: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* Suite ID
|
|
1550
|
+
*/
|
|
1551
|
+
suite_id: number;
|
|
1552
|
+
/**
|
|
1553
|
+
* Previous top agent version (now marked was_top)
|
|
1554
|
+
*/
|
|
1555
|
+
previous_top_agent_version_id?: (string | null);
|
|
1556
|
+
/**
|
|
1557
|
+
* When this agent became top
|
|
1558
|
+
*/
|
|
1559
|
+
top_at: string;
|
|
1560
|
+
};
|
|
1561
|
+
/**
|
|
1562
|
+
* Response model for agent submission.
|
|
1563
|
+
*/
|
|
1564
|
+
type SubmitAgentResponse = {
|
|
1565
|
+
/**
|
|
1566
|
+
* Agent ID (created if needed)
|
|
1567
|
+
*/
|
|
1568
|
+
agent_id?: (string | null);
|
|
1569
|
+
/**
|
|
1570
|
+
* Agent version ID (if accepted)
|
|
1571
|
+
*/
|
|
1572
|
+
agent_version_id?: (string | null);
|
|
1573
|
+
/**
|
|
1574
|
+
* Whether submission was accepted
|
|
1575
|
+
*/
|
|
1576
|
+
admission_status: AdmissionStatus;
|
|
1577
|
+
/**
|
|
1578
|
+
* Reason for rejection if rejected
|
|
1579
|
+
*/
|
|
1580
|
+
admission_reason?: (AdmissionReason | null);
|
|
1581
|
+
/**
|
|
1582
|
+
* When next submission is allowed (if in cooldown)
|
|
1583
|
+
*/
|
|
1584
|
+
next_allowed_at?: (string | null);
|
|
1585
|
+
/**
|
|
1586
|
+
* Miner hotkey that submitted
|
|
1587
|
+
*/
|
|
1588
|
+
hotkey: string;
|
|
1589
|
+
/**
|
|
1590
|
+
* Status message
|
|
1591
|
+
*/
|
|
1592
|
+
message?: string;
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* 404 - Problem suite not found.
|
|
1596
|
+
*/
|
|
1597
|
+
type SuiteNotFoundError = {
|
|
1598
|
+
/**
|
|
1599
|
+
* Error message describing what went wrong
|
|
1600
|
+
*/
|
|
1601
|
+
detail: string;
|
|
1602
|
+
/**
|
|
1603
|
+
* Error code for programmatic handling
|
|
1604
|
+
*/
|
|
1605
|
+
error_code?: "SUITE_NOT_FOUND";
|
|
1606
|
+
};
|
|
1607
|
+
/**
|
|
1608
|
+
* Public representation of a problem suite.
|
|
1609
|
+
*/
|
|
1610
|
+
type SuitePublic = {
|
|
1611
|
+
/**
|
|
1612
|
+
* Problem suite version/ID
|
|
1613
|
+
*/
|
|
1614
|
+
suite_id: number;
|
|
1615
|
+
/**
|
|
1616
|
+
* Version number of the problem suite
|
|
1617
|
+
*/
|
|
1618
|
+
suite_version: number;
|
|
1619
|
+
/**
|
|
1620
|
+
* Whether this suite is currently active
|
|
1621
|
+
*/
|
|
1622
|
+
is_active: boolean;
|
|
1623
|
+
};
|
|
1624
|
+
/**
|
|
1625
|
+
* Response for suite with its problems.
|
|
1626
|
+
*/
|
|
1627
|
+
type SuiteWithProblemsResponse = {
|
|
1628
|
+
/**
|
|
1629
|
+
* Suite information
|
|
1630
|
+
*/
|
|
1631
|
+
suite: SuitePublic;
|
|
1632
|
+
/**
|
|
1633
|
+
* Problems in this suite
|
|
1634
|
+
*/
|
|
1635
|
+
problems: Array<ProblemPublic>;
|
|
1636
|
+
};
|
|
1637
|
+
/**
|
|
1638
|
+
* Terminal statuses for evaluation runs.
|
|
1639
|
+
*/
|
|
1640
|
+
type TerminalStatus = 'SUCCESS' | 'FAILED' | 'TIMED_OUT';
|
|
1641
|
+
/**
|
|
1642
|
+
* Response for top agent endpoint.
|
|
1643
|
+
*/
|
|
1644
|
+
type TopAgentResponse = {
|
|
1645
|
+
/**
|
|
1646
|
+
* Active suite ID
|
|
1647
|
+
*/
|
|
1648
|
+
suite_id: number;
|
|
1649
|
+
/**
|
|
1650
|
+
* When this was computed
|
|
1651
|
+
*/
|
|
1652
|
+
computed_at: string;
|
|
1653
|
+
/**
|
|
1654
|
+
* Top agent version ID
|
|
1655
|
+
*/
|
|
1656
|
+
top_agent_version_id?: (string | null);
|
|
1657
|
+
/**
|
|
1658
|
+
* Top miner's hotkey
|
|
1659
|
+
*/
|
|
1660
|
+
top_miner_hotkey?: (string | null);
|
|
1661
|
+
/**
|
|
1662
|
+
* Top score
|
|
1663
|
+
*/
|
|
1664
|
+
top_score?: (number | null);
|
|
1665
|
+
/**
|
|
1666
|
+
* Hysteresis/decay params
|
|
1667
|
+
*/
|
|
1668
|
+
policy?: ({
|
|
1669
|
+
[key: string]: unknown;
|
|
1670
|
+
} | null);
|
|
1671
|
+
/**
|
|
1672
|
+
* Score required to dethrone
|
|
1673
|
+
*/
|
|
1674
|
+
challenge_threshold?: (number | null);
|
|
1675
|
+
/**
|
|
1676
|
+
* Current emission weight (1.0=full)
|
|
1677
|
+
*/
|
|
1678
|
+
emission_weight?: (number | null);
|
|
1679
|
+
/**
|
|
1680
|
+
* Current challenge margin fraction
|
|
1681
|
+
*/
|
|
1682
|
+
margin?: (number | null);
|
|
1683
|
+
};
|
|
1684
|
+
type ValidationError = {
|
|
1685
|
+
loc: Array<(string | number)>;
|
|
1686
|
+
msg: string;
|
|
1687
|
+
type: string;
|
|
1688
|
+
};
|
|
1689
|
+
/**
|
|
1690
|
+
* Information about the agent currently being evaluated by a validator.
|
|
1691
|
+
*/
|
|
1692
|
+
type ValidatorCurrentAgent = {
|
|
1693
|
+
/**
|
|
1694
|
+
* Name of the agent being evaluated
|
|
1695
|
+
*/
|
|
1696
|
+
agent_name: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Agent version ID
|
|
1699
|
+
*/
|
|
1700
|
+
version_id: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* Version number within this agent (v1, v2, etc.)
|
|
1703
|
+
*/
|
|
1704
|
+
version_number: number;
|
|
1705
|
+
/**
|
|
1706
|
+
* When evaluation started
|
|
1707
|
+
*/
|
|
1708
|
+
started_at: string;
|
|
1709
|
+
};
|
|
1710
|
+
/**
|
|
1711
|
+
* 404 - Validator not found.
|
|
1712
|
+
*/
|
|
1713
|
+
type ValidatorNotFoundError = {
|
|
1714
|
+
/**
|
|
1715
|
+
* Error message describing what went wrong
|
|
1716
|
+
*/
|
|
1717
|
+
detail: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* Error code for programmatic handling
|
|
1720
|
+
*/
|
|
1721
|
+
error_code?: "VALIDATOR_NOT_FOUND";
|
|
1722
|
+
};
|
|
1723
|
+
/**
|
|
1724
|
+
* Result from a single validator for a specific problem.
|
|
1725
|
+
*/
|
|
1726
|
+
type ValidatorProblemResult = {
|
|
1727
|
+
/**
|
|
1728
|
+
* Validator hotkey
|
|
1729
|
+
*/
|
|
1730
|
+
validator_hotkey: string;
|
|
1731
|
+
/**
|
|
1732
|
+
* Problem status from this validator
|
|
1733
|
+
*/
|
|
1734
|
+
status: ProblemStatus;
|
|
1735
|
+
/**
|
|
1736
|
+
* Problem score from this validator
|
|
1737
|
+
*/
|
|
1738
|
+
score?: (number | null);
|
|
1739
|
+
/**
|
|
1740
|
+
* Score breakdown from this validator
|
|
1741
|
+
*/
|
|
1742
|
+
score_components?: ({
|
|
1743
|
+
[key: string]: unknown;
|
|
1744
|
+
} | null);
|
|
1745
|
+
/**
|
|
1746
|
+
* Last update from this validator
|
|
1747
|
+
*/
|
|
1748
|
+
updated_at?: (string | null);
|
|
1749
|
+
};
|
|
1750
|
+
/**
|
|
1751
|
+
* Public representation of a validator.
|
|
1752
|
+
*/
|
|
1753
|
+
type ValidatorPublic = {
|
|
1754
|
+
/**
|
|
1755
|
+
* Validator's SS58 address
|
|
1756
|
+
*/
|
|
1757
|
+
hotkey: string;
|
|
1758
|
+
/**
|
|
1759
|
+
* Current validator status
|
|
1760
|
+
*/
|
|
1761
|
+
status: ValidatorStatus;
|
|
1762
|
+
/**
|
|
1763
|
+
* When validator was registered
|
|
1764
|
+
*/
|
|
1765
|
+
registered_at: string;
|
|
1766
|
+
/**
|
|
1767
|
+
* Last work claim time
|
|
1768
|
+
*/
|
|
1769
|
+
last_claim_at?: (string | null);
|
|
1770
|
+
/**
|
|
1771
|
+
* Agent currently being evaluated, if any
|
|
1772
|
+
*/
|
|
1773
|
+
current_agent?: (ValidatorCurrentAgent | null);
|
|
1774
|
+
/**
|
|
1775
|
+
* Docker image digests for validator stack services
|
|
1776
|
+
*/
|
|
1777
|
+
service_versions?: ({
|
|
1778
|
+
[key: string]: (string);
|
|
1779
|
+
} | null);
|
|
1780
|
+
};
|
|
1781
|
+
/**
|
|
1782
|
+
* Status of a validator.
|
|
1783
|
+
*/
|
|
1784
|
+
type ValidatorStatus = 'evaluating' | 'available';
|
|
1785
|
+
/**
|
|
1786
|
+
* Status of the work item after completion.
|
|
1787
|
+
*/
|
|
1788
|
+
type WorkItemStatus = {
|
|
1789
|
+
/**
|
|
1790
|
+
* Number of successful runs
|
|
1791
|
+
*/
|
|
1792
|
+
included_success_count: number;
|
|
1793
|
+
/**
|
|
1794
|
+
* Required successful runs
|
|
1795
|
+
*/
|
|
1796
|
+
required_successes: number;
|
|
1797
|
+
/**
|
|
1798
|
+
* Whether work item is closed
|
|
1799
|
+
*/
|
|
1800
|
+
is_closed: boolean;
|
|
1801
|
+
};
|
|
1802
|
+
type HealthCheckResponse = ({
|
|
1803
|
+
[key: string]: unknown;
|
|
1804
|
+
});
|
|
1805
|
+
type HealthCheckError = unknown;
|
|
1806
|
+
type GetCurrentSuiteResponse = (SuitePublic);
|
|
1807
|
+
type GetCurrentSuiteError = (SuiteNotFoundError);
|
|
1808
|
+
type GetSuiteProblemsData = {
|
|
1809
|
+
path: {
|
|
1810
|
+
/**
|
|
1811
|
+
* Suite ID/version
|
|
1812
|
+
*/
|
|
1813
|
+
suite_id: number;
|
|
1814
|
+
};
|
|
1815
|
+
};
|
|
1816
|
+
type GetSuiteProblemsResponse = (SuiteWithProblemsResponse);
|
|
1817
|
+
type GetSuiteProblemsError = (SuiteNotFoundError | HTTPValidationError);
|
|
1818
|
+
type GetLeaderboardData = {
|
|
1819
|
+
query?: {
|
|
1820
|
+
/**
|
|
1821
|
+
* Maximum entries to return
|
|
1822
|
+
*/
|
|
1823
|
+
limit?: number;
|
|
1824
|
+
/**
|
|
1825
|
+
* Offset for pagination
|
|
1826
|
+
*/
|
|
1827
|
+
offset?: number;
|
|
1828
|
+
/**
|
|
1829
|
+
* Suite ID (defaults to current)
|
|
1830
|
+
*/
|
|
1831
|
+
suite_id?: (number | null);
|
|
1832
|
+
};
|
|
1833
|
+
};
|
|
1834
|
+
type GetLeaderboardResponse = (LeaderboardResponse);
|
|
1835
|
+
type GetLeaderboardError = (HTTPValidationError);
|
|
1836
|
+
type GetTopAgentResponse = (TopAgentResponse);
|
|
1837
|
+
type GetTopAgentError = unknown;
|
|
1838
|
+
type GetAgentVersionStatusData = {
|
|
1839
|
+
path: {
|
|
1840
|
+
/**
|
|
1841
|
+
* Agent version ID
|
|
1842
|
+
*/
|
|
1843
|
+
agent_version_id: string;
|
|
1844
|
+
};
|
|
1845
|
+
};
|
|
1846
|
+
type GetAgentVersionStatusResponse = (AgentVersionStatus);
|
|
1847
|
+
type GetAgentVersionStatusError = (AgentVersionNotFoundError | HTTPValidationError);
|
|
1848
|
+
type GetAgentVersionRunsData = {
|
|
1849
|
+
path: {
|
|
1850
|
+
/**
|
|
1851
|
+
* Agent version ID
|
|
1852
|
+
*/
|
|
1853
|
+
agent_version_id: string;
|
|
1854
|
+
};
|
|
1855
|
+
};
|
|
1856
|
+
type GetAgentVersionRunsResponse = (Array<EvaluationRunPublic>);
|
|
1857
|
+
type GetAgentVersionRunsError = (AgentVersionNotFoundError | HTTPValidationError);
|
|
1858
|
+
type GetAgentVersionProblemsData = {
|
|
1859
|
+
path: {
|
|
1860
|
+
/**
|
|
1861
|
+
* Agent version ID
|
|
1862
|
+
*/
|
|
1863
|
+
agent_version_id: string;
|
|
1864
|
+
};
|
|
1865
|
+
};
|
|
1866
|
+
type GetAgentVersionProblemsResponse = (AgentVersionProblemsResponse);
|
|
1867
|
+
type GetAgentVersionProblemsError = (AgentVersionNotFoundError | HTTPValidationError);
|
|
1868
|
+
type GetAgentVersionData = {
|
|
1869
|
+
path: {
|
|
1870
|
+
/**
|
|
1871
|
+
* Agent version ID
|
|
1872
|
+
*/
|
|
1873
|
+
agent_version_id: string;
|
|
1874
|
+
};
|
|
1875
|
+
};
|
|
1876
|
+
type GetAgentVersionResponse = (AgentVersionPublic);
|
|
1877
|
+
type GetAgentVersionError = ((AgentVersionNotFoundError | SuiteNotFoundError | ArtifactNotReleasedError) | HTTPValidationError);
|
|
1878
|
+
type GetArtifactDownloadUrlData = {
|
|
1879
|
+
body: ArtifactDownloadRequest;
|
|
1880
|
+
};
|
|
1881
|
+
type GetArtifactDownloadUrlResponse = (ArtifactDownloadResponse);
|
|
1882
|
+
type GetArtifactDownloadUrlError = ((MissingParameterError | InvalidArtifactTypeError) | (AgentVersionNotFoundError | SuiteNotFoundError | ArtifactNotReleasedError | ArtifactNotFoundError | EvalRunNotFoundError) | HTTPValidationError);
|
|
1883
|
+
type GetEvaluationRunData = {
|
|
1884
|
+
path: {
|
|
1885
|
+
/**
|
|
1886
|
+
* Evaluation run ID
|
|
1887
|
+
*/
|
|
1888
|
+
eval_run_id: string;
|
|
1889
|
+
};
|
|
1890
|
+
};
|
|
1891
|
+
type GetEvaluationRunResponse = (EvaluationRunDetail);
|
|
1892
|
+
type GetEvaluationRunError = (EvalRunNotFoundError | HTTPValidationError);
|
|
1893
|
+
type GetValidatorsResponse = (Array<ValidatorPublic>);
|
|
1894
|
+
type GetValidatorsError = unknown;
|
|
1895
|
+
type GetRunningEvaluationsResponse = (Array<RunningEvaluation>);
|
|
1896
|
+
type GetRunningEvaluationsError = unknown;
|
|
1897
|
+
type GetPendingEvaluationsData = {
|
|
1898
|
+
query?: {
|
|
1899
|
+
/**
|
|
1900
|
+
* Maximum items to return
|
|
1901
|
+
*/
|
|
1902
|
+
limit?: number;
|
|
1903
|
+
/**
|
|
1904
|
+
* Number of items to skip
|
|
1905
|
+
*/
|
|
1906
|
+
offset?: number;
|
|
1907
|
+
/**
|
|
1908
|
+
* Filter by problem suite ID
|
|
1909
|
+
*/
|
|
1910
|
+
suite_id?: (number | null);
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
type GetPendingEvaluationsResponse = (PendingEvaluationsResponse);
|
|
1914
|
+
type GetPendingEvaluationsError = (HTTPValidationError);
|
|
1915
|
+
type RequestChallengeData = {
|
|
1916
|
+
body: ChallengeRequest;
|
|
1917
|
+
};
|
|
1918
|
+
type RequestChallengeResponse = (ChallengeResponse);
|
|
1919
|
+
type RequestChallengeError = (HTTPValidationError);
|
|
1920
|
+
type CreateSessionEndpointData = {
|
|
1921
|
+
body: SessionRequest;
|
|
1922
|
+
};
|
|
1923
|
+
type CreateSessionEndpointResponse = (SessionResponse);
|
|
1924
|
+
type CreateSessionEndpointError = (HTTPValidationError);
|
|
1925
|
+
type LogoutData = {
|
|
1926
|
+
headers?: {
|
|
1927
|
+
authorization?: (string | null);
|
|
1928
|
+
};
|
|
1929
|
+
};
|
|
1930
|
+
type LogoutResponse2 = (LogoutResponse);
|
|
1931
|
+
type LogoutError = (HTTPValidationError);
|
|
1932
|
+
type SubmitAgentData = {
|
|
1933
|
+
body: Body_submit_agent;
|
|
1934
|
+
};
|
|
1935
|
+
type SubmitAgentResponse2 = (SubmitAgentResponse);
|
|
1936
|
+
type SubmitAgentError = ((InvalidAgentNameError | InvalidFileError) | FileTooLargeError | CodeAnalysisError | (CooldownActiveError | RateLimitExceededError) | NoActiveSuiteError);
|
|
1937
|
+
type ListMinerAgentsResponse = (MinerAgentsResponse);
|
|
1938
|
+
type ListMinerAgentsError = unknown;
|
|
1939
|
+
type ListAgentVersionsData = {
|
|
1940
|
+
path: {
|
|
1941
|
+
/**
|
|
1942
|
+
* Agent ID
|
|
1943
|
+
*/
|
|
1944
|
+
agent_id: string;
|
|
1945
|
+
};
|
|
1946
|
+
};
|
|
1947
|
+
type ListAgentVersionsResponse = (Array<AgentVersionHistoryEntry>);
|
|
1948
|
+
type ListAgentVersionsError = (AgentNotFoundError | HTTPValidationError);
|
|
1949
|
+
type GetOwnedAgentVersionStatusData = {
|
|
1950
|
+
path: {
|
|
1951
|
+
/**
|
|
1952
|
+
* Agent version ID
|
|
1953
|
+
*/
|
|
1954
|
+
agent_version_id: string;
|
|
1955
|
+
};
|
|
1956
|
+
};
|
|
1957
|
+
type GetOwnedAgentVersionStatusResponse = (AgentVersionStatus);
|
|
1958
|
+
type GetOwnedAgentVersionStatusError = (AgentVersionNotFoundError | HTTPValidationError);
|
|
1959
|
+
type ClaimWorkResponse2 = (ClaimWorkResponse | void);
|
|
1960
|
+
type ClaimWorkError = (AtCapacityError);
|
|
1961
|
+
type HeartbeatData = {
|
|
1962
|
+
body?: (HeartbeatRequest | null);
|
|
1963
|
+
path: {
|
|
1964
|
+
/**
|
|
1965
|
+
* Evaluation run ID
|
|
1966
|
+
*/
|
|
1967
|
+
eval_run_id: string;
|
|
1968
|
+
};
|
|
1969
|
+
};
|
|
1970
|
+
type HeartbeatResponse2 = (HeartbeatResponse);
|
|
1971
|
+
type HeartbeatError = (EvalRunNotFoundError | (LeaseExpiredError | NotRunOwnerError | RunAlreadyCompleteError) | HTTPValidationError);
|
|
1972
|
+
type UpdateProgressData = {
|
|
1973
|
+
body: ProgressUpdateRequest;
|
|
1974
|
+
path: {
|
|
1975
|
+
/**
|
|
1976
|
+
* Evaluation run ID
|
|
1977
|
+
*/
|
|
1978
|
+
eval_run_id: string;
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
type UpdateProgressResponse = (ProgressUpdateResponse);
|
|
1982
|
+
type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError | (LeaseExpiredError | NotRunOwnerError | RunAlreadyCompleteError) | HTTPValidationError);
|
|
1983
|
+
type PresignUploadData = {
|
|
1984
|
+
body: PresignUploadRequest;
|
|
1985
|
+
};
|
|
1986
|
+
type PresignUploadResponse2 = (PresignUploadResponse);
|
|
1987
|
+
type PresignUploadError = ((FileTooLargeError | ValidationError) | (EvalRunNotFoundError | ProblemNotFoundError) | NotRunOwnerError | HTTPValidationError);
|
|
1988
|
+
type CompleteRunData = {
|
|
1989
|
+
body: CompleteRunRequest;
|
|
1990
|
+
path: {
|
|
1991
|
+
/**
|
|
1992
|
+
* Evaluation run ID
|
|
1993
|
+
*/
|
|
1994
|
+
eval_run_id: string;
|
|
1995
|
+
};
|
|
1996
|
+
};
|
|
1997
|
+
type CompleteRunResponse2 = (CompleteRunResponse);
|
|
1998
|
+
type CompleteRunError = ((MissingScoreError | ValidationError) | EvalRunNotFoundError | (NotRunOwnerError | RunAlreadyCompleteError) | HTTPValidationError);
|
|
1999
|
+
type BanMinerData = {
|
|
2000
|
+
body: BanRequest;
|
|
2001
|
+
path: {
|
|
2002
|
+
/**
|
|
2003
|
+
* Miner hotkey to ban
|
|
2004
|
+
*/
|
|
2005
|
+
miner_hotkey: string;
|
|
2006
|
+
};
|
|
2007
|
+
};
|
|
2008
|
+
type BanMinerResponse = (BanResponse);
|
|
2009
|
+
type BanMinerError = (MinerNotFoundError | HTTPValidationError);
|
|
2010
|
+
type UnbanMinerData = {
|
|
2011
|
+
path: {
|
|
2012
|
+
/**
|
|
2013
|
+
* Miner hotkey to unban
|
|
2014
|
+
*/
|
|
2015
|
+
miner_hotkey: string;
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
type UnbanMinerResponse = (BanResponse);
|
|
2019
|
+
type UnbanMinerError = (MinerNotFoundError | HTTPValidationError);
|
|
2020
|
+
type BanValidatorData = {
|
|
2021
|
+
body: BanRequest;
|
|
2022
|
+
path: {
|
|
2023
|
+
/**
|
|
2024
|
+
* Validator hotkey to ban
|
|
2025
|
+
*/
|
|
2026
|
+
validator_hotkey: string;
|
|
2027
|
+
};
|
|
2028
|
+
};
|
|
2029
|
+
type BanValidatorResponse = (BanResponse);
|
|
2030
|
+
type BanValidatorError = (ValidatorNotFoundError | HTTPValidationError);
|
|
2031
|
+
type UnbanValidatorData = {
|
|
2032
|
+
path: {
|
|
2033
|
+
/**
|
|
2034
|
+
* Validator hotkey to unban
|
|
2035
|
+
*/
|
|
2036
|
+
validator_hotkey: string;
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
type UnbanValidatorResponse = (BanResponse);
|
|
2040
|
+
type UnbanValidatorError = (ValidatorNotFoundError | HTTPValidationError);
|
|
2041
|
+
type DiscardAgentVersionData = {
|
|
2042
|
+
body: DiscardRequest;
|
|
2043
|
+
path: {
|
|
2044
|
+
/**
|
|
2045
|
+
* Agent version ID
|
|
2046
|
+
*/
|
|
2047
|
+
agent_version_id: string;
|
|
2048
|
+
};
|
|
2049
|
+
};
|
|
2050
|
+
type DiscardAgentVersionResponse = (DiscardResponse);
|
|
2051
|
+
type DiscardAgentVersionError = (AgentVersionNotFoundError | HTTPValidationError | NoActiveSuiteError);
|
|
2052
|
+
type ReinstateAgentVersionData = {
|
|
2053
|
+
body: ReinstateRequest;
|
|
2054
|
+
path: {
|
|
2055
|
+
/**
|
|
2056
|
+
* Agent version ID
|
|
2057
|
+
*/
|
|
2058
|
+
agent_version_id: string;
|
|
2059
|
+
};
|
|
2060
|
+
};
|
|
2061
|
+
type ReinstateAgentVersionResponse = (DiscardResponse);
|
|
2062
|
+
type ReinstateAgentVersionError = (AgentVersionNotFoundError | HTTPValidationError | NoActiveSuiteError);
|
|
2063
|
+
type SetTopAgentData = {
|
|
2064
|
+
body: SetTopRequest;
|
|
2065
|
+
path: {
|
|
2066
|
+
/**
|
|
2067
|
+
* Agent version ID to set as top
|
|
2068
|
+
*/
|
|
2069
|
+
agent_version_id: string;
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2072
|
+
type SetTopAgentResponse = (SetTopResponse);
|
|
2073
|
+
type SetTopAgentError = (ScoreBelowThresholdError | AgentVersionNotFoundError | HTTPValidationError | NoActiveSuiteError);
|
|
2074
|
+
type InvalidateEvaluationRunData = {
|
|
2075
|
+
body: InvalidateRunRequest;
|
|
2076
|
+
path: {
|
|
2077
|
+
/**
|
|
2078
|
+
* Evaluation run ID
|
|
2079
|
+
*/
|
|
2080
|
+
eval_run_id: string;
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
type InvalidateEvaluationRunResponse = (EvaluationRunStatusPublic);
|
|
2084
|
+
type InvalidateEvaluationRunError = (EvalRunNotFoundError | AlreadyInvalidatedError | HTTPValidationError);
|
|
2085
|
+
type ReevaluateAgentVersionData = {
|
|
2086
|
+
body: ReevaluateRequest;
|
|
2087
|
+
path: {
|
|
2088
|
+
/**
|
|
2089
|
+
* Agent version ID
|
|
2090
|
+
*/
|
|
2091
|
+
agent_version_id: string;
|
|
2092
|
+
};
|
|
2093
|
+
};
|
|
2094
|
+
type ReevaluateAgentVersionResponse = (ReevaluateResponse);
|
|
2095
|
+
type ReevaluateAgentVersionError = (AgentVersionNotFoundError | HTTPValidationError | NoActiveSuiteError);
|
|
2096
|
+
type CancelAgentVersionData = {
|
|
2097
|
+
body: CancelRequest;
|
|
2098
|
+
path: {
|
|
2099
|
+
/**
|
|
2100
|
+
* Agent version ID
|
|
2101
|
+
*/
|
|
2102
|
+
agent_version_id: string;
|
|
2103
|
+
};
|
|
2104
|
+
};
|
|
2105
|
+
type CancelAgentVersionResponse = (CancelResponse);
|
|
2106
|
+
type CancelAgentVersionError = (HTTPValidationError);
|
|
2107
|
+
type CreateSuiteData = {
|
|
2108
|
+
body: CreateSuiteRequest;
|
|
2109
|
+
};
|
|
2110
|
+
type CreateSuiteResponse2 = (CreateSuiteResponse);
|
|
2111
|
+
type CreateSuiteError = (HTTPValidationError);
|
|
2112
|
+
type ActivateSuiteData = {
|
|
2113
|
+
path: {
|
|
2114
|
+
/**
|
|
2115
|
+
* Suite version to activate
|
|
2116
|
+
*/
|
|
2117
|
+
suite_id: number;
|
|
2118
|
+
};
|
|
2119
|
+
};
|
|
2120
|
+
type ActivateSuiteResponse2 = (ActivateSuiteResponse);
|
|
2121
|
+
type ActivateSuiteError = (SuiteNotFoundError | HTTPValidationError);
|
|
2122
|
+
type GetAuditEventsData = {
|
|
2123
|
+
query?: {
|
|
2124
|
+
/**
|
|
2125
|
+
* Filter by action type (e.g., BAN_MINER)
|
|
2126
|
+
*/
|
|
2127
|
+
action?: (string | null);
|
|
2128
|
+
/**
|
|
2129
|
+
* Filter by actor hotkey
|
|
2130
|
+
*/
|
|
2131
|
+
actor_hotkey?: (string | null);
|
|
2132
|
+
/**
|
|
2133
|
+
* Number of events to return
|
|
2134
|
+
*/
|
|
2135
|
+
limit?: number;
|
|
2136
|
+
/**
|
|
2137
|
+
* Offset for pagination
|
|
2138
|
+
*/
|
|
2139
|
+
offset?: number;
|
|
2140
|
+
/**
|
|
2141
|
+
* Filter by target ID
|
|
2142
|
+
*/
|
|
2143
|
+
target_id?: (string | null);
|
|
2144
|
+
/**
|
|
2145
|
+
* Filter by target type
|
|
2146
|
+
*/
|
|
2147
|
+
target_type?: (string | null);
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
type GetAuditEventsResponse = (AuditEventsResponse);
|
|
2151
|
+
type GetAuditEventsError = (HTTPValidationError);
|
|
2152
|
+
type GetReaperStatsResponse = (ReaperStatsResponse);
|
|
2153
|
+
type GetReaperStatsError = unknown;
|
|
2154
|
+
|
|
2155
|
+
declare const client: _hey_api_client_fetch.Client<Request, Response, unknown, _hey_api_client_fetch.RequestOptions<boolean, string>>;
|
|
2156
|
+
/**
|
|
2157
|
+
* Health Check
|
|
2158
|
+
* Health check endpoint (no auth required).
|
|
2159
|
+
*/
|
|
2160
|
+
declare const healthCheck: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<HealthCheckResponse, unknown, ThrowOnError>;
|
|
2161
|
+
/**
|
|
2162
|
+
* Get current active suite
|
|
2163
|
+
* Fetch the currently active problem suite.
|
|
2164
|
+
*/
|
|
2165
|
+
declare const getCurrentSuite: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SuitePublic, SuiteNotFoundError, ThrowOnError>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Get suite problems
|
|
2168
|
+
* Get the list of problems for a specific suite.
|
|
2169
|
+
*/
|
|
2170
|
+
declare const getSuiteProblems: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetSuiteProblemsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SuiteWithProblemsResponse, GetSuiteProblemsError, ThrowOnError>;
|
|
2171
|
+
/**
|
|
2172
|
+
* Get leaderboard
|
|
2173
|
+
* Get the eligible agent leaderboard for a suite.
|
|
2174
|
+
*/
|
|
2175
|
+
declare const getLeaderboard: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetLeaderboardData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LeaderboardResponse, HTTPValidationError, ThrowOnError>;
|
|
2176
|
+
/**
|
|
2177
|
+
* Get top agent for emissions
|
|
2178
|
+
* Get the canonical top miner for emissions calculation.
|
|
2179
|
+
*/
|
|
2180
|
+
declare const getTopAgent: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<TopAgentResponse, unknown, ThrowOnError>;
|
|
2181
|
+
/**
|
|
2182
|
+
* Get agent version status
|
|
2183
|
+
* Get live status and counters for an agent version.
|
|
2184
|
+
*/
|
|
2185
|
+
declare const getAgentVersionStatus: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAgentVersionStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AgentVersionStatus, GetAgentVersionStatusError, ThrowOnError>;
|
|
2186
|
+
/**
|
|
2187
|
+
* Get agent version runs
|
|
2188
|
+
* Get evaluation runs for an agent version.
|
|
2189
|
+
*/
|
|
2190
|
+
declare const getAgentVersionRuns: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAgentVersionRunsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetAgentVersionRunsResponse, GetAgentVersionRunsError, ThrowOnError>;
|
|
2191
|
+
/**
|
|
2192
|
+
* Get agent version problem progress
|
|
2193
|
+
* Get per-problem progress matrix across validators.
|
|
2194
|
+
*/
|
|
2195
|
+
declare const getAgentVersionProblems: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAgentVersionProblemsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AgentVersionProblemsResponse, GetAgentVersionProblemsError, ThrowOnError>;
|
|
2196
|
+
/**
|
|
2197
|
+
* Get agent version details
|
|
2198
|
+
* Get released public details for an agent version.
|
|
2199
|
+
*/
|
|
2200
|
+
declare const getAgentVersion: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetAgentVersionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AgentVersionPublic, GetAgentVersionError, ThrowOnError>;
|
|
2201
|
+
/**
|
|
2202
|
+
* Get artifact download URL
|
|
2203
|
+
* Get a presigned URL to download released artifacts.
|
|
2204
|
+
*/
|
|
2205
|
+
declare const getArtifactDownloadUrl: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetArtifactDownloadUrlData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ArtifactDownloadResponse, GetArtifactDownloadUrlError, ThrowOnError>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Get evaluation run details
|
|
2208
|
+
* Get detailed information about a specific evaluation run.
|
|
2209
|
+
*/
|
|
2210
|
+
declare const getEvaluationRun: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetEvaluationRunData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<EvaluationRunDetail, GetEvaluationRunError, ThrowOnError>;
|
|
2211
|
+
/**
|
|
2212
|
+
* Get list of validators
|
|
2213
|
+
* Get all non-banned validators with their current status.
|
|
2214
|
+
*/
|
|
2215
|
+
declare const getValidators: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetValidatorsResponse, unknown, ThrowOnError>;
|
|
2216
|
+
/**
|
|
2217
|
+
* Get running evaluations
|
|
2218
|
+
* Get all currently running or claimed evaluations.
|
|
2219
|
+
*/
|
|
2220
|
+
declare const getRunningEvaluations: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetRunningEvaluationsResponse, unknown, ThrowOnError>;
|
|
2221
|
+
/**
|
|
2222
|
+
* Get pending evaluations
|
|
2223
|
+
* Get all open work items awaiting validator evaluations, with queue summary.
|
|
2224
|
+
*/
|
|
2225
|
+
declare const getPendingEvaluations: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetPendingEvaluationsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PendingEvaluationsResponse, HTTPValidationError, ThrowOnError>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Request Challenge
|
|
2228
|
+
* Request a challenge for wallet authentication.
|
|
2229
|
+
*
|
|
2230
|
+
* The challenge must be signed by the wallet and submitted to /session
|
|
2231
|
+
* within 60 seconds.
|
|
2232
|
+
*
|
|
2233
|
+
* Rate limited to 10 requests per minute per IP to prevent abuse.
|
|
2234
|
+
*/
|
|
2235
|
+
declare const requestChallenge: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<RequestChallengeData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ChallengeResponse, HTTPValidationError, ThrowOnError>;
|
|
2236
|
+
/**
|
|
2237
|
+
* Create Session Endpoint
|
|
2238
|
+
* Create a session by verifying a signed challenge.
|
|
2239
|
+
*
|
|
2240
|
+
* The challenge must have been requested within the last 60 seconds
|
|
2241
|
+
* and the signature must be valid for the challenge message.
|
|
2242
|
+
*
|
|
2243
|
+
* Rate limited to 5 requests per minute per IP to prevent brute force.
|
|
2244
|
+
*/
|
|
2245
|
+
declare const createSessionEndpoint: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateSessionEndpointData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SessionResponse, HTTPValidationError, ThrowOnError>;
|
|
2246
|
+
/**
|
|
2247
|
+
* Logout
|
|
2248
|
+
* Logout and invalidate the current session.
|
|
2249
|
+
*/
|
|
2250
|
+
declare const logout: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<LogoutData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LogoutResponse, HTTPValidationError, ThrowOnError>;
|
|
2251
|
+
/**
|
|
2252
|
+
* Submit agent
|
|
2253
|
+
* Submit an agent file for evaluation. Creates new agent if needed.
|
|
2254
|
+
*/
|
|
2255
|
+
declare const submitAgent: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SubmitAgentData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SubmitAgentResponse, SubmitAgentError, ThrowOnError>;
|
|
2256
|
+
/**
|
|
2257
|
+
* List miner's agents
|
|
2258
|
+
* List all agents owned by the authenticated miner, with cooldown status.
|
|
2259
|
+
*/
|
|
2260
|
+
declare const listMinerAgents: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<MinerAgentsResponse, unknown, ThrowOnError>;
|
|
2261
|
+
/**
|
|
2262
|
+
* List agent versions
|
|
2263
|
+
* List all versions of a specific agent owned by the miner.
|
|
2264
|
+
*/
|
|
2265
|
+
declare const listAgentVersions: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ListAgentVersionsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ListAgentVersionsResponse, ListAgentVersionsError, ThrowOnError>;
|
|
2266
|
+
/**
|
|
2267
|
+
* Get agent version status
|
|
2268
|
+
* Get detailed status of a specific agent version owned by the miner.
|
|
2269
|
+
*/
|
|
2270
|
+
declare const getOwnedAgentVersionStatus: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<GetOwnedAgentVersionStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AgentVersionStatus, GetOwnedAgentVersionStatusError, ThrowOnError>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Claim evaluation work
|
|
2273
|
+
* FIFO claim of next available evaluation work item.
|
|
2274
|
+
*/
|
|
2275
|
+
declare const claimWork: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ClaimWorkResponse2, AtCapacityError, ThrowOnError>;
|
|
2276
|
+
/**
|
|
2277
|
+
* Extend lease
|
|
2278
|
+
* Heartbeat to extend lease and mark run as RUNNING.
|
|
2279
|
+
*/
|
|
2280
|
+
declare const heartbeat: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HeartbeatData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<HeartbeatResponse, HeartbeatError, ThrowOnError>;
|
|
2281
|
+
/**
|
|
2282
|
+
* Update progress
|
|
2283
|
+
* Report per-problem progress during evaluation.
|
|
2284
|
+
*/
|
|
2285
|
+
declare const updateProgress: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateProgressData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ProgressUpdateResponse, UpdateProgressError, ThrowOnError>;
|
|
2286
|
+
/**
|
|
2287
|
+
* Get upload URL
|
|
2288
|
+
* Get a presigned URL for uploading per-problem evaluation logs.
|
|
2289
|
+
*/
|
|
2290
|
+
declare const presignUpload: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PresignUploadData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PresignUploadResponse, PresignUploadError, ThrowOnError>;
|
|
2291
|
+
/**
|
|
2292
|
+
* Complete evaluation run
|
|
2293
|
+
* Finalize an evaluation run with terminal status and score.
|
|
2294
|
+
*/
|
|
2295
|
+
declare const completeRun: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CompleteRunData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<CompleteRunResponse, CompleteRunError, ThrowOnError>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Ban a miner
|
|
2298
|
+
* Ban a miner from submitting agents.
|
|
2299
|
+
*/
|
|
2300
|
+
declare const banMiner: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BanMinerData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BanResponse, BanMinerError, ThrowOnError>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Unban a miner
|
|
2303
|
+
* Unban a miner, allowing them to submit agents again.
|
|
2304
|
+
*/
|
|
2305
|
+
declare const unbanMiner: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnbanMinerData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BanResponse, UnbanMinerError, ThrowOnError>;
|
|
2306
|
+
/**
|
|
2307
|
+
* Ban a validator
|
|
2308
|
+
* Ban a validator from claiming work.
|
|
2309
|
+
*/
|
|
2310
|
+
declare const banValidator: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<BanValidatorData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BanResponse, BanValidatorError, ThrowOnError>;
|
|
2311
|
+
/**
|
|
2312
|
+
* Unban a validator
|
|
2313
|
+
* Unban a validator, allowing them to claim work again.
|
|
2314
|
+
*/
|
|
2315
|
+
declare const unbanValidator: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UnbanValidatorData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BanResponse, UnbanValidatorError, ThrowOnError>;
|
|
2316
|
+
/**
|
|
2317
|
+
* Discard an agent version from leaderboard
|
|
2318
|
+
* Discard an agent version from the leaderboard (reversible tombstone).
|
|
2319
|
+
*/
|
|
2320
|
+
declare const discardAgentVersion: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<DiscardAgentVersionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DiscardResponse, DiscardAgentVersionError, ThrowOnError>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Reinstate a discarded agent version
|
|
2323
|
+
* Reinstate a previously discarded agent version.
|
|
2324
|
+
*/
|
|
2325
|
+
declare const reinstateAgentVersion: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ReinstateAgentVersionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DiscardResponse, ReinstateAgentVersionError, ThrowOnError>;
|
|
2326
|
+
/**
|
|
2327
|
+
* Set an agent version as the top agent for emissions
|
|
2328
|
+
* Designate an agent version as the top agent for emissions.
|
|
2329
|
+
*
|
|
2330
|
+
* The top agent is the one that receives emissions. Setting a new top agent
|
|
2331
|
+
* automatically marks the previous top agent as was_top=True.
|
|
2332
|
+
*
|
|
2333
|
+
* Requirements:
|
|
2334
|
+
* - Agent version must exist and have an aggregate for the suite
|
|
2335
|
+
* - Only one agent can be is_current_top=True per suite (enforced by DB index)
|
|
2336
|
+
*/
|
|
2337
|
+
declare const setTopAgent: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<SetTopAgentData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<SetTopResponse, SetTopAgentError, ThrowOnError>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Invalidate an evaluation run
|
|
2340
|
+
* Invalidate an evaluation run (irreversible).
|
|
2341
|
+
*
|
|
2342
|
+
* Marks the run as excluded from scoring and adjusts the work item's
|
|
2343
|
+
* included_success_count. Reopens the work item to allow validators
|
|
2344
|
+
* to claim replacement work.
|
|
2345
|
+
*/
|
|
2346
|
+
declare const invalidateEvaluationRun: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<InvalidateEvaluationRunData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<EvaluationRunStatusPublic, InvalidateEvaluationRunError, ThrowOnError>;
|
|
2347
|
+
/**
|
|
2348
|
+
* Re-evaluate an agent version
|
|
2349
|
+
* Create a new work item for an agent version to be re-evaluated.
|
|
2350
|
+
*/
|
|
2351
|
+
declare const reevaluateAgentVersion: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ReevaluateAgentVersionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ReevaluateResponse, ReevaluateAgentVersionError, ThrowOnError>;
|
|
2352
|
+
/**
|
|
2353
|
+
* Cancel evaluation of an agent version
|
|
2354
|
+
* Cancel active evaluation runs for an agent version.
|
|
2355
|
+
*/
|
|
2356
|
+
declare const cancelAgentVersion: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CancelAgentVersionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<CancelResponse, HTTPValidationError, ThrowOnError>;
|
|
2357
|
+
/**
|
|
2358
|
+
* Create a new problem suite
|
|
2359
|
+
* Create a new problem suite version.
|
|
2360
|
+
*
|
|
2361
|
+
* Downloads and parses the problem suite JSON from S3, then creates
|
|
2362
|
+
* Problem records for each problem in the suite.
|
|
2363
|
+
*/
|
|
2364
|
+
declare const createSuite: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<CreateSuiteData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<CreateSuiteResponse, HTTPValidationError, ThrowOnError>;
|
|
2365
|
+
/**
|
|
2366
|
+
* Activate a problem suite
|
|
2367
|
+
* Activate a suite, making it the current active suite (deactivates others).
|
|
2368
|
+
*/
|
|
2369
|
+
declare const activateSuite: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<ActivateSuiteData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ActivateSuiteResponse, ActivateSuiteError, ThrowOnError>;
|
|
2370
|
+
/**
|
|
2371
|
+
* Get audit events
|
|
2372
|
+
* Retrieve audit events with optional filtering and pagination.
|
|
2373
|
+
*/
|
|
2374
|
+
declare const getAuditEvents: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<GetAuditEventsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AuditEventsResponse, HTTPValidationError, ThrowOnError>;
|
|
2375
|
+
/**
|
|
2376
|
+
* Get reaper service statistics
|
|
2377
|
+
* Get statistics about the background reaper service.
|
|
2378
|
+
*
|
|
2379
|
+
* The reaper service runs periodically to clean up orphaned evaluation runs
|
|
2380
|
+
* where validators have stopped reporting (crashed or disconnected).
|
|
2381
|
+
*
|
|
2382
|
+
* Stats are read from Redis (persisted by the active reaper instance) to ensure
|
|
2383
|
+
* consistent visibility across all replicas.
|
|
2384
|
+
*/
|
|
2385
|
+
declare const getReaperStats: <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ReaperStatsResponse, unknown, ThrowOnError>;
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* Auto-generated error code type.
|
|
2389
|
+
*
|
|
2390
|
+
* DO NOT EDIT — regenerate with: python3 scripts/extract-errors.py
|
|
2391
|
+
*/
|
|
2392
|
+
type OroErrorCode = 'AGENT_NOT_FOUND' | 'AGENT_VERSION_NOT_FOUND' | 'ALREADY_INVALIDATED' | 'ARTIFACT_NOT_FOUND' | 'ARTIFACT_NOT_RELEASED' | 'AT_CAPACITY' | 'CODE_ANALYSIS_ERROR' | 'COOLDOWN_ACTIVE' | 'EVAL_RUN_NOT_FOUND' | 'FILE_TOO_LARGE' | 'INVALID_AGENT_NAME' | 'INVALID_ARTIFACT_TYPE' | 'INVALID_FILE' | 'INVALID_PROBLEM_ID' | 'LEASE_EXPIRED' | 'MINER_NOT_FOUND' | 'MISSING_PARAMETER' | 'MISSING_SCORE' | 'NO_ACTIVE_SUITE' | 'NOT_RUN_OWNER' | 'PROBLEM_NOT_FOUND' | 'RATE_LIMIT_EXCEEDED' | 'RUN_ALREADY_COMPLETE' | 'SCORE_BELOW_THRESHOLD' | 'SUITE_NOT_FOUND' | 'VALIDATOR_NOT_FOUND';
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Error classification utilities for the ORO SDK.
|
|
2396
|
+
*
|
|
2397
|
+
* Provides helpers to classify HTTP responses, check transient errors,
|
|
2398
|
+
* and extract structured error details from API responses.
|
|
2399
|
+
*/
|
|
2400
|
+
|
|
2401
|
+
/**
|
|
2402
|
+
* High-level error category derived from HTTP status codes.
|
|
2403
|
+
*/
|
|
2404
|
+
type ErrorCategory = 'NETWORK' | 'AUTH' | 'NOT_FOUND' | 'VALIDATION' | 'CONFLICT' | 'RATE_LIMITED' | 'SERVER' | 'UNKNOWN';
|
|
2405
|
+
/**
|
|
2406
|
+
* Classify an HTTP status code into an {@link ErrorCategory}.
|
|
2407
|
+
*/
|
|
2408
|
+
declare function classifyStatus(status: number | undefined): ErrorCategory;
|
|
2409
|
+
/**
|
|
2410
|
+
* Classify a `Response` object (or null for network failures) into an {@link ErrorCategory}.
|
|
2411
|
+
*/
|
|
2412
|
+
declare function classifyError(response: Response | null): ErrorCategory;
|
|
2413
|
+
/**
|
|
2414
|
+
* Returns `true` if the HTTP status code represents a transient (retryable) error.
|
|
2415
|
+
*
|
|
2416
|
+
* Transient statuses: 429 (rate limited), 5xx (server errors), 0/undefined (network failures).
|
|
2417
|
+
*/
|
|
2418
|
+
declare function isTransient(status: number | undefined): boolean;
|
|
2419
|
+
/**
|
|
2420
|
+
* Returns `true` if the response represents a transient (retryable) error.
|
|
2421
|
+
*/
|
|
2422
|
+
declare function isTransientError(response: Response | null): boolean;
|
|
2423
|
+
/**
|
|
2424
|
+
* Extract the `detail` string from a parsed error body.
|
|
2425
|
+
*
|
|
2426
|
+
* Returns `undefined` if `detail` is missing, not a string (e.g. Pydantic validation arrays),
|
|
2427
|
+
* or the error body is null/undefined.
|
|
2428
|
+
*/
|
|
2429
|
+
declare function getErrorDetail(error: unknown): string | undefined;
|
|
2430
|
+
/**
|
|
2431
|
+
* Extract the `error_code` from a parsed error body.
|
|
2432
|
+
*
|
|
2433
|
+
* Returns `undefined` if the field is missing or not a string.
|
|
2434
|
+
*/
|
|
2435
|
+
declare function getErrorCode(error: unknown): OroErrorCode | undefined;
|
|
2436
|
+
/**
|
|
2437
|
+
* Type guard that narrows `error` to an object with a matching `error_code`.
|
|
2438
|
+
*/
|
|
2439
|
+
declare function hasErrorCode<C extends OroErrorCode>(error: unknown, code: C): error is {
|
|
2440
|
+
error_code: C;
|
|
2441
|
+
};
|
|
2442
|
+
/**
|
|
2443
|
+
* Type guard that narrows `error` to `{ detail: string }`.
|
|
2444
|
+
*/
|
|
2445
|
+
declare function hasDetail(error: unknown): error is {
|
|
2446
|
+
detail: string;
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* Retry middleware for the ORO SDK.
|
|
2451
|
+
*
|
|
2452
|
+
* Provides opt-in retry logic with exponential backoff for transient errors
|
|
2453
|
+
* (429, 502, 503, 504) and network failures.
|
|
2454
|
+
*/
|
|
2455
|
+
/**
|
|
2456
|
+
* Configuration for retry behavior.
|
|
2457
|
+
*/
|
|
2458
|
+
interface RetryConfig {
|
|
2459
|
+
/** Maximum number of retries. Set to 0 to disable. Defaults to 3. */
|
|
2460
|
+
maxRetries?: number;
|
|
2461
|
+
/** HTTP status codes that should trigger a retry. Defaults to [429, 502, 503, 504]. */
|
|
2462
|
+
retryableStatuses?: number[];
|
|
2463
|
+
/** Base delay in milliseconds for exponential backoff. Defaults to 1000. */
|
|
2464
|
+
baseDelayMs?: number;
|
|
2465
|
+
/** Maximum delay in milliseconds. Defaults to 30000. */
|
|
2466
|
+
maxDelayMs?: number;
|
|
2467
|
+
/** Whether to add random jitter to the delay. Defaults to true. */
|
|
2468
|
+
jitter?: boolean;
|
|
2469
|
+
/** Optional callback invoked before each retry attempt. */
|
|
2470
|
+
onRetry?: (context: RetryContext) => void;
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Context passed to the onRetry callback.
|
|
2474
|
+
*/
|
|
2475
|
+
interface RetryContext {
|
|
2476
|
+
/** The current retry attempt number (1-based). */
|
|
2477
|
+
attempt: number;
|
|
2478
|
+
/** The delay in milliseconds before this retry. */
|
|
2479
|
+
delayMs: number;
|
|
2480
|
+
/** The HTTP status code that triggered the retry, or undefined for network errors. */
|
|
2481
|
+
status?: number;
|
|
2482
|
+
/** The Retry-After value from the response header, in milliseconds. */
|
|
2483
|
+
retryAfter?: number;
|
|
2484
|
+
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Parse the Retry-After header value into milliseconds.
|
|
2487
|
+
*
|
|
2488
|
+
* Supports both integer seconds (`120`) and HTTP-date format
|
|
2489
|
+
* (`Wed, 21 Oct 2015 07:28:00 GMT`).
|
|
2490
|
+
*
|
|
2491
|
+
* @param response - The Response object to parse the header from
|
|
2492
|
+
* @returns Retry-After value in milliseconds, or undefined if not present/parseable
|
|
2493
|
+
*/
|
|
2494
|
+
declare function parseRetryAfter(response: Response): number | undefined;
|
|
2495
|
+
/**
|
|
2496
|
+
* Compute the delay before the next retry attempt using exponential backoff.
|
|
2497
|
+
*
|
|
2498
|
+
* Formula: `min(base * 2^attempt, max)`, optionally jittered, with
|
|
2499
|
+
* Retry-After taking precedence when present.
|
|
2500
|
+
*
|
|
2501
|
+
* @param attempt - The current attempt number (0-based)
|
|
2502
|
+
* @param baseDelayMs - Base delay in milliseconds
|
|
2503
|
+
* @param maxDelayMs - Maximum delay in milliseconds
|
|
2504
|
+
* @param jitter - Whether to add random jitter
|
|
2505
|
+
* @param retryAfter - Optional Retry-After value in milliseconds
|
|
2506
|
+
* @returns The computed delay in milliseconds
|
|
2507
|
+
*/
|
|
2508
|
+
declare function computeDelay(attempt: number, baseDelayMs: number, maxDelayMs: number, jitter: boolean, retryAfter?: number): number;
|
|
2509
|
+
/**
|
|
2510
|
+
* Create a fetch wrapper that retries transient failures with exponential backoff.
|
|
2511
|
+
*
|
|
2512
|
+
* The returned function has the same signature as `globalThis.fetch` and can be
|
|
2513
|
+
* passed to `client.setConfig({ fetch: ... })`.
|
|
2514
|
+
*
|
|
2515
|
+
* @param config - Retry configuration (all fields optional with sensible defaults)
|
|
2516
|
+
* @returns A fetch-compatible function with retry logic
|
|
2517
|
+
*
|
|
2518
|
+
* @example
|
|
2519
|
+
* ```typescript
|
|
2520
|
+
* import { createRetryFetch } from '@oro-ai/sdk';
|
|
2521
|
+
*
|
|
2522
|
+
* // Use defaults (3 retries, 1s base delay)
|
|
2523
|
+
* const retryFetch = createRetryFetch({});
|
|
2524
|
+
*
|
|
2525
|
+
* // Custom config
|
|
2526
|
+
* const retryFetch = createRetryFetch({ maxRetries: 5, baseDelayMs: 500 });
|
|
2527
|
+
*
|
|
2528
|
+
* // Disable retries
|
|
2529
|
+
* const noRetryFetch = createRetryFetch({ maxRetries: 0 });
|
|
2530
|
+
* ```
|
|
2531
|
+
*/
|
|
2532
|
+
declare function createRetryFetch(config: RetryConfig): typeof globalThis.fetch;
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
* Bittensor wallet authentication helper for ORO SDK.
|
|
2536
|
+
*
|
|
2537
|
+
* This module provides utilities to authenticate API requests using
|
|
2538
|
+
* Bittensor wallet signatures (SR25519).
|
|
2539
|
+
*/
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Configuration for Bittensor authentication.
|
|
2543
|
+
*/
|
|
2544
|
+
interface BittensorAuthConfig {
|
|
2545
|
+
/**
|
|
2546
|
+
* The hotkey SS58 address.
|
|
2547
|
+
*/
|
|
2548
|
+
hotkey: string;
|
|
2549
|
+
/**
|
|
2550
|
+
* Function to sign a message with the hotkey.
|
|
2551
|
+
* Should return the signature as a hex string.
|
|
2552
|
+
*
|
|
2553
|
+
* @param message - The message to sign (format: "{hotkey}:{timestamp}:{nonce}")
|
|
2554
|
+
* @returns Signature as hex string (with or without 0x prefix)
|
|
2555
|
+
*/
|
|
2556
|
+
sign: (message: string) => string | Promise<string>;
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* Generate authentication headers for a Bittensor wallet.
|
|
2560
|
+
*
|
|
2561
|
+
* The message format is '{hotkey}:{timestamp}:{nonce}' to match
|
|
2562
|
+
* the ORO Backend's expected signature format.
|
|
2563
|
+
*
|
|
2564
|
+
* @param config - Bittensor auth configuration
|
|
2565
|
+
* @param nonce - Optional nonce (defaults to crypto.randomUUID())
|
|
2566
|
+
* @returns Object with X-Hotkey, X-Signature, X-Nonce, X-Timestamp headers
|
|
2567
|
+
*/
|
|
2568
|
+
declare function generateAuthHeaders(config: BittensorAuthConfig, nonce?: string): Promise<Record<string, string>>;
|
|
2569
|
+
/**
|
|
2570
|
+
* Configure the SDK client with Bittensor authentication.
|
|
2571
|
+
*
|
|
2572
|
+
* This adds a request interceptor that automatically signs each request
|
|
2573
|
+
* with fresh authentication headers.
|
|
2574
|
+
*
|
|
2575
|
+
* @param baseUrl - API base URL
|
|
2576
|
+
* @param authConfig - Bittensor auth configuration
|
|
2577
|
+
* @returns The configured client
|
|
2578
|
+
*
|
|
2579
|
+
* @example
|
|
2580
|
+
* ```typescript
|
|
2581
|
+
* import { configureBittensorAuth, claimWork } from '@oro-ai/sdk';
|
|
2582
|
+
*
|
|
2583
|
+
* // With a signing function (you provide the implementation)
|
|
2584
|
+
* configureBittensorAuth('https://api.oro.ai', {
|
|
2585
|
+
* hotkey: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
|
|
2586
|
+
* sign: (message) => wallet.sign(message),
|
|
2587
|
+
* });
|
|
2588
|
+
*
|
|
2589
|
+
* // Now all requests are automatically authenticated
|
|
2590
|
+
* const { data: work } = await claimWork();
|
|
2591
|
+
* ```
|
|
2592
|
+
*/
|
|
2593
|
+
declare function configureBittensorAuth(baseUrl: string, authConfig: BittensorAuthConfig, retryConfig?: RetryConfig): typeof client;
|
|
2594
|
+
/**
|
|
2595
|
+
* Configure the SDK client for public (unauthenticated) access only.
|
|
2596
|
+
*
|
|
2597
|
+
* @param baseUrl - API base URL
|
|
2598
|
+
* @returns The configured client
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2601
|
+
* ```typescript
|
|
2602
|
+
* import { configurePublicClient, getLeaderboard } from '@oro-ai/sdk';
|
|
2603
|
+
*
|
|
2604
|
+
* configurePublicClient('https://api.oro.ai');
|
|
2605
|
+
* const { data } = await getLeaderboard();
|
|
2606
|
+
* ```
|
|
2607
|
+
*/
|
|
2608
|
+
declare function configurePublicClient(baseUrl: string, retryConfig?: RetryConfig): typeof client;
|
|
2609
|
+
|
|
2610
|
+
/**
|
|
2611
|
+
* Session-based authentication manager for ORO SDK.
|
|
2612
|
+
*
|
|
2613
|
+
* This module provides a convenient session lifecycle manager that handles
|
|
2614
|
+
* challenge/response login, token storage, auto-refresh, header injection,
|
|
2615
|
+
* and logout — matching the convenience of the Python SDK's BittensorAuthClient.
|
|
2616
|
+
*/
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* Configuration for session-based authentication.
|
|
2620
|
+
*/
|
|
2621
|
+
interface SessionAuthConfig {
|
|
2622
|
+
/** The hotkey SS58 address. */
|
|
2623
|
+
hotkey: string;
|
|
2624
|
+
/**
|
|
2625
|
+
* Function to sign a challenge string with the hotkey.
|
|
2626
|
+
* Should return the signature as a hex string.
|
|
2627
|
+
*/
|
|
2628
|
+
sign: (message: string) => string | Promise<string>;
|
|
2629
|
+
/** Seconds before expiry to trigger auto-refresh. Default: 300 (5 minutes). */
|
|
2630
|
+
refreshBufferSeconds?: number;
|
|
2631
|
+
/** Called when the session has expired and cannot be refreshed. */
|
|
2632
|
+
onSessionExpired?: () => void;
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2635
|
+
* Information about the current session.
|
|
2636
|
+
*/
|
|
2637
|
+
interface SessionInfo {
|
|
2638
|
+
hotkey: string;
|
|
2639
|
+
role: string;
|
|
2640
|
+
expiresAt: number;
|
|
2641
|
+
}
|
|
2642
|
+
/**
|
|
2643
|
+
* Manages the full session authentication lifecycle: login, logout,
|
|
2644
|
+
* token refresh, and automatic header injection.
|
|
2645
|
+
*/
|
|
2646
|
+
declare class SessionAuthManager {
|
|
2647
|
+
private token;
|
|
2648
|
+
private expiresAt;
|
|
2649
|
+
private role;
|
|
2650
|
+
private refreshPromise;
|
|
2651
|
+
private readonly hotkey;
|
|
2652
|
+
private readonly sign;
|
|
2653
|
+
private readonly refreshBufferSeconds;
|
|
2654
|
+
private readonly onSessionExpired?;
|
|
2655
|
+
constructor(config: SessionAuthConfig);
|
|
2656
|
+
/**
|
|
2657
|
+
* Perform challenge/response login flow.
|
|
2658
|
+
*
|
|
2659
|
+
* 1. Requests a challenge from the server
|
|
2660
|
+
* 2. Signs the challenge with the configured sign function
|
|
2661
|
+
* 3. Creates a session with the signed challenge
|
|
2662
|
+
* 4. Stores the session token internally
|
|
2663
|
+
*/
|
|
2664
|
+
login(): Promise<SessionResponse>;
|
|
2665
|
+
/**
|
|
2666
|
+
* Logout and invalidate the current session.
|
|
2667
|
+
* Silently catches errors (session may already be expired).
|
|
2668
|
+
*/
|
|
2669
|
+
logout(): Promise<void>;
|
|
2670
|
+
/**
|
|
2671
|
+
* Refresh the session by performing a new login flow.
|
|
2672
|
+
*/
|
|
2673
|
+
refreshSession(): Promise<SessionResponse>;
|
|
2674
|
+
/** Returns true if a session token exists and hasn't expired. */
|
|
2675
|
+
hasActiveSession(): boolean;
|
|
2676
|
+
/** Returns true if the session is within the refresh buffer of expiry. */
|
|
2677
|
+
sessionNeedsRefresh(): boolean;
|
|
2678
|
+
/** Returns current session info, or null if no active session. */
|
|
2679
|
+
getSessionInfo(): SessionInfo | null;
|
|
2680
|
+
/**
|
|
2681
|
+
* Returns authorization headers. Auto-refreshes if the session is
|
|
2682
|
+
* within the refresh buffer. Throws if not authenticated or session expired.
|
|
2683
|
+
*/
|
|
2684
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
2685
|
+
private clearSession;
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* Configure the SDK client with session-based authentication.
|
|
2689
|
+
*
|
|
2690
|
+
* Sets up the base URL, creates a {@link SessionAuthManager}, and installs
|
|
2691
|
+
* a request interceptor that injects Bearer tokens automatically.
|
|
2692
|
+
*
|
|
2693
|
+
* @param baseUrl - API base URL
|
|
2694
|
+
* @param config - Session auth configuration
|
|
2695
|
+
* @returns A {@link SessionAuthManager} instance for controlling the session lifecycle
|
|
2696
|
+
*
|
|
2697
|
+
* @example
|
|
2698
|
+
* ```typescript
|
|
2699
|
+
* import { configureSessionAuth, listMinerAgents } from '@oro-ai/sdk';
|
|
2700
|
+
*
|
|
2701
|
+
* const session = configureSessionAuth('https://api.oro.ai', {
|
|
2702
|
+
* hotkey: '5GrwvaEF...',
|
|
2703
|
+
* sign: (challenge) => wallet.sign(challenge),
|
|
2704
|
+
* onSessionExpired: () => router.push('/login'),
|
|
2705
|
+
* });
|
|
2706
|
+
*
|
|
2707
|
+
* await session.login();
|
|
2708
|
+
*
|
|
2709
|
+
* // All subsequent requests include Bearer token automatically
|
|
2710
|
+
* const { data: agents } = await listMinerAgents();
|
|
2711
|
+
* ```
|
|
2712
|
+
*/
|
|
2713
|
+
declare function configureSessionAuth(baseUrl: string, config: SessionAuthConfig): SessionAuthManager;
|
|
2714
|
+
|
|
2715
|
+
export { type ActivateSuiteData, type ActivateSuiteError, type ActivateSuiteResponse, type ActivateSuiteResponse2, type AdmissionReason, type AdmissionStatus, type AgentNotFoundError, type AgentPublic, type AgentVersionHistoryEntry, type AgentVersionNotFoundError, type AgentVersionProblemsResponse, type AgentVersionPublic, type AgentVersionState, type AgentVersionStatus, type AlreadyInvalidatedError, type ArtifactDownloadRequest, type ArtifactDownloadResponse, type ArtifactNotFoundError, type ArtifactNotReleasedError, type ArtifactReleaseState, type ArtifactType, type AtCapacityError, type AuditEventEntry, type AuditEventsResponse, type BanMinerData, type BanMinerError, type BanMinerResponse, type BanRequest, type BanResponse, type BanValidatorData, type BanValidatorError, type BanValidatorResponse, type BittensorAuthConfig, type Body_submit_agent, type CancelAgentVersionData, type CancelAgentVersionError, type CancelAgentVersionResponse, type CancelRequest, type CancelResponse, type ChallengeRequest, type ChallengeResponse, type ClaimWorkError, type ClaimWorkResponse, type ClaimWorkResponse2, type CodeAnalysisError, type CompleteRunData, type CompleteRunError, type CompleteRunRequest, type CompleteRunResponse, type CompleteRunResponse2, type CooldownActiveError, type CreateSessionEndpointData, type CreateSessionEndpointError, type CreateSessionEndpointResponse, type CreateSuiteData, type CreateSuiteError, type CreateSuiteRequest, type CreateSuiteResponse, type CreateSuiteResponse2, type DiscardAgentVersionData, type DiscardAgentVersionError, type DiscardAgentVersionResponse, type DiscardRequest, type DiscardResponse, type ErrorCategory, type EvalRunNotFoundError, type EvaluationRunDetail, type EvaluationRunPublic, type EvaluationRunStatus, type EvaluationRunStatusPublic, type FileTooLargeError, type GetAgentVersionData, type GetAgentVersionError, type GetAgentVersionProblemsData, type GetAgentVersionProblemsError, type GetAgentVersionProblemsResponse, type GetAgentVersionResponse, type GetAgentVersionRunsData, type GetAgentVersionRunsError, type GetAgentVersionRunsResponse, type GetAgentVersionStatusData, type GetAgentVersionStatusError, type GetAgentVersionStatusResponse, type GetArtifactDownloadUrlData, type GetArtifactDownloadUrlError, type GetArtifactDownloadUrlResponse, type GetAuditEventsData, type GetAuditEventsError, type GetAuditEventsResponse, type GetCurrentSuiteError, type GetCurrentSuiteResponse, type GetEvaluationRunData, type GetEvaluationRunError, type GetEvaluationRunResponse, type GetLeaderboardData, type GetLeaderboardError, type GetLeaderboardResponse, type GetOwnedAgentVersionStatusData, type GetOwnedAgentVersionStatusError, type GetOwnedAgentVersionStatusResponse, type GetPendingEvaluationsData, type GetPendingEvaluationsError, type GetPendingEvaluationsResponse, type GetReaperStatsError, type GetReaperStatsResponse, type GetRunningEvaluationsError, type GetRunningEvaluationsResponse, type GetSuiteProblemsData, type GetSuiteProblemsError, type GetSuiteProblemsResponse, type GetTopAgentError, type GetTopAgentResponse, type GetValidatorsError, type GetValidatorsResponse, type HTTPValidationError, type HealthCheckError, type HealthCheckResponse, type HeartbeatData, type HeartbeatError, type HeartbeatRequest, type HeartbeatResponse, type HeartbeatResponse2, type InvalidAgentNameError, type InvalidArtifactTypeError, type InvalidFileError, type InvalidProblemIdError, type InvalidateEvaluationRunData, type InvalidateEvaluationRunError, type InvalidateEvaluationRunResponse, type InvalidateRunRequest, type LeaderboardEntry, type LeaderboardResponse, type LeaseExpiredError, type ListAgentVersionsData, type ListAgentVersionsError, type ListAgentVersionsResponse, type ListMinerAgentsError, type ListMinerAgentsResponse, type LogoutData, type LogoutError, type LogoutResponse, type LogoutResponse2, type MinerAgentsResponse, type MinerNotFoundError, type MissingParameterError, type MissingScoreError, type NoActiveSuiteError, type NotRunOwnerError, type OroErrorCode, type PendingEvaluation, type PendingEvaluationSummary, type PendingEvaluationsResponse, type PresignUploadData, type PresignUploadError, type PresignUploadRequest, type PresignUploadResponse, type PresignUploadResponse2, type ProblemNotFoundError, type ProblemProgressEntry, type ProblemProgressUpdate, type ProblemPublic, type ProblemStatus, type ProgressUpdateRequest, type ProgressUpdateResponse, type RateLimitExceededError, type ReaperStatsResponse, type ReevaluateAgentVersionData, type ReevaluateAgentVersionError, type ReevaluateAgentVersionResponse, type ReevaluateRequest, type ReevaluateResponse, type ReinstateAgentVersionData, type ReinstateAgentVersionError, type ReinstateAgentVersionResponse, type ReinstateRequest, type RequestChallengeData, type RequestChallengeError, type RequestChallengeResponse, type RetryConfig, type RetryContext, type RunAlreadyCompleteError, type RunningEvaluation, type ScoreBelowThresholdError, type SessionAuthConfig, SessionAuthManager, type SessionInfo, type SessionRequest, type SessionResponse, type SetTopAgentData, type SetTopAgentError, type SetTopAgentResponse, type SetTopRequest, type SetTopResponse, type SubmitAgentData, type SubmitAgentError, type SubmitAgentResponse, type SubmitAgentResponse2, type SuiteNotFoundError, type SuitePublic, type SuiteWithProblemsResponse, type TerminalStatus, type TopAgentResponse, type UnbanMinerData, type UnbanMinerError, type UnbanMinerResponse, type UnbanValidatorData, type UnbanValidatorError, type UnbanValidatorResponse, type UpdateProgressData, type UpdateProgressError, type UpdateProgressResponse, type ValidationError, type ValidatorCurrentAgent, type ValidatorNotFoundError, type ValidatorProblemResult, type ValidatorPublic, type ValidatorStatus, type WorkItemStatus, activateSuite, banMiner, banValidator, cancelAgentVersion, claimWork, classifyError, classifyStatus, client, completeRun, computeDelay, configureBittensorAuth, configurePublicClient, configureSessionAuth, createRetryFetch, createSessionEndpoint, createSuite, discardAgentVersion, generateAuthHeaders, getAgentVersion, getAgentVersionProblems, getAgentVersionRuns, getAgentVersionStatus, getArtifactDownloadUrl, getAuditEvents, getCurrentSuite, getErrorCode, getErrorDetail, getEvaluationRun, getLeaderboard, getOwnedAgentVersionStatus, getPendingEvaluations, getReaperStats, getRunningEvaluations, getSuiteProblems, getTopAgent, getValidators, hasDetail, hasErrorCode, healthCheck, heartbeat, invalidateEvaluationRun, isTransient, isTransientError, listAgentVersions, listMinerAgents, logout, parseRetryAfter, presignUpload, reevaluateAgentVersion, reinstateAgentVersion, requestChallenge, setTopAgent, submitAgent, unbanMiner, unbanValidator, updateProgress };
|