@vantaloom/runtime-win32-x64 0.9.3 → 0.9.4
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/VERSION +1 -1
- package/bin/vantaloom-agent.exe +0 -0
- package/bin/vantaloom-api.exe +0 -0
- package/bin/vantaloom-browser.exe +0 -0
- package/bin/vantaloomctl.exe +0 -0
- package/cli/package.json +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/web/404.html +1 -1
- package/web/__next.__PAGE__.txt +2 -2
- package/web/__next._full.txt +3 -3
- package/web/__next._head.txt +1 -1
- package/web/__next._index.txt +2 -2
- package/web/__next._tree.txt +2 -2
- package/web/_next/static/chunks/89fc1d6c73b3a620.css +2 -0
- package/web/_next/static/chunks/{ff7c2c477aacd038.js → f50174c289b30da7.js} +1 -1
- package/web/_not-found/__next._full.txt +2 -2
- package/web/_not-found/__next._head.txt +1 -1
- package/web/_not-found/__next._index.txt +2 -2
- package/web/_not-found/__next._not-found/__PAGE__.txt +1 -1
- package/web/_not-found/__next._not-found.txt +1 -1
- package/web/_not-found/__next._tree.txt +2 -2
- package/web/_not-found.html +1 -1
- package/web/_not-found.txt +2 -2
- package/web/index.html +1 -1
- package/web/index.txt +3 -3
- package/web/_next/static/chunks/dc61f21cb4956107.css +0 -2
- /package/web/_next/static/{AxDMStt3UbWZjc8ancCyR → 2q9rjqyEgjPOvoNoxFYCx}/_buildManifest.js +0 -0
- /package/web/_next/static/{AxDMStt3UbWZjc8ancCyR → 2q9rjqyEgjPOvoNoxFYCx}/_clientMiddlewareManifest.json +0 -0
- /package/web/_next/static/{AxDMStt3UbWZjc8ancCyR → 2q9rjqyEgjPOvoNoxFYCx}/_ssgManifest.js +0 -0
|
@@ -17,7 +17,7 @@ ${c}
|
|
|
17
17
|
${r} [data-chart=${e}] {
|
|
18
18
|
${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).filter(Boolean).join("\n")}
|
|
19
19
|
}
|
|
20
|
-
`).join("\n")}}):null}function Vn({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:i=!1,label:o,labelFormatter:l,labelClassName:s,formatter:c,color:d,nameKey:u,labelKey:f}){let{config:h}=function(){let e=ew.useContext(B9);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}(),m=ew.useMemo(()=>{if(a||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??"value"}`,r=Vr(h,e,n),i=f||"string"!=typeof o?r?.label:h[o]?.label??o;return l?(0,ey.jsx)("div",{className:(0,eI.cn)("font-medium",s),children:l(i,t)}):i?(0,ey.jsx)("div",{className:(0,eI.cn)("font-medium",s),children:i}):null},[o,l,t,a,s,h,f]);if(!e||!t?.length)return null;let p=1===t.length&&"dot"!==r;return(0,ey.jsxs)("div",{className:(0,eI.cn)("vtl-surface-popover grid min-w-32 items-start gap-1.5 rounded-[var(--surface-popover-radius)] border px-2.5 py-1.5 text-xs",n),children:[p?null:m,(0,ey.jsx)("div",{className:"grid gap-1.5",children:t.filter(e=>"none"!==e.type).map((e,t)=>{let n=`${u??e.name??e.dataKey??"value"}`,a=Vr(h,e,n),o=d??e.payload?.fill??e.color;return(0,ey.jsx)("div",{className:(0,eI.cn)("flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground","dot"===r&&"items-center"),children:c&&e?.value!==void 0&&e.name?c(e.value,e.name,e,t,e.payload):(0,ey.jsxs)(ey.Fragment,{children:[a?.icon?(0,ey.jsx)(a.icon,{}):!i&&(0,ey.jsx)("div",{className:(0,eI.cn)("shrink-0 rounded-[2px]","dot"===r&&"size-2.5","line"===r&&"w-1","dashed"===r&&"w-0 border-[1.5px] border-dashed bg-transparent",p&&"dashed"===r&&"my-0.5"),style:{backgroundColor:"dashed"===r?"transparent":o,borderColor:o}}),(0,ey.jsxs)("div",{className:(0,eI.cn)("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[(0,ey.jsxs)("div",{className:"grid gap-1.5",children:[p?m:null,(0,ey.jsx)("span",{className:"text-muted-foreground",children:a?.label??e.name})]}),null!=e.value&&(0,ey.jsx)("span",{className:"font-mono font-medium text-foreground tabular-nums",children:"number"==typeof e.value?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}function Vr(e,t,n){if("object"!=typeof t||null===t)return;let r="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0,a=n;return n in t&&"string"==typeof t[n]?a=t[n]:r&&n in r&&"string"==typeof r[n]&&(a=r[n]),a in e?e[a]:e[n]}let Va={placeholder:"Ask the agent to inspect, change, or explain this workspace...",mode:"Mode",model:"Model",attach:"Attach context",removeChip:"Remove context",removeAttachment:"Remove attachment",queuedMessage:"Queued message",guideQueuedMessage:"Guide",removeQueuedMessage:"Remove queued message",moreQueuedMessageActions:"More queued message actions",contextUsage:"Context usage",contextUsed:"used",contextTokenSummary:"used {used} / {total}",toolCalls:"Tool calls",userMessages:"User messages",otherContext:"Other context",compressContext:"Compress context",compressPrecise:"Precise",compressExtreme:"Extreme",send:"Run",stop:"Stop"},Vi=[{id:"agent",label:"Agent",description:"Use tools and make changes.",icon:(0,ey.jsx)(bC,{className:"fill-current"})},{id:"planner",label:"Planner",description:"Plan before changing files.",icon:(0,ey.jsx)(jT,{})},{id:"reviewer",label:"Reviewer",description:"Inspect risks and regressions.",icon:(0,ey.jsx)(ub,{})}],Vo=[{id:"acceptEdits",label:"Accept edits",description:"Auto-approve edits, ask for risky commands.",icon:(0,ey.jsx)(mZ,{})},{id:"ask",label:"Ask permissions",description:"Ask before any tool action.",icon:(0,ey.jsx)(jz,{})},{id:"auto",label:"Auto mode",description:"Auto-approve all except dangerous.",icon:(0,ey.jsx)(jR,{})}],Vl=[{id:"gpt-5.5",label:"GPT-5.5",description:"Highest quality coding agent."},{id:"gpt-5.4",label:"GPT-5.4",description:"Balanced everyday work."},{id:"gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Fast lightweight passes."}];function Vs(e){if(e)return"string"==typeof e.label||"number"==typeof e.label?String(e.label):e.id}function Vc({value:e,defaultValue:t,onValueChange:n,modes:r=Vi,modeId:a,defaultModeId:i,onModeChange:o,permissionModes:l=Vo,permissionModeId:s,defaultPermissionModeId:c,onPermissionModeChange:d,models:u=Vl,modelId:f,defaultModelId:h,onModelChange:m,queuedMessages:p,defaultQueuedMessages:g=[],onQueuedMessagesChange:v,onQueueMessage:x,onRemoveQueuedMessage:y,queueOnTab:b=!0,renderQueuedMessageActions:w,contextUsage:j,chips:k=[],attachments:S=[],onAttachmentsChange:N,actions:C,footer:M,running:E=!1,disabled:O=!1,submitOnEnter:P=!0,promptHistory:A,minRows:I=2,maxRows:z=7,onSubmit:T,onStop:D,onAttach:R,onNudge:_,labels:L,className:$,textareaClassName:F,toolbarClassName:B}){let V,H,U={...Va,...L},W=ew.useRef(null),q=ew.useId(),K=ew.useRef(0),[G,X]=function({value:e,defaultValue:t="",onChange:n}){let[r,a]=ew.useState(t);return[e??r,ew.useCallback(t=>{void 0===e&&a(t),n?.(t)},[n,e])]}({value:e,defaultValue:t,onChange:n}),Y=A??[],[Z,J]=ew.useState(null),Q=ew.useRef(""),ee=ew.useRef(!1);ew.useEffect(()=>{J(null),ee.current=!1},[A]);let et=ew.useCallback(e=>{ee.current=!0,X(e);let t=W.current;t&&requestAnimationFrame(()=>{let e=t.value.length;t.setSelectionRange(e,e)})},[X]),[en,er]=ew.useState(g),[ea,ei]=ew.useState(i??r[0]?.id),[eo,el]=ew.useState(c??l[0]?.id),[es,ec]=ew.useState(h??u[0]?.id),ed=a??ea,eu=s??eo,ef=f??es,eh=r.find(e=>e.id===ed)??r[0],em=l.find(e=>e.id===eu)??l[0],ep=u.find(e=>e.id===ef)??u[0],eg=p??en,ev=(G.trim().length>0||S.length>0)&&!O;function ex(){ev&&(T?.({value:G,modeId:eh?.id,modelId:ep?.id,attachments:S.length>0?S:void 0}),J(null),ee.current=!1,Q.current="",X(""),S.length>0&&N?.([]))}async function eb(e){if(0===e.length||!N)return;let t=[];for(let n of e){let e=`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;if(n.type.startsWith("image/")){let r=await function(e){return new Promise(t=>{let n=new FileReader;n.onload=()=>t("string"==typeof n.result?n.result:""),n.onerror=()=>t(""),n.readAsDataURL(e)})}(n);if(!r)continue;t.push({id:e,kind:"image",name:n.name||"image.png",mimeType:n.type||"image/png",dataUrl:r,size:n.size})}else{let r=await function(e){return new Promise(t=>{let n=new FileReader;n.onload=()=>t("string"==typeof n.result?n.result:""),n.onerror=()=>t(""),n.readAsText(e)})}(n),a=(n.name.split(".").pop()??"").toLowerCase();t.push({id:e,kind:"file",name:n.name||"file.txt",mimeType:n.type||"text/plain",text:r,ext:a,size:n.size})}}t.length>0&&N([...S,...t])}function ej(e){void 0===p&&er(e),v?.(e)}function ek(){let e=G.trim();if(!e||O)return!1;K.current+=1;let t={id:`${q}-queued-${K.current}`,content:e},n=[...eg,t];return ej(n),x?.(t,n),X(""),!0}return ew.useLayoutEffect(()=>{let e=W.current;if(!e)return;e.style.height="0px";let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)?t*z:160;e.style.height=`${Math.min(e.scrollHeight,n)}px`,e.style.overflowY=e.scrollHeight>n?"auto":"hidden"},[z,G]),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer","data-running":E,className:(0,eI.cn)("relative grid w-full",$),children:[eg.length>0&&(0,ey.jsx)(Vf,{messages:eg,labels:U,renderActions:w,onRemove:function(e){let t=eg.find(t=>t.id===e);if(!t)return;let n=eg.filter(t=>t.id!==e);ej(n),y?.(e,t,n)},onNudge:_,running:E}),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-surface",className:(0,eI.cn)("vtl-agent-input-composer-surface relative grid w-full gap-2 rounded-lg border border-border p-2 shadow-sm transition-colors"),children:[k.length>0&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-context",className:"flex min-w-0 flex-wrap items-center gap-1.5",children:k.map(e=>(0,ey.jsx)(Vm,{chip:e,removeLabel:U.removeChip},e.id))}),S.length>0&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-attachments",className:"flex min-w-0 flex-wrap items-center gap-2",children:S.map(e=>(0,ey.jsx)(Vh,{attachment:e,removeLabel:U.removeAttachment,onRemove:()=>N?.(S.filter(t=>t.id!==e.id))},e.id))}),(0,ey.jsx)("textarea",{ref:W,value:G,disabled:O,rows:I,placeholder:U.placeholder,"data-slot":"agent-input-composer-textarea",className:(0,eI.cn)("min-h-10 w-full resize-none border-0 bg-transparent px-0.5 py-0 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",F),onChange:e=>{var t;return t=e.currentTarget.value,void(!ee.current&&null!==Z&&J(null),ee.current=!1,X(t))},onPaste:function(e){let t=Array.from(e.clipboardData?.files??[]);0!==t.length&&N&&(e.preventDefault(),eb(t))},onKeyDown:e=>{Y.length>0&&e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&!e.nativeEvent.isComposing&&function(e){if(0===Y.length)return!1;if("older"===e){if(null===Z){Q.current=G;let e=Y.length-1;return J(e),et(Y[e]??""),!0}if(Z<=0)return!0;let e=Z-1;return J(e),et(Y[e]??""),!0}if(null===Z)return!1;let t=Z+1;return t>=Y.length?(J(null),ee.current=!1,et(Q.current),ee.current=!1):(J(t),et(Y[t]??"")),!0}("ArrowUp"===e.key?"older":"newer")?e.preventDefault():b&&"Tab"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&ek()?e.preventDefault():!P||"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),E?ek():ex())}}),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-toolbar",className:(0,eI.cn)("grid grid-cols-[minmax(0,1fr)_auto] items-end gap-2",B),children:[(0,ey.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,ey.jsx)(Vp,{label:"Permissions",options:l,value:em?.id,trigger:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)("span",{className:"grid size-3.5 place-items-center text-muted-foreground [&_svg]:size-3",children:em?.icon??(0,ey.jsx)(jz,{})}),(0,ey.jsx)("span",{className:"hidden truncate md:inline",children:Vs(em)}),(0,ey.jsx)(vu,{className:"size-3 text-muted-foreground"})]}),triggerClassName:"rounded-md bg-transparent px-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/70",onSelect:function(e){e.disabled||(void 0===s&&el(e.id),d?.(e.id,e))}}),(0,ey.jsx)(Vp,{label:U.model,options:u,value:ep?.id,trigger:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)("span",{className:"grid size-3.5 place-items-center text-muted-foreground [&_svg]:size-3 md:hidden",children:(0,ey.jsx)(jT,{})}),(0,ey.jsx)("span",{className:"hidden truncate md:inline",children:Vs(ep)}),(0,ey.jsx)(vu,{className:"size-3 text-muted-foreground"})]}),triggerClassName:"rounded-md bg-transparent px-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/70",onSelect:function(e){e.disabled||(void 0===f&&ec(e.id),m?.(e.id,e))}}),R&&(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"text-muted-foreground","aria-label":U.attach,title:U.attach,onClick:R,disabled:O,children:(0,ey.jsx)(jI,{})}),C]}),(0,ey.jsxs)("div",{className:"flex items-center gap-1",children:[j&&(0,ey.jsx)(Vu,{usage:j,labels:U}),(V=G.trim().length>0,H=E&&!V,(0,ey.jsx)(eA.Button,{type:"button",size:"icon-xs",variant:H?"outline":"default","aria-label":H?U.stop:U.send,title:H?U.stop:U.send,disabled:!E&&!ev,className:"rounded-full",onClick:H?D:E?()=>ek():ex,children:H?(0,ey.jsx)(jD,{className:"size-3 fill-current"}):(0,ey.jsx)(jP,{className:"size-3.5"})}))]})]}),M&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-footer",className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:M})]})]})}function Vd(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${Math.round(e/1e3)}k`:e.toLocaleString()}function Vu({usage:e,labels:t}){let[n,r]=ew.useState(!1),a=Math.max(0,e.used),i=Math.max(0,e.total),o=i>0?Math.min(100,Math.round(a/i*100)):0,l=Math.max(0,e.toolCalls),s=Math.max(0,e.userMessages),c=Math.max(0,e.other??Math.max(0,a-l-s)),d=[{name:"toolCalls",value:l,fill:"var(--color-toolCalls)"},{name:"userMessages",value:s,fill:"var(--color-userMessages)"},{name:"other",value:c,fill:"var(--color-other)"},{name:"unused",value:Math.max(0,i-a),fill:"var(--muted)"}].filter(e=>e.value>0),u=t.contextTokenSummary.replace("{used}",Vd(a)).replace("{total}",Vd(i)),f={toolCalls:{label:t.toolCalls,color:"var(--chart-1)"},userMessages:{label:t.userMessages,color:"var(--chart-3)"},other:{label:t.otherContext,color:"var(--chart-5)"}};return(0,ey.jsxs)(xO,{children:[(0,ey.jsx)(xz,{asChild:!0,children:(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"text-muted-foreground","aria-label":`${t.contextUsage}: ${o}% ${t.contextUsed}`,title:`${t.contextUsage}: ${o}% ${t.contextUsed}`,children:(0,ey.jsx)("span",{"aria-hidden":"true",className:"grid size-4 place-items-center rounded-full",style:{background:`conic-gradient(var(--foreground) ${3.6*o}deg, var(--border) 0deg)`},children:(0,ey.jsx)("span",{className:"size-3 rounded-full bg-background dark:bg-popover"})})})}),(0,ey.jsxs)(xq,{side:"top",align:"center",sideOffset:8,className:"w-44 gap-2 p-3",children:[(0,ey.jsxs)("div",{className:"grid gap-0.5 text-center",children:[(0,ey.jsx)("div",{className:"text-sm font-medium text-muted-foreground",children:e.label??t.contextUsage}),(0,ey.jsxs)("div",{className:"text-sm text-muted-foreground",children:[o,"% ",t.contextUsed]}),(0,ey.jsx)("div",{className:"text-sm font-medium",children:u})]}),(0,ey.jsx)("div",{className:"grid justify-center",children:(0,ey.jsx)(Ve,{config:f,className:"h-20 w-20",initialDimension:{width:80,height:80},onMouseMove:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,ey.jsxs)(Bo,{children:[(0,ey.jsx)(BU,{active:n,content:(0,ey.jsx)(Vn,{hideLabel:!0})}),(0,ey.jsx)(LN,{data:d.length>0?d:[{name:"other",value:1,fill:"var(--muted)"}],dataKey:"value",nameKey:"name",innerRadius:25,outerRadius:35,isAnimationActive:!1,strokeWidth:0})]})})}),e.onCompressPrecise||e.onCompressExtreme?(0,ey.jsxs)("div",{className:"flex w-full overflow-hidden rounded-md border",children:[(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"sm",className:"flex-1 rounded-none border-r text-xs font-medium",onClick:e.onCompressPrecise,disabled:e.compressing||!e.onCompressPrecise,children:e.compressing?"…":t.compressPrecise??"精确"}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"sm",className:"flex-1 rounded-none text-xs font-medium",onClick:e.onCompressExtreme,disabled:e.compressing||!e.onCompressExtreme,children:e.compressing?"…":t.compressExtreme??"极致"})]}):(0,ey.jsx)(eA.Button,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:e.onCompress,disabled:!e.onCompress,children:t.compressContext})]})]})}function Vf({messages:e,labels:t,renderActions:n,onRemove:r,onNudge:a,running:i}){return(0,ey.jsx)("div",{"data-slot":"agent-input-composer-queue",className:"vtl-agent-input-composer-queue z-10 mx-5 mb-[-1px] grid gap-1.5 rounded-t-lg rounded-b-none border border-border p-1.5 shadow-xs",children:e.map((e,o)=>(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-queue-item",className:(0,eI.cn)("group/queue flex min-h-8 min-w-0 items-center gap-2 rounded-md px-2 text-sm transition-colors",e.disabled?"text-muted-foreground opacity-60":"text-foreground hover:bg-muted/60"),children:[(0,ey.jsx)("span",{className:"grid size-4 shrink-0 place-items-center text-muted-foreground [&_svg]:size-3.5",children:e.icon??(0,ey.jsx)(jA,{})}),(0,ey.jsx)("span",{className:"min-w-0 flex-1 truncate",title:String(e.content),children:e.content}),e.meta&&(0,ey.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.meta}),(0,ey.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-70 transition-opacity group-hover/queue:opacity-100",children:[n?.(e),i&&a&&(0,ey.jsxs)(eA.Button,{type:"button",variant:"ghost",size:"xs",className:"h-6 gap-1 px-1.5 text-muted-foreground","aria-label":`${t.guideQueuedMessage} ${o+1}`,onClick:()=>a(e.id),children:[(0,ey.jsx)(jA,{className:"size-3.5"}),t.guideQueuedMessage]}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"size-6 text-muted-foreground","aria-label":`${t.removeQueuedMessage} ${o+1}`,onClick:()=>r(e.id),children:(0,ey.jsx)(yi,{})}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"size-6 text-muted-foreground","aria-label":`${t.moreQueuedMessageActions} ${o+1}`,children:(0,ey.jsx)(lY,{})})]})]},e.id))})}function Vh({attachment:e,removeLabel:t,onRemove:n}){return(0,ey.jsxs)("div",{"data-slot":"agent-input-attachment",className:"group/att relative size-14 shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",title:e.name,children:["image"===e.kind&&e.dataUrl?(0,ey.jsx)("img",{src:e.dataUrl,alt:e.name,className:"size-full object-cover"}):(0,ey.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-1 px-1 text-center",children:[(0,ey.jsx)(uC,{className:"size-4 text-muted-foreground"}),(0,ey.jsx)("span",{className:"w-full truncate text-[10px] font-semibold uppercase text-muted-foreground",children:e.ext?`.${e.ext}`:"TXT"})]}),(0,ey.jsx)("button",{type:"button","aria-label":t,title:t,onClick:n,className:"absolute right-0.5 top-0.5 grid size-4 place-items-center rounded-full bg-background/85 text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/att:opacity-100",children:(0,ey.jsx)(fg.XIcon,{className:"size-3"})})]})}function Vm({chip:e,removeLabel:t}){return(0,ey.jsxs)(Bs,{variant:"secondary","data-tone":e.tone,className:(0,eI.cn)("h-6 max-w-full gap-1 rounded-md border border-border bg-muted/70 px-1.5 text-muted-foreground","success"===e.tone&&"border-primary/25 bg-primary/10 text-foreground","warning"===e.tone&&"border-destructive/25 bg-destructive/10 text-foreground"),children:[e.icon&&(0,ey.jsx)("span",{className:"grid size-3.5 shrink-0 place-items-center [&_svg]:size-3",children:e.icon}),(0,ey.jsx)("span",{className:"truncate",children:e.label}),e.onRemove&&(0,ey.jsx)("button",{type:"button",className:"-mr-0.5 grid size-4 shrink-0 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none","aria-label":`${t} ${e.id}`,onClick:()=>e.onRemove?.(e.id),children:(0,ey.jsx)(fg.XIcon,{className:"size-3"})})]})}function Vp({label:e,options:t,value:n,trigger:r,triggerClassName:a,onSelect:i}){return(0,ey.jsxs)(bR,{children:[(0,ey.jsx)(bL,{asChild:!0,children:(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"xs",className:(0,eI.cn)("h-6 max-w-40 gap-1 rounded-md px-1.5 text-xs font-medium",a),children:r})}),(0,ey.jsx)(bZ,{align:"start","aria-label":"string"==typeof e?e:void 0,className:"min-w-40 p-1",children:t.map(e=>(0,ey.jsxs)(bJ,{disabled:e.disabled,className:"h-8 gap-2 px-2 text-sm",onSelect:()=>i(e),children:[(0,ey.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),(0,ey.jsx)(mZ,{className:(0,eI.cn)("ml-auto size-4 text-foreground",n===e.id?"opacity-100":"opacity-0")})]},e.id))})]})}function Vg(e,t,n,r){return[{id:`${t}-task-${e}`,kind:"user",title:n},...r.map(n=>({...n,id:`${t}-${n.id}-${e}`}))]}function Vv(e){return[{id:`read-materials-${e}`,kind:"read",actionLabel:"读取",title:"AgentWorkspace.tsx, styles.css, i18n.json",files:[{id:`workspace-${e}`,name:"AgentWorkspace.tsx",lines:"1-480"},{id:`styles-${e}`,name:"styles.css",lines:"265-820"},{id:`i18n-${e}`,name:"i18n.json",lines:"245-292"}]},{id:`search-actions-${e}`,kind:"search",actionLabel:"搜索",title:"workspace creation, sidebar tree, streaming output",files:[{id:`workspace-search-${e}`,name:"AgentWorkspace.tsx",lines:"64-190"},{id:`style-search-a-${e}`,name:"styles.css",lines:"540-670"},{id:`style-search-b-${e}`,name:"styles.css",lines:"705-790"}]},{id:`subagents-${e}`,kind:"subagent",actionLabel:"召唤",title:"子代理",subagents:[{id:`reader-${e}`,title:"阅读子代理",activity:"阅读 package.json",toolActivities:["读取 package.json","检查 workspace 脚本","整理依赖信息"],status:"阅读 package.json",detail:"package.json 已读取,正在整理脚本与依赖信息。",isRunning:!0,events:Vg(e,"reader","阅读 package.json",[{id:"read-package",kind:"read",actionLabel:"读取",title:"package.json",files:[{id:"package-json",name:"package.json",lines:"1-96"}]},{id:"reader-note",kind:"done",title:"已读取 package.json。\n\n- 已记录 workspace 脚本\n- 已检查 UI 与 app 包依赖\n- 下一步等待主代理合并上下文"}])},{id:`searcher-${e}`,title:"搜索子代理",activity:"搜索 AgentWorkspace.tsx",toolActivities:["搜索 AgentWorkspace.tsx","筛选面板布局","定位事件流接入"],status:"搜索 AgentWorkspace.tsx",detail:"AgentWorkspace.tsx 命中 3 处候选区域,正在筛选可复用结构。",isRunning:!0,events:Vg(e,"searcher","搜索 AgentWorkspace.tsx",[{id:"search-workspace",kind:"search",actionLabel:"搜索",title:"AgentWorkspace.tsx",files:[{id:"agent-workspace-a",name:"AgentWorkspace.tsx",lines:"64-190"},{id:"agent-workspace-b",name:"AgentWorkspace.tsx",lines:"320-418"}]},{id:"searcher-note",kind:"done",title:"已定位 AgentWorkspace.tsx 的面板布局与事件流接入位置。"}])},{id:`verifier-${e}`,title:"验证子代理",activity:"验证工作流状态",toolActivities:["验证对话流","验证右侧面板","检查子代理切换"],status:"验证工作流状态",detail:"工作流状态正在校验,等待主代理提交最终结果。",isRunning:!0,events:Vg(e,"verifier","验证工作流状态",[{id:"verify-flow",kind:"verify",actionLabel:"验证",title:"对话流、右侧面板、子代理切换"},{id:"verifier-note",kind:"done",title:"验证队列已建立,等待主代理继续写入真实结果。"}])}]},{id:`think-structure-${e}`,kind:"thought",actionLabel:"思考",title:"8s",status:"done"},{id:`plan-${e}`,kind:"done",title:"**收到新的编织请求。**\n\n我会先保留当前工作台样式,只用占位文本演示真实任务流:读取、搜索、思考、编辑和验证都会按顺序进入同一条文字流。\n\n- 左侧织布机由真实创建动作产生\n- 编织物初始保持为空\n- 文件读取项仍然可以展开\n- 点击文件名会继续打开右侧标签页"},{id:`edit-workspace-${e}`,kind:"change",actionLabel:"编辑",title:"AgentWorkspace.tsx",additions:44,deletions:16},{id:`edit-style-${e}`,kind:"change",actionLabel:"编辑",title:"styles.css",additions:36,deletions:12},{id:`verify-flow-${e}`,kind:"verify",actionLabel:"验证",title:"empty sidebar, new loom creation, placeholder workflow"},{id:`done-${e}`,kind:"done",title:"演示工作流已完成。\n\n这只是前端占位演示,后续可以直接把事件流替换成真实 agent runtime。"}]}let Vx=[{id:"user-1",kind:"user",title:"345"},...Vv("1"),{id:"user-2",kind:"user",title:"234"}],Vy=(0,ek.default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Vb=(0,ek.default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),Vw=(0,ek.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),Vj=(0,ek.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);(0,ek.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);let Vk=(0,l2.cva)("vtl-dot-matrix-loader",{variants:{size:{xs:"[--vtl-dot-size:3px] [--vtl-dot-gap:3px]",sm:"[--vtl-dot-size:3.5px] [--vtl-dot-gap:3.5px]",default:"[--vtl-dot-size:4px] [--vtl-dot-gap:4px]",lg:"[--vtl-dot-size:5px] [--vtl-dot-gap:5px]",xl:"[--vtl-dot-size:6px] [--vtl-dot-gap:6px]"},tone:{default:"text-current",muted:"text-muted-foreground",primary:"text-primary",inverse:"text-primary-foreground",destructive:"text-destructive"},variant:{pulse:"vtl-dot-matrix-loader-pulse",wave:"vtl-dot-matrix-loader-wave",orbit:"vtl-dot-matrix-loader-orbit",binary:"vtl-dot-matrix-loader-binary"}},defaultVariants:{size:"default",tone:"default",variant:"pulse"}}),VS={pulse:[0,90,180,270,360,450,540,630,720],wave:[0,80,160,80,160,240,160,240,320],orbit:[0,130,260,910,1040,390,780,650,520],binary:[0,210,420,630,140,350,560,70,280]};function VN({className:e,size:t,tone:n,variant:r,animated:a=!0,speed:i=1,style:o,"aria-label":l="Loading",...s}){let c=Math.round(1120/(Number.isFinite(i)&&i>0?i:1)),d=VS[r??"pulse"];return(0,ey.jsx)("span",{role:"status","aria-label":l,"data-animated":a?"true":"false",className:(0,eI.cn)(Vk({size:t,tone:n,variant:r}),e),style:{"--vtl-dot-duration":`${c}ms`,...o},...s,children:Array.from({length:9},(e,t)=>(0,ey.jsx)("span",{"aria-hidden":"true",className:"vtl-dot-matrix-loader-dot",style:{"--vtl-dot-delay":`${d[t]}ms`}},t))})}let VC=(0,l2.cva)("animate-spin",{variants:{size:{xs:"size-3",sm:"size-3.5",default:"size-4",lg:"size-5",xl:"size-6"},variant:{default:"text-current",muted:"text-muted-foreground",primary:"text-primary"}},defaultVariants:{size:"default",variant:"default"}});function VM({className:e,size:t,variant:n,...r}){return(0,ey.jsx)(eM,{role:"status","aria-label":"Loading",className:(0,eI.cn)(VC({size:t,variant:n}),e),...r})}function VE({className:e,...t}){return(0,ey.jsx)("div",{"data-slot":"agent-message-actions",className:(0,eI.cn)("flex items-center gap-1.5 text-muted-foreground",e),...t})}function VO({className:e,...t}){return(0,ey.jsx)(eA.Button,{size:"icon-xs",variant:"ghost",className:e,...t})}function VP({mode:e,label:t,retryAttempt:n,retryMax:r,errorDetail:a,className:i}){let o="retry"===e,l=o?`正在进行重试...(${n??1}/${r??1})`:t??"正在处理中",[s,c]=ew.useState(!1),d=ew.useRef(void 0);ew.useEffect(()=>()=>{void 0!==d.current&&window.clearTimeout(d.current)},[]);let u=ew.useCallback(()=>{let e=(a??"").trim();e&&("u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e):new Promise((t,n)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch(e){n(e)}})).then(()=>{c(!0),void 0!==d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!1),1800)}).catch(()=>{})},[a]),f=o&&!!(a??"").trim();return(0,ey.jsxs)("div",{"data-slot":"conversation-status-tail","aria-live":"polite",className:(0,eI.cn)("flex items-center gap-2 text-sm leading-6",o?"text-destructive":"text-muted-foreground",i),children:[(0,ey.jsx)(VN,{size:"xs",variant:"wave",tone:o?"destructive":"muted",className:"max-h-[1.5em]","aria-label":l}),(0,ey.jsx)("span",{children:l}),f?(0,ey.jsxs)("button",{type:"button",onClick:u,title:"复制完整报错信息",className:"cursor-pointer rounded text-destructive/80 underline decoration-dotted underline-offset-2 transition-colors hover:text-destructive",children:["(",s?"已复制":"点击复制报错信息",")"]}):null]})}function VA(e){return e.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)?|\x1b\[[?!>]?[\d;]*[a-zA-Z~]|\x9b[?!>]?[\d;]*[a-zA-Z~]|\x1b[()#][A-Z0-9]|\x1b[A-Z=><78]|\r/gi,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\x80-\x9f]/g,"")}let VI=[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"];function Vz(e){let t=(e.split(/[?#]/,1)[0]??e).replace(/[\\/]+$/,"").split(/[\\/]/),n=t[t.length-1];return n&&n.trim()?n.trim():e}function VT({src:e,alt:t}){return(0,ey.jsx)("img",{src:e,alt:t,loading:"lazy",className:"vtl-agent-deliverable-image"})}function VD({label:e,target:t,context:n}){let r=n?.classify?.(t)??"url",a=e.trim()||Vz(t);return(0,ey.jsxs)("button",{type:"button",className:"vtl-agent-deliverable-chip",title:t,onClick:()=>n?.onOpen?.({target:t,kind:r,label:a}),children:[(0,ey.jsx)(uC,{className:"vtl-agent-deliverable-chip-icon"}),(0,ey.jsx)("span",{className:"vtl-agent-deliverable-chip-label",children:a}),(0,ey.jsx)("span",{className:"vtl-agent-deliverable-chip-open",children:"打开"})]})}function VR(e,t,n,r,a){if(!t)return;let i=n+t.length;if(r<=n)return void e.push((0,ey.jsx)("span",{className:"vtl-agent-stream-fade-text",children:t},`${a}-fade-${n}`));if(r>=i)return void e.push(t);let o=r-n;e.push(t.slice(0,o)),e.push((0,ey.jsx)("span",{className:"vtl-agent-stream-fade-text",children:t.slice(o)},`${a}-fade-${n}`))}function V_(e,t){let n="!"===e[t]&&"["===e[t+1],r=t+(n?2:1),a=e.indexOf("]",r);if(-1===a||"("!==e[a+1])return null;let i=e.indexOf(")",a+2);if(-1===i)return null;let o=e.slice(r,a),l=e.slice(a+2,i).trim();return l?{isImage:n,label:o,target:l,end:i+1}:null}function VL(e,t=1/0,n){let r=[],a=0;for(;a<e.length;){if("!"===e[a]&&"["===e[a+1]){let t=V_(e,a);if(t){let e=n?.resolveImageSrc?.(t.target)??t.target;r.push((0,ey.jsx)(VT,{src:e,alt:t.label},`img-${a}`)),a=t.end;continue}}if("["===e[a]){let t=V_(e,a);if(t){if(function(e){let t=(e.split(/[?#]/,1)[0]??e).toLowerCase();return!!t.startsWith("data:image/")||VI.some(e=>t.endsWith(e))}(t.target)){let e=n?.resolveImageSrc?.(t.target)??t.target;r.push((0,ey.jsx)(VT,{src:e,alt:t.label||Vz(t.target)},`img-${a}`))}else n?r.push((0,ey.jsx)(VD,{label:t.label,target:t.target,context:n},`chip-${a}`)):r.push((0,ey.jsx)("a",{href:t.target,target:"_blank",rel:"noreferrer noopener",children:t.label||t.target},`link-${a}`));a=t.end;continue}}if(e.startsWith("**",a)){let i=e.indexOf("**",a+2),o=-1===i?e.slice(a+2):e.slice(a+2,i);o.length>0&&r.push((0,ey.jsx)("strong",{children:VL(o,t-a-2,n)},`strong-${a}`)),a=-1===i?e.length:i+2;continue}if("`"===e[a]){let i=e.indexOf("`",a+1),o=-1===i?e.slice(a+1):e.slice(a+1,i);o.length>0&&r.push((0,ey.jsx)("code",{children:VL(o,t-a-1,n)},`code-${a}`)),a=-1===i?e.length:i+1;continue}let i=[e.indexOf("**",a),e.indexOf("`",a),e.indexOf("[",a),e.indexOf("![",a)].filter(e=>e>=0).sort((e,t)=>e-t)[0]??e.length;if(i===a){VR(r,e[a]??"",a,t,`ch-${a}`),a+=1;continue}VR(r,e.slice(a,i),a,t,`text-${a}`),a=i}return r}function V$(e){return/^\s*[-*]\s+/.test(e)}function VF(e){return/^#{1,6}\s+/.test(e.trim())}function VB(e){return/^\s*([-*_])(?:\s*\1){2,}\s*$/.test(e)}function VV(e){return e.includes("|")&&e.trim().split("|").length>=3}function VH(e){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)}function VU(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}let VW=new Map;function Vq({content:e,isStreaming:t=!1,deliverable:n}){let r=function(e){let t=VW.get(e);if(t)return VW.delete(e),VW.set(e,t),t;let n=function(e){let t=e.replace(/\r\n/g,"\n").split("\n"),n=[],r=0;for(let e of t)n.push(r),r+=e.length+1;let a=[],i=0;for(;i<t.length;){let e=t[i]??"",r=e.trim(),o=n[i]??0;if(!r){i+=1;continue}if(r.startsWith("```")){let e=[];for(i+=1;i<t.length&&!(t[i]??"").trim().startsWith("```");)e.push(t[i]??""),i+=1;i<t.length&&(i+=1),a.push({kind:"code",text:e.join("\n"),start:o});continue}if(VB(e)){a.push({kind:"hr",start:o}),i+=1;continue}if(VF(e)){let e=/^(#{1,6})\s+(.+)$/.exec(r),t=e?.[1]??"##";a.push({kind:"heading",depth:t.length,text:e?.[2]??r,start:o}),i+=1;continue}if(VV(e)&&i+1<t.length&&VH(t[i+1]??"")){let n=VU(e),r=[];for(i+=2;i<t.length&&VV(t[i]??"");)r.push(VU(t[i]??"")),i+=1;a.push({kind:"table",headers:n,rows:r,start:o});continue}if(V$(e)){let e=[];for(;i<t.length&&V$(t[i]??"");)e.push({text:(t[i]??"").replace(/^\s*[-*]\s+/,""),start:n[i]??0}),i+=1;a.push({kind:"list",items:e,start:o});continue}let l=[];for(;i<t.length;){let e=t[i]??"",n=t[i+1]??"";if(!e.trim()||e.trim().startsWith("```")||VB(e)||VF(e)||V$(e)||VV(e)&&VH(n))break;l.push(e),i+=1}a.push({kind:"paragraph",lines:l,start:o})}return a}(e);if(VW.set(e,n),VW.size>512){let e=VW.keys().next().value;void 0!==e&&VW.delete(e)}return n}(e),a=t?Math.max(0,e.length-14):1/0;return(0,ey.jsx)("div",{className:"vtl-agent-markdown",children:r.map((e,t)=>{let r=a-e.start;return"code"===e.kind?(0,ey.jsx)("pre",{children:e.text},`block-${t}`):"hr"===e.kind?(0,ey.jsx)("hr",{},`block-${t}`):"heading"===e.kind?e.depth<=2?(0,ey.jsx)("h3",{children:VL(e.text,r,n)},`block-${t}`):(0,ey.jsx)("h4",{children:VL(e.text,r,n)},`block-${t}`):"list"===e.kind?(0,ey.jsx)("ul",{children:e.items.map((e,t)=>(0,ey.jsx)("li",{children:VL(e.text,a-e.start,n)},`${e.text}-${t}`))},`block-${t}`):"table"===e.kind?(0,ey.jsx)("div",{className:"vtl-agent-markdown-table",children:(0,ey.jsxs)("table",{children:[(0,ey.jsx)("thead",{children:(0,ey.jsx)("tr",{children:e.headers.map((e,t)=>(0,ey.jsx)("th",{children:VL(e,r,n)},`${e}-${t}`))})}),(0,ey.jsx)("tbody",{children:e.rows.map((t,a)=>(0,ey.jsx)("tr",{children:e.headers.map((e,i)=>(0,ey.jsx)("td",{children:VL(t[i]??"",r,n)},`cell-${a}-${i}`))},`row-${a}`))})]})},`block-${t}`):(0,ey.jsx)("p",{children:VL(e.lines.map(e=>e.trim()).join(" "),r,n)},`block-${t}`)})})}function VK(e){return("assistant"===e.kind||"done"===e.kind)&&"模型没有返回内容。"===e.title.trim()&&!e.detail?.trim()}function VG(e){return("error"!==e.kind||"retried"!==e.status)&&!VK(e)}let VX=new Set(["thought","read","search","tool","plan","plan-task","plan-compact","browser"]),VY=ew.forwardRef(function({events:e,labels:t,running:n=!1,bottomInset:r=16,className:a,contentClassName:i,hasEarlier:o,loadingEarlier:l,onLoadEarlier:s,onOpenFile:c,deliverable:d,onOpenSubagent:u,onOpenPlan:f,onOpenSpec:h,onRecallUserMessage:m,onBranchAssistantMessage:p,onRetry:g,onApprovalDecision:v,onContinue:x,onActiveEventChange:y,onAtBottomChange:b},w){let j=ew.useRef(null),k=ew.useRef(!0),S=ew.useRef(!0),N=ew.useRef(b);N.current=b;let[C,M]=ew.useState(0),[E,O]=ew.useState(0),[P,A]=ew.useState({}),I=ew.useMemo(()=>e.filter(VG),[e]),z=ew.useMemo(()=>n?function(e){let t;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r){if("user"===r.kind){t=t??r;break}if(void 0===t&&(t=r),"error"===r.kind&&"retried"===r.status)return{mode:"retry",retryAttempt:r.retryAttempt??1,retryMax:r.retryMax??1,errorDetail:(r.detail??r.title??"").trim()};if(("assistant"===r.kind||"done"===r.kind)&&r.isStreaming&&r.title.trim())return null;if(r.isStreaming||"running"===r.status)break}}return{mode:"working",label:function(e){switch(e?.kind){case"thought":return"正在思考中";case"change":return"正在编辑文件";case"subagent":return"正在分发子代理";default:return"正在处理中"}}(t)}}(e):null,[n,e]),T=ew.useMemo(()=>{let e,t=new Set;for(let n of I)"user"===n.kind?(e&&t.add(e),e=void 0):"assistant"!==n.kind&&"done"!==n.kind||VK(n)||(e=n.id);return e&&t.add(e),t},[I]),D=ew.useMemo(()=>(function(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!VX.has(r.kind)){t.push(r),n++;continue}let a=n,i=[];for(;a<e.length&&VX.has(e[a].kind);)i.push(e[a]),a++;a<e.length&&i.length>=2?t.push(function(e){let t=0,n=0,r=0,a=0,i=0;for(let o of e)"thought"===o.kind?a+=1:"read"===o.kind?t+=o.files?.length??1:"search"===o.kind?n+=1:"plan"===o.kind||"plan-task"===o.kind||"plan-compact"===o.kind?i+=1:r+=1;let o=[];a>0&&o.push(`思考 ${a} 次`),t>0&&o.push(`阅读 ${t} 个文件`),n>0&&o.push(`搜索 ${n} 次`),r>0&&o.push(`执行 ${r} 条命令`),i>0&&o.push(`更新计划 ${i} 次`);let l=o.length>0?`已${o.join(",")}`:`已完成 ${e.length} 步操作`;return{id:`toolgroup-${e[0].id}`,kind:"toolgroup",title:l,groupedEvents:e}}(i)):t.push(...i),n=a}return t})(I),[I]);ew.useLayoutEffect(()=>{let e=j.current;if(!e)return;function t(){O(e.clientHeight)}t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let R=ew.useMemo(()=>D.reduce((e,t,n)=>{var r;let a=P[Hv(t,n)]??("toolgroup"===(r=t).kind?30:"user"===r.kind?72:"assistant"===r.kind||"done"===r.kind?Math.max(42,Math.min(260,28+22*Math.ceil((r.title.length+(r.detail?.length??0))/68))):"read"===r.kind||"search"===r.kind||"tool"===r.kind?r.files?.length?28+26*Math.min(r.files.length,5):26:"subagent"===r.kind?r.subagents?.length?6+24*Math.min(r.subagents.length,6):42:"change"===r.kind?Math.max(42,Math.min(180,10+(r.files?.length??1)*43)):"approval"===r.kind?"pending"===r.status?140:72:"limit"===r.kind?80:"error"===r.kind?88:"plan-question"===r.kind||"plan-approval"===r.kind?r.detail?60:30:"plan"===r.kind||"plan-task"===r.kind||"plan-compact"===r.kind||"plan-answer"===r.kind||"plan-decision"===r.kind?28:r.detail?54:26);return e.rows.push({event:t,index:n,offset:e.totalHeight,height:a,autoOpen:("read"===t.kind||"tool"===t.kind)&&!!t.isStreaming||"read"===t.kind&&!D.slice(n+1).some(e=>"read"!==e.kind),showActions:T.has(t.id)}),e.totalHeight+=a,e},{rows:[],totalHeight:0}),[P,D,T]),_=R.rows.filter(e=>e.offset+e.height>=C-360&&e.offset<=C+Math.max(E,520)+360),L=R.totalHeight+Math.max(0,r),$=ew.useRef(R.rows);$.current=R.rows,ew.useImperativeHandle(w,()=>({scrollToEvent:e=>{let t=j.current;if(!t)return!1;let n=$.current.find(t=>t.event.id===e);if(!n)return!1;k.current=!1;let r=Math.max(0,n.offset-12);return t.scrollTop=r,M(r),!0},scrollToBottom:()=>{let e=j.current;e&&(k.current=!0,e.scrollTop=e.scrollHeight,M(e.scrollTop),!0!==S.current&&(S.current=!0,N.current?.(!0)))}}),[]);let F=ew.useRef(void 0),B=ew.useCallback(()=>{let e;if(!y)return;let t=j.current;if(!t)return;let n=t.scrollTop+24;for(let t of $.current)if(t.offset<=n)e=t.event.id;else break;!e&&$.current.length>0&&(e=$.current[0].event.id),e!==F.current&&(F.current=e,y(e))},[y]),V=ew.useCallback(()=>{let e=j.current;if(!e)return;let t=e.scrollHeight-e.clientHeight,n=t-e.scrollTop,r=t<=1||n<96;r!==S.current&&(S.current=r,b?.(r))},[b]),H=ew.useRef(void 0),U=ew.useRef(0);ew.useLayoutEffect(()=>{let e=j.current,t=D[0]?.id,n=H.current,r=U.current;if(e&&void 0!==n&&t!==n&&D.some(e=>e.id===n)){let t=R.totalHeight-r;if(t>0){let n=e.scrollTop+t;e.scrollTop=n,M(n)}}H.current=t,U.current=R.totalHeight},[D,R.totalHeight]),ew.useLayoutEffect(()=>{let e=j.current;if(!e||!I.length||!k.current){B(),V();return}e.scrollTop=e.scrollHeight,M(e.scrollTop),B(),V()},[r,I.length,L,E,z,B,V]);let W=ew.useCallback((e,t)=>{A(n=>1>Math.abs((n[e]??0)-t)?n:{...n,[e]:t})},[]);return(0,ey.jsxs)("div",{ref:j,"data-slot":"agent-conversation-flow",className:(0,eI.cn)("min-h-0 flex-1 overflow-auto px-4 pt-4 opacity-100 transition-opacity duration-180 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden select-text [-webkit-touch-callout:default] [-webkit-user-select:text]",a),onScroll:function(){let e=j.current;e&&(k.current=e.scrollHeight-e.scrollTop-e.clientHeight<96,M(e.scrollTop),B(),V())},children:[o?(0,ey.jsx)("div",{className:"mx-auto mb-2 flex w-full max-w-[48rem] justify-center",children:(0,ey.jsx)("button",{type:"button",disabled:l,onClick:()=>s?.(),className:"rounded-full border border-border bg-popover px-3 py-1 text-xs text-muted-foreground shadow-sm transition-colors hover:bg-muted disabled:cursor-default disabled:opacity-60",children:l?"加载中…":"↑ 加载更早的消息"})}):null,(0,ey.jsxs)("div",{className:(0,eI.cn)("relative mx-auto min-h-full w-full max-w-[48rem]",i),style:{height:L},children:[_.map(e=>(0,ey.jsx)(VZ,{event:e.event,rowKey:Hv(e.event,e.index),offset:e.offset,autoOpen:e.autoOpen,showActions:e.showActions,labels:t,deliverable:d,onMeasure:W,onOpenFile:c,onOpenSubagent:u,onOpenPlan:f,onOpenSpec:h,onRecallUserMessage:m,onBranchAssistantMessage:p,onRetry:g,onApprovalDecision:v,onContinue:x},Hv(e.event,e.index))),z?(0,ey.jsx)("div",{className:"absolute inset-x-0 px-1 pt-1",style:{top:R.totalHeight},children:(0,ey.jsx)(VP,{mode:z.mode,label:"working"===z.mode?z.label:void 0,retryAttempt:"retry"===z.mode?z.retryAttempt:void 0,retryMax:"retry"===z.mode?z.retryMax:void 0,errorDetail:"retry"===z.mode?z.errorDetail:void 0})}):null]})]})}),VZ=ew.memo(function({event:e,rowKey:t,offset:n,autoOpen:r,showActions:a,labels:i,deliverable:o,onMeasure:l,onOpenFile:s,onOpenSubagent:c,onOpenPlan:d,onOpenSpec:u,onRecallUserMessage:f,onBranchAssistantMessage:h,onRetry:m,onApprovalDecision:p,onContinue:g}){let v=ew.useRef(null);return ew.useLayoutEffect(()=>{let e=v.current;if(!e)return;function n(){l(t,Math.ceil(e.getBoundingClientRect().height))}n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[e.id,l,t]),(0,ey.jsx)("div",{ref:v,"data-index":e.id,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${n}px)`},children:(0,ey.jsx)(V1,{event:e,autoOpen:r,showActions:a,labels:i,deliverable:o,onOpenFile:s,onOpenSubagent:c,onOpenPlan:d,onOpenSpec:u,onRecallUserMessage:f,onBranchAssistantMessage:h,onRetry:m,onContinue:g,onApprovalDecision:p})})});function VJ({attachment:e}){return(0,ey.jsx)("div",{className:"size-14 shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",title:e.name,children:"image"===e.kind&&e.url?(0,ey.jsx)("img",{src:e.url,alt:e.name,className:"size-full object-cover"}):(0,ey.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-1 px-1 text-center",children:[(0,ey.jsx)(uC,{className:"size-4 text-muted-foreground"}),(0,ey.jsx)("span",{className:"w-full truncate text-[10px] font-semibold uppercase text-muted-foreground",children:e.ext?`.${e.ext}`:"FILE"})]})})}function VQ({event:e,labels:t,onRecallUserMessage:n}){let[r,a]=ew.useState(!1),[i,o]=ew.useState(!1),l=!e.forkInherited&&!!n;async function s(){try{await navigator.clipboard.writeText(e.title??""),o(!0),window.setTimeout(()=>o(!1),1500)}catch{}}return(0,ey.jsxs)("article",{className:"vtl-agent-event-row group","data-kind":e.kind,children:[e.title?(0,ey.jsx)("div",{className:"vtl-agent-user-message-wrap",children:(0,ey.jsx)("div",{className:"vtl-agent-user-message",children:e.title})}):null,e.attachments&&e.attachments.length>0?(0,ey.jsx)("div",{className:"mt-1.5 flex flex-wrap justify-end gap-2",children:e.attachments.map((e,t)=>(0,ey.jsx)(VJ,{attachment:e},t))}):null,(0,ey.jsx)(VE,{className:(0,eI.cn)("absolute top-1/2 right-2 -translate-y-1/2 transition-opacity","opacity-0 focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100",r&&"opacity-100"),children:(0,ey.jsxs)(bR,{open:r,onOpenChange:a,children:[(0,ey.jsx)(bL,{asChild:!0,children:(0,ey.jsx)(VO,{type:"button","aria-label":t?.more??"更多操作",title:t?.more??"更多操作",children:(0,ey.jsx)(lY,{})})}),(0,ey.jsxs)(bZ,{align:"end",sideOffset:6,className:"min-w-44",children:[l?(0,ey.jsxs)(bJ,{onSelect:()=>n?.(e),children:[(0,ey.jsx)(Vj,{}),(0,ey.jsx)("span",{className:"flex-1",children:t?.recall??"回退对话到此处"})]}):null,(0,ey.jsxs)(bJ,{onSelect:e=>{e.preventDefault(),s()},children:[(0,ey.jsx)(lU,{}),(0,ey.jsx)("span",{className:"flex-1",children:i?"已复制":t?.copy??"复制提示词"})]})]})]})})]})}function V0({event:e,labels:t,showActions:n,deliverable:r,onBranchAssistantMessage:a}){let[i,o]=ew.useState(!1),l=e.detail?`${e.title}
|
|
20
|
+
`).join("\n")}}):null}function Vn({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:i=!1,label:o,labelFormatter:l,labelClassName:s,formatter:c,color:d,nameKey:u,labelKey:f}){let{config:h}=function(){let e=ew.useContext(B9);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}(),m=ew.useMemo(()=>{if(a||!t?.length)return null;let[e]=t,n=`${f??e?.dataKey??e?.name??"value"}`,r=Vr(h,e,n),i=f||"string"!=typeof o?r?.label:h[o]?.label??o;return l?(0,ey.jsx)("div",{className:(0,eI.cn)("font-medium",s),children:l(i,t)}):i?(0,ey.jsx)("div",{className:(0,eI.cn)("font-medium",s),children:i}):null},[o,l,t,a,s,h,f]);if(!e||!t?.length)return null;let p=1===t.length&&"dot"!==r;return(0,ey.jsxs)("div",{className:(0,eI.cn)("vtl-surface-popover grid min-w-32 items-start gap-1.5 rounded-[var(--surface-popover-radius)] border px-2.5 py-1.5 text-xs",n),children:[p?null:m,(0,ey.jsx)("div",{className:"grid gap-1.5",children:t.filter(e=>"none"!==e.type).map((e,t)=>{let n=`${u??e.name??e.dataKey??"value"}`,a=Vr(h,e,n),o=d??e.payload?.fill??e.color;return(0,ey.jsx)("div",{className:(0,eI.cn)("flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground","dot"===r&&"items-center"),children:c&&e?.value!==void 0&&e.name?c(e.value,e.name,e,t,e.payload):(0,ey.jsxs)(ey.Fragment,{children:[a?.icon?(0,ey.jsx)(a.icon,{}):!i&&(0,ey.jsx)("div",{className:(0,eI.cn)("shrink-0 rounded-[2px]","dot"===r&&"size-2.5","line"===r&&"w-1","dashed"===r&&"w-0 border-[1.5px] border-dashed bg-transparent",p&&"dashed"===r&&"my-0.5"),style:{backgroundColor:"dashed"===r?"transparent":o,borderColor:o}}),(0,ey.jsxs)("div",{className:(0,eI.cn)("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[(0,ey.jsxs)("div",{className:"grid gap-1.5",children:[p?m:null,(0,ey.jsx)("span",{className:"text-muted-foreground",children:a?.label??e.name})]}),null!=e.value&&(0,ey.jsx)("span",{className:"font-mono font-medium text-foreground tabular-nums",children:"number"==typeof e.value?e.value.toLocaleString():String(e.value)})]})]})},t)})})]})}function Vr(e,t,n){if("object"!=typeof t||null===t)return;let r="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0,a=n;return n in t&&"string"==typeof t[n]?a=t[n]:r&&n in r&&"string"==typeof r[n]&&(a=r[n]),a in e?e[a]:e[n]}let Va={placeholder:"Ask the agent to inspect, change, or explain this workspace...",mode:"Mode",model:"Model",attach:"Attach context",removeChip:"Remove context",removeAttachment:"Remove attachment",queuedMessage:"Queued message",guideQueuedMessage:"Guide",removeQueuedMessage:"Remove queued message",moreQueuedMessageActions:"More queued message actions",contextUsage:"Context usage",contextUsed:"used",contextTokenSummary:"used {used} / {total}",toolCalls:"Tool calls",userMessages:"User messages",otherContext:"Other context",compressContext:"Compress context",compressPrecise:"Precise",compressExtreme:"Extreme",send:"Run",stop:"Stop"},Vi=[{id:"agent",label:"Agent",description:"Use tools and make changes.",icon:(0,ey.jsx)(bC,{className:"fill-current"})},{id:"planner",label:"Planner",description:"Plan before changing files.",icon:(0,ey.jsx)(jT,{})},{id:"reviewer",label:"Reviewer",description:"Inspect risks and regressions.",icon:(0,ey.jsx)(ub,{})}],Vo=[{id:"acceptEdits",label:"Accept edits",description:"Auto-approve edits, ask for risky commands.",icon:(0,ey.jsx)(mZ,{})},{id:"ask",label:"Ask permissions",description:"Ask before any tool action.",icon:(0,ey.jsx)(jz,{})},{id:"auto",label:"Auto mode",description:"Auto-approve all except dangerous.",icon:(0,ey.jsx)(jR,{})}],Vl=[{id:"gpt-5.5",label:"GPT-5.5",description:"Highest quality coding agent."},{id:"gpt-5.4",label:"GPT-5.4",description:"Balanced everyday work."},{id:"gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Fast lightweight passes."}];function Vs(e){if(e)return"string"==typeof e.label||"number"==typeof e.label?String(e.label):e.id}function Vc({value:e,defaultValue:t,onValueChange:n,modes:r=Vi,modeId:a,defaultModeId:i,onModeChange:o,permissionModes:l=Vo,permissionModeId:s,defaultPermissionModeId:c,onPermissionModeChange:d,models:u=Vl,modelId:f,defaultModelId:h,onModelChange:m,queuedMessages:p,defaultQueuedMessages:g=[],onQueuedMessagesChange:v,onQueueMessage:x,onRemoveQueuedMessage:y,queueOnTab:b=!0,renderQueuedMessageActions:w,contextUsage:j,chips:k=[],attachments:S=[],onAttachmentsChange:N,actions:C,footer:M,running:E=!1,disabled:O=!1,submitOnEnter:P=!0,promptHistory:A,minRows:I=2,maxRows:z=7,onSubmit:T,onStop:D,onAttach:R,onNudge:_,labels:L,className:$,textareaClassName:F,toolbarClassName:B}){let V,H,U={...Va,...L},W=ew.useRef(null),q=ew.useId(),K=ew.useRef(0),[G,X]=function({value:e,defaultValue:t="",onChange:n}){let[r,a]=ew.useState(t);return[e??r,ew.useCallback(t=>{void 0===e&&a(t),n?.(t)},[n,e])]}({value:e,defaultValue:t,onChange:n}),Y=A??[],[Z,J]=ew.useState(null),Q=ew.useRef(""),ee=ew.useRef(!1);ew.useEffect(()=>{J(null),ee.current=!1},[A]);let et=ew.useCallback(e=>{ee.current=!0,X(e);let t=W.current;t&&requestAnimationFrame(()=>{let e=t.value.length;t.setSelectionRange(e,e)})},[X]),[en,er]=ew.useState(g),[ea,ei]=ew.useState(i??r[0]?.id),[eo,el]=ew.useState(c??l[0]?.id),[es,ec]=ew.useState(h??u[0]?.id),ed=a??ea,eu=s??eo,ef=f??es,eh=r.find(e=>e.id===ed)??r[0],em=l.find(e=>e.id===eu)??l[0],ep=u.find(e=>e.id===ef)??u[0],eg=p??en,ev=(G.trim().length>0||S.length>0)&&!O;function ex(){ev&&(T?.({value:G,modeId:eh?.id,modelId:ep?.id,attachments:S.length>0?S:void 0}),J(null),ee.current=!1,Q.current="",X(""),S.length>0&&N?.([]))}async function eb(e){if(0===e.length||!N)return;let t=[];for(let n of e){let e=`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;if(n.type.startsWith("image/")){let r=await function(e){return new Promise(t=>{let n=new FileReader;n.onload=()=>t("string"==typeof n.result?n.result:""),n.onerror=()=>t(""),n.readAsDataURL(e)})}(n);if(!r)continue;t.push({id:e,kind:"image",name:n.name||"image.png",mimeType:n.type||"image/png",dataUrl:r,size:n.size})}else{let r=await function(e){return new Promise(t=>{let n=new FileReader;n.onload=()=>t("string"==typeof n.result?n.result:""),n.onerror=()=>t(""),n.readAsText(e)})}(n),a=(n.name.split(".").pop()??"").toLowerCase();t.push({id:e,kind:"file",name:n.name||"file.txt",mimeType:n.type||"text/plain",text:r,ext:a,size:n.size})}}t.length>0&&N([...S,...t])}function ej(e){void 0===p&&er(e),v?.(e)}function ek(){let e=G.trim();if(!e||O)return!1;K.current+=1;let t={id:`${q}-queued-${K.current}`,content:e},n=[...eg,t];return ej(n),x?.(t,n),X(""),!0}return ew.useLayoutEffect(()=>{let e=W.current;if(!e)return;e.style.height="0px";let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)?t*z:160;e.style.height=`${Math.min(e.scrollHeight,n)}px`,e.style.overflowY=e.scrollHeight>n?"auto":"hidden"},[z,G]),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer","data-running":E,className:(0,eI.cn)("relative grid w-full",$),children:[eg.length>0&&(0,ey.jsx)(Vf,{messages:eg,labels:U,renderActions:w,onRemove:function(e){let t=eg.find(t=>t.id===e);if(!t)return;let n=eg.filter(t=>t.id!==e);ej(n),y?.(e,t,n)},onNudge:_,running:E}),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-surface",className:(0,eI.cn)("vtl-agent-input-composer-surface relative grid w-full gap-2 rounded-lg border border-border p-2 shadow-sm transition-colors"),children:[k.length>0&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-context",className:"flex min-w-0 flex-wrap items-center gap-1.5",children:k.map(e=>(0,ey.jsx)(Vm,{chip:e,removeLabel:U.removeChip},e.id))}),S.length>0&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-attachments",className:"flex min-w-0 flex-wrap items-center gap-2",children:S.map(e=>(0,ey.jsx)(Vh,{attachment:e,removeLabel:U.removeAttachment,onRemove:()=>N?.(S.filter(t=>t.id!==e.id))},e.id))}),(0,ey.jsx)("textarea",{ref:W,value:G,disabled:O,rows:I,placeholder:U.placeholder,"data-slot":"agent-input-composer-textarea",className:(0,eI.cn)("min-h-10 w-full resize-none border-0 bg-transparent px-0.5 py-0 text-sm leading-5 text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",F),onChange:e=>{var t;return t=e.currentTarget.value,void(!ee.current&&null!==Z&&J(null),ee.current=!1,X(t))},onPaste:function(e){let t=Array.from(e.clipboardData?.files??[]);0!==t.length&&N&&(e.preventDefault(),eb(t))},onKeyDown:e=>{Y.length>0&&e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&!e.nativeEvent.isComposing&&function(e){if(0===Y.length)return!1;if("older"===e){if(null===Z){Q.current=G;let e=Y.length-1;return J(e),et(Y[e]??""),!0}if(Z<=0)return!0;let e=Z-1;return J(e),et(Y[e]??""),!0}if(null===Z)return!1;let t=Z+1;return t>=Y.length?(J(null),ee.current=!1,et(Q.current),ee.current=!1):(J(t),et(Y[t]??"")),!0}("ArrowUp"===e.key?"older":"newer")?e.preventDefault():b&&"Tab"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&ek()?e.preventDefault():!P||"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),E?ek():ex())}}),(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-toolbar",className:(0,eI.cn)("grid grid-cols-[minmax(0,1fr)_auto] items-end gap-2",B),children:[(0,ey.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,ey.jsx)(Vp,{label:"Permissions",options:l,value:em?.id,trigger:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)("span",{className:"grid size-3.5 place-items-center text-muted-foreground [&_svg]:size-3",children:em?.icon??(0,ey.jsx)(jz,{})}),(0,ey.jsx)("span",{className:"hidden truncate md:inline",children:Vs(em)}),(0,ey.jsx)(vu,{className:"size-3 text-muted-foreground"})]}),triggerClassName:"rounded-md bg-transparent px-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/70",onSelect:function(e){e.disabled||(void 0===s&&el(e.id),d?.(e.id,e))}}),(0,ey.jsx)(Vp,{label:U.model,options:u,value:ep?.id,trigger:(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)("span",{className:"grid size-3.5 place-items-center text-muted-foreground [&_svg]:size-3 md:hidden",children:(0,ey.jsx)(jT,{})}),(0,ey.jsx)("span",{className:"hidden truncate md:inline",children:Vs(ep)}),(0,ey.jsx)(vu,{className:"size-3 text-muted-foreground"})]}),triggerClassName:"rounded-md bg-transparent px-1.5 text-muted-foreground hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/70",onSelect:function(e){e.disabled||(void 0===f&&ec(e.id),m?.(e.id,e))}}),R&&(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"text-muted-foreground","aria-label":U.attach,title:U.attach,onClick:R,disabled:O,children:(0,ey.jsx)(jI,{})}),C]}),(0,ey.jsxs)("div",{className:"flex items-center gap-1",children:[j&&(0,ey.jsx)(Vu,{usage:j,labels:U}),(V=G.trim().length>0,H=E&&!V,(0,ey.jsx)(eA.Button,{type:"button",size:"icon-xs",variant:H?"outline":"default","aria-label":H?U.stop:U.send,title:H?U.stop:U.send,disabled:!E&&!ev,className:"rounded-full",onClick:H?D:E?()=>ek():ex,children:H?(0,ey.jsx)(jD,{className:"size-3 fill-current"}):(0,ey.jsx)(jP,{className:"size-3.5"})}))]})]}),M&&(0,ey.jsx)("div",{"data-slot":"agent-input-composer-footer",className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:M})]})]})}function Vd(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${Math.round(e/1e3)}k`:e.toLocaleString()}function Vu({usage:e,labels:t}){let[n,r]=ew.useState(!1),a=Math.max(0,e.used),i=Math.max(0,e.total),o=i>0?Math.min(100,Math.round(a/i*100)):0,l=Math.max(0,e.toolCalls),s=Math.max(0,e.userMessages),c=Math.max(0,e.other??Math.max(0,a-l-s)),d=[{name:"toolCalls",value:l,fill:"var(--color-toolCalls)"},{name:"userMessages",value:s,fill:"var(--color-userMessages)"},{name:"other",value:c,fill:"var(--color-other)"},{name:"unused",value:Math.max(0,i-a),fill:"var(--muted)"}].filter(e=>e.value>0),u=t.contextTokenSummary.replace("{used}",Vd(a)).replace("{total}",Vd(i)),f={toolCalls:{label:t.toolCalls,color:"var(--chart-1)"},userMessages:{label:t.userMessages,color:"var(--chart-3)"},other:{label:t.otherContext,color:"var(--chart-5)"}};return(0,ey.jsxs)(xO,{children:[(0,ey.jsx)(xz,{asChild:!0,children:(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"text-muted-foreground","aria-label":`${t.contextUsage}: ${o}% ${t.contextUsed}`,title:`${t.contextUsage}: ${o}% ${t.contextUsed}`,children:(0,ey.jsx)("span",{"aria-hidden":"true",className:"grid size-4 place-items-center rounded-full",style:{background:`conic-gradient(var(--foreground) ${3.6*o}deg, var(--border) 0deg)`},children:(0,ey.jsx)("span",{className:"size-3 rounded-full bg-background dark:bg-popover"})})})}),(0,ey.jsxs)(xq,{side:"top",align:"center",sideOffset:8,className:"w-44 gap-2 p-3",children:[(0,ey.jsxs)("div",{className:"grid gap-0.5 text-center",children:[(0,ey.jsx)("div",{className:"text-sm font-medium text-muted-foreground",children:e.label??t.contextUsage}),(0,ey.jsxs)("div",{className:"text-sm text-muted-foreground",children:[o,"% ",t.contextUsed]}),(0,ey.jsx)("div",{className:"text-sm font-medium",children:u})]}),(0,ey.jsx)("div",{className:"grid justify-center",children:(0,ey.jsx)(Ve,{config:f,className:"h-20 w-20",initialDimension:{width:80,height:80},onMouseMove:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,ey.jsxs)(Bo,{children:[(0,ey.jsx)(BU,{active:n,content:(0,ey.jsx)(Vn,{hideLabel:!0})}),(0,ey.jsx)(LN,{data:d.length>0?d:[{name:"other",value:1,fill:"var(--muted)"}],dataKey:"value",nameKey:"name",innerRadius:25,outerRadius:35,isAnimationActive:!1,strokeWidth:0})]})})}),e.onCompressPrecise||e.onCompressExtreme?(0,ey.jsxs)("div",{className:"flex w-full overflow-hidden rounded-md border",children:[(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"sm",className:"flex-1 rounded-none border-r text-xs font-medium",onClick:e.onCompressPrecise,disabled:e.compressing||!e.onCompressPrecise,children:e.compressing?"…":t.compressPrecise??"精确"}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"sm",className:"flex-1 rounded-none text-xs font-medium",onClick:e.onCompressExtreme,disabled:e.compressing||!e.onCompressExtreme,children:e.compressing?"…":t.compressExtreme??"极致"})]}):(0,ey.jsx)(eA.Button,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:e.onCompress,disabled:!e.onCompress,children:t.compressContext})]})]})}function Vf({messages:e,labels:t,renderActions:n,onRemove:r,onNudge:a,running:i}){return(0,ey.jsx)("div",{"data-slot":"agent-input-composer-queue",className:"vtl-agent-input-composer-queue z-10 mx-5 mb-[-1px] grid gap-1.5 rounded-t-lg rounded-b-none border border-border p-1.5 shadow-xs",children:e.map((e,o)=>(0,ey.jsxs)("div",{"data-slot":"agent-input-composer-queue-item",className:(0,eI.cn)("group/queue flex min-h-8 min-w-0 items-center gap-2 rounded-md px-2 text-sm transition-colors",e.disabled?"text-muted-foreground opacity-60":"text-foreground hover:bg-muted/60"),children:[(0,ey.jsx)("span",{className:"grid size-4 shrink-0 place-items-center text-muted-foreground [&_svg]:size-3.5",children:e.icon??(0,ey.jsx)(jA,{})}),(0,ey.jsx)("span",{className:"min-w-0 flex-1 truncate",title:String(e.content),children:e.content}),e.meta&&(0,ey.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.meta}),(0,ey.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-70 transition-opacity group-hover/queue:opacity-100",children:[n?.(e),i&&a&&(0,ey.jsxs)(eA.Button,{type:"button",variant:"ghost",size:"xs",className:"h-6 gap-1 px-1.5 text-muted-foreground","aria-label":`${t.guideQueuedMessage} ${o+1}`,onClick:()=>a(e.id),children:[(0,ey.jsx)(jA,{className:"size-3.5"}),t.guideQueuedMessage]}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"size-6 text-muted-foreground","aria-label":`${t.removeQueuedMessage} ${o+1}`,onClick:()=>r(e.id),children:(0,ey.jsx)(yi,{})}),(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"icon-xs",className:"size-6 text-muted-foreground","aria-label":`${t.moreQueuedMessageActions} ${o+1}`,children:(0,ey.jsx)(lY,{})})]})]},e.id))})}function Vh({attachment:e,removeLabel:t,onRemove:n}){return(0,ey.jsxs)("div",{"data-slot":"agent-input-attachment",className:"group/att relative size-14 shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",title:e.name,children:["image"===e.kind&&e.dataUrl?(0,ey.jsx)("img",{src:e.dataUrl,alt:e.name,className:"size-full object-cover"}):(0,ey.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-1 px-1 text-center",children:[(0,ey.jsx)(uC,{className:"size-4 text-muted-foreground"}),(0,ey.jsx)("span",{className:"w-full truncate text-[10px] font-semibold uppercase text-muted-foreground",children:e.ext?`.${e.ext}`:"TXT"})]}),(0,ey.jsx)("button",{type:"button","aria-label":t,title:t,onClick:n,className:"absolute right-0.5 top-0.5 grid size-4 place-items-center rounded-full bg-background/85 text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/att:opacity-100",children:(0,ey.jsx)(fg.XIcon,{className:"size-3"})})]})}function Vm({chip:e,removeLabel:t}){return(0,ey.jsxs)(Bs,{variant:"secondary","data-tone":e.tone,className:(0,eI.cn)("h-6 max-w-full gap-1 rounded-md border border-border bg-muted/70 px-1.5 text-muted-foreground","success"===e.tone&&"border-primary/25 bg-primary/10 text-foreground","warning"===e.tone&&"border-destructive/25 bg-destructive/10 text-foreground"),children:[e.icon&&(0,ey.jsx)("span",{className:"grid size-3.5 shrink-0 place-items-center [&_svg]:size-3",children:e.icon}),(0,ey.jsx)("span",{className:"truncate",children:e.label}),e.onRemove&&(0,ey.jsx)("button",{type:"button",className:"-mr-0.5 grid size-4 shrink-0 place-items-center rounded-sm text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none","aria-label":`${t} ${e.id}`,onClick:()=>e.onRemove?.(e.id),children:(0,ey.jsx)(fg.XIcon,{className:"size-3"})})]})}function Vp({label:e,options:t,value:n,trigger:r,triggerClassName:a,onSelect:i}){return(0,ey.jsxs)(bR,{children:[(0,ey.jsx)(bL,{asChild:!0,children:(0,ey.jsx)(eA.Button,{type:"button",variant:"ghost",size:"xs",className:(0,eI.cn)("h-6 max-w-40 gap-1 rounded-md px-1.5 text-xs font-medium",a),children:r})}),(0,ey.jsx)(bZ,{align:"start","aria-label":"string"==typeof e?e:void 0,className:"min-w-40 p-1",children:t.map(e=>(0,ey.jsxs)(bJ,{disabled:e.disabled,className:"h-8 gap-2 px-2 text-sm",onSelect:()=>i(e),children:[(0,ey.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),(0,ey.jsx)(mZ,{className:(0,eI.cn)("ml-auto size-4 text-foreground",n===e.id?"opacity-100":"opacity-0")})]},e.id))})]})}function Vg(e,t,n,r){return[{id:`${t}-task-${e}`,kind:"user",title:n},...r.map(n=>({...n,id:`${t}-${n.id}-${e}`}))]}function Vv(e){return[{id:`read-materials-${e}`,kind:"read",actionLabel:"读取",title:"AgentWorkspace.tsx, styles.css, i18n.json",files:[{id:`workspace-${e}`,name:"AgentWorkspace.tsx",lines:"1-480"},{id:`styles-${e}`,name:"styles.css",lines:"265-820"},{id:`i18n-${e}`,name:"i18n.json",lines:"245-292"}]},{id:`search-actions-${e}`,kind:"search",actionLabel:"搜索",title:"workspace creation, sidebar tree, streaming output",files:[{id:`workspace-search-${e}`,name:"AgentWorkspace.tsx",lines:"64-190"},{id:`style-search-a-${e}`,name:"styles.css",lines:"540-670"},{id:`style-search-b-${e}`,name:"styles.css",lines:"705-790"}]},{id:`subagents-${e}`,kind:"subagent",actionLabel:"召唤",title:"子代理",subagents:[{id:`reader-${e}`,title:"阅读子代理",activity:"阅读 package.json",toolActivities:["读取 package.json","检查 workspace 脚本","整理依赖信息"],status:"阅读 package.json",detail:"package.json 已读取,正在整理脚本与依赖信息。",isRunning:!0,events:Vg(e,"reader","阅读 package.json",[{id:"read-package",kind:"read",actionLabel:"读取",title:"package.json",files:[{id:"package-json",name:"package.json",lines:"1-96"}]},{id:"reader-note",kind:"done",title:"已读取 package.json。\n\n- 已记录 workspace 脚本\n- 已检查 UI 与 app 包依赖\n- 下一步等待主代理合并上下文"}])},{id:`searcher-${e}`,title:"搜索子代理",activity:"搜索 AgentWorkspace.tsx",toolActivities:["搜索 AgentWorkspace.tsx","筛选面板布局","定位事件流接入"],status:"搜索 AgentWorkspace.tsx",detail:"AgentWorkspace.tsx 命中 3 处候选区域,正在筛选可复用结构。",isRunning:!0,events:Vg(e,"searcher","搜索 AgentWorkspace.tsx",[{id:"search-workspace",kind:"search",actionLabel:"搜索",title:"AgentWorkspace.tsx",files:[{id:"agent-workspace-a",name:"AgentWorkspace.tsx",lines:"64-190"},{id:"agent-workspace-b",name:"AgentWorkspace.tsx",lines:"320-418"}]},{id:"searcher-note",kind:"done",title:"已定位 AgentWorkspace.tsx 的面板布局与事件流接入位置。"}])},{id:`verifier-${e}`,title:"验证子代理",activity:"验证工作流状态",toolActivities:["验证对话流","验证右侧面板","检查子代理切换"],status:"验证工作流状态",detail:"工作流状态正在校验,等待主代理提交最终结果。",isRunning:!0,events:Vg(e,"verifier","验证工作流状态",[{id:"verify-flow",kind:"verify",actionLabel:"验证",title:"对话流、右侧面板、子代理切换"},{id:"verifier-note",kind:"done",title:"验证队列已建立,等待主代理继续写入真实结果。"}])}]},{id:`think-structure-${e}`,kind:"thought",actionLabel:"思考",title:"8s",status:"done"},{id:`plan-${e}`,kind:"done",title:"**收到新的编织请求。**\n\n我会先保留当前工作台样式,只用占位文本演示真实任务流:读取、搜索、思考、编辑和验证都会按顺序进入同一条文字流。\n\n- 左侧织布机由真实创建动作产生\n- 编织物初始保持为空\n- 文件读取项仍然可以展开\n- 点击文件名会继续打开右侧标签页"},{id:`edit-workspace-${e}`,kind:"change",actionLabel:"编辑",title:"AgentWorkspace.tsx",additions:44,deletions:16},{id:`edit-style-${e}`,kind:"change",actionLabel:"编辑",title:"styles.css",additions:36,deletions:12},{id:`verify-flow-${e}`,kind:"verify",actionLabel:"验证",title:"empty sidebar, new loom creation, placeholder workflow"},{id:`done-${e}`,kind:"done",title:"演示工作流已完成。\n\n这只是前端占位演示,后续可以直接把事件流替换成真实 agent runtime。"}]}let Vx=[{id:"user-1",kind:"user",title:"345"},...Vv("1"),{id:"user-2",kind:"user",title:"234"}],Vy=(0,ek.default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Vb=(0,ek.default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),Vw=(0,ek.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),Vj=(0,ek.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);(0,ek.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);let Vk=(0,l2.cva)("vtl-dot-matrix-loader",{variants:{size:{xs:"[--vtl-dot-size:3px] [--vtl-dot-gap:3px]",sm:"[--vtl-dot-size:3.5px] [--vtl-dot-gap:3.5px]",default:"[--vtl-dot-size:4px] [--vtl-dot-gap:4px]",lg:"[--vtl-dot-size:5px] [--vtl-dot-gap:5px]",xl:"[--vtl-dot-size:6px] [--vtl-dot-gap:6px]"},tone:{default:"text-current",muted:"text-muted-foreground",primary:"text-primary",inverse:"text-primary-foreground",destructive:"text-destructive"},variant:{pulse:"vtl-dot-matrix-loader-pulse",wave:"vtl-dot-matrix-loader-wave",orbit:"vtl-dot-matrix-loader-orbit",binary:"vtl-dot-matrix-loader-binary"}},defaultVariants:{size:"default",tone:"default",variant:"pulse"}}),VS={pulse:[0,90,180,270,360,450,540,630,720],wave:[0,80,160,80,160,240,160,240,320],orbit:[0,130,260,910,1040,390,780,650,520],binary:[0,210,420,630,140,350,560,70,280]};function VN({className:e,size:t,tone:n,variant:r,animated:a=!0,speed:i=1,style:o,"aria-label":l="Loading",...s}){let c=Math.round(1120/(Number.isFinite(i)&&i>0?i:1)),d=VS[r??"pulse"];return(0,ey.jsx)("span",{role:"status","aria-label":l,"data-animated":a?"true":"false",className:(0,eI.cn)(Vk({size:t,tone:n,variant:r}),e),style:{"--vtl-dot-duration":`${c}ms`,...o},...s,children:Array.from({length:9},(e,t)=>(0,ey.jsx)("span",{"aria-hidden":"true",className:"vtl-dot-matrix-loader-dot",style:{"--vtl-dot-delay":`${d[t]}ms`}},t))})}let VC=(0,l2.cva)("animate-spin",{variants:{size:{xs:"size-3",sm:"size-3.5",default:"size-4",lg:"size-5",xl:"size-6"},variant:{default:"text-current",muted:"text-muted-foreground",primary:"text-primary"}},defaultVariants:{size:"default",variant:"default"}});function VM({className:e,size:t,variant:n,...r}){return(0,ey.jsx)(eM,{role:"status","aria-label":"Loading",className:(0,eI.cn)(VC({size:t,variant:n}),e),...r})}function VE({className:e,...t}){return(0,ey.jsx)("div",{"data-slot":"agent-message-actions",className:(0,eI.cn)("flex items-center gap-1.5 text-muted-foreground",e),...t})}function VO({className:e,...t}){return(0,ey.jsx)(eA.Button,{size:"icon-xs",variant:"ghost",className:e,...t})}function VP({mode:e,label:t,retryAttempt:n,retryMax:r,errorDetail:a,className:i}){let o="retry"===e,l=o?`正在进行重试...(${n??1}/${r??1})`:t??"正在处理中",[s,c]=ew.useState(!1),d=ew.useRef(void 0);ew.useEffect(()=>()=>{void 0!==d.current&&window.clearTimeout(d.current)},[]);let u=ew.useCallback(()=>{let e=(a??"").trim();e&&("u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText?navigator.clipboard.writeText(e):new Promise((t,n)=>{try{let n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch(e){n(e)}})).then(()=>{c(!0),void 0!==d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!1),1800)}).catch(()=>{})},[a]),f=o&&!!(a??"").trim();return(0,ey.jsxs)("div",{"data-slot":"conversation-status-tail","aria-live":"polite",className:(0,eI.cn)("flex items-center gap-2 text-sm leading-6",o?"text-destructive":"text-muted-foreground",i),children:[(0,ey.jsx)(VN,{variant:"wave",tone:o?"destructive":"muted",style:{"--vtl-dot-size":"0.2em","--vtl-dot-gap":"0.2em"},"aria-label":l}),(0,ey.jsx)("span",{children:l}),f?(0,ey.jsxs)("button",{type:"button",onClick:u,title:"复制完整报错信息",className:"cursor-pointer rounded text-destructive/80 underline decoration-dotted underline-offset-2 transition-colors hover:text-destructive",children:["(",s?"已复制":"点击复制报错信息",")"]}):null]})}function VA(e){return e.replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)?|\x1b\[[?!>]?[\d;]*[a-zA-Z~]|\x9b[?!>]?[\d;]*[a-zA-Z~]|\x1b[()#][A-Z0-9]|\x1b[A-Z=><78]|\r/gi,"").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\x80-\x9f]/g,"")}let VI=[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"];function Vz(e){let t=(e.split(/[?#]/,1)[0]??e).replace(/[\\/]+$/,"").split(/[\\/]/),n=t[t.length-1];return n&&n.trim()?n.trim():e}function VT({src:e,alt:t}){return(0,ey.jsx)("img",{src:e,alt:t,loading:"lazy",className:"vtl-agent-deliverable-image"})}function VD({label:e,target:t,context:n}){let r=n?.classify?.(t)??"url",a=e.trim()||Vz(t);return(0,ey.jsxs)("button",{type:"button",className:"vtl-agent-deliverable-chip",title:t,onClick:()=>n?.onOpen?.({target:t,kind:r,label:a}),children:[(0,ey.jsx)(uC,{className:"vtl-agent-deliverable-chip-icon"}),(0,ey.jsx)("span",{className:"vtl-agent-deliverable-chip-label",children:a}),(0,ey.jsx)("span",{className:"vtl-agent-deliverable-chip-open",children:"打开"})]})}function VR(e,t,n,r,a){if(!t)return;let i=n+t.length;if(r<=n)return void e.push((0,ey.jsx)("span",{className:"vtl-agent-stream-fade-text",children:t},`${a}-fade-${n}`));if(r>=i)return void e.push(t);let o=r-n;e.push(t.slice(0,o)),e.push((0,ey.jsx)("span",{className:"vtl-agent-stream-fade-text",children:t.slice(o)},`${a}-fade-${n}`))}function V_(e,t){let n="!"===e[t]&&"["===e[t+1],r=t+(n?2:1),a=e.indexOf("]",r);if(-1===a||"("!==e[a+1])return null;let i=e.indexOf(")",a+2);if(-1===i)return null;let o=e.slice(r,a),l=e.slice(a+2,i).trim();return l?{isImage:n,label:o,target:l,end:i+1}:null}function VL(e,t=1/0,n){let r=[],a=0;for(;a<e.length;){if("!"===e[a]&&"["===e[a+1]){let t=V_(e,a);if(t){let e=n?.resolveImageSrc?.(t.target)??t.target;r.push((0,ey.jsx)(VT,{src:e,alt:t.label},`img-${a}`)),a=t.end;continue}}if("["===e[a]){let t=V_(e,a);if(t){if(function(e){let t=(e.split(/[?#]/,1)[0]??e).toLowerCase();return!!t.startsWith("data:image/")||VI.some(e=>t.endsWith(e))}(t.target)){let e=n?.resolveImageSrc?.(t.target)??t.target;r.push((0,ey.jsx)(VT,{src:e,alt:t.label||Vz(t.target)},`img-${a}`))}else n?r.push((0,ey.jsx)(VD,{label:t.label,target:t.target,context:n},`chip-${a}`)):r.push((0,ey.jsx)("a",{href:t.target,target:"_blank",rel:"noreferrer noopener",children:t.label||t.target},`link-${a}`));a=t.end;continue}}if(e.startsWith("**",a)){let i=e.indexOf("**",a+2),o=-1===i?e.slice(a+2):e.slice(a+2,i);o.length>0&&r.push((0,ey.jsx)("strong",{children:VL(o,t-a-2,n)},`strong-${a}`)),a=-1===i?e.length:i+2;continue}if("`"===e[a]){let i=e.indexOf("`",a+1),o=-1===i?e.slice(a+1):e.slice(a+1,i);o.length>0&&r.push((0,ey.jsx)("code",{children:VL(o,t-a-1,n)},`code-${a}`)),a=-1===i?e.length:i+1;continue}let i=[e.indexOf("**",a),e.indexOf("`",a),e.indexOf("[",a),e.indexOf("![",a)].filter(e=>e>=0).sort((e,t)=>e-t)[0]??e.length;if(i===a){VR(r,e[a]??"",a,t,`ch-${a}`),a+=1;continue}VR(r,e.slice(a,i),a,t,`text-${a}`),a=i}return r}function V$(e){return/^\s*[-*]\s+/.test(e)}function VF(e){return/^#{1,6}\s+/.test(e.trim())}function VB(e){return/^\s*([-*_])(?:\s*\1){2,}\s*$/.test(e)}function VV(e){return e.includes("|")&&e.trim().split("|").length>=3}function VH(e){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)}function VU(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}let VW=new Map;function Vq({content:e,isStreaming:t=!1,deliverable:n}){let r=function(e){let t=VW.get(e);if(t)return VW.delete(e),VW.set(e,t),t;let n=function(e){let t=e.replace(/\r\n/g,"\n").split("\n"),n=[],r=0;for(let e of t)n.push(r),r+=e.length+1;let a=[],i=0;for(;i<t.length;){let e=t[i]??"",r=e.trim(),o=n[i]??0;if(!r){i+=1;continue}if(r.startsWith("```")){let e=[];for(i+=1;i<t.length&&!(t[i]??"").trim().startsWith("```");)e.push(t[i]??""),i+=1;i<t.length&&(i+=1),a.push({kind:"code",text:e.join("\n"),start:o});continue}if(VB(e)){a.push({kind:"hr",start:o}),i+=1;continue}if(VF(e)){let e=/^(#{1,6})\s+(.+)$/.exec(r),t=e?.[1]??"##";a.push({kind:"heading",depth:t.length,text:e?.[2]??r,start:o}),i+=1;continue}if(VV(e)&&i+1<t.length&&VH(t[i+1]??"")){let n=VU(e),r=[];for(i+=2;i<t.length&&VV(t[i]??"");)r.push(VU(t[i]??"")),i+=1;a.push({kind:"table",headers:n,rows:r,start:o});continue}if(V$(e)){let e=[];for(;i<t.length&&V$(t[i]??"");)e.push({text:(t[i]??"").replace(/^\s*[-*]\s+/,""),start:n[i]??0}),i+=1;a.push({kind:"list",items:e,start:o});continue}let l=[];for(;i<t.length;){let e=t[i]??"",n=t[i+1]??"";if(!e.trim()||e.trim().startsWith("```")||VB(e)||VF(e)||V$(e)||VV(e)&&VH(n))break;l.push(e),i+=1}a.push({kind:"paragraph",lines:l,start:o})}return a}(e);if(VW.set(e,n),VW.size>512){let e=VW.keys().next().value;void 0!==e&&VW.delete(e)}return n}(e),a=t?Math.max(0,e.length-14):1/0;return(0,ey.jsx)("div",{className:"vtl-agent-markdown",children:r.map((e,t)=>{let r=a-e.start;return"code"===e.kind?(0,ey.jsx)("pre",{children:e.text},`block-${t}`):"hr"===e.kind?(0,ey.jsx)("hr",{},`block-${t}`):"heading"===e.kind?e.depth<=2?(0,ey.jsx)("h3",{children:VL(e.text,r,n)},`block-${t}`):(0,ey.jsx)("h4",{children:VL(e.text,r,n)},`block-${t}`):"list"===e.kind?(0,ey.jsx)("ul",{children:e.items.map((e,t)=>(0,ey.jsx)("li",{children:VL(e.text,a-e.start,n)},`${e.text}-${t}`))},`block-${t}`):"table"===e.kind?(0,ey.jsx)("div",{className:"vtl-agent-markdown-table",children:(0,ey.jsxs)("table",{children:[(0,ey.jsx)("thead",{children:(0,ey.jsx)("tr",{children:e.headers.map((e,t)=>(0,ey.jsx)("th",{children:VL(e,r,n)},`${e}-${t}`))})}),(0,ey.jsx)("tbody",{children:e.rows.map((t,a)=>(0,ey.jsx)("tr",{children:e.headers.map((e,i)=>(0,ey.jsx)("td",{children:VL(t[i]??"",r,n)},`cell-${a}-${i}`))},`row-${a}`))})]})},`block-${t}`):(0,ey.jsx)("p",{children:VL(e.lines.map(e=>e.trim()).join(" "),r,n)},`block-${t}`)})})}function VK(e){return("assistant"===e.kind||"done"===e.kind)&&"模型没有返回内容。"===e.title.trim()&&!e.detail?.trim()}function VG(e){return("error"!==e.kind||"retried"!==e.status)&&!VK(e)}let VX=new Set(["thought","read","search","tool","plan","plan-task","plan-compact","browser"]),VY=ew.forwardRef(function({events:e,labels:t,running:n=!1,bottomInset:r=16,className:a,contentClassName:i,hasEarlier:o,loadingEarlier:l,onLoadEarlier:s,onOpenFile:c,deliverable:d,onOpenSubagent:u,onOpenPlan:f,onOpenSpec:h,onRecallUserMessage:m,onBranchAssistantMessage:p,onRetry:g,onApprovalDecision:v,onContinue:x,onActiveEventChange:y,onAtBottomChange:b},w){let j=ew.useRef(null),k=ew.useRef(!0),S=ew.useRef(!0),N=ew.useRef(b);N.current=b;let[C,M]=ew.useState(0),[E,O]=ew.useState(0),[P,A]=ew.useState({}),I=ew.useMemo(()=>e.filter(VG),[e]),z=ew.useMemo(()=>n?function(e){let t;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r){if("user"===r.kind){t=t??r;break}if(void 0===t&&(t=r),"error"===r.kind&&"retried"===r.status)return{mode:"retry",retryAttempt:r.retryAttempt??1,retryMax:r.retryMax??1,errorDetail:(r.detail??r.title??"").trim()};if(("assistant"===r.kind||"done"===r.kind)&&r.isStreaming&&r.title.trim())return null;if(r.isStreaming||"running"===r.status)break}}return{mode:"working",label:function(e){switch(e?.kind){case"thought":return"正在思考中";case"change":return"正在编辑文件";case"subagent":return"正在分发子代理";default:return"正在处理中"}}(t)}}(e):null,[n,e]),T=ew.useMemo(()=>{let e,t=new Set;for(let n of I)"user"===n.kind?(e&&t.add(e),e=void 0):"assistant"!==n.kind&&"done"!==n.kind||VK(n)||(e=n.id);return e&&t.add(e),t},[I]),D=ew.useMemo(()=>(function(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!VX.has(r.kind)){t.push(r),n++;continue}let a=n,i=[];for(;a<e.length&&VX.has(e[a].kind);)i.push(e[a]),a++;a<e.length&&i.length>=2?t.push(function(e){let t=0,n=0,r=0,a=0,i=0;for(let o of e)"thought"===o.kind?a+=1:"read"===o.kind?t+=o.files?.length??1:"search"===o.kind?n+=1:"plan"===o.kind||"plan-task"===o.kind||"plan-compact"===o.kind?i+=1:r+=1;let o=[];a>0&&o.push(`思考 ${a} 次`),t>0&&o.push(`阅读 ${t} 个文件`),n>0&&o.push(`搜索 ${n} 次`),r>0&&o.push(`执行 ${r} 条命令`),i>0&&o.push(`更新计划 ${i} 次`);let l=o.length>0?`已${o.join(",")}`:`已完成 ${e.length} 步操作`;return{id:`toolgroup-${e[0].id}`,kind:"toolgroup",title:l,groupedEvents:e}}(i)):t.push(...i),n=a}return t})(I),[I]);ew.useLayoutEffect(()=>{let e=j.current;if(!e)return;function t(){O(e.clientHeight)}t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let R=ew.useMemo(()=>D.reduce((e,t,n)=>{var r;let a=P[Hv(t,n)]??("toolgroup"===(r=t).kind?30:"user"===r.kind?72:"assistant"===r.kind||"done"===r.kind?Math.max(42,Math.min(260,28+22*Math.ceil((r.title.length+(r.detail?.length??0))/68))):"read"===r.kind||"search"===r.kind||"tool"===r.kind?r.files?.length?28+26*Math.min(r.files.length,5):26:"subagent"===r.kind?r.subagents?.length?6+24*Math.min(r.subagents.length,6):42:"change"===r.kind?Math.max(42,Math.min(180,10+(r.files?.length??1)*43)):"approval"===r.kind?"pending"===r.status?140:72:"limit"===r.kind?80:"error"===r.kind?88:"plan-question"===r.kind||"plan-approval"===r.kind?r.detail?60:30:"plan"===r.kind||"plan-task"===r.kind||"plan-compact"===r.kind||"plan-answer"===r.kind||"plan-decision"===r.kind?28:r.detail?54:26);return e.rows.push({event:t,index:n,offset:e.totalHeight,height:a,autoOpen:("read"===t.kind||"tool"===t.kind)&&!!t.isStreaming||"read"===t.kind&&!D.slice(n+1).some(e=>"read"!==e.kind),showActions:T.has(t.id)}),e.totalHeight+=a,e},{rows:[],totalHeight:0}),[P,D,T]),_=R.rows.filter(e=>e.offset+e.height>=C-360&&e.offset<=C+Math.max(E,520)+360),L=40*!!z,$=R.totalHeight+Math.max(0,r)+L,F=ew.useRef(R.rows);F.current=R.rows,ew.useImperativeHandle(w,()=>({scrollToEvent:e=>{let t=j.current;if(!t)return!1;let n=F.current.find(t=>t.event.id===e);if(!n)return!1;k.current=!1;let r=Math.max(0,n.offset-12);return t.scrollTop=r,M(r),!0},scrollToBottom:()=>{let e=j.current;e&&(k.current=!0,e.scrollTop=e.scrollHeight,M(e.scrollTop),!0!==S.current&&(S.current=!0,N.current?.(!0)))}}),[]);let B=ew.useRef(void 0),V=ew.useCallback(()=>{let e;if(!y)return;let t=j.current;if(!t)return;let n=t.scrollTop+24;for(let t of F.current)if(t.offset<=n)e=t.event.id;else break;!e&&F.current.length>0&&(e=F.current[0].event.id),e!==B.current&&(B.current=e,y(e))},[y]),H=ew.useCallback(()=>{let e=j.current;if(!e)return;let t=e.scrollHeight-e.clientHeight,n=t-e.scrollTop,r=t<=1||n<96;r!==S.current&&(S.current=r,b?.(r))},[b]),U=ew.useRef(void 0),W=ew.useRef(0);ew.useLayoutEffect(()=>{let e=j.current,t=D[0]?.id,n=U.current,r=W.current;if(e&&void 0!==n&&t!==n&&D.some(e=>e.id===n)){let t=R.totalHeight-r;if(t>0){let n=e.scrollTop+t;e.scrollTop=n,M(n)}}U.current=t,W.current=R.totalHeight},[D,R.totalHeight]),ew.useLayoutEffect(()=>{let e=j.current;if(!e||!I.length||!k.current){V(),H();return}e.scrollTop=e.scrollHeight,M(e.scrollTop),V(),H()},[r,I.length,$,E,z,V,H]);let q=ew.useCallback((e,t)=>{A(n=>1>Math.abs((n[e]??0)-t)?n:{...n,[e]:t})},[]);return(0,ey.jsxs)("div",{ref:j,"data-slot":"agent-conversation-flow",className:(0,eI.cn)("min-h-0 flex-1 overflow-auto px-4 pt-4 opacity-100 transition-opacity duration-180 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden select-text [-webkit-touch-callout:default] [-webkit-user-select:text]",a),onScroll:function(){let e=j.current;e&&(k.current=e.scrollHeight-e.scrollTop-e.clientHeight<96,M(e.scrollTop),V(),H())},children:[o?(0,ey.jsx)("div",{className:"mx-auto mb-2 flex w-full max-w-[48rem] justify-center",children:(0,ey.jsx)("button",{type:"button",disabled:l,onClick:()=>s?.(),className:"rounded-full border border-border bg-popover px-3 py-1 text-xs text-muted-foreground shadow-sm transition-colors hover:bg-muted disabled:cursor-default disabled:opacity-60",children:l?"加载中…":"↑ 加载更早的消息"})}):null,(0,ey.jsxs)("div",{className:(0,eI.cn)("relative mx-auto min-h-full w-full max-w-[48rem]",i),style:{height:$},children:[_.map(e=>(0,ey.jsx)(VZ,{event:e.event,rowKey:Hv(e.event,e.index),offset:e.offset,autoOpen:e.autoOpen,showActions:e.showActions,labels:t,deliverable:d,onMeasure:q,onOpenFile:c,onOpenSubagent:u,onOpenPlan:f,onOpenSpec:h,onRecallUserMessage:m,onBranchAssistantMessage:p,onRetry:g,onApprovalDecision:v,onContinue:x},Hv(e.event,e.index))),z?(0,ey.jsx)("div",{className:"absolute inset-x-0 px-1 pt-1",style:{top:R.totalHeight},children:(0,ey.jsx)(VP,{mode:z.mode,label:"working"===z.mode?z.label:void 0,retryAttempt:"retry"===z.mode?z.retryAttempt:void 0,retryMax:"retry"===z.mode?z.retryMax:void 0,errorDetail:"retry"===z.mode?z.errorDetail:void 0})}):null]})]})}),VZ=ew.memo(function({event:e,rowKey:t,offset:n,autoOpen:r,showActions:a,labels:i,deliverable:o,onMeasure:l,onOpenFile:s,onOpenSubagent:c,onOpenPlan:d,onOpenSpec:u,onRecallUserMessage:f,onBranchAssistantMessage:h,onRetry:m,onApprovalDecision:p,onContinue:g}){let v=ew.useRef(null);return ew.useLayoutEffect(()=>{let e=v.current;if(!e)return;function n(){l(t,Math.ceil(e.getBoundingClientRect().height))}n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[e.id,l,t]),(0,ey.jsx)("div",{ref:v,"data-index":e.id,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${n}px)`},children:(0,ey.jsx)(V1,{event:e,autoOpen:r,showActions:a,labels:i,deliverable:o,onOpenFile:s,onOpenSubagent:c,onOpenPlan:d,onOpenSpec:u,onRecallUserMessage:f,onBranchAssistantMessage:h,onRetry:m,onContinue:g,onApprovalDecision:p})})});function VJ({attachment:e}){return(0,ey.jsx)("div",{className:"size-14 shrink-0 overflow-hidden rounded-md border border-border bg-muted/40",title:e.name,children:"image"===e.kind&&e.url?(0,ey.jsx)("img",{src:e.url,alt:e.name,className:"size-full object-cover"}):(0,ey.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-1 px-1 text-center",children:[(0,ey.jsx)(uC,{className:"size-4 text-muted-foreground"}),(0,ey.jsx)("span",{className:"w-full truncate text-[10px] font-semibold uppercase text-muted-foreground",children:e.ext?`.${e.ext}`:"FILE"})]})})}function VQ({event:e,labels:t,onRecallUserMessage:n}){let[r,a]=ew.useState(!1),[i,o]=ew.useState(!1),l=!e.forkInherited&&!!n;async function s(){try{await navigator.clipboard.writeText(e.title??""),o(!0),window.setTimeout(()=>o(!1),1500)}catch{}}return(0,ey.jsxs)("article",{className:"vtl-agent-event-row group","data-kind":e.kind,children:[e.title?(0,ey.jsx)("div",{className:"vtl-agent-user-message-wrap",children:(0,ey.jsx)("div",{className:"vtl-agent-user-message",children:e.title})}):null,e.attachments&&e.attachments.length>0?(0,ey.jsx)("div",{className:"mt-1.5 flex flex-wrap justify-end gap-2",children:e.attachments.map((e,t)=>(0,ey.jsx)(VJ,{attachment:e},t))}):null,(0,ey.jsx)(VE,{className:(0,eI.cn)("absolute top-1/2 right-2 -translate-y-1/2 transition-opacity","opacity-0 focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100",r&&"opacity-100"),children:(0,ey.jsxs)(bR,{open:r,onOpenChange:a,children:[(0,ey.jsx)(bL,{asChild:!0,children:(0,ey.jsx)(VO,{type:"button","aria-label":t?.more??"更多操作",title:t?.more??"更多操作",children:(0,ey.jsx)(lY,{})})}),(0,ey.jsxs)(bZ,{align:"end",sideOffset:6,className:"min-w-44",children:[l?(0,ey.jsxs)(bJ,{onSelect:()=>n?.(e),children:[(0,ey.jsx)(Vj,{}),(0,ey.jsx)("span",{className:"flex-1",children:t?.recall??"回退对话到此处"})]}):null,(0,ey.jsxs)(bJ,{onSelect:e=>{e.preventDefault(),s()},children:[(0,ey.jsx)(lU,{}),(0,ey.jsx)("span",{className:"flex-1",children:i?"已复制":t?.copy??"复制提示词"})]})]})]})})]})}function V0({event:e,labels:t,showActions:n,deliverable:r,onBranchAssistantMessage:a}){let[i,o]=ew.useState(!1),l=e.detail?`${e.title}
|
|
21
21
|
|
|
22
22
|
${e.detail}`:e.title;async function s(){try{await navigator.clipboard.writeText(l??""),o(!0),window.setTimeout(()=>o(!1),1500)}catch{}}return(0,ey.jsxs)("article",{className:"vtl-agent-event-row group","data-kind":e.kind,children:[(0,ey.jsx)("div",{"data-streaming":e.isStreaming?"true":"false",children:(0,ey.jsx)(Vq,{content:l,isStreaming:e.isStreaming,deliverable:r})}),e.isStreaming||!n?null:(0,ey.jsxs)(VE,{className:(0,eI.cn)("mt-0.5 gap-0.5 transition-opacity","opacity-0 focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100"),children:[(0,ey.jsx)(VO,{type:"button","aria-label":t?.copyReply??"复制",title:t?.copyReply??"复制",onClick:()=>void s(),children:i?(0,ey.jsx)(mZ,{}):(0,ey.jsx)(lU,{})}),a?(0,ey.jsx)(VO,{type:"button","aria-label":t?.branch??"从此处分支对话",title:t?.branch??"从此处分支对话",onClick:()=>a?.(e),children:(0,ey.jsx)(Vb,{})}):null]})]})}let V1=ew.memo(function({event:e,autoOpen:t,showActions:n,labels:r,deliverable:a,onOpenFile:i,onOpenSubagent:o,onOpenPlan:l,onOpenSpec:s,onRecallUserMessage:c,onBranchAssistantMessage:d,onRetry:u,onApprovalDecision:f,onContinue:h}){return"approval"===e.kind?(0,ey.jsx)(V4,{event:e,onApprovalDecision:f}):"user"===e.kind?(0,ey.jsx)(VQ,{event:e,labels:r,onRecallUserMessage:c}):"assistant"===e.kind||"done"===e.kind?VK(e)?null:(0,ey.jsx)(V0,{event:e,labels:r,showActions:n,deliverable:a,onBranchAssistantMessage:d}):"toolgroup"===e.kind?(0,ey.jsx)(Hh,{event:e,labels:r,onOpenFile:i,onOpenSubagent:o}):("read"===e.kind||"search"===e.kind||"tool"===e.kind)&&(e.files?.length||e.detail?.trim())?(0,ey.jsx)("article",{className:"vtl-agent-event-row","data-kind":e.kind,children:(0,ey.jsx)(Hm,{event:e,autoOpen:t,children:(0,ey.jsx)(V3,{event:e,onOpenFile:i})})}):"subagent"===e.kind&&e.subagents?.length?(0,ey.jsx)("article",{className:"vtl-agent-event-row","data-kind":e.kind,children:(0,ey.jsx)(Hr,{event:e,onOpenSubagent:o})}):"change"===e.kind?(0,ey.jsx)(Hp,{event:e,onOpenFile:i}):"thought"===e.kind?(0,ey.jsx)(Hf,{event:e,labels:r}):"compression"===e.kind?(0,ey.jsxs)("article",{className:"vtl-agent-event-row","data-kind":"compression",children:[(0,ey.jsxs)("div",{className:"vtl-agent-compression-divider",children:[(0,ey.jsx)("div",{className:"vtl-agent-compression-line"}),(0,ey.jsx)("span",{className:"vtl-agent-compression-label",children:e.title}),(0,ey.jsx)("div",{className:"vtl-agent-compression-line"})]}),e.detail&&(0,ey.jsx)("div",{className:"vtl-agent-compression-detail",children:e.detail})]}):"plan-answer"===e.kind||"plan-decision"===e.kind?(0,ey.jsx)(Hc,{event:e}):"plan"===e.kind||"plan-task"===e.kind||"plan-question"===e.kind||"plan-approval"===e.kind||"plan-compact"===e.kind?(0,ey.jsx)(Hs,{event:e,onOpenPlan:l,onOpenSpec:s}):"browser"===e.kind?(0,ey.jsx)(Hd,{event:e}):"limit"===e.kind?(0,ey.jsx)("article",{className:"vtl-agent-event-row","data-kind":"limit",children:(0,ey.jsxs)("div",{className:"vtl-agent-limit-card",children:[(0,ey.jsx)("span",{className:"vtl-agent-limit-title",children:e.title}),e.detail&&(0,ey.jsx)("span",{className:"vtl-agent-limit-detail",children:e.detail}),h&&(0,ey.jsxs)(eA.Button,{type:"button",size:"sm",variant:"outline",className:"vtl-agent-limit-continue",onClick:h,children:[(0,ey.jsx)(Vw,{className:"mr-1.5 size-3"}),e.actionLabel??"继续"]})]})}):"error"===e.kind?(0,ey.jsx)(Hu,{event:e,onRetry:u}):(0,ey.jsx)(Ho,{event:e})}),V2={safe:{text:"安全",className:"vtl-approval-badge-safe"},normal:{text:"常规",className:"vtl-approval-badge-normal"},risky:{text:"风险",className:"vtl-approval-badge-risky"},dangerous:{text:"危险",className:"vtl-approval-badge-dangerous"}},V5={recursive_deletion:"递归删除",force_flag:"强制覆盖",network_access:"网络访问",system_modification:"系统修改",process_management:"进程管理",pipe_to_interpreter:"管道执行",dynamic_execution:"动态执行",git_destructive:"Git 破坏性操作",env_modification:"环境变量修改",registry_modification:"注册表修改",system_destructive:"系统破坏性",parse_error:"解析错误"};function V4({event:e,onApprovalDecision:t}){let n=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(e.meta),r="pending"===e.status,a="done"===e.status,i="failed"===e.status,o=(n?V2[n.classification]:void 0)??{text:"常规",className:"vtl-approval-badge-normal"};return(0,ey.jsx)("article",{className:"vtl-agent-event-row","data-kind":"approval",children:(0,ey.jsxs)("div",{className:(0,eI.cn)("vtl-approval-card",r&&"vtl-approval-pending",a&&"vtl-approval-approved",i&&"vtl-approval-rejected"),children:[(0,ey.jsxs)("div",{className:"vtl-approval-header",children:[(0,ey.jsx)("span",{className:(0,eI.cn)("vtl-approval-badge",o.className),children:o.text}),(0,ey.jsx)("span",{className:"vtl-approval-label",children:r?"需要确认":a?"已放行":"已拒绝"}),n?.toolName&&(0,ey.jsx)("span",{className:"vtl-approval-tool",children:n.toolName})]}),(0,ey.jsx)("div",{className:"vtl-approval-command",children:(0,ey.jsx)("code",{children:e.title})}),e.detail&&!a&&!i&&(0,ey.jsx)("div",{className:"vtl-approval-reason",children:e.detail}),n?.riskFactors&&n.riskFactors.length>0&&r&&(0,ey.jsx)("div",{className:"vtl-approval-risks",children:n.riskFactors.map(e=>(0,ey.jsx)("span",{className:"vtl-approval-risk-tag",children:V5[e]??e},e))}),(a||i)&&e.detail&&(0,ey.jsx)("div",{className:"vtl-approval-resolved-detail",children:e.detail}),r&&t&&n&&(0,ey.jsxs)("div",{className:"vtl-approval-actions",children:[(0,ey.jsx)("button",{type:"button",className:"vtl-approval-btn vtl-approval-btn-approve",onClick:()=>t(n.approvalId,"approve"),children:"放行"}),(0,ey.jsx)("button",{type:"button",className:"vtl-approval-btn vtl-approval-btn-reject",onClick:()=>t(n.approvalId,"reject"),children:"拒绝"})]})]})})}function V3({event:e,onOpenFile:t}){if(e.shellMeta)return(0,ey.jsx)(V6,{event:e,onOpenFile:t});let n=function(e){var t;let n=e.files?.map((t,n)=>V7(e,t,n))??[],r=e.detail?.trim()&&("read"!==e.kind||e.actionLabel?.trim()==="探索")?VA(e.detail.replace(/\r\n/g,"\n")).trimEnd():"";return r?e.actionLabel?.trim()==="探索"?(t=function(e,t){let n,r,a,i,o=(n=[],r=[],a=[],i=null,t.split("\n").forEach((e,t)=>{let o=e.trim();if(!o)return;if(o.startsWith("hint:"))return void a.push({key:`hint-${t}`,label:o.replace(/^hint:\s*/,""),level:0,kind:"hint"});let l=Math.max(0,Math.floor((e.match(/^ */)?.[0].length??0)/2)),s=/[\\/]$/.test(o),c={key:`detail-${t}-${o}`,label:o.replace(/[\\/]+$/,""),level:l,kind:s?"folder":"file"};if(0===l){i={root:c,children:[]},n.push(i);return}i?i.children.push(c):r.push(c)}),{sections:n,orphans:r,hints:a});if(!o.sections.length&&!o.orphans.length)return[...e,...o.hints];let l=new Set,s=[];return e.forEach(e=>{s.push(e);let t=o.sections.findIndex((t,n)=>!l.has(n)&&V9(t.root.label)===V9(e.label));t>=0&&(l.add(t),s.push(...function(e,t,n){if(!t)return e;let r=[];return e.map(e=>{var a,i;let o,l=Math.max(0,e.level-1);return(r.length=l,r[l]=e.label,"file"!==e.kind)?e:{...e,file:{id:e.key,name:e.label,machineId:n,path:(a=t,i=r.slice(0,l+1),o=a.includes("\\")?"\\":"/",[a.replace(/[\\/]+$/,""),...i.map(e=>e.replace(/^[\\/]+|[\\/]+$/g,""))].filter(Boolean).join(o))}}})}(o.sections[t]?.children??[],e.file?.path,e.file?.machineId)))}),o.sections.forEach((e,t)=>{l.has(t)||s.push(e.root,...e.children)}),s.push(...o.orphans,...o.hints),s}(n,r)).map((e,n)=>{if(e.level<=0)return e;let r=Array.from({length:e.level-1},(e,r)=>He(t,n,r+1));return{...e,branch:{ancestorLines:r,isLast:!He(t,n,e.level)}}}):[...n,...r.split("\n").map((e,t)=>{let n=e.trim();return n?n.startsWith("hint:")?{key:`detail-hint-${t}`,label:n.replace(/^hint:\s*/,""),level:0,kind:"hint"}:{key:`detail-plain-${t}`,label:n,level:Math.max(0,Math.floor((e.match(/^ */)?.[0].length??0)/2)),kind:"plain"}:null}).filter(e=>!!e)]:n}(e);return n.length?(0,ey.jsx)("div",{className:"vtl-agent-tool-result","data-kind":e.actionLabel?.trim()==="探索"?"tree":e.kind,children:n.map(e=>(0,ey.jsx)(V8,{row:e,onOpenFile:t},e.key))}):null}function V6({event:e,onOpenFile:t}){let n=e.shellMeta,r=e.detail?VA(e.detail).trim():void 0,a=e.files?.map((t,n)=>V7(e,t,n))??[],i=ew.useCallback((e,t)=>{t.stopPropagation(),navigator.clipboard?.writeText(e)},[]),o="completed"===n.status||"done"===n.status?"shell-ok":"failed"===n.status||"timeout"===n.status?"shell-err":"shell-run",l=void 0!==n.exitCode&&null!==n.exitCode?0===n.exitCode:void 0;return(0,ey.jsxs)("div",{className:"vtl-agent-tool-result","data-kind":"shell",children:[(0,ey.jsxs)("div",{className:"vtl-shell-status-bar",children:[n.commandId?(0,ey.jsx)("button",{type:"button",className:"vtl-shell-chip",title:`命令 ID: ${n.commandId}
|
|
23
23
|
点击复制`,onClick:e=>i(n.commandId,e),children:n.commandId}):null,n.logId?(0,ey.jsx)("button",{type:"button",className:"vtl-shell-chip",title:`日志 ID: ${n.logId}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
9:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"ViewportBoundary"]
|
|
9
9
|
b:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"MetadataBoundary"]
|
|
10
10
|
d:I[50025,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
11
|
-
:HL["/_next/static/chunks/
|
|
12
|
-
0:{"P":null,"b":"
|
|
11
|
+
:HL["/_next/static/chunks/89fc1d6c73b3a620.css","style"]
|
|
12
|
+
0:{"P":null,"b":"2q9rjqyEgjPOvoNoxFYCx","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/89fc1d6c73b3a620.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/2f05240e9e23a8f9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/83c973dd6794ff6b.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/7dfeab42587bcc0e.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"className":"font-sans antialiased","data-vtl-theme":"default","data-vtl-density":"default","data-vtl-motion":"default","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d","$undefined"],"S":true}
|
|
13
13
|
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
14
14
|
8:null
|
|
15
15
|
c:[["$","title","0",{"children":"Vantaloom"}],["$","meta","1",{"name":"description","content":"Vantaloom local agent operations console."}]]
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
2:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"ViewportBoundary"]
|
|
3
3
|
3:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"MetadataBoundary"]
|
|
4
4
|
4:"$Sreact.suspense"
|
|
5
|
-
0:{"buildId":"
|
|
5
|
+
0:{"buildId":"2q9rjqyEgjPOvoNoxFYCx","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Vantaloom"}],["$","meta","1",{"name":"description","content":"Vantaloom local agent operations console."}]]}]}]}],null]}],"loading":null,"isPartial":false}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
3:I[64990,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"TourProvider"]
|
|
4
4
|
4:I[45121,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
5
5
|
5:I[60512,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
6
|
-
:HL["/_next/static/chunks/
|
|
7
|
-
0:{"buildId":"
|
|
6
|
+
:HL["/_next/static/chunks/89fc1d6c73b3a620.css","style"]
|
|
7
|
+
0:{"buildId":"2q9rjqyEgjPOvoNoxFYCx","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/89fc1d6c73b3a620.css","precedence":"next"}],["$","script","script-0",{"src":"/_next/static/chunks/2f05240e9e23a8f9.js","async":true}],["$","script","script-1",{"src":"/_next/static/chunks/83c973dd6794ff6b.js","async":true}],["$","script","script-2",{"src":"/_next/static/chunks/7dfeab42587bcc0e.js","async":true}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"className":"font-sans antialiased","data-vtl-theme":"default","data-vtl-density":"default","data-vtl-motion":"default","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","template":["$","$L5",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]}]]}],"loading":null,"isPartial":false}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"OutletBoundary"]
|
|
3
3
|
3:"$Sreact.suspense"
|
|
4
|
-
0:{"buildId":"
|
|
4
|
+
0:{"buildId":"2q9rjqyEgjPOvoNoxFYCx","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false}
|
|
5
5
|
4:null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
2
|
2:I[45121,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
3
3
|
3:I[60512,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
4
|
-
0:{"buildId":"
|
|
4
|
+
0:{"buildId":"2q9rjqyEgjPOvoNoxFYCx","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:HL["/_next/static/chunks/
|
|
2
|
-
0:{"buildId":"
|
|
1
|
+
:HL["/_next/static/chunks/89fc1d6c73b3a620.css","style"]
|
|
2
|
+
0:{"buildId":"2q9rjqyEgjPOvoNoxFYCx","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300}
|
package/web/_not-found.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--2q9rjqyEgjPOvoNoxFYCx--><html lang="zh-CN" class="font-sans antialiased" data-vtl-theme="default" data-vtl-density="default" data-vtl-motion="default"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/89fc1d6c73b3a620.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/ccc016f22e340d7a.js"/><script src="/_next/static/chunks/465977caba526416.js" async=""></script><script src="/_next/static/chunks/757e2e1b77b5bacc.js" async=""></script><script src="/_next/static/chunks/turbopack-74ec218a8e8a6a34.js" async=""></script><script src="/_next/static/chunks/2f05240e9e23a8f9.js" async=""></script><script src="/_next/static/chunks/83c973dd6794ff6b.js" async=""></script><script src="/_next/static/chunks/7dfeab42587bcc0e.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Vantaloom</title><meta name="description" content="Vantaloom local agent operations console."/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/ccc016f22e340d7a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[22332,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"ThemeProvider\"]\n3:I[64990,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"TourProvider\"]\n4:I[45121,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n5:I[60512,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n6:I[35417,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[35417,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"ViewportBoundary\"]\nb:I[35417,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"MetadataBoundary\"]\nd:I[50025,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n:HL[\"/_next/static/chunks/89fc1d6c73b3a620.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"2q9rjqyEgjPOvoNoxFYCx\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/89fc1d6c73b3a620.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/83c973dd6794ff6b.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/7dfeab42587bcc0e.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"className\":\"font-sans antialiased\",\"data-vtl-theme\":\"default\",\"data-vtl-density\":\"default\",\"data-vtl-motion\":\"default\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"8:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"Vantaloom\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Vantaloom local agent operations console.\"}]]\n"])</script></body></html>
|
package/web/_not-found.txt
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
9:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"ViewportBoundary"]
|
|
9
9
|
b:I[35417,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"MetadataBoundary"]
|
|
10
10
|
d:I[50025,["/_next/static/chunks/2f05240e9e23a8f9.js","/_next/static/chunks/83c973dd6794ff6b.js","/_next/static/chunks/7dfeab42587bcc0e.js"],"default"]
|
|
11
|
-
:HL["/_next/static/chunks/
|
|
12
|
-
0:{"P":null,"b":"
|
|
11
|
+
:HL["/_next/static/chunks/89fc1d6c73b3a620.css","style"]
|
|
12
|
+
0:{"P":null,"b":"2q9rjqyEgjPOvoNoxFYCx","c":["","_not-found"],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/89fc1d6c73b3a620.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/2f05240e9e23a8f9.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/83c973dd6794ff6b.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/7dfeab42587bcc0e.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"className":"font-sans antialiased","data-vtl-theme":"default","data-vtl-density":"default","data-vtl-motion":"default","children":["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L9",null,{"children":"$La"}],["$","div",null,{"hidden":true,"children":["$","$Lb",null,{"children":["$","$7",null,{"name":"Next.Metadata","children":"$Lc"}]}]}],null]}],false]],"m":"$undefined","G":["$d","$undefined"],"S":true}
|
|
13
13
|
a:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
14
14
|
8:null
|
|
15
15
|
c:[["$","title","0",{"children":"Vantaloom"}],["$","meta","1",{"name":"description","content":"Vantaloom local agent operations console."}]]
|
package/web/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--2q9rjqyEgjPOvoNoxFYCx--><html lang="zh-CN" class="font-sans antialiased" data-vtl-theme="default" data-vtl-density="default" data-vtl-motion="default"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/89fc1d6c73b3a620.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/ccc016f22e340d7a.js"/><script src="/_next/static/chunks/465977caba526416.js" async=""></script><script src="/_next/static/chunks/757e2e1b77b5bacc.js" async=""></script><script src="/_next/static/chunks/turbopack-74ec218a8e8a6a34.js" async=""></script><script src="/_next/static/chunks/2f05240e9e23a8f9.js" async=""></script><script src="/_next/static/chunks/83c973dd6794ff6b.js" async=""></script><script src="/_next/static/chunks/7dfeab42587bcc0e.js" async=""></script><script src="/_next/static/chunks/17e0384154325960.js" async=""></script><script src="/_next/static/chunks/c990601c49cb69a5.js" async=""></script><script src="/_next/static/chunks/f50174c289b30da7.js" async=""></script><script src="/_next/static/chunks/742d3900ca49db0a.js" async=""></script><title>Vantaloom</title><meta name="description" content="Vantaloom local agent operations console."/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><main class="grid min-h-svh place-items-center bg-background"><div class="flex flex-col items-center gap-3"><div class="size-8 animate-spin rounded-full border-2 border-muted-foreground/20 border-t-primary"></div><span class="text-sm text-muted-foreground">连接中...</span></div></main><!--$--><!--/$--><script src="/_next/static/chunks/ccc016f22e340d7a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[22332,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\"],\"ThemeProvider\"]\n3:I[64990,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\"],\"TourProvider\"]\n4:I[45121,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n5:I[60512,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n6:I[66863,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"ClientPageRoot\"]\n7:I[66204,[\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"/_next/static/chunks/83c973dd6794ff6b.js\",\"/_next/static/chunks/17e0384154325960.js\",\"/_next/static/chunks/c990601c49cb69a5.js\",\"/_next/static/chunks/f50174c289b30da7.js\",\"/_next/static/chunks/742d3900ca49db0a.js\"],\"default\"]\na:I[35417,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"OutletBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[35417,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"ViewportBoundary\"]\nf:I[35417,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"MetadataBoundary\"]\n11:I[50025,[\"/_next/static/chunks/7dfeab42587bcc0e.js\"],\"default\"]\n:HL[\"/_next/static/chunks/89fc1d6c73b3a620.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"2q9rjqyEgjPOvoNoxFYCx\",\"c\":[\"\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/89fc1d6c73b3a620.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2f05240e9e23a8f9.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/83c973dd6794ff6b.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"className\":\"font-sans antialiased\",\"data-vtl-theme\":\"default\",\"data-vtl-density\":\"default\",\"data-vtl-motion\":\"default\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L6\",null,{\"Component\":\"$7\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@8\",\"$@9\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/17e0384154325960.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/c990601c49cb69a5.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/f50174c289b30da7.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-3\",{\"src\":\"/_next/static/chunks/742d3900ca49db0a.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$La\",null,{\"children\":[\"$\",\"$b\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@c\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Ld\",null,{\"children\":\"$Le\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lf\",null,{\"children\":[\"$\",\"$b\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L10\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:{}\n9:\"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"e:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:null\n10:[[\"$\",\"title\",\"0\",{\"children\":\"Vantaloom\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Vantaloom local agent operations console.\"}]]\n"])</script></body></html>
|