@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.
- package/README.md +10 -1
- package/es/actions/index.d.ts +2 -0
- package/es/actions/index.js +5 -0
- package/es/actions/style.css +36 -0
- package/es/actions.vue.d.ts +4 -4
- package/es/agent/index.d.ts +5 -0
- package/es/agent/index.js +12 -0
- package/es/agent/style.css +3241 -0
- package/es/agent-execution.vue.d.ts +4 -4
- package/es/agent-execution.vue.js +2 -2
- package/es/agent-workbench/index.d.ts +2 -0
- package/es/agent-workbench/index.js +5 -0
- package/es/agent-workbench/style.css +2423 -0
- package/es/agent-workbench.vue.d.ts +4 -4
- package/es/agent-workbench.vue.js +10 -7
- package/es/attachments/index.d.ts +2 -0
- package/es/attachments/index.js +5 -0
- package/es/attachments/style.css +62 -0
- package/es/attachments.vue.d.ts +4 -4
- package/es/bubble/index.d.ts +2 -0
- package/es/bubble/index.js +5 -0
- package/es/bubble/style.css +241 -0
- package/es/bubble.vue.d.ts +3 -3
- package/es/chat/index.d.ts +11 -0
- package/es/chat/index.js +23 -0
- package/es/chat/style.css +595 -0
- package/es/chat-panel/index.d.ts +3 -0
- package/es/chat-panel/index.js +8 -0
- package/es/chat-panel/style.css +591 -0
- package/es/chat-panel.vue.d.ts +4 -4
- package/es/conversations/index.d.ts +2 -0
- package/es/conversations/index.js +5 -0
- package/es/conversations/style.css +48 -0
- package/es/conversations.vue.d.ts +4 -4
- package/es/form/index.d.ts +3 -0
- package/es/form/index.js +9 -0
- package/es/form/style.css +3175 -0
- package/es/form-field.vue.d.ts +4 -4
- package/es/form-field.vue.js +53 -43
- package/es/form.vue.d.ts +4 -4
- package/es/form.vue.js +7 -6
- package/es/process/index.d.ts +2 -0
- package/es/process/index.js +5 -0
- package/es/process/style.css +77 -0
- package/es/process.vue.d.ts +3 -3
- package/es/prompts/index.d.ts +2 -0
- package/es/prompts/index.js +5 -0
- package/es/prompts/style.css +76 -0
- package/es/prompts.vue.d.ts +4 -4
- package/es/sender/index.d.ts +2 -0
- package/es/sender/index.js +5 -0
- package/es/sender/style.css +88 -0
- package/es/sender.vue.d.ts +4 -4
- package/es/sources/index.d.ts +2 -0
- package/es/sources/index.js +5 -0
- package/es/sources/style.css +54 -0
- package/es/sources.vue.d.ts +3 -3
- package/es/thought-chain/index.d.ts +2 -0
- package/es/thought-chain/index.js +5 -0
- package/es/thought-chain/style.css +77 -0
- package/es/thought-chain.vue.d.ts +3 -3
- package/es/welcome/index.d.ts +2 -0
- package/es/welcome/index.js +5 -0
- package/es/welcome/style.css +33 -0
- package/es/welcome.vue.d.ts +3 -3
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +1 -0
- package/lib/actions/style.css +36 -0
- package/lib/actions.vue.d.ts +4 -4
- package/lib/agent/index.d.ts +5 -0
- package/lib/agent/index.js +1 -0
- package/lib/agent/style.css +3241 -0
- package/lib/agent-execution.vue.d.ts +4 -4
- package/lib/agent-execution.vue.js +1 -1
- package/lib/agent-workbench/index.d.ts +2 -0
- package/lib/agent-workbench/index.js +1 -0
- package/lib/agent-workbench/style.css +2423 -0
- package/lib/agent-workbench.vue.d.ts +4 -4
- package/lib/agent-workbench.vue.js +1 -1
- package/lib/attachments/index.d.ts +2 -0
- package/lib/attachments/index.js +1 -0
- package/lib/attachments/style.css +62 -0
- package/lib/attachments.vue.d.ts +4 -4
- package/lib/bubble/index.d.ts +2 -0
- package/lib/bubble/index.js +1 -0
- package/lib/bubble/style.css +241 -0
- package/lib/bubble.vue.d.ts +3 -3
- package/lib/chat/index.d.ts +11 -0
- package/lib/chat/index.js +1 -0
- package/lib/chat/style.css +595 -0
- package/lib/chat-panel/index.d.ts +3 -0
- package/lib/chat-panel/index.js +1 -0
- package/lib/chat-panel/style.css +591 -0
- package/lib/chat-panel.vue.d.ts +4 -4
- package/lib/conversations/index.d.ts +2 -0
- package/lib/conversations/index.js +1 -0
- package/lib/conversations/style.css +48 -0
- package/lib/conversations.vue.d.ts +4 -4
- package/lib/form/index.d.ts +3 -0
- package/lib/form/index.js +1 -0
- package/lib/form/style.css +3175 -0
- package/lib/form-field.vue.d.ts +4 -4
- package/lib/form-field.vue.js +1 -1
- package/lib/form.vue.d.ts +4 -4
- package/lib/form.vue.js +1 -1
- package/lib/process/index.d.ts +2 -0
- package/lib/process/index.js +1 -0
- package/lib/process/style.css +77 -0
- package/lib/process.vue.d.ts +3 -3
- package/lib/prompts/index.d.ts +2 -0
- package/lib/prompts/index.js +1 -0
- package/lib/prompts/style.css +76 -0
- package/lib/prompts.vue.d.ts +4 -4
- package/lib/sender/index.d.ts +2 -0
- package/lib/sender/index.js +1 -0
- package/lib/sender/style.css +88 -0
- package/lib/sender.vue.d.ts +4 -4
- package/lib/sources/index.d.ts +2 -0
- package/lib/sources/index.js +1 -0
- package/lib/sources/style.css +54 -0
- package/lib/sources.vue.d.ts +3 -3
- package/lib/thought-chain/index.d.ts +2 -0
- package/lib/thought-chain/index.js +1 -0
- package/lib/thought-chain/style.css +77 -0
- package/lib/thought-chain.vue.d.ts +3 -3
- package/lib/welcome/index.d.ts +2 -0
- package/lib/welcome/index.js +1 -0
- package/lib/welcome/style.css +33 -0
- package/lib/welcome.vue.d.ts +3 -3
- package/package.json +106 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AIAgentActionHandler, AIAgentArtifact, AIAgentContextItem, AIAgentOperationRequest, AIAgentTask, AIAttachment, AIConversation, AIMessage, AIPrompt, AISource, AITransport, AITransportV2 } from './types';
|
|
2
2
|
type WorkbenchPanelSize = number | `${number}%` | 'auto';
|
|
3
|
-
declare const _default: __VLS_WithTemplateSlots<import("
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
title?: string | undefined;
|
|
5
5
|
description?: string | undefined;
|
|
6
6
|
panelSizes?: WorkbenchPanelSize[] | undefined;
|
|
@@ -39,7 +39,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
|
|
|
39
39
|
reorderable: boolean;
|
|
40
40
|
tasksRevision: undefined;
|
|
41
41
|
scopeKey: undefined;
|
|
42
|
-
}>>, {}, {}, {}, {}, import("
|
|
42
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
43
|
error: (message: string) => void;
|
|
44
44
|
retry: (task: AIAgentTask) => void;
|
|
45
45
|
approve: (task: AIAgentTask) => void;
|
|
@@ -62,7 +62,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
|
|
|
62
62
|
"operation-success": (request: AIAgentOperationRequest) => void;
|
|
63
63
|
"operation-error": (request: AIAgentOperationRequest, message: string) => void;
|
|
64
64
|
"task-move-reject": (reason: string) => void;
|
|
65
|
-
}, string, import("
|
|
65
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
66
66
|
title?: string | undefined;
|
|
67
67
|
description?: string | undefined;
|
|
68
68
|
panelSizes?: WorkbenchPanelSize[] | undefined;
|
|
@@ -143,7 +143,7 @@ declare const _default: __VLS_WithTemplateSlots<import("@vue/runtime-core").Defi
|
|
|
143
143
|
activeConversation: string;
|
|
144
144
|
panelSizes: WorkbenchPanelSize[];
|
|
145
145
|
contextItems: AIAgentContextItem[];
|
|
146
|
-
}, {}, {}, {}, string, import("
|
|
146
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
147
147
|
sources?(_: {
|
|
148
148
|
sources: AISource[];
|
|
149
149
|
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("aheart-ui"),ge=require("@aheart-ui/dnd"),re=require("./attachments.vue.js"),ye=require("./chat-panel.vue.js"),se=require("./conversations.vue.js"),ie=require("./sources.vue.js"),we=require("./agent-execution.vue.js"),Ce={class:"aheart-ai-workbench","aria-label":"AI 工作台"},Ve={class:"aheart-ai-workbench__header"},Ie={key:0},Ne={class:"aheart-ai-workbench__header-status"},xe={class:"aheart-ai-workbench__progress"},Se=["aria-label"],Ee={class:"aheart-ai-workbench__desktop"},$e={class:"aheart-ai-workbench__sidebar"},Be={key:0,class:"aheart-ai-workbench__context","aria-label":"上下文"},_e=["data-context-id"],Te={key:0},Ae={class:"aheart-ai-workbench__move-actions"},Me={class:"aheart-ai-workbench__chat"},De={key:1,class:"aheart-ai-workbench__empty"},Re={class:"aheart-ai-workbench__execution","aria-label":"执行与产物"},je={key:0,class:"aheart-ai-workbench__task-order-error",role:"alert"},Oe={class:"aheart-ai-workbench__mobile"},ze={class:"aheart-ai-workbench__mobile-panel"},Ue={key:0,class:"aheart-ai-workbench__context","aria-label":"上下文"},Pe={class:"aheart-ai-workbench__context-list-mobile"},Ke=["data-context-id"],qe={key:0},He={class:"aheart-ai-workbench__move-actions"},Le={class:"aheart-ai-workbench__mobile-panel"},Fe={class:"aheart-ai-workbench__mobile-panel--chat"},Je=["id"],Ze={key:0,class:"aheart-ai-workbench__empty"},We={class:"aheart-ai-workbench__mobile-panel"},Ge=e.defineComponent({name:"AAIAgentWorkbench",__name:"agent-workbench",props:{title:{default:"AI 工作台"},description:{default:"编排对话、任务、审批与产物。"},panelSizes:{default:()=>[150,"auto",200]},conversations:{default:()=>[]},activeConversation:{default:void 0},messages:{default:()=>[]},prompts:{default:()=>[]},transport:{default:void 0},tasks:{default:()=>[]},contextItems:{default:()=>[]},sources:{default:()=>[]},attachments:{default:()=>[]},artifacts:{default:()=>[]},activeArtifact:{default:void 0},disabled:{type:Boolean,default:!1},actionHandler:{},reorderable:{type:Boolean,default:!0},tasksRevision:{default:void 0},scopeKey:{default:void 0}},emits:["update:panelSizes","update:activeConversation","update:messages","update:activeArtifact","update:tasks","update:contextItems","approve","reject","cancel","retry","move-task","move-context","stop","chat-retry","chat-regenerate","chat-edit","chat-copy","error","operation-start","operation-success","operation-error","task-move-reject"],setup(c,{emit:le}){const r=c,v=le,V=e.ref("chat"),_=e.ref(!1),O=e.ref(),z=e.ref(),q=e.ref(!1),S=e.ref(!1),E=e.ref(!1);let g,M;const $=e.getCurrentInstance(),U=`scope-${e.useId().replace(/[^a-zA-Z0-9_-]/g,"-")}`,P=U.replace(/^scope-/,""),ce=`aheart-ai-${P}-chat-target`,H=`aheart-ai-${P}-execution-target`,K=e.computed(()=>r.scopeKey===void 0?U:`scope-${String(r.scopeKey).replace(/[^a-zA-Z0-9_-]/g,"-")}-${U.replace(/^scope-/,"")}`);e.onMounted(async()=>{var o,n,i;q.value=!0;const a=(n=(o=$==null?void 0:$.proxy)==null?void 0:o.$el)==null?void 0:n.ownerDocument,t=a==null?void 0:a.defaultView;t!=null&&t.matchMedia?(g=t.matchMedia("(max-width: 760px)"),E.value=g.matches,M=d=>{E.value=d.matches},(i=g.addEventListener)==null||i.call(g,"change",M)):E.value=!0,S.value=!0,await e.nextTick()}),e.onBeforeUnmount(()=>{var a;g&&M&&((a=g.removeEventListener)==null||a.call(g,"change",M))}),e.watch(E,a=>{a||(_.value=!1)});const m=e.ref({}),y=new Map,N=new Map;let L=0;const x=new Set,F=()=>Object.prototype.hasOwnProperty.call(($==null?void 0:$.vnode.props)??{},"messages"),J=e.ref(F());e.onBeforeUpdate(()=>{J.value=F()});const de=e.computed(()=>J.value?{messages:r.messages}:{defaultMessages:r.messages}),Z=e.computed(()=>r.tasks.filter(a=>a.approval&&(!a.approval.status||a.approval.status==="pending"))),I=e.computed(()=>Z.value.length),W=e.computed(()=>{const a=Z.value[0],t=r.artifacts.find(n=>{var i;return n.id===((i=a==null?void 0:a.approval)==null?void 0:i.artifactId)});return t?`${I.value>1?`${I.value} 项待审批`:"待审批"}:${t.title}`:`${I.value} 项待审批`}),ue=()=>{V.value="execution",_.value=!0},ve=e.computed(()=>[{key:D("conversations"),label:"会话"},{key:D("chat"),label:"对话"},{key:D("execution"),label:e.h("span",{class:"aheart-ai-workbench__mobile-tab-label"},[e.h("span","执行"),I.value>0?e.h("span",{class:"aheart-ai-workbench__pending-badge","aria-label":`${I.value} 项待审批`},String(I.value)):null])}]),D=a=>`${a}--${P}`,pe=e.computed(()=>Object.fromEntries(Object.entries(m.value).map(([a,t])=>[a,t.message??(t.status==="pending"?"处理中…":t.status==="success"?"成功":"")]))),B=a=>{var t;return`${a.id}:${String(a.revision??"")}:${((t=a.approval)==null?void 0:t.id)??""}`},G=(a,t)=>{const o=B(a),n=m.value[o];return x.has(o)||[...x].some(d=>d.startsWith(`${a.id}:`))||(n==null?void 0:n.status)==="pending"||(n==null?void 0:n.status)==="success"||r.disabled||r.actionHandler&&a.revision===void 0?!0:a.approval?(n==null?void 0:n.status)==="error"&&n.outcome!=="not-applied"&&t!=="retry"||r.actionHandler&&(a.revision===void 0||a.approval.artifactId&&(!r.artifacts.find(d=>{var s;return d.id===((s=a.approval)==null?void 0:s.artifactId)})||r.artifacts.some(d=>{var s;return d.id===((s=a.approval)==null?void 0:s.artifactId)&&d.revision===void 0})))?!0:a.status==="running"&&t!=="cancel":(n==null?void 0:n.status)==="error"?t!=="retry":!(a.status==="running"&&t==="cancel"||a.status==="error"&&t==="retry")},R=async(a,t)=>{var u,p,f,C,A,oe;if(G(t,a))return;if(!r.actionHandler){v(a==="approve"?"approve":a==="reject"?"reject":a==="cancel"?"cancel":"retry",t);return}const o=(u=t.approval)!=null&&u.artifactId?r.artifacts.find(b=>{var h;return b.id===((h=t.approval)==null?void 0:h.artifactId)}):void 0,n=B(t),i=m.value[n];(i==null?void 0:i.status)==="error"&&i.outcome==="not-applied"&&N.delete(n);const d=N.get(n)??`${n}:${Date.now()}:${++L}`;N.set(n,d);const s={operationId:`${d}:attempt-${++L}`,idempotencyKey:d,conversationId:r.activeConversation,taskId:t.id,taskRevision:t.revision,action:(i==null?void 0:i.status)==="error"&&i.outcome==="unknown"&&a==="retry"?i.action:a,...(p=t.approval)!=null&&p.id?{approvalId:t.approval.id}:{},artifactId:((f=t.approval)==null?void 0:f.artifactId)??(o==null?void 0:o.id),...(o==null?void 0:o.revision)===void 0?{}:{artifactRevision:o.revision}},l=new AbortController;x.add(n),y.set(n,l),m.value={...m.value,[n]:{status:"pending",operationId:s.operationId,idempotencyKey:d,action:s.action,taskRevision:t.revision,taskStatus:t.status,approvalStatus:(C=t.approval)==null?void 0:C.status,approvalId:(A=t.approval)==null?void 0:A.id,artifactId:(o==null?void 0:o.id)??((oe=t.approval)==null?void 0:oe.artifactId),artifactRevision:o==null?void 0:o.revision,conversationId:r.activeConversation}},v("operation-start",s);try{const b=await r.actionHandler(s,l.signal),h=m.value[n];if(l.signal.aborted||!h||h.operationId!==s.operationId||b.operationId!==s.operationId)return;b.status==="success"?(m.value={...m.value,[n]:{...h,status:"success",message:"成功"}},v("operation-success",s)):(m.value={...m.value,[n]:{...h,status:"error",message:b.error,outcome:b.outcome??"unknown"}},v("operation-error",s,b.error))}catch(b){if(l.signal.aborted)return;const h=m.value[n];if(!h||h.operationId!==s.operationId)return;const ne=b instanceof Error?b.message:"操作失败";m.value={...m.value,[n]:{...h,status:"error",message:ne,outcome:"unknown"}},v("operation-error",s,ne)}finally{x.delete(n),y.get(n)===l&&y.delete(n)}},X=a=>{const t=new Set(a.map(l=>l.id)),o=new Set(r.tasks.map(l=>l.id));if(t.size!==a.length||t.size!==o.size||[...t].some(l=>!o.has(l))||a.some(l=>{var u;return(u=l.dependsOn)==null?void 0:u.some(p=>!t.has(p))}))return"任务集合或依赖无效,无法排序";const n=new Map(a.map((l,u)=>[l.id,u]));if(a.some(l=>{var u;return(u=l.dependsOn)==null?void 0:u.some(p=>(n.get(p)??1/0)>=n.get(l.id))}))return"依赖任务必须排在前面";const i=new Set,d=new Set,s=l=>{var p;if(i.has(l))return!0;if(d.has(l))return!1;i.add(l);const u=a.find(f=>f.id===l);return(p=u==null?void 0:u.dependsOn)!=null&&p.some(s)?!0:(i.delete(l),d.add(l),!1)};if(a.some(l=>s(l.id)))return"任务依赖存在循环"},Y=e.computed(()=>X(r.tasks)),Q=a=>{var n;const t=X(a);if(t)return t;const o=new Map(r.tasks.map((i,d)=>[i.id,d]));for(const[i,d]of a.entries()){const s=r.tasks[o.get(d.id)??-1];if(!s)return"任务集合发生变化,无法排序";if(JSON.stringify(d)!==JSON.stringify(s))return"任务数据在排序期间发生变化";if((s.lockedReason||s.reorderable===!1||["running","waiting-approval"].includes(s.status))&&o.get(d.id)!==i)return s.lockedReason??"任务当前不可移动";if(((n=m.value[B(s)])==null?void 0:n.status)==="pending"&&o.get(d.id)!==i)return"任务操作进行中,无法移动"}},me=a=>{const t=a,o=Q(t);if(o){v("task-move-reject",o);return}v("update:tasks",t)},ee=e.computed(()=>r.contextItems),te=e.computed(()=>r.tasks.filter(a=>a.status==="complete").length),ae=e.computed(()=>r.tasks.some(a=>a.status==="error")?{key:"error",label:"需要处理"}:I.value>0?{key:"waiting",label:"等待人工审批"}:r.tasks.some(a=>a.status==="running")?{key:"running",label:"执行中"}:r.tasks.length&&te.value===r.tasks.length?{key:"complete",label:"已完成"}:{key:"idle",label:"待开始"}),w=a=>a,fe=(a,t,o)=>{const n=t+o;if(n<0||n>=a.length)return a;const i=[...a],[d]=i.splice(t,1);return i.splice(n,0,d),i},T=(a,t)=>{var n,i;const o=a+t;return!!(r.disabled||o<0||o>=r.contextItems.length||(n=r.contextItems[a])!=null&&n.disabled||(i=r.contextItems[o])!=null&&i.disabled)},j=(a,t)=>{if(T(a,t))return;const o=r.contextItems[a];!o||a+t<0||a+t>=r.contextItems.length||(v("update:contextItems",fe(r.contextItems,a,t)),v("move-context",o.id,t<0?"up":"down"))},he=a=>{if(r.disabled)return;const t=a;r.contextItems.some((n,i)=>{var d;return n.disabled&&((d=t[i])==null?void 0:d.id)!==n.id})||v("update:contextItems",t)},ke=(a,t)=>v("move-task",a,t),be=(a,t)=>v("chat-edit",a,t);return e.watch(()=>[r.tasks,r.artifacts,r.activeConversation,r.actionHandler],()=>{var a,t,o,n,i,d;for(const[s,l]of y){const u=r.tasks.find(C=>B(C)===s);if(!u){l.abort(),y.delete(s),x.delete(s),N.delete(s);continue}const p=m.value[s],f=(a=u.approval)!=null&&a.artifactId?r.artifacts.find(C=>{var A;return C.id===((A=u.approval)==null?void 0:A.artifactId)}):void 0;p&&(p.taskRevision!==u.revision||p.approvalId!==((t=u.approval)==null?void 0:t.id)||p.artifactId!==((f==null?void 0:f.id)??((o=u.approval)==null?void 0:o.artifactId))||p.artifactRevision!==(f==null?void 0:f.revision)||p.conversationId!==r.activeConversation)&&(l==null||l.abort(),l&&y.delete(s),x.delete(s),N.delete(s),delete m.value[s])}for(const s of Object.keys(m.value))r.tasks.some(l=>B(l)===s)||delete m.value[s];for(const[s,l]of Object.entries(m.value)){const u=r.tasks.find(f=>B(f)===s),p=(n=u==null?void 0:u.approval)!=null&&n.artifactId?r.artifacts.find(f=>{var C;return f.id===((C=u.approval)==null?void 0:C.artifactId)}):void 0;(!u||l.conversationId!==r.activeConversation||l.taskStatus!==u.status||l.approvalStatus!==((i=u.approval)==null?void 0:i.status)||l.artifactId!==((p==null?void 0:p.id)??((d=u.approval)==null?void 0:d.artifactId))||l.artifactRevision!==(p==null?void 0:p.revision))&&(N.delete(s),delete m.value[s])}},{deep:!0}),e.watch(()=>r.actionHandler,(a,t)=>{if(a!==t){for(const o of y.values())o.abort();y.clear(),x.clear(),m.value={},N.clear()}}),e.onBeforeUnmount(()=>{for(const a of y.values())a.abort()}),(a,t)=>(e.openBlock(),e.createElementBlock("section",Ce,[e.createElementVNode("header",Ve,[e.createElementVNode("div",null,[t[18]||(t[18]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"智能工作区",-1)),e.createElementVNode("h2",null,e.toDisplayString(c.title),1),c.description?(e.openBlock(),e.createElementBlock("p",Ie,e.toDisplayString(c.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",{"data-workbench-status":"",class:e.normalizeClass(`is-${ae.value.key}`)},e.toDisplayString(ae.value.label),3),e.createElementVNode("small",xe,e.toDisplayString(te.value)+" / "+e.toDisplayString(c.tasks.length)+" 已完成",1),I.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button","data-pending-approval-summary":"",class:"aheart-ai-workbench__pending-summary","aria-label":W.value,onClick:ue},e.toDisplayString(W.value),9,Se)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ee,[e.createVNode(e.unref(k.Splitter),{sizes:c.panelSizes,"default-sizes":[150,"auto",200],"onUpdate:sizes":t[13]||(t[13]=o=>v("update:panelSizes",o))},{default:e.withCtx(()=>[e.createVNode(e.unref(k.SplitterPanel),{min:140,collapsible:""},{default:e.withCtx(()=>[e.createElementVNode("aside",$e,[t[22]||(t[22]=e.createElementVNode("h2",null,"会话",-1)),e.createVNode(se.default,{"model-value":c.activeConversation,conversations:c.conversations,"onUpdate:modelValue":t[0]||(t[0]=o=>v("update:activeConversation",o))},null,8,["model-value","conversations"]),c.contextItems.length?(e.openBlock(),e.createElementBlock("section",Be,[t[21]||(t[21]=e.createElementVNode("h3",null,"上下文",-1)),e.createVNode(e.unref(ge.SortableList),{items:ee.value,"item-key":"id",group:`agent-context-${K.value}`,disabled:c.disabled,"onUpdate:items":he},{item:e.withCtx(({item:o,index:n})=>[e.createElementVNode("div",{class:"aheart-ai-workbench__context-item","data-context-id":w(o).id},[e.createElementVNode("span",null,e.toDisplayString(w(o).label),1),w(o).description?(e.openBlock(),e.createElementBlock("small",Te,e.toDisplayString(w(o).description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ae,[e.createVNode(e.unref(k.Button),{type:"text",disabled:T(n,-1),onClick:i=>j(n,-1)},{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(k.Button),{type:"text",disabled:T(n,1),onClick:i=>j(n,1)},{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])])],8,_e)]),_:1},8,["items","group","disabled"])])):e.createCommentVNode("",!0)])]),_:1}),e.createVNode(e.unref(k.SplitterPanel),{min:230},{default:e.withCtx(()=>[e.createElementVNode("main",Me,[c.transport?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:S.value?O.value:`#${ce}`,disabled:!S.value||!E.value||V.value!=="chat"||!O.value&&S.value},[c.transport?(e.openBlock(),e.createBlock(ye.default,e.mergeProps({key:"chat-owner"},de.value,{transport:c.transport,"conversation-id":c.activeConversation,prompts:c.prompts,disabled:c.disabled,"onUpdate:messages":t[1]||(t[1]=o=>v("update:messages",o)),onError:t[2]||(t[2]=o=>v("error",o)),onStop:t[3]||(t[3]=o=>v("stop")),onRetry:t[4]||(t[4]=o=>v("chat-retry",o)),onRegenerate:t[5]||(t[5]=o=>v("chat-regenerate",o)),onEdit:be,onCopy:t[6]||(t[6]=o=>v("chat-copy",o))}),null,16,["transport","conversation-id","prompts","disabled"])):e.createCommentVNode("",!0)],8,["to","disabled"])):e.createCommentVNode("",!0),c.transport?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",De,"业务层尚未提供对话传输适配器。")),e.renderSlot(a.$slots,"sources",{sources:c.sources},()=>[e.createVNode(ie.default,{sources:c.sources},null,8,["sources"])]),e.renderSlot(a.$slots,"attachments",{attachments:c.attachments},()=>[e.createVNode(re.default,{items:c.attachments},null,8,["items"])])])]),_:3}),e.createVNode(e.unref(k.SplitterPanel),{min:180,collapsible:""},{default:e.withCtx(()=>[e.createElementVNode("aside",Re,[(e.openBlock(),e.createBlock(e.Teleport,{to:S.value?z.value:`#${H}`,disabled:!S.value||!E.value||V.value!=="execution"||!z.value},[e.createVNode(we.default,{key:"execution-owner",tasks:c.tasks,artifacts:c.artifacts,"active-artifact":c.activeArtifact,disabled:c.disabled,reorderable:c.reorderable,"tasks-revision":c.tasksRevision,"scope-key":K.value,"action-disabled":G,"operation-messages":pe.value,"validate-candidate":Q,"onUpdate:tasks":me,onApprove:t[7]||(t[7]=o=>R("approve",o)),onReject:t[8]||(t[8]=o=>R("reject",o)),onCancel:t[9]||(t[9]=o=>R("cancel",o)),onRetry:t[10]||(t[10]=o=>R("retry",o)),onMoveTask:ke,onMoveTaskReject:t[11]||(t[11]=o=>v("task-move-reject",o)),onSelectArtifact:t[12]||(t[12]=o=>v("update:activeArtifact",o.id))},e.createSlots({_:2},[a.$slots.task?{name:"task",fn:e.withCtx(({task:o,index:n})=>[e.renderSlot(a.$slots,"task",{task:o,index:n})]),key:"0"}:void 0,a.$slots.artifact?{name:"artifact",fn:e.withCtx(({artifact:o})=>[e.renderSlot(a.$slots,"artifact",{artifact:o})]),key:"1"}:void 0,a.$slots["artifact-preview"]?{name:"artifact-preview",fn:e.withCtx(({artifact:o})=>[e.renderSlot(a.$slots,"artifact-preview",{artifact:o})]),key:"2"}:void 0]),1032,["tasks","artifacts","active-artifact","disabled","reorderable","tasks-revision","scope-key","operation-messages"])],8,["to","disabled"])),Y.value?(e.openBlock(),e.createElementBlock("p",je,"无法排序:"+e.toDisplayString(Y.value),1)):e.createCommentVNode("",!0)])]),_:3})]),_:3},8,["sizes"])]),e.createElementVNode("div",Oe,[e.createVNode(e.unref(k.Tabs),{items:ve.value,"active-key":D(V.value),"onUpdate:activeKey":t[14]||(t[14]=o=>V.value=String(o).split("--")[0])},null,8,["items","active-key"]),e.withDirectives(e.createElementVNode("section",ze,[e.createVNode(se.default,{"model-value":c.activeConversation,conversations:c.conversations,"onUpdate:modelValue":t[15]||(t[15]=o=>v("update:activeConversation",o))},null,8,["model-value","conversations"]),c.contextItems.length?(e.openBlock(),e.createElementBlock("section",Ue,[t[25]||(t[25]=e.createElementVNode("h3",null,"上下文",-1)),e.createElementVNode("div",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:w(o).id,class:"aheart-ai-workbench__context-item","data-context-id":w(o).id},[e.createElementVNode("span",null,e.toDisplayString(w(o).label),1),w(o).description?(e.openBlock(),e.createElementBlock("small",qe,e.toDisplayString(w(o).description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",He,[e.createVNode(e.unref(k.Button),{type:"text",disabled:T(n,-1),onClick:i=>j(n,-1)},{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(k.Button),{type:"text",disabled:T(n,1),onClick:i=>j(n,1)},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])])],8,Ke))),128))])])):e.createCommentVNode("",!0)],512),[[e.vShow,V.value==="conversations"]]),e.withDirectives(e.createElementVNode("section",Le,[e.createElementVNode("div",Fe,[e.createElementVNode("div",{id:`${K.value}-chat-target`,ref_key:"mobileChatTarget",ref:O,class:"aheart-ai-workbench__mobile-owner-target"},null,8,Je)]),c.transport?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Ze,"业务层尚未提供对话传输适配器。")),e.renderSlot(a.$slots,"sources",{sources:c.sources},()=>[e.createVNode(ie.default,{sources:c.sources},null,8,["sources"])]),e.renderSlot(a.$slots,"attachments",{attachments:c.attachments},()=>[e.createVNode(re.default,{items:c.attachments},null,8,["items"])])],512),[[e.vShow,V.value==="chat"]]),e.withDirectives(e.createElementVNode("section",We,[e.createVNode(e.unref(k.Button),{"data-action":"open-execution-drawer",type:"primary",onClick:t[16]||(t[16]=o=>_.value=!0)},{default:e.withCtx(()=>[...t[26]||(t[26]=[e.createTextVNode("查看执行与产物",-1)])]),_:1})],512),[[e.vShow,V.value==="execution"]]),e.createVNode(e.unref(k.Drawer),{open:_.value,"onUpdate:open":t[17]||(t[17]=o=>_.value=o),title:"执行与产物","get-container":!1,"force-render":q.value,"destroy-on-close":!1,placement:"right"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:H,ref_key:"mobileExecutionTarget",ref:z,class:"aheart-ai-workbench__mobile-owner-target"},null,512)]),_:1},8,["open","force-render"])])]))}});exports.default=Ge;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=require("aheart-ui/button"),ye=require("aheart-ui/drawer"),O=require("aheart-ui/splitter"),we=require("aheart-ui/tabs"),Ce=require("@aheart-ui/dnd/sortable"),se=require("./attachments.vue.js"),Ve=require("./chat-panel.vue.js"),ie=require("./conversations.vue.js"),le=require("./sources.vue.js"),Ie=require("./agent-execution.vue.js"),Ne={class:"aheart-ai-workbench","aria-label":"AI 工作台"},xe={class:"aheart-ai-workbench__header"},Se={key:0},Ee={class:"aheart-ai-workbench__header-status"},$e={class:"aheart-ai-workbench__progress"},Be=["aria-label"],_e={class:"aheart-ai-workbench__desktop"},Te={class:"aheart-ai-workbench__sidebar"},Ae={key:0,class:"aheart-ai-workbench__context","aria-label":"上下文"},Me=["data-context-id"],De={key:0},Re={class:"aheart-ai-workbench__move-actions"},je={class:"aheart-ai-workbench__chat"},Oe={key:1,class:"aheart-ai-workbench__empty"},ze={class:"aheart-ai-workbench__execution","aria-label":"执行与产物"},qe={key:0,class:"aheart-ai-workbench__task-order-error",role:"alert"},Pe={class:"aheart-ai-workbench__mobile"},Ue={class:"aheart-ai-workbench__mobile-panel"},Ke={key:0,class:"aheart-ai-workbench__context","aria-label":"上下文"},He={class:"aheart-ai-workbench__context-list-mobile"},Le=["data-context-id"],Fe={key:0},Je={class:"aheart-ai-workbench__move-actions"},Ze={class:"aheart-ai-workbench__mobile-panel"},We={class:"aheart-ai-workbench__mobile-panel--chat"},Ge=["id"],Xe={key:0,class:"aheart-ai-workbench__empty"},Ye={class:"aheart-ai-workbench__mobile-panel"},Qe=e.defineComponent({name:"AAIAgentWorkbench",__name:"agent-workbench",props:{title:{default:"AI 工作台"},description:{default:"编排对话、任务、审批与产物。"},panelSizes:{default:()=>[150,"auto",200]},conversations:{default:()=>[]},activeConversation:{default:void 0},messages:{default:()=>[]},prompts:{default:()=>[]},transport:{default:void 0},tasks:{default:()=>[]},contextItems:{default:()=>[]},sources:{default:()=>[]},attachments:{default:()=>[]},artifacts:{default:()=>[]},activeArtifact:{default:void 0},disabled:{type:Boolean,default:!1},actionHandler:{},reorderable:{type:Boolean,default:!0},tasksRevision:{default:void 0},scopeKey:{default:void 0}},emits:["update:panelSizes","update:activeConversation","update:messages","update:activeArtifact","update:tasks","update:contextItems","approve","reject","cancel","retry","move-task","move-context","stop","chat-retry","chat-regenerate","chat-edit","chat-copy","error","operation-start","operation-success","operation-error","task-move-reject"],setup(c,{emit:ce}){const r=c,v=ce,C=e.ref("chat"),B=e.ref(!1),z=e.ref(),q=e.ref(),H=e.ref(!1),x=e.ref(!1),S=e.ref(!1);let h,M;const E=e.getCurrentInstance(),P=`scope-${e.useId().replace(/[^a-zA-Z0-9_-]/g,"-")}`,U=P.replace(/^scope-/,""),de=`aheart-ai-${U}-chat-target`,L=`aheart-ai-${U}-execution-target`,K=e.computed(()=>r.scopeKey===void 0?P:`scope-${String(r.scopeKey).replace(/[^a-zA-Z0-9_-]/g,"-")}-${P.replace(/^scope-/,"")}`);e.onMounted(async()=>{var o,n,i;H.value=!0;const a=(n=(o=E==null?void 0:E.proxy)==null?void 0:o.$el)==null?void 0:n.ownerDocument,t=a==null?void 0:a.defaultView;t!=null&&t.matchMedia?(h=t.matchMedia("(max-width: 760px)"),S.value=h.matches,M=d=>{S.value=d.matches},(i=h.addEventListener)==null||i.call(h,"change",M)):S.value=!0,x.value=!0,await e.nextTick()}),e.onBeforeUnmount(()=>{var a;h&&M&&((a=h.removeEventListener)==null||a.call(h,"change",M))}),e.watch(S,a=>{a||(B.value=!1)});const m=e.ref({}),g=new Map,I=new Map;let F=0;const N=new Set,J=()=>Object.prototype.hasOwnProperty.call((E==null?void 0:E.vnode.props)??{},"messages"),Z=e.ref(J());e.onBeforeUpdate(()=>{Z.value=J()});const ue=e.computed(()=>Z.value?{messages:r.messages}:{defaultMessages:r.messages}),W=e.computed(()=>r.tasks.filter(a=>a.approval&&(!a.approval.status||a.approval.status==="pending"))),V=e.computed(()=>W.value.length),G=e.computed(()=>{const a=W.value[0],t=r.artifacts.find(n=>{var i;return n.id===((i=a==null?void 0:a.approval)==null?void 0:i.artifactId)});return t?`${V.value>1?`${V.value} 项待审批`:"待审批"}:${t.title}`:`${V.value} 项待审批`}),ve=()=>{C.value="execution",B.value=!0},pe=e.computed(()=>[{key:D("conversations"),label:"会话"},{key:D("chat"),label:"对话"},{key:D("execution"),label:e.h("span",{class:"aheart-ai-workbench__mobile-tab-label"},[e.h("span","执行"),V.value>0?e.h("span",{class:"aheart-ai-workbench__pending-badge","aria-label":`${V.value} 项待审批`},String(V.value)):null])}]),D=a=>`${a}--${U}`,me=e.computed(()=>Object.fromEntries(Object.entries(m.value).map(([a,t])=>[a,t.message??(t.status==="pending"?"处理中…":t.status==="success"?"成功":"")]))),$=a=>{var t;return`${a.id}:${String(a.revision??"")}:${((t=a.approval)==null?void 0:t.id)??""}`},X=(a,t)=>{const o=$(a),n=m.value[o];return N.has(o)||[...N].some(d=>d.startsWith(`${a.id}:`))||(n==null?void 0:n.status)==="pending"||(n==null?void 0:n.status)==="success"||r.disabled||r.actionHandler&&a.revision===void 0?!0:a.approval?(n==null?void 0:n.status)==="error"&&n.outcome!=="not-applied"&&t!=="retry"||r.actionHandler&&(a.revision===void 0||a.approval.artifactId&&(!r.artifacts.find(d=>{var s;return d.id===((s=a.approval)==null?void 0:s.artifactId)})||r.artifacts.some(d=>{var s;return d.id===((s=a.approval)==null?void 0:s.artifactId)&&d.revision===void 0})))?!0:a.status==="running"&&t!=="cancel":(n==null?void 0:n.status)==="error"?t!=="retry":!(a.status==="running"&&t==="cancel"||a.status==="error"&&t==="retry")},R=async(a,t)=>{var u,p,f,w,T,ne;if(X(t,a))return;if(!r.actionHandler){v(a==="approve"?"approve":a==="reject"?"reject":a==="cancel"?"cancel":"retry",t);return}const o=(u=t.approval)!=null&&u.artifactId?r.artifacts.find(b=>{var k;return b.id===((k=t.approval)==null?void 0:k.artifactId)}):void 0,n=$(t),i=m.value[n];(i==null?void 0:i.status)==="error"&&i.outcome==="not-applied"&&I.delete(n);const d=I.get(n)??`${n}:${Date.now()}:${++F}`;I.set(n,d);const s={operationId:`${d}:attempt-${++F}`,idempotencyKey:d,conversationId:r.activeConversation,taskId:t.id,taskRevision:t.revision,action:(i==null?void 0:i.status)==="error"&&i.outcome==="unknown"&&a==="retry"?i.action:a,...(p=t.approval)!=null&&p.id?{approvalId:t.approval.id}:{},artifactId:((f=t.approval)==null?void 0:f.artifactId)??(o==null?void 0:o.id),...(o==null?void 0:o.revision)===void 0?{}:{artifactRevision:o.revision}},l=new AbortController;N.add(n),g.set(n,l),m.value={...m.value,[n]:{status:"pending",operationId:s.operationId,idempotencyKey:d,action:s.action,taskRevision:t.revision,taskStatus:t.status,approvalStatus:(w=t.approval)==null?void 0:w.status,approvalId:(T=t.approval)==null?void 0:T.id,artifactId:(o==null?void 0:o.id)??((ne=t.approval)==null?void 0:ne.artifactId),artifactRevision:o==null?void 0:o.revision,conversationId:r.activeConversation}},v("operation-start",s);try{const b=await r.actionHandler(s,l.signal),k=m.value[n];if(l.signal.aborted||!k||k.operationId!==s.operationId||b.operationId!==s.operationId)return;b.status==="success"?(m.value={...m.value,[n]:{...k,status:"success",message:"成功"}},v("operation-success",s)):(m.value={...m.value,[n]:{...k,status:"error",message:b.error,outcome:b.outcome??"unknown"}},v("operation-error",s,b.error))}catch(b){if(l.signal.aborted)return;const k=m.value[n];if(!k||k.operationId!==s.operationId)return;const re=b instanceof Error?b.message:"操作失败";m.value={...m.value,[n]:{...k,status:"error",message:re,outcome:"unknown"}},v("operation-error",s,re)}finally{N.delete(n),g.get(n)===l&&g.delete(n)}},Y=a=>{const t=new Set(a.map(l=>l.id)),o=new Set(r.tasks.map(l=>l.id));if(t.size!==a.length||t.size!==o.size||[...t].some(l=>!o.has(l))||a.some(l=>{var u;return(u=l.dependsOn)==null?void 0:u.some(p=>!t.has(p))}))return"任务集合或依赖无效,无法排序";const n=new Map(a.map((l,u)=>[l.id,u]));if(a.some(l=>{var u;return(u=l.dependsOn)==null?void 0:u.some(p=>(n.get(p)??1/0)>=n.get(l.id))}))return"依赖任务必须排在前面";const i=new Set,d=new Set,s=l=>{var p;if(i.has(l))return!0;if(d.has(l))return!1;i.add(l);const u=a.find(f=>f.id===l);return(p=u==null?void 0:u.dependsOn)!=null&&p.some(s)?!0:(i.delete(l),d.add(l),!1)};if(a.some(l=>s(l.id)))return"任务依赖存在循环"},Q=e.computed(()=>Y(r.tasks)),ee=a=>{var n;const t=Y(a);if(t)return t;const o=new Map(r.tasks.map((i,d)=>[i.id,d]));for(const[i,d]of a.entries()){const s=r.tasks[o.get(d.id)??-1];if(!s)return"任务集合发生变化,无法排序";if(JSON.stringify(d)!==JSON.stringify(s))return"任务数据在排序期间发生变化";if((s.lockedReason||s.reorderable===!1||["running","waiting-approval"].includes(s.status))&&o.get(d.id)!==i)return s.lockedReason??"任务当前不可移动";if(((n=m.value[$(s)])==null?void 0:n.status)==="pending"&&o.get(d.id)!==i)return"任务操作进行中,无法移动"}},fe=a=>{const t=a,o=ee(t);if(o){v("task-move-reject",o);return}v("update:tasks",t)},te=e.computed(()=>r.contextItems),ae=e.computed(()=>r.tasks.filter(a=>a.status==="complete").length),oe=e.computed(()=>r.tasks.some(a=>a.status==="error")?{key:"error",label:"需要处理"}:V.value>0?{key:"waiting",label:"等待人工审批"}:r.tasks.some(a=>a.status==="running")?{key:"running",label:"执行中"}:r.tasks.length&&ae.value===r.tasks.length?{key:"complete",label:"已完成"}:{key:"idle",label:"待开始"}),y=a=>a,ke=(a,t,o)=>{const n=t+o;if(n<0||n>=a.length)return a;const i=[...a],[d]=i.splice(t,1);return i.splice(n,0,d),i},_=(a,t)=>{var n,i;const o=a+t;return!!(r.disabled||o<0||o>=r.contextItems.length||(n=r.contextItems[a])!=null&&n.disabled||(i=r.contextItems[o])!=null&&i.disabled)},j=(a,t)=>{if(_(a,t))return;const o=r.contextItems[a];!o||a+t<0||a+t>=r.contextItems.length||(v("update:contextItems",ke(r.contextItems,a,t)),v("move-context",o.id,t<0?"up":"down"))},be=a=>{if(r.disabled)return;const t=a;r.contextItems.some((n,i)=>{var d;return n.disabled&&((d=t[i])==null?void 0:d.id)!==n.id})||v("update:contextItems",t)},he=(a,t)=>v("move-task",a,t),ge=(a,t)=>v("chat-edit",a,t);return e.watch(()=>[r.tasks,r.artifacts,r.activeConversation,r.actionHandler],()=>{var a,t,o,n,i,d;for(const[s,l]of g){const u=r.tasks.find(w=>$(w)===s);if(!u){l.abort(),g.delete(s),N.delete(s),I.delete(s);continue}const p=m.value[s],f=(a=u.approval)!=null&&a.artifactId?r.artifacts.find(w=>{var T;return w.id===((T=u.approval)==null?void 0:T.artifactId)}):void 0;p&&(p.taskRevision!==u.revision||p.approvalId!==((t=u.approval)==null?void 0:t.id)||p.artifactId!==((f==null?void 0:f.id)??((o=u.approval)==null?void 0:o.artifactId))||p.artifactRevision!==(f==null?void 0:f.revision)||p.conversationId!==r.activeConversation)&&(l==null||l.abort(),l&&g.delete(s),N.delete(s),I.delete(s),delete m.value[s])}for(const s of Object.keys(m.value))r.tasks.some(l=>$(l)===s)||delete m.value[s];for(const[s,l]of Object.entries(m.value)){const u=r.tasks.find(f=>$(f)===s),p=(n=u==null?void 0:u.approval)!=null&&n.artifactId?r.artifacts.find(f=>{var w;return f.id===((w=u.approval)==null?void 0:w.artifactId)}):void 0;(!u||l.conversationId!==r.activeConversation||l.taskStatus!==u.status||l.approvalStatus!==((i=u.approval)==null?void 0:i.status)||l.artifactId!==((p==null?void 0:p.id)??((d=u.approval)==null?void 0:d.artifactId))||l.artifactRevision!==(p==null?void 0:p.revision))&&(I.delete(s),delete m.value[s])}},{deep:!0}),e.watch(()=>r.actionHandler,(a,t)=>{if(a!==t){for(const o of g.values())o.abort();g.clear(),N.clear(),m.value={},I.clear()}}),e.onBeforeUnmount(()=>{for(const a of g.values())a.abort()}),(a,t)=>(e.openBlock(),e.createElementBlock("section",Ne,[e.createElementVNode("header",xe,[e.createElementVNode("div",null,[t[18]||(t[18]=e.createElementVNode("span",{class:"aheart-ai-workbench__eyebrow"},"智能工作区",-1)),e.createElementVNode("h2",null,e.toDisplayString(c.title),1),c.description?(e.openBlock(),e.createElementBlock("p",Se,e.toDisplayString(c.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ee,[e.createElementVNode("span",{"data-workbench-status":"",class:e.normalizeClass(`is-${oe.value.key}`)},e.toDisplayString(oe.value.label),3),e.createElementVNode("small",$e,e.toDisplayString(ae.value)+" / "+e.toDisplayString(c.tasks.length)+" 已完成",1),V.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button","data-pending-approval-summary":"",class:"aheart-ai-workbench__pending-summary","aria-label":G.value,onClick:ve},e.toDisplayString(G.value),9,Be)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",_e,[e.createVNode(e.unref(O.Splitter),{sizes:c.panelSizes,"default-sizes":[150,"auto",200],"onUpdate:sizes":t[13]||(t[13]=o=>v("update:panelSizes",o))},{default:e.withCtx(()=>[e.createVNode(e.unref(O.SplitterPanel),{min:140,collapsible:""},{default:e.withCtx(()=>[e.createElementVNode("aside",Te,[t[22]||(t[22]=e.createElementVNode("h2",null,"会话",-1)),e.createVNode(ie.default,{"model-value":c.activeConversation,conversations:c.conversations,"onUpdate:modelValue":t[0]||(t[0]=o=>v("update:activeConversation",o))},null,8,["model-value","conversations"]),c.contextItems.length?(e.openBlock(),e.createElementBlock("section",Ae,[t[21]||(t[21]=e.createElementVNode("h3",null,"上下文",-1)),e.createVNode(e.unref(Ce.SortableList),{items:te.value,"item-key":"id",group:`agent-context-${K.value}`,disabled:c.disabled,"onUpdate:items":be},{item:e.withCtx(({item:o,index:n})=>[e.createElementVNode("div",{class:"aheart-ai-workbench__context-item","data-context-id":y(o).id},[e.createElementVNode("span",null,e.toDisplayString(y(o).label),1),y(o).description?(e.openBlock(),e.createElementBlock("small",De,e.toDisplayString(y(o).description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Re,[e.createVNode(e.unref(A.Button),{type:"text",disabled:_(n,-1),onClick:i=>j(n,-1)},{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(A.Button),{type:"text",disabled:_(n,1),onClick:i=>j(n,1)},{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])])],8,Me)]),_:1},8,["items","group","disabled"])])):e.createCommentVNode("",!0)])]),_:1}),e.createVNode(e.unref(O.SplitterPanel),{min:230},{default:e.withCtx(()=>[e.createElementVNode("main",je,[c.transport?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:x.value?z.value:`#${de}`,disabled:!x.value||!S.value||C.value!=="chat"||!z.value&&x.value},[c.transport?(e.openBlock(),e.createBlock(Ve.default,e.mergeProps({key:"chat-owner"},ue.value,{transport:c.transport,"conversation-id":c.activeConversation,prompts:c.prompts,disabled:c.disabled,"onUpdate:messages":t[1]||(t[1]=o=>v("update:messages",o)),onError:t[2]||(t[2]=o=>v("error",o)),onStop:t[3]||(t[3]=o=>v("stop")),onRetry:t[4]||(t[4]=o=>v("chat-retry",o)),onRegenerate:t[5]||(t[5]=o=>v("chat-regenerate",o)),onEdit:ge,onCopy:t[6]||(t[6]=o=>v("chat-copy",o))}),null,16,["transport","conversation-id","prompts","disabled"])):e.createCommentVNode("",!0)],8,["to","disabled"])):e.createCommentVNode("",!0),c.transport?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Oe,"业务层尚未提供对话传输适配器。")),e.renderSlot(a.$slots,"sources",{sources:c.sources},()=>[e.createVNode(le.default,{sources:c.sources},null,8,["sources"])]),e.renderSlot(a.$slots,"attachments",{attachments:c.attachments},()=>[e.createVNode(se.default,{items:c.attachments},null,8,["items"])])])]),_:3}),e.createVNode(e.unref(O.SplitterPanel),{min:180,collapsible:""},{default:e.withCtx(()=>[e.createElementVNode("aside",ze,[(e.openBlock(),e.createBlock(e.Teleport,{to:x.value?q.value:`#${L}`,disabled:!x.value||!S.value||C.value!=="execution"||!q.value},[e.createVNode(Ie.default,{key:"execution-owner",tasks:c.tasks,artifacts:c.artifacts,"active-artifact":c.activeArtifact,disabled:c.disabled,reorderable:c.reorderable,"tasks-revision":c.tasksRevision,"scope-key":K.value,"action-disabled":X,"operation-messages":me.value,"validate-candidate":ee,"onUpdate:tasks":fe,onApprove:t[7]||(t[7]=o=>R("approve",o)),onReject:t[8]||(t[8]=o=>R("reject",o)),onCancel:t[9]||(t[9]=o=>R("cancel",o)),onRetry:t[10]||(t[10]=o=>R("retry",o)),onMoveTask:he,onMoveTaskReject:t[11]||(t[11]=o=>v("task-move-reject",o)),onSelectArtifact:t[12]||(t[12]=o=>v("update:activeArtifact",o.id))},e.createSlots({_:2},[a.$slots.task?{name:"task",fn:e.withCtx(({task:o,index:n})=>[e.renderSlot(a.$slots,"task",{task:o,index:n})]),key:"0"}:void 0,a.$slots.artifact?{name:"artifact",fn:e.withCtx(({artifact:o})=>[e.renderSlot(a.$slots,"artifact",{artifact:o})]),key:"1"}:void 0,a.$slots["artifact-preview"]?{name:"artifact-preview",fn:e.withCtx(({artifact:o})=>[e.renderSlot(a.$slots,"artifact-preview",{artifact:o})]),key:"2"}:void 0]),1032,["tasks","artifacts","active-artifact","disabled","reorderable","tasks-revision","scope-key","operation-messages"])],8,["to","disabled"])),Q.value?(e.openBlock(),e.createElementBlock("p",qe,"无法排序:"+e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0)])]),_:3})]),_:3},8,["sizes"])]),e.createElementVNode("div",Pe,[e.createVNode(e.unref(we.Tabs),{items:pe.value,"active-key":D(C.value),"onUpdate:activeKey":t[14]||(t[14]=o=>C.value=String(o).split("--")[0])},null,8,["items","active-key"]),e.withDirectives(e.createElementVNode("section",Ue,[e.createVNode(ie.default,{"model-value":c.activeConversation,conversations:c.conversations,"onUpdate:modelValue":t[15]||(t[15]=o=>v("update:activeConversation",o))},null,8,["model-value","conversations"]),c.contextItems.length?(e.openBlock(),e.createElementBlock("section",Ke,[t[25]||(t[25]=e.createElementVNode("h3",null,"上下文",-1)),e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(o,n)=>(e.openBlock(),e.createElementBlock("div",{key:y(o).id,class:"aheart-ai-workbench__context-item","data-context-id":y(o).id},[e.createElementVNode("span",null,e.toDisplayString(y(o).label),1),y(o).description?(e.openBlock(),e.createElementBlock("small",Fe,e.toDisplayString(y(o).description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Je,[e.createVNode(e.unref(A.Button),{type:"text",disabled:_(n,-1),onClick:i=>j(n,-1)},{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createTextVNode("上移",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(e.unref(A.Button),{type:"text",disabled:_(n,1),onClick:i=>j(n,1)},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createTextVNode("下移",-1)])]),_:1},8,["disabled","onClick"])])],8,Le))),128))])])):e.createCommentVNode("",!0)],512),[[e.vShow,C.value==="conversations"]]),e.withDirectives(e.createElementVNode("section",Ze,[e.createElementVNode("div",We,[e.createElementVNode("div",{id:`${K.value}-chat-target`,ref_key:"mobileChatTarget",ref:z,class:"aheart-ai-workbench__mobile-owner-target"},null,8,Ge)]),c.transport?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Xe,"业务层尚未提供对话传输适配器。")),e.renderSlot(a.$slots,"sources",{sources:c.sources},()=>[e.createVNode(le.default,{sources:c.sources},null,8,["sources"])]),e.renderSlot(a.$slots,"attachments",{attachments:c.attachments},()=>[e.createVNode(se.default,{items:c.attachments},null,8,["items"])])],512),[[e.vShow,C.value==="chat"]]),e.withDirectives(e.createElementVNode("section",Ye,[e.createVNode(e.unref(A.Button),{"data-action":"open-execution-drawer",type:"primary",onClick:t[16]||(t[16]=o=>B.value=!0)},{default:e.withCtx(()=>[...t[26]||(t[26]=[e.createTextVNode("查看执行与产物",-1)])]),_:1})],512),[[e.vShow,C.value==="execution"]]),e.createVNode(e.unref(ye.Drawer),{open:B.value,"onUpdate:open":t[17]||(t[17]=o=>B.value=o),title:"执行与产物","get-container":!1,"force-render":H.value,"destroy-on-close":!1,placement:"right"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:L,ref_key:"mobileExecutionTarget",ref:q,class:"aheart-ai-workbench__mobile-owner-target"},null,512)]),_:1},8,["open","force-render"])])]))}});exports.default=Qe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../attachments.vue.js");exports.AIAttachments=e.default;exports.default=e.default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--aheart-ai-cyan: #0e7490;
|
|
3
|
+
--aheart-ai-cyan-strong: #0e7490;
|
|
4
|
+
--aheart-ai-brand-strong: #0958d9;
|
|
5
|
+
--aheart-ai-cyan-soft: #ecfeff;
|
|
6
|
+
--aheart-ai-line: #e4e7ec;
|
|
7
|
+
--aheart-ai-surface: #ffffff;
|
|
8
|
+
--aheart-ai-surface-subtle: #f8fafc;
|
|
9
|
+
--aheart-ai-text: #182230;
|
|
10
|
+
--aheart-ai-text-secondary: #667085;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.aheart-ai-attachments button {
|
|
14
|
+
min-block-size: 28px;
|
|
15
|
+
padding: 3px 8px;
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
background: transparent;
|
|
19
|
+
color: var(--aheart-ai-text-secondary);
|
|
20
|
+
font: 12px/1.4 inherit;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
transition: border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.aheart-ai-attachments button:hover,
|
|
26
|
+
.aheart-ai-attachments button:focus-visible {
|
|
27
|
+
border-color: #b9c2cf;
|
|
28
|
+
background: var(--aheart-ai-surface-subtle);
|
|
29
|
+
color: var(--aheart-ai-text);
|
|
30
|
+
outline: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.aheart-ai-attachments {
|
|
34
|
+
display: grid;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.aheart-ai-attachments {
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
list-style: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.aheart-ai-attachments li {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
min-block-size: 34px;
|
|
50
|
+
padding: 6px 8px;
|
|
51
|
+
border: 1px solid var(--aheart-ai-line);
|
|
52
|
+
border-radius: 5px;
|
|
53
|
+
background: var(--aheart-ai-surface-subtle);
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (pointer: coarse) {
|
|
58
|
+
.aheart-ai-attachments button {
|
|
59
|
+
min-block-size: 44px;
|
|
60
|
+
min-inline-size: 44px;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/lib/attachments.vue.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { AIAttachment } from './types';
|
|
2
|
-
declare const _default: import("
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
items?: AIAttachment[] | undefined;
|
|
4
4
|
removable?: boolean | undefined;
|
|
5
5
|
}>, {
|
|
6
6
|
items: () => never[];
|
|
7
7
|
removable: boolean;
|
|
8
|
-
}>>, {}, {}, {}, {}, import("
|
|
8
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
remove: (item: AIAttachment) => void;
|
|
10
|
-
}, string, import("
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
11
|
items?: AIAttachment[] | undefined;
|
|
12
12
|
removable?: boolean | undefined;
|
|
13
13
|
}>, {
|
|
@@ -18,7 +18,7 @@ declare const _default: import("@vue/runtime-core").DefineComponent<import("@vue
|
|
|
18
18
|
}>, {
|
|
19
19
|
items: AIAttachment[];
|
|
20
20
|
removable: boolean;
|
|
21
|
-
}, {}, {}, {}, string, import("
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
22
|
export default _default;
|
|
23
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
24
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../bubble.vue.js");exports.AIBubble=e.default;exports.default=e.default;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--aheart-ai-cyan: #0e7490;
|
|
3
|
+
--aheart-ai-cyan-strong: #0e7490;
|
|
4
|
+
--aheart-ai-brand-strong: #0958d9;
|
|
5
|
+
--aheart-ai-cyan-soft: #ecfeff;
|
|
6
|
+
--aheart-ai-line: #e4e7ec;
|
|
7
|
+
--aheart-ai-surface: #ffffff;
|
|
8
|
+
--aheart-ai-surface-subtle: #f8fafc;
|
|
9
|
+
--aheart-ai-text: #182230;
|
|
10
|
+
--aheart-ai-text-secondary: #667085;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.aheart-ai-sources h3,
|
|
14
|
+
.aheart-ai-sources p,
|
|
15
|
+
.aheart-ai-process h3 {
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.aheart-ai-process small {
|
|
20
|
+
display: block;
|
|
21
|
+
color: var(--aheart-ai-text-secondary);
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.aheart-ai-bubble {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
max-inline-size: min(760px, 92%);
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 12px 14px;
|
|
32
|
+
border: 1px solid var(--aheart-ai-line);
|
|
33
|
+
border-radius: 7px;
|
|
34
|
+
background: #fff;
|
|
35
|
+
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.aheart-ai-bubble.is-user {
|
|
39
|
+
align-self: end;
|
|
40
|
+
border-color: #91caff;
|
|
41
|
+
background: #f0f7ff;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.aheart-ai-bubble.is-assistant {
|
|
45
|
+
align-self: start;
|
|
46
|
+
border-inline-start: 3px solid var(--aheart-ai-cyan);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.aheart-ai-bubble__header {
|
|
50
|
+
color: var(--aheart-ai-text-secondary);
|
|
51
|
+
font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
52
|
+
text-transform: uppercase;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.aheart-ai-bubble__content,
|
|
56
|
+
.aheart-ai-bubble__error {
|
|
57
|
+
margin: 0;
|
|
58
|
+
line-height: 1.72;
|
|
59
|
+
white-space: pre-wrap;
|
|
60
|
+
overflow-wrap: anywhere;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.aheart-ai-bubble__content a {
|
|
64
|
+
color: var(--aheart-color-primary, #1677ff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.aheart-ai-bubble__tool-call {
|
|
68
|
+
display: grid;
|
|
69
|
+
min-inline-size: 0;
|
|
70
|
+
gap: 10px;
|
|
71
|
+
margin-block: 10px;
|
|
72
|
+
padding: 12px;
|
|
73
|
+
overflow-wrap: anywhere;
|
|
74
|
+
border: 1px solid var(--aheart-ai-line, #d0d5dd);
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
background: var(--aheart-ai-surface-subtle, #f8fafc);
|
|
77
|
+
}
|
|
78
|
+
.aheart-ai-bubble__tool-heading {
|
|
79
|
+
display: grid;
|
|
80
|
+
gap: 3px;
|
|
81
|
+
}
|
|
82
|
+
.aheart-ai-bubble__tool-heading strong {
|
|
83
|
+
color: var(--aheart-ai-text, #101828);
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
}
|
|
86
|
+
.aheart-ai-bubble__tool-heading span {
|
|
87
|
+
color: var(--aheart-ai-text-secondary, #475467);
|
|
88
|
+
font-size: 13px;
|
|
89
|
+
line-height: 1.45;
|
|
90
|
+
}
|
|
91
|
+
.aheart-ai-bubble__tool-details {
|
|
92
|
+
display: grid;
|
|
93
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
94
|
+
gap: 6px 10px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
line-height: 1.45;
|
|
98
|
+
}
|
|
99
|
+
.aheart-ai-bubble__tool-details dt {
|
|
100
|
+
color: var(--aheart-ai-text-secondary, #667085);
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
}
|
|
103
|
+
.aheart-ai-bubble__tool-details dd {
|
|
104
|
+
display: flex;
|
|
105
|
+
min-inline-size: 0;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
gap: 6px;
|
|
108
|
+
margin: 0;
|
|
109
|
+
color: var(--aheart-ai-text, #344054);
|
|
110
|
+
}
|
|
111
|
+
.aheart-ai-bubble__tool-details small {
|
|
112
|
+
padding: 1px 5px;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
background: color-mix(in srgb, currentColor 10%, transparent);
|
|
115
|
+
font-size: 11px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.aheart-ai-bubble__error {
|
|
119
|
+
padding: 8px 10px;
|
|
120
|
+
border-inline-start: 3px solid var(--aheart-color-danger, #d92d20);
|
|
121
|
+
background: #fff1f0;
|
|
122
|
+
color: #b42318;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.aheart-ai-attachments button {
|
|
126
|
+
min-block-size: 28px;
|
|
127
|
+
padding: 3px 8px;
|
|
128
|
+
border: 1px solid transparent;
|
|
129
|
+
border-radius: 4px;
|
|
130
|
+
background: transparent;
|
|
131
|
+
color: var(--aheart-ai-text-secondary);
|
|
132
|
+
font: 12px/1.4 inherit;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
transition: border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.aheart-ai-attachments button:hover,
|
|
138
|
+
.aheart-ai-attachments button:focus-visible {
|
|
139
|
+
border-color: #b9c2cf;
|
|
140
|
+
background: var(--aheart-ai-surface-subtle);
|
|
141
|
+
color: var(--aheart-ai-text);
|
|
142
|
+
outline: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.aheart-ai-sources,
|
|
146
|
+
.aheart-ai-process,
|
|
147
|
+
.aheart-ai-attachments {
|
|
148
|
+
display: grid;
|
|
149
|
+
gap: 8px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.aheart-ai-attachments,
|
|
153
|
+
.aheart-ai-sources ul,
|
|
154
|
+
.aheart-ai-process ol {
|
|
155
|
+
margin: 0;
|
|
156
|
+
padding: 0;
|
|
157
|
+
list-style: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.aheart-ai-attachments li,
|
|
161
|
+
.aheart-ai-sources li {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: space-between;
|
|
165
|
+
gap: 8px;
|
|
166
|
+
min-block-size: 34px;
|
|
167
|
+
padding: 6px 8px;
|
|
168
|
+
border: 1px solid var(--aheart-ai-line);
|
|
169
|
+
border-radius: 5px;
|
|
170
|
+
background: var(--aheart-ai-surface-subtle);
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.aheart-ai-sources {
|
|
175
|
+
padding-block-start: 8px;
|
|
176
|
+
border-block-start: 1px solid var(--aheart-ai-line);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.aheart-ai-sources a {
|
|
180
|
+
color: var(--aheart-ai-brand-strong);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.aheart-ai-sources h3,
|
|
184
|
+
.aheart-ai-process h3 {
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
color: var(--aheart-ai-text-secondary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.aheart-ai-process ol {
|
|
190
|
+
display: grid;
|
|
191
|
+
gap: 6px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.aheart-ai-process li {
|
|
195
|
+
position: relative;
|
|
196
|
+
display: grid;
|
|
197
|
+
gap: 2px;
|
|
198
|
+
padding-inline-start: 16px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.aheart-ai-process li::before {
|
|
202
|
+
content: "";
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset-block-start: 7px;
|
|
205
|
+
inset-inline-start: 2px;
|
|
206
|
+
inline-size: 6px;
|
|
207
|
+
block-size: 6px;
|
|
208
|
+
border-radius: 50%;
|
|
209
|
+
background: #98a2b3;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.aheart-ai-process li.is-running::before {
|
|
213
|
+
background: var(--aheart-ai-cyan);
|
|
214
|
+
box-shadow: 0 0 0 3px #cffafe;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.aheart-ai-process li.is-complete::before {
|
|
218
|
+
background: #12b76a;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.aheart-ai-process li.is-stopped::before {
|
|
222
|
+
background: #98a2b3;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.aheart-ai-process li.is-error {
|
|
226
|
+
color: var(--aheart-color-danger, #d92d20);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@media (max-width: 760px) {
|
|
230
|
+
|
|
231
|
+
.aheart-ai-bubble {
|
|
232
|
+
max-inline-size: 96%;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (pointer: coarse) {
|
|
237
|
+
.aheart-ai-attachments button {
|
|
238
|
+
min-block-size: 44px;
|
|
239
|
+
min-inline-size: 44px;
|
|
240
|
+
}
|
|
241
|
+
}
|
package/lib/bubble.vue.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AIContentRenderer, AIMessage } from './types';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
message: AIMessage;
|
|
4
4
|
contentRenderer?: AIContentRenderer | undefined;
|
|
5
|
-
}>>, {}, {}, {}, {}, import("
|
|
5
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
6
|
message: AIMessage;
|
|
7
7
|
contentRenderer?: AIContentRenderer | undefined;
|
|
8
|
-
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("
|
|
8
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
9
9
|
actions?(_: {
|
|
10
10
|
message: AIMessage;
|
|
11
11
|
}): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as AIChatPanel } from '../chat-panel.vue';
|
|
2
|
+
export { default as AIActions } from '../actions.vue';
|
|
3
|
+
export { default as AIAttachments } from '../attachments.vue';
|
|
4
|
+
export { default as AIBubble } from '../bubble.vue';
|
|
5
|
+
export { default as AIConversations } from '../conversations.vue';
|
|
6
|
+
export { default as AIPrompts } from '../prompts.vue';
|
|
7
|
+
export { default as AISender } from '../sender.vue';
|
|
8
|
+
export { default as AISources } from '../sources.vue';
|
|
9
|
+
export { default as AIWelcome } from '../welcome.vue';
|
|
10
|
+
export type * from '../types';
|
|
11
|
+
export * from '../stream-reducer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chat-panel.vue.js"),u=require("../actions.vue.js"),_=require("../attachments.vue.js"),r=require("../bubble.vue.js"),s=require("../conversations.vue.js"),c=require("../prompts.vue.js"),a=require("../sender.vue.js"),n=require("../sources.vue.js"),p=require("../welcome.vue.js"),e=require("../stream-reducer.js");exports.AIChatPanel=t.default;exports.AIActions=u.default;exports.AIAttachments=_.default;exports.AIBubble=r.default;exports.AIConversations=s.default;exports.AIPrompts=c.default;exports.AISender=a.default;exports.AISources=n.default;exports.AIWelcome=p.default;exports.createAIStreamReducer=e.createAIStreamReducer;exports.reduceAIStreamEvent=e.reduceAIStreamEvent;
|