holy-agents-kits 0.9.0 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holy-agents-kits",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Agent Skills 合集:Jenkins 流水线、Jenkins 控制器、new-api 应用与 CLI、代码图谱分析、IDEA 多语言语义后端(PSI 检视 + 按语言分册的接入配置)、VS Code 与语言服务器语义后端(原生 MCP 通道 + agent-lsp,能力档位逐格实测)、选择性分支同步、规则层治理、文档内容管理、知识可视化、Skill 开发与校验。一条命令装进你的 agent。",
5
5
  "bin": {
6
6
  "holy-agents-kits": "bin/cli.js"
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "author": "monsterbude123",
70
70
  "license": "MIT",
71
- "dependencies": {
71
+ "optionalDependencies": {
72
72
  "vscode-jsonrpc": "^10.0.1"
73
73
  }
74
74
  }
@@ -196,6 +196,13 @@ TS 的「Extract to function」是 **command 型** code action(`_typescript.ap
196
196
 
197
197
  ⇒ 走仓内脚本(客户端用**微软官方** `vscode-jsonrpc`,不自造协议栈):
198
198
 
199
+ > ⚠️ **`vscode-jsonrpc` 是可选依赖**(`optionalDependencies`)—— 离线机器装不上它时,本仓其余能力照常可用,只有抽方法这条路缺席;脚本会直接给出替代路线(改名走 vsc-lsp-mcp 的 rename 三段式或 agent-lsp 的 `rename_symbol`;抽方法走 IDEA 的 `ide_refactor_extract_method`),退出码 3 ⇒ 不让一个新能力把离线用户的安装卡死。
200
+ >
201
+ > **技能目录里要有这个库**(脚本是从技能目录跑的,Node 只认同目录/上层的 `node_modules`):
202
+ > ```bash
203
+ > npm i vscode-jsonrpc --prefix ~/.agents/skills/vscode-backend # 离线时加 --offline(走 npm 缓存)
204
+ > ```
205
+
199
206
  ```bash
200
207
  # 先看这个位置有哪些重构
201
208
  node skills/vscode-backend/scripts/lsp-refactor.mjs --file <绝对路径> --line 6 --col 3 --list
@@ -15,11 +15,24 @@
15
15
  // node lsp-refactor.mjs --file <绝对路径> --line <1-based> --col <1-based> [--end-line N --end-col N] [--list|--apply "<动作标题>"]
16
16
  // 可选:--server "<可直接 spawn 的命令>"(默认 typescript-language-server)|--project <工程根>(默认取文件所在工程)
17
17
  //
18
- // 退出码:0 成功;1 失败;2 参数错。
18
+ // 退出码:0 成功;1 失败;2 参数错;3 缺可选依赖。
19
19
  import { spawn } from 'node:child_process'
20
20
  import { readFileSync, writeFileSync } from 'node:fs'
21
21
  import { dirname, resolve, sep, join } from 'node:path'
22
- import { createMessageConnection, StreamMessageReader, StreamMessageWriter } from 'vscode-jsonrpc/node'
22
+
23
+ // vscode-jsonrpc 是**可选依赖**(optionalDependencies)—— 离线机器装不上它时,
24
+ // 本仓其余能力照常可用,抽方法这条路单独缺席 ⇒ 这里给替代路线而不是崩在 import 上。
25
+ let jsonrpc
26
+ try {
27
+ jsonrpc = await import('vscode-jsonrpc/node')
28
+ } catch {
29
+ console.error('缺可选依赖 vscode-jsonrpc(微软官方,MIT,零依赖)—— 抽方法这条路要它。')
30
+ console.error('装它: npm i vscode-jsonrpc (离线装不上的替代路线见 references/setup.md §6.6)')
31
+ console.error(' · 改名/影响面 → vsc-lsp-mcp 的 rename 三段式、agent-lsp 的 rename_symbol')
32
+ console.error(' · 抽方法 → IDEA 的 ide_refactor_extract_method(monster 分支插件)')
33
+ process.exit(3)
34
+ }
35
+ const { createMessageConnection, StreamMessageReader, StreamMessageWriter } = jsonrpc
23
36
 
24
37
  const argv = process.argv.slice(2)
25
38
  const arg = (name, dflt) => {