@sentry/junior-dashboard 0.279.0 → 0.280.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +100 -31
- package/dist/client-manifest.json +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +100 -31
- package/dist/public/chunks/AdminPage-YEKZOKH6.js +1 -0
- package/dist/public/chunks/AutomationPage-5GS3IUAK.js +3 -0
- package/dist/public/chunks/AutomationRunsPage-IPYEZU4L.js +1 -0
- package/dist/public/chunks/AutomationsPage-HSAYPC3C.js +1 -0
- package/dist/public/chunks/CodePage-IPFKXWFB.js +1 -0
- package/dist/public/chunks/ConnectionsPage-5XUEK6FS.js +1 -0
- package/dist/public/chunks/DrawerContent-RYYS57ZH.js +1 -0
- package/dist/public/chunks/LocationDetailPage-27ETUGR6.js +1 -0
- package/dist/public/chunks/LocationsPage-WOKMQAGM.js +1 -0
- package/dist/public/chunks/McpSettingsPage-3RT7JPEK.js +1 -0
- package/dist/public/chunks/PeoplePage-6YQLDOUL.js +1 -0
- package/dist/public/chunks/PersonProfilePage-GYMAZFIK.js +1 -0
- package/dist/public/chunks/PersonalTokensPage-4BCR744B.js +1 -0
- package/dist/public/chunks/PluginUserPage-IP6WL7MD.js +1 -0
- package/dist/public/chunks/RepositoryPage-TRD44LQ3.js +1 -0
- package/dist/public/chunks/SettingsPage-4E3SLQ36.js +1 -0
- package/dist/public/chunks/SystemPage-C3XBKXKW.js +1 -0
- package/dist/public/chunks/WorkspaceFormPage-2LS2X67Q.js +2 -0
- package/dist/public/chunks/WorkspacesPage-5WB3CUTX.js +1 -0
- package/dist/public/chunks/chunk-2BCS5AQL.js +1 -0
- package/dist/public/chunks/chunk-3Y3ICT6K.js +1 -0
- package/dist/public/chunks/chunk-4AKUZW6R.js +1 -0
- package/dist/public/chunks/chunk-4UGZNVJM.js +1 -0
- package/dist/public/chunks/chunk-564V7YHG.js +1 -0
- package/dist/public/chunks/chunk-5GZDBGAR.js +1 -0
- package/dist/public/chunks/chunk-5ISD3QSC.js +1 -0
- package/dist/public/chunks/chunk-5LNGNJ3P.js +1 -0
- package/dist/public/chunks/chunk-5ZA674OU.js +1 -0
- package/dist/public/chunks/chunk-6FSJ3W2W.js +1 -0
- package/dist/public/chunks/chunk-6GQL3EVJ.js +1 -0
- package/dist/public/chunks/chunk-6PHJZPWD.js +19 -0
- package/dist/public/chunks/chunk-A2QWWA7O.js +41 -0
- package/dist/public/chunks/chunk-AYXSBMWA.js +1 -0
- package/dist/public/chunks/chunk-B5ZN3SWQ.js +14 -0
- package/dist/public/chunks/chunk-B6HGRBBX.js +1 -0
- package/dist/public/chunks/chunk-BKOACADP.js +1 -0
- package/dist/public/chunks/chunk-CQY6BYUB.js +1 -0
- package/dist/public/chunks/chunk-CR2ICLSH.js +1 -0
- package/dist/public/chunks/chunk-DZB4LPI6.js +1 -0
- package/dist/public/chunks/chunk-EFEREKX4.js +1 -0
- package/dist/public/chunks/chunk-FE522UEA.js +1 -0
- package/dist/public/chunks/chunk-FVX42XAD.js +1 -0
- package/dist/public/chunks/chunk-G5NWYJTV.js +1 -0
- package/dist/public/chunks/chunk-GMZIELFU.js +1 -0
- package/dist/public/chunks/chunk-GO45RQDL.js +1 -0
- package/dist/public/chunks/chunk-GOTQ4D6W.js +1 -0
- package/dist/public/chunks/chunk-GRMX2HX6.js +1 -0
- package/dist/public/chunks/chunk-GYRM5ZIV.js +1 -0
- package/dist/public/chunks/chunk-H2ZU34CP.js +1 -0
- package/dist/public/chunks/chunk-H76B43OQ.js +1 -0
- package/dist/public/chunks/chunk-HCLRG2EC.js +1 -0
- package/dist/public/chunks/chunk-IA6BJDKN.js +1 -0
- package/dist/public/chunks/chunk-IZWTFLCC.js +1 -0
- package/dist/public/chunks/chunk-J37MXUED.js +1 -0
- package/dist/public/chunks/chunk-JAZABOBA.js +0 -0
- package/dist/public/chunks/chunk-L2H3ZWZN.js +1 -0
- package/dist/public/chunks/chunk-LBELRO5P.js +1 -0
- package/dist/public/chunks/chunk-LKW7MULF.js +1 -0
- package/dist/public/chunks/chunk-MEHLQZDG.js +3 -0
- package/dist/public/chunks/chunk-MTBUV2GJ.js +1 -0
- package/dist/public/chunks/chunk-N4AONKD3.js +1 -0
- package/dist/public/chunks/chunk-NQMDED2R.js +2 -0
- package/dist/public/chunks/chunk-NQOJAZFQ.js +1 -0
- package/dist/public/chunks/chunk-PEQNT5MO.js +1 -0
- package/dist/public/chunks/chunk-PQPAPPEI.js +1 -0
- package/dist/public/chunks/chunk-PXHLJIOT.js +1 -0
- package/dist/public/chunks/chunk-QNA7F7QB.js +1 -0
- package/dist/public/chunks/chunk-QOX5RMLM.js +1 -0
- package/dist/public/chunks/chunk-QPBLZSNX.js +1 -0
- package/dist/public/chunks/chunk-R4ORRE77.js +1 -0
- package/dist/public/chunks/chunk-RHIXHBS5.js +1 -0
- package/dist/public/chunks/chunk-RHMZNAJX.js +1 -0
- package/dist/public/chunks/chunk-SDKV3OID.js +1 -0
- package/dist/public/chunks/chunk-SIOW7OOW.js +1 -0
- package/dist/public/chunks/chunk-SUX4QBVF.js +1 -0
- package/dist/public/chunks/chunk-T4M53QQT.js +1 -0
- package/dist/public/chunks/chunk-TFJOEF3Q.js +1 -0
- package/dist/public/chunks/chunk-UAH6DWNS.js +1 -0
- package/dist/public/chunks/chunk-UJD3MBMB.js +1 -0
- package/dist/public/chunks/chunk-UK2V4UBT.js +1 -0
- package/dist/public/chunks/chunk-UT6HZPGL.js +1 -0
- package/dist/public/chunks/chunk-UZ44J2LH.js +1 -0
- package/dist/public/chunks/chunk-V5UDSIRA.js +63 -0
- package/dist/public/chunks/chunk-VC6IS564.js +1 -0
- package/dist/public/chunks/chunk-VFEBNOPX.js +1 -0
- package/dist/public/chunks/chunk-VXT3FIVL.js +55 -0
- package/dist/public/chunks/chunk-WJ3OXMVX.js +1 -0
- package/dist/public/chunks/chunk-WRXMQB7X.js +25 -0
- package/dist/public/chunks/chunk-WZVO3HG4.js +1 -0
- package/dist/public/chunks/chunk-XNR4RZEC.js +1 -0
- package/dist/public/chunks/chunk-YPMUHXYT.js +147 -0
- package/dist/public/chunks/chunk-YYNMZ4WC.js +1 -0
- package/dist/public/chunks/chunk-Z2JPRGFT.js +1 -0
- package/dist/public/chunks/chunk-ZIJ6SJDN.js +1 -0
- package/dist/public/chunks/code-highlighter-Q7WC7AEF.js +12 -0
- package/dist/public/client-TYC7JKRE.js +91 -0
- package/dist/tailwind.css +1 -1
- package/package.json +5 -4
- package/src/api/schema.ts +1 -1
- package/src/assets.ts +4 -1
- package/src/client/App.tsx +100 -23
- package/src/client/TracedRoutes.tsx +8 -4
- package/src/client/code-highlighter.ts +26 -0
- package/src/client/code.tsx +2 -22
- package/src/client/components/Drawer.tsx +12 -71
- package/src/client/components/DrawerContent.tsx +76 -0
- package/src/client/components/ProfileMenu.tsx +12 -3
- package/src/client/components/UserInputForm.tsx +28 -5
- package/src/client/conversations/ConversationCatchUp.tsx +107 -0
- package/src/client/conversations/ConversationContextTags.tsx +110 -0
- package/src/client/conversations/ConversationEventLog.tsx +213 -71
- package/src/client/conversations/ConversationHeader.tsx +35 -41
- package/src/client/conversations/ConversationHeaderActions.tsx +34 -38
- package/src/client/conversations/ConversationHomeList.tsx +41 -3
- package/src/client/conversations/ConversationMeta.tsx +6 -12
- package/src/client/conversations/ConversationOverflowMenu.tsx +15 -4
- package/src/client/conversations/ConversationPage.tsx +188 -150
- package/src/client/conversations/ShareConversationButton.tsx +5 -50
- package/src/client/conversations/SlackMark.tsx +16 -4
- package/src/client/conversations/TranscriptRows.tsx +24 -11
- package/src/client/conversations/TranscriptView.tsx +21 -13
- package/src/client/conversations/conversationArchive.ts +22 -0
- package/src/client/conversations/conversationCatchUpState.ts +96 -0
- package/src/client/conversations/conversationMemory.ts +8 -1
- package/src/client/conversations/queries.ts +11 -3
- package/src/client/conversations/{transcriptUnreadHistory.ts → transcriptAroundHistory.ts} +48 -42
- package/src/client/conversations/transcriptBottomPinning.ts +27 -3
- package/src/client/conversations/transcriptReadPosition.ts +24 -2
- package/src/client/conversations/turnContext.ts +1 -1
- package/src/client/pages/admin/AdminPage.tsx +1 -1
- package/src/client/pages/admin/ServiceAccountsSection.tsx +1 -1
- package/src/client/pages/memory/memoryDashboard.ts +1 -1
- package/src/client/pages/memory/memoryRecord.ts +1 -1
- package/src/client/pages/settings/ConnectionsPage.tsx +1 -1
- package/src/client/pages/user/PluginUserPage.tsx +0 -6
- package/src/client/pages/user/pluginUserPageRoutes.ts +5 -0
- package/src/client/primaryNav.ts +1 -1
- package/src/client/review-desk/reviewItemFormat.ts +1 -1
- package/src/mock-reporting/fixtures.ts +43 -0
- package/src/mock-reporting/routes.ts +40 -3
- package/src/public-assets.ts +28 -20
- package/src/shell.ts +12 -2
- package/dist/public/client-ZCZXZBTL.js +0 -460
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ze}from"./chunk-SIOW7OOW.js";import{a as Xe}from"./chunk-SUX4QBVF.js";import{a as se,c as K,f as le,o as de,p as me,q as ce,r as We,s as Ye,t as ue,w as ge,x as he}from"./chunk-V5UDSIRA.js";import{b as Ve}from"./chunk-RHIXHBS5.js";import{a as Z,b as ee,c as te,d as ae,e as re,f as oe,g as ie}from"./chunk-5GZDBGAR.js";import{c as _e}from"./chunk-Z2JPRGFT.js";import"./chunk-NQOJAZFQ.js";import{b as Ke}from"./chunk-J37MXUED.js";import{a as q}from"./chunk-XNR4RZEC.js";import"./chunk-G5NWYJTV.js";import{l as Ce}from"./chunk-A2QWWA7O.js";import{a as X}from"./chunk-3Y3ICT6K.js";import"./chunk-TFJOEF3Q.js";import{b as I}from"./chunk-EFEREKX4.js";import"./chunk-QOX5RMLM.js";import{a as Y}from"./chunk-H76B43OQ.js";import{z as H}from"./chunk-NQMDED2R.js";import"./chunk-PXHLJIOT.js";import{i as Ee,j as Ie,l as He}from"./chunk-GMZIELFU.js";import"./chunk-MEHLQZDG.js";import"./chunk-MTBUV2GJ.js";import{d as we,g as G,i as Re,j as Se,p as Oe,r as z}from"./chunk-GO45RQDL.js";import{Ja as y,a as E,b as N,d as k,e as w,f as W,g as T,s as qe}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import{a as Q,b as Ge}from"./chunk-RHMZNAJX.js";import{a as je}from"./chunk-GOTQ4D6W.js";import{G as Ne,H as Je,K as ne,M as O,d as B,f as Ae,g as F,k as A,q as Te}from"./chunk-6PHJZPWD.js";import"./chunk-T4M53QQT.js";import"./chunk-JAZABOBA.js";import"./chunk-WRXMQB7X.js";import"./chunk-CQY6BYUB.js";import"./chunk-VC6IS564.js";import"./chunk-B5ZN3SWQ.js";import{b as ze}from"./chunk-CR2ICLSH.js";import{Bc as Be,Hc as V,Kc as Fe,Rc as L,Sc as Qe,a as j,ab as Le,b as C,cb as $e,db as xe,mb as ve,zb as Pe}from"./chunk-YPMUHXYT.js";import{c as b}from"./chunk-7SZRL6FY.js";var ke=b(j(),1);var S=b(j(),1);var fe=b(j(),1);function pe(e){let[a,o]=Te(),r=we(),c=(0,fe.useRef)(!1),l=a.get("filter")?.trim()??"",[u,h,p]=Ge(),v=Se({initialPageParam:void 0,queryKey:["dashboard","plugin-user-page",e.pluginName,e.id,l,p],queryFn:({pageParam:g,signal:D})=>{let U=new URLSearchParams;l&&U.set("filter",l),p&&U.set("q",p),g&&U.set("cursor",g);let J=U.toString();return z(qe,`/api/user-pages/${encodeURIComponent(e.pluginName)}/${encodeURIComponent(e.id)}${J?`?${J}`:""}`,D)},getNextPageParam:g=>g.nextCursor,placeholderData:g=>g,retry:!1}),M=(0,fe.useMemo)(()=>[...new Map((v.data?.pages??[]).flatMap(g=>g.records).map(g=>[g.id,g])).values()],[v.data?.pages]),i=Re({mutationFn:g=>Oe(g.href),onMutate:()=>({pluginName:e.pluginName}),onSuccess:async(g,D,U)=>{r.removeQueries({queryKey:["dashboard","plugin-user-page",U.pluginName,"record"]}),await r.invalidateQueries({queryKey:["dashboard","plugin-user-page",U.pluginName]})},onSettled:()=>{c.current=!1}});function d(g){c.current||(c.current=!0,i.mutate(g))}function m(g){let D=new URLSearchParams(a);g?D.set("filter",g):D.delete("filter"),o(D,{replace:!0})}return{action:i,content:v.data?.pages[0],filter:l,query:v,records:M,runAction:d,searchQuery:p,searchText:u,setFilter:m,setSearchText:h}}var tt=E().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),et=w({count:N().int().min(0),date:tt}).strict(),be=w({costUsd:N().finite().min(0),date:tt,events:N().int().min(0)}).strict(),bt=w({days:k(et).length(90),extractionDays:k(be).length(90),extractionHours:k(be).min(24).optional(),generatedAt:T.datetime(),hours:k(et).min(24).optional(),recallDays:k(be).length(90),recallHours:k(be).min(24).optional(),stats:w({active:N().int().min(0),automatic:N().int().min(0),createdThirtyDays:N().int().min(0),embedded:N().int().min(0),explicit:N().int().min(0),knowledge:N().int().min(0),preference:N().int().min(0),procedure:N().int().min(0)}).strict()}).strict();function at(){return G({queryFn:({signal:e})=>z(bt,"/api/plugins/memory/dashboard",e),queryKey:["dashboard","plugin-user-page","memory","summary"],retry:!1})}var ot=b(j(),1);var s=b(C(),1),yt=new Set(["Learned","Memory ID","Source","Type"]);function it(e){let{record:a}=e,[o,r]=(0,ot.useState)(!1),c=a?vt(a):"Memory details",l=a?.actions?.find(u=>u.tone==="danger");return(0,s.jsxs)(_e,{label:"Memory details",onClose:e.onClose,sheetTitle:c,title:(0,s.jsx)("h2",{className:"m-0 flex items-center gap-2 font-display text-base font-medium text-dashboard-text",children:(0,s.jsx)("span",{className:"truncate",children:c})}),children:[(0,s.jsxs)("div",{className:"grid h-full min-h-0 grid-rows-[minmax(0,1fr)_auto]",children:[(0,s.jsx)("div",{"aria-label":"Memory content",role:"region",tabIndex:0,className:"grid min-h-0 min-w-0 content-start gap-4 overflow-y-auto overscroll-contain p-4 outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus [overflow-wrap:anywhere]",children:a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-3 text-sm leading-relaxed",children:[(0,s.jsx)(Ce,{text:a.title}),a.description?(0,s.jsx)(Ce,{text:a.description}):null]}),(0,s.jsx)(xt,{record:a})]}):(0,s.jsx)(I,{label:"Loading memory",variant:"panel"})}),a&&l?(0,s.jsx)("footer",{"aria-label":"Memory actions",className:"flex items-center gap-2 border-t border-dashboard-border bg-dashboard-bg-elevated p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:(0,s.jsxs)(Ee,{children:[(0,s.jsx)(Ie,{render:(0,s.jsx)(ze,{"aria-label":"Forget this memory",className:"min-h-11 min-w-11",disabled:e.forgetPending,onClick:()=>{l.confirmation?r(!0):e.onForget(l)},size:"icon",variant:"danger",children:(0,s.jsx)(V,{"aria-hidden":"true",size:16})})}),(0,s.jsx)(He,{size:"compact",children:"Forget this memory"})]})}):null]}),l?.confirmation&&a?(0,s.jsx)(Z,{onOpenChange:r,open:o,children:(0,s.jsxs)(ee,{children:[(0,s.jsx)(te,{children:l.confirmation}),(0,s.jsx)(ae,{children:a.title}),(0,s.jsxs)(re,{children:[(0,s.jsx)(ie,{children:"Cancel"}),(0,s.jsx)(oe,{onClick:()=>{r(!1),e.onForget(l)},variant:"danger",children:l.label})]})]})}):null]})}function xt(e){let{record:a}=e,o=ye(a,"Learned"),r=ye(a,"Source"),c=o==="Automatic"?`From a ${r??"past"} conversation`:o==="Explicit"?"Someone asked Junior":o?"Before origin tracking":void 0,l=ye(a,"Remembered"),u=(a.metadata??[]).filter(h=>!yt.has(h.label)&&!(h.label==="Observed"&&h.value===l));return(0,s.jsxs)("dl",{className:"m-0 grid min-w-0 gap-2 rounded-lg border border-dashboard-border-subtle bg-dashboard-surface-panel p-3 text-xs leading-snug",children:[c?(0,s.jsx)(rt,{label:"Learned",children:c}):null,u.map(h=>(0,s.jsx)(rt,{label:h.label,children:h.value},h.label))]})}function rt(e){return(0,s.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-4",children:[(0,s.jsx)("dt",{className:"shrink-0 text-dashboard-text-muted",children:e.label}),(0,s.jsx)("dd",{className:"m-0 min-w-0 break-words text-right tabular-nums text-dashboard-text",children:e.children})]})}function vt(e){return ye(e,"Type")??"Memory"}function ye(e,a){return e.metadata?.find(o=>o.label===a)?.value}var R=b(C(),1);function Pt(e){return[...new Set(e.toLowerCase().split(/[^a-z0-9_'-]+/).filter(a=>a.length>=2))]}function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nt(e){let a=Pt(e.query);if(a.length===0)return(0,R.jsx)(R.Fragment,{children:e.text});let o=new RegExp(`(${a.sort((r,c)=>c.length-r.length).map(Ct).join("|")})`,"gi");return(0,R.jsx)(R.Fragment,{children:e.text.split(o).map((r,c)=>c%2===1?(0,R.jsx)("mark",{className:"rounded-sm bg-amber-300/25 text-dashboard-text",children:r},c):r)})}var x=b(C(),1),Nt={count:{color:"var(--color-emerald-300)",label:"Memories"}};function st(e){let a=e.bucketUnit??"day",o=e.days,r=o.map(u=>u.count),c=Math.max(1,...r),l=r.some(u=>u>0);return(0,x.jsxs)(y,{className:"min-h-[17rem] p-4 sm:p-5",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h2",{className:"m-0 font-display text-xl font-medium text-dashboard-text",children:"Activity over time"}),(0,x.jsx)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:a==="hour"?"Memories created each hour.":a==="6hour"?"Memories created each 6 hours.":"Memories created each day."})]}),(0,x.jsxs)("div",{className:"relative mt-3 overflow-hidden",children:[(0,x.jsx)(ge,{className:"aspect-auto h-50 w-full",config:Nt,children:(0,x.jsxs)(le,{"aria-label":`Memories learned during the last ${e.range===1?"24 hours":`${e.range} days`}`,data:o,margin:de,role:"img",children:[(0,x.jsx)(se,{strokeDasharray:"3 5",vertical:!1}),(0,x.jsx)(ce,{maximum:c}),(0,x.jsx)(me,{keys:o.map(u=>u.date)}),(0,x.jsx)(he,{content:(0,x.jsx)(ue,{rows:u=>[["memories",u.count]]})}),(0,x.jsx)(K,{dataKey:"count",fill:"var(--color-count)",fillOpacity:.82,isAnimationActive:!1,maxBarSize:13})]})}),l?null:(0,x.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center pt-12 font-sans text-xs text-dashboard-text-muted",children:"No memories were learned in this period."})]})]})}var f=b(C(),1),Dt={extraction:{color:"var(--color-cyan-300)",label:"Extraction"},recall:{color:"var(--color-fuchsia-400)",label:"Recall"}};function _(e){return H({total:e})}function lt(e){let a=e.bucketUnit??"day",o=new Map(e.recallDays.map(i=>[i.date,i])),r=e.extractionDays.map(i=>{let d=o.get(i.date)??{costUsd:0,date:i.date,events:0};return{date:i.date,extraction:i,extractionCost:i.costUsd,recall:d,recallCost:d.costUsd}}),c=r.reduce((i,d)=>i+d.extraction.costUsd,0),l=r.reduce((i,d)=>i+d.recall.costUsd,0),u=c+l,h=r.reduce((i,d)=>i+d.extraction.events+d.recall.events,0),p=r.map(i=>i.extraction.costUsd+i.recall.costUsd),v=Math.max(.01,...p),M=We(p);return(0,f.jsxs)(y,{className:"min-h-[17rem] p-4 sm:p-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"m-0 font-display text-xl font-medium text-dashboard-text",children:H({total:u})}),(0,f.jsxs)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:["System-wide estimate across ",De(h)," spanning extraction and recall."]}),(0,f.jsx)(Xe,{ariaLabel:"Memory cost legend",items:[{color:"var(--color-cyan-300)",key:"extraction",label:"Extraction",value:H({total:c})},{color:"var(--color-fuchsia-400)",key:"recall",label:"Recall",value:H({total:l})}]})]}),(0,f.jsxs)("div",{className:"relative mt-4 overflow-hidden",children:[(0,f.jsx)(ge,{className:"aspect-auto h-50 w-full",config:Dt,children:(0,f.jsxs)(le,{"aria-label":`Memory extraction and recall cost during the last ${e.range===1?"24 hours":`${e.range} days`}`,data:r,margin:de,role:"img",children:[(0,f.jsx)(se,{strokeDasharray:"3 5",vertical:!1}),(0,f.jsx)(ce,{format:_,maximum:v}),(0,f.jsx)(me,{keys:r.map(i=>i.date)}),(0,f.jsx)(he,{content:(0,f.jsx)(ue,{rows:i=>[["extraction",`${_(i.extractionCost)} \xB7 ${De(i.extraction.events)}`],["recall",`${_(i.recallCost)} \xB7 ${De(i.recall.events)}`],["total",_(i.extractionCost+i.recallCost)]]})}),(0,f.jsx)(K,{dataKey:"extractionCost",fill:"var(--color-extraction)",fillOpacity:.82,isAnimationActive:!1,maxBarSize:13,stackId:"cost"}),(0,f.jsx)(K,{dataKey:"recallCost",fill:"var(--color-recall)",fillOpacity:.82,isAnimationActive:!1,maxBarSize:13,stackId:"cost"}),(0,f.jsx)(Ye,{unit:Je(a),average:M,format:_,stroke:"var(--color-slate-200)"})]})}),h===0?(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center pt-12 font-sans text-xs text-dashboard-text-muted",children:"No memory extraction or recall ran in this period."}):null]})]})}function De(e){return`${e.toLocaleString()} ${e===1?"run":"runs"}`}var Mt=w({content:E().min(1),createdAt:T.datetime(),expiresAt:T.datetime().optional(),id:E().min(1),kind:W(["preference","procedure","knowledge"]),observedAt:T.datetime(),origin:W(["automatic","explicit","other"]),sourcePlatform:W(["local","slack","web"])}).strict();function dt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me(e){return new Intl.DateTimeFormat("en-US",{dateStyle:"medium",timeStyle:"short",timeZone:"UTC"}).format(new Date(e))}function Ut(e){let a=e.origin==="automatic"?"Automatic":e.origin==="explicit"?"Explicit":"Other";return{actions:[{confirmation:"Forget this memory for everyone?",href:`/api/plugins/memory/memories/${encodeURIComponent(e.id)}`,label:"Forget",method:"DELETE",tone:"danger"}],id:e.id,metadata:[{label:"Type",value:dt(e.kind)},{label:"Learned",value:a},{label:"Source",value:dt(e.sourcePlatform)},{label:"Remembered",value:Me(e.createdAt)},{label:"Observed",value:Me(e.observedAt)},{label:"Expires",value:e.expiresAt?Me(e.expiresAt):"Never"}],title:e.content}}function mt(e){return G({enabled:!!e,queryFn:async({signal:a})=>Ut(await z(Mt,`/api/plugins/memory/memories/${encodeURIComponent(e)}`,a)),queryKey:["dashboard","plugin-user-page","memory","record",e],retry:!1})}var t=b(C(),1),ut="grid-cols-1 sm:grid-cols-[minmax(0,1fr)_7rem_9rem]";function gt(e){let[a,o]=(0,S.useState)(30),r=B(),{memoryId:c}=F(),l="/memories",u=`${l}/library`,h=r.pathname===l,p=r.pathname===u||!!c;return!h&&!p?(0,t.jsx)(A,{replace:!0,to:l}):(0,t.jsx)(Ve,{children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O,{description:e.page.description,onRangeChange:o,range:a,title:e.page.label}),(0,t.jsx)(kt,{range:a})]}):(0,t.jsx)(wt,{libraryPath:u,page:e.page})})}function kt(e){let a=at();return a.error?(0,t.jsxs)(y,{className:"flex items-center gap-3 border-rose-300/20 p-5 text-sm text-rose-200",children:[(0,t.jsx)(ve,{"aria-hidden":"true",size:18}),"Memory history is temporarily unavailable."]}):a.data?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"grid gap-4 xl:grid-cols-2",children:[(0,t.jsx)(st,{bucketUnit:Ne(e.range),days:ne({days:a.data.days,hours:a.data.hours,range:e.range,emptySixHour:o=>({count:0,date:o})}),range:e.range}),(0,t.jsx)(lt,{bucketUnit:Ne(e.range),extractionDays:ne({days:a.data.extractionDays,hours:a.data.extractionHours,range:e.range,emptySixHour:o=>({costUsd:0,date:o,events:0})}),range:e.range,recallDays:ne({days:a.data.recallDays,hours:a.data.recallHours,range:e.range,emptySixHour:o=>({costUsd:0,date:o,events:0})})})]}),(0,t.jsx)(St,{data:a.data}),(0,t.jsxs)("section",{className:"grid gap-4 md:grid-cols-2",children:[(0,t.jsx)(At,{data:a.data}),(0,t.jsx)(Tt,{data:a.data})]})]}):(0,t.jsx)(I,{className:"gap-6 sm:gap-8",label:"Loading memory history",variant:"overview"})}function wt(e){let{action:a,content:o,query:r,records:c,runAction:l,searchQuery:u,searchText:h,setSearchText:p}=pe(e.page),v=Ae(),M=B(),{memoryId:i}=F(),d=(0,S.useRef)(null),m=mt(i),g=m.data??c.find(P=>P.id===i),D=P=>Q(P,M.search),U=()=>{let P=i?d.current?.querySelector(`button[data-memory-id="${CSS.escape(i)}"]`):void 0;v(D(e.libraryPath)),(P??d.current)?.focus()},J=P=>{v(D(e.libraryPath)),d.current?.focus(),l(P)};(0,S.useEffect)(()=>{i&&a.reset()},[i]),(0,S.useEffect)(()=>{!i||g||m.isFetching||m.isPending||(m.isError||m.isFetched)&&v(Q(e.libraryPath,M.search),{replace:!0})},[M.search,i,m.isError,m.isFetched,m.isFetching,m.isPending,v,e.libraryPath,g]);let ht=!r.data&&!r.error;return(0,t.jsxs)("div",{className:L("grid h-full min-h-0 min-w-0",i&&"xl:grid-cols-[minmax(0,1fr)_25rem]"),children:[(0,t.jsx)("div",{"aria-label":"Memories list",className:"min-h-0 overflow-y-auto overscroll-contain outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus",ref:d,role:"region",tabIndex:0,children:(0,t.jsxs)(je,{className:"gap-6 sm:gap-8",children:[(0,t.jsx)(O,{description:e.page.description,title:e.page.label}),(0,t.jsxs)("section",{className:"grid gap-4","aria-labelledby":"memory-library-title",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{className:"m-0 font-display text-xl font-medium tracking-[-0.02em] text-dashboard-text",id:"memory-library-title",children:u?"Search results":"What Junior remembers"})}),o?.searchPlaceholder?(0,t.jsx)(Y,{className:"w-full max-w-md sm:w-auto",label:o.searchPlaceholder,onChange:p,placeholder:o.searchPlaceholder,size:"default",value:h}):null]}),ht?(0,t.jsx)(I,{label:"Loading memories",variant:"panel"}):r.error?(0,t.jsxs)(y,{className:"flex items-center gap-3 border-rose-300/20 p-5 text-sm text-rose-200",children:[(0,t.jsx)(ve,{"aria-hidden":"true",size:18}),r.error.message]}):c.length===0?(0,t.jsx)(y,{className:"grid min-h-56 place-items-center p-8 text-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(Pe,{"aria-hidden":"true",className:"mx-auto text-dashboard-text-muted",size:26}),(0,t.jsx)("p",{className:"mt-4 mb-0 text-sm text-dashboard-text-muted",children:o?.emptyText??"No memories yet."})]})}):(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsxs)(y,{padding:"none",children:[(0,t.jsx)(Rt,{}),c.map((P,ft)=>(0,t.jsx)(zt,{first:ft===0,onSelect:()=>v(D(i===P.id?e.libraryPath:`/memories/${encodeURIComponent(P.id)}`)),record:P,searchQuery:u,selected:P.id===i},P.id))]}),(0,t.jsx)(X,{className:"mt-2",hasMore:!r.isPlaceholderData&&!!r.hasNextPage,loading:r.isFetchingNextPage,onLoadMore:()=>{r.fetchNextPage()}}),a.error?(0,t.jsx)(q,{className:"text-center",children:"Could not complete this action. Try again."}):null]})]})]})}),i?(0,t.jsx)(it,{forgetPending:a.isPending,onClose:U,onForget:J,record:g},i):null]})}function Rt(){return(0,t.jsxs)("div",{className:L("hidden items-center gap-3 border-b border-dashboard-border px-4 py-2.5 text-left font-sans font-medium text-xs text-dashboard-text-muted sm:grid",ut),role:"row",children:[(0,t.jsx)("div",{children:"Memory"}),(0,t.jsx)("div",{children:"Type"}),(0,t.jsx)("div",{children:"Learned"})]})}function St(e){let{stats:a}=e.data,o=[{detail:"shared across the workspace",label:"Total active",tone:"text-dashboard-accent-text",value:a.active.toLocaleString("en-US")},{detail:"in the last 30 days",label:"Added \xB7 30d",value:`+${a.createdThirtyDays.toLocaleString("en-US")}`}];return(0,t.jsx)("section",{"aria-label":"Memory summary",className:"grid grid-cols-2 gap-px border-y border-dashboard-border-subtle bg-dashboard-fill-hover",children:o.map(r=>(0,t.jsxs)("div",{className:"bg-dashboard-bg px-4 py-4 sm:px-5",children:[(0,t.jsx)("div",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:r.label}),(0,t.jsx)("div",{className:L("mt-2 font-display text-3xl font-light tracking-[-0.04em] text-dashboard-text",r.tone),children:r.value}),(0,t.jsx)("div",{className:"mt-1 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:r.detail})]},r.label))})}function At(e){let{stats:a}=e.data;return(0,t.jsxs)(y,{className:"p-5 sm:p-6",children:[(0,t.jsx)("h2",{className:"m-0 font-display text-xl font-medium text-dashboard-text",children:"What Junior remembers"}),(0,t.jsxs)("div",{className:"mt-5 grid gap-px overflow-hidden rounded-md border border-dashboard-border-subtle bg-dashboard-fill-hover",children:[(0,t.jsx)($,{detail:"How people like to work",icon:Fe,label:"Preferences",value:a.preference}),(0,t.jsx)($,{detail:"How work should get done",icon:Pe,label:"Procedures",value:a.procedure}),(0,t.jsx)($,{detail:"Facts and durable context",icon:xe,label:"Knowledge",value:a.knowledge})]})]})}function Tt(e){let{stats:a}=e.data,o=Math.max(0,a.active-a.automatic-a.explicit);return(0,t.jsxs)(y,{className:"p-5 sm:p-6",children:[(0,t.jsx)("h2",{className:"m-0 font-display text-xl font-medium text-dashboard-text",children:"How they got here"}),(0,t.jsx)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:"Same totals, split by how they were written."}),(0,t.jsxs)("div",{className:"mt-5 grid gap-px overflow-hidden rounded-md border border-dashboard-border-subtle bg-dashboard-fill-hover",children:[(0,t.jsx)($,{detail:"Passive extraction after runs",icon:Be,label:"Learned by Junior",value:a.automatic}),(0,t.jsx)($,{detail:"Someone asked to remember it",icon:Le,label:"Saved explicitly",value:a.explicit}),(0,t.jsx)($,{detail:"Before origin tracking",icon:xe,label:"Older records",value:o})]})]})}function $(e){let a=e.icon;return(0,t.jsxs)("div",{className:"flex items-center gap-3 bg-dashboard-bg-elevated px-3 py-3",children:[(0,t.jsx)("div",{className:"grid size-9 shrink-0 place-items-center rounded-md border border-dashboard-border bg-dashboard-fill-soft text-dashboard-text-muted",children:(0,t.jsx)(a,{"aria-hidden":"true",size:15})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"font-display text-base font-medium text-dashboard-text",children:e.label}),(0,t.jsx)("div",{className:"mt-0.5 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.detail})]}),(0,t.jsx)("div",{className:"font-display text-2xl font-light text-dashboard-text",children:e.value.toLocaleString("en-US")})]})}function zt(e){let a=Ue(e.record,"Type"),o=Ue(e.record,"Remembered"),r=Ue(e.record,"Source");return(0,t.jsx)(Ze,{className:L("flex items-stretch",!e.first&&"border-t border-dashboard-border-subtle"),onSelect:e.onSelect,selected:e.selected,children:(0,t.jsxs)("button",{"aria-expanded":e.selected,"aria-label":`View memory details: ${e.record.title}`,"data-memory-id":e.record.id,className:L("grid min-w-0 flex-1 cursor-pointer items-center gap-3 border-0 bg-transparent px-4 py-3 text-left",ut),onClick:e.onSelect,type:"button",children:[(0,t.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:(0,t.jsx)("h3",{className:"m-0 truncate font-display text-base font-medium leading-snug text-dashboard-text",children:(0,t.jsx)(nt,{query:e.searchQuery,text:e.record.title})})}),(0,t.jsxs)("div",{className:"mt-1.5 truncate font-sans text-xs leading-relaxed text-dashboard-text-muted",children:["Source: ",r,(0,t.jsxs)("span",{className:"sm:hidden",children:[" ","\xB7 ",a," \xB7 ",ct(o)]})]})]}),(0,t.jsx)("span",{className:"hidden truncate font-mono text-xs text-dashboard-text-muted sm:block",children:a}),(0,t.jsx)("span",{className:"hidden truncate font-mono text-xs text-dashboard-text sm:block",children:ct(o)})]})})}function Ue(e,a){return e.metadata?.find(o=>o.label===a)?.value??"\u2014"}function ct(e){return e.split(",").slice(0,2).join(",")}var n=b(C(),1);function Wa(e){let a=e.pages.find(o=>o.pluginName==="memory"&&o.id==="memories");return a?(0,n.jsx)(gt,{page:a}):(0,n.jsx)(A,{replace:!0,to:"/"})}function Ya(e){let a=B(),{"*":o,pageId:r,pluginName:c}=F(),l=e.pages.find(u=>u.pluginName===c&&u.id===r);if(!l)return(0,n.jsx)(A,{replace:!0,to:"/"});if(l.pluginName==="memory"&&l.id==="memories"){let u=o?`/${o}`:"";return(0,n.jsx)(A,{replace:!0,to:Q(`/memories${u}`,a.search)})}return(0,n.jsx)(Lt,{page:l})}function Lt(e){let{action:a,content:o,query:r,records:c,runAction:l,searchText:u,setSearchText:h}=pe(e.page),[p,v]=(0,ke.useState)(),[M,i]=(0,ke.useState)(!1);return!r.data&&!r.error?(0,n.jsx)(Ke,{label:`Loading ${e.page.label}`}):(0,n.jsxs)("div",{className:`${Qe} px-4 py-8 md:px-8`,children:[(0,n.jsxs)("section",{className:"mx-auto grid w-full max-w-3xl gap-6",children:[(0,n.jsx)(O,{description:e.page.description,title:e.page.label}),o?.metrics?.length?(0,n.jsx)("section",{"aria-label":`${e.page.label} overview`,className:"grid gap-3 sm:grid-cols-2",children:o.metrics.map(d=>(0,n.jsxs)(y,{className:"p-4",children:[(0,n.jsx)("div",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:d.label}),(0,n.jsx)("div",{className:"mt-3 font-display text-2xl font-light text-dashboard-text",children:d.value}),d.detail?(0,n.jsx)("div",{className:"mt-1 font-mono text-xs text-dashboard-text-muted",children:d.detail}):null]},d.label))}):null,o?.searchPlaceholder?(0,n.jsx)(Y,{className:"w-full",label:o.searchPlaceholder,onChange:h,placeholder:o.searchPlaceholder,size:"default",value:u}):null,r.error?(0,n.jsx)(y,{padding:"md",children:(0,n.jsxs)(q,{children:["Could not load ",e.page.label.toLowerCase(),". Try again."]})}):c.length===0?(0,n.jsx)(y,{padding:"md",children:(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("div",{className:"grid size-10 shrink-0 place-items-center rounded-md border border-dashboard-border bg-dashboard-fill-soft text-dashboard-text-muted",children:(0,n.jsx)($e,{"aria-hidden":"true",size:17})}),(0,n.jsx)("p",{className:"m-0 text-sm text-dashboard-text-muted",children:o?.emptyText??`No ${e.page.label.toLowerCase()}.`})]})}):(0,n.jsxs)("div",{className:"grid gap-3",children:[c.map(d=>(0,n.jsxs)(y,{padding:"md",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("h2",{className:"m-0 min-w-0 flex-1 font-display text-base font-medium text-dashboard-text",children:d.title}),d.actions?.map(m=>m.method==="GET"?(0,n.jsx)("a",{className:"shrink-0 rounded-md border border-dashboard-border-strong px-3 py-1.5 text-sm font-semibold text-dashboard-text no-underline transition-colors hover:bg-dashboard-fill-strong",href:m.href,children:m.label},`${m.method}:${m.href}`):(0,n.jsx)("button",{"aria-label":`${m.label}: ${d.title}`,className:`cursor-pointer border-0 bg-transparent p-1 text-dashboard-text-muted transition-colors ${m.tone==="danger"?"hover:text-rose-300":"hover:text-dashboard-text"}`,disabled:a.isPending,onClick:()=>{if(!m.confirmation){l(m);return}v({action:m,record:d}),i(!0)},title:m.label,type:"button",children:m.tone==="danger"?(0,n.jsx)(V,{"aria-hidden":"true",size:16}):m.label},`${m.method}:${m.href}`))]}),d.description?(0,n.jsx)("p",{className:"mt-2 mb-0 text-sm text-dashboard-text-muted",children:d.description}):null,d.metadata?.length?(0,n.jsx)("dl",{className:"mt-4 flex flex-wrap gap-x-6 gap-y-2",children:d.metadata.map(m=>(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:m.label}),(0,n.jsx)("dd",{className:"mt-1 ml-0 font-mono text-xs text-dashboard-text-muted",children:m.value})]},m.label))}):null]},d.id)),(0,n.jsx)(X,{hasMore:!r.isPlaceholderData&&!!r.hasNextPage,loading:r.isFetchingNextPage,onLoadMore:()=>{r.fetchNextPage()}}),a.error?(0,n.jsx)(q,{className:"text-center",children:"Could not complete this action. Try again."}):null]})]}),(0,n.jsx)(Z,{onOpenChange:i,open:M,children:(0,n.jsxs)(ee,{children:[(0,n.jsx)(te,{children:p?.action.confirmation}),(0,n.jsx)(ae,{children:p?.record.title}),(0,n.jsxs)(re,{children:[(0,n.jsx)(ie,{children:"Cancel"}),(0,n.jsx)(oe,{onClick:()=>{p&&l(p.action),i(!1)},variant:p?.action.tone==="danger"?"danger":"primary",children:p?.action.label})]})]})})]})}export{Wa as MemoryPermalinkRoute,Lt as PluginUserPage,Ya as PluginUserPageRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as me}from"./chunk-6GQL3EVJ.js";import{a as le,b as ce}from"./chunk-LBELRO5P.js";import{c as de}from"./chunk-VFEBNOPX.js";import{a as N,b as S}from"./chunk-IA6BJDKN.js";import"./chunk-WJ3OXMVX.js";import"./chunk-SUX4QBVF.js";import"./chunk-V5UDSIRA.js";import{G as Y,M as ee,N as te,P as oe,g as X}from"./chunk-N4AONKD3.js";import{h as K}from"./chunk-R4ORRE77.js";import{a as M}from"./chunk-5ZA674OU.js";import"./chunk-FVX42XAD.js";import"./chunk-A2QWWA7O.js";import{b as P,c as I,d as D}from"./chunk-3Y3ICT6K.js";import{b as h}from"./chunk-5LNGNJ3P.js";import{j as se}from"./chunk-TFJOEF3Q.js";import{a as ne}from"./chunk-YYNMZ4WC.js";import"./chunk-EFEREKX4.js";import"./chunk-LKW7MULF.js";import"./chunk-6FSJ3W2W.js";import"./chunk-2BCS5AQL.js";import"./chunk-QOX5RMLM.js";import{a as A}from"./chunk-H76B43OQ.js";import{e as v}from"./chunk-564V7YHG.js";import{e as V,f as R}from"./chunk-QNA7F7QB.js";import"./chunk-B6HGRBBX.js";import{F as Z,H as J,I as j,N as G,R as w,e as q,g as Q}from"./chunk-NQMDED2R.js";import"./chunk-PXHLJIOT.js";import"./chunk-GMZIELFU.js";import"./chunk-MEHLQZDG.js";import"./chunk-MTBUV2GJ.js";import"./chunk-GO45RQDL.js";import{Ja as T}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import"./chunk-RHMZNAJX.js";import{a as E}from"./chunk-GOTQ4D6W.js";import{G as x,K as ae,L as ie,M as re,g as B,o as y}from"./chunk-6PHJZPWD.js";import"./chunk-T4M53QQT.js";import"./chunk-IZWTFLCC.js";import"./chunk-JAZABOBA.js";import"./chunk-WRXMQB7X.js";import"./chunk-CQY6BYUB.js";import"./chunk-VC6IS564.js";import"./chunk-B5ZN3SWQ.js";import{a as _}from"./chunk-CR2ICLSH.js";import{Cb as U,Rc as W,Tc as $,Xa as F,a as z,b as f}from"./chunk-YPMUHXYT.js";import{c as g}from"./chunk-7SZRL6FY.js";var fe=g(z(),1);var m=g(f(),1);function H(t){return(0,m.jsxs)(T,{as:"section",className:"mb-0",variant:"section",children:[(0,m.jsx)(le,{actions:t.viewAllTo?(0,m.jsx)(y,{className:"text-sm text-dashboard-text underline underline-offset-2",to:t.viewAllTo,children:"View all"}):void 0,children:(0,m.jsx)(ce,{children:t.title})}),t.children]})}function pe(t){let o=t.conversation,i=Z(o),r=J(o,{includeId:!1}),c=!!o.sidebarAnnotations?.length;return(0,m.jsxs)("div",{className:"relative min-w-0 border-b border-dashboard-border-subtle px-4 py-3 transition-colors last:border-b-0 hover:bg-dashboard-fill-soft",children:[(0,m.jsx)(y,{"aria-label":`Open ${i}`,className:"absolute inset-0 z-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-dashboard-focus",to:M(o.id)}),(0,m.jsxs)("div",{className:"pointer-events-none relative z-[1] grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-2",children:[(0,m.jsx)("span",{className:"mt-1.5 grid size-3 shrink-0 place-items-center",children:(0,m.jsx)(ee,{finishedSinceSeen:!1,isPrivate:o.visibility==="private",status:j(o),waitingOnViewer:!1})}),(0,m.jsx)("div",{className:"min-w-0 truncate font-display text-sm text-dashboard-text",children:i}),(0,m.jsx)("span",{className:"whitespace-nowrap font-mono text-xs text-dashboard-text-muted",children:Q(o.lastSeenAt)}),(0,m.jsx)("div",{className:"col-start-2 col-end-4 mt-1 flex h-4 min-w-0 items-center gap-1.5 font-mono text-xs text-dashboard-text-muted",children:c?(0,m.jsx)(Y,{annotations:o.sidebarAnnotations}):r?(0,m.jsx)("span",{className:"truncate",children:r}):null})]})]})}function k(t,o){return ae({days:t.activityDays,hours:t.activityHours,sixHours:t.activitySixHours,range:o,emptySixHour:i=>({closed:0,created:0,date:i,merged:0})})}var d=g(z(),1);var a=g(f(),1),b=25,be=new Set;function ge(t){let[o,i]=(0,d.useState)(""),[r,c]=(0,d.useState)(1),s=oe(o.trim()),l=R(t.repositoryId,s),n=w(l.data?.conversations??[]),u=K();return(0,d.useEffect)(()=>{c(1)},[s]),(0,a.jsxs)("section",{"aria-label":"Conversations",className:"grid gap-3",children:[(0,a.jsx)(A,{className:"w-full sm:ml-auto sm:w-72",label:"Search conversations in this repository",onChange:i,placeholder:"Search conversations\u2026",value:o}),l.error?(0,a.jsx)(v,{children:"Conversations are unavailable. Try refreshing the dashboard."}):(0,a.jsx)(te,{conversations:P(X(n,u),r,b),emptyLabel:s?"No conversations match this search.":"No conversations are linked to this repository yet.",finishedConversationIds:be,loading:!l.data,timeZone:q(),waitingConversationIds:u}),(0,a.jsx)(D,{className:"pt-1",onPageChange:c,page:r,pageCount:I(n.length,b),pageSize:b,total:n.length})]})}function ue(t){let[o,i]=(0,d.useState)(""),[r,c]=(0,d.useState)(""),[s,l]=(0,d.useState)(1),n=t.data.changes,u=r.trim().toLowerCase(),C=n.filter(p=>(!o||p.state===o)&&(!u||p.title?.toLowerCase().includes(u)||`#${p.number}`.includes(u))),L=p=>n.filter(he=>he.state===p).length;return(0,d.useEffect)(()=>{l(1)},[o,u]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N,{bucketUnit:x(t.range),days:k(t.data,t.range),range:t.range}),(0,a.jsxs)("section",{"aria-label":"Changes",className:"grid gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,a.jsx)(de,{ariaLabel:"Change state",items:[{count:n.length,label:"All",value:""},{count:L("open"),label:"Open",value:"open"},{count:L("merged"),label:"Merged",value:"merged"},{count:L("closed"),label:"Closed",value:"closed"}],onChange:i,value:o}),(0,a.jsx)(A,{className:"w-full max-w-md sm:w-auto",label:"Search changes",onChange:c,placeholder:"Title or number",value:r})]}),(0,a.jsx)(T,{children:C.length===0?(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)(v,{children:"No changes match these filters."})}):P(C,s,b).map(p=>(0,a.jsx)(S,{change:p},p.id))}),(0,a.jsx)(D,{onPageChange:l,page:s,pageCount:I(C.length,b),pageSize:b,total:C.length})]})]})}var e=g(f(),1),ye=5,O="Conversations and code changes from Junior.",Ce=W("font-semibold",$);function gt(t){let i=B().repositoryId,[r,c]=(0,fe.useState)(30),s=V(i);if(!s.data&&!s.error)return(0,e.jsx)(ne,{description:O,label:"Loading repository",title:"Repository",variant:"stats"});let l=s.data;if(!l)return(0,e.jsxs)(E,{children:[(0,e.jsx)(ve,{}),(0,e.jsx)(v,{children:"This repository is unavailable. It may not have any code changes from Junior."})]});let n=l.repository;return(0,e.jsx)(se,{ariaLabel:"Repository navigation",items:[{end:!0,label:"Overview",to:h(n.id)},{label:"Conversations",to:h(n.id,"conversations")},{label:"Changes",to:h(n.id,"changes")}],children:(0,e.jsxs)(E,{children:[(0,e.jsx)(ve,{}),(0,e.jsx)(re,{actions:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(ie,{onChange:c,value:r}),n.url?(0,e.jsxs)(y,{className:_(),rel:"noopener noreferrer",target:"_blank",to:n.url,children:["Open repository",(0,e.jsx)(U,{"aria-hidden":"true",className:"size-3.5 shrink-0"})]}):null]}),description:(0,e.jsx)(Re,{data:l}),documentTitle:t.tab==="overview"?n.name:`${n.name} \xB7 ${t.tab==="changes"?"Changes":"Conversations"}`,title:n.name}),t.tab==="overview"?(0,e.jsx)(Te,{data:l,range:r}):null,t.tab==="conversations"?(0,e.jsx)(ge,{repositoryId:n.id}):null,t.tab==="changes"?(0,e.jsx)(ue,{data:l,range:r}):null]})})}function ve(){return(0,e.jsxs)(y,{className:"flex w-fit items-center gap-2 font-display text-sm font-medium text-dashboard-text-muted no-underline transition-colors hover:text-dashboard-text",to:"/code",children:[(0,e.jsx)(F,{"aria-hidden":"true",size:15,strokeWidth:1.8}),"Back to code"]})}function Re(t){let o=t.data.workspaces;return o.length===0?O:(0,e.jsxs)(e.Fragment,{children:[O," / Workspaces"," ",o.map((i,r)=>(0,e.jsxs)("span",{children:[r>0?", ":null,(0,e.jsx)(y,{className:Ce,to:G(i.id),children:i.name})]},i.id))]})}function Te(t){let o=t.data,i=R(o.repository.id),r=w(i.data?.conversations??[]).slice(0,ye),c=o.changes.slice(0,ye);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(me,{summary:o.summary}),(0,e.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,e.jsx)(H,{title:"Recent conversations",viewAllTo:h(o.repository.id,"conversations"),children:r.length>0?r.map(s=>(0,e.jsx)(pe,{conversation:s},s.id)):(0,e.jsx)("div",{className:"p-4",children:(0,e.jsx)(v,{children:i.error?"Conversations are unavailable. Try refreshing the dashboard.":i.data?"No conversations are linked to this repository yet.":"Loading conversations\u2026"})})}),(0,e.jsx)(H,{title:"Recent changes",viewAllTo:h(o.repository.id,"changes"),children:c.length>0?c.map(s=>(0,e.jsx)(S,{change:s},s.id)):(0,e.jsx)("div",{className:"p-4",children:(0,e.jsx)(v,{children:"No code changes are recorded yet."})})})]}),(0,e.jsx)(N,{bucketUnit:x(t.range),days:k(o,t.range),range:t.range})]})}export{gt as RepositoryPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U}from"./chunk-4UGZNVJM.js";import{a as _,c as Q}from"./chunk-GRMX2HX6.js";import{a as F,b as R,c as G}from"./chunk-HCLRG2EC.js";import{a as y,b as C,c as N,e as M}from"./chunk-PQPAPPEI.js";import{a as p}from"./chunk-XNR4RZEC.js";import{a as q}from"./chunk-DZB4LPI6.js";import"./chunk-L2H3ZWZN.js";import{G as O}from"./chunk-R4ORRE77.js";import{a as T,b as A}from"./chunk-B6HGRBBX.js";import"./chunk-NQMDED2R.js";import{l as L}from"./chunk-MEHLQZDG.js";import"./chunk-MTBUV2GJ.js";import{d as f,g as I,i as v,l as k,m as D,o as z,r as H}from"./chunk-GO45RQDL.js";import{G as S,H as P,Ja as u}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import"./chunk-RHMZNAJX.js";import"./chunk-GOTQ4D6W.js";import"./chunk-6PHJZPWD.js";import"./chunk-JAZABOBA.js";import"./chunk-CQY6BYUB.js";import"./chunk-VC6IS564.js";import"./chunk-B5ZN3SWQ.js";import{b}from"./chunk-CR2ICLSH.js";import{a as $,b as x}from"./chunk-YPMUHXYT.js";import{c as g}from"./chunk-7SZRL6FY.js";var h=g($(),1);var a=g(x(),1),J=["dashboard","core"],w=[1,6,24,72,T];function W(t){return t===0?"No done conversations to archive.":t===1?"Archived 1 conversation.":`Archived ${t} conversations.`}function X(t){if(t%24!==0)return t===1?"1 hour":`${t} hours`;let o=t/24;return o===7?"1 week":o===1?"1 day":`${o} days`}function B({identity:t}){let o=f(),i=v({mutationFn:s=>D(A,"/api/me",s),onSuccess:s=>{o.setQueryData(J,r=>r&&{...r,me:s})}}),m=Q(),n=t.autoArchiveDefault??!1,l=t.autoArchiveGraceHours??24,c=w.includes(l)?w:[...w,l].sort((s,r)=>s-r);return(0,a.jsxs)(u,{className:"mt-6 mb-0",padding:"md",variant:"raised",children:[(0,a.jsx)("h2",{className:"m-0 text-lg font-bold",children:"Conversations"}),(0,a.jsxs)("label",{className:"mt-4 flex cursor-pointer items-start gap-3",children:[(0,a.jsx)(F,{checked:n,className:"mt-0.5",disabled:i.isPending,onCheckedChange:s=>i.mutate({autoArchiveDefault:s})}),(0,a.jsxs)("span",{className:"grid gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Auto-archive conversations when done"}),(0,a.jsx)("span",{className:"text-xs text-dashboard-text-muted",children:"Archive a conversation for you when all of its linked work, such as pull requests, is merged or closed and nobody replies during the wait time. You can change this for each conversation in its details."})]})]}),(0,a.jsxs)(y,{className:"mt-5 max-w-xs",children:[(0,a.jsx)(C,{htmlFor:"auto-archive-grace",children:"Wait time"}),(0,a.jsx)(U,{"aria-describedby":"auto-archive-grace-help",disabled:i.isPending,id:"auto-archive-grace",onChange:s=>i.mutate({autoArchiveGraceHours:Number(s.target.value)}),value:l,children:c.map(s=>(0,a.jsx)("option",{value:s,children:X(s)},s))}),(0,a.jsx)(N,{id:"auto-archive-grace-help",children:"How long finished work and the conversation stay quiet before archive."})]}),i.isError?(0,a.jsx)(p,{className:"mt-3",children:"Could not save this setting. Try again."}):null,(0,a.jsxs)("div",{className:"mt-5 grid gap-1.5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)(b,{disabled:m.isPending,onClick:()=>m.mutate(),type:"button",children:m.isPending?"Archiving\u2026":"Archive done now"}),m.isSuccess?(0,a.jsx)("p",{className:"m-0 text-sm text-dashboard-text-muted",role:"status",children:W(m.data.archived)}):null,m.isError?(0,a.jsx)(p,{children:"Could not archive conversations. Try again."}):null]}),(0,a.jsx)("p",{className:"m-0 text-xs text-dashboard-text-muted",children:"Archive every done conversation once, without the wait time. Skips conversations where you turned auto-archive off."})]})]})}var e=g(x(),1),Y=["dashboard","core"],K=["dashboard","user-customization"],V="/api/user-customization";function we({identity:t}){let o=f(),[i,m]=(0,h.useState)(t.user.name??"");(0,h.useEffect)(()=>{m(t.user.name??"")},[t.user.name]);let n=v({mutationFn:d=>D(A,"/api/me",{displayName:d}),onSuccess:d=>{o.setQueryData(Y,E=>E&&{...E,me:d}),m(d.user.name??"")}}),l=t.user.name?.trim()??"",c=i.trim(),s=c.length>0&&c.length<=80&&c!==l&&!n.isPending;function r(d){d.preventDefault(),s&&n.mutate(c)}return(0,e.jsxs)(q,{description:"Manage your profile and preferences.",title:"General",children:[(0,e.jsx)("form",{onSubmit:r,children:(0,e.jsxs)(u,{className:"mb-0",padding:"md",variant:"raised",children:[(0,e.jsx)("h2",{className:"m-0 text-lg font-bold",children:"Profile"}),(0,e.jsxs)(y,{className:"mt-5",children:[(0,e.jsx)(C,{htmlFor:"display-name",children:"Display name"}),(0,e.jsx)(L,{autoComplete:"name",id:"display-name",maxLength:80,onChange:d=>{m(d.target.value),(n.isError||n.isSuccess)&&n.reset()},value:i}),(0,e.jsx)(N,{id:"display-name-help",children:"Your display name is shown with your conversations and activity."})]}),(0,e.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,e.jsx)(b,{disabled:!s,type:"submit",children:n.isPending?"Saving\u2026":"Save changes"}),n.isSuccess?(0,e.jsx)("p",{className:"m-0 text-sm text-emerald-300",children:"Changes saved."}):null,n.isError?(0,e.jsx)(p,{children:"Could not save your display name. Try again."}):null]})]})}),(0,e.jsx)(j,{}),(0,e.jsx)(ee,{}),(0,e.jsx)(B,{identity:t}),(0,e.jsx)(te,{})]})}var Z=[{description:"Open at the first new message, below a \u201CNew\u201D line.",label:"Where I left off",value:"unread"},{description:"Always open at the newest message.",label:"Latest message",value:"latest"}];function j(){let[t,o]=O();return(0,e.jsx)(u,{className:"mt-6 mb-0",padding:"md",variant:"raised",children:(0,e.jsxs)("fieldset",{className:"m-0 min-w-0 border-0 p-0",children:[(0,e.jsx)("legend",{className:"m-0 p-0 text-lg font-bold",children:"Open conversations at"}),(0,e.jsx)("p",{className:"mt-1 mb-4 text-sm text-dashboard-text-muted",children:"Junior keeps your place in each conversation on all your devices. This choice applies to this browser."}),(0,e.jsx)(R,{"aria-label":"Open conversations at",className:"grid gap-3",onValueChange:o,value:t,children:Z.map(i=>(0,e.jsxs)("label",{className:"flex cursor-pointer items-start gap-3",children:[(0,e.jsx)(G,{className:"mt-0.5",value:i.value}),(0,e.jsxs)("span",{className:"grid gap-0.5",children:[(0,e.jsx)("span",{className:"text-sm font-medium",children:i.label}),(0,e.jsx)("span",{className:"text-xs text-dashboard-text-muted",children:i.description})]})]},i.value))})]})})}function ee(){let[t,o]=_();return(0,e.jsxs)(u,{className:"mt-6 mb-0",padding:"md",variant:"raised",children:[(0,e.jsx)("h2",{className:"m-0 text-lg font-bold",children:"Message box"}),(0,e.jsxs)("label",{className:"mt-4 flex cursor-pointer items-start gap-3",children:[(0,e.jsx)(F,{checked:t,className:"mt-0.5",onCheckedChange:o}),(0,e.jsxs)("span",{className:"grid gap-0.5",children:[(0,e.jsx)("span",{className:"text-sm font-medium",children:"Autocorrect"}),(0,e.jsx)("span",{className:"text-xs text-dashboard-text-muted",children:"Let your keyboard correct spelling and capitalize sentences as you type. This can change ids, paths, and code. This choice applies to this browser."})]})]})]})}function te(){let t=f(),[o,i]=(0,h.useState)(""),m=I({queryKey:K,queryFn:({signal:r})=>H(P,V,r),retry:!1}),n=m.data?.customization;(0,h.useEffect)(()=>{n!==void 0&&i(n)},[n]);let l=v({mutationFn:r=>z(P,V,{customization:r}),onSuccess:r=>{t.setQueryData(K,r)}});if(m.error instanceof k&&m.error.status===404)return null;if(n===void 0)return m.isError?(0,e.jsx)(p,{children:"Could not load your customization."}):null;let c=o.trim()!==n&&o.trim().length<=S&&!l.isPending;function s(r){r.preventDefault(),c&&l.mutate(o.trim())}return(0,e.jsx)("form",{onSubmit:s,children:(0,e.jsxs)(u,{className:"mb-0",padding:"md",variant:"raised",children:[(0,e.jsx)("h2",{className:"m-0 text-lg font-bold",children:"Customization"}),(0,e.jsxs)(y,{className:"mt-5",children:[(0,e.jsx)(C,{htmlFor:"user-customization",children:"How should replies to you change?"}),(0,e.jsx)(M,{id:"user-customization",maxLength:S,onChange:r=>{i(r.target.value),(l.isError||l.isSuccess)&&l.reset()},placeholder:"Keep replies short and simple.",value:o}),(0,e.jsxs)(N,{children:["Added to each message you send. Do not put secrets here. (",o.trim().length,"/",S,")"]})]}),(0,e.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,e.jsx)(b,{disabled:!c,type:"submit",children:l.isPending?"Saving\u2026":"Save customization"}),l.isSuccess?(0,e.jsx)("p",{className:"m-0 text-sm text-emerald-300",children:"Changes saved."}):null,l.isError?(0,e.jsx)(p,{children:"Could not save your customization. Try again."}):null]})]})})}export{we as SettingsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as he,b as xe,c as ye}from"./chunk-PEQNT5MO.js";import{a as fe}from"./chunk-H2ZU34CP.js";import{a as A}from"./chunk-WJ3OXMVX.js";import"./chunk-SUX4QBVF.js";import{a as ie,c as re,f as se,j as ne,n as oe,o as le,p as de,q as me,r as ce,s as ge,t as ue,v as pe,w as be,x as ve}from"./chunk-V5UDSIRA.js";import{a as te,b as ae}from"./chunk-AYXSBMWA.js";import{a as T,b as Z,c as D,d as ee}from"./chunk-UT6HZPGL.js";import{a as C}from"./chunk-L2H3ZWZN.js";import"./chunk-TFJOEF3Q.js";import"./chunk-YYNMZ4WC.js";import"./chunk-EFEREKX4.js";import"./chunk-LKW7MULF.js";import"./chunk-6FSJ3W2W.js";import"./chunk-QOX5RMLM.js";import{e as X}from"./chunk-564V7YHG.js";import{f as F,r as f,s as V,z as k}from"./chunk-NQMDED2R.js";import"./chunk-GMZIELFU.js";import{Ja as p}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import"./chunk-RHMZNAJX.js";import"./chunk-GOTQ4D6W.js";import{F as Y,G as J,H as Q,J as B,K as $,M as P,d as _,k as U,o as G,s as w,t as W}from"./chunk-6PHJZPWD.js";import"./chunk-JAZABOBA.js";import"./chunk-WRXMQB7X.js";import"./chunk-CQY6BYUB.js";import"./chunk-B5ZN3SWQ.js";import{Bc as N,Jc as j,Pb as E,Rc as M,Ya as H,a as Be,b,bc as I,cb as y,pb as q,qc as O,yc as K}from"./chunk-YPMUHXYT.js";import{c as u}from"./chunk-7SZRL6FY.js";var Ae=u(Be(),1);var g=u(b(),1);function ke(e){return(0,g.jsxs)("section",{"aria-labelledby":"plugin-details-heading",className:"grid gap-3",children:[(0,g.jsx)(C,{className:"px-1",id:"plugin-details-heading",title:"Details"}),(0,g.jsxs)(p,{children:[(0,g.jsxs)("div",{className:"grid grid-cols-1 gap-px bg-dashboard-fill-hover sm:grid-cols-3",children:[(0,g.jsx)(L,{icon:y,label:"Identifier",value:e.plugin.name}),(0,g.jsx)(L,{icon:N,label:"Skills",value:String(e.plugin.skills.length)}),(0,g.jsx)(L,{icon:E,label:"Configuration",value:String(e.plugin.configKeys.length)})]}),(0,g.jsxs)("div",{className:"grid gap-5 border-t border-dashboard-border-subtle p-4 sm:p-5 lg:grid-cols-2",children:[(0,g.jsx)(Ne,{emptyText:"No plugin-provided skills were discovered.",items:e.plugin.skills.map(t=>t.name),title:"Skills"}),e.plugin.configKeys.length?(0,g.jsx)("div",{className:"lg:col-span-2",children:(0,g.jsx)(Ne,{emptyText:"",items:e.plugin.configKeys,title:"Configuration keys"})}):null]})]})]})}function L(e){let t=e.icon;return(0,g.jsxs)("div",{className:"flex items-center gap-3 bg-dashboard-surface-panel px-4 py-3.5",children:[(0,g.jsx)(t,{"aria-hidden":"true",className:"text-dashboard-accent-text/60",size:15}),(0,g.jsxs)("div",{className:"min-w-0",children:[(0,g.jsx)("div",{className:"truncate font-display text-base font-medium text-dashboard-text",children:e.value}),(0,g.jsx)("div",{className:"mt-0.5 font-sans font-medium text-xs text-dashboard-text-muted",children:e.label})]})]})}function Ne(e){return(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{className:"m-0 font-sans text-xs font-medium text-dashboard-text-muted",children:e.title}),e.items.length?(0,g.jsx)("div",{className:"mt-2.5 flex flex-wrap gap-2",children:e.items.map(t=>(0,g.jsx)("span",{className:"rounded-md border border-dashboard-border bg-dashboard-overlay-soft px-2.5 py-1.5 font-mono text-xs text-dashboard-text-muted",children:t},t))}):(0,g.jsx)("p",{className:"mt-2 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.emptyText})]})}var c=u(b(),1);function Ce(e){return(0,c.jsx)("section",{"aria-label":"Plugins",className:"grid gap-3",children:e.plugins.length?(0,c.jsx)("div",{className:"grid gap-3",children:e.plugins.map(t=>(0,c.jsx)($e,{plugin:t},t.name))}):(0,c.jsx)(p,{padding:"md",children:(0,c.jsx)("div",{className:"font-mono text-xs text-dashboard-text-muted",children:"No plugin inventory has been reported yet."})})})}function $e(e){let t=e.plugin.reports.flatMap(a=>a.metrics??[]);return(0,c.jsxs)(G,{className:"group grid min-w-0 gap-4 rounded-lg border border-dashboard-border bg-dashboard-surface-panel/85 p-4 no-underline transition-colors hover:border-dashboard-accent/20 hover:bg-dashboard-accent/[0.025] sm:p-5",to:D(e.plugin.name),children:[(0,c.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-4",children:[(0,c.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,c.jsx)("div",{className:"grid size-9 shrink-0 place-items-center rounded-md border border-dashboard-accent/15 bg-dashboard-accent/[0.075] text-dashboard-accent-text",children:(0,c.jsx)(y,{"aria-hidden":"true",size:16,strokeWidth:1.8})}),(0,c.jsxs)("div",{className:"min-w-0",children:[(0,c.jsx)("h3",{className:"m-0 truncate font-display text-lg font-medium text-dashboard-text",children:e.plugin.displayName}),(0,c.jsx)("p",{className:"mt-1 mb-0 line-clamp-2 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.plugin.description})]})]}),(0,c.jsx)(H,{"aria-hidden":"true",className:"mt-1 shrink-0 text-dashboard-text-muted transition-transform group-hover:translate-x-0.5 group-hover:text-dashboard-accent-text/70",size:16})]}),t.length?(0,c.jsx)("div",{className:`grid ${t.length===1?"grid-cols-1":"grid-cols-2"} gap-px overflow-hidden rounded-md border border-dashboard-border-subtle bg-dashboard-fill-hover`,children:t.slice(0,2).map(a=>(0,c.jsxs)("div",{className:"min-w-0 bg-dashboard-surface-panel px-3 py-2.5",children:[(0,c.jsx)("div",{className:"truncate font-display text-lg font-light text-dashboard-text",children:a.value}),(0,c.jsx)("div",{className:"mt-1 truncate font-sans font-medium text-xs text-dashboard-text-muted",children:a.label})]},a.label))}):null,(0,c.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-dashboard-border-subtle pt-3",children:(0,c.jsx)(Le,{icon:N,label:`${e.plugin.skills.length} skills`})})]})}function Le(e){let t=e.icon;return(0,c.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-sans font-medium text-xs text-dashboard-text-muted",children:[(0,c.jsx)(t,{"aria-hidden":"true",size:11}),e.label]})}var l=u(b(),1);function Se(e){return e.reports.length===0&&!e.emptyText?null:e.reports.length===0?(0,l.jsx)(p,{padding:"md",children:(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"grid size-10 shrink-0 place-items-center rounded-md border border-dashboard-border bg-dashboard-fill-soft text-dashboard-text-muted",children:(0,l.jsx)(O,{"aria-hidden":"true",size:17})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"m-0 font-display text-base font-medium text-dashboard-text-muted",children:"Operational reports"}),(0,l.jsx)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.emptyText})]})]})}):(0,l.jsxs)("div",{className:"grid gap-3",children:[(0,l.jsx)(C,{className:"px-1",title:"Operational reports"}),e.reports.map(t=>(0,l.jsx)(ze,{fallbackTitle:e.fallbackTitle,range:e.range,report:t},t.pluginName))]})}function ze(e){let a=(e.report.title===e.report.pluginName?void 0:e.report.title)??e.fallbackTitle??e.report.pluginName,s=e.report.metrics??[];return(0,l.jsxs)(p,{children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-4 border-b border-dashboard-border-subtle px-5 py-4",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"m-0 truncate font-display text-lg font-medium text-dashboard-text",children:a}),(0,l.jsx)("div",{className:"mt-1 hidden font-mono text-xs text-dashboard-text-muted sm:block",children:e.report.pluginName})]}),e.report.generatedAt?(0,l.jsxs)("div",{className:"hidden shrink-0 font-mono text-xs text-dashboard-text-muted sm:block",children:["updated ",F(e.report.generatedAt)]}):null]}),s.length?(0,l.jsx)("div",{className:M("grid gap-px bg-dashboard-fill-hover",s.length===1?"grid-cols-1":"grid-cols-2",s.length===3?"lg:grid-cols-3":s.length===5?"lg:grid-cols-5":s.length>=4?"lg:grid-cols-4":void 0),children:s.map(d=>(0,l.jsxs)("div",{className:M("min-w-0 bg-dashboard-surface-panel px-4 py-4",s.length>1&&s.length%2===1&&"last:col-span-2 lg:last:col-span-1",_e(d.tone)),children:[(0,l.jsx)("div",{className:"truncate font-display text-2xl font-light leading-none text-dashboard-text",children:d.value}),(0,l.jsx)("div",{className:"mt-2 font-sans font-medium text-xs text-dashboard-text-muted",children:d.label})]},d.label))}):null,e.report.widgets?.length?(0,l.jsx)("div",{className:"grid gap-3 border-t border-dashboard-border-subtle bg-dashboard-overlay-soft p-3 lg:grid-cols-2",children:e.report.widgets.map(d=>(0,l.jsx)(xe,{range:e.range,widget:d},d.id))}):null,e.report.recordSets?.map(d=>(0,l.jsx)(ye,{embedded:!0,recordSet:d},`${e.report.pluginName}:${d.title}`))]})}function _e(e){return e==="danger"?"shadow-[inset_0_2px_0_rgba(251,113,133,0.65)]":e==="warning"?"shadow-[inset_0_2px_0_rgba(251,191,36,0.65)]":e==="good"?"shadow-[inset_0_2px_0_rgba(110,231,183,0.55)]":""}var o=u(b(),1);function Re(e){let t=He(e.skills),a=e.skills.filter(s=>s.pluginProvider).length;return(0,o.jsxs)(p,{children:[(0,o.jsxs)("div",{className:"flex items-start justify-between gap-4 border-b border-dashboard-border-subtle px-5 py-4 max-sm:flex-col",children:[(0,o.jsx)(C,{description:(0,o.jsxs)(o.Fragment,{children:["The task-specific instructions ",w()," ","discovered, grouped by their plugin provider when one is registered."]}),title:"Skills"}),(0,o.jsxs)("div",{className:"grid min-w-[12rem] grid-cols-2 overflow-hidden rounded-lg border border-dashboard-border bg-dashboard-overlay-soft max-sm:w-full max-sm:min-w-0",children:[(0,o.jsx)(we,{label:"discovered",value:e.skills.length}),(0,o.jsx)(we,{label:"from plugins",value:a})]})]}),(0,o.jsx)("div",{className:"grid gap-3 p-3 sm:p-4",children:t.length?t.map(s=>(0,o.jsx)(Ge,{group:s},s.pluginProvider??"standalone")):(0,o.jsx)("div",{className:"rounded-lg border border-dashed border-dashboard-border px-4 py-8 text-center font-sans text-xs text-dashboard-text-muted",children:"No skills have been discovered yet."})})]})}function Ge(e){let t=e.group.pluginProvider??"Standalone";return(0,o.jsxs)("article",{className:"rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-soft p-4",children:[(0,o.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,o.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,o.jsx)("div",{className:"grid size-8 shrink-0 place-items-center rounded-md border border-dashboard-accent/15 bg-dashboard-accent/[0.075] text-dashboard-accent-text",children:e.group.pluginProvider?(0,o.jsx)(y,{"aria-hidden":"true",size:15,strokeWidth:1.8}):(0,o.jsx)(N,{"aria-hidden":"true",size:15,strokeWidth:1.8})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"m-0 truncate font-display text-base font-medium text-dashboard-text",children:t}),(0,o.jsx)("div",{className:"mt-0.5 font-sans font-medium text-xs text-dashboard-text-muted",children:e.group.pluginProvider?"plugin provider":"core or local"})]})]}),(0,o.jsxs)("span",{className:"font-mono text-xs text-dashboard-text-muted",children:[f(e.group.skills.length)," skill",e.group.skills.length===1?"":"s"]})]}),(0,o.jsx)("div",{className:"flex flex-wrap gap-2",children:e.group.skills.map(a=>(0,o.jsx)("span",{className:"rounded-md border border-dashboard-border bg-dashboard-overlay-soft px-2.5 py-1.5 font-mono text-xs text-dashboard-text-muted",children:a.name},a.name))})]})}function we(e){return(0,o.jsxs)("div",{className:"border-r border-dashboard-border-subtle px-3 py-2.5 text-center last:border-r-0",children:[(0,o.jsx)("div",{className:"font-display text-xl font-light leading-none text-dashboard-text",children:f(e.value)}),(0,o.jsx)("div",{className:"mt-1.5 font-sans font-medium text-xs text-dashboard-text-muted",children:e.label})]})}function He(e){let t=new Map;for(let a of e){let s=t.get(a.pluginProvider)??[];s.push(a),t.set(a.pluginProvider,s)}return[...t.entries()].map(([a,s])=>({pluginProvider:a,skills:[...s].sort((d,r)=>d.name.localeCompare(r.name))})).sort((a,s)=>a.pluginProvider?s.pluginProvider?a.pluginProvider.localeCompare(s.pluginProvider):-1:1)}var v=u(b(),1),qe={conversations:{color:"var(--color-cyan-400)",label:"Conversations"}};function Pe(e){let t=e.bucketUnit??"day",a=Math.max(1,...e.days.map(m=>m.conversations)),s=e.days.map(m=>m.conversations),d=s.reduce((m,x)=>m+x,0),r=ce(s);return(0,v.jsxs)(p,{children:[(0,v.jsx)(fe,{description:`Root conversations with recorded activity, per ${t==="6hour"?"6 hours":t}.`,title:"Conversation activity",total:f(d)}),(0,v.jsx)("div",{className:"px-2 py-2",children:(0,v.jsx)(be,{className:"aspect-auto h-38 w-full",config:qe,children:(0,v.jsxs)(se,{"aria-label":`Conversations per ${t==="6hour"?"6 hours":t}`,data:e.days,margin:le,role:"img",children:[(0,v.jsx)(ie,{strokeDasharray:"3 5",vertical:!1}),(0,v.jsx)(me,{maximum:a}),(0,v.jsx)(de,{keys:e.days.map(m=>m.date)}),(0,v.jsx)(ve,{content:(0,v.jsx)(ue,{rows:m=>[["conversations",m.conversations]]})}),(0,v.jsx)(re,{dataKey:"conversations",fill:"var(--color-conversations)",fillOpacity:.78,isAnimationActive:!1,maxBarSize:24,minPointSize:m=>m?2:0,radius:2}),(0,v.jsx)(ge,{average:r,format:V,stroke:"var(--color-cyan-400)",unit:Q(t)})]})})})]})}var i=u(b(),1);function Ee(e){return e.reduce((t,a)=>({allow:t.allow+a.allow,ask:t.ask+a.ask,costUsd:t.costUsd+(a.costUsd??0),deny:t.deny+a.deny,requests:t.requests+a.requests}),{allow:0,ask:0,costUsd:0,deny:0,requests:0})}function R(e){return(0,i.jsxs)("div",{className:"rounded-md border border-dashboard-border-subtle bg-dashboard-overlay-soft px-3 py-3",children:[(0,i.jsx)("div",{className:"font-display text-xl font-light text-dashboard-text",children:(0,i.jsx)("span",{className:e.valueClassName,children:e.value})}),(0,i.jsx)("div",{className:"mt-1 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.label})]})}function Te(e){let t=e.bucketUnit??"day",a=Ee(e.days),s=Math.max(1,...e.days.map(r=>r.requests)),d=[0,Math.floor((e.days.length-1)/2),e.days.length-1].filter((r,m,x)=>r>=0&&x.indexOf(r)===m);return(0,i.jsxs)(p,{children:[(0,i.jsxs)("div",{className:"border-b border-dashboard-border-subtle px-4 py-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"m-0 font-sans text-xs font-medium text-dashboard-text-muted",children:"Guardian reviews"}),(0,i.jsxs)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:[B(t)," decisions before reviewed actions execute."]})]}),(0,i.jsxs)("div",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:[(0,i.jsx)("span",{className:"mr-3 text-emerald-200/75",children:"Allow"}),(0,i.jsx)("span",{className:"mr-3 text-amber-200/75",children:"Ask"}),(0,i.jsx)("span",{className:"text-rose-200/75",children:"Deny"})]})]}),(0,i.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-5",children:[(0,i.jsx)(R,{label:"Requests",value:f(a.requests)}),(0,i.jsx)(R,{label:"Allowed",value:f(a.allow),valueClassName:"text-emerald-100"}),(0,i.jsx)(R,{label:"Asked",value:f(a.ask),valueClassName:"text-amber-100"}),(0,i.jsx)(R,{label:"Denied",value:f(a.deny),valueClassName:"text-rose-100"}),(0,i.jsx)(R,{label:"Estimated cost",value:k({total:a.costUsd})})]})]}),(0,i.jsxs)("div",{className:"px-4 pt-5 pb-3",children:[(0,i.jsx)("div",{"aria-label":`${B(t)} Guardian review results`,className:"flex h-36 items-end gap-px",role:"img",children:e.days.map(r=>{let m=Math.max(2,r.requests/s*100);return(0,i.jsx)(pe,{content:(0,i.jsxs)("div",{className:"grid grid-cols-[auto_auto] gap-x-4",children:[(0,i.jsx)("span",{children:"Allow"}),(0,i.jsx)("span",{className:"text-right",children:r.allow}),(0,i.jsx)("span",{children:"Ask"}),(0,i.jsx)("span",{className:"text-right",children:r.ask}),(0,i.jsx)("span",{children:"Deny"}),(0,i.jsx)("span",{className:"text-right",children:r.deny}),(0,i.jsx)("span",{children:"Cost"}),(0,i.jsx)("span",{className:"text-right",children:k({total:r.costUsd??0})})]}),date:r.date,summary:`${r.allow} allowed, ${r.ask} asked, ${r.deny} denied, ${k({total:r.costUsd??0})}`,children:(0,i.jsxs)("button",{className:"flex min-w-0 flex-1 flex-col justify-end overflow-hidden rounded-t-sm bg-dashboard-fill-soft focus-visible:outline-1 focus-visible:outline-dashboard-focus",style:{height:`${m}%`},type:"button",children:[r.deny?(0,i.jsx)("span",{className:"block w-full bg-rose-400/75",style:{flex:r.deny}}):null,r.ask?(0,i.jsx)("span",{className:"block w-full bg-amber-300/75",style:{flex:r.ask}}):null,r.allow?(0,i.jsx)("span",{className:"block w-full bg-emerald-300/70",style:{flex:r.allow}}):null]})},r.date)})}),(0,i.jsx)("div",{className:"relative mt-2 h-4",children:d.map(r=>{let m=e.days[r];return m?(0,i.jsx)(oe,{className:"absolute -translate-x-1/2",style:{left:`${(r+.5)/e.days.length*100}%`},children:ne(m.date)},m.date):null})})]})]})}var h=u(b(),1);function Ie(e){return e.reduce((t,a)=>({conversations:t.conversations+a.conversations,costUsd:t.costUsd+(a.costUsd??0),tokens:t.tokens+(a.tokens??0)}),{conversations:0,costUsd:0,tokens:0})}function De(e){if(!e.stats)return(0,h.jsx)(p,{padding:"sm",children:(0,h.jsx)(X,{children:e.error?"Conversation metrics failed to load.":e.loading?"Loading conversation metrics.":"No conversation metrics have been reported yet."})});let t=$({days:e.stats.metricDays,hours:e.stats.metricHours,sixHours:e.stats.metricSixHours,range:e.range,emptySixHour:r=>({conversations:0,date:r,durationMs:0})}),a=$({days:e.stats.guardian.metricDays,hours:e.stats.guardian.metricHours,sixHours:e.stats.guardian.metricSixHours,range:e.range,emptySixHour:r=>({allow:0,ask:0,date:r,deny:0,requests:0})}),s=Ie(t),d=J(e.range);return(0,h.jsxs)("section",{"aria-label":"Runtime telemetry",className:"grid gap-4",children:[e.error?(0,h.jsx)("p",{className:"m-0 font-sans text-xs text-rose-200/65",children:"Metrics refresh failed. Showing cached data."}):null,(0,h.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,h.jsx)(A,{detail:`Root conversations in the ${Y(e.range)}`,icon:I,label:"Conversations",value:f(s.conversations)}),(0,h.jsx)(A,{detail:"All recorded model tokens",icon:K,label:"Tokens",value:f(s.tokens)}),(0,h.jsx)(A,{detail:"Estimated model cost",icon:q,label:"Model spend",value:k({total:s.costUsd})})]}),(0,h.jsx)(he,{bucketUnit:d,cacheBreakdown:!0,days:t}),(0,h.jsx)(Pe,{bucketUnit:d,days:t}),(0,h.jsx)(Te,{bucketUnit:d,days:a})]})}var n=u(b(),1);function Yt(e){let[t,a]=(0,Ae.useState)(30),s=_(),d=e.data.pluginReports?.reports??[],r=Z({plugins:e.data.plugins,reports:d,skills:e.data.skills}),m=ee(s.pathname),x=m===T,S=r.find(Me=>D(Me.name)===m),z=m.startsWith(`${T}/`);return z&&!S&&e.data.pluginReportsLoading?(0,n.jsx)(ae,{description:"Loading plugin details and operational reports.",label:"Loading plugin",title:"Plugin"}):z&&!S?(0,n.jsx)(U,{replace:!0,to:T}):m!=="/system"&&!x&&!S?(0,n.jsx)(U,{replace:!0,to:"/system"}):(0,n.jsx)(te,{children:S?(0,n.jsx)(je,{data:e.data,onRangeChange:a,plugin:S,range:t}):x?(0,n.jsx)(Ke,{data:e.data,plugins:r}):(0,n.jsx)(Oe,{data:e.data,range:t,onRangeChange:a})})}function Oe(e){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{description:`A live read on ${W()} runtime and model usage.`,onRangeChange:e.onRangeChange,range:e.range,title:"System"}),(0,n.jsx)(De,{error:e.data.conversationStatsError,range:e.range,loading:e.data.conversationStatsLoading,stats:e.data.conversationStats})]})}function Ke(e){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{description:`Loaded capabilities and operational reports for ${w()}.`,title:"Plugins"}),e.data.pluginReportsError?(0,n.jsx)(Ue,{showingReports:e.plugins.some(t=>t.reports.length)}):null,(0,n.jsx)(Ce,{plugins:e.plugins}),e.data.skills.length?(0,n.jsx)(Re,{skills:e.data.skills}):null]})}function je(e){let t=e.plugin.reports,a=t.some(s=>s.widgets?.some(d=>d.timeRangeDays?.length));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{description:e.plugin.description,...a?{onRangeChange:e.onRangeChange,range:e.range}:{},title:e.plugin.displayName}),e.data.pluginReportsError?(0,n.jsx)(Ue,{showingReports:!!t.length}):null,(0,n.jsx)(ke,{plugin:e.plugin}),(0,n.jsx)(Se,{fallbackTitle:e.plugin.displayName,...!e.data.pluginReportsLoading&&!e.data.pluginReportsError?{emptyText:"This plugin does not expose operational activity yet."}:{},range:e.range,reports:t})]})}function Ue(e){return(0,n.jsx)(p,{className:"border-amber-300/10 bg-amber-300/[0.025]",padding:"sm",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"grid size-9 shrink-0 place-items-center rounded-md border border-amber-300/15 bg-amber-300/[0.055] text-amber-200/70",children:(0,n.jsx)(j,{"aria-hidden":"true",size:15})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-display text-sm font-medium text-dashboard-text-muted",children:"Plugin stats failed to load."}),(0,n.jsx)("div",{className:"mt-1 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.showingReports?`Showing the last operational reports ${w()} received.`:"Plugin details and capabilities are still available."})]})]})})}export{Yt as SystemPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as M,b as R,c as q,d as F,e as G,f as H}from"./chunk-WZVO3HG4.js";import{a as m,b as l,c as W,e as A}from"./chunk-PQPAPPEI.js";import{a as C}from"./chunk-AYXSBMWA.js";import"./chunk-UT6HZPGL.js";import{b as J}from"./chunk-J37MXUED.js";import{a as V}from"./chunk-XNR4RZEC.js";import"./chunk-TFJOEF3Q.js";import"./chunk-YYNMZ4WC.js";import"./chunk-EFEREKX4.js";import{e as K}from"./chunk-564V7YHG.js";import{N}from"./chunk-NQMDED2R.js";import{l as h}from"./chunk-MEHLQZDG.js";import"./chunk-MTBUV2GJ.js";import{d as E,i as L,n as Q,o as B}from"./chunk-GO45RQDL.js";import{Ga as D,Ja as w}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import"./chunk-RHMZNAJX.js";import"./chunk-GOTQ4D6W.js";import{M as z,f as O,g as I,o as $}from"./chunk-6PHJZPWD.js";import"./chunk-VC6IS564.js";import"./chunk-B5ZN3SWQ.js";import{a as _,b as x}from"./chunk-CR2ICLSH.js";import{Hc as U,a as re,b,pc as T}from"./chunk-YPMUHXYT.js";import{c as v}from"./chunk-7SZRL6FY.js";var k=v(re(),1);function y(){return{key:crypto.randomUUID(),provider:"github",repo:""}}function Y(){return{name:"",setupScript:"",vcpus:"",repos:[y()]}}function X(e){return{name:e.name,setupScript:e.setupScript,vcpus:e.vcpus===null?"":String(e.vcpus),repos:e.repos.length>0?e.repos.map(r=>({key:`${r.provider}:${r.repo.toLowerCase()}`,provider:r.provider,repo:r.repo})):[y()]}}function Z(e){return{name:e.name.trim(),setupScript:e.setupScript,vcpus:e.vcpus.trim()?Number(e.vcpus.trim()):null,repos:e.repos.map(r=>({provider:r.provider.trim(),repo:r.repo.trim()}))}}function j(e,r){return!(r||!e.name.trim()||e.vcpus.trim()&&!/^[1-9]\d*$/.test(e.vcpus.trim())||e.repos.some(p=>!p.provider.trim()||!p.repo.trim()))}var a=v(b(),1);function ee(e){function r(t,s){e.onChange({...e.draft,repos:e.draft.repos.map(o=>o.key===t?{...o,...s}:o)})}function p(t){let s=e.draft.repos.filter(o=>o.key!==t);e.onChange({...e.draft,repos:s.length>0?s:[y()]})}function u(t){t.preventDefault(),e.canSave&&e.onSubmit()}return(0,a.jsx)(w,{className:"mb-0",padding:"md",variant:"section",children:(0,a.jsxs)("form",{className:"grid gap-6",onSubmit:u,children:[(0,a.jsxs)(m,{children:[(0,a.jsx)(l,{htmlFor:"workspace-name",children:"Name"}),(0,a.jsx)(h,{autoComplete:"off",id:"workspace-name",maxLength:64,onChange:t=>e.onChange({...e.draft,name:t.target.value}),placeholder:"sentry",value:e.draft.name}),(0,a.jsx)(W,{id:"workspace-name-help",children:"Lowercase name used when agents switch into this Workspace."})]}),(0,a.jsxs)("section",{className:"grid gap-3","aria-labelledby":"workspace-repos-title",children:[(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start sm:gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 grid gap-1",children:[(0,a.jsx)("h3",{className:"m-0 text-sm font-semibold text-dashboard-text",id:"workspace-repos-title",children:"Repositories"}),(0,a.jsxs)("p",{className:"m-0 text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",children:["Each repository clones to a fixed"," ",(0,a.jsxs)("code",{className:"text-dashboard-text",children:["repos/","{name}"]})," ","path. Junior loads"," ",(0,a.jsx)("code",{className:"text-dashboard-text",children:"AGENTS.md"})," from each repository and labels those instructions with that directory."]})]}),(0,a.jsxs)(x,{className:"w-full sm:w-auto",disabled:e.busy,onClick:()=>e.onChange({...e.draft,repos:[...e.draft.repos,y()]}),type:"button",children:[(0,a.jsx)(T,{"aria-hidden":"true",size:14}),"Add repository"]})]}),(0,a.jsx)("div",{className:"grid gap-3",children:e.draft.repos.map((t,s)=>(0,a.jsx)("div",{className:"grid gap-3 rounded-lg border border-dashboard-border-strong bg-dashboard-overlay-soft p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,8.5rem)_minmax(0,1fr)_auto] sm:items-end",children:[(0,a.jsxs)(m,{className:"gap-1.5",children:[(0,a.jsx)(l,{htmlFor:`workspace-repo-provider-${t.key}`,className:"font-sans text-xs font-medium text-dashboard-text-muted",children:"Provider"}),(0,a.jsx)(h,{"aria-label":`Provider ${s+1}`,id:`workspace-repo-provider-${t.key}`,onChange:o=>r(t.key,{provider:o.target.value}),placeholder:"github",value:t.provider})]}),(0,a.jsxs)(m,{className:"gap-1.5",children:[(0,a.jsx)(l,{htmlFor:`workspace-repo-name-${t.key}`,className:"font-sans text-xs font-medium text-dashboard-text-muted",children:"Repository"}),(0,a.jsx)(h,{"aria-label":`Repository ${s+1}`,id:`workspace-repo-name-${t.key}`,onChange:o=>r(t.key,{repo:o.target.value}),placeholder:"getsentry/sentry",value:t.repo})]}),(0,a.jsxs)(x,{"aria-label":`Remove repository ${s+1}`,className:"w-full sm:w-auto",onClick:()=>p(t.key),variant:"danger",type:"button",children:[(0,a.jsx)(U,{"aria-hidden":"true",size:14}),"Remove"]})]})},t.key))})]}),(0,a.jsxs)(m,{children:[(0,a.jsx)(l,{htmlFor:"workspace-setup",children:"Setup script"}),(0,a.jsx)(A,{className:"font-mono",id:"workspace-setup",onChange:t=>e.onChange({...e.draft,setupScript:t.target.value}),placeholder:`pnpm install --dir "$JUNIOR_REPOS_ROOT/sentry"
|
|
2
|
+
# cwd is $JUNIOR_WORKSPACE_ROOT`,value:e.draft.setupScript}),(0,a.jsx)(W,{id:"workspace-setup-help",children:(0,a.jsxs)(a.Fragment,{children:["Runs once while Junior builds the reusable snapshot. Current working directory is"," ",(0,a.jsx)("code",{className:"text-dashboard-text",children:"$JUNIOR_WORKSPACE_ROOT"})," ","(the Sandbox root, usually"," ",(0,a.jsx)("code",{className:"text-dashboard-text",children:"/vercel/sandbox"}),"). Cloned repositories live under"," ",(0,a.jsx)("code",{className:"text-dashboard-text",children:"$JUNIOR_REPOS_ROOT"})," (",(0,a.jsx)("code",{className:"text-dashboard-text",children:"$JUNIOR_WORKSPACE_ROOT/repos"}),"). Use those variables instead of hard-coded absolute paths."]})})]}),(0,a.jsxs)(m,{children:[(0,a.jsx)(l,{htmlFor:"workspace-vcpus",children:"vCPUs"}),(0,a.jsx)(h,{autoComplete:"off",id:"workspace-vcpus",inputMode:"numeric",onChange:t=>e.onChange({...e.draft,vcpus:t.target.value}),placeholder:M(e.defaultVcpus),value:e.draft.vcpus}),(0,a.jsx)(W,{id:"workspace-vcpus-help",children:"Sandbox vCPUs for this Workspace. Each vCPU adds 2 GB of memory. Leave empty to use the app default."})]}),e.error?(0,a.jsx)(V,{children:e.error}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-t border-dashboard-border-subtle pt-5",children:[(0,a.jsx)(x,{disabled:!e.canSave,type:"submit",variant:"primary",children:e.busy?"Saving\u2026":e.editing?"Save changes":"Create Workspace"}),(0,a.jsx)($,{className:_(),to:e.cancelPath,children:"Cancel"}),(0,a.jsx)("p",{className:"m-0 text-xs text-dashboard-text-muted",children:e.editing?"Saved changes apply the next time this Workspace is prepared.":"You can edit repositories and setup after create."})]})]})})}var i=v(b(),1);function Pe(){let{workspaceId:e}=I(),r=e!==void 0,p=O(),u=E(),[t,s]=(0,k.useState)(Y),[o,P]=(0,k.useState)(),n=H(e),ae=G().data?.defaultVcpus??null;(0,k.useEffect)(()=>{!r||!e||!n.data||o?.workspaceId!==e&&P({draft:X(n.data),workspaceId:e})},[r,o?.workspaceId,e,n.data]);let f=r?o?.workspaceId===e?o.draft:void 0:t,g=L({mutationFn:async d=>{let c=Z(d);return r?B(D,`/api/workspaces/${encodeURIComponent(e)}`,c):Q(D,"/api/workspaces",c)},onSuccess:async d=>{await u.cancelQueries({queryKey:R}),u.setQueryData(R,c=>c&&{...c,workspaces:[d,...c.workspaces.filter(S=>S.id!==d.id)].sort((S,te)=>S.name.localeCompare(te.name))}),await u.invalidateQueries({queryKey:q(d.id)}),p(N(d.id))}});return r&&!n.error&&(!n.data||!f)?(0,i.jsx)(C,{children:(0,i.jsx)(J,{label:"Loading Workspace"})}):(0,i.jsx)(C,{children:(0,i.jsxs)("div",{className:"grid min-w-0 gap-4 sm:gap-5",children:[(0,i.jsx)(z,{description:r?"Change the repositories, setup script, or Sandbox size.":"Name the recipe, choose repositories, and optionally add a one-time setup script.",title:r?n.data?.name??"Workspace":"New Workspace"}),n.error?(0,i.jsx)(w,{padding:"sm",children:(0,i.jsx)(K,{children:F(n.error,"Workspace not found. It may have been deleted.")})}):f?(0,i.jsx)(ee,{busy:g.isPending,canSave:j(f,g.isPending),cancelPath:e?N(e):"/system/workspaces",defaultVcpus:ae,draft:f,editing:r,error:g.error?F(g.error,"Could not save the Workspace. Try again."):void 0,onChange:r?d=>P({draft:d,workspaceId:e}):s,onSubmit:()=>g.mutate(f)}):null]})})}export{Pe as WorkspaceFormPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y,b as z,c as We,d as Te,e as Re,f as Ae}from"./chunk-WZVO3HG4.js";import{a as Le}from"./chunk-BKOACADP.js";import{a as Ee}from"./chunk-SIOW7OOW.js";import{a as Se}from"./chunk-H2ZU34CP.js";import{a as ge,c as he,f as be,o as ke,p as ye,q as xe,r as we,s as ve,t as De,w as Ne,x as Ce}from"./chunk-V5UDSIRA.js";import{a as de,b as w}from"./chunk-4AKUZW6R.js";import{b as j}from"./chunk-GYRM5ZIV.js";import{a as ae,b as oe,c as re,d as se,e as ne,f as ie,g as le}from"./chunk-5GZDBGAR.js";import{c as ce}from"./chunk-Z2JPRGFT.js";import"./chunk-NQOJAZFQ.js";import{e as fe}from"./chunk-UT6HZPGL.js";import"./chunk-FE522UEA.js";import"./chunk-G5NWYJTV.js";import"./chunk-TFJOEF3Q.js";import{a as V,b as C}from"./chunk-EFEREKX4.js";import{e as k}from"./chunk-564V7YHG.js";import{s as Y}from"./chunk-QNA7F7QB.js";import"./chunk-B6HGRBBX.js";import{N as R,f as S,g as W,h as T,r as ee,s as te}from"./chunk-NQMDED2R.js";import{i as E,j as P,l as U}from"./chunk-GMZIELFU.js";import"./chunk-MTBUV2GJ.js";import{d as M,i as $,p as X}from"./chunk-GO45RQDL.js";import{Ja as b}from"./chunk-VXT3FIVL.js";import"./chunk-QPBLZSNX.js";import"./chunk-RHMZNAJX.js";import{a as ue}from"./chunk-GOTQ4D6W.js";import{E as me,M as pe,f as I,g as H,o as D,s as Z}from"./chunk-6PHJZPWD.js";import"./chunk-IZWTFLCC.js";import"./chunk-JAZABOBA.js";import"./chunk-WRXMQB7X.js";import"./chunk-CQY6BYUB.js";import"./chunk-VC6IS564.js";import"./chunk-B5ZN3SWQ.js";import{a as N,b as Q}from"./chunk-CR2ICLSH.js";import{Fb as _,Hc as q,Rc as J,a as F,b as u,kb as O,lc as G,pc as K}from"./chunk-YPMUHXYT.js";import{c as m}from"./chunk-7SZRL6FY.js";var v=m(F(),1);var s=m(u(),1);function Pe(e){let t=e.snapshot;return(0,s.jsx)(b,{as:"section",className:"mb-0",padding:"md",variant:"section",children:(0,s.jsxs)("div",{"aria-labelledby":"base-sandbox-heading",className:"grid gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 grid gap-1",children:[(0,s.jsx)("h2",{className:"m-0 text-base font-semibold text-dashboard-text",id:"base-sandbox-heading",children:"Base Sandbox"}),(0,s.jsx)("p",{className:"m-0 text-sm leading-relaxed text-dashboard-text-muted",children:"The base snapshot is inherited by all Workspaces."})]}),(0,s.jsxs)("dl",{className:"m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-6 gap-y-2 text-sm",children:[(0,s.jsx)(x,{label:"Size",children:y(e.defaultVcpus)}),t?(0,s.jsxs)(s.Fragment,{children:[t.dependencyCount==null?null:(0,s.jsx)(x,{label:"Dependencies",children:t.dependencyCount}),(0,s.jsx)(x,{label:"Build time",children:T(t.buildDurationMs)}),(0,s.jsx)(x,{label:"Generated",children:(0,s.jsx)("span",{title:S(t.generatedAt),children:W(t.generatedAt)})}),(0,s.jsx)(x,{label:"Snapshot",children:(0,s.jsx)("span",{className:"break-all font-mono text-xs",children:t.id})})]}):(0,s.jsx)(x,{label:"Snapshot",children:(0,s.jsx)("span",{className:"text-dashboard-text-muted",children:"Not built yet. The first Sandbox without a Workspace builds it."})})]})]})})}function x(e){return(0,s.jsxs)("div",{className:"contents",children:[(0,s.jsx)("dt",{className:"text-dashboard-text-muted",children:e.label}),(0,s.jsx)("dd",{className:"m-0 min-w-0 tabular-nums text-dashboard-text",children:e.children})]})}var Ue=m(F(),1);var f=m(u(),1);function Ve(e){let[t,o]=(0,Ue.useState)(!0),n=M(),p=j(),c=$({mutationFn:()=>X(`/api/workspaces/${encodeURIComponent(e.workspace.id)}`),onSuccess:async()=>{await n.cancelQueries({queryKey:z}),n.setQueryData(z,r=>r&&{...r,workspaces:r.workspaces.filter(g=>g.id!==e.workspace.id)}),e.onDeleted(),n.removeQueries({queryKey:We(e.workspace.id)}),p.add({title:"Workspace deleted",description:e.workspace.name,type:"success"}),o(!1)}});return(0,f.jsx)(ae,{open:t,onOpenChange:(r,g)=>{c.isPending?g.cancel():o(r)},onOpenChangeComplete:r=>{r||e.onClose()},children:(0,f.jsxs)(oe,{finalFocus:e.returnFocus,children:[(0,f.jsx)(re,{children:"Delete Workspace?"}),(0,f.jsxs)(se,{children:["Delete"," ",(0,f.jsx)("strong",{className:"font-medium text-dashboard-text",children:e.workspace.name}),"? Active conversations keep their current Sandbox until the next switch."]}),c.error?(0,f.jsx)(Le,{tone:"error",title:Te(c.error,"Could not delete the Workspace. Try again.")}):null,(0,f.jsxs)(ne,{children:[(0,f.jsx)(le,{disabled:c.isPending,children:"Cancel"}),(0,f.jsx)(ie,{disabled:c.isPending,onClick:()=>c.mutate(),variant:"danger",children:c.isPending?"Deleting\u2026":"Delete Workspace"})]})]})})}var d=m(u(),1),ze="var(--color-violet-400)",Oe={count:{color:ze,label:"Usage"}};function Be(e){let t=e.days.map(r=>r.count),o=Math.max(1,...t),n=we(t),p=t.reduce((r,g)=>r+g,0),c=p>0;return(0,d.jsxs)(b,{children:[(0,d.jsx)(Se,{description:`Successful switches into \u201C${e.workspaceName}\u201D.`,title:"Usage",total:ee(p),totalLabel:`last ${e.range} days`}),(0,d.jsxs)("div",{className:"relative px-2 py-3 sm:px-4 sm:py-4",children:[(0,d.jsx)(Ne,{className:"aspect-auto h-50 w-full",config:Oe,children:(0,d.jsxs)(be,{"aria-label":`Usage for ${e.workspaceName} during the last ${e.range} days`,data:e.days,margin:ke,role:"img",children:[(0,d.jsx)(ge,{strokeDasharray:"3 5",vertical:!1}),(0,d.jsx)(xe,{maximum:o}),(0,d.jsx)(ye,{keys:e.days.map(r=>r.date)}),(0,d.jsx)(Ce,{content:(0,d.jsx)(De,{rows:r=>[["usage",r.count]]})}),(0,d.jsx)(he,{dataKey:"count",fill:"var(--color-count)",fillOpacity:.82,isAnimationActive:!1,maxBarSize:13,minPointSize:r=>r?2:0,radius:2}),(0,d.jsx)(ve,{average:n,format:te,stroke:ze})]})}),c?null:(0,d.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center pt-12 font-sans text-xs text-dashboard-text-muted",children:"No usage in this period."})]})]})}function _e(e,t=Date.now()){let o=new Date(t);return o.setUTCHours(0,0,0,0),Array.from({length:e},(n,p)=>{let c=new Date(o);return c.setUTCDate(o.getUTCDate()-(e-1-p)),c.toISOString().slice(0,10)})}function Fe(e){let t=new Map;for(let o of e.stats)o.namespace!=="junior"||o.metric!=="workspace_switch"||o.name!==e.workspaceId||t.set(o.date,(t.get(o.date)??0)+o.count);return _e(e.range,e.nowMs).map(o=>({count:t.get(o)??0,date:o}))}var a=m(u(),1),Me=30;function $e(e){let t=Ae(e.workspaceId),o=Y(),n=t.data??e.workspace,p=!n&&(t.isError||e.listError);return(0,a.jsx)(ce,{actions:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(E,{children:[(0,a.jsx)(P,{render:(0,a.jsx)(D,{"aria-label":`Edit ${n.name}`,className:N({size:"icon"}),to:`${R(n.id)}/edit`,children:(0,a.jsx)(G,{"aria-hidden":"true",size:15})})}),(0,a.jsx)(U,{size:"compact",children:"Edit Workspace"})]}),(0,a.jsxs)(E,{children:[(0,a.jsx)(P,{render:(0,a.jsx)(Q,{"aria-label":`Delete ${n.name}`,onClick:c=>e.onDelete(n,c.currentTarget),size:"icon",children:(0,a.jsx)(q,{"aria-hidden":"true",size:15})})}),(0,a.jsx)(U,{size:"compact",children:"Delete Workspace"})]})]}):void 0,label:"Workspace details",onClose:e.onClose,sheetTitle:n?.name,title:(0,a.jsx)("h2",{className:"m-0 break-words font-display text-base font-medium text-dashboard-text",children:n?.name??"Workspace details"}),children:(0,a.jsx)("div",{className:"p-4 [overflow-wrap:anywhere]",children:n?(0,a.jsx)(Ge,{defaultVcpus:e.defaultVcpus,error:!!o.error,loading:o.isPending,snapshot:t.data?"ready":t.isError?"error":"loading",stats:o.data,workspace:n}):p?(0,a.jsx)(k,{children:"Workspace not found. It may have been deleted."}):(0,a.jsx)(C,{label:"Loading Workspace details",variant:"panel"})})})}function Ge(e){let{workspace:t}=e;return(0,a.jsxs)("div",{className:"grid min-w-0 gap-4",children:[(0,a.jsxs)(de,{children:[(0,a.jsx)(w,{label:"Repositories",children:t.repos.length===0?(0,a.jsx)("span",{className:"text-dashboard-text-muted",children:"None"}):(0,a.jsx)("ul",{className:"m-0 grid list-none gap-1.5 p-0",children:t.repos.map(o=>(0,a.jsxs)("li",{className:"min-w-0",children:[(0,a.jsxs)("span",{className:"block font-mono text-xs text-dashboard-text",children:[o.provider,":",o.repo]}),(0,a.jsx)("span",{className:"block font-mono text-xs text-dashboard-text-muted",children:o.checkoutPath})]},`${o.provider}:${o.repo}`))})}),(0,a.jsxs)(w,{label:"Sandbox size",children:[y(t.vcpus??e.defaultVcpus),t.vcpus===null?(0,a.jsx)("span",{className:"text-dashboard-text-muted",children:" \xB7 default"}):null]}),(0,a.jsx)(w,{label:"Snapshot",children:(0,a.jsx)(Ke,{state:e.snapshot,workspace:t})}),(0,a.jsx)(w,{label:"Setup script",children:t.setupScript.trim()?(0,a.jsx)("pre",{className:"m-0 max-h-48 overflow-auto whitespace-pre-wrap rounded-md bg-dashboard-fill-soft p-2 font-mono text-xs leading-relaxed text-dashboard-text",children:t.setupScript}):(0,a.jsx)("span",{className:"text-dashboard-text-muted",children:"None"})})]}),e.stats?(0,a.jsxs)("div",{className:"grid min-w-0 gap-3",children:[e.error?(0,a.jsx)("p",{className:"m-0 font-sans text-xs text-rose-200/65",children:"Workspace usage refresh failed. Showing cached data."}):null,(0,a.jsx)(Be,{days:Fe({workspaceId:t.id,range:Me,stats:e.stats.stats}),range:Me,workspaceName:t.name})]}):(0,a.jsx)(k,{children:e.error?"Workspace usage failed to load.":e.loading?"Loading Workspace usage.":"No usage in this period."})]})}function Ke(e){if(e.state==="loading")return(0,a.jsxs)("span",{className:"grid gap-1.5",role:"status",children:[(0,a.jsx)("span",{className:"sr-only",children:"Loading snapshot"}),(0,a.jsx)(V,{className:"h-4 w-36"}),(0,a.jsx)(V,{className:"h-3.5 w-48"})]});if(e.state==="error")return(0,a.jsx)("span",{className:"text-dashboard-text-muted",children:"Snapshot status could not be loaded."});let t=e.workspace.snapshot;return t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"block tabular-nums",children:[(0,a.jsx)("span",{title:S(t.generatedAt),children:W(t.generatedAt)})," ","\xB7 built in ",T(t.buildDurationMs)]}),(0,a.jsx)("span",{className:"block break-all font-mono text-xs text-dashboard-text-muted",children:t.id})]}):(0,a.jsx)("span",{className:"text-dashboard-text-muted",children:"Not built yet. The first successful prepare builds it."})}var l=m(u(),1);function Ie(e){return(0,l.jsx)(b,{padding:"none",children:e.workspaces.length===0?(0,l.jsx)("div",{className:"p-5",children:(0,l.jsx)(k,{children:"No Workspaces yet. Create one so agents can switch into a prepared multi-repo Sandbox."})}):(0,l.jsx)("ul",{className:"m-0 list-none p-0",children:e.workspaces.map(t=>(0,l.jsx)(qe,{defaultVcpus:e.defaultVcpus,onSelect:()=>e.onSelect(t),selected:t.id===e.selectedId,workspace:t},t.id))})})}function qe(e){let{workspace:t}=e;return(0,l.jsx)("li",{className:"border-b border-dashboard-border-subtle last:border-b-0","data-workspace-id":t.id,children:(0,l.jsx)(Ee,{className:"px-4 py-3.5",onSelect:e.onSelect,selected:e.selected,children:(0,l.jsxs)("button",{"aria-expanded":e.selected,"aria-label":`View Workspace details: ${t.name}`,className:"flex w-full min-w-0 cursor-pointer items-center gap-3 rounded-md border-0 bg-transparent p-0 text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-dashboard-focus",onClick:e.onSelect,type:"button",children:[(0,l.jsx)("span",{className:"grid size-9 shrink-0 place-items-center rounded-md border border-dashboard-border-strong bg-dashboard-fill-soft text-dashboard-accent transition-colors group-hover:border-dashboard-accent/20 group-hover:bg-dashboard-accent/[0.06] group-hover:text-dashboard-accent-text",children:(0,l.jsx)(_,{"aria-hidden":"true",size:16})}),(0,l.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"font-display text-base font-medium leading-tight text-dashboard-text",children:t.name}),(0,l.jsxs)("span",{className:"font-mono text-xs text-dashboard-text-muted",children:[t.repos.length," repo",t.repos.length===1?"":"s"," \xB7"," ",y(t.vcpus??e.defaultVcpus)]})]}),(0,l.jsx)("span",{className:"mt-1.5 block truncate font-mono text-xs text-dashboard-text-muted",children:t.repos.length?t.repos.map(o=>`${o.provider}:${o.repo}`).join(" \xB7 "):"No repositories"})]}),(0,l.jsx)(O,{"aria-hidden":"true",className:"shrink-0 text-dashboard-text-muted transition-transform group-hover:translate-x-0.5 group-hover:text-dashboard-text",size:16})]})})})}var i=m(u(),1),A="/system/workspaces";function ea(){let{workspaceId:e}=H(),t=I(),o=(0,v.useRef)(null),n=(0,v.useRef)(null),[p,c]=(0,v.useState)(),r=Re(),g=r.data?.workspaces??[],L=r.data?.defaultVcpus??null,B=g.find(h=>h.id===e);me(B?.name??"Workspaces");let He=()=>{let h=e?o.current?.querySelector(`[data-workspace-id="${CSS.escape(e)}"] button`):void 0;t(A),(h??o.current)?.focus()};return(0,i.jsxs)(fe,{className:"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] md:grid-rows-[minmax(0,1fr)]",children:[(0,i.jsxs)("div",{className:J("grid h-full min-h-0 min-w-0",e&&"xl:grid-cols-[minmax(0,1fr)_25rem]"),children:[(0,i.jsx)("div",{"aria-label":"Workspaces list",className:"min-h-0 overflow-y-auto overscroll-contain outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus",ref:o,role:"region",tabIndex:0,children:(0,i.jsxs)(ue,{children:[(0,i.jsx)(pe,{actions:(0,i.jsxs)(D,{className:N(),to:`${A}/new`,children:[(0,i.jsx)(K,{"aria-hidden":"true",size:14}),"New Workspace"]}),description:`Named repository recipes ${Z()} can switch into without cloning each turn.`,title:"Workspaces"}),r.error?(0,i.jsx)(b,{padding:"sm",children:(0,i.jsx)(k,{children:"Workspaces failed to load. Try refreshing the dashboard."})}):r.data?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pe,{defaultVcpus:L,snapshot:r.data.baselineSnapshot}),(0,i.jsx)(Ie,{defaultVcpus:L,onSelect:h=>t(h.id===e?A:R(h.id)),selectedId:e,workspaces:g})]}):(0,i.jsx)(C,{label:"Loading Workspaces",variant:"list"})]})}),e?(0,i.jsx)($e,{defaultVcpus:L,listError:!!r.error,onClose:He,onDelete:(h,Qe)=>{n.current=Qe,c(h)},workspace:B,workspaceId:e},e):null]}),p?(0,i.jsx)(Ve,{onClose:()=>c(void 0),onDeleted:()=>{e===p.id&&t(A)},returnFocus:()=>n.current?.isConnected?n.current:o.current??!1,workspace:p}):null]})}export{ea as WorkspacesPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as s,b as n}from"./chunk-YPMUHXYT.js";import{c as a}from"./chunk-7SZRL6FY.js";var e=a(n(),1),r={accent:"text-dashboard-accent",danger:"text-rose-300",info:"text-cyan-300",neutral:"text-dashboard-text-muted",success:"text-emerald-300",warning:"text-amber-300"},c={compact:"text-xs",default:"text-sm"};function o(t){return(0,e.jsxs)("span",{className:s("inline-flex w-fit items-center gap-1.5 font-sans font-medium normal-case leading-snug tracking-normal",c[t.size??"default"],r[t.tone??"neutral"],t.className),children:[(0,e.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-current"}),(0,e.jsx)("span",{className:"block first-letter:uppercase",children:t.children})]})}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o}from"./chunk-CR2ICLSH.js";import{Qa as m,Rc as l,b as u,jb as f,kb as P}from"./chunk-YPMUHXYT.js";import{c as r}from"./chunk-7SZRL6FY.js";var e=r(u(),1);function d({className:n,...t}){return(0,e.jsx)("nav",{role:"navigation","aria-label":"Pagination","data-slot":"pagination",className:m("flex w-full justify-center",n),...t})}function b({className:n,...t}){return(0,e.jsx)("ul",{"data-slot":"pagination-content",className:m("flex items-center gap-2",n),...t})}function g({...n}){return(0,e.jsx)("li",{"data-slot":"pagination-item",...n})}function C(n){return(0,e.jsx)(o,{"aria-label":"Previous page",size:"icon",...n,children:(0,e.jsx)(f,{"aria-hidden":"true",size:16})})}function x(n){return(0,e.jsx)(o,{"aria-label":"Next page",size:"icon",...n,children:(0,e.jsx)(P,{"aria-hidden":"true",size:16})})}var a=r(u(),1);function I(n){return n.hasMore?(0,a.jsx)(o,{className:l("justify-self-center",n.className),disabled:n.loading,onClick:n.onLoadMore,children:n.loading?"Loading\u2026":"Load more"}):null}function y(n,t,i){let c=(Math.max(1,t)-1)*i;return n.slice(c,c+i)}function z(n,t){return n<=0?1:Math.max(1,Math.ceil(n/t))}function B(n){if(n.total<=n.pageSize||n.pageCount<=1)return null;let t=Math.min(Math.max(1,n.page),n.pageCount),i=(t-1)*n.pageSize+1,s=Math.min(n.total,t*n.pageSize);return(0,a.jsxs)(d,{className:l("flex-wrap items-center justify-between gap-3",n.className),children:[(0,a.jsxs)("p",{className:"m-0 font-sans tabular-nums text-xs text-dashboard-text-muted",children:["Showing ",i.toLocaleString("en-US"),"-",s.toLocaleString("en-US")," of"," ",n.total.toLocaleString("en-US")]}),(0,a.jsxs)(b,{children:[(0,a.jsx)(g,{children:(0,a.jsx)(C,{disabled:t<=1,onClick:()=>n.onPageChange(t-1)})}),(0,a.jsxs)(g,{className:"min-w-16 text-center font-sans tabular-nums text-xs text-dashboard-text-muted",children:[t," / ",n.pageCount]}),(0,a.jsx)(g,{children:(0,a.jsx)(x,{disabled:t>=n.pageCount,onClick:()=>n.onPageChange(t+1)})})]})]})}export{I as a,y as b,z as c,B as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as a,b as l}from"./chunk-YPMUHXYT.js";import{c as t}from"./chunk-7SZRL6FY.js";var d=t(l(),1);function s(e){return(0,d.jsx)("dl",{className:a("grid gap-px overflow-hidden rounded-md border border-dashboard-border-subtle bg-dashboard-fill-hover",e.className),children:e.children})}function o(e){return(0,d.jsxs)("div",{className:"min-w-0 bg-dashboard-bg-elevated px-3 py-3",children:[(0,d.jsx)("dt",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:e.label}),(0,d.jsx)("dd",{className:a("mt-1.5 ml-0 break-words text-sm leading-relaxed text-dashboard-text",e.valueClassName),children:e.children})]})}export{s as a,o as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qa as e,Sa as d,b as s,ib as n}from"./chunk-YPMUHXYT.js";import{c as t}from"./chunk-7SZRL6FY.js";var o=t(s(),1),l=d("block w-full min-w-0 appearance-none pr-9 disabled:cursor-not-allowed disabled:opacity-60 forced-colors:appearance-auto [color-scheme:var(--dashboard-color-scheme,dark)]",{variants:{variant:{form:"min-h-11 rounded-md border border-dashboard-border-emphasis bg-dashboard-ink py-2 pl-3 text-base text-dashboard-text focus:border-dashboard-focus focus:outline-none aria-invalid:border-rose-300 sm:min-h-10 sm:text-sm",filter:"h-9 rounded-lg border border-dashboard-border-emphasis bg-dashboard-control pl-2 text-sm text-dashboard-text transition-colors hover:border-dashboard-border-interactive focus:border-dashboard-focus focus:outline-none focus:ring-1 focus:ring-dashboard-focus/25",sort:"h-full bg-dashboard-control pl-2 font-sans text-xs text-dashboard-text-muted outline-none"}},defaultVariants:{variant:"form"}});function m({className:i,variant:a,...r}){return(0,o.jsxs)("span",{"data-slot":"native-select-wrapper",className:e("relative block w-full min-w-0",a==="sort"&&"h-full",i),children:[(0,o.jsx)("select",{"data-slot":"native-select",className:l({variant:a}),...r}),(0,o.jsx)(n,{"aria-hidden":"true","data-slot":"native-select-icon",className:e("pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-dashboard-text-muted forced-colors:hidden",r.disabled&&"opacity-60")})]})}export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qa as o,b as i}from"./chunk-YPMUHXYT.js";import{c as d}from"./chunk-7SZRL6FY.js";var r=d(i(),1);function a({className:t,...e}){return(0,r.jsx)("div",{"data-slot":"empty",className:o("min-w-0 rounded-lg border border-dashboard-border-strong bg-dashboard-bg px-4 py-3",t),...e})}function m({className:t,...e}){return(0,r.jsx)("div",{"aria-hidden":"true","data-slot":"empty-media",className:o("grid size-8 shrink-0 place-items-center rounded-md bg-dashboard-fill-strong text-dashboard-text-subtle [&_svg:not([class*='size-'])]:size-4",t),...e})}function l({className:t,...e}){return(0,r.jsx)("div",{"data-slot":"empty-title",className:o("font-display text-base font-medium leading-tight text-dashboard-text",t),...e})}function p({className:t,...e}){return(0,r.jsx)("div",{"data-slot":"empty-description",className:o("text-base leading-relaxed text-dashboard-text-muted",t),...e})}var n=d(i(),1);function b(t){return(0,n.jsx)(a,{children:(0,n.jsx)(p,{children:t.children})})}export{a,m as b,l as c,p as d,b as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p,b as m}from"./chunk-NQOJAZFQ.js";import{e as g,f as d,i as c,j as D,k as f,l as u,m as x,n as A}from"./chunk-G5NWYJTV.js";import{b as l}from"./chunk-CR2ICLSH.js";import{Qa as a,b as n}from"./chunk-YPMUHXYT.js";import{b as h,c as s}from"./chunk-7SZRL6FY.js";var r={};h(r,{Backdrop:()=>p,Close:()=>g,Description:()=>d,Handle:()=>i,Popup:()=>m,Portal:()=>c,Root:()=>P,Title:()=>u,Trigger:()=>y,Viewport:()=>f,createHandle:()=>b});function P(t){return D("alert-dialog",t)}var y=x;var i=class extends A{};function b(){return new i}var o=s(n(),1);function X(t){return(0,o.jsx)(r.Root,{...t})}function Y({className:t,...e}){return(0,o.jsxs)(r.Portal,{children:[(0,o.jsx)(r.Backdrop,{className:"fixed inset-0 z-50 bg-dashboard-overlay transition-opacity duration-180 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0"}),(0,o.jsx)(r.Popup,{"data-dashboard-modal":"","data-slot":"alert-dialog-content",className:a("fixed top-1/2 left-1/2 z-50 grid grid-cols-1 max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-sm -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl border border-dashboard-border-emphasis bg-dashboard-surface-raised p-5 text-dashboard-text shadow-lg outline-none transition-[opacity,scale] duration-180 motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:scale-95 data-starting-style:scale-95",t),...e})]})}function Z({className:t,...e}){return(0,o.jsx)(r.Title,{className:a("m-0 font-display text-lg font-medium",t),...e})}function _({className:t,...e}){return(0,o.jsx)(r.Description,{className:a("m-0 break-words text-sm leading-relaxed text-dashboard-text-muted",t),...e})}function $({className:t,...e}){return(0,o.jsx)("div",{className:a("flex flex-wrap justify-end gap-2",t),...e})}function tt(t){return(0,o.jsx)(l,{"data-slot":"alert-dialog-action",className:"min-h-11",...t})}function ot(t){return(0,o.jsx)(r.Close,{render:(0,o.jsx)(l,{className:"min-h-11"}),...t})}export{X as a,Y as b,Z as c,_ as d,$ as e,tt as f,ot as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-4UGZNVJM.js";import{b as o}from"./chunk-YPMUHXYT.js";import{c as t}from"./chunk-7SZRL6FY.js";var e=t(o(),1);function l(a){return(0,e.jsxs)("label",{className:"grid h-9 min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center overflow-hidden rounded-lg border border-dashboard-border-strong bg-dashboard-fill-faint transition-colors hover:border-dashboard-border-emphasis focus-within:border-amber-500/35 focus-within:ring-1 focus-within:ring-amber-500/15",children:[(0,e.jsx)("span",{className:"flex h-full items-center border-r border-dashboard-border-subtle px-2 font-sans font-medium text-xs text-dashboard-text-muted",children:"Sort"}),(0,e.jsx)(i,{"aria-label":a.ariaLabel,variant:"sort",value:a.value,onChange:r=>a.onChange(r.currentTarget.value),children:a.options.map(r=>(0,e.jsx)("option",{className:"bg-dashboard-control text-dashboard-text",value:r.value,children:r.label},r.value))})]})}export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=["overview","conversations","changes"];function n(r,o="overview"){let e=`/code/${encodeURIComponent(r)}`;return o==="overview"?e:`${e}/${o}`}export{t as a,n as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(n,t){let e=`/conversations/${encodeURIComponent(n)}`,r=new URLSearchParams;t?.turnId&&r.set(u,t.turnId),t?.reviewItems&&r.set(s,i);let o=r.toString();return o?`${e}?${o}`:e}var d="/";function a(n){return n==="/"||n==="/conversations/new"}var p="event";function E(n){return n&&/^\d+$/.test(n)?Number(n):void 0}var s="review",i="open",u="turn";function N(n,t){return n?.find(({data:e})=>e.type==="turn_lifecycle"&&e.state==="started"&&e.turnId===t)?.seq}export{c as a,d as b,a as c,p as d,E as e,s as f,i as g,u as h,N as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as oe,t as le}from"./chunk-WRXMQB7X.js";import{c as R,e as ie,h as ae,i as ue,j as ce}from"./chunk-B5ZN3SWQ.js";import{Fa as se,M as X,Oa as B,Pa as V,Qc as fe,Xc as de,a as Q,g as k,h as ne,j as g,l as re}from"./chunk-YPMUHXYT.js";import{c as J}from"./chunk-7SZRL6FY.js";var H=J(Q(),1);function Le(e){let{open:o,defaultOpen:s=!1,onOpenChange:c,disabled:u}=e,[n,b]=de({controlled:o,default:s,name:"Collapsible",state:"open"}),{mounted:r,setMounted:d,transitionStatus:v}=ce(n,!0,!0),l=fe(),[p,h]=H.useState(),S=p===null?void 0:p??l,L=g(x=>{let y=!n,C=B(V.triggerPress,x.nativeEvent);c(y,C),!C.isCanceled&&b(y)});return H.useMemo(()=>({defaultPanelId:l,disabled:u,handleTrigger:L,mounted:r,open:n,panelId:S,setMounted:d,setOpen:b,setPanelIdState:h,transitionStatus:v}),[l,u,L,r,n,S,d,b,h,v])}var U=J(Q(),1),Ae=U.createContext(void 0);function je(){let e=U.useContext(Ae);if(e===void 0)throw new Error(ne(15));return e}var pe="data-open",me="data-closed",I=X.startingStyle,Ve=X.endingStyle;var ye="data-panel-open";var De={[pe]:""},Oe={[me]:""},He={open(e){return e?{[ye]:""}:null}},Ue={open(e){return e?De:Oe}};var a=J(Q(),1);var O={height:void 0,width:void 0};function nt(e){let{externalRef:o,hiddenUntilFound:s,id:c,keepMounted:u,mounted:n,onOpenChange:b,open:r,setMounted:d,setOpen:v,transitionStatus:l}=e,p=a.useRef(null),h=a.useRef(null),[S,L]=a.useState(O),x=a.useRef(O),y=a.useRef(!1),C=a.useRef(r),z=a.useRef(!1),[K,_]=a.useState(!1),N=a.useRef(null),Re=se(o,p),T=le(r),$=ae(p),F=!r&&!n,j=K?"idle":l,W=r&&(C.current||z.current),ee=!r&&n&&h.current==="css-animation"&&S.height===void 0&&S.width===void 0?x.current:S,be=s&&F&&h.current!=="css-animation",f=g((t,i=!0)=>{i&&(x.current=t),L(t)}),M=g(()=>{N.current?.(),N.current=null}),Y=g(t=>{M(),N.current=()=>{N.current=null,t()}}),te=g(()=>{r&&n&&h.current==="css-animation"&&(z.current=!0)});k(()=>{!K||l==="starting"||_(!1)},[K,l]),a.useEffect(()=>()=>{te(),M()},[te,M]),k(()=>{r||(C.current=!1,z.current=!1);let t=p.current;if(!t)return;!r&&N.current&&M();let i=Ee(t,W);if(h.current=i,r&&l==="idle"&&C.current&&i==="css-animation"){x.current=E(t);return}if(r&&l==="starting"){let A=y.current;if(y.current=!1,i==="none"){f(E(t)),_(!0);return}if(i==="css-transition"){let P=ve(t);if(f(E(t)),!A)return P;let D=q(t,"transition-duration","0s");return Y(D),_(!0),P}f(E(t));let Z=q(t,"animation-name","none");if(!A){Z();return}let G=q(t,"animation-duration","0s");Z(),Y(G),_(!0);return}if(!r&&n&&(l==="idle"||l==="starting")){if(i==="none"){f(O,!1),d(!1);return}f(E(t));return}if(l!=="ending")return;if(i==="none"){d(!1);return}let m=E(t);if(!(m.height>0||m.width>0)){d(!1);return}f(m),i==="css-animation"&&q(t,"animation-name","none")()},[n,r,M,f,d,Y,W,l]),ue({enabled:r&&n&&j==="idle",open:!0,ref:p,onComplete(){r&&f(O,!1)}}),a.useEffect(()=>{if(r||!n||j!=="ending")return;if(!p.current){d(!1),f(O,!1);return}let i=new AbortController,m=-1;function w(){T.current||(d(!1),f(O,!1))}return m=R.request(()=>{$(w,i.signal)}),()=>{R.cancel(m),i.abort()}},[T,n,r,j,$,f,d]),k(()=>{let t=p.current;!t||!s||!F||t.setAttribute("hidden","until-found")},[F,s]),a.useEffect(function(){let i=p.current;if(!i)return;let m=ie.create(),w=-1,A=(P,D)=>{m.start(0,()=>{T.current||(w=R.request(()=>{T.current||(P&&(y.current=!1),D&&i.setAttribute(I,""),i.setAttribute("hidden","until-found"))}))})},G=oe(i,"beforematch",P=>{let D=B(V.none,P);if(b(!0,D),D.isCanceled){A(!1,!1);return}y.current=!0;let Ce=i.hasAttribute(I);i.removeAttribute(I),v(!0),A(!0,Ce)});return()=>{m.clear(),R.cancel(w),G()}},[T,b,v]);let Se=u||s||n||r;return{height:ee.height,props:{...be?{[I]:""}:void 0,hidden:F,id:c},ref:Re,shouldPreventOpenAnimation:W,shouldRender:Se,transitionStatus:j,width:ee.width}}function E(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Ee(e,o){let s=re(e).getComputedStyle(e),c=(s.animationName.split(",").map(n=>n.trim()).some(n=>n!==""&&n!=="none")||o)&&ge(s.animationDuration),u=ge(s.transitionDuration);return c&&u||u?"css-transition":c?"css-animation":"none"}function ge(e){return e.split(",").map(o=>o.trim()).some(o=>o!==""&&Number.parseFloat(o)>0)}function q(e,o,s){let c=e.style.getPropertyValue(o),u=e.style.getPropertyPriority(o);return e.style.setProperty(o,s),()=>{if(c===""){e.style.removeProperty(o);return}e.style.setProperty(o,c,u)}}function ve(e){let o={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(o).forEach(u=>{e.style.setProperty(u,"initial","important")});function s(){Object.entries(o).forEach(([u,n])=>{if(n===""){e.style.removeProperty(u);return}e.style.setProperty(u,n)})}let c=R.request(s);return()=>{R.cancel(c),s()}}export{Le as a,Ae as b,je as c,He as d,Ue as e,nt as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-WJ3OXMVX.js";import{a as u,r as l,z as f}from"./chunk-NQMDED2R.js";import{Gc as s,Jb as m,Rb as d,b as i,xb as n}from"./chunk-YPMUHXYT.js";import{c as a}from"./chunk-7SZRL6FY.js";var r=a(i(),1);function c(e){return e===void 0?"\u2014":`${Math.round(e*100)}%`}function g(e){return f(e===void 0?void 0:{total:e})||"\u2014"}function v(e){let o=e.summary;return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[(0,r.jsx)(t,{detail:"In the last 30 days",icon:m,label:"Created",value:l(o.created)}),(0,r.jsx)(t,{detail:"Share of completed changes that merged",icon:d,label:"Merge rate",value:c(o.mergeRate)}),(0,r.jsx)(t,{detail:"Median time from open to merge in the last 30 days",icon:s,label:"Median merge time",value:u(o.medianMergeTimeMs)||"\u2014"}),(0,r.jsx)(t,{detail:"Conversation cost for changes opened in the last 30 days",icon:n,label:"Cost",value:g(o.costUsd)})]})}export{c as a,g as b,v as c};
|