opencode-idea 0.0.3 → 0.0.4
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 +4 -0
- package/package.json +1 -1
- package/src/idea-mcp.js +2 -2
- package/src/plugin.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
- **`/open-in-idea` 刷新工具列表**:在 `ctx.mcp.reload()` 之后显式调用 `ctx.tool.reload()`。之前只有 MCP 层重建目录,已经捕获过工具快照的会话仍然看不到新的 `idea_*` 原生工具;现在下一次模型请求即可用,无需重开会话。
|
|
6
|
+
|
|
3
7
|
## 0.0.3
|
|
4
8
|
|
|
5
9
|
- **直接暴露 IDEA MCP 工具**:注册 MCP 服务器时设置 `codemode: false`,让 `idea_*` 工具直接出现在原生工具表(而非 Code Mode 的 `tools.idea.*`)。模型可以直接调用并看到完整参数 schema,不再需要先探索、也不会猜错参数名。
|
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.4' },
|
|
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.4' },
|
|
155
155
|
},
|
|
156
156
|
});
|
|
157
157
|
const response = await post({
|
package/src/plugin.js
CHANGED
|
@@ -125,11 +125,8 @@ export default {
|
|
|
125
125
|
* prompt: (input: { sessionID: string, text: string, delivery: unknown }) => Promise<unknown>,
|
|
126
126
|
* hook: (name: string, cb: (event: { system?: unknown[] }) => void) => Promise<{ dispose: () => Promise<void> | void }>,
|
|
127
127
|
* },
|
|
128
|
-
* tool
|
|
129
|
-
*
|
|
130
|
-
* list: () => ReadonlyArray<{ id?: string }>,
|
|
131
|
-
* update: (id: string, update: (tool: { description?: string }) => void) => void,
|
|
132
|
-
* }) => void) => Promise<{ dispose: () => Promise<void> | void }>,
|
|
128
|
+
* tool?: {
|
|
129
|
+
* reload?: () => Promise<void>,
|
|
133
130
|
* },
|
|
134
131
|
* mcp: {
|
|
135
132
|
* transform: (cb: (editor: { set: (name: string, config: unknown) => void }) => void) => Promise<{ dispose: () => Promise<void> | void }>,
|
|
@@ -192,6 +189,11 @@ export default {
|
|
|
192
189
|
registrations = [mcpRegistration];
|
|
193
190
|
activePort = port;
|
|
194
191
|
if (typeof ctx.mcp.reload === 'function') await ctx.mcp.reload();
|
|
192
|
+
// Reconcile the MCP servers above, then replay the tool registry so the
|
|
193
|
+
// refreshed catalog lands in the next model request's tool snapshot.
|
|
194
|
+
// Without this, a session that already captured a snapshot keeps the old
|
|
195
|
+
// tool list until the session is reopened.
|
|
196
|
+
if (typeof ctx.tool?.reload === 'function') await ctx.tool.reload();
|
|
195
197
|
};
|
|
196
198
|
|
|
197
199
|
const reconcileOnce = async ({ probeIde = true } = {}) => {
|