@axiom-lattice/core 2.1.67 → 2.1.69

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
@@ -1559,7 +1559,7 @@ interface SandboxManagerProtocol {
1559
1559
  vmIsolation: SandboxIsolationLevel;
1560
1560
  };
1561
1561
  getSandboxFromConfig(config: RunSandboxConfig): Promise<SandboxInstance>;
1562
- createSandbox(name: string): Promise<SandboxInstance>;
1562
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
1563
1563
  getSandbox(name: string): Promise<SandboxInstance>;
1564
1564
  stopSandbox(name: string): Promise<void>;
1565
1565
  deleteSandbox(name: string): Promise<void>;
@@ -3852,7 +3852,7 @@ interface VolumeFsClient {
3852
3852
  }
3853
3853
 
3854
3854
  interface SandboxProvider {
3855
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
3855
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
3856
3856
  getSandbox(name: string): Promise<SandboxInstance>;
3857
3857
  stopSandbox(name: string): Promise<void>;
3858
3858
  deleteSandbox(name: string): Promise<void>;
@@ -3970,7 +3970,7 @@ declare class MicrosandboxRemoteProvider implements SandboxProvider {
3970
3970
  private readonly instances;
3971
3971
  private readonly creating;
3972
3972
  constructor(config: MicrosandboxRemoteProviderConfig);
3973
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
3973
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
3974
3974
  getSandbox(name: string): Promise<SandboxInstance>;
3975
3975
  stopSandbox(name: string): Promise<void>;
3976
3976
  deleteSandbox(name: string): Promise<void>;
@@ -3988,7 +3988,7 @@ declare class RemoteSandboxProvider implements SandboxProvider {
3988
3988
  private client;
3989
3989
  private instances;
3990
3990
  constructor(config: RemoteSandboxProviderConfig);
3991
- createSandbox(name: string): Promise<SandboxInstance>;
3991
+ createSandbox(name: string, _config: RunSandboxConfig): Promise<SandboxInstance>;
3992
3992
  getSandbox(name: string): Promise<SandboxInstance>;
3993
3993
  stopSandbox(name: string): Promise<void>;
3994
3994
  deleteSandbox(name: string): Promise<void>;
@@ -4005,7 +4005,7 @@ declare class E2BProvider implements SandboxProvider {
4005
4005
  private instances;
4006
4006
  private creating;
4007
4007
  constructor(config: E2BProviderConfig);
4008
- createSandbox(name: string): Promise<SandboxInstance>;
4008
+ createSandbox(name: string, _config: RunSandboxConfig): Promise<SandboxInstance>;
4009
4009
  getSandbox(name: string): Promise<SandboxInstance>;
4010
4010
  stopSandbox(name: string): Promise<void>;
4011
4011
  deleteSandbox(name: string): Promise<void>;
@@ -4026,7 +4026,7 @@ declare class DaytonaProvider implements SandboxProvider {
4026
4026
  private creating;
4027
4027
  private volumeId;
4028
4028
  constructor(config: DaytonaProviderConfig);
4029
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
4029
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
4030
4030
  /**
4031
4031
  * Build volume mounts for a sandbox based on RunSandboxConfig.
4032
4032
  * Mounts:
@@ -4186,7 +4186,7 @@ declare class SandboxLatticeManager extends BaseLatticeManager<SandboxProvider>
4186
4186
  getVolumeBackend(config: RunSandboxConfig): Promise<BackendProtocol | null>;
4187
4187
  getVolumeBackendForPath(config: RunSandboxConfig, filePath: string): Promise<BackendProtocol | null>;
4188
4188
  private _resolveVolumeForPath;
4189
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
4189
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
4190
4190
  getSandbox(name: string): Promise<SandboxInstance>;
4191
4191
  stopSandbox(name: string): Promise<void>;
4192
4192
  deleteSandbox(name: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1559,7 +1559,7 @@ interface SandboxManagerProtocol {
1559
1559
  vmIsolation: SandboxIsolationLevel;
1560
1560
  };
1561
1561
  getSandboxFromConfig(config: RunSandboxConfig): Promise<SandboxInstance>;
1562
- createSandbox(name: string): Promise<SandboxInstance>;
1562
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
1563
1563
  getSandbox(name: string): Promise<SandboxInstance>;
1564
1564
  stopSandbox(name: string): Promise<void>;
1565
1565
  deleteSandbox(name: string): Promise<void>;
@@ -3852,7 +3852,7 @@ interface VolumeFsClient {
3852
3852
  }
3853
3853
 
3854
3854
  interface SandboxProvider {
3855
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
3855
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
3856
3856
  getSandbox(name: string): Promise<SandboxInstance>;
3857
3857
  stopSandbox(name: string): Promise<void>;
3858
3858
  deleteSandbox(name: string): Promise<void>;
@@ -3970,7 +3970,7 @@ declare class MicrosandboxRemoteProvider implements SandboxProvider {
3970
3970
  private readonly instances;
3971
3971
  private readonly creating;
3972
3972
  constructor(config: MicrosandboxRemoteProviderConfig);
3973
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
3973
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
3974
3974
  getSandbox(name: string): Promise<SandboxInstance>;
3975
3975
  stopSandbox(name: string): Promise<void>;
3976
3976
  deleteSandbox(name: string): Promise<void>;
@@ -3988,7 +3988,7 @@ declare class RemoteSandboxProvider implements SandboxProvider {
3988
3988
  private client;
3989
3989
  private instances;
3990
3990
  constructor(config: RemoteSandboxProviderConfig);
3991
- createSandbox(name: string): Promise<SandboxInstance>;
3991
+ createSandbox(name: string, _config: RunSandboxConfig): Promise<SandboxInstance>;
3992
3992
  getSandbox(name: string): Promise<SandboxInstance>;
3993
3993
  stopSandbox(name: string): Promise<void>;
3994
3994
  deleteSandbox(name: string): Promise<void>;
@@ -4005,7 +4005,7 @@ declare class E2BProvider implements SandboxProvider {
4005
4005
  private instances;
4006
4006
  private creating;
4007
4007
  constructor(config: E2BProviderConfig);
4008
- createSandbox(name: string): Promise<SandboxInstance>;
4008
+ createSandbox(name: string, _config: RunSandboxConfig): Promise<SandboxInstance>;
4009
4009
  getSandbox(name: string): Promise<SandboxInstance>;
4010
4010
  stopSandbox(name: string): Promise<void>;
4011
4011
  deleteSandbox(name: string): Promise<void>;
@@ -4026,7 +4026,7 @@ declare class DaytonaProvider implements SandboxProvider {
4026
4026
  private creating;
4027
4027
  private volumeId;
4028
4028
  constructor(config: DaytonaProviderConfig);
4029
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
4029
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
4030
4030
  /**
4031
4031
  * Build volume mounts for a sandbox based on RunSandboxConfig.
4032
4032
  * Mounts:
@@ -4186,7 +4186,7 @@ declare class SandboxLatticeManager extends BaseLatticeManager<SandboxProvider>
4186
4186
  getVolumeBackend(config: RunSandboxConfig): Promise<BackendProtocol | null>;
4187
4187
  getVolumeBackendForPath(config: RunSandboxConfig, filePath: string): Promise<BackendProtocol | null>;
4188
4188
  private _resolveVolumeForPath;
4189
- createSandbox(name: string, config?: RunSandboxConfig): Promise<SandboxInstance>;
4189
+ createSandbox(name: string, config: RunSandboxConfig): Promise<SandboxInstance>;
4190
4190
  getSandbox(name: string): Promise<SandboxInstance>;
4191
4191
  stopSandbox(name: string): Promise<void>;
4192
4192
  deleteSandbox(name: string): Promise<void>;
package/dist/index.js CHANGED
@@ -2618,6 +2618,10 @@ var InMemoryWorkflowTrackingStore = class {
2618
2618
  this.runs.set(runId, updated);
2619
2619
  return updated;
2620
2620
  }
2621
+ async deleteWorkflowRun(runId) {
2622
+ this.runs.delete(runId);
2623
+ this.steps.delete(runId);
2624
+ }
2621
2625
  async getWorkflowRunsByThreadId(tenantId, threadId) {
2622
2626
  const results = [];
2623
2627
  for (const run of this.runs.values()) {
@@ -5838,6 +5842,9 @@ var SandboxLatticeManager = class _SandboxLatticeManager extends BaseLatticeMana
5838
5842
  projectId: config.projectId,
5839
5843
  assistant_id: config.assistant_id
5840
5844
  });
5845
+ console.log(
5846
+ `[SandboxLattice] getSandboxFromConfig name=${name} isolation=${policy.vmIsolation} tenantId=${config.tenantId} workspaceId=${config.workspaceId} projectId=${config.projectId} assistant_id=${config.assistant_id} thread_id=${config.thread_id}`
5847
+ );
5841
5848
  return this.createSandbox(name, config);
5842
5849
  }
5843
5850
  async getVolumeBackend(config) {
@@ -5948,7 +5955,11 @@ var createShellExecTool = ({
5948
5955
  const runConfig = exe_config?.configurable?.runConfig ?? {};
5949
5956
  const sandboxManager = getSandBoxManager();
5950
5957
  const sandbox = await sandboxManager.getSandboxFromConfig({
5951
- ...runConfig,
5958
+ assistant_id: runConfig.assistant_id || "",
5959
+ thread_id: runConfig.thread_id || "",
5960
+ tenantId: runConfig.tenantId,
5961
+ workspaceId: runConfig.workspaceId,
5962
+ projectId: runConfig.projectId,
5952
5963
  vmIsolation
5953
5964
  });
5954
5965
  const executeResult = await sandbox.shell.execCommand({
@@ -6007,7 +6018,11 @@ registerToolLattice(
6007
6018
  const runConfig = exe_config.configurable?.runConfig || {};
6008
6019
  const sandboxManager = getSandBoxManager();
6009
6020
  const sandbox = await sandboxManager.getSandboxFromConfig({
6010
- ...runConfig,
6021
+ assistant_id: runConfig.assistant_id || "",
6022
+ thread_id: runConfig.thread_id || "",
6023
+ tenantId: runConfig.tenantId,
6024
+ workspaceId: runConfig.workspaceId,
6025
+ projectId: runConfig.projectId,
6011
6026
  vmIsolation: "global"
6012
6027
  });
6013
6028
  let inputPath = input.uri;
@@ -17418,6 +17433,9 @@ function createTopologyMiddleware(options) {
17418
17433
  stepIdMap: import_zod52.z.record(import_zod52.z.string()).default({})
17419
17434
  }),
17420
17435
  beforeAgent: async (state, runtime) => {
17436
+ if (state.runId) {
17437
+ return {};
17438
+ }
17421
17439
  const runConfig = runtime.context?.runConfig ?? {};
17422
17440
  const startingNode = edges[0]?.from ?? runConfig.assistant_id ?? "";
17423
17441
  let runId = "";
@@ -21110,6 +21128,9 @@ var MicrosandboxServiceClient = class {
21110
21128
  this.apiKey = config.apiKey;
21111
21129
  }
21112
21130
  async ensureSandbox(name, input) {
21131
+ console.log(
21132
+ `[MicrosandboxClient] ensureSandbox name=${name} image=${input.image ?? "not set"} envKeys=${Object.keys(input.env ?? {}).join(",") || "none"}`
21133
+ );
21113
21134
  return this.request(`/api/sandboxes/${encodeURIComponent(name)}`, {
21114
21135
  method: "PUT",
21115
21136
  body: input
@@ -21357,8 +21378,12 @@ var MicrosandboxRemoteProvider = class {
21357
21378
  }
21358
21379
  buildEnsureInput(config) {
21359
21380
  const defaultMicrosandboxRemoteConfig = getDefaultMicrosandboxRemoteConfig();
21381
+ const image = this.config.image ?? defaultMicrosandboxRemoteConfig.image;
21382
+ console.log(
21383
+ `[MicrosandboxRemote] buildEnsureInput image=${image} from=${this.config.image ? "providerConfig" : "defaultConfig"}`
21384
+ );
21360
21385
  return {
21361
- image: this.config.image ?? defaultMicrosandboxRemoteConfig.image,
21386
+ image,
21362
21387
  cpus: this.config.cpus ?? defaultMicrosandboxRemoteConfig.cpus,
21363
21388
  memoryMib: this.config.memoryMib ?? defaultMicrosandboxRemoteConfig.memoryMib,
21364
21389
  env: {
@@ -21523,7 +21548,7 @@ var RemoteSandboxProvider = class {
21523
21548
  environment: ""
21524
21549
  });
21525
21550
  }
21526
- async createSandbox(name) {
21551
+ async createSandbox(name, _config) {
21527
21552
  const existing = this.instances.get(name);
21528
21553
  if (existing) {
21529
21554
  return existing;
@@ -21660,7 +21685,7 @@ var E2BProvider = class {
21660
21685
  this.instances = /* @__PURE__ */ new Map();
21661
21686
  this.creating = /* @__PURE__ */ new Map();
21662
21687
  }
21663
- async createSandbox(name) {
21688
+ async createSandbox(name, _config) {
21664
21689
  const existing = this.instances.get(name);
21665
21690
  if (existing) {
21666
21691
  const running = await existing.getStatus();