@axiom-lattice/gateway 2.1.93 → 2.1.95

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
@@ -3304,6 +3304,7 @@ var WorkspaceController = class {
3304
3304
  if (!workspace) {
3305
3305
  throw new Error("Workspace not found");
3306
3306
  }
3307
+ console.log(`[getBackend] storageType=${workspace.storageType} filePath=${filePath}`);
3307
3308
  if (workspace.storageType === "sandbox") {
3308
3309
  const sandboxManager = getSandBoxManager3();
3309
3310
  const volumeConfig = {
@@ -3313,11 +3314,15 @@ var WorkspaceController = class {
3313
3314
  workspaceId,
3314
3315
  projectId
3315
3316
  };
3317
+ console.log(`[getBackend] trying volume backend for path=${filePath} assistant_id=${assistantId}`);
3316
3318
  const volumeBackend = await sandboxManager.getVolumeBackendForPath(volumeConfig, filePath || "/project");
3317
3319
  if (volumeBackend) {
3320
+ console.log(`[getBackend] using VolumeFilesystem`);
3318
3321
  return { backend: volumeBackend, workspace };
3319
3322
  }
3323
+ console.log(`[getBackend] volume not found, falling back to SandboxFilesystem`);
3320
3324
  const sandbox = await sandboxManager.getSandboxFromConfig(volumeConfig);
3325
+ console.log(`[getBackend] sandbox acquired, name=${sandbox.name || "unknown"}`);
3321
3326
  return {
3322
3327
  backend: new SandboxFilesystem({
3323
3328
  sandboxInstance: sandbox
@@ -3325,6 +3330,7 @@ var WorkspaceController = class {
3325
3330
  workspace
3326
3331
  };
3327
3332
  } else {
3333
+ console.log(`[getBackend] using FilesystemBackend rootDir=/lattice_store/tenants/${tenantId}/workspaces/${workspaceId}/${projectId}`);
3328
3334
  return {
3329
3335
  backend: new FilesystemBackend({
3330
3336
  rootDir: `/lattice_store/tenants/${tenantId}/workspaces/${workspaceId}/${projectId}`,
@@ -3541,8 +3547,11 @@ var WorkspaceController = class {
3541
3547
  const { workspaceId, projectId } = request.params;
3542
3548
  const path3 = request.query.path || "/";
3543
3549
  const assistantId = request.query.assistantId;
3550
+ console.log(`[listPath] tenantId=${tenantId} workspaceId=${workspaceId} projectId=${projectId} path=${path3} assistantId=${assistantId}`);
3544
3551
  const { backend } = await this.getBackend(tenantId, workspaceId, projectId, assistantId, path3);
3552
+ console.log(`[listPath] backend type=${backend.constructor.name} calling lsInfo(${path3})`);
3545
3553
  const files = await backend.lsInfo(path3);
3554
+ console.log(`[listPath] result count=${files.length}`);
3546
3555
  return { success: true, data: files };
3547
3556
  }
3548
3557
  async readFile(request) {
@@ -8218,6 +8227,8 @@ app.addHook("preHandler", async (request, reply) => {
8218
8227
  if (!authRequired) return;
8219
8228
  if (request.method === "OPTIONS") return;
8220
8229
  if (PUBLIC_ROUTES.some((r) => request.url === r)) return;
8230
+ const urlPath = request.url.split("?")[0];
8231
+ if (urlPath.includes("/viewfile") || urlPath.includes("/downloadfile")) return;
8221
8232
  return reply.status(401).send({
8222
8233
  success: false,
8223
8234
  error: "Unauthorized - Missing or invalid token"