@oro-ai/sdk 0.6.8 → 0.7.0
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 +0 -18
- package/dist/index.d.mts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +23 -0
- package/dist/index.mjs +23 -0
- package/package.json +1 -1
- package/src/generated/sdk.gen.ts +1 -1
- package/src/generated/types.gen.ts +1 -1
package/README.md
CHANGED
|
@@ -6,24 +6,6 @@ This SDK is auto-generated from the OpenAPI specification using [@hey-api/openap
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
This package is hosted on GitHub Packages. First, configure npm to use GitHub Packages for the `@oro-ai` scope.
|
|
10
|
-
|
|
11
|
-
**1. Create a GitHub Personal Access Token** with `read:packages` scope at https://github.com/settings/tokens
|
|
12
|
-
|
|
13
|
-
**2. Add to your project's `.npmrc`:**
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
@oro-ai:registry=https://npm.pkg.github.com
|
|
17
|
-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Or authenticate via npm login:
|
|
21
|
-
```bash
|
|
22
|
-
npm login --scope=@oro-ai --registry=https://npm.pkg.github.com
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**3. Install the package:**
|
|
26
|
-
|
|
27
9
|
```bash
|
|
28
10
|
npm install @oro-ai/sdk @hey-api/client-fetch
|
|
29
11
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -1979,7 +1979,7 @@ type UpdateProgressData = {
|
|
|
1979
1979
|
};
|
|
1980
1980
|
};
|
|
1981
1981
|
type UpdateProgressResponse = (ProgressUpdateResponse);
|
|
1982
|
-
type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError |
|
|
1982
|
+
type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError | NotRunOwnerError | HTTPValidationError);
|
|
1983
1983
|
type PresignUploadData = {
|
|
1984
1984
|
body: PresignUploadRequest;
|
|
1985
1985
|
};
|
|
@@ -2280,7 +2280,7 @@ declare const claimWork: <ThrowOnError extends boolean = false>(options?: Option
|
|
|
2280
2280
|
declare const heartbeat: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HeartbeatData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<HeartbeatResponse, HeartbeatError, ThrowOnError>;
|
|
2281
2281
|
/**
|
|
2282
2282
|
* Update progress
|
|
2283
|
-
* Report per-problem progress during evaluation.
|
|
2283
|
+
* Report per-problem progress during evaluation. Accepts updates even after run completion so late-arriving scores and log keys are not lost.
|
|
2284
2284
|
*/
|
|
2285
2285
|
declare const updateProgress: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateProgressData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ProgressUpdateResponse, UpdateProgressError, ThrowOnError>;
|
|
2286
2286
|
/**
|
|
@@ -2615,6 +2615,15 @@ declare function configurePublicClient(baseUrl: string, retryConfig?: RetryConfi
|
|
|
2615
2615
|
* and logout — matching the convenience of the Python SDK's BittensorAuthClient.
|
|
2616
2616
|
*/
|
|
2617
2617
|
|
|
2618
|
+
/**
|
|
2619
|
+
* A serializable snapshot of a session, suitable for caching
|
|
2620
|
+
* in sessionStorage or similar.
|
|
2621
|
+
*/
|
|
2622
|
+
interface CachedSession {
|
|
2623
|
+
token: string;
|
|
2624
|
+
expiresAt: number;
|
|
2625
|
+
role: string;
|
|
2626
|
+
}
|
|
2618
2627
|
/**
|
|
2619
2628
|
* Configuration for session-based authentication.
|
|
2620
2629
|
*/
|
|
@@ -2630,6 +2639,12 @@ interface SessionAuthConfig {
|
|
|
2630
2639
|
refreshBufferSeconds?: number;
|
|
2631
2640
|
/** Called when the session has expired and cannot be refreshed. */
|
|
2632
2641
|
onSessionExpired?: () => void;
|
|
2642
|
+
/**
|
|
2643
|
+
* Previously cached session to restore without re-authenticating.
|
|
2644
|
+
* If provided and the token hasn't expired, the manager starts
|
|
2645
|
+
* in an authenticated state — no login() call needed.
|
|
2646
|
+
*/
|
|
2647
|
+
cachedSession?: CachedSession;
|
|
2633
2648
|
}
|
|
2634
2649
|
/**
|
|
2635
2650
|
* Information about the current session.
|
|
@@ -2677,6 +2692,14 @@ declare class SessionAuthManager {
|
|
|
2677
2692
|
sessionNeedsRefresh(): boolean;
|
|
2678
2693
|
/** Returns current session info, or null if no active session. */
|
|
2679
2694
|
getSessionInfo(): SessionInfo | null;
|
|
2695
|
+
/**
|
|
2696
|
+
* Returns a serializable snapshot of the current session for caching.
|
|
2697
|
+
* Returns null if no active session.
|
|
2698
|
+
*
|
|
2699
|
+
* Store the result in sessionStorage and pass it back as
|
|
2700
|
+
* `cachedSession` in the constructor to restore without re-authenticating.
|
|
2701
|
+
*/
|
|
2702
|
+
getSessionToken(): CachedSession | null;
|
|
2680
2703
|
/**
|
|
2681
2704
|
* Returns authorization headers. Auto-refreshes if the session is
|
|
2682
2705
|
* within the refresh buffer. Throws if not authenticated or session expired.
|
|
@@ -2712,4 +2735,4 @@ declare class SessionAuthManager {
|
|
|
2712
2735
|
*/
|
|
2713
2736
|
declare function configureSessionAuth(baseUrl: string, config: SessionAuthConfig): SessionAuthManager;
|
|
2714
2737
|
|
|
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 };
|
|
2738
|
+
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 CachedSession, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1979,7 +1979,7 @@ type UpdateProgressData = {
|
|
|
1979
1979
|
};
|
|
1980
1980
|
};
|
|
1981
1981
|
type UpdateProgressResponse = (ProgressUpdateResponse);
|
|
1982
|
-
type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError |
|
|
1982
|
+
type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError | NotRunOwnerError | HTTPValidationError);
|
|
1983
1983
|
type PresignUploadData = {
|
|
1984
1984
|
body: PresignUploadRequest;
|
|
1985
1985
|
};
|
|
@@ -2280,7 +2280,7 @@ declare const claimWork: <ThrowOnError extends boolean = false>(options?: Option
|
|
|
2280
2280
|
declare const heartbeat: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HeartbeatData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<HeartbeatResponse, HeartbeatError, ThrowOnError>;
|
|
2281
2281
|
/**
|
|
2282
2282
|
* Update progress
|
|
2283
|
-
* Report per-problem progress during evaluation.
|
|
2283
|
+
* Report per-problem progress during evaluation. Accepts updates even after run completion so late-arriving scores and log keys are not lost.
|
|
2284
2284
|
*/
|
|
2285
2285
|
declare const updateProgress: <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateProgressData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ProgressUpdateResponse, UpdateProgressError, ThrowOnError>;
|
|
2286
2286
|
/**
|
|
@@ -2615,6 +2615,15 @@ declare function configurePublicClient(baseUrl: string, retryConfig?: RetryConfi
|
|
|
2615
2615
|
* and logout — matching the convenience of the Python SDK's BittensorAuthClient.
|
|
2616
2616
|
*/
|
|
2617
2617
|
|
|
2618
|
+
/**
|
|
2619
|
+
* A serializable snapshot of a session, suitable for caching
|
|
2620
|
+
* in sessionStorage or similar.
|
|
2621
|
+
*/
|
|
2622
|
+
interface CachedSession {
|
|
2623
|
+
token: string;
|
|
2624
|
+
expiresAt: number;
|
|
2625
|
+
role: string;
|
|
2626
|
+
}
|
|
2618
2627
|
/**
|
|
2619
2628
|
* Configuration for session-based authentication.
|
|
2620
2629
|
*/
|
|
@@ -2630,6 +2639,12 @@ interface SessionAuthConfig {
|
|
|
2630
2639
|
refreshBufferSeconds?: number;
|
|
2631
2640
|
/** Called when the session has expired and cannot be refreshed. */
|
|
2632
2641
|
onSessionExpired?: () => void;
|
|
2642
|
+
/**
|
|
2643
|
+
* Previously cached session to restore without re-authenticating.
|
|
2644
|
+
* If provided and the token hasn't expired, the manager starts
|
|
2645
|
+
* in an authenticated state — no login() call needed.
|
|
2646
|
+
*/
|
|
2647
|
+
cachedSession?: CachedSession;
|
|
2633
2648
|
}
|
|
2634
2649
|
/**
|
|
2635
2650
|
* Information about the current session.
|
|
@@ -2677,6 +2692,14 @@ declare class SessionAuthManager {
|
|
|
2677
2692
|
sessionNeedsRefresh(): boolean;
|
|
2678
2693
|
/** Returns current session info, or null if no active session. */
|
|
2679
2694
|
getSessionInfo(): SessionInfo | null;
|
|
2695
|
+
/**
|
|
2696
|
+
* Returns a serializable snapshot of the current session for caching.
|
|
2697
|
+
* Returns null if no active session.
|
|
2698
|
+
*
|
|
2699
|
+
* Store the result in sessionStorage and pass it back as
|
|
2700
|
+
* `cachedSession` in the constructor to restore without re-authenticating.
|
|
2701
|
+
*/
|
|
2702
|
+
getSessionToken(): CachedSession | null;
|
|
2680
2703
|
/**
|
|
2681
2704
|
* Returns authorization headers. Auto-refreshes if the session is
|
|
2682
2705
|
* within the refresh buffer. Throws if not authenticated or session expired.
|
|
@@ -2712,4 +2735,4 @@ declare class SessionAuthManager {
|
|
|
2712
2735
|
*/
|
|
2713
2736
|
declare function configureSessionAuth(baseUrl: string, config: SessionAuthConfig): SessionAuthManager;
|
|
2714
2737
|
|
|
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 };
|
|
2738
|
+
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 CachedSession, 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 };
|
package/dist/index.js
CHANGED
|
@@ -550,6 +550,14 @@ var SessionAuthManager = class {
|
|
|
550
550
|
this.sign = config.sign;
|
|
551
551
|
this.refreshBufferSeconds = config.refreshBufferSeconds ?? 300;
|
|
552
552
|
this.onSessionExpired = config.onSessionExpired;
|
|
553
|
+
if (config.cachedSession) {
|
|
554
|
+
const now = Date.now() / 1e3;
|
|
555
|
+
if (now < config.cachedSession.expiresAt) {
|
|
556
|
+
this.token = config.cachedSession.token;
|
|
557
|
+
this.expiresAt = config.cachedSession.expiresAt;
|
|
558
|
+
this.role = config.cachedSession.role;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
553
561
|
}
|
|
554
562
|
/**
|
|
555
563
|
* Perform challenge/response login flow.
|
|
@@ -626,6 +634,21 @@ var SessionAuthManager = class {
|
|
|
626
634
|
expiresAt: this.expiresAt
|
|
627
635
|
};
|
|
628
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* Returns a serializable snapshot of the current session for caching.
|
|
639
|
+
* Returns null if no active session.
|
|
640
|
+
*
|
|
641
|
+
* Store the result in sessionStorage and pass it back as
|
|
642
|
+
* `cachedSession` in the constructor to restore without re-authenticating.
|
|
643
|
+
*/
|
|
644
|
+
getSessionToken() {
|
|
645
|
+
if (!this.token || Date.now() / 1e3 >= this.expiresAt) return null;
|
|
646
|
+
return {
|
|
647
|
+
token: this.token,
|
|
648
|
+
expiresAt: this.expiresAt,
|
|
649
|
+
role: this.role
|
|
650
|
+
};
|
|
651
|
+
}
|
|
629
652
|
/**
|
|
630
653
|
* Returns authorization headers. Auto-refreshes if the session is
|
|
631
654
|
* within the refresh buffer. Throws if not authenticated or session expired.
|
package/dist/index.mjs
CHANGED
|
@@ -458,6 +458,14 @@ var SessionAuthManager = class {
|
|
|
458
458
|
this.sign = config.sign;
|
|
459
459
|
this.refreshBufferSeconds = config.refreshBufferSeconds ?? 300;
|
|
460
460
|
this.onSessionExpired = config.onSessionExpired;
|
|
461
|
+
if (config.cachedSession) {
|
|
462
|
+
const now = Date.now() / 1e3;
|
|
463
|
+
if (now < config.cachedSession.expiresAt) {
|
|
464
|
+
this.token = config.cachedSession.token;
|
|
465
|
+
this.expiresAt = config.cachedSession.expiresAt;
|
|
466
|
+
this.role = config.cachedSession.role;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
461
469
|
}
|
|
462
470
|
/**
|
|
463
471
|
* Perform challenge/response login flow.
|
|
@@ -534,6 +542,21 @@ var SessionAuthManager = class {
|
|
|
534
542
|
expiresAt: this.expiresAt
|
|
535
543
|
};
|
|
536
544
|
}
|
|
545
|
+
/**
|
|
546
|
+
* Returns a serializable snapshot of the current session for caching.
|
|
547
|
+
* Returns null if no active session.
|
|
548
|
+
*
|
|
549
|
+
* Store the result in sessionStorage and pass it back as
|
|
550
|
+
* `cachedSession` in the constructor to restore without re-authenticating.
|
|
551
|
+
*/
|
|
552
|
+
getSessionToken() {
|
|
553
|
+
if (!this.token || Date.now() / 1e3 >= this.expiresAt) return null;
|
|
554
|
+
return {
|
|
555
|
+
token: this.token,
|
|
556
|
+
expiresAt: this.expiresAt,
|
|
557
|
+
role: this.role
|
|
558
|
+
};
|
|
559
|
+
}
|
|
537
560
|
/**
|
|
538
561
|
* Returns authorization headers. Auto-refreshes if the session is
|
|
539
562
|
* within the refresh buffer. Throws if not authenticated or session expired.
|
package/package.json
CHANGED
package/src/generated/sdk.gen.ts
CHANGED
|
@@ -275,7 +275,7 @@ export const heartbeat = <ThrowOnError extends boolean = false>(options: Options
|
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
277
|
* Update progress
|
|
278
|
-
* Report per-problem progress during evaluation.
|
|
278
|
+
* Report per-problem progress during evaluation. Accepts updates even after run completion so late-arriving scores and log keys are not lost.
|
|
279
279
|
*/
|
|
280
280
|
export const updateProgress = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<UpdateProgressData, ThrowOnError>) => {
|
|
281
281
|
return (options?.client ?? client).post<UpdateProgressResponse, UpdateProgressError, ThrowOnError>({
|
|
@@ -2140,7 +2140,7 @@ export type UpdateProgressData = {
|
|
|
2140
2140
|
|
|
2141
2141
|
export type UpdateProgressResponse = (ProgressUpdateResponse);
|
|
2142
2142
|
|
|
2143
|
-
export type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError |
|
|
2143
|
+
export type UpdateProgressError = (InvalidProblemIdError | EvalRunNotFoundError | NotRunOwnerError | HTTPValidationError);
|
|
2144
2144
|
|
|
2145
2145
|
export type PresignUploadData = {
|
|
2146
2146
|
body: PresignUploadRequest;
|