luminae-helper 1.1.1 → 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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.2
4
+
5
+ - 安装时目标已存在且非本工具安装(缺 `managed-by`)→ 跳过并在结果表标「已跳过」,不再覆盖用户自建技能目录。
6
+ - 复制技能目录时跳过软链,避免把包外文件内容带进工具目录。
7
+ - 移除未使用的 `runCommand`(原实现在 win32 下启用 shell)。
8
+
3
9
  ## 1.1.1
4
10
 
5
11
  - 选择命令/技能时默认全选:直接回车即安装全部,`a` 全选 / `i` 反选仍可用。
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luminae-helper",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Install public AI agent skills to coding tools",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -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
@@ -460,6 +460,17 @@ async function stepExecute(skillIds, toolIds, installedTools, isUninstall, faile
460
460
  status: chalk.green("已安装"),
461
461
  mode: installModeDescription(target),
462
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);
463
474
  } else {
464
475
  resultRows.push({
465
476
  key,
@@ -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] };