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,11 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface EnvironmentStateResponse {
|
|
4
|
+
data?: EnvironmentStateResponse.Data;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export namespace EnvironmentStateResponse {
|
|
8
|
+
export interface Data {
|
|
9
|
+
state?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface EvaluateResponse {
|
|
4
|
+
score?: EvaluateResponse.Score;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export namespace EvaluateResponse {
|
|
8
|
+
export interface Score {
|
|
9
|
+
result?: Score.Result;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace Score {
|
|
13
|
+
export interface Result {
|
|
14
|
+
correct?: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
diffs?: Record<string, unknown>[];
|
|
17
|
+
expected_mutations?: Record<string, unknown>[];
|
|
18
|
+
mutations?: Record<string, unknown>[];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface EvaluationResult {
|
|
4
|
+
success: boolean;
|
|
5
|
+
reason?: string;
|
|
6
|
+
diffs?: Record<string, unknown>[];
|
|
7
|
+
expected_mutations?: Record<string, unknown>[];
|
|
8
|
+
actual_mutations?: Record<string, unknown>[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Server-sent event for operation monitoring. The SSE data field contains base64-encoded JSON of this object.
|
|
5
|
+
*
|
|
6
|
+
* **Event Types:**
|
|
7
|
+
* - `connected`: Initial connection event, no action needed, continue listening
|
|
8
|
+
* - `progress`: Progress update with human-readable message
|
|
9
|
+
* - `run_result`: Sandbox setup/creation completed (check `success` field)
|
|
10
|
+
* - `ssh_result`: SSH setup operation completed (check `success` field)
|
|
11
|
+
* - `error`: Operation failed (check `error` or `message` field)
|
|
12
|
+
*
|
|
13
|
+
* **Terminal Events:**
|
|
14
|
+
* `run_result`, `ssh_result`, and `error` are terminal events that indicate the operation has finished.
|
|
15
|
+
* Close the stream after receiving one of these.
|
|
16
|
+
*
|
|
17
|
+
* **Success Detection:**
|
|
18
|
+
* An operation is successful if you receive `run_result` or `ssh_result` with `success: true`.
|
|
19
|
+
* An operation failed if you receive an `error` event or a result event with `success: false`.
|
|
20
|
+
*/
|
|
21
|
+
export interface OperationEvent {
|
|
22
|
+
/** Type of operation event */
|
|
23
|
+
type: OperationEvent.Type;
|
|
24
|
+
/** Whether the operation was successful (only present in result events) */
|
|
25
|
+
success?: boolean;
|
|
26
|
+
/** Error message if operation failed */
|
|
27
|
+
error?: string;
|
|
28
|
+
/** Human-readable progress or status message */
|
|
29
|
+
message?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace OperationEvent {
|
|
33
|
+
/** Type of operation event */
|
|
34
|
+
export const Type = {
|
|
35
|
+
Connected: "connected",
|
|
36
|
+
RunResult: "run_result",
|
|
37
|
+
SshResult: "ssh_result",
|
|
38
|
+
Error: "error",
|
|
39
|
+
Progress: "progress",
|
|
40
|
+
} as const;
|
|
41
|
+
export type Type = (typeof Type)[keyof typeof Type];
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import type * as Api from "../index.js";
|
|
4
|
+
|
|
5
|
+
export interface PlatoTask {
|
|
6
|
+
public_id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
env_id: string;
|
|
10
|
+
start_url: string;
|
|
11
|
+
dataset_name?: string;
|
|
12
|
+
average_time?: number;
|
|
13
|
+
average_steps?: number;
|
|
14
|
+
num_validator_human_scores?: number;
|
|
15
|
+
default_scoring_config?: Record<string, unknown>;
|
|
16
|
+
scoring_type?: Api.ScoringType[];
|
|
17
|
+
output_schema?: Record<string, unknown>;
|
|
18
|
+
is_sample?: boolean;
|
|
19
|
+
simulator_artifact_id?: string;
|
|
20
|
+
metadata?: Api.PlatoTaskMetadata;
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface PlatoTaskMetadata {
|
|
4
|
+
reasoning_level?: PlatoTaskMetadata.ReasoningLevel;
|
|
5
|
+
skills?: string[];
|
|
6
|
+
capabilities?: string[];
|
|
7
|
+
tags?: string[];
|
|
8
|
+
rejected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export namespace PlatoTaskMetadata {
|
|
12
|
+
export const ReasoningLevel = {
|
|
13
|
+
Level1: "level_1",
|
|
14
|
+
Level2: "level_2",
|
|
15
|
+
Level3: "level_3",
|
|
16
|
+
Level4: "level_4",
|
|
17
|
+
Level5: "level_5",
|
|
18
|
+
} as const;
|
|
19
|
+
export type ReasoningLevel = (typeof ReasoningLevel)[keyof typeof ReasoningLevel];
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface ProxyUrlResponse {
|
|
4
|
+
data?: ProxyUrlResponse.Data;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export namespace ProxyUrlResponse {
|
|
9
|
+
export interface Data {
|
|
10
|
+
proxy_url?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface ResetEnvironmentResponse {
|
|
4
|
+
success: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
data?: ResetEnvironmentResponse.Data;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export namespace ResetEnvironmentResponse {
|
|
10
|
+
export interface Data {
|
|
11
|
+
run_session_id?: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import type * as Api from "../index.js";
|
|
4
|
+
|
|
5
|
+
export interface SimConfigDataset {
|
|
6
|
+
compute: Api.SimConfigCompute;
|
|
7
|
+
metadata: Api.SimConfigMetadata;
|
|
8
|
+
services?: Record<string, Api.SimConfigService>;
|
|
9
|
+
listeners?: Record<string, Api.SimConfigListener>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface SimConfigListener {
|
|
4
|
+
type: SimConfigListener.Type;
|
|
5
|
+
db_type?: string;
|
|
6
|
+
db_host?: string;
|
|
7
|
+
db_port?: number;
|
|
8
|
+
db_user?: string;
|
|
9
|
+
db_password?: string;
|
|
10
|
+
db_database?: string;
|
|
11
|
+
target_dir?: string;
|
|
12
|
+
watch_enabled?: boolean;
|
|
13
|
+
watch_patterns?: string[];
|
|
14
|
+
ignore_patterns?: string[];
|
|
15
|
+
seed_data_path?: string;
|
|
16
|
+
seed_data_paths?: string[];
|
|
17
|
+
volumes?: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export namespace SimConfigListener {
|
|
21
|
+
export const Type = {
|
|
22
|
+
Db: "db",
|
|
23
|
+
File: "file",
|
|
24
|
+
Proxy: "proxy",
|
|
25
|
+
} as const;
|
|
26
|
+
export type Type = (typeof Type)[keyof typeof Type];
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import type * as Api from "../index.js";
|
|
4
|
+
|
|
5
|
+
export interface SimConfigMetadata {
|
|
6
|
+
favicon?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
source_code_url?: string;
|
|
10
|
+
start_url?: string;
|
|
11
|
+
license?: string;
|
|
12
|
+
variables?: Api.Variable[];
|
|
13
|
+
flows_path?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface SshInfo {
|
|
4
|
+
/** Complete SSH command to connect */
|
|
5
|
+
ssh_command: string;
|
|
6
|
+
/** SSH host identifier */
|
|
7
|
+
ssh_host: string;
|
|
8
|
+
/** Path to SSH config file */
|
|
9
|
+
ssh_config_path: string;
|
|
10
|
+
/** Sandbox public ID */
|
|
11
|
+
public_id: string;
|
|
12
|
+
/** Generated SSH public key */
|
|
13
|
+
public_key?: string;
|
|
14
|
+
/** Path to private key file */
|
|
15
|
+
private_key_path?: string;
|
|
16
|
+
/** Correlation ID for monitoring SSH setup */
|
|
17
|
+
correlation_id?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
export interface TaskMetadata {
|
|
4
|
+
reasoningLevel?: TaskMetadata.ReasoningLevel;
|
|
5
|
+
skills?: string[];
|
|
6
|
+
capabilities?: string[];
|
|
7
|
+
tags?: string[];
|
|
8
|
+
rejected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export namespace TaskMetadata {
|
|
12
|
+
export const ReasoningLevel = {
|
|
13
|
+
Level1: "level_1",
|
|
14
|
+
Level2: "level_2",
|
|
15
|
+
Level3: "level_3",
|
|
16
|
+
Level4: "level_4",
|
|
17
|
+
Level5: "level_5",
|
|
18
|
+
} as const;
|
|
19
|
+
export type ReasoningLevel = (typeof ReasoningLevel)[keyof typeof ReasoningLevel];
|
|
20
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import type * as Api from "../index.js";
|
|
4
|
+
|
|
5
|
+
export interface TestCase {
|
|
6
|
+
publicId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
prompt: string;
|
|
9
|
+
startUrl: string;
|
|
10
|
+
simulator: TestCase.Simulator;
|
|
11
|
+
averageTimeTaken?: number;
|
|
12
|
+
averageStepsTaken?: number;
|
|
13
|
+
defaultScoringConfig?: TestCase.DefaultScoringConfig;
|
|
14
|
+
scoringTypes?: TestCase.ScoringTypes.Item[];
|
|
15
|
+
outputSchema?: Record<string, unknown>;
|
|
16
|
+
isSample?: boolean;
|
|
17
|
+
simulatorArtifactId?: string;
|
|
18
|
+
metadataConfig?: Api.TaskMetadata;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export namespace TestCase {
|
|
22
|
+
export interface Simulator {
|
|
23
|
+
name?: string;
|
|
24
|
+
id?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DefaultScoringConfig {
|
|
28
|
+
num_sessions_used?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ScoringTypes = ScoringTypes.Item[];
|
|
32
|
+
|
|
33
|
+
export namespace ScoringTypes {
|
|
34
|
+
export const Item = {
|
|
35
|
+
Output: "output",
|
|
36
|
+
Mutations: "mutations",
|
|
37
|
+
} as const;
|
|
38
|
+
export type Item = (typeof Item)[keyof typeof Item];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RawResponse } from "./RawResponse.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The response of an API call.
|
|
5
|
+
* It is a successful response or a failed response.
|
|
6
|
+
*/
|
|
7
|
+
export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
|
|
8
|
+
|
|
9
|
+
export interface SuccessfulResponse<T> {
|
|
10
|
+
ok: true;
|
|
11
|
+
body: T;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `rawResponse` instead
|
|
14
|
+
*/
|
|
15
|
+
headers?: Record<string, any>;
|
|
16
|
+
rawResponse: RawResponse;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FailedResponse<T> {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: T;
|
|
22
|
+
rawResponse: RawResponse;
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ResponseWithBody } from "./ResponseWithBody.js";
|
|
2
|
+
|
|
3
|
+
export type BinaryResponse = {
|
|
4
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
|
|
5
|
+
bodyUsed: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a ReadableStream of the response body.
|
|
8
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)
|
|
9
|
+
*/
|
|
10
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
11
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
|
|
12
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
13
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
|
|
14
|
+
blob: () => Promise<Blob>;
|
|
15
|
+
/**
|
|
16
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
|
|
17
|
+
* Some versions of the Fetch API may not support this method.
|
|
18
|
+
*/
|
|
19
|
+
bytes?(): Promise<Uint8Array>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function getBinaryResponse(response: ResponseWithBody): BinaryResponse {
|
|
23
|
+
const binaryResponse: BinaryResponse = {
|
|
24
|
+
get bodyUsed() {
|
|
25
|
+
return response.bodyUsed;
|
|
26
|
+
},
|
|
27
|
+
stream: () => response.body,
|
|
28
|
+
arrayBuffer: response.arrayBuffer.bind(response),
|
|
29
|
+
blob: response.blob.bind(response),
|
|
30
|
+
};
|
|
31
|
+
if ("bytes" in response && typeof response.bytes === "function") {
|
|
32
|
+
binaryResponse.bytes = response.bytes.bind(response);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return binaryResponse;
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
|
+
import type { Supplier } from "./Supplier.js";
|
|
3
|
+
|
|
4
|
+
type EndpointSupplierFn<T> = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise<T>;
|
|
5
|
+
export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
|
|
6
|
+
export const EndpointSupplier = {
|
|
7
|
+
get: async <T>(supplier: EndpointSupplier<T>, arg: { endpointMetadata: EndpointMetadata }): Promise<T> => {
|
|
8
|
+
if (typeof supplier === "function") {
|
|
9
|
+
return (supplier as EndpointSupplierFn<T>)(arg);
|
|
10
|
+
} else {
|
|
11
|
+
return supplier;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
};
|