@boatdev/sdk 1.4.0 → 1.5.0

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 (43) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/dist/apis/BoatApi.d.ts +22 -0
  3. package/dist/apis/BoatApi.js +51 -0
  4. package/dist/esm/apis/BoatApi.d.ts +22 -0
  5. package/dist/esm/apis/BoatApi.js +51 -0
  6. package/dist/esm/models/PromptRequest.d.ts +6 -0
  7. package/dist/esm/models/PromptRequest.js +2 -0
  8. package/dist/esm/models/PromptResponse.d.ts +6 -0
  9. package/dist/esm/models/PromptResponse.js +2 -0
  10. package/dist/esm/models/PromptRun.d.ts +6 -0
  11. package/dist/esm/models/PromptRun.js +2 -0
  12. package/dist/esm/models/Sandbox.d.ts +39 -0
  13. package/dist/esm/models/Sandbox.js +18 -0
  14. package/dist/esm/models/Share200Response.d.ts +45 -0
  15. package/dist/esm/models/Share200Response.js +46 -0
  16. package/dist/esm/models/index.d.ts +1 -0
  17. package/dist/esm/models/index.js +1 -0
  18. package/dist/models/PromptRequest.d.ts +6 -0
  19. package/dist/models/PromptRequest.js +2 -0
  20. package/dist/models/PromptResponse.d.ts +6 -0
  21. package/dist/models/PromptResponse.js +2 -0
  22. package/dist/models/PromptRun.d.ts +6 -0
  23. package/dist/models/PromptRun.js +2 -0
  24. package/dist/models/Sandbox.d.ts +39 -0
  25. package/dist/models/Sandbox.js +19 -1
  26. package/dist/models/Share200Response.d.ts +45 -0
  27. package/dist/models/Share200Response.js +53 -0
  28. package/dist/models/index.d.ts +1 -0
  29. package/dist/models/index.js +1 -0
  30. package/docs/BoatApi.md +85 -1
  31. package/docs/PromptRequest.md +2 -0
  32. package/docs/PromptResponse.md +2 -0
  33. package/docs/PromptRun.md +2 -0
  34. package/docs/Sandbox.md +10 -0
  35. package/docs/Share200Response.md +36 -0
  36. package/package.json +1 -1
  37. package/src/apis/BoatApi.ts +76 -0
  38. package/src/models/PromptRequest.ts +8 -0
  39. package/src/models/PromptResponse.ts +8 -0
  40. package/src/models/PromptRun.ts +8 -0
  41. package/src/models/Sandbox.ts +50 -0
  42. package/src/models/Share200Response.ts +89 -0
  43. package/src/models/index.ts +1 -0
@@ -303,6 +303,11 @@ import {
303
303
  SetEnvironmentVarRequestFromJSON,
304
304
  SetEnvironmentVarRequestToJSON,
305
305
  } from '../models/SetEnvironmentVarRequest';
306
+ import {
307
+ type Share200Response,
308
+ Share200ResponseFromJSON,
309
+ Share200ResponseToJSON,
310
+ } from '../models/Share200Response';
306
311
  import {
307
312
  type SnapshotDownloadResponse,
308
313
  SnapshotDownloadResponseFromJSON,
@@ -616,6 +621,8 @@ export interface RotateWebhookSigningSecretRequest {
616
621
  }
617
622
 
618
623
  export interface SandboxesRequest {
624
+ org?: string;
625
+ xBoatOrg?: string;
619
626
  limit?: number;
620
627
  cursor?: string | null;
621
628
  sort?: SandboxesSortEnum;
@@ -645,6 +652,10 @@ export interface SetEnvironmentVarOperationRequest {
645
652
  setEnvironmentVarRequest: SetEnvironmentVarRequest;
646
653
  }
647
654
 
655
+ export interface ShareRequest {
656
+ sandboxId: string;
657
+ }
658
+
648
659
  export interface SshKeyOperationRequest {
649
660
  sandboxId: string;
650
661
  sshKeyRequest: SshKeyRequest;
@@ -3650,6 +3661,10 @@ export class BoatApi extends runtime.BaseAPI {
3650
3661
  async sandboxesRequestOpts(requestParameters: SandboxesRequest): Promise<runtime.RequestOpts> {
3651
3662
  const queryParameters: any = {};
3652
3663
 
3664
+ if (requestParameters['org'] != null) {
3665
+ queryParameters['org'] = requestParameters['org'];
3666
+ }
3667
+
3653
3668
  if (requestParameters['limit'] != null) {
3654
3669
  queryParameters['limit'] = requestParameters['limit'];
3655
3670
  }
@@ -3668,6 +3683,10 @@ export class BoatApi extends runtime.BaseAPI {
3668
3683
 
3669
3684
  const headerParameters: runtime.HTTPHeaders = {};
3670
3685
 
3686
+ if (requestParameters['xBoatOrg'] != null) {
3687
+ headerParameters['X-Boat-Org'] = String(requestParameters['xBoatOrg']);
3688
+ }
3689
+
3671
3690
  if (this.configuration && this.configuration.accessToken) {
3672
3691
  const token = this.configuration.accessToken;
3673
3692
  const tokenString = await token("BoatBearerAuth", []);
@@ -3688,6 +3707,7 @@ export class BoatApi extends runtime.BaseAPI {
3688
3707
  }
3689
3708
 
3690
3709
  /**
3710
+ * Your sandboxes. In an organization\'s scope (the active wallet, `org`, or `X-Boat-Org`) the list also holds every sandbox that organization pays for, whoever created it; `createdBy` and `access` say whose it is and what you may do with it.
3691
3711
  * List sandboxes
3692
3712
  */
3693
3713
  async sandboxesRaw(requestParameters: SandboxesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SandboxListResponse>> {
@@ -3698,6 +3718,7 @@ export class BoatApi extends runtime.BaseAPI {
3698
3718
  }
3699
3719
 
3700
3720
  /**
3721
+ * Your sandboxes. In an organization\'s scope (the active wallet, `org`, or `X-Boat-Org`) the list also holds every sandbox that organization pays for, whoever created it; `createdBy` and `access` say whose it is and what you may do with it.
3701
3722
  * List sandboxes
3702
3723
  */
3703
3724
  async sandboxes(requestParameters: SandboxesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SandboxListResponse> {
@@ -4066,6 +4087,61 @@ export class BoatApi extends runtime.BaseAPI {
4066
4087
  return await response.value();
4067
4088
  }
4068
4089
 
4090
+ /**
4091
+ * Creates request options for share without sending the request
4092
+ */
4093
+ async shareRequestOpts(requestParameters: ShareRequest): Promise<runtime.RequestOpts> {
4094
+ if (requestParameters['sandboxId'] == null) {
4095
+ throw new runtime.RequiredError(
4096
+ 'sandboxId',
4097
+ 'Required parameter "sandboxId" was null or undefined when calling share().'
4098
+ );
4099
+ }
4100
+
4101
+ const queryParameters: any = {};
4102
+
4103
+ const headerParameters: runtime.HTTPHeaders = {};
4104
+
4105
+ if (this.configuration && this.configuration.accessToken) {
4106
+ const token = this.configuration.accessToken;
4107
+ const tokenString = await token("BoatBearerAuth", []);
4108
+
4109
+ if (tokenString) {
4110
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
4111
+ }
4112
+ }
4113
+
4114
+ let urlPath = `/sandboxes/{sandboxId}/share`;
4115
+ urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
4116
+
4117
+ return {
4118
+ path: urlPath,
4119
+ method: 'POST',
4120
+ headers: headerParameters,
4121
+ query: queryParameters,
4122
+ };
4123
+ }
4124
+
4125
+ /**
4126
+ * Let every member of the organization that pays for this sandbox use it. Your personal logins (GitHub token, Claude and Codex logins, environment secrets, the sandbox\'s own CLI key) are never pushed to it again and are wiped off its disk at its next start, so a teammate never acts as you. Files you wrote stay. One-way: the sandbox stays like a `noEnv` sandbox from then on. A running sandbox stays `view` for the organization until you stop and resume it (`restartRequired`). Only the person who created the sandbox can share it, and only a sandbox billed to an organization. Sharing an already shared sandbox is a no-op.
4127
+ * Share sandbox with the organization
4128
+ */
4129
+ async shareRaw(requestParameters: ShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Share200Response>> {
4130
+ const requestOptions = await this.shareRequestOpts(requestParameters);
4131
+ const response = await this.request(requestOptions, initOverrides);
4132
+
4133
+ return new runtime.JSONApiResponse(response, (jsonValue) => Share200ResponseFromJSON(jsonValue));
4134
+ }
4135
+
4136
+ /**
4137
+ * Let every member of the organization that pays for this sandbox use it. Your personal logins (GitHub token, Claude and Codex logins, environment secrets, the sandbox\'s own CLI key) are never pushed to it again and are wiped off its disk at its next start, so a teammate never acts as you. Files you wrote stay. One-way: the sandbox stays like a `noEnv` sandbox from then on. A running sandbox stays `view` for the organization until you stop and resume it (`restartRequired`). Only the person who created the sandbox can share it, and only a sandbox billed to an organization. Sharing an already shared sandbox is a no-op.
4138
+ * Share sandbox with the organization
4139
+ */
4140
+ async share(requestParameters: ShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Share200Response> {
4141
+ const response = await this.shareRaw(requestParameters, initOverrides);
4142
+ return await response.value();
4143
+ }
4144
+
4069
4145
  /**
4070
4146
  * Creates request options for sshKey without sending the request
4071
4147
  */
@@ -44,6 +44,12 @@ export interface PromptRequest {
44
44
  * @memberof PromptRequest
45
45
  */
46
46
  reasoningEffort?: string | null;
47
+ /**
48
+ * Optional. `true` runs this prompt in fast mode. The model stays the same and gives output faster. The provider bills fast mode at its higher fast rate. Omit to use the choice saved on the Agents dashboard for that model. `false` forces standard speed. Only models with `fastMode` set to `true` in `GET /provider-models` accept `true`. Other models return 400 `fast_mode_not_supported`.
49
+ * @type {boolean}
50
+ * @memberof PromptRequest
51
+ */
52
+ fast?: boolean | null;
47
53
  /**
48
54
  * Start a NEW conversation on the sandbox (runs in parallel with any existing ones) instead of continuing the most-recently-active one. Mutually exclusive with `conversationId`.
49
55
  * @type {boolean}
@@ -104,6 +110,7 @@ export function PromptRequestFromJSONTyped(json: any, ignoreDiscriminator: boole
104
110
  'provider': json['provider'],
105
111
  'model': json['model'] == null ? undefined : json['model'],
106
112
  'reasoningEffort': json['reasoningEffort'] == null ? undefined : json['reasoningEffort'],
113
+ 'fast': json['fast'] == null ? undefined : json['fast'],
107
114
  '_new': json['new'] == null ? undefined : json['new'],
108
115
  'conversationId': json['conversationId'] == null ? undefined : json['conversationId'],
109
116
  'prompt': json['prompt'],
@@ -124,6 +131,7 @@ export function PromptRequestToJSONTyped(value?: PromptRequest | null, ignoreDis
124
131
  'provider': value['provider'],
125
132
  'model': value['model'],
126
133
  'reasoningEffort': value['reasoningEffort'],
134
+ 'fast': value['fast'],
127
135
  'new': value['_new'],
128
136
  'conversationId': value['conversationId'],
129
137
  'prompt': value['prompt'],
@@ -87,6 +87,12 @@ export interface PromptResponse {
87
87
  * @memberof PromptResponse
88
88
  */
89
89
  reasoningEffort?: string | null;
90
+ /**
91
+ * The prompt runs in fast mode.
92
+ * @type {boolean}
93
+ * @memberof PromptResponse
94
+ */
95
+ fast?: boolean;
90
96
  }
91
97
 
92
98
 
@@ -141,6 +147,7 @@ export function PromptResponseFromJSONTyped(json: any, ignoreDiscriminator: bool
141
147
  'provider': json['provider'],
142
148
  'model': json['model'] == null ? undefined : json['model'],
143
149
  'reasoningEffort': json['reasoningEffort'] == null ? undefined : json['reasoningEffort'],
150
+ 'fast': json['fast'] == null ? undefined : json['fast'],
144
151
  };
145
152
  }
146
153
 
@@ -165,6 +172,7 @@ export function PromptResponseToJSONTyped(value?: PromptResponse | null, ignoreD
165
172
  'provider': value['provider'],
166
173
  'model': value['model'],
167
174
  'reasoningEffort': value['reasoningEffort'],
175
+ 'fast': value['fast'],
168
176
  };
169
177
  }
170
178
 
@@ -67,6 +67,12 @@ export interface PromptRun {
67
67
  * @memberof PromptRun
68
68
  */
69
69
  reasoningEffort?: string | null;
70
+ /**
71
+ * The prompt runs in fast mode. `null` means no speed is set yet. The prompt waits without a speed choice, or it ended without running (`done` is true). The speed is set when the prompt starts, for the model that runs.
72
+ * @type {boolean}
73
+ * @memberof PromptRun
74
+ */
75
+ fast?: boolean | null;
70
76
  /**
71
77
  * The conversation this prompt ran in. A Sandbox runs many conversations in parallel; see [Integrated agents](/integrated-agents).
72
78
  * @type {string}
@@ -120,6 +126,7 @@ export function PromptRunFromJSONTyped(json: any, ignoreDiscriminator: boolean):
120
126
  'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
121
127
  'model': json['model'] == null ? undefined : json['model'],
122
128
  'reasoningEffort': json['reasoningEffort'] == null ? undefined : json['reasoningEffort'],
129
+ 'fast': json['fast'] == null ? undefined : json['fast'],
123
130
  'conversationId': json['conversationId'] == null ? undefined : json['conversationId'],
124
131
  };
125
132
  }
@@ -143,6 +150,7 @@ export function PromptRunToJSONTyped(value?: PromptRun | null, ignoreDiscriminat
143
150
  'createdAt': value['createdAt'] == null ? value['createdAt'] : value['createdAt'].toISOString(),
144
151
  'model': value['model'],
145
152
  'reasoningEffort': value['reasoningEffort'],
153
+ 'fast': value['fast'],
146
154
  'conversationId': value['conversationId'],
147
155
  };
148
156
  }
@@ -177,6 +177,36 @@ export interface Sandbox {
177
177
  * @memberof Sandbox
178
178
  */
179
179
  team?: SandboxTeam;
180
+ /**
181
+ * Display name (or email) of the person who created the sandbox. Organization members see every sandbox the organization pays for, so this says whose it is.
182
+ * @type {string}
183
+ * @memberof Sandbox
184
+ */
185
+ createdBy?: string | null;
186
+ /**
187
+ * Account id of the person who created the sandbox.
188
+ * @type {string}
189
+ * @memberof Sandbox
190
+ */
191
+ createdById?: string | null;
192
+ /**
193
+ * What you may do with this sandbox. `owner`: you created it. `use`: a teammate's organization sandbox that is `noEnv` (created with it, or shared and restarted), so you can open, run commands in, prompt, resume and stop it. `view`: a teammate's organization sandbox that still holds their personal logins, so you can see it and stop it until they share it (`POST /sandboxes/{sandboxId}/share`).
194
+ * @type {SandboxAccessEnum}
195
+ * @memberof Sandbox
196
+ */
197
+ access?: SandboxAccessEnum;
198
+ /**
199
+ * True while the sandbox still holds its creator's personal logins (GitHub token, model logins, secrets). Other members can only see such a sandbox.
200
+ * @type {boolean}
201
+ * @memberof Sandbox
202
+ */
203
+ holdsCreatorLogins?: boolean;
204
+ /**
205
+ * True once the sandbox is shared but not restarted yet. Its creator's logins are wiped at its next start, and the organization can use it from then on.
206
+ * @type {boolean}
207
+ * @memberof Sandbox
208
+ */
209
+ wipePendingUntilRestart?: boolean;
180
210
  /**
181
211
  * The sandbox's stable three-word subdomain slug (e.g. "frazil-pneuma-rallye"), or null before one is assigned.
182
212
  * @type {string}
@@ -268,6 +298,16 @@ export const SandboxMachineProviderEnum = {
268
298
  } as const;
269
299
  export type SandboxMachineProviderEnum = typeof SandboxMachineProviderEnum[keyof typeof SandboxMachineProviderEnum];
270
300
 
301
+ /**
302
+ * @export
303
+ */
304
+ export const SandboxAccessEnum = {
305
+ Owner: 'owner',
306
+ Use: 'use',
307
+ View: 'view'
308
+ } as const;
309
+ export type SandboxAccessEnum = typeof SandboxAccessEnum[keyof typeof SandboxAccessEnum];
310
+
271
311
  /**
272
312
  * @export
273
313
  */
@@ -339,6 +379,11 @@ export function SandboxFromJSONTyped(json: any, ignoreDiscriminator: boolean): S
339
379
  'snapshotCompletedAt': json['snapshotCompletedAt'] == null ? undefined : (new Date(json['snapshotCompletedAt'])),
340
380
  'snapshotVerifiedAt': json['snapshotVerifiedAt'] == null ? undefined : (new Date(json['snapshotVerifiedAt'])),
341
381
  'team': json['team'] == null ? undefined : SandboxTeamFromJSON(json['team']),
382
+ 'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
383
+ 'createdById': json['createdById'] == null ? undefined : json['createdById'],
384
+ 'access': json['access'] == null ? undefined : json['access'],
385
+ 'holdsCreatorLogins': json['holdsCreatorLogins'] == null ? undefined : json['holdsCreatorLogins'],
386
+ 'wipePendingUntilRestart': json['wipePendingUntilRestart'] == null ? undefined : json['wipePendingUntilRestart'],
342
387
  'subdomain': json['subdomain'] == null ? undefined : json['subdomain'],
343
388
  'lastSnapshotAttemptAt': json['lastSnapshotAttemptAt'] == null ? undefined : (new Date(json['lastSnapshotAttemptAt'])),
344
389
  'lastSnapshotStatus': json['lastSnapshotStatus'] == null ? undefined : json['lastSnapshotStatus'],
@@ -385,6 +430,11 @@ export function SandboxToJSONTyped(value?: Sandbox | null, ignoreDiscriminator:
385
430
  'snapshotCompletedAt': value['snapshotCompletedAt'] == null ? value['snapshotCompletedAt'] : value['snapshotCompletedAt'].toISOString(),
386
431
  'snapshotVerifiedAt': value['snapshotVerifiedAt'] == null ? value['snapshotVerifiedAt'] : value['snapshotVerifiedAt'].toISOString(),
387
432
  'team': SandboxTeamToJSON(value['team']),
433
+ 'createdBy': value['createdBy'],
434
+ 'createdById': value['createdById'],
435
+ 'access': value['access'],
436
+ 'holdsCreatorLogins': value['holdsCreatorLogins'],
437
+ 'wipePendingUntilRestart': value['wipePendingUntilRestart'],
388
438
  'subdomain': value['subdomain'],
389
439
  'lastSnapshotAttemptAt': value['lastSnapshotAttemptAt'] == null ? value['lastSnapshotAttemptAt'] : value['lastSnapshotAttemptAt'].toISOString(),
390
440
  'lastSnapshotStatus': value['lastSnapshotStatus'],
@@ -0,0 +1,89 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Boat Public API v1
5
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Sandbox } from './Sandbox';
17
+ import {
18
+ SandboxFromJSON,
19
+ SandboxFromJSONTyped,
20
+ SandboxToJSON,
21
+ SandboxToJSONTyped,
22
+ } from './Sandbox';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface Share200Response
28
+ */
29
+ export interface Share200Response {
30
+ /**
31
+ *
32
+ * @type {Sandbox}
33
+ * @memberof Share200Response
34
+ */
35
+ sandbox?: Sandbox;
36
+ /**
37
+ * True when the sandbox was running: what runs on it still holds your logins in memory, so it stays `view` for the organization until you stop and resume it.
38
+ * @type {boolean}
39
+ * @memberof Share200Response
40
+ */
41
+ restartRequired?: boolean;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof Share200Response
46
+ */
47
+ message?: string;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the Share200Response interface.
52
+ */
53
+ export function instanceOfShare200Response(value: object): value is Share200Response {
54
+ return true;
55
+ }
56
+
57
+ export function Share200ResponseFromJSON(json: any): Share200Response {
58
+ return Share200ResponseFromJSONTyped(json, false);
59
+ }
60
+
61
+ export function Share200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Share200Response {
62
+ if (json == null) {
63
+ return json;
64
+ }
65
+ return {
66
+
67
+ 'sandbox': json['sandbox'] == null ? undefined : SandboxFromJSON(json['sandbox']),
68
+ 'restartRequired': json['restartRequired'] == null ? undefined : json['restartRequired'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ };
71
+ }
72
+
73
+ export function Share200ResponseToJSON(json: any): Share200Response {
74
+ return Share200ResponseToJSONTyped(json, false);
75
+ }
76
+
77
+ export function Share200ResponseToJSONTyped(value?: Share200Response | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'sandbox': SandboxToJSON(value['sandbox']),
85
+ 'restartRequired': value['restartRequired'],
86
+ 'message': value['message'],
87
+ };
88
+ }
89
+
@@ -101,6 +101,7 @@ export * from './SecretsUpdateRequest';
101
101
  export * from './SelectedRepository';
102
102
  export * from './SetEnvironmentSecretFileRequest';
103
103
  export * from './SetEnvironmentVarRequest';
104
+ export * from './Share200Response';
104
105
  export * from './SnapshotChunk';
105
106
  export * from './SnapshotDownloadResponse';
106
107
  export * from './SnapshotDownloadResponseAllOfInventory';