@markus-global/cli 0.12.3-rc.0 → 0.12.3-rc.2
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/commands/start.js +1 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/markus.mjs +2298 -2034
- package/dist/web-ui/assets/{AsyncState-Co9o9Bjm.js → AsyncState-DlUYNJNs.js} +1 -1
- package/dist/web-ui/assets/ChatComponents-Buxli2VA.js +12 -0
- package/dist/web-ui/assets/{ContentRenderer-B9gsL4I6.js → ContentRenderer-Dry2nbFd.js} +2 -2
- package/dist/web-ui/assets/{DeliverableShareModal-BUdo2qSE.js → DeliverableShareModal-C5hu0BwE.js} +1 -1
- package/dist/web-ui/assets/{Deliverables-CDBY53C5.js → Deliverables-KM6_2Vwj.js} +1 -1
- package/dist/web-ui/assets/{MarkdownMessage-C3gog80t.js → MarkdownMessage-BU1Z2MSr.js} +1 -1
- package/dist/web-ui/assets/{Search-DClPgzaq.js → Search-Dk7IVqDd.js} +1 -1
- package/dist/web-ui/assets/{SendToChat-A26aOPb3.js → SendToChat-CLVw1mNM.js} +1 -1
- package/dist/web-ui/assets/{Settings-BZ8jYVDO.js → Settings-BDFR0Z_o.js} +1 -1
- package/dist/web-ui/assets/{Store-Djm15pAq.js → Store-DSubNdbJ.js} +1 -1
- package/dist/web-ui/assets/{Switch-BsePV-zC.js → Switch-CE_QndUQ.js} +1 -1
- package/dist/web-ui/assets/{Team-BhwiXwfp.js → Team-lUUZwXVm.js} +38 -38
- package/dist/web-ui/assets/Work-skYgAZu2.js +142 -0
- package/dist/web-ui/assets/{arc-DLLbWPzU.js → arc-CzLCxbPi.js} +1 -1
- package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-DHB20fXN.js → architectureDiagram-3BPJPVTR-Bjt1eu5I.js} +1 -1
- package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-hGFNjiSE.js → blockDiagram-GPEHLZMM-5t_XsWP-.js} +1 -1
- package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-CpsBleVs.js → c4Diagram-AAUBKEIU-DC4yhIA-.js} +1 -1
- package/dist/web-ui/assets/channel-Dr_j_eV7.js +1 -0
- package/dist/web-ui/assets/{chunk-2J33WTMH-txB49n9B.js → chunk-2J33WTMH-DpBVR8wv.js} +1 -1
- package/dist/web-ui/assets/{chunk-4BX2VUAB-ceih3NkH.js → chunk-4BX2VUAB-CRHzHTTM.js} +1 -1
- package/dist/web-ui/assets/{chunk-55IACEB6-Bim3xVp2.js → chunk-55IACEB6-BiE1vYDP.js} +1 -1
- package/dist/web-ui/assets/{chunk-727SXJPM-CrMJuX-q.js → chunk-727SXJPM-C62sZl96.js} +1 -1
- package/dist/web-ui/assets/{chunk-AQP2D5EJ-Dx-Cmb2E.js → chunk-AQP2D5EJ-BWltDJW9.js} +1 -1
- package/dist/web-ui/assets/{chunk-FMBD7UC4-CQr40Nnm.js → chunk-FMBD7UC4-Djfb2_hP.js} +1 -1
- package/dist/web-ui/assets/{chunk-ND2GUHAM-BwcD6_Y7.js → chunk-ND2GUHAM-B5S005b9.js} +1 -1
- package/dist/web-ui/assets/{chunk-QZHKN3VN-Byaq12B1.js → chunk-QZHKN3VN-CHbAcqJY.js} +1 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-DnBTgapK.js +1 -0
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-DnBTgapK.js +1 -0
- package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-CLXxIaDa.js → cose-bilkent-S5V4N54A-BkLxosxB.js} +1 -1
- package/dist/web-ui/assets/{dagre-BM42HDAG-DdXf9urh.js → dagre-BM42HDAG-D3u0UzhI.js} +1 -1
- package/dist/web-ui/assets/{diagram-2AECGRRQ-smJ2CryU.js → diagram-2AECGRRQ-CI9nnxn2.js} +1 -1
- package/dist/web-ui/assets/{diagram-5GNKFQAL-D9J88vfp.js → diagram-5GNKFQAL-CcHQ4hSh.js} +1 -1
- package/dist/web-ui/assets/{diagram-KO2AKTUF-DFW95y1-.js → diagram-KO2AKTUF-DdULvZjD.js} +1 -1
- package/dist/web-ui/assets/{diagram-LMA3HP47-B8RJaXa8.js → diagram-LMA3HP47-CInbHt1K.js} +1 -1
- package/dist/web-ui/assets/{diagram-OG6HWLK6-CRDK8ZKU.js → diagram-OG6HWLK6-B29d5ucM.js} +1 -1
- package/dist/web-ui/assets/{docx-preview-DOe2cigo.js → docx-preview-ChWyJtz_.js} +1 -1
- package/dist/web-ui/assets/{erDiagram-TEJ5UH35-7cnIAhD9.js → erDiagram-TEJ5UH35-CJnS1EyG.js} +1 -1
- package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-Cdc7tjsm.js → flowDiagram-I6XJVG4X-B2WoYwwl.js} +1 -1
- package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-BVMk6ZGl.js → ganttDiagram-6RSMTGT7-DPV693xk.js} +1 -1
- package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-Bu7IjszT.js → gitGraphDiagram-PVQCEYII-3D2euYF9.js} +1 -1
- package/dist/web-ui/assets/{index-BY_HjdWI.js → index-BdiEUYQB.js} +65 -65
- package/dist/web-ui/assets/index-CjwBVJDR.css +1 -0
- package/dist/web-ui/assets/{infoDiagram-5YYISTIA-B1PiHzF5.js → infoDiagram-5YYISTIA-BWUbt7Jc.js} +1 -1
- package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-Bkz8bgJH.js → ishikawaDiagram-YF4QCWOH-BE3afH_7.js} +1 -1
- package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-DnxZwAvG.js → journeyDiagram-JHISSGLW-CDm95QAx.js} +1 -1
- package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-CfmP8vuE.js → kanban-definition-UN3LZRKU-c0jOBZCa.js} +1 -1
- package/dist/web-ui/assets/{mermaid.core-CVQWE7ug.js → mermaid.core-c5cZjaP1.js} +5 -5
- package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-CwURI_4d.js → mindmap-definition-RKZ34NQL-BbsAVFCx.js} +1 -1
- package/dist/web-ui/assets/{pieDiagram-4H26LBE5-DhtzkQBJ.js → pieDiagram-4H26LBE5-DyXBINfp.js} +1 -1
- package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-DyCAqF3Q.js → quadrantDiagram-W4KKPZXB-gMRWTBzV.js} +1 -1
- package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-DXlQ98TY.js → requirementDiagram-4Y6WPE33-OWjUHVO4.js} +1 -1
- package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-Cymt2A_C.js → sankeyDiagram-5OEKKPKP-CsIAucjq.js} +1 -1
- package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-UcPHNPcv.js → sequenceDiagram-3UESZ5HK-BbxZog_d.js} +1 -1
- package/dist/web-ui/assets/{stateDiagram-AJRCARHV-4YyVx5n7.js → stateDiagram-AJRCARHV-CfNPAfJc.js} +1 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-BhOU2GYL.js +1 -0
- package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-B9XFBLaA.js → timeline-definition-PNZ67QCA-BSO--1Kk.js} +1 -1
- package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-Cn1fCIU1.js → vennDiagram-CIIHVFJN-FBig_P4B.js} +1 -1
- package/dist/web-ui/assets/{wardley-L42UT6IY-CZB5Iwi7.js → wardley-L42UT6IY-BSFxmcZr.js} +1 -1
- package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-NHaRrC9h.js → wardleyDiagram-YWT4CUSO-KgYOT0P6.js} +1 -1
- package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-415yqDyz.js → xychartDiagram-2RQKCTM6-TiGfFomq.js} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/docs/fixes/2026-11-12-session-expiry-and-mention-thinking.md +108 -0
- package/package.json +1 -1
- package/dist/web-ui/assets/ChatComponents-CuWlVFJz.js +0 -12
- package/dist/web-ui/assets/Work-C0v0dHzp.js +0 -142
- package/dist/web-ui/assets/channel-ehfg-vdK.js +0 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-D7qJkeZM.js +0 -1
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-D7qJkeZM.js +0 -1
- package/dist/web-ui/assets/index-CnyolIne.css +0 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-D-aZF8vI.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{u as Ze,j as e,r as a,a as As,b as Ms,Q as $s,R as is,c as Ds,k as h,U as Ct,V as os,W as Vs,P as I,n as te,X as Hs,Y as Fs,Z as Ws,h as _s,i as cs,N as Us}from"./index-
|
|
1
|
+
import{u as Ze,j as e,r as a,a as As,b as Ms,Q as $s,R as is,c as Ds,k as h,U as Ct,V as os,W as Vs,P as I,n as te,X as Hs,Y as Fs,Z as Ws,h as _s,i as cs,N as Us}from"./index-BdiEUYQB.js";import{MarkdownMessage as It}from"./MarkdownMessage-BU1Z2MSr.js";import{resolveFormat as Os,ContentRenderer as Ks}from"./ContentRenderer-Dry2nbFd.js";import{c as zs,a as Gs,D as Ys}from"./DeliverableShareModal-C5hu0BwE.js";import{S as qs,s as Qs}from"./SendToChat-CLVw1mNM.js";import"./chatChips-DVIRVTpT.js";function M(o){return Array.isArray(o)?o.map(d=>String(d).trim()).filter(Boolean):typeof o=="string"&&o?o.split(",").map(d=>d.trim()).filter(Boolean):[]}function Xs(o){return o.files&&typeof o.files=="object"&&!Array.isArray(o.files)?o.files:null}function se({label:o,value:d}){return d?e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:o}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:d})]}):null}function he({label:o,value:d,color:u}){if(!d)return null;const s={purple:"bg-brand-500/15 text-brand-500",cyan:"bg-blue-500/15 text-blue-600",indigo:"bg-brand-500/15 text-brand-500",gray:"bg-gray-500/15 text-fg-secondary",emerald:"bg-green-500/15 text-green-600"};return e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:o}),e.jsx("div",{className:`mt-0.5 px-2 py-0.5 rounded-full text-[10px] font-medium ${s[u]??s.gray} capitalize inline-block`,children:d})]})}function Lt({files:o}){const{t:d}=Ze(["builder","common"]),[u,s]=a.useState(Object.keys(o)[0]??""),c=Object.keys(o);return c.length===0?null:e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:d("builder:artifact.files",{count:c.length})}),e.jsxs("div",{className:"mt-1 bg-surface-elevated/50 rounded-lg border border-border-default/30 overflow-hidden",children:[e.jsx("div",{className:"flex gap-0.5 px-1.5 py-1 border-b border-border-default/30 overflow-x-auto",children:c.map(b=>e.jsx("button",{onClick:()=>s(b),className:`px-2 py-0.5 text-[10px] rounded whitespace-nowrap transition-colors ${u===b?"bg-brand-600/30 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:b},b))}),u&&o[u]!=null&&e.jsx("pre",{className:"p-2 text-[10px] text-fg-secondary max-h-[120px] overflow-auto whitespace-pre-wrap font-mono",children:o[u]})]})]})}function Zs({artifact:o,mode:d}){const{t:u}=Ze(["builder","common"]),s=Xs(o),c=o.agent,b=o.team,S=o.dependencies,w=o.displayName??o.name;if(d==="agent"){const j=c?.roleName,P=c?.agentRole,k=c?.llmProvider,R=c?.llmModel,g=M(S?.env),E=M(S?.skills);return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(se,{label:u("builder:artifact.name"),value:w}),e.jsx(se,{label:u("builder:artifact.description"),value:o.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[j&&e.jsx(he,{label:u("builder:artifact.baseTemplate"),value:j,color:"indigo"}),e.jsx(he,{label:u("builder:artifact.agentRole"),value:P,color:P==="manager"?"purple":"cyan"})]}),M(o.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(o.tags).map(N=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:N},N))}),(k||R)&&e.jsxs("div",{className:"flex gap-2",children:[k&&e.jsx(he,{label:u("builder:artifact.llmProvider"),value:k,color:"gray"}),R&&e.jsx(he,{label:u("builder:artifact.llmModel"),value:R,color:"gray"})]}),g.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:u("builder:artifact.requiredEnv")}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(N=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-amber-500/10 text-amber-600 rounded font-mono",children:N},N))})]}),E.length>0&&e.jsx(se,{label:u("builder:artifact.skills"),value:E.join(", ")}),s&&e.jsx(Lt,{files:s})]})}if(d==="team"){const P=b?.members??[];return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(se,{label:u("builder:artifact.name"),value:w}),e.jsx(se,{label:u("builder:artifact.description"),value:o.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(he,{label:u("builder:artifact.category"),value:o.category,color:"indigo"})}),M(o.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(o.tags).map(k=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:k},k))}),s&&e.jsx(Lt,{files:s}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:u("builder:artifact.members",{count:P.length})}),e.jsx("div",{className:"mt-1.5 space-y-1.5",children:P.map((k,R)=>e.jsxs("div",{className:"bg-surface-elevated/30 rounded-lg px-2 py-1.5 border border-border-default/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center text-[10px] font-bold ${k.role==="manager"?"bg-brand-500/20 text-brand-500":"bg-blue-500/20 text-blue-600"}`,children:k.role==="manager"?"★":R+1}),e.jsx("span",{className:"text-xs text-fg-secondary flex-1 truncate",children:k.name}),typeof k.roleName=="string"&&k.roleName&&e.jsx("span",{className:"text-[10px] text-brand-500/70 font-mono",children:k.roleName}),e.jsxs("span",{className:"text-[10px] text-fg-tertiary",children:["x",String(k.count??1)]})]}),M(k.skills).length>0&&e.jsx("div",{className:"mt-1 ml-7 flex flex-wrap gap-1",children:M(k.skills).map(g=>e.jsx("span",{className:"px-1 py-0.5 text-[9px] bg-green-500/10 text-green-600 rounded font-mono",children:g},g))})]},R))})]})]})}return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(se,{label:u("builder:artifact.name"),value:w}),e.jsx(se,{label:u("builder:artifact.description"),value:o.description}),e.jsx("div",{className:"flex gap-2",children:e.jsx(he,{label:u("builder:artifact.category"),value:o.category,color:"indigo"})}),s&&e.jsx(Lt,{files:s}),M(o.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(o.tags).map(j=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:j},j))})]})}function Qe(o){const d=document.scrollingElement,s=!!o&&o.scrollHeight>o.clientHeight+1?o:d,c=s?.scrollTop??0,b=s?.clientHeight??window.innerHeight,S=s?.scrollHeight??document.body.scrollHeight;return{scrollTop:c,clientHeight:b,scrollHeight:S,atTop:c<=0,atBottom:c+b>=S-1}}function Js(o){return window.addEventListener("scroll",o,{passive:!0,capture:!0}),()=>window.removeEventListener("scroll",o,{capture:!0})}const me={file:{icon:"📄",color:"bg-green-500/10 text-green-600"},directory:{icon:"📁",color:"bg-blue-500/10 text-blue-600"}},er=["file","directory"];function Xe(o){return/^https?:\/\//i.test(o)}function L(o){return o?.shareStatus??null}function tr(o,d){const u=Date.now(),s=new Date(o).getTime(),c=u-s,b=Math.floor(c/6e4);if(b<1)return d("time.justNow");if(b<60)return d("time.minutesAgo",{count:b});const S=Math.floor(b/60);if(S<24)return d("time.hoursAgo",{count:S});const w=Math.floor(S/24);if(w===1)return d("time.yesterday");if(w<30)return d("time.daysAgo",{count:w});const j=Math.floor(w/30);return j<12?d("time.monthsAgo",{count:j}):d("time.yearsAgo",{count:Math.floor(j/12)})}function Rt(o){const d=o.title?.trim()||o.id;return{kind:"deliverable",label:`📄 ${Qs(d)}`,content:["[deliverable]",`ID: ${o.id}`,`Title: ${o.title??""}`,o.reference?`Reference: ${o.reference}`:"",o.taskId?`Task: ${o.taskId}`:"",o.projectId?`Project: ${o.projectId}`:""].filter(Boolean).join(`
|
|
2
2
|
`)}}const z={agent:{icon:"✦",color:"bg-brand-500/10 text-brand-500"},team:{icon:"◈",color:"bg-blue-500/10 text-blue-600"},skill:{icon:"⬡",color:"bg-amber-500/10 text-amber-600"}};function cr({authUser:o,previewMode:d,previewData:u}={}){const{t:s}=Ze(["deliverables","common"]),c=As(),b=Ms(I.DELIVERABLES),S=$s({side:"left",defaultWidth:384,minWidth:280,maxWidth:600,storageKey:"markus_deliverables_list"}),[w,j]=a.useState(!1),P=a.useRef(w);P.current=w,a.useEffect(()=>(is(I.DELIVERABLES,c&&w?1:0),()=>is(I.DELIVERABLES,0)),[c,w]),a.useEffect(()=>{if(!c)return;const t=()=>{P.current&&j(!1)};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[c]);const k=20,R=60,[g,E]=a.useState(u?.items??[]),[N,D]=a.useState(u?.items?.length??0),[m,re]=a.useState(!1),[Je,Et]=a.useState(u?.projects??[]),[et,Pt]=a.useState(u?.agents??[]),[us,xs]=a.useState([]),[fs,Tt]=a.useState(!1),[Bt,hs]=a.useState([]),[G,At]=a.useState(!u),[Te,Be]=a.useState(""),[ge,Ae]=a.useState(""),[V,be]=a.useState(""),[H,ye]=a.useState(""),[F,W]=a.useState(""),[ne,Me]=a.useState(""),[ms,tt]=a.useState(!1),[$,ps]=a.useState("date"),[n,T]=a.useState(()=>u?.initialSelectedId&&u.items?u.items.find(t=>t.id===u.initialSelectedId)??u.items[0]??null:u?.items?.[0]??null),[st,Mt]=a.useState(null),[$t,Dt]=a.useState(""),[Y,gs]=a.useState(!0),[rt,ve]=a.useState(()=>{const t=new Date,r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return new Set([r])}),[nt,bs]=a.useState(!1),[at,Vt]=a.useState(!1),ae=a.useRef(null),[$e,le]=a.useState(null),[De,Ht]=a.useState("markdown"),[je,lt]=a.useState(null),[ke,it]=a.useState(null),[ie,ot]=a.useState(null),[q,we]=a.useState(null),[ct,oe]=a.useState(!1),[Ft,Q]=a.useState(!1),[Ne,Wt]=a.useState(!1),[_t,Ve]=a.useState(null),[dt,He]=a.useState(null),[ut,Fe]=a.useState(null),[ys,xt]=a.useState(!1),[ft,vs]=a.useState(""),[Ut,js]=a.useState(new Set),Ot=ie&&n?.type==="file",We=Ot||!!q&&n?.type==="directory",[_,X]=a.useState(!1),A=Ds(),ce=A?.keyboardPane??"content",[Se,de]=a.useState(null),[ue,Z]=a.useState(!1),[Ce,ht]=a.useState(""),[U,J]=a.useState(!1),[mt,Kt]=a.useState(!1),[pt,ee]=a.useState(null),gt=a.useRef(null),zt=a.useCallback(t=>{t&&(t.style.height="auto",t.style.height=t.scrollHeight+"px")},[]),Gt=a.useRef(void 0);a.useEffect(()=>{zt(gt.current)},[Ce,ue,zt]);const B=(t,r)=>{Mt({type:t,text:r}),setTimeout(()=>Mt(null),3e3)},_e=async t=>{await Us(t)?(Wt(!0),setTimeout(()=>Wt(!1),1500)):B("error",s("detail.copyFailed"))},Ue=a.useMemo(()=>new Map(et.map(t=>[t.id,t])),[et]),bt=a.useMemo(()=>new Map(Je.map(t=>[t.id,t])),[Je]),Yt=a.useMemo(()=>new Map(Bt.map(t=>[t.id,t])),[Bt]),Ie=a.useCallback(t=>{if(!t||t==="default")return null;const r=bt.get(t)?.name;return!r||r==="default"?null:r},[bt]);a.useEffect(()=>{d||(h.projects.list().then(t=>Et(t.projects)).catch(()=>{}),h.agents.list().then(t=>Pt(t.agents??[])).catch(()=>{}),h.users.list().then(t=>xs(t.users??[])).catch(()=>{}),h.teams.list().then(t=>hs(t.teams??[])).catch(()=>{}),h.system.info().then(t=>vs(t.dataDir+"/shared")).catch(()=>{}),h.deliverables.checkHealth().then(t=>js(new Set(t.missingFiles))).catch(()=>{}))},[d]),a.useEffect(()=>(Gt.current=setTimeout(()=>Ae(Te),300),()=>clearTimeout(Gt.current)),[Te]);const xe=a.useMemo(()=>({q:ge||void 0,projectId:ne||void 0,type:V||void 0,artifactType:H||void 0,source:F||void 0}),[ge,V,H,ne,F]),fe=$==="date"?k:R,yt=a.useCallback((t,r)=>r?{...r,hubShareId:r.hubShareId!=null?r.hubShareId:t.hubShareId??null,shareStatus:r.shareStatus!=null?r.shareStatus:t.shareStatus??null,shareUrl:r.shareUrl!=null?r.shareUrl:t.shareUrl??null,shareVisibility:r.shareVisibility!=null?r.shareVisibility:t.shareVisibility??null,shareReason:r.shareReason!=null?r.shareReason:t.shareReason}:t,[]),Oe=a.useCallback(async()=>{try{const{results:t,total:r}=await h.deliverables.search({...xe,offset:0,limit:fe});E(i=>i.map(l=>{const f=t.find(x=>x.id===l.id);return f?yt(l,f):l})),D(r),T(i=>{if(!i)return null;const l=t.find(f=>f.id===i.id);return l?yt(i,l):i})}catch{}},[xe,fe,yt]),O=a.useCallback(async()=>{At(!0),ae.current?.scrollTo({top:0,behavior:"instant"}),window.scrollY>0&&window.scrollTo({top:0,behavior:"instant"});try{const{results:t,total:r}=await h.deliverables.search({...xe,offset:0,limit:fe});E(t),D(r),T(i=>i&&t.some(l=>l.id===i.id)?i:null)}catch{E([]),D(0),T(null)}At(!1)},[xe,fe]),Ke=a.useCallback(async()=>{if(!(m||g.length>=N)){re(!0);try{const{results:t,total:r}=await h.deliverables.search({...xe,offset:g.length,limit:fe});E(i=>[...i,...t]),D(r)}catch{}re(!1)}},[xe,fe,g.length,N,m]);a.useEffect(()=>{d||O()},[O,d]),a.useEffect(()=>{!d||!u||(E(u.items??[]),D(u.items?.length??0),Et(u.projects??[]),Pt(u.agents??[]),u.initialSelectedId&&T(u.items?.find(t=>t.id===u.initialSelectedId)??u.items?.[0]??null))},[d,u]);const vt=a.useRef(n);vt.current=n,a.useEffect(()=>{if(d||!b)return;const t=Ct.on("deliverable:created",()=>O()),r=Ct.on("deliverable:updated",l=>{Oe();const f=l.payload?.deliverableId;f&&vt.current?.id===f&&h.deliverables.get(f).then(x=>{x.deliverable&&(T(p=>({...p??x.deliverable,...x.deliverable,hubShareId:p?.hubShareId??x.deliverable.hubShareId??null,shareStatus:p?.shareStatus??x.deliverable.shareStatus??null,shareUrl:p?.shareUrl??x.deliverable.shareUrl??null,shareVisibility:p?.shareVisibility??x.deliverable.shareVisibility??null,shareReason:p?.shareReason??x.deliverable.shareReason??null})),Xt(x.deliverable))}).catch(()=>{})}),i=Ct.on("deliverable:removed",()=>O());return()=>{t(),r(),i()}},[Oe,b,d]);const qt=a.useMemo(()=>zs(os,_s.getUrl()),[]);a.useEffect(()=>{if(d||!b||!os())return;let t=!1;const r=async()=>{try{const l=await qt.listMine();if(t)return;const f=new Map,x=new Map;for(const v of l)v.id&&f.set(v.id,v),v.localId&&x.set(v.localId,v);const p=new Map;E(v=>v.map(y=>{const C=y.hubShareId&&f.get(y.hubShareId)||x.get(y.id);if(!C)return y;const Pe={hubShareId:y.hubShareId??C.id??null,shareStatus:C.status??null,shareUrl:C.url??null,shareVisibility:y.shareVisibility??C.visibility??null,...C.reason!=null?{shareReason:C.reason}:{}};return p.set(y.id,Pe),{...y,...Pe}})),T(v=>{if(!v)return v;const y=p.get(v.id);return y?{...v,...y}:v});for(const[v,y]of p)h.deliverables.update(v,y).catch(C=>{console.warn("[deliverables] Hub 分享状态本地持久化失败:",C)})}catch{}};r();const i=setInterval(r,3e4);return()=>{t=!0,clearInterval(i)}},[qt,b,d]);const ze=a.useRef(null),jt=a.useRef(g);jt.current=g;const Le=a.useCallback(t=>{const r=l=>{T(l),c&&(j(!0),history.pushState({mobileDetail:I.DELIVERABLES},"",window.location.hash))},i=jt.current.find(l=>l.id===t);if(i){r(i);return}h.deliverables.get(t).then(l=>{l.deliverable&&r(l.deliverable)}).catch(()=>{})},[c]);a.useEffect(()=>{if(d)return;const t=window.location.hash.slice(1).split("/"),r=Vs(t[0])===I.DELIVERABLES?t[1]:void 0,i=localStorage.getItem("markus_nav_projectId"),l=localStorage.getItem("markus_nav_source");i&&(localStorage.removeItem("markus_nav_projectId"),Me(i)),(l==="knowledge"||l==="agent")&&(localStorage.removeItem("markus_nav_source"),W(l));const f=localStorage.getItem("markus_nav_openDeliverable")||r;f&&(localStorage.removeItem("markus_nav_openDeliverable"),jt.current.length>0?Le(f):ze.current=f);const x=p=>{const y=p.detail?.params;y?.projectId&&Me(y.projectId),(y?.source==="knowledge"||y?.source==="agent")&&W(y.source),y?.openDeliverable&&(localStorage.removeItem("markus_nav_openDeliverable"),Le(y.openDeliverable))};return window.addEventListener("markus:navigate",x),()=>window.removeEventListener("markus:navigate",x)},[Le,d]),a.useEffect(()=>{const t=ze.current;!t||g.length===0||(ze.current=null,Le(t))},[g,Le]);const Qt=a.useCallback(()=>{const t=ae.current;if(!t||G||m||g.length>=N)return;const r=Qe(t);r.scrollHeight<=r.clientHeight+100&&Ke()},[G,m,g.length,N,Ke]);a.useEffect(()=>Js(()=>{Qe(ae.current).atBottom&&Ke()}),[Ke]),a.useEffect(()=>{Qt()},[Qt,Y,rt]);const K=a.useMemo(()=>{const t=new Map;for(const i of g){let l,f;if($==="project"){const x=Ie(i.projectId);l=x?i.projectId??"_none":"_none",f=x??s("noProject")}else if($==="team"){const p=(i.agentId?Ue.get(i.agentId):void 0)?.teamId??"_none";l=p,f=p!=="_none"?Yt.get(p)?.name??p:s("noTeam")}else if($==="agent")l=i.agentId??"_none",f=i.agentId?Ue.get(i.agentId)?.name??i.agentId:s("common:unknown");else{const x=new Date(i.updatedAt);l=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}-${String(x.getDate()).padStart(2,"0")}`,f=l}t.has(l)||t.set(l,{label:f,items:[]}),t.get(l).items.push(i)}const r=[...t.entries()];return $==="date"?r.sort((i,l)=>l[0].localeCompare(i[0])):r.sort((i,l)=>i[1].label.localeCompare(l[1].label)),r},[g,$,bt,Ue,Yt,s]);a.useEffect(()=>{if($==="date"&&Y){const t=new Date,r=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;ve(new Set([r]))}else ve(new Set)},[$]);const ks=async t=>{Dt("remove");try{await h.deliverables.remove(t.id),B("success",s("removed")),T(null),O()}catch(r){B("error",s("common:error",{message:String(r)}))}Dt("")},ws=a.useCallback(t=>{const r=vt.current,i=r?.id;if(!i)return;const l={hubShareId:t.id??null,shareStatus:t.status??null,shareUrl:t.url??null,shareVisibility:t.visibility??null,...t.reason!=null||t.status==="rejected"?{shareReason:t.reason??r?.shareReason??null}:{}},f={...l,shareStatus:l.shareStatus??r?.shareStatus??null};T(x=>x&&x.id===i?{...x,...f}:x),E(x=>x.map(p=>p.id===i?{...p,...f}:p)),(async()=>{try{await h.deliverables.update(i,l)}catch(x){console.warn("[deliverables] 分享状态本地回写失败,将由 Hub 轮询补偿:",x)}Oe()})()},[Oe]),Ns=()=>{te.navigate(I.BUILDER)},Re=a.useCallback(async(t,r,i)=>{if(t.type==="directory"&&Array.isArray(t.entries))we({path:t.path,name:t.name,entries:t.entries});else if(t.type==="image"&&t.mimeType){const l=t.streamUrl||(t.path?h.files.streamUrl(t.path):h.files.streamUrl(r));lt({src:l,name:t.name})}else if(t.type==="audio"||t.type==="video"){const l=t.streamUrl||(t.path?h.files.streamUrl(t.path):h.files.streamUrl(r));it({kind:t.type,src:l,name:t.name})}else if(t.type==="office"){const l=t.streamUrl||(t.path?h.files.streamUrl(t.path):h.files.streamUrl(r));ot({format:t.format||String(t.extension||"").replace(/^\./,"")||"pdf",streamUrl:l,name:t.name,size:t.size,reference:t.path||r})}else t.type==="binary"?Q(!0):typeof t.content=="string"?(le(t.content),Ht(Os({format:i,reference:r,content:t.content}))):Q(!0)},[]),kt=a.useCallback(async t=>{oe(!0),le(null),lt(null),it(null),ot(null),Q(!1),we(null),Ve(null),He(null);try{const r=await h.files.preview(t);r.type==="directory"&&Array.isArray(r.entries)?we({path:r.path,name:r.name,entries:r.entries}):await Re(r,t)}catch{Q(!0)}oe(!1)},[Re]),Ss=a.useCallback(async(t,r)=>{oe(!0),Ve(r??null),He(t),we(null);try{const i=await h.files.preview(t);await Re(i,t)}catch{le(null),Q(!0)}oe(!1)},[Re]),Xt=async t=>{if(t.reference&&!Xe(t.reference)){if(t.type==="directory"){kt(t.reference);return}oe(!0);try{const r=await h.files.preview(t.reference);await Re(r,t.reference,t.format)}catch{le(null),t.type==="file"&&Q(!0)}oe(!1)}};a.useEffect(()=>{d||(le(null),Ht("markdown"),lt(null),it(null),ot(null),we(null),Q(!1),Ve(null),He(null),n&&Xt(n))},[n?.id,d]);const Zt=a.useCallback(t=>Y!==rt.has(t),[Y,rt]),Jt=K.length>0&&K.every(([t])=>Zt(t)),Cs=a.useCallback(t=>{ve(r=>{const i=new Set(r);return i.has(t)?i.delete(t):i.add(t),i})},[]),es=a.useCallback(t=>{ve(r=>{if(r.has(t)===Y)return r;const i=new Set(r);return Y?i.add(t):i.delete(t),i})},[Y]),Is=a.useCallback(()=>{gs(t=>!t),ve(new Set)},[]),Ge=!!(V||H||F||ne||ge),ts=a.useCallback(()=>{be(""),ye(""),W(""),Me(""),Be(""),Ae("")},[]),Ee=a.useMemo(()=>K.flatMap(([,t])=>t.items),[K]);a.useEffect(()=>{d||c||G||n||ze.current||Ee.length!==0&&T(Ee[0])},[d,c,G,n,Ee]);const wt=a.useRef(null);a.useEffect(()=>{if(!n){wt.current=null;return}if(wt.current===n.id)return;const t=K.find(([,r])=>r.items.some(i=>i.id===n.id));t&&(wt.current=n.id,es(t[0]))},[n?.id,K,es]);const ss=a.useRef(null),rs=a.useRef(null),Ye=a.useRef(!1),ns=a.useRef(ce);a.useEffect(()=>{if(d||c||!b)return;const t=ns.current;ns.current=ce,!(ce!=="l1"||t==="l1")&&_&&(Ye.current=!0,X(!1))},[ce,d,c,b,_]),a.useEffect(()=>{if(d||c||!b)return;const t=r=>{if(r.metaKey||r.ctrlKey){if(r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement){r.key==="Escape"&&(r.target.blur(),r.preventDefault());return}if(cs(r.target))return;if(r.key==="f"){r.preventDefault(),ss.current?.focus();return}if(r.key.toLowerCase()==="b"){r.preventDefault(),X(C=>{const Pe=!C;return Pe&&(Ye.current=!0,A?.setKeyboardPane("l1"),requestAnimationFrame(()=>rs.current?.focus())),Pe});return}if(r.key.toLowerCase()==="l"){r.preventDefault(),St();return}return r.altKey,void 0}if(A?.keyboardPane==="l0")return;if(r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement){r.key==="Escape"&&(r.target.blur(),r.preventDefault());return}if(cs(r.target)||r.metaKey||r.ctrlKey||r.altKey)return;const l=r.key.length===1?r.key.toLowerCase():r.key;if(l==="h"||l==="ArrowLeft"){r.preventDefault(),_&&X(!1),A?.setL0FocusPageId(I.DELIVERABLES),A?.setLeftCollapsed(!1),A?.setKeyboardPane("l0");return}if(l==="l"||l==="ArrowRight"){r.preventDefault(),_&&X(!1),A?.keyboardPane!=="l1"&&A?.setKeyboardPane("l1");return}const f=l==="j"||l==="ArrowDown"?1:l==="k"||l==="ArrowUp"?-1:0;if(!f)return;r.preventDefault(),A?.setKeyboardPane("l1"),_&&(Ye.current=!0,X(!1));const x=Ee;if(x.length===0)return;const p=n?x.findIndex(C=>C.id===n.id):-1,v=p<0?f>0?-1:0:p,y=Math.max(0,Math.min(x.length-1,v+f));as(x[y]),requestAnimationFrame(()=>{document.querySelector(`[data-deliverable-id="${x[y].id}"]`)?.scrollIntoView({block:"nearest"})})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[Ee,n,d,c,b,A,_]);const qe=a.useRef(null),Ls=a.useCallback(t=>{if(!c||!Qe(ae.current).atTop)return;const r=t.touches[0];r&&(qe.current={y:r.clientY,x:r.clientX})},[c]),Rs=a.useCallback(t=>{if(!c||!qe.current||at)return;const r=t.changedTouches[0],i=qe.current;if(qe.current=null,!r)return;const l=r.clientY-i.y,f=Math.abs(r.clientX-i.x);l<72||f>l||Qe(ae.current).atTop&&(Vt(!0),O().finally(()=>Vt(!1)))},[c,at,O]),as=t=>{const r=()=>{T(t),xt(!1),Z(!1),J(!1),c&&(j(!0),history.pushState({mobileDetail:I.DELIVERABLES},"",window.location.hash))};U?ee({action:r}):r()},Es=()=>{if(!U){const t=$e??n?.summary??"";ht(t)}Z(!0)},Ps=()=>{U?ee({action:()=>{Z(!1),J(!1)}}):Z(!1)},ls=async()=>{if(!(!n?.reference||mt)){Kt(!0);try{await h.files.write(n.reference,Ce),le(Ce),J(!1),Z(!1),B("success",s("detail.saved"))}catch(t){B("error",s("detail.saveFailed")+": "+String(t))}Kt(!1)}},Ts=()=>{Z(!1),J(!1),ee(null)};a.useEffect(()=>{if(!U)return;const t=r=>{r.preventDefault()};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[U]),a.useEffect(()=>{if(!U)return;const t=r=>{r.preventDefault(),r.stopImmediatePropagation(),ee({action:()=>{Z(!1),J(!1);const{page:i,params:l}=r.detail||{};i&&te.navigate(i,l)}})};return window.addEventListener("markus:navigate",t),()=>window.removeEventListener("markus:navigate",t)},[U]);const Nt=a.useRef(null),St=a.useCallback((t,r)=>{const i=n?.agentId??"",l=n?.id??"",f={};l&&(f.openDeliverable=l);const x=[];if(n&&x.push(Rt(n)),t?.trim()){const p=t.trim().length>40?`${t.trim().slice(0,24)}…${t.trim().slice(-12)}`:t.trim();if(r){const v=n?.reference??"";x.push({label:`🌐 ${p}`,content:["[html-selection]",`Text: "${t.trim()}"`,`CSS Selector: ${r.cssSelector}`,`XPath: ${r.xpath}`,v?`File: ${v}`:""].filter(Boolean).join(`
|
|
3
3
|
`)})}else x.push({label:`📝 ${p}`,content:t.trim()})}x.length>0&&(f.chatChips=JSON.stringify(x)),i&&(f.agentId=i),de(null),window.getSelection()?.removeAllRanges(),te.navigate(I.TEAM,f)},[n]),Bs=a.useCallback(t=>{if(!t.text.trim())return;const i=Nt.current?.querySelector("iframe")?.getBoundingClientRect(),l=(i?.left??0)+t.rect.x+t.rect.width/2,f=(i?.top??0)+t.rect.y;de({x:l,y:f,text:t.text,htmlMeta:{xpath:t.xpath,cssSelector:t.cssSelector}})},[]);return a.useEffect(()=>{const t=Nt.current;if(!t)return;const r=()=>{requestAnimationFrame(()=>{const l=window.getSelection(),f=l?.toString().trim();if(!f||!l?.rangeCount){de(null);return}const x=l.getRangeAt(0);if(!t.contains(x.commonAncestorContainer)){de(null);return}const p=x.getBoundingClientRect();de({x:p.left+p.width/2,y:p.top,text:f})})},i=l=>{const f=document.getElementById("selection-toolbar");f&&f.contains(l.target)||de(null)};return t.addEventListener("mouseup",r),document.addEventListener("mousedown",i),()=>{t.removeEventListener("mouseup",r),document.removeEventListener("mousedown",i)}},[]),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{ref:rs,tabIndex:-1,"data-keyboard-pane":"l1",className:`${c?"flex-1 min-w-0":"shrink-0"} flex flex-col bg-surface-secondary rounded-xl m-1 mr-0 outline-none ${!c&&ce==="l1"?"ring-1 ring-inset ring-brand-500/30":""}`,style:c?w?{display:"none"}:void 0:_?{display:"none"}:{width:S.width},children:[e.jsxs("div",{"data-electron-drag":!0,className:"p-4 space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c&&e.jsx(Hs,{}),!c&&e.jsx("button",{onClick:()=>X(!0),className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 bg-brand-500/15 text-brand-500 hover:bg-brand-500/25",title:s("sidebar.collapse"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsxs("h2",{className:"text-sm font-semibold text-fg-secondary truncate",children:[s("title"),N>0&&e.jsxs("span",{className:"ml-1.5 text-fg-tertiary font-normal",children:["(",N,")"]})]})]})}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:ss,value:Te,onChange:t=>Be(t.target.value),placeholder:s("searchPlaceholder"),className:"w-full bg-surface-elevated border border-border-default rounded-lg pl-8 pr-8 py-2 text-sm text-fg-primary focus:border-brand-500 focus:outline-none transition-colors"}),Te&&e.jsx("button",{onClick:()=>{Be(""),Ae("")},className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center rounded-full bg-surface-overlay text-fg-tertiary hover:text-fg-secondary transition-colors",children:e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),ft&&!c&&e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-surface-elevated rounded-lg text-[10px] text-fg-tertiary",children:[e.jsx("span",{className:"truncate font-mono",children:ft}),e.jsx("button",{onClick:()=>{h.system.openPath(ft)},className:"shrink-0 underline hover:text-fg-secondary transition-colors",children:s("common:open")})]}),c&&e.jsxs("button",{onClick:()=>bs(t=>!t),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors ${nt||Ge?"bg-brand-500/15 text-brand-500":"bg-surface-elevated text-fg-secondary"}`,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),e.jsx("line",{x1:"12",y1:"18",x2:"20",y2:"18"})]}),s("filters.filtersLabel"),Ge&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-brand-500"}),e.jsx("svg",{className:`w-3 h-3 ml-auto transition-transform ${nt?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),e.jsxs("div",{className:c&&!nt?"hidden":"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-hide filter-pills-fade",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:s("filters.source")}),e.jsx(pe,{label:s("filters.allSources"),value:"",current:F,onClick:()=>W("")}),e.jsx(pe,{label:s("filters.sourceAgent"),value:"agent",current:F,onClick:t=>W(t||"")}),e.jsx(pe,{label:s("filters.sourceKnowledge"),value:"knowledge",current:F,onClick:t=>W(t||"")}),e.jsxs("button",{type:"button",onClick:()=>tt(!0),className:"ml-auto shrink-0 flex items-center gap-1 px-2 py-1 rounded text-[10px] text-fg-tertiary hover:text-brand-500 hover:bg-surface-elevated transition-colors",title:s("filters.bindKnowledgeBase"),children:[e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),s("filters.bindKnowledgeBase")]})]}),e.jsxs("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide filter-pills-fade",children:[e.jsx(pe,{label:s("filters.allTypes"),value:"",current:V||H||"",onClick:()=>{be(""),ye("")}}),er.map(t=>e.jsx(pe,{label:`${me[t]?.icon??""} ${t}`,value:t,current:V,onClick:r=>{be(r),ye("")}},t)),["agent","team","skill"].map(t=>e.jsx(pe,{label:`${z[t].icon} ${s(`artifactTypes.${t}`)}`,value:t,current:H,onClick:r=>{ye(r),be("")}},t))]}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary",children:s("filters.group")}),["date","project","team","agent"].map(t=>e.jsx("button",{onClick:()=>{ps(t)},className:`px-2 py-1 rounded text-xs transition-colors ${$===t?"bg-brand-600 text-on-brand":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:s(`groupBy.${t}`)},t)),K.length>1&&e.jsx("button",{onClick:Is,className:"ml-auto px-1.5 py-1 rounded text-[10px] text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated transition-colors",title:s(Jt?"expandAllTooltip":"collapseAllTooltip"),children:s(Jt?"expandAll":"collapseAll")})]})]}),Ge&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[ge&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:["“",ge,"”",e.jsx("button",{onClick:()=>{Be(""),Ae("")},className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),V&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[me[V]?.icon," ",V,e.jsx("button",{onClick:()=>be(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),H&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[z[H]?.icon," ",s(`artifactTypes.${H}`),e.jsx("button",{onClick:()=>ye(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),F&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[s(F==="knowledge"?"filters.sourceKnowledge":"filters.sourceAgent"),e.jsx("button",{onClick:()=>W(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),ne&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[Ie(ne)??ne,e.jsx("button",{onClick:()=>Me(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("button",{onClick:ts,className:"text-[10px] text-fg-tertiary hover:text-brand-500 ml-auto transition-colors",children:s("filters.clearAll")})]})]}),st&&e.jsx("div",{className:`mx-4 mt-2 px-3 py-1.5 text-xs rounded-lg ${st.type==="success"?"bg-green-500/15 text-green-600":"bg-red-500/15 text-red-500"}`,children:st.text}),e.jsxs("div",{ref:ae,className:"flex-1 overflow-y-auto p-2 space-y-1 transition-opacity duration-150",style:{opacity:G?.5:1},onTouchStart:c?Ls:void 0,onTouchEnd:c?Rs:void 0,children:[at&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-brand-500",children:[e.jsx(ds,{})," ",e.jsx("span",{className:"text-[10px]",children:s("filters.refreshing")})]}),G?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(t=>e.jsxs("div",{className:"animate-pulse space-y-2",children:[e.jsx("div",{className:"h-4 bg-surface-elevated rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-surface-elevated rounded w-1/2"})]},t))}):g.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("svg",{className:"w-12 h-12 text-fg-muted mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),Ge?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:s("empty.noResults")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:s("empty.noResultsHint")}),e.jsx("button",{onClick:ts,className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-on-brand transition-colors",children:s("filters.clearAll")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:s("empty.title")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:s("empty.subtitle")}),e.jsx("button",{onClick:()=>te.navigate(I.WORK),className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-on-brand transition-colors",children:s("empty.goToWork")})]})]}):K.map(([t,r])=>{const i=Zt(t);return e.jsxs("div",{className:"mb-1 cv-row",children:[e.jsxs("button",{onClick:()=>Cs(t),className:"w-full flex items-center gap-1.5 px-2 py-2 rounded-md hover:bg-surface-elevated/50 transition-colors group/header border-b border-border-subtle/50",children:[e.jsx("svg",{className:`w-3 h-3 text-fg-tertiary transition-transform duration-200 shrink-0 ${i?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.jsx("span",{className:"text-[11px] font-semibold text-fg-tertiary uppercase tracking-wider truncate",children:r.label}),e.jsxs("span",{className:"text-[10px] text-fg-muted bg-surface-elevated px-1.5 py-0.5 rounded-full shrink-0",children:[r.items.length,g.length<N?"+":""]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-200 ${i?"max-h-0 opacity-0":"max-h-[5000px] opacity-100"}`,children:r.items.map(l=>e.jsx("button",{"data-deliverable-id":l.id,onClick:()=>as(l),className:`cv-row w-full text-left px-3 py-2 rounded-lg transition-all duration-150 ${n?.id===l.id?ce==="l1"?"bg-brand-500/25 ring-1 ring-inset ring-brand-500/40 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"bg-brand-600/15 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"hover:bg-surface-elevated/60 border-l-2 border-l-transparent border-y border-r border-transparent"}`,children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[l.artifactType&&z[l.artifactType]?e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium shrink-0 ${z[l.artifactType].color}`,children:z[l.artifactType].icon}):e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium uppercase shrink-0 ${me[l.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:me[l.type]?.icon??l.type.charAt(0)}),e.jsx("span",{className:"text-sm font-medium text-fg-primary truncate flex-1",children:l.title}),L(l)==="published"&&e.jsxs("svg",{className:"shrink-0 text-green-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":s("share.published",{defaultValue:"已发布到 Hub"}),children:[e.jsx("title",{children:s("share.published",{defaultValue:"已发布到 Hub"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),L(l)==="pending_review"&&e.jsxs("svg",{className:"shrink-0 text-amber-500 animate-pulse",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":s("share.pendingReview",{defaultValue:"Hub 审核中"}),children:[e.jsx("title",{children:s("share.pendingReview",{defaultValue:"Hub 审核中"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),L(l)==="rejected"&&e.jsxs("svg",{className:"shrink-0 text-red-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":s("share.rejected",{defaultValue:"Hub 已拒绝"}),children:[e.jsx("title",{children:s("share.rejected",{defaultValue:"Hub 已拒绝"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),Ut.has(l.id)&&e.jsx("span",{className:"shrink-0 text-amber-500",title:s("detail.fileMissing"),children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}),e.jsx("span",{className:"text-[10px] text-fg-muted shrink-0",children:tr(l.updatedAt,s)})]})},l.id))})]},t)}),m&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 text-fg-tertiary",children:[e.jsx(ds,{})," ",e.jsx("span",{className:"text-[10px]",children:s("common:loadingMore")})]}),!G&&g.length>0&&e.jsx("div",{className:"text-center text-[10px] text-fg-tertiary py-2",children:g.length<N?s("count.partial",{loaded:g.length,total:N}):s("count.total",{total:N})})]})]}),!c&&e.jsx("div",{className:"w-2 shrink-0 cursor-col-resize group relative flex items-center justify-center hover:bg-brand-500/5 transition-colors",onMouseDown:S.onResizeStart,children:e.jsxs("div",{className:"flex flex-col gap-1 items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"})]})}),(!c||w)&&e.jsxs("div",{"data-no-drag":!0,className:"flex-1 overflow-hidden min-w-0 flex relative self-stretch",children:[e.jsxs("div",{ref:Nt,className:"flex-1 overflow-y-auto min-w-0 h-full",children:[_&&!c&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-primary/80 backdrop-blur-sm px-4 py-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{Ye.current=!0,X(!1)},className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated",title:s("sidebar.expand"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsx("span",{className:"text-sm font-medium text-fg-secondary truncate",children:n?.title??s("detail.details")})]}),c&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-secondary px-4 py-2.5 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>history.back(),className:"text-fg-secondary hover:text-fg-primary transition-colors p-1 -ml-1",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsx("span",{className:"text-sm font-medium truncate",children:n?.title??s("detail.details")})]}),n?e.jsxs("div",{className:`px-3 py-3 md:p-6 space-y-4 ${We?"flex flex-col min-h-0 h-full":""}`,children:[!d&&Ut.has(n.id)&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-600 text-xs",children:[e.jsxs("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsx("span",{children:s("detail.fileMissing")})]}),e.jsxs("div",{className:`space-y-3 ${We?"shrink-0":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"text-xl font-semibold text-fg-primary",children:n.title}),!d&&e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[Gs(n?.format)&&e.jsxs("button",{onClick:()=>xt(!0),title:s("share.title",{defaultValue:"分享到 Markus Hub"}),"aria-label":s("share.title",{defaultValue:"分享到 Markus Hub"}),className:`relative p-1.5 rounded-lg transition-colors ${L(n)==="published"?"text-green-500 hover:text-green-400 hover:bg-green-500/10":L(n)==="pending_review"?"text-amber-500 hover:text-amber-400 hover:bg-amber-500/10":"text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated"}`,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),L(n)==="published"||L(n)==="pending_review"||L(n)==="rejected"?e.jsx("span",{className:`absolute top-0.5 right-0.5 w-2 h-2 rounded-full border border-surface-primary ${L(n)==="published"?"bg-green-500":L(n)==="pending_review"?"bg-amber-500 animate-pulse":"bg-red-500"}`,"aria-hidden":!0}):null]}),e.jsx("button",{onClick:()=>Fe(n),disabled:!!$t,className:"p-1.5 rounded-lg text-fg-tertiary hover:text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 shrink-0",title:s("common:remove"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium uppercase ${me[n.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:[me[n.type]?.icon??""," ",n.type]}),n.artifactType&&z[n.artifactType]&&e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${z[n.artifactType].color}`,children:[z[n.artifactType].icon," ",s("detail.builderWithType",{type:s(`artifactTypes.${n.artifactType}`)})]}),n.tags.length>0&&n.tags.map(t=>e.jsx("span",{className:"px-2 py-0.5 text-xs bg-surface-elevated text-fg-secondary rounded",children:t},t)),L(n)==="published"&&e.jsxs("a",{href:n.shareUrl??void 0,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-green-500/15 text-green-600 hover:bg-green-500/25 hover:underline",title:n.shareUrl??void 0,children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),s("share.published",{defaultValue:"已发布"})]}),L(n)==="pending_review"&&e.jsxs("a",{href:n.shareUrl??void 0,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 hover:underline",title:`${n.shareUrl??void 0} · ${s("share.pendingReview",{defaultValue:"审核中"})}`,children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),s("share.pendingReview",{defaultValue:"审核中"})]}),L(n)==="rejected"&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-500",title:n.shareReason??void 0,children:[s("share.rejected",{defaultValue:"已拒绝"}),n.shareReason?e.jsxs("span",{className:"text-red-400/90 font-normal",children:["— ",n.shareReason]}):null]})]}),(n.taskId||n.agentId||Ie(n.projectId))&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.taskId&&e.jsx("button",{onClick:()=>te.navigate(I.WORK,{openTask:n.taskId}),className:"text-xs text-brand-500 hover:underline bg-brand-500/10 px-2 py-0.5 rounded",children:s("links.task",{id:`${n.taskId.slice(0,12)}...`})}),n.agentId&&e.jsx("button",{onClick:()=>te.navigate(I.TEAM,{selectAgent:n.agentId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:s("links.agent",{name:Ue.get(n.agentId)?.name??n.agentId.slice(0,12)})}),Ie(n.projectId)&&e.jsx("button",{onClick:()=>te.navigate(I.WORK,{projectId:n.projectId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:s("links.project",{name:Ie(n.projectId)})})]}),(n.diffStats||n.testResults)&&e.jsxs("div",{className:"flex gap-3 flex-wrap",children:[n.diffStats&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[s("diffStats.title"),":"]}),e.jsx("span",{className:"text-fg-secondary",children:s("diffStats.files",{count:n.diffStats.filesChanged})}),e.jsxs("span",{className:"text-green-600",children:["+",n.diffStats.additions]}),e.jsxs("span",{className:"text-red-500",children:["-",n.diffStats.deletions]})]}),n.testResults&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[s("testResults.title"),":"]}),e.jsx("span",{className:"text-green-600",children:s("testResults.passed",{count:n.testResults.passed})}),e.jsx("span",{className:"text-red-500",children:s("testResults.failed",{count:n.testResults.failed})}),e.jsx("span",{className:"text-fg-secondary",children:s("testResults.skipped",{count:n.testResults.skipped})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-fg-tertiary flex-wrap",children:[e.jsxs("span",{children:[s("metadata.created")," ",new Date(n.createdAt).toLocaleString()]}),e.jsxs("span",{children:[s("metadata.updated")," ",new Date(n.updatedAt).toLocaleString()]}),e.jsx("span",{className:"text-fg-muted select-all",children:n.id.slice(0,12)})]}),n.reference&&!Xe(n.reference)&&n.type==="file"&&e.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[e.jsx("button",{onClick:()=>{h.files.reveal(n.reference).catch(()=>B("error",s("detail.failedToOpenBrowser")))},className:"text-xs font-mono text-brand-500 hover:text-brand-500 hover:underline truncate flex-1 text-left cursor-pointer",title:s("detail.openInFileBrowser"),children:n.reference}),e.jsx("button",{onClick:()=>{h.files.reveal(n.reference).catch(()=>B("error",s("detail.failedToOpenBrowser")))},className:"px-2 py-1 text-[10px] rounded bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",title:s("detail.revealInFinder"),children:s("common:open")}),e.jsx("button",{onClick:()=>_e(n.reference),className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${Ne?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,title:s("detail.copyPath"),children:s(Ne?"common:copied":"common:copy")})]}),n.reference&&!Xe(n.reference)&&n.type!=="file"&&n.type!=="directory"&&e.jsx("span",{className:"text-xs text-fg-tertiary font-mono break-all",children:n.reference})]}),n.artifactType&&n.artifactData?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Zs,{artifact:n.artifactData,mode:n.artifactType})}),n.reference&&e.jsxs("div",{className:"px-3 py-2 bg-surface-elevated rounded-lg",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider block mb-1",children:s("detail.artifactDirectory")}),e.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all",children:n.reference})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("button",{onClick:Ns,className:"flex-1 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-on-brand text-sm font-medium rounded-lg transition-colors",children:s("detail.openInBuilder")})}),n.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(It,{content:n.summary,className:"text-fg-secondary text-sm"})})]}):n.reference&&Xe(n.reference)?e.jsxs("div",{className:"space-y-4",children:[n.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(It,{content:n.summary,className:"text-fg-secondary text-sm"})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[e.jsxs("svg",{className:"w-10 h-10 text-fg-muted mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),e.jsx("p",{className:"text-xs text-fg-tertiary font-mono mb-4 px-4 text-center break-all select-all",children:n.reference}),e.jsx("button",{onClick:()=>window.open(n.reference,"_blank","noopener,noreferrer"),className:"px-6 py-2.5 bg-brand-600 hover:bg-brand-500 text-on-brand text-sm font-medium rounded-lg transition-colors",children:s("detail.openUrl")})]})]}):e.jsxs("div",{className:`bg-surface-elevated rounded-xl overflow-hidden ${We?"flex flex-col h-full":""}`,children:[($e||n.summary)&&!ct&&!je&&!q&&!Ft&&n.reference&&n.type==="file"&&(De==="markdown"||De==="text"||De==="html")&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border-subtle bg-surface-secondary/50",children:[e.jsx("button",{onClick:Ps,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ue?"text-fg-tertiary hover:text-fg-secondary":"bg-brand-600/20 text-brand-500"}`,children:s("detail.preview")}),e.jsx("button",{onClick:Es,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ue?"bg-brand-600/20 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:s("detail.edit")}),e.jsx("div",{className:"flex-1"}),ue&&e.jsx("button",{onClick:ls,disabled:!U||mt,className:"px-3 py-1 rounded text-xs font-medium bg-brand-600 hover:bg-brand-500 text-on-brand transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:s(mt?"detail.saving":"detail.save")})]}),e.jsxs("div",{className:We?"flex-1 min-h-0 p-5 flex flex-col":"p-5",children:[_t&&dt&&!q&&!ct&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 px-3 py-2 border border-border-subtle bg-surface-secondary/50 rounded-lg shrink-0",children:[e.jsxs("button",{className:"inline-flex items-center gap-1 text-xs text-fg-secondary hover:text-brand-500 transition-colors cursor-pointer",onClick:()=>{const t=_t;Ve(null),He(null),kt(t)},children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 01-.75.75H5.612l4.158 3.96a.75.75 0 11-1.04 1.08l-5.5-5.25a.75.75 0 010-1.08l5.5-5.25a.75.75 0 111.04 1.08L5.612 9.25H16.25A.75.75 0 0117 10z",clipRule:"evenodd"})}),"返回上级目录"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{className:"shrink-0 text-xs text-fg-secondary hover:text-fg-primary hover:underline cursor-pointer",onClick:()=>_e(dt),children:Ne?s("common:copied"):s("common:copyPath",{defaultValue:"复制路径"})}),e.jsx("button",{className:"shrink-0 text-xs text-fg-secondary hover:text-fg-primary hover:underline cursor-pointer",onClick:()=>{h.files.reveal(dt).catch(()=>B("error",s("detail.failedToOpenBrowser")))},children:s("detail.openInFileBrowser",{defaultValue:"在文件浏览器中显示"})})]}),ct?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-full"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-5/6"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-4/6"}),e.jsx("div",{className:"h-32 bg-surface-overlay/40 rounded-lg w-full mt-2"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-2/3"})]}):q?e.jsx("div",{className:n.type==="directory"?"flex-1 min-h-0":"h-[50vh] min-h-[300px]",children:e.jsx(Fs,{path:q.path,entries:q.entries,onNavigate:t=>{kt(t)},onOpenFile:t=>{Ss(t,q?.path)},onReveal:t=>{h.files.reveal(t).catch(()=>B("error",s("detail.failedToOpenBrowser")))},onCopyPath:t=>_e(t)})}):je?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("img",{src:je.src,alt:je.name,className:"max-w-full max-h-[60vh] rounded-lg object-contain"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:je.name})]}):ie?e.jsx("div",{className:Ot?"flex-1 min-h-0":"h-[55vh]",children:e.jsx(Ws,{data:ie,reference:ie.reference,onFallback:ie.reference?()=>{h.files.reveal(ie.reference).catch(()=>{})}:void 0})}):ke?e.jsxs("div",{className:"flex flex-col gap-3 py-4",children:[ke.kind==="audio"?e.jsx("audio",{controls:!0,preload:"metadata",src:ke.src,className:"w-full"}):e.jsx("video",{controls:!0,preload:"metadata",src:ke.src,className:"w-full max-h-[60vh] rounded-lg bg-black"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:ke.name})]}):$e?ue?e.jsx("div",{className:"animate-fadeIn",children:e.jsx("textarea",{ref:gt,value:Ce,onChange:t=>{ht(t.target.value),J(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1})},"edit"):e.jsx("div",{className:"animate-fadeIn",children:e.jsx(Ks,{content:$e,format:De,className:"text-fg-secondary text-sm",onHtmlSelection:Bs,basePath:n?.reference?n.reference.replace(/[/\\][^/\\]+$/,""):void 0,copyVariant:"preview"})},"preview"):Ft?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:s("detail.cannotPreview",{type:n.type})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{h.files.reveal(n.reference).catch(()=>B("error",s("detail.failedToOpen")))},className:"text-xs bg-surface-elevated px-3 py-2 rounded text-brand-500 hover:text-brand-500 hover:underline flex-1 truncate text-left cursor-pointer font-mono",title:s("detail.openInFileBrowser"),children:n.reference}),e.jsx("button",{onClick:()=>{h.files.reveal(n.reference).catch(()=>B("error",s("detail.failedToOpen")))},className:"px-3 py-2 text-xs rounded-lg bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",children:s("common:open")}),e.jsx("button",{onClick:()=>_e(n.reference),className:`px-3 py-2 text-xs rounded-lg transition-colors shrink-0 ${Ne?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,children:s(Ne?"common:copied":"common:copy")})]})]}):n.summary?ue?e.jsx("textarea",{ref:gt,value:Ce,onChange:t=>{ht(t.target.value),J(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1}):e.jsx(It,{content:n.summary,className:"text-fg-secondary text-sm"}):e.jsx("p",{className:"text-sm text-fg-tertiary italic",children:s("detail.noContent")})]})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center text-fg-tertiary space-y-3 max-w-xs",children:[e.jsx("div",{className:"w-16 h-16 mx-auto rounded-2xl bg-surface-elevated/60 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-fg-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),e.jsx("p",{className:"text-sm text-fg-secondary",children:s("detail.selectToView")}),!c&&e.jsx("p",{className:"text-[10px] text-fg-muted",children:s("detail.keyboardHint")})]})})]}),n?.agentId&&e.jsx("button",{type:"button",onClick:()=>{c?Tt(!0):St()},className:`${c?"fixed bottom-[calc(1.25rem+env(safe-area-inset-bottom))] right-4 z-40":"absolute bottom-6 right-6 z-20"} w-12 h-12 rounded-full bg-brand-600 hover:bg-brand-500 text-on-brand shadow-lg shadow-black/20 flex items-center justify-center transition-transform hover:scale-105 animate-fab-in`,title:c?s("chat.sendToChat",{defaultValue:"Send to conversation"}):s("chat.openChat",{defaultValue:"Open in Team Chat"}),"aria-label":c?s("chat.sendToChat",{defaultValue:"Send to conversation"}):s("chat.openChat",{defaultValue:"Open in Team Chat"}),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}),fs&&n&&e.jsx(qs,{chipKind:"deliverable",chipLabel:Rt(n).label,chipContent:Rt(n).content,agents:et,users:us,defaultTarget:n.agentId?`agent:${n.agentId}`:void 0,onClose:()=>Tt(!1)})]}),Se&&e.jsx("div",{id:"selection-toolbar",className:"fixed z-50 -translate-x-1/2 -translate-y-full bg-surface-elevated border border-border-default rounded-lg shadow-xl overflow-hidden",style:{left:Se.x,top:Se.y-8},children:e.jsxs("button",{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),St(Se.text,Se.htmlMeta)},className:"px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-1.5 whitespace-nowrap",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),s("contextMenu.addToConversation")]})}),ys&&n&&e.jsx(Ys,{item:n,onClose:()=>xt(!1),onShared:ws}),ms&&e.jsx(sr,{projects:Je,onClose:()=>tt(!1),onBound:()=>{tt(!1),W("knowledge"),O()}}),ut&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>Fe(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-red-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:s("detail.confirmRemoveTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:s("detail.confirmRemoveMessage",{name:ut.title})})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>Fe(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:s("common:cancel")}),e.jsx("button",{onClick:()=>{const t=ut;Fe(null),ks(t)},disabled:!!$t,className:"px-4 py-1.5 text-xs bg-red-600 hover:bg-red-500 text-white rounded-lg transition-colors disabled:opacity-50",children:s("common:remove")})]})]})}),pt&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>ee(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-amber-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:s("detail.unsavedTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:s("detail.unsavedMessage")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>ee(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:s("common:cancel")}),e.jsx("button",{onClick:()=>{Ts(),pt.action()},className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:s("detail.discard")}),e.jsx("button",{onClick:async()=>{await ls(),pt.action(),ee(null)},className:"px-4 py-1.5 text-xs bg-brand-600 hover:bg-brand-500 text-on-brand rounded-lg transition-colors",children:s("detail.saveAndLeave")})]})]})})]})}function sr({projects:o,onClose:d,onBound:u}){const{t:s}=Ze("deliverables"),[c,b]=a.useState(""),[S,w]=a.useState(""),[j,P]=a.useState(!1),[k,R]=a.useState(""),g=o.find(m=>m.id===c),E=typeof window<"u"&&!!window.markusDesktop?.selectDirectory,N=async()=>{try{const m=await window.markusDesktop?.selectDirectory?.(s("bindBrowseTitle",{defaultValue:"Select knowledge base directory"}));m&&w(m)}catch(m){R(String(m))}},D=async()=>{if(!(!c||!S.trim()||j)){P(!0),R("");try{const m=S.trim(),re=[...new Set([...g?.knowledgeBasePaths??[],m])];await h.projects.update(c,{knowledgeBasePaths:re}),await h.projects.syncKnowledge(c),u()}catch(m){R(String(m))}finally{P(!1)}}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>{j||d()},children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl",onClick:m=>m.stopPropagation(),children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary mb-1",children:s("bindKnowledgeBase")}),e.jsx("p",{className:"text-xs text-fg-secondary mb-4",children:s("bindKnowledgeBaseHint")}),e.jsx("label",{className:"block text-[10px] text-fg-tertiary mb-1",children:s("bindProject")}),e.jsxs("select",{value:c,onChange:m=>b(m.target.value),className:"w-full mb-3 px-2.5 py-2 text-xs bg-surface-primary border border-border-default rounded-lg text-fg-primary",children:[e.jsx("option",{value:"",children:s("bindProjectSelect")}),o.map(m=>e.jsx("option",{value:m.id,children:m.name},m.id))]}),e.jsx("label",{className:"block text-[10px] text-fg-tertiary mb-1",children:s("bindPath")}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx("input",{value:S,onChange:m=>w(m.target.value),onKeyDown:m=>{m.key==="Enter"&&D()},placeholder:s("bindPathPlaceholder"),className:"flex-1 min-w-0 px-2.5 py-2 text-xs bg-surface-primary border border-border-default rounded-lg text-fg-primary placeholder:text-fg-tertiary font-mono"}),E&&e.jsx("button",{type:"button",onClick:()=>{N()},disabled:j,title:s("bindBrowse",{defaultValue:"Browse…"}),className:"shrink-0 px-3 py-2 text-xs bg-surface-overlay text-fg-secondary hover:text-fg-primary rounded-lg disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:s("bindBrowse",{defaultValue:"Browse…"})})]}),g&&(g.knowledgeBasePaths??[]).length>0&&e.jsxs("div",{className:"mb-3 space-y-1",children:[e.jsx("div",{className:"text-[10px] text-fg-tertiary",children:s("bindCurrentPaths")}),(g.knowledgeBasePaths??[]).map((m,re)=>e.jsxs("div",{className:"text-[11px] text-fg-secondary font-mono truncate",title:m,children:["• ",m]},`${m}-${re}`))]}),k&&e.jsx("div",{className:"mb-3 px-2.5 py-1.5 text-[11px] rounded-md bg-red-500/15 text-red-500",children:k}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx("button",{onClick:d,disabled:j,className:"px-3 py-1.5 text-xs text-fg-tertiary hover:text-fg-secondary rounded-lg transition-colors",children:s("common:cancel",{defaultValue:"Cancel"})}),e.jsx("button",{onClick:()=>{D()},disabled:j||!c||!S.trim(),className:"px-3 py-1.5 text-xs bg-brand-600 text-on-brand rounded-lg hover:bg-brand-500 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:j?s("bindSaving",{defaultValue:"Saving…"}):s("bindSave",{defaultValue:"Bind directory"})})]})]})})}function pe({label:o,value:d,current:u,onClick:s}){return e.jsx("button",{onClick:()=>s(u===d?"":d),className:`px-2 py-1 rounded text-xs whitespace-nowrap shrink-0 transition-colors ${u===d?"bg-brand-600 text-on-brand":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:o})}function ds(){return e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}export{cr as DeliverablesPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as T,r as i,j as e,c as z,m as x,o as H,E as A,M as S,p as D,q as _,s as U,v as B,w as O,x as G,y as $,z as W,B as K,C as q,D as V,F as Y,G as J,H as Q,J as X,K as Z,L as ee,N as te,O as re}from"./index-BY_HjdWI.js";const R="markus-copy-typography",C={fontFamily:"default",fontSize:15,headingScale:"standard"};function P(){try{const t=localStorage.getItem(R);if(t)return{...C,...JSON.parse(t)}}catch{}return C}function se(t){localStorage.setItem(R,JSON.stringify(t))}function ne(t){const r={default:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",serif:"Georgia, 'Times New Roman', Times, serif","sans-serif":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif",mono:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace"},n={compact:{h1:1.3,h2:1.15,h3:1.05,h4:1},standard:{h1:1.6,h2:1.35,h3:1.15,h4:1},large:{h1:2,h2:1.6,h3:1.3,h4:1.1}};return{fontFamily:r[t.fontFamily]??r.default,fontSize:`${t.fontSize}px`,headingScales:n[t.headingScale]??n.standard}}function ae({onClose:t}){const{t:r}=T("common"),[n,s]=i.useState(P);i.useEffect(()=>{se(n)},[n]);const l=i.useCallback((o,u)=>{s(d=>({...d,[o]:u}))},[]);return e.jsxs("div",{className:"px-3 py-2 space-y-3 max-w-[260px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-medium text-fg-primary text-xs",children:r("markdown.typographySettings")}),e.jsx("button",{onClick:t,className:"text-fg-tertiary hover:text-fg-primary p-0.5",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("p",{className:"text-[10px] text-fg-tertiary",children:r("markdown.typographyDesc")}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:r("markdown.fontFamily")}),e.jsxs("select",{value:n.fontFamily,onChange:o=>l("fontFamily",o.target.value),className:"w-full px-2 py-1 text-xs rounded bg-surface-primary border border-border-subtle text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50",children:[e.jsx("option",{value:"default",children:r("markdown.fontDefault")}),e.jsx("option",{value:"serif",children:r("markdown.fontSerif")}),e.jsx("option",{value:"sans-serif",children:r("markdown.fontSansSerif")}),e.jsx("option",{value:"mono",children:r("markdown.fontMono")})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:[r("markdown.fontSize"),": ",n.fontSize,"px"]}),e.jsx("input",{type:"range",min:10,max:24,step:1,value:n.fontSize,onChange:o=>l("fontSize",Number(o.target.value)),className:"w-full h-1 rounded-full appearance-none bg-border-subtle [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-brand-500"}),e.jsxs("div",{className:"flex justify-between text-[9px] text-fg-tertiary mt-0.5",children:[e.jsx("span",{children:"10px"}),e.jsx("span",{children:"24px"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:r("markdown.headingScale")}),e.jsx("div",{className:"flex gap-1",children:["compact","standard","large"].map(o=>e.jsx("button",{onClick:()=>l("headingScale",o),className:`flex-1 px-2 py-1 rounded text-[10px] font-medium transition-colors ${n.headingScale===o?"bg-brand-600/20 text-brand-500":"bg-surface-primary text-fg-tertiary hover:text-fg-secondary border border-border-subtle"}`,children:r(`markdown.scale${o.charAt(0).toUpperCase()+o.slice(1)}`)},o))})]})]})}const M=[B,O,G],L=[D,[_,{strict:"ignore"}],[U,{detect:!0,ignoreMissing:!0}]];function E(t){if(/^(deliverable|task|requirement|project|agent|team|workflow):/i.test(t))return t;const n=W(t);return K(n)?n:q(t)}const oe=/(?:<thinking>| thinking)([\s\S]*?)<\/thinking>/g;function ie(t){const r=[];let n=t.replace(oe,(s,l)=>{const o=l.trim();return o&&r.push(o),""});return n=n.replace(/<thinking>/gi,"").replace(/<\/thinking>/gi,""),{thinking:r,rest:n.trim()}}const le={inline:{wrapper:"absolute top-1 right-1 z-10 opacity-0 focus-within:opacity-100 group-hover/md:opacity-100 transition-opacity",button:"p-1.5 rounded-lg bg-brand-600 text-on-brand hover:bg-brand-500 shadow-sm transition-colors",icon:"w-4 h-4",labelled:!1},preview:{wrapper:"absolute top-2 right-2 z-10",button:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-brand-600 text-on-brand hover:bg-brand-500 shadow-md text-xs font-medium transition-colors",icon:"w-4 h-4",labelled:!0}},ce={inline:"pr-2 sm:pr-8",preview:"pr-2 sm:pr-24"};function de(t=640){const[r,n]=i.useState(()=>window.innerWidth<t);return i.useEffect(()=>{const s=window.matchMedia(`(max-width: ${t-1}px)`),l=o=>n(o.matches);return s.addEventListener("change",l),n(s.matches),()=>s.removeEventListener("change",l)},[t]),r}function me({content:t,contentRef:r,variant:n}){const{t:s}=T("common"),[l,o]=i.useState(!1),[u,d]=i.useState(!1),[g,h]=i.useState(!1),[y,w]=i.useState(null),f=i.useRef(null),p=de();i.useEffect(()=>{if(!l)return;const a=m=>{f.current&&!f.current.contains(m.target)&&(o(!1),d(!1),h(!1))};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[l]);const k=i.useCallback(a=>{w(a),setTimeout(()=>w(null),1500)},[]),v=async()=>{const a=await te(t);k(s(a?"markdown.copied":"markdown.failed")),o(!1)},b=async a=>{const m=r.current?.firstElementChild;if(!m)return;const I=P(),j=ne(I),N=await re(m,a,t,{fontFamily:j.fontFamily,fontSize:j.fontSize,headingScales:j.headingScales}),F=s(a==="light"?"markdown.themeLight":"markdown.themeDark");k(N.ok?N.method==="html"?s("markdown.htmlCopied",{theme:F}):s("markdown.textCopied"):s("markdown.failed")),o(!1)},c=le[n];return e.jsxs("div",{className:c.wrapper,ref:f,"data-copy-variant":n,children:[y&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-20 px-2 py-0.5 rounded bg-surface-elevated border border-border-default text-[10px] text-fg-secondary whitespace-nowrap shadow-lg",children:y}),e.jsxs("button",{onClick:()=>o(a=>!a),className:c.button,title:s("markdown.copyContent"),children:[e.jsx("svg",{className:c.icon,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),c.labelled&&e.jsx("span",{className:"leading-none",children:s("markdown.copy")})]}),l&&e.jsx("div",{className:"absolute right-0 top-full mt-1 bg-surface-elevated border border-border-default rounded-lg shadow-xl py-1 min-w-[180px]",children:g?e.jsx(ae,{onClose:()=>h(!1)}):u?e.jsxs("div",{className:"px-3 py-2 text-[11px] text-fg-secondary space-y-2 max-w-[260px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-medium text-fg-primary text-xs",children:s("markdown.infoTitle")}),e.jsx("button",{onClick:()=>d(!1),className:"text-fg-tertiary hover:text-fg-primary p-0.5",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:s("markdown.mdAbbrev")})," — ",s("markdown.infoMdDesc")]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:"☀️"})," — ",s("markdown.infoHtmlLightDesc")]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:"🌙"})," — ",s("markdown.infoHtmlDarkDesc")]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border-subtle mb-1",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary font-medium",children:s("markdown.copyContent")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>h(!0),className:"p-0.5 rounded text-fg-tertiary hover:text-fg-primary transition-colors",title:s("markdown.typographySettings"),children:e.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),e.jsx("button",{onClick:()=>d(!0),className:"p-0.5 rounded text-fg-tertiary hover:text-fg-primary transition-colors",title:s("markdown.infoTitle"),children:e.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{strokeLinecap:"round",d:"M12 16v-4m0-4h.01"})]})})]})]}),e.jsxs("button",{onClick:v,className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center text-fg-tertiary shrink-0 font-mono text-[10px]",children:s("markdown.mdAbbrev")}),s(p?"markdown.copyMdSourceShort":"markdown.copyMdSource")]}),e.jsxs("button",{onClick:()=>b("light"),className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center shrink-0 text-[10px]",children:"☀️"}),s(p?"markdown.copyHtmlLightShort":"markdown.copyHtmlLight")]}),e.jsxs("button",{onClick:()=>b("dark"),className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center shrink-0 text-[10px]",children:"🌙"}),s(p?"markdown.copyHtmlDarkShort":"markdown.copyHtmlDark")]})]})})]})}const xe=i.memo(function({content:r,className:n="",onMentionClick:s,knownNames:l,basePath:o,copyVariant:u="inline"}){const{thinking:d,rest:g}=ie(r),h=i.useRef(null),[y,w]=i.useState(null),f=z(),p=i.useCallback(c=>{let a=x(c,V);return a=x(a,Y),a=x(a,J),a=x(a,Q),a=x(a,X),a=x(a,m=>Z(m,l)),a=x(a,ee),a},[l]),k=i.useMemo(()=>p(g),[g,p]),v=ce[u],b=H({onMentionClick:s,basePath:o,onImagePreview:w,contentRef:h,hostAvailable:f?.hostAvailable,openRightPanel:f?.openRightPanel});return e.jsxs("div",{className:"relative group/md",children:[e.jsx(me,{content:r,contentRef:h,variant:u}),e.jsx("div",{ref:h,children:e.jsx(A,{resetKeys:[k],fallback:e.jsx("div",{className:`prose prose-sm max-w-none break-words whitespace-pre-wrap ${v} text-fg-secondary ${n}`,children:g}),children:e.jsxs("div",{className:`prose prose-sm max-w-none break-words ${v} text-fg-secondary ${n}`,children:[d.length>0&&(()=>{const c=d.join(`
|
|
1
|
+
import{u as T,r as i,j as e,c as z,m as x,o as H,E as A,M as S,p as D,q as _,s as U,v as B,w as O,x as G,y as $,z as W,B as K,C as q,D as V,F as Y,G as J,H as Q,J as X,K as Z,L as ee,N as te,O as re}from"./index-BdiEUYQB.js";const R="markus-copy-typography",C={fontFamily:"default",fontSize:15,headingScale:"standard"};function P(){try{const t=localStorage.getItem(R);if(t)return{...C,...JSON.parse(t)}}catch{}return C}function se(t){localStorage.setItem(R,JSON.stringify(t))}function ne(t){const r={default:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif",serif:"Georgia, 'Times New Roman', Times, serif","sans-serif":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif",mono:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace"},n={compact:{h1:1.3,h2:1.15,h3:1.05,h4:1},standard:{h1:1.6,h2:1.35,h3:1.15,h4:1},large:{h1:2,h2:1.6,h3:1.3,h4:1.1}};return{fontFamily:r[t.fontFamily]??r.default,fontSize:`${t.fontSize}px`,headingScales:n[t.headingScale]??n.standard}}function ae({onClose:t}){const{t:r}=T("common"),[n,s]=i.useState(P);i.useEffect(()=>{se(n)},[n]);const l=i.useCallback((o,u)=>{s(d=>({...d,[o]:u}))},[]);return e.jsxs("div",{className:"px-3 py-2 space-y-3 max-w-[260px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-medium text-fg-primary text-xs",children:r("markdown.typographySettings")}),e.jsx("button",{onClick:t,className:"text-fg-tertiary hover:text-fg-primary p-0.5",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("p",{className:"text-[10px] text-fg-tertiary",children:r("markdown.typographyDesc")}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:r("markdown.fontFamily")}),e.jsxs("select",{value:n.fontFamily,onChange:o=>l("fontFamily",o.target.value),className:"w-full px-2 py-1 text-xs rounded bg-surface-primary border border-border-subtle text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50",children:[e.jsx("option",{value:"default",children:r("markdown.fontDefault")}),e.jsx("option",{value:"serif",children:r("markdown.fontSerif")}),e.jsx("option",{value:"sans-serif",children:r("markdown.fontSansSerif")}),e.jsx("option",{value:"mono",children:r("markdown.fontMono")})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:[r("markdown.fontSize"),": ",n.fontSize,"px"]}),e.jsx("input",{type:"range",min:10,max:24,step:1,value:n.fontSize,onChange:o=>l("fontSize",Number(o.target.value)),className:"w-full h-1 rounded-full appearance-none bg-border-subtle [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-brand-500"}),e.jsxs("div",{className:"flex justify-between text-[9px] text-fg-tertiary mt-0.5",children:[e.jsx("span",{children:"10px"}),e.jsx("span",{children:"24px"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-fg-tertiary font-medium block mb-1",children:r("markdown.headingScale")}),e.jsx("div",{className:"flex gap-1",children:["compact","standard","large"].map(o=>e.jsx("button",{onClick:()=>l("headingScale",o),className:`flex-1 px-2 py-1 rounded text-[10px] font-medium transition-colors ${n.headingScale===o?"bg-brand-600/20 text-brand-500":"bg-surface-primary text-fg-tertiary hover:text-fg-secondary border border-border-subtle"}`,children:r(`markdown.scale${o.charAt(0).toUpperCase()+o.slice(1)}`)},o))})]})]})}const M=[B,O,G],L=[D,[_,{strict:"ignore"}],[U,{detect:!0,ignoreMissing:!0}]];function E(t){if(/^(deliverable|task|requirement|project|agent|team|workflow):/i.test(t))return t;const n=W(t);return K(n)?n:q(t)}const oe=/(?:<thinking>| thinking)([\s\S]*?)<\/thinking>/g;function ie(t){const r=[];let n=t.replace(oe,(s,l)=>{const o=l.trim();return o&&r.push(o),""});return n=n.replace(/<thinking>/gi,"").replace(/<\/thinking>/gi,""),{thinking:r,rest:n.trim()}}const le={inline:{wrapper:"absolute top-1 right-1 z-10 opacity-0 focus-within:opacity-100 group-hover/md:opacity-100 transition-opacity",button:"p-1.5 rounded-lg bg-brand-600 text-on-brand hover:bg-brand-500 shadow-sm transition-colors",icon:"w-4 h-4",labelled:!1},preview:{wrapper:"absolute top-2 right-2 z-10",button:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-brand-600 text-on-brand hover:bg-brand-500 shadow-md text-xs font-medium transition-colors",icon:"w-4 h-4",labelled:!0}},ce={inline:"pr-2 sm:pr-8",preview:"pr-2 sm:pr-24"};function de(t=640){const[r,n]=i.useState(()=>window.innerWidth<t);return i.useEffect(()=>{const s=window.matchMedia(`(max-width: ${t-1}px)`),l=o=>n(o.matches);return s.addEventListener("change",l),n(s.matches),()=>s.removeEventListener("change",l)},[t]),r}function me({content:t,contentRef:r,variant:n}){const{t:s}=T("common"),[l,o]=i.useState(!1),[u,d]=i.useState(!1),[g,h]=i.useState(!1),[y,w]=i.useState(null),f=i.useRef(null),p=de();i.useEffect(()=>{if(!l)return;const a=m=>{f.current&&!f.current.contains(m.target)&&(o(!1),d(!1),h(!1))};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[l]);const k=i.useCallback(a=>{w(a),setTimeout(()=>w(null),1500)},[]),v=async()=>{const a=await te(t);k(s(a?"markdown.copied":"markdown.failed")),o(!1)},b=async a=>{const m=r.current?.firstElementChild;if(!m)return;const I=P(),j=ne(I),N=await re(m,a,t,{fontFamily:j.fontFamily,fontSize:j.fontSize,headingScales:j.headingScales}),F=s(a==="light"?"markdown.themeLight":"markdown.themeDark");k(N.ok?N.method==="html"?s("markdown.htmlCopied",{theme:F}):s("markdown.textCopied"):s("markdown.failed")),o(!1)},c=le[n];return e.jsxs("div",{className:c.wrapper,ref:f,"data-copy-variant":n,children:[y&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-20 px-2 py-0.5 rounded bg-surface-elevated border border-border-default text-[10px] text-fg-secondary whitespace-nowrap shadow-lg",children:y}),e.jsxs("button",{onClick:()=>o(a=>!a),className:c.button,title:s("markdown.copyContent"),children:[e.jsx("svg",{className:c.icon,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),c.labelled&&e.jsx("span",{className:"leading-none",children:s("markdown.copy")})]}),l&&e.jsx("div",{className:"absolute right-0 top-full mt-1 bg-surface-elevated border border-border-default rounded-lg shadow-xl py-1 min-w-[180px]",children:g?e.jsx(ae,{onClose:()=>h(!1)}):u?e.jsxs("div",{className:"px-3 py-2 text-[11px] text-fg-secondary space-y-2 max-w-[260px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-medium text-fg-primary text-xs",children:s("markdown.infoTitle")}),e.jsx("button",{onClick:()=>d(!1),className:"text-fg-tertiary hover:text-fg-primary p-0.5",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:s("markdown.mdAbbrev")})," — ",s("markdown.infoMdDesc")]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:"☀️"})," — ",s("markdown.infoHtmlLightDesc")]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-fg-primary",children:"🌙"})," — ",s("markdown.infoHtmlDarkDesc")]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border-subtle mb-1",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary font-medium",children:s("markdown.copyContent")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>h(!0),className:"p-0.5 rounded text-fg-tertiary hover:text-fg-primary transition-colors",title:s("markdown.typographySettings"),children:e.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),e.jsx("button",{onClick:()=>d(!0),className:"p-0.5 rounded text-fg-tertiary hover:text-fg-primary transition-colors",title:s("markdown.infoTitle"),children:e.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{strokeLinecap:"round",d:"M12 16v-4m0-4h.01"})]})})]})]}),e.jsxs("button",{onClick:v,className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center text-fg-tertiary shrink-0 font-mono text-[10px]",children:s("markdown.mdAbbrev")}),s(p?"markdown.copyMdSourceShort":"markdown.copyMdSource")]}),e.jsxs("button",{onClick:()=>b("light"),className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center shrink-0 text-[10px]",children:"☀️"}),s(p?"markdown.copyHtmlLightShort":"markdown.copyHtmlLight")]}),e.jsxs("button",{onClick:()=>b("dark"),className:"w-full px-3 py-2 text-left text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-2",children:[e.jsx("span",{className:"w-4 text-center shrink-0 text-[10px]",children:"🌙"}),s(p?"markdown.copyHtmlDarkShort":"markdown.copyHtmlDark")]})]})})]})}const xe=i.memo(function({content:r,className:n="",onMentionClick:s,knownNames:l,basePath:o,copyVariant:u="inline"}){const{thinking:d,rest:g}=ie(r),h=i.useRef(null),[y,w]=i.useState(null),f=z(),p=i.useCallback(c=>{let a=x(c,V);return a=x(a,Y),a=x(a,J),a=x(a,Q),a=x(a,X),a=x(a,m=>Z(m,l)),a=x(a,ee),a},[l]),k=i.useMemo(()=>p(g),[g,p]),v=ce[u],b=H({onMentionClick:s,basePath:o,onImagePreview:w,contentRef:h,hostAvailable:f?.hostAvailable,openRightPanel:f?.openRightPanel});return e.jsxs("div",{className:"relative group/md",children:[e.jsx(me,{content:r,contentRef:h,variant:u}),e.jsx("div",{ref:h,children:e.jsx(A,{resetKeys:[k],fallback:e.jsx("div",{className:`prose prose-sm max-w-none break-words whitespace-pre-wrap ${v} text-fg-secondary ${n}`,children:g}),children:e.jsxs("div",{className:`prose prose-sm max-w-none break-words ${v} text-fg-secondary ${n}`,children:[d.length>0&&(()=>{const c=d.join(`
|
|
2
2
|
|
|
3
3
|
`),a=c.split(`
|
|
4
4
|
`)[0]??"",m=a.length>80?a.slice(0,80)+"…":a;return e.jsxs("details",{className:"mb-3 rounded-lg bg-surface-elevated/60 border border-border-default/50 overflow-hidden group/think",children:[e.jsxs("summary",{className:"cursor-pointer select-none px-3 py-2 text-xs text-fg-secondary hover:text-fg-secondary transition-colors flex items-center gap-1.5 min-w-0",children:[e.jsx("svg",{className:"w-3 h-3 shrink-0 transition-transform group-open/think:rotate-90",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),e.jsx("span",{className:"shrink-0",children:"Thinking"}),e.jsx("span",{className:"truncate text-fg-tertiary ml-1 group-open/think:hidden",children:m})]}),e.jsx("div",{className:"px-3 pb-3 border-t border-border-default/50",children:e.jsx("div",{className:"mt-2 pl-3 border-l-2 border-brand-500/40 text-xs text-fg-secondary leading-relaxed",children:e.jsx(S,{remarkPlugins:M,rehypePlugins:L,components:b,urlTransform:E,children:p(c)})})})]})})(),e.jsx(S,{remarkPlugins:M,rehypePlugins:L,components:b,urlTransform:E,children:k})]})})}),y&&e.jsx($,{src:y,onClose:()=>w(null)})]})},(t,r)=>t.content===r.content&&t.className===r.className&&t.basePath===r.basePath&&t.copyVariant===r.copyVariant&&t.onMentionClick===r.onMentionClick&&he(t.knownNames,r.knownNames));function he(t,r){if(t===r)return!0;if(!t||!r||t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}export{$ as ImagePreviewModal,xe as MarkdownMessage,E as chatUrlTransform};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as z,r as i,k as c,j as e,n as d,P as x,A as O,l as I,t as K}from"./index-BY_HjdWI.js";import{P as $,E as D}from"./AsyncState-Co9o9Bjm.js";function J(){const{t:l}=z(["common","home","work"]),[u,y]=i.useState(""),[a,o]=i.useState("all"),[t,m]=i.useState({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),[h,b]=i.useState(!1),[w,p]=i.useState(!1),v=i.useRef(null),j=i.useRef(void 0);i.useEffect(()=>{setTimeout(()=>v.current?.focus(),100)},[]);const W=i.useCallback(async s=>{if(!s.trim()){m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1);return}b(!0),p(!0);const n=s.toLowerCase();try{const[N,C,V,L,R,A]=await Promise.allSettled([c.agents.list(),c.tasks.list({search:s,pageSize:20}),c.requirements.list(),c.projects.list(),c.deliverables.search({q:s,limit:20}),c.teams.list()]),q=N.status==="fulfilled"?N.value.agents.filter(r=>r.name?.toLowerCase().includes(n)||r.role?.toLowerCase().includes(n)):[],T=C.status==="fulfilled"?C.value.tasks:[],M=V.status==="fulfilled"?V.value.requirements.filter(r=>r.title?.toLowerCase().includes(n)||r.description?.toLowerCase().includes(n)):[],H=L.status==="fulfilled"?L.value.projects.filter(r=>r.name?.toLowerCase().includes(n)||r.description?.toLowerCase().includes(n)):[],P=R.status==="fulfilled"?R.value.results:[],S=[];if(A.status==="fulfilled"){const r=await Promise.allSettled(A.value.teams.map(f=>c.workflows.list(f.id)));for(const f of r)if(f.status==="fulfilled")for(const g of f.value.workflows)(g.name.toLowerCase().includes(n)||(g.displayName||"").toLowerCase().includes(n)||g.description?.toLowerCase().includes(n))&&S.push(g)}m({agents:q,tasks:T,requirements:M,projects:H,deliverables:P,workflows:S})}catch{m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]})}finally{b(!1)}},[]),B=s=>{y(s),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>W(s),400)},E=[{id:"all",label:l("common:all",{defaultValue:"全部"})},{id:"agents",label:l("common:agents",{defaultValue:"智能体"})},{id:"tasks",label:l("common:tasks",{defaultValue:"任务"})},{id:"requirements",label:l("common:requirements",{defaultValue:"需求"})},{id:"projects",label:l("common:projects",{defaultValue:"项目"})},{id:"deliverables",label:l("common:deliverables",{defaultValue:"交付物"})},{id:"workflows",label:l("common:workflows",{defaultValue:"工作流"})}],k=t.agents.length>0||t.tasks.length>0||t.requirements.length>0||t.projects.length>0||t.deliverables.length>0||t.workflows.length>0;return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-2 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d.navigate(x.HOME),className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors shrink-0",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]})}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-tertiary",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:v,value:u,onChange:s=>B(s.target.value),placeholder:l("common:search"),className:"w-full bg-surface-elevated border border-border-default rounded-xl pl-9 pr-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-tertiary focus:border-brand-500 focus:outline-none transition-colors"}),u&&e.jsx("button",{onClick:()=>{y(""),m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1),v.current?.focus()},className:"absolute right-3 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide",children:E.map(s=>e.jsx("button",{onClick:()=>o(s.id),className:`px-3 py-1.5 text-xs rounded-lg whitespace-nowrap transition-colors ${a===s.id?"bg-brand-600 text-on-brand":"bg-surface-elevated text-fg-secondary hover:text-fg-primary"}`,children:s.label},s.id))})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[h&&e.jsx($,{className:"py-12"}),!h&&w&&!k&&e.jsx(D,{className:"py-12",icon:e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),title:l("common:noResults",{defaultValue:"没有找到相关结果"})}),!h&&k&&e.jsxs("div",{className:"space-y-4",children:[(a==="all"||a==="agents")&&t.agents.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:agents",{defaultValue:"智能体"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.agents.slice(0,8):t.agents).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.TEAM,{agentId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(O,{name:s.name||"Agent",avatarUrl:s.avatarUrl,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary truncate",children:s.name}),e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.role||s.status})]}),e.jsx(U,{status:s.status})]},s.id))}),a==="all"&&t.agents.length>8&&e.jsxs("button",{onClick:()=>o("agents"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.agents.length,")"]})]}),(a==="all"||a==="tasks")&&t.tasks.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:tasks",{defaultValue:"任务"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.tasks.slice(0,8):t.tasks).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openTask:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(F,{status:s.status}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),a==="all"&&t.tasks.length>8&&e.jsxs("button",{onClick:()=>o("tasks"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.tasks.length,")"]})]}),(a==="all"||a==="requirements")&&t.requirements.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:requirements",{defaultValue:"需求"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.requirements.slice(0,8):t.requirements).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openRequirement:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${s.status==="approved"?"text-green-500 bg-green-500/15":s.status==="pending"?"text-amber-500 bg-amber-500/15":s.status==="rejected"?"text-red-500 bg-red-500/15":"text-fg-tertiary bg-surface-elevated"}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),a==="all"&&t.requirements.length>8&&e.jsxs("button",{onClick:()=>o("requirements"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.requirements.length,")"]})]}),(a==="all"||a==="projects")&&t.projects.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:projects",{defaultValue:"项目"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.projects.slice(0,8):t.projects).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{projectId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-brand-500",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.name}),s.description&&e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.description})]})]},s.id))}),a==="all"&&t.projects.length>8&&e.jsxs("button",{onClick:()=>o("projects"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.projects.length,")"]})]}),(a==="all"||a==="deliverables")&&t.deliverables.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:deliverables",{defaultValue:"交付物"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.deliverables.slice(0,8):t.deliverables).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.DELIVERABLES,{openDeliverable:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-purple-500",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.type," · ",s.status]})]})]},s.id))}),a==="all"&&t.deliverables.length>8&&e.jsxs("button",{onClick:()=>o("deliverables"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.deliverables.length,")"]})]}),(a==="all"||a==="workflows")&&t.workflows.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:workflows",{defaultValue:"工作流"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.workflows.slice(0,8):t.workflows).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{boardType:"workflows"}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-teal-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-teal-500",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.displayName||s.name}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.stepCount," steps · v",s.version]})]})]},s.name))}),a==="all"&&t.workflows.length>8&&e.jsxs("button",{onClick:()=>o("workflows"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.workflows.length,")"]})]})]}),!h&&!w&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:search")})]})]})]})}function U({status:l}){const u=l==="active"||l==="idle"?"bg-green-500":l==="working"||l==="busy"?"bg-blue-500":"bg-gray-400";return e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${u}`})}function F({status:l}){const u=I[K(l)].chip;return e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${u}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M9 11l3 3L22 4"}),e.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})})}export{J as SearchPage};
|
|
1
|
+
import{u as z,r as i,k as c,j as e,n as d,P as x,A as O,l as I,t as K}from"./index-BdiEUYQB.js";import{P as $,E as D}from"./AsyncState-DlUYNJNs.js";function J(){const{t:l}=z(["common","home","work"]),[u,y]=i.useState(""),[a,o]=i.useState("all"),[t,m]=i.useState({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),[h,b]=i.useState(!1),[w,p]=i.useState(!1),v=i.useRef(null),j=i.useRef(void 0);i.useEffect(()=>{setTimeout(()=>v.current?.focus(),100)},[]);const W=i.useCallback(async s=>{if(!s.trim()){m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1);return}b(!0),p(!0);const n=s.toLowerCase();try{const[N,C,V,L,R,A]=await Promise.allSettled([c.agents.list(),c.tasks.list({search:s,pageSize:20}),c.requirements.list(),c.projects.list(),c.deliverables.search({q:s,limit:20}),c.teams.list()]),q=N.status==="fulfilled"?N.value.agents.filter(r=>r.name?.toLowerCase().includes(n)||r.role?.toLowerCase().includes(n)):[],T=C.status==="fulfilled"?C.value.tasks:[],M=V.status==="fulfilled"?V.value.requirements.filter(r=>r.title?.toLowerCase().includes(n)||r.description?.toLowerCase().includes(n)):[],H=L.status==="fulfilled"?L.value.projects.filter(r=>r.name?.toLowerCase().includes(n)||r.description?.toLowerCase().includes(n)):[],P=R.status==="fulfilled"?R.value.results:[],S=[];if(A.status==="fulfilled"){const r=await Promise.allSettled(A.value.teams.map(f=>c.workflows.list(f.id)));for(const f of r)if(f.status==="fulfilled")for(const g of f.value.workflows)(g.name.toLowerCase().includes(n)||(g.displayName||"").toLowerCase().includes(n)||g.description?.toLowerCase().includes(n))&&S.push(g)}m({agents:q,tasks:T,requirements:M,projects:H,deliverables:P,workflows:S})}catch{m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]})}finally{b(!1)}},[]),B=s=>{y(s),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>W(s),400)},E=[{id:"all",label:l("common:all",{defaultValue:"全部"})},{id:"agents",label:l("common:agents",{defaultValue:"智能体"})},{id:"tasks",label:l("common:tasks",{defaultValue:"任务"})},{id:"requirements",label:l("common:requirements",{defaultValue:"需求"})},{id:"projects",label:l("common:projects",{defaultValue:"项目"})},{id:"deliverables",label:l("common:deliverables",{defaultValue:"交付物"})},{id:"workflows",label:l("common:workflows",{defaultValue:"工作流"})}],k=t.agents.length>0||t.tasks.length>0||t.requirements.length>0||t.projects.length>0||t.deliverables.length>0||t.workflows.length>0;return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-2 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d.navigate(x.HOME),className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors shrink-0",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]})}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-tertiary",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:v,value:u,onChange:s=>B(s.target.value),placeholder:l("common:search"),className:"w-full bg-surface-elevated border border-border-default rounded-xl pl-9 pr-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-tertiary focus:border-brand-500 focus:outline-none transition-colors"}),u&&e.jsx("button",{onClick:()=>{y(""),m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1),v.current?.focus()},className:"absolute right-3 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide",children:E.map(s=>e.jsx("button",{onClick:()=>o(s.id),className:`px-3 py-1.5 text-xs rounded-lg whitespace-nowrap transition-colors ${a===s.id?"bg-brand-600 text-on-brand":"bg-surface-elevated text-fg-secondary hover:text-fg-primary"}`,children:s.label},s.id))})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[h&&e.jsx($,{className:"py-12"}),!h&&w&&!k&&e.jsx(D,{className:"py-12",icon:e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),title:l("common:noResults",{defaultValue:"没有找到相关结果"})}),!h&&k&&e.jsxs("div",{className:"space-y-4",children:[(a==="all"||a==="agents")&&t.agents.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:agents",{defaultValue:"智能体"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.agents.slice(0,8):t.agents).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.TEAM,{agentId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(O,{name:s.name||"Agent",avatarUrl:s.avatarUrl,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary truncate",children:s.name}),e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.role||s.status})]}),e.jsx(U,{status:s.status})]},s.id))}),a==="all"&&t.agents.length>8&&e.jsxs("button",{onClick:()=>o("agents"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.agents.length,")"]})]}),(a==="all"||a==="tasks")&&t.tasks.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:tasks",{defaultValue:"任务"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.tasks.slice(0,8):t.tasks).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openTask:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(F,{status:s.status}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),a==="all"&&t.tasks.length>8&&e.jsxs("button",{onClick:()=>o("tasks"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.tasks.length,")"]})]}),(a==="all"||a==="requirements")&&t.requirements.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:requirements",{defaultValue:"需求"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.requirements.slice(0,8):t.requirements).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openRequirement:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${s.status==="approved"?"text-green-500 bg-green-500/15":s.status==="pending"?"text-amber-500 bg-amber-500/15":s.status==="rejected"?"text-red-500 bg-red-500/15":"text-fg-tertiary bg-surface-elevated"}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),a==="all"&&t.requirements.length>8&&e.jsxs("button",{onClick:()=>o("requirements"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.requirements.length,")"]})]}),(a==="all"||a==="projects")&&t.projects.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:projects",{defaultValue:"项目"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.projects.slice(0,8):t.projects).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{projectId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-brand-500",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.name}),s.description&&e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.description})]})]},s.id))}),a==="all"&&t.projects.length>8&&e.jsxs("button",{onClick:()=>o("projects"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.projects.length,")"]})]}),(a==="all"||a==="deliverables")&&t.deliverables.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:deliverables",{defaultValue:"交付物"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.deliverables.slice(0,8):t.deliverables).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.DELIVERABLES,{openDeliverable:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-purple-500",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.type," · ",s.status]})]})]},s.id))}),a==="all"&&t.deliverables.length>8&&e.jsxs("button",{onClick:()=>o("deliverables"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.deliverables.length,")"]})]}),(a==="all"||a==="workflows")&&t.workflows.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:workflows",{defaultValue:"工作流"})}),e.jsx("div",{className:"space-y-1",children:(a==="all"?t.workflows.slice(0,8):t.workflows).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{boardType:"workflows"}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-teal-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-teal-500",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.displayName||s.name}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.stepCount," steps · v",s.version]})]})]},s.name))}),a==="all"&&t.workflows.length>8&&e.jsxs("button",{onClick:()=>o("workflows"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.workflows.length,")"]})]})]}),!h&&!w&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:search")})]})]})]})}function U({status:l}){const u=l==="active"||l==="idle"?"bg-green-500":l==="working"||l==="busy"?"bg-blue-500":"bg-gray-400";return e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${u}`})}function F({status:l}){const u=I[K(l)].chip;return e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${u}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M9 11l3 3L22 4"}),e.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})})}export{J as SearchPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as z,r as c,j as e,A as D,n as H,P as W,k as M}from"./index-BY_HjdWI.js";import{i as B}from"./chatChips-DVIRVTpT.js";const E=80;function G(i){const n=i.replace(/<think>[\s\S]*?<\/think>/g," ").replace(/\[(?:terminal|html|file|deliverable|task|requirement)-?[a-z]*\]/gi," ").replace(/\s+/g," ").trim();return n.length>E?`${n.slice(0,E)}…`:n}async function R(i){const d=(await M.sessions.listByAgent(i,20,1)).sessions??[];return await Promise.all(d.map(async l=>{try{const m=(await M.sessions.getMessages(l.id,1)).messages?.[0];return{id:l.id,title:l.title,lastMessageAt:l.lastMessageAt,snippet:m?.content&&G(m.content)||null,snippetFailed:!1}}catch{return{id:l.id,title:l.title,lastMessageAt:l.lastMessageAt,snippet:null,snippetFailed:!0}}}))}function J(i,n,d){if(i){if(n.some(u=>u.id===i))return`agent:${i}`;if(d.some(u=>u.id===i))return`human:${i}`}return n[0]?`agent:${n[0].id}`:d[0]?`human:${d[0].id}`:""}function Q(i){const n=i.trim();return n.length>40?`${n.slice(0,24)}…${n.slice(-12)}`:n}function X({onClick:i,label:n,className:d}){return e.jsxs("button",{type:"button",onClick:i,title:n,"aria-label":n,className:d??"shrink-0 inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-border-default text-xs text-fg-secondary hover:text-brand-500 hover:border-brand-500/40 hover:bg-brand-500/10 transition-colors",children:[e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"}),e.jsx("line",{x1:"10",y1:"9",x2:"14",y2:"9"})]}),e.jsx("span",{className:"hidden sm:inline",children:n})]})}function _({chipKind:i,chipLabel:n,chipContent:d,agents:u,users:l,defaultTarget:j,onClose:m}){const{t:s}=z(["work","common"]),[x,L]=c.useState(()=>j||J(void 0,u,l)),[v,q]=c.useState(""),[f,N]=c.useState(!1),[b,p]=c.useState("idle"),[w,k]=c.useState([]),h=c.useRef(0),y=c.useMemo(()=>{const t=v.trim().toLowerCase(),r=a=>!t||a.toLowerCase().includes(t);return[...u.filter(a=>r(a.name)).map(a=>({value:`agent:${a.id}`,name:a.name,meta:a.status,isAgent:!0,avatarUrl:a.avatarUrl})),...l.filter(a=>r(a.name)).map(a=>({value:`human:${a.id}`,name:a.name,meta:"",isAgent:!1,avatarUrl:a.avatarUrl}))]},[u,l,v]),C=c.useRef(null),S=c.useRef(!1);c.useEffect(()=>{if(S.current)return;const t=C.current;if(!t)return;const r=t.querySelector('[data-selected="true"]');if(r){S.current=!0;try{r.scrollIntoView({block:"nearest"})}catch{}}},[y]);const[P,T]=x.split(":"),V=P==="agent"?u.find(t=>t.id===T)?.name??"":l.find(t=>t.id===T)?.name??"",A=i??B(d,n),g=t=>{if(!x)return;const[r,a]=x.split(":"),o={chatChips:JSON.stringify([{kind:A,label:n,content:d}])};r==="agent"?o.agentId=a:o.dm=a,t&&(o.sessionId=t),H.navigate(W.TEAM,o),m()},U=async t=>{const r=++h.current;p("loading");try{const a=await R(t);if(r!==h.current)return;k(a),p("ok")}catch{if(r!==h.current)return;k([]),p("error")}},F=()=>{if(!x)return;const[t,r]=x.split(":");if(t!=="agent"){g();return}(async()=>{const a=++h.current;N(!0),p("loading");try{const o=await R(r);if(a!==h.current)return;if(k(o),p("ok"),o.length===0){g();return}if(o.length===1){g(o[0].id);return}}catch{if(a!==h.current)return;k([]),p("error")}})()},I=t=>{const r=new Date(t);if(Number.isNaN(r.getTime()))return"";const a=Date.now()-r.getTime(),o=Math.floor(a/6e4);if(o<1)return s("common:justNow",{defaultValue:"just now"});if(o<60)return`${o}m`;const $=Math.floor(o/60);return $<24?`${$}h`:r.toLocaleDateString()};return e.jsx("div",{className:"fixed inset-0 z-[10050] flex items-center justify-center bg-black/60 p-4",onClick:m,children:e.jsxs("div",{className:"w-full max-w-md max-h-[85vh] flex flex-col bg-surface-primary border border-border-default rounded-2xl shadow-2xl overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-5 pt-4 pb-3 border-b border-border-default shrink-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-fg-primary",children:s("work:task.sendToChatTitle",{defaultValue:"发送到对话"})}),e.jsx("button",{onClick:m,className:"text-fg-tertiary hover:text-fg-secondary text-xl leading-none -mt-1","aria-label":s("common:close"),children:"×"})]}),e.jsx("p",{className:"mt-1 text-xs text-fg-tertiary leading-relaxed",children:s("work:task.sendToChatHint",{defaultValue:"选择要发送到的对话,它会作为上下文标签加入输入框,你可以接着补充说明。"})})]}),f&&e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-3 py-2","data-send-to-sessions":!0,children:[e.jsx("div",{className:"px-2 pb-1 text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider",children:s("work:task.sendToChatSessions",{defaultValue:"Conversation"})}),e.jsx("p",{className:"px-2 pb-2 text-[11px] text-fg-tertiary leading-relaxed",children:s("work:task.sendToChatSessionHint",{defaultValue:"This agent has several conversations — pick the one to send into."})}),b==="loading"&&e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary","data-send-to-sessions-loading":!0,children:s("common:loading",{defaultValue:"Loading…"})}),b==="error"&&e.jsxs("div",{className:"mx-1 mb-2 px-3 py-2 rounded-lg border border-amber-500/40 bg-amber-500/10 text-xs text-amber-500 leading-relaxed","data-send-to-sessions-error":!0,children:[s("work:task.sendToChatSessionError",{defaultValue:"Could not load the conversations — sending to the default conversation instead."}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{const[,t]=x.split(":");t&&U(t)},className:"underline hover:no-underline","data-send-to-sessions-retry":!0,children:s("work:task.sendToChatSessionRetry",{defaultValue:"Retry"})}),e.jsx("button",{type:"button",onClick:()=>g(),className:"underline hover:no-underline","data-send-to-default-session":!0,children:s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"})})]})]}),b==="ok"&&w.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary","data-send-to-sessions-empty":!0,children:s("work:task.sendToChatSessionEmpty",{defaultValue:"No conversations yet — this goes to a new one."})}),b==="ok"&&w.map(t=>e.jsxs("button",{type:"button",onClick:()=>g(t.id),"data-session-id":t.id,className:"w-full text-left px-3 py-2 rounded-lg hover:bg-surface-elevated transition-colors",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm text-fg-primary",children:t.title?.trim()||s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"})}),e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:I(t.lastMessageAt)})]}),e.jsx("div",{className:"text-[11px] text-fg-tertiary truncate",children:t.snippetFailed?s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"}):t.snippet??s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"})})]},t.id)),b==="ok"&&w.length>0&&e.jsxs("button",{type:"button",onClick:()=>g(),className:"w-full text-left px-3 py-2 mt-1 rounded-lg text-xs text-fg-secondary hover:bg-surface-elevated transition-colors","data-send-to-new-session":!0,children:["+ ",s("work:task.sendToChatSessionEmpty",{defaultValue:"No conversations yet — this goes to a new one."})]})]}),e.jsxs("div",{className:`px-5 pt-3 pb-2 shrink-0 ${f?"hidden":""}`,children:[e.jsx("label",{className:"block text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider mb-1",children:s("work:task.sendToChatTarget",{defaultValue:"发送给"})}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-tertiary pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{value:v,onChange:t=>q(t.target.value),placeholder:s("work:task.sendToChatSearch",{defaultValue:"搜索智能体或成员…"}),className:"w-full pl-8 pr-3 py-2 bg-surface-elevated border border-border-default rounded-lg text-sm text-fg-primary outline-none focus:border-brand-500 placeholder:text-fg-tertiary"})]}),e.jsx("div",{className:"mt-1.5 text-[11px] text-fg-tertiary truncate",children:V?`${s("work:task.sendToChatTarget",{defaultValue:"发送给"})}:${V}`:s("work:task.sendToChatNoTarget",{defaultValue:"当前没有可发送的对象"})})]}),e.jsx("div",{className:`flex-1 min-h-0 overflow-y-auto px-2 pb-2 ${f?"hidden":""}`,ref:C,children:y.length===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary",children:s("work:task.sendToChatEmpty",{defaultValue:"没有匹配的对象"})}):y.map((t,r)=>{const a=r===0||y[r-1].isAgent!==t.isAgent,o=t.value===x;return e.jsxs("div",{children:[a&&e.jsx("div",{className:"px-3 pt-2 pb-1 text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider",children:t.isAgent?s("work:task.sendToChatAgents",{defaultValue:"智能体"}):s("work:task.sendToChatHumans",{defaultValue:"成员"})}),e.jsxs("button",{type:"button",onClick:()=>L(t.value),"data-selected":o?"true":"false","aria-current":o?"true":void 0,className:`w-full text-left px-3 py-2 rounded-lg flex items-center gap-2 transition-colors ${o?"bg-brand-500/15 text-brand-500 font-medium":"text-fg-secondary hover:bg-surface-elevated"}`,children:[e.jsx(D,{name:t.name,avatarUrl:t.avatarUrl,size:22,fallback:t.isAgent?"initials":"icon"}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm",children:t.name}),t.meta&&e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:t.meta}),o&&e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]})]},t.value)})}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-default bg-surface-secondary/40 shrink-0",children:[e.jsx("span",{className:"block text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider mb-1",children:s("work:task.sendToChatContext",{defaultValue:"将加入的上下文标签"})}),e.jsx("span",{className:"inline-flex items-center gap-1 max-w-full pl-2 pr-2 py-1 rounded-lg bg-brand-500/10 text-brand-500 text-xs border border-brand-500/20",title:d,"data-chip-kind":A,children:e.jsx("span",{className:"truncate",children:n})}),e.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:f?()=>N(!1):m,className:"px-3 py-1.5 text-xs rounded-lg border border-border-default text-fg-secondary hover:bg-surface-elevated transition-colors",children:f?s("common:back",{defaultValue:"Back"}):s("common:cancel")}),!f&&e.jsx("button",{type:"button",onClick:F,disabled:!x,"data-send-to-confirm":!0,"aria-label":s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"}),className:"px-3 py-1.5 text-xs rounded-lg bg-brand-600 hover:bg-brand-500 text-on-brand font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"})})]})]})]})})}export{_ as S,X as a,J as r,Q as s};
|
|
1
|
+
import{u as z,r as c,j as e,A as D,n as H,P as W,k as M}from"./index-BdiEUYQB.js";import{i as B}from"./chatChips-DVIRVTpT.js";const E=80;function G(i){const n=i.replace(/<think>[\s\S]*?<\/think>/g," ").replace(/\[(?:terminal|html|file|deliverable|task|requirement)-?[a-z]*\]/gi," ").replace(/\s+/g," ").trim();return n.length>E?`${n.slice(0,E)}…`:n}async function R(i){const d=(await M.sessions.listByAgent(i,20,1)).sessions??[];return await Promise.all(d.map(async l=>{try{const m=(await M.sessions.getMessages(l.id,1)).messages?.[0];return{id:l.id,title:l.title,lastMessageAt:l.lastMessageAt,snippet:m?.content&&G(m.content)||null,snippetFailed:!1}}catch{return{id:l.id,title:l.title,lastMessageAt:l.lastMessageAt,snippet:null,snippetFailed:!0}}}))}function J(i,n,d){if(i){if(n.some(u=>u.id===i))return`agent:${i}`;if(d.some(u=>u.id===i))return`human:${i}`}return n[0]?`agent:${n[0].id}`:d[0]?`human:${d[0].id}`:""}function Q(i){const n=i.trim();return n.length>40?`${n.slice(0,24)}…${n.slice(-12)}`:n}function X({onClick:i,label:n,className:d}){return e.jsxs("button",{type:"button",onClick:i,title:n,"aria-label":n,className:d??"shrink-0 inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-border-default text-xs text-fg-secondary hover:text-brand-500 hover:border-brand-500/40 hover:bg-brand-500/10 transition-colors",children:[e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"}),e.jsx("line",{x1:"10",y1:"9",x2:"14",y2:"9"})]}),e.jsx("span",{className:"hidden sm:inline",children:n})]})}function _({chipKind:i,chipLabel:n,chipContent:d,agents:u,users:l,defaultTarget:j,onClose:m}){const{t:s}=z(["work","common"]),[x,L]=c.useState(()=>j||J(void 0,u,l)),[v,q]=c.useState(""),[f,N]=c.useState(!1),[b,p]=c.useState("idle"),[w,k]=c.useState([]),h=c.useRef(0),y=c.useMemo(()=>{const t=v.trim().toLowerCase(),r=a=>!t||a.toLowerCase().includes(t);return[...u.filter(a=>r(a.name)).map(a=>({value:`agent:${a.id}`,name:a.name,meta:a.status,isAgent:!0,avatarUrl:a.avatarUrl})),...l.filter(a=>r(a.name)).map(a=>({value:`human:${a.id}`,name:a.name,meta:"",isAgent:!1,avatarUrl:a.avatarUrl}))]},[u,l,v]),C=c.useRef(null),S=c.useRef(!1);c.useEffect(()=>{if(S.current)return;const t=C.current;if(!t)return;const r=t.querySelector('[data-selected="true"]');if(r){S.current=!0;try{r.scrollIntoView({block:"nearest"})}catch{}}},[y]);const[P,T]=x.split(":"),V=P==="agent"?u.find(t=>t.id===T)?.name??"":l.find(t=>t.id===T)?.name??"",A=i??B(d,n),g=t=>{if(!x)return;const[r,a]=x.split(":"),o={chatChips:JSON.stringify([{kind:A,label:n,content:d}])};r==="agent"?o.agentId=a:o.dm=a,t&&(o.sessionId=t),H.navigate(W.TEAM,o),m()},U=async t=>{const r=++h.current;p("loading");try{const a=await R(t);if(r!==h.current)return;k(a),p("ok")}catch{if(r!==h.current)return;k([]),p("error")}},F=()=>{if(!x)return;const[t,r]=x.split(":");if(t!=="agent"){g();return}(async()=>{const a=++h.current;N(!0),p("loading");try{const o=await R(r);if(a!==h.current)return;if(k(o),p("ok"),o.length===0){g();return}if(o.length===1){g(o[0].id);return}}catch{if(a!==h.current)return;k([]),p("error")}})()},I=t=>{const r=new Date(t);if(Number.isNaN(r.getTime()))return"";const a=Date.now()-r.getTime(),o=Math.floor(a/6e4);if(o<1)return s("common:justNow",{defaultValue:"just now"});if(o<60)return`${o}m`;const $=Math.floor(o/60);return $<24?`${$}h`:r.toLocaleDateString()};return e.jsx("div",{className:"fixed inset-0 z-[10050] flex items-center justify-center bg-black/60 p-4",onClick:m,children:e.jsxs("div",{className:"w-full max-w-md max-h-[85vh] flex flex-col bg-surface-primary border border-border-default rounded-2xl shadow-2xl overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-5 pt-4 pb-3 border-b border-border-default shrink-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-fg-primary",children:s("work:task.sendToChatTitle",{defaultValue:"发送到对话"})}),e.jsx("button",{onClick:m,className:"text-fg-tertiary hover:text-fg-secondary text-xl leading-none -mt-1","aria-label":s("common:close"),children:"×"})]}),e.jsx("p",{className:"mt-1 text-xs text-fg-tertiary leading-relaxed",children:s("work:task.sendToChatHint",{defaultValue:"选择要发送到的对话,它会作为上下文标签加入输入框,你可以接着补充说明。"})})]}),f&&e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-3 py-2","data-send-to-sessions":!0,children:[e.jsx("div",{className:"px-2 pb-1 text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider",children:s("work:task.sendToChatSessions",{defaultValue:"Conversation"})}),e.jsx("p",{className:"px-2 pb-2 text-[11px] text-fg-tertiary leading-relaxed",children:s("work:task.sendToChatSessionHint",{defaultValue:"This agent has several conversations — pick the one to send into."})}),b==="loading"&&e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary","data-send-to-sessions-loading":!0,children:s("common:loading",{defaultValue:"Loading…"})}),b==="error"&&e.jsxs("div",{className:"mx-1 mb-2 px-3 py-2 rounded-lg border border-amber-500/40 bg-amber-500/10 text-xs text-amber-500 leading-relaxed","data-send-to-sessions-error":!0,children:[s("work:task.sendToChatSessionError",{defaultValue:"Could not load the conversations — sending to the default conversation instead."}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{const[,t]=x.split(":");t&&U(t)},className:"underline hover:no-underline","data-send-to-sessions-retry":!0,children:s("work:task.sendToChatSessionRetry",{defaultValue:"Retry"})}),e.jsx("button",{type:"button",onClick:()=>g(),className:"underline hover:no-underline","data-send-to-default-session":!0,children:s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"})})]})]}),b==="ok"&&w.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary","data-send-to-sessions-empty":!0,children:s("work:task.sendToChatSessionEmpty",{defaultValue:"No conversations yet — this goes to a new one."})}),b==="ok"&&w.map(t=>e.jsxs("button",{type:"button",onClick:()=>g(t.id),"data-session-id":t.id,className:"w-full text-left px-3 py-2 rounded-lg hover:bg-surface-elevated transition-colors",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm text-fg-primary",children:t.title?.trim()||s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"})}),e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:I(t.lastMessageAt)})]}),e.jsx("div",{className:"text-[11px] text-fg-tertiary truncate",children:t.snippetFailed?s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"}):t.snippet??s("work:task.sendToChatSessionNoSummary",{defaultValue:"No message yet"})})]},t.id)),b==="ok"&&w.length>0&&e.jsxs("button",{type:"button",onClick:()=>g(),className:"w-full text-left px-3 py-2 mt-1 rounded-lg text-xs text-fg-secondary hover:bg-surface-elevated transition-colors","data-send-to-new-session":!0,children:["+ ",s("work:task.sendToChatSessionEmpty",{defaultValue:"No conversations yet — this goes to a new one."})]})]}),e.jsxs("div",{className:`px-5 pt-3 pb-2 shrink-0 ${f?"hidden":""}`,children:[e.jsx("label",{className:"block text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider mb-1",children:s("work:task.sendToChatTarget",{defaultValue:"发送给"})}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-tertiary pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{value:v,onChange:t=>q(t.target.value),placeholder:s("work:task.sendToChatSearch",{defaultValue:"搜索智能体或成员…"}),className:"w-full pl-8 pr-3 py-2 bg-surface-elevated border border-border-default rounded-lg text-sm text-fg-primary outline-none focus:border-brand-500 placeholder:text-fg-tertiary"})]}),e.jsx("div",{className:"mt-1.5 text-[11px] text-fg-tertiary truncate",children:V?`${s("work:task.sendToChatTarget",{defaultValue:"发送给"})}:${V}`:s("work:task.sendToChatNoTarget",{defaultValue:"当前没有可发送的对象"})})]}),e.jsx("div",{className:`flex-1 min-h-0 overflow-y-auto px-2 pb-2 ${f?"hidden":""}`,ref:C,children:y.length===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-tertiary",children:s("work:task.sendToChatEmpty",{defaultValue:"没有匹配的对象"})}):y.map((t,r)=>{const a=r===0||y[r-1].isAgent!==t.isAgent,o=t.value===x;return e.jsxs("div",{children:[a&&e.jsx("div",{className:"px-3 pt-2 pb-1 text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider",children:t.isAgent?s("work:task.sendToChatAgents",{defaultValue:"智能体"}):s("work:task.sendToChatHumans",{defaultValue:"成员"})}),e.jsxs("button",{type:"button",onClick:()=>L(t.value),"data-selected":o?"true":"false","aria-current":o?"true":void 0,className:`w-full text-left px-3 py-2 rounded-lg flex items-center gap-2 transition-colors ${o?"bg-brand-500/15 text-brand-500 font-medium":"text-fg-secondary hover:bg-surface-elevated"}`,children:[e.jsx(D,{name:t.name,avatarUrl:t.avatarUrl,size:22,fallback:t.isAgent?"initials":"icon"}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm",children:t.name}),t.meta&&e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:t.meta}),o&&e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})]})]},t.value)})}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-default bg-surface-secondary/40 shrink-0",children:[e.jsx("span",{className:"block text-[10px] font-semibold text-fg-tertiary uppercase tracking-wider mb-1",children:s("work:task.sendToChatContext",{defaultValue:"将加入的上下文标签"})}),e.jsx("span",{className:"inline-flex items-center gap-1 max-w-full pl-2 pr-2 py-1 rounded-lg bg-brand-500/10 text-brand-500 text-xs border border-brand-500/20",title:d,"data-chip-kind":A,children:e.jsx("span",{className:"truncate",children:n})}),e.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:f?()=>N(!1):m,className:"px-3 py-1.5 text-xs rounded-lg border border-border-default text-fg-secondary hover:bg-surface-elevated transition-colors",children:f?s("common:back",{defaultValue:"Back"}):s("common:cancel")}),!f&&e.jsx("button",{type:"button",onClick:F,disabled:!x,"data-send-to-confirm":!0,"aria-label":s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"}),className:"px-3 py-1.5 text-xs rounded-lg bg-brand-600 hover:bg-brand-500 text-on-brand font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:s("work:task.sendToChatConfirm",{defaultValue:"发送到对话"})})]})]})]})})}export{_ as S,X as a,J as r,Q as s};
|