@inf-monkeys-tech/monkeys-design 2.0.395 → 2.0.396
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/dist/components/agent-ui/index.js +1 -1
- package/dist/components/agent-ui/index.js.map +1 -1
- package/dist/components/agent-ui/index.mjs +1 -1
- package/dist/components/agent-ui/index.mjs.map +1 -1
- package/dist/sources/{2b5602bdc5c948d3e74a6ac1d6db0eb6192a3b9b56392fcb1fa8de9b1816be95.tsx → e348c505638b1f635b6ae8ee14a8a4fefda6201c641e028c87069ecce6f43c36.tsx} +1 -1
- package/package.json +1 -1
|
@@ -264,7 +264,7 @@ void main(){
|
|
|
264
264
|
${e==="red"?"bg-red":"bg-green"}`,style:{animation:"bui-pop-in 300ms cubic-bezier(0.23,1,0.32,1) both"},children:t})}a(np,"Badge");var Ok=jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Hk=jsxRuntime.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})}),Wk=jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6"})}),Fk={completed:"Completed",failed:"Failed"},_k=[];function Qa({variant:e="Capsules",rows:t=_k,labels:o,className:n,onToggleRow:r,progress:i}){let[s,l]=ye.useState({}),d=Ot(Fk,o),c=Ue();if(e==="Progress"&&i){let g=t[i.current-1];if(!g)return null;let b={...g,label:c("taskProgressCurrent",{current:i.current,total:t.length,title:g.label}),status:i.status==="completed"?"done":i.status,step:i.current,details:[]};return jsxRuntime.jsx(op,{progress:i,className:n,capsule:jsxRuntime.jsx(Qa,{variant:"Capsules",rows:[b],labels:o}),children:jsxRuntime.jsx(Qa,{variant:"List",rows:t.map((x,f)=>({...x,step:x.step??f+1})),labels:o})})}let u=a(g=>g.status==="done"?jsxRuntime.jsx(np,{tone:"green",children:Hk}):g.status==="running"?jsxRuntime.jsx(Ls,{active:true,children:g.step}):g.status==="pending"?jsxRuntime.jsx(Ls,{children:g.step}):g.status==="failed"?jsxRuntime.jsx(np,{tone:"red",children:Ok}):jsxRuntime.jsx(Ls,{children:g.step}),"badgeFor"),m=a(g=>g.status==="done"?jsxRuntime.jsx("span",{className:"inline-flex h-5.5 items-center rounded-chip bg-green-tint px-2 text-[11.5px] font-medium text-green",children:d.completed}):g.status==="stopped"||g.status==="skipped"?jsxRuntime.jsx("span",{className:"inline-flex h-5.5 items-center rounded-chip bg-inset px-2 text-[11.5px] font-medium text-ink-2",children:c(`taskProgressStatus.${g.status}`)}):g.status==="running"?null:g.status==="failed"?jsxRuntime.jsxs("span",{className:"inline-flex h-5.5 items-center gap-1.5 rounded-chip bg-red-tint px-2 text-[11.5px] font-medium text-red",style:{animation:"bui-fade-in 200ms ease-out both"},children:[d.failed," ",jsxRuntime.jsx("span",{style:{animation:"bui-spin 1.2s linear infinite"},className:"flex",children:Wk})]}):null,"pillFor"),p=e==="List";return jsxRuntime.jsx(re,{children:jsxRuntime.jsx("div",{"data-bui-task-rows":true,"data-variant":p?"List":"Capsules",role:"list",className:`flex w-full max-w-110 flex-col ${p?"gap-0 self-start overflow-hidden rounded-card bg-surface shadow-card":"min-h-[196px] gap-2"}${n?` ${n}`:""}`,children:t.map((g,b)=>{let x=g.details.length>0,f=x?"button":"div",y=x&&(s[g.key]??false);return jsxRuntime.jsxs("div",{role:"listitem","data-status":g.status,className:`self-stretch overflow-hidden transition-[border-radius,background-color] duration-300 hover:bg-inset ${p?"border-b border-line last:border-0":"bg-surface shadow-card"}`,style:{borderRadius:p?0:"var(--bui-token-radius-card, var(--bui-radius-card))",animation:`bui-fade-up 450ms cubic-bezier(0.23,1,0.32,1) ${b*80}ms both`},children:[jsxRuntime.jsxs(f,{type:x?"button":void 0,"aria-expanded":x?y:void 0,onClick:x?()=>{l(k=>({...k,[g.key]:!y})),r?.(g.key,!y);}:void 0,className:"flex min-h-11 w-full items-center gap-2.5 px-2.5 py-2 text-left",children:[jsxRuntime.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:u(g)}),jsxRuntime.jsx("span",{"data-bui-task-label":true,className:"min-w-0 flex-1 [overflow-wrap:anywhere] text-[13px] font-medium text-ink",children:g.label}),jsxRuntime.jsx("span",{className:"text-[12.5px] text-ink-2 tabular-nums",children:g.amount}),m(g),x&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"-ml-2 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3",children:jsxRuntime.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300",style:{transform:y?"rotate(180deg)":"rotate(0)"},children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})})]}),jsxRuntime.jsx("div",{className:"grid transition-[grid-template-rows,opacity] duration-300",style:{gridTemplateRows:y?"1fr":"0fr",opacity:y?1:0,transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)"},children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsxs("div",{className:"mb-2.5 grid grid-cols-[24px_1fr] gap-2.5 px-2.5",children:[jsxRuntime.jsx("span",{"aria-hidden":true,className:"mx-auto h-full w-px bg-line"}),jsxRuntime.jsx("div",{className:"flex flex-col gap-1.5",children:g.details.map((k,S)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between",style:y?{animation:`bui-fade-up 300ms cubic-bezier(0.23,1,0.32,1) ${120+S*100}ms both`}:void 0,children:[jsxRuntime.jsx("span",{className:"text-[12px] text-ink-2",children:k.label}),jsxRuntime.jsx("span",{className:"font-mono text-[11.5px] text-ink-3 tabular-nums",children:k.meta})]},k.label))})]})})})]},g.key)})})})}a(Qa,"BUITaskRows");function ip({children:e,className:t="",highlightClassName:o="inset-x-0 rounded-[8px] bg-hover",rowSelector:n="[data-menu-row]"}){let r=ye.useRef(null),[i,s]=ye.useState(null),[l,d]=ye.useState(false),c=a(u=>{let m=r.current;if(!(u instanceof Element)||!m)return;let p=u.closest(n);if(!(p instanceof HTMLElement)||!m.contains(p))return;let g=m.getBoundingClientRect(),b=p.getBoundingClientRect();s({top:b.top-g.top,height:b.height}),d(true);},"moveTo");return jsxRuntime.jsx(re,{children:jsxRuntime.jsxs("div",{ref:r,onMouseOver:u=>c(u.target),onMouseLeave:()=>d(false),onFocusCapture:u=>c(u.target),onBlurCapture:u=>{r.current?.contains(u.relatedTarget)||d(false);},className:`group/glide-menu relative ${t}`,children:[jsxRuntime.jsx("span",{"aria-hidden":true,className:`pointer-events-none absolute ${o}`,style:{top:i?.top??0,height:i?.height??0,opacity:i&&l?1:0,transition:"top 220ms cubic-bezier(0.23,1,0.32,1), height 220ms cubic-bezier(0.23,1,0.32,1), opacity 150ms ease"}}),e]})})}a(ip,"BUIGlideMenu");var Gk=[],qk={skip:"Skip",continue:"Continue",send:"Send",customPlaceholder:"Something else\u2026",sentMessage:"Answers sent"},Kk=400,zs="360ms cubic-bezier(0.22, 1, 0.36, 1)";function Xk({value:e}){let t=ye.useRef(e),[o,n]=ye.useState(e),[r,i]=ye.useState(e),[s,l]=ye.useState(false),[d,c]=ye.useState(false),[u,m]=ye.useState("up");ye.useEffect(()=>{if(t.current===e)return;let g=t.current;t.current=e;let b=parseInt(g,10),x=parseInt(e,10);m(Number.isFinite(b)&&Number.isFinite(x)&&x<b?"down":"up"),n(g),i(e),l(true),c(false);let f=0,y=requestAnimationFrame(()=>{f=requestAnimationFrame(()=>c(true));}),k=setTimeout(()=>{l(false),n(e),c(false);},Kk);return ()=>{cancelAnimationFrame(y),cancelAnimationFrame(f),clearTimeout(k);}},[e]);let p=s?r:o;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:p.length},(g,b)=>{let x=o[b]??"",f=p[b]??"";return !s||x===f?jsxRuntime.jsx("span",{children:f},`${b}-${f}`):jsxRuntime.jsx("span",{style:{display:"inline-block",position:"relative",overflow:"hidden",height:"1em",lineHeight:"1em",verticalAlign:"-0.05em"},children:jsxRuntime.jsxs("span",{style:{display:"flex",flexDirection:"column",transition:"transform 350ms cubic-bezier(0.4, 0, 0.2, 1)",transform:`translateY(${d?u==="down"?"0":"-1em":u==="down"?"-1em":"0"})`},children:[jsxRuntime.jsx("span",{style:{height:"1em",lineHeight:"1em"},children:u==="down"?f:x}),jsxRuntime.jsx("span",{style:{height:"1em",lineHeight:"1em"},children:u==="down"?x:f})]})},`${b}-${x}-${f}-${u}`)})})}a(Xk,"RollingDigits");function Os({path:e,size:t=14,sw:o=2}){return jsxRuntime.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true,children:e})}a(Os,"Ico");function Ws({questions:e=Gk,labels:t,onSubmitted:o,onAnswerChange:n,resettable:r=true,allowSkip:i=true,status:s="idle",onReset:l}){let d=Ue(),c=Ot(qk,t),[u,m]=ye.useState(0),[p,g]=ye.useState({}),[b,x]=ye.useState({}),f=s==="submitted",y=ye.useRef(p),k=ye.useRef(b);y.current=p,k.current=b;let[S,w]=ye.useState(true),C=ye.useRef(null),T=ye.useRef([]),$=ye.useRef(false),[P,E]=ye.useState(void 0),[R,W]=ye.useState(0),[B,A]=ye.useState(false),[L,I]=ye.useState(false),K=u===e.length-1,_=(p[u]??[]).length>0||!!b[u]?.trim(),Y=a(V=>{let J=T.current[u];if(!J)return;let O=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;E(J.offsetHeight),W(J.offsetTop),A(V&&!O);},"sync");ye.useLayoutEffect(()=>{let V=$.current;$.current=true,Y(V),I(true);},[u,p,b,S,f]),ye.useEffect(()=>{let V=requestAnimationFrame(()=>Y($.current));return ()=>cancelAnimationFrame(V)},[u]),ye.useEffect(()=>()=>{C.current&&clearTimeout(C.current);},[]);let M=a(V=>{C.current&&clearTimeout(C.current),m(Math.min(Math.max(V,0),e.length-1));},"goTo"),z=a(()=>{C.current&&clearTimeout(C.current),s!=="submitting"&&o?.(y.current,k.current);},"send"),Q=a(()=>{K?z():M(u+1);},"advance"),ce=a(V=>{let J=e[u].type,O=y.current,F=O[u]??[],oe=J==="radio"?[V]:F.includes(V)?F.filter(pe=>pe!==V):[...F,V],ae={...O,[u]:oe};y.current=ae,g(ae),n?.(u,oe),J==="radio"&&(x(pe=>({...pe,[u]:""})),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{K?z():m(pe=>Math.min(e.length-1,pe+1));},480));},"toggle"),se=a(()=>{m(0),g({}),x({}),l?.(),w(true),$.current=false;},"reset");return e.length?S?f?jsxRuntime.jsx(re,{children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-80 items-center gap-3",style:{animation:"bui-pop-in 260ms cubic-bezier(0.23,1,0.32,1) both"},children:[jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-green-tint py-1 pr-2.5 pl-1 text-[12.5px] font-medium text-green",children:[jsxRuntime.jsx("span",{className:"flex size-4.5 items-center justify-center rounded-full bg-green text-white",children:jsxRuntime.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})}),c.sentMessage]}),r&&jsxRuntime.jsx("button",{type:"button",onClick:se,className:"text-[12px] font-medium text-ink-3 transition-colors duration-150 hover:text-ink",children:d("Start over")})]})}):jsxRuntime.jsx(re,{children:jsxRuntime.jsx("div",{className:"w-full max-w-80",children:jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-card bg-surface shadow-card",style:{animation:"bui-fade-up 380ms cubic-bezier(0.23,1,0.32,1) both"},children:[jsxRuntime.jsx("button",{type:"button","aria-label":d("Dismiss"),onClick:()=>w(false),className:"primitive-icon-button absolute right-2.5 top-2.5 z-10 text-ink-3 transition-colors duration-100 hover:bg-hover hover:text-ink",children:jsxRuntime.jsx(Os,{size:14,sw:2.2,path:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),jsxRuntime.jsx("div",{className:"primitive-card-pad",children:jsxRuntime.jsx("div",{className:"overflow-hidden",style:{height:P,transition:B?`height ${zs}`:void 0},"aria-live":"polite",children:jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"calc(var(--bui-spacing) * 6.5)",transform:`translate3d(0, ${-R}px, 0)`,transition:B?`transform ${zs}`:void 0,willChange:"transform"},children:e.map((V,J)=>{let O=J===u;if(!L&&!O)return null;let F=p[J]??[],oe={opacity:O?1:0,transition:B?`opacity ${zs}`:void 0,pointerEvents:O?void 0:"none"};return jsxRuntime.jsxs("div",{ref:ae=>{T.current[J]=ae;},"aria-hidden":O?void 0:true,style:oe,children:[jsxRuntime.jsx("div",{className:"pr-7 text-[14px] font-medium text-ink",children:V.q}),jsxRuntime.jsxs(ip,{className:"mt-2.5 flex flex-col gap-1",highlightClassName:"inset-x-0 rounded-control bg-hover",children:[V.options.map((ae,pe)=>{let Ce=F.includes(pe);return jsxRuntime.jsxs("button",{type:"button","data-menu-row":true,"aria-pressed":Ce,tabIndex:O?0:-1,disabled:s==="submitting",onClick:()=>{O&&ce(pe);},className:"relative z-10 flex items-center gap-1.5 rounded-control pl-1 pr-2 py-1 text-left transition-colors duration-100",children:[jsxRuntime.jsx("span",{className:`flex size-4 shrink-0 items-center justify-center transition-colors duration-200
|
|
265
265
|
${V.type==="radio"?"rounded-full":"rounded-[5px]"}
|
|
266
266
|
${Ce?"bg-ink text-canvas":"shadow-[inset_0_0_0_1.5px_var(--bui-line-strong)] text-transparent"}`,children:V.type==="radio"?jsxRuntime.jsx("span",{className:"size-1.5 rounded-full bg-canvas transition-transform duration-200",style:{transform:Ce?"scale(1)":"scale(0)"}}):jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})}),jsxRuntime.jsx("span",{className:`text-[13px] leading-none transition-colors duration-200 ${Ce?"text-ink":"text-ink-2"}`,children:ae})]},ae)}),V.allowCustom!==false&&jsxRuntime.jsx("label",{"data-menu-row":true,className:"relative z-10 flex items-center gap-1.5 rounded-control pl-1 pr-2 py-1 transition-colors duration-100",children:jsxRuntime.jsx("input",{type:V.customInputType??"text",disabled:s==="submitting",value:b[J]??"",tabIndex:O?0:-1,onChange:ae=>{O&&(x(pe=>({...pe,[J]:ae.target.value})),V.type==="radio"&&g(pe=>({...pe,[J]:[]})));},onKeyDown:ae=>{ae.key==="Enter"&&!ae.nativeEvent.isComposing&&ae.keyCode!==229&&_&&(ae.preventDefault(),Q());},placeholder:c.customPlaceholder,"aria-label":d("Custom answer"),className:"min-w-0 flex-1 bg-transparent pl-1.5 text-[13px] text-ink outline-none placeholder:text-ink-3"})})]})]},J)})})})}),jsxRuntime.jsxs("div",{className:"primitive-card-footer flex items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1 text-ink-3",children:[jsxRuntime.jsx("button",{type:"button","aria-label":d("Previous question"),disabled:u<=0,onClick:()=>M(u-1),className:"flex size-[18px] items-center justify-center rounded-[var(--bui-radius-scale-5)] transition-colors duration-100 enabled:hover:text-ink disabled:opacity-30",children:jsxRuntime.jsx(Os,{size:14,path:jsxRuntime.jsx("path",{d:"M18 15l-6-6-6 6"})})}),jsxRuntime.jsx("span",{className:"inline-flex items-center text-[12px] font-medium tabular-nums text-ink-3",style:{letterSpacing:"-0.1px",lineHeight:1},children:jsxRuntime.jsx(Xk,{value:`${u+1} / ${e.length}`})}),jsxRuntime.jsx("button",{type:"button","aria-label":d("Next question"),disabled:K,onClick:()=>M(u+1),className:"flex size-[18px] items-center justify-center rounded-[var(--bui-radius-scale-5)] transition-colors duration-100 enabled:hover:text-ink disabled:opacity-30",children:jsxRuntime.jsx(Os,{size:14,path:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})})]}),jsxRuntime.jsxs("div",{className:"-mr-0.5 flex items-center gap-1.5",children:[i&&jsxRuntime.jsx(Te,{variant:"ghost",size:"sm",disabled:s==="submitting",onClick:()=>K?w(false):M(u+1),children:c.skip}),jsxRuntime.jsx(Te,{variant:"accent",size:"sm",disabled:!_||s==="submitting",onClick:Q,children:K?c.send:c.continue})]})]})]})})}):jsxRuntime.jsx(re,{children:jsxRuntime.jsx("button",{type:"button",onClick:()=>w(true),className:"rounded-control bg-surface px-3 py-2 text-[12.5px] font-medium text-ink shadow-btn transition-colors duration-150 hover:bg-hover",children:d("Open approval")})}):null}a(Ws,"BUIApprovalCard");function Jk({tone:e}){return jsxRuntime.jsx("span",{className:`flex size-3.5 shrink-0 items-center justify-center rounded-full text-white ${e}`,children:jsxRuntime.jsxs("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M3.5 12h17M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})})}a(Jk,"Dot");var ew=["bg-accent","bg-orange","bg-green"];function lp({variant:e="Steps",onSettled:t,rows:o,active:n,done:r,icon:i,status:s="running",query:l}){let d=Ue(),c=s==="running"?2:4,[u,m]=ye.useState(null),[p,g]=ye.useState(null),b={rows:[],active:d("Thinking"),done:d("Thought complete"),query:l},x={...b,rows:o??b.rows,active:n??b.active,done:r??b.done},f=c>=1&&c<4,y=x.rows.length>0||!!x.query,k=y?"button":"div",S=y&&(u??f),w=c<3,C=c<2?0:x.rows.length,T=ye.useRef(null),[$,P]=ye.useState(0);ye.useLayoutEffect(()=>{T.current&&P(T.current.offsetHeight);},[C,S,e,c]);let E=ye.useRef(false);return ye.useEffect(()=>{if(w){E.current=false;return}E.current||(E.current=true,t?.());},[w,t]),jsxRuntime.jsx(re,{children:jsxRuntime.jsxs("div",{"data-bui-thinking":true,className:"flex w-full max-w-95 flex-col",style:{minHeight:w||S?"var(--bui-activity-min-height, 176px)":void 0,transition:"min-height 400ms cubic-bezier(0.23,1,0.32,1)"},children:[jsxRuntime.jsxs(k,{type:y?"button":void 0,"aria-expanded":y?S:void 0,onClick:y?()=>m(R=>!(R??f)):void 0,className:`-mx-1.5 flex w-fit items-center gap-2 rounded-control px-1.5 py-1
|
|
267
|
-
transition-colors duration-100 hover:bg-hover-2`,children:[i?jsxRuntime.jsx("span",{className:"flex shrink-0 transition-colors duration-200",style:{color:w?"var(--bui-ink-2)":"var(--bui-ink-3)"},children:i}):jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:w?"var(--bui-ink-2)":"var(--bui-ink-3)",children:jsxRuntime.jsx("path",{d:"M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8z"})}),jsxRuntime.jsx("span",{role:"status",className:"contents",children:w?jsxRuntime.jsx("span",{className:"bg-clip-text text-[13px] font-medium whitespace-nowrap text-transparent",style:{backgroundImage:"linear-gradient(90deg, var(--bui-ink-3) 35%, var(--bui-ink) 50%, var(--bui-ink-3) 65%)",backgroundSize:"200% 100%",animation:"bui-shimmer-text 1.4s linear infinite"},children:x.active}):jsxRuntime.jsx("span",{className:"text-[13px] font-medium whitespace-nowrap text-ink-2",style:{animation:"bui-fade-in 350ms ease-out both"},children:x.done})}),y&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300",style:{transform:S?"rotate(180deg)":"rotate(0)"},children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),jsxRuntime.jsx("div",{className:"grid transition-[grid-template-rows,opacity] duration-400",style:{gridTemplateRows:S?"1fr":"0fr",opacity:S?1:0,transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)"},children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsxs("div",{className:"relative mt-1 ml-[5px] pl-4",children:[jsxRuntime.jsx("span",{"aria-hidden":true,className:"absolute left-[3px] w-px bg-line",style:{top:-8,height:$?$-2:0,transition:"height 500ms cubic-bezier(0.23,1,0.32,1)"}}),jsxRuntime.jsxs("div",{ref:T,className:"flex flex-col gap-1 py-1",children:[x.query&&jsxRuntime.jsxs("div",{className:"flex h-6 items-center gap-2 px-1.5",style:{animation:S?"bui-fade-up 300ms cubic-bezier(0.23,1,0.32,1) both":void 0},children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2",strokeLinecap:"round",className:"shrink-0",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"M21 21l-4.3-4.3"})]}),jsxRuntime.jsx("span",{className:"text-[12.5px] text-ink-2",children:x.query})]}),x.rows.slice(0,C).map((R,W)=>{let B=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="Search"&&jsxRuntime.jsx(Jk,{tone:ew[W%3]}),e==="Steps"&&(W<C-1||!w?jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})}):jsxRuntime.jsx("span",{className:"size-3 shrink-0 rounded-full border-[1.5px] border-line-strong border-t-ink-2",style:{animation:"bui-spin 700ms linear infinite"}})),jsxRuntime.jsx("span",{className:`min-w-0 text-[12.5px] ${e==="Reasoning"?"whitespace-pre-wrap [overflow-wrap:anywhere] leading-relaxed text-ink-2":"font-medium text-ink"} ${e==="Search"?"animated-underline":""}`,children:R.primary}),R.secondary&&jsxRuntime.jsx("span",{className:`shrink-0 text-[11.5px] text-ink-3 ${R.mono?"font-mono":""}`,children:R.secondary}),R.add!==void 0&&jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums",children:[jsxRuntime.jsxs("span",{className:"text-green",children:["+",R.add]})," ",jsxRuntime.jsxs("span",{className:"text-red",children:["\u2212",R.del]})]})]}),A="flex min-h-7 w-full items-center gap-2 rounded-[6px] px-1.5 py-0.5 text-left",L={animation:`bui-fade-up 320ms cubic-bezier(0.23,1,0.32,1) ${W*120}ms both`};if(e==="Search")return jsxRuntime.jsx("a",{href:Ro(R.href,"link"),target:"_blank",rel:"noreferrer",className:`${A} transition-colors duration-150 hover:bg-hover`,style:L,children:B},R.primary);if(e==="Coding"){let I=p===R.primary;return jsxRuntime.jsx("button",{type:"button","aria-pressed":I,onClick:()=>g(I?null:R.primary),className:`${A} transition-colors duration-150 ${I?"bg-inset":"hover:bg-hover"}`,style:L,children:B},R.primary)}return jsxRuntime.jsx("div",{className:A,style:L,children:B},R.primary)}),e==="Search"&&c>=3&&jsxRuntime.jsx("span",{className:"text-[12px] text-ink-3",style:{animation:"bui-fade-in 300ms ease-out both"},children:d("More")})]})]})})})]},e)})}a(lp,"BUIThinkingState");function dp({groups:e,onSelect:t,trigger:o,anchorRef:n,uploadContent:r,triggerLabel:i="\u6DFB\u52A0\u5185\u5BB9",emptyLabel:s="\u6682\u65E0\u53EF\u7528\u64CD\u4F5C",disabled:l=false,open:d,defaultOpen:c=false,onOpenChange:u,styles:m,classNames:p}){let[g,b]=ye.useState(c),x=io(),f=Fn(),y=Number(f.values["component.ui.quickPromptMenu.sideOffset"]),k=Number(f.values["component.ui.quickPromptMenu.collisionPadding"]),S=Number(f.values["component.ui.quickPromptMenu.maxHeightRatio"]);if(!Number.isFinite(y)||y<0||!Number.isFinite(k)||k<0||!Number.isFinite(S)||S<=0||S>1)throw new TypeError("QuickPromptMenu positioning tokens require non-negative CSS pixel numbers and a maxHeightRatio in (0, 1].");let w={"--bui-quick-prompt-width":f.cssValues["component.ui.quickPromptMenu.width"],"--bui-quick-prompt-height-ratio":S,"--bui-quick-prompt-border-width":f.cssValues["component.ui.size.s1"],"--bui-quick-prompt-radius":f.cssValues["semantic.ui.radius.container"],"--bui-quick-prompt-focus-width":f.cssValues["component.ui.size.s2"],"--bui-quick-prompt-focus-color":f.cssValues["component.ui.focus"],"--bui-quick-prompt-layer":f.cssValues["component.ui.layer.overlayBase"],...m?.content},C=l||!!o?.props.disabled,T=!C&&(d??g),$=a(R=>{R&&C||(b(R),u?.(R));},"setOpen"),P=e.filter(R=>R.options.length>0),E=r!=null&&r!==false;return jsxRuntime.jsx(re,{children:jsxRuntime.jsxs(Zo__namespace.Root,{modal:false,open:T,onOpenChange:$,children:[jsxRuntime.jsx(Zo__namespace.Trigger,{asChild:true,children:o?ye.cloneElement(o,{type:o.props.type??"button",disabled:C,"aria-label":o.props["aria-label"]??i}):jsxRuntime.jsx(To,{shape:"icon",size:"sm",disabled:C,"aria-label":i,children:jsxRuntime.jsx(lucideReact.Plus,{size:f.cssValues["component.ui.icon.size.s16"],"aria-hidden":"true"})})}),n&&jsxRuntime.jsx(Zo__namespace.Anchor,{virtualRef:n}),T&&jsxRuntime.jsx(xr,{children:jsxRuntime.jsx(re,{portal:true,children:jsxRuntime.jsxs(Zo__namespace.Content,{dir:x,side:"top",align:"start",sideOffset:y,collisionPadding:k,"aria-label":i,"data-anchor":n?"container":"trigger",className:["bui-quick-prompt-menu",p?.content].filter(Boolean).join(" "),style:w,children:[E&&jsxRuntime.jsx("div",{className:["bui-quick-prompt-upload",p?.upload].filter(Boolean).join(" "),style:m?.upload,children:r}),P.length>0?jsxRuntime.jsx("div",{className:["bui-quick-prompt-groups",p?.groups].filter(Boolean).join(" "),style:m?.groups,children:P.map((R,W)=>jsxRuntime.jsxs("section",{"aria-label":R.label,children:[jsxRuntime.jsx("h2",{className:"bui-quick-prompt-heading",children:R.label}),R.options.map(B=>jsxRuntime.jsx(To,{variant:"ghost",size:"sm",icon:jsxRuntime.jsx(lucideReact.Box,{size:f.cssValues["component.ui.icon.size.s16"],"aria-hidden":"true"}),className:"bui-quick-prompt-option",onClick:()=>{$(false),t(B);},children:jsxRuntime.jsxs("span",{className:"bui-quick-prompt-copy",children:[jsxRuntime.jsx("span",{children:B.label}),B.description&&jsxRuntime.jsx("span",{className:"bui-quick-prompt-description",children:B.description})]})},B.key))]},`${R.label}-${W}`))}):E?null:jsxRuntime.jsx("p",{className:"bui-quick-prompt-empty",children:s})]})})})]})})}a(dp,"BUIQuickPromptMenu");var uw=ye.lazy(()=>import('@inf-monkeys-tech/monkeys-design/components/markdown-editor').then(e=>({default:e.MarkdownEditor})));function pp({model:e}){let t=$t().markdownDocument,o=Bo(),[n,r]=ye.useState(()=>o?.colorMode==="light"?"light":"dark");ye.useEffect(()=>{(o?.colorMode==="light"||o?.colorMode==="dark")&&r(o.colorMode);},[o?.colorMode]);let i=Cu(qo(Da,o?.contract),n),s=ye.useRef(e.saveStatus);ye.useEffect(()=>{let R=s.current;e.saveStatus!==R&&(e.saveStatus==="saved"&&["saving","dirty"].includes(R)&&Cr.success(t.saved),["error","offline","conflict"].includes(e.saveStatus)&&Cr.error(e.saveStatus==="conflict"?t.conflict:t.error)),s.current=e.saveStatus;},[t.conflict,t.error,t.saved,e.saveStatus]);let[l,d]=ye.useState("visual"),[c,u]=ye.useState(false),[m,p]=ye.useState(false),[g,b]=ye.useState(),[x,f]=ye.useState(),[y,k]=ye.useState(false),S=zo(e.resources),[w,C]=ye.useState(false),T=a(R=>{C(false),R().catch(()=>C(true));},"invoke");if(e.status==="loading")return jsxRuntime.jsx("div",{role:"status",className:"markdown-document-state",children:t.loading});if(e.status==="unavailable")return jsxRuntime.jsx("div",{className:"markdown-document-state",children:t.unavailable});if(e.status==="error")return jsxRuntime.jsxs("div",{role:"alert",className:"markdown-document-state",children:[t.unavailable,jsxRuntime.jsx(ie,{onClick:e.onRetry,children:t.retry})]});let $=!["saved"].includes(e.saveStatus),P=n==="dark"?lucideReact.Sun:lucideReact.Moon,E={...i,"--background":i["--monkeys-ui-page"]??i["--monkeys-ui-background"],"--foreground":i["--monkeys-ui-foreground"],"--border":i["--monkeys-ui-border"],"--muted":i["--monkeys-ui-page"],"--primary":i["--monkeys-ui-button-primary-background"]};return jsxRuntime.jsxs("section",{className:"markdown-document monkeys-ui-markdown-document","data-editing":e.editing?"true":"false","data-color-mode":n,"aria-label":e.name,style:{...E,backgroundColor:i["--monkeys-ui-page"],color:i["--monkeys-ui-foreground"],colorScheme:n},onKeyDown:R=>{(R.metaKey||R.ctrlKey)&&R.key.toLowerCase()==="s"&&(R.preventDefault(),T(e.onSave));},children:[jsxRuntime.jsxs("header",{className:"markdown-document-header",children:[jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",className:"markdown-document-theme-toggle","aria-label":n==="dark"?t.switchToLight:t.switchToDark,title:n==="dark"?t.switchToLight:t.switchToDark,onClick:()=>r(R=>R==="dark"?"light":"dark"),children:jsxRuntime.jsx(P,{"aria-hidden":"true"})}),jsxRuntime.jsxs("div",{className:"markdown-document-header-actions",children:[e.editing?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ie,{size:"sm",variant:l==="visual"?"secondary":"ghost","aria-pressed":l==="visual",onClick:()=>d("visual"),children:t.visual}),jsxRuntime.jsx(ie,{size:"sm",variant:l==="source"?"secondary":"ghost","aria-pressed":l==="source",onClick:()=>d("source"),children:t.source}),jsxRuntime.jsx(ie,{size:"sm",onClick:()=>T(e.onSave),disabled:e.saveStatus==="saving"||!$||e.saveStatus==="conflict",children:t.save}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>{$?T(async()=>{await e.onSave(),e.onExit();}):e.onExit();},children:t.exit})]}):jsxRuntime.jsx(ie,{size:"sm",variant:"outline",disabled:!e.canEdit||e.tooLarge,onClick:e.onEdit,children:t.edit}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>T(e.onDownload),children:t.download}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>{u(true),T(()=>e.onHistory());},children:t.history})]})]}),e.tooLarge?jsxRuntime.jsx("p",{role:"status",children:t.tooLarge}):null,w?jsxRuntime.jsx("p",{role:"alert",children:t.error}):null,e.recoveryAvailable?jsxRuntime.jsxs("div",{role:"status",children:[t.recovery,jsxRuntime.jsx(ie,{size:"sm",onClick:e.onRecover,children:t.recover})]}):null,e.saveStatus==="conflict"?jsxRuntime.jsxs("div",{role:"alert",children:[t.conflict,jsxRuntime.jsx(ie,{onClick:()=>{p(true),T(e.onLoadLatest);},children:t.latest})]}):null,jsxRuntime.jsx("div",{className:"markdown-document-content",children:e.editing?jsxRuntime.jsx(ye.Suspense,{fallback:jsxRuntime.jsx("p",{role:"status",children:t.loading}),children:jsxRuntime.jsx(uw,{value:e.text,mode:l,onChange:e.onChange,onCompositionChange:e.onCompositionChange,uploadImage:e.uploadImage,resourceAccess:e.resources})}):jsxRuntime.jsx(un,{text:e.text,resources:S})}),jsxRuntime.jsx(Ti,{open:m,onOpenChange:p,children:jsxRuntime.jsxs(Rn,{className:"markdown-document-dialog",children:[jsxRuntime.jsx(Jr,{children:t.conflict}),jsxRuntime.jsxs("div",{className:"markdown-document-comparison",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{children:t.dirty}),jsxRuntime.jsx("pre",{children:e.text})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{children:t.latest}),jsxRuntime.jsx("pre",{children:e.latestText??t.loading})]})]}),jsxRuntime.jsx(ie,{disabled:e.latestText===void 0,onClick:()=>{e.onUseLatest(),p(false);},children:t.useLatest}),jsxRuntime.jsx(ie,{disabled:e.latestText===void 0,variant:"outline",onClick:()=>{e.onMergeDraft(),p(false),d("source");},children:t.keepDraft})]})}),jsxRuntime.jsx(Ti,{open:c,onOpenChange:u,children:jsxRuntime.jsxs(Rn,{className:"markdown-document-dialog",children:[jsxRuntime.jsx(Jr,{children:t.history}),jsxRuntime.jsxs("div",{className:"markdown-document-history",children:[e.history?.items.map(R=>jsxRuntime.jsxs(ie,{variant:"ghost",onClick:()=>{b(R),f(void 0),e.onVersion(R).then(f).catch(()=>C(true));},children:[new Date(R.createdAt).toLocaleString()," \xB7 ",R.actorId]},R.commitId)),e.history?.items.length?null:jsxRuntime.jsx("p",{children:e.history?.loading?t.loading:t.emptyHistory}),e.history?.hasMore?jsxRuntime.jsx(ie,{disabled:e.history.loading,onClick:()=>T(()=>e.onHistory(true)),children:t.history}):null]}),g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(un,{text:x??"",resources:S}),jsxRuntime.jsx(ie,{disabled:y||x===void 0||$,onClick:()=>{k(true),e.onRestore(g.commitId).then(()=>{u(false),b(void 0);}).catch(()=>C(true)).finally(()=>k(false));},children:t.restore})]}):null]})})]})}a(pp,"MarkdownDocumentWorkspace");var _s=ye.createContext(void 0);function mE({document:e,history:t,receipt:o,...n}){let r=ye.useContext(_s);if(!r)throw new Error("Markdown documents require a declared artifact workspace slot.");return jsxRuntime.jsx(pp,{model:r.useData(n,e,t)})}a(mE,"AgentConversationMarkdownDocument");var hp=ye.createContext({});function kw({children:e,preview:t,overlays:o}){let n=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_i,{...n.layout,preview:n.previewOpen?jsxRuntime.jsx(is,{hostRef:n.previewHost,children:t}):void 0,children:e}),o]})}a(kw,"AgentConversationLayout");function ww({header:e,prompt:t,questions:o,progress:n,notice:r,interactions:i,pending:s,artifacts:l,collapseProcessOnComplete:d=true,fontScale:c,fontScaleLabels:u,onFontScaleChange:m}){let p=agentUi.useAgentConversationData();return jsxRuntime.jsx(hp.Provider,{value:{fontScale:c,fontScaleLabels:u,onFontScaleChange:m},children:jsxRuntime.jsx("div",{className:"contents agent-conversation-font-scale","data-font-scale":c,children:jsxRuntime.jsx(ep,{...p.chat,fill:true,readable:true,showMessageLabels:false,headerActions:e,composerContent:t,composerAccessory:p.questions?o:void 0,composerProgress:p.taskProgress?n:void 0,composerNotice:p.reviewNotice?r:void 0,pendingContent:p.pendingLabel?s:null,sidePanel:p.artifactsOpen?l:void 0,renderMessage:(g,b)=>jsxRuntime.jsx(Cw,{row:p.rows[b],collapseProcessOnComplete:d},g.id??b),children:p.interactions.blocking||p.interactions.approvals?.length||p.interactions.form||p.interactions.unsupported?i:null})})})}a(ww,"AgentConversationTranscript");function Cw({row:e,collapseProcessOnComplete:t=true}){return e.kind==="process"?jsxRuntime.jsx(Tw,{row:e,collapseOnComplete:t}):e.kind==="question"?jsxRuntime.jsx(xp,{data:e.data}):jsxRuntime.jsx(vp,{data:e.data})}a(Cw,"AgentConversationRow");function vp({data:e}){return jsxRuntime.jsx(Uu,{model:e.useData()})}a(vp,"MessageBinding");function xp({data:e}){return jsxRuntime.jsx(Ra,{...e.useData()})}a(xp,"QuestionBinding");function Tw({row:e,collapseOnComplete:t}){let o=["completed","failed","stopped"].includes(e.process.status),[n,r]=ye.useState(!o),i=ye.useRef(o);return ye.useEffect(()=>{o&&!i.current&&t&&r(false),i.current=o;},[o,t]),jsxRuntime.jsx(Zc,{...e.process,density:"compact",showStatusIcon:false,open:n,onOpenChange:r,children:e.items.map(s=>jsxRuntime.jsx(vp,{data:s},s.key))})}a(Tw,"ProcessRow");function Sw(){let{header:e}=agentUi.useAgentConversationData(),t=ye.useContext(hp),o=t.fontScaleLabels;return jsxRuntime.jsxs("span",{className:"flex items-center",children:[t.fontScale&&o?jsxRuntime.jsx(Eu,{"aria-label":o.ariaLabel,value:t.fontScale,onValueChange:n=>t.onFontScaleChange?.(n),items:[{value:"lg",label:o.large},{value:"md",label:o.medium},{value:"sm",label:o.small}],className:"agent-conversation-font-scale-control"}):null,jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.canvasLabel,title:e.canvasLabel,"aria-pressed":e.canvasVisible,disabled:e.canvasDisabled,onClick:e.onCanvas,children:jsxRuntime.jsx(lucideReact.Shapes,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})}),jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.artifactsLabel,title:e.artifactsLabel,"aria-expanded":e.artifactsOpen,"aria-controls":e.artifactsId,onClick:e.onArtifacts,children:jsxRuntime.jsx(lucideReact.Files,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})}),jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.previewLabel,title:e.previewLabel,"aria-pressed":e.previewOpen,disabled:e.previewDisabled,onClick:e.onPreview,children:e.previewOpen?jsxRuntime.jsx(lucideReact.PanelRightClose,{className:"agent-workbench-artifact-icon","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})})]})}a(Sw,"AgentConversationHeader");var kp=ye.createContext(null);function $w({controls:e,menu:t}){let{fileInputRef:o,onFiles:n,prompt:r,chat:i}=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bo,{unstyled:true,ref:o,type:"file",multiple:true,hidden:true,tabIndex:-1,onChange:s=>{n(Array.from(s.target.files??[])),s.target.value="";}}),jsxRuntime.jsx(Ka,{...r,controls:e,renderAttachButton:t?(s,l)=>jsxRuntime.jsx(kp.Provider,{value:{trigger:s,anchorRef:l},children:t}):void 0,minRows:i.composerContainer?1:2,showDictation:true})]})}a($w,"AgentConversationPrompt");function _E({triggerLabel:e,uploadLabel:t,emptyLabel:o,loadingLabel:n,errorLabel:r}){let i=agentUi.useAgentConversationData();return i.promptMenu?jsxRuntime.jsx(Pw,{binding:i.promptMenu,labels:{triggerLabel:e,uploadLabel:t,emptyLabel:o,loadingLabel:n,errorLabel:r}}):null}a(_E,"AgentConversationPromptMenu");function Pw({binding:e,labels:t}){let o=agentUi.useAgentConversationData(),n=ye.useContext(kp),r=e.useData(),[i,s]=ye.useState(false);if(!n)throw new Error("The prompt menu requires an AgentConversationPrompt menu slot.");let l=r.status==="loading"?t.loadingLabel:r.status==="error"?t.errorLabel:r.groups.some(d=>d.options.length)?void 0:t.emptyLabel;return jsxRuntime.jsx(dp,{...n,trigger:ye.cloneElement(n.trigger,{"aria-label":t.triggerLabel}),triggerLabel:t.triggerLabel,groups:r.groups,disabled:o.prompt.disabled,open:i,onOpenChange:d=>{s(d),d&&r.status==="error"&&r.onRetry?.();},uploadContent:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(To,{size:"sm",variant:"soft",style:{width:"100%",justifyContent:"start"},icon:jsxRuntime.jsx(lucideReact.Paperclip,{size:"var(--monkeys-ui-icon-size-s16,var(--monkeys-ui-default-icon-size-s16))","aria-hidden":"true"}),onClick:()=>{s(false),o.prompt.onAttach?.();},children:t.uploadLabel}),l?jsxRuntime.jsx("p",{role:"status",children:l}):null]}),onSelect:d=>r.onSelect(d.key)})}a(Pw,"PromptMenuBinding");function Rw(){let{questions:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsxs("div",{"data-agent-question-dock":true,children:[e.blocking&&ye.createElement(Ra,{...e.blocking,key:e.blocking.key}),e.asynchronous?.map(t=>jsxRuntime.jsx(xp,{data:t},t.key))]}):null}a(Rw,"AgentConversationQuestions");function Mw(){let{taskProgress:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Qa,{...e,variant:"Progress"}):null}a(Mw,"AgentConversationProgress");function Aw(){let{pendingLabel:e,pendingElapsedMs:t,pendingStartedAtMs:o}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(gn,{variant:"Dots",label:e,elapsedMs:t,startedAtMs:o}):null}a(Aw,"AgentConversationPending");function Bw(){let{reviewNotice:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Te,{size:"xs",variant:"quiet",disabled:e.disabled,onClick:e.onClick,children:e.label}):null}a(Bw,"AgentConversationNotice");function Nw(){let{interactions:e}=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.blocking&&ye.createElement(Ra,{...e.blocking,key:e.blocking.key}),e.approvals?.map(({id:t,...o})=>jsxRuntime.jsx(Ws,{...o},t)),e.form&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.form.authorization&&jsxRuntime.jsx(Te,{onClick:e.form.authorization.onClick,children:e.form.authorization.label}),jsxRuntime.jsx(Ws,{...e.form},e.form.id)]}),e.unsupported&&jsxRuntime.jsxs("div",{role:"status",children:[jsxRuntime.jsx(lp,{status:"running",active:e.unsupported.label,rows:[]}),jsxRuntime.jsx(Te,{disabled:e.unsupported.disabled,onClick:e.unsupported.onStop,children:e.unsupported.stopLabel})]})]})}a(Nw,"AgentConversationInteractions");function Ew({panel:e,files:t,error:o}){return jsxRuntime.jsx(ni,{...e,footer:o?jsxRuntime.jsx(tu,{message:o}):void 0,children:jsxRuntime.jsx(ri,{...t})})}a(Ew,"AgentConversationArtifactList");function Iw({data:e}){return jsxRuntime.jsx(Ew,{...e.useData()})}a(Iw,"ArtifactBinding");function Dw(){let e=agentUi.useAgentConversationData();return jsxRuntime.jsx(Iw,{data:e.artifacts})}a(Dw,"AgentConversationArtifacts");function Lw({data:e,canvas:t,markdown:o,onMarkdownSourceSelected:n}){let r=e.useData(),i=a(c=>{let u=r.workspace.artifacts.find(p=>p.id===c),m=u&&r.contents.find(p=>p.id===u.id);return u?.kind==="markdown"&&m?.kind==="artifact"?m.document?.source??null:null},"sourceFor"),s=i(r.workspace.activeArtifactId),l=JSON.stringify(s),d=ye.useRef(n);return d.current=n,ye.useEffect(()=>{d.current&&Promise.resolve(d.current(s)).catch(()=>{});},[l]),jsxRuntime.jsx(Ic,{conversation:r.conversation,workspace:{...r.workspace,density:"compact",tabBar:"flush",onIntent:a(c=>{c.type==="select"&&n&&Promise.resolve(n(i(c.artifactId))).catch(()=>{}),r.workspace.onIntent?.(c);},"onIntent"),renderArtifact:a(c=>{if(c.id==="agent-session-canvas")return jsxRuntime.jsx(is,{children:t});let u=r.contents.find(m=>m.id===c.id);return u?u.kind==="artifact"&&u.document&&o?jsxRuntime.jsx(_s.Provider,{value:u.document,children:o},u.id):u.kind==="data"?jsxRuntime.jsx(zw,{data:u.data},u.id):jsxRuntime.jsx(Ow,{data:u.data},u.id):null},"renderArtifact")}})}a(Lw,"WorkspaceBinding");function zw({data:e}){return jsxRuntime.jsx(Iu,{...e.useData()})}a(zw,"LinkedBinding");function Ow({data:e}){return jsxRuntime.jsx(ur,{...e.useData()})}a(Ow,"PreviewBinding");function Hw({canvas:e,markdown:t,onMarkdownSourceSelected:o}){let n=agentUi.useAgentConversationData();return jsxRuntime.jsx(Lw,{data:n.workspace,canvas:n.canvasOpen?e:void 0,markdown:t,onMarkdownSourceSelected:o})}a(Hw,"AgentConversationWorkspace");function Ww({data:e}){return jsxRuntime.jsx(Lu,{...e.useData()})}a(Ww,"CanvasBinding");function Fw(){let{canvas:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Ww,{data:e},e.key):null}a(Fw,"AgentConversationCanvas");function _w({data:e}){return jsxRuntime.jsx(Ms,{...e.useData()})}a(_w,"CollectionBinding");function Uw(){let{collection:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(_w,{data:e}):null}a(Uw,"AgentConversationCollection");function UE({canvas:e}){return jsxRuntime.jsx(kw,{preview:jsxRuntime.jsx(Hw,{canvas:e??jsxRuntime.jsx(Fw,{})}),overlays:jsxRuntime.jsx(Uw,{}),children:jsxRuntime.jsx(ww,{header:jsxRuntime.jsx(Sw,{}),prompt:jsxRuntime.jsx($w,{}),questions:jsxRuntime.jsx(Rw,{}),progress:jsxRuntime.jsx(Mw,{}),notice:jsxRuntime.jsx(Bw,{}),interactions:jsxRuntime.jsx(Nw,{}),pending:jsxRuntime.jsx(Aw,{}),artifacts:jsxRuntime.jsx(Dw,{})})})}a(UE,"AgentConversationDefaultView");
|
|
267
|
+
transition-colors duration-100 hover:bg-hover-2`,children:[i?jsxRuntime.jsx("span",{className:"flex shrink-0 transition-colors duration-200",style:{color:w?"var(--bui-ink-2)":"var(--bui-ink-3)"},children:i}):jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:w?"var(--bui-ink-2)":"var(--bui-ink-3)",children:jsxRuntime.jsx("path",{d:"M12 2l2.4 7.2L22 12l-7.6 2.8L12 22l-2.4-7.2L2 12l7.6-2.8z"})}),jsxRuntime.jsx("span",{role:"status",className:"contents",children:w?jsxRuntime.jsx("span",{className:"bg-clip-text text-[13px] font-medium whitespace-nowrap text-transparent",style:{backgroundImage:"linear-gradient(90deg, var(--bui-ink-3) 35%, var(--bui-ink) 50%, var(--bui-ink-3) 65%)",backgroundSize:"200% 100%",animation:"bui-shimmer-text 1.4s linear infinite"},children:x.active}):jsxRuntime.jsx("span",{className:"text-[13px] font-medium whitespace-nowrap text-ink-2",style:{animation:"bui-fade-in 350ms ease-out both"},children:x.done})}),y&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform duration-300",style:{transform:S?"rotate(180deg)":"rotate(0)"},children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),jsxRuntime.jsx("div",{className:"grid transition-[grid-template-rows,opacity] duration-400",style:{gridTemplateRows:S?"1fr":"0fr",opacity:S?1:0,transitionTimingFunction:"cubic-bezier(0.23, 1, 0.32, 1)"},children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsxs("div",{className:"relative mt-1 ml-[5px] pl-4",children:[jsxRuntime.jsx("span",{"aria-hidden":true,className:"absolute left-[3px] w-px bg-line",style:{top:-8,height:$?$-2:0,transition:"height 500ms cubic-bezier(0.23,1,0.32,1)"}}),jsxRuntime.jsxs("div",{ref:T,className:"flex flex-col gap-1 py-1",children:[x.query&&jsxRuntime.jsxs("div",{className:"flex h-6 items-center gap-2 px-1.5",style:{animation:S?"bui-fade-up 300ms cubic-bezier(0.23,1,0.32,1) both":void 0},children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2",strokeLinecap:"round",className:"shrink-0",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"M21 21l-4.3-4.3"})]}),jsxRuntime.jsx("span",{className:"text-[12.5px] text-ink-2",children:x.query})]}),x.rows.slice(0,C).map((R,W)=>{let B=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="Search"&&jsxRuntime.jsx(Jk,{tone:ew[W%3]}),e==="Steps"&&(W<C-1||!w?jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bui-ink-3)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})}):jsxRuntime.jsx("span",{className:"size-3 shrink-0 rounded-full border-[1.5px] border-line-strong border-t-ink-2",style:{animation:"bui-spin 700ms linear infinite"}})),jsxRuntime.jsx("span",{className:`min-w-0 text-[12.5px] ${e==="Reasoning"?"whitespace-pre-wrap [overflow-wrap:anywhere] leading-relaxed text-ink-2":"font-medium text-ink"} ${e==="Search"?"animated-underline":""}`,children:R.primary}),R.secondary&&jsxRuntime.jsx("span",{className:`shrink-0 text-[11.5px] text-ink-3 ${R.mono?"font-mono":""}`,children:R.secondary}),R.add!==void 0&&jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums",children:[jsxRuntime.jsxs("span",{className:"text-green",children:["+",R.add]})," ",jsxRuntime.jsxs("span",{className:"text-red",children:["\u2212",R.del]})]})]}),A="flex min-h-7 w-full items-center gap-2 rounded-[6px] px-1.5 py-0.5 text-left",L={animation:`bui-fade-up 320ms cubic-bezier(0.23,1,0.32,1) ${W*120}ms both`};if(e==="Search")return jsxRuntime.jsx("a",{href:Ro(R.href,"link"),target:"_blank",rel:"noreferrer",className:`${A} transition-colors duration-150 hover:bg-hover`,style:L,children:B},R.primary);if(e==="Coding"){let I=p===R.primary;return jsxRuntime.jsx("button",{type:"button","aria-pressed":I,onClick:()=>g(I?null:R.primary),className:`${A} transition-colors duration-150 ${I?"bg-inset":"hover:bg-hover"}`,style:L,children:B},R.primary)}return jsxRuntime.jsx("div",{className:A,style:L,children:B},R.primary)}),e==="Search"&&c>=3&&jsxRuntime.jsx("span",{className:"text-[12px] text-ink-3",style:{animation:"bui-fade-in 300ms ease-out both"},children:d("More")})]})]})})})]},e)})}a(lp,"BUIThinkingState");function dp({groups:e,onSelect:t,trigger:o,anchorRef:n,uploadContent:r,triggerLabel:i="\u6DFB\u52A0\u5185\u5BB9",emptyLabel:s="\u6682\u65E0\u53EF\u7528\u64CD\u4F5C",disabled:l=false,open:d,defaultOpen:c=false,onOpenChange:u,styles:m,classNames:p}){let[g,b]=ye.useState(c),x=io(),f=Fn(),y=Number(f.values["component.ui.quickPromptMenu.sideOffset"]),k=Number(f.values["component.ui.quickPromptMenu.collisionPadding"]),S=Number(f.values["component.ui.quickPromptMenu.maxHeightRatio"]);if(!Number.isFinite(y)||y<0||!Number.isFinite(k)||k<0||!Number.isFinite(S)||S<=0||S>1)throw new TypeError("QuickPromptMenu positioning tokens require non-negative CSS pixel numbers and a maxHeightRatio in (0, 1].");let w={"--bui-quick-prompt-width":f.cssValues["component.ui.quickPromptMenu.width"],"--bui-quick-prompt-height-ratio":S,"--bui-quick-prompt-border-width":f.cssValues["component.ui.size.s1"],"--bui-quick-prompt-radius":f.cssValues["semantic.ui.radius.container"],"--bui-quick-prompt-focus-width":f.cssValues["component.ui.size.s2"],"--bui-quick-prompt-focus-color":f.cssValues["component.ui.focus"],"--bui-quick-prompt-layer":f.cssValues["component.ui.layer.overlayBase"],...m?.content},C=l||!!o?.props.disabled,T=!C&&(d??g),$=a(R=>{R&&C||(b(R),u?.(R));},"setOpen"),P=e.filter(R=>R.options.length>0),E=r!=null&&r!==false;return jsxRuntime.jsx(re,{children:jsxRuntime.jsxs(Zo__namespace.Root,{modal:false,open:T,onOpenChange:$,children:[jsxRuntime.jsx(Zo__namespace.Trigger,{asChild:true,children:o?ye.cloneElement(o,{type:o.props.type??"button",disabled:C,"aria-label":o.props["aria-label"]??i}):jsxRuntime.jsx(To,{shape:"icon",size:"sm",disabled:C,"aria-label":i,children:jsxRuntime.jsx(lucideReact.Plus,{size:f.cssValues["component.ui.icon.size.s16"],"aria-hidden":"true"})})}),n&&jsxRuntime.jsx(Zo__namespace.Anchor,{virtualRef:n}),T&&jsxRuntime.jsx(xr,{children:jsxRuntime.jsx(re,{portal:true,children:jsxRuntime.jsxs(Zo__namespace.Content,{dir:x,side:"top",align:"start",sideOffset:y,collisionPadding:k,"aria-label":i,"data-anchor":n?"container":"trigger",className:["bui-quick-prompt-menu",p?.content].filter(Boolean).join(" "),style:w,children:[E&&jsxRuntime.jsx("div",{className:["bui-quick-prompt-upload",p?.upload].filter(Boolean).join(" "),style:m?.upload,children:r}),P.length>0?jsxRuntime.jsx("div",{className:["bui-quick-prompt-groups",p?.groups].filter(Boolean).join(" "),style:m?.groups,children:P.map((R,W)=>jsxRuntime.jsxs("section",{"aria-label":R.label,children:[jsxRuntime.jsx("h2",{className:"bui-quick-prompt-heading",children:R.label}),R.options.map(B=>jsxRuntime.jsx(To,{variant:"ghost",size:"sm",icon:jsxRuntime.jsx(lucideReact.Box,{size:f.cssValues["component.ui.icon.size.s16"],"aria-hidden":"true"}),className:"bui-quick-prompt-option",onClick:()=>{$(false),t(B);},children:jsxRuntime.jsxs("span",{className:"bui-quick-prompt-copy",children:[jsxRuntime.jsx("span",{children:B.label}),B.description&&jsxRuntime.jsx("span",{className:"bui-quick-prompt-description",children:B.description})]})},B.key))]},`${R.label}-${W}`))}):E?null:jsxRuntime.jsx("p",{className:"bui-quick-prompt-empty",children:s})]})})})]})})}a(dp,"BUIQuickPromptMenu");var uw=ye.lazy(()=>import('@inf-monkeys-tech/monkeys-design/components/markdown-editor').then(e=>({default:e.MarkdownEditor})));function pp({model:e}){let t=$t().markdownDocument,o=Bo(),[n,r]=ye.useState(()=>o?.colorMode==="light"?"light":"dark");ye.useEffect(()=>{(o?.colorMode==="light"||o?.colorMode==="dark")&&r(o.colorMode);},[o?.colorMode]);let i=Cu(qo(Da,o?.contract),n),s=ye.useRef(e.saveStatus);ye.useEffect(()=>{let R=s.current;e.saveStatus!==R&&(e.saveStatus==="saved"&&["saving","dirty"].includes(R)&&Cr.success(t.saved),["error","offline","conflict"].includes(e.saveStatus)&&Cr.error(e.saveStatus==="conflict"?t.conflict:t.error)),s.current=e.saveStatus;},[t.conflict,t.error,t.saved,e.saveStatus]);let[l,d]=ye.useState("visual"),[c,u]=ye.useState(false),[m,p]=ye.useState(false),[g,b]=ye.useState(),[x,f]=ye.useState(),[y,k]=ye.useState(false),S=zo(e.resources),[w,C]=ye.useState(false),T=a(R=>{C(false),R().catch(()=>C(true));},"invoke");if(e.status==="loading")return jsxRuntime.jsx("div",{role:"status",className:"markdown-document-state",children:t.loading});if(e.status==="unavailable")return jsxRuntime.jsx("div",{className:"markdown-document-state",children:t.unavailable});if(e.status==="error")return jsxRuntime.jsxs("div",{role:"alert",className:"markdown-document-state",children:[t.unavailable,jsxRuntime.jsx(ie,{onClick:e.onRetry,children:t.retry})]});let $=!["saved"].includes(e.saveStatus),P=n==="dark"?lucideReact.Sun:lucideReact.Moon,E={...i,"--background":i["--monkeys-ui-page"]??i["--monkeys-ui-background"],"--foreground":i["--monkeys-ui-foreground"],"--border":i["--monkeys-ui-border"],"--muted":i["--monkeys-ui-page"],"--primary":i["--monkeys-ui-button-primary-background"]};return jsxRuntime.jsxs("section",{className:"markdown-document monkeys-ui-markdown-document","data-editing":e.editing?"true":"false","data-color-mode":n,"aria-label":e.name,style:{...E,backgroundColor:i["--monkeys-ui-page"],color:i["--monkeys-ui-foreground"],colorScheme:n},onKeyDown:R=>{(R.metaKey||R.ctrlKey)&&R.key.toLowerCase()==="s"&&(R.preventDefault(),T(e.onSave));},children:[jsxRuntime.jsxs("header",{className:"markdown-document-header",children:[jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",className:"markdown-document-theme-toggle","aria-label":n==="dark"?t.switchToLight:t.switchToDark,title:n==="dark"?t.switchToLight:t.switchToDark,onClick:()=>r(R=>R==="dark"?"light":"dark"),children:jsxRuntime.jsx(P,{"aria-hidden":"true"})}),jsxRuntime.jsxs("div",{className:"markdown-document-header-actions",children:[e.editing?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ie,{size:"sm",variant:l==="visual"?"secondary":"ghost","aria-pressed":l==="visual",onClick:()=>d("visual"),children:t.visual}),jsxRuntime.jsx(ie,{size:"sm",variant:l==="source"?"secondary":"ghost","aria-pressed":l==="source",onClick:()=>d("source"),children:t.source}),jsxRuntime.jsx(ie,{size:"sm",onClick:()=>T(e.onSave),disabled:e.saveStatus==="saving"||!$||e.saveStatus==="conflict",children:t.save}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>{$?T(async()=>{await e.onSave(),e.onExit();}):e.onExit();},children:t.exit})]}):jsxRuntime.jsx(ie,{size:"sm",variant:"outline",disabled:!e.canEdit||e.tooLarge,onClick:e.onEdit,children:t.edit}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>T(e.onDownload),children:t.download}),jsxRuntime.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>{u(true),T(()=>e.onHistory());},children:t.history})]})]}),e.tooLarge?jsxRuntime.jsx("p",{role:"status",children:t.tooLarge}):null,w?jsxRuntime.jsx("p",{role:"alert",children:t.error}):null,e.recoveryAvailable?jsxRuntime.jsxs("div",{role:"status",children:[t.recovery,jsxRuntime.jsx(ie,{size:"sm",onClick:e.onRecover,children:t.recover})]}):null,e.saveStatus==="conflict"?jsxRuntime.jsxs("div",{role:"alert",children:[t.conflict,jsxRuntime.jsx(ie,{onClick:()=>{p(true),T(e.onLoadLatest);},children:t.latest})]}):null,jsxRuntime.jsx("div",{className:"markdown-document-content",children:e.editing?jsxRuntime.jsx(ye.Suspense,{fallback:jsxRuntime.jsx("p",{role:"status",children:t.loading}),children:jsxRuntime.jsx(uw,{value:e.text,mode:l,onChange:e.onChange,onCompositionChange:e.onCompositionChange,uploadImage:e.uploadImage,resourceAccess:e.resources})}):jsxRuntime.jsx(un,{text:e.text,resources:S})}),jsxRuntime.jsx(Ti,{open:m,onOpenChange:p,children:jsxRuntime.jsxs(Rn,{className:"markdown-document-dialog",children:[jsxRuntime.jsx(Jr,{children:t.conflict}),jsxRuntime.jsxs("div",{className:"markdown-document-comparison",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{children:t.dirty}),jsxRuntime.jsx("pre",{children:e.text})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{children:t.latest}),jsxRuntime.jsx("pre",{children:e.latestText??t.loading})]})]}),jsxRuntime.jsx(ie,{disabled:e.latestText===void 0,onClick:()=>{e.onUseLatest(),p(false);},children:t.useLatest}),jsxRuntime.jsx(ie,{disabled:e.latestText===void 0,variant:"outline",onClick:()=>{e.onMergeDraft(),p(false),d("source");},children:t.keepDraft})]})}),jsxRuntime.jsx(Ti,{open:c,onOpenChange:u,children:jsxRuntime.jsxs(Rn,{className:"markdown-document-dialog",children:[jsxRuntime.jsx(Jr,{children:t.history}),jsxRuntime.jsxs("div",{className:"markdown-document-history",children:[e.history?.items.map(R=>jsxRuntime.jsxs(ie,{variant:"ghost",onClick:()=>{b(R),f(void 0),e.onVersion(R).then(f).catch(()=>C(true));},children:[new Date(R.createdAt).toLocaleString()," \xB7 ",R.actorId]},R.commitId)),e.history?.items.length?null:jsxRuntime.jsx("p",{children:e.history?.loading?t.loading:t.emptyHistory}),e.history?.hasMore?jsxRuntime.jsx(ie,{disabled:e.history.loading,onClick:()=>T(()=>e.onHistory(true)),children:t.history}):null]}),g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(un,{text:x??"",resources:S}),jsxRuntime.jsx(ie,{disabled:y||x===void 0||$,onClick:()=>{k(true),e.onRestore(g.commitId).then(()=>{u(false),b(void 0);}).catch(()=>C(true)).finally(()=>k(false));},children:t.restore})]}):null]})})]})}a(pp,"MarkdownDocumentWorkspace");var _s=ye.createContext(void 0);function mE({document:e,history:t,receipt:o,...n}){let r=ye.useContext(_s);if(!r)throw new Error("Markdown documents require a declared artifact workspace slot.");return jsxRuntime.jsx(pp,{model:r.useData(n,e,t)})}a(mE,"AgentConversationMarkdownDocument");var hp=ye.createContext({});function kw({children:e,preview:t,overlays:o}){let n=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_i,{...n.layout,preview:n.previewOpen?jsxRuntime.jsx(is,{hostRef:n.previewHost,children:t}):void 0,children:e}),o]})}a(kw,"AgentConversationLayout");function ww({header:e,prompt:t,questions:o,progress:n,notice:r,interactions:i,pending:s,artifacts:l,collapseProcessOnComplete:d=true,fontScale:c,fontScaleLabels:u,onFontScaleChange:m}){let p=agentUi.useAgentConversationData();return jsxRuntime.jsx(hp.Provider,{value:{fontScale:c,fontScaleLabels:u,onFontScaleChange:m},children:jsxRuntime.jsx("div",{className:"contents agent-conversation-font-scale","data-font-scale":c,children:jsxRuntime.jsx(ep,{...p.chat,fill:true,readable:true,showMessageLabels:false,headerActions:e,composerContent:t,composerAccessory:p.questions?o:void 0,composerProgress:p.taskProgress?n:void 0,composerNotice:p.reviewNotice?r:void 0,pendingContent:p.pendingLabel?s:null,sidePanel:p.artifactsOpen?l:void 0,renderMessage:(g,b)=>jsxRuntime.jsx(Cw,{row:p.rows[b],collapseProcessOnComplete:d},g.id??b),children:p.interactions.blocking||p.interactions.approvals?.length||p.interactions.form||p.interactions.unsupported?i:null})})})}a(ww,"AgentConversationTranscript");function Cw({row:e,collapseProcessOnComplete:t=true}){return e.kind==="process"?jsxRuntime.jsx(Tw,{row:e,collapseOnComplete:t}):e.kind==="question"?jsxRuntime.jsx(xp,{data:e.data}):jsxRuntime.jsx(vp,{data:e.data})}a(Cw,"AgentConversationRow");function vp({data:e}){return jsxRuntime.jsx(Uu,{model:e.useData()})}a(vp,"MessageBinding");function xp({data:e}){return jsxRuntime.jsx(Ra,{...e.useData()})}a(xp,"QuestionBinding");function Tw({row:e,collapseOnComplete:t}){let o=["completed","failed","stopped"].includes(e.process.status),[n,r]=ye.useState(!o),i=ye.useRef(o);return ye.useEffect(()=>{o&&!i.current&&t&&r(false),i.current=o;},[o,t]),jsxRuntime.jsx(Zc,{...e.process,density:"compact",showStatusIcon:false,open:n,onOpenChange:r,children:e.items.map(s=>jsxRuntime.jsx(vp,{data:s},s.key))})}a(Tw,"ProcessRow");function Sw(){let{header:e}=agentUi.useAgentConversationData(),t=ye.useContext(hp),o=t.fontScaleLabels;return jsxRuntime.jsxs("span",{className:"flex items-center",children:[t.fontScale&&o?jsxRuntime.jsx(Eu,{"aria-label":o.ariaLabel,value:t.fontScale,onValueChange:n=>t.onFontScaleChange?.(n),items:[{value:"lg",label:o.large},{value:"md",label:o.medium},{value:"sm",label:o.small}],className:"agent-conversation-font-scale-control"}):null,jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.canvasLabel,title:e.canvasLabel,"aria-pressed":e.canvasVisible,disabled:e.canvasDisabled,onClick:e.onCanvas,children:jsxRuntime.jsx(lucideReact.Shapes,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})}),jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.artifactsLabel,title:e.artifactsLabel,"aria-expanded":e.artifactsOpen,"aria-controls":e.artifactsId,onClick:e.onArtifacts,children:jsxRuntime.jsx(lucideReact.Files,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})}),jsxRuntime.jsx(Te,{size:"xs",variant:"quiet","aria-label":e.previewLabel,title:e.previewLabel,"aria-pressed":e.previewOpen,disabled:e.previewDisabled,onClick:e.onPreview,children:e.previewOpen?jsxRuntime.jsx(lucideReact.PanelRightClose,{className:"agent-workbench-artifact-icon","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"agent-workbench-artifact-icon","aria-hidden":"true"})})]})}a(Sw,"AgentConversationHeader");var kp=ye.createContext(null);function $w({controls:e,menu:t}){let{fileInputRef:o,onFiles:n,prompt:r,chat:i}=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bo,{unstyled:true,ref:o,type:"file",multiple:true,hidden:true,tabIndex:-1,onChange:s=>{n(Array.from(s.target.files??[])),s.target.value="";}}),jsxRuntime.jsx(Ka,{...r,controls:e,renderAttachButton:t?(s,l)=>jsxRuntime.jsx(kp.Provider,{value:{trigger:s,anchorRef:l},children:t}):void 0,minRows:i.composerContainer?1:2,showDictation:true})]})}a($w,"AgentConversationPrompt");function _E({triggerLabel:e,uploadLabel:t,emptyLabel:o,loadingLabel:n,errorLabel:r}){let i=agentUi.useAgentConversationData();return i.promptMenu?jsxRuntime.jsx(Pw,{binding:i.promptMenu,labels:{triggerLabel:e,uploadLabel:t,emptyLabel:o,loadingLabel:n,errorLabel:r}},i.promptMenu.key):null}a(_E,"AgentConversationPromptMenu");function Pw({binding:e,labels:t}){let o=agentUi.useAgentConversationData(),n=ye.useContext(kp),r=e.useData(),[i,s]=ye.useState(false);if(!n)throw new Error("The prompt menu requires an AgentConversationPrompt menu slot.");let l=r.status==="loading"?t.loadingLabel:r.status==="error"?t.errorLabel:r.groups.some(d=>d.options.length)?void 0:t.emptyLabel;return jsxRuntime.jsx(dp,{...n,trigger:ye.cloneElement(n.trigger,{"aria-label":t.triggerLabel}),triggerLabel:t.triggerLabel,groups:r.groups,disabled:o.prompt.disabled,open:i,onOpenChange:d=>{s(d),d&&r.status==="error"&&r.onRetry?.();},uploadContent:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(To,{size:"sm",variant:"soft",style:{width:"100%",justifyContent:"start"},icon:jsxRuntime.jsx(lucideReact.Paperclip,{size:"var(--monkeys-ui-icon-size-s16,var(--monkeys-ui-default-icon-size-s16))","aria-hidden":"true"}),onClick:()=>{s(false),o.prompt.onAttach?.();},children:t.uploadLabel}),l?jsxRuntime.jsx("p",{role:"status",children:l}):null]}),onSelect:d=>r.onSelect(d.key)})}a(Pw,"PromptMenuBinding");function Rw(){let{questions:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsxs("div",{"data-agent-question-dock":true,children:[e.blocking&&ye.createElement(Ra,{...e.blocking,key:e.blocking.key}),e.asynchronous?.map(t=>jsxRuntime.jsx(xp,{data:t},t.key))]}):null}a(Rw,"AgentConversationQuestions");function Mw(){let{taskProgress:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Qa,{...e,variant:"Progress"}):null}a(Mw,"AgentConversationProgress");function Aw(){let{pendingLabel:e,pendingElapsedMs:t,pendingStartedAtMs:o}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(gn,{variant:"Dots",label:e,elapsedMs:t,startedAtMs:o}):null}a(Aw,"AgentConversationPending");function Bw(){let{reviewNotice:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Te,{size:"xs",variant:"quiet",disabled:e.disabled,onClick:e.onClick,children:e.label}):null}a(Bw,"AgentConversationNotice");function Nw(){let{interactions:e}=agentUi.useAgentConversationData();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.blocking&&ye.createElement(Ra,{...e.blocking,key:e.blocking.key}),e.approvals?.map(({id:t,...o})=>jsxRuntime.jsx(Ws,{...o},t)),e.form&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.form.authorization&&jsxRuntime.jsx(Te,{onClick:e.form.authorization.onClick,children:e.form.authorization.label}),jsxRuntime.jsx(Ws,{...e.form},e.form.id)]}),e.unsupported&&jsxRuntime.jsxs("div",{role:"status",children:[jsxRuntime.jsx(lp,{status:"running",active:e.unsupported.label,rows:[]}),jsxRuntime.jsx(Te,{disabled:e.unsupported.disabled,onClick:e.unsupported.onStop,children:e.unsupported.stopLabel})]})]})}a(Nw,"AgentConversationInteractions");function Ew({panel:e,files:t,error:o}){return jsxRuntime.jsx(ni,{...e,footer:o?jsxRuntime.jsx(tu,{message:o}):void 0,children:jsxRuntime.jsx(ri,{...t})})}a(Ew,"AgentConversationArtifactList");function Iw({data:e}){return jsxRuntime.jsx(Ew,{...e.useData()})}a(Iw,"ArtifactBinding");function Dw(){let e=agentUi.useAgentConversationData();return jsxRuntime.jsx(Iw,{data:e.artifacts})}a(Dw,"AgentConversationArtifacts");function Lw({data:e,canvas:t,markdown:o,onMarkdownSourceSelected:n}){let r=e.useData(),i=a(c=>{let u=r.workspace.artifacts.find(p=>p.id===c),m=u&&r.contents.find(p=>p.id===u.id);return u?.kind==="markdown"&&m?.kind==="artifact"?m.document?.source??null:null},"sourceFor"),s=i(r.workspace.activeArtifactId),l=JSON.stringify(s),d=ye.useRef(n);return d.current=n,ye.useEffect(()=>{d.current&&Promise.resolve(d.current(s)).catch(()=>{});},[l]),jsxRuntime.jsx(Ic,{conversation:r.conversation,workspace:{...r.workspace,density:"compact",tabBar:"flush",onIntent:a(c=>{c.type==="select"&&n&&Promise.resolve(n(i(c.artifactId))).catch(()=>{}),r.workspace.onIntent?.(c);},"onIntent"),renderArtifact:a(c=>{if(c.id==="agent-session-canvas")return jsxRuntime.jsx(is,{children:t});let u=r.contents.find(m=>m.id===c.id);return u?u.kind==="artifact"&&u.document&&o?jsxRuntime.jsx(_s.Provider,{value:u.document,children:o},u.id):u.kind==="data"?jsxRuntime.jsx(zw,{data:u.data},u.id):jsxRuntime.jsx(Ow,{data:u.data},u.id):null},"renderArtifact")}})}a(Lw,"WorkspaceBinding");function zw({data:e}){return jsxRuntime.jsx(Iu,{...e.useData()})}a(zw,"LinkedBinding");function Ow({data:e}){return jsxRuntime.jsx(ur,{...e.useData()})}a(Ow,"PreviewBinding");function Hw({canvas:e,markdown:t,onMarkdownSourceSelected:o}){let n=agentUi.useAgentConversationData();return jsxRuntime.jsx(Lw,{data:n.workspace,canvas:n.canvasOpen?e:void 0,markdown:t,onMarkdownSourceSelected:o})}a(Hw,"AgentConversationWorkspace");function Ww({data:e}){return jsxRuntime.jsx(Lu,{...e.useData()})}a(Ww,"CanvasBinding");function Fw(){let{canvas:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(Ww,{data:e},e.key):null}a(Fw,"AgentConversationCanvas");function _w({data:e}){return jsxRuntime.jsx(Ms,{...e.useData()})}a(_w,"CollectionBinding");function Uw(){let{collection:e}=agentUi.useAgentConversationData();return e?jsxRuntime.jsx(_w,{data:e}):null}a(Uw,"AgentConversationCollection");function UE({canvas:e}){return jsxRuntime.jsx(kw,{preview:jsxRuntime.jsx(Hw,{canvas:e??jsxRuntime.jsx(Fw,{})}),overlays:jsxRuntime.jsx(Uw,{}),children:jsxRuntime.jsx(ww,{header:jsxRuntime.jsx(Sw,{}),prompt:jsxRuntime.jsx($w,{}),questions:jsxRuntime.jsx(Rw,{}),progress:jsxRuntime.jsx(Mw,{}),notice:jsxRuntime.jsx(Bw,{}),interactions:jsxRuntime.jsx(Nw,{}),pending:jsxRuntime.jsx(Aw,{}),artifacts:jsxRuntime.jsx(Dw,{})})})}a(UE,"AgentConversationDefaultView");
|
|
268
268
|
|
|
269
269
|
exports.AgentArtifactLayout = _i;
|
|
270
270
|
exports.AgentCanvasView = Lu;
|