opencode-idea 0.0.7 → 0.0.8
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 +6 -0
- package/README.md +3 -0
- package/package.json +1 -1
- package/src/idea-mcp.js +2 -2
- package/src/plugin.js +9 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.8
|
|
4
|
+
|
|
5
|
+
- **撤销 0.0.7 的「skill 注册尽力而为」**。skill 是本插件的核心功能,不是可选知识:定义被 schema 拒绝就说明我们写错了,必须**立即失败**。原来那个 catch 会把「功能残缺」伪装成「运行正常」—— 正是 0.0.6 丢掉 `/open-in-idea` 却没人察觉的那种失败模式。现在恢复为直接注册 (无 try/catch)。
|
|
6
|
+
- **补测试**:断言打包后的 skill 文档 (`src/ide-run-config-skill.md`) 真实存在,这样 `.md` 漏进 `package.json` 的 `files` 会在测试阶段暴露,而不是在 `setup` 时才炸。
|
|
7
|
+
- **文档**:README 限制节写明 skill 字段名以 schema 为准 (`Skill.Info` 要 `path`,官方文档里的 `location` 不存在),用错会禁用整个插件。
|
|
8
|
+
|
|
3
9
|
## 0.0.7
|
|
4
10
|
|
|
5
11
|
- **修复:0.0.6 因 skill schema 校验失败导致整个插件被禁用**。`idea-run-config` skill 的定义用了 `location` 字段,而 `Skill.Info` 要求的是 `path` (AbsolutePath);`ctx.skill.transform` 因此抛 `SchemaError(Missing key at ["path"])`。OpenCode 的策略是**任何 transform 失败都会禁用整个插件**,所以 0.0.6 里 `/open-in-idea` 命令和 IDE MCP 注册都没能生效 (日志:`disabled plugin after transform failure plugin.id=opencode-idea state=skill`)。现在改用 `path`,并在测试里钉死字段集合 (`content` / `description` / `id` / `name` / `path`)。
|
package/README.md
CHANGED
|
@@ -228,6 +228,9 @@ export { default } from "/Users/yutao/Projects/opencode-idea/src/index.js";
|
|
|
228
228
|
- 仅支持 **OpenCode V2** 插件 API (`ctx.tool` / `ctx.mcp` / `ctx.shell` / `ctx.command` / `ctx.session` /
|
|
229
229
|
`ctx.location`)。
|
|
230
230
|
- IDE MCP 注册需要 IDE **2026.2+** 的 Streamable HTTP 端点 `/stream`;更早版本只有 `/sse`,OpenCode V2 无法连接。
|
|
231
|
+
- skill 定义的字段名**以 schema 为准**,不要照官方文档:`Skill.Info` 需要 `path` (AbsolutePath),文档里写的 `location`
|
|
232
|
+
不存在 —— 用错会让 `ctx.skill.transform` 抛 `SchemaError`,而**任何 transform 失败都会禁用整个插件**(0.0.6 就是这样丢了
|
|
233
|
+
`/open-in-idea`)。同理,`Skill.Info` 的完整字段是 `id` / `name` / `description?` / `autoinvoke?` / `path` / `content`。
|
|
231
234
|
- 环境变量依赖 `execute_terminal_command` + Brave Mode;拿不到时环境为空。
|
|
232
235
|
- 一批用不到的 IDEA MCP 工具被硬编码隐藏 (`src/plugin.js` 的 `HIDDEN_IDEA_TOOLS`,共 31 个):VCS (`idea_git_status` /
|
|
233
236
|
`idea_get_repositories`,版本控制走原生 `git`)、Router 派发工具 (`idea_execute_tool`,未启用 router-only 时冗余)、Debugger
|
package/package.json
CHANGED
package/src/idea-mcp.js
CHANGED
|
@@ -81,7 +81,7 @@ export async function probePort(port, options = {}) {
|
|
|
81
81
|
params: {
|
|
82
82
|
protocolVersion: PROTOCOL_VERSION,
|
|
83
83
|
capabilities: {},
|
|
84
|
-
clientInfo: { name: 'opencode-idea', version: '0.0.
|
|
84
|
+
clientInfo: { name: 'opencode-idea', version: '0.0.8' },
|
|
85
85
|
},
|
|
86
86
|
}),
|
|
87
87
|
signal: controller.signal,
|
|
@@ -151,7 +151,7 @@ export async function callTool(port, projectPath, name, args = {}, options = {})
|
|
|
151
151
|
params: {
|
|
152
152
|
protocolVersion: PROTOCOL_VERSION,
|
|
153
153
|
capabilities: {},
|
|
154
|
-
clientInfo: { name: 'opencode-idea', version: '0.0.
|
|
154
|
+
clientInfo: { name: 'opencode-idea', version: '0.0.8' },
|
|
155
155
|
},
|
|
156
156
|
});
|
|
157
157
|
const response = await post({
|
package/src/plugin.js
CHANGED
|
@@ -508,19 +508,16 @@ export default {
|
|
|
508
508
|
// live, how to bootstrap a schema from a real example, and how to verify a
|
|
509
509
|
// write. JetBrains projects only, and independent of `/open-in-idea`.
|
|
510
510
|
//
|
|
511
|
-
//
|
|
512
|
-
//
|
|
513
|
-
//
|
|
511
|
+
// Deliberately NOT wrapped in a catch: this is a core feature of the plugin,
|
|
512
|
+
// so a rejected definition must fail loudly. Swallowing it would ship a
|
|
513
|
+
// silently incomplete plugin — which is exactly how 0.0.6 lost
|
|
514
|
+
// `/open-in-idea` without anyone noticing until the command was gone.
|
|
514
515
|
if (isIdeaProject && typeof ctx.skill?.transform === 'function') {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
});
|
|
521
|
-
} catch {
|
|
522
|
-
skillRegistration = undefined;
|
|
523
|
-
}
|
|
516
|
+
// Read the document before the transform: callbacks must stay synchronous.
|
|
517
|
+
const runConfigSkillDefinition = runConfigSkill();
|
|
518
|
+
skillRegistration = await ctx.skill.transform((editor) => {
|
|
519
|
+
editor.add(runConfigSkillDefinition);
|
|
520
|
+
});
|
|
524
521
|
}
|
|
525
522
|
|
|
526
523
|
// `/open-in-idea`: manual, re-entrant trigger that also loads the IDE
|