@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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +19 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/controllers/workspace.ts +12 -0
- package/src/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiom-lattice/gateway",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.95",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"redis": "^5.0.1",
|
|
41
41
|
"uuid": "^9.0.1",
|
|
42
42
|
"zod": "3.25.76",
|
|
43
|
-
"@axiom-lattice/agent-eval": "2.1.
|
|
44
|
-
"@axiom-lattice/core": "2.1.
|
|
45
|
-
"@axiom-lattice/pg-stores": "1.0.
|
|
43
|
+
"@axiom-lattice/agent-eval": "2.1.77",
|
|
44
|
+
"@axiom-lattice/core": "2.1.83",
|
|
45
|
+
"@axiom-lattice/pg-stores": "1.0.74",
|
|
46
46
|
"@axiom-lattice/protocols": "2.1.43",
|
|
47
47
|
"@axiom-lattice/queue-redis": "1.0.42"
|
|
48
48
|
},
|
|
@@ -262,6 +262,8 @@ export class WorkspaceController {
|
|
|
262
262
|
throw new Error("Workspace not found");
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
console.log(`[getBackend] storageType=${workspace.storageType} filePath=${filePath}`);
|
|
266
|
+
|
|
265
267
|
if (workspace.storageType === "sandbox") {
|
|
266
268
|
const sandboxManager = getSandBoxManager();
|
|
267
269
|
|
|
@@ -273,18 +275,23 @@ export class WorkspaceController {
|
|
|
273
275
|
projectId,
|
|
274
276
|
};
|
|
275
277
|
|
|
278
|
+
console.log(`[getBackend] trying volume backend for path=${filePath} assistant_id=${assistantId}`);
|
|
276
279
|
const volumeBackend = await sandboxManager.getVolumeBackendForPath(volumeConfig, filePath || "/project");
|
|
277
280
|
if (volumeBackend) {
|
|
281
|
+
console.log(`[getBackend] using VolumeFilesystem`);
|
|
278
282
|
return { backend: volumeBackend, workspace };
|
|
279
283
|
}
|
|
280
284
|
|
|
285
|
+
console.log(`[getBackend] volume not found, falling back to SandboxFilesystem`);
|
|
281
286
|
const sandbox = await sandboxManager.getSandboxFromConfig(volumeConfig);
|
|
287
|
+
console.log(`[getBackend] sandbox acquired, name=${(sandbox as any).name || "unknown"}`);
|
|
282
288
|
return {
|
|
283
289
|
backend: new SandboxFilesystem({
|
|
284
290
|
sandboxInstance: sandbox,
|
|
285
291
|
}), workspace
|
|
286
292
|
};
|
|
287
293
|
} else {
|
|
294
|
+
console.log(`[getBackend] using FilesystemBackend rootDir=/lattice_store/tenants/${tenantId}/workspaces/${workspaceId}/${projectId}`);
|
|
288
295
|
return {
|
|
289
296
|
backend: new FilesystemBackend({
|
|
290
297
|
rootDir: `/lattice_store/tenants/${tenantId}/workspaces/${workspaceId}/${projectId}`,
|
|
@@ -549,8 +556,13 @@ export class WorkspaceController {
|
|
|
549
556
|
const path = (request.query.path as string) || "/";
|
|
550
557
|
const assistantId = request.query.assistantId;
|
|
551
558
|
|
|
559
|
+
console.log(`[listPath] tenantId=${tenantId} workspaceId=${workspaceId} projectId=${projectId} path=${path} assistantId=${assistantId}`);
|
|
560
|
+
|
|
552
561
|
const { backend } = await this.getBackend(tenantId, workspaceId, projectId, assistantId, path);
|
|
562
|
+
console.log(`[listPath] backend type=${backend.constructor.name} calling lsInfo(${path})`);
|
|
563
|
+
|
|
553
564
|
const files = await backend.lsInfo(path);
|
|
565
|
+
console.log(`[listPath] result count=${files.length}`);
|
|
554
566
|
|
|
555
567
|
return { success: true, data: files };
|
|
556
568
|
}
|
package/src/index.ts
CHANGED
|
@@ -125,6 +125,11 @@ app.addHook("preHandler", async (request, reply) => {
|
|
|
125
125
|
// Public routes don't require authentication
|
|
126
126
|
if (PUBLIC_ROUTES.some((r) => request.url === r)) return;
|
|
127
127
|
|
|
128
|
+
// Allow direct URL access for iframe endpoints (viewfile, downloadfile)
|
|
129
|
+
// These carry tenant context via query params and are accessed by iframes
|
|
130
|
+
const urlPath = request.url.split("?")[0];
|
|
131
|
+
if (urlPath.includes("/viewfile") || urlPath.includes("/downloadfile")) return;
|
|
132
|
+
|
|
128
133
|
return reply.status(401).send({
|
|
129
134
|
success: false,
|
|
130
135
|
error: "Unauthorized - Missing or invalid token",
|