plato-sandbox-sdk 1.1.1
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/BaseClient.ts +28 -0
- package/Client.ts +1849 -0
- package/README.md +339 -0
- package/api/client/index.ts +1 -0
- package/api/client/requests/CreateSandboxRequest.ts +37 -0
- package/api/client/requests/CreateSnapshotRequest.ts +11 -0
- package/api/client/requests/EvaluateRequest.ts +9 -0
- package/api/client/requests/GetEnvironmentStateRequest.ts +11 -0
- package/api/client/requests/GetTestCasesRequest.ts +15 -0
- package/api/client/requests/LogRequest.ts +19 -0
- package/api/client/requests/MakeEnvironmentRequest.ts +27 -0
- package/api/client/requests/PostEvaluationResultRequest.ts +14 -0
- package/api/client/requests/ResetEnvironmentRequest.ts +11 -0
- package/api/client/requests/SetupRootAccessRequest.ts +14 -0
- package/api/client/requests/SetupSandboxRequest.ts +29 -0
- package/api/client/requests/StartWorkerRequest.ts +28 -0
- package/api/client/requests/index.ts +12 -0
- package/api/errors/BadRequestError.ts +17 -0
- package/api/errors/index.ts +1 -0
- package/api/index.ts +3 -0
- package/api/types/ActiveSessionResponse.ts +6 -0
- package/api/types/BackupEnvironmentResponse.ts +7 -0
- package/api/types/CdpUrlResponse.ts +12 -0
- package/api/types/CloseEnvironmentResponse.ts +6 -0
- package/api/types/CreateSandboxResponse.ts +14 -0
- package/api/types/CreateSnapshotResponse.ts +10 -0
- package/api/types/DeleteSandboxResponse.ts +6 -0
- package/api/types/Environment.ts +7 -0
- package/api/types/EnvironmentStateResponse.ts +11 -0
- package/api/types/ErrorResponse.ts +6 -0
- package/api/types/EvaluateResponse.ts +21 -0
- package/api/types/EvaluationResult.ts +9 -0
- package/api/types/HeartbeatResponse.ts +6 -0
- package/api/types/JobStatusResponse.ts +7 -0
- package/api/types/LogResponse.ts +5 -0
- package/api/types/MakeEnvironmentResponse.ts +6 -0
- package/api/types/OperationEvent.ts +42 -0
- package/api/types/PlatoConfig.ts +8 -0
- package/api/types/PlatoTask.ts +21 -0
- package/api/types/PlatoTaskMetadata.ts +20 -0
- package/api/types/PostEvaluationResultResponse.ts +6 -0
- package/api/types/ProxyUrlResponse.ts +12 -0
- package/api/types/ResetEnvironmentResponse.ts +13 -0
- package/api/types/RunningSessionsCountResponse.ts +6 -0
- package/api/types/Sandbox.ts +10 -0
- package/api/types/ScoringType.ts +7 -0
- package/api/types/SetupRootAccessResponse.ts +7 -0
- package/api/types/SetupSandboxResponse.ts +6 -0
- package/api/types/SimConfigCompute.ts +9 -0
- package/api/types/SimConfigDataset.ts +10 -0
- package/api/types/SimConfigListener.ts +27 -0
- package/api/types/SimConfigMetadata.ts +14 -0
- package/api/types/SimConfigService.ts +8 -0
- package/api/types/Simulator.ts +10 -0
- package/api/types/SimulatorListItem.ts +7 -0
- package/api/types/SshInfo.ts +18 -0
- package/api/types/StartWorkerResponse.ts +7 -0
- package/api/types/TaskMetadata.ts +20 -0
- package/api/types/TestCase.ts +40 -0
- package/api/types/TestCasesResponse.ts +10 -0
- package/api/types/Variable.ts +6 -0
- package/api/types/WorkerReadyResponse.ts +9 -0
- package/api/types/index.ts +42 -0
- package/core/fetcher/APIResponse.ts +23 -0
- package/core/fetcher/BinaryResponse.ts +36 -0
- package/core/fetcher/EndpointMetadata.ts +13 -0
- package/core/fetcher/EndpointSupplier.ts +14 -0
- package/core/fetcher/Fetcher.ts +165 -0
- package/core/fetcher/Headers.ts +93 -0
- package/core/fetcher/HttpResponsePromise.ts +116 -0
- package/core/fetcher/RawResponse.ts +61 -0
- package/core/fetcher/ResponseWithBody.ts +7 -0
- package/core/fetcher/Supplier.ts +11 -0
- package/core/fetcher/createRequestUrl.ts +6 -0
- package/core/fetcher/getErrorResponseBody.ts +33 -0
- package/core/fetcher/getFetchFn.ts +3 -0
- package/core/fetcher/getHeader.ts +8 -0
- package/core/fetcher/getRequestBody.ts +16 -0
- package/core/fetcher/getResponseBody.ts +43 -0
- package/core/fetcher/index.ts +11 -0
- package/core/fetcher/makeRequest.ts +44 -0
- package/core/fetcher/requestWithRetries.ts +73 -0
- package/core/fetcher/signals.ts +38 -0
- package/core/headers.ts +33 -0
- package/core/index.ts +4 -0
- package/core/json.ts +27 -0
- package/core/runtime/index.ts +1 -0
- package/core/runtime/runtime.ts +133 -0
- package/core/stream/Stream.ts +155 -0
- package/core/stream/index.ts +1 -0
- package/core/url/encodePathParam.ts +18 -0
- package/core/url/index.ts +3 -0
- package/core/url/join.ts +80 -0
- package/core/url/qs.ts +74 -0
- package/dist/BaseClient.d.ts +25 -0
- package/dist/Client.d.ts +376 -0
- package/dist/api/client/index.d.ts +2 -0
- package/dist/api/client/requests/CreateSandboxRequest.d.ts +35 -0
- package/dist/api/client/requests/CreateSnapshotRequest.d.ts +10 -0
- package/dist/api/client/requests/EvaluateRequest.d.ts +8 -0
- package/dist/api/client/requests/GetEnvironmentStateRequest.d.ts +10 -0
- package/dist/api/client/requests/GetTestCasesRequest.d.ts +14 -0
- package/dist/api/client/requests/LogRequest.d.ts +18 -0
- package/dist/api/client/requests/MakeEnvironmentRequest.d.ts +26 -0
- package/dist/api/client/requests/PostEvaluationResultRequest.d.ts +13 -0
- package/dist/api/client/requests/ResetEnvironmentRequest.d.ts +10 -0
- package/dist/api/client/requests/SetupRootAccessRequest.d.ts +13 -0
- package/dist/api/client/requests/SetupSandboxRequest.d.ts +27 -0
- package/dist/api/client/requests/StartWorkerRequest.d.ts +26 -0
- package/dist/api/client/requests/index.d.ts +13 -0
- package/dist/api/errors/BadRequestError.d.ts +7 -0
- package/dist/api/errors/index.d.ts +2 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/types/ActiveSessionResponse.d.ts +5 -0
- package/dist/api/types/BackupEnvironmentResponse.d.ts +6 -0
- package/dist/api/types/CdpUrlResponse.d.ts +10 -0
- package/dist/api/types/CloseEnvironmentResponse.d.ts +5 -0
- package/dist/api/types/CreateSandboxResponse.d.ts +13 -0
- package/dist/api/types/CreateSnapshotResponse.d.ts +9 -0
- package/dist/api/types/DeleteSandboxResponse.d.ts +5 -0
- package/dist/api/types/Environment.d.ts +6 -0
- package/dist/api/types/EnvironmentStateResponse.d.ts +9 -0
- package/dist/api/types/ErrorResponse.d.ts +5 -0
- package/dist/api/types/EvaluateResponse.d.ts +18 -0
- package/dist/api/types/EvaluationResult.d.ts +8 -0
- package/dist/api/types/HeartbeatResponse.d.ts +5 -0
- package/dist/api/types/JobStatusResponse.d.ts +6 -0
- package/dist/api/types/LogResponse.d.ts +4 -0
- package/dist/api/types/MakeEnvironmentResponse.d.ts +5 -0
- package/dist/api/types/OperationEvent.d.ts +40 -0
- package/dist/api/types/PlatoConfig.d.ts +6 -0
- package/dist/api/types/PlatoTask.d.ts +19 -0
- package/dist/api/types/PlatoTaskMetadata.d.ts +18 -0
- package/dist/api/types/PostEvaluationResultResponse.d.ts +5 -0
- package/dist/api/types/ProxyUrlResponse.d.ts +10 -0
- package/dist/api/types/ResetEnvironmentResponse.d.ts +11 -0
- package/dist/api/types/RunningSessionsCountResponse.d.ts +5 -0
- package/dist/api/types/Sandbox.d.ts +9 -0
- package/dist/api/types/ScoringType.d.ts +6 -0
- package/dist/api/types/SetupRootAccessResponse.d.ts +6 -0
- package/dist/api/types/SetupSandboxResponse.d.ts +5 -0
- package/dist/api/types/SimConfigCompute.d.ts +8 -0
- package/dist/api/types/SimConfigDataset.d.ts +8 -0
- package/dist/api/types/SimConfigListener.d.ts +25 -0
- package/dist/api/types/SimConfigMetadata.d.ts +12 -0
- package/dist/api/types/SimConfigService.d.ts +7 -0
- package/dist/api/types/Simulator.d.ts +9 -0
- package/dist/api/types/SimulatorListItem.d.ts +6 -0
- package/dist/api/types/SshInfo.d.ts +17 -0
- package/dist/api/types/StartWorkerResponse.d.ts +6 -0
- package/dist/api/types/TaskMetadata.d.ts +18 -0
- package/dist/api/types/TestCase.d.ts +34 -0
- package/dist/api/types/TestCasesResponse.d.ts +8 -0
- package/dist/api/types/Variable.d.ts +5 -0
- package/dist/api/types/WorkerReadyResponse.d.ts +8 -0
- package/dist/api/types/index.d.ts +43 -0
- package/dist/core/fetcher/APIResponse.d.ts +21 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +21 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts +14 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts +13 -0
- package/dist/core/fetcher/Fetcher.d.ts +43 -0
- package/dist/core/fetcher/Headers.d.ts +3 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +59 -0
- package/dist/core/fetcher/RawResponse.d.ts +30 -0
- package/dist/core/fetcher/ResponseWithBody.d.ts +5 -0
- package/dist/core/fetcher/Supplier.d.ts +5 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +2 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +2 -0
- package/dist/core/fetcher/getFetchFn.d.ts +2 -0
- package/dist/core/fetcher/getHeader.d.ts +2 -0
- package/dist/core/fetcher/getRequestBody.d.ts +8 -0
- package/dist/core/fetcher/getResponseBody.d.ts +2 -0
- package/dist/core/fetcher/index.d.ts +12 -0
- package/dist/core/fetcher/makeRequest.d.ts +2 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +2 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/json.d.ts +16 -0
- package/dist/core/runtime/index.d.ts +2 -0
- package/dist/core/runtime/runtime.d.ts +10 -0
- package/dist/core/stream/Stream.d.ts +48 -0
- package/dist/core/stream/index.d.ts +2 -0
- package/dist/core/url/encodePathParam.d.ts +2 -0
- package/dist/core/url/index.d.ts +4 -0
- package/dist/core/url/join.d.ts +2 -0
- package/dist/core/url/qs.d.ts +7 -0
- package/dist/errors/ApiError.d.ts +13 -0
- package/dist/errors/ApiTimeoutError.d.ts +4 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/helpers/SandboxHelpers.d.ts +127 -0
- package/dist/helpers/SandboxMonitor.d.ts +89 -0
- package/dist/helpers/index.d.ts +9 -0
- package/dist/index.d.ts +6 -0
- package/errors/ApiError.ts +53 -0
- package/errors/ApiTimeoutError.ts +8 -0
- package/errors/index.ts +2 -0
- package/helpers/README.md +229 -0
- package/helpers/SandboxHelpers.ts +213 -0
- package/helpers/SandboxMonitor.ts +252 -0
- package/helpers/index.ts +10 -0
- package/index.ts +7 -0
- package/package.json +54 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CreateSandboxResponse {
|
|
2
|
+
/** Public URL for the sandbox */
|
|
3
|
+
url?: string;
|
|
4
|
+
/** Public ID of the sandbox job */
|
|
5
|
+
job_public_id: string;
|
|
6
|
+
/** Job group ID for the sandbox */
|
|
7
|
+
job_group_id: string;
|
|
8
|
+
/** Current status of the sandbox */
|
|
9
|
+
status?: string;
|
|
10
|
+
/** Correlation ID for monitoring operation progress via SSE */
|
|
11
|
+
correlation_id?: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=CreateSandboxResponse.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface EvaluateResponse {
|
|
2
|
+
score?: EvaluateResponse.Score;
|
|
3
|
+
}
|
|
4
|
+
export declare namespace EvaluateResponse {
|
|
5
|
+
interface Score {
|
|
6
|
+
result?: Score.Result;
|
|
7
|
+
}
|
|
8
|
+
namespace Score {
|
|
9
|
+
interface Result {
|
|
10
|
+
correct?: boolean;
|
|
11
|
+
reason?: string;
|
|
12
|
+
diffs?: Record<string, unknown>[];
|
|
13
|
+
expected_mutations?: Record<string, unknown>[];
|
|
14
|
+
mutations?: Record<string, unknown>[];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=EvaluateResponse.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-sent event for operation monitoring. The SSE data field contains base64-encoded JSON of this object.
|
|
3
|
+
*
|
|
4
|
+
* **Event Types:**
|
|
5
|
+
* - `connected`: Initial connection event, no action needed, continue listening
|
|
6
|
+
* - `progress`: Progress update with human-readable message
|
|
7
|
+
* - `run_result`: Sandbox setup/creation completed (check `success` field)
|
|
8
|
+
* - `ssh_result`: SSH setup operation completed (check `success` field)
|
|
9
|
+
* - `error`: Operation failed (check `error` or `message` field)
|
|
10
|
+
*
|
|
11
|
+
* **Terminal Events:**
|
|
12
|
+
* `run_result`, `ssh_result`, and `error` are terminal events that indicate the operation has finished.
|
|
13
|
+
* Close the stream after receiving one of these.
|
|
14
|
+
*
|
|
15
|
+
* **Success Detection:**
|
|
16
|
+
* An operation is successful if you receive `run_result` or `ssh_result` with `success: true`.
|
|
17
|
+
* An operation failed if you receive an `error` event or a result event with `success: false`.
|
|
18
|
+
*/
|
|
19
|
+
export interface OperationEvent {
|
|
20
|
+
/** Type of operation event */
|
|
21
|
+
type: OperationEvent.Type;
|
|
22
|
+
/** Whether the operation was successful (only present in result events) */
|
|
23
|
+
success?: boolean;
|
|
24
|
+
/** Error message if operation failed */
|
|
25
|
+
error?: string;
|
|
26
|
+
/** Human-readable progress or status message */
|
|
27
|
+
message?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace OperationEvent {
|
|
30
|
+
/** Type of operation event */
|
|
31
|
+
const Type: {
|
|
32
|
+
readonly Connected: "connected";
|
|
33
|
+
readonly RunResult: "run_result";
|
|
34
|
+
readonly SshResult: "ssh_result";
|
|
35
|
+
readonly Error: "error";
|
|
36
|
+
readonly Progress: "progress";
|
|
37
|
+
};
|
|
38
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=OperationEvent.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as Api from "../index.js";
|
|
2
|
+
export interface PlatoTask {
|
|
3
|
+
public_id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
env_id: string;
|
|
7
|
+
start_url: string;
|
|
8
|
+
dataset_name?: string;
|
|
9
|
+
average_time?: number;
|
|
10
|
+
average_steps?: number;
|
|
11
|
+
num_validator_human_scores?: number;
|
|
12
|
+
default_scoring_config?: Record<string, unknown>;
|
|
13
|
+
scoring_type?: Api.ScoringType[];
|
|
14
|
+
output_schema?: Record<string, unknown>;
|
|
15
|
+
is_sample?: boolean;
|
|
16
|
+
simulator_artifact_id?: string;
|
|
17
|
+
metadata?: Api.PlatoTaskMetadata;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=PlatoTask.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PlatoTaskMetadata {
|
|
2
|
+
reasoning_level?: PlatoTaskMetadata.ReasoningLevel;
|
|
3
|
+
skills?: string[];
|
|
4
|
+
capabilities?: string[];
|
|
5
|
+
tags?: string[];
|
|
6
|
+
rejected?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace PlatoTaskMetadata {
|
|
9
|
+
const ReasoningLevel: {
|
|
10
|
+
readonly Level1: "level_1";
|
|
11
|
+
readonly Level2: "level_2";
|
|
12
|
+
readonly Level3: "level_3";
|
|
13
|
+
readonly Level4: "level_4";
|
|
14
|
+
readonly Level5: "level_5";
|
|
15
|
+
};
|
|
16
|
+
type ReasoningLevel = (typeof ReasoningLevel)[keyof typeof ReasoningLevel];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=PlatoTaskMetadata.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ResetEnvironmentResponse {
|
|
2
|
+
success: boolean;
|
|
3
|
+
error?: string;
|
|
4
|
+
data?: ResetEnvironmentResponse.Data;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace ResetEnvironmentResponse {
|
|
7
|
+
interface Data {
|
|
8
|
+
run_session_id?: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ResetEnvironmentResponse.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as Api from "../index.js";
|
|
2
|
+
export interface SimConfigDataset {
|
|
3
|
+
compute: Api.SimConfigCompute;
|
|
4
|
+
metadata: Api.SimConfigMetadata;
|
|
5
|
+
services?: Record<string, Api.SimConfigService>;
|
|
6
|
+
listeners?: Record<string, Api.SimConfigListener>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SimConfigDataset.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface SimConfigListener {
|
|
2
|
+
type: SimConfigListener.Type;
|
|
3
|
+
db_type?: string;
|
|
4
|
+
db_host?: string;
|
|
5
|
+
db_port?: number;
|
|
6
|
+
db_user?: string;
|
|
7
|
+
db_password?: string;
|
|
8
|
+
db_database?: string;
|
|
9
|
+
target_dir?: string;
|
|
10
|
+
watch_enabled?: boolean;
|
|
11
|
+
watch_patterns?: string[];
|
|
12
|
+
ignore_patterns?: string[];
|
|
13
|
+
seed_data_path?: string;
|
|
14
|
+
seed_data_paths?: string[];
|
|
15
|
+
volumes?: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare namespace SimConfigListener {
|
|
18
|
+
const Type: {
|
|
19
|
+
readonly Db: "db";
|
|
20
|
+
readonly File: "file";
|
|
21
|
+
readonly Proxy: "proxy";
|
|
22
|
+
};
|
|
23
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=SimConfigListener.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Api from "../index.js";
|
|
2
|
+
export interface SimConfigMetadata {
|
|
3
|
+
favicon?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
source_code_url?: string;
|
|
7
|
+
start_url?: string;
|
|
8
|
+
license?: string;
|
|
9
|
+
variables?: Api.Variable[];
|
|
10
|
+
flows_path?: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=SimConfigMetadata.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SshInfo {
|
|
2
|
+
/** Complete SSH command to connect */
|
|
3
|
+
ssh_command: string;
|
|
4
|
+
/** SSH host identifier */
|
|
5
|
+
ssh_host: string;
|
|
6
|
+
/** Path to SSH config file */
|
|
7
|
+
ssh_config_path: string;
|
|
8
|
+
/** Sandbox public ID */
|
|
9
|
+
public_id: string;
|
|
10
|
+
/** Generated SSH public key */
|
|
11
|
+
public_key?: string;
|
|
12
|
+
/** Path to private key file */
|
|
13
|
+
private_key_path?: string;
|
|
14
|
+
/** Correlation ID for monitoring SSH setup */
|
|
15
|
+
correlation_id?: string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SshInfo.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TaskMetadata {
|
|
2
|
+
reasoningLevel?: TaskMetadata.ReasoningLevel;
|
|
3
|
+
skills?: string[];
|
|
4
|
+
capabilities?: string[];
|
|
5
|
+
tags?: string[];
|
|
6
|
+
rejected?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace TaskMetadata {
|
|
9
|
+
const ReasoningLevel: {
|
|
10
|
+
readonly Level1: "level_1";
|
|
11
|
+
readonly Level2: "level_2";
|
|
12
|
+
readonly Level3: "level_3";
|
|
13
|
+
readonly Level4: "level_4";
|
|
14
|
+
readonly Level5: "level_5";
|
|
15
|
+
};
|
|
16
|
+
type ReasoningLevel = (typeof ReasoningLevel)[keyof typeof ReasoningLevel];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TaskMetadata.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type * as Api from "../index.js";
|
|
2
|
+
export interface TestCase {
|
|
3
|
+
publicId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
startUrl: string;
|
|
7
|
+
simulator: TestCase.Simulator;
|
|
8
|
+
averageTimeTaken?: number;
|
|
9
|
+
averageStepsTaken?: number;
|
|
10
|
+
defaultScoringConfig?: TestCase.DefaultScoringConfig;
|
|
11
|
+
scoringTypes?: TestCase.ScoringTypes.Item[];
|
|
12
|
+
outputSchema?: Record<string, unknown>;
|
|
13
|
+
isSample?: boolean;
|
|
14
|
+
simulatorArtifactId?: string;
|
|
15
|
+
metadataConfig?: Api.TaskMetadata;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace TestCase {
|
|
18
|
+
interface Simulator {
|
|
19
|
+
name?: string;
|
|
20
|
+
id?: number;
|
|
21
|
+
}
|
|
22
|
+
interface DefaultScoringConfig {
|
|
23
|
+
num_sessions_used?: number;
|
|
24
|
+
}
|
|
25
|
+
type ScoringTypes = ScoringTypes.Item[];
|
|
26
|
+
namespace ScoringTypes {
|
|
27
|
+
const Item: {
|
|
28
|
+
readonly Output: "output";
|
|
29
|
+
readonly Mutations: "mutations";
|
|
30
|
+
};
|
|
31
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=TestCase.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * from "./ActiveSessionResponse.js";
|
|
2
|
+
export * from "./BackupEnvironmentResponse.js";
|
|
3
|
+
export * from "./CdpUrlResponse.js";
|
|
4
|
+
export * from "./CloseEnvironmentResponse.js";
|
|
5
|
+
export * from "./CreateSandboxResponse.js";
|
|
6
|
+
export * from "./CreateSnapshotResponse.js";
|
|
7
|
+
export * from "./DeleteSandboxResponse.js";
|
|
8
|
+
export * from "./Environment.js";
|
|
9
|
+
export * from "./EnvironmentStateResponse.js";
|
|
10
|
+
export * from "./ErrorResponse.js";
|
|
11
|
+
export * from "./EvaluateResponse.js";
|
|
12
|
+
export * from "./EvaluationResult.js";
|
|
13
|
+
export * from "./HeartbeatResponse.js";
|
|
14
|
+
export * from "./JobStatusResponse.js";
|
|
15
|
+
export * from "./LogResponse.js";
|
|
16
|
+
export * from "./MakeEnvironmentResponse.js";
|
|
17
|
+
export * from "./OperationEvent.js";
|
|
18
|
+
export * from "./PlatoConfig.js";
|
|
19
|
+
export * from "./PlatoTask.js";
|
|
20
|
+
export * from "./PlatoTaskMetadata.js";
|
|
21
|
+
export * from "./PostEvaluationResultResponse.js";
|
|
22
|
+
export * from "./ProxyUrlResponse.js";
|
|
23
|
+
export * from "./ResetEnvironmentResponse.js";
|
|
24
|
+
export * from "./RunningSessionsCountResponse.js";
|
|
25
|
+
export * from "./Sandbox.js";
|
|
26
|
+
export * from "./ScoringType.js";
|
|
27
|
+
export * from "./SetupRootAccessResponse.js";
|
|
28
|
+
export * from "./SetupSandboxResponse.js";
|
|
29
|
+
export * from "./SimConfigCompute.js";
|
|
30
|
+
export * from "./SimConfigDataset.js";
|
|
31
|
+
export * from "./SimConfigListener.js";
|
|
32
|
+
export * from "./SimConfigMetadata.js";
|
|
33
|
+
export * from "./SimConfigService.js";
|
|
34
|
+
export * from "./Simulator.js";
|
|
35
|
+
export * from "./SimulatorListItem.js";
|
|
36
|
+
export * from "./SshInfo.js";
|
|
37
|
+
export * from "./StartWorkerResponse.js";
|
|
38
|
+
export * from "./TaskMetadata.js";
|
|
39
|
+
export * from "./TestCase.js";
|
|
40
|
+
export * from "./TestCasesResponse.js";
|
|
41
|
+
export * from "./Variable.js";
|
|
42
|
+
export * from "./WorkerReadyResponse.js";
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RawResponse } from "./RawResponse.js";
|
|
2
|
+
/**
|
|
3
|
+
* The response of an API call.
|
|
4
|
+
* It is a successful response or a failed response.
|
|
5
|
+
*/
|
|
6
|
+
export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
|
|
7
|
+
export interface SuccessfulResponse<T> {
|
|
8
|
+
ok: true;
|
|
9
|
+
body: T;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `rawResponse` instead
|
|
12
|
+
*/
|
|
13
|
+
headers?: Record<string, any>;
|
|
14
|
+
rawResponse: RawResponse;
|
|
15
|
+
}
|
|
16
|
+
export interface FailedResponse<T> {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: T;
|
|
19
|
+
rawResponse: RawResponse;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=APIResponse.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ResponseWithBody } from "./ResponseWithBody.js";
|
|
2
|
+
export type BinaryResponse = {
|
|
3
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
4
|
+
bodyUsed: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a ReadableStream of the response body.
|
|
7
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
8
|
+
*/
|
|
9
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
10
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
11
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
12
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
13
|
+
blob: () => Promise<Blob>;
|
|
14
|
+
/**
|
|
15
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
16
|
+
* Some versions of the Fetch API may not support this method.
|
|
17
|
+
*/
|
|
18
|
+
bytes?(): Promise<Uint8Array>;
|
|
19
|
+
};
|
|
20
|
+
export declare function getBinaryResponse(response: ResponseWithBody): BinaryResponse;
|
|
21
|
+
//# sourceMappingURL=BinaryResponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type SecuritySchemeKey = string;
|
|
2
|
+
/**
|
|
3
|
+
* A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme.
|
|
4
|
+
* All schemes in the collection must be satisfied for authentication to be successful.
|
|
5
|
+
*/
|
|
6
|
+
export type SecuritySchemeCollection = Record<SecuritySchemeKey, AuthScope[]>;
|
|
7
|
+
export type AuthScope = string;
|
|
8
|
+
export type EndpointMetadata = {
|
|
9
|
+
/**
|
|
10
|
+
* An array of security scheme collections. Each collection represents an alternative way to authenticate.
|
|
11
|
+
*/
|
|
12
|
+
security?: SecuritySchemeCollection[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=EndpointMetadata.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
|
+
import type { Supplier } from "./Supplier.js";
|
|
3
|
+
type EndpointSupplierFn<T> = (arg: {
|
|
4
|
+
endpointMetadata: EndpointMetadata;
|
|
5
|
+
}) => T | Promise<T>;
|
|
6
|
+
export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
|
|
7
|
+
export declare const EndpointSupplier: {
|
|
8
|
+
get: <T>(supplier: EndpointSupplier<T>, arg: {
|
|
9
|
+
endpointMetadata: EndpointMetadata;
|
|
10
|
+
}) => Promise<T>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=EndpointSupplier.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { APIResponse } from "./APIResponse.js";
|
|
2
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
3
|
+
import { EndpointSupplier } from "./EndpointSupplier.js";
|
|
4
|
+
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
5
|
+
export declare namespace Fetcher {
|
|
6
|
+
interface Args {
|
|
7
|
+
url: string;
|
|
8
|
+
method: string;
|
|
9
|
+
contentType?: string;
|
|
10
|
+
headers?: Record<string, string | EndpointSupplier<string | null | undefined> | null | undefined>;
|
|
11
|
+
queryParameters?: Record<string, unknown>;
|
|
12
|
+
body?: unknown;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
withCredentials?: boolean;
|
|
16
|
+
abortSignal?: AbortSignal;
|
|
17
|
+
requestType?: "json" | "file" | "bytes";
|
|
18
|
+
responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
|
|
19
|
+
duplex?: "half";
|
|
20
|
+
endpointMetadata?: EndpointMetadata;
|
|
21
|
+
}
|
|
22
|
+
type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
|
|
23
|
+
interface FailedStatusCodeError {
|
|
24
|
+
reason: "status-code";
|
|
25
|
+
statusCode: number;
|
|
26
|
+
body: unknown;
|
|
27
|
+
}
|
|
28
|
+
interface NonJsonError {
|
|
29
|
+
reason: "non-json";
|
|
30
|
+
statusCode: number;
|
|
31
|
+
rawBody: string;
|
|
32
|
+
}
|
|
33
|
+
interface TimeoutError {
|
|
34
|
+
reason: "timeout";
|
|
35
|
+
}
|
|
36
|
+
interface UnknownError {
|
|
37
|
+
reason: "unknown";
|
|
38
|
+
errorMessage: string;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export declare function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse<R, Fetcher.Error>>;
|
|
42
|
+
export declare const fetcher: FetchFunction;
|
|
43
|
+
//# sourceMappingURL=Fetcher.d.ts.map
|