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,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,9 @@
1
+ export interface CreateSnapshotResponse {
2
+ artifact_id: string;
3
+ status: string;
4
+ timestamp: string;
5
+ correlation_id: string;
6
+ s3_uri: string;
7
+ git_hash?: string;
8
+ }
9
+ //# sourceMappingURL=CreateSnapshotResponse.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface DeleteSandboxResponse {
2
+ success?: boolean;
3
+ message?: string;
4
+ }
5
+ //# sourceMappingURL=DeleteSandboxResponse.d.ts.map
@@ -0,0 +1,6 @@
1
+ export interface Environment {
2
+ job_id: string;
3
+ alias?: string;
4
+ status?: string;
5
+ }
6
+ //# sourceMappingURL=Environment.d.ts.map
@@ -0,0 +1,9 @@
1
+ export interface EnvironmentStateResponse {
2
+ data?: EnvironmentStateResponse.Data;
3
+ }
4
+ export declare namespace EnvironmentStateResponse {
5
+ interface Data {
6
+ state?: Record<string, unknown>;
7
+ }
8
+ }
9
+ //# sourceMappingURL=EnvironmentStateResponse.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface ErrorResponse {
2
+ error?: string;
3
+ message?: string;
4
+ }
5
+ //# sourceMappingURL=ErrorResponse.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,8 @@
1
+ export interface EvaluationResult {
2
+ success: boolean;
3
+ reason?: string;
4
+ diffs?: Record<string, unknown>[];
5
+ expected_mutations?: Record<string, unknown>[];
6
+ actual_mutations?: Record<string, unknown>[];
7
+ }
8
+ //# sourceMappingURL=EvaluationResult.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface HeartbeatResponse {
2
+ success?: boolean;
3
+ timestamp?: string;
4
+ }
5
+ //# sourceMappingURL=HeartbeatResponse.d.ts.map
@@ -0,0 +1,6 @@
1
+ export interface JobStatusResponse {
2
+ status: string;
3
+ job_id?: string;
4
+ job_group_id?: string;
5
+ }
6
+ //# sourceMappingURL=JobStatusResponse.d.ts.map
@@ -0,0 +1,4 @@
1
+ export interface LogResponse {
2
+ success?: boolean;
3
+ }
4
+ //# sourceMappingURL=LogResponse.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface MakeEnvironmentResponse {
2
+ job_id: string;
3
+ alias?: string;
4
+ }
5
+ //# sourceMappingURL=MakeEnvironmentResponse.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,6 @@
1
+ import type * as Api from "../index.js";
2
+ export interface PlatoConfig {
3
+ service?: string;
4
+ datasets?: Record<string, Api.SimConfigDataset>;
5
+ }
6
+ //# sourceMappingURL=PlatoConfig.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,5 @@
1
+ export interface PostEvaluationResultResponse {
2
+ success?: boolean;
3
+ message?: string;
4
+ }
5
+ //# sourceMappingURL=PostEvaluationResultResponse.d.ts.map
@@ -0,0 +1,10 @@
1
+ export interface ProxyUrlResponse {
2
+ data?: ProxyUrlResponse.Data;
3
+ error?: string;
4
+ }
5
+ export declare namespace ProxyUrlResponse {
6
+ interface Data {
7
+ proxy_url?: string;
8
+ }
9
+ }
10
+ //# sourceMappingURL=ProxyUrlResponse.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,5 @@
1
+ export interface RunningSessionsCountResponse {
2
+ organization_id?: string;
3
+ running_sessions_count?: number;
4
+ }
5
+ //# sourceMappingURL=RunningSessionsCountResponse.d.ts.map
@@ -0,0 +1,9 @@
1
+ export interface Sandbox {
2
+ job_id: string;
3
+ public_id: string;
4
+ job_group_id: string;
5
+ url?: string;
6
+ status?: string;
7
+ correlation_id?: string;
8
+ }
9
+ //# sourceMappingURL=Sandbox.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const ScoringType: {
2
+ readonly Output: "output";
3
+ readonly Mutations: "mutations";
4
+ };
5
+ export type ScoringType = (typeof ScoringType)[keyof typeof ScoringType];
6
+ //# sourceMappingURL=ScoringType.d.ts.map
@@ -0,0 +1,6 @@
1
+ export interface SetupRootAccessResponse {
2
+ success?: boolean;
3
+ /** Correlation ID for monitoring setup progress via SSE */
4
+ correlation_id?: string;
5
+ }
6
+ //# sourceMappingURL=SetupRootAccessResponse.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface SetupSandboxResponse {
2
+ /** Correlation ID for monitoring setup progress via SSE */
3
+ correlation_id: string;
4
+ }
5
+ //# sourceMappingURL=SetupSandboxResponse.d.ts.map
@@ -0,0 +1,8 @@
1
+ export interface SimConfigCompute {
2
+ cpus: number;
3
+ memory: number;
4
+ disk: number;
5
+ app_port: number;
6
+ plato_messaging_port: number;
7
+ }
8
+ //# sourceMappingURL=SimConfigCompute.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,7 @@
1
+ export interface SimConfigService {
2
+ type: string;
3
+ file?: string;
4
+ required_healthy_containers?: string[];
5
+ healthy_wait_timeout?: number;
6
+ }
7
+ //# sourceMappingURL=SimConfigService.d.ts.map
@@ -0,0 +1,9 @@
1
+ export interface Simulator {
2
+ id?: number;
3
+ name: string;
4
+ description?: string;
5
+ enabled: boolean;
6
+ sim_type?: string;
7
+ config?: Record<string, unknown>;
8
+ }
9
+ //# sourceMappingURL=Simulator.d.ts.map
@@ -0,0 +1,6 @@
1
+ export interface SimulatorListItem {
2
+ name: string;
3
+ description?: string;
4
+ artifact_id?: string;
5
+ }
6
+ //# sourceMappingURL=SimulatorListItem.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,6 @@
1
+ export interface StartWorkerResponse {
2
+ status: string;
3
+ timestamp: string;
4
+ correlation_id: string;
5
+ }
6
+ //# sourceMappingURL=StartWorkerResponse.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,8 @@
1
+ import type * as Api from "../index.js";
2
+ export interface TestCasesResponse {
3
+ testcases: Api.TestCase[];
4
+ total?: number;
5
+ page?: number;
6
+ page_size?: number;
7
+ }
8
+ //# sourceMappingURL=TestCasesResponse.d.ts.map
@@ -0,0 +1,5 @@
1
+ export interface Variable {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ //# sourceMappingURL=Variable.d.ts.map
@@ -0,0 +1,8 @@
1
+ export interface WorkerReadyResponse {
2
+ ready: boolean;
3
+ worker_ip?: string;
4
+ worker_port?: number;
5
+ health_status?: Record<string, unknown>;
6
+ error?: string;
7
+ }
8
+ //# sourceMappingURL=WorkerReadyResponse.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
@@ -0,0 +1,3 @@
1
+ declare let Headers: typeof globalThis.Headers;
2
+ export { Headers };
3
+ //# sourceMappingURL=Headers.d.ts.map