dsh-vscode-mode 0.1.14 → 0.1.16
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/README.md +13 -3
- package/lib/client.js +432 -13
- package/lib/client.js.map +1 -1
- package/lib/index.js +418 -131
- package/lib/index.js.map +1 -1
- package/package.json +6 -1
- package/src/capture.ts +4 -10
- package/src/client/compat.ts +91 -0
- package/src/client/fileOpeners.ts +173 -0
- package/src/client/index.ts +64 -9
- package/src/client/openPathRouter.ts +57 -0
- package/src/client/settingsContext.ts +21 -0
- package/src/client/styles/mcp.css +16 -0
- package/src/client/ui/EditorView.ts +5 -2
- package/src/client/ui/McpSettings.ts +76 -3
- package/src/compat.ts +146 -0
- package/src/fileOpenSettings.ts +124 -0
- package/src/host-deps.d.ts +14 -0
- package/src/index.ts +35 -5
- package/src/mcp.ts +8 -9
- package/src/mcpIsolation.ts +6 -12
- package/src/routes.ts +26 -7
- package/src/rpc.ts +20 -0
- package/src/shared/compat.ts +20 -0
- package/src/shared/rpc.ts +7 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-vscode-mode 兼容层双面契约 — 与其他插件 / DSH 版本的探测与自诊断报告。
|
|
3
|
+
* Purity rule: no node/react imports (same as types.ts / rpc.ts)。
|
|
4
|
+
* 作者 ddj 2026-08-24
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** 单项适配状态:外部插件/服务或护栏项,active 表示健康/生效。 */
|
|
8
|
+
export interface CompatAdapter {
|
|
9
|
+
name: string
|
|
10
|
+
active: boolean
|
|
11
|
+
note?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** 兼容性报告:host 侧构建(RPC edrv.compat 返回),client 侧补充本地适配项后展示。 */
|
|
15
|
+
export interface CompatReport {
|
|
16
|
+
pluginVersion: string
|
|
17
|
+
external: CompatAdapter[]
|
|
18
|
+
guards: CompatAdapter[]
|
|
19
|
+
warnings: string[]
|
|
20
|
+
}
|
package/src/shared/rpc.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
StaleHunk,
|
|
14
14
|
} from './types.js'
|
|
15
15
|
import type { MpcConfig, MpcProject, MpcProjectSaveInput, MpcServer } from './mcp.js'
|
|
16
|
+
import type { CompatReport } from './compat.js'
|
|
16
17
|
|
|
17
18
|
/** webServer 精确路由。 */
|
|
18
19
|
export const RPC_PATH = '/edrv/rpc'
|
|
@@ -43,6 +44,9 @@ export interface RpcRequestMap {
|
|
|
43
44
|
'mcp.projectRemove': { workspacePath: string; serverName: string }
|
|
44
45
|
'mcp.projectToggle': { workspacePath: string; serverName: string; enabled: boolean }
|
|
45
46
|
'mcp.projectRefresh': { workspacePath: string; serverName: string }
|
|
47
|
+
'vscode.fileOpenSettingsGet': {}
|
|
48
|
+
'vscode.fileOpenSettingsUpdate': { fileOpenTool: string; expectedRevision?: number }
|
|
49
|
+
'compat': {}
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
export type RpcMethod = keyof RpcRequestMap
|
|
@@ -70,6 +74,9 @@ export interface RpcOkMap {
|
|
|
70
74
|
'mcp.projectRemove': { project: MpcProject }
|
|
71
75
|
'mcp.projectToggle': { project: MpcProject }
|
|
72
76
|
'mcp.projectRefresh': { project: MpcProject }
|
|
77
|
+
'vscode.fileOpenSettingsGet': { fileOpenTool: string; revision?: number }
|
|
78
|
+
'vscode.fileOpenSettingsUpdate': { fileOpenTool: string; revision?: number }
|
|
79
|
+
'compat': { report: CompatReport }
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
/** 统一响应:{ok:true, ...payload} 或 {ok:false, error}。 */
|