feat(web): AI 工作台命令意图解析与动作策略

- 新增 workbenchIntentFrameModel,解析删除/审批/查询/咨询政策等意图帧,含风险等级、目标模式(当前上下文/筛选候选)与日期归一化
- 新增 workbenchIntentActionPolicy,按意图帧路由下一步(直通/拦截批量/上下文确认/查询候选)
- 新增 workbenchAiCommandIntentModel 与 useWorkbenchAiCommandIntents,识别草稿删除意图并解析最近草稿载荷生成引导
- usePersonalWorkbenchAiMode 接入命令意图处理,personal-workbench-ai-mode.css 适配
- 新增 command-intent-model/intent-frame-model 测试
This commit is contained in:
caoxiaozhu
2026-06-24 22:58:59 +08:00
parent a0f6d9f702
commit 3eb78d343a
8 changed files with 732 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ import { useWorkbenchAiStewardFlow } from './useWorkbenchAiStewardFlow.js'
import {
isReimbursementCreationIntent
} from './workbenchAiApplicationGateModel.js'
import { useWorkbenchAiCommandIntents } from './useWorkbenchAiCommandIntents.js'
import {
buildRuleFallbackWorkbenchAiIntentPlan,
normalizeWorkbenchAiIntentPlan,
@@ -164,6 +165,24 @@ export function usePersonalWorkbenchAiMode(props, emit) {
scrollInlineConversationToBottom
})
const commandIntents = useWorkbenchAiCommandIntents({
activateInlineConversation,
activeConversationTitle,
assistantDraft,
clearAiModeFiles: filesFlow.clearAiModeFiles,
closeWorkbenchDatePicker,
conversationId,
conversationMessages,
createInlineMessage,
documentQueryFlow,
inlineConversationAutoScrollPinned,
persistCurrentConversation,
removeWorkbenchDateTag,
scrollInlineConversationToBottom,
searchConversationId: AI_SEARCH_CONVERSATION_ID,
sending
})
const attachmentFlow = useWorkbenchAiAttachmentAssociationFlow({
aiAttachmentAssociationRuntime,
conversationId,
@@ -728,8 +747,7 @@ export function usePersonalWorkbenchAiMode(props, emit) {
return
}
if (aiExpenseDraft.value && !isAiExpenseDraftComplete(aiExpenseDraft.value)) {
expenseFlow.advanceAiExpenseDraft(cleanPrompt, files)
if (commandIntents.handleInlineDraftDeletionIntent(cleanPrompt, entry)) {
return
}
@@ -737,6 +755,11 @@ export function usePersonalWorkbenchAiMode(props, emit) {
return
}
if (aiExpenseDraft.value && !isAiExpenseDraftComplete(aiExpenseDraft.value)) {
expenseFlow.advanceAiExpenseDraft(cleanPrompt, files)
return
}
if (shouldRequestWorkbenchAiIntentPlan(cleanPrompt)) {
void executeModelPlannedWorkbenchIntent(cleanPrompt, entry, files)
return