Files
ai-diff-preview/package.json
T
Gmarker689 a7c992a804 refactor: 重构为 Webview Review 面板架构
- 移除旧的 DiffEngine、InlineDecorator、CodeLensProvider 等模块
- 新增 ChangeSetManager 统一管理代码变更快照
- 新增 reviewPanel.ts 实现双栏 Review Webview 面板
- 简化 hookHandler.ts,直接通过 ChangeSet 收集变更
- 简化 extension.ts 入口,移除冗余模块导入
- 更新 types.ts,精简 ChangeSet 和 ChangeEntry 类型定义
- package.json 添加 onStartupFinished 激活事件
2026-06-18 00:09:56 +08:00

123 lines
3.4 KiB
JSON

{
"name": "ai-diff-preview",
"displayName": "AI Code Diff Preview",
"description": "类 Cursor 的 AI 代码差异预览插件,支持 Accept/Reject 操作",
"version": "0.1.0",
"publisher": "your-publisher-name",
"engines": {
"vscode": "^1.85.0"
},
"categories": [
"Linters",
"Programming Languages",
"Other"
],
"activationEvents": ["onStartupFinished"],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "aiDiffPreview.acceptChunk",
"title": "AI Diff: 接受当前变更块",
"icon": "$(check)"
},
{
"command": "aiDiffPreview.rejectChunk",
"title": "AI Diff: 拒绝当前变更块",
"icon": "$(close)"
},
{
"command": "aiDiffPreview.acceptAll",
"title": "AI Diff: 接受所有变更",
"icon": "$(check-all)"
},
{
"command": "aiDiffPreview.rejectAll",
"title": "AI Diff: 拒绝所有变更",
"icon": "$(trash)"
},
{
"command": "aiDiffPreview.showDiffPanel",
"title": "AI Diff: 显示 Diff 面板",
"icon": "$(diff)"
}
],
"keybindings": [
{
"command": "aiDiffPreview.acceptChunk",
"key": "tab",
"when": "aiDiffPreview.isActive"
},
{
"command": "aiDiffPreview.rejectAll",
"key": "escape",
"when": "aiDiffPreview.isActive"
},
{
"command": "aiDiffPreview.acceptAll",
"key": "ctrl+shift+a",
"mac": "cmd+shift+a",
"when": "aiDiffPreview.isActive"
},
{
"command": "aiDiffPreview.rejectAll",
"key": "ctrl+shift+r",
"mac": "cmd+shift+r",
"when": "aiDiffPreview.isActive"
}
],
"configuration": {
"title": "AI Diff Preview",
"properties": {
"aiDiffPreview.enableAutoTrigger": {
"type": "boolean",
"default": true,
"description": "启用 Claude Hooks 自动触发"
},
"aiDiffPreview.showInlineButtons": {
"type": "boolean",
"default": true,
"description": "显示内联 Accept/Reject 按钮"
},
"aiDiffPreview.autoLint": {
"type": "boolean",
"default": true,
"description": "Diff 预览时自动运行 Lint 检查"
},
"aiDiffPreview.maxFileSize": {
"type": "number",
"default": 100000,
"description": "最大处理文件大小(字符数)"
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run build",
"build": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --minify",
"watch": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --sourcemap --watch",
"lint": "eslint src --ext ts",
"test": "vitest run",
"test:watch": "vitest",
"package": "vsce package"
},
"devDependencies": {
"@types/diff": "^5.0.0",
"@types/node": "^20.0.0",
"@types/uuid": "^9.0.0",
"@types/vscode": "^1.85.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vscode/test-electron": "^2.3.0",
"esbuild": "^0.19.0",
"eslint": "^8.0.0",
"prettier": "^3.0.0",
"typescript": "^5.3.0",
"vitest": "^1.0.0"
},
"dependencies": {
"diff": "^5.0.0",
"uuid": "^9.0.0"
}
}