@axiom-lattice/core 2.1.86 → 2.1.88

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.d.mts CHANGED
@@ -4228,7 +4228,6 @@ interface MicrosandboxRemoteProviderConfig extends MicrosandboxServiceClientConf
4228
4228
  declare class MicrosandboxRemoteProvider implements SandboxProvider {
4229
4229
  private readonly config;
4230
4230
  private readonly client;
4231
- private readonly instances;
4232
4231
  private readonly creating;
4233
4232
  constructor(config: MicrosandboxRemoteProviderConfig);
4234
4233
  createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
package/dist/index.d.ts CHANGED
@@ -4228,7 +4228,6 @@ interface MicrosandboxRemoteProviderConfig extends MicrosandboxServiceClientConf
4228
4228
  declare class MicrosandboxRemoteProvider implements SandboxProvider {
4229
4229
  private readonly config;
4230
4230
  private readonly client;
4231
- private readonly instances;
4232
4231
  private readonly creating;
4233
4232
  constructor(config: MicrosandboxRemoteProviderConfig);
4234
4233
  createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
package/dist/index.js CHANGED
@@ -24365,7 +24365,6 @@ function getDefaultMicrosandboxRemoteConfig() {
24365
24365
  var MicrosandboxRemoteProvider = class {
24366
24366
  constructor(config) {
24367
24367
  this.config = config;
24368
- this.instances = /* @__PURE__ */ new Map();
24369
24368
  this.creating = /* @__PURE__ */ new Map();
24370
24369
  this.client = config.client ?? new MicrosandboxServiceClient({
24371
24370
  baseURL: config.baseURL,
@@ -24377,48 +24376,32 @@ var MicrosandboxRemoteProvider = class {
24377
24376
  if (inFlight) {
24378
24377
  return inFlight;
24379
24378
  }
24380
- const existing = this.instances.get(name);
24381
- if (existing) {
24382
- console.log(`[MicrosandboxRemote] createSandbox name=${name} INSTANCE_CACHE_HIT`);
24383
- return existing;
24384
- }
24385
24379
  const creation = (async () => {
24386
24380
  const tStart = Date.now();
24387
24381
  const input = this.buildEnsureInput(config);
24388
24382
  console.log(`[MicrosandboxRemote] createSandbox name=${name} calling ensureSandbox...`);
24389
24383
  await this.client.ensureSandbox(name, input);
24390
24384
  console.log(`[MicrosandboxRemote] createSandbox DONE name=${name} elapsed=${Date.now() - tStart}ms`);
24391
- const instance = new MicrosandboxRemoteInstance(name, this.client);
24392
- this.instances.set(name, instance);
24393
- return instance;
24385
+ return new MicrosandboxRemoteInstance(name, this.client);
24394
24386
  })();
24395
24387
  this.creating.set(name, creation);
24396
- creation.then(
24397
- () => {
24398
- this.creating.delete(name);
24399
- },
24400
- () => {
24401
- this.creating.delete(name);
24402
- }
24403
- );
24388
+ creation.finally(() => this.creating.delete(name));
24404
24389
  return creation;
24405
24390
  }
24406
24391
  async getSandbox(name) {
24407
- const instance = this.instances.get(name);
24408
- if (!instance) {
24392
+ const status = await this.client.getStatus(name);
24393
+ if (status.status === "unknown") {
24409
24394
  throw new Error(`Sandbox ${name} not found`);
24410
24395
  }
24411
- return instance;
24396
+ return new MicrosandboxRemoteInstance(name, this.client);
24412
24397
  }
24413
24398
  async stopSandbox(name) {
24414
24399
  try {
24415
24400
  await this.client.stopSandbox(name);
24416
24401
  } catch {
24417
24402
  }
24418
- this.instances.delete(name);
24419
24403
  }
24420
24404
  async deleteSandbox(name) {
24421
- this.instances.delete(name);
24422
24405
  await this.client.deleteSandbox(name);
24423
24406
  }
24424
24407
  createVolumeFsClient(volumeName, _pathPrefix) {
@@ -24431,7 +24414,7 @@ var MicrosandboxRemoteProvider = class {
24431
24414
  };
24432
24415
  }
24433
24416
  async listSandboxes() {
24434
- return Array.from(this.instances.values());
24417
+ return [];
24435
24418
  }
24436
24419
  buildEnsureInput(config) {
24437
24420
  const defaultMicrosandboxRemoteConfig = getDefaultMicrosandboxRemoteConfig();