dsh-agentone 0.5.26 → 0.5.27
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/lib/proc.js +24 -6
- package/package.json +1 -1
package/lib/proc.js
CHANGED
|
@@ -47,11 +47,13 @@ function extraBinDirs() {
|
|
|
47
47
|
join(programFilesX86, 'nodejs'),
|
|
48
48
|
join(localAppData, 'Programs', 'nodejs'),
|
|
49
49
|
);
|
|
50
|
-
// npm -g 默认 prefix、pnpm 默认 PNPM_HOME
|
|
51
|
-
//
|
|
52
|
-
// ccpg-cli
|
|
53
|
-
//
|
|
54
|
-
|
|
50
|
+
// npm -g 默认 prefix、pnpm 默认 PNPM_HOME(两种布局都兑底:pnpm 版本/
|
|
51
|
+
// 安装方式差异,全局 bin 可能在 %LOCALAPPDATA%\pnpm 或 ...\pnpm\bin——
|
|
52
|
+
// 后者还是 pnpm -g 的前置校验目录,缺了会拒绝安装),以及 ccpg-cli
|
|
53
|
+
// Windows 官方安装器的落点 %USERPROFILE%\bin(本机实测 C:\Users\<user>\
|
|
54
|
+
// bin\ccpg-cli.exe;装完不重启也能立即探测/自升级)。nodejs.org 安装器
|
|
55
|
+
// 的系统级安装不在这些目录,但那种环境 PATH 里有 node,不需要兑底。
|
|
56
|
+
dirs.push(join(appData, 'npm'), join(localAppData, 'pnpm'), join(localAppData, 'pnpm', 'bin'), join(home, 'bin'));
|
|
55
57
|
// Python 常见安装位(python 探测兑底):python.org 每用户安装位
|
|
56
58
|
// %LOCALAPPDATA%\Programs\Python\Python3xx、机器级 Program Files\
|
|
57
59
|
// Python3xx、Miniconda/Anaconda 默认位。自定义安装位(如
|
|
@@ -612,7 +614,23 @@ export async function installCliTool(tool, { timeoutMs = 600_000 } = {}) {
|
|
|
612
614
|
if (resolveCommandOrNull('npm')) {
|
|
613
615
|
({ stdout } = await runCliTool('npm', ['install', '-g', '@larksuite/cli@latest'], { timeoutMs }));
|
|
614
616
|
} else if (resolveCommandOrNull('pnpm')) {
|
|
615
|
-
|
|
617
|
+
const pnpmInstall = () => runCliTool('pnpm', ['add', '-g', '@larksuite/cli@latest'], { timeoutMs });
|
|
618
|
+
try {
|
|
619
|
+
({ stdout } = await pnpmInstall());
|
|
620
|
+
} catch (error) {
|
|
621
|
+
// pnpm -g 前置校验:自己配置的全局 bin 目录必须在 PATH 里(真实
|
|
622
|
+
// 用户机报 The configured global bin directory "C:\Users\<u>\
|
|
623
|
+
// AppData\Local\pnpm\bin" is not in PATH)。自定义安装位不在兑底
|
|
624
|
+
// 目录里时,从报错原文解析出该目录补进 PATH 重试一次
|
|
625
|
+
const dir = /global bin directory "(.+?)" is not in PATH/i.exec(String(error?.message || ''))?.[1];
|
|
626
|
+
if (!dir) throw error;
|
|
627
|
+
extraBinDirsCache = [...extraBinDirs(), dir];
|
|
628
|
+
try {
|
|
629
|
+
({ stdout } = await pnpmInstall());
|
|
630
|
+
} finally {
|
|
631
|
+
resetExtraBinDirsCache();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
616
634
|
} else if (process.platform === 'win32') {
|
|
617
635
|
const nodeNote = await installNodeWindows(timeoutMs);
|
|
618
636
|
({ stdout } = await runCliTool('npm', ['install', '-g', '@larksuite/cli@latest'], { timeoutMs }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agentone",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.27",
|
|
4
4
|
"description": "AgentOne 平台集成插件:飞书登录、平台模型(同步失败自愈重试)、SkillHub 技能(升级检测一键升级、装后即时刷新、套餐技能自动同步)、套餐申请、插件管理与自助升级、lark-cli / ccpg-cli 探测与一键安装(请求超时与错误码透传、令牌轮换 single-flight、凭据损坏容错与并发安全写入、状态页 UX 增强)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|