From f18152919524d2eda217e3baee62f7decd1bf49a Mon Sep 17 00:00:00 2001 From: WeiCHEN Date: Mon, 7 Sep 2026 23:16:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(intent):=20=E5=A2=9E=E5=BC=BA=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E5=B8=82=E5=9C=BA=E6=A7=BD=E4=BD=8D=E6=84=8F=E5=9B=BE?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=B8=8E=E4=B8=8A=E4=B8=8B=E6=96=87=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=8E=A8=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- internal/coordinator/context.go | 8 +++++++- internal/intent/recognizer.go | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/coordinator/context.go b/internal/coordinator/context.go index 152754e7..2fdeea94 100644 --- a/internal/coordinator/context.go +++ b/internal/coordinator/context.go @@ -256,6 +256,12 @@ func (a *ContextAssembler) AssembleFromWorkspace(workDir string, user UserInfo) ctx.Project.TargetMarket = wsMeta.TargetMarket ctx.Project.CurrentWorkflow = wsMeta.TaskKey } + } else { + // 备选:从目录名推断 + baseName := filepath.Base(workDir) + if strings.HasPrefix(baseName, "intake_") { + ctx.Project.CurrentWorkflow = "intake" + } } // 2. 尝试读取 blackboard.json @@ -275,7 +281,7 @@ func (a *ContextAssembler) AssembleFromWorkspace(workDir string, user UserInfo) } // 3. 尝试提取阶段与文档 - if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.1") { + if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.1") || ctx.Project.CurrentWorkflow == "intake" { ctx.Project.CurrentStage = bizdev.StageV01_Triage } else if strings.HasPrefix(ctx.Project.CurrentWorkflow, "V0.5") { ctx.Project.CurrentStage = bizdev.StageV05_Feasibility diff --git a/internal/intent/recognizer.go b/internal/intent/recognizer.go index b9641484..a1e112da 100644 --- a/internal/intent/recognizer.go +++ b/internal/intent/recognizer.go @@ -305,6 +305,7 @@ func extractFactSlots(input string) map[string]string { // 目标市场 marketPrefixes := []string{ + "目标市场不仅是", "目标市场不仅有", "目标市场还包括", "目标市场确定为", "目标市场确定是", "目标市场改成", "目标市场改为", "目标市场是", "目标市场为", "市场改成", "市场改为", "市场是", "市场为", "目标市场除了国内还想考虑", } @@ -400,8 +401,8 @@ func matchAdvanceStage(input string, currentStage bizdev.MaturityStage) *Candida func matchSupplementInfo(input string) *CandidateIntent { patterns := []string{ - "补充", "更新", "客户说", "客户反馈", "修改为", "改为", "增加", - "市场是", "参数是", "用途是", "设备是", "预算是", "时间是", "资料", "附件", + "补充", "更新", "客户说", "客户反馈", "客户确定", "修改为", "改为", "增加", + "目标市场", "市场是", "参数是", "用途是", "设备是", "预算是", "时间是", "资料", "附件", } matchedAny := false