@workclaw/cli 1.0.31 → 1.0.311
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.
|
@@ -197,7 +197,7 @@ class BoxInstaller {
|
|
|
197
197
|
this.spinner.text = chalk.cyan("正在安装插件...");
|
|
198
198
|
try {
|
|
199
199
|
await execAsync$1(
|
|
200
|
-
`openclaw plugins install ${PLUGIN_PACKAGE_NAME$1} --dangerously-force-unsafe-install
|
|
200
|
+
`openclaw plugins install ${PLUGIN_PACKAGE_NAME$1} --dangerously-force-unsafe-install`,
|
|
201
201
|
{ timeout: 12e4 }
|
|
202
202
|
);
|
|
203
203
|
debugLog("[安装插件] openclaw plugins install 执行成功");
|
|
@@ -4744,55 +4744,19 @@ class LocalInstaller {
|
|
|
4744
4744
|
debugLog("[安装插件] 创建扩展目录...");
|
|
4745
4745
|
await fs.mkdir(paths.extensions, { recursive: true });
|
|
4746
4746
|
debugLog(`[安装插件] 扩展目录: ${paths.extensions}`);
|
|
4747
|
-
debugLog("[安装插件]
|
|
4747
|
+
debugLog("[安装插件] 执行 openclaw plugins install 命令");
|
|
4748
4748
|
try {
|
|
4749
|
-
await fs.mkdir(paths.target, { recursive: true });
|
|
4750
|
-
const packageJson = {
|
|
4751
|
-
name: "temp-install",
|
|
4752
|
-
version: "1.0.0",
|
|
4753
|
-
private: true
|
|
4754
|
-
};
|
|
4755
|
-
await fs.writeFile(
|
|
4756
|
-
path.join(paths.target, "package.json"),
|
|
4757
|
-
JSON.stringify(packageJson, null, 2)
|
|
4758
|
-
);
|
|
4759
|
-
debugLog(`[安装插件] 执行 pnpm add ${PLUGIN_PACKAGE_NAME}`);
|
|
4760
4749
|
await execAsync(
|
|
4761
|
-
`
|
|
4762
|
-
{
|
|
4750
|
+
`openclaw plugins install ${PLUGIN_PACKAGE_NAME} --dangerously-force-unsafe-install --pin`,
|
|
4751
|
+
{ timeout: 12e4 }
|
|
4763
4752
|
);
|
|
4764
|
-
|
|
4765
|
-
const files = await fs.readdir(nodeModulesPath);
|
|
4766
|
-
for (const file of files) {
|
|
4767
|
-
const srcPath = path.join(nodeModulesPath, file);
|
|
4768
|
-
const destPath = path.join(paths.target, file);
|
|
4769
|
-
await fs.rename(srcPath, destPath);
|
|
4770
|
-
}
|
|
4771
|
-
await fs.rm(path.join(paths.target, "node_modules"), { recursive: true, force: true });
|
|
4772
|
-
await fs.unlink(path.join(paths.target, "package.json"));
|
|
4773
|
-
if (await fs.access(path.join(paths.target, "pnpm-lock.yaml")).then(() => true).catch(() => false)) {
|
|
4774
|
-
await fs.unlink(path.join(paths.target, "pnpm-lock.yaml"));
|
|
4775
|
-
}
|
|
4776
|
-
debugLog("[安装插件] pnpm 安装完成");
|
|
4753
|
+
debugLog("[安装插件] openclaw plugins install 执行成功");
|
|
4777
4754
|
this.prefixText += chalk.green(` ✓ 插件安装完成
|
|
4778
4755
|
`);
|
|
4779
4756
|
} catch (error) {
|
|
4780
4757
|
const errorMsg = error.message || "未知错误";
|
|
4781
4758
|
debugLog(`[安装插件] 安装失败: ${errorMsg}`);
|
|
4782
|
-
|
|
4783
|
-
try {
|
|
4784
|
-
await execAsync(
|
|
4785
|
-
`openclaw plugins install ${PLUGIN_PACKAGE_NAME} --dangerously-force-unsafe-install`,
|
|
4786
|
-
{ timeout: 12e4 }
|
|
4787
|
-
);
|
|
4788
|
-
debugLog("[安装插件] openclaw plugins install 执行成功");
|
|
4789
|
-
this.prefixText += chalk.green(` ✓ 插件安装完成
|
|
4790
|
-
`);
|
|
4791
|
-
} catch (fallbackError) {
|
|
4792
|
-
const fallbackErrorMsg = fallbackError.message || "未知错误";
|
|
4793
|
-
debugLog(`[安装插件] openclaw 安装也失败: ${fallbackErrorMsg}`);
|
|
4794
|
-
throw new AppError2(ERROR_CODES.NPM_INSTALL_FAILED, `插件安装失败: ${fallbackErrorMsg}`);
|
|
4795
|
-
}
|
|
4759
|
+
throw new AppError2(ERROR_CODES.NPM_INSTALL_FAILED, `插件安装失败: ${errorMsg}`);
|
|
4796
4760
|
}
|
|
4797
4761
|
}
|
|
4798
4762
|
async doUpdateConfig(paths, boundConfig, env) {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../src/local/installer/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6B,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAsD/E,qBAAa,cAAc;IAIb,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEX,MAAM,EAAE,oBAAoB;IAIhD,cAAc,IAAI,IAAI;IAYhB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoC9B,aAAa,IAAI,MAAM;YAIT,OAAO;YAoBP,kBAAkB;YAalB,eAAe;YAmBf,iBAAiB;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../../src/local/installer/installer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6B,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAsD/E,qBAAa,cAAc;IAIb,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEX,MAAM,EAAE,oBAAoB;IAIhD,cAAc,IAAI,IAAI;IAYhB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoC9B,aAAa,IAAI,MAAM;YAIT,OAAO;YAoBP,kBAAkB;YAalB,eAAe;YAmBf,iBAAiB;YAyBjB,cAAc;CA+M7B"}
|