"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_node_module = require('../node/module.js');

//#region src/smol/vfs.ts
/**
* @file Lazy-loader for socket-btm's `node:smol-vfs`. Targets the
*   **post-alignment** shape that mirrors upstream `node:vfs` (PR
*   nodejs/node#61478). socket-btm's runtime is being patched in lockstep with
*   this lib to match. Alignment summary vs. upstream `node:vfs`:
*
*   - `node:smol-vfs` exports a single `getSmolVfs()` accessor that returns a
*     `SmolVirtualFileSystem` instance pre-mounted at the SEA prefix (default
*     `/sea`).
*   - `vfs.mounted` (boolean), `vfs.mountPoint` (string | null) — instance
*     getters matching upstream.
*   - `vfs.extract(suffix)` — socket-btm-specific addition that returns a real-fs
*     path to an embedded asset. Upstream `node:vfs` doesn't have this — you'd
*     work via the patched `fs` namespace after `mount()`. We need real-fs
*     paths to spawn binaries (Bazel, SBT launcher, JRE's `bin/java`), so btm
*     carries this as a non-upstream extension.
*   - No `NODE_VFS_PREFIX` env-var override anywhere; prefix is set at build time
*     and immutable at runtime. Returns `undefined` on stock Node, non-Node
*     runtimes, and on socket-btm binaries that haven't yet shipped the aligned
*     binding. Result is cached across calls. Callers fall back to PATH lookup
*     (or out-of-band downloads in socket-cli's case) when this is missing.
*/
let _smolVfs;
let _smolVfsProbed = false;
/**
* Returns the pre-mounted SEA `SmolVirtualFileSystem` instance when running on
* a smol Node binary with an embedded SEA payload; otherwise `undefined`.
* Result is cached across calls.
*
* This is the only accessor external-tools resolvers need — the `node:smol-vfs`
* binding-module loader is collapsed into this function so callers don't deal
* with two indirection levels.
*/
/*@__NO_SIDE_EFFECTS__*/
function getSmolVfs() {
	if (!_smolVfsProbed) {
		_smolVfsProbed = true;
		/* c8 ignore start - smol Node binary only. */
		if (/* @__PURE__ */ require_node_module.isNodeBuiltin("node:smol-vfs")) _smolVfs = require("node:smol-vfs").getSmolVfs();
	}
	return _smolVfs;
}

//#endregion
exports.getSmolVfs = getSmolVfs;