refactor: let DSH infer intent from backend capability schemas

This commit is contained in:
阿白叔 committed 2026-10-30 14:49:22 +08:00
1 parent ef40f339cd
commit be382a117d
6 files changed
+43 -6

No files matched your search

+4 -1
View File
@@ -74,7 +74,10 @@ try {
await c.call('Input.dispatchKeyEvent',{type:'keyDown',key:'Escape',code:'Escape'});
await c.call('Input.dispatchKeyEvent',{type:'keyUp',key:'Escape',code:'Escape'});
await c.click(`document.querySelector('[contenteditable="true"]')`);
await c.call('Input.insertText',{text:liveModel ? '请分析当前任务:先调用 dx_task_snapshot 获取真实任务快照,然后用中文告诉我任务名称、当前状态和允许的下一步。不要修改工程。' : '请分析当前任务的异常,并说明允许的处理方式。'});
const prompt=liveModel ? '请分析当前任务的状态和异常,告诉我任务名称、现在进展到哪一步以及接下来可以做什么。不要修改工程。' : '请分析当前任务的异常,并说明允许的处理方式。';
report.prompt=prompt;
report.explicitToolNamesInPrompt=false;
await c.call('Input.insertText',{text:prompt});
await wait(`document.querySelector('[contenteditable="true"]').textContent.includes('请分析当前任务')`);
report.checks.push('typed into official composer with native keyboard input');
report.liveModelReplyTested=false;
+4 -1
View File
@@ -16,7 +16,10 @@ async function wait(expression,timeout=30000){
try{
await wait(`!!document.querySelector('[contenteditable="true"]')`,50000);
await c.click(`document.querySelector('[contenteditable="true"]')`);
await c.call('Input.insertText',{text:'请现在调用 dx_task_create 创建名为“DSH对话换料验收”的工程任务,备注“真实对话验收”,替换规则 OLD123 → NEW456,把料号复制到 Value。工程目录我会在本机原生窗口中选择。仅创建任务,不采集、不替换。完成后告诉我实际创建数量和真实 task_id。'});
const prompt='帮我建个换料任务,名字叫“DSH对话换料验收”,备注写“真实对话验收”。把 OLD123 换成 NEW456,料号也复制到 Value。工程目录我来选,先别开始替换。建好后告诉我数量和任务编号。';
report.prompt=prompt;
report.explicitToolNamesInPrompt=false;
await c.call('Input.insertText',{text:prompt});
await c.click(`document.querySelector('button[aria-label="发送消息"]')`);
report.checks.push('typed and sent natural-language task creation request through official composer');
await wait(`fetch('/dx/context').then(r=>r.json()).then(d=>d.creation?.result?.status==='created')`,180000);