@vellumai/web 0.10.0-staging.2 → 0.10.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/assets/{account-page-D5qDx37o.js → account-page-B5rB7loj.js} +1 -1
- package/dist/assets/{add-credits-modal-DpHTkxV2.js → add-credits-modal-BEX4_5jj.js} +1 -1
- package/dist/assets/{advanced-page-DWX9qbxa.js → advanced-page-9RUi4YCF.js} +1 -1
- package/dist/assets/{ai-page-Cp6X0S2W.js → ai-page-CZj92XF4.js} +1 -1
- package/dist/assets/{api-key-screen-DvV4RiY0.js → api-key-screen-CUKjlF2C.js} +1 -1
- package/dist/assets/{archive-page-B7i9-bc2.js → archive-page-YsBlmevd.js} +1 -1
- package/dist/assets/{billing-page-CMhUfBBf.js → billing-page-DgX2YBSA.js} +1 -1
- package/dist/assets/{bookmarks-page-BBlx8L6h.js → bookmarks-page-DRcIBBva.js} +1 -1
- package/dist/assets/{command-palette-yIWk_niH.js → command-palette-BXEAR93M.js} +1 -1
- package/dist/assets/{command-palette-window-page-CHu_bF8J.js → command-palette-window-page-5SP_Ft4Y.js} +1 -1
- package/dist/assets/{community-page-CiartSQX.js → community-page-D5-exeNr.js} +1 -1
- package/dist/assets/{contacts-page-route-C9IaBKKe.js → contacts-page-route-C9T-8Sdr.js} +1 -1
- package/dist/assets/{debug-page-DGQMqihK.js → debug-page-ClQetFUa.js} +1 -1
- package/dist/assets/{deploy-dialogs-DWIqIDdv.js → deploy-dialogs-BtpYB7B8.js} +1 -1
- package/dist/assets/{developer-page-ClPMK7n8.js → developer-page-DQs8SZ8K.js} +1 -1
- package/dist/assets/{devices-page-N9s-okC5.js → devices-page-VsRsz6XP.js} +1 -1
- package/dist/assets/{dictation-overlay-page-D_eJHI6R.js → dictation-overlay-page-C5HFJIsY.js} +1 -1
- package/dist/assets/{document-viewer-page-CmSYAtEc.js → document-viewer-page-BLBwWqM4.js} +1 -1
- package/dist/assets/{earn-credits-modal-OFm9gF2_.js → earn-credits-modal-Dig03UD-.js} +1 -1
- package/dist/assets/{emails-page-psWdsGCD.js → emails-page-D9R72EQW.js} +1 -1
- package/dist/assets/{file-editor-CKotrZYQ.js → file-editor-HQXiGdH-.js} +1 -1
- package/dist/assets/{general-page-CaAos_hp.js → general-page-CMr5RhNh.js} +1 -1
- package/dist/assets/{hatching-screen-CtgkoJwM.js → hatching-screen-BAzE4aGD.js} +1 -1
- package/dist/assets/{home-page-route-syOFwCBN.js → home-page-route-JenDSLBl.js} +1 -1
- package/dist/assets/{hosting-screen-Duoz3ECF.js → hosting-screen-dPfTLCnv.js} +1 -1
- package/dist/assets/{identity-page-route-gCgQUpAC.js → identity-page-route-r9ZgIw8g.js} +1 -1
- package/dist/assets/{index-LP2PV_QY.js → index-BiN-6kWM.js} +23 -23
- package/dist/assets/{inspect-page-CYszP4kv.js → inspect-page-2cNMjT4e.js} +1 -1
- package/dist/assets/{install-BK1MtTfb.js → install-CHMiF_Hw.js} +1 -1
- package/dist/assets/{integrations-page-8RrTqdmS.js → integrations-page-BiLM3QyR.js} +1 -1
- package/dist/assets/{intelligence-layout-DMxSxRZX.js → intelligence-layout-CjDxFKQO.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-q_QkRUkC.js → keyboard-shortcuts-page-DIhG1FK_.js} +1 -1
- package/dist/assets/{library-detail-page-_lrynJRj.js → library-detail-page-CjeBxuMc.js} +1 -1
- package/dist/assets/{library-page-CKh1x82Q.js → library-page-BFIPthR_.js} +1 -1
- package/dist/assets/{login-page-CDtyRiaq.js → login-page-KDH0IZ6y.js} +1 -1
- package/dist/assets/{logout-page-vdgRWyPg.js → logout-page-DI7i4Hok.js} +1 -1
- package/dist/assets/{logs-layout-btcFTD4i.js → logs-layout-BEMQQY7S.js} +1 -1
- package/dist/assets/{mcp-page-DdG8hp_Z.js → mcp-page-B7tUTzT0.js} +1 -1
- package/dist/assets/{memory-router-playground-page-Bt_KJsxN.js → memory-router-playground-page-JdkTEwPy.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-Cd68jgRD.js → mobile-sidebar-drawer-DuJUmy0b.js} +1 -1
- package/dist/assets/{notifications-page-BilkBeoP.js → notifications-page-CmOvbV59.js} +1 -1
- package/dist/assets/{oauth-complete-page-BC7UElNs.js → oauth-complete-page-R_1ODIIi.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-CiTNEvfk.js → oauth-popup-complete-page-YECuZtPs.js} +1 -1
- package/dist/assets/{pairing-page-Dc-5wQmY.js → pairing-page-BtaFWq0w.js} +1 -1
- package/dist/assets/{plugin-detail-page-CtWtIYBW.js → plugin-detail-page-D6Gve0qx.js} +1 -1
- package/dist/assets/{plugins-page-1vkkdBfG.js → plugins-page-DA-JrehF.js} +1 -1
- package/dist/assets/{prechat-route-CG8Qo2Tq.js → prechat-route-BhzvRsw3.js} +1 -1
- package/dist/assets/{privacy-page-rNHkqHfs.js → privacy-page-Yex5OJjZ.js} +1 -1
- package/dist/assets/{privacy-screen-Cck6z5wu.js → privacy-screen-ccjT4S0F.js} +1 -1
- package/dist/assets/{provider-callback-page-CrZXFWM7.js → provider-callback-page-BS-DqV_M.js} +1 -1
- package/dist/assets/{research-mock-page-D7-VpSBh.js → research-mock-page-D0-sKBpu.js} +1 -1
- package/dist/assets/{research-onboarding-route-DAPVTFHs.js → research-onboarding-route-ZTgUGnrN.js} +1 -1
- package/dist/assets/{review-terms-screen-C8XTIUYc.js → review-terms-screen-DLWgKysx.js} +1 -1
- package/dist/assets/{select-assistant-screen-PZqDGbI2.js → select-assistant-screen-LNX6PpzR.js} +1 -1
- package/dist/assets/{settings-layout-ByZKbs5J.js → settings-layout-BA0suokL.js} +1 -1
- package/dist/assets/{share-feedback-modal-CuxFlSR6.js → share-feedback-modal-CFgHvfgR.js} +1 -1
- package/dist/assets/{sidebar-tree-BZUv9ggX.js → sidebar-tree-DALLHIeG.js} +1 -1
- package/dist/assets/{signup-page-BWnAp0Bw.js → signup-page-13TRI3CC.js} +1 -1
- package/dist/assets/{skills-page-BAodqgt1.js → skills-page-DiopOlcy.js} +1 -1
- package/dist/assets/{sounds-page-hDPPoEEQ.js → sounds-page-DE47aZrz.js} +1 -1
- package/dist/assets/{step-indicator-dots-CwbobrxS.js → step-indicator-dots-BOKv1I4C.js} +1 -1
- package/dist/assets/{subagent-detail-panel-Db9feY1I.js → subagent-detail-panel-BdPp2LMK.js} +1 -1
- package/dist/assets/{system-events-page-DYi0jI1g.js → system-events-page-DcaF2EuX.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DD5B0bf0.js → tiptap-document-editor-DjIQ9tCC.js} +1 -1
- package/dist/assets/{tool-detail-panel-DZf8WIS6.js → tool-detail-panel-C6uFi3_6.js} +1 -1
- package/dist/assets/{trace-page-DSDi-YYp.js → trace-page-4MU66DDM.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-DHzkb9An.js → upgrade-cancel-page-D2-xTACq.js} +1 -1
- package/dist/assets/{upgrade-success-page-CIooZvxn.js → upgrade-success-page-DLjl6978.js} +1 -1
- package/dist/assets/{usage-page-XWL-WFaq.js → usage-page-CCBqWkRU.js} +1 -1
- package/dist/assets/{voice-page-BwA-ETwe.js → voice-page-VrJ7AZrg.js} +1 -1
- package/dist/assets/{weather-forecast-display-tzc5l6oR.js → weather-forecast-display-DKMPxDv5.js} +1 -1
- package/dist/assets/{welcome-screen-BkL_1qYq.js → welcome-screen-DVeLGZKg.js} +1 -1
- package/dist/assets/{workflow-detail-panel-DYQvTG3m.js → workflow-detail-panel-BgDWu3_4.js} +1 -1
- package/dist/assets/{workspace-page-t_8JOOXv.js → workspace-page-BlVlfXIt.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./dropdown-yOV5eJnU.js";import"./src-D6Nu2Lol.js";import{t as c}from"./sparkles-B9QIWdq0.js";import{t as l}from"./triangle-alert-M_S_Pe8C.js";import{er as u}from"./sdk.gen-Bew9wO5C.js";import{Dt as d,Et as f,Ot as ee,Tt as te,c as ne,d as re,ut as ie}from"./react-query.gen-DdB0sQgj.js";import{t as p}from"./api-errors-CwAGZ-xJ.js";import{Lt as ae,bt as m}from"./index-LP2PV_QY.js";import{t as h}from"./use-active-assistant-id-512RohBL.js";import{i as g,t as _}from"./format-B12w_G9l.js";import{i as v,o as y,r as b}from"./llm-dimension-Cs4q1Ovq.js";import{n as x}from"./usage-window-BO_9IIjX.js";import{n as oe,t as se}from"./schedules-DqkGi2Lm.js";var S=e(t(),1);function ce(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function C(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function le(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=C(t,e,n);return r===e.group?e:{...e,group:r}})}var w=6,T=`value:`,E=`null:`;function D(e,t=`schedule`){return e===null?`${E}${v(t)?y(t):t}`:`${T}${e}`}function O(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=j(e.bucketId),r=j(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function ue(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function de(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=C(t,A(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function k(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,w)}}function A(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount}}function j(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var M=o(),N=140,P=40,F=28,fe=2,pe=2,me=1e-6,I=12,L=220,R=56,he=[40,80,60,100,50,70,30],ge=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],z=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function B(e){return z[e%z.length]}function V(e){return e.displayLabel?e.displayLabel:e.date}function _e(e,t){let n=e+I,r=t+I;return n+L>window.innerWidth&&(n=e-L-I),r+R>window.innerHeight&&(r=t-R-I),{x:n,y:r}}function ve({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>O(e),[e]),o=(0,S.useMemo)(()=>k(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,S.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,S.useCallback)((e,t)=>{let n=_e(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,S.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,M.jsx)(Se,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,M.jsx)(H,{items:c})]})}let f=t?F:P;return(0,M.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(fe,N*t);return(0,M.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${V(e)}: ${_(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,M.jsx)(be,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,M.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:V(e)})]},e.bucketId))}),c.length>0?(0,M.jsx)(H,{items:c}):null]}),r?(0,M.jsx)(xe,{tooltip:r}):null]})}function ye({isHourly:e}){let t=e?ge:he,n=e?F:P;return(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function be({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:V(e),cost:_(e.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:B(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,M.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:V(e),cost:_(r.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(pe,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,me))}px`,background:B(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function xe({tooltip:e}){return(0,M.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,M.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,M.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function H({items:e}){return(0,M.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,M.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:B(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,M.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Se({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,M.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,M.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function U(e){return v(e)?y(e):e}function Ce(e){return G({from:e.from,to:e.to},e.scheduleId)}function we(e){return G({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function W(e){return G({from:e.from,to:e.to,groupBy:U(e.groupBy)},e.scheduleId)}function Te(e){return G({from:e.from,to:e.to,granularity:e.granularity,groupBy:U(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function G(e,t){return t?{...e,scheduleId:t}:e}function Ee(e){return[`${g(e.totalInputTokens)} direct`,`${g(e.totalCacheCreationTokens)} cache created`,`${g(e.totalCacheReadTokens)} cache read`,`${g(e.totalOutputTokens)} out`].join(` / `)}function K(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function De(e){return`${K(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${K(e.totalOutputTokens)} out`}var Oe=`task`,q=`model`,ke=new Set([400,404,422]),Ae=3,je=new Set([`today`,`7d`,`30d`,`90d`,`all`]),Me=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),J={task:b.task,profile:b.profile,model:b.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Ne=[{value:`task`,label:J.task},{value:`profile`,label:J.profile},{value:`model`,label:J.model},{value:`provider`,label:J.provider},{value:`schedule`,label:J.schedule},{value:`conversation`,label:J.conversation}];function Pe(e){let t=e.get(`range`),n=e.get(`groupBy`),r=Re(n)?n:Oe;return{range:Le(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Fe(e):void 0}}function Fe(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function Ie(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function Le(e){return e!=null&&je.has(e)}function Re(e){return e!=null&&Me.has(e)}function ze(e){return e!==`conversation`}function Be(e,t){return e!==`task`&&e!==`profile`?!1:Ve(t)}function Y(e,t){return!Ve(t)&&e<Ae}function Ve(e){return e instanceof p&&ke.has(e.status)}function He(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${J[t]}`}function Ue({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(We))?`hourly`:`daily`}function We(e){return e.bucketId.includes(`|`)||Ge(e.date)}function Ge(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function Ke(e,t,n=Date.now()){return x(e,t,n)}function qe(e){return e===`today`?`hourly`:`daily`}function Je({prompt:e,children:t,variant:i=`outlined`,size:a=`regular`,className:o}){let s=r(),l=(0,S.useCallback)(()=>{m(s,{prompt:e})},[s,e]);return(0,M.jsx)(n,{variant:i,size:a,leftIcon:(0,M.jsx)(c,{}),onClick:l,className:o,children:t})}var Ye=[{value:`today`,label:`Today`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],Xe=300*1e3,Ze=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),Qe=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function $e({assistantId:e}){let[t,n]=i(),{range:r,groupBy:o,scheduleId:s}=(0,S.useMemo)(()=>Pe(t),[t]),c=ae(),l=(0,S.useCallback)(e=>{n(t=>Ie(t,e),{replace:!0})},[n]),p=(0,S.useMemo)(()=>Ke(r,c),[r,c]),m=(0,S.useMemo)(()=>qe(r),[r]),h=a({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=a({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=a({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s})}),queryFn:async({signal:t})=>{try{let{data:n}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:o,response:n}}catch(n){if(!Be(o,n))throw n;let{data:r}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:q,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:q,response:r}}},retry:Y}),y=v.data?.groupBy??o,b=ze(y)?y:void 0,x=a({...d({path:{assistant_id:e},query:Te({from:p.from,to:p.to,granularity:m,groupBy:b??`actor`,tz:c,scheduleId:s})}),enabled:!!b,retry:Y}),C=a({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=a({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=a({...ne({path:{assistant_id:e}}),select:oe,enabled:y===`profile`,staleTime:Xe}),E=(0,S.useMemo)(()=>({callSites:ce(w.data),profiles:T.data??{}}),[w.data,T.data]),D=(0,S.useMemo)(()=>{let e=v.data;if(e)return le(e.response.breakdown,e.groupBy,E)},[v.data,E]),O=(0,S.useMemo)(()=>{if(!(!b||!x.data))return de(x.data.buckets,b,E)},[x.data,b,E]),k=(0,S.useMemo)(()=>{if(C.data)return ue(C.data.buckets)},[C.data]),A=(0,S.useMemo)(()=>b?x.error?k?{isLoading:!1,error:null,data:k,refetch:C.refetch}:{isLoading:C.isLoading||!k&&!C.error,error:C.error??x.error,data:void 0,refetch:C.error?C.refetch:x.refetch}:{isLoading:x.isLoading,error:x.error,data:O,refetch:x.refetch}:{isLoading:C.isLoading,error:C.error,data:k,refetch:C.refetch},[k,C.error,C.isLoading,C.refetch,O,b,x.error,x.isLoading,x.refetch]),j=Ue({requestedGranularity:m,isLoading:A.isLoading,buckets:A.data}),N=j===`hourly`,P=b&&x.error?void 0:y,F=(0,S.useMemo)(()=>{if(!(y!==`schedule`||!s))return et(h.data,s)},[y,s,h.data]);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(rt,{range:r,onChange:g})})]}),(0,M.jsx)(`section`,{"aria-label":`Totals`,children:(0,M.jsx)(Z,{query:_,skeleton:(0,M.jsx)(at,{}),render:e=>(0,M.jsx)(it,{totals:e})})}),(0,M.jsx)(X,{title:`Inference Usage`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:He(j,P)}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(ot,{value:y,onChange:e=>{e===o&&y!==o&&(v.refetch(),x.refetch()),l({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,M.jsx)(Z,{query:A,skeleton:(0,M.jsx)(ye,{isHourly:N}),render:e=>(0,M.jsx)(ve,{buckets:e,isHourly:N,legendItems:F})})]})}),(0,M.jsx)(st,{query:v,groups:D}),(0,M.jsx)(nt,{})]})}function et(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:tt(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:D(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function tt(e){return`Unknown schedule (${e})`}function nt(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,M.jsx)(X,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,M.jsx)(Je,{prompt:Ze,children:`Analyze costs with assistant`}),(0,M.jsx)(Je,{prompt:Qe,variant:`ghost`,children:`Optimize settings`})]})})]})}function rt({range:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,options:Ye.map(e=>({value:e.value,label:e.label}))})})}function X({title:e,subtitle:t,children:n}){return(0,M.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,M.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function Z({query:e,skeleton:t,render:n}){return e.isLoading?(0,M.jsx)(M.Fragment,{children:t}):e.error?(0,M.jsx)(ft,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,M.jsx)(M.Fragment,{children:n(e.data)}):(0,M.jsx)(M.Fragment,{children:t})}function it({totals:e}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:g(e.eventCount)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,M.jsx)(Q,{label:`Direct Input Tokens`,value:g(e.totalInputTokens)}),(0,M.jsx)(Q,{label:`Output Tokens`,value:g(e.totalOutputTokens)}),(0,M.jsx)(Q,{label:`Cache Created`,value:g(e.totalCacheCreationTokens)}),(0,M.jsx)(Q,{label:`Cache Read`,value:g(e.totalCacheReadTokens)})]})]})}function Q({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,M.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function at(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:140,height:30}),(0,M.jsx)($,{width:90,height:12})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:60,height:16}),(0,M.jsx)($,{width:60,height:12})]})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)($,{width:`50%`,height:12}),(0,M.jsx)($,{width:`70%`,height:11})]},t))})]})}function ot({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Ne.map(e=>({value:e.value,label:e.label}))})})}function st({query:e,groups:t}){let[n,r]=(0,S.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,M.jsx)(X,{title:`Breakdown`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(ct,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,M.jsx)(ct,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)})]}),(0,M.jsx)(Z,{query:e,skeleton:(0,M.jsx)(ut,{}),render:e=>(0,M.jsx)(lt,{groups:t??e.response.breakdown,showPct:n.has(`pct`),showTokens:n.has(`tokens`)})})]})})}function ct({label:e,active:t,onClick:n}){return(0,M.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function lt({groups:e,showPct:t,showTokens:n}){if(e.length===0)return(0,M.jsx)(dt,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let r=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,M.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,M.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),n?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,t?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,M.jsx)(`tbody`,{children:e.map((e,i)=>{let a=Ee(e),o=De(e),s=r>0?Math.round(e.totalEstimatedCostUsd/r*100):0;return(0,M.jsxs)(`tr`,{style:{borderTop:i===0?`none`:`1px solid var(--border-base)`},children:[(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),n?(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-small-default`,title:a,children:o})}):null,t?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[s,`%`]})}):null,(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${i}`)})})]})})}function ut(){return(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)($,{width:100,height:14}),(0,M.jsx)($,{width:`60%`,height:12}),(0,M.jsx)($,{width:50,height:14})]},t))})}function $({width:e,height:t}){return(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function dt({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,M.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function ft({message:e,onRetry:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(l,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function pt(){return(0,M.jsx)($e,{assistantId:h()})}export{pt as UsagePage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./dropdown-yOV5eJnU.js";import"./src-D6Nu2Lol.js";import{t as c}from"./sparkles-B9QIWdq0.js";import{t as l}from"./triangle-alert-M_S_Pe8C.js";import{er as u}from"./sdk.gen-Bew9wO5C.js";import{Dt as d,Et as f,Ot as ee,Tt as te,c as ne,d as re,ut as ie}from"./react-query.gen-DdB0sQgj.js";import{t as p}from"./api-errors-CwAGZ-xJ.js";import{Lt as ae,bt as m}from"./index-BiN-6kWM.js";import{t as h}from"./use-active-assistant-id-512RohBL.js";import{i as g,t as _}from"./format-B12w_G9l.js";import{i as v,o as y,r as b}from"./llm-dimension-Cs4q1Ovq.js";import{n as x}from"./usage-window-BO_9IIjX.js";import{n as oe,t as se}from"./schedules-DqkGi2Lm.js";var S=e(t(),1);function ce(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function C(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function le(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=C(t,e,n);return r===e.group?e:{...e,group:r}})}var w=6,T=`value:`,E=`null:`;function D(e,t=`schedule`){return e===null?`${E}${v(t)?y(t):t}`:`${T}${e}`}function O(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=j(e.bucketId),r=j(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function ue(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function de(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=C(t,A(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function k(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,w)}}function A(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount}}function j(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var M=o(),N=140,P=40,F=28,fe=2,pe=2,me=1e-6,I=12,L=220,R=56,he=[40,80,60,100,50,70,30],ge=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],z=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function B(e){return z[e%z.length]}function V(e){return e.displayLabel?e.displayLabel:e.date}function _e(e,t){let n=e+I,r=t+I;return n+L>window.innerWidth&&(n=e-L-I),r+R>window.innerHeight&&(r=t-R-I),{x:n,y:r}}function ve({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>O(e),[e]),o=(0,S.useMemo)(()=>k(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,S.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,S.useCallback)((e,t)=>{let n=_e(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,S.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,M.jsx)(Se,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,M.jsx)(H,{items:c})]})}let f=t?F:P;return(0,M.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(fe,N*t);return(0,M.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${V(e)}: ${_(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,M.jsx)(be,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,M.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:V(e)})]},e.bucketId))}),c.length>0?(0,M.jsx)(H,{items:c}):null]}),r?(0,M.jsx)(xe,{tooltip:r}):null]})}function ye({isHourly:e}){let t=e?ge:he,n=e?F:P;return(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function be({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:V(e),cost:_(e.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:B(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,M.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:V(e),cost:_(r.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(pe,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,me))}px`,background:B(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function xe({tooltip:e}){return(0,M.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,M.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,M.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function H({items:e}){return(0,M.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,M.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:B(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,M.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Se({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,M.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,M.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function U(e){return v(e)?y(e):e}function Ce(e){return G({from:e.from,to:e.to},e.scheduleId)}function we(e){return G({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function W(e){return G({from:e.from,to:e.to,groupBy:U(e.groupBy)},e.scheduleId)}function Te(e){return G({from:e.from,to:e.to,granularity:e.granularity,groupBy:U(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function G(e,t){return t?{...e,scheduleId:t}:e}function Ee(e){return[`${g(e.totalInputTokens)} direct`,`${g(e.totalCacheCreationTokens)} cache created`,`${g(e.totalCacheReadTokens)} cache read`,`${g(e.totalOutputTokens)} out`].join(` / `)}function K(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function De(e){return`${K(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${K(e.totalOutputTokens)} out`}var Oe=`task`,q=`model`,ke=new Set([400,404,422]),Ae=3,je=new Set([`today`,`7d`,`30d`,`90d`,`all`]),Me=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),J={task:b.task,profile:b.profile,model:b.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Ne=[{value:`task`,label:J.task},{value:`profile`,label:J.profile},{value:`model`,label:J.model},{value:`provider`,label:J.provider},{value:`schedule`,label:J.schedule},{value:`conversation`,label:J.conversation}];function Pe(e){let t=e.get(`range`),n=e.get(`groupBy`),r=Re(n)?n:Oe;return{range:Le(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Fe(e):void 0}}function Fe(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function Ie(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function Le(e){return e!=null&&je.has(e)}function Re(e){return e!=null&&Me.has(e)}function ze(e){return e!==`conversation`}function Be(e,t){return e!==`task`&&e!==`profile`?!1:Ve(t)}function Y(e,t){return!Ve(t)&&e<Ae}function Ve(e){return e instanceof p&&ke.has(e.status)}function He(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${J[t]}`}function Ue({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(We))?`hourly`:`daily`}function We(e){return e.bucketId.includes(`|`)||Ge(e.date)}function Ge(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function Ke(e,t,n=Date.now()){return x(e,t,n)}function qe(e){return e===`today`?`hourly`:`daily`}function Je({prompt:e,children:t,variant:i=`outlined`,size:a=`regular`,className:o}){let s=r(),l=(0,S.useCallback)(()=>{m(s,{prompt:e})},[s,e]);return(0,M.jsx)(n,{variant:i,size:a,leftIcon:(0,M.jsx)(c,{}),onClick:l,className:o,children:t})}var Ye=[{value:`today`,label:`Today`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],Xe=300*1e3,Ze=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),Qe=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function $e({assistantId:e}){let[t,n]=i(),{range:r,groupBy:o,scheduleId:s}=(0,S.useMemo)(()=>Pe(t),[t]),c=ae(),l=(0,S.useCallback)(e=>{n(t=>Ie(t,e),{replace:!0})},[n]),p=(0,S.useMemo)(()=>Ke(r,c),[r,c]),m=(0,S.useMemo)(()=>qe(r),[r]),h=a({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=a({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=a({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s})}),queryFn:async({signal:t})=>{try{let{data:n}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:o,response:n}}catch(n){if(!Be(o,n))throw n;let{data:r}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:q,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:q,response:r}}},retry:Y}),y=v.data?.groupBy??o,b=ze(y)?y:void 0,x=a({...d({path:{assistant_id:e},query:Te({from:p.from,to:p.to,granularity:m,groupBy:b??`actor`,tz:c,scheduleId:s})}),enabled:!!b,retry:Y}),C=a({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=a({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=a({...ne({path:{assistant_id:e}}),select:oe,enabled:y===`profile`,staleTime:Xe}),E=(0,S.useMemo)(()=>({callSites:ce(w.data),profiles:T.data??{}}),[w.data,T.data]),D=(0,S.useMemo)(()=>{let e=v.data;if(e)return le(e.response.breakdown,e.groupBy,E)},[v.data,E]),O=(0,S.useMemo)(()=>{if(!(!b||!x.data))return de(x.data.buckets,b,E)},[x.data,b,E]),k=(0,S.useMemo)(()=>{if(C.data)return ue(C.data.buckets)},[C.data]),A=(0,S.useMemo)(()=>b?x.error?k?{isLoading:!1,error:null,data:k,refetch:C.refetch}:{isLoading:C.isLoading||!k&&!C.error,error:C.error??x.error,data:void 0,refetch:C.error?C.refetch:x.refetch}:{isLoading:x.isLoading,error:x.error,data:O,refetch:x.refetch}:{isLoading:C.isLoading,error:C.error,data:k,refetch:C.refetch},[k,C.error,C.isLoading,C.refetch,O,b,x.error,x.isLoading,x.refetch]),j=Ue({requestedGranularity:m,isLoading:A.isLoading,buckets:A.data}),N=j===`hourly`,P=b&&x.error?void 0:y,F=(0,S.useMemo)(()=>{if(!(y!==`schedule`||!s))return et(h.data,s)},[y,s,h.data]);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(rt,{range:r,onChange:g})})]}),(0,M.jsx)(`section`,{"aria-label":`Totals`,children:(0,M.jsx)(Z,{query:_,skeleton:(0,M.jsx)(at,{}),render:e=>(0,M.jsx)(it,{totals:e})})}),(0,M.jsx)(X,{title:`Inference Usage`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:He(j,P)}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(ot,{value:y,onChange:e=>{e===o&&y!==o&&(v.refetch(),x.refetch()),l({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,M.jsx)(Z,{query:A,skeleton:(0,M.jsx)(ye,{isHourly:N}),render:e=>(0,M.jsx)(ve,{buckets:e,isHourly:N,legendItems:F})})]})}),(0,M.jsx)(st,{query:v,groups:D}),(0,M.jsx)(nt,{})]})}function et(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:tt(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:D(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function tt(e){return`Unknown schedule (${e})`}function nt(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,M.jsx)(X,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,M.jsx)(Je,{prompt:Ze,children:`Analyze costs with assistant`}),(0,M.jsx)(Je,{prompt:Qe,variant:`ghost`,children:`Optimize settings`})]})})]})}function rt({range:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,options:Ye.map(e=>({value:e.value,label:e.label}))})})}function X({title:e,subtitle:t,children:n}){return(0,M.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,M.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function Z({query:e,skeleton:t,render:n}){return e.isLoading?(0,M.jsx)(M.Fragment,{children:t}):e.error?(0,M.jsx)(ft,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,M.jsx)(M.Fragment,{children:n(e.data)}):(0,M.jsx)(M.Fragment,{children:t})}function it({totals:e}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:g(e.eventCount)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,M.jsx)(Q,{label:`Direct Input Tokens`,value:g(e.totalInputTokens)}),(0,M.jsx)(Q,{label:`Output Tokens`,value:g(e.totalOutputTokens)}),(0,M.jsx)(Q,{label:`Cache Created`,value:g(e.totalCacheCreationTokens)}),(0,M.jsx)(Q,{label:`Cache Read`,value:g(e.totalCacheReadTokens)})]})]})}function Q({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,M.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function at(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:140,height:30}),(0,M.jsx)($,{width:90,height:12})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:60,height:16}),(0,M.jsx)($,{width:60,height:12})]})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)($,{width:`50%`,height:12}),(0,M.jsx)($,{width:`70%`,height:11})]},t))})]})}function ot({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Ne.map(e=>({value:e.value,label:e.label}))})})}function st({query:e,groups:t}){let[n,r]=(0,S.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,M.jsx)(X,{title:`Breakdown`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(ct,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,M.jsx)(ct,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)})]}),(0,M.jsx)(Z,{query:e,skeleton:(0,M.jsx)(ut,{}),render:e=>(0,M.jsx)(lt,{groups:t??e.response.breakdown,showPct:n.has(`pct`),showTokens:n.has(`tokens`)})})]})})}function ct({label:e,active:t,onClick:n}){return(0,M.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function lt({groups:e,showPct:t,showTokens:n}){if(e.length===0)return(0,M.jsx)(dt,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let r=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,M.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,M.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),n?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,t?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,M.jsx)(`tbody`,{children:e.map((e,i)=>{let a=Ee(e),o=De(e),s=r>0?Math.round(e.totalEstimatedCostUsd/r*100):0;return(0,M.jsxs)(`tr`,{style:{borderTop:i===0?`none`:`1px solid var(--border-base)`},children:[(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),n?(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-small-default`,title:a,children:o})}):null,t?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[s,`%`]})}):null,(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${i}`)})})]})})}function ut(){return(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)($,{width:100,height:14}),(0,M.jsx)($,{width:`60%`,height:12}),(0,M.jsx)($,{width:50,height:14})]},t))})}function $({width:e,height:t}){return(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function dt({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,M.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function ft({message:e,onRetry:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(l,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function pt(){return(0,M.jsx)($e,{assistantId:h()})}export{pt as UsagePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./toggle-_vZlLDBV.js";import{t as u}from"./info-BJtskZc-.js";import{a as d}from"./routes-BKwsRssF.js";import{Gt as f,Ht as p,Jt as m,Kt as h,Ut as g,Vt as _,Wt as v,Xt as y,Yt as b,cn as x,qt as S,sn as C,yo as w}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./toggle-_vZlLDBV.js";import{t as u}from"./info-BJtskZc-.js";import{a as d}from"./routes-BKwsRssF.js";import{Gt as f,Ht as p,Jt as m,Kt as h,Ut as g,Vt as _,Wt as v,Xt as y,Yt as b,cn as x,qt as S,sn as C,yo as w}from"./index-BiN-6kWM.js";import{t as T}from"./detail-card-CLwQ17AA.js";var E=e(i(),1),D=s(),O=`vellum:voice:conversationTimeoutSeconds`,k=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],A={label:`Fn`,activator:g},j=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],M=`30`,N=`text-body-small-default text-[var(--content-tertiary)]`;function P(){return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsx)(F,{}),(0,D.jsx)(L,{}),(0,D.jsx)(R,{}),(0,D.jsx)(B,{})]})}function F(){return(0,D.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--field-bg)] px-3 py-2`,children:[(0,D.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,D.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,D.jsxs)(o,{to:d.settings.ai,className:`inline-flex items-center gap-1 text-body-medium-lighter text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Go to Models & Services`,(0,D.jsx)(w,{className:`h-3 w-3`})]})]})}var I=``;function L(){let[e,n]=(0,E.useState)([]),[i,o]=(0,E.useState)(!1),[s,l]=(0,E.useState)(()=>x()),u=(0,E.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{n([]),o(!1)}},[]),d=(0,E.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}u()},[u]);(0,E.useEffect)(()=>{u();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void u();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[u]);let f=(0,E.useMemo)(()=>[{value:I,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),p=(0,E.useCallback)(e=>{l(e),e===I?t(C):r(C,e)},[]);return(0,D.jsx)(T,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:f,value:f.some(e=>e.value===s)?s:I,onChange:p,"aria-label":`Microphone`})}),i&&(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(a,{variant:`outlined`,onClick:d,children:`Allow Microphone Access`}),(0,D.jsx)(`span`,{className:N,children:`Grant microphone access to list your available input devices.`})]})]})})}function R(){let e=_(),[t,i]=(0,E.useState)(()=>{let t=n(v,``);return t?m(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),x=(0,E.useRef)(!1),C=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),w=t.kind!==`off`,O=w&&!e,j=(0,E.useCallback)(e=>{i(e),r(v,b(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),x.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),x.current=!1},[]),F=(0,E.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),I=(0,E.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){P();return}let t=F(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?g.modifiers:y(t));return}if(t.includes(`function`)){j(g);return}x.current=!0,j({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[P,F,j]),L=(0,E.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(x.current){x.current=!1,c([]);return}F(e).length===0&&s.length>0&&j({kind:`modifierOnly`,modifiers:s})}},[F,a,s,j]);(0,E.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&P()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[P,a]);let R=w&&!C.some(e=>h(e.activator,t));return(0,D.jsx)(T,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(l,{checked:w,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:p):j({kind:`off`})},label:`Enable Push to Talk`}),w&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:N,children:`Activation Key:`}),(0,D.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?I:void 0,onKeyUp:a?L:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[C.map(e=>{let n=h(e.activator,t);return(0,D.jsx)(z,{label:e.label,selected:n,onClick:()=>j(e.activator)},e.label)}),a?(0,D.jsx)(z,{label:s.length>0?S(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?f(t):`Custom`,selected:R,onClick:M})]}),O&&(0,D.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,D.jsx)(u,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,D.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,D.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,D.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,D.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function B(){let[e,t]=(0,E.useState)(()=>{let e=n(O,M);return j.find(t=>t.value===e)?.value??M});return(0,D.jsx)(T,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:j,value:e,onChange:(0,E.useCallback)(e=>{t(e),r(O,e)},[]),"aria-label":`Conversation timeout`})})})}export{P as VoicePage};
|
package/dist/assets/{weather-forecast-display-tzc5l6oR.js → weather-forecast-display-DKMPxDv5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./moon-C0wLM1iN.js";import{A as i,Bi as a,Ji as o,M as s,N as c,Xa as l,Zi as u,ao as d,io as f,j as p,no as m,oo as h,ro as g,to as _}from"./index-LP2PV_QY.js";var v=e(t(),1),y={"sun.max.fill":{icon:o,className:`text-orange-500`},"cloud.sun.fill":{icon:m,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:f,className:`text-blue-400`},"cloud.fill":{icon:_,className:`text-stone-400`},"cloud.rain.fill":{icon:g,className:`text-blue-400`},snowflake:{icon:u,className:`text-blue-300`},"cloud.bolt.fill":{icon:d,className:`text-orange-500`},"cloud.fog.fill":{icon:h,className:`text-stone-400`}},b={sunny:{icon:o,className:`text-orange-500`},clear:{icon:o,className:`text-orange-500`},"partly cloudy":{icon:m,className:`text-amber-400`},"mostly sunny":{icon:m,className:`text-amber-400`},cloudy:{icon:_,className:`text-stone-400`},overcast:{icon:_,className:`text-stone-400`},rainy:{icon:g,className:`text-blue-400`},rain:{icon:g,className:`text-blue-400`},drizzle:{icon:g,className:`text-blue-400`},snow:{icon:u,className:`text-blue-300`},snowy:{icon:u,className:`text-blue-300`},thunderstorm:{icon:d,className:`text-orange-500`},thunder:{icon:d,className:`text-orange-500`},foggy:{icon:h,className:`text-stone-400`},fog:{icon:h,className:`text-stone-400`},mist:{icon:h,className:`text-stone-400`},hazy:{icon:h,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:o,className:`text-orange-500`},"mostly cloudy":{icon:_,className:`text-stone-400`},breezy:{icon:a,className:`text-stone-400`},windy:{icon:a,className:`text-stone-400`},cool:{icon:_,className:`text-stone-400`},warm:{icon:o,className:`text-orange-500`},hot:{icon:o,className:`text-orange-500`},cold:{icon:u,className:`text-blue-300`},"cold snap":{icon:u,className:`text-blue-300`},"warm, mostly sunny":{icon:m,className:`text-amber-400`},"cooler, breezy":{icon:a,className:`text-stone-400`}},x={icon:_,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function w(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=s(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=s(e.current),r=p(n?.temp)??p(e.currentTemp)??p(e.temperature)??p(e.temp),a=p(n?.feelsLike)??p(n?.feels_like)??p(n?.apparentTemperature)??p(e.feelsLike)??p(e.feels_like)??p(e.apparentTemperature),o=c(n?.condition)??c(e.condition),l=p(n?.humidity)??p(e.humidity),u=C(n?.wind??e.wind),d=p(n?.windSpeed)??p(n?.wind_speed)??p(e.windSpeed)??p(e.wind_speed)??u.speed,f=c(n?.windDirection)??c(n?.wind_direction)??c(e.windDirection)??c(e.wind_direction)??u.direction,m=s(e.units),h=c(m?.temperature)??c(n?.unit)??c(e.unit)??`F`,g=c(m?.speed)??c(e.windUnit)??c(e.wind_unit),_=i(e.hourly).map((e,t)=>({id:c(e.id)??String(t),time:c(e.time)??``,icon:c(e.icon)??c(e.condition)??`cloud.fill`,temp:p(e.tempC)??p(e.temp)??p(e.temperature),tempC:p(e.tempC)})),v=i([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:c(e.id)??String(t),day:c(e.day)??c(e.date),dayLabel:c(e.dayLabel)??c(e.date),icon:c(e.icon)??c(e.condition)??`cloud.fill`,low:p(e.low),high:p(e.high),lowC:p(e.lowC),highC:p(e.highC),precip:p(e.precip)??p(e.precipitation)??p(e.precipitationProbability),condition:c(e.condition)}));return{location:t,currentTemp:r,feelsLike:a,condition:o,humidity:l,windSpeed:d,windDirection:f,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`}`,children:`°F`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`}`,children:`°C`})]})}function P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,o=D(e.currentTemp,t,n),s=D(e.feelsLike,t,n),c=n?`F`:`C`,u=e.forecast?.[0],d=u?A(u,t,n):null,f=u?k(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),o!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[o,`°`,c]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[s!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,s,`°`]}),d!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(a,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(l,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L as WeatherForecastDisplay};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./moon-C0wLM1iN.js";import{A as i,Bi as a,Ji as o,M as s,N as c,Xa as l,Zi as u,ao as d,io as f,j as p,no as m,oo as h,ro as g,to as _}from"./index-BiN-6kWM.js";var v=e(t(),1),y={"sun.max.fill":{icon:o,className:`text-orange-500`},"cloud.sun.fill":{icon:m,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:f,className:`text-blue-400`},"cloud.fill":{icon:_,className:`text-stone-400`},"cloud.rain.fill":{icon:g,className:`text-blue-400`},snowflake:{icon:u,className:`text-blue-300`},"cloud.bolt.fill":{icon:d,className:`text-orange-500`},"cloud.fog.fill":{icon:h,className:`text-stone-400`}},b={sunny:{icon:o,className:`text-orange-500`},clear:{icon:o,className:`text-orange-500`},"partly cloudy":{icon:m,className:`text-amber-400`},"mostly sunny":{icon:m,className:`text-amber-400`},cloudy:{icon:_,className:`text-stone-400`},overcast:{icon:_,className:`text-stone-400`},rainy:{icon:g,className:`text-blue-400`},rain:{icon:g,className:`text-blue-400`},drizzle:{icon:g,className:`text-blue-400`},snow:{icon:u,className:`text-blue-300`},snowy:{icon:u,className:`text-blue-300`},thunderstorm:{icon:d,className:`text-orange-500`},thunder:{icon:d,className:`text-orange-500`},foggy:{icon:h,className:`text-stone-400`},fog:{icon:h,className:`text-stone-400`},mist:{icon:h,className:`text-stone-400`},hazy:{icon:h,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:o,className:`text-orange-500`},"mostly cloudy":{icon:_,className:`text-stone-400`},breezy:{icon:a,className:`text-stone-400`},windy:{icon:a,className:`text-stone-400`},cool:{icon:_,className:`text-stone-400`},warm:{icon:o,className:`text-orange-500`},hot:{icon:o,className:`text-orange-500`},cold:{icon:u,className:`text-blue-300`},"cold snap":{icon:u,className:`text-blue-300`},"warm, mostly sunny":{icon:m,className:`text-amber-400`},"cooler, breezy":{icon:a,className:`text-stone-400`}},x={icon:_,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function w(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=s(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=s(e.current),r=p(n?.temp)??p(e.currentTemp)??p(e.temperature)??p(e.temp),a=p(n?.feelsLike)??p(n?.feels_like)??p(n?.apparentTemperature)??p(e.feelsLike)??p(e.feels_like)??p(e.apparentTemperature),o=c(n?.condition)??c(e.condition),l=p(n?.humidity)??p(e.humidity),u=C(n?.wind??e.wind),d=p(n?.windSpeed)??p(n?.wind_speed)??p(e.windSpeed)??p(e.wind_speed)??u.speed,f=c(n?.windDirection)??c(n?.wind_direction)??c(e.windDirection)??c(e.wind_direction)??u.direction,m=s(e.units),h=c(m?.temperature)??c(n?.unit)??c(e.unit)??`F`,g=c(m?.speed)??c(e.windUnit)??c(e.wind_unit),_=i(e.hourly).map((e,t)=>({id:c(e.id)??String(t),time:c(e.time)??``,icon:c(e.icon)??c(e.condition)??`cloud.fill`,temp:p(e.tempC)??p(e.temp)??p(e.temperature),tempC:p(e.tempC)})),v=i([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:c(e.id)??String(t),day:c(e.day)??c(e.date),dayLabel:c(e.dayLabel)??c(e.date),icon:c(e.icon)??c(e.condition)??`cloud.fill`,low:p(e.low),high:p(e.high),lowC:p(e.lowC),highC:p(e.highC),precip:p(e.precip)??p(e.precipitation)??p(e.precipitationProbability),condition:c(e.condition)}));return{location:t,currentTemp:r,feelsLike:a,condition:o,humidity:l,windSpeed:d,windDirection:f,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`}`,children:`°F`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`px-2 py-0.5 text-body-small-default transition-colors ${e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`}`,children:`°C`})]})}function P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,o=D(e.currentTemp,t,n),s=D(e.feelsLike,t,n),c=n?`F`:`C`,u=e.forecast?.[0],d=u?A(u,t,n):null,f=u?k(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),o!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[o,`°`,c]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[s!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,s,`°`]}),d!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(a,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,j.jsx)(l,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L as WeatherForecastDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{c as r}from"./local-mode-9ZkSq1Fr.js";import{a as i}from"./routes-BKwsRssF.js";import{t as a}from"./use-onboarding-login-CxXV3Iue.js";import{ft as o}from"./index-
|
|
1
|
+
import{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{c as r}from"./local-mode-9ZkSq1Fr.js";import{a as i}from"./routes-BKwsRssF.js";import{t as a}from"./use-onboarding-login-CxXV3Iue.js";import{ft as o}from"./index-BiN-6kWM.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./cn-DvW5mxZR.js";import{t as a}from"./typography-BscuIPxA.js";import"./src-D6Nu2Lol.js";import{n as o,r as s,t as c}from"./metric-card-B3EBP9m4.js";import{t as l}from"./ban-BMsomjPu.js";import{t as u}from"./circle-check-D3yd2el7.js";import{t as d}from"./loader-circle-CTs38Ovl.js";import{t as f}from"./triangle-alert-M_S_Pe8C.js";import{t as p}from"./x-Dz7msELe.js";import{Ct as m,Hi as h,St as g,xo as _,xt as v,zi as y}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./cn-DvW5mxZR.js";import{t as a}from"./typography-BscuIPxA.js";import"./src-D6Nu2Lol.js";import{n as o,r as s,t as c}from"./metric-card-B3EBP9m4.js";import{t as l}from"./ban-BMsomjPu.js";import{t as u}from"./circle-check-D3yd2el7.js";import{t as d}from"./loader-circle-CTs38Ovl.js";import{t as f}from"./triangle-alert-M_S_Pe8C.js";import{t as p}from"./x-Dz7msELe.js";import{Ct as m,Hi as h,St as g,xo as _,xt as v,zi as y}from"./index-BiN-6kWM.js";var b=e(t(),1),x=r();function S({status:e}){let t=g(e);return(0,x.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-0.5 text-label-small-default`,style:{color:t,backgroundColor:`color-mix(in srgb, ${t} 15%, transparent)`},children:m(e)})}function C({status:e}){let t=`h-3.5 w-3.5 shrink-0`;switch(e){case`completed`:return(0,x.jsx)(u,{className:t,style:{color:`var(--system-positive-strong)`}});case`failed`:return(0,x.jsx)(f,{className:t,style:{color:`var(--system-negative-strong)`}});case`cancelled`:return(0,x.jsx)(l,{className:t,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`});default:return(0,x.jsx)(d,{className:`${t} animate-spin`,style:{color:`var(--primary-base)`}})}}function w({leaf:e}){let[t,n]=(0,b.useState)(!1),r=!!e.resultSummary,i=e.label??`Leaf ${e.seq}`;return(0,x.jsxs)(`div`,{className:`rounded-lg bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 text-left disabled:cursor-default`,children:[(0,x.jsx)(C,{status:e.status}),(0,x.jsx)(a,{variant:`body-medium-default`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:i}),r&&(0,x.jsx)(a,{variant:`body-small-default`,className:`shrink-0 text-[var(--content-tertiary)]`,children:t?`Hide`:`Details`})]}),e.promptSummary&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-1 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.promptSummary}),r&&t&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-2 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.resultSummary})]})}function T({leaves:e}){let t=[...e.values()].sort((e,t)=>e.seq-t.seq);return t.length===0?(0,x.jsx)(a,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No agents yet`}):(0,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(e=>(0,x.jsx)(w,{leaf:e},e.seq))})}function E({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let u=v(e.status),d=e.label??e.runId,f=e.agentsSpawned||e.leaves.size,m=u?`live`:`final`;return(0,b.useEffect)(()=>{l?.(e.runId)},[e.runId,m,l]),(0,x.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] px-5 py-4`,children:[(0,x.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-overlay)]`,children:(0,x.jsx)(y,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,x.jsx)(a,{variant:`title-medium`,title:d,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:d}),(0,x.jsx)(S,{status:e.status}),(0,x.jsx)(`span`,{className:`flex-1`}),u&&r&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Stop workflow`,onClick:()=>r(e.runId),className:`flex shrink-0 cursor-pointer items-center gap-1.5 rounded-lg bg-[var(--system-negative-strong)] px-3 py-1.5 text-white transition-colors hover:bg-[color-mix(in_srgb,var(--system-negative-strong)_85%,black)]`,children:(0,x.jsx)(a,{variant:`label-small-default`,className:`text-white`,children:`Stop`})}),(0,x.jsx)(n,{variant:`ghost`,iconOnly:(0,x.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0`})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:[(0,x.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,x.jsx)(c,{icon:(0,x.jsx)(_,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,x.jsx)(c,{icon:(0,x.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,x.jsx)(c,{icon:(0,x.jsx)(h,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:f,format:e=>o(Math.round(e)),label:`Agents`})]}),(e.phase||e.message)&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[e.phase&&(0,x.jsx)(a,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e.phase}),e.message&&(0,x.jsx)(a,{variant:`body-small-default`,as:`p`,className:i(`whitespace-pre-wrap break-words text-[var(--content-secondary)]`,e.phase&&`mt-1`),children:e.message})]}),e.summary&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsx)(a,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:`Summary`}),(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.summary})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(a,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Agents`}),(0,x.jsx)(T,{leaves:e.leaves})]})]})]})}export{E as WorkflowDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./menu-BvyV91Np.js";import{a as u}from"./src-D6Nu2Lol.js";import{t as d}from"./confirm-dialog-DbNUkFt6.js";import{t as f}from"./input-CwdmSRlD.js";import{t as p}from"./modal-DX6UN7b0.js";import{n as m,t as h}from"./panel-item-BFOUNXY1.js";import{t as g}from"./createLucideIcon-DIlBzeWM.js";import{t as _}from"./chevron-right-HpmykQ8I.js";import{t as v}from"./loader-circle-CTs38Ovl.js";import{t as y}from"./pencil-lwgMCqyH.js";import{t as b}from"./x-Dz7msELe.js";import{cr as x,dr as S,fr as C,lr as w,pr as T,sr as E,ur as D}from"./sdk.gen-Bew9wO5C.js";import{n as O}from"./use-is-mobile-CvT53Qs1.js";import{Ga as k,H as A,Ha as j,Ja as M,Ki as N,Ra as P,U as F,Ua as I,Vi as L,Wa as R,aa as ee,mo as z,pa as B,qa as te}from"./index-LP2PV_QY.js";import{t as V}from"./use-active-assistant-id-512RohBL.js";import{n as ne,t as H}from"./mobile-sidebar-drawer-Cd68jgRD.js";import{i as U,n as W,r as G,t as K}from"./file-editor-CKotrZYQ.js";import{t as q}from"./format-file-size-DxhjMSDx.js";var re=g(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ie=g(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),ae=g(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),J=g(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Y=e(t(),1);function oe(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function se(e,t){return oe(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function ce(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function X(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Z=s();function le(e){return c({queryFn:async()=>{let{data:t,error:n}=await w({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function ue({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=R;return n.startsWith(`image/`)?r=P:n.startsWith(`video/`)?r=L:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=I),(0,Z.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Z.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function de({viewMode:e,onChange:t}){return(0,Z.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Z.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function Q({name:e,mimeType:t,size:n,rightContent:r}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(ue,{mimeType:t}),(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:q(n)})]}),r]})}function fe({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await x({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function pe({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...le({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),y(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Y.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),y(e=>e!=null&&t(e.path)?null:e)},[d]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,C=()=>{g(null),y(null)},w=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await T({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),y(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,Y.useCallback)(()=>{t&&E&&!w.isPending&&w.mutate({path:t,content:S})},[t,E,w,S]);if(!t)return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Z.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Z.jsx)(ae,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,k=p.name??t.split(`/`).pop()??t,j=F(k,O),M=se(k,O),N=p.content!=null&&!j&&!M,P=t?X(t):!0,L=b&&(0,Z.jsx)(W,{isDirty:E,isSaving:w.isPending,error:w.isError?`Save failed`:null,onSave:D,onDiscard:C});if(j&&p.content!=null){let e=b?S:p.content;return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(A,{content:e})}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),L]})}if(M&&p.content!=null){let e=b?S:p.content,n=ce(e);return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:s===`preview`?n:e,downloadContent:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(U,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),L]})}return N?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:b?S:p.content??``,fileName:k,mimeType:O,showEdit:!P,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),L]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Z.jsx)(fe,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Z.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Z.jsx)(I,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Z.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:k}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:O}),(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:q(p.size,`Unknown size`)}),p.modifiedAt&&(0,Z.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(p.modifiedAt).toLocaleString()]})]})]})})]})}function me(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function he(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await C({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function ge(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await C({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function _e({entry:e}){return e.type===`directory`?(0,Z.jsx)(j,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Z.jsx)(P,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Z.jsx)(L,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(R,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function ve({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,b=n.has(h),x=r===h,S=g.startsWith(`.`),C=!X(h),w=v&&(b||s.length>0),{data:T}=a({...he({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,Y.useMemo)(()=>me(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Z.jsxs)(`button`,{onClick:()=>{v?c(h):l(h)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${m*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?w?(0,Z.jsx)(z,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Z.jsx)(_e,{entry:e}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:q(e.size)})]});return(0,Z.jsxs)(`div`,{children:[C?(0,Z.jsxs)(u.Root,{children:[(0,Z.jsx)(u.Trigger,{children:O}),(0,Z.jsxs)(u.Content,{children:[v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(k,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Z.jsx)(u.Separator,{})]}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(N,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(y,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Z.jsx)(`div`,{children:E.map(e=>(0,Z.jsx)(ve,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m+1},e.path))})]})}function ye({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Y.useRef)(null),[d,m]=(0,Y.useState)(a??``),h=d.trim(),g=h.length>0&&(/[/\\]/.test(h)||h===`.`||h===`..`),_=h.length>0&&!g&&!c;return(0,Z.jsx)(p.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Z.jsx)(p.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(h)},children:[(0,Z.jsx)(p.Header,{children:(0,Z.jsx)(p.Title,{children:e})}),(0,Z.jsx)(p.Body,{children:(0,Z.jsx)(f,{ref:u,label:`Name`,value:d,onChange:e=>m(e.target.value),placeholder:t,errorText:l??(g?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Z.jsxs)(p.Footer,{children:[(0,Z.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function $({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:p,onToggleShowHidden:m,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,x]=(0,Y.useState)(``),C=y.trim().toLowerCase(),[w,O]=(0,Y.useState)(!1),[k,A]=(0,Y.useState)(null),[j,N]=(0,Y.useState)(null),P=(0,Y.useCallback)(()=>{A(null),N(null)},[]),{data:F,isLoading:I}=a(he({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Y.useMemo)(()=>me(F?.entries??[],c),[F?.entries,c]),R=(0,Y.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),z=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await ge(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await T({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await D({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{P(),R(),e.parentPath&&u(e.parentPath),e.kind===`file`?p(e.path):u(e.path)},onError:e=>{N(e instanceof Error?e.message:`Failed to create.`)}}),B=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await ge(e,r,t.newName,i);let{error:o,response:s}=await S({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{P(),R(),_(e,t)},onError:e=>{N(e instanceof Error?e.message:`Failed to rename.`)}}),V=(0,Y.useCallback)(e=>{N(null),A({type:`create`,...e})},[]),ne=(0,Y.useCallback)(e=>{N(null),A({type:`rename`,path:e.path,name:e.name})},[]),[H,U]=(0,Y.useState)(null),W=o({mutationFn:async t=>{let{error:n,response:r}=await E({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{U(null),R(),g(e.path)}}),G=(0,Y.useCallback)(e=>{W.reset(),U(e)},[W]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Z.jsx)(ie,{"aria-hidden":!0}):(0,Z.jsx)(re,{"aria-hidden":!0}),onClick:()=>h(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Z.jsx)(te,{"aria-hidden":!0}):(0,Z.jsx)(M,{"aria-hidden":!0}),onClick:m,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(be,{open:w,onOpenChange:O,onSelectKind:e=>{O(!1),V({kind:e,parentPath:``})}})]})]}),(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(f,{type:`text`,value:y,onChange:e=>x(e.target.value),placeholder:`Search files`,leftIcon:(0,Z.jsx)(ee,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(b,{"aria-hidden":!0}),onClick:()=>x(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:I?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):L.length?L.map(n=>(0,Z.jsx)(ve,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:C,onToggleExpand:l,onSelectPath:p,onRequestDelete:G,onRequestRename:ne,onRequestCreate:V,depth:0},n.path)):(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Z.jsx)(ye,{title:k.kind===`file`?`New File`:`New Folder`,placeholder:k.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:P,onConfirm:e=>{N(null),z.mutate({kind:k.kind,parentPath:k.parentPath,name:e})},pending:z.isPending,error:j},`create-${k.kind}-${k.parentPath}`),k?.type===`rename`&&(0,Z.jsx)(ye,{title:`Rename`,placeholder:k.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:k.name,onCancel:P,onConfirm:e=>{if(e===k.name){P();return}N(null),B.mutate({oldPath:k.path,newName:e})},pending:B.isPending,error:j},`rename-${k.path}`),(0,Z.jsx)(d,{open:H!==null,title:H?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Z.jsx)(`span`,{style:{color:`var(--content-default)`},children:H?.name}),H?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,W.error&&(0,Z.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:W.error.message})]}),confirmLabel:W.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:W.isPending,onConfirm:()=>{H&&W.mutate(H)},onCancel:()=>U(null)})]})}function be({open:e,onOpenChange:t,onSelectKind:r}){return O()?(0,Z.jsxs)(m.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(m.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(B,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(m.Content,{children:[(0,Z.jsx)(m.Header,{className:`sr-only`,children:(0,Z.jsx)(m.Title,{children:`Create new`})}),(0,Z.jsxs)(m.Body,{className:`pt-0`,children:[(0,Z.jsx)(h,{icon:k,label:`New File`,onSelect:()=>r(`file`)}),(0,Z.jsx)(h,{icon:J,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Z.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(l.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(B,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(k,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function xe(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Se({assistantId:e}){let[t,n]=r(),[i,a]=(0,Y.useState)(()=>{let e=t.get(`file`);return e?xe(e):new Set}),[o,s]=(0,Y.useState)(()=>t.get(`file`)),[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Y.useState)(`preview`);(0,Y.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Y.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Y.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Y.useState)(!1),v=(0,Y.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Y.useState)(null),x=(0,Y.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Y.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Y.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Z.jsx)(ne,{onClick:()=>_(!0)})}),(0,Z.jsx)(H,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Z.jsx)($,{...w})}),(0,Z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Z.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)($,{...w})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)(pe,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function Ce(){return(0,Z.jsx)(Se,{assistantId:V()})}export{Ce as WorkspacePage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./menu-BvyV91Np.js";import{a as u}from"./src-D6Nu2Lol.js";import{t as d}from"./confirm-dialog-DbNUkFt6.js";import{t as f}from"./input-CwdmSRlD.js";import{t as p}from"./modal-DX6UN7b0.js";import{n as m,t as h}from"./panel-item-BFOUNXY1.js";import{t as g}from"./createLucideIcon-DIlBzeWM.js";import{t as _}from"./chevron-right-HpmykQ8I.js";import{t as v}from"./loader-circle-CTs38Ovl.js";import{t as y}from"./pencil-lwgMCqyH.js";import{t as b}from"./x-Dz7msELe.js";import{cr as x,dr as S,fr as C,lr as w,pr as T,sr as E,ur as D}from"./sdk.gen-Bew9wO5C.js";import{n as O}from"./use-is-mobile-CvT53Qs1.js";import{Ga as k,H as A,Ha as j,Ja as M,Ki as N,Ra as P,U as F,Ua as I,Vi as L,Wa as R,aa as ee,mo as z,pa as B,qa as te}from"./index-BiN-6kWM.js";import{t as V}from"./use-active-assistant-id-512RohBL.js";import{n as ne,t as H}from"./mobile-sidebar-drawer-DuJUmy0b.js";import{i as U,n as W,r as G,t as K}from"./file-editor-HQXiGdH-.js";import{t as q}from"./format-file-size-DxhjMSDx.js";var re=g(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ie=g(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),ae=g(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),J=g(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Y=e(t(),1);function oe(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function se(e,t){return oe(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function ce(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function X(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Z=s();function le(e){return c({queryFn:async()=>{let{data:t,error:n}=await w({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function ue({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=R;return n.startsWith(`image/`)?r=P:n.startsWith(`video/`)?r=L:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=I),(0,Z.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Z.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function de({viewMode:e,onChange:t}){return(0,Z.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Z.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function Q({name:e,mimeType:t,size:n,rightContent:r}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(ue,{mimeType:t}),(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:q(n)})]}),r]})}function fe({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await x({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function pe({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...le({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),y(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Y.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),y(e=>e!=null&&t(e.path)?null:e)},[d]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,C=()=>{g(null),y(null)},w=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await T({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),y(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,Y.useCallback)(()=>{t&&E&&!w.isPending&&w.mutate({path:t,content:S})},[t,E,w,S]);if(!t)return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Z.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Z.jsx)(ae,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,k=p.name??t.split(`/`).pop()??t,j=F(k,O),M=se(k,O),N=p.content!=null&&!j&&!M,P=t?X(t):!0,L=b&&(0,Z.jsx)(W,{isDirty:E,isSaving:w.isPending,error:w.isError?`Save failed`:null,onSave:D,onDiscard:C});if(j&&p.content!=null){let e=b?S:p.content;return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(A,{content:e})}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),L]})}if(M&&p.content!=null){let e=b?S:p.content,n=ce(e);return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:s===`preview`?n:e,downloadContent:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(U,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),L]})}return N?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:b?S:p.content??``,fileName:k,mimeType:O,showEdit:!P,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),L]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Z.jsx)(fe,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Z.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Z.jsx)(I,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Z.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:k}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:O}),(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:q(p.size,`Unknown size`)}),p.modifiedAt&&(0,Z.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(p.modifiedAt).toLocaleString()]})]})]})})]})}function me(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function he(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await C({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function ge(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await C({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function _e({entry:e}){return e.type===`directory`?(0,Z.jsx)(j,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Z.jsx)(P,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Z.jsx)(L,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(R,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function ve({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,b=n.has(h),x=r===h,S=g.startsWith(`.`),C=!X(h),w=v&&(b||s.length>0),{data:T}=a({...he({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,Y.useMemo)(()=>me(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Z.jsxs)(`button`,{onClick:()=>{v?c(h):l(h)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${m*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?w?(0,Z.jsx)(z,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Z.jsx)(_e,{entry:e}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:q(e.size)})]});return(0,Z.jsxs)(`div`,{children:[C?(0,Z.jsxs)(u.Root,{children:[(0,Z.jsx)(u.Trigger,{children:O}),(0,Z.jsxs)(u.Content,{children:[v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(k,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Z.jsx)(u.Separator,{})]}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(N,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(y,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Z.jsx)(`div`,{children:E.map(e=>(0,Z.jsx)(ve,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m+1},e.path))})]})}function ye({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Y.useRef)(null),[d,m]=(0,Y.useState)(a??``),h=d.trim(),g=h.length>0&&(/[/\\]/.test(h)||h===`.`||h===`..`),_=h.length>0&&!g&&!c;return(0,Z.jsx)(p.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Z.jsx)(p.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(h)},children:[(0,Z.jsx)(p.Header,{children:(0,Z.jsx)(p.Title,{children:e})}),(0,Z.jsx)(p.Body,{children:(0,Z.jsx)(f,{ref:u,label:`Name`,value:d,onChange:e=>m(e.target.value),placeholder:t,errorText:l??(g?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Z.jsxs)(p.Footer,{children:[(0,Z.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function $({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:p,onToggleShowHidden:m,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,x]=(0,Y.useState)(``),C=y.trim().toLowerCase(),[w,O]=(0,Y.useState)(!1),[k,A]=(0,Y.useState)(null),[j,N]=(0,Y.useState)(null),P=(0,Y.useCallback)(()=>{A(null),N(null)},[]),{data:F,isLoading:I}=a(he({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Y.useMemo)(()=>me(F?.entries??[],c),[F?.entries,c]),R=(0,Y.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),z=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await ge(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await T({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await D({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{P(),R(),e.parentPath&&u(e.parentPath),e.kind===`file`?p(e.path):u(e.path)},onError:e=>{N(e instanceof Error?e.message:`Failed to create.`)}}),B=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await ge(e,r,t.newName,i);let{error:o,response:s}=await S({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{P(),R(),_(e,t)},onError:e=>{N(e instanceof Error?e.message:`Failed to rename.`)}}),V=(0,Y.useCallback)(e=>{N(null),A({type:`create`,...e})},[]),ne=(0,Y.useCallback)(e=>{N(null),A({type:`rename`,path:e.path,name:e.name})},[]),[H,U]=(0,Y.useState)(null),W=o({mutationFn:async t=>{let{error:n,response:r}=await E({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{U(null),R(),g(e.path)}}),G=(0,Y.useCallback)(e=>{W.reset(),U(e)},[W]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Z.jsx)(ie,{"aria-hidden":!0}):(0,Z.jsx)(re,{"aria-hidden":!0}),onClick:()=>h(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Z.jsx)(te,{"aria-hidden":!0}):(0,Z.jsx)(M,{"aria-hidden":!0}),onClick:m,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(be,{open:w,onOpenChange:O,onSelectKind:e=>{O(!1),V({kind:e,parentPath:``})}})]})]}),(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(f,{type:`text`,value:y,onChange:e=>x(e.target.value),placeholder:`Search files`,leftIcon:(0,Z.jsx)(ee,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(b,{"aria-hidden":!0}),onClick:()=>x(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:I?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):L.length?L.map(n=>(0,Z.jsx)(ve,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:C,onToggleExpand:l,onSelectPath:p,onRequestDelete:G,onRequestRename:ne,onRequestCreate:V,depth:0},n.path)):(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Z.jsx)(ye,{title:k.kind===`file`?`New File`:`New Folder`,placeholder:k.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:P,onConfirm:e=>{N(null),z.mutate({kind:k.kind,parentPath:k.parentPath,name:e})},pending:z.isPending,error:j},`create-${k.kind}-${k.parentPath}`),k?.type===`rename`&&(0,Z.jsx)(ye,{title:`Rename`,placeholder:k.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:k.name,onCancel:P,onConfirm:e=>{if(e===k.name){P();return}N(null),B.mutate({oldPath:k.path,newName:e})},pending:B.isPending,error:j},`rename-${k.path}`),(0,Z.jsx)(d,{open:H!==null,title:H?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Z.jsx)(`span`,{style:{color:`var(--content-default)`},children:H?.name}),H?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,W.error&&(0,Z.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:W.error.message})]}),confirmLabel:W.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:W.isPending,onConfirm:()=>{H&&W.mutate(H)},onCancel:()=>U(null)})]})}function be({open:e,onOpenChange:t,onSelectKind:r}){return O()?(0,Z.jsxs)(m.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(m.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(B,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(m.Content,{children:[(0,Z.jsx)(m.Header,{className:`sr-only`,children:(0,Z.jsx)(m.Title,{children:`Create new`})}),(0,Z.jsxs)(m.Body,{className:`pt-0`,children:[(0,Z.jsx)(h,{icon:k,label:`New File`,onSelect:()=>r(`file`)}),(0,Z.jsx)(h,{icon:J,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Z.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(l.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(B,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(k,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function xe(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Se({assistantId:e}){let[t,n]=r(),[i,a]=(0,Y.useState)(()=>{let e=t.get(`file`);return e?xe(e):new Set}),[o,s]=(0,Y.useState)(()=>t.get(`file`)),[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Y.useState)(`preview`);(0,Y.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Y.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Y.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Y.useState)(!1),v=(0,Y.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Y.useState)(null),x=(0,Y.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Y.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Y.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Z.jsx)(ne,{onClick:()=>_(!0)})}),(0,Z.jsx)(H,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Z.jsx)($,{...w})}),(0,Z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Z.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)($,{...w})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)(pe,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function Ce(){return(0,Z.jsx)(Se,{assistantId:V()})}export{Ce as WorkspacePage};
|
package/dist/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="apple-touch-icon" href="/assistant/favicon.svg" />
|
|
11
11
|
<title>Vellum Assistant</title>
|
|
12
12
|
<script src="/assistant/theme-init.js"></script>
|
|
13
|
-
<script type="module" crossorigin src="/assistant/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assistant/assets/index-BiN-6kWM.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assistant/assets/chunk-jRWAZmH_.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assistant/assets/preload-helper-BewR0kVT.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assistant/assets/dist-nMnxT9pm.js">
|