devassist-agent 1.0.0 → 1.0.1
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/bin/devassist.js +2 -1
- package/package.json +1 -1
- package/src/cli/commands/watch.js +6 -1
package/bin/devassist.js
CHANGED
|
@@ -135,7 +135,7 @@ async function main() {
|
|
|
135
135
|
case 'fix':
|
|
136
136
|
return require(path.join(cmdDir, 'fix'))(projectRoot, args.slice(1), { printHeader, c });
|
|
137
137
|
case 'watch':
|
|
138
|
-
return require(path.join(cmdDir, 'watch'))(projectRoot, args.slice(1), { printHeader, printFinding, c });
|
|
138
|
+
return require(path.join(cmdDir, 'watch'))(projectRoot, args.slice(1), { printHeader, printFinding, printStats, c });
|
|
139
139
|
case 'report':
|
|
140
140
|
return require(path.join(cmdDir, 'report'))(projectRoot, args.slice(1), { printHeader, printFinding, c });
|
|
141
141
|
case 'diff':
|
|
@@ -195,6 +195,7 @@ function printHelp() {
|
|
|
195
195
|
console.log(` ${c.gray('$')} devassist init`);
|
|
196
196
|
console.log(` ${c.gray('$')} devassist check --ai`);
|
|
197
197
|
console.log(` ${c.gray('$')} devassist watch # 开发时实时监控`);
|
|
198
|
+
console.log(` ${c.gray('$')} devassist watch --ai --compare # 实时监控+AI多引擎对比`);
|
|
198
199
|
console.log(` ${c.gray('$')} devassist diff --staged # 提交前检查暂存文件`);
|
|
199
200
|
console.log(` ${c.gray('$')} devassist report --open # 生成并查看 HTML 报告`);
|
|
200
201
|
console.log(` ${c.gray('$')} devassist convention add --id naming-list --rule "使用 data.list 而非 data.items" --severity block`);
|
package/package.json
CHANGED
|
@@ -32,12 +32,14 @@ const SKIP_DIRS = ['node_modules', '.git', '.devassist', 'dist', 'build', 'vendo
|
|
|
32
32
|
module.exports = async function watch(projectRoot, args, ui) {
|
|
33
33
|
const { printHeader, printFinding, c } = ui;
|
|
34
34
|
const useAI = args.includes('--ai');
|
|
35
|
+
const useCompare = args.includes('--compare');
|
|
35
36
|
const watchDir = args.includes('--dir') ? args[args.indexOf('--dir') + 1] : null;
|
|
36
37
|
|
|
37
38
|
printHeader('监控模式');
|
|
38
39
|
|
|
39
40
|
console.log(` ${c.gray('监控目录:')} ${watchDir || '整个项目'}`);
|
|
40
41
|
console.log(` ${c.gray('AI 分析:')} ${useAI ? '已启用' : '已禁用'}`);
|
|
42
|
+
console.log(` ${c.gray('多引擎对比:')} ${useCompare ? '已启用' : '已禁用'}`);
|
|
41
43
|
console.log(` ${c.gray('按 Ctrl+C 停止')}\n`);
|
|
42
44
|
|
|
43
45
|
// Initialize convention store
|
|
@@ -166,7 +168,10 @@ module.exports = async function watch(projectRoot, args, ui) {
|
|
|
166
168
|
// Initial full check
|
|
167
169
|
console.log(` ${c.gray('正在执行初始检查...')}`);
|
|
168
170
|
const checkCmd = require('./check');
|
|
169
|
-
|
|
171
|
+
const checkArgs = [];
|
|
172
|
+
if (useAI) checkArgs.push('--ai');
|
|
173
|
+
if (useCompare) checkArgs.push('--compare');
|
|
174
|
+
await checkCmd(projectRoot, checkArgs, ui);
|
|
170
175
|
console.log(`\n ${c.cyan('开始监控变更...')}`);
|
|
171
176
|
|
|
172
177
|
// Handle new files being added (watch parent dirs for new entries)
|