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.
Files changed (203) hide show
  1. package/BaseClient.ts +28 -0
  2. package/Client.ts +1849 -0
  3. package/README.md +339 -0
  4. package/api/client/index.ts +1 -0
  5. package/api/client/requests/CreateSandboxRequest.ts +37 -0
  6. package/api/client/requests/CreateSnapshotRequest.ts +11 -0
  7. package/api/client/requests/EvaluateRequest.ts +9 -0
  8. package/api/client/requests/GetEnvironmentStateRequest.ts +11 -0
  9. package/api/client/requests/GetTestCasesRequest.ts +15 -0
  10. package/api/client/requests/LogRequest.ts +19 -0
  11. package/api/client/requests/MakeEnvironmentRequest.ts +27 -0
  12. package/api/client/requests/PostEvaluationResultRequest.ts +14 -0
  13. package/api/client/requests/ResetEnvironmentRequest.ts +11 -0
  14. package/api/client/requests/SetupRootAccessRequest.ts +14 -0
  15. package/api/client/requests/SetupSandboxRequest.ts +29 -0
  16. package/api/client/requests/StartWorkerRequest.ts +28 -0
  17. package/api/client/requests/index.ts +12 -0
  18. package/api/errors/BadRequestError.ts +17 -0
  19. package/api/errors/index.ts +1 -0
  20. package/api/index.ts +3 -0
  21. package/api/types/ActiveSessionResponse.ts +6 -0
  22. package/api/types/BackupEnvironmentResponse.ts +7 -0
  23. package/api/types/CdpUrlResponse.ts +12 -0
  24. package/api/types/CloseEnvironmentResponse.ts +6 -0
  25. package/api/types/CreateSandboxResponse.ts +14 -0
  26. package/api/types/CreateSnapshotResponse.ts +10 -0
  27. package/api/types/DeleteSandboxResponse.ts +6 -0
  28. package/api/types/Environment.ts +7 -0
  29. package/api/types/EnvironmentStateResponse.ts +11 -0
  30. package/api/types/ErrorResponse.ts +6 -0
  31. package/api/types/EvaluateResponse.ts +21 -0
  32. package/api/types/EvaluationResult.ts +9 -0
  33. package/api/types/HeartbeatResponse.ts +6 -0
  34. package/api/types/JobStatusResponse.ts +7 -0
  35. package/api/types/LogResponse.ts +5 -0
  36. package/api/types/MakeEnvironmentResponse.ts +6 -0
  37. package/api/types/OperationEvent.ts +42 -0
  38. package/api/types/PlatoConfig.ts +8 -0
  39. package/api/types/PlatoTask.ts +21 -0
  40. package/api/types/PlatoTaskMetadata.ts +20 -0
  41. package/api/types/PostEvaluationResultResponse.ts +6 -0
  42. package/api/types/ProxyUrlResponse.ts +12 -0
  43. package/api/types/ResetEnvironmentResponse.ts +13 -0
  44. package/api/types/RunningSessionsCountResponse.ts +6 -0
  45. package/api/types/Sandbox.ts +10 -0
  46. package/api/types/ScoringType.ts +7 -0
  47. package/api/types/SetupRootAccessResponse.ts +7 -0
  48. package/api/types/SetupSandboxResponse.ts +6 -0
  49. package/api/types/SimConfigCompute.ts +9 -0
  50. package/api/types/SimConfigDataset.ts +10 -0
  51. package/api/types/SimConfigListener.ts +27 -0
  52. package/api/types/SimConfigMetadata.ts +14 -0
  53. package/api/types/SimConfigService.ts +8 -0
  54. package/api/types/Simulator.ts +10 -0
  55. package/api/types/SimulatorListItem.ts +7 -0
  56. package/api/types/SshInfo.ts +18 -0
  57. package/api/types/StartWorkerResponse.ts +7 -0
  58. package/api/types/TaskMetadata.ts +20 -0
  59. package/api/types/TestCase.ts +40 -0
  60. package/api/types/TestCasesResponse.ts +10 -0
  61. package/api/types/Variable.ts +6 -0
  62. package/api/types/WorkerReadyResponse.ts +9 -0
  63. package/api/types/index.ts +42 -0
  64. package/core/fetcher/APIResponse.ts +23 -0
  65. package/core/fetcher/BinaryResponse.ts +36 -0
  66. package/core/fetcher/EndpointMetadata.ts +13 -0
  67. package/core/fetcher/EndpointSupplier.ts +14 -0
  68. package/core/fetcher/Fetcher.ts +165 -0
  69. package/core/fetcher/Headers.ts +93 -0
  70. package/core/fetcher/HttpResponsePromise.ts +116 -0
  71. package/core/fetcher/RawResponse.ts +61 -0
  72. package/core/fetcher/ResponseWithBody.ts +7 -0
  73. package/core/fetcher/Supplier.ts +11 -0
  74. package/core/fetcher/createRequestUrl.ts +6 -0
  75. package/core/fetcher/getErrorResponseBody.ts +33 -0
  76. package/core/fetcher/getFetchFn.ts +3 -0
  77. package/core/fetcher/getHeader.ts +8 -0
  78. package/core/fetcher/getRequestBody.ts +16 -0
  79. package/core/fetcher/getResponseBody.ts +43 -0
  80. package/core/fetcher/index.ts +11 -0
  81. package/core/fetcher/makeRequest.ts +44 -0
  82. package/core/fetcher/requestWithRetries.ts +73 -0
  83. package/core/fetcher/signals.ts +38 -0
  84. package/core/headers.ts +33 -0
  85. package/core/index.ts +4 -0
  86. package/core/json.ts +27 -0
  87. package/core/runtime/index.ts +1 -0
  88. package/core/runtime/runtime.ts +133 -0
  89. package/core/stream/Stream.ts +155 -0
  90. package/core/stream/index.ts +1 -0
  91. package/core/url/encodePathParam.ts +18 -0
  92. package/core/url/index.ts +3 -0
  93. package/core/url/join.ts +80 -0
  94. package/core/url/qs.ts +74 -0
  95. package/dist/BaseClient.d.ts +25 -0
  96. package/dist/Client.d.ts +376 -0
  97. package/dist/api/client/index.d.ts +2 -0
  98. package/dist/api/client/requests/CreateSandboxRequest.d.ts +35 -0
  99. package/dist/api/client/requests/CreateSnapshotRequest.d.ts +10 -0
  100. package/dist/api/client/requests/EvaluateRequest.d.ts +8 -0
  101. package/dist/api/client/requests/GetEnvironmentStateRequest.d.ts +10 -0
  102. package/dist/api/client/requests/GetTestCasesRequest.d.ts +14 -0
  103. package/dist/api/client/requests/LogRequest.d.ts +18 -0
  104. package/dist/api/client/requests/MakeEnvironmentRequest.d.ts +26 -0
  105. package/dist/api/client/requests/PostEvaluationResultRequest.d.ts +13 -0
  106. package/dist/api/client/requests/ResetEnvironmentRequest.d.ts +10 -0
  107. package/dist/api/client/requests/SetupRootAccessRequest.d.ts +13 -0
  108. package/dist/api/client/requests/SetupSandboxRequest.d.ts +27 -0
  109. package/dist/api/client/requests/StartWorkerRequest.d.ts +26 -0
  110. package/dist/api/client/requests/index.d.ts +13 -0
  111. package/dist/api/errors/BadRequestError.d.ts +7 -0
  112. package/dist/api/errors/index.d.ts +2 -0
  113. package/dist/api/index.d.ts +4 -0
  114. package/dist/api/types/ActiveSessionResponse.d.ts +5 -0
  115. package/dist/api/types/BackupEnvironmentResponse.d.ts +6 -0
  116. package/dist/api/types/CdpUrlResponse.d.ts +10 -0
  117. package/dist/api/types/CloseEnvironmentResponse.d.ts +5 -0
  118. package/dist/api/types/CreateSandboxResponse.d.ts +13 -0
  119. package/dist/api/types/CreateSnapshotResponse.d.ts +9 -0
  120. package/dist/api/types/DeleteSandboxResponse.d.ts +5 -0
  121. package/dist/api/types/Environment.d.ts +6 -0
  122. package/dist/api/types/EnvironmentStateResponse.d.ts +9 -0
  123. package/dist/api/types/ErrorResponse.d.ts +5 -0
  124. package/dist/api/types/EvaluateResponse.d.ts +18 -0
  125. package/dist/api/types/EvaluationResult.d.ts +8 -0
  126. package/dist/api/types/HeartbeatResponse.d.ts +5 -0
  127. package/dist/api/types/JobStatusResponse.d.ts +6 -0
  128. package/dist/api/types/LogResponse.d.ts +4 -0
  129. package/dist/api/types/MakeEnvironmentResponse.d.ts +5 -0
  130. package/dist/api/types/OperationEvent.d.ts +40 -0
  131. package/dist/api/types/PlatoConfig.d.ts +6 -0
  132. package/dist/api/types/PlatoTask.d.ts +19 -0
  133. package/dist/api/types/PlatoTaskMetadata.d.ts +18 -0
  134. package/dist/api/types/PostEvaluationResultResponse.d.ts +5 -0
  135. package/dist/api/types/ProxyUrlResponse.d.ts +10 -0
  136. package/dist/api/types/ResetEnvironmentResponse.d.ts +11 -0
  137. package/dist/api/types/RunningSessionsCountResponse.d.ts +5 -0
  138. package/dist/api/types/Sandbox.d.ts +9 -0
  139. package/dist/api/types/ScoringType.d.ts +6 -0
  140. package/dist/api/types/SetupRootAccessResponse.d.ts +6 -0
  141. package/dist/api/types/SetupSandboxResponse.d.ts +5 -0
  142. package/dist/api/types/SimConfigCompute.d.ts +8 -0
  143. package/dist/api/types/SimConfigDataset.d.ts +8 -0
  144. package/dist/api/types/SimConfigListener.d.ts +25 -0
  145. package/dist/api/types/SimConfigMetadata.d.ts +12 -0
  146. package/dist/api/types/SimConfigService.d.ts +7 -0
  147. package/dist/api/types/Simulator.d.ts +9 -0
  148. package/dist/api/types/SimulatorListItem.d.ts +6 -0
  149. package/dist/api/types/SshInfo.d.ts +17 -0
  150. package/dist/api/types/StartWorkerResponse.d.ts +6 -0
  151. package/dist/api/types/TaskMetadata.d.ts +18 -0
  152. package/dist/api/types/TestCase.d.ts +34 -0
  153. package/dist/api/types/TestCasesResponse.d.ts +8 -0
  154. package/dist/api/types/Variable.d.ts +5 -0
  155. package/dist/api/types/WorkerReadyResponse.d.ts +8 -0
  156. package/dist/api/types/index.d.ts +43 -0
  157. package/dist/core/fetcher/APIResponse.d.ts +21 -0
  158. package/dist/core/fetcher/BinaryResponse.d.ts +21 -0
  159. package/dist/core/fetcher/EndpointMetadata.d.ts +14 -0
  160. package/dist/core/fetcher/EndpointSupplier.d.ts +13 -0
  161. package/dist/core/fetcher/Fetcher.d.ts +43 -0
  162. package/dist/core/fetcher/Headers.d.ts +3 -0
  163. package/dist/core/fetcher/HttpResponsePromise.d.ts +59 -0
  164. package/dist/core/fetcher/RawResponse.d.ts +30 -0
  165. package/dist/core/fetcher/ResponseWithBody.d.ts +5 -0
  166. package/dist/core/fetcher/Supplier.d.ts +5 -0
  167. package/dist/core/fetcher/createRequestUrl.d.ts +2 -0
  168. package/dist/core/fetcher/getErrorResponseBody.d.ts +2 -0
  169. package/dist/core/fetcher/getFetchFn.d.ts +2 -0
  170. package/dist/core/fetcher/getHeader.d.ts +2 -0
  171. package/dist/core/fetcher/getRequestBody.d.ts +8 -0
  172. package/dist/core/fetcher/getResponseBody.d.ts +2 -0
  173. package/dist/core/fetcher/index.d.ts +12 -0
  174. package/dist/core/fetcher/makeRequest.d.ts +2 -0
  175. package/dist/core/fetcher/requestWithRetries.d.ts +2 -0
  176. package/dist/core/fetcher/signals.d.ts +12 -0
  177. package/dist/core/headers.d.ts +3 -0
  178. package/dist/core/index.d.ts +5 -0
  179. package/dist/core/json.d.ts +16 -0
  180. package/dist/core/runtime/index.d.ts +2 -0
  181. package/dist/core/runtime/runtime.d.ts +10 -0
  182. package/dist/core/stream/Stream.d.ts +48 -0
  183. package/dist/core/stream/index.d.ts +2 -0
  184. package/dist/core/url/encodePathParam.d.ts +2 -0
  185. package/dist/core/url/index.d.ts +4 -0
  186. package/dist/core/url/join.d.ts +2 -0
  187. package/dist/core/url/qs.d.ts +7 -0
  188. package/dist/errors/ApiError.d.ts +13 -0
  189. package/dist/errors/ApiTimeoutError.d.ts +4 -0
  190. package/dist/errors/index.d.ts +3 -0
  191. package/dist/helpers/SandboxHelpers.d.ts +127 -0
  192. package/dist/helpers/SandboxMonitor.d.ts +89 -0
  193. package/dist/helpers/index.d.ts +9 -0
  194. package/dist/index.d.ts +6 -0
  195. package/errors/ApiError.ts +53 -0
  196. package/errors/ApiTimeoutError.ts +8 -0
  197. package/errors/index.ts +2 -0
  198. package/helpers/README.md +229 -0
  199. package/helpers/SandboxHelpers.ts +213 -0
  200. package/helpers/SandboxMonitor.ts +252 -0
  201. package/helpers/index.ts +10 -0
  202. package/index.ts +7 -0
  203. package/package.json +54 -0
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface Environment {
4
+ job_id: string;
5
+ alias?: string;
6
+ status?: string;
7
+ }
@@ -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,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface ErrorResponse {
4
+ error?: string;
5
+ message?: string;
6
+ }
@@ -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,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface HeartbeatResponse {
4
+ success?: boolean;
5
+ timestamp?: string;
6
+ }
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface JobStatusResponse {
4
+ status: string;
5
+ job_id?: string;
6
+ job_group_id?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface LogResponse {
4
+ success?: boolean;
5
+ }
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface MakeEnvironmentResponse {
4
+ job_id: string;
5
+ alias?: string;
6
+ }
@@ -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,8 @@
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 PlatoConfig {
6
+ service?: string;
7
+ datasets?: Record<string, Api.SimConfigDataset>;
8
+ }
@@ -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,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface PostEvaluationResultResponse {
4
+ success?: boolean;
5
+ message?: string;
6
+ }
@@ -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,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface RunningSessionsCountResponse {
4
+ organization_id?: string;
5
+ running_sessions_count?: number;
6
+ }
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface Sandbox {
4
+ job_id: string;
5
+ public_id: string;
6
+ job_group_id: string;
7
+ url?: string;
8
+ status?: string;
9
+ correlation_id?: string;
10
+ }
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export const ScoringType = {
4
+ Output: "output",
5
+ Mutations: "mutations",
6
+ } as const;
7
+ export type ScoringType = (typeof ScoringType)[keyof typeof ScoringType];
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface SetupRootAccessResponse {
4
+ success?: boolean;
5
+ /** Correlation ID for monitoring setup progress via SSE */
6
+ correlation_id?: string;
7
+ }
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface SetupSandboxResponse {
4
+ /** Correlation ID for monitoring setup progress via SSE */
5
+ correlation_id: string;
6
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface SimConfigCompute {
4
+ cpus: number;
5
+ memory: number;
6
+ disk: number;
7
+ app_port: number;
8
+ plato_messaging_port: number;
9
+ }
@@ -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,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface SimConfigService {
4
+ type: string;
5
+ file?: string;
6
+ required_healthy_containers?: string[];
7
+ healthy_wait_timeout?: number;
8
+ }
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface Simulator {
4
+ id?: number;
5
+ name: string;
6
+ description?: string;
7
+ enabled: boolean;
8
+ sim_type?: string;
9
+ config?: Record<string, unknown>;
10
+ }
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface SimulatorListItem {
4
+ name: string;
5
+ description?: string;
6
+ artifact_id?: string;
7
+ }
@@ -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,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface StartWorkerResponse {
4
+ status: string;
5
+ timestamp: string;
6
+ correlation_id: string;
7
+ }
@@ -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,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 TestCasesResponse {
6
+ testcases: Api.TestCase[];
7
+ total?: number;
8
+ page?: number;
9
+ page_size?: number;
10
+ }
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface Variable {
4
+ name: string;
5
+ value: string;
6
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface WorkerReadyResponse {
4
+ ready: boolean;
5
+ worker_ip?: string;
6
+ worker_port?: number;
7
+ health_status?: Record<string, unknown>;
8
+ error?: string;
9
+ }
@@ -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
+ };