engine7 7.1.19 → 7.1.21

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.mjs CHANGED
@@ -326,27 +326,33 @@ async function doImport(opts) {
326
326
  process.exit(1);
327
327
  }
328
328
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
329
- const workspace = path.join(stateDir, "workspace");
330
- const engineHome = path.join(os.homedir(), ".openclaw");
331
- const dirs = { workspace, stateDir, engineHome };
329
+ const workspace = path.join(stateDir, "workspace").replace(/\\/g, "/");
330
+ const engineHome = path.join(os.homedir(), ".openclaw").replace(/\\/g, "/");
331
+ const dirs = { workspace, stateDir: stateDir.replace(/\\/g, "/"), engineHome };
332
332
  console.log(` \u7248\u672C: ${manifest.version}`);
333
333
  console.log(` \u521B\u5EFA: ${manifest.createdAt}`);
334
334
  console.log(` \u6587\u4EF6\u6570: ${manifest.fileCount}`);
335
335
  const wsStaging = path.join(stagingDir, "workspace");
336
336
  let restoredCount = 0;
337
+ let skipCount = 0;
337
338
  if (fs.existsSync(wsStaging)) {
338
339
  const allFiles = collectAllFiles(wsStaging);
339
340
  for (const srcFile of allFiles) {
340
341
  const relPath = path.relative(wsStaging, srcFile);
341
342
  const destFile = path.join(workspace, relPath);
342
343
  fs.mkdirSync(path.dirname(destFile), { recursive: true });
343
- if (isTextFile(srcFile)) {
344
- const content = fs.readFileSync(srcFile, "utf-8");
345
- fs.writeFileSync(destFile, restoreContent(content, dirs));
346
- } else {
347
- fs.copyFileSync(srcFile, destFile);
344
+ try {
345
+ if (isTextFile(srcFile)) {
346
+ const content = fs.readFileSync(srcFile, "utf-8");
347
+ fs.writeFileSync(destFile, restoreContent(content, dirs));
348
+ } else {
349
+ fs.copyFileSync(srcFile, destFile);
350
+ }
351
+ restoredCount++;
352
+ } catch (e) {
353
+ skipCount++;
354
+ console.log(` \u26A0\uFE0F \u8DF3\u8FC7: ${path.relative(wsStaging, srcFile)} (${e.code || e.message})`);
348
355
  }
349
- restoredCount++;
350
356
  }
351
357
  }
352
358
  const agentsStaging = path.join(stagingDir, "agents");
@@ -377,7 +383,7 @@ async function doImport(opts) {
377
383
  restoredCount++;
378
384
  }
379
385
  }
380
- console.log(`\u2705 \u6062\u590D\u5B8C\u6210: ${restoredCount} \u6587\u4EF6 \u2192 ${stateDir}`);
386
+ console.log(`\u2705 \u6062\u590D\u5B8C\u6210: ${restoredCount} \u6587\u4EF6 \u2192 ${stateDir}${skipCount ? ` (\u8DF3\u8FC7 ${skipCount})` : ""}`);
381
387
  const platformConfigName = process.platform === "darwin" ? "xiaoke-mac.json" : "xiaoke-win.json";
382
388
  const restoredConfigPath = path.join(stateDir, "configs", platformConfigName);
383
389
  const configToUse = fs.existsSync(restoredConfigPath) ? restoredConfigPath : path.join(stateDir, "configs", "xiaoke.json");
@@ -543,7 +549,8 @@ var init_cli_travel = __esm({
543
549
  "test-agent",
544
550
  "nul",
545
551
  "*.bak*",
546
- "*.bak-*"
552
+ "*.bak-*",
553
+ "~$*"
547
554
  ]);
548
555
  TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
549
556
  ".md",