@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.js CHANGED
@@ -18243,12 +18243,7 @@ var import_microsandbox = require("microsandbox");
18243
18243
 
18244
18244
  // src/sandbox_lattice/MicrosandboxInstance.ts
18245
18245
  function exec(native, cmd, opts) {
18246
- return native.execWith(cmd, (b) => {
18247
- if (opts?.args) b.args(opts.args);
18248
- if (opts?.cwd) b.cwd(opts.cwd);
18249
- if (opts?.timeoutMs) b.timeout(opts.timeoutMs);
18250
- return b;
18251
- });
18246
+ return native.execWithConfig({ cmd, args: opts?.args, cwd: opts?.cwd, timeoutMs: opts?.timeoutMs });
18252
18247
  }
18253
18248
  var MicrosandboxInstance = class {
18254
18249
  constructor(name, native) {
@@ -18256,7 +18251,7 @@ var MicrosandboxInstance = class {
18256
18251
  this.file = {
18257
18252
  readFile: async (file) => {
18258
18253
  const fs3 = this.native.fs();
18259
- const content = await fs3.readToString(file);
18254
+ const content = await fs3.readString(file);
18260
18255
  return { content };
18261
18256
  },
18262
18257
  writeFile: async (file, content) => {
@@ -18397,11 +18392,16 @@ var MicrosandboxProvider = class {
18397
18392
  native = void 0;
18398
18393
  }
18399
18394
  if (!native) {
18400
- const builder = import_microsandbox.Sandbox.builder(name).image(this.config.image ?? "python:3.11-slim").cpus(this.config.cpus ?? 1).memory(this.config.memoryMib ?? 512).envs({
18401
- ...this.config.env,
18402
- ...buildSandboxMetadataEnv(config)
18395
+ native = await import_microsandbox.Sandbox.createDetached({
18396
+ name,
18397
+ image: this.config.image ?? "python:3.11-slim",
18398
+ cpus: this.config.cpus ?? 1,
18399
+ memoryMib: this.config.memoryMib ?? 512,
18400
+ env: {
18401
+ ...this.config.env,
18402
+ ...buildSandboxMetadataEnv(config)
18403
+ }
18403
18404
  });
18404
- native = await builder.createDetached();
18405
18405
  }
18406
18406
  const instance = new MicrosandboxInstance(name, native);
18407
18407
  this.instances.set(name, instance);