@axiom-lattice/core 2.1.51 → 2.1.52

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
@@ -3266,39 +3266,68 @@ ${serverKeys.map(
3266
3266
  // src/tool_lattice/code_eval/index.ts
3267
3267
  import z15 from "zod";
3268
3268
 
3269
- // src/sandbox_lattice/utils.ts
3270
- function normalizeSandboxName(name) {
3271
- if (!name || typeof name !== "string") {
3272
- throw new Error("Sandbox name must be a non-empty string");
3269
+ // src/deep_agent_new/backends/volumeFilesystem.ts
3270
+ var VolumeFilesystem = class {
3271
+ constructor(client) {
3272
+ this.client = client;
3273
3273
  }
3274
- let normalized = name.toLowerCase();
3275
- normalized = normalized.replace(/_/g, "-");
3276
- normalized = normalized.replace(/[^a-z0-9.-]/g, "");
3277
- normalized = normalized.replace(/^[.-]+|[.-]+$/g, "");
3278
- normalized = normalized.replace(/[.-]{2,}/g, "-");
3279
- normalized = normalized.replace(/^[.-]+|[.-]+$/g, "");
3280
- if (!normalized) {
3281
- throw new Error(
3282
- `Sandbox name "${name}" cannot be normalized to a valid RFC 1123 subdomain name`
3283
- );
3274
+ async lsInfo(path4) {
3275
+ const entries = await this.client.list(path4);
3276
+ return entries.map((entry) => ({
3277
+ path: entry.path,
3278
+ is_dir: entry.kind === "directory",
3279
+ size: entry.size,
3280
+ modified_at: entry.modified ? new Date(entry.modified).toISOString() : void 0
3281
+ }));
3284
3282
  }
3285
- if (!/^[a-z0-9]/.test(normalized)) {
3286
- normalized = `sandbox-${normalized}`;
3283
+ async read(filePath, offset = 0, limit = 2e3) {
3284
+ const raw = await this.client.read(filePath);
3285
+ const lines = raw.split("\n");
3286
+ const start = Math.max(0, offset);
3287
+ const end = Math.min(lines.length, start + limit);
3288
+ const sliced = lines.slice(start, end);
3289
+ return sliced.map((line, i) => {
3290
+ const lineNum = (start + i + 1).toString().padStart(6, " ");
3291
+ return `${lineNum}|${line}`;
3292
+ }).join("\n");
3287
3293
  }
3288
- if (!/[a-z0-9]$/.test(normalized)) {
3289
- normalized = `${normalized}-0`;
3294
+ async readRaw(filePath) {
3295
+ const content = await this.client.read(filePath);
3296
+ const lines = content.split("\n");
3297
+ const now = (/* @__PURE__ */ new Date()).toISOString();
3298
+ return {
3299
+ content: lines,
3300
+ created_at: now,
3301
+ modified_at: now
3302
+ };
3290
3303
  }
3291
- const rfc1123Pattern = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/;
3292
- if (!rfc1123Pattern.test(normalized)) {
3293
- normalized = normalized.replace(/[^a-z0-9-]/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
3294
- if (!/^[a-z0-9]/.test(normalized)) {
3295
- normalized = `sandbox-${normalized}`;
3296
- }
3297
- if (!/[a-z0-9]$/.test(normalized)) {
3298
- normalized = `${normalized}0`;
3304
+ grepRaw(_pattern, _path, _glob) {
3305
+ throw new Error("Not supported on volume backend");
3306
+ }
3307
+ globInfo(_pattern, _path) {
3308
+ throw new Error("Not supported on volume backend");
3309
+ }
3310
+ async write(filePath, content) {
3311
+ try {
3312
+ await this.client.write(filePath, content);
3313
+ return { path: filePath, filesUpdate: null };
3314
+ } catch (err) {
3315
+ return { error: String(err) };
3299
3316
  }
3300
3317
  }
3301
- return normalized;
3318
+ edit(_filePath, _oldString, _newString, _replaceAll) {
3319
+ throw new Error("Not supported on volume backend");
3320
+ }
3321
+ };
3322
+
3323
+ // src/sandbox_lattice/utils.ts
3324
+ import { createHash } from "crypto";
3325
+ function normalizeSandboxName(name) {
3326
+ if (!name || typeof name !== "string") {
3327
+ throw new Error("Sandbox name must be a non-empty string");
3328
+ }
3329
+ const hash = createHash("sha256").update(name).digest("hex").slice(0, 16);
3330
+ return `n${hash}`;
3302
3331
  }
3303
3332
  function isValidSandboxName(name) {
3304
3333
  if (!name || typeof name !== "string") {
@@ -3307,6 +3336,24 @@ function isValidSandboxName(name) {
3307
3336
  const rfc1123Pattern = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/;
3308
3337
  return rfc1123Pattern.test(name.toLowerCase());
3309
3338
  }
3339
+ function buildSandboxMetadataEnv(config) {
3340
+ if (!config) {
3341
+ return {};
3342
+ }
3343
+ const vars = {};
3344
+ if (config.tenantId) vars.LATTICE_TENANT_ID = config.tenantId;
3345
+ if (config.assistant_id) vars.LATTICE_ASSISTANT_ID = config.assistant_id;
3346
+ if (config.projectId) vars.LATTICE_PROJECT_ID = config.projectId;
3347
+ if (config.workspaceId) vars.LATTICE_WORKSPACE_ID = config.workspaceId;
3348
+ return vars;
3349
+ }
3350
+
3351
+ // src/sandbox_lattice/volumeFsUtils.ts
3352
+ import { createHash as createHash2 } from "crypto";
3353
+ function buildNamedVolumeName(prefix, ...parts) {
3354
+ const hash = createHash2("sha256").update(parts.filter((part) => part !== void 0).join("\0")).digest("hex").slice(0, 16);
3355
+ return `${prefix}${hash}`;
3356
+ }
3310
3357
 
3311
3358
  // src/sandbox_lattice/SandboxLatticeManager.ts
3312
3359
  function computeSandboxName(config) {
@@ -3317,7 +3364,7 @@ function computeSandboxName(config) {
3317
3364
  return normalizeSandboxName(`${config.tenantId ?? "default"}-${config.assistant_id}`);
3318
3365
  case "project":
3319
3366
  return normalizeSandboxName(
3320
- `${config.tenantId ?? "default"}-${config.workspaceId ?? "default"}-${config.projectId ?? "default"}`
3367
+ `${config.tenantId ?? "default"}-${config.assistant_id ?? "default"}-${config.projectId ?? "default"}`
3321
3368
  );
3322
3369
  }
3323
3370
  }
@@ -3379,6 +3426,19 @@ var SandboxLatticeManager = class _SandboxLatticeManager extends BaseLatticeMana
3379
3426
  });
3380
3427
  return this.createSandbox(name, config);
3381
3428
  }
3429
+ async getVolumeBackend(config) {
3430
+ const provider = this._requireProvider();
3431
+ if (!provider.createVolumeFsClient) {
3432
+ return null;
3433
+ }
3434
+ const tenantId = config.tenantId ?? "default";
3435
+ if (!config.projectId) {
3436
+ return null;
3437
+ }
3438
+ const volumeName = buildNamedVolumeName("p", "project", tenantId, config.workspaceId, config.projectId);
3439
+ const client = provider.createVolumeFsClient(volumeName);
3440
+ return new VolumeFilesystem(client);
3441
+ }
3382
3442
  async createSandbox(name, config) {
3383
3443
  const provider = this._requireProvider();
3384
3444
  return provider.createSandbox(name, config);
@@ -4414,13 +4474,6 @@ import { HumanMessage as HumanMessage3 } from "@langchain/core/messages";
4414
4474
  // src/agent_lattice/types.ts
4415
4475
  import {
4416
4476
  AgentType,
4417
- AgentConfig,
4418
- ReactAgentConfig,
4419
- DeepAgentConfig,
4420
- TeamAgentConfig,
4421
- TeamTeammateConfig,
4422
- AgentConfigWithTools,
4423
- GraphBuildOptions,
4424
4477
  hasTools,
4425
4478
  isDeepAgentConfig,
4426
4479
  isTeamAgentConfig,
@@ -18019,13 +18072,21 @@ var mcpManager = McpLatticeManager.getInstance();
18019
18072
  import { Sandbox } from "microsandbox";
18020
18073
 
18021
18074
  // src/sandbox_lattice/MicrosandboxInstance.ts
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
+ });
18082
+ }
18022
18083
  var MicrosandboxInstance = class {
18023
18084
  constructor(name, native) {
18024
18085
  this.native = native;
18025
18086
  this.file = {
18026
18087
  readFile: async (file) => {
18027
18088
  const fs3 = this.native.fs();
18028
- const content = await fs3.readString(file);
18089
+ const content = await fs3.readToString(file);
18029
18090
  return { content };
18030
18091
  },
18031
18092
  writeFile: async (file, content) => {
@@ -18044,16 +18105,14 @@ var MicrosandboxInstance = class {
18044
18105
  return { files };
18045
18106
  },
18046
18107
  findFiles: async (path4, glob) => {
18047
- const output = await this.native.execWithConfig({
18048
- cmd: "sh",
18108
+ const output = await exec(this.native, "sh", {
18049
18109
  args: ["-c", `find "${path4}" -name "${glob}" -type f`]
18050
18110
  });
18051
18111
  const lines = output.stdout().split("\n").filter(Boolean);
18052
18112
  return { files: lines };
18053
18113
  },
18054
18114
  searchInFile: async (file, regex) => {
18055
- const output = await this.native.execWithConfig({
18056
- cmd: "grep",
18115
+ const output = await exec(this.native, "grep", {
18057
18116
  args: ["-n", "-E", regex, file]
18058
18117
  });
18059
18118
  const lines = output.stdout().split("\n").filter(Boolean);
@@ -18075,8 +18134,7 @@ var MicrosandboxInstance = class {
18075
18134
  const escapedOld = old_str.replace(new RegExp(`[\\\\${delim}]`, "g"), "\\$&").replace(/\n/g, "\\n");
18076
18135
  const escapedNew = new_str.replace(new RegExp(`[\\\\${delim}]`, "g"), "\\$&").replace(/\n/g, "\\n");
18077
18136
  const flag = replace_mode === "ALL" ? "g" : "";
18078
- await this.native.execWithConfig({
18079
- cmd: "sh",
18137
+ await exec(this.native, "sh", {
18080
18138
  args: ["-c", `sed -i 's${delim}${escapedOld}${delim}${escapedNew}${delim}${flag}' "${path4}"`]
18081
18139
  });
18082
18140
  },
@@ -18092,8 +18150,7 @@ var MicrosandboxInstance = class {
18092
18150
  };
18093
18151
  this.shell = {
18094
18152
  execCommand: async (params) => {
18095
- const output = await this.native.execWithConfig({
18096
- cmd: "sh",
18153
+ const output = await exec(this.native, "sh", {
18097
18154
  args: ["-c", params.command],
18098
18155
  cwd: params.exec_dir,
18099
18156
  timeoutMs: params.timeout ? params.timeout * 1e3 : void 0
@@ -18116,7 +18173,7 @@ var MicrosandboxInstance = class {
18116
18173
  }
18117
18174
  async getStatus() {
18118
18175
  try {
18119
- await this.native.execWithConfig({ cmd: "echo", args: ["ok"] });
18176
+ await this.native.exec("echo", ["ok"]);
18120
18177
  return "running";
18121
18178
  } catch {
18122
18179
  return "unknown";
@@ -18143,7 +18200,7 @@ var MicrosandboxProvider = class {
18143
18200
  this.instances = /* @__PURE__ */ new Map();
18144
18201
  this.creating = /* @__PURE__ */ new Map();
18145
18202
  }
18146
- async createSandbox(name) {
18203
+ async createSandbox(name, config) {
18147
18204
  const existing = this.instances.get(name);
18148
18205
  if (existing) {
18149
18206
  return existing;
@@ -18170,13 +18227,11 @@ var MicrosandboxProvider = class {
18170
18227
  native = void 0;
18171
18228
  }
18172
18229
  if (!native) {
18173
- native = await Sandbox.createDetached({
18174
- name,
18175
- image: this.config.image ?? "python:3.11-slim",
18176
- cpus: this.config.cpus ?? 1,
18177
- memoryMib: this.config.memoryMib ?? 512,
18178
- env: this.config.env
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)
18179
18233
  });
18234
+ native = await builder.createDetached();
18180
18235
  }
18181
18236
  const instance = new MicrosandboxInstance(name, native);
18182
18237
  this.instances.set(name, instance);
@@ -18218,30 +18273,42 @@ var MicrosandboxProvider = class {
18218
18273
 
18219
18274
  // src/sandbox_lattice/pathUtils.ts
18220
18275
  import path3 from "path";
18221
- function isVirtualSandboxPath(inputPath) {
18222
- return inputPath === "~" || inputPath.startsWith("~/") || inputPath.startsWith("/");
18223
- }
18224
- function toSandboxHomePath(inputPath, options = {}) {
18225
- const { homeDir = "/home/daytona", absolute = false } = options;
18226
- if (!isVirtualSandboxPath(inputPath)) {
18227
- return inputPath;
18276
+ var SANDBOX_HOME_DIR = "/home/daytona";
18277
+ function normalizeExternalSandboxPath(inputPath) {
18278
+ if (inputPath === "~") {
18279
+ return "~/";
18228
18280
  }
18229
- let relativePath = inputPath;
18230
- while (relativePath.startsWith("~/") || relativePath.startsWith("/")) {
18231
- if (relativePath.startsWith("~/")) {
18232
- relativePath = relativePath.slice(2);
18233
- } else {
18234
- relativePath = relativePath.slice(1);
18235
- }
18281
+ if (inputPath === SANDBOX_HOME_DIR) {
18282
+ return "~/";
18236
18283
  }
18237
- if (relativePath === "~") {
18238
- relativePath = "";
18284
+ if (inputPath.startsWith(`${SANDBOX_HOME_DIR}/`)) {
18285
+ return `~/${inputPath.slice(SANDBOX_HOME_DIR.length + 1)}`;
18239
18286
  }
18240
- if (!absolute) {
18241
- return relativePath;
18287
+ if (inputPath.startsWith("~/")) {
18288
+ return inputPath;
18289
+ }
18290
+ if (inputPath.startsWith("/")) {
18291
+ return `~${inputPath}`;
18242
18292
  }
18293
+ return inputPath;
18294
+ }
18295
+ function toSandboxRelativePath(inputPath) {
18296
+ const canonicalPath = normalizeExternalSandboxPath(inputPath);
18297
+ return canonicalPath === "~/" ? "" : canonicalPath.slice(2);
18298
+ }
18299
+ function toSandboxAbsolutePath(inputPath, homeDir = SANDBOX_HOME_DIR) {
18300
+ const relativePath = toSandboxRelativePath(inputPath);
18243
18301
  return relativePath ? path3.posix.join(homeDir, relativePath) : homeDir;
18244
18302
  }
18303
+ function fromSandboxExecutionPath(inputPath, homeDir = SANDBOX_HOME_DIR) {
18304
+ if (inputPath === homeDir) {
18305
+ return "~/";
18306
+ }
18307
+ if (inputPath.startsWith(`${homeDir}/`)) {
18308
+ return `~/${inputPath.slice(homeDir.length + 1)}`;
18309
+ }
18310
+ return normalizeExternalSandboxPath(inputPath);
18311
+ }
18245
18312
 
18246
18313
  // src/sandbox_lattice/MicrosandboxRemoteInstance.ts
18247
18314
  var MicrosandboxRemoteInstance = class {
@@ -18251,40 +18318,43 @@ var MicrosandboxRemoteInstance = class {
18251
18318
  readFile: async (file) => {
18252
18319
  const result = await this.client.readFile(
18253
18320
  this.name,
18254
- toSandboxHomePath(file, { absolute: true, homeDir: "/home/daytona" })
18321
+ toSandboxAbsolutePath(file, SANDBOX_HOME_DIR)
18255
18322
  );
18256
18323
  return { content: result.content };
18257
18324
  },
18258
18325
  writeFile: async (file, content) => {
18259
18326
  await this.client.writeFile(
18260
18327
  this.name,
18261
- toSandboxHomePath(file, { absolute: true, homeDir: "/home/daytona" }),
18328
+ toSandboxAbsolutePath(file, SANDBOX_HOME_DIR),
18262
18329
  content
18263
18330
  );
18264
18331
  },
18265
18332
  listPath: async (path4, options) => {
18266
18333
  const result = await this.client.listPath(
18267
18334
  this.name,
18268
- toSandboxHomePath(path4, { absolute: true, homeDir: "/home/daytona" }),
18335
+ toSandboxAbsolutePath(path4, SANDBOX_HOME_DIR),
18269
18336
  options?.recursive
18270
18337
  );
18271
18338
  const files = result.entries.map((entry) => ({
18272
- path: entry.path,
18273
- is_dir: entry.type === "dir"
18339
+ path: fromSandboxExecutionPath(entry.path, SANDBOX_HOME_DIR),
18340
+ is_dir: entry.type === "directory"
18274
18341
  }));
18275
18342
  return { files };
18276
18343
  },
18277
18344
  findFiles: async (path4, glob) => {
18278
- return this.client.findFiles(
18345
+ const result = await this.client.findFiles(
18279
18346
  this.name,
18280
- toSandboxHomePath(path4, { absolute: true, homeDir: "/home/daytona" }),
18347
+ toSandboxAbsolutePath(path4, SANDBOX_HOME_DIR),
18281
18348
  glob
18282
18349
  );
18350
+ return {
18351
+ files: result.files.map((filePath) => fromSandboxExecutionPath(filePath, SANDBOX_HOME_DIR))
18352
+ };
18283
18353
  },
18284
18354
  searchInFile: async (file, regex) => {
18285
18355
  const result = await this.client.searchInFile(
18286
18356
  this.name,
18287
- toSandboxHomePath(file, { absolute: true, homeDir: "/home/daytona" }),
18357
+ toSandboxAbsolutePath(file, SANDBOX_HOME_DIR),
18288
18358
  regex
18289
18359
  );
18290
18360
  return {
@@ -18294,7 +18364,7 @@ var MicrosandboxRemoteInstance = class {
18294
18364
  },
18295
18365
  strReplaceEditor: async (params) => {
18296
18366
  await this.client.replaceInFile(this.name, {
18297
- path: toSandboxHomePath(params.path, { absolute: true, homeDir: "/home/daytona" }),
18367
+ path: toSandboxAbsolutePath(params.path, SANDBOX_HOME_DIR),
18298
18368
  search: params.old_str,
18299
18369
  replace: params.new_str
18300
18370
  });
@@ -18302,14 +18372,14 @@ var MicrosandboxRemoteInstance = class {
18302
18372
  uploadFile: async (params) => {
18303
18373
  await this.client.uploadFile(
18304
18374
  this.name,
18305
- toSandboxHomePath(params.file, { absolute: true, homeDir: "/home/daytona" }),
18375
+ toSandboxAbsolutePath(params.file, SANDBOX_HOME_DIR),
18306
18376
  params.data
18307
18377
  );
18308
18378
  },
18309
18379
  downloadFile: async (params) => {
18310
18380
  const result = await this.client.downloadFile(
18311
18381
  this.name,
18312
- toSandboxHomePath(params.file, { absolute: true, homeDir: "/home/daytona" })
18382
+ toSandboxAbsolutePath(params.file, SANDBOX_HOME_DIR)
18313
18383
  );
18314
18384
  if (result.contentBase64) {
18315
18385
  return Buffer.from(result.contentBase64, "base64");
@@ -18442,6 +18512,53 @@ var MicrosandboxServiceClient = class {
18442
18512
  body: input
18443
18513
  });
18444
18514
  }
18515
+ async volumeFsRead(volumeName, path4) {
18516
+ const result = await this.request(
18517
+ `/api/volumes/${encodeURIComponent(volumeName)}/fs/read`,
18518
+ {
18519
+ method: "POST",
18520
+ body: { path: path4 }
18521
+ }
18522
+ );
18523
+ return result.content;
18524
+ }
18525
+ async volumeFsWrite(volumeName, path4, content) {
18526
+ await this.request(
18527
+ `/api/volumes/${encodeURIComponent(volumeName)}/fs/write`,
18528
+ {
18529
+ method: "POST",
18530
+ body: { path: path4, content }
18531
+ }
18532
+ );
18533
+ }
18534
+ async volumeFsList(volumeName, path4) {
18535
+ const result = await this.request(
18536
+ `/api/volumes/${encodeURIComponent(volumeName)}/fs/list`,
18537
+ {
18538
+ method: "POST",
18539
+ body: { path: path4 }
18540
+ }
18541
+ );
18542
+ return result.entries;
18543
+ }
18544
+ async volumeFsDownload(volumeName, path4) {
18545
+ const result = await this.request(
18546
+ `/api/volumes/${encodeURIComponent(volumeName)}/fs/download?path=${encodeURIComponent(path4)}`,
18547
+ {
18548
+ method: "GET"
18549
+ }
18550
+ );
18551
+ return Buffer.from(result.contentBase64, "base64");
18552
+ }
18553
+ async volumeFsUpload(volumeName, path4, data) {
18554
+ await this.request(
18555
+ `/api/volumes/${encodeURIComponent(volumeName)}/fs/upload`,
18556
+ {
18557
+ method: "POST",
18558
+ body: { path: path4, contentBase64: data.toString("base64") }
18559
+ }
18560
+ );
18561
+ }
18445
18562
  async request(path4, init) {
18446
18563
  const headers = {};
18447
18564
  if (init.body) {
@@ -18483,9 +18600,11 @@ function parseOptionalNumberEnv(name, fallback) {
18483
18600
  }
18484
18601
  function getDefaultMicrosandboxRemoteConfig() {
18485
18602
  return {
18486
- image: process.env.MICROSANDBOX_IMAGE ?? "daytonaio/sandbox:0.6.0",
18603
+ image: process.env.MICROSANDBOX_IMAGE ?? "daytona-cn-shanghai.cr.volces.com/daytona/sandbox:0.0.2",
18604
+ //"daytonaio/sandbox:0.6.0",
18487
18605
  cpus: parseOptionalNumberEnv("MICROSANDBOX_CPUS", 1),
18488
- memoryMib: parseOptionalNumberEnv("MICROSANDBOX_MEMORY", 512)
18606
+ memoryMib: parseOptionalNumberEnv("MICROSANDBOX_MEMORY", 512),
18607
+ user: "root"
18489
18608
  };
18490
18609
  }
18491
18610
  var MicrosandboxRemoteProvider = class {
@@ -18539,6 +18658,15 @@ var MicrosandboxRemoteProvider = class {
18539
18658
  await this.client.deleteSandbox(name);
18540
18659
  this.instances.delete(name);
18541
18660
  }
18661
+ createVolumeFsClient(volumeName) {
18662
+ return {
18663
+ read: (path4) => this.client.volumeFsRead(volumeName, path4),
18664
+ write: (path4, content) => this.client.volumeFsWrite(volumeName, path4, content),
18665
+ list: (path4) => this.client.volumeFsList(volumeName, path4),
18666
+ readRaw: (path4) => this.client.volumeFsDownload(volumeName, path4),
18667
+ writeRaw: (path4, data) => this.client.volumeFsUpload(volumeName, path4, data)
18668
+ };
18669
+ }
18542
18670
  async listSandboxes() {
18543
18671
  return Array.from(this.instances.values());
18544
18672
  }
@@ -18548,7 +18676,10 @@ var MicrosandboxRemoteProvider = class {
18548
18676
  image: this.config.image ?? defaultMicrosandboxRemoteConfig.image,
18549
18677
  cpus: this.config.cpus ?? defaultMicrosandboxRemoteConfig.cpus,
18550
18678
  memoryMib: this.config.memoryMib ?? defaultMicrosandboxRemoteConfig.memoryMib,
18551
- env: this.config.env,
18679
+ env: {
18680
+ ...this.config.env,
18681
+ ...buildSandboxMetadataEnv(config)
18682
+ },
18552
18683
  volumes: config?.volumes ?? this.buildDefaultVolumes(config)
18553
18684
  };
18554
18685
  }
@@ -18557,20 +18688,19 @@ var MicrosandboxRemoteProvider = class {
18557
18688
  const volumes = {
18558
18689
  "/home/daytona/.agents/skills": {
18559
18690
  type: "named",
18560
- name: `${tenantId}-skills`
18691
+ name: buildNamedVolumeName("s", "skills", tenantId)
18561
18692
  }
18562
18693
  };
18563
18694
  if (config?.assistant_id) {
18564
18695
  volumes["/home/daytona/agent"] = {
18565
18696
  type: "named",
18566
- name: `${tenantId}-agent-${config.assistant_id}`
18697
+ name: buildNamedVolumeName("a", "agent", tenantId, config.assistant_id)
18567
18698
  };
18568
18699
  }
18569
18700
  if (config?.projectId) {
18570
- const projectVolumeName = config.workspaceId ? `${tenantId}-workspace-${config.workspaceId}-project-${config.projectId}` : `${tenantId}-project-${config.projectId}`;
18571
18701
  volumes["/home/daytona/project"] = {
18572
18702
  type: "named",
18573
- name: projectVolumeName
18703
+ name: buildNamedVolumeName("p", "project", tenantId, config.workspaceId, config.projectId)
18574
18704
  };
18575
18705
  }
18576
18706
  return volumes;
@@ -18909,26 +19039,18 @@ var DaytonaInstance = class {
18909
19039
  this.native = native;
18910
19040
  this.file = {
18911
19041
  readFile: async (file) => {
18912
- const buffer2 = await this.native.fs.downloadFile(toSandboxHomePath(file));
19042
+ const buffer2 = await this.native.fs.downloadFile(toSandboxRelativePath(file));
18913
19043
  return { content: buffer2.toString("utf-8") };
18914
19044
  },
18915
19045
  writeFile: async (file, content) => {
18916
- await this.native.fs.uploadFile(Buffer.from(content, "utf-8"), toSandboxHomePath(file));
19046
+ await this.native.fs.uploadFile(Buffer.from(content, "utf-8"), toSandboxRelativePath(file));
18917
19047
  },
18918
19048
  listPath: async (path4, options) => {
18919
- const entries = await this.native.fs.listFiles(toSandboxHomePath(path4));
19049
+ const entries = await this.native.fs.listFiles(toSandboxRelativePath(path4));
18920
19050
  const files = entries.map((e) => {
18921
- let name = e.name || "";
18922
- while (name.startsWith("~/") || name.startsWith("/")) {
18923
- if (name.startsWith("~/")) {
18924
- name = name.slice(2);
18925
- } else if (name.startsWith("/")) {
18926
- name = name.slice(1);
18927
- }
18928
- }
18929
- const fullPath = name ? `${path4}/${name}`.replace(/\/+/g, "/") : path4;
19051
+ const rawPath = e.name || "";
18930
19052
  return {
18931
- path: fullPath,
19053
+ path: fromSandboxExecutionPath(rawPath),
18932
19054
  is_dir: e.isDir ?? false,
18933
19055
  size: e.size,
18934
19056
  modified_at: e.modTime ? e.modTime : void 0
@@ -18937,11 +19059,11 @@ var DaytonaInstance = class {
18937
19059
  return { files };
18938
19060
  },
18939
19061
  findFiles: async (path4, glob) => {
18940
- const result = await this.native.fs.searchFiles(toSandboxHomePath(path4), glob);
18941
- return { files: result.files || [] };
19062
+ const result = await this.native.fs.searchFiles(toSandboxRelativePath(path4), glob);
19063
+ return { files: (result.files || []).map((filePath) => fromSandboxExecutionPath(filePath)) };
18942
19064
  },
18943
19065
  searchInFile: async (file, regex) => {
18944
- const matches = await this.native.fs.findFiles(toSandboxHomePath(file), regex);
19066
+ const matches = await this.native.fs.findFiles(toSandboxRelativePath(file), regex);
18945
19067
  const line_numbers = [];
18946
19068
  const matchTexts = [];
18947
19069
  for (const match of matches) {
@@ -18952,7 +19074,7 @@ var DaytonaInstance = class {
18952
19074
  },
18953
19075
  strReplaceEditor: async (params) => {
18954
19076
  const { path: path4, old_str, new_str, replace_mode } = params;
18955
- const relPath = toSandboxHomePath(path4);
19077
+ const relPath = toSandboxRelativePath(path4);
18956
19078
  if (replace_mode === "ALL") {
18957
19079
  await this.native.fs.replaceInFiles([relPath], old_str, new_str);
18958
19080
  } else {
@@ -18966,10 +19088,10 @@ var DaytonaInstance = class {
18966
19088
  }
18967
19089
  },
18968
19090
  uploadFile: async (params) => {
18969
- await this.native.fs.uploadFile(params.data, toSandboxHomePath(params.file));
19091
+ await this.native.fs.uploadFile(params.data, toSandboxRelativePath(params.file));
18970
19092
  },
18971
19093
  downloadFile: async (params) => {
18972
- const buffer2 = await this.native.fs.downloadFile(toSandboxHomePath(params.file));
19094
+ const buffer2 = await this.native.fs.downloadFile(toSandboxRelativePath(params.file));
18973
19095
  return Buffer.isBuffer(buffer2) ? buffer2 : Buffer.from(buffer2);
18974
19096
  }
18975
19097
  };
@@ -19330,7 +19452,6 @@ function clearEncryptionKeyCache() {
19330
19452
  export {
19331
19453
  AGENT_TASK_EVENT,
19332
19454
  Agent,
19333
- AgentConfig,
19334
19455
  AgentInstanceManager,
19335
19456
  AgentLatticeManager,
19336
19457
  AgentManager,
@@ -19349,7 +19470,6 @@ export {
19349
19470
  EmbeddingsLatticeManager,
19350
19471
  FileSystemSkillStore,
19351
19472
  FilesystemBackend,
19352
- GraphBuildOptions,
19353
19473
  HumanMessage3 as HumanMessage,
19354
19474
  InMemoryAssistantStore,
19355
19475
  InMemoryChunkBuffer,
@@ -19403,9 +19523,12 @@ export {
19403
19523
  ThreadStatus2 as ThreadStatus,
19404
19524
  ToolLatticeManager,
19405
19525
  VectorStoreLatticeManager,
19526
+ VolumeFilesystem,
19406
19527
  agentInstanceManager,
19407
19528
  agentLatticeManager,
19408
19529
  buildGrepResultsDict,
19530
+ buildNamedVolumeName,
19531
+ buildSandboxMetadataEnv,
19409
19532
  buildSkillFile,
19410
19533
  checkEmptyContent,
19411
19534
  clearEncryptionKeyCache,