mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-20 08:58:03 +00:00
插件的真实形态是「独立子进程 + 内核侧握手」,所以插件问题几乎都在 IDE 之外发生:
编不出来(多半是没声明用哪版 SDK,工具链拿了存储里的 current)、编出来起不来
(产物与内核协议绑定)、起来了行为不对(真因只在内核日志里)。这个扩展把这三件事
拉进 IDE。
- `tools/vscode-hmapdev`:TypeScript 扩展(零运行时依赖,仅 devDeps: typescript + @types/vscode)
- **plg.json 诊断**:必需字段;`sdk` 必须是完整版本号(区间写法 `1.2` 报错并说明
「patch 位恒为 .0」,与工具链 ResolveSDKForProject 同一套规矩);声明的 SDK 未安装时
直接给 `hmapdev sdk install vX.Y.Z`;
- **状态栏**:`插件 · SDK <声明> · hmapdev <版本>`,工具链缺失/工程有错时变色,tooltip 列已装 SDK;
- **命令**:build / build --target all / clean / debug(解释执行)/ 工具链版本 / SDK 列表-安装-切换 /
跟随内核日志 / 停止跟随 / 刷新;
- **任务**:同一批动作注册为 `hmapdev` 任务 + Go 问题匹配器(编译错误进 Problems);
- **内核日志跟随**:读 `<dataDir>/log` 最新 `homed_*.log`,按插件名过滤持续输出;
- schema 校验 + plg.json 骨架片段。
- 诚实边界(写进 README):**不是源码级调试器**——没有断点/单步,没有 DAP 会话;
做的是构建、运行、看内核日志、清单校验。
验证:`tsc` 零错误;`node --test` 13/13(版本规则、诊断分级、SDK 列表解析、状态栏文本、
以及**反向核对抓到的真缺陷**:`hmapdev 未找到` 这类输出曾被解析成版本号 → 已要求版本
token 以数字开头,否则「工具链不在」会被显示成「工具链 <垃圾词>」并让 SDK 诊断失真);
与真实工具链输出的集成核对 PASS(`hmapdev version` / `sdk list` 的真输出解析正确)。
README 同时补两节:plg.json 的 `sdk` 字段语义(含「为什么必须有」与「为什么拒区间写法」)、
本扩展的用法与边界。
60 lines
1.8 KiB
JSON
60 lines
1.8 KiB
JSON
{
|
|
"name": "hmapdev-vscode",
|
|
"version": "0.1.0",
|
|
"lockfileVersion": 3,
|
|
"requires": true,
|
|
"packages": {
|
|
"": {
|
|
"name": "hmapdev-vscode",
|
|
"version": "0.1.0",
|
|
"license": "AGPL-3.0-only",
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"@types/vscode": "^1.85.0",
|
|
"typescript": "^5.6.0"
|
|
},
|
|
"engines": {
|
|
"vscode": "^1.85.0"
|
|
}
|
|
},
|
|
"node_modules/@types/node": {
|
|
"version": "22.20.2",
|
|
"resolved": "https://registry.npmmirror.com/@types/node/-/node-22.20.2.tgz",
|
|
"integrity": "sha512-xlvWf4Vs9n1PEVYwP1n4vvG07M6y8WgvJ2t0vbrWTmijsIHp1cS+uJ2kMIRdY3nHZK0nCYKrPeD171+SzF4/zw==",
|
|
"dev": true,
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"undici-types": "~6.21.0"
|
|
}
|
|
},
|
|
"node_modules/@types/vscode": {
|
|
"version": "1.137.0",
|
|
"resolved": "https://registry.npmmirror.com/@types/vscode/-/vscode-1.137.0.tgz",
|
|
"integrity": "sha512-0dc/BBWxkyUsJzXIZ7PkKSalThmS4xiBT+8YEDiWdCefRKHGVV5ZNkM5NB5ULYamallYJujIfncNoXWFlyzL8A==",
|
|
"dev": true,
|
|
"license": "MIT"
|
|
},
|
|
"node_modules/typescript": {
|
|
"version": "5.9.3",
|
|
"resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz",
|
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
|
"dev": true,
|
|
"license": "Apache-2.0",
|
|
"bin": {
|
|
"tsc": "bin/tsc",
|
|
"tsserver": "bin/tsserver"
|
|
},
|
|
"engines": {
|
|
"node": ">=14.17"
|
|
}
|
|
},
|
|
"node_modules/undici-types": {
|
|
"version": "6.21.0",
|
|
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz",
|
|
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
|
"dev": true,
|
|
"license": "MIT"
|
|
}
|
|
}
|
|
}
|