fix(dsh): keep AI waits off task execution and adapt main capabilities
Core regression / Python 3.12 core, intervention UI and release configuration (push) Failing after 21s
Core regression / JavaScript syntax (push) Successful in 3s
Core regression / Python 3.12 core, intervention UI and release configuration (pull_request) Failing after 21s
Core regression / JavaScript syntax (pull_request) Successful in 3s

This commit is contained in:
阿白叔 committed 2026-11-05 17:15:29 +08:00
1 parent 3ecb6fa276
commit eba935e710
24 files changed
+929 -128

No files matched your search

+1 -1
View File
@@ -124,7 +124,7 @@ window.__ModuleLoader__.load({id:'@dx/dsh-task',factory:require=>{
const blockerList=values=>values?.length?detail('阻断原因',values.map(value=>blockers[value]||value).join(';')):null;
function ImpactPanel({report,scope,perform,pending}){
const rows=report?.rows||[];
const policy=row=>row.value_policy==='preserve'?'保留原 Value':row.value_policy==='custom'?'自定义 Value':'复制元件库标签(实际值待执行读取)';
const policy=row=>row.value_policy==='preserve'?'保留原 Value':row.value_policy==='custom'?'自定义 Value':row.value_policy==='part_number'?'使用新料号':'复制元件库标签(实际值待执行读取)';
const columns=['范围','工程 / 图页','位号 / UID','旧料号 → 新料号','旧 Value → 拟议 Value','Cell / NC'];
return h('div',{'data-testid':'dx-operations-impact'},
actions(button('dx-impact-refresh','查看当前任务影响',()=>perform({operation:'impact',task_ids:scope}),pending||!scope.length)),
+1 -1
View File
@@ -96,7 +96,7 @@ export async function apply(ctx){
description:'Create real DxDesigner project tasks with replacement rules. Opens the native task preview and project selector; the user confirms the project scope. Returns actual task IDs after creation or cancellation. Does not execute CAD. A directory may be omitted: the user can supply it in the native dialog. project_directory only prefills that dialog and is never scanned automatically. Include only options explicitly requested by the user; omit unspecified options to retain task-center defaults. Available to interactive conversations, denied in automatic incident sessions.',
parameters:{name:{type:'string',required:true,description:'Short task name'},note:{type:'string'},
project_directory:{type:'string',description:'Optional directory suggested by the user; only displayed for native confirmation'},
copy_part_number_to_value:{type:'boolean',description:'Copy the part number into Value. Default false; set true only when requested.'},
copy_part_number_to_value:{type:'boolean',description:'Task default: false preserves original Value, true copies the new library Part Label (known only at execution). Default false; set true only when requested. Per-item overrides belong to the native target plan/BOM value_mode column.'},
rules:{type:'array',items:{type:'object',additionalProperties:false,properties:{
old_part_number:{type:'string',required:true},new_part_number:{type:'string',required:true},
target_cell:{type:'string',description:'Optional explicit target package/cell, unrelated to Value'},
+3 -3
View File
@@ -31,16 +31,16 @@ export function registerLifecycle(ctx){
const ids={type:'array',required:true,items:{type:'string'},description:'1 to 20 distinct real task IDs obtained from current records, in execution order. Never infer IDs.'};
const definitions=[
{name:'dx_task_catalog',capability:'catalog',parameters:{task_id:{type:'string',description:'Optional real task ID to also read its saved rule mappings, Value policy and execution phase.'}},
description:'List real tasks and their IDs, names, groups, statuses and notes. Optionally read one task in detail, including existing rule mappings. Use to resolve natural-language task references before changing, copying or executing a task. Reads saved records only. Interactive conversations only.'},
description:'List real tasks and their IDs, names, groups, statuses and notes. Optionally read one task in detail, including existing rule mappings and bounded saved target identities/Value policies. Target value_mode is the explicit saved selection: inherit uses the task default, preserve retains original Value, part_label reads the library label during execution, part_number uses the replacement number, custom uses explicit text. value_policy is its effective mode; omitted_targets reports unreturned targets. Use real IDs before changing, copying or executing. Reads saved records only. Interactive conversations only.'},
{name:'dx_task_preflight',capability:'preflight',parameters:{task_ids:ids},
description:'Check the selected saved tasks before execution. Reports project availability, enabled rules/targets, existing execution evidence, unresolved failures and resource blockers. No CAD connection or engineering writes. Returns concrete blockers; does not guarantee a successful CAD run. Interactive conversations only.'},
{name:'dx_task_manage',capability:'manage',parameters:{
operation:{type:'string',required:true,enum:['select','copy','update','archive']},task_id:{type:'string',required:true},
operation:{type:'string',required:true,enum:['select','copy','update','archive','import_bom']},task_id:{type:'string',required:true},
patch:{type:'object',additionalProperties:false,description:'Only for update. Omit fields the user did not request. Rule edits propagate to the existing task batch and are shown in the native preview.',properties:{
name:{type:'string'},note:{type:'string'},copy_part_number_to_value:{type:'boolean'},
rules:{type:'array',items:{type:'object',additionalProperties:false,properties:{old_part_number:{type:'string',required:true},
new_part_number:{type:'string'},target_cell:{type:'string'},custom_value:{type:'string'},custom_value_enabled:{type:'boolean'},sync_nc:{type:'boolean'},enabled:{type:'boolean'}}}}}}},
description:'Manage an existing real task. select changes the task-center selection. update previews explicit metadata and existing rule changes, then waits for native user confirmation. archive moves only that task to the recycle bin, preserving evidence. copy copies mapping configuration and opens the native selector for NEW engineering scope; never duplicates execution evidence or executes CAD. Returns committed IDs/results or cancellation. Native user confirmation cannot be supplied by model arguments. Interactive conversations only.'},
description:'Manage an existing real task. select changes the task-center selection. update previews explicit metadata and existing rule changes, then waits for native user confirmation. archive moves only that task to the recycle bin, preserving evidence. copy copies mapping configuration and opens the native selector for NEW engineering scope; never duplicates execution evidence or executes CAD. import_bom requires the task already selected and loaded: after native confirmation opens the existing multi-file Excel picker, validation and preview workflow. User chooses files and separately saves the checked batch plan; handed_off never means imported or saved. File paths and confirmation are never model arguments. Returns committed IDs/results or cancellation. Native user confirmation cannot be supplied by model arguments. Interactive conversations only.'},
{name:'dx_task_execute',capability:'execute',parameters:{operation:{type:'string',required:true,enum:['start','pause','resume']},task_ids:{type:'array',items:{type:'string'},description:ids.description},run_id:{type:'string',description:'For resume only, use the real saved run ID from execution history. Original frozen scope/order and existing checkpoint are inspected, then natively confirmed.'}},
description:'Start or continue the existing serial execution queue for an explicit ordered list of real task IDs. Prechecks and native confirmation are required; actual execution can replace and save engineering files using existing backup, interruption and verification gates. Waits for real results including saved, failed and no-match counts. For pause, provide exactly the active run scope; requests safe stopping after the current item and returns pause_requested, not a claim that stopping has completed. No force-stop, no new CAD scripting or hidden retry. Interactive conversations only.'},
{name:'dx_task_operations',capability:'operations',parameters:{
@@ -24,6 +24,11 @@ export function compactResult(value){
delete result.plan_hashes;delete result.fingerprint;delete result.full_fingerprint;
if(result.rows)Object.assign(result,impact(result));
if(result.impact)result.impact=impact(result.impact);
if(result.detail?.targets){
const targets=result.detail.targets;
result.detail={...result.detail,targets:targets.slice(0,20),
omitted_targets:(result.detail.omitted_targets||0)+Math.max(0,targets.length-20)};
}
if(result.tasks?.length>50){result.model_omitted_tasks=result.tasks.length-50;result.tasks=result.tasks.slice(0,50);}
if(result.tasks)result.tasks=result.tasks.map(t=>({...t,...t.note?{note:short(t.note,300)}:{}}));
if(result.runs)result.runs=result.runs.slice(0,5).map(run);