@boatdev/sdk 1.7.0 → 1.9.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.
- package/.openapi-generator/FILES +12 -0
- package/dist/apis/BoatApi.d.ts +102 -4
- package/dist/apis/BoatApi.js +233 -4
- package/dist/esm/apis/BoatApi.d.ts +102 -4
- package/dist/esm/apis/BoatApi.js +233 -4
- package/dist/esm/http2-fetch.d.ts +1 -0
- package/dist/esm/http2-fetch.js +203 -0
- package/dist/esm/models/CreateSandboxRequest.d.ts +4 -3
- package/dist/esm/models/CreateSandboxRequest.js +2 -1
- package/dist/esm/models/ForkRequest.d.ts +2 -1
- package/dist/esm/models/ForkRequest.js +2 -1
- package/dist/esm/models/NamedSnapshotShare.d.ts +76 -0
- package/dist/esm/models/NamedSnapshotShare.js +74 -0
- package/dist/esm/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
- package/dist/esm/models/NamedSnapshotShareCreatedResponse.js +66 -0
- package/dist/esm/models/NamedSnapshotShareListResponse.d.ts +58 -0
- package/dist/esm/models/NamedSnapshotShareListResponse.js +62 -0
- package/dist/esm/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
- package/dist/esm/models/NamedSnapshotShareRevokedResponse.js +62 -0
- package/dist/esm/models/Recover200Response.d.ts +57 -0
- package/dist/esm/models/Recover200Response.js +53 -0
- package/dist/esm/models/ResumeRequest.d.ts +2 -1
- package/dist/esm/models/ResumeRequest.js +2 -1
- package/dist/esm/models/Sandbox.d.ts +2 -1
- package/dist/esm/models/Sandbox.js +2 -1
- package/dist/esm/models/SandboxUsageResponse.d.ts +2 -1
- package/dist/esm/models/SandboxUsageResponse.js +2 -1
- package/dist/esm/models/StopOperation.d.ts +1 -1
- package/dist/esm/models/StopOperationResponse.d.ts +58 -0
- package/dist/esm/models/StopOperationResponse.js +62 -0
- package/dist/esm/models/StopRequest.d.ts +1 -1
- package/dist/esm/models/UpdateSandboxRequest.d.ts +1 -1
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/esm/runtime.js +2 -1
- package/dist/http2-fetch.d.ts +1 -0
- package/dist/http2-fetch.js +239 -0
- package/dist/models/CreateSandboxRequest.d.ts +4 -3
- package/dist/models/CreateSandboxRequest.js +2 -1
- package/dist/models/ForkRequest.d.ts +2 -1
- package/dist/models/ForkRequest.js +2 -1
- package/dist/models/NamedSnapshotShare.d.ts +76 -0
- package/dist/models/NamedSnapshotShare.js +82 -0
- package/dist/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
- package/dist/models/NamedSnapshotShareCreatedResponse.js +74 -0
- package/dist/models/NamedSnapshotShareListResponse.d.ts +58 -0
- package/dist/models/NamedSnapshotShareListResponse.js +70 -0
- package/dist/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
- package/dist/models/NamedSnapshotShareRevokedResponse.js +70 -0
- package/dist/models/Recover200Response.d.ts +57 -0
- package/dist/models/Recover200Response.js +61 -0
- package/dist/models/ResumeRequest.d.ts +2 -1
- package/dist/models/ResumeRequest.js +2 -1
- package/dist/models/Sandbox.d.ts +2 -1
- package/dist/models/Sandbox.js +2 -1
- package/dist/models/SandboxUsageResponse.d.ts +2 -1
- package/dist/models/SandboxUsageResponse.js +2 -1
- package/dist/models/StopOperation.d.ts +1 -1
- package/dist/models/StopOperationResponse.d.ts +58 -0
- package/dist/models/StopOperationResponse.js +70 -0
- package/dist/models/StopRequest.d.ts +1 -1
- package/dist/models/UpdateSandboxRequest.d.ts +1 -1
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/dist/runtime.js +9 -8
- package/docs/BoatApi.md +385 -2
- package/docs/NamedSnapshotShare.md +45 -0
- package/docs/NamedSnapshotShareCreatedResponse.md +40 -0
- package/docs/NamedSnapshotShareListResponse.md +38 -0
- package/docs/NamedSnapshotShareRevokedResponse.md +38 -0
- package/docs/Recover200Response.md +38 -0
- package/docs/StopOperationResponse.md +38 -0
- package/package.json +1 -1
- package/src/apis/BoatApi.ts +348 -4
- package/src/http2-fetch.ts +179 -0
- package/src/models/CreateSandboxRequest.ts +5 -4
- package/src/models/ForkRequest.ts +3 -2
- package/src/models/NamedSnapshotShare.ts +131 -0
- package/src/models/NamedSnapshotShareCreatedResponse.ts +120 -0
- package/src/models/NamedSnapshotShareListResponse.ts +111 -0
- package/src/models/NamedSnapshotShareRevokedResponse.ts +111 -0
- package/src/models/Recover200Response.ts +99 -0
- package/src/models/ResumeRequest.ts +3 -2
- package/src/models/Sandbox.ts +3 -2
- package/src/models/SandboxUsageResponse.ts +3 -2
- package/src/models/StopOperation.ts +1 -1
- package/src/models/StopOperationResponse.ts +111 -0
- package/src/models/StopRequest.ts +1 -1
- package/src/models/UpdateSandboxRequest.ts +1 -1
- package/src/models/index.ts +6 -0
- package/src/runtime.ts +2 -1
package/dist/esm/apis/BoatApi.js
CHANGED
|
@@ -48,10 +48,14 @@ import { NamedSnapshotInfoResponseFromJSON, } from '../models/NamedSnapshotInfoR
|
|
|
48
48
|
import { NamedSnapshotListResponseFromJSON, } from '../models/NamedSnapshotListResponse';
|
|
49
49
|
import { NamedSnapshotSaveRequestToJSON, } from '../models/NamedSnapshotSaveRequest';
|
|
50
50
|
import { NamedSnapshotSavingResponseFromJSON, } from '../models/NamedSnapshotSavingResponse';
|
|
51
|
+
import { NamedSnapshotShareCreatedResponseFromJSON, } from '../models/NamedSnapshotShareCreatedResponse';
|
|
52
|
+
import { NamedSnapshotShareListResponseFromJSON, } from '../models/NamedSnapshotShareListResponse';
|
|
53
|
+
import { NamedSnapshotShareRevokedResponseFromJSON, } from '../models/NamedSnapshotShareRevokedResponse';
|
|
51
54
|
import { OrgListResponseFromJSON, } from '../models/OrgListResponse';
|
|
52
55
|
import { PromptRequestToJSON, } from '../models/PromptRequest';
|
|
53
56
|
import { PromptResponseFromJSON, } from '../models/PromptResponse';
|
|
54
57
|
import { PromptRunResponseFromJSON, } from '../models/PromptRunResponse';
|
|
58
|
+
import { Recover200ResponseFromJSON, } from '../models/Recover200Response';
|
|
55
59
|
import { RepoSelectionRequestToJSON, } from '../models/RepoSelectionRequest';
|
|
56
60
|
import { RepoSelectionResponseFromJSON, } from '../models/RepoSelectionResponse';
|
|
57
61
|
import { ReposResponseFromJSON, } from '../models/ReposResponse';
|
|
@@ -75,6 +79,7 @@ import { SshKeyRequestToJSON, } from '../models/SshKeyRequest';
|
|
|
75
79
|
import { SshKeyResponseFromJSON, } from '../models/SshKeyResponse';
|
|
76
80
|
import { SteerRequestToJSON, } from '../models/SteerRequest';
|
|
77
81
|
import { SteerResponseFromJSON, } from '../models/SteerResponse';
|
|
82
|
+
import { StopOperationResponseFromJSON, } from '../models/StopOperationResponse';
|
|
78
83
|
import { StopRequestToJSON, } from '../models/StopRequest';
|
|
79
84
|
import { UpdateSandboxEnvironmentRequestToJSON, } from '../models/UpdateSandboxEnvironmentRequest';
|
|
80
85
|
import { UpdateSandboxRequestToJSON, } from '../models/UpdateSandboxRequest';
|
|
@@ -250,6 +255,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
250
255
|
};
|
|
251
256
|
}
|
|
252
257
|
/**
|
|
258
|
+
* Downloads one file of up to 50 MiB, under /home/user or /tmp, as raw bytes.
|
|
253
259
|
* Download a sandbox artifact
|
|
254
260
|
*/
|
|
255
261
|
async artifactRaw(requestParameters, initOverrides) {
|
|
@@ -258,6 +264,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
258
264
|
return new runtime.BlobApiResponse(response);
|
|
259
265
|
}
|
|
260
266
|
/**
|
|
267
|
+
* Downloads one file of up to 50 MiB, under /home/user or /tmp, as raw bytes.
|
|
261
268
|
* Download a sandbox artifact
|
|
262
269
|
*/
|
|
263
270
|
async artifact(requestParameters, initOverrides) {
|
|
@@ -539,6 +546,48 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
539
546
|
const response = await this.createScopedApiKeyRaw(requestParameters, initOverrides);
|
|
540
547
|
return await response.value();
|
|
541
548
|
}
|
|
549
|
+
/**
|
|
550
|
+
* Creates request options for createSnapshotShare without sending the request
|
|
551
|
+
*/
|
|
552
|
+
async createSnapshotShareRequestOpts(requestParameters) {
|
|
553
|
+
if (requestParameters['name'] == null) {
|
|
554
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling createSnapshotShare().');
|
|
555
|
+
}
|
|
556
|
+
const queryParameters = {};
|
|
557
|
+
const headerParameters = {};
|
|
558
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
559
|
+
const token = this.configuration.accessToken;
|
|
560
|
+
const tokenString = await token("BoatBearerAuth", []);
|
|
561
|
+
if (tokenString) {
|
|
562
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
let urlPath = `/named-snapshots/{name}/shares`;
|
|
566
|
+
urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
|
|
567
|
+
return {
|
|
568
|
+
path: urlPath,
|
|
569
|
+
method: 'POST',
|
|
570
|
+
headers: headerParameters,
|
|
571
|
+
query: queryParameters,
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Make a secret code that lets any Boat account create a sandbox from this named snapshot (`boat snapshot share <name>` in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Everything on the disk is shared, so do not keep secrets in files on it. Needs `snapshot.write`.
|
|
576
|
+
* Share a named snapshot
|
|
577
|
+
*/
|
|
578
|
+
async createSnapshotShareRaw(requestParameters, initOverrides) {
|
|
579
|
+
const requestOptions = await this.createSnapshotShareRequestOpts(requestParameters);
|
|
580
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
581
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareCreatedResponseFromJSON(jsonValue));
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Make a secret code that lets any Boat account create a sandbox from this named snapshot (`boat snapshot share <name>` in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Everything on the disk is shared, so do not keep secrets in files on it. Needs `snapshot.write`.
|
|
585
|
+
* Share a named snapshot
|
|
586
|
+
*/
|
|
587
|
+
async createSnapshotShare(requestParameters, initOverrides) {
|
|
588
|
+
const response = await this.createSnapshotShareRaw(requestParameters, initOverrides);
|
|
589
|
+
return await response.value();
|
|
590
|
+
}
|
|
542
591
|
/**
|
|
543
592
|
* Creates request options for createWebhook without sending the request
|
|
544
593
|
*/
|
|
@@ -1520,6 +1569,52 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
1520
1569
|
const response = await this.getSnapshotTreeRaw(requestParameters, initOverrides);
|
|
1521
1570
|
return await response.value();
|
|
1522
1571
|
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Creates request options for getStop without sending the request
|
|
1574
|
+
*/
|
|
1575
|
+
async getStopRequestOpts(requestParameters) {
|
|
1576
|
+
if (requestParameters['sandboxId'] == null) {
|
|
1577
|
+
throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling getStop().');
|
|
1578
|
+
}
|
|
1579
|
+
if (requestParameters['stopId'] == null) {
|
|
1580
|
+
throw new runtime.RequiredError('stopId', 'Required parameter "stopId" was null or undefined when calling getStop().');
|
|
1581
|
+
}
|
|
1582
|
+
const queryParameters = {};
|
|
1583
|
+
const headerParameters = {};
|
|
1584
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1585
|
+
const token = this.configuration.accessToken;
|
|
1586
|
+
const tokenString = await token("BoatBearerAuth", []);
|
|
1587
|
+
if (tokenString) {
|
|
1588
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
let urlPath = `/sandboxes/{sandboxId}/stops/{stopId}`;
|
|
1592
|
+
urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
|
|
1593
|
+
urlPath = urlPath.replace('{stopId}', encodeURIComponent(String(requestParameters['stopId'])));
|
|
1594
|
+
return {
|
|
1595
|
+
path: urlPath,
|
|
1596
|
+
method: 'GET',
|
|
1597
|
+
headers: headerParameters,
|
|
1598
|
+
query: queryParameters,
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* Returns one stop of this sandbox by the id that `POST /sandboxes/{sandboxId}/stop` returned. Old stops stay readable after a resume or a later stop. Returns 404 when the id is unknown or belongs to another sandbox.
|
|
1603
|
+
* Get a stop by id
|
|
1604
|
+
*/
|
|
1605
|
+
async getStopRaw(requestParameters, initOverrides) {
|
|
1606
|
+
const requestOptions = await this.getStopRequestOpts(requestParameters);
|
|
1607
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1608
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => StopOperationResponseFromJSON(jsonValue));
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Returns one stop of this sandbox by the id that `POST /sandboxes/{sandboxId}/stop` returned. Old stops stay readable after a resume or a later stop. Returns 404 when the id is unknown or belongs to another sandbox.
|
|
1612
|
+
* Get a stop by id
|
|
1613
|
+
*/
|
|
1614
|
+
async getStop(requestParameters, initOverrides) {
|
|
1615
|
+
const response = await this.getStopRaw(requestParameters, initOverrides);
|
|
1616
|
+
return await response.value();
|
|
1617
|
+
}
|
|
1523
1618
|
/**
|
|
1524
1619
|
* Creates request options for getWebhook without sending the request
|
|
1525
1620
|
*/
|
|
@@ -1829,6 +1924,48 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
1829
1924
|
const response = await this.listSandboxSnapshotsRaw(requestParameters, initOverrides);
|
|
1830
1925
|
return await response.value();
|
|
1831
1926
|
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Creates request options for listSnapshotShares without sending the request
|
|
1929
|
+
*/
|
|
1930
|
+
async listSnapshotSharesRequestOpts(requestParameters) {
|
|
1931
|
+
if (requestParameters['name'] == null) {
|
|
1932
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling listSnapshotShares().');
|
|
1933
|
+
}
|
|
1934
|
+
const queryParameters = {};
|
|
1935
|
+
const headerParameters = {};
|
|
1936
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1937
|
+
const token = this.configuration.accessToken;
|
|
1938
|
+
const tokenString = await token("BoatBearerAuth", []);
|
|
1939
|
+
if (tokenString) {
|
|
1940
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
let urlPath = `/named-snapshots/{name}/shares`;
|
|
1944
|
+
urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
|
|
1945
|
+
return {
|
|
1946
|
+
path: urlPath,
|
|
1947
|
+
method: 'GET',
|
|
1948
|
+
headers: headerParameters,
|
|
1949
|
+
query: queryParameters,
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* List the share codes of a named snapshot, active and revoked (`boat snapshot shares <name>` in the CLI). The full codes are not returned. Needs `snapshot.read`.
|
|
1954
|
+
* List share codes of a named snapshot
|
|
1955
|
+
*/
|
|
1956
|
+
async listSnapshotSharesRaw(requestParameters, initOverrides) {
|
|
1957
|
+
const requestOptions = await this.listSnapshotSharesRequestOpts(requestParameters);
|
|
1958
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1959
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareListResponseFromJSON(jsonValue));
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* List the share codes of a named snapshot, active and revoked (`boat snapshot shares <name>` in the CLI). The full codes are not returned. Needs `snapshot.read`.
|
|
1963
|
+
* List share codes of a named snapshot
|
|
1964
|
+
*/
|
|
1965
|
+
async listSnapshotShares(requestParameters, initOverrides) {
|
|
1966
|
+
const response = await this.listSnapshotSharesRaw(requestParameters, initOverrides);
|
|
1967
|
+
return await response.value();
|
|
1968
|
+
}
|
|
1832
1969
|
/**
|
|
1833
1970
|
* Creates request options for listSnapshots without sending the request
|
|
1834
1971
|
*/
|
|
@@ -2081,6 +2218,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2081
2218
|
};
|
|
2082
2219
|
}
|
|
2083
2220
|
/**
|
|
2221
|
+
* Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
|
|
2084
2222
|
* Read a file from a sandbox
|
|
2085
2223
|
*/
|
|
2086
2224
|
async readFileRaw(requestParameters, initOverrides) {
|
|
@@ -2089,12 +2227,55 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2089
2227
|
return new runtime.JSONApiResponse(response, (jsonValue) => FileReadResponseFromJSON(jsonValue));
|
|
2090
2228
|
}
|
|
2091
2229
|
/**
|
|
2230
|
+
* Files up to 5 MiB. Use `GET /sandboxes/{sandboxId}/artifacts` for files up to 50 MiB, and SCP over SSH for larger ones.
|
|
2092
2231
|
* Read a file from a sandbox
|
|
2093
2232
|
*/
|
|
2094
2233
|
async readFile(requestParameters, initOverrides) {
|
|
2095
2234
|
const response = await this.readFileRaw(requestParameters, initOverrides);
|
|
2096
2235
|
return await response.value();
|
|
2097
2236
|
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Creates request options for recover without sending the request
|
|
2239
|
+
*/
|
|
2240
|
+
async recoverRequestOpts(requestParameters) {
|
|
2241
|
+
if (requestParameters['sandboxId'] == null) {
|
|
2242
|
+
throw new runtime.RequiredError('sandboxId', 'Required parameter "sandboxId" was null or undefined when calling recover().');
|
|
2243
|
+
}
|
|
2244
|
+
const queryParameters = {};
|
|
2245
|
+
const headerParameters = {};
|
|
2246
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2247
|
+
const token = this.configuration.accessToken;
|
|
2248
|
+
const tokenString = await token("BoatBearerAuth", []);
|
|
2249
|
+
if (tokenString) {
|
|
2250
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
let urlPath = `/sandboxes/{sandboxId}/recover`;
|
|
2254
|
+
urlPath = urlPath.replace('{sandboxId}', encodeURIComponent(String(requestParameters['sandboxId'])));
|
|
2255
|
+
return {
|
|
2256
|
+
path: urlPath,
|
|
2257
|
+
method: 'POST',
|
|
2258
|
+
headers: headerParameters,
|
|
2259
|
+
query: queryParameters,
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Power-cycle the machine of a sandbox that stopped answering. The disk is not touched. The sandbox usually answers again within 1-2 minutes and then saves your work by itself; `sandbox.recovered` fires when it does. Refused with `409`: - `sandbox_is_reachable`: the sandbox answers normally. - `too_soon`: a recover started less than 10 minutes ago. - `no_machine`: the sandbox has no machine. Resume it instead. - `recover_unsupported`: its machine cannot be power-cycled. Wait for it to answer, or resume it from its last snapshot. - `reset_failed`: the power-cycle failed. Reply to the incident email.
|
|
2264
|
+
* Recover a sandbox that stopped responding
|
|
2265
|
+
*/
|
|
2266
|
+
async recoverRaw(requestParameters, initOverrides) {
|
|
2267
|
+
const requestOptions = await this.recoverRequestOpts(requestParameters);
|
|
2268
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
2269
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => Recover200ResponseFromJSON(jsonValue));
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Power-cycle the machine of a sandbox that stopped answering. The disk is not touched. The sandbox usually answers again within 1-2 minutes and then saves your work by itself; `sandbox.recovered` fires when it does. Refused with `409`: - `sandbox_is_reachable`: the sandbox answers normally. - `too_soon`: a recover started less than 10 minutes ago. - `no_machine`: the sandbox has no machine. Resume it instead. - `recover_unsupported`: its machine cannot be power-cycled. Wait for it to answer, or resume it from its last snapshot. - `reset_failed`: the power-cycle failed. Reply to the incident email.
|
|
2273
|
+
* Recover a sandbox that stopped responding
|
|
2274
|
+
*/
|
|
2275
|
+
async recover(requestParameters, initOverrides) {
|
|
2276
|
+
const response = await this.recoverRaw(requestParameters, initOverrides);
|
|
2277
|
+
return await response.value();
|
|
2278
|
+
}
|
|
2098
2279
|
/**
|
|
2099
2280
|
* Creates request options for repos without sending the request
|
|
2100
2281
|
*/
|
|
@@ -2236,6 +2417,52 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2236
2417
|
const response = await this.revokeApiKeyRaw(requestParameters, initOverrides);
|
|
2237
2418
|
return await response.value();
|
|
2238
2419
|
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Creates request options for revokeSnapshotShare without sending the request
|
|
2422
|
+
*/
|
|
2423
|
+
async revokeSnapshotShareRequestOpts(requestParameters) {
|
|
2424
|
+
if (requestParameters['name'] == null) {
|
|
2425
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling revokeSnapshotShare().');
|
|
2426
|
+
}
|
|
2427
|
+
if (requestParameters['shareId'] == null) {
|
|
2428
|
+
throw new runtime.RequiredError('shareId', 'Required parameter "shareId" was null or undefined when calling revokeSnapshotShare().');
|
|
2429
|
+
}
|
|
2430
|
+
const queryParameters = {};
|
|
2431
|
+
const headerParameters = {};
|
|
2432
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
2433
|
+
const token = this.configuration.accessToken;
|
|
2434
|
+
const tokenString = await token("BoatBearerAuth", []);
|
|
2435
|
+
if (tokenString) {
|
|
2436
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
let urlPath = `/named-snapshots/{name}/shares/{shareId}`;
|
|
2440
|
+
urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
|
|
2441
|
+
urlPath = urlPath.replace('{shareId}', encodeURIComponent(String(requestParameters['shareId'])));
|
|
2442
|
+
return {
|
|
2443
|
+
path: urlPath,
|
|
2444
|
+
method: 'DELETE',
|
|
2445
|
+
headers: headerParameters,
|
|
2446
|
+
query: queryParameters,
|
|
2447
|
+
};
|
|
2448
|
+
}
|
|
2449
|
+
/**
|
|
2450
|
+
* Revoke a share code (`boat snapshot unshare <name> <share-id>` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`.
|
|
2451
|
+
* Revoke a share code
|
|
2452
|
+
*/
|
|
2453
|
+
async revokeSnapshotShareRaw(requestParameters, initOverrides) {
|
|
2454
|
+
const requestOptions = await this.revokeSnapshotShareRequestOpts(requestParameters);
|
|
2455
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
2456
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => NamedSnapshotShareRevokedResponseFromJSON(jsonValue));
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* Revoke a share code (`boat snapshot unshare <name> <share-id>` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`.
|
|
2460
|
+
* Revoke a share code
|
|
2461
|
+
*/
|
|
2462
|
+
async revokeSnapshotShare(requestParameters, initOverrides) {
|
|
2463
|
+
const response = await this.revokeSnapshotShareRaw(requestParameters, initOverrides);
|
|
2464
|
+
return await response.value();
|
|
2465
|
+
}
|
|
2239
2466
|
/**
|
|
2240
2467
|
* Creates request options for rotateApiKey without sending the request
|
|
2241
2468
|
*/
|
|
@@ -2771,7 +2998,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2771
2998
|
};
|
|
2772
2999
|
}
|
|
2773
3000
|
/**
|
|
2774
|
-
* Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Where the harness has a native mid-turn primitive (Claude Code, Codex, pi, Prime Agent) nothing is interrupted and the response has `native: true`. Where it does not (OpenCode), Boat interrupts that turn and immediately continues the SAME conversation with the instruction, keeping the session and its memory, and the response has `native: false`. Refused with **409 `no_running_turn`** when the conversation has nothing in flight; queue work with `POST /prompt` instead. The steer shows up in `GET /events` as a `steer` event. See [Integrated agents](/integrated-agents).
|
|
3001
|
+
* Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Where the harness has a native mid-turn primitive (Claude Code, Codex, pi, Prime Agent) nothing is interrupted and the response has `native: true`. Where it does not (OpenCode), Boat interrupts that turn and immediately continues the SAME conversation with the instruction, keeping the session and its memory, and the response has `native: false`. Refused with **409 `no_running_turn`** when the conversation has nothing in flight; queue work with `POST /prompt` instead. `error.details.reason` says why: `turn_ended` (with `error.details.lastTurn.status` and `.error` of the newest turn), `turn_not_started` (the turn is starting; retry in a moment), `no_turn`, `not_running` (the sandbox is not running) or `delivery_failed` (the sandbox did not accept the steer; check the turn before sending more work). The steer shows up in `GET /events` as a `steer` event. See [Integrated agents](/integrated-agents).
|
|
2775
3002
|
* Steer a running turn
|
|
2776
3003
|
*/
|
|
2777
3004
|
async steerRaw(requestParameters, initOverrides) {
|
|
@@ -2780,7 +3007,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2780
3007
|
return new runtime.JSONApiResponse(response, (jsonValue) => SteerResponseFromJSON(jsonValue));
|
|
2781
3008
|
}
|
|
2782
3009
|
/**
|
|
2783
|
-
* Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Where the harness has a native mid-turn primitive (Claude Code, Codex, pi, Prime Agent) nothing is interrupted and the response has `native: true`. Where it does not (OpenCode), Boat interrupts that turn and immediately continues the SAME conversation with the instruction, keeping the session and its memory, and the response has `native: false`. Refused with **409 `no_running_turn`** when the conversation has nothing in flight; queue work with `POST /prompt` instead. The steer shows up in `GET /events` as a `steer` event. See [Integrated agents](/integrated-agents).
|
|
3010
|
+
* Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Where the harness has a native mid-turn primitive (Claude Code, Codex, pi, Prime Agent) nothing is interrupted and the response has `native: true`. Where it does not (OpenCode), Boat interrupts that turn and immediately continues the SAME conversation with the instruction, keeping the session and its memory, and the response has `native: false`. Refused with **409 `no_running_turn`** when the conversation has nothing in flight; queue work with `POST /prompt` instead. `error.details.reason` says why: `turn_ended` (with `error.details.lastTurn.status` and `.error` of the newest turn), `turn_not_started` (the turn is starting; retry in a moment), `no_turn`, `not_running` (the sandbox is not running) or `delivery_failed` (the sandbox did not accept the steer; check the turn before sending more work). The steer shows up in `GET /events` as a `steer` event. See [Integrated agents](/integrated-agents).
|
|
2784
3011
|
* Steer a running turn
|
|
2785
3012
|
*/
|
|
2786
3013
|
async steer(requestParameters, initOverrides) {
|
|
@@ -2816,7 +3043,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2816
3043
|
};
|
|
2817
3044
|
}
|
|
2818
3045
|
/**
|
|
2819
|
-
* Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox\'s disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you. You are not billed for time spent in that state. The stop is an operation: the response and the sandbox carry it as `stop`, with an `id` and a `status`. Poll `GET /sandboxes/{sandboxId}` until `stop.status` is `completed`. A failed attempt shows `failing` with its `error` and is retried until the sandbox archives; commands and prompts you send meanwhile do not cancel it. Only a resume ends it early (`superseded`). Calling stop again while one is pending returns the same `id`. Set `force: true` to stop anyway,
|
|
3046
|
+
* Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox\'s disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you. You are not billed for time spent in that state. The stop is an operation: the response and the sandbox carry it as `stop`, with an `id` and a `status`. Poll `GET /sandboxes/{sandboxId}` until `stop.status` is `completed`. A failed attempt shows `failing` with its `error` and is retried until the sandbox archives; commands and prompts you send meanwhile do not cancel it. Only a resume ends it early (`superseded`). Calling stop again while one is pending returns the same `id`. Set `force: true` to stop anyway, keeping the last successful snapshot and losing everything written since then. This is irreversible; only reach for it after a stop has already failed. A force on a stop that is already pending escalates that stop.
|
|
2820
3047
|
* Stop and archive sandbox
|
|
2821
3048
|
*/
|
|
2822
3049
|
async stopRaw(requestParameters, initOverrides) {
|
|
@@ -2825,7 +3052,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
2825
3052
|
return new runtime.JSONApiResponse(response, (jsonValue) => SandboxActionResponseFromJSON(jsonValue));
|
|
2826
3053
|
}
|
|
2827
3054
|
/**
|
|
2828
|
-
* Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox\'s disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you. You are not billed for time spent in that state. The stop is an operation: the response and the sandbox carry it as `stop`, with an `id` and a `status`. Poll `GET /sandboxes/{sandboxId}` until `stop.status` is `completed`. A failed attempt shows `failing` with its `error` and is retried until the sandbox archives; commands and prompts you send meanwhile do not cancel it. Only a resume ends it early (`superseded`). Calling stop again while one is pending returns the same `id`. Set `force: true` to stop anyway,
|
|
3055
|
+
* Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox\'s disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you. You are not billed for time spent in that state. The stop is an operation: the response and the sandbox carry it as `stop`, with an `id` and a `status`. Poll `GET /sandboxes/{sandboxId}` until `stop.status` is `completed`. A failed attempt shows `failing` with its `error` and is retried until the sandbox archives; commands and prompts you send meanwhile do not cancel it. Only a resume ends it early (`superseded`). Calling stop again while one is pending returns the same `id`. Set `force: true` to stop anyway, keeping the last successful snapshot and losing everything written since then. This is irreversible; only reach for it after a stop has already failed. A force on a stop that is already pending escalates that stop.
|
|
2829
3056
|
* Stop and archive sandbox
|
|
2830
3057
|
*/
|
|
2831
3058
|
async stop(requestParameters, initOverrides) {
|
|
@@ -3185,6 +3412,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
3185
3412
|
};
|
|
3186
3413
|
}
|
|
3187
3414
|
/**
|
|
3415
|
+
* Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
|
|
3188
3416
|
* Write a file in a sandbox
|
|
3189
3417
|
*/
|
|
3190
3418
|
async writeFileRaw(requestParameters, initOverrides) {
|
|
@@ -3193,6 +3421,7 @@ export class BoatApi extends runtime.BaseAPI {
|
|
|
3193
3421
|
return new runtime.JSONApiResponse(response, (jsonValue) => FileWriteResponseFromJSON(jsonValue));
|
|
3194
3422
|
}
|
|
3195
3423
|
/**
|
|
3424
|
+
* Files up to 5 MiB after decoding. Use SCP over SSH for larger files.
|
|
3196
3425
|
* Write a file in a sandbox
|
|
3197
3426
|
*/
|
|
3198
3427
|
async writeFile(requestParameters, initOverrides) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultFetch: typeof fetch;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// The SDK's default fetch. On Node it sends every request to an https origin over
|
|
2
|
+
// ONE shared HTTP/2 connection. Node's global fetch speaks HTTP/1.1 only, so N
|
|
3
|
+
// concurrent calls opened N TLS connections: a burst of 200 calls from a laptop
|
|
4
|
+
// made 200 handshakes (measured 2026-10-08), and 250 creates arrived at the API
|
|
5
|
+
// over 8-14 s. Elsewhere (browsers, Deno, Bun, an origin without HTTP/2), and for
|
|
6
|
+
// any body this does not handle, it is the global fetch.
|
|
7
|
+
// Pass `fetchApi` in the Configuration to use your own fetch instead.
|
|
8
|
+
const sessions = new Map();
|
|
9
|
+
const http1Only = new Set();
|
|
10
|
+
const slots = new WeakMap();
|
|
11
|
+
// A server caps the streams open at once on a connection (boat.dev: 250; this uses
|
|
12
|
+
// at most 100). A stream past the cap is refused, so the excess waits here. Requests open
|
|
13
|
+
// or waiting keep the process alive; an idle shared connection does not.
|
|
14
|
+
async function streamSlot(s, signal) {
|
|
15
|
+
var _a;
|
|
16
|
+
let st = slots.get(s);
|
|
17
|
+
if (!st) {
|
|
18
|
+
st = { active: 0, waiting: [] };
|
|
19
|
+
slots.set(s, st);
|
|
20
|
+
}
|
|
21
|
+
const state = st;
|
|
22
|
+
const cap = Math.max(1, Math.min(Number((_a = s.remoteSettings) === null || _a === void 0 ? void 0 : _a.maxConcurrentStreams) || 100, 100));
|
|
23
|
+
// Already aborted: take no stream, never queue (an abort listener added now never fires).
|
|
24
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
25
|
+
return () => { };
|
|
26
|
+
if (state.active === 0 && state.waiting.length === 0)
|
|
27
|
+
s.ref();
|
|
28
|
+
if (state.active >= cap) {
|
|
29
|
+
const turn = await new Promise((wake) => {
|
|
30
|
+
const w = () => wake(true);
|
|
31
|
+
state.waiting.push(w);
|
|
32
|
+
// An aborted waiter leaves the queue without a stream; the caller rejects it.
|
|
33
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', () => {
|
|
34
|
+
const i = state.waiting.indexOf(w);
|
|
35
|
+
if (i !== -1) {
|
|
36
|
+
state.waiting.splice(i, 1);
|
|
37
|
+
wake(false);
|
|
38
|
+
}
|
|
39
|
+
}, { once: true });
|
|
40
|
+
});
|
|
41
|
+
if (!turn)
|
|
42
|
+
return () => { };
|
|
43
|
+
}
|
|
44
|
+
state.active++;
|
|
45
|
+
let released = false;
|
|
46
|
+
return () => {
|
|
47
|
+
if (released)
|
|
48
|
+
return;
|
|
49
|
+
released = true;
|
|
50
|
+
state.active--;
|
|
51
|
+
const next = state.waiting.shift();
|
|
52
|
+
if (next)
|
|
53
|
+
next();
|
|
54
|
+
else if (state.active === 0)
|
|
55
|
+
s.unref();
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
let nodeHttp2;
|
|
59
|
+
function loadNode() {
|
|
60
|
+
var _a;
|
|
61
|
+
if (!nodeHttp2) {
|
|
62
|
+
const versions = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.versions;
|
|
63
|
+
const isNode = !!(versions === null || versions === void 0 ? void 0 : versions.node) && !versions.bun && typeof globalThis.Deno === 'undefined';
|
|
64
|
+
// A variable, not a literal: a browser bundler must not try to resolve it.
|
|
65
|
+
const h2 = 'node:http2';
|
|
66
|
+
nodeHttp2 = isNode
|
|
67
|
+
? import(/* webpackIgnore: true */ /* @vite-ignore */ h2).catch(() => null)
|
|
68
|
+
: Promise.resolve(null);
|
|
69
|
+
}
|
|
70
|
+
return nodeHttp2;
|
|
71
|
+
}
|
|
72
|
+
function session(origin, http2) {
|
|
73
|
+
const open = sessions.get(origin);
|
|
74
|
+
if (open)
|
|
75
|
+
return open;
|
|
76
|
+
const pending = new Promise((resolve) => {
|
|
77
|
+
let s;
|
|
78
|
+
try {
|
|
79
|
+
s = http2.connect(origin);
|
|
80
|
+
}
|
|
81
|
+
catch (_a) {
|
|
82
|
+
resolve(null);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const drop = () => { if (sessions.get(origin) === pending)
|
|
86
|
+
sessions.delete(origin); };
|
|
87
|
+
s.once('connect', () => {
|
|
88
|
+
// An origin that answered without h2 never gets here: the TLS layer fails the connect.
|
|
89
|
+
s.unref(); // an idle shared connection must not keep the process alive
|
|
90
|
+
resolve(s);
|
|
91
|
+
});
|
|
92
|
+
// `on`, not `once`: a session can emit more than one error, and an unhandled one kills the process.
|
|
93
|
+
s.on('error', () => { drop(); resolve(null); });
|
|
94
|
+
s.once('close', drop);
|
|
95
|
+
s.once('goaway', drop);
|
|
96
|
+
});
|
|
97
|
+
sessions.set(origin, pending);
|
|
98
|
+
return pending;
|
|
99
|
+
}
|
|
100
|
+
function sendableBody(body) {
|
|
101
|
+
if (body == null)
|
|
102
|
+
return null;
|
|
103
|
+
if (typeof body === 'string')
|
|
104
|
+
return body;
|
|
105
|
+
if (body instanceof Uint8Array)
|
|
106
|
+
return body;
|
|
107
|
+
if (body instanceof ArrayBuffer)
|
|
108
|
+
return new Uint8Array(body);
|
|
109
|
+
if (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
|
|
110
|
+
return body.toString();
|
|
111
|
+
return undefined; // FormData, Blob, streams: the global fetch encodes these
|
|
112
|
+
}
|
|
113
|
+
const HOP_BY_HOP = new Set(['connection', 'host', 'keep-alive', 'proxy-connection', 'transfer-encoding', 'upgrade']);
|
|
114
|
+
async function http2Fetch(input, init = {}) {
|
|
115
|
+
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
|
|
116
|
+
const body = sendableBody(init.body);
|
|
117
|
+
const node = await loadNode();
|
|
118
|
+
const isRequest = typeof input !== 'string' && !(input instanceof URL);
|
|
119
|
+
if (!node || isRequest || body === undefined || url.protocol !== 'https:' || http1Only.has(url.origin)) {
|
|
120
|
+
return fetch(input, init);
|
|
121
|
+
}
|
|
122
|
+
const s = await session(url.origin, node);
|
|
123
|
+
if (!s || s.closed || s.destroyed) {
|
|
124
|
+
if (!s)
|
|
125
|
+
http1Only.add(url.origin);
|
|
126
|
+
return fetch(input, init);
|
|
127
|
+
}
|
|
128
|
+
const headers = { ':method': (init.method || 'GET').toUpperCase(), ':path': url.pathname + url.search };
|
|
129
|
+
new Headers(init.headers).forEach((value, key) => { if (!HOP_BY_HOP.has(key))
|
|
130
|
+
headers[key] = value; });
|
|
131
|
+
const signal = init.signal;
|
|
132
|
+
const aborted = () => { var _a; return (_a = signal.reason) !== null && _a !== void 0 ? _a : new DOMException('This operation was aborted', 'AbortError'); };
|
|
133
|
+
const release = await streamSlot(s, signal);
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
136
|
+
release();
|
|
137
|
+
reject(aborted());
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
let req;
|
|
141
|
+
try {
|
|
142
|
+
req = s.request(headers, { endStream: body === null });
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
// The connection closed (GOAWAY) while this call waited for a stream.
|
|
146
|
+
release();
|
|
147
|
+
reject(e);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const onAbort = () => { req.close(); reject(aborted()); };
|
|
151
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', onAbort, { once: true });
|
|
152
|
+
req.once('close', () => { release(); signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', onAbort); });
|
|
153
|
+
req.on('error', reject); // after the response this errors its body stream; a no-op here
|
|
154
|
+
req.once('response', (h) => {
|
|
155
|
+
const status = Number(h[':status']);
|
|
156
|
+
const out = new Headers();
|
|
157
|
+
for (const [k, v] of Object.entries(h)) {
|
|
158
|
+
if (k.startsWith(':') || v === undefined)
|
|
159
|
+
continue;
|
|
160
|
+
for (const one of Array.isArray(v) ? v : [v])
|
|
161
|
+
out.append(k, String(one));
|
|
162
|
+
}
|
|
163
|
+
const empty = status === 204 || status === 205 || status === 304 || headers[':method'] === 'HEAD';
|
|
164
|
+
if (empty)
|
|
165
|
+
req.resume();
|
|
166
|
+
// Fed from 'data' events, not Readable.toWeb: an HTTP/2 stream the server has
|
|
167
|
+
// already closed is destroyed with its unread data, and toWeb's backpressure
|
|
168
|
+
// turned that into "Premature close" on 25 of 250 calls (prod, 2026-10-08).
|
|
169
|
+
// A slow reader (streamCommand between frames) must not let a fast command
|
|
170
|
+
// fill memory: past 4 MiB unread the stream pauses until the reader pulls.
|
|
171
|
+
const bodyStream = empty ? null : new ReadableStream({
|
|
172
|
+
start(controller) {
|
|
173
|
+
req.on('data', (chunk) => {
|
|
174
|
+
var _a;
|
|
175
|
+
controller.enqueue(new Uint8Array(chunk));
|
|
176
|
+
if (((_a = controller.desiredSize) !== null && _a !== void 0 ? _a : 1) <= 0)
|
|
177
|
+
req.pause();
|
|
178
|
+
});
|
|
179
|
+
req.once('end', () => controller.close());
|
|
180
|
+
req.once('error', (e) => controller.error(e));
|
|
181
|
+
req.once('close', () => {
|
|
182
|
+
if (!req.readableEnded) {
|
|
183
|
+
try {
|
|
184
|
+
controller.error(new Error(`HTTP/2 stream closed before its end (code ${req.rstCode})`));
|
|
185
|
+
}
|
|
186
|
+
catch (_a) { }
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
pull() { if (req.isPaused())
|
|
191
|
+
req.resume(); },
|
|
192
|
+
cancel() { req.close(); },
|
|
193
|
+
}, { highWaterMark: 4 * 1024 * 1024, size: (chunk) => { var _a; return (_a = chunk === null || chunk === void 0 ? void 0 : chunk.byteLength) !== null && _a !== void 0 ? _a : 0; } });
|
|
194
|
+
const response = new Response(bodyStream, { status, headers: out });
|
|
195
|
+
// Response.url is read-only; the generated client never reads it, but keep it right.
|
|
196
|
+
Object.defineProperty(response, 'url', { value: url.href });
|
|
197
|
+
resolve(response);
|
|
198
|
+
});
|
|
199
|
+
if (body !== null)
|
|
200
|
+
req.end(body);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export const defaultFetch = http2Fetch;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export interface CreateSandboxRequest {
|
|
18
18
|
/**
|
|
19
|
-
* Machine size. `small` consumes machine time at half rate and `large` at twice the default rate (see the Billing guide). A fork inherits the source sandbox's type unless the fork request passes its own, and resume and fork can move a sandbox between sizes.
|
|
19
|
+
* Machine size. `small` consumes machine time at half rate and `large` at twice the default rate (see the Billing guide). `xlarge` needs the $100/month plan or higher; lower plans get a 403 `machine_class_plan_required` on create, resume and fork. A fork inherits the source sandbox's type unless the fork request passes its own, and resume and fork can move a sandbox between sizes.
|
|
20
20
|
* @type {CreateSandboxRequestTypeEnum}
|
|
21
21
|
* @memberof CreateSandboxRequest
|
|
22
22
|
*/
|
|
@@ -60,7 +60,7 @@ export interface CreateSandboxRequest {
|
|
|
60
60
|
*/
|
|
61
61
|
failFast?: boolean;
|
|
62
62
|
/**
|
|
63
|
-
* Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user via `bash`, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the sandbox. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB.
|
|
63
|
+
* Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user (`user`, not root; `sudo` needs no password) via `bash`, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the sandbox. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB.
|
|
64
64
|
* @type {string}
|
|
65
65
|
* @memberof CreateSandboxRequest
|
|
66
66
|
*/
|
|
@@ -78,7 +78,7 @@ export interface CreateSandboxRequest {
|
|
|
78
78
|
*/
|
|
79
79
|
teamId?: string;
|
|
80
80
|
/**
|
|
81
|
-
* Create the sandbox from a named snapshot (saved with `POST /named-snapshots`, or `boat snapshot <id> <name>` in the CLI). The sandbox starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking.
|
|
81
|
+
* Create the sandbox from a named snapshot (saved with `POST /named-snapshots`, or `boat snapshot <id> <name>` in the CLI). The sandbox starts from that exact frozen state. Omitting `type` inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking. Also accepts a share code (`bsh_...`) that another account made with `POST /named-snapshots/{name}/shares`. The new sandbox lives in and is billed to your account. It does not get the owner's per-sandbox env; your own environment applies normally. A wrong or revoked code returns `404 snapshot_not_found`.
|
|
82
82
|
* @type {string}
|
|
83
83
|
* @memberof CreateSandboxRequest
|
|
84
84
|
*/
|
|
@@ -91,6 +91,7 @@ export declare const CreateSandboxRequestTypeEnum: {
|
|
|
91
91
|
readonly Small: 'small';
|
|
92
92
|
readonly Default: 'default';
|
|
93
93
|
readonly Large: 'large';
|
|
94
|
+
readonly Xlarge: 'xlarge';
|
|
94
95
|
};
|
|
95
96
|
export type CreateSandboxRequestTypeEnum = typeof CreateSandboxRequestTypeEnum[keyof typeof CreateSandboxRequestTypeEnum];
|
|
96
97
|
/**
|
|
@@ -42,7 +42,7 @@ export interface ForkRequest {
|
|
|
42
42
|
*/
|
|
43
43
|
noEnv?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Machine size for the fork. Omit to inherit the source sandbox's type. The source sandbox is never modified. Shrinking is rejected with `type_too_small` when the source's data would not fit the smaller disk.
|
|
45
|
+
* Machine size for the fork. Omit to inherit the source sandbox's type. `xlarge` needs the $100/month plan or higher (403 `machine_class_plan_required`). The source sandbox is never modified. Shrinking is rejected with `type_too_small` when the source's data would not fit the smaller disk.
|
|
46
46
|
* @type {ForkRequestTypeEnum}
|
|
47
47
|
* @memberof ForkRequest
|
|
48
48
|
*/
|
|
@@ -61,6 +61,7 @@ export declare const ForkRequestTypeEnum: {
|
|
|
61
61
|
readonly Small: 'small';
|
|
62
62
|
readonly Default: 'default';
|
|
63
63
|
readonly Large: 'large';
|
|
64
|
+
readonly Xlarge: 'xlarge';
|
|
64
65
|
};
|
|
65
66
|
export type ForkRequestTypeEnum = typeof ForkRequestTypeEnum[keyof typeof ForkRequestTypeEnum];
|
|
66
67
|
/**
|