@axiom-lattice/gateway 2.1.113 → 2.1.114

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/gateway",
3
- "version": "2.1.113",
3
+ "version": "2.1.114",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -583,7 +583,7 @@ export class WorkspaceController {
583
583
  ) {
584
584
  const tenantId = this.getTenantId(request);
585
585
  const { workspaceId, projectId } = request.params;
586
- const assistantId = (request.query as any).assistantId;
586
+ const assistantId = (request.query as any).assistantId || (request.headers["x-assistant-id"] as string);
587
587
 
588
588
  const workspace = await this.workspaceStore.getWorkspaceById(
589
589
  tenantId,
@@ -635,12 +635,12 @@ export class WorkspaceController {
635
635
  ? path.posix.join(pathValue, filename)
636
636
  : path.posix.join("/project/uploads", filename);
637
637
 
638
- // Try volume backend for text files; binary files must use sandbox
639
- // (volume backend's write API is text-based and corrupts binary data)
640
638
  const isBinary = this.isBinaryContentType(filename);
641
639
  const volumeBackend = await sandboxManager.getVolumeBackendForPath(volumeConfig, realPath);
642
640
  if (volumeBackend && !isBinary) {
643
641
  await volumeBackend.write(realPath, buffer.toString("utf-8"));
642
+ } else if (volumeBackend && volumeBackend.writeBinary) {
643
+ await volumeBackend.writeBinary(realPath, buffer);
644
644
  } else {
645
645
  const sandbox = await sandboxManager.getSandboxFromConfig(volumeConfig);
646
646
  await sandbox.file.uploadFile({ file: realPath, data: buffer });