@supermachine/core 0.7.11 → 0.7.14

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 (2) hide show
  1. package/index.d.ts +31 -7
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -191,6 +191,17 @@ export interface BuildOptions {
191
191
  source?: string
192
192
  /** File or directory path for non-registry sources. See `source`. */
193
193
  sourcePath?: string
194
+ /**
195
+ * Target platform, in Docker `--platform` form. Supported:
196
+ * * `"linux/arm64"` (default) — native arm64 path.
197
+ * * `"linux/amd64"` — pull the amd64 variant of multi-arch
198
+ * images, auto-mount Apple's Rosetta runtime share at
199
+ * `/run/rosetta`, register binfmt for amd64 ELFs. Requires
200
+ * `softwareupdate --install-rosetta` on the host.
201
+ * See `docs/design/chrome-amd64-gap-2026-05-17.md` for the
202
+ * Chrome / Playwright headful demo this enables.
203
+ */
204
+ platform?: string
194
205
  /**
195
206
  * Stable tag for the warmup callback (see the `warmup`
196
207
  * parameter on [`Image.build`]). Folded into the snapshot's
@@ -443,7 +454,18 @@ export declare class Pool {
443
454
  * / ~22 ms spawn-from-disk.
444
455
  */
445
456
  acquire(): Promise<Vm>
446
- /** Best-effort pool shutdown. Pool also shuts down on GC. */
457
+ /**
458
+ * Explicit pool shutdown. Wakes any caller blocked on
459
+ * `acquire()` (they receive a "pool is shutting down" error
460
+ * instead of hanging), drains idle + dirty workers, and
461
+ * stops housekeeping threads. Idempotent.
462
+ *
463
+ * The pool ALSO shuts down on GC, but JS GC is unpredictable
464
+ * and an integrator wiring this into a process-shutdown hook
465
+ * wants a synchronous "pool is gone now" guarantee. Call
466
+ * this in your shutdown path; the await resolves when the
467
+ * idle workers have been QUITed (or SIGKILLed on timeout).
468
+ */
447
469
  shutdown(): Promise<void>
448
470
  /**
449
471
  * Snapshot of the pool's current state. Cheap (~1 µs, just a
@@ -697,12 +719,14 @@ export declare class Vm {
697
719
  * Pass `hostPort = 0` to let the OS pick a free port; read
698
720
  * the actual bound port back via `forwarder.localAddr`.
699
721
  *
700
- * Note: `guestPort` is currently advisory. The Rust crate's
701
- * `expose_tcp` ignores it and routes all forwarded
702
- * connections into whatever the in-guest TSI mux accepts;
703
- * per-guest-port routing is on the roadmap. Pass the port
704
- * you semantically want it's plumbed through so the
705
- * signature stays stable when the routing fix lands.
722
+ * `guestPort` pins the host-port → guest-port mapping. The
723
+ * forwarder writes a small per-connection routing header
724
+ * (`SMUX-PORT-V1\0\0\0\0` + u32 BE port) over the unix mux,
725
+ * and the worker routes to the matching AF_INET TSI listener
726
+ * instead of falling back to "first listener" important
727
+ * when the guest binds multiple AF_INET ports (e.g. Chrome
728
+ * DevTools + helper sockets). Pass `guestPort = 0` to opt out
729
+ * of the header and keep the legacy first-listener behavior.
706
730
  */
707
731
  exposeTcp(hostPort: number, guestPort: number): Promise<TcpForwarder>
708
732
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supermachine/core",
3
- "version": "0.7.11",
3
+ "version": "0.7.14",
4
4
  "description": "Run any OCI/Docker image as a hardware-isolated microVM. Node/Bun/Deno binding for the supermachine Rust crate.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "index.js",
@@ -22,7 +22,7 @@
22
22
  "arm64"
23
23
  ],
24
24
  "optionalDependencies": {
25
- "@supermachine/core-darwin-arm64": "0.7.11"
25
+ "@supermachine/core-darwin-arm64": "0.7.14"
26
26
  },
27
27
  "scripts": {
28
28
  "build:rust": "TYPE_DEF_TMP_PATH=$(pwd)/scripts/.napi_type_defs.tmp cargo build --release -p supermachine-napi && cargo build --release --bin supermachine-worker -p supermachine",