@hasna/files 0.2.25 → 0.2.27

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/cli/index.js CHANGED
@@ -167918,14 +167918,15 @@ async function importGoogleDriveItem(client2, item, config9, destinationSource,
167918
167918
  };
167919
167919
  }
167920
167920
  function shouldStreamGoogleDriveItem(client2, item, storageType) {
167921
- return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && item.size >= STREAM_TO_S3_THRESHOLD_BYTES;
167921
+ return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && (!item.size || item.size >= STREAM_TO_S3_THRESHOLD_BYTES);
167922
167922
  }
167923
167923
  async function importGoogleDriveStream(source, storageType, item, config9, downloaded) {
167924
167924
  const importedName = basename5(downloaded.filename);
167925
167925
  const importedPath = buildImportedPath(config9, item, importedName);
167926
167926
  const contentType = downloaded.mimeType || ($lookup(downloaded.filename) || item.mime || "application/octet-stream");
167927
- const size = downloaded.size ?? item.size;
167928
- const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, size);
167927
+ const contentLength = downloaded.size && downloaded.size > 0 ? downloaded.size : item.size > 0 ? item.size : undefined;
167928
+ const size = contentLength ?? 0;
167929
+ const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, contentLength);
167929
167930
  return {
167930
167931
  importedName,
167931
167932
  importedPath,
package/dist/index.js CHANGED
@@ -164511,14 +164511,15 @@ async function importGoogleDriveItem(client2, item, config9, destinationSource,
164511
164511
  };
164512
164512
  }
164513
164513
  function shouldStreamGoogleDriveItem(client2, item, storageType) {
164514
- return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && item.size >= STREAM_TO_S3_THRESHOLD_BYTES;
164514
+ return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && (!item.size || item.size >= STREAM_TO_S3_THRESHOLD_BYTES);
164515
164515
  }
164516
164516
  async function importGoogleDriveStream(source, storageType, item, config9, downloaded) {
164517
164517
  const importedName = basename5(downloaded.filename);
164518
164518
  const importedPath = buildImportedPath(config9, item, importedName);
164519
164519
  const contentType = downloaded.mimeType || ($lookup(downloaded.filename) || item.mime || "application/octet-stream");
164520
- const size = downloaded.size ?? item.size;
164521
- const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, size);
164520
+ const contentLength = downloaded.size && downloaded.size > 0 ? downloaded.size : item.size > 0 ? item.size : undefined;
164521
+ const size = contentLength ?? 0;
164522
+ const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, contentLength);
164522
164523
  return {
164523
164524
  importedName,
164524
164525
  importedPath,
package/dist/mcp/index.js CHANGED
@@ -183442,14 +183442,15 @@ async function importGoogleDriveItem(client2, item, config9, destinationSource,
183442
183442
  };
183443
183443
  }
183444
183444
  function shouldStreamGoogleDriveItem(client2, item, storageType) {
183445
- return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && item.size >= STREAM_TO_S3_THRESHOLD_BYTES;
183445
+ return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && (!item.size || item.size >= STREAM_TO_S3_THRESHOLD_BYTES);
183446
183446
  }
183447
183447
  async function importGoogleDriveStream(source, storageType, item, config9, downloaded) {
183448
183448
  const importedName = basename5(downloaded.filename);
183449
183449
  const importedPath = buildImportedPath(config9, item, importedName);
183450
183450
  const contentType = downloaded.mimeType || ($lookup(downloaded.filename) || item.mime || "application/octet-stream");
183451
- const size = downloaded.size ?? item.size;
183452
- const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, size);
183451
+ const contentLength = downloaded.size && downloaded.size > 0 ? downloaded.size : item.size > 0 ? item.size : undefined;
183452
+ const size = contentLength ?? 0;
183453
+ const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, contentLength);
183453
183454
  return {
183454
183455
  importedName,
183455
183456
  importedPath,
@@ -164181,14 +164181,15 @@ async function importGoogleDriveItem(client2, item, config9, destinationSource,
164181
164181
  };
164182
164182
  }
164183
164183
  function shouldStreamGoogleDriveItem(client2, item, storageType) {
164184
- return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && item.size >= STREAM_TO_S3_THRESHOLD_BYTES;
164184
+ return storageType === "s3" && typeof client2.downloadFileStream === "function" && !item.mime.startsWith("application/vnd.google-apps.") && (!item.size || item.size >= STREAM_TO_S3_THRESHOLD_BYTES);
164185
164185
  }
164186
164186
  async function importGoogleDriveStream(source, storageType, item, config9, downloaded) {
164187
164187
  const importedName = basename5(downloaded.filename);
164188
164188
  const importedPath = buildImportedPath(config9, item, importedName);
164189
164189
  const contentType = downloaded.mimeType || ($lookup(downloaded.filename) || item.mime || "application/octet-stream");
164190
- const size = downloaded.size ?? item.size;
164191
- const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, size);
164190
+ const contentLength = downloaded.size && downloaded.size > 0 ? downloaded.size : item.size > 0 ? item.size : undefined;
164191
+ const size = contentLength ?? 0;
164192
+ const storageKey = await writeStreamToDestination(source, storageType, importedPath, downloaded.body, contentType, contentLength);
164192
164193
  return {
164193
164194
  importedName,
164194
164195
  importedPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/files",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "description": "Agent-first file management — index local folders and S3 buckets, sync Google Drive, tag, search, and retrieve files via CLI + MCP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",