luminae-helper 1.1.0 → 1.1.2
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/CHANGELOG.md +10 -0
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/lib/installer.js +7 -0
- package/src/lib/ui.js +12 -0
- package/src/utils/platform.js +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
- 安装时目标已存在且非本工具安装(缺 `managed-by`)→ 跳过并在结果表标「已跳过」,不再覆盖用户自建技能目录。
|
|
6
|
+
- 复制技能目录时跳过软链,避免把包外文件内容带进工具目录。
|
|
7
|
+
- 移除未使用的 `runCommand`(原实现在 win32 下启用 shell)。
|
|
8
|
+
|
|
9
|
+
## 1.1.1
|
|
10
|
+
|
|
11
|
+
- 选择命令/技能时默认全选:直接回车即安装全部,`a` 全选 / `i` 反选仍可用。
|
|
12
|
+
|
|
3
13
|
## 1.1.0
|
|
4
14
|
|
|
5
15
|
- 新增 ai-development-workflow skill:按任务规模组织 AI 辅助开发协作,维护版本基线、环境受限验证与阶段验收交接。
|
package/README.md
CHANGED
|
@@ -38,6 +38,8 @@ luminae-helper
|
|
|
38
38
|
|
|
39
39
|
卸载时只会删除带有 `managed-by: luminae-helper` 标识的文件,不会误删用户手动创建或 AI 工具自带的同名文件。
|
|
40
40
|
|
|
41
|
+
安装同理:目标位置已有同名的非本工具内容时直接跳过(结果表标「已跳过」),不会覆盖。
|
|
42
|
+
|
|
41
43
|
### 其他命令
|
|
42
44
|
|
|
43
45
|
```bash
|
|
@@ -104,7 +106,7 @@ managed-by: luminae-helper
|
|
|
104
106
|
---
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
安装与卸载都只碰带有此标识的文件/目录,保护用户手动创建的内容。
|
|
108
110
|
|
|
109
111
|
### 安全设计
|
|
110
112
|
|
package/package.json
CHANGED
package/src/lib/installer.js
CHANGED
|
@@ -73,6 +73,8 @@ function copyDir(src, dest) {
|
|
|
73
73
|
const entries = readdirSync(src, { withFileTypes: true });
|
|
74
74
|
for (const entry of entries) {
|
|
75
75
|
if (COPY_SKIP_ENTRIES.has(entry.name)) continue;
|
|
76
|
+
// 软链一律跳过:跟随复制会把包外文件内容带进工具目录
|
|
77
|
+
if (entry.isSymbolicLink()) continue;
|
|
76
78
|
const srcPath = join(src, entry.name);
|
|
77
79
|
const destPath = join(tmpDest, entry.name);
|
|
78
80
|
if (entry.isDirectory()) {
|
|
@@ -163,6 +165,11 @@ export function installSkillToTool(skill, tool) {
|
|
|
163
165
|
const destPath = target.destPath();
|
|
164
166
|
const isDirBased = target.installMode === "dir";
|
|
165
167
|
|
|
168
|
+
// 目标已存在但不是本工具装的(缺 managed-by)→ 跳过,不覆盖用户自建内容
|
|
169
|
+
if (existsSync(destPath) && !isInstalledByUs(destPath, isDirBased)) {
|
|
170
|
+
return { success: false, skipped: true, message: `目标已存在且非本工具安装,已跳过: ${destPath}` };
|
|
171
|
+
}
|
|
172
|
+
|
|
166
173
|
if (isDirBased) {
|
|
167
174
|
try {
|
|
168
175
|
copyDir(sourceDir, destPath);
|
package/src/lib/ui.js
CHANGED
|
@@ -248,6 +248,7 @@ async function stepSelectSkills() {
|
|
|
248
248
|
const skillChoices = SKILLS.map(s => ({
|
|
249
249
|
name: s.name + " - " + s.description,
|
|
250
250
|
value: s.id,
|
|
251
|
+
checked: true,
|
|
251
252
|
}));
|
|
252
253
|
|
|
253
254
|
const theme = {
|
|
@@ -459,6 +460,17 @@ async function stepExecute(skillIds, toolIds, installedTools, isUninstall, faile
|
|
|
459
460
|
status: chalk.green("已安装"),
|
|
460
461
|
mode: installModeDescription(target),
|
|
461
462
|
});
|
|
463
|
+
} else if (result.skipped) {
|
|
464
|
+
resultRows.push({
|
|
465
|
+
key,
|
|
466
|
+
toolName: tool.name,
|
|
467
|
+
skillName: skill.name,
|
|
468
|
+
status: chalk.yellow("已跳过"),
|
|
469
|
+
mode: result.message,
|
|
470
|
+
});
|
|
471
|
+
allSuccess = false;
|
|
472
|
+
// 目标被非本工具内容占用,重试也不会变
|
|
473
|
+
permanentFailedKeys.add(key);
|
|
462
474
|
} else {
|
|
463
475
|
resultRows.push({
|
|
464
476
|
key,
|
package/src/utils/platform.js
CHANGED
|
@@ -16,20 +16,6 @@ export function commandExists(commandName) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function runCommand(command, args = [], options = {}) {
|
|
20
|
-
const { encoding = "utf-8", inherit = false } = options;
|
|
21
|
-
const result = spawnSync(command, args, {
|
|
22
|
-
encoding,
|
|
23
|
-
shell: platform() === "win32",
|
|
24
|
-
stdio: inherit ? "inherit" : ["pipe", "pipe", "pipe"],
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
status: result.status,
|
|
28
|
-
stdout: result.stdout?.toString() ?? "",
|
|
29
|
-
stderr: result.stderr?.toString() ?? "",
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
19
|
function getCommandLookup(plat, commandName) {
|
|
34
20
|
if (plat === "win32") return { command: "where", args: [commandName] };
|
|
35
21
|
return { command: "which", args: [commandName] };
|