test-wuying-agentbay-sdk 0.13.1-beta.20251223163333 → 0.13.1-beta.20251223194518

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.cjs CHANGED
@@ -13235,10 +13235,11 @@ var _FileTransfer = class _FileTransfer {
13235
13235
  error: `Upload exception: ${e.message || e}`
13236
13236
  };
13237
13237
  }
13238
+ const remoteDir = this.remoteDir(remotePath);
13238
13239
  let reqIdSync;
13239
13240
  try {
13240
13241
  logDebug("Triggering sync to cloud disk");
13241
- reqIdSync = await this.awaitSync("download", remotePath, this.contextId);
13242
+ reqIdSync = await this.awaitSync("download", remoteDir, this.contextId);
13242
13243
  } catch (e) {
13243
13244
  return {
13244
13245
  success: false,
@@ -13258,7 +13259,7 @@ var _FileTransfer = class _FileTransfer {
13258
13259
  if (wait) {
13259
13260
  const { success, error } = await this.waitForTask({
13260
13261
  contextId: this.contextId,
13261
- remotePath,
13262
+ remotePath: remoteDir,
13262
13263
  taskType: "download",
13263
13264
  timeout: waitTimeout,
13264
13265
  interval: pollInterval
@@ -13328,9 +13329,10 @@ var _FileTransfer = class _FileTransfer {
13328
13329
  };
13329
13330
  }
13330
13331
  }
13332
+ const remoteDir = this.remoteDir(remotePath);
13331
13333
  let reqIdSync;
13332
13334
  try {
13333
- reqIdSync = await this.awaitSync("upload", remotePath, this.contextId);
13335
+ reqIdSync = await this.awaitSync("upload", remoteDir, this.contextId);
13334
13336
  } catch (e) {
13335
13337
  return {
13336
13338
  success: false,
@@ -13344,7 +13346,7 @@ var _FileTransfer = class _FileTransfer {
13344
13346
  if (wait) {
13345
13347
  const { success, error } = await this.waitForTask({
13346
13348
  contextId: this.contextId,
13347
- remotePath,
13349
+ remotePath: remoteDir,
13348
13350
  taskType: "upload",
13349
13351
  timeout: waitTimeout,
13350
13352
  interval: pollInterval
@@ -13438,6 +13440,18 @@ var _FileTransfer = class _FileTransfer {
13438
13440
  }
13439
13441
  }
13440
13442
  // ========== Internal Utilities ==========
13443
+ /**
13444
+ * Ensure sync path is a directory: strip filename, keep directory inputs.
13445
+ */
13446
+ remoteDir(remotePath) {
13447
+ if (!remotePath) return "";
13448
+ if (remotePath.endsWith("/")) {
13449
+ const trimmed = remotePath.replace(/\/+$/, "");
13450
+ return trimmed || "/";
13451
+ }
13452
+ const dir = path4.posix.dirname(remotePath);
13453
+ return dir === "." ? "/" : dir;
13454
+ }
13441
13455
  /**
13442
13456
  * Compatibility wrapper for session.context.sync which may be sync or async:
13443
13457
  * - Try async call first