@hasna/files 0.2.12 → 0.2.14

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
@@ -149324,7 +149324,7 @@ function extractGoogleError(body) {
149324
149324
  }
149325
149325
  var package_default2 = {
149326
149326
  name: "@hasna/connectors",
149327
- version: "1.3.28",
149327
+ version: "1.3.29",
149328
149328
  description: "Open source connector library - Install API connectors with a single command",
149329
149329
  type: "module",
149330
149330
  bin: {
@@ -167875,13 +167875,19 @@ function buildImportedPath(config9, item, importedName) {
167875
167875
  if (config9.path_mode === "id_based") {
167876
167876
  return posix.join("google-drive", safePathSegment(config9.profile), safePathSegment(item.drive_id), item.id, importedName);
167877
167877
  }
167878
- const itemPath = item.path === item.name ? importedName : posix.join(dirname5(item.path), importedName);
167878
+ const storageName = appendDriveFileId(importedName, item.id);
167879
+ const itemPath = item.path === item.name ? storageName : posix.join(dirname5(item.path), storageName);
167879
167880
  const driveSegment = item.drive_id === "my-drive" ? "my-drive" : safePathSegment(item.drive_name || item.drive_id);
167880
167881
  return posix.join("google-drive", safePathSegment(config9.profile), driveSegment, itemPath);
167881
167882
  }
167882
167883
  function safePathSegment(value) {
167883
167884
  return value.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "_").replace(/\s+/g, " ").trim() || "unnamed";
167884
167885
  }
167886
+ function appendDriveFileId(filename, fileId) {
167887
+ const ext = extname5(filename);
167888
+ const base = ext ? filename.slice(0, -ext.length) : filename;
167889
+ return `${base} (${safePathSegment(fileId)})${ext}`;
167890
+ }
167885
167891
  function toApiFile(item) {
167886
167892
  return {
167887
167893
  id: item.id,
package/dist/index.js CHANGED
@@ -145914,7 +145914,7 @@ function extractGoogleError(body) {
145914
145914
  }
145915
145915
  var package_default2 = {
145916
145916
  name: "@hasna/connectors",
145917
- version: "1.3.28",
145917
+ version: "1.3.29",
145918
145918
  description: "Open source connector library - Install API connectors with a single command",
145919
145919
  type: "module",
145920
145920
  bin: {
@@ -164468,13 +164468,19 @@ function buildImportedPath(config9, item, importedName) {
164468
164468
  if (config9.path_mode === "id_based") {
164469
164469
  return posix.join("google-drive", safePathSegment(config9.profile), safePathSegment(item.drive_id), item.id, importedName);
164470
164470
  }
164471
- const itemPath = item.path === item.name ? importedName : posix.join(dirname5(item.path), importedName);
164471
+ const storageName = appendDriveFileId(importedName, item.id);
164472
+ const itemPath = item.path === item.name ? storageName : posix.join(dirname5(item.path), storageName);
164472
164473
  const driveSegment = item.drive_id === "my-drive" ? "my-drive" : safePathSegment(item.drive_name || item.drive_id);
164473
164474
  return posix.join("google-drive", safePathSegment(config9.profile), driveSegment, itemPath);
164474
164475
  }
164475
164476
  function safePathSegment(value) {
164476
164477
  return value.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "_").replace(/\s+/g, " ").trim() || "unnamed";
164477
164478
  }
164479
+ function appendDriveFileId(filename, fileId) {
164480
+ const ext = extname5(filename);
164481
+ const base = ext ? filename.slice(0, -ext.length) : filename;
164482
+ return `${base} (${safePathSegment(fileId)})${ext}`;
164483
+ }
164478
164484
  function toApiFile(item) {
164479
164485
  return {
164480
164486
  id: item.id,
package/dist/mcp/index.js CHANGED
@@ -164853,7 +164853,7 @@ function extractGoogleError(body) {
164853
164853
  }
164854
164854
  var package_default2 = {
164855
164855
  name: "@hasna/connectors",
164856
- version: "1.3.28",
164856
+ version: "1.3.29",
164857
164857
  description: "Open source connector library - Install API connectors with a single command",
164858
164858
  type: "module",
164859
164859
  bin: {
@@ -183399,13 +183399,19 @@ function buildImportedPath(config9, item, importedName) {
183399
183399
  if (config9.path_mode === "id_based") {
183400
183400
  return posix.join("google-drive", safePathSegment(config9.profile), safePathSegment(item.drive_id), item.id, importedName);
183401
183401
  }
183402
- const itemPath = item.path === item.name ? importedName : posix.join(dirname5(item.path), importedName);
183402
+ const storageName = appendDriveFileId(importedName, item.id);
183403
+ const itemPath = item.path === item.name ? storageName : posix.join(dirname5(item.path), storageName);
183403
183404
  const driveSegment = item.drive_id === "my-drive" ? "my-drive" : safePathSegment(item.drive_name || item.drive_id);
183404
183405
  return posix.join("google-drive", safePathSegment(config9.profile), driveSegment, itemPath);
183405
183406
  }
183406
183407
  function safePathSegment(value) {
183407
183408
  return value.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "_").replace(/\s+/g, " ").trim() || "unnamed";
183408
183409
  }
183410
+ function appendDriveFileId(filename, fileId) {
183411
+ const ext = extname5(filename);
183412
+ const base = ext ? filename.slice(0, -ext.length) : filename;
183413
+ return `${base} (${safePathSegment(fileId)})${ext}`;
183414
+ }
183409
183415
  function toApiFile(item) {
183410
183416
  return {
183411
183417
  id: item.id,
@@ -145673,7 +145673,7 @@ function extractGoogleError(body) {
145673
145673
  }
145674
145674
  var package_default2 = {
145675
145675
  name: "@hasna/connectors",
145676
- version: "1.3.28",
145676
+ version: "1.3.29",
145677
145677
  description: "Open source connector library - Install API connectors with a single command",
145678
145678
  type: "module",
145679
145679
  bin: {
@@ -164138,13 +164138,19 @@ function buildImportedPath(config9, item, importedName) {
164138
164138
  if (config9.path_mode === "id_based") {
164139
164139
  return posix.join("google-drive", safePathSegment(config9.profile), safePathSegment(item.drive_id), item.id, importedName);
164140
164140
  }
164141
- const itemPath = item.path === item.name ? importedName : posix.join(dirname5(item.path), importedName);
164141
+ const storageName = appendDriveFileId(importedName, item.id);
164142
+ const itemPath = item.path === item.name ? storageName : posix.join(dirname5(item.path), storageName);
164142
164143
  const driveSegment = item.drive_id === "my-drive" ? "my-drive" : safePathSegment(item.drive_name || item.drive_id);
164143
164144
  return posix.join("google-drive", safePathSegment(config9.profile), driveSegment, itemPath);
164144
164145
  }
164145
164146
  function safePathSegment(value) {
164146
164147
  return value.replace(/[\\/:*?"<>|\u0000-\u001f]/g, "_").replace(/\s+/g, " ").trim() || "unnamed";
164147
164148
  }
164149
+ function appendDriveFileId(filename, fileId) {
164150
+ const ext = extname5(filename);
164151
+ const base = ext ? filename.slice(0, -ext.length) : filename;
164152
+ return `${base} (${safePathSegment(fileId)})${ext}`;
164153
+ }
164148
164154
  function toApiFile(item) {
164149
164155
  return {
164150
164156
  id: item.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/files",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
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",
@@ -66,7 +66,7 @@
66
66
  "@aws-sdk/lib-storage": "^3.744.0",
67
67
  "@aws-sdk/s3-request-presigner": "^3.1009.0",
68
68
  "@hasna/cloud": "^0.1.24",
69
- "@hasna/connectors": "^1.3.28",
69
+ "@hasna/connectors": "^1.3.29",
70
70
  "@modelcontextprotocol/sdk": "^1.10.1",
71
71
  "@noble/hashes": "^1.7.2",
72
72
  "chalk": "^5.4.1",