speccore 8.3.189 → 8.3.191
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.en.md +1 -1
- package/README.md +2 -2
- package/dist/cli.js +21 -24
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts +1 -0
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +87 -24
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/dev.js +38 -14
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doc2spec.d.ts +5 -0
- package/dist/commands/doc2spec.d.ts.map +1 -1
- package/dist/commands/doc2spec.js +2 -0
- package/dist/commands/doc2spec.js.map +1 -1
- package/dist/commands/help.js +91 -15
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/next.d.ts +5 -0
- package/dist/commands/next.d.ts.map +1 -0
- package/dist/commands/next.js +152 -0
- package/dist/commands/next.js.map +1 -0
- package/dist/commands/pipeline.d.ts.map +1 -1
- package/dist/commands/pipeline.js +3 -1
- package/dist/commands/pipeline.js.map +1 -1
- package/dist/commands/req-doc.d.ts +17 -0
- package/dist/commands/req-doc.d.ts.map +1 -0
- package/dist/commands/req-doc.js +388 -0
- package/dist/commands/req-doc.js.map +1 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +619 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/status-panel.js +3 -3
- package/dist/commands/verify.d.ts +8 -0
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +8 -0
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/welcome.js +2 -2
- package/dist/commands/welcome.js.map +1 -1
- package/dist/commands/workspace.js +2 -2
- package/dist/core/agent-adapter.d.ts.map +1 -1
- package/dist/core/agent-adapter.js +18 -0
- package/dist/core/agent-adapter.js.map +1 -1
- package/dist/core/agents/defaults/_INDEX.md +68 -0
- package/dist/core/ask-engine.d.ts.map +1 -1
- package/dist/core/ask-engine.js +120 -26
- package/dist/core/ask-engine.js.map +1 -1
- package/dist/core/handoff-generator.d.ts +1 -1
- package/dist/core/handoff-generator.d.ts.map +1 -1
- package/dist/core/handoff-generator.js +10 -10
- package/dist/core/handoff-generator.js.map +1 -1
- package/dist/core/help-panel.d.ts +1 -1
- package/dist/core/help-panel.d.ts.map +1 -1
- package/dist/core/help-panel.js +2 -1
- package/dist/core/help-panel.js.map +1 -1
- package/dist/core/intent-recognition.d.ts +1 -1
- package/dist/core/intent-recognition.d.ts.map +1 -1
- package/dist/core/intent-recognition.js +98 -15
- package/dist/core/intent-recognition.js.map +1 -1
- package/dist/core/requirement-clarifier.d.ts +7 -1
- package/dist/core/requirement-clarifier.d.ts.map +1 -1
- package/dist/core/requirement-clarifier.js +42 -10
- package/dist/core/requirement-clarifier.js.map +1 -1
- package/dist/core/spec-paths.d.ts +6 -0
- package/dist/core/spec-paths.d.ts.map +1 -1
- package/dist/core/spec-paths.js +66 -0
- package/dist/core/spec-paths.js.map +1 -1
- package/dist/core/spec-skeleton.js +2 -2
- package/dist/core/spec-skeleton.js.map +1 -1
- package/dist/core/unified-config.d.ts +16 -0
- package/dist/core/unified-config.d.ts.map +1 -1
- package/dist/core/unified-config.js +53 -94
- package/dist/core/unified-config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# AGENTS 注册表
|
|
2
|
+
|
|
3
|
+
> 本文件定义各命令/阶段下激活的 Agent 列表。
|
|
4
|
+
> 新增角色后,在本文件中添加一行即可挂载到对应流程。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## analyze / clarify
|
|
9
|
+
|
|
10
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
11
|
+
|------|--------|------|------|
|
|
12
|
+
| product-analyst | 100 | — | 业务流程完整性、遗漏识别、术语统一 |
|
|
13
|
+
| interaction-designer | 90 | — | 交互状态矩阵、前后端一致性、用户路径(叠加 RULES/ 技术栈交互约束) |
|
|
14
|
+
| security-reviewer | 70 | project.securityLevel > 2 | 需求中的安全风险预判(叠加 RULES/ 技术栈安全规则) |
|
|
15
|
+
|
|
16
|
+
## analyze / confirm-check
|
|
17
|
+
|
|
18
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
19
|
+
|------|--------|------|------|
|
|
20
|
+
| product-analyst | 100 | — | 最终确认清单 |
|
|
21
|
+
|
|
22
|
+
## split / default
|
|
23
|
+
|
|
24
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
25
|
+
|------|--------|------|------|
|
|
26
|
+
| task-decomposer | 100 | — | 任务拆分专家 |
|
|
27
|
+
| dependency-analyst | 90 | — | 依赖关系分析(叠加 RULES/ 技术栈依赖模式) |
|
|
28
|
+
| effort-estimator | 70 | — | 工时估算 |
|
|
29
|
+
|
|
30
|
+
## plan / default
|
|
31
|
+
|
|
32
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
33
|
+
|------|--------|------|------|
|
|
34
|
+
| schedule-planner | 100 | — | 排期规划 |
|
|
35
|
+
| risk-assessor | 90 | — | 风险评估 |
|
|
36
|
+
|
|
37
|
+
## execute / quality-gate
|
|
38
|
+
|
|
39
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
40
|
+
|------|--------|------|------|
|
|
41
|
+
| compiler | 100 | — | 编译可行性检查(叠加 RULES/ 技术栈构建规则) |
|
|
42
|
+
| test-engineer | 90 | — | 单元测试执行与覆盖率(叠加 RULES/ 技术栈测试规范) |
|
|
43
|
+
| security-reviewer | 80 | — | 安全漏洞扫描(叠加 RULES/ 技术栈安全规则) |
|
|
44
|
+
| performance-expert | 50 | — | 性能回归检测(叠加 RULES/ 技术栈性能规范) |
|
|
45
|
+
| doc-sync-agent | 40 | — | 文档与实际代码一致性(叠加 RULES/ 技术栈文档格式) |
|
|
46
|
+
|
|
47
|
+
## change / impact
|
|
48
|
+
|
|
49
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
50
|
+
|------|--------|------|------|
|
|
51
|
+
| impact-analyst | 100 | — | 变更影响范围分析(叠加 RULES/ 技术栈模块结构) |
|
|
52
|
+
| regression-tester | 80 | — | 回归测试范围(叠加 RULES/ 技术栈测试策略) |
|
|
53
|
+
|
|
54
|
+
## pr / review
|
|
55
|
+
|
|
56
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
57
|
+
|------|--------|------|------|
|
|
58
|
+
| code-reviewer | 100 | — | 代码质量审查(叠加 RULES/ 技术栈编码规范) |
|
|
59
|
+
| security-reviewer | 90 | — | 安全审查(叠加 RULES/ 技术栈安全规则) |
|
|
60
|
+
| test-reviewer | 80 | — | 测试完整性审查(叠加 RULES/ 技术栈测试规范) |
|
|
61
|
+
|
|
62
|
+
## audit / default
|
|
63
|
+
|
|
64
|
+
| 角色 | 优先级 | 条件 | 说明 |
|
|
65
|
+
|------|--------|------|------|
|
|
66
|
+
| security-reviewer | 100 | — | 安全审计(叠加 RULES/ 技术栈安全规则) |
|
|
67
|
+
| compliance-checker | 90 | project.industry == 'finance' | 合规检查(金融行业) |
|
|
68
|
+
| performance-expert | 70 | — | 性能基线审计(叠加 RULES/ 技术栈性能规范) |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-engine.d.ts","sourceRoot":"","sources":["../../src/core/ask-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,aAAa;AACb,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAE/E,aAAa;AACb,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,C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,CAgD7C,CAAC;AAMF,iBAAiB;AACjB,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CA2DnD;AA4xBD,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAqJ7F;AA4OD,uCAAuC;AACvC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA4BjD;AAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/core/ask-engine.js
CHANGED
|
@@ -21,7 +21,7 @@ const knowledge_graph_1 = require("./knowledge-graph");
|
|
|
21
21
|
// ============================================================
|
|
22
22
|
const COMMAND_KB = [
|
|
23
23
|
{ name: 'init', aliases: ['in'], description: '初始化 SpecCore 项目,创建 .speccore 目录和配置',
|
|
24
|
-
usage: 'speccore init [--interactive] [--name <name>]', examples: ['speccore init', 'speccore init --name my-project'], related: ['
|
|
24
|
+
usage: 'speccore init [--interactive] [--name <name>]', examples: ['speccore init', 'speccore init --name my-project'], related: ['run', 'config'], triggers: ['初始化', 'init', '开始', '新建项目', '创建项目'] },
|
|
25
25
|
{ name: 'doc2spec', aliases: ['d2s'], description: '导入 PRD/Word 文档,AI + Pandoc 双路转换为 SpecCore MD。--classify 智能分类 sources/ 文档到 staging/(按类型提取 feature/bug/refactor/research)',
|
|
26
26
|
usage: 'speccore doc2spec -f <file> --iter <iteration> [--task <task>] [--no-ai] [--classify [--prompt] [--response <json>]]', examples: ['speccore doc2spec -f PRD.docx --iter Q3', 'speccore doc2spec -f 需求.docx --iter Q2 --task T-01 --no-ai', 'speccore doc2spec --classify --prompt -I Q3', 'speccore doc2spec --classify -I Q3'], related: ['spec2doc', 'analyze'], triggers: ['导入', 'doc2spec', 'word转', '文档转换', 'PRD', '需求文档', '智能分类', 'classify', '分类文档', '提取需求'] },
|
|
27
27
|
{ name: 'spec2doc', aliases: ['s2d'], description: 'SpecCore MD 导出为 Word/PDF/HTML/PPTX',
|
|
@@ -31,7 +31,7 @@ const COMMAND_KB = [
|
|
|
31
31
|
{ name: 'analyze', aliases: ['al'], description: '统一分析:需求文档+源码→分析报告。支持 --full 三阶段合成,--deep 单文档深度分析(字数/图表翻倍),--iterative 迭代式生成(大纲→逐节填充),--filter 按需分析指定模块,--with-code 注入代码结构化数据,--phase 单阶段合成,--feature 局部分析功能模块,--doc 局部分析类型文档,--sync 任务分析后局部回写 020-specs/,--no-source 跳过源码,--supplement 追加源码',
|
|
32
32
|
usage: 'speccore analyze [--task <id>] [--iteration <name>] [--full] [--deep <doc>] [--iterative] [--filter <keywords>] [--with-code] [--phase <n>] [--feature <module>] [--doc <type/slug>] [--no-source] [--source-scope <dirs>] [--supplement] [--sync] [--scope global] [--dev-guide]', examples: ['speccore analyze', 'speccore analyze --full -i Q2', 'speccore analyze --deep ARCHITECTURE.md --iterative', 'speccore analyze --filter "订单,支付" --with-code', 'speccore analyze --phase 1 -i Q2', 'speccore analyze --feature 支付模块', 'speccore analyze --doc bugs/login-timeout', 'speccore analyze --with-code', 'speccore analyze --supplement --source-scope src/core', 'speccore analyze --task Task-001 --apply "..." --sync'], related: ['dashboard', 'validate', 'code-index', 'refresh', 'synthesize'], triggers: ['分析', 'analyze', '审计', 'audit', '检查', '结合源码', '连代码', '带代码', '源码分析', '迭代分析', '分析迭代', '倒推需求', '反推', '从代码生成', '分析代码', '不读源码', '不读代码', '跳过源码', '指定目录分析', '只扫描', '补充分析', '追加分析', '补充源码', '追加源码', '遗漏', '没分析到', '没覆盖', '漏掉', '再分析', '多读几个', '局部分析', '单个模块', '单独分析', 'bug分析', '重构分析', '局部回写', '回写spec', '同步spec', '合成需求', '合并需求', '需求合成', '智能合成', '需求合并', '多端合成', '全量分析', '跨端综合', '全量合成', '开发指南', '生成开发指南', '带开发指南', '深度分析', '深入分析', '详细分析', '迭代生成', '逐节分析', '大纲分析', '按需分析', '只分析', '过滤分析', '聚焦分析'] },
|
|
33
33
|
{ name: 'code-index', aliases: ['ci', 'idx'], description: '源码索引:扫描项目代码,自动识别多端/模块/依赖,生成 Markdown 索引',
|
|
34
|
-
usage: 'speccore code-index [--full] [--scope <dirs>] [--show]', examples: ['speccore code-index', 'speccore code-index --full', 'speccore code-index --scope src/commands,src/core', 'speccore code-index --show'], related: ['analyze', '
|
|
34
|
+
usage: 'speccore code-index [--full] [--scope <dirs>] [--show]', examples: ['speccore code-index', 'speccore code-index --full', 'speccore code-index --scope src/commands,src/core', 'speccore code-index --show'], related: ['analyze', 'run'], triggers: ['代码索引', '源码索引', 'code-index', '索引', '建索引', '更新索引', '扫描代码', '代码结构', '模块索引', '项目结构'] },
|
|
35
35
|
{ name: 'execute', aliases: ['ex'], description: '执行开发任务:依赖排序+分批+交互引导+计划联动',
|
|
36
36
|
usage: 'speccore execute [--task <id>] [--batch-size <n>] [--auto]', examples: ['speccore execute', 'speccore execute --batch-size 3'], related: ['plan', 'done'], triggers: ['执行', 'execute', '开发', '开始做', '干活'] },
|
|
37
37
|
{ name: 'plan', aliases: ['pl'], description: '生成执行计划+管理历史:创建/交互/列表/详情/取消',
|
|
@@ -46,21 +46,21 @@ const COMMAND_KB = [
|
|
|
46
46
|
{ name: 'validate', aliases: ['vl'], description: '合规验证:检查 Spec 完整性与一致性',
|
|
47
47
|
usage: 'speccore validate [--iteration <name>]', examples: ['speccore validate', 'speccore validate --iteration Q2'], related: ['analyze', 'audit'], triggers: ['验证', 'validate', '检查', '合规', '校验'] },
|
|
48
48
|
{ name: 'sync', aliases: ['sy'], description: '双向同步:代码↔Spec,--global 同步到全局层(原 sync-global)',
|
|
49
|
-
usage: 'speccore sync [--task <id>] [--iteration <name>] [--global] [--direction to_global|from_global]', examples: ['speccore sync --task Task-001', 'speccore sync --global', 'speccore sync --global --direction from_global'], related: ['
|
|
49
|
+
usage: 'speccore sync [--task <id>] [--iteration <name>] [--global] [--direction to_global|from_global]', examples: ['speccore sync --task Task-001', 'speccore sync --global', 'speccore sync --global --direction from_global'], related: ['run'], triggers: ['同步', 'sync', '对齐', '更新', '同步全量', '同步全局', '更新全量层', '同步到全量'] },
|
|
50
50
|
{ name: 'change', aliases: ['ch'], description: '需求变更:联动更新所有关联 Spec,支持口语化输入',
|
|
51
51
|
usage: 'speccore change "<description>" [--task <id>]', examples: ['speccore change "把登录改成验证码登录"', 'speccore change "加上支付功能" --task T-03'], related: ['analyze'], triggers: ['变更', 'change', '修改', '改', '更新需求'] },
|
|
52
52
|
{ name: 'done', aliases: ['dn'], description: '收尾归档:校验→同步→审计,--all 批量归档',
|
|
53
53
|
usage: 'speccore done [--task <id>] [--all] [--interactive]', examples: ['speccore done --task T-01', 'speccore done --all'], related: ['execute', 'pr'], triggers: ['完成', 'done', '归档', '结束', '做完'] },
|
|
54
|
-
{ name: '
|
|
55
|
-
usage: 'speccore
|
|
56
|
-
{ name: 'run', aliases: ['r'], description: '
|
|
57
|
-
usage: 'speccore run [
|
|
54
|
+
{ name: 'next', aliases: ['n'], description: '检测当前迭代进度,提示下一步操作(只指引,不执行)',
|
|
55
|
+
usage: 'speccore next [--iteration <name>]', examples: ['speccore next', 'speccore next -i Q2'], related: ['run', 'status'], triggers: ['下一步', '接下来', '该做什么', '接下来做什么', 'next', '做到哪了', '下一步做什么', '现在到哪了'] },
|
|
56
|
+
{ name: 'run', aliases: ['r'], description: '端到端命名流水线:支持 preset(full/import/analyze/develop/deliver/deploy/docs)或起止点(--from/--to),默认 develop(分析→验证),三闸口',
|
|
57
|
+
usage: 'speccore run [--preset <name>] [--from <phase>] [--to <phase>] [--demo]', examples: ['speccore run --preset deploy', 'speccore run --from analyze --to execute', 'speccore run --demo'], related: ['next', 'req-doc', 'execute'], triggers: ['run', '跑一遍', '端到端', '全流程', '一键开发', '自动开发', '从头到尾', '完整流程', '全自动', '流水线'] },
|
|
58
58
|
{ name: 'task', aliases: ['tk'], description: '任务管理:创建/列表/状态。子命令: new, list, status',
|
|
59
59
|
usage: 'speccore task new --name <name> [--id <id>] | speccore task list | speccore task status', examples: ['speccore task new --name "用户登录"', 'speccore task list'], related: ['plan', 'execute'], triggers: ['task', '任务列表', '查看任务', '列出任务'] },
|
|
60
60
|
{ name: 'iteration', aliases: ['it'], description: '迭代管理:创建时自动生成唯一编码(Iteration-001-功能名),支持拆分/列表',
|
|
61
61
|
usage: 'speccore iteration create -n <name> | speccore iteration split | speccore iteration list', examples: ['speccore iteration create -n Q3 → Iteration-001-Q3', 'speccore iteration list'], related: ['task', 'plan'], triggers: ['迭代', 'iteration', '迭代', 'sprint'] },
|
|
62
62
|
{ name: 'context', aliases: ['ctx'], description: '查看/设置当前上下文:迭代、任务、阶段',
|
|
63
|
-
usage: 'speccore context [--set --iteration <name>] [--list]', examples: ['speccore context --list', 'speccore context --set --iteration Q1'], related: ['dashboard', '
|
|
63
|
+
usage: 'speccore context [--set --iteration <name>] [--list]', examples: ['speccore context --list', 'speccore context --set --iteration Q1'], related: ['dashboard', 'run'], triggers: ['切换', '上下文', 'context', '当前.*迭代', '设置.*迭代', '换到', '切换到'] },
|
|
64
64
|
{ name: 'search', aliases: ['sh'], description: '全文搜索:跨所有 Spec 文件关键词检索',
|
|
65
65
|
usage: 'speccore search <query> [--task <id>] [--iteration <name>]', examples: ['speccore search "登录"', 'speccore search "支付" --iteration Q2'], related: ['track'], triggers: ['搜索', 'search', '查找', '检索', 'grep'] },
|
|
66
66
|
{ name: 'track', aliases: ['trk', 'tr'], description: 'REQ→Task→Code 全链路追踪(合并原 trace + tracker)',
|
|
@@ -86,9 +86,9 @@ const COMMAND_KB = [
|
|
|
86
86
|
usage: 'speccore graph query <question> | speccore graph entity <id> | speccore graph related <id> | speccore graph path <from> <to> | speccore graph stats',
|
|
87
87
|
examples: ['speccore graph query "订单相关代码"', 'speccore graph entity SRC:auth-AuthController', 'speccore graph related Task-001', 'speccore graph path Task-001 Task-002', 'speccore graph stats'], related: ['knowledge', 'code-index', 'search', 'track'], triggers: ['图谱', 'graph', '知识图谱', '代码图谱', '查询图谱', '图谱查询', '查图谱', '找关联', '找路径', '实体查询', '图谱统计'] },
|
|
88
88
|
// v8.3.0+: 需求澄清
|
|
89
|
-
{ name: '
|
|
90
|
-
usage: 'speccore
|
|
91
|
-
examples: ['speccore
|
|
89
|
+
{ name: 'req-doc', aliases: ['rd'], description: '需求文档化:将口语化/非专业需求整理为 PRD 级文档。支持 --local 临时工作区模式',
|
|
90
|
+
usage: 'speccore req-doc "<描述>" | req-doc --from <file> [--to <iteration> | --local]',
|
|
91
|
+
examples: ['speccore req-doc "我要加个购物车"', 'speccore req-doc --from notes.md --local', 'speccore req-doc --promote <entryId> --to <iteration>'], related: ['analyze', 'doc2spec'], triggers: ['整理需求', '专业化', '规范化', '整理一下', '写成PRD', '润色需求', '需求整理', '整理成文档', '需求文档化', '需求专业化'] },
|
|
92
92
|
// v8.3.24+: 契约冲突裁决
|
|
93
93
|
{ name: 'verdict', aliases: ['vd'], description: '契约冲突裁决:查看待裁决冲突、进行人工裁决、查看裁决书',
|
|
94
94
|
usage: 'speccore verdict [--list] [--conflict <id> --decide <pass|reject|defer> --reason <reason>] [--report] [--task <id>]',
|
|
@@ -150,8 +150,8 @@ const SYNONYM_MAP = {
|
|
|
150
150
|
'建索引': 'code-index', '扫描代码': 'code-index', '代码结构': 'code-index',
|
|
151
151
|
// ── iteration ──
|
|
152
152
|
'sprint': 'iteration',
|
|
153
|
-
// ── dev
|
|
154
|
-
'流水线': '
|
|
153
|
+
// ── run(原 dev,v8.3.189 合并)──
|
|
154
|
+
'流水线': 'run', '全自动': 'run',
|
|
155
155
|
// ── verify ──
|
|
156
156
|
'冒烟': 'verify', 'smoke': 'verify', '视觉检查': 'verify', 'ui验证': 'verify', '跑测试': 'verify', '测一下': 'verify', '检查页面': 'verify',
|
|
157
157
|
// ── refresh ──
|
|
@@ -246,11 +246,28 @@ function classifyMode(input) {
|
|
|
246
246
|
];
|
|
247
247
|
if (explainPatterns.some(p => p.test(lower)))
|
|
248
248
|
return 'explain';
|
|
249
|
+
// v8.3.190+: run 流水线意图前置检测("从 X 到 Y"、"跑/执行流水线"、"帮我部署/交付"等)
|
|
250
|
+
// 优先于 pipeline/guide 判定,让 run 命名流水线编排走 match 分支
|
|
251
|
+
const runPipelinePatterns = [
|
|
252
|
+
/从.+?(?:到|至).+/,
|
|
253
|
+
/(?:跑|执行|运行).{0,4}流水线/,
|
|
254
|
+
/帮我(?:部署|交付|上线|提代码|提交代码)/,
|
|
255
|
+
/(?:部署|交付|上线).{0,4}流水线/,
|
|
256
|
+
/(?:跑|执行).{0,4}全流程/,
|
|
257
|
+
/(?:生成|出).{0,2}(?:spec|规格)/,
|
|
258
|
+
/.{0,6}到拆分/,
|
|
259
|
+
/开发(?:流程|到验证|到执行)/,
|
|
260
|
+
/(?:分析|需求).{0,4}到开发/,
|
|
261
|
+
];
|
|
262
|
+
if (runPipelinePatterns.some(p => p.test(input)))
|
|
263
|
+
return 'match';
|
|
249
264
|
// 模式4: 复杂编排 — 包含多个动作词 + 时序/数量词
|
|
250
|
-
|
|
265
|
+
// v8.3.189+: 补充「分析」「拆分」动作词和「并且」「以及」并列连接词,
|
|
266
|
+
// 使「分析…拆分…」这类复合意图能进入 pipeline 编排(analyze-split-plan)
|
|
267
|
+
const pipelineKeywords = ['然后', '再', '接着', '最后', '同时', '之后', '并且', '以及', '还要',
|
|
251
268
|
'then', 'after', 'finally', '同时执行', 'pipeline'];
|
|
252
|
-
const actionWords = ['计划', '执行', '分批', '安排',
|
|
253
|
-
'plan', 'execute', 'batch'];
|
|
269
|
+
const actionWords = ['计划', '执行', '分批', '安排', '分析', '拆分',
|
|
270
|
+
'plan', 'execute', 'batch', 'analyze', 'split'];
|
|
254
271
|
const hasTiming = /晚.*点|早上.*点|明天|今天|后天|下周|周[一到日]|(\d+)[点时]/i.test(lower);
|
|
255
272
|
const hasBatch = /分批|批次|batch|一批|一组/i.test(lower);
|
|
256
273
|
const hasBugfix = /bug|修复|fix|defect/i.test(lower);
|
|
@@ -546,7 +563,7 @@ function handleGuide(input) {
|
|
|
546
563
|
`---`,
|
|
547
564
|
`执行方式:`,
|
|
548
565
|
` 逐步执行: 按顺序手动执行每一步`,
|
|
549
|
-
` 一键执行: speccore
|
|
566
|
+
` 一键执行: speccore run(自动检测并推进)`,
|
|
550
567
|
` 编排执行: speccore ask "完整描述你的需求" --pipeline`,
|
|
551
568
|
].join('\n');
|
|
552
569
|
const firstStep = matchedWorkflow[0];
|
|
@@ -574,9 +591,36 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
574
591
|
const kbMatch = matchCommandInKB(input);
|
|
575
592
|
const config = await (0, ask_config_1.loadAskConfig)();
|
|
576
593
|
const results = await (0, intent_recognition_1.recognizeIntent)(input);
|
|
577
|
-
|
|
594
|
+
let best = results[0];
|
|
595
|
+
// v8.3.191+: run 意图带 preset/起止点(extractParams 已精确识别编排)时优先 run 编排,
|
|
596
|
+
// 避免被 execute/analyze 的宽泛触发词(跑/开发/分析)抢占。
|
|
597
|
+
// 条件:confidence>=40 兜底,防止极低置信度的 run 误抢。
|
|
598
|
+
// runForced:preset/起止点已精确识别 → 跳过歧义检测与中置信度确认,直接编排执行。
|
|
599
|
+
let runForced = false;
|
|
600
|
+
const runWithParams = results.find(r => r.intent === 'run' && r.confidence >= 40 && (r.extractedParams?.preset || r.extractedParams?.from || r.extractedParams?.to));
|
|
601
|
+
if (runWithParams && best?.intent !== 'run') {
|
|
602
|
+
best = runWithParams;
|
|
603
|
+
runForced = true;
|
|
604
|
+
}
|
|
605
|
+
// v8.3.190+: 澄清三态 flag(仅 analyze 命令,供各分支命令展示统一使用)
|
|
606
|
+
const clarifyFlag = best && best.command === 'analyze' && best.extractedParams?.clarify === 'on' ? ' --clarify'
|
|
607
|
+
: best && best.command === 'analyze' && best.extractedParams?.clarify === 'off' ? ' --skip-clarify'
|
|
608
|
+
: '';
|
|
609
|
+
// v8.3.190+: run 流水线 flag(preset / 起止点,供各分支命令展示统一使用)
|
|
610
|
+
let runFlag = '';
|
|
611
|
+
if (best && best.command === 'run') {
|
|
612
|
+
const rp = best.extractedParams || {};
|
|
613
|
+
if (rp.preset)
|
|
614
|
+
runFlag += ` --preset ${rp.preset}`;
|
|
615
|
+
if (rp.from)
|
|
616
|
+
runFlag += ` --from ${rp.from}`;
|
|
617
|
+
if (rp.to)
|
|
618
|
+
runFlag += ` --to ${rp.to}`;
|
|
619
|
+
}
|
|
578
620
|
// 如果 KB 有匹配且置信度高于意图识别,用 KB(但要整合意图识别的参数)
|
|
579
|
-
|
|
621
|
+
// v8.3.191+: run 意图有 preset/起止点时,优先 run 编排(避免被 KB 的 split/deploy 等抢占)
|
|
622
|
+
const runHasParams = best?.command === 'run' && (best.extractedParams?.preset || best.extractedParams?.from || best.extractedParams?.to);
|
|
623
|
+
if (kbMatch && (!best || best.confidence < 60) && !runHasParams) {
|
|
580
624
|
const params = best?.extractedParams || {};
|
|
581
625
|
let fullCommand = `speccore ${kbMatch.name}`;
|
|
582
626
|
const paramNotes = [];
|
|
@@ -596,6 +640,30 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
596
640
|
fullCommand += ` --scope ${params.scope}`;
|
|
597
641
|
paramNotes.push(`🌐 范围: ${params.scope}`);
|
|
598
642
|
}
|
|
643
|
+
// v8.3.190+: 澄清三态 ask 单次覆盖(仅 analyze)
|
|
644
|
+
if (kbMatch.name === 'analyze' && params.clarify === 'on') {
|
|
645
|
+
fullCommand += ` --clarify`;
|
|
646
|
+
paramNotes.push(`🔍 澄清: 强制澄清`);
|
|
647
|
+
}
|
|
648
|
+
if (kbMatch.name === 'analyze' && params.clarify === 'off') {
|
|
649
|
+
fullCommand += ` --skip-clarify`;
|
|
650
|
+
paramNotes.push(`⏭️ 澄清: 跳过`);
|
|
651
|
+
}
|
|
652
|
+
// v8.3.190+: run 流水线意图(preset / 起止点)
|
|
653
|
+
if (kbMatch.name === 'run') {
|
|
654
|
+
if (params.preset) {
|
|
655
|
+
fullCommand += ` --preset ${params.preset}`;
|
|
656
|
+
paramNotes.push(`🎯 流水线: ${params.preset}`);
|
|
657
|
+
}
|
|
658
|
+
if (params.from) {
|
|
659
|
+
fullCommand += ` --from ${params.from}`;
|
|
660
|
+
paramNotes.push(`📍 起点: ${params.from}`);
|
|
661
|
+
}
|
|
662
|
+
if (params.to) {
|
|
663
|
+
fullCommand += ` --to ${params.to}`;
|
|
664
|
+
paramNotes.push(`🏁 终点: ${params.to}`);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
599
667
|
// 补充分析意图已在 askEngine 顶层检测,此处不再重复
|
|
600
668
|
let detail = `🎯 推荐命令: ${fullCommand}\n${kbMatch.description}\n\n用法: ${kbMatch.usage}`;
|
|
601
669
|
if (paramNotes.length > 0)
|
|
@@ -620,7 +688,7 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
620
688
|
}
|
|
621
689
|
// ── 歧义检测: 第二候选与第一差距 < 15% ──
|
|
622
690
|
const second = results[1];
|
|
623
|
-
if (second && (best.confidence - second.confidence) < 15) {
|
|
691
|
+
if (!runForced && second && (best.confidence - second.confidence) < 15) {
|
|
624
692
|
const candidates = results.slice(0, 4);
|
|
625
693
|
const lines = ['🤔 检测到多个可能意图,请选择:', ''];
|
|
626
694
|
candidates.forEach((r, i) => {
|
|
@@ -645,7 +713,7 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
645
713
|
'🤔 我识别到你可能想执行 speccore 命令,但不确定这是调用 CLI 还是普通技术讨论:',
|
|
646
714
|
'',
|
|
647
715
|
` 你的输入: "${input}"`,
|
|
648
|
-
` 匹配意图: ${best.intent} → speccore ${best.command}`,
|
|
716
|
+
` 匹配意图: ${best.intent} → speccore ${best.command}${clarifyFlag}${runFlag}`,
|
|
649
717
|
'',
|
|
650
718
|
'如果是 speccore 操作,请补充明确的上下文词,例如:',
|
|
651
719
|
' • "用 speccore 分析本迭代需求"',
|
|
@@ -655,7 +723,7 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
655
723
|
'',
|
|
656
724
|
'如果是普通技术讨论(解释代码、审查片段、讨论需求),请直接描述你的问题。',
|
|
657
725
|
'',
|
|
658
|
-
'或输入 y 确认执行: speccore ' + best.command,
|
|
726
|
+
'或输入 y 确认执行: speccore ' + best.command + clarifyFlag + runFlag,
|
|
659
727
|
];
|
|
660
728
|
return {
|
|
661
729
|
mode: 'ambiguous',
|
|
@@ -665,10 +733,10 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
665
733
|
};
|
|
666
734
|
}
|
|
667
735
|
// ── 中置信度确认: 匹配到了但不确定,询问用户 ──
|
|
668
|
-
if (best.confidence < config.routing.highThreshold && best.confidence >= config.routing.lowThreshold) {
|
|
736
|
+
if (!runForced && best.confidence < config.routing.highThreshold && best.confidence >= config.routing.lowThreshold) {
|
|
669
737
|
const lines = ['🤔 我理解你想做这个,但不太确定,请确认:', ''];
|
|
670
738
|
lines.push(`🎯 我的理解: ${best.intent} (${best.confidence}%)`);
|
|
671
|
-
lines.push(`📋 建议命令: speccore ${best.command}`);
|
|
739
|
+
lines.push(`📋 建议命令: speccore ${best.command}${clarifyFlag}${runFlag}`);
|
|
672
740
|
lines.push('');
|
|
673
741
|
if (results.length > 1) {
|
|
674
742
|
lines.push('其他可能:');
|
|
@@ -720,6 +788,32 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
720
788
|
fullCommand += ` --with-code`;
|
|
721
789
|
paramNotes.push(`🔍 源码扫描: 结合工程源码分析`);
|
|
722
790
|
}
|
|
791
|
+
// v8.3.190+: 澄清步骤 ask 单次覆盖(仅 analyze 命令消费 optional_steps.clarify)
|
|
792
|
+
if (best.command === 'analyze') {
|
|
793
|
+
if (params.clarify === 'on') {
|
|
794
|
+
fullCommand += ` --clarify`;
|
|
795
|
+
paramNotes.push(`🔍 澄清: 强制澄清`);
|
|
796
|
+
}
|
|
797
|
+
else if (params.clarify === 'off') {
|
|
798
|
+
fullCommand += ` --skip-clarify`;
|
|
799
|
+
paramNotes.push(`⏭️ 澄清: 跳过`);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
// v8.3.190+: run 流水线意图 — preset 或起止点自动编排
|
|
803
|
+
if (best.command === 'run') {
|
|
804
|
+
if (params.preset) {
|
|
805
|
+
fullCommand += ` --preset ${params.preset}`;
|
|
806
|
+
paramNotes.push(`🎯 流水线: ${params.preset}`);
|
|
807
|
+
}
|
|
808
|
+
if (params.from) {
|
|
809
|
+
fullCommand += ` --from ${params.from}`;
|
|
810
|
+
paramNotes.push(`📍 起点: ${params.from}`);
|
|
811
|
+
}
|
|
812
|
+
if (params.to) {
|
|
813
|
+
fullCommand += ` --to ${params.to}`;
|
|
814
|
+
paramNotes.push(`🏁 终点: ${params.to}`);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
723
817
|
// v6.97.0+: 重新/补充分析模式
|
|
724
818
|
if (params.supplement) {
|
|
725
819
|
fullCommand += ` --supplement`;
|
|
@@ -778,7 +872,7 @@ async function handleMatch(input, isExplicit = false) {
|
|
|
778
872
|
// v6.97.0+ 修复:强制确认命令列表 — 即使置信度高也需要用户确认
|
|
779
873
|
// 这些命令会产生文件/副作用,不能误执行
|
|
780
874
|
const FORCE_CONFIRM_COMMANDS = new Set([
|
|
781
|
-
'analyze', 'split', 'plan', 'execute', '
|
|
875
|
+
'analyze', 'split', 'plan', 'execute', 'run',
|
|
782
876
|
'doc2spec', 'spec2doc', 'iteration', 'task',
|
|
783
877
|
'pr', 'done', 'change', 'reindex',
|
|
784
878
|
]);
|
|
@@ -1356,7 +1450,7 @@ function buildGuideDetail(name, steps) {
|
|
|
1356
1450
|
`---`,
|
|
1357
1451
|
`执行方式:`,
|
|
1358
1452
|
` 逐步执行: 按顺序手动执行每一步`,
|
|
1359
|
-
` 一键执行: speccore
|
|
1453
|
+
` 一键执行: speccore run(自动检测并推进)`,
|
|
1360
1454
|
` 编排执行: speccore ask "完整描述你的需求" --pipeline`,
|
|
1361
1455
|
].join('\n');
|
|
1362
1456
|
}
|