@boatdev/sdk 1.9.2 → 1.9.3

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 (152) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/dist/apis/BoatApi.d.ts +192 -4
  3. package/dist/apis/BoatApi.js +452 -5
  4. package/dist/esm/apis/BoatApi.d.ts +192 -4
  5. package/dist/esm/apis/BoatApi.js +451 -4
  6. package/dist/esm/models/CommandAttachFrame.d.ts +121 -0
  7. package/dist/esm/models/CommandAttachFrame.js +83 -0
  8. package/dist/esm/models/CommandInfoResponse.d.ts +52 -0
  9. package/dist/esm/models/CommandInfoResponse.js +58 -0
  10. package/dist/esm/models/CommandListResponse.d.ts +58 -0
  11. package/dist/esm/models/CommandListResponse.js +62 -0
  12. package/dist/esm/models/CommandLogsResponse.d.ts +109 -0
  13. package/dist/esm/models/CommandLogsResponse.js +99 -0
  14. package/dist/esm/models/CommandRecord.d.ts +132 -0
  15. package/dist/esm/models/CommandRecord.js +105 -0
  16. package/dist/esm/models/CommandResponse.d.ts +6 -0
  17. package/dist/esm/models/CommandResponse.js +2 -0
  18. package/dist/esm/models/CommandStartedResponse.d.ts +6 -0
  19. package/dist/esm/models/CommandStartedResponse.js +2 -0
  20. package/dist/esm/models/CommandStatusResponse.d.ts +32 -2
  21. package/dist/esm/models/CommandStatusResponse.js +10 -0
  22. package/dist/esm/models/CommandStopResponse.d.ts +70 -0
  23. package/dist/esm/models/CommandStopResponse.js +70 -0
  24. package/dist/esm/models/CommandStreamFrame.d.ts +6 -0
  25. package/dist/esm/models/CommandStreamFrame.js +2 -0
  26. package/dist/esm/models/CreateSandboxRequest.d.ts +6 -0
  27. package/dist/esm/models/CreateSandboxRequest.js +2 -0
  28. package/dist/esm/models/DataRetentionPolicyResponse.d.ts +12 -0
  29. package/dist/esm/models/DataRetentionPolicyResponse.js +4 -0
  30. package/dist/esm/models/DataRetentionUpdateRequest.d.ts +7 -1
  31. package/dist/esm/models/DataRetentionUpdateRequest.js +2 -0
  32. package/dist/esm/models/ForkRequest.d.ts +6 -0
  33. package/dist/esm/models/ForkRequest.js +2 -0
  34. package/dist/esm/models/ProcessListResponse.d.ts +70 -0
  35. package/dist/esm/models/ProcessListResponse.js +70 -0
  36. package/dist/esm/models/Sandbox.d.ts +6 -0
  37. package/dist/esm/models/Sandbox.js +2 -0
  38. package/dist/esm/models/SandboxProcess.d.ts +74 -0
  39. package/dist/esm/models/SandboxProcess.js +59 -0
  40. package/dist/esm/models/TelemetryConfig.d.ts +57 -0
  41. package/dist/esm/models/TelemetryConfig.js +60 -0
  42. package/dist/esm/models/TelemetryConfigLastError.d.ts +44 -0
  43. package/dist/esm/models/TelemetryConfigLastError.js +51 -0
  44. package/dist/esm/models/TelemetryResponse.d.ts +45 -0
  45. package/dist/esm/models/TelemetryResponse.js +52 -0
  46. package/dist/esm/models/TelemetrySetRequest.d.ts +40 -0
  47. package/dist/esm/models/TelemetrySetRequest.js +45 -0
  48. package/dist/esm/models/TelemetrySetResponse.d.ts +52 -0
  49. package/dist/esm/models/TelemetrySetResponse.js +57 -0
  50. package/dist/esm/models/TelemetryTestResult.d.ts +44 -0
  51. package/dist/esm/models/TelemetryTestResult.js +51 -0
  52. package/dist/esm/models/index.d.ts +14 -0
  53. package/dist/esm/models/index.js +14 -0
  54. package/dist/models/CommandAttachFrame.d.ts +121 -0
  55. package/dist/models/CommandAttachFrame.js +91 -0
  56. package/dist/models/CommandInfoResponse.d.ts +52 -0
  57. package/dist/models/CommandInfoResponse.js +66 -0
  58. package/dist/models/CommandListResponse.d.ts +58 -0
  59. package/dist/models/CommandListResponse.js +70 -0
  60. package/dist/models/CommandLogsResponse.d.ts +109 -0
  61. package/dist/models/CommandLogsResponse.js +107 -0
  62. package/dist/models/CommandRecord.d.ts +132 -0
  63. package/dist/models/CommandRecord.js +113 -0
  64. package/dist/models/CommandResponse.d.ts +6 -0
  65. package/dist/models/CommandResponse.js +2 -0
  66. package/dist/models/CommandStartedResponse.d.ts +6 -0
  67. package/dist/models/CommandStartedResponse.js +2 -0
  68. package/dist/models/CommandStatusResponse.d.ts +32 -2
  69. package/dist/models/CommandStatusResponse.js +10 -0
  70. package/dist/models/CommandStopResponse.d.ts +70 -0
  71. package/dist/models/CommandStopResponse.js +78 -0
  72. package/dist/models/CommandStreamFrame.d.ts +6 -0
  73. package/dist/models/CommandStreamFrame.js +2 -0
  74. package/dist/models/CreateSandboxRequest.d.ts +6 -0
  75. package/dist/models/CreateSandboxRequest.js +2 -0
  76. package/dist/models/DataRetentionPolicyResponse.d.ts +12 -0
  77. package/dist/models/DataRetentionPolicyResponse.js +4 -0
  78. package/dist/models/DataRetentionUpdateRequest.d.ts +7 -1
  79. package/dist/models/DataRetentionUpdateRequest.js +2 -0
  80. package/dist/models/ForkRequest.d.ts +6 -0
  81. package/dist/models/ForkRequest.js +2 -0
  82. package/dist/models/ProcessListResponse.d.ts +70 -0
  83. package/dist/models/ProcessListResponse.js +78 -0
  84. package/dist/models/Sandbox.d.ts +6 -0
  85. package/dist/models/Sandbox.js +2 -0
  86. package/dist/models/SandboxProcess.d.ts +74 -0
  87. package/dist/models/SandboxProcess.js +66 -0
  88. package/dist/models/TelemetryConfig.d.ts +57 -0
  89. package/dist/models/TelemetryConfig.js +67 -0
  90. package/dist/models/TelemetryConfigLastError.d.ts +44 -0
  91. package/dist/models/TelemetryConfigLastError.js +58 -0
  92. package/dist/models/TelemetryResponse.d.ts +45 -0
  93. package/dist/models/TelemetryResponse.js +59 -0
  94. package/dist/models/TelemetrySetRequest.d.ts +40 -0
  95. package/dist/models/TelemetrySetRequest.js +52 -0
  96. package/dist/models/TelemetrySetResponse.d.ts +52 -0
  97. package/dist/models/TelemetrySetResponse.js +64 -0
  98. package/dist/models/TelemetryTestResult.d.ts +44 -0
  99. package/dist/models/TelemetryTestResult.js +58 -0
  100. package/dist/models/index.d.ts +14 -0
  101. package/dist/models/index.js +14 -0
  102. package/docs/BoatApi.md +715 -11
  103. package/docs/Command200Response.md +2 -0
  104. package/docs/CommandAttachFrame.md +53 -0
  105. package/docs/CommandInfoResponse.md +36 -0
  106. package/docs/CommandListResponse.md +38 -0
  107. package/docs/CommandLogsResponse.md +50 -0
  108. package/docs/CommandRecord.md +59 -0
  109. package/docs/CommandResponse.md +2 -0
  110. package/docs/CommandStartedResponse.md +2 -0
  111. package/docs/CommandStatusResponse.md +10 -0
  112. package/docs/CommandStopResponse.md +42 -0
  113. package/docs/CommandStreamFrame.md +2 -0
  114. package/docs/CreateSandboxRequest.md +2 -0
  115. package/docs/DataRetentionPolicyResponse.md +4 -0
  116. package/docs/DataRetentionUpdateRequest.md +3 -1
  117. package/docs/ForkRequest.md +2 -0
  118. package/docs/ProcessListResponse.md +42 -0
  119. package/docs/Sandbox.md +2 -0
  120. package/docs/SandboxProcess.md +46 -0
  121. package/docs/TelemetryConfig.md +40 -0
  122. package/docs/TelemetryConfigLastError.md +37 -0
  123. package/docs/TelemetryResponse.md +36 -0
  124. package/docs/TelemetrySetRequest.md +34 -0
  125. package/docs/TelemetrySetResponse.md +38 -0
  126. package/docs/TelemetryTestResult.md +36 -0
  127. package/package.json +1 -1
  128. package/src/apis/BoatApi.ts +671 -4
  129. package/src/models/CommandAttachFrame.ts +179 -0
  130. package/src/models/CommandInfoResponse.ts +102 -0
  131. package/src/models/CommandListResponse.ts +111 -0
  132. package/src/models/CommandLogsResponse.ts +175 -0
  133. package/src/models/CommandRecord.ts +204 -0
  134. package/src/models/CommandResponse.ts +8 -0
  135. package/src/models/CommandStartedResponse.ts +8 -0
  136. package/src/models/CommandStatusResponse.ts +42 -2
  137. package/src/models/CommandStopResponse.ts +129 -0
  138. package/src/models/CommandStreamFrame.ts +8 -0
  139. package/src/models/CreateSandboxRequest.ts +8 -0
  140. package/src/models/DataRetentionPolicyResponse.ts +16 -0
  141. package/src/models/DataRetentionUpdateRequest.ts +9 -1
  142. package/src/models/ForkRequest.ts +8 -0
  143. package/src/models/ProcessListResponse.ts +129 -0
  144. package/src/models/Sandbox.ts +8 -0
  145. package/src/models/SandboxProcess.ts +123 -0
  146. package/src/models/TelemetryConfig.ts +110 -0
  147. package/src/models/TelemetryConfigLastError.ts +84 -0
  148. package/src/models/TelemetryResponse.ts +92 -0
  149. package/src/models/TelemetrySetRequest.ts +74 -0
  150. package/src/models/TelemetrySetResponse.ts +108 -0
  151. package/src/models/TelemetryTestResult.ts +84 -0
  152. package/src/models/index.ts +14 -0
@@ -20,8 +20,13 @@ import { ApiKeySecretResponseFromJSON, } from '../models/ApiKeySecretResponse';
20
20
  import { ApiKeyUsageResponseFromJSON, } from '../models/ApiKeyUsageResponse';
21
21
  import { ApiKeysResponseFromJSON, } from '../models/ApiKeysResponse';
22
22
  import { Command200ResponseFromJSON, } from '../models/Command200Response';
23
+ import { CommandAttachFrameFromJSON, } from '../models/CommandAttachFrame';
24
+ import { CommandInfoResponseFromJSON, } from '../models/CommandInfoResponse';
25
+ import { CommandListResponseFromJSON, } from '../models/CommandListResponse';
26
+ import { CommandLogsResponseFromJSON, } from '../models/CommandLogsResponse';
23
27
  import { CommandRequestToJSON, } from '../models/CommandRequest';
24
28
  import { CommandStatusResponseFromJSON, } from '../models/CommandStatusResponse';
29
+ import { CommandStopResponseFromJSON, } from '../models/CommandStopResponse';
25
30
  import { ConversationsResponseFromJSON, } from '../models/ConversationsResponse';
26
31
  import { CreateSandboxEnvironmentRequestToJSON, } from '../models/CreateSandboxEnvironmentRequest';
27
32
  import { CreateSandboxRequestToJSON, } from '../models/CreateSandboxRequest';
@@ -52,6 +57,7 @@ import { NamedSnapshotShareCreatedResponseFromJSON, } from '../models/NamedSnaps
52
57
  import { NamedSnapshotShareListResponseFromJSON, } from '../models/NamedSnapshotShareListResponse';
53
58
  import { NamedSnapshotShareRevokedResponseFromJSON, } from '../models/NamedSnapshotShareRevokedResponse';
54
59
  import { OrgListResponseFromJSON, } from '../models/OrgListResponse';
60
+ import { ProcessListResponseFromJSON, } from '../models/ProcessListResponse';
55
61
  import { PromptRequestToJSON, } from '../models/PromptRequest';
56
62
  import { PromptResponseFromJSON, } from '../models/PromptResponse';
57
63
  import { PromptRunResponseFromJSON, } from '../models/PromptRunResponse';
@@ -81,6 +87,9 @@ import { SteerRequestToJSON, } from '../models/SteerRequest';
81
87
  import { SteerResponseFromJSON, } from '../models/SteerResponse';
82
88
  import { StopOperationResponseFromJSON, } from '../models/StopOperationResponse';
83
89
  import { StopRequestToJSON, } from '../models/StopRequest';
90
+ import { TelemetryResponseFromJSON, } from '../models/TelemetryResponse';
91
+ import { TelemetrySetRequestToJSON, } from '../models/TelemetrySetRequest';
92
+ import { TelemetrySetResponseFromJSON, } from '../models/TelemetrySetResponse';
84
93
  import { UpdateSandboxEnvironmentRequestToJSON, } from '../models/UpdateSandboxEnvironmentRequest';
85
94
  import { UpdateSandboxRequestToJSON, } from '../models/UpdateSandboxRequest';
86
95
  import { UpgradeSandboxEnvironmentRequestToJSON, } from '../models/UpgradeSandboxEnvironmentRequest';
@@ -271,6 +280,58 @@ export class BoatApi extends runtime.BaseAPI {
271
280
  const response = await this.artifactRaw(requestParameters, initOverrides);
272
281
  return await response.value();
273
282
  }
283
+ /**
284
+ * Creates request options for attachCommand without sending the request
285
+ */
286
+ async attachCommandRequestOpts(requestParameters) {
287
+ if (requestParameters['sandboxId'] == null) {
288
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling attachCommand().');
289
+ }
290
+ if (requestParameters['processId'] == null) {
291
+ throw new runtime.RequiredError('processId', 'Required parameter "processId" was null or undefined when calling attachCommand().');
292
+ }
293
+ const queryParameters = {};
294
+ if (requestParameters['stdoutOffset'] != null) {
295
+ queryParameters['stdoutOffset'] = requestParameters['stdoutOffset'];
296
+ }
297
+ if (requestParameters['stderrOffset'] != null) {
298
+ queryParameters['stderrOffset'] = requestParameters['stderrOffset'];
299
+ }
300
+ const headerParameters = {};
301
+ if (this.configuration && this.configuration.accessToken) {
302
+ const token = this.configuration.accessToken;
303
+ const tokenString = await token("BoatBearerAuth", []);
304
+ if (tokenString) {
305
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
306
+ }
307
+ }
308
+ let urlPath = `/sandboxes/{sandboxId}/commands/{processId}/stream`;
309
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
310
+ urlPath = urlPath.replace('{processId}', encodeURIComponent(String(requestParameters['processId'])));
311
+ return {
312
+ path: urlPath,
313
+ method: 'GET',
314
+ headers: headerParameters,
315
+ query: queryParameters,
316
+ };
317
+ }
318
+ /**
319
+ * The output of a detached command as it is written, one JSON object per line, until the command ends. After 10 minutes the stream ends with a `reconnect` line: open it again with its offsets to continue with no gap. One open stream replaces polling. Needs the `exec` key scope.
320
+ * Attach to a detached command
321
+ */
322
+ async attachCommandRaw(requestParameters, initOverrides) {
323
+ const requestOptions = await this.attachCommandRequestOpts(requestParameters);
324
+ const response = await this.request(requestOptions, initOverrides);
325
+ return new runtime.JSONApiResponse(response, (jsonValue) => CommandAttachFrameFromJSON(jsonValue));
326
+ }
327
+ /**
328
+ * The output of a detached command as it is written, one JSON object per line, until the command ends. After 10 minutes the stream ends with a `reconnect` line: open it again with its offsets to continue with no gap. One open stream replaces polling. Needs the `exec` key scope.
329
+ * Attach to a detached command
330
+ */
331
+ async attachCommand(requestParameters, initOverrides) {
332
+ const response = await this.attachCommandRaw(requestParameters, initOverrides);
333
+ return await response.value();
334
+ }
274
335
  /**
275
336
  * Creates request options for command without sending the request
276
337
  */
@@ -303,7 +364,7 @@ export class BoatApi extends runtime.BaseAPI {
303
364
  };
304
365
  }
305
366
  /**
306
- * Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox.
367
+ * Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox. Every command and its output are kept 90 days in the command history (`/sandboxes/{sandboxId}/command-history`), readable while the sandbox is stopped.
307
368
  * Execute a command in a sandbox
308
369
  */
309
370
  async commandRaw(requestParameters, initOverrides) {
@@ -312,13 +373,125 @@ export class BoatApi extends runtime.BaseAPI {
312
373
  return new runtime.JSONApiResponse(response, (jsonValue) => Command200ResponseFromJSON(jsonValue));
313
374
  }
314
375
  /**
315
- * Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox.
376
+ * Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox. Every command and its output are kept 90 days in the command history (`/sandboxes/{sandboxId}/command-history`), readable while the sandbox is stopped.
316
377
  * Execute a command in a sandbox
317
378
  */
318
379
  async command(requestParameters, initOverrides) {
319
380
  const response = await this.commandRaw(requestParameters, initOverrides);
320
381
  return await response.value();
321
382
  }
383
+ /**
384
+ * Creates request options for commandHistory without sending the request
385
+ */
386
+ async commandHistoryRequestOpts(requestParameters) {
387
+ if (requestParameters['sandboxId'] == null) {
388
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling commandHistory().');
389
+ }
390
+ const queryParameters = {};
391
+ if (requestParameters['mode'] != null) {
392
+ queryParameters['mode'] = requestParameters['mode'];
393
+ }
394
+ if (requestParameters['q'] != null) {
395
+ queryParameters['q'] = requestParameters['q'];
396
+ }
397
+ if (requestParameters['limit'] != null) {
398
+ queryParameters['limit'] = requestParameters['limit'];
399
+ }
400
+ if (requestParameters['cursor'] != null) {
401
+ queryParameters['cursor'] = requestParameters['cursor'];
402
+ }
403
+ const headerParameters = {};
404
+ if (this.configuration && this.configuration.accessToken) {
405
+ const token = this.configuration.accessToken;
406
+ const tokenString = await token("BoatBearerAuth", []);
407
+ if (tokenString) {
408
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
409
+ }
410
+ }
411
+ let urlPath = `/sandboxes/{sandboxId}/command-history`;
412
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
413
+ return {
414
+ path: urlPath,
415
+ method: 'GET',
416
+ headers: headerParameters,
417
+ query: queryParameters,
418
+ };
419
+ }
420
+ /**
421
+ * Every command run through `POST /sandboxes/{sandboxId}/commands` in the last 90 days, and every other process that wrote to its stdout/stderr in the last 72 hours (mode `process`), newest first. Works while the sandbox is stopped.
422
+ * List the command and process history
423
+ */
424
+ async commandHistoryRaw(requestParameters, initOverrides) {
425
+ const requestOptions = await this.commandHistoryRequestOpts(requestParameters);
426
+ const response = await this.request(requestOptions, initOverrides);
427
+ return new runtime.JSONApiResponse(response, (jsonValue) => CommandListResponseFromJSON(jsonValue));
428
+ }
429
+ /**
430
+ * Every command run through `POST /sandboxes/{sandboxId}/commands` in the last 90 days, and every other process that wrote to its stdout/stderr in the last 72 hours (mode `process`), newest first. Works while the sandbox is stopped.
431
+ * List the command and process history
432
+ */
433
+ async commandHistory(requestParameters, initOverrides) {
434
+ const response = await this.commandHistoryRaw(requestParameters, initOverrides);
435
+ return await response.value();
436
+ }
437
+ /**
438
+ * Creates request options for commandLogs without sending the request
439
+ */
440
+ async commandLogsRequestOpts(requestParameters) {
441
+ if (requestParameters['sandboxId'] == null) {
442
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling commandLogs().');
443
+ }
444
+ if (requestParameters['commandId'] == null) {
445
+ throw new runtime.RequiredError('commandId', 'Required parameter "commandId" was null or undefined when calling commandLogs().');
446
+ }
447
+ const queryParameters = {};
448
+ if (requestParameters['stream'] != null) {
449
+ queryParameters['stream'] = requestParameters['stream'];
450
+ }
451
+ if (requestParameters['offset'] != null) {
452
+ queryParameters['offset'] = requestParameters['offset'];
453
+ }
454
+ if (requestParameters['limit'] != null) {
455
+ queryParameters['limit'] = requestParameters['limit'];
456
+ }
457
+ if (requestParameters['encoding'] != null) {
458
+ queryParameters['encoding'] = requestParameters['encoding'];
459
+ }
460
+ const headerParameters = {};
461
+ if (this.configuration && this.configuration.accessToken) {
462
+ const token = this.configuration.accessToken;
463
+ const tokenString = await token("BoatBearerAuth", []);
464
+ if (tokenString) {
465
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
466
+ }
467
+ }
468
+ let urlPath = `/sandboxes/{sandboxId}/command-history/{commandId}/logs`;
469
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
470
+ urlPath = urlPath.replace('{commandId}', encodeURIComponent(String(requestParameters['commandId'])));
471
+ return {
472
+ path: urlPath,
473
+ method: 'GET',
474
+ headers: headerParameters,
475
+ query: queryParameters,
476
+ };
477
+ }
478
+ /**
479
+ * Reads stdout or stderr from a byte offset, at most 1 MiB per call. Read on with `nextOffset` until `done`. A running detached command gains output every 30 s; a streamed one every 2 s. Works while the sandbox is stopped.
480
+ * Read a command\'s stored output
481
+ */
482
+ async commandLogsRaw(requestParameters, initOverrides) {
483
+ const requestOptions = await this.commandLogsRequestOpts(requestParameters);
484
+ const response = await this.request(requestOptions, initOverrides);
485
+ return new runtime.JSONApiResponse(response, (jsonValue) => CommandLogsResponseFromJSON(jsonValue));
486
+ }
487
+ /**
488
+ * Reads stdout or stderr from a byte offset, at most 1 MiB per call. Read on with `nextOffset` until `done`. A running detached command gains output every 30 s; a streamed one every 2 s. Works while the sandbox is stopped.
489
+ * Read a command\'s stored output
490
+ */
491
+ async commandLogs(requestParameters, initOverrides) {
492
+ const response = await this.commandLogsRaw(requestParameters, initOverrides);
493
+ return await response.value();
494
+ }
322
495
  /**
323
496
  * Creates request options for commandStatus without sending the request
324
497
  */
@@ -333,6 +506,12 @@ export class BoatApi extends runtime.BaseAPI {
333
506
  if (requestParameters['tailBytes'] != null) {
334
507
  queryParameters['tailBytes'] = requestParameters['tailBytes'];
335
508
  }
509
+ if (requestParameters['stdoutOffset'] != null) {
510
+ queryParameters['stdoutOffset'] = requestParameters['stdoutOffset'];
511
+ }
512
+ if (requestParameters['stderrOffset'] != null) {
513
+ queryParameters['stderrOffset'] = requestParameters['stderrOffset'];
514
+ }
336
515
  const headerParameters = {};
337
516
  if (this.configuration && this.configuration.accessToken) {
338
517
  const token = this.configuration.accessToken;
@@ -352,6 +531,7 @@ export class BoatApi extends runtime.BaseAPI {
352
531
  };
353
532
  }
354
533
  /**
534
+ * Without offsets, the answer holds the end of each log. With `stdoutOffset` or `stderrOffset`, it holds only the output written since those byte offsets, so each poll returns only new output. A sandbox agent too old for offsets answers 409 `agent_outdated`.
355
535
  * Get detached command status and logs
356
536
  */
357
537
  async commandStatusRaw(requestParameters, initOverrides) {
@@ -360,6 +540,7 @@ export class BoatApi extends runtime.BaseAPI {
360
540
  return new runtime.JSONApiResponse(response, (jsonValue) => CommandStatusResponseFromJSON(jsonValue));
361
541
  }
362
542
  /**
543
+ * Without offsets, the answer holds the end of each log. With `stdoutOffset` or `stderrOffset`, it holds only the output written since those byte offsets, so each poll returns only new output. A sandbox agent too old for offsets answers 409 `agent_outdated`.
363
544
  * Get detached command status and logs
364
545
  */
365
546
  async commandStatus(requestParameters, initOverrides) {
@@ -1000,6 +1181,44 @@ export class BoatApi extends runtime.BaseAPI {
1000
1181
  const response = await this.deleteSnapshotRaw(requestParameters, initOverrides);
1001
1182
  return await response.value();
1002
1183
  }
1184
+ /**
1185
+ * Creates request options for deleteTelemetry without sending the request
1186
+ */
1187
+ async deleteTelemetryRequestOpts() {
1188
+ const queryParameters = {};
1189
+ const headerParameters = {};
1190
+ if (this.configuration && this.configuration.accessToken) {
1191
+ const token = this.configuration.accessToken;
1192
+ const tokenString = await token("BoatBearerAuth", []);
1193
+ if (tokenString) {
1194
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1195
+ }
1196
+ }
1197
+ let urlPath = `/telemetry`;
1198
+ return {
1199
+ path: urlPath,
1200
+ method: 'DELETE',
1201
+ headers: headerParameters,
1202
+ query: queryParameters,
1203
+ };
1204
+ }
1205
+ /**
1206
+ * Removes the export and its queued deliveries. Needs an API key with `account.admin`.
1207
+ * Remove OpenTelemetry export
1208
+ */
1209
+ async deleteTelemetryRaw(initOverrides) {
1210
+ const requestOptions = await this.deleteTelemetryRequestOpts();
1211
+ const response = await this.request(requestOptions, initOverrides);
1212
+ return new runtime.JSONApiResponse(response, (jsonValue) => TelemetryResponseFromJSON(jsonValue));
1213
+ }
1214
+ /**
1215
+ * Removes the export and its queued deliveries. Needs an API key with `account.admin`.
1216
+ * Remove OpenTelemetry export
1217
+ */
1218
+ async deleteTelemetry(initOverrides) {
1219
+ const response = await this.deleteTelemetryRaw(initOverrides);
1220
+ return await response.value();
1221
+ }
1003
1222
  /**
1004
1223
  * Creates request options for deleteWebhook without sending the request
1005
1224
  */
@@ -1278,6 +1497,50 @@ export class BoatApi extends runtime.BaseAPI {
1278
1497
  const response = await this.getRaw(requestParameters, initOverrides);
1279
1498
  return await response.value();
1280
1499
  }
1500
+ /**
1501
+ * Creates request options for getCommand without sending the request
1502
+ */
1503
+ async getCommandRequestOpts(requestParameters) {
1504
+ if (requestParameters['sandboxId'] == null) {
1505
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling getCommand().');
1506
+ }
1507
+ if (requestParameters['commandId'] == null) {
1508
+ throw new runtime.RequiredError('commandId', 'Required parameter "commandId" was null or undefined when calling getCommand().');
1509
+ }
1510
+ const queryParameters = {};
1511
+ const headerParameters = {};
1512
+ if (this.configuration && this.configuration.accessToken) {
1513
+ const token = this.configuration.accessToken;
1514
+ const tokenString = await token("BoatBearerAuth", []);
1515
+ if (tokenString) {
1516
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1517
+ }
1518
+ }
1519
+ let urlPath = `/sandboxes/{sandboxId}/command-history/{commandId}`;
1520
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
1521
+ urlPath = urlPath.replace('{commandId}', encodeURIComponent(String(requestParameters['commandId'])));
1522
+ return {
1523
+ path: urlPath,
1524
+ method: 'GET',
1525
+ headers: headerParameters,
1526
+ query: queryParameters,
1527
+ };
1528
+ }
1529
+ /**
1530
+ * Get one command from the history
1531
+ */
1532
+ async getCommandRaw(requestParameters, initOverrides) {
1533
+ const requestOptions = await this.getCommandRequestOpts(requestParameters);
1534
+ const response = await this.request(requestOptions, initOverrides);
1535
+ return new runtime.JSONApiResponse(response, (jsonValue) => CommandInfoResponseFromJSON(jsonValue));
1536
+ }
1537
+ /**
1538
+ * Get one command from the history
1539
+ */
1540
+ async getCommand(requestParameters, initOverrides) {
1541
+ const response = await this.getCommandRaw(requestParameters, initOverrides);
1542
+ return await response.value();
1543
+ }
1281
1544
  /**
1282
1545
  * Creates request options for getDataRetention without sending the request
1283
1546
  */
@@ -1511,7 +1774,7 @@ export class BoatApi extends runtime.BaseAPI {
1511
1774
  };
1512
1775
  }
1513
1776
  /**
1514
- * Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`).
1777
+ * Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`). File responses accept a single `Range: bytes=` header and answer 206 with `Content-Range`, so large files can be downloaded in parts and resumed.
1515
1778
  * Download a file or folder from a snapshot
1516
1779
  */
1517
1780
  async getSnapshotFileRaw(requestParameters, initOverrides) {
@@ -1520,7 +1783,7 @@ export class BoatApi extends runtime.BaseAPI {
1520
1783
  return new runtime.BlobApiResponse(response);
1521
1784
  }
1522
1785
  /**
1523
- * Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`).
1786
+ * Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`). File responses accept a single `Range: bytes=` header and answer 206 with `Content-Range`, so large files can be downloaded in parts and resumed.
1524
1787
  * Download a file or folder from a snapshot
1525
1788
  */
1526
1789
  async getSnapshotFile(requestParameters, initOverrides) {
@@ -1615,6 +1878,44 @@ export class BoatApi extends runtime.BaseAPI {
1615
1878
  const response = await this.getStopRaw(requestParameters, initOverrides);
1616
1879
  return await response.value();
1617
1880
  }
1881
+ /**
1882
+ * Creates request options for getTelemetry without sending the request
1883
+ */
1884
+ async getTelemetryRequestOpts() {
1885
+ const queryParameters = {};
1886
+ const headerParameters = {};
1887
+ if (this.configuration && this.configuration.accessToken) {
1888
+ const token = this.configuration.accessToken;
1889
+ const tokenString = await token("BoatBearerAuth", []);
1890
+ if (tokenString) {
1891
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1892
+ }
1893
+ }
1894
+ let urlPath = `/telemetry`;
1895
+ return {
1896
+ path: urlPath,
1897
+ method: 'GET',
1898
+ headers: headerParameters,
1899
+ query: queryParameters,
1900
+ };
1901
+ }
1902
+ /**
1903
+ * Returns the account\'s OpenTelemetry export, or `telemetry` null when none is set. Header values are never included. Needs an API key with `account.admin`.
1904
+ * Get OpenTelemetry export
1905
+ */
1906
+ async getTelemetryRaw(initOverrides) {
1907
+ const requestOptions = await this.getTelemetryRequestOpts();
1908
+ const response = await this.request(requestOptions, initOverrides);
1909
+ return new runtime.JSONApiResponse(response, (jsonValue) => TelemetryResponseFromJSON(jsonValue));
1910
+ }
1911
+ /**
1912
+ * Returns the account\'s OpenTelemetry export, or `telemetry` null when none is set. Header values are never included. Needs an API key with `account.admin`.
1913
+ * Get OpenTelemetry export
1914
+ */
1915
+ async getTelemetry(initOverrides) {
1916
+ const response = await this.getTelemetryRaw(initOverrides);
1917
+ return await response.value();
1918
+ }
1618
1919
  /**
1619
1920
  * Creates request options for getWebhook without sending the request
1620
1921
  */
@@ -2089,6 +2390,48 @@ export class BoatApi extends runtime.BaseAPI {
2089
2390
  const response = await this.meRaw(initOverrides);
2090
2391
  return await response.value();
2091
2392
  }
2393
+ /**
2394
+ * Creates request options for processes without sending the request
2395
+ */
2396
+ async processesRequestOpts(requestParameters) {
2397
+ if (requestParameters['sandboxId'] == null) {
2398
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling processes().');
2399
+ }
2400
+ const queryParameters = {};
2401
+ const headerParameters = {};
2402
+ if (this.configuration && this.configuration.accessToken) {
2403
+ const token = this.configuration.accessToken;
2404
+ const tokenString = await token("BoatBearerAuth", []);
2405
+ if (tokenString) {
2406
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
2407
+ }
2408
+ }
2409
+ let urlPath = `/sandboxes/{sandboxId}/processes`;
2410
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
2411
+ return {
2412
+ path: urlPath,
2413
+ method: 'GET',
2414
+ headers: headerParameters,
2415
+ query: queryParameters,
2416
+ };
2417
+ }
2418
+ /**
2419
+ * A running sandbox: every user-space process, read now, busiest first. A stopped sandbox: the last sample kept (`live: false`).
2420
+ * List the processes in a sandbox
2421
+ */
2422
+ async processesRaw(requestParameters, initOverrides) {
2423
+ const requestOptions = await this.processesRequestOpts(requestParameters);
2424
+ const response = await this.request(requestOptions, initOverrides);
2425
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProcessListResponseFromJSON(jsonValue));
2426
+ }
2427
+ /**
2428
+ * A running sandbox: every user-space process, read now, busiest first. A stopped sandbox: the last sample kept (`live: false`).
2429
+ * List the processes in a sandbox
2430
+ */
2431
+ async processes(requestParameters, initOverrides) {
2432
+ const response = await this.processesRaw(requestParameters, initOverrides);
2433
+ return await response.value();
2434
+ }
2092
2435
  /**
2093
2436
  * Creates request options for prompt without sending the request
2094
2437
  */
@@ -2873,6 +3216,50 @@ export class BoatApi extends runtime.BaseAPI {
2873
3216
  const response = await this.setEnvironmentVarRaw(requestParameters, initOverrides);
2874
3217
  return await response.value();
2875
3218
  }
3219
+ /**
3220
+ * Creates request options for setTelemetry without sending the request
3221
+ */
3222
+ async setTelemetryRequestOpts(input) {
3223
+ const requestParameters = runtime.unflattenBody(input, 'telemetrySetRequest', [], []);
3224
+ if (requestParameters['telemetrySetRequest'] == null) {
3225
+ throw new runtime.RequiredError('telemetrySetRequest', 'Required parameter "telemetrySetRequest" was null or undefined when calling setTelemetry().');
3226
+ }
3227
+ const queryParameters = {};
3228
+ const headerParameters = {};
3229
+ headerParameters['Content-Type'] = 'application/json';
3230
+ if (this.configuration && this.configuration.accessToken) {
3231
+ const token = this.configuration.accessToken;
3232
+ const tokenString = await token("BoatBearerAuth", []);
3233
+ if (tokenString) {
3234
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3235
+ }
3236
+ }
3237
+ let urlPath = `/telemetry`;
3238
+ return {
3239
+ path: urlPath,
3240
+ method: 'PUT',
3241
+ headers: headerParameters,
3242
+ query: queryParameters,
3243
+ body: TelemetrySetRequestToJSON(requestParameters['telemetrySetRequest']),
3244
+ };
3245
+ }
3246
+ /**
3247
+ * Sets the account\'s one OTLP/HTTP destination, or replaces it. Boat then sends one metrics export at once and returns the collector\'s answer in `test`. Every 60 seconds Boat sends the sandbox and account gauges to `<endpoint>/v1/metrics`. Each sandbox lifecycle event goes to `<endpoint>/v1/logs`. The endpoint must use HTTPS on port 443 or 4318 and resolve only to public addresses. Needs an API key with `account.admin`.
3248
+ * Set OpenTelemetry export
3249
+ */
3250
+ async setTelemetryRaw(requestParameters, initOverrides) {
3251
+ const requestOptions = await this.setTelemetryRequestOpts(requestParameters);
3252
+ const response = await this.request(requestOptions, initOverrides);
3253
+ return new runtime.JSONApiResponse(response, (jsonValue) => TelemetrySetResponseFromJSON(jsonValue));
3254
+ }
3255
+ /**
3256
+ * Sets the account\'s one OTLP/HTTP destination, or replaces it. Boat then sends one metrics export at once and returns the collector\'s answer in `test`. Every 60 seconds Boat sends the sandbox and account gauges to `<endpoint>/v1/metrics`. Each sandbox lifecycle event goes to `<endpoint>/v1/logs`. The endpoint must use HTTPS on port 443 or 4318 and resolve only to public addresses. Needs an API key with `account.admin`.
3257
+ * Set OpenTelemetry export
3258
+ */
3259
+ async setTelemetry(requestParameters, initOverrides) {
3260
+ const response = await this.setTelemetryRaw(requestParameters, initOverrides);
3261
+ return await response.value();
3262
+ }
2876
3263
  /**
2877
3264
  * Creates request options for share without sending the request
2878
3265
  */
@@ -3059,6 +3446,52 @@ export class BoatApi extends runtime.BaseAPI {
3059
3446
  const response = await this.stopRaw(requestParameters, initOverrides);
3060
3447
  return await response.value();
3061
3448
  }
3449
+ /**
3450
+ * Creates request options for stopCommand without sending the request
3451
+ */
3452
+ async stopCommandRequestOpts(requestParameters) {
3453
+ if (requestParameters['sandboxId'] == null) {
3454
+ throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling stopCommand().');
3455
+ }
3456
+ if (requestParameters['processId'] == null) {
3457
+ throw new runtime.RequiredError('processId', 'Required parameter "processId" was null or undefined when calling stopCommand().');
3458
+ }
3459
+ const queryParameters = {};
3460
+ const headerParameters = {};
3461
+ if (this.configuration && this.configuration.accessToken) {
3462
+ const token = this.configuration.accessToken;
3463
+ const tokenString = await token("BoatBearerAuth", []);
3464
+ if (tokenString) {
3465
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3466
+ }
3467
+ }
3468
+ let urlPath = `/sandboxes/{sandboxId}/commands/{processId}`;
3469
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
3470
+ urlPath = urlPath.replace('{processId}', encodeURIComponent(String(requestParameters['processId'])));
3471
+ return {
3472
+ path: urlPath,
3473
+ method: 'DELETE',
3474
+ headers: headerParameters,
3475
+ query: queryParameters,
3476
+ };
3477
+ }
3478
+ /**
3479
+ * Sends SIGTERM to the command and every process it started, then SIGKILL to what is left after 5 s. Only a process started with `detached` can be stopped. The response carries the command\'s history record with its final state and output.
3480
+ * Stop a detached command
3481
+ */
3482
+ async stopCommandRaw(requestParameters, initOverrides) {
3483
+ const requestOptions = await this.stopCommandRequestOpts(requestParameters);
3484
+ const response = await this.request(requestOptions, initOverrides);
3485
+ return new runtime.JSONApiResponse(response, (jsonValue) => CommandStopResponseFromJSON(jsonValue));
3486
+ }
3487
+ /**
3488
+ * Sends SIGTERM to the command and every process it started, then SIGKILL to what is left after 5 s. Only a process started with `detached` can be stopped. The response carries the command\'s history record with its final state and output.
3489
+ * Stop a detached command
3490
+ */
3491
+ async stopCommand(requestParameters, initOverrides) {
3492
+ const response = await this.stopCommandRaw(requestParameters, initOverrides);
3493
+ return await response.value();
3494
+ }
3062
3495
  /**
3063
3496
  * Creates request options for update without sending the request
3064
3497
  */
@@ -3429,6 +3862,20 @@ export class BoatApi extends runtime.BaseAPI {
3429
3862
  return await response.value();
3430
3863
  }
3431
3864
  }
3865
+ /**
3866
+ * @export
3867
+ */
3868
+ export const CommandLogsStreamEnum = {
3869
+ Stdout: 'stdout',
3870
+ Stderr: 'stderr'
3871
+ };
3872
+ /**
3873
+ * @export
3874
+ */
3875
+ export const CommandLogsEncodingEnum = {
3876
+ Utf8: 'utf8',
3877
+ Base64: 'base64'
3878
+ };
3432
3879
  /**
3433
3880
  * @export
3434
3881
  */