Files
bare-operating-system/kernel/lib/bare/bundles/bareEnv.js
T
Raven Scott 9bdecc4170
Release rolling / release (push) Successful in 11m16s
Sync Holepunch modules to current clone/npm latest
Bump published pins (compact-encoding 3, bare-fetch/tls/https/ws 3,
bare-subprocess 6, bare-signals 5, corestore 7.12, protomux 3.11,
hypercore-crypto 3.7, bare-runtime 1.31) and regenerate catalogs,
manifests, and kernel/seeder bundles.

Adapt call sites to the new APIs:
- Corestore: explicit session flush before suspend(); treeCache ctor opts
- bare-crypto: KeyObject.export() instead of removed ._key
- Protomux 3.11: wait for fullyOpened()/fullyClosed() on chat channels
- bare-fetch: surface response.type and Headers.getSetCookie
- host snapshots: bare-os 3.9 / bare-posix / bare-fs.statfs frsize
- bare-subprocess 6: optional IPC channel + json serialization

Keep catalog sync from wiping curated pearEntries. Teach the Node test
shim to stub bare-thread/bare-worker (ESM absolute paths) and chain
Bare.on so bare-timers can load. Booter 479, protocol 34, seeder 14.
2026-08-12 20:56:28 -04:00

325 lines
12 KiB
JavaScript

var __bare_os_bundle_exports__ = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// ../../node_modules/bare-os/binding.js
var require_binding = __commonJS({
"../../node_modules/bare-os/binding.js"(exports, module) {
module.exports = __require.addon();
}
});
// ../../node_modules/bare-os/lib/errors.js
var require_errors = __commonJS({
"../../node_modules/bare-os/lib/errors.js"(exports, module) {
module.exports = class OSError extends Error {
constructor(msg, fn = OSError, code = fn.name) {
super(`${code}: ${msg}`);
this.code = code;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, fn);
}
}
get name() {
return "OSError";
}
static UNKNOWN_SIGNAL(msg) {
return new OSError(msg, OSError.UNKNOWN_SIGNAL);
}
static TITLE_OVERFLOW(msg) {
return new OSError(msg, OSError.TITLE_OVERFLOW);
}
};
}
});
// ../../node_modules/bare-os/lib/constants.js
var require_constants = __commonJS({
"../../node_modules/bare-os/lib/constants.js"(exports, module) {
var binding = require_binding();
module.exports = {
signals: binding.signals,
errnos: binding.errnos,
priority: binding.priority
};
}
});
// ../../node_modules/bare-os/index.js
var require_bare_os = __commonJS({
"../../node_modules/bare-os/index.js"(exports) {
var binding = require_binding();
var errors = require_errors();
var constants = require_constants();
exports.constants = constants;
exports.errors = errors;
exports.EOL = binding.platform === "win32" ? "\r\n" : "\n";
exports.devNull = binding.platform === "win32" ? "\\\\.\\nul" : "/dev/null";
exports.platform = function platform() {
return binding.platform;
};
exports.arch = function arch() {
return binding.arch;
};
exports.type = function type() {
return binding.type();
};
exports.version = function version() {
return binding.version();
};
exports.release = function release() {
return binding.release();
};
exports.machine = function machine() {
return binding.machine();
};
exports.execPath = function execPath() {
return binding.execPath();
};
exports.pid = function pid() {
return binding.pid();
};
exports.ppid = function ppid() {
return binding.ppid();
};
exports.cwd = function cwd() {
return binding.cwd();
};
exports.chdir = function chdir(dir) {
validateString(dir, "Directory");
binding.chdir(dir);
};
exports.tmpdir = function tmpdir() {
return binding.tmpdir();
};
exports.homedir = function homedir() {
return binding.homedir();
};
exports.hostname = function hostname() {
return binding.hostname();
};
exports.userInfo = function userInfo(uid) {
if (uid !== void 0) validateInteger(uid, "User ID");
return binding.userInfo(uid);
};
exports.groupInfo = function groupInfo(gid) {
if (gid !== void 0) validateInteger(gid, "Group ID");
return binding.groupInfo(gid);
};
exports.networkInterfaces = function networkInterfaces() {
const result = {};
for (const entry of binding.networkInterfaces()) {
const { name, ...properties } = entry;
if (result[name]) result[name].push(properties);
else result[name] = [properties];
}
return result;
};
exports.kill = function kill(pid, signal = constants.signals.SIGTERM) {
validateInteger(pid, "Process ID");
if (typeof signal === "string") {
if (signal in constants.signals === false) {
throw errors.UNKNOWN_SIGNAL("Unknown signal: " + signal);
}
signal = constants.signals[signal];
} else {
validateInteger(signal, "Signal");
}
binding.kill(pid, signal);
};
exports.endianness = function endianness() {
return binding.isLittleEndian ? "LE" : "BE";
};
exports.availableParallelism = function availableParallelism() {
return binding.availableParallelism();
};
exports.cpuUsage = function cpuUsage(previous) {
const current = binding.cpuUsage();
if (previous) {
return {
user: current.user - previous.user,
system: current.system - previous.system
};
}
return current;
};
exports.threadCpuUsage = function threadCpuUsage(previous) {
const current = binding.threadCpuUsage();
if (previous) {
return {
user: current.user - previous.user,
system: current.system - previous.system
};
}
return current;
};
exports.resourceUsage = function resourceUsage() {
return binding.resourceUsage();
};
exports.memoryUsage = function memoryUsage() {
return binding.memoryUsage();
};
exports.freemem = function freemem() {
return binding.freemem();
};
exports.totalmem = function totalmem() {
return binding.totalmem();
};
exports.availableMemory = function availableMemory() {
return binding.availableMemory();
};
exports.constrainedMemory = function constrainedMemory() {
return binding.constrainedMemory();
};
exports.uptime = function uptime() {
return binding.uptime();
};
exports.loadavg = function loadavg() {
return binding.loadavg();
};
exports.cpus = function cpus() {
return binding.cpus();
};
exports.getProcessTitle = function getProcessTitle() {
return binding.getProcessTitle();
};
exports.setProcessTitle = function setProcessTitle(title) {
if (typeof title !== "string") title = title.toString();
if (title.length >= 256) {
throw errors.TITLE_OVERFLOW("Process title is too long");
}
binding.setProcessTitle(title);
};
exports.getPriority = function getPriority(pid = 0) {
validateInteger(pid, "Process ID");
return binding.getPriority(pid);
};
exports.setPriority = function setPriority(pid, priority) {
if (priority === void 0) {
priority = pid;
pid = 0;
}
validateInteger(pid, "Process ID");
validateInteger(priority, "Priority");
binding.setPriority(pid, priority);
};
exports.getEnvKeys = function getEnvKeys() {
return binding.getEnvKeys();
};
exports.getEnv = function getEnv(name) {
validateString(name, "Name");
return binding.getEnv(name);
};
exports.hasEnv = function hasEnv(name) {
validateString(name, "Name");
return binding.hasEnv(name);
};
exports.setEnv = function setEnv(name, value) {
validateString(name, "Name");
validateString(value, "Value");
binding.setEnv(name, value);
};
exports.unsetEnv = function unsetEnv(name) {
validateString(name, "Name");
binding.unsetEnv(name);
};
function validateString(value, name) {
if (typeof value !== "string") {
throw new TypeError(`${name} must be a string. Received type ${typeof value} (${value})`);
}
}
function validateInteger(value, name) {
if (!Number.isInteger(value)) {
throw new TypeError(`${name} must be an integer. Received type ${typeof value} (${value})`);
}
}
}
});
// ../../node_modules/bare-env/index.js
var require_bare_env = __commonJS({
"../../node_modules/bare-env/index.js"(exports, module) {
var os = require_bare_os();
module.exports = new Proxy(/* @__PURE__ */ Object.create(null), {
ownKeys(target) {
return os.getEnvKeys();
},
get(target, property) {
if (typeof property !== "string") return;
return os.getEnv(property);
},
has(target, property) {
if (typeof property !== "string") return false;
return os.hasEnv(property);
},
set(target, property, value) {
if (typeof property !== "string") return;
const type = typeof value;
if (type !== "string" && type !== "number" && type !== "boolean") {
throw new Error("Environment variable must be of type string, number, or boolean");
}
value = String(value);
os.setEnv(property, value);
return true;
},
deleteProperty(target, property) {
if (typeof property !== "string") return;
os.unsetEnv(property);
},
getOwnPropertyDescriptor(target, property) {
return {
value: this.get(target, property),
enumerable: true,
configurable: true,
writable: true
};
}
});
}
});
// ../../bare-lib-entry-bareEnv.js
var bare_lib_entry_bareEnv_exports = {};
__export(bare_lib_entry_bareEnv_exports, {
default: () => bare_lib_entry_bareEnv_default
});
var import_bare_env = __toESM(require_bare_env());
var bare_lib_entry_bareEnv_default = import_bare_env.default;
return __toCommonJS(bare_lib_entry_bareEnv_exports);
})();
;(function(){var g=globalThis;var s="__bare_os_stdlib__";g[s]=g[s]||{};var e=typeof __bare_os_bundle_exports__!=="undefined"?__bare_os_bundle_exports__:void 0;var v=e!=null&&typeof e==="object"&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;g[s]["bareEnv"]=v;})();