feat(web): AI 工作台意图规划与规划思考模型
- 新增 workbenchAiIntentPlannerModel,基于 LLM function_call 解析建单/草稿/提交意图,区分 model 与 rule_fallback 来源 - 新增 workbenchAiPlanningThinkingModel 合并规划思考事件流,按 eventId 去重合并 - application gate/preview 模型接入意图规划,usePersonalWorkbenchAiMode/useWorkbenchAiStewardFlow/useWorkbenchAiActionRouter 链路适配,支持上下文提交 - steward 服务与 stewardPlanModel 适配新动作结构,receipt-folder-view 微调样式 - 新增 intent-planner-model/application-context-submit/steward-actions-service 测试,更新 gate-model/action-router/plan-message-copy/fast-preview 测试
This commit is contained in:
@@ -71,3 +71,55 @@ test('steward plan summary guides bare reimbursement intent into scene selection
|
||||
assert.match(action.description, /先进入报销助手选择具体费用类型/)
|
||||
assert.equal(action.payload.carry_text, '我要报销')
|
||||
})
|
||||
|
||||
test('steward suggested action carries server executable application action step', () => {
|
||||
const plan = {
|
||||
plan_id: 'plan-application-submit',
|
||||
tasks: [
|
||||
{
|
||||
task_id: 'task-app-1',
|
||||
task_type: 'expense_application',
|
||||
title: '上海出差申请',
|
||||
assigned_agent: 'application_assistant',
|
||||
requested_action: 'submit',
|
||||
ontology_fields: {
|
||||
expense_type: 'travel',
|
||||
time_range: '2026-02-20 至 2026-02-23',
|
||||
location: '上海',
|
||||
reason: '辅助国网仿生产服务器部署',
|
||||
transport_mode: 'train'
|
||||
},
|
||||
missing_fields: [],
|
||||
action_steps: [
|
||||
{ step_id: 'task-app-1:01', action_type: 'fill_application_fields', status: 'planned' },
|
||||
{ step_id: 'task-app-1:02', action_type: 'build_application_preview', status: 'planned' },
|
||||
{ step_id: 'task-app-1:03', action_type: 'validate_required_fields', status: 'planned' },
|
||||
{ step_id: 'task-app-1:04', action_type: 'run_duplicate_precheck', status: 'planned' },
|
||||
{
|
||||
step_id: 'task-app-1:05',
|
||||
action_type: 'submit_application',
|
||||
status: 'pending_confirmation',
|
||||
requires_confirmation: true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
confirmation_groups: [
|
||||
{
|
||||
confirmation_id: 'confirm-task-app-1',
|
||||
action_type: 'confirm_create_application',
|
||||
target_task_id: 'task-app-1'
|
||||
}
|
||||
],
|
||||
next_action: 'confirm_task'
|
||||
}
|
||||
|
||||
const [action] = buildStewardSuggestedActions(plan)
|
||||
|
||||
assert.equal(action.payload.steward_execute_action, true)
|
||||
assert.equal(action.payload.steward_action_type, 'submit_application')
|
||||
assert.equal(action.payload.steward_action_step.step_id, 'task-app-1:05')
|
||||
assert.equal(action.payload.steward_action_requires_confirmation, true)
|
||||
assert.equal(action.payload.steward_current_task.requested_action, 'submit')
|
||||
assert.equal(action.payload.steward_current_task.action_steps.at(-1).action_type, 'submit_application')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user