@axiom-lattice/core 2.1.52 → 2.1.53

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/dist/index.mjs CHANGED
@@ -18073,12 +18073,7 @@ import { Sandbox } from "microsandbox";
18073
18073
 
18074
18074
  // src/sandbox_lattice/MicrosandboxInstance.ts
18075
18075
  function exec(native, cmd, opts) {
18076
- return native.execWith(cmd, (b) => {
18077
- if (opts?.args) b.args(opts.args);
18078
- if (opts?.cwd) b.cwd(opts.cwd);
18079
- if (opts?.timeoutMs) b.timeout(opts.timeoutMs);
18080
- return b;
18081
- });
18076
+ return native.execWithConfig({ cmd, args: opts?.args, cwd: opts?.cwd, timeoutMs: opts?.timeoutMs });
18082
18077
  }
18083
18078
  var MicrosandboxInstance = class {
18084
18079
  constructor(name, native) {
@@ -18086,7 +18081,7 @@ var MicrosandboxInstance = class {
18086
18081
  this.file = {
18087
18082
  readFile: async (file) => {
18088
18083
  const fs3 = this.native.fs();
18089
- const content = await fs3.readToString(file);
18084
+ const content = await fs3.readString(file);
18090
18085
  return { content };
18091
18086
  },
18092
18087
  writeFile: async (file, content) => {
@@ -18227,11 +18222,16 @@ var MicrosandboxProvider = class {
18227
18222
  native = void 0;
18228
18223
  }
18229
18224
  if (!native) {
18230
- const builder = Sandbox.builder(name).image(this.config.image ?? "python:3.11-slim").cpus(this.config.cpus ?? 1).memory(this.config.memoryMib ?? 512).envs({
18231
- ...this.config.env,
18232
- ...buildSandboxMetadataEnv(config)
18225
+ native = await Sandbox.createDetached({
18226
+ name,
18227
+ image: this.config.image ?? "python:3.11-slim",
18228
+ cpus: this.config.cpus ?? 1,
18229
+ memoryMib: this.config.memoryMib ?? 512,
18230
+ env: {
18231
+ ...this.config.env,
18232
+ ...buildSandboxMetadataEnv(config)
18233
+ }
18233
18234
  });
18234
- native = await builder.createDetached();
18235
18235
  }
18236
18236
  const instance = new MicrosandboxInstance(name, native);
18237
18237
  this.instances.set(name, instance);