@supermachine/core 0.4.29 → 0.5.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 (2) hide show
  1. package/index.d.ts +45 -0
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -27,6 +27,20 @@ export interface ExtraFileSpec {
27
27
  guestPath: string
28
28
  }
29
29
 
30
+ /**
31
+ * One virtio-fs DAX mount: a host directory exposed to the guest
32
+ * at a given `guestTag` (max 35 UTF-8 bytes). The guest mounts it
33
+ * via `mount -t virtiofs <guestTag> <target>`. Reads go through
34
+ * DAX (zero-copy, host-page-cache-shared across VMs that mount the
35
+ * same path) — validated by spike 22.
36
+ */
37
+ export interface MountSpec {
38
+ /** Host directory to expose. Must exist + be a directory. */
39
+ hostPath: string
40
+ /** virtiofs tag the guest mounts by. Max 35 bytes. */
41
+ guestTag: string
42
+ }
43
+
30
44
  /**
31
45
  * Options for [`Image.build`]. Mirrors `OciImageBuilder` in the
32
46
  * Rust crate. All fields optional except `ref` (the OCI image
@@ -84,6 +98,37 @@ export interface BuildOptions {
84
98
  * `OciImageBuilder::with_extra_file`.
85
99
  */
86
100
  extraFiles?: Array<ExtraFileSpec>
101
+ /**
102
+ * virtio-fs DAX mounts. Each entry attaches a host directory
103
+ * to the guest, served zero-copy via FUSE-over-virtio with DAX.
104
+ * Folded into the bake's input hash so changing `hostPath`
105
+ * re-bakes.
106
+ */
107
+ mounts?: Array<MountSpec>
108
+ /**
109
+ * Override where to fetch the image bytes. Default behavior
110
+ * (when omitted) treats `ref` as a registry reference and pulls
111
+ * from Docker Hub / the registry encoded in `ref`. Set this
112
+ * when the image lives locally and a registry round-trip
113
+ * would be wasteful or impossible (offline CI, locally-built
114
+ * images via Apple `container`, etc.).
115
+ *
116
+ * Accepted values:
117
+ * * `"oci-archive"` — `sourcePath` is a tarball (the output of
118
+ * `docker save` or `skopeo copy --format=oci-archive`).
119
+ * * `"oci-layout"` — `sourcePath` is a directory containing
120
+ * `index.json` + `oci-layout` + `blobs/sha256/...`.
121
+ * * `"registry"` — default. `sourcePath` is ignored.
122
+ *
123
+ * When set, `ref` is preserved as the logical image identifier
124
+ * (used to derive the snapshot directory name); the actual
125
+ * image bytes come from `sourcePath`. The folded input hash
126
+ * includes the source path's stat so changes to the local
127
+ * image re-bake automatically.
128
+ */
129
+ source?: string
130
+ /** File or directory path for non-registry sources. See `source`. */
131
+ sourcePath?: string
87
132
  /**
88
133
  * Stable tag for the warmup callback (see the `warmup`
89
134
  * parameter on [`Image.build`]). Folded into the snapshot's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supermachine/core",
3
- "version": "0.4.29",
3
+ "version": "0.5.0",
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.4.29"
25
+ "@supermachine/core-darwin-arm64": "0.5.0"
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",