@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.
Files changed (91) hide show
  1. package/.openapi-generator/FILES +12 -0
  2. package/dist/apis/BoatApi.d.ts +102 -4
  3. package/dist/apis/BoatApi.js +233 -4
  4. package/dist/esm/apis/BoatApi.d.ts +102 -4
  5. package/dist/esm/apis/BoatApi.js +233 -4
  6. package/dist/esm/http2-fetch.d.ts +1 -0
  7. package/dist/esm/http2-fetch.js +203 -0
  8. package/dist/esm/models/CreateSandboxRequest.d.ts +4 -3
  9. package/dist/esm/models/CreateSandboxRequest.js +2 -1
  10. package/dist/esm/models/ForkRequest.d.ts +2 -1
  11. package/dist/esm/models/ForkRequest.js +2 -1
  12. package/dist/esm/models/NamedSnapshotShare.d.ts +76 -0
  13. package/dist/esm/models/NamedSnapshotShare.js +74 -0
  14. package/dist/esm/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  15. package/dist/esm/models/NamedSnapshotShareCreatedResponse.js +66 -0
  16. package/dist/esm/models/NamedSnapshotShareListResponse.d.ts +58 -0
  17. package/dist/esm/models/NamedSnapshotShareListResponse.js +62 -0
  18. package/dist/esm/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  19. package/dist/esm/models/NamedSnapshotShareRevokedResponse.js +62 -0
  20. package/dist/esm/models/Recover200Response.d.ts +57 -0
  21. package/dist/esm/models/Recover200Response.js +53 -0
  22. package/dist/esm/models/ResumeRequest.d.ts +2 -1
  23. package/dist/esm/models/ResumeRequest.js +2 -1
  24. package/dist/esm/models/Sandbox.d.ts +2 -1
  25. package/dist/esm/models/Sandbox.js +2 -1
  26. package/dist/esm/models/SandboxUsageResponse.d.ts +2 -1
  27. package/dist/esm/models/SandboxUsageResponse.js +2 -1
  28. package/dist/esm/models/StopOperation.d.ts +1 -1
  29. package/dist/esm/models/StopOperationResponse.d.ts +58 -0
  30. package/dist/esm/models/StopOperationResponse.js +62 -0
  31. package/dist/esm/models/StopRequest.d.ts +1 -1
  32. package/dist/esm/models/UpdateSandboxRequest.d.ts +1 -1
  33. package/dist/esm/models/index.d.ts +6 -0
  34. package/dist/esm/models/index.js +6 -0
  35. package/dist/esm/runtime.js +2 -1
  36. package/dist/http2-fetch.d.ts +1 -0
  37. package/dist/http2-fetch.js +239 -0
  38. package/dist/models/CreateSandboxRequest.d.ts +4 -3
  39. package/dist/models/CreateSandboxRequest.js +2 -1
  40. package/dist/models/ForkRequest.d.ts +2 -1
  41. package/dist/models/ForkRequest.js +2 -1
  42. package/dist/models/NamedSnapshotShare.d.ts +76 -0
  43. package/dist/models/NamedSnapshotShare.js +82 -0
  44. package/dist/models/NamedSnapshotShareCreatedResponse.d.ts +64 -0
  45. package/dist/models/NamedSnapshotShareCreatedResponse.js +74 -0
  46. package/dist/models/NamedSnapshotShareListResponse.d.ts +58 -0
  47. package/dist/models/NamedSnapshotShareListResponse.js +70 -0
  48. package/dist/models/NamedSnapshotShareRevokedResponse.d.ts +58 -0
  49. package/dist/models/NamedSnapshotShareRevokedResponse.js +70 -0
  50. package/dist/models/Recover200Response.d.ts +57 -0
  51. package/dist/models/Recover200Response.js +61 -0
  52. package/dist/models/ResumeRequest.d.ts +2 -1
  53. package/dist/models/ResumeRequest.js +2 -1
  54. package/dist/models/Sandbox.d.ts +2 -1
  55. package/dist/models/Sandbox.js +2 -1
  56. package/dist/models/SandboxUsageResponse.d.ts +2 -1
  57. package/dist/models/SandboxUsageResponse.js +2 -1
  58. package/dist/models/StopOperation.d.ts +1 -1
  59. package/dist/models/StopOperationResponse.d.ts +58 -0
  60. package/dist/models/StopOperationResponse.js +70 -0
  61. package/dist/models/StopRequest.d.ts +1 -1
  62. package/dist/models/UpdateSandboxRequest.d.ts +1 -1
  63. package/dist/models/index.d.ts +6 -0
  64. package/dist/models/index.js +6 -0
  65. package/dist/runtime.js +9 -8
  66. package/docs/BoatApi.md +385 -2
  67. package/docs/NamedSnapshotShare.md +45 -0
  68. package/docs/NamedSnapshotShareCreatedResponse.md +40 -0
  69. package/docs/NamedSnapshotShareListResponse.md +38 -0
  70. package/docs/NamedSnapshotShareRevokedResponse.md +38 -0
  71. package/docs/Recover200Response.md +38 -0
  72. package/docs/StopOperationResponse.md +38 -0
  73. package/package.json +1 -1
  74. package/src/apis/BoatApi.ts +348 -4
  75. package/src/http2-fetch.ts +179 -0
  76. package/src/models/CreateSandboxRequest.ts +5 -4
  77. package/src/models/ForkRequest.ts +3 -2
  78. package/src/models/NamedSnapshotShare.ts +131 -0
  79. package/src/models/NamedSnapshotShareCreatedResponse.ts +120 -0
  80. package/src/models/NamedSnapshotShareListResponse.ts +111 -0
  81. package/src/models/NamedSnapshotShareRevokedResponse.ts +111 -0
  82. package/src/models/Recover200Response.ts +99 -0
  83. package/src/models/ResumeRequest.ts +3 -2
  84. package/src/models/Sandbox.ts +3 -2
  85. package/src/models/SandboxUsageResponse.ts +3 -2
  86. package/src/models/StopOperation.ts +1 -1
  87. package/src/models/StopOperationResponse.ts +111 -0
  88. package/src/models/StopRequest.ts +1 -1
  89. package/src/models/UpdateSandboxRequest.ts +1 -1
  90. package/src/models/index.ts +6 -0
  91. package/src/runtime.ts +2 -1
@@ -42,7 +42,8 @@ export const SandboxHealthEnum = {
42
42
  export const SandboxTypeEnum = {
43
43
  Small: 'small',
44
44
  Default: 'default',
45
- Large: 'large'
45
+ Large: 'large',
46
+ Xlarge: 'xlarge'
46
47
  };
47
48
  /**
48
49
  * @export
@@ -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 2 for `large`.
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
  /**
@@ -17,7 +17,8 @@
17
17
  export const SandboxUsageResponseSandboxTypeEnum = {
18
18
  Small: 'small',
19
19
  Default: 'default',
20
- Large: 'large'
20
+ Large: 'large',
21
+ Xlarge: 'xlarge'
21
22
  };
22
23
  /**
23
24
  * Check if a given object implements the SandboxUsageResponse interface.
@@ -28,7 +28,7 @@ export interface StopOperation {
28
28
  */
29
29
  status: StopOperationStatusEnum;
30
30
  /**
31
- * When the stop was accepted. Null once it has ended.
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. Everything written since the last successful snapshot 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.
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 archival TTL. `null` disables auto-stop.
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
  */
@@ -63,6 +63,10 @@ export * from './NamedSnapshotInfoResponse';
63
63
  export * from './NamedSnapshotListResponse';
64
64
  export * from './NamedSnapshotSaveRequest';
65
65
  export * from './NamedSnapshotSavingResponse';
66
+ export * from './NamedSnapshotShare';
67
+ export * from './NamedSnapshotShareCreatedResponse';
68
+ export * from './NamedSnapshotShareListResponse';
69
+ export * from './NamedSnapshotShareRevokedResponse';
66
70
  export * from './Org';
67
71
  export * from './OrgListResponse';
68
72
  export * from './PageInfo';
@@ -74,6 +78,7 @@ export * from './PromptRequest';
74
78
  export * from './PromptResponse';
75
79
  export * from './PromptRun';
76
80
  export * from './PromptRunResponse';
81
+ export * from './Recover200Response';
77
82
  export * from './RepoSelectionRequest';
78
83
  export * from './RepoSelectionResponse';
79
84
  export * from './ReposResponse';
@@ -117,6 +122,7 @@ export * from './SteerEventData';
117
122
  export * from './SteerRequest';
118
123
  export * from './SteerResponse';
119
124
  export * from './StopOperation';
125
+ export * from './StopOperationResponse';
120
126
  export * from './StopRequest';
121
127
  export * from './SuccessBase';
122
128
  export * from './UnknownEvent';
@@ -65,6 +65,10 @@ export * from './NamedSnapshotInfoResponse';
65
65
  export * from './NamedSnapshotListResponse';
66
66
  export * from './NamedSnapshotSaveRequest';
67
67
  export * from './NamedSnapshotSavingResponse';
68
+ export * from './NamedSnapshotShare';
69
+ export * from './NamedSnapshotShareCreatedResponse';
70
+ export * from './NamedSnapshotShareListResponse';
71
+ export * from './NamedSnapshotShareRevokedResponse';
68
72
  export * from './Org';
69
73
  export * from './OrgListResponse';
70
74
  export * from './PageInfo';
@@ -76,6 +80,7 @@ export * from './PromptRequest';
76
80
  export * from './PromptResponse';
77
81
  export * from './PromptRun';
78
82
  export * from './PromptRunResponse';
83
+ export * from './Recover200Response';
79
84
  export * from './RepoSelectionRequest';
80
85
  export * from './RepoSelectionResponse';
81
86
  export * from './ReposResponse';
@@ -119,6 +124,7 @@ export * from './SteerEventData';
119
124
  export * from './SteerRequest';
120
125
  export * from './SteerResponse';
121
126
  export * from './StopOperation';
127
+ export * from './StopOperationResponse';
122
128
  export * from './StopRequest';
123
129
  export * from './SuccessBase';
124
130
  export * from './UnknownEvent';
@@ -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 || fetch)(fetchParams.url, fetchParams.init);
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
  */
@@ -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
  /**
@@ -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,76 @@
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
+ * A share code for a named snapshot. Any Boat account that holds the code can create a sandbox from the snapshot. Boat stores only a hash of the code. The full code is in the create response only.
14
+ * @export
15
+ * @interface NamedSnapshotShare
16
+ */
17
+ export interface NamedSnapshotShare {
18
+ /**
19
+ * Share id, for example `shr_...`. Pass it to revoke the code.
20
+ * @type {string}
21
+ * @memberof NamedSnapshotShare
22
+ */
23
+ id: string;
24
+ /**
25
+ * The first characters of the code, for example `bsh_xxxxxxxx`. Use it to tell codes apart.
26
+ * @type {string}
27
+ * @memberof NamedSnapshotShare
28
+ */
29
+ codePrefix: string;
30
+ /**
31
+ *
32
+ * @type {NamedSnapshotShareStatusEnum}
33
+ * @memberof NamedSnapshotShare
34
+ */
35
+ status: NamedSnapshotShareStatusEnum;
36
+ /**
37
+ * Number of sandboxes created with this code.
38
+ * @type {number}
39
+ * @memberof NamedSnapshotShare
40
+ */
41
+ useCount: number;
42
+ /**
43
+ * When a sandbox was last created with this code. null if never.
44
+ * @type {Date}
45
+ * @memberof NamedSnapshotShare
46
+ */
47
+ lastUsedAt: Date | null;
48
+ /**
49
+ * When the code was revoked. null while active.
50
+ * @type {Date}
51
+ * @memberof NamedSnapshotShare
52
+ */
53
+ revokedAt: Date | null;
54
+ /**
55
+ *
56
+ * @type {Date}
57
+ * @memberof NamedSnapshotShare
58
+ */
59
+ createdAt: Date;
60
+ }
61
+ /**
62
+ * @export
63
+ */
64
+ export declare const NamedSnapshotShareStatusEnum: {
65
+ readonly Active: 'active';
66
+ readonly Revoked: 'revoked';
67
+ };
68
+ export type NamedSnapshotShareStatusEnum = typeof NamedSnapshotShareStatusEnum[keyof typeof NamedSnapshotShareStatusEnum];
69
+ /**
70
+ * Check if a given object implements the NamedSnapshotShare interface.
71
+ */
72
+ export declare function instanceOfNamedSnapshotShare(value: object): value is NamedSnapshotShare;
73
+ export declare function NamedSnapshotShareFromJSON(json: any): NamedSnapshotShare;
74
+ export declare function NamedSnapshotShareFromJSONTyped(json: any, ignoreDiscriminator: boolean): NamedSnapshotShare;
75
+ export declare function NamedSnapshotShareToJSON(json: any): NamedSnapshotShare;
76
+ export declare function NamedSnapshotShareToJSONTyped(value?: NamedSnapshotShare | null, ignoreDiscriminator?: boolean): any;