@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{H as At,l as E,m as Ct,n as Nt,o as wt,w as St}from"./chunk-R4ORRE77.js";import{a as pe}from"./chunk-5ZA674OU.js";import{a as yt,c as xt,d as kt}from"./chunk-FVX42XAD.js";import{l as se}from"./chunk-A2QWWA7O.js";import{a as R}from"./chunk-EFEREKX4.js";import{a as ie,b as re,c as Rt}from"./chunk-LKW7MULF.js";import{e as Tt}from"./chunk-564V7YHG.js";import{B as ge,D as bt,F as q,G as ht,H as oe,I as gt,O as pt,f as _,g as ae,k as dt,r as z,t as V,u as ut,v as mt,x as G,y as ft,z as vt}from"./chunk-NQMDED2R.js";import{i as U,j as L,l as P,m as tt}from"./chunk-GMZIELFU.js";import{a as st,b as lt,c as ct}from"./chunk-MTBUV2GJ.js";import{d as X,g as Pe,h as ve,i as _e,m as it,r as rt}from"./chunk-GO45RQDL.js";import{fa as at,i as te,j as nt,la as ot}from"./chunk-VXT3FIVL.js";import{d as ze,f as Ee,o as W}from"./chunk-6PHJZPWD.js";import{b as je}from"./chunk-CR2ICLSH.js";import{Db as We,Fb as Ve,Fc as Xe,Gc as Je,Ib as Ge,Jb as ee,Jc as Ze,Kb as qe,Lc as et,Qa as Oe,Rc as u,Tc as he,Ua as J,Va as $e,Vb as He,Wb as K,Wc as ne,a as k,b as f,bb as Fe,hc as Ye,kb as F,mb as Ke,ob as Qe,qb as Z,rc as be,tb as Be}from"./chunk-YPMUHXYT.js";import{c}from"./chunk-7SZRL6FY.js";var An={key:"pinned",label:"Pinned",order:-2},Tn={key:"attention",label:"Needs attention",order:-1};function Dt(e,t){let n=Ut(t.nowMs,t.timeZone),a=new Map,o=[...e].sort((i,r)=>ye(r)-ye(i));for(let i of o){let r=i.pinnedAt?An:t.attentionIds?.has(i.id)?Tn:kn(ye(i),n,t.nowMs,t.timeZone),d=a.get(r.key);d?d.conversations.push(i):a.set(r.key,{...r,conversations:[i]})}return[...a.values()].sort((i,r)=>i.order-r.order).map(({order:i,...r})=>r)}function Mt(e,t){return new Set([...e,...t])}function ya(e,t){let n=a=>a.pinnedAt?0:t.has(a.id)?1:2;return[...e].sort((a,o)=>n(a)-n(o))}function ye(e){let t=Date.parse(e.lastSeenAt);return Number.isFinite(t)?t:Number.NEGATIVE_INFINITY}function kn(e,t,n,a){if(!Number.isFinite(e))return{key:"older",label:"Older",order:Number.POSITIVE_INFINITY};let o=Math.max(0,Math.round((t-Ut(e,a))/864e5));if(o===0)return{key:"today",label:"Today",order:0};if(o===1)return{key:"yesterday",label:"Yesterday",order:1};if(o<=7)return{key:"previous-7-days",label:"Previous 7 days",order:2};if(o<=30)return{key:"previous-30-days",label:"Previous 30 days",order:3};let i=It(e,a),r=It(n,a);return{key:`month-${i.year}-${i.month}`,label:new Intl.DateTimeFormat("en-US",{month:"long",timeZone:a,...i.year===r.year?void 0:{year:"numeric"}}).format(e),order:4+(r.year-i.year)*12+(r.month-i.month)}}function It(e,t){let n=new Intl.DateTimeFormat("en-US",{month:"numeric",timeZone:t,year:"numeric"}).formatToParts(e),a=new Map(n.map(o=>[o.type,Number(o.value)]));return{month:a.get("month")??1,year:a.get("year")??0}}function Ut(e,t){let n=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"numeric",timeZone:t,year:"numeric"}).formatToParts(e),a=new Map(n.map(o=>[o.type,Number(o.value)]));return Date.UTC(a.get("year")??0,(a.get("month")??1)-1,a.get("day")??1)}var xe=c(f(),1),Rn={neutral:"text-dashboard-text-muted",success:"text-emerald-500",danger:"text-rose-500",warning:"text-amber-500",info:"text-cyan-500",accent:"text-violet-400"};function O(e){let t=te(e),n=[t.label,e.status].filter(Boolean).join(": ");return(0,xe.jsx)("svg",{"aria-hidden":e.decorative?!0:void 0,"aria-label":e.decorative?void 0:n,role:e.decorative?void 0:"img",className:u("inline-block shrink-0 align-middle",Rn[t.tone],e.className),width:e.size??16,height:e.size??16,viewBox:"0 0 16 16",fill:"currentColor",children:nt[t.icon].map(a=>(0,xe.jsx)("path",{d:a},a))})}var Zt=c(k(),1);var Ce=c(f(),1);function j(e){if(!e.active&&!e.className&&!e["aria-label"])return e.children;let t=u(e.active&&"shimmer",e.className);return e.as==="strong"?(0,Ce.jsx)("strong",{"aria-label":e["aria-label"],className:t,children:e.children}):(0,Ce.jsx)("span",{"aria-label":e["aria-label"],className:t,children:e.children})}var h=c(f(),1);function In(e){return(0,h.jsx)("span",{className:"grid min-w-0 self-start grid-cols-[minmax(0,1fr)_auto] content-start gap-x-3 gap-y-1.5",children:e.lines.map((t,n)=>(0,h.jsxs)("span",{className:t.label?"contents":u("col-span-2 block min-w-0 break-words text-dashboard-text",t.valueStyle==="heading"&&"font-sans tabular-nums font-semibold text-dashboard-text",t.valueStyle==="heading"&&n>0&&"mt-1 border-t border-dashboard-border-strong pt-2"),children:[t.label?(0,h.jsx)("span",{className:u("min-w-0 break-words font-medium text-dashboard-text-muted",t.labelStyle==="code"&&"break-all font-mono text-xs text-dashboard-text"),children:t.label}):null,t.label?(0,h.jsx)("span",{className:"whitespace-nowrap text-right text-dashboard-text",children:t.value}):(0,h.jsxs)(h.Fragment,{children:[t.value,t.live?(0,h.jsxs)("span",{className:"ml-2 inline-flex items-center gap-1.5 font-sans text-xs font-normal tracking-wide text-dashboard-text-muted",children:[(0,h.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,h.jsx)(j,{active:!0,children:"in progress"})]}):null]})]},`${n}-${t.label??""}-${t.value}-${t.live?"live":""}`))})}function H(e){let t=e.tooltip?.filter(n=>n.value.trim());return!e.tooltipCard&&!t?.length?(0,h.jsx)("span",{className:e.className,children:e.children}):(0,h.jsxs)(U,{children:[(0,h.jsx)(L,{render:(0,h.jsx)("span",{className:u("inline-flex border-b border-dotted border-dashboard-border-interactive outline-none transition-colors hover:border-dashboard-border-heavy focus-visible:border-dashboard-border-heavy",e.className),tabIndex:0,children:e.children})}),(0,h.jsx)(P,{align:e.align==="left"?"start":e.align==="right"?"end":"center",className:u("w-[calc(100vw-2rem)] max-w-80 rounded-lg bg-dashboard-bg text-left font-normal shadow-xl shadow-black/35",e.tooltipCard?"p-3 leading-snug":"px-3 py-2 leading-relaxed"),side:e.tooltipPlacement==="above"?"top":"bottom",children:e.tooltipCard?(0,h.jsx)("span",{className:"block max-h-[min(30rem,var(--available-height,30rem))] overflow-y-auto",children:e.tooltipCard}):t?(0,h.jsx)("span",{className:"block max-h-72 overflow-y-auto",children:(0,h.jsx)(In,{lines:t})}):null})]})}var m=c(f(),1),Lt="bg-dashboard-focus/80",Pt="bg-dashboard-focus/30";function _t(e){return(0,m.jsx)("span",{"aria-hidden":"true",className:u("size-2 shrink-0 rounded-xs",e.className)})}function Ne(e){let t=Math.min(100,Math.max(0,(e.split?.selfShare??1)*100));return(0,m.jsxs)("span",{className:"grid gap-3",children:[(0,m.jsxs)("span",{className:u("grid gap-2.5",e.sections.length>0&&"border-b border-dashboard-border pb-3"),children:[(0,m.jsxs)("span",{className:"flex items-baseline justify-between gap-3",children:[(0,m.jsxs)("span",{className:"min-w-0 truncate font-medium text-dashboard-text",children:[e.title,e.note?(0,m.jsxs)("span",{className:"text-dashboard-text-faint",children:[" \xB7 ",e.note]}):null]}),(0,m.jsx)("span",{className:"whitespace-nowrap text-base font-semibold tabular-nums text-dashboard-text",children:e.total})]}),e.split?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("span",{"aria-hidden":"true",className:"flex h-1.5 overflow-hidden rounded-full bg-dashboard-fill-hover",children:[(0,m.jsx)("span",{className:Lt,style:{width:`${t}%`}}),(0,m.jsx)("span",{className:Pt,style:{width:`${100-t}%`}})]}),(0,m.jsxs)("span",{className:"flex flex-wrap justify-between gap-x-3 gap-y-1 tabular-nums",children:[(0,m.jsxs)("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[(0,m.jsx)(_t,{className:Lt}),"this agent",(0,m.jsx)("span",{className:"font-medium text-dashboard-text",children:e.split.self})]}),(0,m.jsxs)("span",{className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[(0,m.jsx)(_t,{className:Pt}),e.split.count," subagent",e.split.count===1?"":"s",(0,m.jsx)("span",{className:"font-medium text-dashboard-text",children:e.split.subagents})]})]})]}):null]}),e.sections.map(n=>(0,m.jsxs)("span",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-2",children:[(0,m.jsxs)("span",{className:"col-span-2 font-sans font-medium text-dashboard-text-faint",children:[n.title,n.total?` \xB7 ${n.total}`:null]}),n.rows.map(a=>(0,m.jsxs)("span",{className:"contents",children:[(0,m.jsxs)("span",{className:u("flex min-w-0 items-baseline gap-2",a.code&&"font-mono"),children:[(0,m.jsx)("span",{className:"min-w-0 truncate",title:a.label,children:a.label}),a.live?(0,m.jsx)("span",{className:"shrink-0 font-sans text-2xs text-dashboard-text-muted",children:(0,m.jsx)(j,{active:!0,children:"in progress"})}):null]}),(0,m.jsx)("span",{className:"whitespace-nowrap text-right tabular-nums text-dashboard-text",children:a.value})]},a.label)),n.more?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("span",{className:"text-dashboard-text-faint",children:[n.more.count," more"]}),(0,m.jsx)("span",{className:"whitespace-nowrap text-right tabular-nums",children:n.more.value})]}):null]},n.title))]})}var I=c(f(),1);function Ae(e,t){return`${z(t)} ${e}${t===1?"":"s"}`}function Dn(e){return!!e}function Mn(e){return[["input",e.inputTokens],["output",e.outputTokens],["cached",e.cachedInputTokens],["cache write",e.cacheCreationTokens],["reasoning",e.reasoningTokens]].flatMap(([t,n])=>n?[{label:t,value:z(n)}]:[])}function Et(e){return{cost:(G(e?.cumulativeUsage)?.total??0)+(e?.auxiliaryCostUsd??0),tokens:V(e?.cumulativeUsage)?.totalTokens??0}}function Ot(e,t){return Math.min(Math.max(0,e),Math.max(0,t))}function Un(e,t,n,a){if(!e)return[];let o=Ot(n,t);return[{value:"By agent",valueStyle:"heading"},{label:"this agent",value:a(t-o)},{label:Ae("subagent",e.count),value:a(o)}]}function we(e){return e.split("/").at(-1)??e}function Ln(e,t){return{live:e===t,value:we(e),valueStyle:"heading"}}var jt=4,Pn=3;function Se(e,t,n){if(e.length<=t+1)return{rows:e};let a=e.slice(t);return{more:{count:a.length,value:n(a.reduce((o,i)=>o+i.amount,0))},rows:e.slice(0,t)}}function $t(e,t,n,a,o){let i=(e??[]).flatMap(r=>{let d=n(r.usage);return d?[{amount:a(d),modelId:r.modelId}]:[]}).sort((r,d)=>d.amount-r.amount).map(r=>({amount:r.amount,code:!0,label:we(r.modelId),live:r.modelId===t,value:o(r.amount)}));return t&&!i.some(r=>r.live)&&i.unshift({amount:0,code:!0,label:we(t),live:!0,value:"\u2026"}),i}function Ft(e,t,n,a){if(!e)return;let o=Ot(n,t);return{count:e.count,self:a(t-o),selfShare:t>0?(t-o)/t:1,subagents:a(o)}}function zt(e){return new Intl.NumberFormat("en-US",{currency:"USD",maximumFractionDigits:e,minimumFractionDigits:e,style:"currency"})}function _n(e){let t=e>=10?2:e>=1?3:4,n=zt(t),a=zt(4);return o=>o>0&&o<.5*10**-t?a.format(o):n.format(o)}function zn(e,t,n,a,o){let i=$t(t,a,V,r=>r.totalTokens,z);return{note:n?Ae("compaction",n):void 0,sections:i.length?[{title:"By model",...Se(i,jt,z)}]:[{rows:Mn(e),title:"By type"}].filter(r=>r.rows.length),split:Ft(o,e.totalTokens,Et(o).tokens,z),title:"Tokens",total:z(e.totalTokens)}}function En(e,t){return[["input",e.input],["output",e.output],["cache read",e.cacheRead],["cache write",e.cacheWrite]].flatMap(([n,a])=>a===void 0?[]:[{label:n,value:t(a)}])}function On(e,t,n,a,o){let i=ge(e,n);if(!i)return;let r=_n(i.total),d=$t(t,a,G,p=>p.total,r),y=[...n?.operations??[]].sort((p,C)=>C.costUsd-p.costUsd).map(p=>({amount:p.costUsd,label:jn(p),value:r(p.costUsd)})),x=[];if(d.length)x.push({title:"By model",...Se(d,jt,r)});else if(e){let p=En(e,r);p.length&&x.push({rows:p,title:"By type"})}return n&&y.length&&x.push({title:"Auxiliary",total:r(n.costUsd),...Se(y,Pn,r)}),{sections:x,split:Ft(o,i.total,Et(o).cost,r),title:"Estimated cost",total:r(i.total)}}function jn(e){let t={"junior/guardian_action_reviewed":"Guardian","junior/passive_reply_routed":"Passive reply routing","junior/turn_routed":"Thinking routing","memory/memories_captured":"Memory extraction","memory/memories_recalled":"Memory recall","memory/task_model_called":"Memory extraction","memory/user_prompt_model_called":"Memory recall"},n=`${e.namespace}/${e.name}`;return t[n]??`${e.namespace} \xB7 ${e.name.replaceAll("_"," ")}`}function Kt(e){let t=ft(e.modelUsage)??e.summary,n=ge(t,e.auxiliaryCosts);if(!n&&!e.live)return null;let a=!!e.live,o=n?`${vt(n)}${a?"+":""}`:"$\u2026",i=On(t,e.modelUsage,e.auxiliaryCosts,e.liveModelId,e.childAgentTotals);return(0,I.jsx)(H,{align:e.align,tooltipPlacement:e.tooltipPlacement??"above",tooltip:!i&&e.liveModelId?[Ln(e.liveModelId,e.liveModelId)]:void 0,tooltipCard:i?(0,I.jsx)(Ne,{...i}):void 0,children:(0,I.jsx)(j,{active:a,children:o})})}function Qt(e){return e.summary?(0,I.jsx)(H,{align:e.align,tooltipCard:(0,I.jsx)(Ne,{...zn(e.summary,e.modelUsage,e.compactionCount,e.liveModelId,e.childAgentTotals)}),children:(0,I.jsx)(j,{active:e.live,children:mt(e.summary)})}):null}function Bt(e){if(!e.label||e.label==="none")return null;let n=[e.startedAt?{label:"started",value:_(e.startedAt)}:void 0,e.endedAt?{label:"ended",value:_(e.endedAt)}:void 0,...Un(e.childAgentTotals,e.durationMs??0,e.childAgentTotals?.cumulativeDurationMs??0,a=>dt(a)||"0s")].filter(Dn);return(0,I.jsx)(H,{align:e.align,tooltip:n,children:e.label})}function Wt(e){if(!e.childAgentTotals)return null;let t=Ae("subagent",e.childAgentTotals.count);return(0,I.jsx)(H,{tooltip:[{value:`Tokens, cost, and runtime include ${t} at any depth.`}],children:t})}function $n(e){let t=new Map,n=[];for(let a of e){let o=t.get(a.label);if(!o){t.set(a.label,[a]),n.push(a.label);continue}o.push(a)}return n.map(a=>({label:a,annotations:t.get(a)??[]}))}function Vt(e){let t=$n(e);return{groups:t,labeledGroups:t.slice(0,2),overflowGroupCount:Math.max(0,t.length-2)}}var qt=c(k(),1);var b=c(f(),1);function Ka(e){return(0,b.jsxs)("section",{"aria-label":e.label,className:"grid min-w-0 gap-2.5 rounded-lg border border-dashboard-border-subtle bg-dashboard-surface-panel p-3",children:[e.title?(0,b.jsxs)("h3",{className:"m-0 flex min-w-0 items-center gap-1.5 break-words font-sans text-xs font-medium text-dashboard-text-muted",children:[e.title,e.count?(0,b.jsx)("span",{className:"tabular-nums text-dashboard-text-faint",children:e.count.toLocaleString("en-US")}):null]}):null,(0,b.jsx)("div",{className:"min-w-0 break-words font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.children})]})}var Gt=3;function le(e){let[t,n]=(0,qt.useState)(!1),a=e.items.length-Gt,o=t||a<=0?e.items:e.items.slice(0,Gt);return(0,b.jsxs)("ul",{className:"-mx-1.5 -mb-1.5 -mt-1 grid list-none gap-0.5 p-0",children:[o.map(i=>(0,b.jsx)("li",{children:e.renderItem(i)},e.itemKey(i))),a>0?(0,b.jsx)("li",{children:(0,b.jsxs)("button",{"aria-expanded":t,className:"group flex min-h-8 w-full items-center gap-2.5 rounded-md px-1.5 py-1.5 text-left text-xs font-medium leading-4 text-dashboard-text-muted transition-colors hover:bg-dashboard-surface-hover hover:text-dashboard-text focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus",onClick:()=>n(i=>!i),type:"button",children:[(0,b.jsx)("span",{className:"grid size-5 shrink-0 place-items-center",children:(0,b.jsx)(F,{"aria-hidden":"true",className:ne})}),t?"Show fewer":`Show ${a} more`]})}):null]})}function Y(e){let t=e.href!==void 0||e.disclosure===!0,n=u("grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1 rounded-md px-1.5 py-1.5 text-left text-inherit no-underline",t&&"group transition-colors hover:bg-dashboard-surface-hover focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus"),a=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"grid size-5 shrink-0 place-items-center text-dashboard-text-muted",children:e.icon}),(0,b.jsx)("span",{className:"min-w-0 truncate text-sm font-medium leading-5 text-dashboard-text",children:e.title}),(0,b.jsx)("span",{className:"shrink-0 text-xs leading-5 tabular-nums text-dashboard-text-muted",children:e.meta}),e.children]});return e.href?(0,b.jsx)("a",{className:n,href:e.href,rel:"noreferrer",target:"_blank",title:e.tooltip,children:a}):e.disclosure?(0,b.jsx)(re,{className:n,title:e.tooltip,children:a}):(0,b.jsx)("div",{className:n,title:e.tooltip,children:a})}function Ht(e){return(0,b.jsx)("div",{className:u("col-start-2 col-end-4 min-w-0 text-xs leading-4 text-dashboard-text-muted",e.className),children:e.children})}var v=c(f(),1);function eo(e){return Pe({queryFn:({signal:t})=>rt(ot,`/api/conversations/${encodeURIComponent(e)}/watches`,t),queryKey:Ct(e,"watches"),retry:!1})}function to(e){return(0,v.jsx)(le,{itemKey:t=>t.id,items:e.watches,renderItem:t=>(0,v.jsx)(Kn,{watch:t})})}var Fn={channel:qe,deployment:be,deployment_source:be,issue:Z,pull_request:ee,release_source:Xe,repository:Ve,team:et,timer:Je,workspace_snapshot:Ye};function Kn(e){let{watch:t}=e,n=t.redacted?K:Fn[t.resourceType]??We,a=`${t.namespace} ${t.resourceType.replaceAll("_"," ")}`,o=(0,v.jsx)(n,{"aria-hidden":"true",className:"size-3.5"}),i=t.label??`Private ${a}`;return(0,v.jsxs)(ie,{className:"min-w-0",children:[t.url?(0,v.jsx)(Te,{label:i,children:(0,v.jsx)(Y,{href:t.url,icon:o,title:i})}):(0,v.jsx)(Y,{disclosure:!0,icon:o,meta:(0,v.jsx)(Xt,{}),title:i}),(0,v.jsx)(ke,{watches:[t]})]})}function Te(e){return(0,v.jsxs)("div",{className:"flex min-w-0 items-start gap-0.5",children:[(0,v.jsx)("div",{className:"min-w-0 flex-1",children:e.children}),(0,v.jsx)(re,{"aria-label":`Details for ${e.label}`,className:"group grid size-8 shrink-0 place-items-center rounded-md text-dashboard-text-muted transition-colors hover:bg-dashboard-surface-hover hover:text-dashboard-text focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus",children:(0,v.jsx)(Xt,{})})]})}function Xt(){return(0,v.jsx)("span",{className:"grid size-5 place-items-center",children:(0,v.jsx)(F,{"aria-hidden":"true",className:ne})})}function ke(e){return(0,v.jsx)(Rt,{className:"grid min-w-0 gap-3 pb-2 pl-9 pr-1.5 pt-0.5 text-xs leading-4 text-dashboard-text-muted",children:e.watches.map(t=>(0,v.jsx)(Qn,{watch:t},t.id))})}function Qn(e){let{watch:t}=e,n=t.firesAt?[]:t.events,a=Object.entries(t.match??{});return(0,v.jsxs)("div",{className:"grid min-w-0 gap-1.5",children:[t.intent?(0,v.jsx)("p",{className:"m-0 break-words",children:(0,v.jsx)(se,{inline:!0,text:t.intent})}):null,t.firesAt?(0,v.jsxs)("p",{className:"m-0",children:["Fires"," ",(0,v.jsx)("time",{dateTime:t.firesAt,children:_(t.firesAt,{dateStyle:"medium",timeStyle:"short"})})]}):null,n.length>0||a.length>0?(0,v.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map(o=>(0,v.jsx)(Yt,{children:Bn(o,t.resourceType)},o)),a.map(([o,i])=>(0,v.jsxs)(Yt,{filter:!0,children:[o.replaceAll("_"," "),": ",[i].flat().join(", ")]},`match:${o}`))]}):null,t.childAgent?(0,v.jsxs)("p",{className:"m-0 flex min-w-0 items-center gap-1",children:[(0,v.jsx)(Fe,{"aria-hidden":"true",className:"size-3 shrink-0"}),(0,v.jsxs)("span",{className:"truncate",children:["via ",t.childAgent.name??"subagent"]})]}):null]})}function Yt(e){return(0,v.jsx)("span",{className:e.filter?"min-w-0 truncate rounded-md border border-dashed border-dashboard-border px-1.5 py-px text-xs leading-4 text-dashboard-text-muted":"min-w-0 truncate rounded-md bg-dashboard-fill-soft px-1.5 py-px text-xs leading-4 text-dashboard-text-subtle",children:e.children})}function Bn(e,t){let n=e.split(".");return(n[0]===t&&n.length>1?n.slice(1):n).join(" ").replaceAll("_"," ")}var N=c(f(),1),Wn={closed:"Closed",draft:"Draft",merged:"Merged",open:"Open",warning:"Needs attention"};function Re(e){return e?Wn[e]??e.charAt(0).toUpperCase()+e.slice(1):""}function so(e){return(e?.annotations??[]).flatMap(t=>{if(!t.url)return[];let n=t.objectType??e?.sidebarAnnotations?.find(o=>o.key===t.key)?.objectType??"item",a=t.kind==="object"&&t.title!==t.label?t.title:t.description;return[{...a?{description:a}:void 0,...t.kind==="object"&&t.facts?{facts:t.facts}:void 0,key:`${t.plugin}:${t.key}`,label:t.label,objectType:n,plugin:t.plugin,...t.status?{status:t.status}:void 0,url:t.url}]})}function lo(e){return(0,N.jsx)(le,{itemKey:t=>t.key,items:e.links,renderItem:t=>{let n=(0,N.jsx)(Gn,{link:t}),a=e.watchesByUrl.get(t.url);return a?(0,N.jsxs)(ie,{className:"min-w-0",children:[(0,N.jsx)(Te,{label:t.label,children:n}),(0,N.jsx)(ke,{watches:a})]}):e.watchesByUrl.size>0?(0,N.jsx)(Vn,{children:n}):n}})}function Vn(e){return(0,N.jsxs)("div",{className:"flex min-w-0 items-start gap-0.5",children:[(0,N.jsx)("div",{className:"min-w-0 flex-1",children:e.children}),(0,N.jsx)("span",{"aria-hidden":"true",className:"size-8 shrink-0"})]})}function Gn(e){let{link:t}=e,n=Re(t.status);return(0,N.jsx)(Y,{href:t.url,icon:(0,N.jsx)(O,{decorative:!0,facts:t.facts,objectType:t.objectType,size:14,status:t.status}),meta:n,title:t.label,tooltip:[t.label,t.plugin,n,t.description].filter(Boolean).join(" \xB7 "),children:t.description?(0,N.jsx)(Ht,{className:"line-clamp-2 break-words",children:t.description}):null})}var l=c(f(),1),on=c(k(),1),Jt="(max-width: 767px)";function Co(e){return(0,l.jsxs)("div",{className:"mb-2 rounded-lg border border-dashboard-accent/20 bg-dashboard-accent/[0.07] px-3 py-2.5 font-sans text-sm text-dashboard-text",children:[(0,l.jsx)("a",{className:"font-medium text-dashboard-accent-text underline decoration-dashboard-accent/40 underline-offset-2 hover:text-dashboard-accent-text",href:e.authorization.authorizationUrl,rel:"noreferrer",target:"_blank",children:e.authorization.label}),(0,l.jsx)("p",{className:"mb-0 mt-1 text-xs text-dashboard-text-muted",children:e.authorization.completionText})]})}function No(e){if(e.visibility!=="private")return null;let t="Private conversation. Only members of this conversation can see this transcript.";return(0,l.jsxs)("span",{className:"inline-flex items-center text-dashboard-text-muted",role:"note",title:t,children:[(0,l.jsx)(K,{"aria-hidden":"true",className:"size-3.5 shrink-0"}),(0,l.jsx)("span",{className:"sr-only",children:t})]})}function en(e){let t=e.annotations,n=Xn();if(!t?.length)return null;let a=t.map(d=>Jn(d)),o=Vt(t),i=n&&o.groups.length>1,r=i?o.groups.flatMap(d=>d.annotations):[];return(0,l.jsxs)(U,{children:[(0,l.jsx)(L,{render:(0,l.jsx)("span",{"aria-label":`Linked work, newest first: ${a.join(", ")}`,className:"inline-flex min-w-0 max-w-full items-center",children:i?(0,l.jsx)(qn,{annotations:r,cutoutColor:"var(--color-dashboard-surface-panel)"}):(0,l.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1",children:[o.labeledGroups.map(d=>(0,l.jsx)(Hn,{group:d},d.label)),o.overflowGroupCount>0?(0,l.jsxs)("span",{className:"inline-flex h-5 min-w-7 shrink-0 items-center justify-center rounded-full border border-dashboard-border-strong bg-dashboard-control px-1.5 font-sans text-2xs tabular-nums leading-none text-dashboard-text-muted",children:["+",o.overflowGroupCount]}):null]})})}),(0,l.jsxs)(P,{align:"start",children:[(0,l.jsx)(tt,{children:"Linked work"}),(0,l.jsx)("ul",{className:"m-0 list-none space-y-1 p-0",children:t.map((d,y)=>(0,l.jsxs)("li",{className:"flex min-w-0 items-center gap-1.5",children:[d.objectType?(0,l.jsx)(O,{...d,objectType:d.objectType,size:14}):d.icon?(0,l.jsx)(Ie,{icon:d.icon}):null,(0,l.jsx)("span",{className:"min-w-0 truncate",children:a[y]})]},`${d.key}:${y}`))})]})]})}function qn(e){return(0,l.jsx)("span",{className:u("relative isolate inline-flex h-[18px] items-center pr-0.5",e.className),children:e.annotations.map((t,n)=>(0,l.jsx)(Yn,{annotation:t,cutoutColor:e.cutoutColor,stacked:n>0,zIndex:n+1},t.key))})}function Hn(e){return(0,l.jsxs)("span",{className:"inline-flex h-5 min-w-0 max-w-60 shrink-0 items-center gap-1 truncate rounded-full border border-dashboard-border-strong bg-dashboard-control px-1.5 font-sans text-2xs leading-none text-dashboard-text-muted",children:[e.group.annotations.map(t=>t.objectType?(0,on.createElement)(O,{...t,objectType:t.objectType,key:t.key,decorative:!0,size:14}):t.icon?(0,l.jsx)(Ie,{decorative:!0,icon:t.icon,size:11},t.key):null),(0,l.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap",children:e.group.label})]})}function Yn(e){let t=e.annotation.icon?tn[e.annotation.icon]:void 0;return(0,l.jsx)("span",{"aria-hidden":"true",className:u("relative box-border inline-flex size-[18px] shrink-0 items-center justify-center rounded-full border border-dashboard-border-strong bg-dashboard-control",e.stacked&&"-ml-1"),style:{boxShadow:`0 0 0 2px ${e.cutoutColor}`,zIndex:e.zIndex},title:t?.label,children:e.annotation.objectType?(0,l.jsx)(O,{...e.annotation,objectType:e.annotation.objectType,decorative:!0,size:12}):e.annotation.icon?(0,l.jsx)(Ie,{decorative:!0,icon:e.annotation.icon,size:11}):(0,l.jsx)("span",{className:"font-sans text-2xs font-semibold leading-none text-dashboard-text-muted",children:e.annotation.label.slice(0,1)})})}function Xn(){return(0,Zt.useSyncExternalStore)(e=>{if(typeof window>"u")return()=>{};let t=window.matchMedia(Jt);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>typeof window<"u"&&window.matchMedia(Jt).matches,()=>!1)}function Jn(e){let t=e.objectType?[te({objectType:e.objectType}).label,e.status].filter(Boolean).join(": "):"",n=e.key.includes("/")||e.key.includes("#")?e.key:e.label;return[t,n].filter(Boolean).join(" \xB7 ")}var tn={"circle-dot":{className:"text-[#3fb950] light:text-[#1a7f37]",Icon:Z,label:"Open"},"circle-dashed":{className:"text-[#8c959f] light:text-[#59636e]",Icon:Qe,label:"Draft"},"circle-x":{className:"text-[#f85149] light:text-[#cf222e]",Icon:Be,label:"Closed"},"git-merge":{className:"text-[#a371f7] light:text-[#8250df]",Icon:Ge,label:"Merged"},"git-pull-request":{className:"text-[#3fb950] light:text-[#1a7f37]",Icon:ee,label:"Open pull request"},"triangle-alert":{className:"text-[#d29922] light:text-[#9a6700]",Icon:Ze,label:"Needs attention"}};function Ie(e){let t=tn[e.icon],n=e.size??11;return(0,l.jsxs)("span",{"aria-hidden":e.decorative?!0:void 0,className:u("inline-flex shrink-0 items-center justify-center leading-none",t.className),style:{width:n,height:n},title:e.decorative?void 0:t.label,children:[(0,l.jsx)(t.Icon,{"aria-hidden":"true",className:"block",size:n,strokeWidth:2.25}),e.decorative?null:(0,l.jsx)("span",{className:"sr-only",children:t.label})]})}function wo(e){return(0,l.jsx)("div",{className:"flex gap-x-4 gap-y-2 overflow-x-auto",children:e.links.map(t=>(0,l.jsxs)("a",{className:"inline-flex min-w-0 max-w-full shrink-0 items-center gap-2 rounded-md px-1 py-0.5 font-sans text-xs leading-snug text-dashboard-text no-underline transition-colors hover:text-dashboard-accent-text focus-visible:outline focus-visible:outline-2 focus-visible:outline-dashboard-focus",href:t.url,rel:"noreferrer",target:"_blank",title:[t.label,t.plugin,Re(t.status),t.description].filter(Boolean).join(" \xB7 "),children:[(0,l.jsx)(O,{facts:t.facts,objectType:t.objectType,size:16,status:t.status}),(0,l.jsx)("span",{className:"min-w-0 break-words",children:t.label})]},t.key))})}function Zn(e){return e.locationUrl?(0,l.jsx)("a",{className:he,href:e.locationUrl,rel:"noreferrer",target:"_blank",children:e.label}):e.label}function ea(e){let t=e.sourceTask.id?.trim(),n=e.sourceTask.title?.trim(),a=n?`Automation: ${n}`:"Automation";return t?(0,l.jsx)(W,{className:he,to:pt(t),children:a}):(0,l.jsx)("span",{children:a})}function nn(e){if(!e)return;let t=new Set,n;for(let a of e.events){let o=a.data;if(o.type==="turn_lifecycle"){o.state==="started"?t.add(o.turnId):t.delete(o.turnId),t.size===0&&(n=void 0);continue}t.size>0&&a.model&&(n=a.model.modelId)}return t.size>0?n:void 0}function So(e){return an(e).length>0}function Ao(e){let t=an(e);return t.length===0?null:(0,l.jsx)("dl",{className:"m-0 grid min-w-0 gap-2 text-xs leading-snug",children:t.map(n=>(0,l.jsxs)("div",{className:u("flex min-w-0 items-baseline justify-between gap-4",n.mobileOnly&&"md:hidden"),children:[(0,l.jsx)("dt",{className:"shrink-0 text-dashboard-text-muted",children:n.label}),(0,l.jsx)("dd",{className:"m-0 min-w-0 break-words text-right tabular-nums text-dashboard-text",children:n.content})]},n.key))})}function ta(e,t){if(!e)return null;let n=oe(e,{includeId:!1});return n?(0,l.jsx)(Zn,{label:n,locationUrl:t?.locationUrl??e.locationUrl}):null}function na(e,t,n){if(!e)return null;let a=G(t?.cumulativeUsage??e.cumulativeUsage),o=t?.auxiliaryCosts??e.auxiliaryCosts,i=(t?.status??e.status)==="active";return!a&&!o&&!i?null:(0,l.jsx)(Kt,{auxiliaryCosts:o,childAgentTotals:t?.childAgentTotals??e.childAgentTotals,live:i,liveModelId:nn(t),modelUsage:t?.modelUsage,summary:a,tooltipPlacement:n})}function an(e){if(!e.conversation)return[];let t=e.detail?.previousCursor?void 0:e.detail,n=e.detail?.cumulativeUsage??e.conversation.cumulativeUsage,a=ut(e.detail?.modelUsage)??V(n),o=bt(e.conversation),i=(e.detail?.status??e.conversation.status)==="active",r=nn(e.detail),d=e.detail?.sourceTask,y=e.detail?.childAgentTotals??e.conversation.childAgentTotals,x=e.conversation.lastSeenAt,p=ta(e.conversation,e.detail),C=na(e.conversation,e.detail);return[p?{content:p,key:"location",label:"Location",mobileOnly:!0}:void 0,d?{content:(0,l.jsx)(ea,{sourceTask:d}),key:"source-task",label:"Source"}:void 0,x?{content:(0,l.jsx)("time",{dateTime:x,title:_(x,{dateStyle:"medium",timeStyle:"short"}),children:ae(x)}),key:"last-activity",label:"Last activity"}:void 0,o!=="none"?{content:(0,l.jsx)(Bt,{childAgentTotals:y,durationMs:e.conversation.cumulativeDurationMs,endedAt:e.conversation.lastSeenAt,label:o,startedAt:e.conversation.startedAt}),key:"duration",label:"Runtime"}:void 0,a?{content:(0,l.jsx)(Qt,{childAgentTotals:y,compactionCount:t?t.events.filter(S=>S.data.type==="compaction").length:void 0,live:i,liveModelId:r,modelUsage:e.detail?.modelUsage,summary:a}),key:"tokens",label:"Tokens"}:void 0,C?{content:C,key:"cost",label:"Cost",mobileOnly:!0}:void 0,y?{content:(0,l.jsx)(Wt,{childAgentTotals:y}),key:"subagents",label:"Subagents"}:void 0].filter(S=>S!==void 0)}var sn=c(f(),1);function rn({className:e,...t}){return(0,sn.jsx)(He,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:Oe("size-4 animate-spin motion-reduce:animate-none",e),...t})}var $=c(f(),1);function ln(e){return e.waitingOnViewer?(0,$.jsx)("span",{"aria-label":"Waiting on you",className:"size-2 shrink-0 rounded-full bg-violet-300 shadow-[0_0_6px_rgba(196,181,253,0.7)]",role:"img"}):e.status==="active"?(0,$.jsx)(rn,{"aria-label":"Running",className:"size-3 text-emerald-300"}):e.finishedSinceSeen?(0,$.jsx)("span",{"aria-label":"Finished since last viewed",className:"size-1.5 shrink-0 rounded-full bg-orange-300",role:"img"}):e.isPrivate?(0,$.jsx)(K,{"aria-label":"Private conversation",className:u("size-3 shrink-0",e.status==="failed"&&"text-rose-300",e.status==="idle"&&"text-dashboard-text-muted")}):e.status==="failed"?(0,$.jsx)("span",{"aria-label":"Failed",className:"size-1.5 shrink-0 rounded-full bg-rose-300",role:"img"}):(0,$.jsx)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-dashboard-text-faint"})}var D=c(k(),1);var g=c(f(),1),cn=3;function De(e){return e.fullName?.trim()||e.slackUserName?.trim()||e.email?.trim()||e.slackUserId?.trim()||"Unknown actor"}function ce(e){let t=De(e),n=e.email?.trim();return n&&n!==t?`${t}, ${n}`:t}function dn(e,t){return e.email?.trim().toLowerCase()||e.slackUserId?.trim()||e.slackUserName?.trim()||`${ht(e)??"actor"}:${t}`}function aa(e){let t=De(e.participant),n=e.participant.email?.trim();return(0,g.jsxs)("span",{className:"grid gap-0.5 font-sans",children:[(0,g.jsx)("span",{className:"font-semibold text-dashboard-text",children:t}),n&&n!==t?(0,g.jsx)("span",{className:"font-sans text-dashboard-text-muted",children:n}):null]})}function oa(e){let t=ce(e.participant);return(0,g.jsxs)(U,{children:[(0,g.jsx)(L,{render:(0,g.jsx)("span",{"aria-label":t,role:"img",className:"relative -ml-1 inline-flex rounded-full first:ml-0 pointer-events-none focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-dashboard-focus [@media(hover:hover)_and_(pointer:fine)]:pointer-events-auto",onKeyDown:n=>n.stopPropagation(),tabIndex:0,children:(0,g.jsx)(kt,{imageUrl:e.participant.avatarUrl,name:De(e.participant),size:e.size})})}),(0,g.jsx)(P,{children:(0,g.jsx)(aa,{participant:e.participant})})]})}function un(e){return e?.participants?.length?e.participants:e?.actorIdentity?[e.actorIdentity]:[]}function mn(e){if(e.participants.length===0)return null;let t=e.participants.slice(0,cn),n=e.participants.slice(cn),a=e.participants.map(ce).join("; ");return(0,g.jsxs)("span",{"aria-label":`Conversation participants: ${a}`,className:"inline-flex items-center",role:"group",children:[t.map((o,i)=>(0,g.jsx)(oa,{participant:o,size:e.size},dn(o,i))),n.length>0?(0,g.jsxs)(U,{children:[(0,g.jsx)(L,{render:(0,g.jsx)(yt,{"aria-label":`${n.length} more participants: ${n.map(ce).join("; ")}`,className:"-ml-1 pointer-events-none bg-dashboard-surface-active shadow-none focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-dashboard-focus [@media(hover:hover)_and_(pointer:fine)]:pointer-events-auto",onKeyDown:o=>o.stopPropagation(),size:e.size==="list"?"sm":"default",tabIndex:0,children:(0,g.jsxs)(xt,{className:"tabular-nums tracking-normal text-dashboard-text-muted",children:["+",n.length]})})}),(0,g.jsx)(P,{children:(0,g.jsx)("span",{className:"grid gap-1 font-sans",children:n.map((o,i)=>(0,g.jsx)("span",{children:ce(o)},dn(o,i)))})})]}):null]})}var bn=c(k(),1);var A=c(f(),1);function Me({action:e,children:t,detail:n,icon:a,title:o,tone:i="default"}){let r=i==="error";return(0,A.jsxs)(st,{className:"block gap-0 overflow-hidden rounded-xl p-0 shadow-[0_16px_40px_rgba(0,0,0,0.5)]",role:r?"alert":"status",variant:r?"destructive":"default",children:[(0,A.jsxs)("div",{className:"flex min-w-0 items-center gap-3 px-3 py-3",children:[a?(0,A.jsx)("div",{className:u("grid size-8 shrink-0 place-items-center rounded-lg",r?"bg-rose-300/15 text-rose-100":"bg-dashboard-accent/10 text-dashboard-accent-text/80"),children:(0,A.jsx)(a,{"aria-hidden":"true",size:16})}):null,(0,A.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,A.jsxs)(lt,{className:"font-display text-sm leading-snug",children:[o,n?" ":null]}),n?(0,A.jsx)(ct,{className:u("mt-0.5 truncate font-sans text-xs",r&&"text-rose-100/70"),children:n}):null]}),e]}),t]})}function Ue({className:e,tone:t="default",...n}){return(0,A.jsx)(je,{...n,className:u("h-auto shrink-0 rounded-lg border-0 px-3 py-1.5 text-xs leading-normal",t==="error"?"bg-rose-200/15 text-rose-50 hover:bg-rose-200/25 hover:text-rose-50 focus-visible:outline-rose-300/55 data-disabled:hover:bg-rose-200/15 data-disabled:hover:text-rose-50":"bg-dashboard-accent/10 text-dashboard-accent-text hover:bg-dashboard-accent/20 hover:text-dashboard-accent-text data-disabled:hover:bg-dashboard-accent/10 data-disabled:hover:text-dashboard-accent-text",e)})}function fn(e){return["dashboard","archived-conversation",e]}function ia(e){let t=e[e.length-1];return t==="active"||t==="archived"?t:void 0}var Le=["dashboard","archive-conversation"];function Go(){return ve({filters:{mutationKey:Le,status:"pending"},select:e=>{let t=e.state.variables,n=e.state.context,a=e.options.mutationKey?.[2];return{archived:t.archived,conversation:n?.archivedSnapshot?.conversation,conversationId:typeof a=="string"?a:""}}})}function vn(e){let t=ve({filters:{exact:!0,mutationKey:[...Le,e]},select:n=>n.state.status});return e?t.at(-1):void 0}function de(e,t){let n=X();return _e({mutationKey:[...Le,e],mutationFn:a=>it(at,`/api/conversations/${encodeURIComponent(e)}/archive`,a),onMutate:async a=>{let o={queryKey:["dashboard","conversations"]},i=E(e),r=fn(e);await Promise.all([n.cancelQueries(o),n.cancelQueries({queryKey:i})]);let d=n.getQueriesData(o),y=n.getQueryData(i),x=n.getQueryData(r),p=a.archived?new Date().toISOString():null,C=a.archived?{archivedAt:p,pinnedAt:null}:{archivedAt:p},w=ra(d,e)??x;return d.forEach(([S,B])=>{if(!B)return;let Cn=B.conversations.some(M=>M.conversationId===e),Nn=ia(S),wn=!a.archived&&!Cn&&!!w&&Nn!=="archived"?[...B.conversations,{...w.conversation,archivedAt:null,pinnedAt:null}].sort((M,Sn)=>Sn.lastSeenAt.localeCompare(M.lastSeenAt)):B.conversations.map(M=>M.conversationId===e?{...M,...C}:M);n.setQueryData(S,{...B,conversations:wn})}),n.setQueryData(i,S=>S&&{...S,...C,detailEtag:void 0}),w&&n.setQueryData(r,w),{archivedQueryKey:r,archivedSnapshot:w,detailQueryKey:i,previousArchivedSnapshot:x,previousDetail:y,previousFeeds:d}},onError:(a,o,i)=>{i?.previousFeeds.forEach(([r,d])=>{n.setQueryData(r,d)}),i&&(n.setQueryData(i.detailQueryKey,i.previousDetail),i.previousArchivedSnapshot?n.setQueryData(i.archivedQueryKey,i.previousArchivedSnapshot):n.removeQueries({exact:!0,queryKey:i.archivedQueryKey})),t?.onError?.()},onSuccess:(a,o)=>{n.setQueryData(E(e),i=>i&&{...i,archivedAt:a.archivedAt,detailEtag:void 0}),o.archived||n.removeQueries({exact:!0,queryKey:fn(e)}),t?.onSuccess?.(a.archivedAt)},onSettled:async()=>{await Promise.all([n.invalidateQueries({queryKey:["dashboard","conversations"]}),n.invalidateQueries({queryKey:["dashboard","locations"]}),n.invalidateQueries({queryKey:["dashboard","people"]}),n.invalidateQueries({exact:!0,queryKey:E(e)})])}})}function ra(e,t){let n,a=[];for(let[o,i]of e){let r=i?.conversations.find(d=>d.conversationId===t);r&&(n??=r,a.push(JSON.stringify(o)))}return n?{conversation:n,feedQueryHashes:a}:void 0}var T=c(f(),1);function hn(e){return!e.archivedConversation&&!e.archiveError?null:(0,T.jsxs)("div",{className:u("grid gap-2",e.className),children:[e.archiveError?(0,T.jsx)(sa,{conversation:e.archiveError.conversation,onDismiss:e.onDismissError,wasArchiving:e.archiveError.wasArchiving}):null,e.archivedConversation?(0,T.jsx)(la,{conversation:e.archivedConversation,onRestored:e.onRestored},e.archivedConversation.id):null]})}function sa(e){let t=q(e.conversation);return(0,T.jsx)(Me,{action:(0,T.jsx)(Ue,{onClick:e.onDismiss,title:"Dismiss",tone:"error",children:"Dismiss"}),detail:t,icon:Ke,title:e.wasArchiving?"Could not archive":"Could not restore",tone:"error"})}function la(e){let t=de(e.conversation.id,{onSuccess:a=>{a||e.onRestored()}}),n=q(e.conversation);return(0,bn.useEffect)(()=>{if(t.isPending||t.error)return;let a=window.setTimeout(e.onRestored,6e3);return()=>window.clearTimeout(a)},[e.conversation.id,e.onRestored,t.error,t.isPending]),(0,T.jsx)(Me,{action:(0,T.jsx)(Ue,{"aria-label":`Undo archive for ${n}`,disabled:t.isPending,onClick:()=>t.mutate({archived:!1,lastSeenAt:e.conversation.lastSeenAt}),title:`Undo archive for ${n}`,children:t.isPending?"Restoring\u2026":"Undo"}),detail:n,icon:J,title:"Conversation archived",children:t.error?(0,T.jsx)("div",{className:"border-t border-rose-300/25 bg-rose-400/[0.12] px-3 py-2 font-sans text-xs text-rose-50/85",role:"alert",children:"Could not restore the conversation."}):null})}var Q=c(f(),1);function gn(e){return(0,Q.jsx)("h3",{className:u("m-0 font-sans text-xs font-medium text-dashboard-text-muted",e.className),id:e.id,children:(0,Q.jsxs)("button",{"aria-expanded":!e.collapsed,className:"flex cursor-pointer items-center gap-1 rounded-sm border-0 bg-transparent p-0 font-[inherit] text-inherit transition-colors hover:text-dashboard-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-dashboard-focus",onClick:e.onToggle,type:"button",children:[(0,Q.jsx)(F,{"aria-hidden":"true",className:u("size-3 shrink-0 transition-transform motion-reduce:transition-none",!e.collapsed&&"rotate-90")}),e.label,e.collapsed?(0,Q.jsx)("span",{className:"tabular-nums text-dashboard-text-faint",children:e.count}):null]})})}var ue=c(k(),1);var ca=150;function da(e,t){e.getQueryCache().find({exact:!0,queryKey:E(t)})?.getObserversCount()||e.prefetchQuery({...wt(t),queryFn:async({signal:a})=>{let o=await St(t,a,void 0,{mailbox:!0,unreadPage:At()==="unread"});return Nt(e,t,e.getQueryData(E(t)),o),{...o,prefetchedAtMs:Date.now()}}})}function pn(e){let t=X(),n=(0,ue.useRef)(void 0);(0,ue.useEffect)(()=>()=>clearTimeout(n.current),[]);let a=()=>{clearTimeout(n.current),n.current=setTimeout(()=>da(t,e),ca)},o=()=>clearTimeout(n.current);return{onBlur:o,onFocus:a,onPointerEnter:i=>{i.pointerType!=="touch"&&a()},onPointerLeave:o}}var me=c(k(),1),yn="junior:conversation-collapsed-sections";function xn(){let[e,t]=(0,me.useState)(ua),n=(0,me.useCallback)(a=>{t(o=>{let i=new Set(o);return i.delete(a)||i.add(a),ma(i),i})},[]);return{collapsedKeys:e,toggle:n}}function ua(){if(typeof window>"u")return new Set;try{let e=JSON.parse(window.localStorage.getItem(yn)??"[]");return Array.isArray(e)?new Set(e.filter(t=>typeof t=="string")):new Set}catch{return new Set}}function ma(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yn,JSON.stringify([...e]))}catch{}}var s=c(f(),1);function Ti(e){let{collapsedKeys:t,toggle:n}=xn(),[a,o]=(0,D.useState)(),[i,r]=(0,D.useState)(),d=(0,D.useCallback)((C,w)=>{r({conversation:C,wasArchiving:w})},[]),y=(0,D.useCallback)(C=>{r(w=>w?.conversation.id===C.id?void 0:w),o(C)},[]);fa(y,d);let x=(0,s.jsx)(hn,{archivedConversation:a,archiveError:i,className:"fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-3 right-3 z-30 sm:left-auto sm:w-96",onDismissError:()=>r(void 0),onRestored:()=>o(void 0)});if(e.loading&&e.conversations.length===0)return(0,s.jsx)(va,{label:"Loading conversations"});if(e.conversations.length===0)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint p-4",children:(0,s.jsx)(Tt,{children:e.emptyLabel??"No conversations match this view."})}),x]});let p=Dt(e.conversations,{attentionIds:Mt(e.waitingConversationIds,e.finishedConversationIds),nowMs:Date.now(),timeZone:e.timeZone});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{"aria-label":"Your conversations",className:"grid gap-5",role:"list",children:p.map(C=>(0,s.jsx)(ha,{collapsed:t.has(C.key),finishedConversationIds:e.finishedConversationIds,onArchiveError:d,onArchived:y,onToggle:()=>n(C.key),waitingConversationIds:e.waitingConversationIds,section:C},C.key))}),x]})}function fa(e,t){let n=ze(),a=Ee(),o=n.state?.archivedConversation,i=vn(o?.id);(0,D.useEffect)(()=>{!o||i!=="success"&&i!=="error"||(i==="success"?e(o):t(o,!0),a({hash:n.hash,search:n.search},{replace:!0,state:null}))},[o,n.hash,n.search,a,t,e,i])}function va(e){return(0,s.jsxs)("div",{"aria-busy":e.label?"true":void 0,"aria-live":e.label?"polite":void 0,className:"grid gap-5",role:e.label?"status":void 0,children:[e.label?(0,s.jsx)("span",{className:"sr-only",children:e.label}):null,[3,2].map((t,n)=>(0,s.jsxs)("div",{children:[(0,s.jsx)(R,{className:u("mb-2 ml-1 h-3",n===0?"w-16":"w-12")}),(0,s.jsx)("div",{className:"grid gap-2",children:Array.from({length:t},(a,o)=>(0,s.jsx)(ba,{index:o+n*3},o))})]},t))]})}function ba(e){return(0,s.jsxs)("div",{className:"grid min-w-0 gap-2 rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint px-4 py-4 md:px-5",children:[(0,s.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_max-content] items-start gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2.5",children:[(0,s.jsx)(R,{className:"mt-1.5 size-3 shrink-0 rounded-full"}),(0,s.jsx)(R,{className:u("h-4",e.index%2===0?"w-56 max-w-4/5":"w-44 max-w-3/5")})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(R,{className:"h-3 w-16 opacity-70"}),(0,s.jsx)(R,{className:"size-4"})]})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(R,{className:"h-3 w-full max-w-3xl opacity-70"}),e.index%2===0?(0,s.jsx)(R,{className:"h-3 w-2/3 max-w-xl opacity-70"}):null]}),(0,s.jsx)(R,{className:"h-3 w-64 max-w-4/5 opacity-70"})]})}function ha(e){return(0,s.jsxs)("section",{"aria-labelledby":`conversation-section-${e.section.key}`,children:[(0,s.jsx)(gn,{className:u("px-1",!e.collapsed&&"mb-2"),collapsed:e.collapsed,count:e.section.conversations.length,id:`conversation-section-${e.section.key}`,label:e.section.label,onToggle:e.onToggle}),e.collapsed?null:(0,s.jsx)("div",{className:"grid gap-2",children:e.section.conversations.map(t=>(0,s.jsx)(ga,{conversation:t,finishedSinceSeen:e.finishedConversationIds.has(t.id),onArchiveError:e.onArchiveError,onArchived:e.onArchived,waitingOnViewer:e.waitingConversationIds.has(t.id)},t.id))})]})}function ga(e){let t=e.conversation,n=de(t.id,{onError:()=>e.onArchiveError(t,n.variables?.archived??!0),onSuccess:x=>{x&&e.onArchived(t)}}),a=gt(t),o=q(t),i=oe(t,{includeId:!1}),r=un(t),d=t.visibility==="private",y=pn(t.id);return(0,s.jsxs)("article",{...y,className:"group relative grid min-w-0 gap-2 rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint px-4 py-4 transition-colors hover:border-dashboard-border hover:bg-dashboard-fill-soft md:px-5",role:"listitem",children:[(0,s.jsx)(W,{"aria-label":`Open ${o}`,className:"absolute inset-0 z-0 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-dashboard-focus",to:pe(t.id)}),(0,s.jsxs)("div",{className:"relative z-[1] grid min-w-0 grid-cols-[minmax(0,1fr)_max-content] items-start gap-3 pointer-events-none",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2.5",children:[(0,s.jsx)("span",{className:"mt-1.5 grid size-3 shrink-0 place-items-center",children:(0,s.jsx)(ln,{finishedSinceSeen:e.finishedSinceSeen,isPrivate:d,status:a,waitingOnViewer:e.waitingOnViewer})}),(0,s.jsx)("h4",{className:"m-0 truncate font-display text-base font-medium leading-snug text-dashboard-text",children:o})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(W,{className:"pointer-events-auto whitespace-nowrap font-sans text-xs tabular-nums text-dashboard-text-muted hover:text-dashboard-text focus:outline-none focus:ring-2 focus:ring-dashboard-focus",to:pe(t.id),children:ae(t.lastSeenAt)}),(0,s.jsx)("button",{"aria-label":`${t.archivedAt?"Restore":"Archive"} ${o}`,className:"pointer-events-auto relative shrink-0 cursor-pointer border-0 bg-transparent p-0 text-dashboard-text-muted transition before:absolute before:-inset-2 hover:text-dashboard-text focus:outline-none focus:ring-2 focus:ring-dashboard-focus focus:ring-offset-2 focus:ring-offset-dashboard-canvas disabled:cursor-not-allowed disabled:opacity-50",disabled:n.isPending,onClick:()=>n.mutate({archived:!t.archivedAt,lastSeenAt:t.lastSeenAt}),type:"button",children:t.archivedAt?(0,s.jsx)(J,{"aria-hidden":"true",size:15}):(0,s.jsx)($e,{"aria-hidden":"true",size:15})})]})]}),t.activityPreview?(0,s.jsx)("p",{className:"relative z-[1] m-0 line-clamp-2 font-sans text-sm leading-relaxed text-dashboard-text-subtle pointer-events-none",children:(0,s.jsx)(se,{inline:!0,mentions:t.activityPreview.mentions,text:t.activityPreview.text})}):(0,s.jsx)("p",{className:"relative z-[1] m-0 font-sans text-sm leading-relaxed text-dashboard-text-muted pointer-events-none",children:a==="active"?"Working\u2026":"No recent message"}),(0,s.jsxs)("div",{className:"relative z-[1] flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 font-sans text-xs text-dashboard-text-muted pointer-events-none",children:[i?(0,s.jsx)("span",{className:"truncate",children:i}):null,i&&r.length>0?(0,s.jsx)("span",{"aria-hidden":"true",children:"\xB7"}):null,r.length>0?(0,s.jsx)(mn,{participants:r,size:"list"}):null,(0,s.jsx)(en,{annotations:t.sidebarAnnotations})]})]})}var fe=c(k(),1);function Ri(e,t=250){let[n,a]=(0,fe.useState)(e);return(0,fe.useEffect)(()=>{let o=window.setTimeout(()=>a(e),t);return()=>window.clearTimeout(o)},[t,e]),n}export{Go as a,de as b,Me as c,Ue as d,Dt as e,Mt as f,ya as g,gn as h,pn as i,xn as j,rn as k,De as l,oa as m,un as n,mn as o,O as p,j as q,Mn as r,Et as s,Ot as t,we as u,_n as v,jn as w,Ka as x,le as y,Y as z,eo as A,to as B,so as C,lo as D,Co as E,No as F,en as G,wo as H,nn as I,So as J,Ao as K,na as L,ln as M,Ti as N,va as O,Ri as P};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{y as _}from"./chunk-VXT3FIVL.js";import{s as D}from"./chunk-6PHJZPWD.js";import{b as N}from"./chunk-YPMUHXYT.js";import{c as U}from"./chunk-7SZRL6FY.js";var h=U(N(),1);function x(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=Math.max(0,Math.floor(e));if(t<1e3)return`${t}ms`;if(t<6e4){let o=t/1e3;return`${o.toFixed(o<10?1:0)}s`}let r=[],i=[["mo",2592e6],["d",864e5],["h",36e5],["m",6e4],["s",1e3]];for(let[o,u]of i){let m=Math.floor(t/u);if(m!==0){if(r.push(`${m}${o}`),r.length===2)break;t%=u}}return r.join(" ")}function de(e){return(0,h.jsx)(h.Fragment,{children:x(e.value)||e.fallback||null})}function y(e){return Date.parse(e.createdAt)}function l(e,t,r){return{parts:r,role:t,sourceSeq:e.seq,timestamp:y(e),...e.mentions?{mentions:e.mentions}:void 0}}function q(e){let t=new Set;for(let r of e){let i=r.data;i.type==="subagent"&&i.parentToolCallId&&t.add(i.parentToolCallId)}return t}function L(e){let t=new Set;for(let r of e)r.messageId&&t.add(r.messageId);return t}function z(e,t){return{delivery:e.delivery,messageId:e.messageId,parts:e.redacted?[{type:"text",redacted:!0}]:[{type:"text",text:e.text??""}],...e.attachments?{attachments:e.attachments}:void 0,...e.images?.length?{images:e.images}:void 0,pending:!0,role:"user",source:e.source,sourceSeq:Number.MAX_SAFE_INTEGER-1e6+t,timestamp:Date.parse(e.createdAt),...e.actorIdentity?{actorIdentity:e.actorIdentity}:void 0,...e.actorIdentityId?{actorIdentityId:e.actorIdentityId}:void 0,...e.mentions?{mentions:e.mentions}:void 0,...e.reviewItemChange?{reviewItemChanges:[e.reviewItemChange]}:void 0}}function W(e,t){if(!t?.length)return e;let r=j(e,t);return r.length===0?e:[...e,...r]}function j(e,t){if(!t?.length)return[];let r=L(e);return t.filter(i=>!r.has(i.messageId)).map((i,o)=>z(i,o))}function J(e,t){return H(e.events,e.annotations,t)}function H(e,t,r){let i=q(e),o=new Map,u=new Map,m=new Map,f=[],C=new Map,b=new Map,M,V=(a,n)=>{if(i.has(n.toolCallId))return;let s="output"in n?n.output:void 0,d=o.get(n.toolCallId);if(d){d.name=n.name,d.status=n.status,n.input!==void 0&&(d.input=n.input),s!==void 0&&(d.output=s),d.startedTimestamp===void 0&&n.startedAt&&(d.startedTimestamp=Date.parse(n.startedAt)),n.status!=="running"&&(d.resultTimestamp=y(a));return}let c={type:"tool_call",id:n.toolCallId,name:n.name,status:n.status,...n.input===void 0?void 0:{input:n.input},...s===void 0?void 0:{output:s},...n.status==="running"?void 0:{resultTimestamp:y(a)}},p={...l(a,"tool",[c]),sourceSeq:n.startedSeq??a.seq,timestamp:n.startedAt?Date.parse(n.startedAt):y(a)};o.set(n.toolCallId,c),u.set(n.toolCallId,p),f.push(p)};for(let a of e){let n=a.data;if(n.type==="message"){let s={...l(a,n.role,[n.redacted?{type:"text",redacted:!0}:{type:"text",text:n.text}]),messageId:n.messageId,...n.attachments?{attachments:n.attachments}:void 0,...n.cards?{cards:_(n.cards,t??[])}:void 0,...n.actorIdentity?{actorIdentity:n.actorIdentity}:void 0,...n.actorIdentityId?{actorIdentityId:n.actorIdentityId}:void 0,...n.agentInvocationId?{agentInvocationId:n.agentInvocationId}:void 0,...n.eventType?{eventType:n.eventType}:void 0,eventObjectType:n.eventObjectType,...n.trustedSummary?{trustedSummary:n.trustedSummary}:void 0,...n.events?{events:n.events}:void 0,...n.explicitMention!==void 0?{explicitMention:n.explicitMention}:void 0,...n.quiet?{quiet:n.quiet}:void 0,...n.reviewItemChanges?{reviewItemChanges:n.reviewItemChanges}:void 0,...n.source?{source:n.source}:void 0};f.push(s),C.set(s.messageId,s),s.role==="user"&&(M=s);continue}if(n.type==="message_handled"){let s=C.get(n.messageId);s?.role==="user"&&s.explicitMention===!1&&!s.eventType&&(s.context=!0);continue}if(n.type==="assistant_message"){if(n.parts.length===0)continue;f.push(l(a,"assistant",n.parts.map(s=>s.redacted?{type:"reasoning",redacted:!0}:{type:"reasoning",text:s.text})));continue}if(n.type==="turn_lifecycle"&&n.state==="started"){let s=n.inputMessageIds?.map(c=>C.get(c)).filter(c=>c!==void 0),d=s?.slice().reverse().find(c=>c.role==="user");d?b.set(n.turnId,d):M&&b.set(n.turnId,M);for(let c of s??[])c.role==="user"&&c.explicitMention===!1&&!c.eventType&&(c.context=!0);continue}if(n.type==="turn_context"){let s=b.get(n.turnId);s&&(s.contexts??=[],s.contexts.push({content:n.content,kind:n.kind,loadedAt:a.createdAt,pluginName:n.pluginName,turnId:n.turnId,version:n.version}));continue}if(n.type==="tool_calls"){for(let s of n.calls)V(a,s);if(n.assistant){let s=[];for(let d of n.assistant.parts){if(d.type==="reasoning"){s.push(d.redacted?{type:"reasoning",redacted:!0}:{type:"reasoning",text:d.text});continue}if(i.has(d.toolCallId))continue;let c=o.get(d.toolCallId);if(!c)continue;let p=u.get(d.toolCallId);if(p){p.sourceSeq!==a.seq&&(c.startedTimestamp=p.timestamp);let w=f.indexOf(p);w>=0&&f.splice(w,1),u.delete(d.toolCallId)}s.push(c)}s.length>0&&f.push(l(a,"assistant",s))}continue}if(n.type==="subagent"){let s=`${n.childConversationId}:${n.startedSeq}`,d=m.get(s),c=n.status==="running"?void 0:y(a);if(d){d.status=n.status,c===void 0?delete d.finishedTimestamp:d.finishedTimestamp=c;continue}let p={type:"subagent",id:s,childConversationId:n.childConversationId,subagentKind:n.subagentKind,status:n.status,...c===void 0?void 0:{finishedTimestamp:c},...n.agentName?{agentName:n.agentName}:void 0,...n.task?{task:n.task}:void 0,...n.title?{title:n.title}:void 0};m.set(s,p),f.push({...l(a,"tool",[p]),sourceSeq:n.startedSeq,timestamp:Date.parse(n.startedAt)});continue}if(n.type==="structured_event"){f.push(l(a,"system",[{type:"structured_event",...a.mentions?{mentions:a.mentions}:void 0,namespace:n.namespace,name:n.name,version:n.version,presentation:n.presentation,...n.turnId?{turnId:n.turnId}:void 0}]));continue}if(n.type==="attachments_delivered"){f.push(l(a,"system",[{type:"attachments_delivered",attachments:n.attachments}]));continue}if(n.type==="compaction"){f.push(l(a,"system",[{type:"context_event",...a.mentions?{mentions:a.mentions}:void 0,event:{type:n.type,createdAt:a.createdAt,...n.modelId?{modelId:n.modelId}:void 0,...n.summary?{summary:n.summary}:void 0,...n.details?{details:n.details}:void 0}}]));continue}if(n.type==="turn_lifecycle"&&n.state==="failed"){f.push({role:n.failureCode==="delivery_failed"?"system":"assistant",failureCode:n.failureCode,...n.failureReason?{failureReason:n.failureReason}:void 0,...n.eventId?{eventId:n.eventId}:void 0,...n.sentryEventUrl?{sentryEventUrl:n.sentryEventUrl}:void 0,parts:[],sourceSeq:a.seq,timestamp:y(a)});continue}}let O=f.filter(a=>a.role!=="user"||a.eventType!==void 0||a.explicitMention!==!1||a.context===!0).sort((a,n)=>a.sourceSeq-n.sourceSeq);return W(O,r)}function v(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function Z(e){return e.status==="active"}function B(e){return e.status==="failed"}function K(e){return e.status==="active"}function G(e){return e.status==="failed"}function I(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function ye(e,t){let r=I(e);return r==null?"none":new Date(r).toLocaleString(void 0,{...t,timeZone:v()})}function Te(e){let t=I(e);if(t==null)return"not updated yet";let r=Math.round((t-Date.now())/1e3),i=Math.abs(r),o=[["year",3600*24*365],["month",3600*24*30],["week",3600*24*7],["day",3600*24],["hour",3600],["minute",60]];for(let[u,m]of o)if(i>=m)return new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}).format(Math.round(r/m),u);return"just now"}function X(e){if(typeof e!="number"||!Number.isFinite(e))return"none";let t=Math.max(0,Math.floor(e));if(t<1e3)return`${t}ms`;let r=t/1e3;if(r<60)return`${r.toFixed(r<10?1:0)}s`;let i=Math.round(r),o=Math.floor(i/60),u=i%60;return`${o}m ${u}s`}function he(e){if(e===void 0)return;let t=typeof e=="string"?e:JSON.stringify(e);if(t===void 0)return;let r=new TextEncoder().encode(t).byteLength;return r<1e3?`${r}b`:`${Math.round(r/1e3)}kb`}function ve(e,t){if(!(typeof e!="number"||typeof t!="number"||t<e))return X(t-e)}function Y(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=Math.max(0,Math.floor(e));return t===0?"":x(t)}function Ie(e,t=!1){if(typeof e!="number"||!Number.isFinite(e))return"no timestamp";let r=new Date(e);return t?r.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium",timeZone:v()}):r.toLocaleTimeString(void 0,{timeZone:v()})}function Ce(e){if(typeof e!="number"||!Number.isFinite(e))return"no timestamp";let t=Math.round((e-Date.now())/1e3),r=Math.abs(t),i=[["year",3600*24*365],["month",3600*24*30],["week",3600*24*7],["day",3600*24],["hour",3600]],[o,u]=i.find(([,m])=>r>=m)??i.at(-1);return new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}).format(Math.round(t/u),o)}function be(e){let t=new Date(e),r={dateStyle:"medium",timeStyle:"long"};return{local:t.toLocaleString(void 0,{...r,timeZone:v()}),utc:t.toLocaleString(void 0,{...r,timeZone:"UTC"})}}function A(e){if(typeof e!="number"||!Number.isFinite(e))return"0";let t=Math.max(0,Math.floor(e));if(t<1e3)return String(t);let r=[["t",1e12],["b",1e9],["m",1e6],["k",1e3]],[i,o]=r.find(([,f])=>t>=f)??r[1],u=t/o;return`${u>=100||Number.isInteger(u)||u>=10?Math.round(u).toString():(Math.floor(u*10)/10).toFixed(1).replace(/\.0$/,"")}${i}`}function g(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):void 0}function Q(e){return[e.inputTokens,e.outputTokens,e.cachedInputTokens,e.cacheCreationTokens].reduce((t,r)=>{let i=g(r);return i===void 0?t:(t??0)+i},void 0)}function R(e){let t=e.toLowerCase();return t==="assistant"?"assistant":t==="user"?"user":t==="system"?"system":t.includes("tool")?"tool":"other"}function ee(e,t){if(R(t.role)!=="user"||t.agentInvocationId)return;let r=t.actorIdentityId?e.authors?.[t.actorIdentityId]:void 0;if(r)return r;if(S(t.actorIdentity))return t.actorIdentity;if(S(e.actorIdentity))return e.actorIdentity}function Me(e,t){let r=R(t.role);if(r==="assistant")return D();if(r==="user"){if(t.agentInvocationId)return"Agent invocation";let i=ee(e,t);return i?.fullName?.trim()||(S(i)??"User")}return r==="system"?"System":r==="tool"?"Tool":t.role||"Unknown"}function te(e){return A(e)}function xe(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?"0":e<10?(Math.round(e*10)/10).toFixed(1).replace(/\.0$/,""):te(e)}function P(e){if(!e)return;let t={totalTokens:0};t.reasoningTokens=g(e.reasoningTokens);let r=Q(e);if(r!==void 0)t.totalTokens=r,t.inputTokens=g(e.inputTokens),t.outputTokens=g(e.outputTokens),t.cachedInputTokens=g(e.cachedInputTokens),t.cacheCreationTokens=g(e.cacheCreationTokens);else{let i=g(e.totalTokens);i!==void 0&&(t.totalTokens=i,t.providerTotalTokens=i)}return t.totalTokens>0?t:void 0}function Se(e){if(!e?.length)return;let t={totalTokens:0};for(let r of e){let i=P(r.usage);if(i){t.totalTokens+=i.totalTokens;for(let o of["inputTokens","outputTokens","cachedInputTokens","cacheCreationTokens","reasoningTokens"]){let u=i[o];u!==void 0&&(t[o]=(t[o]??0)+u)}}}return t.totalTokens>0?t:void 0}function ne(e){return e?`${A(e.totalTokens)} tokens`:""}function ke(e){return ne(P(e))}function T(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0}function k(e,t){return Math.round((e+t)*1e12)/1e12}function F(e){if(!e?.cost)return;let t={total:0},r=e.cost,i=T(r.total),o={input:T(r.input),output:T(r.output),cacheRead:T(r.cacheRead),cacheWrite:T(r.cacheWrite)},u=Object.values(o).reduce((m,f)=>m+(f??0),0);return t.total=k(t.total,i??u),t.input=o.input,t.output=o.output,t.cacheRead=o.cacheRead,t.cacheWrite=o.cacheWrite,i!==void 0||u>0?t:void 0}function we(e){let t;for(let r of e??[]){let i=F(r.usage);i&&(t=k(t??0,i.total))}return t===void 0?void 0:{total:t}}function re(e){if(!e)return"";let t=e.total>0&&e.total<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e.total)}function Ue(e){return e?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e.total):""}function ie(e,t){if(!(!e&&!t))return{...e,total:k(e?.total??0,t?.costUsd??0)}}function Ne(e,t){return re(ie(F(e),t))}function _e(e){return Y(e.cumulativeDurationMs)||"none"}function oe(e,t){return(I(t)??0)-(I(e)??0)}function De(e){return e?.agentTree?.at(-1)?.label??(e?.displayTitle?.trim()||void 0)}function Ae(e){return e?.displayTitle??"Conversation"}function S(e){let t=e?.email?.trim()||void 0,r=e?.fullName?.trim()||void 0,i=e?.slackUserName?.trim()||void 0;return t??r??i??e?.slackUserId}function Re(e,t={}){let r=e.channel;if(!r)return;let o=t.includeId??!0?` (${r})`:"";if(e.channelNameRedacted&&e.channelName)return`${e.channelName}${o}`;let u=e.channelName?.replace(/^#/,"");return r.startsWith("D")?`Direct Message${o}`:r.startsWith("C")?u?`#${u}${o}`:`Public Channel${o}`:r.startsWith("G")?u?.startsWith("mpdm-")?`Group DM${o}`:`Private Channel${o}`:u?`${u}${o}`:r}function se(e){return B(e)?"failed":Z(e)?"active":"idle"}function Pe(e){return K(e)?"active":G(e)?"failed":"idle"}function Fe(e){return e.eventHistory.status==="redacted"?"Transcript hidden because this conversation is not public.":e.eventHistory.status==="expired"?"Transcript expired for this conversation.":se(e)==="active"?"Transcript pending while this conversation is active.":"Transcript unavailable for this conversation."}function $e(e){return`/people/${encodeURIComponent(e)}`}function Ee(e){return`/memories/${encodeURIComponent(e)}`}function Ve(e){return`/system/locations/${encodeURIComponent(e)}`}function Oe(e){return`/system/workspaces/${encodeURIComponent(e)}`}function qe(e,t="overview"){let r=`/automations/${encodeURIComponent(e)}`;return t==="overview"?r:`${r}/${t}`}function $(e){let t=e.trim();if(t)try{return JSON.stringify(JSON.parse(t),null,2)}catch{return}}function E(e){let t=e.trim().split(/\r?\n/).filter(i=>i.trim().length>0);if(t.length<2)return;let r=[];for(let i of t){let o=$(i);if(!o)return;r.push(o)}return r.join(`
|
|
2
|
+
`)}function ae(e){return $(e)??E(e)}function Le(e){let t=e.trim();if(!t)return"markdown";try{return JSON.parse(t),"json"}catch{}return E(t)?"json":"markdown"}function ue(e){return e.map(t=>({activityPreview:t.activityPreview,annotations:t.annotations,sidebarAnnotations:t.sidebarAnnotations,archivedAt:t.archivedAt,pinnedAt:t.pinnedAt,auxiliaryCosts:t.auxiliaryCosts,channel:t.channel,channelName:t.channelName,channelNameRedacted:t.channelNameRedacted,childAgentTotals:t.childAgentTotals,cumulativeDurationMs:t.cumulativeDurationMs,cumulativeUsage:t.cumulativeUsage,displayTitle:t.displayTitle,id:t.conversationId,lastProgressAt:t.lastProgressAt,lastSeenAt:t.lastSeenAt,locationId:t.locationId,locationUrl:t.locationUrl,actorIdentity:t.actorIdentity,participants:t.participants,sentryTraceUrl:t.sentryTraceUrl,startedAt:t.startedAt,status:t.status,surface:t.surface,traceId:t.traceId,isPriority:t.isPriority,unfinishedWork:t.unfinishedWork,visibility:t.visibility})).sort((t,r)=>oe(t.lastSeenAt,r.lastSeenAt))}function ze(e){if(!e)return;let t=ue([e])[0];return t?{...t,displayTitle:e.displayTitle}:void 0}function We(e){return e==null||e===""?"":typeof e=="string"?ae(e)??e:JSON.stringify(e,null,2)??""}export{x as a,de as b,J as c,H as d,v as e,ye as f,Te as g,X as h,he as i,ve as j,Y as k,Ie as l,Ce as m,be as n,R as o,ee as p,Me as q,te as r,xe as s,P as t,Se as u,ne as v,ke as w,F as x,we as y,re as z,Ue as A,ie as B,Ne as C,_e as D,De as E,Ae as F,S as G,Re as H,Pe as I,Fe as J,$e as K,Ee as L,Ve as M,Oe as N,qe as O,ae as P,Le as Q,ue as R,ze as S,We as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as h,e as V,f as H,g as z,h as _,i as U,j as K,k as L,l as W,m as X,n as Y,o as j,s as q}from"./chunk-G5NWYJTV.js";import{B as O,G as k,H as B,c as E}from"./chunk-WRXMQB7X.js";import{i as w}from"./chunk-B5ZN3SWQ.js";import{b as F}from"./chunk-CR2ICLSH.js";import{Ia as g,Oc as I,Qa as d,Rc as A,S as T,a as y,b as m,cd as M}from"./chunk-YPMUHXYT.js";import{b as Dt,c as r}from"./chunk-7SZRL6FY.js";var at=r(y(),1);var s={};Dt(s,{Backdrop:()=>J,Close:()=>V,Description:()=>H,Handle:()=>Y,Popup:()=>et,Portal:()=>U,Root:()=>ot,Title:()=>W,Trigger:()=>X,Viewport:()=>L,createHandle:()=>j});var G=r(y(),1);var J=G.forwardRef(function(a,p){let{render:S,className:c,style:x,forceRender:l=!1,...u}=a,i=h(),e=i.useState("open"),D=i.useState("nested"),b=i.useState("mounted"),f=i.useState("transitionStatus");return g("div",a,{state:{open:e,transitionStatus:f},ref:[i.context.backdropRef,p],stateAttributesMapping:T,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!D})});var $=r(y(),1);var Q="--nested-dialogs";var tt=r(m(),1),et=$.forwardRef(function(a,p){let{render:S,className:c,style:x,finalFocus:l,initialFocus:u,...i}=a,e=h(),D=e.useState("descriptionElementId"),b=e.useState("disablePointerDismissal"),f=e.useState("floatingRootContext"),R=e.useState("popupProps"),lt=e.useState("modal"),C=e.useState("mounted"),dt=e.useState("nested"),v=e.useState("nestedOpenDialogCount"),P=e.useState("open"),pt=e.useState("openMethod"),mt=e.useState("titleElementId"),ct=e.useState("transitionStatus"),ut=e.useState("role"),ft=f.useState("floatingId");z(),w({open:P,ref:e.context.popupRef,onComplete(){P&&e.context.onOpenChangeComplete?.(!0)}});let gt=u===void 0?B(e.context.popupRef):u,ht=v>0,St=e.useStateSetter("popupElement"),xt=g("div",a,{state:{open:P,nested:dt,transitionStatus:ct,nestedDialogOpen:ht},props:[R,{id:ft,"aria-labelledby":mt,"aria-describedby":D,role:ut,...k,hidden:!C,onKeyDown(N){M.has(N.key)&&N.stopPropagation()},style:{[Q]:v}},i],ref:[p,e.context.popupRef,St],stateAttributesMapping:_});return(0,tt.jsx)(O,{context:f,openInteractionType:pt,disabled:!C,closeOnFocusOut:!b,initialFocus:gt,returnFocus:l,modal:lt!==!1,restoreFocus:"popup",children:xt})});var ot=E(function(a){return K("dialog",a)});var o=r(m(),1);function st({...t}){return(0,o.jsx)(s.Root,{"data-slot":"sheet",...t})}function re({...t}){return(0,o.jsx)(s.Close,{"data-slot":"sheet-close",...t})}function bt({...t}){return(0,o.jsx)(s.Portal,{"data-slot":"sheet-portal",...t})}function Pt({className:t,...a}){return(0,o.jsx)(s.Backdrop,{"data-slot":"sheet-overlay",className:d("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",t),...a})}function rt({className:t,children:a,side:p="right",showCloseButton:S=!0,closeButtonProps:c,...x}){let l=at.useRef(null);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:l,className:"contents"}),(0,o.jsxs)(bt,{container:l,children:[(0,o.jsx)(Pt,{}),(0,o.jsxs)(s.Popup,{"data-slot":"sheet-content","data-dashboard-modal":"","data-side":p,className:d("fixed z-50 flex flex-col gap-4 border-dashboard-border-strong bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition-[opacity,transform] duration-180 ease-[cubic-bezier(0.2,0.8,0.2,1)] motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...x,children:[a,S&&(0,o.jsxs)(s.Close,{"data-slot":"sheet-close",render:(0,o.jsx)(F,{...c,className:d("absolute top-3 right-3",c?.className),size:"icon"}),children:[(0,o.jsx)(I,{"aria-hidden":"true",size:15,strokeWidth:2.25}),(0,o.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})]})}function it({className:t,...a}){return(0,o.jsx)("div",{"data-slot":"sheet-header",className:d("flex flex-col gap-1 p-4 pr-14",t),...a})}function nt({className:t,...a}){return(0,o.jsx)(s.Title,{"data-slot":"sheet-title",className:d("text-lg font-semibold text-foreground",t),...a})}var n=r(m(),1);function pe(t){let a=q(t.onClose);return(0,n.jsx)(st,{...a.rootProps,children:(0,n.jsxs)(rt,{...a.contentProps,"aria-label":t.label,side:"bottom",className:A("mx-auto w-full max-w-2xl gap-0 rounded-t-2xl outline-none",t.size==="content"?"max-h-[85dvh]":"max-h-full data-[side=bottom]:h-[85dvh]"),children:[(0,n.jsx)(it,{className:"border-b border-dashboard-border",children:(0,n.jsx)(nt,{className:"break-words",children:t.title??t.label})}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:t.children})]})})}export{J as a,et as b,s as c,st as d,re as e,rt as f,pe as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as j}from"./chunk-H2ZU34CP.js";import{a as de}from"./chunk-SUX4QBVF.js";import{a as N,b as te,c as C,d as ae,e as re,f as G,h as oe,i as ie,k as ne,l as se,m as le,o as w,p as R,q as A,r as me,s as ce,t as S,w as U,x as M}from"./chunk-V5UDSIRA.js";import{a as O,b as L,c as F}from"./chunk-LKW7MULF.js";import{a as z,b as E,c as W,e as T,f as x,g as B}from"./chunk-QOX5RMLM.js";import{a as Y,r as g,s as J,z as $}from"./chunk-NQMDED2R.js";import{Ja as H}from"./chunk-VXT3FIVL.js";import{C as Q,D as X,H as Z,I as ee}from"./chunk-6PHJZPWD.js";import{Rc as _,Wc as P,a as xe,b as y,kb as I}from"./chunk-YPMUHXYT.js";import{c as h}from"./chunk-7SZRL6FY.js";var be=h(xe(),1);var v=[{key:"cachedInputTokens",label:"From cache",color:"var(--color-cyan-400)"},{key:"cacheCreationTokens",label:"Written to cache",color:"var(--color-amber-400)"},{key:"inputTokens",label:"Uncached",color:"var(--color-violet-400)"}];function k(t){if(!v.some(({key:e})=>t[e]===void 0))return v.reduce((e,{key:a})=>e+t[a],0)}function D(t,e){if(t===void 0||e===void 0||e===0)return"\u2014";let a=t/e*100;return a<100&&a>=99.95?"<100%":a>0&&a<.05?"<0.1%":`${a.toFixed(1)}%`}function V(t){return v.some(({key:e})=>t[e]!==void 0)||(t.tokens??0)>0||t.durationMs>0||t.conversations>0}function ue(t){let e=t.filter(V),a={};for(let{key:o}of v)e.length&&e.every(s=>s[o]!==void 0)&&(a[o]=e.reduce((s,d)=>s+d[o],0));return{input:a,total:k(a),activePeriods:e.length,incompletePeriods:e.filter(o=>k(o)===void 0).length}}var u=h(y(),1);function pe(t){let e=t.days.filter(o=>(o.cacheCreationTokens??0)>0).sort((o,s)=>s.cacheCreationTokens-o.cacheCreationTokens||s.date.localeCompare(o.date)).slice(0,3);if(!e.length)return null;let a=t.bucketUnit==="6hour"?"6 hours":t.bucketUnit;return(0,u.jsxs)(O,{className:"border-t border-dashboard-border-subtle px-4 py-3 sm:px-5",children:[(0,u.jsxs)(L,{className:"group flex cursor-pointer items-center gap-1 font-sans tabular-nums text-xs text-dashboard-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-dashboard-focus",children:[(0,u.jsx)(I,{"aria-hidden":"true",className:P}),"Largest cache writes"]}),(0,u.jsxs)(F,{hiddenUntilFound:!0,children:[(0,u.jsxs)("p",{className:"mb-2 mt-3 font-sans tabular-nums text-xs leading-relaxed text-dashboard-text-muted",children:["Top three by tokens written per ",a,", within the selected time window. Large writes alone do not mean a cache problem."]}),(0,u.jsxs)(z,{"aria-label":"Largest cache writes",className:"min-w-80 table-fixed font-sans text-xs tabular-nums",children:[(0,u.jsx)(E,{children:(0,u.jsxs)(T,{children:[(0,u.jsx)(x,{scope:"col",className:"px-0 py-2 font-normal",children:t.bucketUnit==="day"?"Day":"Starting at"}),(0,u.jsx)(x,{scope:"col",className:"w-24 px-0 py-2 text-right font-normal",children:"Written"}),(0,u.jsx)(x,{scope:"col",className:"w-24 px-0 py-2 text-right font-normal",children:"From cache"})]})}),(0,u.jsx)(W,{children:e.map(o=>(0,u.jsxs)(T,{children:[(0,u.jsx)(x,{scope:"row",className:"px-0 py-2 font-normal whitespace-normal",children:ne(o.date)}),(0,u.jsx)(B,{className:"px-0 py-2 text-right whitespace-normal",children:g(o.cacheCreationTokens)}),(0,u.jsx)(B,{className:"px-0 py-2 text-right whitespace-normal",children:D(o.cachedInputTokens,k(o))})]},o.date))})]})]})]})}var i=h(y(),1),Ce={...Object.fromEntries(v.map(({color:t,key:e,label:a})=>[e,{color:t,label:a}])),missing:{color:"var(--color-slate-400)",label:"Missing data"}};function fe(t){let[e,a]=(0,be.useState)("share"),o=ue(t.days),s=t.days.map(n=>{let b=k(n);return{...Object.fromEntries(v.map(({key:r})=>{let m=n[r]??0;return[r,e==="share"?b?m/b*100:0:m]})),date:n.date,day:n,missing:b===void 0&&V(n)?0:void 0}}),d=e==="share"?100:Math.max(1,...t.days.map(n=>v.reduce((b,{key:f})=>b+(n[f]??0),0)));return(0,i.jsxs)(H,{children:[(0,i.jsx)(j,{title:"Input cache",trailing:(0,i.jsxs)(Q,{"aria-label":"Cache chart display",onValueChange:([n])=>{n&&a(n)},value:[e],children:[(0,i.jsx)(X,{value:"share",children:"Percent"}),(0,i.jsx)(X,{value:"tokens",children:"Tokens"})]})}),(0,i.jsx)("dl",{className:"m-0 flex flex-wrap gap-x-5 gap-y-2 px-4 py-3 font-sans tabular-nums text-xs sm:px-5",children:v.map(({key:n,label:b,color:f})=>(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("dt",{className:"flex items-center gap-1.5 text-dashboard-text-muted",children:[(0,i.jsx)("span",{"aria-hidden":"true",className:"size-2 rounded-full",style:{backgroundColor:f}}),b]}),(0,i.jsx)("dd",{className:"m-0 tabular-nums text-dashboard-text",children:D(o.input[n],o.total)})]},n))}),o.activePeriods===0?(0,i.jsx)("p",{className:"m-0 px-4 pb-2 font-sans tabular-nums text-xs text-dashboard-text-muted sm:px-5",children:"No input data in this time window."}):o.incompletePeriods>0?(0,i.jsxs)("p",{className:"m-0 px-4 pb-2 font-sans tabular-nums text-xs text-dashboard-text-muted sm:px-5",children:["Missing data in ",o.incompletePeriods," of ",o.activePeriods," ","active time intervals. Percentages are unavailable; Tokens shows the reported values."]}):null,(0,i.jsx)("div",{className:"px-2 pb-2",children:(0,i.jsx)(U,{className:"aspect-auto h-40 w-full",config:Ce,children:(0,i.jsxs)(G,{"aria-label":`Input cache ${e} per ${ee(t.bucketUnit)}`,data:s,margin:w,role:"img",children:[(0,i.jsx)(N,{strokeDasharray:"3 5",vertical:!1}),(0,i.jsx)(A,{format:e==="share"?n=>`${n}%`:g,maximum:d}),(0,i.jsx)(R,{keys:s.map(n=>n.date)}),(0,i.jsx)(re,{dataKey:"date",hide:!0,xAxisId:"missing"}),(0,i.jsx)(M,{content:(0,i.jsx)(S,{rows:({day:n})=>{let b=k(n);return v.map(({key:f,label:r})=>[r,n[f]===void 0?"Not reported":`${g(n[f])} \xB7 ${D(n[f],b)}`])}})}),v.map(({key:n})=>(0,i.jsx)(C,{dataKey:n,fill:`var(--color-${n})`,fillOpacity:.85,isAnimationActive:!1,maxBarSize:32,stackId:"input"},n)),(0,i.jsx)(C,{dataKey:"missing",fill:"var(--color-missing)",isAnimationActive:!1,maxBarSize:32,minPointSize:3,xAxisId:"missing"})]})})}),(0,i.jsx)(pe,{days:t.days,bucketUnit:t.bucketUnit}),(0,i.jsxs)(O,{className:"border-t border-dashboard-border-subtle px-4 py-3 font-sans tabular-nums text-xs text-dashboard-text-muted sm:px-5",children:[(0,i.jsxs)(L,{className:"group flex cursor-pointer items-center gap-1 text-dashboard-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-dashboard-focus",children:[(0,i.jsx)(I,{"aria-hidden":"true",className:P}),"How to read this"]}),(0,i.jsx)(F,{hiddenUntilFound:!0,children:(0,i.jsxs)("div",{className:"mt-3 grid gap-2 leading-relaxed",children:[(0,i.jsx)("p",{className:"m-0",children:"From cache is input reused. Written to cache is input saved for reuse. Uncached is the remaining input."}),(0,i.jsx)("p",{className:"m-0",children:"Percentages use total input tokens, not call counts. Gray marks and \u2014 mean missing data; zero means a reported zero. The latest interval may be incomplete."}),(0,i.jsx)("p",{className:"m-0",children:"These totals can show when reuse changes, but not why. They do not show individual calls or prove that every call reported cache use."})]})})]})]})}var c=h(y(),1);function ke(t){return t<1?`$${t.toFixed(2)}`:`$${g(t)}`}function Te(t){let e=t/36e5;return e>=24?`${g(e/24)}d`:e>=1?`${g(e)}h`:Y(t)}function Ne(){return{axisFormat:g,color:"var(--color-cyan-400)",format:g,metric:"tokens",title:"Token usage",type:"bar"}}function he(){return[{axisFormat:ke,color:"var(--color-amber-400)",format:t=>$({total:t}),metric:"costUsd",title:"Model spend",type:"area"},{axisFormat:Te,color:"var(--color-violet-400)",format:Y,metric:"durationMs",title:"Runtime",type:"scatter"}]}function we(t,e){return t[e]??0}function dt(t){let e=t.bucketUnit??"day",a=t.cacheBreakdown?he():[Ne(),...he()];return(0,c.jsxs)("div",{className:"grid gap-4",children:[t.cacheBreakdown?(0,c.jsx)(fe,{bucketUnit:e,days:t.days}):null,(0,c.jsx)("div",{className:t.cacheBreakdown?"grid gap-4 lg:grid-cols-2":"grid gap-4 lg:grid-cols-3",children:a.map(o=>(0,c.jsx)(Re,{bucketUnit:e,chart:o,days:t.days},o.metric))})]})}function Re(t){let{chart:e,days:a}=t,o=a.map(r=>we(r,e.metric)),s=a.map((r,m)=>({date:r.date,value:o[m]})),d=Math.max(Number.EPSILON,...o),n=o.reduce((r,m)=>r+m,0),b=me(o),f={dataKey:"value",fill:"var(--color-value)",isAnimationActive:!1};return(0,c.jsxs)(H,{children:[(0,c.jsx)(j,{title:e.title,total:e.format(n)}),(0,c.jsx)("div",{className:"px-2 py-2",children:(0,c.jsx)(U,{className:"aspect-auto h-38 w-full",config:{value:{color:e.color,label:e.title}},children:(0,c.jsxs)(oe,{"aria-label":`${e.title} per ${t.bucketUnit==="6hour"?"6 hours":t.bucketUnit}`,data:s,margin:w,role:"img",children:[(0,c.jsx)(N,{strokeDasharray:"3 5",vertical:!1}),(0,c.jsx)(A,{format:e.axisFormat,maximum:d}),(0,c.jsx)(R,{keys:s.map(r=>r.date)}),(0,c.jsx)(M,{content:(0,c.jsx)(S,{rows:r=>[[e.title,e.format(r.value)]]})}),e.type==="bar"?(0,c.jsx)(C,{...f,fillOpacity:.8,maxBarSize:8,minPointSize:r=>r?2:0,radius:1.5}):e.type==="area"?(0,c.jsx)(te,{...f,dot:{fillOpacity:.45,r:2.5,stroke:"none"},fillOpacity:.08,stroke:"var(--color-value)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,type:"linear"}):(0,c.jsx)(ae,{...f,fillOpacity:.75}),(0,c.jsx)(ce,{average:b,format:e.metric==="tokens"?J:e.format,stroke:e.color,unit:Z(t.bucketUnit)})]})})})]})}var p=h(y(),1),q=["var(--color-cyan-300)","var(--color-emerald-300)","var(--color-amber-400)","var(--color-rose-400)","var(--color-violet-400)"],Ae={danger:"var(--color-rose-400)",good:"var(--color-emerald-300)",neutral:"var(--color-cyan-300)",warning:"var(--color-amber-400)"};function ge(t,e){return t.tone?Ae[t.tone]:q[e%q.length]??q[0]}function Se(t,e){let a=t.timeRangeDays?t.categories.slice(-Me(t,e)):t.categories,o=a.flatMap(b=>t.series.map(f=>b.values[f.key]??0)),s=Math.min(0,...o),d=Math.max(0,...o),n=d===s?s+1:d;return{categories:a,maximum:n,minimum:s}}function vt(t){let{widget:e}=t,{categories:a,maximum:o,minimum:s}=Se(e,t.range),d=De(e),n=a.map(r=>({category:r,id:r.id,...Object.fromEntries(e.series.map((m,K)=>[`series-${K}`,r.values[m.key]??0]))})),b=new Map(a.map(r=>[r.id,r.label])),f=Object.fromEntries(e.series.map((r,m)=>[`series-${m}`,{color:ge(r,m),label:r.label}]));return(0,p.jsxs)("div",{className:"overflow-hidden rounded-md border border-dashboard-border bg-dashboard-surface-panel",children:[(0,p.jsxs)("div",{className:"border-b border-dashboard-border-subtle px-4 py-3",children:[(0,p.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,p.jsx)("h4",{className:"m-0 font-sans text-xs font-medium text-dashboard-text-muted",children:e.title})}),e.description?(0,p.jsx)("p",{className:"mt-1 mb-0 font-mono text-xs text-dashboard-text-muted",children:e.description}):null,e.series.length>1?(0,p.jsx)(de,{ariaLabel:"Chart legend",items:e.series.map((r,m)=>({color:ge(r,m),key:r.key,label:r.label}))}):null]}),a.length===0?(0,p.jsx)("p",{className:"m-0 p-4 font-sans text-xs text-dashboard-text-muted",children:e.emptyText??"No chart data."}):(0,p.jsx)(U,{className:"aspect-auto h-60 w-full",config:f,children:(0,p.jsxs)(G,{"aria-label":e.title,data:n,margin:w,role:"img",children:[(0,p.jsx)(N,{strokeDasharray:"3 5",vertical:!1}),(0,p.jsx)(A,{format:r=>ve(r,d),maximum:o,minimum:s}),(0,p.jsx)(R,{centered:!0,dataKey:"id",formatLabel:r=>se(b.get(r)??r),keys:a.map(r=>r.id)}),(0,p.jsx)(M,{content:(0,p.jsx)(S,{formatLabel:r=>le(b.get(r)??r),rows:({category:r})=>e.series.map(m=>[m.label,ve(r.values[m.key]??0,m.format)])})}),e.series.map((r,m)=>(0,p.jsx)(C,{dataKey:`series-${m}`,fill:`var(--color-series-${m})`,fillOpacity:.82,isAnimationActive:!1,maxBarSize:54/e.series.length,minPointSize:K=>K?2:0,radius:1.5},r.key))]})})]})}var Ue=24;function Me(t,e){let a=t.timeRangeDays??[],o=t.categories[0],s=o?.id||o?.label||"",d=ie(s);return e===1?d&&a.includes(1)?Ue:a.includes(7)?7:a.includes(30)?30:a[0]??30:e&&a.includes(e)?e:a.includes(30)?30:a[0]??30}function Be(t){return String(Number(t.toPrecision(12)))}function De(t){return new Set(t.series.map(a=>a.format)).size===1?t.series[0]?.format:void 0}function ve(t,e){return e==="usd"?$({total:t}):Be(t)}var l=h(y(),1);function kt(t){let e=t.recordSet.fields??[],a=t.recordSet.records??[],o=t.embedded===!0;return(0,l.jsxs)("div",{className:_(o?"border-t border-dashboard-border-subtle":"overflow-hidden rounded-md border border-dashboard-border bg-dashboard-surface-panel"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-4 px-5 py-3",children:[(0,l.jsx)("div",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:t.recordSet.title}),(0,l.jsxs)("div",{className:"hidden font-mono text-xs text-dashboard-text-muted sm:block",children:[a.length," records"]})]}),a.length===0?(0,l.jsx)("div",{className:"px-5 pb-5 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:t.recordSet.emptyText??"No records."}):e.length===0?(0,l.jsx)("div",{className:"px-5 pb-5 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:"Report records are unavailable because no fields were declared."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"grid gap-2 border-t border-dashboard-border-subtle p-3 sm:hidden",children:a.map(s=>(0,l.jsx)("div",{className:_("grid gap-3 rounded-md border border-dashboard-border-subtle bg-dashboard-overlay-soft p-3",ye(s.tone)),children:e.map(d=>(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"font-sans font-medium text-xs text-dashboard-text-muted",children:d.label}),(0,l.jsx)("div",{className:"mt-1 break-words font-sans text-xs leading-relaxed text-dashboard-text-muted",children:s.values[d.key]??""})]},d.key))},s.id))}),(0,l.jsx)("div",{className:"hidden border-t border-dashboard-border-subtle sm:block",children:(0,l.jsxs)(z,{className:"min-w-[36rem]",children:[(0,l.jsx)(E,{className:"bg-dashboard-overlay-soft",children:(0,l.jsx)(T,{children:e.map(s=>(0,l.jsx)(x,{className:"px-5",scope:"col",children:s.label},s.key))})}),(0,l.jsx)(W,{children:a.map(s=>(0,l.jsx)(T,{className:ye(s.tone),children:e.map(d=>(0,l.jsx)(B,{className:"max-w-72 truncate px-5 py-3 font-mono text-xs text-dashboard-text-muted",children:s.values[d.key]??""},d.key))},s.id))})]})})]})]})}function ye(t){return t==="danger"?"bg-rose-500/[0.07]":t==="warning"?"bg-amber-300/[0.045]":t==="good"?"bg-emerald-400/[0.055]":""}export{dt as a,vt as b,kt as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as l}from"./chunk-MEHLQZDG.js";import{Qa as o,b as n}from"./chunk-YPMUHXYT.js";import{c as a}from"./chunk-7SZRL6FY.js";var r=a(n(),1);function d({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"field",className:o("grid gap-2",e),...t})}function m({className:e,...t}){return(0,r.jsx)("label",{"data-slot":"field-label",className:o("text-sm font-semibold text-dashboard-text",e),...t})}function p({className:e,...t}){return(0,r.jsx)("p",{"data-slot":"field-description",className:o("m-0 text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",e),...t})}function x({className:e,...t}){return t.children?(0,r.jsx)("p",{role:"alert","data-slot":"field-error",className:o("m-0 text-xs leading-relaxed text-rose-300",e),...t}):null}var s=a(n(),1);function C({className:e,...t}){return(0,s.jsx)("textarea",{"data-slot":"textarea",className:o(l,"min-h-36",e),...t})}export{d as a,m as b,p as c,x as d,C as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as u,j as y,l as f}from"./chunk-GMZIELFU.js";import{b as l}from"./chunk-CR2ICLSH.js";import{a as T,b as s,hb as g,mb as p,yb as c}from"./chunk-YPMUHXYT.js";import{c as a}from"./chunk-7SZRL6FY.js";var m=a(T(),1);var e=a(s(),1);function h(i){let[t,n]=(0,m.useState)("idle"),o=t==="copied"?"Copied":t==="copying"?i.copyingLabel??"Copying":t==="failed"?"Copy failed":i.label,d={copied:g,copying:c,failed:p,idle:c}[t];async function r(){if(i.getText)try{n("copying"),await navigator.clipboard.writeText(await i.getText()),n("copied")}catch{n("failed")}}return i.layout==="menu"?(0,e.jsxs)(l,{"aria-label":o,disabled:!i.getText||t==="copying",onClick:()=>{r()},size:"menu",children:[(0,e.jsx)(d,{"aria-hidden":"true",size:16,strokeWidth:2}),(0,e.jsx)("span",{children:o})]}):(0,e.jsxs)(u,{children:[(0,e.jsx)(y,{render:(0,e.jsx)(l,{focusableWhenDisabled:!0,"aria-label":o,disabled:!i.getText||t==="copying",onClick:()=>{r()},size:"icon",children:(0,e.jsx)(d,{"aria-hidden":"true",className:t==="failed"?"text-rose-300":void 0,size:15,strokeWidth:2})})}),(0,e.jsx)(f,{size:"compact",children:o})]})}export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as A,c as C,d as B}from"./chunk-B6HGRBBX.js";import{a as i,g as a,r}from"./chunk-GO45RQDL.js";import{F as d,Ia as K,N as l,P as y,Q as f,R as m,S as h,Y as D,Z as b,_ as p,ia as R,ma as q,na as S,oa as g,sa as P,t as c,ta as x,ua as v,va as F,wa as _}from"./chunk-VXT3FIVL.js";var u=5*6e4;function U(){if(typeof window>"u")return;let e=window.__JUNIOR_DASHBOARD_BOOTSTRAP__;delete window.__JUNIOR_DASHBOARD_BOOTSTRAP__;let o=B.safeParse(e);return o.success?o.data:void 0}var w=1e4;function L(){return{queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[o,t]=await Promise.all([r(A,"/api/me",e),r(C,"/api/config",e)]);return{config:t,me:o}},initialData:U,initialDataUpdatedAt:()=>performance.timeOrigin,retry:!1,staleTime:u}}function W(){return a(L())}function $(){return a({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>r(D,"/api/plugins",e),retry:!1,staleTime:u})}function z(){return a({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>r(c,"/api/user-pages",e),retry:!1,staleTime:u})}function G(e=""){return a({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:o})=>r(d,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,o),placeholderData:i,refetchInterval:o=>o.state.data?.conversations.some(t=>t.status==="active")?1e4:!1,retry:!1})}function X(){return a({queryKey:["dashboard","code"],queryFn:({signal:e})=>r(q,"/api/code",e),retry:!1})}function Y(e){return a({enabled:!!e,queryKey:["dashboard","code","repositories",e],queryFn:({signal:o})=>r(S,`/api/code/repositories/${encodeURIComponent(e)}`,o),retry:!1})}function Z(e,o=""){return a({enabled:!!e,queryKey:["dashboard","conversations","code-repository",{repositoryId:e,search:o}],queryFn:({signal:t})=>{let n=new URLSearchParams({codeRepositoryId:e});return o&&n.set("q",o),r(d,`/api/conversations?${n.toString()}`,t)},placeholderData:i,retry:!1})}function ee(e,o){return a({enabled:e,queryKey:["dashboard","automations",o],queryFn:({signal:t})=>r(y,`/api/automations${o?`?${o}`:""}`,t),placeholderData:i,retry:!1})}function oe(e,o){return a({enabled:e&&!!o,queryKey:["dashboard","automations","detail",o],queryFn:({signal:t})=>r(l,`/api/automations/${encodeURIComponent(o)}`,t),retry:!1})}function re(e){return a({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:o})=>r(m,"/api/automations/runs",o),retry:!1})}function ae(e,o){return a({enabled:e&&!!o,queryKey:["dashboard","automations",o,"executions"],queryFn:({signal:t})=>r(f,`/api/automations/${encodeURIComponent(o)}/executions`,t),retry:!1})}function te(e,o){return a({enabled:e&&!!o,queryKey:["dashboard","automations",o,"versions"],queryFn:({signal:t})=>r(h,`/api/automations/${encodeURIComponent(o)}/versions`,t),retry:!1})}function ne(){return a({queryKey:["dashboard","people"],queryFn:({signal:e})=>r(v,"/api/people",e),retry:!1})}function se(e){return a({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:o})=>r(F,`/api/people/${encodeURIComponent(e)}`,o),retry:!1})}function ie(e){return a({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:o})=>r(p,`/api/people/${encodeURIComponent(e)}/plugin-reports`,o),retry:!1})}function ue(e){return a({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:o})=>r(g,`/api/people/${encodeURIComponent(e)}/code`,o),retry:!1})}function de(e){return a({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:o})=>r(_,"/api/people/me/spend",o),refetchInterval:w,retry:!1,staleTime:0})}function pe(){return a({queryKey:["dashboard","locations"],queryFn:({signal:e})=>r(P,"/api/locations",e),retry:!1})}function ce(e){return a({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:o})=>r(x,`/api/locations/${encodeURIComponent(e)}`,o),retry:!1})}function T(){return a({queryKey:["dashboard","skills"],queryFn:({signal:e})=>r(b,"/api/skills",e),retry:!1,staleTime:u})}function k(){return a({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>r(p,"/api/plugin-reports",e),retry:!1})}function le(){return a({queryKey:["dashboard","stats"],queryFn:({signal:e})=>r(K,"/api/stats",e),retry:!1})}function ye(e){let o=$(),t=a({queryKey:["dashboard","conversation-stats"],queryFn:({signal:O})=>r(R,"/api/conversations/stats",O),retry:!1}),n=T(),s=k();return{data:o.data&&n.data?{...e,conversationStatsError:!!t.error,...t.data?{conversationStats:t.data}:void 0,conversationStatsLoading:t.isPending,pluginReportsError:!!s.error,...s.data?{pluginReports:s.data}:void 0,pluginReportsLoading:s.isPending,plugins:o.data,skills:n.data}:void 0,error:o.error??n.error,isPending:o.isPending||n.isPending}}export{W as a,z as b,G as c,X as d,Y as e,Z as f,ee as g,oe as h,re as i,ae as j,te as k,ne as l,se as m,ie as n,ue as o,de as p,pe as q,ce as r,le as s,ye as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qa as o,b as l}from"./chunk-YPMUHXYT.js";import{c as r}from"./chunk-7SZRL6FY.js";var a=r(l(),1);function d({className:t,...e}){return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:o("w-full border-collapse text-left text-sm",t),...e})})}function n({className:t,...e}){return(0,a.jsx)("thead",{"data-slot":"table-header",className:o("[&_tr]:hover:bg-transparent",t),...e})}function b({className:t,...e}){return(0,a.jsx)("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",t),...e})}function p({className:t,...e}){return(0,a.jsx)("tfoot",{"data-slot":"table-footer",className:o("border-t border-dashboard-border font-medium [&>tr]:last:border-b-0",t),...e})}function c({className:t,...e}){return(0,a.jsx)("tr",{"data-slot":"table-row",className:o("border-b border-dashboard-border-subtle transition-colors hover:bg-dashboard-fill-soft has-aria-expanded:bg-dashboard-fill-soft data-[state=selected]:bg-dashboard-surface-active",t),...e})}function i({className:t,...e}){return(0,a.jsx)("th",{"data-slot":"table-head",className:o("px-2 py-2.5 text-left align-middle font-sans text-xs font-medium whitespace-nowrap text-dashboard-text-muted [&:has([role=checkbox])]:pr-0",t),...e})}function m({className:t,...e}){return(0,a.jsx)("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap text-dashboard-text [&:has([role=checkbox])]:pr-0",t),...e})}export{d as a,n as b,b as c,p as d,c as e,i as f,m as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-RHMZNAJX.js";import{d as v,o as L,p as k}from"./chunk-6PHJZPWD.js";import{Rc as f,a as N,b as x}from"./chunk-YPMUHXYT.js";import{c as b}from"./chunk-7SZRL6FY.js";var o=b(N(),1);var l=b(x(),1);function y(e){let{className:s,item:t}=e,i=v(),a=p(t.to,i.search);if(t.isActive){let r=t.isActive(i.pathname);return(0,l.jsx)(L,{"aria-current":r?"page":void 0,className:s({isActive:r}),to:a,children:t.label})}return(0,l.jsx)(k,{className:s,end:t.end,to:a,children:t.label})}var h=24;function S(e){let s=e.scrollWidth-e.clientWidth;return{end:e.scrollLeft<s-1,start:e.scrollLeft>1}}function E(e){let s=e.querySelector('[aria-current="page"]');if(!s||e.clientWidth===0)return;let t=S(e),i=e.scrollLeft+(t.start?h:0),a=e.scrollLeft+e.clientWidth-(t.end?h:0),r=s.offsetLeft,n=r+s.offsetWidth;r>=i&&n<=a||(e.scrollLeft=r-(e.clientWidth-s.offsetWidth)/2)}function W(e){if(!e.start&&!e.end)return;let s=`${h}px`,t=e.start?`transparent, black ${s}`:"black",i=e.end?`black calc(100% - ${s}), transparent`:"black",a=`linear-gradient(to right, ${t}, ${i})`;return{maskImage:a,WebkitMaskImage:a}}function M(e){let{pathname:s}=v(),t=(0,o.useRef)(null),[i,a]=(0,o.useState)({end:!1,start:!1});(0,o.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let c=()=>{let{end:d,start:g}=S(n);a(u=>u.start===g&&u.end===d?u:{end:d,start:g})},m=new ResizeObserver(()=>{n.scrollLeft=0,E(n),c()});c(),n.addEventListener("scroll",c,{passive:!0}),m.observe(n);for(let d of n.children)m.observe(d);return()=>{n.removeEventListener("scroll",c),m.disconnect()}},[]),(0,o.useLayoutEffect)(()=>{t.current&&E(t.current)},[s]);let r=({isActive:n})=>f("relative flex h-10 items-center justify-center whitespace-nowrap font-sans text-sm font-medium no-underline transition-colors after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-dashboard-focus",n?"text-dashboard-text after:bg-dashboard-text-solid":"text-dashboard-text-muted hover:text-dashboard-text",e.fill?"min-w-max flex-[1_0_0]":"shrink-0");return(0,l.jsx)("nav",{"aria-label":e.ariaLabel,className:f("flex min-w-0 max-w-full",!e.fill&&"w-fit"),children:(0,l.jsx)("div",{className:f("relative -mx-1 flex gap-5 px-1 min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"),ref:t,style:W(i),children:e.items.map(n=>(0,l.jsx)(y,{className:r,item:n},n.to))})})}export{y as a,M as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as Xe}from"./chunk-NQMDED2R.js";import{a as Oe,d as _,f as De,g as z,i as U,j as fe,l as ze,n as W,o as We,q as Ye,r as Q,s as Je}from"./chunk-GO45RQDL.js";import{$ as ke,A as pe,B as He,C as _e,Ca as Me,D as Ee,Da as Ve,E as ge,Ea as je,Fa as $e,I as Ne,P as Ue,aa as Be,ba as Ke,ca as Qe,ja as Fe,z as qe}from"./chunk-VXT3FIVL.js";import{a as ae}from"./chunk-YPMUHXYT.js";import{c as se}from"./chunk-7SZRL6FY.js";var k=se(ae(),1);function et(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}var Ge=(e,t)=>{let n=JSON.stringify(t);window.localStorage.setItem(e,n),et(e,n)},Tt=e=>{window.localStorage.removeItem(e),et(e,null)},Ze=e=>window.localStorage.getItem(e),Pt=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),Lt=()=>{throw Error("useLocalStorage is a client-only hook")};function tt(e,t){let o=k.useSyncExternalStore(Pt,()=>Ze(e),Lt),r=k.useCallback(s=>{try{let a=typeof s=="function"?s(JSON.parse(o)):s;a==null?Tt(e):Ge(e,a)}catch(a){console.warn(a)}},[e,o]);return k.useEffect(()=>{Ze(e)===null&&typeof t<"u"&&Ge(e,t)},[e,t]),[o?JSON.parse(o):t,r]}var B=se(ae(),1);var R=se(ae(),1);var me=se(ae(),1);var ee=["dashboard","review-items"],nt=6e4;function hn(e){let t=new URLSearchParams;e.conversationId&&t.set("conversationId",e.conversationId),e.forViewer&&t.set("for","viewer"),e.q&&t.set("q",e.q);let n=t.toString(),o=fe({initialPageParam:void 0,queryKey:[...ee,"list",n],queryFn:({pageParam:a,signal:l})=>{let d=new URLSearchParams(n);return a&&d.set("cursor",a),Q(Ve,`/api/review-items?${d.toString()}`,l)},getNextPageParam:a=>a.nextCursor,placeholderData:Oe,retry:!1}),r=o.data?.pages;return{items:(0,me.useMemo)(()=>(r??[]).flatMap(a=>a.items),[r]),moreArchived:!!r?.[0]?.moreArchived,query:o}}function bn(e){return z({enabled:!!e,queryKey:[...ee,"detail",e],queryFn:({signal:t})=>Q(Me,`/api/review-items/${encodeURIComponent(e)}`,t),retry:!1})}function Cn(e){return De({queries:e.map(t=>({queryKey:["dashboard","conversation-title",t],queryFn:async({signal:n})=>Xe(await Q(ge,`/api/conversations/${encodeURIComponent(t)}?limit=1`,n))??null,retry:!1,staleTime:5*6e4}))}).map(t=>t.data??void 0)}function wn(e){return z({enabled:e,queryKey:[...ee,"count"],queryFn:({signal:t})=>Q(je,"/api/review-items/count",t),refetchInterval:nt,retry:!1})}function Sn(e){return z({enabled:e,queryKey:["dashboard","automations","scope=mine&state=blocked"],queryFn:({signal:t})=>Q(Ue,"/api/automations?scope=mine&state=blocked&pageSize=100",t),retry:!1})}function Rn(){let e=_();return U({mutationFn:t=>W(Me,`/api/review-items/${encodeURIComponent(t.id)}/actions`,t.body),onSettled:()=>e.invalidateQueries({queryKey:ee})})}var It=new Map;function At(){let t=z({queryKey:[...ee,"waiting-conversations"],queryFn:({signal:n})=>Q($e,"/api/review-items/waiting-conversations",n),refetchInterval:nt,retry:!1}).data?.conversations;return(0,me.useMemo)(()=>t?new Map(t.map(({conversationId:n,count:o,title:r})=>[n,{count:o,title:r}])):It,[t])}function En(){let e=At();return(0,me.useMemo)(()=>new Set(e.keys()),[e])}function ve(e){let t=e.getQueryData(["dashboard","core"])?.me.user;if(t?.email)return{...t.avatarUrl?{avatarUrl:t.avatarUrl}:void 0,email:t.email,fullName:t.name||void 0}}function J(e){return["conversation",e,"outbox"]}function ye(e){let t=e.now??new Date().toISOString();return{actorIdentity:e.actorIdentity,createdAt:t,idempotencyKey:e.idempotencyKey,...e.inline?{inline:!0}:void 0,message:e.message,...e.images?.length?{images:e.images}:void 0,messageId:e.messageId,status:"sending"}}function ot(e){return{actorIdentity:e.actorIdentity,clientStatus:e.status,createdAt:e.createdAt,delivery:"defer",idempotencyKey:e.idempotencyKey,inboundMessageId:e.messageId,messageId:e.messageId,receivedAt:e.createdAt,role:"user",source:"web",text:e.message,...e.images?.length?{images:e.images}:void 0}}function rt(e,t,n){let o=e??[],r=t??[],s=o;if(r.length>0){let a=new Set(o.map(d=>d.messageId)),l=r.filter(d=>!a.has(d.messageId)).map(ot);l.length>0&&(s=[...o,...l])}return he(n,s)}function he(e,t){if(!e)return t;if(e===t)return e;if(e.length!==t.length)return t;for(let n=0;n<e.length;n+=1)if(!Ot(e[n],t[n]))return t;return e}function Ot(e,t){return e.inboundMessageId===t.inboundMessageId&&e.messageId===t.messageId&&e.clientStatus===t.clientStatus&&e.delivery===t.delivery&&e.text===t.text&&e.images===t.images&&JSON.stringify(e.attachments)===JSON.stringify(t.attachments)&&e.redacted===t.redacted&&e.source===t.source&&e.role===t.role&&e.createdAt===t.createdAt&&e.receivedAt===t.receivedAt&&e.idempotencyKey===t.idempotencyKey&&st(e.actorIdentity,t.actorIdentity)&&Dt(e.mentions,t.mentions)}function Dt(e,t){return e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,o)=>st(n,t[o]))}function st(e,t){return e===t?!0:!e||!t?!1:e.avatarUrl===t.avatarUrl&&e.email===t.email&&e.fullName===t.fullName&&e.slackUserId===t.slackUserId&&e.slackUserName===t.slackUserName}function xe(e){return!!e.inline&&e.status!=="failed"}function at(e,t,n){let o=n.filter(xe);if(o.length===0)return{inline:[],queued:e};let r=new Set(o.map(a=>a.messageId)),s=new Map((t??[]).map(a=>[a.messageId,a]));return{inline:o.map(a=>s.get(a.messageId)??ot(a)),queued:e.filter(a=>!r.has(a.messageId))}}function be(e,t){let n=e??[],o=n.findIndex(s=>s.idempotencyKey===t.idempotencyKey);if(o<0)return[...n,t];let r=n.slice();return r[o]=t,r}function it(e,t,n){return(e??[]).map(o=>o.idempotencyKey===t?{...o,messageId:n,status:"accepted"}:o)}function ut(e,t){return(e??[]).map(n=>n.idempotencyKey===t?{...n,status:"failed"}:n)}function Te(e,t){let n=vt(e,t);return n||(t.length===0?e:{...e,events:mt([...t.flatMap(o=>o.events),...e.events]),previousCursor:Ce(e.previousCursor,t)??(t.length?Pe(t):e.previousCursor)})}function Tn(e,t,n){let o=vt(e,t);return o||{...e,events:mt([...t.flatMap(r=>r.events),...n]),previousCursor:Pe(t)}}async function lt(e){let t=new Map(e.historyPages.map(s=>[s.requestedBefore,s])),n=[],o=new Set,r=e.detail.previousCursor;for(;r;){if(o.has(r))throw new Error("Conversation history cursor did not advance");o.add(r);let s=t.get(r)??{...await e.readPage(r),requestedBefore:r};n.push(s),r=s.previousCursor}return Te(e.detail,n)}function dt(e){let t=gt(e);return t===void 0?"empty":String(t)}function ft(e,t){return Ce(e,t)??Pe(t)}function Ce(e,t){if(!e)return;let n=new Map(t.map(a=>[a.requestedBefore,a])),o=new Set,r=new Set,s=e;for(;s;){if(r.has(s))return;r.add(s);let a=n.get(s);if(!a)return o.size>0&&o.size===t.length?void 0:s;o.add(a);let l=gt(o),d=qt(t.filter(M=>!o.has(M)));if(l!==void 0&&d!==void 0&&l<=d+1)return;s=a.previousCursor}}function pt(e,t){return t.some(n=>n.eventHistory.status!==e.eventHistory.status)}function gt(e){let t;for(let n of e){let o=n.events[0]?.seq;o!==void 0&&(t===void 0||o<t)&&(t=o)}return t}function qt(e){let t;for(let n of e){let o=n.events.at(-1)?.seq;o!==void 0&&(t===void 0||o>t)&&(t=o)}return t}function Pe(e){let t;for(let n of e){let o=n.events[0]?.seq,r=t?.events[0]?.seq;o!==void 0&&(r===void 0||o<r)&&(t=n)}return t?.previousCursor}function mt(e){return[...new Map(e.map(t=>[t.seq,t])).values()].sort((t,n)=>t.seq-n.seq)}function vt(e,t){if(e.eventHistory.status!=="available")return ct(e);let n=t.find(o=>o.eventHistory.status!=="available");if(n)return ct({...e,eventHistory:n.eventHistory,events:n.events,previousCursor:n.previousCursor})}function ct(e){let{modelUsage:t,...n}=e;return n}function yt(e,t){if(!e)return t;let n=Ht(e.events,t.events)?e.events:t.events,o=JSON.stringify(e.annotations)===JSON.stringify(t.annotations)?e.annotations:t.annotations,r=JSON.stringify(e.authors)===JSON.stringify(t.authors)?e.authors:t.authors;return n===t.events&&o===t.annotations&&r===t.authors?t:{...t,events:n,annotations:o,authors:r}}function Ht(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let o=e[n],r=t[n];if(o.seq!==r.seq||o.createdAt!==r.createdAt||o.data.type==="message"&&r.data.type==="message"&&JSON.stringify(o.data.attachments)!==JSON.stringify(r.data.attachments))return!1}return!0}function Pn(e){if(e?.status!=="active")return!1;for(let t=e.events.length-1;t>=0;t-=1){let n=e.events[t].data;if(n.type==="turn_lifecycle")return n.state==="started"}return!!e.previousCursor}function E(e){return["conversation",e,"detail"]}var _t=500,Nt=6e3,Ut=3e4;function kt(e,t){let n=E(t),o=e.getQueryState(n);if(!o?.data?.prefetchedAtMs)return;let{prefetchedAtMs:r,...s}=o.data;e.setQueryData(n,s,{updatedAt:o.dataUpdatedAt})}function Bt(e){return!!(e?.prefetchedAtMs&&Date.now()-e.prefetchedAtMs<Ut)}async function Kt(e,t,n,o){if(!n)return ht(e,t,void 0,{mailbox:!0,unreadPage:o});let r=await zt(e,t);return{...await ht(e,t,n,{unreadPage:o}),mailbox:r}}var Qt=["agents","memories","watches"];function Ft(e,t){return["conversation",e,t]}function Vt(e,t,n,o){if(!(!n?.detailEtag||!o.detailEtag||n.detailEtag===o.detailEtag)){for(let r of Qt)e.invalidateQueries({queryKey:Ft(t,r)});e.invalidateQueries({queryKey:ee})}}function jt(e,t){return{enabled:!!e,queryKey:E(e),queryFn:async({signal:n,client:o})=>{let r=o.getQueryData(E(e)),s=await Kt(e,n,r,t?.unreadPage);return Vt(o,e,r,s),s},structuralSharing:(n,o)=>!o||typeof o!="object"||!n||typeof n!="object"?o:$t(n,yt(n,o)),refetchInterval:n=>t?.fastPollUntilMs&&Date.now()<t.fastPollUntilMs?_t:t?.awaitingMessage||n.state.data?.status==="active"||n.state.data?.mailbox?.messages.length||n.state.data?.mailbox?.authorization?2e3:1e4,retry:!1}}function $t(e,t){let n=e.readPosition;if(!n||(t.readPosition?.lastReadSeq??-1)>=n.lastReadSeq)return t;let{unreadCursor:o,unreadPage:r,...s}=t;return{...s,readPosition:n,...e.unreadCursor?{unreadCursor:e.unreadCursor,unreadPage:e.unreadPage}:void 0}}function Nn(){let e=_();return U({mutationFn:t=>W(pe,"/api/conversations",t),onSuccess:(t,n)=>{e.setQueryData(J(t.conversationId),o=>be(o,{...ye({...n,actorIdentity:ve(e),inline:!0,messageId:t.messageId}),status:"accepted"})),e.invalidateQueries({queryKey:["dashboard","conversations"]}),e.invalidateQueries({exact:!0,queryKey:E(t.conversationId)})}})}function Un(e){let t=_();return U({mutationFn:async n=>{let o=await W(He,`/api/conversations/${encodeURIComponent(e)}/forks`,{messageId:n.messageId,idempotencyKey:n.idempotencyKey});return W(pe,`/api/conversations/${encodeURIComponent(o.conversationId)}/messages`,{idempotencyKey:n.idempotencyKey,message:n.message})},onSuccess:(n,o)=>{t.setQueryData(J(n.conversationId),r=>be(r,{...ye({idempotencyKey:o.idempotencyKey,message:o.message,actorIdentity:ve(t),inline:!0,messageId:n.messageId}),status:"accepted"})),t.invalidateQueries({queryKey:["dashboard","conversations"]})}})}function kn(e){let t=_(),n=J(e);return U({mutationFn:({inline:o,...r})=>W(pe,`/api/conversations/${encodeURIComponent(e)}/messages`,r),onMutate:async o=>{let r=await Ne({conversationId:e,idempotencyKey:o.idempotencyKey}),s=ye({...o,actorIdentity:ve(t),messageId:r});t.setQueryData(n,a=>be(a,s))},onError:(o,r)=>{t.setQueryData(n,s=>ut(s,r.idempotencyKey))},onSuccess:(o,r)=>{t.setQueryData(n,s=>it(s,r.idempotencyKey,o.messageId)),t.invalidateQueries({queryKey:["dashboard","conversations"]}),t.invalidateQueries({exact:!0,queryKey:E(e)})}})}function Bn(e){let t=_();return U({mutationFn:n=>Ye(Ke,`/api/conversations/${encodeURIComponent(e)}/pending-messages`,n),onMutate:async n=>{await t.cancelQueries({exact:!0,queryKey:E(e)});let o=t.getQueryData(E(e));return o?.mailbox&&t.setQueryData(E(e),{...o,mailbox:{...o.mailbox,messages:o.mailbox.messages.filter(r=>!n.inboundMessageIds.includes(r.inboundMessageId))}}),{previousPending:o}},onError:(n,o,r)=>{r?.previousPending&&t.setQueryData(E(e),s=>s&&{...s,mailbox:r.previousPending?.mailbox})},onSettled:async()=>{await Promise.all([t.invalidateQueries({queryKey:["dashboard","conversations"]}),t.invalidateQueries({exact:!0,queryKey:E(e)})])}})}function Kn(e){let t=_();return U({mutationFn:n=>W(Qe,`/api/conversations/${encodeURIComponent(e)}/pending-messages/steer`,n),onSuccess:async n=>{let o=new Set(n.steeredInboundMessageIds);o.size!==0&&(await t.cancelQueries({exact:!0,queryKey:E(e)}),t.setQueryData(E(e),r=>r?.mailbox?{...r,mailbox:{...r.mailbox,messages:r.mailbox.messages.map(s=>o.has(s.inboundMessageId)?{...s,delivery:"interrupt"}:s)}}:r))},onSettled:async()=>{await t.invalidateQueries({exact:!0,queryKey:E(e)})}})}function Le(e){return["conversation",e,"stopped-messages"]}function Qn(e){let t=_();return U({mutationFn:()=>W(Fe,`/api/conversations/${encodeURIComponent(e)}/stop`,{}),onSuccess:n=>{let o=n.stoppedInboundMessageIds;o.length&&(t.setQueryData(Le(e),r=>[...r??[],...o]),t.setQueryData(J(e),r=>r?.filter(s=>!o.includes(s.messageId))))},onSettled:async()=>{await t.invalidateQueries({exact:!0,queryKey:E(e)})}})}function Fn(e,t){let n=_(),o=()=>{let g=Bt(n.getQueryData(E(e)));return{conversationId:e,fetched:g,prefetched:g}},[r,s]=(0,R.useState)(o);r.conversationId!==e&&s(o());let a=r.conversationId===e&&r.fetched,l=r.conversationId===e&&r.prefetched,d=z({enabled:!!e,queryFn:async()=>n.getQueryData(J(e))??[],queryKey:J(e),initialData:[],staleTime:1/0,gcTime:1/0}),M=z({enabled:!!e,queryFn:async()=>n.getQueryData(Le(e))??[],queryKey:Le(e),initialData:[],staleTime:1/0,gcTime:1/0}),K=d.data.filter(g=>g.status!=="failed"),F=Math.max(0,...K.map(g=>Date.parse(g.createdAt))),b=z({...jt(e,{awaitingMessage:K.length>0,fastPollUntilMs:F?F+Nt:void 0,unreadPage:!!t?.unreadPageAtOpen&&!a})}),q=b.refetch;(0,R.useEffect)(()=>{if(e)return q({cancelRefetch:!1}),()=>kt(n,e)},[e,n,q]),!a&&b.isFetchedAfterMount&&!b.isFetching&&s({conversationId:e,fetched:!0,prefetched:l});let V=(0,R.useDeferredValue)(b.data),v=V&&V.conversationId===e?V:b.data,x=v?.mailbox;(0,R.useEffect)(()=>{if(!x||!v)return;let g=new Set(x.messages.map(y=>y.messageId)),S=new Set;for(let y of v.events)y.data.type==="message"&&S.add(y.data.messageId);n.setQueryData(J(e),y=>{let $=y?.filter(P=>!S.has(P.messageId)&&(xe(P)||!g.has(P.messageId)));return $?.length===y?.length?y:$})},[e,v,x,d.data,n]);let j=b.data?.displayTitle,m=b.dataUpdatedAt;(0,R.useEffect)(()=>{if(!e||!j)return;let g=n.getQueryCache().findAll({queryKey:["dashboard","conversations"]});for(let S of g){let y=S.state.data;!y||S.state.dataUpdatedAt>m||!y.conversations.some(P=>P.conversationId===e&&P.displayTitle!==j)||n.setQueryData(S.queryKey,{...y,conversations:y.conversations.map(P=>P.conversationId===e?{...P,displayTitle:j}:P)})}},[e,m,j,n]);let h=v?.eventHistory.status,T=(0,R.useMemo)(()=>["conversation",e,"history",h],[e,h]),p=fe({enabled:!1,queryKey:T,queryFn:async({pageParam:g,signal:S})=>({...await bt(e,g,S),requestedBefore:g}),initialPageParam:v?.previousCursor??"",getNextPageParam:(g,S)=>ft(v?.previousCursor,S),retry:!1}),X=p.data?.pages,ce=(0,R.useMemo)(()=>v?Te(v,X??[]):void 0,[v,X]),I=(0,R.useRef)(void 0),le=(0,R.useRef)(void 0),{inlineMessages:de,pendingMessages:Y}=(0,R.useMemo)(()=>{let g=M.data,S=g.length?x?.messages.filter(i=>!g.includes(i.inboundMessageId)):x?.messages,y=g.length?d.data.filter(i=>!g.includes(i.messageId)):d.data,$=at(rt(S,y),S,y),P=he(I.current,$.queued),c=he(le.current,$.inline);return I.current=P,le.current=c,{inlineMessages:c,pendingMessages:P}},[d.data,x?.messages,M.data]),f=Wt(p.error),H=!!(v&&(pt(v,X??[])||f)),te=f?null:p.error,G=!!(v?.previousCursor&&p.data&&Ce(v.previousCursor,p.data.pages)&&!H&&!p.error&&!p.isFetchingNextPage),Z=p.isFetchingNextPage||G;(0,R.useEffect)(()=>{H&&q()},[q,H]),(0,R.useEffect)(()=>{f&&n.resetQueries({exact:!0,queryKey:T})},[T,f,n]);let N=p.fetchNextPage;return(0,R.useEffect)(()=>{G&&N({cancelRefetch:!1})},[N,G]),{data:ce,latest:b.data,error:b.error,historyError:te,historyVersion:dt(X??[]),hasPreviousPage:p.data?p.hasNextPage:!!v?.previousCursor,isPending:b.isPending,fetchedAtOpen:a,fetchedDetail:l||b.isFetchedAfterMount&&!b.isFetching?b.data:void 0,isLoadingPreviousPage:Z,pendingAuthorization:x?.authorization,pendingGeneratedAt:x?.generatedAt,inlineMessages:de,pendingMessages:Y,loadCompleteTranscript:()=>{if(!e||!v)throw new Error("Cannot load a conversation without an id");return lt({detail:v,historyPages:p.data?.pages??[],readPage:g=>bt(e,g)})},loadPreviousPage:()=>{let g=p.data?p.hasNextPage:!!v?.previousCursor;e&&g&&p.fetchNextPage({cancelRefetch:!1})}}}async function ht(e,t,n,o){let r=new URLSearchParams;o?.unreadPage&&r.set("unreadPage","true"),o?.mailbox&&r.set("mailbox","true");let s=r.size?`?${r}`:"",a=await Je(`/api/conversations/${encodeURIComponent(e)}${s}`,t,n?.detailEtag?{[Ee]:n.detailEtag}:void 0);return a.status===304&&n?n:{...(o?.mailbox?Be:ge).parse(await a.json()),detailEtag:a.headers.get(Ee)??void 0}}function zt(e,t){return Q(ke,`/api/conversations/${encodeURIComponent(e)}/pending-messages`,t)}function bt(e,t,n){let o=new URLSearchParams({before:t});return Q(_e,`/api/conversations/${encodeURIComponent(e)}/events?${o}`,n).then(r=>{if(r.previousCursor===t)throw new Error("Conversation history cursor did not advance");return r})}function Wt(e){return e instanceof ze&&e.status===400}var u=se(ae(),1);var we="data-scroll-anchor";function Yt(e,t,n){let o=0,r=e;for(;o<r;){let s=o+r>>1;t(s).bottom<=n.top?o=s+1:r=s}return o>=e?null:t(o).top>=n.top?o:o+1<e&&t(o+1).top<n.bottom?o+1:o}function Ct(e,t){let n=e.querySelectorAll(`[${we}]`),o=new Map,r=l=>{let d=o.get(l);return d||(d=n[l].getBoundingClientRect(),o.set(l,d)),d},s=Yt(n.length,r,t);if(s===null)return null;let a=n[s];return{element:a,key:a.getAttribute(we)??"",offset:r(s).top-t.top}}function wt(e,t,n){let o=n.element.isConnected?n.element:Jt(e,n.key);return o?o.getBoundingClientRect().top-t.top-n.offset:null}function Jt(e,t){for(let n of e.querySelectorAll(`[${we}]`))if(n.getAttribute(we)===t)return n;return null}var Xt=96,St=600,Rt=2,Gt=48,Ae="data-transcript-pin-start",Zt=16;function zn(e){return{[Ae]:e}}var ie=typeof window>"u"?u.useEffect:u.useLayoutEffect;function ue(e,t=Xt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function Wn(e){if(!e)return"empty";for(let t=e.events.length-1;t>=0;t-=1){let n=e.events[t],o=n.data;if(o.type==="message"&&o.role==="assistant")return[n.seq,n.createdAt,o.messageId,o.redacted?"redacted":o.text?.length??0].join(":");if(o.type==="assistant_message"&&o.parts.length>0){let r=o.parts.at(-1);return[n.seq,n.createdAt,o.parts.length,r?.redacted?"redacted":r?.text?.length??0].join(":")}}return"empty"}function Yn(e,t="rich"){if(!e)return"empty";let n;for(let o=e.events.length-1;o>=0;o-=1){let r=e.events[o];if(!(t==="rich"&&!en(r))){n=r;break}}return[e.conversationId,e.status,n?.seq??"",n?.createdAt??"",tn(n)].join("|")}function en(e){let t=e.data;return t.type==="turn_lifecycle"?t.state==="failed":t.type==="message"||t.type==="assistant_message"&&t.parts.length>0||t.type==="tool_calls"||t.type==="subagent"||t.type==="structured_event"||t.type==="attachments_delivered"||t.type==="compaction"}function tn(e){if(!e)return"";let t=e.data;switch(t.type){case"message":return[t.type,t.role,t.messageId,t.redacted?"redacted":t.text?.length??0,t.eventType??""].join(":");case"assistant_message":{let n=t.parts,o=n.at(-1);return[t.type,n.length,o?.redacted?"redacted":o?.text?.length??0].join(":")}case"tool_calls":{let n=t.calls.at(-1);return[t.type,t.calls.length,n?.toolCallId??"",n?.name??"",n?.status??"",n?.output===void 0?"":"output"].join(":")}case"subagent":return[t.type,t.childConversationId,t.status,t.subagentKind,t.parentToolCallId??""].join(":");case"turn_lifecycle":return[t.type,t.turnId,t.state,"failureCode"in t?t.failureCode:"","failureReason"in t?t.failureReason??"":""].join(":");case"structured_event":return[t.type,t.namespace,t.name,t.version,t.presentation.title,t.presentation.preview?.length??0].join(":");case"message_handled":return[t.type,t.messageId].join(":");case"attachments_delivered":return[t.type,t.attachments.length,...t.attachments.map(n=>`${n.id}:${n.filename}:${n.bytes}`)].join(":");case"compaction":return[t.type,t.summary?.length??0,e.createdAt].join(":");case"guardian_action_reviewed":return[t.type,t.turnId,t.toolCallId,t.decision].join(":");case"turn_context":return[t.type,t.turnId,t.pluginName,t.kind,t.version].join(":");default:return`${t.type??"unknown"}:${e.seq}`}}function nn(e){return e.enabled&&e.following}function on(e){if(e.enabled)return{pending:!1,pin:!1};let t=e.pending||e.wasEnabled&&!e.enabled&&e.following;return t&&e.juniorMessageChanged?{pending:!1,pin:!0}:{pending:t,pin:!1}}function rn(e){return!e.following&&(e.endsAtLatest===!1||!!e.openedAtUnread||e.enabled&&e.hasPendingUpdate)}function sn(e){return e.source==="scroll"&&e.previousScrollTop!=null&&e.snapshot.scrollTop<e.previousScrollTop-Rt?"pause":e.source==="scroll"&&ue(e.snapshot)?"follow":"preserve"}function an(e){return e.intent==="pause"&&!ue(e.snapshot)?"pause":"ignore"}function Jn(e){let t=(0,u.useRef)(null),n=(0,u.useRef)(null),o=(0,u.useRef)(e.enabled),r=(0,u.useRef)(!0);r.current=e.endsAtLatest??!0;let s=(0,u.useRef)(!1),a=(0,u.useRef)(!1),l=(0,u.useRef)(null),d=(0,u.useRef)(null),M=(0,u.useRef)(null),K=(0,u.useRef)(null),F=(0,u.useRef)(e.pinRequestVersion??0),b=(0,u.useRef)(e.juniorMessageVersion),q=(0,u.useRef)(e.enabled),V=(0,u.useRef)(!1),v=(0,u.useRef)(e.versions),x=(0,u.useRef)(0),j=(0,u.useRef)(new Set),[m,h]=(0,u.useState)(!1),[T,p]=(0,u.useState)(!1),[X,ce]=(0,u.useState)(!1),[I,le]=(0,u.useState)(null),de=(0,u.useCallback)(c=>{n.current=c,le(c)},[]);(0,u.useEffect)(()=>{o.current=e.enabled,e.enabled||p(!1)},[e.enabled]);let Y=(0,u.useRef)(!1),f=(0,u.useCallback)(c=>{s.current=c,h(c),c?ce(!1):Y.current=!1},[]),H=(0,u.useCallback)(()=>{let c=n.current,i=D(c);!c||!i||(K.current=Ct(c,Ie(i)))},[]),te=(0,u.useCallback)(()=>{let c=n.current,i=D(c),C=K.current;if(!c||!i)return;let L=C?wt(c,Ie(i),C):null;if(L!==null&&Math.abs(L)>=1){let w=O(i).scrollTop+L;Se(i,w);let A=O(i).scrollTop;d.current=A,M.current=A}H()},[H]),G=(0,u.useCallback)(()=>{if(!s.current)return;let c=D(n.current);!c||O(c).scrollTop<=0||(x.current=0,f(!1))},[f]),Z=(0,u.useCallback)(c=>{let i=D(n.current);if(!i)return;c==="scroll"&&H();let C=O(i),L=d.current;if(d.current=C.scrollTop,c==="scroll"){let A=M.current;if(M.current=null,A!==null&&Math.abs(C.scrollTop-A)<1)return}let w=sn({previousScrollTop:L,snapshot:C,source:c});if(c==="scroll"&&x.current>0){an({intent:w,snapshot:C})==="pause"&&(x.current=0,f(!1));return}if(w==="follow"){if(!r.current)return;f(!0),p(!1);return}w==="pause"&&f(!1)},[H,f]),N=(0,u.useCallback)(c=>{let i=D(n.current);if(!i)return;let C=un(i,n.current,j.current);C!==null&&f(!1);let L=C!==null||s.current,w=L?++x.current:0;Se(i,C??O(i).scrollHeight,c);let A=()=>{if(L&&x.current!==w)return;L&&(x.current=0);let oe=O(i);d.current=oe.scrollTop,o.current&&s.current&&ue(oe)&&(f(!0),p(!1))};if(c==="smooth"){window.setTimeout(A,400);return}requestAnimationFrame(()=>{requestAnimationFrame(A)})},[f]),g=(0,u.useCallback)(()=>{let c=n.current,i=D(c),C=c?.querySelector("[data-transcript-unread-marker]");if(!i||!C)return!1;Y.current=!1;let L=C.getBoundingClientRect().top-Ie(i).top;Se(i,Math.max(0,O(i).scrollTop+L-Gt));let w=O(i);d.current=w.scrollTop;let A=r.current&&ue(w);return f(A),ce(!A),H(),!0},[H,f]);ie(()=>{if(!I||!e.conversationId)return;let c=`${e.conversationId}:${e.startAtLink?"link":"start"}`;if(l.current===c)return;let i=D(I);if(i){if(l.current=c,p(!1),e.startAtLink){d.current=O(i).scrollTop,f(!1);return}e.startAtUnread&&g()||(Se(i,O(i).scrollHeight),d.current=O(i).scrollTop,f(!0),Y.current=!!e.startAtUnread)}},[I,e.conversationId,e.startAtLink,e.startAtUnread,g,f]);let S=(0,u.useCallback)(()=>{if(!(Y.current&&g())){if(!r.current){f(!1),te();return}N("auto")}},[g,te,N,f]),y=(0,u.useCallback)(()=>{if(s.current){S();return}te(),Z("measure")},[S,Z,te]);ie(()=>{y()},[e.historyVersion,y]),ie(()=>{let c=v.current[e.view]!==e.versions[e.view];v.current=e.versions;let i=o.current;if(a.current&&!c&&i===e.enabled)return;let C=e.enabled||i;if(o.current=e.enabled,!C)return;let L=a.current;if(a.current||(a.current=!0),e.enabled&&!i){let w=D(n.current);w&&f(ue(O(w)))}if(nn({enabled:e.enabled,following:s.current})){S(),p(!1);return}e.enabled&&L&&p(!0)},[e.enabled,e.view,e.versions.rich,e.versions.raw,S,f]),(0,u.useEffect)(()=>{if(typeof window>"u"||!I)return;let c=D(I);if(!c)return;let i=c,C=()=>Z("scroll"),L=re=>{re.deltaY<0&&G()},w=null,A=re=>{w=re.touches[0]?.clientY??null},oe=re=>{let Re=re.touches[0]?.clientY;Re===void 0||w===null||(Re>w+Rt&&G(),w=Math.min(w,Re))};return Z("measure"),H(),i.addEventListener("scroll",C,{passive:!0}),i.addEventListener("wheel",L,{passive:!0}),i.addEventListener("touchstart",A,{passive:!0}),i.addEventListener("touchmove",oe,{passive:!0}),window.addEventListener("resize",y),()=>{i.removeEventListener("scroll",C),i.removeEventListener("wheel",L),i.removeEventListener("touchstart",A),i.removeEventListener("touchmove",oe),window.removeEventListener("resize",y)}},[I,G,Z,H,y]),(0,u.useEffect)(()=>{if(typeof ResizeObserver>"u"||!I)return;let c=new ResizeObserver(()=>{y()});c.observe(I);let i=D(I);return i&&!ne(i)&&c.observe(i),()=>c.disconnect()},[I,y]);let $=(0,u.useCallback)(()=>{Y.current=!1,f(!0),p(!1),N(cn())},[N,f]);ie(()=>{let c=b.current!==e.juniorMessageVersion;b.current=e.juniorMessageVersion;let i=on({enabled:e.enabled,following:s.current,juniorMessageChanged:c,pending:V.current,wasEnabled:q.current});q.current=e.enabled,V.current=i.pending,i.pin&&(f(!0),p(!1),N("auto"))},[e.enabled,e.juniorMessageVersion,N,f]),ie(()=>{let c=e.pinRequestVersion??0;c!==F.current&&(F.current=c,Y.current=!1,f(!0),p(!1),N("auto"))},[e.pinRequestVersion,N,f]);let P=(0,u.useCallback)(()=>K.current?.key,[]);return(0,u.useMemo)(()=>({anchorRef:t,contentElement:I,contentRef:de,hasPendingUpdate:T,jumpToBottom:$,scrollAnchorKey:P,showJumpToLatest:rn({enabled:e.enabled,endsAtLatest:e.endsAtLatest,following:m,hasPendingUpdate:T,openedAtUnread:X})}),[I,de,m,T,e.enabled,e.endsAtLatest,$,X,P])}var Xn=(0,u.createContext)(void 0);function Gn(e){let[t,n]=(0,u.useState)(null),o=(0,u.useRef)(e.onLoad);return o.current=e.onLoad,(0,u.useEffect)(()=>{if(!e.enabled||!t||typeof IntersectionObserver>"u")return;let r=D(t),s=new IntersectionObserver(a=>{a.some(l=>l.isIntersecting)&&(s.disconnect(),o.current())},{root:r&&!ne(r)?r:null,rootMargin:e.edge==="top"?`${St}px 0px 0px 0px`:`0px 0px ${St}px 0px`});return s.observe(t),()=>s.disconnect()},[e.edge,e.enabled,e.historyVersion,t]),n}function D(e){if(typeof window>"u")return null;if(!e)return window;let t=e.parentElement;for(;t&&t!==document.body;){let n=window.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n.overflowY))return t;t=t.parentElement}return window}function un(e,t,n){let o=t?Array.from(t.querySelectorAll(`[${Ae}]`)).at(-1):void 0,r=o?.getAttribute(Ae);if(!o||!r||n.has(r))return null;let s=o.getBoundingClientRect();if(s.height===0)return null;n.add(r);let a=O(e),l=a.scrollTop-(ne(e)?0:e.getBoundingClientRect().top),d=s.top+l-Zt,M=a.scrollHeight-a.clientHeight;return d>=M||s.bottom+l<=M?null:Math.max(0,d)}function O(e){if(ne(e)){let t=document.scrollingElement??document.documentElement;return{clientHeight:window.innerHeight,scrollHeight:t.scrollHeight,scrollTop:window.scrollY||t.scrollTop}}return{clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,scrollTop:e.scrollTop}}function Se(e,t,n="auto"){if(ne(e)){window.scrollTo({behavior:n,top:t});return}e.scrollTo({behavior:n,top:t})}function Ie(e){if(ne(e))return{bottom:window.innerHeight,top:0};let t=e.getBoundingClientRect().top;return{bottom:t+e.clientHeight,top:t}}function ne(e){return e===window}function cn(){return typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}var ln=750,Mt="data-transcript-seq",Et=`[${Mt}]`,xt="junior:conversation:start-position";function ao(){return tt(xt,"unread")}function io(){if(typeof window>"u")return"unread";try{let e=window.localStorage.getItem(xt);return e&&JSON.parse(e)==="latest"?"latest":"unread"}catch{return"unread"}}function uo(e,t){let[n,o]=(0,B.useState)(),[r,s]=(0,B.useState)(),a=n??(e?{lastReadSeq:e.readPosition?.lastReadSeq}:void 0);!n&&a&&o(a);let l=r??(t?{throughSeq:t.events.at(-1)?.seq,unreadCursor:t.unreadCursor,unreadPage:t.unreadPage}:void 0);return!r&&l&&s(l),{...dn(a?.lastReadSeq,l?l.throughSeq:e?.events.at(-1)?.seq),...l?.unreadCursor?{unreadCursor:l.unreadCursor,unreadPage:l.unreadPage}:void 0}}function dn(e,t){return e===void 0?{}:t===void 0||t<=e?{lastReadSeq:e}:{lastReadSeq:e,unread:{afterSeq:e,throughSeq:t}}}function fn(e,t){let n=e.events[0]?.seq;if(!e.unreadCursor||n!==void 0&&t.lastReadSeq+1<n)return{...e,readPosition:t};let{unreadCursor:o,unreadPage:r,...s}=e;return{...s,readPosition:t}}function co(e){let t=_(),{mutate:n}=U({mutationFn:o=>We(qe,`/api/conversations/${encodeURIComponent(e)}/read-position`,{lastReadSeq:o}),onSuccess:o=>{t.setQueryData(E(e),r=>r&&fn(r,o))}});return(0,B.useCallback)(o=>{let r=t.getQueryData(E(e))?.readPosition?.lastReadSeq;r!==void 0&&o<=r||n(o)},[e,n,t])}function lo(e){let t=(0,B.useRef)(e.onRead);t.current=e.onRead;let n=(0,B.useRef)(e.paused);n.current=e.paused;let o=(0,B.useRef)(e.lastReadSeq??-1),r=!!e.onRead;(0,B.useEffect)(()=>{let s=e.content,a=D(s);if(!r||!s||!a||typeof IntersectionObserver>"u")return;let l=new Set,d,M=null,K=()=>{d!==void 0&&window.clearTimeout(d),d=void 0;let m=M;M=null,!(m===null||m<=o.current)&&(o.current=m,t.current?.(m))},F=()=>{if(!(n.current||document.visibilityState!=="visible")){for(let m of l){let h=Number(m.dataset.transcriptSeq);Number.isSafeInteger(h)&&(M=Math.max(M??-1,h))}M!==null&&(d??=window.setTimeout(K,ln))}},b=()=>{document.visibilityState==="visible"?F():K()},q=new IntersectionObserver(m=>{for(let h of m){let T=h.target;h.isIntersecting&&T.isConnected?l.add(T):l.delete(T)}F()},{root:a===window?null:a}),V=m=>{if(!(m instanceof HTMLElement))return[];let h=[...m.querySelectorAll(Et)];return m.matches(Et)?[m,...h]:h},v=m=>{for(let h of V(m))q.observe(h)},x=m=>{for(let h of V(m))q.unobserve(h),l.delete(h)},j=new MutationObserver(m=>{let h=!1;for(let T of m)if(T.addedNodes.forEach(v),T.removedNodes.forEach(x),T.type==="attributes"){let p=T.target;q.observe(p),h||=l.has(p)}h&&F()});return j.observe(s,{attributeFilter:[Mt],childList:!0,subtree:!0}),v(s),document.addEventListener("visibilitychange",b),()=>{K(),q.disconnect(),j.disconnect(),document.removeEventListener("visibilitychange",b)}},[r,e.content])}export{hn as a,bn as b,Cn as c,wn as d,Sn as e,Rn as f,At as g,En as h,Tn as i,dt as j,Pn as k,E as l,Ft as m,Vt as n,jt as o,Nn as p,Un as q,kn as r,Bn as s,Kn as t,Qn as u,Fn as v,ht as w,bt as x,tt as y,zn as z,Wn as A,Yn as B,Jn as C,Xn as D,Gn as E,D as F,ao as G,io as H,uo as I,co as J,lo as K};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u}from"./chunk-TFJOEF3Q.js";import{b as c}from"./chunk-EFEREKX4.js";import{a as t}from"./chunk-GOTQ4D6W.js";import{M as d,d as a}from"./chunk-6PHJZPWD.js";import{b as l}from"./chunk-YPMUHXYT.js";import{c as m}from"./chunk-7SZRL6FY.js";var e=m(l(),1),g="/memories",i=`${g}/library`,y=new Set(["library"]);function n(r){if(r===i||r.startsWith(`${i}/`))return!0;let o=r.match(/^\/memories\/([^/]+)$/);return!!(o?.[1]&&!y.has(o[1]))}function f(r){let o=n(a().pathname);return(0,e.jsx)(u,{ariaLabel:"Memory navigation",className:o?"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] md:grid-rows-[minmax(0,1fr)]":void 0,items:[{end:!0,label:"Overview",to:g},{isActive:n,label:"Memories",to:i}],children:o?(0,e.jsx)("div",{className:"min-h-0",children:r.children}):(0,e.jsx)(t,{className:"gap-6 sm:gap-8",children:r.children})})}function P(r){let o=n(a().pathname),s=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d,{description:r.description??"Personal and public memories Junior can use across conversations.",title:r.title??"Memories"}),(0,e.jsx)(c,{label:r.label,variant:o?"library":"overview"})]});return(0,e.jsx)(f,{children:o?(0,e.jsx)("div",{className:"h-full overflow-y-auto",children:(0,e.jsx)(t,{className:"gap-6 sm:gap-8",children:s})}):s})}export{n as a,f as b,P as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as f}from"./chunk-6PHJZPWD.js";import{a as S}from"./chunk-YPMUHXYT.js";import{c as P}from"./chunk-7SZRL6FY.js";var i=P(S(),1);function T(e,t){let n=typeof t=="string"?t.startsWith("?")?t.slice(1):t:t?.toString()??"",a=e.indexOf("?"),c=a===-1?e:e.slice(0,a),u=a===-1?"":e.slice(a+1).replace(/^\?+/,""),r=new URLSearchParams(n);for(let[m,s]of new URLSearchParams(u))r.set(m,s);let o=r.toString();return o?`${c}?${o}`:c}function h(e,t){let n=e?.trim();return n&&t.includes(n)?n:void 0}function x(e="q",t={}){let n=t.delayMs??250,a=t.resetPage??!1,[c,u]=f(),r=c.get(e)?.trim()??"",[o,m]=(0,i.useState)(r);return(0,i.useEffect)(()=>{m(s=>s.trim()===r?s:r)},[r]),(0,i.useEffect)(()=>{let s=window.setTimeout(()=>{let d=o.trim();d!==r&&u(g=>{let l=new URLSearchParams(g);return a&&l.delete("page"),d?l.set(e,d):l.delete(e),l},{replace:!0})},n);return()=>window.clearTimeout(s)},[r,n,e,a,u,o]),[o,m,r]}function w(e,t,n){let[a,c]=f(),u=h(a.get(e),n)??t,r=(0,i.useCallback)(o=>{c(m=>{let s=new URLSearchParams(m);return o===t?s.delete(e):s.set(e,o),s},{replace:!0})},[t,e,c]);return[u,r]}export{T as a,x as b,w as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as o}from"./chunk-NQMDED2R.js";function r(t){return t.schedule.includes(t.timezone)?t.schedule:`${t.schedule} (${t.timezone})`}function u(t,e){let n={day:"numeric",hour:"numeric",minute:"2-digit",month:"short",timeZoneName:"short",year:"numeric"};return e?new Intl.DateTimeFormat(void 0,{...n,timeZone:e}).format(new Date(t)):o(t,n)}function m(t){return t==="failed"?"danger":t==="blocked"?"warning":"success"}function a(t,e){return t.title?.trim()||(t.conversationId?e:"No conversation")}export{r as a,u as b,m as c,a as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as c,b as n}from"./chunk-YPMUHXYT.js";import{c as o}from"./chunk-7SZRL6FY.js";var l=o(n(),1),i="a, button, input, select, textarea, [role='button'], [role='link']";function s(e){function a(t){t.target instanceof Element&&t.target.closest(i)||e.onSelect()}return(0,l.jsx)("div",{className:c("group cursor-pointer transition-colors",e.selected?"bg-dashboard-accent/[0.045]":"hover:bg-dashboard-fill-soft focus-within:bg-dashboard-fill-soft",e.className),onClick:a,children:e.children})}export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as r,b as t}from"./chunk-YPMUHXYT.js";import{c as n}from"./chunk-7SZRL6FY.js";var e=n(t(),1);function o(l){return(0,e.jsx)("ul",{"aria-label":l.ariaLabel,className:r("m-0 flex list-none flex-wrap gap-x-4 gap-y-1 p-0 font-sans text-2xs text-dashboard-text-muted",!l.inline&&"mt-4"),children:l.items.map(a=>(0,e.jsxs)("li",{className:"flex items-center whitespace-nowrap",children:[(0,e.jsx)("i",{"aria-hidden":"true",className:"mr-1.5 block size-2 shrink-0 rounded-full",style:{backgroundColor:a.color}}),(0,e.jsxs)("span",{children:[a.label,a.value!==void 0?(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"})," ",a.value]}):null]})]},a.key))})}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as U}from"./chunk-7SZRL6FY.js";var K={"angular-html":()=>import("./angular-html-ZNDXTZDN.js"),"angular-ts":()=>import("./angular-ts-ON3WFVNV.js"),astro:()=>import("./astro-TCFNN3TA.js"),blade:()=>import("./blade-XRKVUGGE.js"),c:()=>import("./c-WHCDUHJR.js"),coffee:()=>import("./coffee-NWMA7ZVV.js"),coffeescript:()=>import("./coffee-NWMA7ZVV.js"),cpp:()=>import("./cpp-7ZDYJCCI.js"),"c++":()=>import("./cpp-7ZDYJCCI.js"),css:()=>import("./css-XF3SDJYW.js"),csv:()=>import("./csv-I2Y5BPVG.js"),glsl:()=>import("./glsl-SDKJ4MVB.js"),graphql:()=>import("./graphql-XJBKAS4G.js"),gql:()=>import("./graphql-XJBKAS4G.js"),haml:()=>import("./haml-QQIA6ZDV.js"),handlebars:()=>import("./handlebars-A4STSCQ6.js"),hbs:()=>import("./handlebars-A4STSCQ6.js"),html:()=>import("./html-T3MIDC6T.js"),"html-derivative":()=>import("./html-derivative-A5ABNIZH.js"),http:()=>import("./http-VGZ3EXS5.js"),hurl:()=>import("./hurl-TO4NQQLI.js"),imba:()=>import("./imba-P3ARIZRP.js"),java:()=>import("./java-WCBM5OUU.js"),javascript:()=>import("./javascript-TQH7GGAM.js"),js:()=>import("./javascript-TQH7GGAM.js"),cjs:()=>import("./javascript-TQH7GGAM.js"),mjs:()=>import("./javascript-TQH7GGAM.js"),jinja:()=>import("./jinja-UYMB4X6S.js"),jison:()=>import("./jison-ED4UFXGK.js"),json:()=>import("./json-XRHV7G5W.js"),json5:()=>import("./json5-2OA2ZMVI.js"),jsonc:()=>import("./jsonc-KO53QF6Y.js"),jsonl:()=>import("./jsonl-GHTNFMM6.js"),jsx:()=>import("./jsx-V5TSP3NI.js"),julia:()=>import("./julia-EI7BACOV.js"),jl:()=>import("./julia-EI7BACOV.js"),less:()=>import("./less-FPWZXUDW.js"),markdown:()=>import("./markdown-QWIM2DOI.js"),md:()=>import("./markdown-QWIM2DOI.js"),marko:()=>import("./marko-3POAQSZY.js"),mdc:()=>import("./mdc-KT6TTBUF.js"),mdx:()=>import("./mdx-CWS3UMSH.js"),php:()=>import("./php-3CK4FBZI.js"),postcss:()=>import("./postcss-7K34RN34.js"),pug:()=>import("./pug-IEW5PJRA.js"),jade:()=>import("./pug-IEW5PJRA.js"),python:()=>import("./python-GCPXLELR.js"),py:()=>import("./python-GCPXLELR.js"),r:()=>import("./r-XV5O7BSV.js"),regexp:()=>import("./regexp-655IUQFI.js"),regex:()=>import("./regexp-655IUQFI.js"),sass:()=>import("./sass-MSBN6O54.js"),scss:()=>import("./scss-N73GNFL4.js"),shellscript:()=>import("./shellscript-OPDT4ZZ3.js"),bash:()=>import("./shellscript-OPDT4ZZ3.js"),sh:()=>import("./shellscript-OPDT4ZZ3.js"),shell:()=>import("./shellscript-OPDT4ZZ3.js"),zsh:()=>import("./shellscript-OPDT4ZZ3.js"),sql:()=>import("./sql-ZR72I7RP.js"),stylus:()=>import("./stylus-NVEQWGLA.js"),styl:()=>import("./stylus-NVEQWGLA.js"),svelte:()=>import("./svelte-ZZAXFLSI.js"),"ts-tags":()=>import("./ts-tags-MCSPJMMM.js"),lit:()=>import("./ts-tags-MCSPJMMM.js"),tsx:()=>import("./tsx-ZTNB67YL.js"),typescript:()=>import("./typescript-HV6B525T.js"),ts:()=>import("./typescript-HV6B525T.js"),cts:()=>import("./typescript-HV6B525T.js"),mts:()=>import("./typescript-HV6B525T.js"),vue:()=>import("./vue-WXFFFGZ3.js"),"vue-html":()=>import("./vue-html-SKWAUQDE.js"),"vue-vine":()=>import("./vue-vine-V3A5HTCZ.js"),wasm:()=>import("./wasm-JWJ5BADC.js"),wgsl:()=>import("./wgsl-ZCQ7MKDM.js"),wit:()=>import("./wit-MLLAONFF.js"),xml:()=>import("./xml-VST5CLIL.js"),yaml:()=>import("./yaml-BX3BWN2A.js"),yml:()=>import("./yaml-BX3BWN2A.js")};var d=class{constructor(o,r,a){this.normal=r,this.property=o,a&&(this.space=a)}};d.prototype.normal={};d.prototype.property={};d.prototype.space=void 0;function C(l,o){let r={},a={};for(let p of l)Object.assign(r,p.property),Object.assign(a,p.normal);return new d(r,a,o)}function v(l){return l.toLowerCase()}var u=class{constructor(o,r){this.attribute=r,this.property=o}};u.prototype.attribute="";u.prototype.booleanish=!1;u.prototype.boolean=!1;u.prototype.commaOrSpaceSeparated=!1;u.prototype.commaSeparated=!1;u.prototype.defined=!1;u.prototype.mustUseProperty=!1;u.prototype.number=!1;u.prototype.overloadedBoolean=!1;u.prototype.property="";u.prototype.spaceSeparated=!1;u.prototype.space=void 0;var x={};U(x,{boolean:()=>e,booleanish:()=>i,commaOrSpaceSeparated:()=>s,commaSeparated:()=>g,number:()=>n,overloadedBoolean:()=>k,spaceSeparated:()=>t});var z=0,e=f(),i=f(),k=f(),n=f(),t=f(),g=f(),s=f();function f(){return 2**++z}var w=Object.keys(x),y=class extends u{constructor(o,r,a,p){let c=-1;if(super(o,r),M(this,"space",p),typeof a=="number")for(;++c<w.length;){let h=w[c];M(this,w[c],(a&x[h])===x[h])}}};y.prototype.defined=!0;function M(l,o,r){r&&(l[o]=r)}function m(l){let o={},r={};for(let[a,p]of Object.entries(l.properties)){let c=new y(a,l.transform(l.attributes||{},a),p,l.space);l.mustUseProperty&&l.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),o[a]=c,r[v(a)]=a,r[v(c.attribute)]=a}return new d(o,r,l.space)}var L=m({properties:{ariaActiveDescendant:null,ariaAtomic:i,ariaAutoComplete:null,ariaBusy:i,ariaChecked:i,ariaColCount:n,ariaColIndex:n,ariaColSpan:n,ariaControls:t,ariaCurrent:null,ariaDescribedBy:t,ariaDetails:null,ariaDisabled:i,ariaDropEffect:t,ariaErrorMessage:null,ariaExpanded:i,ariaFlowTo:t,ariaGrabbed:i,ariaHasPopup:null,ariaHidden:i,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:t,ariaLevel:n,ariaLive:null,ariaModal:i,ariaMultiLine:i,ariaMultiSelectable:i,ariaOrientation:null,ariaOwns:t,ariaPlaceholder:null,ariaPosInSet:n,ariaPressed:i,ariaReadOnly:i,ariaRelevant:null,ariaRequired:i,ariaRoleDescription:t,ariaRowCount:n,ariaRowIndex:n,ariaRowSpan:n,ariaSelected:i,ariaSetSize:n,ariaSort:null,ariaValueMax:n,ariaValueMin:n,ariaValueNow:n,ariaValueText:null,role:null},transform(l,o){return o==="role"?o:"aria-"+o.slice(4).toLowerCase()}});function S(l,o){return o in l?l[o]:o}function b(l,o){return S(l,o.toLowerCase())}var R=m({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:g,acceptCharset:t,accessKey:t,action:null,allow:null,allowFullScreen:e,allowPaymentRequest:e,allowUserMedia:e,alt:null,as:null,async:e,autoCapitalize:null,autoComplete:t,autoFocus:e,autoPlay:e,blocking:t,capture:null,charSet:null,checked:e,cite:null,className:t,cols:n,colSpan:null,content:null,contentEditable:i,controls:e,controlsList:t,coords:n|g,crossOrigin:null,data:null,dateTime:null,decoding:null,default:e,defer:e,dir:null,dirName:null,disabled:e,download:k,draggable:i,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:e,formTarget:null,headers:t,height:n,hidden:k,high:n,href:null,hrefLang:null,htmlFor:t,httpEquiv:t,id:null,imageSizes:null,imageSrcSet:null,inert:e,inputMode:null,integrity:null,is:null,isMap:e,itemId:null,itemProp:t,itemRef:t,itemScope:e,itemType:t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:e,low:n,manifest:null,max:null,maxLength:n,media:null,method:null,min:null,minLength:n,multiple:e,muted:e,name:null,nonce:null,noModule:e,noValidate:e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:e,optimum:n,pattern:null,ping:t,placeholder:null,playsInline:e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:e,referrerPolicy:null,rel:t,required:e,reversed:e,rows:n,rowSpan:n,sandbox:t,scope:null,scoped:e,seamless:e,selected:e,shadowRootClonable:e,shadowRootDelegatesFocus:e,shadowRootMode:null,shape:null,size:n,sizes:null,slot:null,span:n,spellCheck:i,src:null,srcDoc:null,srcLang:null,srcSet:null,start:n,step:null,style:null,tabIndex:n,target:null,title:null,translate:null,type:null,typeMustMatch:e,useMap:null,value:i,width:n,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:t,axis:null,background:null,bgColor:null,border:n,borderColor:null,bottomMargin:n,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:e,declare:e,event:null,face:null,frame:null,frameBorder:null,hSpace:n,leftMargin:n,link:null,longDesc:null,lowSrc:null,marginHeight:n,marginWidth:n,noResize:e,noHref:e,noShade:e,noWrap:e,object:null,profile:null,prompt:null,rev:null,rightMargin:n,rules:null,scheme:null,scrolling:i,standby:null,summary:null,text:null,topMargin:n,valueType:null,version:null,vAlign:null,vLink:null,vSpace:n,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:e,disableRemotePlayback:e,prefix:null,property:null,results:n,security:null,unselectable:null},space:"html",transform:b});var T=m({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:s,accentHeight:n,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:n,amplitude:n,arabicForm:null,ascent:n,attributeName:null,attributeType:null,azimuth:n,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:n,by:null,calcMode:null,capHeight:n,className:t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:n,diffuseConstant:n,direction:null,display:null,dur:null,divisor:n,dominantBaseline:null,download:e,dx:null,dy:null,edgeMode:null,editable:null,elevation:n,enableBackground:null,end:null,event:null,exponent:n,externalResourcesRequired:null,fill:null,fillOpacity:n,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:g,g2:g,glyphName:g,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:n,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:n,horizOriginX:n,horizOriginY:n,id:null,ideographic:n,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:n,k:n,k1:n,k2:n,k3:n,k4:n,kernelMatrix:s,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:n,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:n,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:n,overlineThickness:n,paintOrder:null,panose1:null,path:null,pathLength:n,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:n,pointsAtY:n,pointsAtZ:n,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:s,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:s,rev:s,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:s,requiredFeatures:s,requiredFonts:s,requiredFormats:s,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:n,specularExponent:n,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:n,strikethroughThickness:n,string:null,stroke:null,strokeDashArray:s,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:n,strokeOpacity:n,strokeWidth:null,style:null,surfaceScale:n,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:s,tabIndex:n,tableValues:null,target:null,targetX:n,targetY:n,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:s,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:n,underlineThickness:n,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:n,values:null,vAlphabetic:n,vMathematical:n,vectorEffect:null,vHanging:n,vIdeographic:n,version:null,vertAdvY:n,vertOriginX:n,vertOriginY:n,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:n,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:S});var P=m({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(l,o){return"xlink:"+o.slice(5).toLowerCase()}});var D=m({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:b});var O=m({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(l,o){return"xml:"+o.slice(3).toLowerCase()}});var I={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var B=/[A-Z]/g,A=/-[a-z]/g,j=/^data[-\w.:]+$/i;function H(l,o){let r=v(o),a=o,p=u;if(r in l.normal)return l.property[l.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&j.test(o)){if(o.charAt(4)==="-"){let c=o.slice(5).replace(A,V);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{let c=o.slice(4);if(!A.test(c)){let h=c.replace(B,F);h.charAt(0)!=="-"&&(h="-"+h),o="data"+h}}p=y}return new p(a,o)}function F(l){return"-"+l.toLowerCase()}function V(l){return l.charAt(1).toUpperCase()}var Bn=C([L,R,P,D,O],"html"),jn=C([L,T,P,D,O],"svg");function qn(l,o){let r=String(l);if(typeof o!="string")throw new TypeError("Expected character");let a=0,p=r.indexOf(o);for(;p!==-1;)a++,p=r.indexOf(o,p+o.length);return a}function Kn(l,o){let r=o||{};return(l[l.length-1]===""?[...l,""]:l).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function Nn(l){return l.join(" ").trim()}var q=/[ \t\n\f\r]/g;function W(l){return typeof l=="object"?l.type==="text"?E(l.value):!1:E(l)}function E(l){return l.replace(q,"")===""}export{I as a,H as b,Bn as c,jn as d,qn as e,Kn as f,Nn as g,W as h,K as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p,b as u}from"./chunk-QPBLZSNX.js";import{a as P}from"./chunk-B5ZN3SWQ.js";import{Rc as c,Sc as L,Uc as R,a as T,b}from"./chunk-YPMUHXYT.js";import{c as d}from"./chunk-7SZRL6FY.js";var o=d(T(),1),s=d(P(),1),r=d(b(),1),a=(0,o.createContext)(null);function w(e){let[t,l]=(0,o.useState)(null),[m,x]=(0,o.useState)(null),[v,E]=(0,o.useState)(null),[f,k]=(0,o.useState)(null),h=(0,o.useRef)(null),S=(0,o.useCallback)(i=>{l(i)},[]),N=(0,o.useCallback)(i=>{x(i)},[]),H=(0,o.useCallback)(i=>{E(i)},[]),M=(0,o.useCallback)(i=>{k(i)},[]),g=(0,o.useCallback)(i=>{h.current=i},[]),y=(0,o.useCallback)(()=>{h.current?.()},[]),D=(0,o.useMemo)(()=>({mobileHeaderActionsSlot:v,mobileHeaderActionsSlotRef:H,mobileHeaderLiveSlot:f,mobileHeaderLiveSlotRef:M,mobileSecondarySlot:m,mobileSecondarySlotRef:N,openMobileNavigation:y,registerOpenMobileNavigation:g,secondarySlot:t,secondarySlotRef:S}),[v,H,f,M,m,N,y,g,t,S]);return(0,r.jsx)(a.Provider,{value:D,children:e.children})}function A(e){let t=(0,o.useContext)(a);if(!t)throw new Error("DashboardChrome requires DashboardChromeProvider");return(0,r.jsxs)("div",{className:"sticky top-0 z-30 bg-dashboard-bg/95 pt-[env(safe-area-inset-top)]",children:[(0,r.jsxs)("div",{className:"border-b border-dashboard-border-strong md:border-b-0 md:has-[[data-secondary-slot]>*]:border-b md:tall:border-b",children:[e.header,(0,r.jsx)("div",{className:"hidden md:block","data-secondary-slot":"",ref:t.secondarySlotRef})]}),e.banner]})}function O(){let e=(0,o.useContext)(a);if(!e)throw new Error("MobileSecondaryNavigationSlot requires DashboardChromeProvider");return(0,r.jsx)("div",{ref:e.mobileSecondarySlotRef})}function I(){let e=(0,o.useContext)(a);if(!e)throw new Error("MobileHeaderActionsSlot requires DashboardChromeProvider");return(0,r.jsx)("div",{className:"col-start-3 row-start-1 flex min-w-0 items-center justify-self-end md:hidden",ref:e.mobileHeaderActionsSlotRef})}function q(){let e=(0,o.useContext)(a);if(!e)throw new Error("MobileHeaderLiveSlot requires DashboardChromeProvider");return(0,r.jsx)("div",{className:"flex shrink-0 items-center md:hidden",ref:e.mobileHeaderLiveSlotRef})}function V(e){let t=(0,o.useContext)(a);return t?.mobileHeaderActionsSlot?(0,s.createPortal)(e.children,t.mobileHeaderActionsSlot):null}function z(e){let t=(0,o.useContext)(a);return t?.mobileHeaderLiveSlot?(0,s.createPortal)(e.children,t.mobileHeaderLiveSlot):null}function B(){let e=(0,o.useContext)(a);return e?e.openMobileNavigation:null}function F(e){let t=(0,o.useContext)(a),l=(0,o.useRef)(e);l.current=e,(0,o.useEffect)(()=>{if(!t)return;let m=()=>{l.current?.()};return t.registerOpenMobileNavigation(e?m:null),()=>{t.registerOpenMobileNavigation(null)}},[t,e])}function C(e){let t=(0,o.useContext)(a);return t?t.secondarySlot?(0,r.jsxs)(r.Fragment,{children:[(0,s.createPortal)(e.desktop,t.secondarySlot),t.mobileSecondarySlot?(0,s.createPortal)(e.mobile,t.mobileSecondarySlot):null]}):null:e.desktop}var n=d(b(),1);function U(e){let t=({isActive:l})=>c("rounded-lg px-3 py-3 pl-6 font-sans text-sm font-medium no-underline transition-colors",l?"bg-dashboard-accent/[0.1] text-dashboard-accent-text":c("hover:bg-dashboard-fill-faint",R));return(0,n.jsxs)("div",{className:c("min-w-0",e.className),children:[(0,n.jsx)(C,{desktop:(0,n.jsx)("div",{className:c(L,"min-w-0 px-4 md:px-8"),children:(0,n.jsx)(u,{ariaLabel:e.ariaLabel,items:e.items})}),mobile:(0,n.jsx)("nav",{"aria-label":e.ariaLabel,className:"mt-3 grid gap-1 border-t border-dashboard-border pt-3",children:e.items.map(l=>(0,n.jsx)(p,{className:t,item:l},l.to))})}),(0,n.jsx)("div",{className:"border-b border-dashboard-border px-4 pt-2 sm:px-8 md:hidden",children:(0,n.jsx)(u,{ariaLabel:e.ariaLabel,fill:!0,items:e.items})}),e.children]})}export{w as a,A as b,O as c,I as d,q as e,V as f,z as g,B as h,F as i,U as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as d,c as V,d as z}from"./chunk-SDKV3OID.js";import{c as E}from"./chunk-Z2JPRGFT.js";import{a as w}from"./chunk-5ZA674OU.js";import{b as L}from"./chunk-EFEREKX4.js";import{a as O}from"./chunk-2BCS5AQL.js";import{O as v,g as D,k as I,r as P,z as M}from"./chunk-NQMDED2R.js";import{i as C,j as k,l as F}from"./chunk-GMZIELFU.js";import{a as U}from"./chunk-GOTQ4D6W.js";import{o as u,q as S}from"./chunk-6PHJZPWD.js";import{a as x}from"./chunk-CR2ICLSH.js";import{Rc as i,Tc as R,a as _,ac as y,b}from"./chunk-YPMUHXYT.js";import{c as l}from"./chunk-7SZRL6FY.js";var K=l(_(),1);var e=l(b(),1),N="run";function se(n){let[t,m]=S(),h=(0,K.useRef)(null),r=t.get(N)??void 0,g=o=>m(f=>{let s=new URLSearchParams(f);return o?s.set(N,o):s.delete(N),s},{replace:!0}),T=o=>h.current?.querySelector(`[data-run-id="${CSS.escape(o)}"] button`);return{close:()=>{let o=r?T(r):void 0;g(void 0),(o??h.current)?.focus({preventScroll:!0})},listRef:h,onRowsKeyDown:o=>{if(!r||o.key!=="ArrowDown"&&o.key!=="ArrowUp")return;let f=o.target.closest("[data-run-id]")?.getAttribute("data-run-id"),s=f?n.indexOf(f):-1,p=n[s+(o.key==="ArrowDown"?1:-1)];s===-1||!p||(o.preventDefault(),g(p),T(p)?.focus())},runId:r,toggle:o=>g(o===r?void 0:o)}}function re(n){return(0,e.jsxs)("div",{className:i("grid h-full min-h-0 min-w-0",n.details?"xl:grid-cols-[minmax(0,1fr)_25rem]":void 0),children:[(0,e.jsx)("div",{"aria-label":n.label,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:n.listRef,role:"region",tabIndex:0,children:(0,e.jsx)(U,{children:n.children})}),n.details]})}function le(n){return n.conversationId?(0,e.jsxs)(C,{children:[(0,e.jsx)(k,{render:(0,e.jsx)(u,{"aria-label":"Open conversation",className:i(x({size:"icon"}),"size-8"),to:w(n.conversationId),children:(0,e.jsx)(y,{"aria-hidden":"true",size:15})})}),(0,e.jsx)(F,{size:"compact",children:"Open conversation"})]}):(0,e.jsx)("span",{"aria-hidden":"true"})}function ue(n){let{run:t}=n,m=t?z(t,t.automationTitle):"Run";return(0,e.jsx)(E,{actions:t?.conversationId?(0,e.jsx)(u,{className:i(x(),"shrink-0 whitespace-nowrap"),to:w(t.conversationId),children:"Open conversation"}):void 0,label:"Run details",onClose:n.onClose,sheetTitle:m,title:(0,e.jsx)("h2",{className:"m-0 line-clamp-2 break-words font-display text-base font-medium text-dashboard-text",children:m}),children:(0,e.jsx)("div",{className:"p-4 [overflow-wrap:anywhere]",children:t?(0,e.jsx)($,{run:t,showAutomation:n.showAutomation}):n.loading?(0,e.jsx)(L,{label:"Loading run details",variant:"panel"}):(0,e.jsx)("p",{className:"m-0 text-sm text-dashboard-text-muted",children:"This run is not in the loaded runs."})})})}function $(n){let{run:t}=n;return(0,e.jsxs)("div",{className:"grid min-w-0 gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-1",children:[(0,e.jsx)(O,{tone:V(t.status),children:t.status}),(0,e.jsx)("time",{className:"text-xs text-dashboard-text-muted",dateTime:t.executedAt,title:d(t.executedAt),children:D(t.executedAt)})]}),t.error?(0,e.jsx)(A,{title:"Error",children:(0,e.jsx)("p",{className:"m-0 whitespace-pre-wrap font-mono text-xs leading-relaxed text-rose-300",children:t.error})}):null,(0,e.jsx)(A,{title:"Run",children:(0,e.jsxs)("dl",{className:H,children:[(0,e.jsx)(a,{label:"Trigger",children:t.kind==="scheduled"?"Schedule":"Event"}),t.scheduledFor?(0,e.jsx)(a,{label:"Scheduled for",children:d(t.scheduledFor)}):null,t.startedAt?(0,e.jsx)(a,{label:"Started",children:d(t.startedAt)}):null,(0,e.jsx)(a,{label:"Finished",children:d(t.executedAt)}),(0,e.jsx)(a,{label:"Duration",children:I(t.durationMs)||"\u2014"}),(0,e.jsx)(a,{label:"Tokens",children:t.totalTokens===void 0?"\u2014":P(t.totalTokens)}),(0,e.jsx)(a,{label:"Cost",children:t.costUsd===void 0?"\u2014":M({total:t.costUsd})})]})}),(0,e.jsx)(A,{title:"Setup",children:(0,e.jsxs)("dl",{className:H,children:[n.showAutomation?(0,e.jsx)(a,{label:"Automation",children:(0,e.jsx)(u,{className:R,to:v(t.automationId),children:t.automationTitle})}):null,t.automationVersion?(0,e.jsx)(a,{label:"Version",children:(0,e.jsxs)(u,{className:R,to:`${v(t.automationId,"versions")}?version=${t.automationVersion}`,children:["Version ",t.automationVersion]})}):null,t.credentialMode?(0,e.jsx)(a,{label:"Accounts",children:t.credentialMode==="creator"?"Creator\u2019s connected accounts":"Junior\u2019s accounts only"}):null,(0,e.jsx)(a,{label:"Run ID",children:(0,e.jsx)("span",{className:"font-mono",children:t.executionId})})]})}),t.conversationId?null:(0,e.jsx)("p",{className:"m-0 px-1 text-xs text-dashboard-text-muted",children:"No Conversation was recorded for this run."})]})}var H="m-0 grid min-w-0 gap-2 text-xs leading-snug";function A(n){return(0,e.jsxs)("section",{className:"grid min-w-0 gap-2.5 rounded-lg border border-dashboard-border-subtle bg-dashboard-surface-panel p-3",children:[(0,e.jsx)("h3",{className:"m-0 font-sans text-xs font-medium text-dashboard-text-muted",children:n.title}),n.children]})}function a(n){return(0,e.jsxs)("div",{className:"flex min-w-0 items-baseline justify-between gap-4",children:[(0,e.jsx)("dt",{className:"shrink-0 text-dashboard-text-muted",children:n.label}),(0,e.jsx)("dd",{className:"m-0 min-w-0 break-words text-right tabular-nums text-dashboard-text",children:n.children})]})}var c=l(b(),1),j={accent:"bg-violet-300",danger:"bg-rose-300",info:"bg-cyan-300",neutral:"bg-dashboard-text-faint",success:"bg-emerald-300",warning:"bg-amber-300"};function me(n){return(0,c.jsxs)("span",{className:i("inline-flex shrink-0 items-center",n.className),title:n.label,children:[(0,c.jsx)("span",{"aria-hidden":"true",className:i("size-1.5 rounded-full",j[n.tone??"neutral"])}),(0,c.jsx)("span",{className:"sr-only",children:n.label})]})}export{N as a,se as b,re as c,le as d,ue as e,me as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as m}from"./chunk-6PHJZPWD.js";import{Rc as s,b as r}from"./chunk-YPMUHXYT.js";import{c as d}from"./chunk-7SZRL6FY.js";var t=d(r(),1);function l(e){let o=e.wideRuntime?"grid-cols-[minmax(14rem,1fr)_repeat(2,minmax(5rem,auto))_minmax(8rem,auto)] max-md:grid-cols-3":"grid-cols-[minmax(14rem,1fr)_repeat(3,minmax(5rem,auto))] max-md:grid-cols-3";return(0,t.jsxs)("div",{"aria-label":"Loading sorted results",className:"min-w-0 animate-pulse",role:"status",children:[Array.from({length:5},(n,b)=>(0,t.jsxs)("div",{"aria-hidden":"true",className:`grid min-w-0 ${o} items-center gap-4 border-b border-dashboard-border-subtle px-4 py-3.5 last:border-b-0 max-md:gap-x-3 max-md:gap-y-4`,children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3 max-md:col-span-3",children:[(0,t.jsx)("span",{className:"size-9 shrink-0 rounded-md bg-dashboard-fill-hover"}),(0,t.jsxs)("div",{className:"grid min-w-0 flex-1 gap-2",children:[(0,t.jsx)("span",{className:"h-3.5 w-2/5 rounded-md bg-dashboard-fill-strong"}),(0,t.jsx)("span",{className:"h-2.5 w-3/5 rounded-md bg-dashboard-fill-soft"})]})]}),[0,1,2].map(u=>(0,t.jsx)("span",{className:"h-4 w-10 justify-self-end rounded-md bg-dashboard-fill-hover"},u))]},b)),(0,t.jsx)("span",{className:"sr-only",children:"Loading sorted results"})]})}var a=d(r(),1),c="grid-cols-[minmax(14rem,1fr)_repeat(2,minmax(5rem,auto))_minmax(8rem,auto)]";function v(e){return(0,a.jsx)("div",{className:s("grid min-w-0 gap-2 border-b border-dashboard-border-subtle bg-dashboard-overlay-soft p-3",e.columnsClassName),children:e.children})}function N(e){return e.loading?(0,a.jsx)(l,{wideRuntime:!0}):e.empty?(0,a.jsx)("div",{className:"p-4",children:e.empty}):(0,a.jsxs)("div",{"aria-label":e.ariaLabel,className:"min-w-0",children:[(0,a.jsx)("div",{"aria-hidden":"true",className:s("grid items-center gap-4 border-b border-dashboard-border-subtle bg-dashboard-overlay-soft px-4 py-2.5 font-sans font-medium text-xs text-dashboard-text-muted max-md:hidden",c),children:e.headers.map((o,n)=>(0,a.jsx)("div",{className:n?"justify-self-end":void 0,children:o},o))}),e.children]})}function p(e){return(0,a.jsx)(m,{className:s("group grid min-w-0 items-center gap-4 border-b border-dashboard-border-subtle px-4 py-3.5 text-inherit no-underline transition-colors last:border-b-0 hover:bg-dashboard-fill-soft max-md:grid-cols-3 max-md:gap-x-3 max-md:gap-y-4",c),to:e.to,children:e.children})}function y(e){return(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 max-md:col-span-3",children:[(0,a.jsx)("span",{className:s("grid size-9 shrink-0 place-items-center rounded-md border border-dashboard-border-strong transition-colors",e.iconClassName),children:e.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"truncate font-display text-base font-medium leading-tight text-dashboard-text",children:e.title}),e.description?(0,a.jsx)("div",{className:"mt-1 truncate font-sans text-xs leading-tight text-dashboard-text-muted",children:e.description}):null]})]})}var i=d(r(),1);function R(e){return(0,i.jsxs)("div",{className:"justify-self-end text-right max-md:justify-self-stretch max-md:text-left",children:[(0,i.jsx)("div",{"aria-hidden":"true",className:"mb-1 hidden font-sans font-medium text-xs text-dashboard-text-muted max-md:block",children:e.label}),(0,i.jsxs)("div",{className:"font-display text-xl font-light leading-none text-dashboard-text md:font-sans md:tabular-nums md:text-xs md:text-dashboard-text-muted",children:[(0,i.jsxs)("span",{className:"sr-only",children:[e.label,": "]}),e.value]})]})}export{v as a,N as b,p as c,y as d,R as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(e,n){return e==="memory"&&n==="memories"?"/memories":`/plugins/${encodeURIComponent(e)}/${encodeURIComponent(n)}`}export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./chunk-TFJOEF3Q.js";import{b as r}from"./chunk-YPMUHXYT.js";import{c as i}from"./chunk-7SZRL6FY.js";var l="/system/plugins";function g(s){let o=new Map(s.plugins.map(e=>[e.name,{...e,reports:[],skills:[]}]));for(let e of s.skills){let t=e.pluginProvider?o.get(e.pluginProvider):void 0;t&&t.skills.push(e)}for(let e of s.reports){let t=o.get(e.pluginName);t||(t={configKeys:[],description:"Core operational report.",displayName:e.title?.trim()||e.pluginName,name:e.pluginName,reports:[],skills:[]},o.set(e.pluginName,t)),t.reports.push(e)}return[...o.values()].map(e=>({...e,reports:[...e.reports],skills:[...e.skills].sort((t,p)=>t.name.localeCompare(p.name))})).sort((e,t)=>e.displayName.localeCompare(t.displayName))}function u(s){return`${l}/${encodeURIComponent(s)}`}function c(s){return s.replace(/\/+$/,"")||"/"}var a=i(r(),1),m=[{end:!0,label:"Overview",to:"/system"},{label:"People",to:"/system/people"},{label:"Locations",to:"/system/locations"},{label:"Workspaces",to:"/system/workspaces"},{label:"Plugins",to:l}];function f(s){return(0,a.jsx)(n,{ariaLabel:"System navigation",className:s.className,items:m,children:s.children})}export{l as a,g as b,u as c,c as d,f as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as s,b as d}from"./chunk-YPMUHXYT.js";import{c as a}from"./chunk-7SZRL6FY.js";var t=a(d(),1);function r(e){return(0,t.jsxs)("div",{className:s("flex flex-wrap items-start justify-between gap-4 border-b border-dashboard-border-subtle px-4 py-4 sm:px-5",e.className),children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"m-0 font-sans text-xs font-medium text-dashboard-text-muted",children:e.title}),e.description?(0,t.jsx)("p",{className:"mt-1 mb-0 font-sans text-xs leading-relaxed text-dashboard-text-muted",children:e.description}):null]}),e.trailing?(0,t.jsx)("div",{className:"font-sans text-xs text-dashboard-text-muted",children:e.trailing}):null]})}export{r as a};
|