@molecule/api-code-sandbox-flyio 1.0.18 → 1.1.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/README.md +79 -19
- package/dist/api.d.ts +5 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +11 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +200 -8
- package/dist/types.d.ts +35 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-08-
|
|
6
|
+
Generated: 2026-08-16T01:24:44.152Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-code-sandbox-flyio
|
|
@@ -133,6 +133,30 @@ interface FlyApiClientOptions {
|
|
|
133
133
|
}
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
#### `FlyApp`
|
|
137
|
+
|
|
138
|
+
An app as returned by `GET /v1/apps?org_slug=…` (the fields this provider reads).
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
interface FlyApp {
|
|
142
|
+
id?: string
|
|
143
|
+
name: string
|
|
144
|
+
machine_count?: number
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### `FlyAppList`
|
|
149
|
+
|
|
150
|
+
Response body of `GET /v1/apps?org_slug=…`.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
interface FlyAppList {
|
|
154
|
+
/** Total apps in the org, which the returned page may not cover. */
|
|
155
|
+
total_apps?: number
|
|
156
|
+
apps?: FlyApp[]
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
136
160
|
#### `FlyExecResponse`
|
|
137
161
|
|
|
138
162
|
Response body of `POST /v1/apps/{app}/machines/{id}/exec` (`flydv1.ExecResponse`).
|
|
@@ -244,10 +268,13 @@ interface FlyioConfig {
|
|
|
244
268
|
*/
|
|
245
269
|
publicService?: boolean
|
|
246
270
|
/**
|
|
247
|
-
* Fly Proxy idle behaviour for the preview service. `
|
|
248
|
-
*
|
|
249
|
-
* idle
|
|
250
|
-
*
|
|
271
|
+
* Fly Proxy idle behaviour for the preview service. Defaults to `'off'` —
|
|
272
|
+
* never idle the Machine — because the autostop timer counts the PROXY
|
|
273
|
+
* service's idle time, not the workload's, so a sandbox with nobody looking at
|
|
274
|
+
* its preview is suspended out from under a build that is still running.
|
|
275
|
+
* `suspend` is the scale-to-zero mapping (resume from a memory snapshot on the
|
|
276
|
+
* next request) and `stop` is a full stop with a cold boot on wake; opt into
|
|
277
|
+
* either deliberately.
|
|
251
278
|
*/
|
|
252
279
|
autostop?: 'off' | 'stop' | 'suspend'
|
|
253
280
|
/**
|
|
@@ -264,9 +291,12 @@ interface FlyioConfig {
|
|
|
264
291
|
/** Timeout for a single Machines API request, in ms. Defaults to 30000. */
|
|
265
292
|
requestTimeoutMs?: number
|
|
266
293
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
294
|
+
* TOTAL budget, in seconds, that `create()`/`start()`/`wake()` block waiting
|
|
295
|
+
* for the Machine to actually reach `started`. Fly's `GET .../wait` blocks
|
|
296
|
+
* for at most 60 seconds per call, so a larger budget is spent as consecutive
|
|
297
|
+
* wait rounds. Defaults to 180 — a Machine whose image is not yet cached on
|
|
298
|
+
* its host (every first boot after an image push) pulls it before starting,
|
|
299
|
+
* and that alone can exceed a single 60 s round.
|
|
270
300
|
*
|
|
271
301
|
* Without this wait, `start()` resolves the moment Fly ACCEPTS the request,
|
|
272
302
|
* and the caller's very next `exec` hits a Machine that is not running yet.
|
|
@@ -449,6 +479,14 @@ interface FlyMachine {
|
|
|
449
479
|
region?: string
|
|
450
480
|
private_ip?: string
|
|
451
481
|
config?: FlyMachineConfig
|
|
482
|
+
/** RFC 3339 creation time, as Fly reports it. */
|
|
483
|
+
created_at?: string
|
|
484
|
+
/**
|
|
485
|
+
* Lifecycle events, newest first. The ONLY place Fly records when a Machine
|
|
486
|
+
* was first started — there is no `started_at` field — which is what
|
|
487
|
+
* distinguishes a stopped Machine from one that was created and never ran.
|
|
488
|
+
*/
|
|
489
|
+
events?: FlyMachineEvent[]
|
|
452
490
|
}
|
|
453
491
|
```
|
|
454
492
|
|
|
@@ -470,6 +508,20 @@ interface FlyMachineConfig {
|
|
|
470
508
|
}
|
|
471
509
|
```
|
|
472
510
|
|
|
511
|
+
#### `FlyMachineEvent`
|
|
512
|
+
|
|
513
|
+
One entry of {@link FlyMachine.events}.
|
|
514
|
+
|
|
515
|
+
```typescript
|
|
516
|
+
interface FlyMachineEvent {
|
|
517
|
+
/** `start`, `launch`, `exit`, … */
|
|
518
|
+
type?: string
|
|
519
|
+
status?: string
|
|
520
|
+
/** Epoch milliseconds. */
|
|
521
|
+
timestamp?: number
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
473
525
|
#### `FlyMachineService`
|
|
474
526
|
|
|
475
527
|
A Fly Proxy service attached to a Machine (`fly.MachineService`).
|
|
@@ -855,11 +907,9 @@ type RawExec = (command: string[], timeoutSeconds: number) => Promise<FlyExecRes
|
|
|
855
907
|
|
|
856
908
|
#### `FlyApiClient`
|
|
857
909
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
generated client would drag in the whole Machines + Postgres + tokens surface
|
|
862
|
-
for no benefit.
|
|
910
|
+
Minimal Fly Machines API client: bearer auth, JSON bodies, per-request
|
|
911
|
+
timeout, bounded retries with backoff, and account-wide request pacing via
|
|
912
|
+
{@link paceFlyRequest}.
|
|
863
913
|
|
|
864
914
|
#### `FlyApiError`
|
|
865
915
|
|
|
@@ -1520,6 +1570,14 @@ function requireStore(ctx: TemplateContext): ObjectStore
|
|
|
1520
1570
|
|
|
1521
1571
|
**Returns:** The configured store.
|
|
1522
1572
|
|
|
1573
|
+
#### `resetFlyPacerForTests()`
|
|
1574
|
+
|
|
1575
|
+
Test-only: reset the shared pacer so timing tests start from a clean slate.
|
|
1576
|
+
|
|
1577
|
+
```typescript
|
|
1578
|
+
function resetFlyPacerForTests(): void
|
|
1579
|
+
```
|
|
1580
|
+
|
|
1523
1581
|
#### `resolveTemplateStorage(config)`
|
|
1524
1582
|
|
|
1525
1583
|
Resolves template-storage settings from config and the environment.
|
|
@@ -2169,12 +2227,14 @@ live, and any failure to LIST or read the store throws rather than reporting
|
|
|
2169
2227
|
exist for providers whose templates are host-local; object storage is already
|
|
2170
2228
|
the shared store, so there is nothing to publish or fetch.
|
|
2171
2229
|
|
|
2172
|
-
**`
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2230
|
+
**`importFiles` IS implemented; `exportFiles` is not.** Import takes the same
|
|
2231
|
+
route the template restore does — a presigned object-store URL the Machine
|
|
2232
|
+
pulls itself, falling back to chunked base64 over `exec` when no store is
|
|
2233
|
+
configured — so an app tree can be delivered into a fresh Machine. There is no
|
|
2234
|
+
inverse: Fly's only read channel is the `exec` endpoint's JSON response, and a
|
|
2235
|
+
base64 emulation of a whole-tree export would look supported and route every
|
|
2236
|
+
byte through the control plane. Pair a Fly destination with a source that CAN
|
|
2237
|
+
export (the core's rooting contract makes them interchangeable).
|
|
2178
2238
|
|
|
2179
2239
|
**Sandbox ids are composite: `"<app>:<machineId>"`.** A Fly Machine id is only
|
|
2180
2240
|
unique within its app and every endpoint is `/v1/apps/{app}/machines/{id}`, so
|
package/dist/api.d.ts
CHANGED
|
@@ -115,6 +115,11 @@ export interface FlyApiClientOptions {
|
|
|
115
115
|
}
|
|
116
116
|
/** Test-only: reset the shared pacer so timing tests start from a clean slate. */
|
|
117
117
|
export declare function resetFlyPacerForTests(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Minimal Fly Machines API client: bearer auth, JSON bodies, per-request
|
|
120
|
+
* timeout, bounded retries with backoff, and account-wide request pacing via
|
|
121
|
+
* {@link paceFlyRequest}.
|
|
122
|
+
*/
|
|
118
123
|
export declare class FlyApiClient {
|
|
119
124
|
private readonly token;
|
|
120
125
|
private readonly baseUrl;
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAgBH;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;;;;;;OAOG;gBAED,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAgBhC;AAED,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;;;;OA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AAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;IAErD;;;OAGG;gBACS,OAAO,EAAE,mBAAmB;IASxC;;;;;;;;;;OAUG;IACG,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAiFnF"}
|
package/dist/api.js
CHANGED
|
@@ -145,6 +145,12 @@ function minRequestGapMs() {
|
|
|
145
145
|
*/
|
|
146
146
|
let flyPacerTail = Promise.resolve();
|
|
147
147
|
let flyLastRequestAt = 0;
|
|
148
|
+
/**
|
|
149
|
+
* Queues the caller behind the shared pacer chain and resolves once its slot
|
|
150
|
+
* arrives (at least {@link MIN_REQUEST_GAP_MS} after the previous request).
|
|
151
|
+
* @param sleep - Injected sleep, so tests can collapse the waits.
|
|
152
|
+
* @returns Resolves when the caller may fire its request.
|
|
153
|
+
*/
|
|
148
154
|
function paceFlyRequest(sleep) {
|
|
149
155
|
const mine = flyPacerTail.then(async () => {
|
|
150
156
|
const wait = Math.max(0, flyLastRequestAt + minRequestGapMs() - Date.now());
|
|
@@ -160,6 +166,11 @@ export function resetFlyPacerForTests() {
|
|
|
160
166
|
flyPacerTail = Promise.resolve();
|
|
161
167
|
flyLastRequestAt = 0;
|
|
162
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Minimal Fly Machines API client: bearer auth, JSON bodies, per-request
|
|
171
|
+
* timeout, bounded retries with backoff, and account-wide request pacing via
|
|
172
|
+
* {@link paceFlyRequest}.
|
|
173
|
+
*/
|
|
163
174
|
export class FlyApiClient {
|
|
164
175
|
token;
|
|
165
176
|
baseUrl;
|
package/dist/index.d.ts
CHANGED
|
@@ -281,12 +281,14 @@
|
|
|
281
281
|
* exist for providers whose templates are host-local; object storage is already
|
|
282
282
|
* the shared store, so there is nothing to publish or fetch.
|
|
283
283
|
*
|
|
284
|
-
* **`
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
284
|
+
* **`importFiles` IS implemented; `exportFiles` is not.** Import takes the same
|
|
285
|
+
* route the template restore does — a presigned object-store URL the Machine
|
|
286
|
+
* pulls itself, falling back to chunked base64 over `exec` when no store is
|
|
287
|
+
* configured — so an app tree can be delivered into a fresh Machine. There is no
|
|
288
|
+
* inverse: Fly's only read channel is the `exec` endpoint's JSON response, and a
|
|
289
|
+
* base64 emulation of a whole-tree export would look supported and route every
|
|
290
|
+
* byte through the control plane. Pair a Fly destination with a source that CAN
|
|
291
|
+
* export (the core's rooting contract makes them interchangeable).
|
|
290
292
|
*
|
|
291
293
|
* **Sandbox ids are composite: `"<app>:<machineId>"`.** A Fly Machine id is only
|
|
292
294
|
* unique within its app and every endpoint is `/v1/apps/{app}/machines/{id}`, so
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0UG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAMjE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,eAUrB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -281,12 +281,14 @@
|
|
|
281
281
|
* exist for providers whose templates are host-local; object storage is already
|
|
282
282
|
* the shared store, so there is nothing to publish or fetch.
|
|
283
283
|
*
|
|
284
|
-
* **`
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
284
|
+
* **`importFiles` IS implemented; `exportFiles` is not.** Import takes the same
|
|
285
|
+
* route the template restore does — a presigned object-store URL the Machine
|
|
286
|
+
* pulls itself, falling back to chunked base64 over `exec` when no store is
|
|
287
|
+
* configured — so an app tree can be delivered into a fresh Machine. There is no
|
|
288
|
+
* inverse: Fly's only read channel is the `exec` endpoint's JSON response, and a
|
|
289
|
+
* base64 emulation of a whole-tree export would look supported and route every
|
|
290
|
+
* byte through the control plane. Pair a Fly destination with a source that CAN
|
|
291
|
+
* export (the core's rooting contract makes them interchangeable).
|
|
290
292
|
*
|
|
291
293
|
* **Sandbox ids are composite: `"<app>:<machineId>"`.** A Fly Machine id is only
|
|
292
294
|
* unique within its app and every endpoint is `/v1/apps/{app}/machines/{id}`, so
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAWV,eAAe,EAGhB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAgC,MAAM,UAAU,CAAA;AAsBrE,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAEhG,OAAO,KAAK,EAIV,WAAW,EAUZ,MAAM,YAAY,CAAA;AA6oEnB;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,CAAC,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,YAAY,EACrB,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,GACzB,eAAe,CAEjB"}
|
package/dist/provider.js
CHANGED
|
@@ -41,6 +41,38 @@ const DEFAULT_VOLUME_GB = 10;
|
|
|
41
41
|
const LIST_PAGE_SIZE = 200;
|
|
42
42
|
/** Hard cap on pages fetched while listing, so a bad cursor cannot loop forever. */
|
|
43
43
|
const LIST_MAX_PAGES = 50;
|
|
44
|
+
/**
|
|
45
|
+
* Hard cap on how many per-project apps `find()` will walk in one sweep.
|
|
46
|
+
*
|
|
47
|
+
* Requests are paced account-wide (~4.5/s), so enumerating N apps costs N
|
|
48
|
+
* round-trips of wall clock. Past this the sweep is refused OUTRIGHT rather than
|
|
49
|
+
* truncated, because `find()`'s whole contract is that a short answer is never
|
|
50
|
+
* mistaken for an empty one. Raise `FLY_FIND_MAX_APPS` deliberately.
|
|
51
|
+
*/
|
|
52
|
+
const FIND_MAX_APPS = (() => {
|
|
53
|
+
const configured = Number(process.env.FLY_FIND_MAX_APPS);
|
|
54
|
+
return Number.isFinite(configured) && configured > 0 ? configured : 500;
|
|
55
|
+
})();
|
|
56
|
+
/**
|
|
57
|
+
* When a Machine was FIRST started, from its event log.
|
|
58
|
+
*
|
|
59
|
+
* Fly has no `started_at` field; the events array (newest first) is the only
|
|
60
|
+
* record, and its absence is the meaningful case — a Machine created but never
|
|
61
|
+
* started is not "stopped", it is wreckage from an interrupted create that
|
|
62
|
+
* still holds its volume.
|
|
63
|
+
*
|
|
64
|
+
* @param machine - The Machine as Fly reported it.
|
|
65
|
+
* @returns ISO 8601 timestamp of the earliest `start` event, or `null` if it has
|
|
66
|
+
* never started (or Fly sent no events).
|
|
67
|
+
*/
|
|
68
|
+
const firstStartedAt = (machine) => {
|
|
69
|
+
const starts = (machine.events ?? [])
|
|
70
|
+
.filter((event) => event.type === 'start' && typeof event.timestamp === 'number')
|
|
71
|
+
.map((event) => event.timestamp);
|
|
72
|
+
if (!starts.length)
|
|
73
|
+
return null;
|
|
74
|
+
return new Date(Math.min(...starts)).toISOString();
|
|
75
|
+
};
|
|
44
76
|
/**
|
|
45
77
|
* Chunk size for base64-encoded `writeFile` payloads. The binding limit is NOT
|
|
46
78
|
* the OS `MAX_ARG_STRLEN` (128 KB) but Fly's exec API, which silently rejects a
|
|
@@ -204,6 +236,16 @@ class FlyioSandboxProvider {
|
|
|
204
236
|
return this.config.appPerProject;
|
|
205
237
|
return process.env.FLY_SANDBOX_APP_PER_PROJECT !== 'false';
|
|
206
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* The per-project Fly app-name prefix. One resolution shared by app NAMING
|
|
241
|
+
* (`resolveApp`) and app DISCOVERY (`find`), so a sweep can never look for a
|
|
242
|
+
* prefix creation does not use.
|
|
243
|
+
*
|
|
244
|
+
* @returns The configured prefix.
|
|
245
|
+
*/
|
|
246
|
+
appPrefix() {
|
|
247
|
+
return this.config.appPrefix ?? process.env.FLY_SANDBOX_APP_PREFIX ?? DEFAULT_APP_PREFIX;
|
|
248
|
+
}
|
|
207
249
|
/**
|
|
208
250
|
* Resolves the Fly app a project's Machine belongs to.
|
|
209
251
|
*
|
|
@@ -218,7 +260,7 @@ class FlyioSandboxProvider {
|
|
|
218
260
|
*/
|
|
219
261
|
resolveApp(projectId) {
|
|
220
262
|
if (this.appPerProject()) {
|
|
221
|
-
return appNameForProject(this.
|
|
263
|
+
return appNameForProject(this.appPrefix(), projectId);
|
|
222
264
|
}
|
|
223
265
|
const shared = this.config.appName ?? process.env.FLY_SANDBOX_APP;
|
|
224
266
|
if (process.env.NODE_ENV === 'production') {
|
|
@@ -765,8 +807,11 @@ class FlyioSandboxProvider {
|
|
|
765
807
|
}
|
|
766
808
|
// Also resolved BEFORE anything is provisioned: a sandbox told to dial a
|
|
767
809
|
// `.flycast` host nobody declared would boot healthy and then fail to
|
|
768
|
-
// connect inside the user's own application.
|
|
769
|
-
|
|
810
|
+
// connect inside the user's own application. Env the caller delivers itself
|
|
811
|
+
// is checked too — the host is unroutable however the value arrives, and
|
|
812
|
+
// that env is exactly where a control plane puts the values it refuses to
|
|
813
|
+
// leave in a Machine config.
|
|
814
|
+
assertPrivateRoutesForEnv({ ...config.env, ...config.selfDeliveredEnv }, this.privateServices());
|
|
770
815
|
const app = this.resolveApp(config.projectId);
|
|
771
816
|
const privateRoutes = await this.ensureApp(app);
|
|
772
817
|
// Clear any stale Machine from a prior failed/partial create before
|
|
@@ -809,10 +854,19 @@ class FlyioSandboxProvider {
|
|
|
809
854
|
},
|
|
810
855
|
// `no` matches the Docker provider: a sandbox whose main process exits
|
|
811
856
|
// stays stopped for the caller to inspect, rather than silently looping.
|
|
812
|
-
// Fly's default when unset is `on-failure`.
|
|
813
|
-
|
|
857
|
+
// Fly's default when unset is `on-failure`. A caller running something
|
|
858
|
+
// long-lived overrides it (`config.restartPolicy`).
|
|
859
|
+
restart: { policy: config.restartPolicy ?? 'no' },
|
|
814
860
|
auto_destroy: false,
|
|
815
861
|
};
|
|
862
|
+
// The caller's own main process, instead of the image's entrypoint/cmd.
|
|
863
|
+
// Fly's `init.exec` overrides BOTH ("run this instead of the entrypoint and
|
|
864
|
+
// command in your Docker container definition"), which is what a caller
|
|
865
|
+
// asking for a specific pid 1 means. Without it a Machine that Fly restarts
|
|
866
|
+
// — host migration, `fly machine restart`, an OOM kill — comes back running
|
|
867
|
+
// the image's idle command and serving nothing.
|
|
868
|
+
if (config.command?.length)
|
|
869
|
+
machineConfig.init = { exec: [...config.command] };
|
|
816
870
|
if (config.volumeName) {
|
|
817
871
|
metadata[`${this.metadataPrefix}.volumeName`] = config.volumeName;
|
|
818
872
|
const sizeGB = config.resources?.diskMB
|
|
@@ -822,9 +876,7 @@ class FlyioSandboxProvider {
|
|
|
822
876
|
// The caller may scope the volume to a subtree (e.g. /workspace/<appDir>)
|
|
823
877
|
// so regenerable tooling (node_modules) stays on the fast image-backed
|
|
824
878
|
// rootfs and only durable state pays the volume's small-file IO cost.
|
|
825
|
-
machineConfig.mounts = [
|
|
826
|
-
{ volume: volumeId, path: config.volumeMountPath ?? WORKSPACE_PATH },
|
|
827
|
-
];
|
|
879
|
+
machineConfig.mounts = [{ volume: volumeId, path: config.volumeMountPath ?? WORKSPACE_PATH }];
|
|
828
880
|
}
|
|
829
881
|
const service = this.previewService();
|
|
830
882
|
if (service)
|
|
@@ -934,6 +986,146 @@ class FlyioSandboxProvider {
|
|
|
934
986
|
}
|
|
935
987
|
return sandboxes;
|
|
936
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* Find managed sandboxes by what the caller labelled them.
|
|
991
|
+
*
|
|
992
|
+
* The reconciliation counterpart to `list()`: a control plane that restarted
|
|
993
|
+
* asks this which of its recorded sandboxes are still alive, and which live
|
|
994
|
+
* sandboxes no record names. molecule.dev's production sweep is the reason it
|
|
995
|
+
* exists — with no `find()` the sweep returned at its capability check, so a
|
|
996
|
+
* Machine that died stayed recorded as `live` and the edge kept routing to it,
|
|
997
|
+
* while a Machine from a crashed deploy kept running and billing with nothing
|
|
998
|
+
* left to name it.
|
|
999
|
+
*
|
|
1000
|
+
* **Enumeration is by APP, not by the org-wide Machines endpoint.** In
|
|
1001
|
+
* per-project mode each project owns a whole Fly app, so the complete set is
|
|
1002
|
+
* "every app whose name starts with this provider's prefix, and every Machine
|
|
1003
|
+
* in each" — which is exactly answerable. `GET /orgs/{org}/machines` (what
|
|
1004
|
+
* `list()` uses) pages with an advisory limit and a cursor Fly may still be
|
|
1005
|
+
* handing out at the page cap, and a TRUNCATED answer here is worse than no
|
|
1006
|
+
* answer: the caller reads a missing Machine as "gone" and stops routing to a
|
|
1007
|
+
* live one.
|
|
1008
|
+
*
|
|
1009
|
+
* Which is the whole contract of this method — **it throws rather than
|
|
1010
|
+
* returning a short list.** Every failure mode below (no app listing, an
|
|
1011
|
+
* incomplete app listing, more apps than the bound, a machine listing that
|
|
1012
|
+
* errors) is "I could not enumerate", and a recovery loop must never read that
|
|
1013
|
+
* as "there is nothing there".
|
|
1014
|
+
*
|
|
1015
|
+
* `ports` is deliberately always empty: Fly routes to a Machine through its
|
|
1016
|
+
* proxy by HOSTNAME with TLS at the edge, not by a `host:port` forward the
|
|
1017
|
+
* control plane can dial. `getPreviewUrl()` is the address; a `{ host, port }`
|
|
1018
|
+
* pair here would be dialled as plain http on 443.
|
|
1019
|
+
*
|
|
1020
|
+
* @param query - Narrowing by label, status and project. All conditions AND.
|
|
1021
|
+
* @returns A descriptor per matching sandbox.
|
|
1022
|
+
* @throws {Error} When the provider cannot enumerate completely.
|
|
1023
|
+
*/
|
|
1024
|
+
async find(query) {
|
|
1025
|
+
const managedKey = `${this.metadataPrefix}.managed`;
|
|
1026
|
+
const projectIdKey = `${this.metadataPrefix}.projectId`;
|
|
1027
|
+
const volumeNameKey = `${this.metadataPrefix}.volumeName`;
|
|
1028
|
+
const templateIdKey = `${this.metadataPrefix}.templateId`;
|
|
1029
|
+
const apps = await this.appsToEnumerate();
|
|
1030
|
+
const descriptors = [];
|
|
1031
|
+
for (const app of apps) {
|
|
1032
|
+
let machines;
|
|
1033
|
+
try {
|
|
1034
|
+
machines = await this.client.request(`/apps/${app}/machines`, {
|
|
1035
|
+
// A 404 is the app itself being gone — a real absence (it was deleted
|
|
1036
|
+
// between the app listing and this call), not a failed query.
|
|
1037
|
+
nullOn: [404],
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
catch (error) {
|
|
1041
|
+
throw new Error(t('codeSandbox.flyio.error.findFailed', { app }, {
|
|
1042
|
+
defaultValue: `Cannot enumerate Fly sandboxes: listing Machines in app "${app}" failed. ` +
|
|
1043
|
+
'Refusing to report a partial result — a caller reconciling against it would ' +
|
|
1044
|
+
'treat every unseen sandbox as gone.',
|
|
1045
|
+
}), { cause: error });
|
|
1046
|
+
}
|
|
1047
|
+
for (const machine of machines ?? []) {
|
|
1048
|
+
const metadata = machine.config?.metadata ?? {};
|
|
1049
|
+
if (metadata[managedKey] !== 'true')
|
|
1050
|
+
continue;
|
|
1051
|
+
const status = mapMachineState(machine.state ?? 'created');
|
|
1052
|
+
const projectId = metadata[projectIdKey] ?? null;
|
|
1053
|
+
if (query?.projectId && projectId !== query.projectId)
|
|
1054
|
+
continue;
|
|
1055
|
+
if (query?.statuses?.length && !query.statuses.includes(status))
|
|
1056
|
+
continue;
|
|
1057
|
+
if (query?.labels) {
|
|
1058
|
+
let matches = true;
|
|
1059
|
+
for (const [key, value] of Object.entries(query.labels)) {
|
|
1060
|
+
if (metadata[key] !== value) {
|
|
1061
|
+
matches = false;
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
if (!matches)
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
descriptors.push({
|
|
1069
|
+
id: toSandboxId(app, machine.id),
|
|
1070
|
+
projectId,
|
|
1071
|
+
status,
|
|
1072
|
+
// The caller's own labels are in this map verbatim — `create()` merges
|
|
1073
|
+
// them alongside the provider's `<prefix>.*` keys.
|
|
1074
|
+
labels: { ...metadata },
|
|
1075
|
+
createdAt: machine.created_at ?? null,
|
|
1076
|
+
startedAt: firstStartedAt(machine),
|
|
1077
|
+
templateRef: metadata[templateIdKey] ?? machine.config?.image ?? null,
|
|
1078
|
+
volumeName: metadata[volumeNameKey] ?? null,
|
|
1079
|
+
ports: [],
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return descriptors;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* The apps `find()` must look inside — one per project in per-project mode,
|
|
1087
|
+
* the single configured app otherwise.
|
|
1088
|
+
*
|
|
1089
|
+
* Filtering the org's apps by this provider's own prefix is what keeps the
|
|
1090
|
+
* sweep off apps it does not own (the control-plane API, the databases, the
|
|
1091
|
+
* edge proxy), without needing a permission the token may not have.
|
|
1092
|
+
*
|
|
1093
|
+
* @returns Every app name to enumerate.
|
|
1094
|
+
* @throws {Error} When the org's apps cannot be listed completely.
|
|
1095
|
+
*/
|
|
1096
|
+
async appsToEnumerate() {
|
|
1097
|
+
if (!this.appPerProject())
|
|
1098
|
+
return [this.resolveApp('unused')];
|
|
1099
|
+
const org = this.orgSlug();
|
|
1100
|
+
let listing;
|
|
1101
|
+
try {
|
|
1102
|
+
listing = await this.client.request(`/apps?org_slug=${encodeURIComponent(org)}`, {});
|
|
1103
|
+
}
|
|
1104
|
+
catch (error) {
|
|
1105
|
+
throw new Error(t('codeSandbox.flyio.error.appListFailed', { org }, {
|
|
1106
|
+
defaultValue: `Cannot enumerate Fly sandboxes: listing the apps of org "${org}" failed. ` +
|
|
1107
|
+
'Refusing to report a partial result.',
|
|
1108
|
+
}), { cause: error });
|
|
1109
|
+
}
|
|
1110
|
+
const apps = listing?.apps ?? [];
|
|
1111
|
+
const total = listing?.total_apps;
|
|
1112
|
+
if (typeof total === 'number' && apps.length < total) {
|
|
1113
|
+
throw new Error(t('codeSandbox.flyio.error.appListTruncated', { org, returned: String(apps.length), total: String(total) }, {
|
|
1114
|
+
defaultValue: `Fly returned ${apps.length} of ${total} apps for org "${org}" — this listing is ` +
|
|
1115
|
+
'TRUNCATED, so some sandboxes would be missing from the result.',
|
|
1116
|
+
}));
|
|
1117
|
+
}
|
|
1118
|
+
const prefix = `${this.appPrefix()}-`;
|
|
1119
|
+
const owned = apps.map((app) => app.name).filter((name) => name?.startsWith(prefix));
|
|
1120
|
+
if (owned.length > FIND_MAX_APPS) {
|
|
1121
|
+
throw new Error(t('codeSandbox.flyio.error.findTooManyApps', { count: String(owned.length), max: String(FIND_MAX_APPS) }, {
|
|
1122
|
+
defaultValue: `Refusing to enumerate ${owned.length} Fly sandbox apps (cap ${FIND_MAX_APPS}): ` +
|
|
1123
|
+
'requests are paced account-wide, so this sweep would take longer than the caller ' +
|
|
1124
|
+
'can wait. Raise FLY_FIND_MAX_APPS deliberately rather than reading a partial sweep.',
|
|
1125
|
+
}));
|
|
1126
|
+
}
|
|
1127
|
+
return owned;
|
|
1128
|
+
}
|
|
937
1129
|
/**
|
|
938
1130
|
* Destroys a sandbox.
|
|
939
1131
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -104,10 +104,13 @@ export interface FlyioConfig {
|
|
|
104
104
|
*/
|
|
105
105
|
publicService?: boolean;
|
|
106
106
|
/**
|
|
107
|
-
* Fly Proxy idle behaviour for the preview service. `
|
|
108
|
-
*
|
|
109
|
-
* idle
|
|
110
|
-
*
|
|
107
|
+
* Fly Proxy idle behaviour for the preview service. Defaults to `'off'` —
|
|
108
|
+
* never idle the Machine — because the autostop timer counts the PROXY
|
|
109
|
+
* service's idle time, not the workload's, so a sandbox with nobody looking at
|
|
110
|
+
* its preview is suspended out from under a build that is still running.
|
|
111
|
+
* `suspend` is the scale-to-zero mapping (resume from a memory snapshot on the
|
|
112
|
+
* next request) and `stop` is a full stop with a cold boot on wake; opt into
|
|
113
|
+
* either deliberately.
|
|
111
114
|
*/
|
|
112
115
|
autostop?: 'off' | 'stop' | 'suspend';
|
|
113
116
|
/**
|
|
@@ -457,6 +460,34 @@ export interface FlyMachine {
|
|
|
457
460
|
region?: string;
|
|
458
461
|
private_ip?: string;
|
|
459
462
|
config?: FlyMachineConfig;
|
|
463
|
+
/** RFC 3339 creation time, as Fly reports it. */
|
|
464
|
+
created_at?: string;
|
|
465
|
+
/**
|
|
466
|
+
* Lifecycle events, newest first. The ONLY place Fly records when a Machine
|
|
467
|
+
* was first started — there is no `started_at` field — which is what
|
|
468
|
+
* distinguishes a stopped Machine from one that was created and never ran.
|
|
469
|
+
*/
|
|
470
|
+
events?: FlyMachineEvent[];
|
|
471
|
+
}
|
|
472
|
+
/** One entry of {@link FlyMachine.events}. */
|
|
473
|
+
export interface FlyMachineEvent {
|
|
474
|
+
/** `start`, `launch`, `exit`, … */
|
|
475
|
+
type?: string;
|
|
476
|
+
status?: string;
|
|
477
|
+
/** Epoch milliseconds. */
|
|
478
|
+
timestamp?: number;
|
|
479
|
+
}
|
|
480
|
+
/** An app as returned by `GET /v1/apps?org_slug=…` (the fields this provider reads). */
|
|
481
|
+
export interface FlyApp {
|
|
482
|
+
id?: string;
|
|
483
|
+
name: string;
|
|
484
|
+
machine_count?: number;
|
|
485
|
+
}
|
|
486
|
+
/** Response body of `GET /v1/apps?org_slug=…`. */
|
|
487
|
+
export interface FlyAppList {
|
|
488
|
+
/** Total apps in the org, which the returned page may not cover. */
|
|
489
|
+
total_apps?: number;
|
|
490
|
+
apps?: FlyApp[];
|
|
460
491
|
}
|
|
461
492
|
/** A Machine as returned by the org-wide list endpoint (`GET /orgs/{org}/machines`). */
|
|
462
493
|
export interface FlyOrgMachine extends FlyMachine {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IACl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MAAM,CAAA;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-code-sandbox-flyio",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Fly.io Machines (Firecracker microVM) code sandbox provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@molecule/api-bond": "1.0.1",
|
|
34
|
-
"@molecule/api-code-sandbox": "1.0
|
|
34
|
+
"@molecule/api-code-sandbox": "1.2.0",
|
|
35
35
|
"@types/node": "26.1.2",
|
|
36
36
|
"typescript": "6.0.3",
|
|
37
37
|
"vitest": "4.1.10"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@molecule/api-bond": "^1.0.1",
|
|
41
|
-
"@molecule/api-code-sandbox": "^1.0
|
|
41
|
+
"@molecule/api-code-sandbox": "^1.2.0",
|
|
42
42
|
"@molecule/api-i18n": "^1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|