engine7 7.1.26 → 7.1.28

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
@@ -184,7 +184,7 @@ function collectRecentSessions(agentsDir, _days = 7) {
184
184
  async function doExport(opts) {
185
185
  const { agentName, stateDir, note, dryRun: dryRun2 } = opts;
186
186
  const workspace = opts.workspace || path.join(stateDir, "workspace");
187
- const engineHome = path.join(os.homedir(), ".openclaw");
187
+ const engineHome = path.join(os.homedir(), ".engine7");
188
188
  console.log(`\u{1F4E6} engine7 export`);
189
189
  console.log(` agent: ${agentName}`);
190
190
  console.log(` state: ${stateDir}`);
@@ -327,7 +327,7 @@ async function doImport(opts) {
327
327
  }
328
328
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
329
329
  const workspace = path.join(stateDir, "workspace").replace(/\\/g, "/");
330
- const engineHome = path.join(os.homedir(), ".openclaw").replace(/\\/g, "/");
330
+ const engineHome = path.join(os.homedir(), ".engine7").replace(/\\/g, "/");
331
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}`);
@@ -691,34 +691,15 @@ function sleep(ms) {
691
691
  }
692
692
 
693
693
  // src/qr-render.ts
694
- var qrcodeModule = null;
695
- async function getQrModule() {
696
- if (qrcodeModule) return qrcodeModule;
697
- try {
698
- qrcodeModule = await import("qrcode-terminal");
699
- } catch {
700
- try {
701
- qrcodeModule = await import("qrcode");
702
- } catch {
703
- throw new Error("\u8BF7\u5148\u5B89\u88C5 qrcode-terminal: npm install qrcode-terminal");
704
- }
705
- }
706
- return qrcodeModule;
707
- }
694
+ import { createRequire } from "node:module";
695
+ var require2 = createRequire(import.meta.url);
708
696
  async function renderQrTerminal(url, options) {
709
- const mod = await getQrModule();
710
697
  return new Promise((resolve2, reject) => {
711
698
  try {
712
- if (mod.generate) {
713
- mod.generate(url, { small: options?.small ?? true }, (output) => {
714
- resolve2(output);
715
- });
716
- } else if (mod.toString) {
717
- const output = mod.toString(url, { type: "terminal", small: options?.small ?? true });
699
+ const qt = require2("qrcode-terminal");
700
+ qt.generate(url, { small: options?.small ?? true }, (output) => {
718
701
  resolve2(output);
719
- } else {
720
- reject(new Error("\u4E0D\u652F\u6301\u7684\u4E8C\u7EF4\u7801\u5E93"));
721
- }
702
+ });
722
703
  } catch (err) {
723
704
  reject(err);
724
705
  }