@szc-ft/mcp-szcd-client 0.11.0 → 0.11.1

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/AGENTS.md ADDED
@@ -0,0 +1,9 @@
1
+ # 项目指令
2
+
3
+ ## 语言偏好
4
+
5
+ 始终使用中文(简体)回复用户,包括:
6
+ - 所有对话回复
7
+ - 代码注释说明
8
+ - 错误信息和日志解读
9
+ - 工具调用结果的解释说明
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@szc-ft/mcp-szcd-client",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "MCP client for szcd component library - connects to remote MCP server via SSE or stdio proxy",
5
5
  "keywords": [
6
6
  "mcp",
@@ -32,6 +32,7 @@
32
32
  "skill/",
33
33
  "agents/",
34
34
  "commands/",
35
+ "AGENTS.md",
35
36
  "README.md"
36
37
  ],
37
38
  "engines": {
@@ -13,15 +13,16 @@
13
13
  *
14
14
  * Qoder 目录结构:
15
15
  * ~/.qoder/
16
- * ├── settings.json # 权限/Hook/MCP 配置
17
- * ├── agents/ # 子代理
16
+ * ├── AGENTS.md # 用户级项目指令(语言偏好等)
17
+ * ├── settings.json # 权限/Hook/MCP 配置
18
+ * ├── agents/ # 子代理
18
19
  * │ └── <agentName>.md
19
- * ├── skills/ # Skills
20
+ * ├── skills/ # Skills
20
21
  * │ └── <skillName>/
21
22
  * │ └── SKILL.md
22
- * ├── commands/ # 自定义命令
23
+ * ├── commands/ # 自定义命令
23
24
  * │ └── <commandName>.md
24
- * └── hooks/ # Hook 脚本
25
+ * └── hooks/ # Hook 脚本
25
26
  */
26
27
 
27
28
  import fs from "node:fs";
@@ -64,6 +65,14 @@ function getQoderProjectSettingsPath(projectRoot) {
64
65
  return path.join(projectRoot, ".qoder", "settings.json");
65
66
  }
66
67
 
68
+ function getQoderUserAgentsMdPath() {
69
+ return path.join(getQoderUserDirectory(), "AGENTS.md");
70
+ }
71
+
72
+ function getQoderProjectAgentsMdPath(projectRoot) {
73
+ return path.join(projectRoot, ".qoder", "AGENTS.md");
74
+ }
75
+
67
76
  // ==================== JSON 读写 ====================
68
77
 
69
78
  function readJsonFile(filePath) {
@@ -274,6 +283,47 @@ function copyCommandsToQoder(deps, isProjectLevel = false) {
274
283
  return false;
275
284
  }
276
285
 
286
+ // ==================== AGENTS.md 复制 ====================
287
+
288
+ /**
289
+ * 复制 AGENTS.md 到用户级 ~/.qoder/AGENTS.md
290
+ * 如果已存在用户自定义内容则跳过(避免覆盖用户修改)
291
+ */
292
+ function copyAgentsMdToQoder(deps, isProjectLevel = false) {
293
+ const agentsMdSource = path.join(deps.PACKAGE_ROOT, "AGENTS.md");
294
+ if (!fs.existsSync(agentsMdSource)) {
295
+ console.log("⏭️ Skipping AGENTS.md install: source file not found in package");
296
+ return false;
297
+ }
298
+
299
+ const agentsMdDest = isProjectLevel
300
+ ? getQoderProjectAgentsMdPath(deps.PROJECT_ROOT)
301
+ : getQoderUserAgentsMdPath();
302
+
303
+ try {
304
+ // 如果目标已存在,检查内容是否相同
305
+ if (fs.existsSync(agentsMdDest)) {
306
+ const existingContent = fs.readFileSync(agentsMdDest, "utf8").trim();
307
+ const sourceContent = fs.readFileSync(agentsMdSource, "utf8").trim();
308
+ if (existingContent === sourceContent) {
309
+ console.log(`✓ Qoder ${isProjectLevel ? "project" : "user"} AGENTS.md already up-to-date: ${agentsMdDest}`);
310
+ return true;
311
+ }
312
+ // 用户已自定义,不覆盖
313
+ console.log(`⏭️ Skipping Qoder AGENTS.md (${isProjectLevel ? "project" : "user"}): already exists with custom content`);
314
+ return false;
315
+ }
316
+
317
+ deps.ensureDirectory(path.dirname(agentsMdDest));
318
+ deps.copyFile(agentsMdSource, agentsMdDest);
319
+ console.log(`✓ Copied AGENTS.md to Qoder ${isProjectLevel ? "project" : "user"} directory: ${agentsMdDest}`);
320
+ return true;
321
+ } catch (error) {
322
+ console.log(`⚠️ Failed to copy AGENTS.md to Qoder ${isProjectLevel ? "project" : "user"} directory: ${error.message}`);
323
+ return false;
324
+ }
325
+ }
326
+
277
327
  // ==================== 项目级配置 ====================
278
328
 
279
329
  function setupQoderProjectConfig(deps) {
@@ -401,6 +451,7 @@ export function setupQoder(deps) {
401
451
  copySkillToQoder(deps, false);
402
452
  copyAgentsToQoder(deps, false);
403
453
  copyCommandsToQoder(deps, false);
454
+ copyAgentsMdToQoder(deps, false);
404
455
 
405
456
  // ---- 项目级安装(暂不启用,用户级足够) ----
406
457
  // let qoderProjectInstalled = false;