@aheart-ui/ai 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +10 -1
  2. package/es/actions/index.d.ts +2 -0
  3. package/es/actions/index.js +5 -0
  4. package/es/actions/style.css +36 -0
  5. package/es/actions.vue.d.ts +4 -4
  6. package/es/agent/index.d.ts +5 -0
  7. package/es/agent/index.js +12 -0
  8. package/es/agent/style.css +3241 -0
  9. package/es/agent-execution.vue.d.ts +4 -4
  10. package/es/agent-execution.vue.js +2 -2
  11. package/es/agent-workbench/index.d.ts +2 -0
  12. package/es/agent-workbench/index.js +5 -0
  13. package/es/agent-workbench/style.css +2423 -0
  14. package/es/agent-workbench.vue.d.ts +4 -4
  15. package/es/agent-workbench.vue.js +10 -7
  16. package/es/attachments/index.d.ts +2 -0
  17. package/es/attachments/index.js +5 -0
  18. package/es/attachments/style.css +62 -0
  19. package/es/attachments.vue.d.ts +4 -4
  20. package/es/bubble/index.d.ts +2 -0
  21. package/es/bubble/index.js +5 -0
  22. package/es/bubble/style.css +241 -0
  23. package/es/bubble.vue.d.ts +3 -3
  24. package/es/chat/index.d.ts +11 -0
  25. package/es/chat/index.js +23 -0
  26. package/es/chat/style.css +595 -0
  27. package/es/chat-panel/index.d.ts +3 -0
  28. package/es/chat-panel/index.js +8 -0
  29. package/es/chat-panel/style.css +591 -0
  30. package/es/chat-panel.vue.d.ts +4 -4
  31. package/es/conversations/index.d.ts +2 -0
  32. package/es/conversations/index.js +5 -0
  33. package/es/conversations/style.css +48 -0
  34. package/es/conversations.vue.d.ts +4 -4
  35. package/es/form/index.d.ts +3 -0
  36. package/es/form/index.js +9 -0
  37. package/es/form/style.css +3175 -0
  38. package/es/form-field.vue.d.ts +4 -4
  39. package/es/form-field.vue.js +53 -43
  40. package/es/form.vue.d.ts +4 -4
  41. package/es/form.vue.js +7 -6
  42. package/es/process/index.d.ts +2 -0
  43. package/es/process/index.js +5 -0
  44. package/es/process/style.css +77 -0
  45. package/es/process.vue.d.ts +3 -3
  46. package/es/prompts/index.d.ts +2 -0
  47. package/es/prompts/index.js +5 -0
  48. package/es/prompts/style.css +76 -0
  49. package/es/prompts.vue.d.ts +4 -4
  50. package/es/sender/index.d.ts +2 -0
  51. package/es/sender/index.js +5 -0
  52. package/es/sender/style.css +88 -0
  53. package/es/sender.vue.d.ts +4 -4
  54. package/es/sources/index.d.ts +2 -0
  55. package/es/sources/index.js +5 -0
  56. package/es/sources/style.css +54 -0
  57. package/es/sources.vue.d.ts +3 -3
  58. package/es/thought-chain/index.d.ts +2 -0
  59. package/es/thought-chain/index.js +5 -0
  60. package/es/thought-chain/style.css +77 -0
  61. package/es/thought-chain.vue.d.ts +3 -3
  62. package/es/welcome/index.d.ts +2 -0
  63. package/es/welcome/index.js +5 -0
  64. package/es/welcome/style.css +33 -0
  65. package/es/welcome.vue.d.ts +3 -3
  66. package/lib/actions/index.d.ts +2 -0
  67. package/lib/actions/index.js +1 -0
  68. package/lib/actions/style.css +36 -0
  69. package/lib/actions.vue.d.ts +4 -4
  70. package/lib/agent/index.d.ts +5 -0
  71. package/lib/agent/index.js +1 -0
  72. package/lib/agent/style.css +3241 -0
  73. package/lib/agent-execution.vue.d.ts +4 -4
  74. package/lib/agent-execution.vue.js +1 -1
  75. package/lib/agent-workbench/index.d.ts +2 -0
  76. package/lib/agent-workbench/index.js +1 -0
  77. package/lib/agent-workbench/style.css +2423 -0
  78. package/lib/agent-workbench.vue.d.ts +4 -4
  79. package/lib/agent-workbench.vue.js +1 -1
  80. package/lib/attachments/index.d.ts +2 -0
  81. package/lib/attachments/index.js +1 -0
  82. package/lib/attachments/style.css +62 -0
  83. package/lib/attachments.vue.d.ts +4 -4
  84. package/lib/bubble/index.d.ts +2 -0
  85. package/lib/bubble/index.js +1 -0
  86. package/lib/bubble/style.css +241 -0
  87. package/lib/bubble.vue.d.ts +3 -3
  88. package/lib/chat/index.d.ts +11 -0
  89. package/lib/chat/index.js +1 -0
  90. package/lib/chat/style.css +595 -0
  91. package/lib/chat-panel/index.d.ts +3 -0
  92. package/lib/chat-panel/index.js +1 -0
  93. package/lib/chat-panel/style.css +591 -0
  94. package/lib/chat-panel.vue.d.ts +4 -4
  95. package/lib/conversations/index.d.ts +2 -0
  96. package/lib/conversations/index.js +1 -0
  97. package/lib/conversations/style.css +48 -0
  98. package/lib/conversations.vue.d.ts +4 -4
  99. package/lib/form/index.d.ts +3 -0
  100. package/lib/form/index.js +1 -0
  101. package/lib/form/style.css +3175 -0
  102. package/lib/form-field.vue.d.ts +4 -4
  103. package/lib/form-field.vue.js +1 -1
  104. package/lib/form.vue.d.ts +4 -4
  105. package/lib/form.vue.js +1 -1
  106. package/lib/process/index.d.ts +2 -0
  107. package/lib/process/index.js +1 -0
  108. package/lib/process/style.css +77 -0
  109. package/lib/process.vue.d.ts +3 -3
  110. package/lib/prompts/index.d.ts +2 -0
  111. package/lib/prompts/index.js +1 -0
  112. package/lib/prompts/style.css +76 -0
  113. package/lib/prompts.vue.d.ts +4 -4
  114. package/lib/sender/index.d.ts +2 -0
  115. package/lib/sender/index.js +1 -0
  116. package/lib/sender/style.css +88 -0
  117. package/lib/sender.vue.d.ts +4 -4
  118. package/lib/sources/index.d.ts +2 -0
  119. package/lib/sources/index.js +1 -0
  120. package/lib/sources/style.css +54 -0
  121. package/lib/sources.vue.d.ts +3 -3
  122. package/lib/thought-chain/index.d.ts +2 -0
  123. package/lib/thought-chain/index.js +1 -0
  124. package/lib/thought-chain/style.css +77 -0
  125. package/lib/thought-chain.vue.d.ts +3 -3
  126. package/lib/welcome/index.d.ts +2 -0
  127. package/lib/welcome/index.js +1 -0
  128. package/lib/welcome/style.css +33 -0
  129. package/lib/welcome.vue.d.ts +3 -3
  130. package/package.json +106 -4
@@ -1,5 +1,5 @@
1
1
  import type { AIAgentArtifact, AIAgentTask } from './types';
2
- declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  tasks?: AIAgentTask[] | undefined;
4
4
  artifacts?: AIAgentArtifact[] | undefined;
5
5
  activeArtifact?: string | undefined;
@@ -20,7 +20,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
20
20
  actionDisabled: () => false;
21
21
  operationMessages: () => {};
22
22
  validateCandidate: () => undefined;
23
- }>>, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
23
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
24
  retry: (task: AIAgentTask) => void;
25
25
  approve: (task: AIAgentTask) => void;
26
26
  reject: (task: AIAgentTask) => void;
@@ -29,7 +29,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
29
29
  "move-task": (id: string, direction: "up" | "down") => void;
30
30
  "move-task-reject": (reason: string) => void;
31
31
  "select-artifact": (artifact: AIAgentArtifact) => void;
32
- }, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
32
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
33
33
  tasks?: AIAgentTask[] | undefined;
34
34
  artifacts?: AIAgentArtifact[] | undefined;
35
35
  activeArtifact?: string | undefined;
@@ -69,7 +69,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
69
69
  actionDisabled: (task: AIAgentTask, action: string) => boolean;
70
70
  operationMessages: Record<string, string>;
71
71
  validateCandidate: (tasks: AIAgentTask[]) => string | undefined;
72
- }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>, {
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
73
73
  task?(_: {
74
74
  task: AIAgentTask;
75
75
  index: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("aheart-ui"),ne=require("@aheart-ui/dnd"),J=require("./safe-markdown.js"),se={class:"aheart-ai-workbench__execution-content"},ce={key:0,class:"aheart-ai-workbench__mobile-priority",role:"region","aria-label":"移动端优先处理"},ie={class:"aheart-ai-workbench__priority-heading"},de={class:"aheart-ai-workbench__eyebrow"},pe={key:0},ue={key:1},ke={key:0,class:"aheart-ai-workbench__priority-approval"},me={key:0},ve={class:"aheart-ai-workbench__priority-actions"},_e={key:1,class:"aheart-ai-workbench__approval-result"},ye=["aria-label"],he={key:0},be=["aria-label"],ge={key:0},Be=["aria-labelledby"],Ne={class:"aheart-ai-workbench__section-heading"},Ve=["id"],Ee={class:"aheart-ai-workbench__timeline"},fe=["data-task-id"],Ce={class:"aheart-ai-workbench__task-body"},we={class:"aheart-ai-workbench__task-summary"},Se={key:0,class:"aheart-ai-workbench__tool-name"},De={class:"aheart-ai-workbench__task-status"},$e={key:0,class:"aheart-ai-workbench__task-detail"},xe={key:1,class:"aheart-ai-workbench__tool-call","aria-label":"工具调用摘要"},je={key:0},Ae={key:1},Te={key:2},Me={key:2,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ie={key:3,class:"aheart-ai-workbench__task-lock-reason",role:"status"},ze={key:4,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ke={key:5,class:"aheart-ai-workbench__task-progress"},Re=["aria-valuenow"],Le={key:6,class:"aheart-ai-workbench__task-time"},Fe={key:0},qe={key:1},Ue={key:7,class:"aheart-ai-workbench__task-error"},He={class:"aheart-ai-workbench__task-actions"},Pe={key:8,class:"aheart-ai-workbench__operation-status",role:"status"},Oe=["data-approval-id"],We={key:0},Ze={key:1,class:"aheart-ai-workbench__approval-result"},Ge={key:0,class:"aheart-ai-workbench__empty"},Je=["aria-labelledby"],Qe={class:"aheart-ai-workbench__section-heading"},Xe=["id"],Ye={key:0,class:"aheart-ai-workbench__artifact-list"},et=["data-artifact-id"],tt=["aria-pressed","onClick"],at={key:0},ot={key:1,class:"aheart-ai-workbench__empty"},lt={key:2,class:"aheart-ai-workbench__artifact-preview","aria-label":"产物预览"},rt={class:"aheart-ai-workbench__artifact-preview-header"},nt=["href"],st={key:0},ct=e.defineComponent({name:"AIAgentWorkbenchExecution",__name:"agent-execution",props:{tasks:{default:()=>[]},artifacts:{default:()=>[]},activeArtifact:{default:void 0},disabled:{type:Boolean,default:!1},reorderable:{type:Boolean,default:!0},tasksRevision:{},scopeKey:{default:"default"},actionDisabled:{type:Function,default:()=>!1},operationMessages:{default:()=>({})},validateCandidate:{type:Function,default:()=>{}}},emits:["update:tasks","approve","reject","cancel","retry","move-task","move-task-reject","select-artifact"],setup(i,{emit:Q}){const r=i,C=e.computed(()=>`aheart-agent-execution-${String(r.scopeKey??"default").replace(/[^a-zA-Z0-9_-]/g,"-")}`),w=e.computed(()=>`${C.value}-tasks`),S=e.computed(()=>`${C.value}-artifacts`),d=Q,X={pending:"等待执行",running:"执行中","waiting-approval":"等待审批",complete:"已完成",error:"执行失败",cancelled:"已取消"},Y=e.computed(()=>r.tasks.map((o,l)=>({...o,__sortableKey:`${o.id}::${l}`}))),n=e.computed(()=>r.artifacts.find(o=>o.id===r.activeArtifact)??r.artifacts[0]),s=e.computed(()=>r.tasks.find(o=>o.approval&&(!o.approval.status||o.approval.status==="pending"))??r.tasks.find(o=>o.approval)),_=e.computed(()=>r.artifacts.find(o=>{var l,c;return o.id===((c=(l=s.value)==null?void 0:l.approval)==null?void 0:c.artifactId)})??n.value),ee=e.computed(()=>{var o;return(o=s.value)!=null&&o.approval&&(!s.value.approval.status||s.value.approval.status==="pending")?"等待审批":s.value?"审批结果":"当前产物"}),a=o=>o,p=o=>o.toolCall,N=o=>{var l;return`${o.id}:${String(o.revision??"")}:${((l=o.approval)==null?void 0:l.id)??""}`},te=o=>{d("move-task-reject",{"stale-revision":"任务版本已变化,排序已拒绝","source-missing":"源任务已不存在,排序已拒绝","target-missing":"目标位置已不存在,排序已拒绝","duplicate-key":"任务标识重复,无法排序","group-mismatch":"任务不属于当前排序分组",disabled:"任务当前不可排序,排序已拒绝","invalid-position":"目标位置无效,排序已拒绝","parent-rejected":"任务版本已变化,排序已拒绝","rollback-rejected":"排序回滚失败,请刷新后重试",unmounted:"排序目标已卸载",cancelled:"排序已取消"}[o.reason??""]??"任务当前不可排序,排序已拒绝")},ae=o=>X[o],oe=o=>o.status,le=o=>ae(o.status),V=o=>Math.min(100,Math.max(0,Math.round(o??0))),re=o=>{var l;if(!r.disabled&&r.reorderable){const c=o.map(({__sortableKey:b,...h})=>h),k=(l=r.validateCandidate)==null?void 0:l.call(r,c);if(k){d("move-task-reject",k);return}d("update:tasks",c)}},D=(o,l)=>{var h;if(E(r.tasks[o],o,l))return;const c=[...r.tasks],[k]=c.splice(o,1);c.splice(o+l,0,k);const b=(h=r.validateCandidate)==null?void 0:h.call(r,c);if(b){d("move-task-reject",b);return}d("update:tasks",c),d("move-task",k.id,l<0?"up":"down")},y=(o,l)=>{var c;return r.disabled||!!((c=r.actionDisabled)!=null&&c.call(r,o,l))},E=(o,l,c)=>!!(r.disabled||!r.reorderable||l+c<0||l+c>=r.tasks.length||(o==null?void 0:o.reorderable)===!1||o!=null&&o.lockedReason||(o==null?void 0:o.status)==="running"||(o==null?void 0:o.status)==="waiting-approval");return(o,l)=>{var c,k,b,h,$,x;return e.openBlock(),e.createElementBlock("div",se,[s.value||n.value?(e.openBlock(),e.createElementBlock("section",ce,[e.createElementVNode("div",ie,[e.createElementVNode("span",de,e.toDisplayString(ee.value),1),s.value?(e.openBlock(),e.createElementBlock("strong",pe,e.toDisplayString((c=s.value.approval)==null?void 0:c.title),1)):(e.openBlock(),e.createElementBlock("strong",ue,"查看当前产物"))]),s.value?(e.openBlock(),e.createElementBlock("div",ke,[(k=s.value.approval)!=null&&k.description?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(s.value.approval.description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ve,[!((b=s.value.approval)!=null&&b.status)||s.value.approval.status==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(s.value,"approve"),onClick:l[0]||(l[0]=t=>d("approve",s.value))},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(s.value,"reject"),onClick:l[1]||(l[1]=t=>d("reject",s.value))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled"])],64)):(e.openBlock(),e.createElementBlock("span",_e,e.toDisplayString(s.value.approval.status==="approved"?"已批准":"已拒绝"),1))])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"approval","aria-label":_.value.title,onClick:l[2]||(l[2]=t=>d("select-artifact",_.value))},[e.createElementVNode("span",null,e.toDisplayString(($=(h=s.value)==null?void 0:h.approval)!=null&&$.artifactId?"审批对象":"当前产物"),1),e.createElementVNode("strong",null,e.toDisplayString(_.value.title),1),_.value.description?(e.openBlock(),e.createElementBlock("small",he,e.toDisplayString(_.value.description),1)):e.createCommentVNode("",!0)],8,ye)):e.createCommentVNode("",!0),n.value&&n.value.id!==((x=_.value)==null?void 0:x.id)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"current","aria-label":n.value.title,onClick:l[3]||(l[3]=t=>d("select-artifact",n.value))},[l[6]||(l[6]=e.createElementVNode("span",null,"当前产物",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value.title),1),n.value.description?(e.openBlock(),e.createElementBlock("small",ge,e.toDisplayString(n.value.description),1)):e.createCommentVNode("",!0)],8,be)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:"aheart-ai-workbench__tasks","aria-labelledby":w.value},[e.createElementVNode("div",Ne,[e.createElementVNode("div",null,[l[7]||(l[7]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"执行流程",-1)),e.createElementVNode("h2",{id:w.value},"执行时间线",8,Ve)]),e.createElementVNode("span",null,e.toDisplayString(i.tasks.length)+" 项",1)]),e.createElementVNode("div",Ee,[e.createVNode(e.unref(ne.SortableList),{items:Y.value,"item-key":"__sortableKey",disabled:i.disabled||!i.reorderable,revision:i.tasksRevision,group:`agent-tasks-${i.scopeKey}`,"onUpdate:items":re,onMoveReject:te},{item:e.withCtx(({item:t,index:m})=>[e.renderSlot(o.$slots,"task",{task:a(t),index:m},()=>{var g,f,j,A,T,M,I,z,K,R,L,F,q,U,H,P,O,W,Z,G;return[e.createElementVNode("article",{"data-task-id":a(t).id,class:e.normalizeClass(["aheart-ai-workbench__timeline-item",[`is-${oe(a(t))}`,{"has-approval-summary":!!a(t).approval}]])},[l[15]||(l[15]=e.createElementVNode("span",{class:"aheart-ai-workbench__timeline-marker","aria-hidden":"true"},null,-1)),e.createElementVNode("div",Ce,[e.createElementVNode("header",we,[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString(a(t).label),1),a(t).toolName?(e.openBlock(),e.createElementBlock("span",Se,e.toDisplayString(a(t).toolName),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",De,e.toDisplayString(le(a(t))),1)]),a(t).detail&&!p(a(t))?(e.openBlock(),e.createElementBlock("p",$e,e.toDisplayString(a(t).detail),1)):e.createCommentVNode("",!0),p(a(t))?(e.openBlock(),e.createElementBlock("section",xe,[e.createElementVNode("strong",null,e.toDisplayString((g=p(a(t)))==null?void 0:g.name),1),e.createElementVNode("span",null,e.toDisplayString((f=p(a(t)))==null?void 0:f.summary),1),(j=p(a(t)))!=null&&j.inputSummary?(e.openBlock(),e.createElementBlock("small",je,e.toDisplayString((A=p(a(t)))==null?void 0:A.inputSummary),1)):e.createCommentVNode("",!0),(T=p(a(t)))!=null&&T.resultSummary?(e.openBlock(),e.createElementBlock("small",Ae,e.toDisplayString((M=p(a(t)))==null?void 0:M.resultSummary),1)):e.createCommentVNode("",!0),(I=p(a(t)))!=null&&I.error?(e.openBlock(),e.createElementBlock("small",Te,e.toDisplayString((z=p(a(t)))==null?void 0:z.error),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).lockedReason||((K=i.operationMessages)==null?void 0:K[N(a(t))])===""?(e.openBlock(),e.createElementBlock("p",Me,e.toDisplayString(a(t).lockedReason),1)):e.createCommentVNode("",!0),a(t).revision===void 0&&y(a(t),"approve")?(e.openBlock(),e.createElementBlock("p",Ie,"缺少任务版本")):e.createCommentVNode("",!0),(R=a(t).approval)!=null&&R.artifactId&&(!i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)})||i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)&&u.revision===void 0}))?(e.openBlock(),e.createElementBlock("p",ze,"缺少产物版本")):e.createCommentVNode("",!0),a(t).progress!==void 0?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{role:"progressbar","aria-label":"任务进度","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":V(a(t).progress)},[e.createElementVNode("span",{style:e.normalizeStyle({inlineSize:`${V(a(t).progress)}%`})},null,4)],8,Re),e.createElementVNode("small",null,e.toDisplayString(V(a(t).progress))+"%",1)])):e.createCommentVNode("",!0),a(t).startedAt||a(t).completedAt?(e.openBlock(),e.createElementBlock("div",Le,[a(t).startedAt?(e.openBlock(),e.createElementBlock("span",Fe,"开始 "+e.toDisplayString(a(t).startedAt),1)):e.createCommentVNode("",!0),a(t).completedAt?(e.openBlock(),e.createElementBlock("span",qe,"完成 "+e.toDisplayString(a(t).completedAt),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).error?(e.openBlock(),e.createElementBlock("details",Ue,[l[8]||(l[8]=e.createElementVNode("summary",null,"查看错误详情",-1)),e.createElementVNode("p",null,e.toDisplayString(a(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[a(t).status==="running"?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:0,"data-action":"cancel",type:"text",disabled:y(a(t),"cancel"),onClick:u=>d("cancel",a(t))},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),a(t).status==="error"||(L=i.operationMessages)!=null&&L[N(a(t))]?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:1,"data-action":"retry",type:"text",disabled:y(a(t),"retry"),onClick:u=>d("retry",a(t))},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("重试",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v.Button),{"data-action":"move-up",type:"text",disabled:E(a(t),m,-1),onClick:u=>D(m,-1)},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"move-down",type:"text",disabled:E(a(t),m,1),onClick:u=>D(m,1)},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])]),(F=i.operationMessages)!=null&&F[N(a(t))]?(e.openBlock(),e.createElementBlock("p",Pe,e.toDisplayString(i.operationMessages[N(a(t))]),1)):e.createCommentVNode("",!0),a(t).approval?(e.openBlock(),e.createElementBlock("div",{key:9,"data-approval-id":(q=a(t).approval)==null?void 0:q.id,class:e.normalizeClass(["aheart-ai-workbench__approval",`is-${((U=a(t).approval)==null?void 0:U.status)??"pending"}`])},[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString((H=a(t).approval)==null?void 0:H.title),1),(P=a(t).approval)!=null&&P.description?(e.openBlock(),e.createElementBlock("p",We,e.toDisplayString((O=a(t).approval)==null?void 0:O.description),1)):e.createCommentVNode("",!0)]),!((W=a(t).approval)!=null&&W.status)||((Z=a(t).approval)==null?void 0:Z.status)==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(a(t),"approve"),onClick:u=>d("approve",a(t))},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(a(t),"reject"),onClick:u=>d("reject",a(t))},{default:e.withCtx(()=>[...l[14]||(l[14]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled","onClick"])],64)):(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(((G=a(t).approval)==null?void 0:G.status)==="approved"?"已批准":"已拒绝"),1))],10,Oe)):e.createCommentVNode("",!0)])],10,fe)]})]),_:3},8,["items","disabled","revision","group"])]),i.tasks.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Ge,"尚无执行任务。"))],8,Be),e.createElementVNode("section",{class:"aheart-ai-workbench__artifacts","aria-labelledby":S.value},[e.createElementVNode("div",Qe,[e.createElementVNode("div",null,[l[16]||(l[16]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"产物输出",-1)),e.createElementVNode("h2",{id:S.value},"产物",8,Xe)]),e.createElementVNode("span",null,e.toDisplayString(i.artifacts.length)+" 项",1)]),i.artifacts.length?(e.openBlock(),e.createElementBlock("ul",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.artifacts,t=>{var m,g;return e.openBlock(),e.createElementBlock("li",{key:t.id,"data-artifact-id":t.id,class:e.normalizeClass({"is-active":t.id===((m=n.value)==null?void 0:m.id)})},[e.createElementVNode("button",{type:"button","aria-pressed":t.id===((g=n.value)==null?void 0:g.id),onClick:f=>d("select-artifact",t)},[e.renderSlot(o.$slots,"artifact",{artifact:t},()=>[e.createElementVNode("span",null,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("small",at,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])],8,tt)],10,et)}),128))])):(e.openBlock(),e.createElementBlock("p",ot,"任务完成后,产物会出现在这里。")),n.value?(e.openBlock(),e.createElementBlock("section",lt,[e.renderSlot(o.$slots,"artifact-preview",{artifact:n.value},()=>[e.createElementVNode("div",rt,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(n.value.type??"文件"),1),e.createElementVNode("h3",null,e.toDisplayString(n.value.title),1)]),e.unref(J.getSafeUrl)(n.value.url)?(e.openBlock(),e.createElementBlock("a",{key:0,href:e.unref(J.getSafeUrl)(n.value.url),target:"_blank",rel:"noreferrer"},"打开产物",8,nt)):e.createCommentVNode("",!0)]),e.createElementVNode("p",null,e.toDisplayString(n.value.description??"业务层可通过 artifact-preview 插槽提供自定义预览。"),1),n.value.updatedAt?(e.openBlock(),e.createElementBlock("small",st,"更新于 "+e.toDisplayString(n.value.updatedAt),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],8,Je)])}}});exports.default=ct;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("aheart-ui/button"),ne=require("@aheart-ui/dnd/sortable"),J=require("./safe-markdown.js"),se={class:"aheart-ai-workbench__execution-content"},ce={key:0,class:"aheart-ai-workbench__mobile-priority",role:"region","aria-label":"移动端优先处理"},ie={class:"aheart-ai-workbench__priority-heading"},de={class:"aheart-ai-workbench__eyebrow"},pe={key:0},ue={key:1},ke={key:0,class:"aheart-ai-workbench__priority-approval"},me={key:0},ve={class:"aheart-ai-workbench__priority-actions"},_e={key:1,class:"aheart-ai-workbench__approval-result"},ye=["aria-label"],he={key:0},be=["aria-label"],ge={key:0},Be=["aria-labelledby"],Ne={class:"aheart-ai-workbench__section-heading"},Ve=["id"],Ee={class:"aheart-ai-workbench__timeline"},fe=["data-task-id"],Ce={class:"aheart-ai-workbench__task-body"},we={class:"aheart-ai-workbench__task-summary"},Se={key:0,class:"aheart-ai-workbench__tool-name"},De={class:"aheart-ai-workbench__task-status"},$e={key:0,class:"aheart-ai-workbench__task-detail"},xe={key:1,class:"aheart-ai-workbench__tool-call","aria-label":"工具调用摘要"},je={key:0},Ae={key:1},Te={key:2},Me={key:2,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ie={key:3,class:"aheart-ai-workbench__task-lock-reason",role:"status"},ze={key:4,class:"aheart-ai-workbench__task-lock-reason",role:"status"},Ke={key:5,class:"aheart-ai-workbench__task-progress"},Re=["aria-valuenow"],Le={key:6,class:"aheart-ai-workbench__task-time"},Fe={key:0},qe={key:1},Ue={key:7,class:"aheart-ai-workbench__task-error"},He={class:"aheart-ai-workbench__task-actions"},Pe={key:8,class:"aheart-ai-workbench__operation-status",role:"status"},Oe=["data-approval-id"],We={key:0},Ze={key:1,class:"aheart-ai-workbench__approval-result"},Ge={key:0,class:"aheart-ai-workbench__empty"},Je=["aria-labelledby"],Qe={class:"aheart-ai-workbench__section-heading"},Xe=["id"],Ye={key:0,class:"aheart-ai-workbench__artifact-list"},et=["data-artifact-id"],tt=["aria-pressed","onClick"],at={key:0},ot={key:1,class:"aheart-ai-workbench__empty"},lt={key:2,class:"aheart-ai-workbench__artifact-preview","aria-label":"产物预览"},rt={class:"aheart-ai-workbench__artifact-preview-header"},nt=["href"],st={key:0},ct=e.defineComponent({name:"AIAgentWorkbenchExecution",__name:"agent-execution",props:{tasks:{default:()=>[]},artifacts:{default:()=>[]},activeArtifact:{default:void 0},disabled:{type:Boolean,default:!1},reorderable:{type:Boolean,default:!0},tasksRevision:{},scopeKey:{default:"default"},actionDisabled:{type:Function,default:()=>!1},operationMessages:{default:()=>({})},validateCandidate:{type:Function,default:()=>{}}},emits:["update:tasks","approve","reject","cancel","retry","move-task","move-task-reject","select-artifact"],setup(i,{emit:Q}){const r=i,C=e.computed(()=>`aheart-agent-execution-${String(r.scopeKey??"default").replace(/[^a-zA-Z0-9_-]/g,"-")}`),w=e.computed(()=>`${C.value}-tasks`),S=e.computed(()=>`${C.value}-artifacts`),d=Q,X={pending:"等待执行",running:"执行中","waiting-approval":"等待审批",complete:"已完成",error:"执行失败",cancelled:"已取消"},Y=e.computed(()=>r.tasks.map((o,l)=>({...o,__sortableKey:`${o.id}::${l}`}))),n=e.computed(()=>r.artifacts.find(o=>o.id===r.activeArtifact)??r.artifacts[0]),s=e.computed(()=>r.tasks.find(o=>o.approval&&(!o.approval.status||o.approval.status==="pending"))??r.tasks.find(o=>o.approval)),_=e.computed(()=>r.artifacts.find(o=>{var l,c;return o.id===((c=(l=s.value)==null?void 0:l.approval)==null?void 0:c.artifactId)})??n.value),ee=e.computed(()=>{var o;return(o=s.value)!=null&&o.approval&&(!s.value.approval.status||s.value.approval.status==="pending")?"等待审批":s.value?"审批结果":"当前产物"}),a=o=>o,p=o=>o.toolCall,N=o=>{var l;return`${o.id}:${String(o.revision??"")}:${((l=o.approval)==null?void 0:l.id)??""}`},te=o=>{d("move-task-reject",{"stale-revision":"任务版本已变化,排序已拒绝","source-missing":"源任务已不存在,排序已拒绝","target-missing":"目标位置已不存在,排序已拒绝","duplicate-key":"任务标识重复,无法排序","group-mismatch":"任务不属于当前排序分组",disabled:"任务当前不可排序,排序已拒绝","invalid-position":"目标位置无效,排序已拒绝","parent-rejected":"任务版本已变化,排序已拒绝","rollback-rejected":"排序回滚失败,请刷新后重试",unmounted:"排序目标已卸载",cancelled:"排序已取消"}[o.reason??""]??"任务当前不可排序,排序已拒绝")},ae=o=>X[o],oe=o=>o.status,le=o=>ae(o.status),V=o=>Math.min(100,Math.max(0,Math.round(o??0))),re=o=>{var l;if(!r.disabled&&r.reorderable){const c=o.map(({__sortableKey:b,...h})=>h),k=(l=r.validateCandidate)==null?void 0:l.call(r,c);if(k){d("move-task-reject",k);return}d("update:tasks",c)}},D=(o,l)=>{var h;if(E(r.tasks[o],o,l))return;const c=[...r.tasks],[k]=c.splice(o,1);c.splice(o+l,0,k);const b=(h=r.validateCandidate)==null?void 0:h.call(r,c);if(b){d("move-task-reject",b);return}d("update:tasks",c),d("move-task",k.id,l<0?"up":"down")},y=(o,l)=>{var c;return r.disabled||!!((c=r.actionDisabled)!=null&&c.call(r,o,l))},E=(o,l,c)=>!!(r.disabled||!r.reorderable||l+c<0||l+c>=r.tasks.length||(o==null?void 0:o.reorderable)===!1||o!=null&&o.lockedReason||(o==null?void 0:o.status)==="running"||(o==null?void 0:o.status)==="waiting-approval");return(o,l)=>{var c,k,b,h,$,x;return e.openBlock(),e.createElementBlock("div",se,[s.value||n.value?(e.openBlock(),e.createElementBlock("section",ce,[e.createElementVNode("div",ie,[e.createElementVNode("span",de,e.toDisplayString(ee.value),1),s.value?(e.openBlock(),e.createElementBlock("strong",pe,e.toDisplayString((c=s.value.approval)==null?void 0:c.title),1)):(e.openBlock(),e.createElementBlock("strong",ue,"查看当前产物"))]),s.value?(e.openBlock(),e.createElementBlock("div",ke,[(k=s.value.approval)!=null&&k.description?(e.openBlock(),e.createElementBlock("p",me,e.toDisplayString(s.value.approval.description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ve,[!((b=s.value.approval)!=null&&b.status)||s.value.approval.status==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(s.value,"approve"),onClick:l[0]||(l[0]=t=>d("approve",s.value))},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(s.value,"reject"),onClick:l[1]||(l[1]=t=>d("reject",s.value))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled"])],64)):(e.openBlock(),e.createElementBlock("span",_e,e.toDisplayString(s.value.approval.status==="approved"?"已批准":"已拒绝"),1))])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"approval","aria-label":_.value.title,onClick:l[2]||(l[2]=t=>d("select-artifact",_.value))},[e.createElementVNode("span",null,e.toDisplayString(($=(h=s.value)==null?void 0:h.approval)!=null&&$.artifactId?"审批对象":"当前产物"),1),e.createElementVNode("strong",null,e.toDisplayString(_.value.title),1),_.value.description?(e.openBlock(),e.createElementBlock("small",he,e.toDisplayString(_.value.description),1)):e.createCommentVNode("",!0)],8,ye)):e.createCommentVNode("",!0),n.value&&n.value.id!==((x=_.value)==null?void 0:x.id)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"aheart-ai-workbench__priority-artifact","data-artifact-role":"current","aria-label":n.value.title,onClick:l[3]||(l[3]=t=>d("select-artifact",n.value))},[l[6]||(l[6]=e.createElementVNode("span",null,"当前产物",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value.title),1),n.value.description?(e.openBlock(),e.createElementBlock("small",ge,e.toDisplayString(n.value.description),1)):e.createCommentVNode("",!0)],8,be)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:"aheart-ai-workbench__tasks","aria-labelledby":w.value},[e.createElementVNode("div",Ne,[e.createElementVNode("div",null,[l[7]||(l[7]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"执行流程",-1)),e.createElementVNode("h2",{id:w.value},"执行时间线",8,Ve)]),e.createElementVNode("span",null,e.toDisplayString(i.tasks.length)+" 项",1)]),e.createElementVNode("div",Ee,[e.createVNode(e.unref(ne.SortableList),{items:Y.value,"item-key":"__sortableKey",disabled:i.disabled||!i.reorderable,revision:i.tasksRevision,group:`agent-tasks-${i.scopeKey}`,"onUpdate:items":re,onMoveReject:te},{item:e.withCtx(({item:t,index:m})=>[e.renderSlot(o.$slots,"task",{task:a(t),index:m},()=>{var g,f,j,A,T,M,I,z,K,R,L,F,q,U,H,P,O,W,Z,G;return[e.createElementVNode("article",{"data-task-id":a(t).id,class:e.normalizeClass(["aheart-ai-workbench__timeline-item",[`is-${oe(a(t))}`,{"has-approval-summary":!!a(t).approval}]])},[l[15]||(l[15]=e.createElementVNode("span",{class:"aheart-ai-workbench__timeline-marker","aria-hidden":"true"},null,-1)),e.createElementVNode("div",Ce,[e.createElementVNode("header",we,[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString(a(t).label),1),a(t).toolName?(e.openBlock(),e.createElementBlock("span",Se,e.toDisplayString(a(t).toolName),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",De,e.toDisplayString(le(a(t))),1)]),a(t).detail&&!p(a(t))?(e.openBlock(),e.createElementBlock("p",$e,e.toDisplayString(a(t).detail),1)):e.createCommentVNode("",!0),p(a(t))?(e.openBlock(),e.createElementBlock("section",xe,[e.createElementVNode("strong",null,e.toDisplayString((g=p(a(t)))==null?void 0:g.name),1),e.createElementVNode("span",null,e.toDisplayString((f=p(a(t)))==null?void 0:f.summary),1),(j=p(a(t)))!=null&&j.inputSummary?(e.openBlock(),e.createElementBlock("small",je,e.toDisplayString((A=p(a(t)))==null?void 0:A.inputSummary),1)):e.createCommentVNode("",!0),(T=p(a(t)))!=null&&T.resultSummary?(e.openBlock(),e.createElementBlock("small",Ae,e.toDisplayString((M=p(a(t)))==null?void 0:M.resultSummary),1)):e.createCommentVNode("",!0),(I=p(a(t)))!=null&&I.error?(e.openBlock(),e.createElementBlock("small",Te,e.toDisplayString((z=p(a(t)))==null?void 0:z.error),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).lockedReason||((K=i.operationMessages)==null?void 0:K[N(a(t))])===""?(e.openBlock(),e.createElementBlock("p",Me,e.toDisplayString(a(t).lockedReason),1)):e.createCommentVNode("",!0),a(t).revision===void 0&&y(a(t),"approve")?(e.openBlock(),e.createElementBlock("p",Ie,"缺少任务版本")):e.createCommentVNode("",!0),(R=a(t).approval)!=null&&R.artifactId&&(!i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)})||i.artifacts.some(u=>{var B;return u.id===((B=a(t).approval)==null?void 0:B.artifactId)&&u.revision===void 0}))?(e.openBlock(),e.createElementBlock("p",ze,"缺少产物版本")):e.createCommentVNode("",!0),a(t).progress!==void 0?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{role:"progressbar","aria-label":"任务进度","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":V(a(t).progress)},[e.createElementVNode("span",{style:e.normalizeStyle({inlineSize:`${V(a(t).progress)}%`})},null,4)],8,Re),e.createElementVNode("small",null,e.toDisplayString(V(a(t).progress))+"%",1)])):e.createCommentVNode("",!0),a(t).startedAt||a(t).completedAt?(e.openBlock(),e.createElementBlock("div",Le,[a(t).startedAt?(e.openBlock(),e.createElementBlock("span",Fe,"开始 "+e.toDisplayString(a(t).startedAt),1)):e.createCommentVNode("",!0),a(t).completedAt?(e.openBlock(),e.createElementBlock("span",qe,"完成 "+e.toDisplayString(a(t).completedAt),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a(t).error?(e.openBlock(),e.createElementBlock("details",Ue,[l[8]||(l[8]=e.createElementVNode("summary",null,"查看错误详情",-1)),e.createElementVNode("p",null,e.toDisplayString(a(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[a(t).status==="running"?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:0,"data-action":"cancel",type:"text",disabled:y(a(t),"cancel"),onClick:u=>d("cancel",a(t))},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),a(t).status==="error"||(L=i.operationMessages)!=null&&L[N(a(t))]?(e.openBlock(),e.createBlock(e.unref(v.Button),{key:1,"data-action":"retry",type:"text",disabled:y(a(t),"retry"),onClick:u=>d("retry",a(t))},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("重试",-1)])]),_:1},8,["disabled","onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(v.Button),{"data-action":"move-up",type:"text",disabled:E(a(t),m,-1),onClick:u=>D(m,-1)},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"move-down",type:"text",disabled:E(a(t),m,1),onClick:u=>D(m,1)},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])]),(F=i.operationMessages)!=null&&F[N(a(t))]?(e.openBlock(),e.createElementBlock("p",Pe,e.toDisplayString(i.operationMessages[N(a(t))]),1)):e.createCommentVNode("",!0),a(t).approval?(e.openBlock(),e.createElementBlock("div",{key:9,"data-approval-id":(q=a(t).approval)==null?void 0:q.id,class:e.normalizeClass(["aheart-ai-workbench__approval",`is-${((U=a(t).approval)==null?void 0:U.status)??"pending"}`])},[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString((H=a(t).approval)==null?void 0:H.title),1),(P=a(t).approval)!=null&&P.description?(e.openBlock(),e.createElementBlock("p",We,e.toDisplayString((O=a(t).approval)==null?void 0:O.description),1)):e.createCommentVNode("",!0)]),!((W=a(t).approval)!=null&&W.status)||((Z=a(t).approval)==null?void 0:Z.status)==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(v.Button),{"data-action":"approve",type:"primary",disabled:y(a(t),"approve"),onClick:u=>d("approve",a(t))},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("批准",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(v.Button),{"data-action":"reject",danger:"",disabled:y(a(t),"reject"),onClick:u=>d("reject",a(t))},{default:e.withCtx(()=>[...l[14]||(l[14]=[e.createTextVNode("拒绝",-1)])]),_:1},8,["disabled","onClick"])],64)):(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(((G=a(t).approval)==null?void 0:G.status)==="approved"?"已批准":"已拒绝"),1))],10,Oe)):e.createCommentVNode("",!0)])],10,fe)]})]),_:3},8,["items","disabled","revision","group"])]),i.tasks.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Ge,"尚无执行任务。"))],8,Be),e.createElementVNode("section",{class:"aheart-ai-workbench__artifacts","aria-labelledby":S.value},[e.createElementVNode("div",Qe,[e.createElementVNode("div",null,[l[16]||(l[16]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"产物输出",-1)),e.createElementVNode("h2",{id:S.value},"产物",8,Xe)]),e.createElementVNode("span",null,e.toDisplayString(i.artifacts.length)+" 项",1)]),i.artifacts.length?(e.openBlock(),e.createElementBlock("ul",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.artifacts,t=>{var m,g;return e.openBlock(),e.createElementBlock("li",{key:t.id,"data-artifact-id":t.id,class:e.normalizeClass({"is-active":t.id===((m=n.value)==null?void 0:m.id)})},[e.createElementVNode("button",{type:"button","aria-pressed":t.id===((g=n.value)==null?void 0:g.id),onClick:f=>d("select-artifact",t)},[e.renderSlot(o.$slots,"artifact",{artifact:t},()=>[e.createElementVNode("span",null,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("small",at,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)])],8,tt)],10,et)}),128))])):(e.openBlock(),e.createElementBlock("p",ot,"任务完成后,产物会出现在这里。")),n.value?(e.openBlock(),e.createElementBlock("section",lt,[e.renderSlot(o.$slots,"artifact-preview",{artifact:n.value},()=>[e.createElementVNode("div",rt,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(n.value.type??"文件"),1),e.createElementVNode("h3",null,e.toDisplayString(n.value.title),1)]),e.unref(J.getSafeUrl)(n.value.url)?(e.openBlock(),e.createElementBlock("a",{key:0,href:e.unref(J.getSafeUrl)(n.value.url),target:"_blank",rel:"noreferrer"},"打开产物",8,nt)):e.createCommentVNode("",!0)]),e.createElementVNode("p",null,e.toDisplayString(n.value.description??"业务层可通过 artifact-preview 插槽提供自定义预览。"),1),n.value.updatedAt?(e.openBlock(),e.createElementBlock("small",st,"更新于 "+e.toDisplayString(n.value.updatedAt),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],8,Je)])}}});exports.default=ct;
@@ -0,0 +1,2 @@
1
+ export { default as AIAgentWorkbench, default } from '../agent-workbench.vue';
2
+ export type * from '../types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../agent-workbench.vue.js");exports.AIAgentWorkbench=e.default;exports.default=e.default;