@boatdev/sdk 1.7.0 → 1.8.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 +4 -0
- package/dist/apis/BoatApi.d.ts +47 -4
- package/dist/apis/BoatApi.js +100 -4
- package/dist/esm/apis/BoatApi.d.ts +47 -4
- package/dist/esm/apis/BoatApi.js +100 -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 +3 -2
- 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/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 +2 -0
- package/dist/esm/models/index.js +2 -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 +3 -2
- 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/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 +2 -0
- package/dist/models/index.js +2 -0
- package/dist/runtime.js +9 -8
- package/docs/BoatApi.md +160 -2
- package/docs/Recover200Response.md +38 -0
- package/docs/StopOperationResponse.md +38 -0
- package/package.json +1 -1
- package/src/apis/BoatApi.ts +147 -4
- package/src/http2-fetch.ts +179 -0
- package/src/models/CreateSandboxRequest.ts +4 -3
- package/src/models/ForkRequest.ts +3 -2
- 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 +2 -0
- package/src/runtime.ts +2 -1
|
@@ -40,7 +40,7 @@ export interface SandboxUsageResponse {
|
|
|
40
40
|
*/
|
|
41
41
|
sandboxType: SandboxUsageResponseSandboxTypeEnum;
|
|
42
42
|
/**
|
|
43
|
-
* Rate at which this sandbox consumes machine time. 0.5 for `small`, 1 for `default`, and
|
|
43
|
+
* Rate at which this sandbox consumes machine time. 0.5 for `small`, 1 for `default`, 2 for `large`, and 50/9 (about 5.56) for `xlarge`.
|
|
44
44
|
* @type {number}
|
|
45
45
|
* @memberof SandboxUsageResponse
|
|
46
46
|
*/
|
|
@@ -89,6 +89,7 @@ export declare const SandboxUsageResponseSandboxTypeEnum: {
|
|
|
89
89
|
readonly Small: 'small';
|
|
90
90
|
readonly Default: 'default';
|
|
91
91
|
readonly Large: 'large';
|
|
92
|
+
readonly Xlarge: 'xlarge';
|
|
92
93
|
};
|
|
93
94
|
export type SandboxUsageResponseSandboxTypeEnum = typeof SandboxUsageResponseSandboxTypeEnum[keyof typeof SandboxUsageResponseSandboxTypeEnum];
|
|
94
95
|
/**
|
|
@@ -28,7 +28,7 @@ export interface StopOperation {
|
|
|
28
28
|
*/
|
|
29
29
|
status: StopOperationStatusEnum;
|
|
30
30
|
/**
|
|
31
|
-
* When the stop was accepted.
|
|
31
|
+
* When the stop was accepted. On the sandbox, null once it has ended. Read by id (`GET /sandboxes/{sandboxId}/stops/{stopId}`), it is kept.
|
|
32
32
|
* @type {Date}
|
|
33
33
|
* @memberof StopOperation
|
|
34
34
|
*/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boat Public API v1
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { StopOperation } from './StopOperation';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface StopOperationResponse
|
|
17
|
+
*/
|
|
18
|
+
export interface StopOperationResponse {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
* @memberof StopOperationResponse
|
|
23
|
+
*/
|
|
24
|
+
ok: boolean;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {StopOperationResponseTypeEnum}
|
|
28
|
+
* @memberof StopOperationResponse
|
|
29
|
+
*/
|
|
30
|
+
type: StopOperationResponseTypeEnum;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof StopOperationResponse
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {StopOperation}
|
|
40
|
+
* @memberof StopOperationResponse
|
|
41
|
+
*/
|
|
42
|
+
stop: StopOperation;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
export declare const StopOperationResponseTypeEnum: {
|
|
48
|
+
readonly StopStatus: 'stop.status';
|
|
49
|
+
};
|
|
50
|
+
export type StopOperationResponseTypeEnum = typeof StopOperationResponseTypeEnum[keyof typeof StopOperationResponseTypeEnum];
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the StopOperationResponse interface.
|
|
53
|
+
*/
|
|
54
|
+
export declare function instanceOfStopOperationResponse(value: object): value is StopOperationResponse;
|
|
55
|
+
export declare function StopOperationResponseFromJSON(json: any): StopOperationResponse;
|
|
56
|
+
export declare function StopOperationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StopOperationResponse;
|
|
57
|
+
export declare function StopOperationResponseToJSON(json: any): StopOperationResponse;
|
|
58
|
+
export declare function StopOperationResponseToJSONTyped(value?: StopOperationResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
import { StopOperationFromJSON, StopOperationToJSON, } from './StopOperation';
|
|
15
|
+
/**
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const StopOperationResponseTypeEnum = {
|
|
19
|
+
StopStatus: 'stop.status'
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the StopOperationResponse interface.
|
|
23
|
+
*/
|
|
24
|
+
export function instanceOfStopOperationResponse(value) {
|
|
25
|
+
if (!('ok' in value) || value['ok'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('type' in value) || value['type'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if (!('stop' in value) || value['stop'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
export function StopOperationResponseFromJSON(json) {
|
|
36
|
+
return StopOperationResponseFromJSONTyped(json, false);
|
|
37
|
+
}
|
|
38
|
+
export function StopOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
39
|
+
if (json == null) {
|
|
40
|
+
return json;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
'ok': json['ok'],
|
|
44
|
+
'type': json['type'],
|
|
45
|
+
'id': json['id'],
|
|
46
|
+
'stop': StopOperationFromJSON(json['stop']),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function StopOperationResponseToJSON(json) {
|
|
50
|
+
return StopOperationResponseToJSONTyped(json, false);
|
|
51
|
+
}
|
|
52
|
+
export function StopOperationResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
53
|
+
if (value == null) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
'ok': value['ok'],
|
|
58
|
+
'type': value['type'],
|
|
59
|
+
'id': value['id'],
|
|
60
|
+
'stop': StopOperationToJSON(value['stop']),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export interface StopRequest {
|
|
18
18
|
/**
|
|
19
|
-
* Stop the sandbox even if its disk cannot be snapshotted.
|
|
19
|
+
* Stop the sandbox even if its disk cannot be snapshotted. It keeps its last successful snapshot and everything written since then is permanently LOST. Without this, a sandbox whose snapshot pipeline is failing is left running rather than discarding your work, and you are not billed for that time. Only use this after a stop has already been refused.
|
|
20
20
|
* @type {boolean}
|
|
21
21
|
* @memberof StopRequest
|
|
22
22
|
*/
|
|
@@ -22,7 +22,7 @@ export interface UpdateSandboxRequest {
|
|
|
22
22
|
*/
|
|
23
23
|
name?: string;
|
|
24
24
|
/**
|
|
25
|
-
* New
|
|
25
|
+
* New auto-stop TTL. The deadline becomes now + `ttlSeconds`, so calling this again extends a running sandbox's life. `null` disables auto-stop.
|
|
26
26
|
* @type {number}
|
|
27
27
|
* @memberof UpdateSandboxRequest
|
|
28
28
|
*/
|
|
@@ -74,6 +74,7 @@ export * from './PromptRequest';
|
|
|
74
74
|
export * from './PromptResponse';
|
|
75
75
|
export * from './PromptRun';
|
|
76
76
|
export * from './PromptRunResponse';
|
|
77
|
+
export * from './Recover200Response';
|
|
77
78
|
export * from './RepoSelectionRequest';
|
|
78
79
|
export * from './RepoSelectionResponse';
|
|
79
80
|
export * from './ReposResponse';
|
|
@@ -117,6 +118,7 @@ export * from './SteerEventData';
|
|
|
117
118
|
export * from './SteerRequest';
|
|
118
119
|
export * from './SteerResponse';
|
|
119
120
|
export * from './StopOperation';
|
|
121
|
+
export * from './StopOperationResponse';
|
|
120
122
|
export * from './StopRequest';
|
|
121
123
|
export * from './SuccessBase';
|
|
122
124
|
export * from './UnknownEvent';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -76,6 +76,7 @@ export * from './PromptRequest';
|
|
|
76
76
|
export * from './PromptResponse';
|
|
77
77
|
export * from './PromptRun';
|
|
78
78
|
export * from './PromptRunResponse';
|
|
79
|
+
export * from './Recover200Response';
|
|
79
80
|
export * from './RepoSelectionRequest';
|
|
80
81
|
export * from './RepoSelectionResponse';
|
|
81
82
|
export * from './ReposResponse';
|
|
@@ -119,6 +120,7 @@ export * from './SteerEventData';
|
|
|
119
120
|
export * from './SteerRequest';
|
|
120
121
|
export * from './SteerResponse';
|
|
121
122
|
export * from './StopOperation';
|
|
123
|
+
export * from './StopOperationResponse';
|
|
122
124
|
export * from './StopRequest';
|
|
123
125
|
export * from './SuccessBase';
|
|
124
126
|
export * from './UnknownEvent';
|
package/dist/esm/runtime.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defaultFetch } from './http2-fetch';
|
|
1
2
|
/* tslint:disable */
|
|
2
3
|
/* eslint-disable */
|
|
3
4
|
/**
|
|
@@ -77,7 +78,7 @@ export class BaseAPI {
|
|
|
77
78
|
}
|
|
78
79
|
let response = undefined;
|
|
79
80
|
try {
|
|
80
|
-
response = await (this.configuration.fetchApi ||
|
|
81
|
+
response = await (this.configuration.fetchApi || defaultFetch)(fetchParams.url, fetchParams.init);
|
|
81
82
|
}
|
|
82
83
|
catch (e) {
|
|
83
84
|
for (const middleware of this.middleware) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultFetch: typeof fetch;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The SDK's default fetch. On Node it sends every request to an https origin over
|
|
3
|
+
// ONE shared HTTP/2 connection. Node's global fetch speaks HTTP/1.1 only, so N
|
|
4
|
+
// concurrent calls opened N TLS connections: a burst of 200 calls from a laptop
|
|
5
|
+
// made 200 handshakes (measured 2026-10-08), and 250 creates arrived at the API
|
|
6
|
+
// over 8-14 s. Elsewhere (browsers, Deno, Bun, an origin without HTTP/2), and for
|
|
7
|
+
// any body this does not handle, it is the global fetch.
|
|
8
|
+
// Pass `fetchApi` in the Configuration to use your own fetch instead.
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.defaultFetch = void 0;
|
|
44
|
+
const sessions = new Map();
|
|
45
|
+
const http1Only = new Set();
|
|
46
|
+
const slots = new WeakMap();
|
|
47
|
+
// A server caps the streams open at once on a connection (boat.dev: 250; this uses
|
|
48
|
+
// at most 100). A stream past the cap is refused, so the excess waits here. Requests open
|
|
49
|
+
// or waiting keep the process alive; an idle shared connection does not.
|
|
50
|
+
async function streamSlot(s, signal) {
|
|
51
|
+
var _a;
|
|
52
|
+
let st = slots.get(s);
|
|
53
|
+
if (!st) {
|
|
54
|
+
st = { active: 0, waiting: [] };
|
|
55
|
+
slots.set(s, st);
|
|
56
|
+
}
|
|
57
|
+
const state = st;
|
|
58
|
+
const cap = Math.max(1, Math.min(Number((_a = s.remoteSettings) === null || _a === void 0 ? void 0 : _a.maxConcurrentStreams) || 100, 100));
|
|
59
|
+
// Already aborted: take no stream, never queue (an abort listener added now never fires).
|
|
60
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted)
|
|
61
|
+
return () => { };
|
|
62
|
+
if (state.active === 0 && state.waiting.length === 0)
|
|
63
|
+
s.ref();
|
|
64
|
+
if (state.active >= cap) {
|
|
65
|
+
const turn = await new Promise((wake) => {
|
|
66
|
+
const w = () => wake(true);
|
|
67
|
+
state.waiting.push(w);
|
|
68
|
+
// An aborted waiter leaves the queue without a stream; the caller rejects it.
|
|
69
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', () => {
|
|
70
|
+
const i = state.waiting.indexOf(w);
|
|
71
|
+
if (i !== -1) {
|
|
72
|
+
state.waiting.splice(i, 1);
|
|
73
|
+
wake(false);
|
|
74
|
+
}
|
|
75
|
+
}, { once: true });
|
|
76
|
+
});
|
|
77
|
+
if (!turn)
|
|
78
|
+
return () => { };
|
|
79
|
+
}
|
|
80
|
+
state.active++;
|
|
81
|
+
let released = false;
|
|
82
|
+
return () => {
|
|
83
|
+
if (released)
|
|
84
|
+
return;
|
|
85
|
+
released = true;
|
|
86
|
+
state.active--;
|
|
87
|
+
const next = state.waiting.shift();
|
|
88
|
+
if (next)
|
|
89
|
+
next();
|
|
90
|
+
else if (state.active === 0)
|
|
91
|
+
s.unref();
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
let nodeHttp2;
|
|
95
|
+
function loadNode() {
|
|
96
|
+
var _a;
|
|
97
|
+
if (!nodeHttp2) {
|
|
98
|
+
const versions = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.versions;
|
|
99
|
+
const isNode = !!(versions === null || versions === void 0 ? void 0 : versions.node) && !versions.bun && typeof globalThis.Deno === 'undefined';
|
|
100
|
+
// A variable, not a literal: a browser bundler must not try to resolve it.
|
|
101
|
+
const h2 = 'node:http2';
|
|
102
|
+
nodeHttp2 = isNode
|
|
103
|
+
? Promise.resolve(`${h2}`).then(s => __importStar(require(s))).catch(() => null)
|
|
104
|
+
: Promise.resolve(null);
|
|
105
|
+
}
|
|
106
|
+
return nodeHttp2;
|
|
107
|
+
}
|
|
108
|
+
function session(origin, http2) {
|
|
109
|
+
const open = sessions.get(origin);
|
|
110
|
+
if (open)
|
|
111
|
+
return open;
|
|
112
|
+
const pending = new Promise((resolve) => {
|
|
113
|
+
let s;
|
|
114
|
+
try {
|
|
115
|
+
s = http2.connect(origin);
|
|
116
|
+
}
|
|
117
|
+
catch (_a) {
|
|
118
|
+
resolve(null);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const drop = () => { if (sessions.get(origin) === pending)
|
|
122
|
+
sessions.delete(origin); };
|
|
123
|
+
s.once('connect', () => {
|
|
124
|
+
// An origin that answered without h2 never gets here: the TLS layer fails the connect.
|
|
125
|
+
s.unref(); // an idle shared connection must not keep the process alive
|
|
126
|
+
resolve(s);
|
|
127
|
+
});
|
|
128
|
+
// `on`, not `once`: a session can emit more than one error, and an unhandled one kills the process.
|
|
129
|
+
s.on('error', () => { drop(); resolve(null); });
|
|
130
|
+
s.once('close', drop);
|
|
131
|
+
s.once('goaway', drop);
|
|
132
|
+
});
|
|
133
|
+
sessions.set(origin, pending);
|
|
134
|
+
return pending;
|
|
135
|
+
}
|
|
136
|
+
function sendableBody(body) {
|
|
137
|
+
if (body == null)
|
|
138
|
+
return null;
|
|
139
|
+
if (typeof body === 'string')
|
|
140
|
+
return body;
|
|
141
|
+
if (body instanceof Uint8Array)
|
|
142
|
+
return body;
|
|
143
|
+
if (body instanceof ArrayBuffer)
|
|
144
|
+
return new Uint8Array(body);
|
|
145
|
+
if (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
|
|
146
|
+
return body.toString();
|
|
147
|
+
return undefined; // FormData, Blob, streams: the global fetch encodes these
|
|
148
|
+
}
|
|
149
|
+
const HOP_BY_HOP = new Set(['connection', 'host', 'keep-alive', 'proxy-connection', 'transfer-encoding', 'upgrade']);
|
|
150
|
+
async function http2Fetch(input, init = {}) {
|
|
151
|
+
const url = new URL(typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
|
|
152
|
+
const body = sendableBody(init.body);
|
|
153
|
+
const node = await loadNode();
|
|
154
|
+
const isRequest = typeof input !== 'string' && !(input instanceof URL);
|
|
155
|
+
if (!node || isRequest || body === undefined || url.protocol !== 'https:' || http1Only.has(url.origin)) {
|
|
156
|
+
return fetch(input, init);
|
|
157
|
+
}
|
|
158
|
+
const s = await session(url.origin, node);
|
|
159
|
+
if (!s || s.closed || s.destroyed) {
|
|
160
|
+
if (!s)
|
|
161
|
+
http1Only.add(url.origin);
|
|
162
|
+
return fetch(input, init);
|
|
163
|
+
}
|
|
164
|
+
const headers = { ':method': (init.method || 'GET').toUpperCase(), ':path': url.pathname + url.search };
|
|
165
|
+
new Headers(init.headers).forEach((value, key) => { if (!HOP_BY_HOP.has(key))
|
|
166
|
+
headers[key] = value; });
|
|
167
|
+
const signal = init.signal;
|
|
168
|
+
const aborted = () => { var _a; return (_a = signal.reason) !== null && _a !== void 0 ? _a : new DOMException('This operation was aborted', 'AbortError'); };
|
|
169
|
+
const release = await streamSlot(s, signal);
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
172
|
+
release();
|
|
173
|
+
reject(aborted());
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
let req;
|
|
177
|
+
try {
|
|
178
|
+
req = s.request(headers, { endStream: body === null });
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
// The connection closed (GOAWAY) while this call waited for a stream.
|
|
182
|
+
release();
|
|
183
|
+
reject(e);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const onAbort = () => { req.close(); reject(aborted()); };
|
|
187
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', onAbort, { once: true });
|
|
188
|
+
req.once('close', () => { release(); signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', onAbort); });
|
|
189
|
+
req.on('error', reject); // after the response this errors its body stream; a no-op here
|
|
190
|
+
req.once('response', (h) => {
|
|
191
|
+
const status = Number(h[':status']);
|
|
192
|
+
const out = new Headers();
|
|
193
|
+
for (const [k, v] of Object.entries(h)) {
|
|
194
|
+
if (k.startsWith(':') || v === undefined)
|
|
195
|
+
continue;
|
|
196
|
+
for (const one of Array.isArray(v) ? v : [v])
|
|
197
|
+
out.append(k, String(one));
|
|
198
|
+
}
|
|
199
|
+
const empty = status === 204 || status === 205 || status === 304 || headers[':method'] === 'HEAD';
|
|
200
|
+
if (empty)
|
|
201
|
+
req.resume();
|
|
202
|
+
// Fed from 'data' events, not Readable.toWeb: an HTTP/2 stream the server has
|
|
203
|
+
// already closed is destroyed with its unread data, and toWeb's backpressure
|
|
204
|
+
// turned that into "Premature close" on 25 of 250 calls (prod, 2026-10-08).
|
|
205
|
+
// A slow reader (streamCommand between frames) must not let a fast command
|
|
206
|
+
// fill memory: past 4 MiB unread the stream pauses until the reader pulls.
|
|
207
|
+
const bodyStream = empty ? null : new ReadableStream({
|
|
208
|
+
start(controller) {
|
|
209
|
+
req.on('data', (chunk) => {
|
|
210
|
+
var _a;
|
|
211
|
+
controller.enqueue(new Uint8Array(chunk));
|
|
212
|
+
if (((_a = controller.desiredSize) !== null && _a !== void 0 ? _a : 1) <= 0)
|
|
213
|
+
req.pause();
|
|
214
|
+
});
|
|
215
|
+
req.once('end', () => controller.close());
|
|
216
|
+
req.once('error', (e) => controller.error(e));
|
|
217
|
+
req.once('close', () => {
|
|
218
|
+
if (!req.readableEnded) {
|
|
219
|
+
try {
|
|
220
|
+
controller.error(new Error(`HTTP/2 stream closed before its end (code ${req.rstCode})`));
|
|
221
|
+
}
|
|
222
|
+
catch (_a) { }
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
pull() { if (req.isPaused())
|
|
227
|
+
req.resume(); },
|
|
228
|
+
cancel() { req.close(); },
|
|
229
|
+
}, { 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; } });
|
|
230
|
+
const response = new Response(bodyStream, { status, headers: out });
|
|
231
|
+
// Response.url is read-only; the generated client never reads it, but keep it right.
|
|
232
|
+
Object.defineProperty(response, 'url', { value: url.href });
|
|
233
|
+
resolve(response);
|
|
234
|
+
});
|
|
235
|
+
if (body !== null)
|
|
236
|
+
req.end(body);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
exports.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
|
*/
|
|
@@ -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
|
/**
|
|
@@ -25,7 +25,8 @@ exports.CreateSandboxRequestToJSONTyped = CreateSandboxRequestToJSONTyped;
|
|
|
25
25
|
exports.CreateSandboxRequestTypeEnum = {
|
|
26
26
|
Small: 'small',
|
|
27
27
|
Default: 'default',
|
|
28
|
-
Large: 'large'
|
|
28
|
+
Large: 'large',
|
|
29
|
+
Xlarge: 'xlarge'
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
32
|
* Check if a given object implements the CreateSandboxRequest interface.
|
|
@@ -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
|
/**
|
|
@@ -25,7 +25,8 @@ exports.ForkRequestToJSONTyped = ForkRequestToJSONTyped;
|
|
|
25
25
|
exports.ForkRequestTypeEnum = {
|
|
26
26
|
Small: 'small',
|
|
27
27
|
Default: 'default',
|
|
28
|
-
Large: 'large'
|
|
28
|
+
Large: 'large',
|
|
29
|
+
Xlarge: 'xlarge'
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
32
|
* Check if a given object implements the ForkRequest interface.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boat Public API v1
|
|
3
|
+
* 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.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Recover200Response
|
|
16
|
+
*/
|
|
17
|
+
export interface Recover200Response {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
* @memberof Recover200Response
|
|
22
|
+
*/
|
|
23
|
+
ok?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof Recover200Response
|
|
28
|
+
*/
|
|
29
|
+
type?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Recover200ResponseStatusEnum}
|
|
33
|
+
* @memberof Recover200Response
|
|
34
|
+
*/
|
|
35
|
+
status?: Recover200ResponseStatusEnum;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Recover200Response
|
|
40
|
+
*/
|
|
41
|
+
message?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export declare const Recover200ResponseStatusEnum: {
|
|
47
|
+
readonly Recovering: 'recovering';
|
|
48
|
+
};
|
|
49
|
+
export type Recover200ResponseStatusEnum = typeof Recover200ResponseStatusEnum[keyof typeof Recover200ResponseStatusEnum];
|
|
50
|
+
/**
|
|
51
|
+
* Check if a given object implements the Recover200Response interface.
|
|
52
|
+
*/
|
|
53
|
+
export declare function instanceOfRecover200Response(value: object): value is Recover200Response;
|
|
54
|
+
export declare function Recover200ResponseFromJSON(json: any): Recover200Response;
|
|
55
|
+
export declare function Recover200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Recover200Response;
|
|
56
|
+
export declare function Recover200ResponseToJSON(json: any): Recover200Response;
|
|
57
|
+
export declare function Recover200ResponseToJSONTyped(value?: Recover200Response | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Boat Public API v1
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Recover200ResponseStatusEnum = void 0;
|
|
17
|
+
exports.instanceOfRecover200Response = instanceOfRecover200Response;
|
|
18
|
+
exports.Recover200ResponseFromJSON = Recover200ResponseFromJSON;
|
|
19
|
+
exports.Recover200ResponseFromJSONTyped = Recover200ResponseFromJSONTyped;
|
|
20
|
+
exports.Recover200ResponseToJSON = Recover200ResponseToJSON;
|
|
21
|
+
exports.Recover200ResponseToJSONTyped = Recover200ResponseToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.Recover200ResponseStatusEnum = {
|
|
26
|
+
Recovering: 'recovering'
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Check if a given object implements the Recover200Response interface.
|
|
30
|
+
*/
|
|
31
|
+
function instanceOfRecover200Response(value) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
function Recover200ResponseFromJSON(json) {
|
|
35
|
+
return Recover200ResponseFromJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
function Recover200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
38
|
+
if (json == null) {
|
|
39
|
+
return json;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'ok': json['ok'] == null ? undefined : json['ok'],
|
|
43
|
+
'type': json['type'] == null ? undefined : json['type'],
|
|
44
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
45
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function Recover200ResponseToJSON(json) {
|
|
49
|
+
return Recover200ResponseToJSONTyped(json, false);
|
|
50
|
+
}
|
|
51
|
+
function Recover200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
'ok': value['ok'],
|
|
57
|
+
'type': value['type'],
|
|
58
|
+
'status': value['status'],
|
|
59
|
+
'message': value['message'],
|
|
60
|
+
};
|
|
61
|
+
}
|