// This file is auto-generated by @hey-api/openapi-ts import { createClient, createConfig, type OptionsLegacyParser, formDataBodySerializer } from '@hey-api/client-fetch'; import type { HealthCheckError, HealthCheckResponse, DeepHealthCheckError, DeepHealthCheckResponse, ListSuitesError, ListSuitesResponse, GetCurrentSuiteError, GetCurrentSuiteResponse, GetSuiteProblemsData, GetSuiteProblemsError, GetSuiteProblemsResponse, GetLeaderboardData, GetLeaderboardError, GetLeaderboardResponse, GetTopAgentError, GetTopAgentResponse, GetTopMinerPayoutError, GetTopMinerPayoutResponse, GetTopHistoryData, GetTopHistoryError, GetTopHistoryResponse, GetAgentVersionStatusData, GetAgentVersionStatusError, GetAgentVersionStatusResponse, GetAgentVersionRunsData, GetAgentVersionRunsError, GetAgentVersionRunsResponse, GetAgentVersionProblemsData, GetAgentVersionProblemsError, GetAgentVersionProblemsResponse, GetAgentVersionData, GetAgentVersionError, GetAgentVersionResponse, GetArtifactDownloadUrlData, GetArtifactDownloadUrlError, GetArtifactDownloadUrlResponse, GetEvaluationRunData, GetEvaluationRunError, GetEvaluationRunResponse, GetValidatorsError, GetValidatorsResponse, GetRunningEvaluationsError, GetRunningEvaluationsResponse, GetPendingEvaluationsData, GetPendingEvaluationsError, GetPendingEvaluationsResponse, GetCurrentRaceError, GetCurrentRaceResponse, GetRaceHistoryData, GetRaceHistoryError, GetRaceHistoryResponse, GetRaceDetailData, GetRaceDetailError, GetRaceDetailResponse, GetRaceValidatorVarianceData, GetRaceValidatorVarianceError, GetRaceValidatorVarianceResponse, JoinWaitlistData, JoinWaitlistError, JoinWaitlistResponse, GetInferenceModelsData, GetInferenceModelsError, GetInferenceModelsResponse, RequestChallengeData, RequestChallengeError, RequestChallengeResponse, CreateSessionEndpointData, CreateSessionEndpointError, CreateSessionEndpointResponse, LogoutData, LogoutError, LogoutResponse2, SubmitAgentData, SubmitAgentError, SubmitAgentResponse2, StoreInferenceCredentialData, StoreInferenceCredentialError, StoreInferenceCredentialResponse, GetInferenceAuthStatusOneData, GetInferenceAuthStatusOneError, GetInferenceAuthStatusOneResponse, DeleteInferenceCredentialData, DeleteInferenceCredentialError, DeleteInferenceCredentialResponse, ListInferenceAuthError, ListInferenceAuthResponse, SetDefaultInferenceProviderData, SetDefaultInferenceProviderError, SetDefaultInferenceProviderResponse, StoreChutesTokenData, StoreChutesTokenError, StoreChutesTokenResponse, GetChutesAuthStatusError, GetChutesAuthStatusResponse, ExchangeChutesCodeData, ExchangeChutesCodeError, ExchangeChutesCodeResponse2, ListMinerAgentsError, ListMinerAgentsResponse, ListAgentVersionsData, ListAgentVersionsError, ListAgentVersionsResponse, GetOwnedAgentVersionStatusData, GetOwnedAgentVersionStatusError, GetOwnedAgentVersionStatusResponse, SetRaceSelectionData, SetRaceSelectionError, SetRaceSelectionResponse, ClearRaceSelectionError, ClearRaceSelectionResponse, ClaimWorkData, ClaimWorkError, ClaimWorkResponse2, HeartbeatData, HeartbeatError, HeartbeatResponse2, UpdateProgressData, UpdateProgressError, UpdateProgressResponse, PresignUploadData, PresignUploadError, PresignUploadResponse2, CompleteRunData, CompleteRunError, CompleteRunResponse2, GetRunProblemsData, GetRunProblemsError, GetRunProblemsResponse, GetWeightSaltError, GetWeightSaltResponse, BanMinerData, BanMinerError, BanMinerResponse, UnbanMinerData, UnbanMinerError, UnbanMinerResponse, BanValidatorData, BanValidatorError, BanValidatorResponse, UnbanValidatorData, UnbanValidatorError, UnbanValidatorResponse, UpdateValidatorData, UpdateValidatorError, UpdateValidatorResponse, DiscardAgentVersionData, DiscardAgentVersionError, DiscardAgentVersionResponse, ReinstateAgentVersionData, ReinstateAgentVersionError, ReinstateAgentVersionResponse, EliminateAgentVersionData, EliminateAgentVersionError, EliminateAgentVersionResponse, ReinstateEliminationData, ReinstateEliminationError, ReinstateEliminationResponse2, SetTopAgentData, SetTopAgentError, SetTopAgentResponse, InvalidateEvaluationRunData, InvalidateEvaluationRunError, InvalidateEvaluationRunResponse, ReevaluateAgentVersionData, ReevaluateAgentVersionError, ReevaluateAgentVersionResponse, CancelAgentVersionData, CancelAgentVersionError, CancelAgentVersionResponse, CreateSuiteData, CreateSuiteError, CreateSuiteResponse2, ActivateSuiteData, ActivateSuiteError, ActivateSuiteResponse2, GetAuditEventsData, GetAuditEventsError, GetAuditEventsResponse, GetReaperStatsError, GetReaperStatsResponse, ClearMinerCooldownData, ClearMinerCooldownError, ClearMinerCooldownResponse, ListMinersData, ListMinersError, ListMinersResponse, ListValidatorsData, ListValidatorsError, ListValidatorsResponse, ListAgentVersions1Data, ListAgentVersions1Error, ListAgentVersions1Response, ListEvaluationRunsData, ListEvaluationRunsError, ListEvaluationRunsResponse, GetValidatorScoresData, GetValidatorScoresError, GetValidatorScoresResponse, GetAgentVersionVarianceData, GetAgentVersionVarianceError, GetAgentVersionVarianceResponse, GetAgentVersionCodeData, GetAgentVersionCodeError, GetAgentVersionCodeResponse, GetCurrentRacesError, GetCurrentRacesResponse, GetRaceDiagnosticsData, GetRaceDiagnosticsError, GetRaceDiagnosticsResponse, CloseQualifyingError, CloseQualifyingResponse2, GetValidatorResourceSamplesData, GetValidatorResourceSamplesError, GetValidatorResourceSamplesResponse, GetValidatorFailuresData, GetValidatorFailuresError, GetValidatorFailuresResponse, GetValidatorPauseError, GetValidatorPauseResponse, PostValidatorPauseData, PostValidatorPauseError, PostValidatorPauseResponse, PostValidatorResumeData, PostValidatorResumeError, PostValidatorResumeResponse, ApiProblemsData, ApiProblemsError, ApiProblemsResponse, ApiRunData, ApiRunError, ApiRunResponse } from './types.gen'; export const client = createClient(createConfig()); /** * Health Check * Shallow liveness check. Confirms the process is up; does not * exercise the DB pool. Kept available as a release valve in case * we need to flip the ALB target group back during an RDS incident. */ export const healthCheck = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/health' }); }; /** * Deep Health Check * Deep readiness check that exercises the SQLAlchemy pool (ORO-1121). * * Acquires a session and runs SELECT 1 with a hard timeout, retrying * once on failure to ride out transient pool stalls or one-shot * network blips (ORO-1168). If the pool is wedged (phantom-checked-out * slots) or RDS is unreachable across both attempts, the check fails * and the ALB pulls the task out of rotation after its own * unhealthy_threshold_count consecutive failures. * * On final failure we return 503 directly via `JSONResponse` instead * of raising `HTTPException`. The status to the ALB is identical, but * the Sentry FastAPI integration only captures *exceptions* — so this * path no longer triggers the "new unhandled error" PD rule on a * transient blip. Sustained DB-unreachable is correctly surfaced by * the ALB target-health alarm, not the Sentry new-issue rule. */ export const deepHealthCheck = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/health/deep' }); }; /** * List all suites * Get all problem suites, ordered by version descending (newest first). */ export const listSuites = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/suites' }); }; /** * Get current active suite * Fetch the currently active problem suite. */ export const getCurrentSuite = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/suites/current' }); }; /** * Get suite problems * Get the list of problems for a specific suite. */ export const getSuiteProblems = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/suites/{suite_id}/problems' }); }; /** * Get leaderboard * Get the eligible agent leaderboard for a suite. */ export const getLeaderboard = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/leaderboard' }); }; /** * Get top agent for emissions * Get the canonical top miner for emissions calculation. */ export const getTopAgent = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/top' }); }; /** * Get top miner payout rate * Get the current top miner's estimated emission payout rate in TAO/day and USD/day. Uses the cached metagraph and a periodically refreshed TAO/USD price. */ export const getTopMinerPayout = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/top-miner-payout' }); }; /** * Get top agent history * Get all agents that have held top agent status for a suite. */ export const getTopHistory = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/top/history' }); }; /** * Get agent version status * Get live status and counters for an agent version. */ export const getAgentVersionStatus = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/agent-versions/{agent_version_id}/status' }); }; /** * Get agent version runs * Get evaluation runs for an agent version. */ export const getAgentVersionRuns = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/agent-versions/{agent_version_id}/runs' }); }; /** * Get agent version problem progress * Get per-problem progress matrix across validators. */ export const getAgentVersionProblems = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/agent-versions/{agent_version_id}/problems' }); }; /** * Get agent version details * Get released public details for an agent version. */ export const getAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/agent-versions/{agent_version_id}' }); }; /** * Get artifact download URL * Get a presigned URL to download artifacts. Agent code requires the version to be released. Qualifying-phase trajectories and logs are available immediately; race-phase artifacts are gated until the race completes (403 RACE_IN_FLIGHT). */ export const getArtifactDownloadUrl = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/public/artifacts/download-url' }); }; /** * Get evaluation run details * Get detailed information about a specific evaluation run. */ export const getEvaluationRun = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/evaluation-runs/{eval_run_id}' }); }; /** * Get list of validators * Get all non-banned validators with their current status. */ export const getValidators = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/validators' }); }; /** * Get running evaluations * Get all currently running or claimed evaluations. */ export const getRunningEvaluations = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/evaluations/running' }); }; /** * Get pending evaluations * Get all open work items awaiting validator evaluations, with queue summary. */ export const getPendingEvaluations = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/evaluations/pending' }); }; /** * Get current race * Get the active race for the current suite, if any. */ export const getCurrentRace = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/races/current' }); }; /** * Get race history * Get completed and cancelled races, most recent first. */ export const getRaceHistory = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/races/history' }); }; /** * Get race details * Get details for a specific race including qualifiers and results. */ export const getRaceDetail = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/races/{race_id}' }); }; /** * Per-validator variance for a race * Per-validator variance statistics for a race, computed over included SUCCESS evaluation runs (`is_included = true`, `invalidated_at IS NULL`) joined via `eval_work_items` on `phase = 'RACE'`. Only agent-race pairs where at least two validators produced a run are counted. * * Available live during a running race. This endpoint aggregates data that `/agent-versions/{av_id}/runs` already exposes per-run — see `_assert_artifact_not_race_gated` for the artifacts that stay hidden until race completion (ORO-1467). * * Announced 2026-07-17 as part of the validator-variance visibility commitment. See the miner announcement thread for background. */ export const getRaceValidatorVariance = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/races/{race_id}/validator-variance' }); }; /** * Join waitlist * Submit an email to join the ORO waitlist. */ export const joinWaitlist = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/public/waitlist' }); }; /** * List allowed inference models * Returns the models available to ORO agents via the inference proxy. Defaults to a flat array of model IDs (provider's static allowlist). Set ``?ranked=true`` to receive models in load-/health-sorted order with per-model stats from the most recent provider poll. * * **Chutes-deprecated models (still in the Chutes allowlist for miner compatibility, but Chutes no longer serves them — route via OpenRouter):** * - `deepseek-ai/DeepSeek-V3.1-TEE` * - `deepseek-ai/DeepSeek-V3-0324-TEE` * - `deepseek-ai/DeepSeek-R1-0528-TEE` * - `XiaomiMiMo/MiMo-V2-Flash-TEE` */ export const getInferenceModels = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/public/inference/models' }); }; /** * Request Challenge * Request a challenge for wallet authentication. * * The challenge must be signed by the wallet and submitted to /session * within 60 seconds. * * Rate limited to 10 requests per minute per IP to prevent abuse. */ export const requestChallenge = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/auth/challenge' }); }; /** * Create Session Endpoint * Create a session by verifying a signed challenge. * * The challenge must have been requested within the last 60 seconds * and the signature must be valid for the challenge message. * * Rate limited to 5 requests per minute per IP to prevent brute force. */ export const createSessionEndpoint = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/auth/session' }); }; /** * Logout * Logout and invalidate the current session. */ export const logout = (options?: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/auth/logout' }); }; /** * Submit agent * Submit an agent file for evaluation. Creates new agent if needed. */ export const submitAgent = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, ...formDataBodySerializer, headers: { 'Content-Type': null, ...options?.headers }, url: '/v1/miner/submit' }); }; /** * Store an inference-provider credential * Store (or overwrite) the miner's credential for the given provider. * * Validates the credential before persisting so bad input fails here rather * than at first claim_work. The first stored provider becomes the miner's * default; switching default afterward goes through the dedicated PATCH * endpoint. */ export const storeInferenceCredential = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/miner/inference-auth/{provider}' }); }; /** * Check inference auth status for a single provider * Check whether the miner has a stored credential for the given provider. */ export const getInferenceAuthStatusOne = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/inference-auth/{provider}' }); }; /** * Disconnect an inference-provider credential * Delete the miner's stored credential for the given provider. * * If the deleted provider was the miner's default, the default falls back * to whichever other provider is still connected, or clears to NULL when * none remain. Returns the new default so the client can update without a * follow-up GET. */ export const deleteInferenceCredential = (options: OptionsLegacyParser) => { return (options?.client ?? client).delete({ ...options, url: '/v1/miner/inference-auth/{provider}' }); }; /** * List all inference-auth providers the miner has connected * List every provider the authenticated miner currently has a credential for. */ export const listInferenceAuth = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/inference-auth' }); }; /** * Set the miner's default inference provider * Set which provider claim_work should mint a token from for this miner. */ export const setDefaultInferenceProvider = (options: OptionsLegacyParser) => { return (options?.client ?? client).patch({ ...options, url: '/v1/miner/inference-auth/default' }); }; /** * @deprecated * Store Chutes OAuth refresh token (legacy — use /inference-auth/chutes) * Back-compat shim. Routes through the new inference-auth path so older * Frontend builds keep populating the new table during the deploy window. */ export const storeChutesToken = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/miner/chutes-auth' }); }; /** * @deprecated * Check Chutes auth status (legacy — use /inference-auth/chutes) * Back-compat shim. Reads from the new MinerInferenceAuth table. */ export const getChutesAuthStatus = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/chutes-auth/status' }); }; /** * Exchange Chutes PKCE auth code for a refresh token (server-side) * Complete the Chutes OAuth code exchange on behalf of the SDK CLI. * * Chutes' OAuth app is registered as a Confidential client (requires * ``client_secret`` at /idp/token). The SDK, distributed via PyPI, can't * safely hold a secret. So the SDK runs the browser PKCE leg locally * (preserves auth-code interception protection) and then hands the * resulting authorization code + ``code_verifier`` here. Backend holds * the ``client_secret`` and completes the exchange (ORO-1463). */ export const exchangeChutesCode = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/miner/chutes/exchange-code' }); }; /** * List miner's agents * List all agents owned by the authenticated miner, with cooldown status. * * Includes the latest version per agent with its state and score so the * frontend doesn't need to make N additional requests. */ export const listMinerAgents = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/agents' }); }; /** * List agent versions * List all versions of a specific agent owned by the miner. */ export const listAgentVersions = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/agents/{agent_id}/versions' }); }; /** * Get agent version status * Get detailed status of a specific agent version owned by the miner. */ export const getOwnedAgentVersionStatus = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/miner/agent-versions/{agent_version_id}' }); }; /** * Pin agent version as race candidate * Pin the given agent version as this miner's race candidate. */ export const setRaceSelection = (options: OptionsLegacyParser) => { return (options?.client ?? client).put({ ...options, url: '/v1/miner/race-selection' }); }; /** * Clear pinned race candidate * Clear the miner's pinned race candidate so the auto-pick is used. */ export const clearRaceSelection = (options?: OptionsLegacyParser) => { return (options?.client ?? client).delete({ ...options, url: '/v1/miner/race-selection' }); }; /** * Claim evaluation work * FIFO claim of next available evaluation work item. */ export const claimWork = (options?: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/validator/work/claim' }); }; /** * Extend lease * Heartbeat to extend lease and mark run as RUNNING. */ export const heartbeat = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/validator/evaluation-runs/{eval_run_id}/heartbeat' }); }; /** * Update progress * Report per-problem progress during evaluation. */ export const updateProgress = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/validator/evaluation-runs/{eval_run_id}/progress' }); }; /** * Get upload URL * Get a presigned URL for uploading per-problem evaluation logs. */ export const presignUpload = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/validator/uploads/presign' }); }; /** * Complete evaluation run * Finalize an evaluation run with terminal status and score. */ export const completeRun = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/validator/evaluation-runs/{eval_run_id}/complete' }); }; /** * Get problems for an evaluation run * Returns the problems that should be evaluated for a given run. */ export const getRunProblems = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/validator/evaluation-runs/{eval_run_id}/problems' }); }; /** * Get Weight Salt * Per-epoch base standings for the weight setter (ORO-1704). * * Serves the epoch-pinned base standings (top designation + finisher tail) * snapshotted once per epoch, so every honest validator in the epoch builds the * identical base vector regardless of tick phase. (The ORO-1649 watermark * decoy-overlay was removed — we rely on the chain's anti-copy features.) */ export const getWeightSalt = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/validator/weight-salt' }); }; /** * Ban a miner * Ban a miner from submitting agents. */ export const banMiner = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/miners/{miner_hotkey}/ban' }); }; /** * Unban a miner * Unban a miner, allowing them to submit agents again. */ export const unbanMiner = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/miners/{miner_hotkey}/unban' }); }; /** * Ban a validator * Ban a validator from claiming work. Revokes any active inference tokens. */ export const banValidator = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/validators/{validator_hotkey}/ban' }); }; /** * Unban a validator * Unban a validator, allowing them to claim work again. */ export const unbanValidator = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/validators/{validator_hotkey}/unban' }); }; /** * Update validator configuration * Update validator configuration. Currently supports `max_concurrent_runs`. */ export const updateValidator = (options: OptionsLegacyParser) => { return (options?.client ?? client).patch({ ...options, url: '/v1/admin/validators/{validator_hotkey}' }); }; /** * Discard an agent version from leaderboard * Discard an agent version from the leaderboard (reversible tombstone). * * Also cancels any active evaluation runs and closes the work item * to prevent the validator from claiming new work for this version. */ export const discardAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/discard' }); }; /** * Reinstate a discarded agent version * Reinstate a previously discarded agent version. * * Also reopens the work item so validators can claim work again. */ export const reinstateAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/reinstate' }); }; /** * Eliminate an agent version (admin override) * Stamp `eliminated_at` on the aggregate so the version is removed from * future qualifying. * * Counterpart to `reinstate-elimination`. Used to test the admission * cascade end-to-end and to manually retire an agent that should no * longer race (e.g. confirmed cheating before a natural race-loss). * * Idempotent on `eliminated_at`: re-running stamps the same row with a * fresh timestamp. */ export const eliminateAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/eliminate' }); }; /** * Reinstate an agent version that was eliminated after a race * Clear `eliminated_at` and `eliminated_in_race_id` on the aggregate. * * Use when an agent was eliminated due to a mis-evaluation, scoring bug, or * operational incident rather than genuine poor performance. The agent will * re-appear in `_find_scored_qualifiers` on the next qualifying evaluation. * * Idempotent: succeeds even if the aggregate is not currently eliminated. */ export const reinstateElimination = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/reinstate-elimination' }); }; /** * Set an agent version as the top agent for emissions * Designate an agent version as the top agent for emissions. * * The top agent is the one that receives emissions. Setting a new top agent * automatically marks the previous top agent as was_top=True. * * Requirements: * - Agent version must exist and have an aggregate for the suite * - Only one agent can be is_current_top=True per suite (enforced by DB index) */ export const setTopAgent = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/set-top' }); }; /** * Invalidate an evaluation run * Invalidate an evaluation run (irreversible). * * Marks the run as excluded from scoring and adjusts the work item's * included_success_count. Reopens the work item to allow validators * to claim replacement work. */ export const invalidateEvaluationRun = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/evaluation-runs/{eval_run_id}/invalidate' }); }; /** * Re-evaluate an agent version * Create a new work item for an agent version to be re-evaluated. */ export const reevaluateAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/reevaluate' }); }; /** * Cancel evaluation of an agent version * Cancel active evaluation runs for an agent version. */ export const cancelAgentVersion = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/cancel' }); }; /** * Create a new problem suite * Create a new problem suite version. * * Downloads and parses the problem suite JSON from S3, then creates * Problem records for each problem in the suite. */ export const createSuite = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/suites' }); }; /** * Activate a problem suite * Activate a suite, making it the current active suite (deactivates others). * * Automatically requeues the top N agent versions from the previous suite * so validators have work immediately and the leaderboard populates quickly. */ export const activateSuite = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/suites/{suite_id}/activate' }); }; /** * Get audit events * Retrieve audit events with optional filtering and pagination. */ export const getAuditEvents = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/audit-events' }); }; /** * Get reaper service statistics * Get statistics about the background reaper service. * * The reaper service runs periodically to clean up orphaned evaluation runs * where validators have stopped reporting (crashed or disconnected). * * Stats are read from Redis (persisted by the active reaper instance) to ensure * consistent visibility across all replicas. */ export const getReaperStats = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/reaper/stats' }); }; /** * Clear miner cooldown * Clear the submission cooldown for a miner. */ export const clearMinerCooldown = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/miners/{hotkey}/clear-cooldown' }); }; /** * List miners with ban status and agent count * List all miners with their ban status, agent count, and last submission time. */ export const listMiners = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/miners' }); }; /** * List validators including banned * List all validators including banned ones. */ export const listValidators = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/validators' }); }; /** * List agent versions with work item state * List agent versions with aggregate and work item state for a specific suite. */ export const listAgentVersions1 = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/agent-versions' }); }; /** * List evaluation runs with full details * List evaluation runs with optional filtering and pagination. */ export const listEvaluationRuns = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/evaluation-runs' }); }; /** * Aggregated scoring statistics per validator * Compute per-validator scoring and performance statistics. */ export const getValidatorScores = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/analytics/validator-scores' }); }; /** * Score variance across validators for recent agent versions * Find agent versions with high score variance across validators. */ export const getAgentVersionVariance = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/analytics/agent-version-variance' }); }; /** * Download agent code * Get a presigned S3 URL to download agent source code for any version, regardless of release state. */ export const getAgentVersionCode = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/agent-versions/{agent_version_id}/code' }); }; /** * Get current race state * Get all active (non-complete, non-cancelled) races with summary info. */ export const getCurrentRaces = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/races/current' }); }; /** * Get race diagnostics * Get detailed diagnostics for a specific race. */ export const getRaceDiagnostics = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/races/{race_id}/diagnostics' }); }; /** * Close qualifying and start race * Close the current qualifying window immediately. * * Sets qualifying_closes_at to now so the orchestrator picks it up * on its next cycle and transitions to RACE_RUNNING (or CANCELLED * if no qualifiers meet the threshold). */ export const closeQualifying = (options?: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/races/close-qualifying' }); }; /** * Validator host resource samples */ export const getValidatorResourceSamples = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/analytics/validator-resources' }); }; /** * Recent failed/timed-out runs for a single validator * Returns the most recent FAILED and TIMED_OUT evaluation runs for the given validator, ordered by completed_at DESC. Powers the expandable failure-history view on the admin analytics dashboard (ORO-676). */ export const getValidatorFailures = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/analytics/validator-failures/{validator_hotkey}' }); }; /** * Get validator-pause (andon-cord) state * Returns whether new validator claims are currently paused, plus metadata on who pulled the cord and when it auto-releases. */ export const getValidatorPause = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/admin/validator-pause' }); }; /** * Pause validator claims (pull the andon cord) * Block all validators from claiming new evaluations. In-flight runs continue and report normally. Idempotent — calling twice overwrites the prior pause metadata. */ export const postValidatorPause = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/validator-pause' }); }; /** * Resume validator claims (release the andon cord) */ export const postValidatorResume = (options: OptionsLegacyParser) => { return (options?.client ?? client).post({ ...options, url: '/v1/admin/validator-resume' }); }; /** * Api Problems */ export const apiProblems = (options?: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/demo/problems' }); }; /** * Api Run */ export const apiRun = (options: OptionsLegacyParser) => { return (options?.client ?? client).get({ ...options, url: '/v1/demo/run' }); };