@lunora/studio 1.0.0-alpha.362 → 1.0.0-alpha.363
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/standalone/{chunk-J6XQKD2F.js → chunk-32V7XGNC.js} +1 -1
- package/dist/standalone/{chunk-Q2J73V2C.js → chunk-4L55URI5.js} +1 -1
- package/dist/standalone/{chunk-FBDIQ67D.js → chunk-4N76XUNG.js} +1 -1
- package/dist/standalone/{chunk-6KE7ILEZ.js → chunk-53XKGQEE.js} +1 -1
- package/dist/standalone/{chunk-7KJCRT4B.js → chunk-5QUTVSHM.js} +1 -1
- package/dist/standalone/{chunk-MJTVTUNI.js → chunk-5RX5CQSU.js} +1 -1
- package/dist/standalone/{chunk-ZG3IUVQ2.js → chunk-5Z2U4KBN.js} +1 -1
- package/dist/standalone/{chunk-ZKEYRU5C.js → chunk-75TRPM7O.js} +1 -1
- package/dist/standalone/{chunk-GC3GKGWD.js → chunk-7MLX5CGD.js} +1 -1
- package/dist/standalone/{chunk-BO5NNWMO.js → chunk-7TQ7BZ67.js} +1 -1
- package/dist/standalone/{chunk-H7BQUL7D.js → chunk-AD5J2ANS.js} +1 -1
- package/dist/standalone/{chunk-COLSZPCE.js → chunk-ALR4VAUE.js} +1 -1
- package/dist/standalone/{chunk-5EWIOOBI.js → chunk-AXE2SDRU.js} +1 -1
- package/dist/standalone/{chunk-JENPPZFV.js → chunk-BAEIW3YS.js} +1 -1
- package/dist/standalone/{chunk-BX7TFVCC.js → chunk-BBDTJG2K.js} +1 -1
- package/dist/standalone/{chunk-ZFQ253FX.js → chunk-BI6MZHZJ.js} +1 -1
- package/dist/standalone/{chunk-EE2COWFF.js → chunk-CP7QNLR4.js} +1 -1
- package/dist/standalone/{chunk-OP4QEV27.js → chunk-D57B4MFK.js} +1 -1
- package/dist/standalone/{chunk-53CGUTRT.js → chunk-DZFXH55R.js} +1 -1
- package/dist/standalone/{chunk-J3BZWYJQ.js → chunk-EPWCW2DF.js} +1 -1
- package/dist/standalone/{chunk-PAZKX7I6.js → chunk-FJLRSFTE.js} +1 -1
- package/dist/standalone/{chunk-L26RMC2W.js → chunk-FVCBNFQW.js} +1 -1
- package/dist/standalone/{chunk-UW6QNC74.js → chunk-GVQPNM3T.js} +1 -1
- package/dist/standalone/{chunk-7WV3EPE6.js → chunk-H3EIPYRZ.js} +1 -1
- package/dist/standalone/{chunk-HCCQTUHS.js → chunk-H5TMLWIS.js} +1 -1
- package/dist/standalone/{chunk-LPFUEJZ4.js → chunk-HBG6SSE2.js} +1 -1
- package/dist/standalone/{chunk-5O7ICPWV.js → chunk-HC2B7SXW.js} +1 -1
- package/dist/standalone/{chunk-IDZLHZIA.js → chunk-HGCOTYPV.js} +1 -1
- package/dist/standalone/{chunk-Q2KL457J.js → chunk-HLHMHCXS.js} +1 -1
- package/dist/standalone/{chunk-WADY55J2.js → chunk-HSF2DCJ2.js} +1 -1
- package/dist/standalone/{chunk-QEFLZBT7.js → chunk-I3SSF2T6.js} +1 -1
- package/dist/standalone/{chunk-ALQHMFOC.js → chunk-I5QX75DE.js} +1 -1
- package/dist/standalone/{chunk-JCRFMCNP.js → chunk-ICHZ2IBL.js} +1 -1
- package/dist/standalone/{chunk-E2FFHKGI.js → chunk-IG5VD7R7.js} +1 -1
- package/dist/standalone/{chunk-ABMHWBYA.js → chunk-KKMQUBYH.js} +1 -1
- package/dist/standalone/{chunk-AEU3EF4T.js → chunk-LDHJRHPZ.js} +1 -1
- package/dist/standalone/{chunk-X54WR7FF.js → chunk-MNYDT3RH.js} +1 -1
- package/dist/standalone/{chunk-OPIMGKWU.js → chunk-MT4ICMXJ.js} +1 -1
- package/dist/standalone/{chunk-N7WQJPOM.js → chunk-MXJTD2OX.js} +1 -1
- package/dist/standalone/{chunk-WCWP4EAW.js → chunk-OZAOWE7T.js} +1 -1
- package/dist/standalone/{chunk-GVZ3VFGG.js → chunk-Q3IA6HPX.js} +1 -1
- package/dist/standalone/{chunk-3RZD6VJ7.js → chunk-RBIVXSXT.js} +1 -1
- package/dist/standalone/{chunk-JHTL3QHW.js → chunk-SDDEOSQB.js} +1 -1
- package/dist/standalone/chunk-SHHGIT7M.js +7 -0
- package/dist/standalone/{chunk-Z57KMMOK.js → chunk-SVQWZPO4.js} +1 -1
- package/dist/standalone/{chunk-YX2N5PJW.js → chunk-TEMI7MVE.js} +1 -1
- package/dist/standalone/{chunk-VHPTPEZ4.js → chunk-U5MPNEM2.js} +1 -1
- package/dist/standalone/{chunk-5NIQHOPN.js → chunk-ULQNADMJ.js} +1 -1
- package/dist/standalone/{chunk-66LYVBXB.js → chunk-UPPNZ6MI.js} +1 -1
- package/dist/standalone/{chunk-ZSLKFLWE.js → chunk-UTQLJKHH.js} +1 -1
- package/dist/standalone/{chunk-FQEZUQ36.js → chunk-UVG3ZISC.js} +1 -1
- package/dist/standalone/{chunk-2FTGLXYA.js → chunk-VQDTA4P6.js} +1 -1
- package/dist/standalone/{chunk-7O5SGABV.js → chunk-WLHQ4FKC.js} +1 -1
- package/dist/standalone/{chunk-XWWQIAF6.js → chunk-XPFVUAPX.js} +1 -1
- package/dist/standalone/{chunk-NF2Q75WM.js → chunk-Y3IGTWUE.js} +1 -1
- package/dist/standalone/{chunk-J6FR2B77.js → chunk-Y64STA6O.js} +1 -1
- package/dist/standalone/{chunk-IUGNIG6L.js → chunk-YEXTJUKQ.js} +1 -1
- package/dist/standalone/{chunk-RE7GRXBM.js → chunk-YFTPHGS2.js} +1 -1
- package/dist/standalone/{chunk-EXFERMUT.js → chunk-Z64BZNPS.js} +1 -1
- package/dist/standalone/{chunk-TMWKF4XM.js → chunk-Z6VILGGP.js} +1 -1
- package/dist/standalone/{chunk-MQTI3STP.js → chunk-ZBOB33BA.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +3 -3
- package/dist/standalone/chunk-FACXM2UB.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-RCXNYW7P.js";import{b as x}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as y}from"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-RCXNYW7P.js";import{b as x}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as y}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as w,b,c as S,d as c,e as s,f as o}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as u}from"./chunk-2W4UO5BC.js";import{c as p}from"./chunk-4N76XUNG.js";import{a as g,e as v}from"./chunk-OK2QU2EV.js";import"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as f}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import"./chunk-GWNGVKLG.js";import{b as T}from"./chunk-6G3E4PJ2.js";import{a as n,d as R}from"./chunk-5PEAXTYQ.js";var e=R(T(),1);var $={active:"default",failing:"destructive",idle:"secondary"},j=n(a=>a===void 0?"\u2014":`${new Date(a).toISOString().slice(0,19).replace("T"," ")} UTC`,"I"),K=n(a=>{let t=a.runs+a.suppressed;return t===0?void 0:Math.round(a.suppressed/t*100)},"$"),F=n(({initialShardKey:a=""})=>{let t=f(),{data:l,error:E,errorSource:A,liveError:I}=p(u.listReactors,{},{live:!0,shardKey:a}),C=l!==void 0,i=Array.isArray(l?.reactors)?l.reactors:[],d;C&&i.length===0?d=(0,e.jsx)(N,{description:t("No reactor is declared in this deployment. Export an onQueryChange(select, handler) from lunora/ to run server-side logic when a query's result changes."),testId:"reactors-empty",title:t("No reactors declared")}):d=(0,e.jsx)(g,{className:"overflow-hidden py-0",children:(0,e.jsx)(v,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"reactors-table",children:[(0,e.jsx)(b,{children:(0,e.jsxs)(c,{children:[(0,e.jsx)(s,{children:t("Reactor")}),(0,e.jsx)(s,{children:t("State")}),(0,e.jsx)(s,{children:t("Ran")}),(0,e.jsx)(s,{children:t("Suppressed")}),(0,e.jsx)(s,{children:t("Errors")}),(0,e.jsx)(s,{children:t("Watches")}),(0,e.jsx)(s,{children:t("Last dispatch")})]})}),(0,e.jsx)(S,{children:i.map(r=>{let m=K(r);return(0,e.jsxs)(c,{"data-testid":`reactors-row-${r.path}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:r.path}),(0,e.jsx)(o,{children:(0,e.jsx)(x,{"data-testid":`reactors-state-${r.path}`,variant:$[r.state],children:r.state})}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.runs}),(0,e.jsxs)(o,{className:"font-mono text-xs text-muted-foreground",children:[r.suppressed,m===void 0?"":` (${String(m)}%)`]}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.errors===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"0"}):(0,e.jsx)("span",{className:"text-destructive",children:r.errors})}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:r.tables===void 0||r.tables.length===0?"\u2014":r.tables.join(", ")}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:j(r.lastRanAt)})]},r.path)})})]})})});let h=i.filter(r=>r.state==="failing");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-reactors-panel",children:[E!==null&&(0,e.jsx)(y,{error:A,shardKey:a,testId:"reactors-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("A reactor runs after a write flush, but only when the result of the query it watches actually changed \u2014 a trigger fires on a row write, a reactor fires on a result changing. Suppressed dispatches are the ones where the read re-ran and nothing had moved.")}),h.length>0&&(0,e.jsx)("div",{className:"flex flex-col gap-2","data-testid":"reactors-failing",children:h.map(r=>(0,e.jsxs)("p",{className:"text-xs text-destructive",role:"alert",children:[(0,e.jsx)("span",{className:"font-mono",children:r.path}),": ",r.lastError??t("last dispatch failed")]},r.path))}),I!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"reactors-live-error",role:"alert",children:t("Live updates unavailable; showing the last reading.")}),d]})},"U");export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ie}from"./chunk-P6VNMPWR.js";import{a as ae,b as re,c as se}from"./chunk-GXTSE66Z.js";import"./chunk-ZSWW2UGP.js";import{b as Y}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as ne}from"./chunk-IUGNIG6L.js";import"./chunk-LSEUUZN4.js";import{a as le,b as oe,c as de,d as Z,e as G,f as H}from"./chunk-7QEZ2SFW.js";import"./chunk-WCWP4EAW.js";import"./chunk-BX7TFVCC.js";import"./chunk-4PI2OSSP.js";import{a as W}from"./chunk-2W4UO5BC.js";import{c as Q}from"./chunk-FBDIQ67D.js";import{a as q,e as B}from"./chunk-OK2QU2EV.js";import"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as X}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as pe}from"./chunk-GWNGVKLG.js";import{b as ue}from"./chunk-6G3E4PJ2.js";import{a as _,d as te}from"./chunk-5PEAXTYQ.js";var J=te(pe(),1);var a=te(ue(),1);var ce=["disabled","schema","schema_and_log","schema_and_log_and_data"],he={describeTables:"schema",readAdvisors:"schema",readLogs:"schema_and_log",readPolicies:"schema",runSql:"schema_and_log_and_data"},xe={binding:"outline",secret:"destructive",var:"secondary"},fe=_((t,e)=>{if(t===void 0)return[];let m=[];return t.workerUrl!==void 0&&m.push({label:e("URL"),value:t.workerUrl}),t.environment!==void 0&&m.push({label:e("Environment"),value:t.environment}),t.deploymentId!==void 0&&m.push({label:e("Deployment"),value:t.deploymentId}),t.versionTag!==void 0&&m.push({label:e("Version"),value:t.versionTag}),m},"ue"),ge={disabled:"The assistant is off. Nothing about this deployment is sent to a model.",schema:"Table and column names.",schema_and_log:"Table and column names, plus recent log lines.",schema_and_log_and_data:"Table and column names, log lines, and rows read with SELECT."},be=_(t=>{let e=[];for(let[m,r]of Object.entries(he))r===t&&e.push(m);return e},"pe"),ye=_(()=>{let t=(0,J.c)(29),e=X(),m,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={},r={shardKey:""},t[0]=m,t[1]=r):(m=t[0],r=t[1]);let{data:g}=Q(W.aiAvailable,m,r),p=g?.level,f;t[2]!==p?(f=p===void 0?-1:ce.indexOf(p),t[2]=p,t[3]=f):f=t[3];let x=f,i;t[4]!==e?(i=e("AI assistant data sharing"),t[4]=e,t[5]=i):i=t[5];let c;t[6]!==i?(c=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),t[6]=i,t[7]=c):c=t[7];let u;t[8]!==p?(u=p!==void 0&&(0,a.jsx)(Y,{"data-testid":"set-ai-level",variant:p==="disabled"?"outline":"secondary",children:p}),t[8]=p,t[9]=u):u=t[9];let n;t[10]!==c||t[11]!==u?(n=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[c,u]}),t[10]=c,t[11]=u,t[12]=n):n=t[12];let h;t[13]!==x||t[14]!==p||t[15]!==e?(h=ce.map((y,w)=>{let N=x>=w,v=be(y);return(0,a.jsxs)("li",{className:N?"flex flex-col gap-0.5":"flex flex-col gap-0.5 opacity-50","data-granted":String(N),"data-testid":`set-ai-tier-${y}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:y}),y===p&&(0,a.jsx)("span",{className:"text-[11px] text-primary",children:e("current")})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e(ge[y])}),v.length>0&&(0,a.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:v.join(", ")})]},y)}),t[13]=x,t[14]=p,t[15]=e,t[16]=h):h=t[16];let o;t[17]!==h?(o=(0,a.jsx)("ul",{className:"flex flex-col gap-1.5 text-sm",children:h}),t[17]=h,t[18]=o):o=t[18];let s;t[19]!==e?(s=e("Set LUNORA_AI_OPT_IN in wrangler.jsonc and redeploy to change this. The Studio can read this level but never raise it."),t[19]=e,t[20]=s):s=t[20];let d;t[21]!==s?(d=(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"set-ai-howto",children:s}),t[21]=s,t[22]=d):d=t[22];let l;t[23]!==d||t[24]!==o?(l=(0,a.jsxs)(B,{className:"flex flex-col gap-3 py-3",children:[o,d]}),t[23]=d,t[24]=o,t[25]=l):l=t[25];let b;return t[26]!==l||t[27]!==n?(b=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-ai-sharing",children:[n,l]}),t[26]=l,t[27]=n,t[28]=b):b=t[28],b},"xe"),me=_(t=>{let e=(0,J.c)(18),{modifier:m,name:r,label:g}=t,p=ae(),f;e[0]!==r?(f=_(l=>{if(!["Escape","Tab"].includes(l.key)){if(l.shiftKey){l.preventDefault();return}l.preventDefault(),re(r,l.key)}},"g"),e[0]=r,e[1]=f):f=e[1];let x=f,i=`set-shortcut-${r}`,c;e[2]!==g?(c=(0,a.jsx)("dt",{className:"text-muted-foreground",children:g}),e[2]=g,e[3]=c):c=e[3];let u;e[4]!==m?(u=(0,a.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:m}),e[4]=m,e[5]=u):u=e[5];let n=`set-shortcut-input-${r}`,h=p[r],o;e[6]!==g||e[7]!==x||e[8]!==n||e[9]!==h?(o=(0,a.jsx)("input",{"aria-label":g,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":n,onKeyDown:x,readOnly:!0,value:h}),e[6]=g,e[7]=x,e[8]=n,e[9]=h,e[10]=o):o=e[10];let s;e[11]!==u||e[12]!==o?(s=(0,a.jsxs)("dd",{className:"flex items-center gap-1.5",children:[u,o]}),e[11]=u,e[12]=o,e[13]=s):s=e[13];let d;return e[14]!==i||e[15]!==c||e[16]!==s?(d=(0,a.jsxs)("div",{className:"contents","data-testid":i,children:[c,s]}),e[14]=i,e[15]=c,e[16]=s,e[17]=d):d=e[17],d},"J"),Ee=_(t=>{let e=(0,J.c)(86),{initialShardKey:m}=t,r=X(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let p=m??"",f;e[1]!==p?(f={shardKey:p},e[1]=p,e[2]=f):f=e[2];let{data:x,error:i,errorSource:c,isLoading:u}=Q(W.getSettings,g,f),n,h,o,s,d,l,b;if(e[3]!==i||e[4]!==c||e[5]!==x?.deploy||e[6]!==x?.settings||e[7]!==r){let ee=fe(x?.deploy,r),z;e[15]!==x?.settings?(z=x?.settings??[],e[15]=x?.settings,e[16]=z):z=e[16],n=z,h="flex flex-col gap-4",o="lunora-settings";let F;e[17]!==r?(F=r("Open in Cloudflare"),e[17]=r,e[18]=F):F=e[18],e[19]!==F?(s=(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,a.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:ie,rel:"noreferrer",target:"_blank",children:F})}),e[19]=F,e[20]=s):s=e[20];let V;e[21]!==r?(V=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=V):V=e[22],e[23]!==V?(d=(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:V}),e[23]=V,e[24]=d):d=e[24],e[25]!==i||e[26]!==c?(l=i!==null&&(0,a.jsx)(ne,{error:c,testId:"set-error"}),e[25]=i,e[26]=c,e[27]=l):l=e[27],b=ee.length>0&&(0,a.jsxs)(q,{className:"py-0","data-testid":"set-deploy",children:[(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,a.jsx)(B,{className:"py-3",children:(0,a.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:ee.map(Ne)})})]}),e[3]=i,e[4]=c,e[5]=x?.deploy,e[6]=x?.settings,e[7]=r,e[8]=n,e[9]=h,e[10]=o,e[11]=s,e[12]=d,e[13]=l,e[14]=b}else n=e[8],h=e[9],o=e[10],s=e[11],d=e[12],l=e[13],b=e[14];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(ye,{}),e[28]=y):y=e[28];let w;e[29]!==r?(w=r("Keyboard shortcuts"),e[29]=r,e[30]=w):w=e[30];let N;e[31]!==w?(N=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[31]=w,e[32]=N):N=e[32];let v;e[33]!==r?(v=r("Reset"),e[33]=r,e[34]=v):v=e[34];let k;e[35]!==v?(k=(0,a.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:se,type:"button",children:v}),e[35]=v,e[36]=k):k=e[36];let T;e[37]!==N||e[38]!==k?(T=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[N,k]}),e[37]=N,e[38]=k,e[39]=T):T=e[39];let S;e[40]!==r?(S=r("Command palette"),e[40]=r,e[41]=S):S=e[41];let C;e[42]!==S?(C=(0,a.jsx)(me,{label:S,modifier:"\u2318/Ctrl",name:"palette"}),e[42]=S,e[43]=C):C=e[43];let I;e[44]!==r?(I=r("Operation console"),e[44]=r,e[45]=I):I=e[45];let O;e[46]!==I?(O=(0,a.jsx)(me,{label:I,modifier:"Ctrl",name:"console"}),e[46]=I,e[47]=O):O=e[47];let j;e[48]!==C||e[49]!==O?(j=(0,a.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[C,O]}),e[48]=C,e[49]=O,e[50]=j):j=e[50];let E;e[51]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[51]=r,e[52]=E):E=e[52];let A;e[53]!==E?(A=(0,a.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[53]=E,e[54]=A):A=e[54];let D;e[55]!==j||e[56]!==A?(D=(0,a.jsxs)(B,{className:"py-3",children:[j,A]}),e[55]=j,e[56]=A,e[57]=D):D=e[57];let K;e[58]!==T||e[59]!==D?(K=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-preferences",children:[T,D]}),e[58]=T,e[59]=D,e[60]=K):K=e[60];let L;e[61]!==r?(L=r("Environment & bindings"),e[61]=r,e[62]=L):L=e[62];let U;e[63]!==L?(U=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:L})}),e[63]=L,e[64]=U):U=e[64];let P;e[65]!==i||e[66]!==u||e[67]!==n.length||e[68]!==r?(P=i===null&&!u&&n.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[65]=i,e[66]=u,e[67]=n.length,e[68]=r,e[69]=P):P=e[69];let R;e[70]!==n||e[71]!==r?(R=n.length>0&&(0,a.jsx)(B,{className:"px-0 py-0",children:(0,a.jsxs)(le,{"data-testid":"set-table",children:[(0,a.jsx)(oe,{children:(0,a.jsxs)(Z,{children:[(0,a.jsx)(G,{children:r("name")}),(0,a.jsx)(G,{children:r("kind")}),(0,a.jsx)(G,{children:r("value")})]})}),(0,a.jsx)(de,{children:n.map(ve)})]})}),e[70]=n,e[71]=r,e[72]=R):R=e[72];let $;e[73]!==U||e[74]!==P||e[75]!==R?($=(0,a.jsxs)(q,{className:"py-0",children:[U,P,R]}),e[73]=U,e[74]=P,e[75]=R,e[76]=$):$=e[76];let M;return e[77]!==K||e[78]!==$||e[79]!==h||e[80]!==o||e[81]!==s||e[82]!==d||e[83]!==l||e[84]!==b?(M=(0,a.jsxs)("div",{className:h,"data-testid":o,children:[s,d,l,b,y,K,$]}),e[77]=K,e[78]=$,e[79]=h,e[80]=o,e[81]=s,e[82]=d,e[83]=l,e[84]=b,e[85]=M):M=e[85],M},"Le");function Ne(t){return(0,a.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:t.label}),(0,a.jsx)("dd",{className:"truncate font-mono text-xs",title:t.value,children:t.value})]},t.label)}_(Ne,"ge");function ve(t){return(0,a.jsxs)(Z,{"data-testid":"set-row",children:[(0,a.jsx)(H,{className:"font-mono text-xs font-medium",children:t.name}),(0,a.jsx)(H,{children:(0,a.jsx)(Y,{variant:xe[t.kind],children:t.bindingType??t.kind})}),(0,a.jsx)(H,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:t.value??(0,a.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},t.name)}_(ve,"be");export{Ee as SettingsPanel};
|
|
1
|
+
import{b as ie}from"./chunk-P6VNMPWR.js";import{a as ae,b as re,c as se}from"./chunk-GXTSE66Z.js";import"./chunk-ZSWW2UGP.js";import{b as Y}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as ne}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as le,b as oe,c as de,d as Z,e as G,f as H}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as W}from"./chunk-2W4UO5BC.js";import{c as Q}from"./chunk-4N76XUNG.js";import{a as q,e as B}from"./chunk-OK2QU2EV.js";import"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as X}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as pe}from"./chunk-GWNGVKLG.js";import{b as ue}from"./chunk-6G3E4PJ2.js";import{a as _,d as te}from"./chunk-5PEAXTYQ.js";var J=te(pe(),1);var a=te(ue(),1);var ce=["disabled","schema","schema_and_log","schema_and_log_and_data"],he={describeTables:"schema",readAdvisors:"schema",readLogs:"schema_and_log",readPolicies:"schema",runSql:"schema_and_log_and_data"},xe={binding:"outline",secret:"destructive",var:"secondary"},fe=_((t,e)=>{if(t===void 0)return[];let m=[];return t.workerUrl!==void 0&&m.push({label:e("URL"),value:t.workerUrl}),t.environment!==void 0&&m.push({label:e("Environment"),value:t.environment}),t.deploymentId!==void 0&&m.push({label:e("Deployment"),value:t.deploymentId}),t.versionTag!==void 0&&m.push({label:e("Version"),value:t.versionTag}),m},"ue"),ge={disabled:"The assistant is off. Nothing about this deployment is sent to a model.",schema:"Table and column names.",schema_and_log:"Table and column names, plus recent log lines.",schema_and_log_and_data:"Table and column names, log lines, and rows read with SELECT."},be=_(t=>{let e=[];for(let[m,r]of Object.entries(he))r===t&&e.push(m);return e},"pe"),ye=_(()=>{let t=(0,J.c)(29),e=X(),m,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={},r={shardKey:""},t[0]=m,t[1]=r):(m=t[0],r=t[1]);let{data:g}=Q(W.aiAvailable,m,r),p=g?.level,f;t[2]!==p?(f=p===void 0?-1:ce.indexOf(p),t[2]=p,t[3]=f):f=t[3];let x=f,i;t[4]!==e?(i=e("AI assistant data sharing"),t[4]=e,t[5]=i):i=t[5];let c;t[6]!==i?(c=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),t[6]=i,t[7]=c):c=t[7];let u;t[8]!==p?(u=p!==void 0&&(0,a.jsx)(Y,{"data-testid":"set-ai-level",variant:p==="disabled"?"outline":"secondary",children:p}),t[8]=p,t[9]=u):u=t[9];let n;t[10]!==c||t[11]!==u?(n=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[c,u]}),t[10]=c,t[11]=u,t[12]=n):n=t[12];let h;t[13]!==x||t[14]!==p||t[15]!==e?(h=ce.map((y,w)=>{let N=x>=w,v=be(y);return(0,a.jsxs)("li",{className:N?"flex flex-col gap-0.5":"flex flex-col gap-0.5 opacity-50","data-granted":String(N),"data-testid":`set-ai-tier-${y}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:y}),y===p&&(0,a.jsx)("span",{className:"text-[11px] text-primary",children:e("current")})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e(ge[y])}),v.length>0&&(0,a.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:v.join(", ")})]},y)}),t[13]=x,t[14]=p,t[15]=e,t[16]=h):h=t[16];let o;t[17]!==h?(o=(0,a.jsx)("ul",{className:"flex flex-col gap-1.5 text-sm",children:h}),t[17]=h,t[18]=o):o=t[18];let s;t[19]!==e?(s=e("Set LUNORA_AI_OPT_IN in wrangler.jsonc and redeploy to change this. The Studio can read this level but never raise it."),t[19]=e,t[20]=s):s=t[20];let d;t[21]!==s?(d=(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"set-ai-howto",children:s}),t[21]=s,t[22]=d):d=t[22];let l;t[23]!==d||t[24]!==o?(l=(0,a.jsxs)(B,{className:"flex flex-col gap-3 py-3",children:[o,d]}),t[23]=d,t[24]=o,t[25]=l):l=t[25];let b;return t[26]!==l||t[27]!==n?(b=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-ai-sharing",children:[n,l]}),t[26]=l,t[27]=n,t[28]=b):b=t[28],b},"xe"),me=_(t=>{let e=(0,J.c)(18),{modifier:m,name:r,label:g}=t,p=ae(),f;e[0]!==r?(f=_(l=>{if(!["Escape","Tab"].includes(l.key)){if(l.shiftKey){l.preventDefault();return}l.preventDefault(),re(r,l.key)}},"g"),e[0]=r,e[1]=f):f=e[1];let x=f,i=`set-shortcut-${r}`,c;e[2]!==g?(c=(0,a.jsx)("dt",{className:"text-muted-foreground",children:g}),e[2]=g,e[3]=c):c=e[3];let u;e[4]!==m?(u=(0,a.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:m}),e[4]=m,e[5]=u):u=e[5];let n=`set-shortcut-input-${r}`,h=p[r],o;e[6]!==g||e[7]!==x||e[8]!==n||e[9]!==h?(o=(0,a.jsx)("input",{"aria-label":g,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":n,onKeyDown:x,readOnly:!0,value:h}),e[6]=g,e[7]=x,e[8]=n,e[9]=h,e[10]=o):o=e[10];let s;e[11]!==u||e[12]!==o?(s=(0,a.jsxs)("dd",{className:"flex items-center gap-1.5",children:[u,o]}),e[11]=u,e[12]=o,e[13]=s):s=e[13];let d;return e[14]!==i||e[15]!==c||e[16]!==s?(d=(0,a.jsxs)("div",{className:"contents","data-testid":i,children:[c,s]}),e[14]=i,e[15]=c,e[16]=s,e[17]=d):d=e[17],d},"J"),Ee=_(t=>{let e=(0,J.c)(86),{initialShardKey:m}=t,r=X(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let p=m??"",f;e[1]!==p?(f={shardKey:p},e[1]=p,e[2]=f):f=e[2];let{data:x,error:i,errorSource:c,isLoading:u}=Q(W.getSettings,g,f),n,h,o,s,d,l,b;if(e[3]!==i||e[4]!==c||e[5]!==x?.deploy||e[6]!==x?.settings||e[7]!==r){let ee=fe(x?.deploy,r),z;e[15]!==x?.settings?(z=x?.settings??[],e[15]=x?.settings,e[16]=z):z=e[16],n=z,h="flex flex-col gap-4",o="lunora-settings";let F;e[17]!==r?(F=r("Open in Cloudflare"),e[17]=r,e[18]=F):F=e[18],e[19]!==F?(s=(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,a.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:ie,rel:"noreferrer",target:"_blank",children:F})}),e[19]=F,e[20]=s):s=e[20];let V;e[21]!==r?(V=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=V):V=e[22],e[23]!==V?(d=(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:V}),e[23]=V,e[24]=d):d=e[24],e[25]!==i||e[26]!==c?(l=i!==null&&(0,a.jsx)(ne,{error:c,testId:"set-error"}),e[25]=i,e[26]=c,e[27]=l):l=e[27],b=ee.length>0&&(0,a.jsxs)(q,{className:"py-0","data-testid":"set-deploy",children:[(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,a.jsx)(B,{className:"py-3",children:(0,a.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:ee.map(Ne)})})]}),e[3]=i,e[4]=c,e[5]=x?.deploy,e[6]=x?.settings,e[7]=r,e[8]=n,e[9]=h,e[10]=o,e[11]=s,e[12]=d,e[13]=l,e[14]=b}else n=e[8],h=e[9],o=e[10],s=e[11],d=e[12],l=e[13],b=e[14];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=(0,a.jsx)(ye,{}),e[28]=y):y=e[28];let w;e[29]!==r?(w=r("Keyboard shortcuts"),e[29]=r,e[30]=w):w=e[30];let N;e[31]!==w?(N=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),e[31]=w,e[32]=N):N=e[32];let v;e[33]!==r?(v=r("Reset"),e[33]=r,e[34]=v):v=e[34];let k;e[35]!==v?(k=(0,a.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:se,type:"button",children:v}),e[35]=v,e[36]=k):k=e[36];let T;e[37]!==N||e[38]!==k?(T=(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[N,k]}),e[37]=N,e[38]=k,e[39]=T):T=e[39];let S;e[40]!==r?(S=r("Command palette"),e[40]=r,e[41]=S):S=e[41];let C;e[42]!==S?(C=(0,a.jsx)(me,{label:S,modifier:"\u2318/Ctrl",name:"palette"}),e[42]=S,e[43]=C):C=e[43];let I;e[44]!==r?(I=r("Operation console"),e[44]=r,e[45]=I):I=e[45];let O;e[46]!==I?(O=(0,a.jsx)(me,{label:I,modifier:"Ctrl",name:"console"}),e[46]=I,e[47]=O):O=e[47];let j;e[48]!==C||e[49]!==O?(j=(0,a.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[C,O]}),e[48]=C,e[49]=O,e[50]=j):j=e[50];let E;e[51]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[51]=r,e[52]=E):E=e[52];let A;e[53]!==E?(A=(0,a.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[53]=E,e[54]=A):A=e[54];let D;e[55]!==j||e[56]!==A?(D=(0,a.jsxs)(B,{className:"py-3",children:[j,A]}),e[55]=j,e[56]=A,e[57]=D):D=e[57];let K;e[58]!==T||e[59]!==D?(K=(0,a.jsxs)(q,{className:"py-0","data-testid":"set-preferences",children:[T,D]}),e[58]=T,e[59]=D,e[60]=K):K=e[60];let L;e[61]!==r?(L=r("Environment & bindings"),e[61]=r,e[62]=L):L=e[62];let U;e[63]!==L?(U=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:L})}),e[63]=L,e[64]=U):U=e[64];let P;e[65]!==i||e[66]!==u||e[67]!==n.length||e[68]!==r?(P=i===null&&!u&&n.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[65]=i,e[66]=u,e[67]=n.length,e[68]=r,e[69]=P):P=e[69];let R;e[70]!==n||e[71]!==r?(R=n.length>0&&(0,a.jsx)(B,{className:"px-0 py-0",children:(0,a.jsxs)(le,{"data-testid":"set-table",children:[(0,a.jsx)(oe,{children:(0,a.jsxs)(Z,{children:[(0,a.jsx)(G,{children:r("name")}),(0,a.jsx)(G,{children:r("kind")}),(0,a.jsx)(G,{children:r("value")})]})}),(0,a.jsx)(de,{children:n.map(ve)})]})}),e[70]=n,e[71]=r,e[72]=R):R=e[72];let $;e[73]!==U||e[74]!==P||e[75]!==R?($=(0,a.jsxs)(q,{className:"py-0",children:[U,P,R]}),e[73]=U,e[74]=P,e[75]=R,e[76]=$):$=e[76];let M;return e[77]!==K||e[78]!==$||e[79]!==h||e[80]!==o||e[81]!==s||e[82]!==d||e[83]!==l||e[84]!==b?(M=(0,a.jsxs)("div",{className:h,"data-testid":o,children:[s,d,l,b,y,K,$]}),e[77]=K,e[78]=$,e[79]=h,e[80]=o,e[81]=s,e[82]=d,e[83]=l,e[84]=b,e[85]=M):M=e[85],M},"Le");function Ne(t){return(0,a.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:t.label}),(0,a.jsx)("dd",{className:"truncate font-mono text-xs",title:t.value,children:t.value})]},t.label)}_(Ne,"ge");function ve(t){return(0,a.jsxs)(Z,{"data-testid":"set-row",children:[(0,a.jsx)(H,{className:"font-mono text-xs font-medium",children:t.name}),(0,a.jsx)(H,{children:(0,a.jsx)(Y,{variant:xe[t.kind],children:t.bindingType??t.kind})}),(0,a.jsx)(H,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:t.value??(0,a.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},t.name)}_(ve,"be");export{Ee as SettingsPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as H}from"./chunk-LSEUUZN4.js";import{a as B}from"./chunk-
|
|
1
|
+
import{a as H}from"./chunk-LSEUUZN4.js";import{a as B}from"./chunk-OZAOWE7T.js";import{b as _}from"./chunk-BBDTJG2K.js";import{b as $}from"./chunk-4PI2OSSP.js";import{B as z,e as D,j as E,m as S,n as W}from"./chunk-GNI37YCV.js";import{a as F}from"./chunk-GWNGVKLG.js";import{b as G}from"./chunk-6G3E4PJ2.js";import{a as I,d as O}from"./chunk-5PEAXTYQ.js";var M=O(F(),1);var o=O(G(),1);var ee=I(U=>{let e=(0,M.c)(51),{className:T,error:t,shardKey:j,testId:K}=U,s=z(),r=$(),v=_(),V=v!==void 0&&!v.unavailable,l,c,a,m,d,u,p,i,n,h;if(e[0]!==v||e[1]!==T||e[2]!==t||e[3]!==r||e[4]!==j||e[5]!==s||e[6]!==K){let y=S(t),w;e[17]!==t?(w=W(t),e[17]=t,e[18]=w):w=e[18],a=w;let N;e[19]!==t?(N=B(t),e[19]=t,e[20]=N):N=e[20];let q=N,A=t?.why,C;e[21]!==r||e[22]!==q?(C=I(()=>{r?.openConsole({errorsOnly:!0,seq:q})},"C"),e[21]=r,e[22]=q,e[23]=C):C=e[23],m=C,c=I(()=>{let Z=y===void 0?"":`
|
|
2
2
|
|
|
3
3
|
${s("The studio suggested: {hint}",{hint:D(y)})}`;v?.openAssistant({ask:s(`The studio reported this error:
|
|
4
4
|
{message}{detail}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-2W4UO5BC.js";import{c as f}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-2W4UO5BC.js";import{c as f}from"./chunk-4N76XUNG.js";import{m as q}from"./chunk-SHHGIT7M.js";import{h as s,i as l}from"./chunk-GNI37YCV.js";import{a as U}from"./chunk-6G3E4PJ2.js";import{a as e,d as R}from"./chunk-5PEAXTYQ.js";var p=R(U(),1);var _=e(async i=>{try{let{knowledgeExcerpts:d}=await import("./chunk-L2FYX4FN.js");return d(i)}catch{return[]}},"x"),B={},H=s(n.aiGenerateSql),L=s(n.aiTableFilter),O=s(n.aiChartConfig),P=s(n.aiChat),V=s(n.aiNameQuery),j=s(n.aiCronExpression),Y=e(i=>{let d=q(),[w,m]=(0,p.useState)({}),[b,g]=(0,p.useState)({}),y=f(n.aiAvailable,B,{shardKey:i}),[C,S]=(0,p.useState)(!1),N=C||y.data?.available===!1,c=e(a=>{m(r=>({...r,[a]:!0})),g(r=>({...r,[a]:void 0}))},"i"),t=e((a,r)=>{m(o=>({...o,[a]:!1})),r!==void 0&&g(o=>({...o,[a]:r})),(r==="ai-disabled"||r==="no-ai-binding")&&S(!0)},"e"),h=e(async a=>{c("sql");try{let r=await d.query(H,a,l(i));return t("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{t("sql","ai-error");return}},"p"),x=e(async(a,r)=>h({failedError:r?.error,failedSql:r?.sql,prompt:a}),"E"),E=e(async(a,r)=>h({editSql:r,prompt:a}),"w"),F=e(async(a,r,o,G,K,v)=>{c("chat");try{let u=await d.streamRpc(P,{approval:G,knowledge:await _(a),prompt:a,schema:o,shardKey:i,transcript:r},{onFrame:e(M=>{K?.(M)},"onFrame"),...v===void 0?{}:{signal:v}});return t("chat",u.degraded?u.reason:void 0),u.degraded?void 0:u}catch{t("chat","ai-error");return}},"C"),A=e(async(a,r)=>{c("filter");try{let o=await d.query(L,{prompt:a,table:r},l(i));return t("filter",o.degraded?o.reason:void 0),o.degraded?void 0:o.clauses}catch{t("filter","ai-error");return}},"I"),I=e(async a=>{c("chart");try{let r=await d.query(O,a,l(i));return t("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{t("chart","ai-error");return}},"R"),Q=e(async a=>{c("name");try{let r=await d.query(V,{sql:a},l(i));return t("name",r.degraded?r.reason:void 0),r.degraded?void 0:{description:r.description,title:r.title}}catch{t("name","ai-error");return}},"S"),T=e(async a=>{c("cron");try{let r=await d.query(j,{prompt:a},l(i));return t("cron",r.degraded?r.reason:void 0),r.degraded?void 0:r.cron}catch{t("cron","ai-error");return}},"T"),k=e(a=>w[a]===!0,"N"),D=e(a=>b[a],"b");return{chat:F,generate:x,inferChart:I,level:y.data?.level,nameQuery:Q,pending:k,reason:D,rewrite:E,suggestCron:T,suggestFilter:A,unavailable:N}},"V");export{Y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-EPWCW2DF.js";import{a as F}from"./chunk-J45HAKBU.js";import{a as D}from"./chunk-FHLODLBC.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import"./chunk-UD5REVU2.js";import{a as B}from"./chunk-RCXNYW7P.js";import{b as y}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as L}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as O,b as P,c as W,d as C,e as h,f as p}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as $}from"./chunk-2W4UO5BC.js";import{c as T}from"./chunk-4N76XUNG.js";import{a as E,e as _}from"./chunk-OK2QU2EV.js";import"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as j,p as M}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as H}from"./chunk-GWNGVKLG.js";import{b as U}from"./chunk-6G3E4PJ2.js";import{a as S,d as A}from"./chunk-5PEAXTYQ.js";var R=A(H(),1);var t=A(U(),1);var J=80,Z=S(c=>{if(c===void 0)return"";let e=JSON.stringify(c,M);return e.length>J?`${e.slice(0,J)}\u2026`:e},"G"),z=S(c=>{let e=[];for(let i of c){let n=i.id.toString();if(i.subscriptions.length===0){e.push({admin:i.admin,connectionId:i.id,key:`c${n}`,subscription:null});continue}i.subscriptions.forEach((s,o)=>{e.push({admin:i.admin,connectionId:i.id,key:`c${n}-s${o.toString()}`,subscription:s})})}return e},"J"),K=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),ce=S(c=>{let e=(0,R.c)(24),{initialShardKey:i}=c,n=j(),{queryShardKey:s,setShardKey:o,shardKey:m}=F(i),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==s?(b={keepPreviousData:!0,shardKey:s},e[1]=s,e[2]=b):b=e[2];let{data:r,error:a,errorSource:u,poll:G}=T($.listSubscriptions,f,b);q(G,!0);let x;if(e[3]!==a||e[4]!==u||e[5]!==s||e[6]!==r||e[7]!==o||e[8]!==m||e[9]!==n){let k=r===void 0?[]:z(r.connections),d;e[11]!==o||e[12]!==m?(d=(0,t.jsx)(D,{onChange:o,testId:"subs-shard-input",value:m}),e[11]=o,e[12]=m,e[13]=d):d=e[13];let l;e[14]!==r||e[15]!==n?(l=r!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:r.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:r.totalSubscriptions})})]}),e[14]=r,e[15]=n,e[16]=l):l=e[16];let v;e[17]!==d||e[18]!==l?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[d,l]}),e[17]=d,e[18]=l,e[19]=v):v=e[19];let g;e[20]!==a||e[21]!==u||e[22]!==s?(g=a!==null&&(0,t.jsx)(L,{error:u,shardKey:s,testId:"subs-error"}),e[20]=a,e[21]=u,e[22]=s,e[23]=g):g=e[23],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[v,g,a===null&&r!==void 0&&k.length===0&&(0,t.jsx)(B,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),a===null&&k.length>0&&(0,t.jsx)(E,{className:"overflow-hidden py-0",children:(0,t.jsx)(_,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(N=>{let{subscription:I}=N,w=Z(I?.args);return(0,t.jsxs)(C,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??K}),(0,t.jsx)(p,{children:I?.table??K}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:w||void 0,children:w||K})]},N.key)})})]})})})]}),e[3]=a,e[4]=u,e[5]=s,e[6]=r,e[7]=o,e[8]=m,e[9]=n,e[10]=x}else x=e[10];return x},"ae");export{ce as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as T}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-YEXTJUKQ.js";import{a as k,b as I,c as $,d as l,e as c,f as a}from"./chunk-7QEZ2SFW.js";import{b}from"./chunk-BBDTJG2K.js";import{a as N,e as w}from"./chunk-OK2QU2EV.js";import{B as v,x as y}from"./chunk-GNI37YCV.js";import{a as C,b as S}from"./chunk-6G3E4PJ2.js";import{a as i,d as x}from"./chunk-5PEAXTYQ.js";var A=x(C(),1);var e=x(S(),1);var O={ERROR:"error",INFO:"info",WARN:"warning"},M=i(t=>{let s=typeof t.metadata.table=="string"?t.metadata.table:void 0;return{description:`${t.detail} ${t.remediation}`,entity:s,issueType:t.title,key:t.cacheKey,level:O[t.level]}},"J"),W=["error","warning","info"],j={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},D=i((t,s)=>({error:t("Errors"),info:t("Info"),warning:t("Warnings")})[s],"O"),H=i((t,s,o)=>({error:t("{count} errors",{count:o}),info:t("{count} suggestions",{count:o}),warning:t("{count} warnings",{count:o})})[s],"S"),L=i((t,s)=>({error:t("No errors detected"),info:t("No suggestions"),warning:t("No warnings detected")})[s],"D"),z=i(t=>{let s={error:0,info:0,warning:0};for(let o of t??[])s[o.level]+=1;return s},"H"),P=i(({error:t=null,errorSource:s,rows:o,shardKey:p,testId:d,toolbar:f})=>{let n=v(),m=b(),g=m!==void 0&&!m.unavailable,[u,E]=(0,A.useState)("error"),K=z(o),h=(o??[]).filter(r=>r.level===u),R=i(r=>{E(r.currentTarget.dataset.level)},"y");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":d,children:[(0,e.jsx)("div",{className:"flex border-b border-border",role:"tablist",children:W.map(r=>(0,e.jsxs)("button",{"aria-selected":u===r,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":r,"data-testid":`${d}-tab-${r}`,onClick:R,role:"tab",type:"button",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:y("size-2 rounded-sm",j[r])}),D(n,r)]}),(0,e.jsx)("span",{className:"ps-4 text-xs text-muted-foreground",children:H(n,r,K[r])})]},r))}),f!==void 0&&(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:f}),t!==null&&(0,e.jsx)(T,{error:s??t,shardKey:p,testId:`${d}-error`}),(0,e.jsx)(N,{className:"overflow-hidden py-0",children:(0,e.jsx)(w,{className:"px-0",children:(0,e.jsxs)(k,{children:[(0,e.jsx)(I,{children:(0,e.jsxs)(l,{children:[(0,e.jsx)(c,{children:n("Issue type")}),(0,e.jsx)(c,{children:n("Entity/item")}),(0,e.jsx)(c,{children:n("Description")})]})}),(0,e.jsx)($,{children:h.length===0?(0,e.jsx)(l,{children:(0,e.jsxs)(a,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${d}-empty`,children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:L(n,u)}),(0,e.jsx)("span",{className:"block text-sm",children:n("Nothing to report for this deployment.")})]})}):h.map(r=>(0,e.jsxs)(l,{children:[(0,e.jsx)(a,{className:"font-medium text-foreground",children:r.issueType}),(0,e.jsx)(a,{className:"font-mono text-xs text-muted-foreground",children:r.entity??"\u2014"}),(0,e.jsxs)(a,{className:"text-muted-foreground",children:[(0,e.jsx)("span",{children:r.description}),(r.action!==void 0||g)&&(0,e.jsxs)("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.action,g&&(0,e.jsx)("button",{className:"text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"advisor-ask-assistant",onClick:i(()=>{m.openAssistant({ask:n(`The Lunora advisor reported: {finding}.
|
|
2
2
|
|
|
3
3
|
{description}
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as E,e as _}from"./chunk-FWM5Z6CH.js";import{a as $}from"./chunk-SR6CPTRT.js";import{a as de}from"./chunk-DB6QX4X6.js";import"./chunk-5WNGRT7N.js";import{a as ce}from"./chunk-QNM2J7MG.js";import"./chunk-ONTGYVAN.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BG2CJOVS.js";import{a as le}from"./chunk-J45HAKBU.js";import{a as re}from"./chunk-FHLODLBC.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import"./chunk-UD5REVU2.js";import{a as ae}from"./chunk-RCXNYW7P.js";import{b as K}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as ie}from"./chunk-IUGNIG6L.js";import"./chunk-LSEUUZN4.js";import{a as R,b as W,c as Z,d as A,e as M,f as S}from"./chunk-7QEZ2SFW.js";import"./chunk-WCWP4EAW.js";import"./chunk-BX7TFVCC.js";import"./chunk-4PI2OSSP.js";import{a as U}from"./chunk-2W4UO5BC.js";import{c as D}from"./chunk-FBDIQ67D.js";import{a as q,b as H,c as J,e as ne}from"./chunk-OK2QU2EV.js";import"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as F,w as oe}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as be}from"./chunk-GWNGVKLG.js";import{b as ge}from"./chunk-6G3E4PJ2.js";import{a as p,d as se}from"./chunk-5PEAXTYQ.js";var O=se(be(),1);var o=se(ge(),1);var G="gen_ai.usage.input_tokens",Q="gen_ai.usage.output_tokens",V="gen_ai.usage.cost",fe="gen_ai.request.model",Te="lunora.usage.cost.source",xe=new Set(["ai.embed","ai.generate","ai.stream"]),ue=6e4,Ce=1440,ve="unknown",X=p(()=>({calls:0,estimatedCost:0,inputTokens:0,outputTokens:0,providerCost:0}),"q"),Y=p((n,e)=>{let s=n?.[e];return typeof s=="string"&&s!==""?s:void 0},"J"),z=p((n,e)=>{let s=n?.[e];return typeof s=="number"&&Number.isFinite(s)?s:void 0},"L"),ee=p(n=>Y(n,Te)==="provider"?"provider":"estimated","Q"),me=p((n,e)=>n.reduce((s,a)=>s+e(a),0),"Y"),B=p(n=>n.providerCost+n.estimatedCost,"F"),ke=p(n=>n.estimatedCost>0?n.providerCost>0?"mixed":"estimated":n.providerCost>0?"provider":"none","ae"),ye=p((n,e)=>({calls:n.calls+e.calls,estimatedCost:n.estimatedCost+e.estimatedCost,inputTokens:n.inputTokens+e.inputTokens,outputTokens:n.outputTokens+e.outputTokens,providerCost:n.providerCost+e.providerCost}),"ce"),Ie=p(n=>{let e=X(),s=0,a=0,t=0;for(let c of n){let l=me(c.points,i=>i.sum),r=me(c.points,i=>i.count);c.name===G?(e.inputTokens+=l,s+=r):c.name===Q?(e.outputTokens+=l,a+=r):(t+=r,ee(c.attributes)==="provider"?e.providerCost+=l:e.estimatedCost+=l)}return e.calls=Math.max(s,a,t),e},"ge"),Ne=p((n,e)=>B(e)-B(n)||e.inputTokens+e.outputTokens-(n.inputTokens+n.outputTokens)||n.key.localeCompare(e.key),"Ne"),pe=p((n,e)=>{let s=new Map;for(let a of n){let t=e(a);s.set(t,{key:t,...ye(s.get(t)??X(),a)})}return[...s.values()].toSorted(Ne)},"Z"),we=p(n=>(n?.series??[]).filter(e=>e.name===G||e.name===Q||e.name===V),"xe"),Me=p(n=>Y(n.attributes,fe)??ve,"Se"),Se=p(n=>{let e=new Map;for(let s of n){let a=Me(s),t=JSON.stringify([s.functionPath,a]),c=e.get(t)??{functionPath:s.functionPath,model:a,series:[]};c.series.push(s),e.set(t,c)}return[...e.values()].map(({functionPath:s,model:a,series:t})=>({functionPath:s,model:a,...Ie(t)}))},"Ie"),_e=p(n=>{let e=new Map;for(let r of n){if(r.name!==V)continue;let i=ee(r.attributes)==="provider";for(let u of r.points){let m=e.get(u.bucketMs)??{bucketMs:u.bucketMs,estimatedCost:0,providerCost:0};i?m.providerCost+=u.sum:m.estimatedCost+=u.sum,e.set(u.bucketMs,m)}}let s=[...e.keys()].toSorted((r,i)=>r-i),a=s[0],t=s.at(-1);if(a===void 0||t===void 0)return[];let c=Math.max(a,t-(Ce-1)*ue),l=[];for(let r=c;r<=t;r+=ue)l.push(e.get(r)??{bucketMs:r,estimatedCost:0,providerCost:0});return l},"_e"),Pe=p(n=>{let e=[];for(let s of n)for(let a of s.spans){if(!xe.has(a.name))continue;let{attributes:t}=a,c=z(t,V),l=z(t,G),r=z(t,Q);e.push({...c===void 0?{}:{cost:c,costSource:ee(t)},functionPath:s.functionPath,...l===void 0?{}:{inputTokens:l},model:Y(t,fe)??ve,ok:a.ok,...r===void 0?{}:{outputTokens:r},startTs:s.startTs+a.offsetMs,streaming:a.name==="ai.stream",traceId:s.traceId})}return e.toSorted((s,a)=>a.startTs-s.startTs)},"Me"),Fe=p(n=>n.map(e=>{let s=e.cost??0;return{calls:1,estimatedCost:e.costSource==="provider"?0:s,functionPath:e.functionPath,inputTokens:e.inputTokens??0,model:e.model,outputTokens:e.outputTokens??0,providerCost:e.costSource==="provider"?s:0}}),"Oe"),Oe=p((n,e)=>{let s=we(n),a=Pe(e),t=s.length>0,c=t?Se(s):Fe(a),l=X(),r="none";for(let i of c)l=ye(l,i);return t?r="history":a.length>0&&(r="live"),{byFunction:pe(c,i=>i.functionPath),byModel:pe(c,i=>i.model),calls:a,source:r,totals:l,trend:t?_e(s):[]}},"Ae"),Ke=p(n=>Array.isArray(n?.traces)?n.traces:[],"Ee"),Ae=25,te=p(n=>{let e=(0,O.c)(16),{provenance:s,value:a}=n,t=F();if(s==="none"){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,o.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let c;e[1]!==s||e[2]!==a?(c=s==="provider"?E(a):`~${E(a)}`,e[1]=s,e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=(0,o.jsx)("span",{className:"tabular-nums",children:c}),e[4]=c,e[5]=l):l=e[5];let r;e[6]!==s||e[7]!==t?(r=s==="estimated"?(0,o.jsx)(K,{title:t("Derived from a price table, not reported by the provider."),variant:"warning",children:t("Estimated")}):null,e[6]=s,e[7]=t,e[8]=r):r=e[8];let i;e[9]!==s||e[10]!==t?(i=s==="mixed"?(0,o.jsx)(K,{title:t("Includes cost derived from a price table, not reported by the provider."),variant:"warning",children:t("Partly estimated")}):null,e[9]=s,e[10]=t,e[11]=i):i=e[11];let u;return e[12]!==l||e[13]!==r||e[14]!==i?(u=(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[l,r,i]}),e[12]=l,e[13]=r,e[14]=i,e[15]=u):u=e[15],u},"V"),he=p(n=>{let e=(0,O.c)(40),{keyLabel:s,rows:a,testId:t,title:c}=n,l=F(),r;e[0]!==c?(r=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[0]=c,e[1]=r):r=e[1];let i;e[2]!==s?(i=(0,o.jsx)(M,{children:s}),e[2]=s,e[3]=i):i=e[3];let u;e[4]!==l?(u=l("Calls"),e[4]=l,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)(M,{className:"text-end",children:u}),e[6]=u,e[7]=m):m=e[7];let k;e[8]!==l?(k=l("Input tokens"),e[8]=l,e[9]=k):k=e[9];let y;e[10]!==k?(y=(0,o.jsx)(M,{className:"text-end",children:k}),e[10]=k,e[11]=y):y=e[11];let b;e[12]!==l?(b=l("Output tokens"),e[12]=l,e[13]=b):b=e[13];let T;e[14]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[14]=b,e[15]=T):T=e[15];let g;e[16]!==l?(g=l("Cost"),e[16]=l,e[17]=g):g=e[17];let d;e[18]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[18]=g,e[19]=d):d=e[19];let x;e[20]!==d||e[21]!==i||e[22]!==m||e[23]!==y||e[24]!==T?(x=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d]})}),e[20]=d,e[21]=i,e[22]=m,e[23]=y,e[24]=T,e[25]=x):x=e[25];let h;if(e[26]!==a||e[27]!==t){let N;e[29]!==t?(N=p(w=>(0,o.jsxs)(A,{"data-testid":`${t}-row`,children:[(0,o.jsx)(S,{className:"max-w-[280px] truncate font-mono",title:w.key,children:w.key}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.calls)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:ke(w),value:B(w)})})]},w.key),"x"),e[29]=t,e[30]=N):N=e[30],h=a.map(N),e[26]=a,e[27]=t,e[28]=h}else h=e[28];let f;e[31]!==h?(f=(0,o.jsx)(Z,{children:h}),e[31]=h,e[32]=f):f=e[32];let v;e[33]!==x||e[34]!==f?(v=(0,o.jsxs)(R,{children:[x,f]}),e[33]=x,e[34]=f,e[35]=v):v=e[35];let C;return e[36]!==r||e[37]!==v||e[38]!==t?(C=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":t,children:[r,v]}),e[36]=r,e[37]=v,e[38]=t,e[39]=C):C=e[39],C},"ee"),$e=p(n=>{let e=(0,O.c)(55),{calls:s,onOpenTrace:a}=n,t=F(),c;e[0]!==t?(c=t("Recent calls"),e[0]=t,e[1]=c):c=e[1];let l;e[2]!==c?(l=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[2]=c,e[3]=l):l=e[3];let r;e[4]!==t?(r=t("When"),e[4]=t,e[5]=r):r=e[5];let i;e[6]!==r?(i=(0,o.jsx)(M,{children:r}),e[6]=r,e[7]=i):i=e[7];let u;e[8]!==t?(u=t("Function"),e[8]=t,e[9]=u):u=e[9];let m;e[10]!==u?(m=(0,o.jsx)(M,{children:u}),e[10]=u,e[11]=m):m=e[11];let k;e[12]!==t?(k=t("Model"),e[12]=t,e[13]=k):k=e[13];let y;e[14]!==k?(y=(0,o.jsx)(M,{children:k}),e[14]=k,e[15]=y):y=e[15];let b;e[16]!==t?(b=t("Input tokens"),e[16]=t,e[17]=b):b=e[17];let T;e[18]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[18]=b,e[19]=T):T=e[19];let g;e[20]!==t?(g=t("Output tokens"),e[20]=t,e[21]=g):g=e[21];let d;e[22]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[22]=g,e[23]=d):d=e[23];let x;e[24]!==t?(x=t("Cost"),e[24]=t,e[25]=x):x=e[25];let h;e[26]!==x?(h=(0,o.jsx)(M,{className:"text-end",children:x}),e[26]=x,e[27]=h):h=e[27];let f;e[28]!==t?(f=t("Trace"),e[28]=t,e[29]=f):f=e[29];let v;e[30]!==f?(v=(0,o.jsx)(M,{children:f}),e[30]=f,e[31]=v):v=e[31];let C;e[32]!==T||e[33]!==d||e[34]!==h||e[35]!==v||e[36]!==i||e[37]!==m||e[38]!==y?(C=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d,h,v]})}),e[32]=T,e[33]=d,e[34]=h,e[35]=v,e[36]=i,e[37]=m,e[38]=y,e[39]=C):C=e[39];let N;if(e[40]!==s||e[41]!==a||e[42]!==t){let j;e[44]!==a||e[45]!==t?(j=p(I=>(0,o.jsxs)(A,{"data-testid":"ai-call",children:[(0,o.jsx)(S,{className:"font-mono text-muted-foreground",children:oe(I.startTs)}),(0,o.jsx)(S,{className:"font-mono",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[I.functionPath,I.streaming?(0,o.jsx)(K,{variant:"outline",children:t("stream")}):null,I.ok?null:(0,o.jsx)(K,{variant:"destructive",children:t("failed")})]})}),(0,o.jsx)(S,{className:"max-w-[240px] truncate font-mono",title:I.model,children:I.model}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.inputTokens===void 0?"\u2014":_(I.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.outputTokens===void 0?"\u2014":_(I.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:I.cost===void 0?"none":I.costSource??"estimated",value:I.cost??0})}),(0,o.jsx)(S,{children:(0,o.jsx)("button",{className:"font-mono text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{a(I.traceId)},"onClick"),title:t("Open the trace {trace}",{trace:I.traceId}),type:"button",children:I.traceId.slice(0,8)})})]},`${I.traceId}:${I.startTs.toString()}:${I.model}`),"K"),e[44]=a,e[45]=t,e[46]=j):j=e[46],N=s.slice(0,Ae).map(j),e[40]=s,e[41]=a,e[42]=t,e[43]=N}else N=e[43];let w;e[47]!==N?(w=(0,o.jsx)(Z,{children:N}),e[47]=N,e[48]=w):w=e[48];let P;e[49]!==C||e[50]!==w?(P=(0,o.jsxs)(R,{children:[C,w]}),e[49]=C,e[50]=w,e[51]=P):P=e[51];let L;return e[52]!==l||e[53]!==P?(L=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":"ai-calls",children:[l,P]}),e[52]=l,e[53]=P,e[54]=L):L=e[54],L},"Pe"),Ee=p(n=>{let e=(0,O.c)(48),{totals:s,trend:a}=n,t=F(),c;e[0]!==s?(c=ke(s),e[0]=s,e[1]=c):c=e[1];let l=c,r;e[2]!==t||e[3]!==a?(r=a.length>=2?(0,o.jsx)(de,{ariaLabel:t("Cost per minute"),className:"h-7 w-24",series:a,testId:"ai-trend"}):void 0,e[2]=t,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==l||e[6]!==t||e[7]!==s.estimatedCost||e[8]!==s.providerCost?(i=l==="none"?t("No cost reported"):(0,o.jsx)("span",{"data-testid":"ai-cost-split",children:t("{provider} provider-reported \xB7 {estimated} estimated",{estimated:E(s.estimatedCost),provider:E(s.providerCost)})}),e[5]=l,e[6]=t,e[7]=s.estimatedCost,e[8]=s.providerCost,e[9]=i):i=e[9];let u;e[10]!==t?(u=t("Total cost"),e[10]=t,e[11]=u):u=e[11];let m;e[12]!==s?(m=B(s),e[12]=s,e[13]=m):m=e[13];let k;e[14]!==l||e[15]!==m?(k=(0,o.jsx)(te,{provenance:l,value:m}),e[14]=l,e[15]=m,e[16]=k):k=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==k?(y=(0,o.jsx)($,{chart:r,footer:i,label:u,testId:"ai-total-cost",value:k}),e[17]=r,e[18]=i,e[19]=u,e[20]=k,e[21]=y):y=e[21];let b;e[22]!==t?(b=t("Input tokens"),e[22]=t,e[23]=b):b=e[23];let T;e[24]!==s.inputTokens?(T=_(s.inputTokens),e[24]=s.inputTokens,e[25]=T):T=e[25];let g;e[26]!==b||e[27]!==T?(g=(0,o.jsx)($,{label:b,testId:"ai-input-tokens",value:T}),e[26]=b,e[27]=T,e[28]=g):g=e[28];let d;e[29]!==t?(d=t("Output tokens"),e[29]=t,e[30]=d):d=e[30];let x;e[31]!==s.outputTokens?(x=_(s.outputTokens),e[31]=s.outputTokens,e[32]=x):x=e[32];let h;e[33]!==d||e[34]!==x?(h=(0,o.jsx)($,{label:d,testId:"ai-output-tokens",value:x}),e[33]=d,e[34]=x,e[35]=h):h=e[35];let f;e[36]!==t?(f=t("Calls"),e[36]=t,e[37]=f):f=e[37];let v;e[38]!==s.calls?(v=_(s.calls),e[38]=s.calls,e[39]=v):v=e[39];let C;e[40]!==f||e[41]!==v?(C=(0,o.jsx)($,{label:f,testId:"ai-calls-total",value:v}),e[40]=f,e[41]=v,e[42]=C):C=e[42];let N;return e[43]!==g||e[44]!==h||e[45]!==C||e[46]!==y?(N=(0,o.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"ai-totals",children:[y,g,h,C]}),e[43]=g,e[44]=h,e[45]=C,e[46]=y,e[47]=N):N=e[47],N},"Ke"),Ye=p(n=>{let e=(0,O.c)(29),{initialShardKey:s}=n,a=F(),{queryShardKey:t,setShardKey:c,shardKey:l}=le(s),r=ce(t),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let u;e[1]!==t?(u={live:!0,shardKey:t},e[1]=t,e[2]=u):u=e[2];let{data:m,error:k}=D(U.getTraces,i,u),y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={},e[3]=y):y=e[3];let b;e[4]!==t?(b={live:!0,shardKey:t},e[4]=t,e[5]=b):b=e[5];let{data:T}=D(U.getMetricHistory,y,b),g,d;e[6]!==m||e[7]!==T?(d=Oe(T,Ke(m)),g=d.trend.map(Le),e[6]=m,e[7]=T,e[8]=g,e[9]=d):(g=e[8],d=e[9]);let x=g,h;e[10]!==c||e[11]!==l?(h=(0,o.jsx)(re,{onChange:c,testId:"ai-shard-input",value:l}),e[10]=c,e[11]=l,e[12]=h):h=e[12];let f;e[13]!==k||e[14]!==t?(f=k===null?null:(0,o.jsx)(ie,{error:k,shardKey:t,testId:"ai-error"}),e[13]=k,e[14]=t,e[15]=f):f=e[15];let v;e[16]!==r||e[17]!==a||e[18]!==x||e[19]!==d.byFunction||e[20]!==d.byModel||e[21]!==d.calls||e[22]!==d.source||e[23]!==d.totals?(v=d.source==="none"?(0,o.jsx)(ae,{description:a("Spend shows up here once an action calls ctx.ai.model(...) \u2014 tokens and cost per function and per model."),testId:"ai-empty",title:a("No AI usage recorded")}):(0,o.jsxs)(o.Fragment,{children:[d.source==="live"?(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-live-only",children:a("No durable history yet \u2014 these totals come from the live trace ring and reset when the shard hibernates.")}):(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-window",children:a("Totals cover the retained metric history (up to the last 24 hours).")}),(0,o.jsx)(Ee,{totals:d.totals,trend:x}),(0,o.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,o.jsx)(he,{keyLabel:a("Function"),rows:d.byFunction,testId:"ai-by-function",title:a("By function")}),(0,o.jsx)(he,{keyLabel:a("Model"),rows:d.byModel,testId:"ai-by-model",title:a("By model")})]}),d.calls.length===0?(0,o.jsx)(q,{children:(0,o.jsx)(ne,{className:"p-4 text-xs text-muted-foreground","data-testid":"ai-no-calls",children:a("No recent calls in the live trace ring \u2014 it empties when the shard hibernates.")})}):(0,o.jsx)($e,{calls:d.calls,onOpenTrace:r})]}),e[16]=r,e[17]=a,e[18]=x,e[19]=d.byFunction,e[20]=d.byModel,e[21]=d.calls,e[22]=d.source,e[23]=d.totals,e[24]=v):v=e[24];let C;return e[25]!==h||e[26]!==f||e[27]!==v?(C=(0,o.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ai-panel",children:[h,f,v]}),e[25]=h,e[26]=f,e[27]=v,e[28]=C):C=e[28],C},"Ze");function Le(n){return n.providerCost+n.estimatedCost}p(Le,"Ue");export{Ye as default};
|
|
1
|
+
import{d as E,e as _}from"./chunk-FWM5Z6CH.js";import{a as $}from"./chunk-SR6CPTRT.js";import{a as de}from"./chunk-DB6QX4X6.js";import"./chunk-5WNGRT7N.js";import{a as ce}from"./chunk-QNM2J7MG.js";import"./chunk-ONTGYVAN.js";import"./chunk-Y2YLTUMD.js";import"./chunk-BG2CJOVS.js";import{a as le}from"./chunk-J45HAKBU.js";import{a as re}from"./chunk-FHLODLBC.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import"./chunk-4EPW63HS.js";import"./chunk-UD5REVU2.js";import{a as ae}from"./chunk-RCXNYW7P.js";import{b as K}from"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{a as ie}from"./chunk-YEXTJUKQ.js";import"./chunk-LSEUUZN4.js";import{a as R,b as W,c as Z,d as A,e as M,f as S}from"./chunk-7QEZ2SFW.js";import"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import{a as U}from"./chunk-2W4UO5BC.js";import{c as D}from"./chunk-4N76XUNG.js";import{a as q,b as H,c as J,e as ne}from"./chunk-OK2QU2EV.js";import"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as F,w as oe}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as be}from"./chunk-GWNGVKLG.js";import{b as ge}from"./chunk-6G3E4PJ2.js";import{a as p,d as se}from"./chunk-5PEAXTYQ.js";var O=se(be(),1);var o=se(ge(),1);var G="gen_ai.usage.input_tokens",Q="gen_ai.usage.output_tokens",V="gen_ai.usage.cost",fe="gen_ai.request.model",Te="lunora.usage.cost.source",xe=new Set(["ai.embed","ai.generate","ai.stream"]),ue=6e4,Ce=1440,ve="unknown",X=p(()=>({calls:0,estimatedCost:0,inputTokens:0,outputTokens:0,providerCost:0}),"q"),Y=p((n,e)=>{let s=n?.[e];return typeof s=="string"&&s!==""?s:void 0},"J"),z=p((n,e)=>{let s=n?.[e];return typeof s=="number"&&Number.isFinite(s)?s:void 0},"L"),ee=p(n=>Y(n,Te)==="provider"?"provider":"estimated","Q"),me=p((n,e)=>n.reduce((s,a)=>s+e(a),0),"Y"),B=p(n=>n.providerCost+n.estimatedCost,"F"),ke=p(n=>n.estimatedCost>0?n.providerCost>0?"mixed":"estimated":n.providerCost>0?"provider":"none","ae"),ye=p((n,e)=>({calls:n.calls+e.calls,estimatedCost:n.estimatedCost+e.estimatedCost,inputTokens:n.inputTokens+e.inputTokens,outputTokens:n.outputTokens+e.outputTokens,providerCost:n.providerCost+e.providerCost}),"ce"),Ie=p(n=>{let e=X(),s=0,a=0,t=0;for(let c of n){let l=me(c.points,i=>i.sum),r=me(c.points,i=>i.count);c.name===G?(e.inputTokens+=l,s+=r):c.name===Q?(e.outputTokens+=l,a+=r):(t+=r,ee(c.attributes)==="provider"?e.providerCost+=l:e.estimatedCost+=l)}return e.calls=Math.max(s,a,t),e},"ge"),Ne=p((n,e)=>B(e)-B(n)||e.inputTokens+e.outputTokens-(n.inputTokens+n.outputTokens)||n.key.localeCompare(e.key),"Ne"),pe=p((n,e)=>{let s=new Map;for(let a of n){let t=e(a);s.set(t,{key:t,...ye(s.get(t)??X(),a)})}return[...s.values()].toSorted(Ne)},"Z"),we=p(n=>(n?.series??[]).filter(e=>e.name===G||e.name===Q||e.name===V),"xe"),Me=p(n=>Y(n.attributes,fe)??ve,"Se"),Se=p(n=>{let e=new Map;for(let s of n){let a=Me(s),t=JSON.stringify([s.functionPath,a]),c=e.get(t)??{functionPath:s.functionPath,model:a,series:[]};c.series.push(s),e.set(t,c)}return[...e.values()].map(({functionPath:s,model:a,series:t})=>({functionPath:s,model:a,...Ie(t)}))},"Ie"),_e=p(n=>{let e=new Map;for(let r of n){if(r.name!==V)continue;let i=ee(r.attributes)==="provider";for(let u of r.points){let m=e.get(u.bucketMs)??{bucketMs:u.bucketMs,estimatedCost:0,providerCost:0};i?m.providerCost+=u.sum:m.estimatedCost+=u.sum,e.set(u.bucketMs,m)}}let s=[...e.keys()].toSorted((r,i)=>r-i),a=s[0],t=s.at(-1);if(a===void 0||t===void 0)return[];let c=Math.max(a,t-(Ce-1)*ue),l=[];for(let r=c;r<=t;r+=ue)l.push(e.get(r)??{bucketMs:r,estimatedCost:0,providerCost:0});return l},"_e"),Pe=p(n=>{let e=[];for(let s of n)for(let a of s.spans){if(!xe.has(a.name))continue;let{attributes:t}=a,c=z(t,V),l=z(t,G),r=z(t,Q);e.push({...c===void 0?{}:{cost:c,costSource:ee(t)},functionPath:s.functionPath,...l===void 0?{}:{inputTokens:l},model:Y(t,fe)??ve,ok:a.ok,...r===void 0?{}:{outputTokens:r},startTs:s.startTs+a.offsetMs,streaming:a.name==="ai.stream",traceId:s.traceId})}return e.toSorted((s,a)=>a.startTs-s.startTs)},"Me"),Fe=p(n=>n.map(e=>{let s=e.cost??0;return{calls:1,estimatedCost:e.costSource==="provider"?0:s,functionPath:e.functionPath,inputTokens:e.inputTokens??0,model:e.model,outputTokens:e.outputTokens??0,providerCost:e.costSource==="provider"?s:0}}),"Oe"),Oe=p((n,e)=>{let s=we(n),a=Pe(e),t=s.length>0,c=t?Se(s):Fe(a),l=X(),r="none";for(let i of c)l=ye(l,i);return t?r="history":a.length>0&&(r="live"),{byFunction:pe(c,i=>i.functionPath),byModel:pe(c,i=>i.model),calls:a,source:r,totals:l,trend:t?_e(s):[]}},"Ae"),Ke=p(n=>Array.isArray(n?.traces)?n.traces:[],"Ee"),Ae=25,te=p(n=>{let e=(0,O.c)(16),{provenance:s,value:a}=n,t=F();if(s==="none"){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=(0,o.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[0]=m):m=e[0],m}let c;e[1]!==s||e[2]!==a?(c=s==="provider"?E(a):`~${E(a)}`,e[1]=s,e[2]=a,e[3]=c):c=e[3];let l;e[4]!==c?(l=(0,o.jsx)("span",{className:"tabular-nums",children:c}),e[4]=c,e[5]=l):l=e[5];let r;e[6]!==s||e[7]!==t?(r=s==="estimated"?(0,o.jsx)(K,{title:t("Derived from a price table, not reported by the provider."),variant:"warning",children:t("Estimated")}):null,e[6]=s,e[7]=t,e[8]=r):r=e[8];let i;e[9]!==s||e[10]!==t?(i=s==="mixed"?(0,o.jsx)(K,{title:t("Includes cost derived from a price table, not reported by the provider."),variant:"warning",children:t("Partly estimated")}):null,e[9]=s,e[10]=t,e[11]=i):i=e[11];let u;return e[12]!==l||e[13]!==r||e[14]!==i?(u=(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[l,r,i]}),e[12]=l,e[13]=r,e[14]=i,e[15]=u):u=e[15],u},"V"),he=p(n=>{let e=(0,O.c)(40),{keyLabel:s,rows:a,testId:t,title:c}=n,l=F(),r;e[0]!==c?(r=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[0]=c,e[1]=r):r=e[1];let i;e[2]!==s?(i=(0,o.jsx)(M,{children:s}),e[2]=s,e[3]=i):i=e[3];let u;e[4]!==l?(u=l("Calls"),e[4]=l,e[5]=u):u=e[5];let m;e[6]!==u?(m=(0,o.jsx)(M,{className:"text-end",children:u}),e[6]=u,e[7]=m):m=e[7];let k;e[8]!==l?(k=l("Input tokens"),e[8]=l,e[9]=k):k=e[9];let y;e[10]!==k?(y=(0,o.jsx)(M,{className:"text-end",children:k}),e[10]=k,e[11]=y):y=e[11];let b;e[12]!==l?(b=l("Output tokens"),e[12]=l,e[13]=b):b=e[13];let T;e[14]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[14]=b,e[15]=T):T=e[15];let g;e[16]!==l?(g=l("Cost"),e[16]=l,e[17]=g):g=e[17];let d;e[18]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[18]=g,e[19]=d):d=e[19];let x;e[20]!==d||e[21]!==i||e[22]!==m||e[23]!==y||e[24]!==T?(x=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d]})}),e[20]=d,e[21]=i,e[22]=m,e[23]=y,e[24]=T,e[25]=x):x=e[25];let h;if(e[26]!==a||e[27]!==t){let N;e[29]!==t?(N=p(w=>(0,o.jsxs)(A,{"data-testid":`${t}-row`,children:[(0,o.jsx)(S,{className:"max-w-[280px] truncate font-mono",title:w.key,children:w.key}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.calls)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:_(w.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:ke(w),value:B(w)})})]},w.key),"x"),e[29]=t,e[30]=N):N=e[30],h=a.map(N),e[26]=a,e[27]=t,e[28]=h}else h=e[28];let f;e[31]!==h?(f=(0,o.jsx)(Z,{children:h}),e[31]=h,e[32]=f):f=e[32];let v;e[33]!==x||e[34]!==f?(v=(0,o.jsxs)(R,{children:[x,f]}),e[33]=x,e[34]=f,e[35]=v):v=e[35];let C;return e[36]!==r||e[37]!==v||e[38]!==t?(C=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":t,children:[r,v]}),e[36]=r,e[37]=v,e[38]=t,e[39]=C):C=e[39],C},"ee"),$e=p(n=>{let e=(0,O.c)(55),{calls:s,onOpenTrace:a}=n,t=F(),c;e[0]!==t?(c=t("Recent calls"),e[0]=t,e[1]=c):c=e[1];let l;e[2]!==c?(l=(0,o.jsx)(H,{className:"px-4 py-3",children:(0,o.jsx)(J,{children:c})}),e[2]=c,e[3]=l):l=e[3];let r;e[4]!==t?(r=t("When"),e[4]=t,e[5]=r):r=e[5];let i;e[6]!==r?(i=(0,o.jsx)(M,{children:r}),e[6]=r,e[7]=i):i=e[7];let u;e[8]!==t?(u=t("Function"),e[8]=t,e[9]=u):u=e[9];let m;e[10]!==u?(m=(0,o.jsx)(M,{children:u}),e[10]=u,e[11]=m):m=e[11];let k;e[12]!==t?(k=t("Model"),e[12]=t,e[13]=k):k=e[13];let y;e[14]!==k?(y=(0,o.jsx)(M,{children:k}),e[14]=k,e[15]=y):y=e[15];let b;e[16]!==t?(b=t("Input tokens"),e[16]=t,e[17]=b):b=e[17];let T;e[18]!==b?(T=(0,o.jsx)(M,{className:"text-end",children:b}),e[18]=b,e[19]=T):T=e[19];let g;e[20]!==t?(g=t("Output tokens"),e[20]=t,e[21]=g):g=e[21];let d;e[22]!==g?(d=(0,o.jsx)(M,{className:"text-end",children:g}),e[22]=g,e[23]=d):d=e[23];let x;e[24]!==t?(x=t("Cost"),e[24]=t,e[25]=x):x=e[25];let h;e[26]!==x?(h=(0,o.jsx)(M,{className:"text-end",children:x}),e[26]=x,e[27]=h):h=e[27];let f;e[28]!==t?(f=t("Trace"),e[28]=t,e[29]=f):f=e[29];let v;e[30]!==f?(v=(0,o.jsx)(M,{children:f}),e[30]=f,e[31]=v):v=e[31];let C;e[32]!==T||e[33]!==d||e[34]!==h||e[35]!==v||e[36]!==i||e[37]!==m||e[38]!==y?(C=(0,o.jsx)(W,{children:(0,o.jsxs)(A,{children:[i,m,y,T,d,h,v]})}),e[32]=T,e[33]=d,e[34]=h,e[35]=v,e[36]=i,e[37]=m,e[38]=y,e[39]=C):C=e[39];let N;if(e[40]!==s||e[41]!==a||e[42]!==t){let j;e[44]!==a||e[45]!==t?(j=p(I=>(0,o.jsxs)(A,{"data-testid":"ai-call",children:[(0,o.jsx)(S,{className:"font-mono text-muted-foreground",children:oe(I.startTs)}),(0,o.jsx)(S,{className:"font-mono",children:(0,o.jsxs)("span",{className:"inline-flex items-center gap-2",children:[I.functionPath,I.streaming?(0,o.jsx)(K,{variant:"outline",children:t("stream")}):null,I.ok?null:(0,o.jsx)(K,{variant:"destructive",children:t("failed")})]})}),(0,o.jsx)(S,{className:"max-w-[240px] truncate font-mono",title:I.model,children:I.model}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.inputTokens===void 0?"\u2014":_(I.inputTokens)}),(0,o.jsx)(S,{className:"text-end tabular-nums",children:I.outputTokens===void 0?"\u2014":_(I.outputTokens)}),(0,o.jsx)(S,{className:"text-end",children:(0,o.jsx)(te,{provenance:I.cost===void 0?"none":I.costSource??"estimated",value:I.cost??0})}),(0,o.jsx)(S,{children:(0,o.jsx)("button",{className:"font-mono text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{a(I.traceId)},"onClick"),title:t("Open the trace {trace}",{trace:I.traceId}),type:"button",children:I.traceId.slice(0,8)})})]},`${I.traceId}:${I.startTs.toString()}:${I.model}`),"K"),e[44]=a,e[45]=t,e[46]=j):j=e[46],N=s.slice(0,Ae).map(j),e[40]=s,e[41]=a,e[42]=t,e[43]=N}else N=e[43];let w;e[47]!==N?(w=(0,o.jsx)(Z,{children:N}),e[47]=N,e[48]=w):w=e[48];let P;e[49]!==C||e[50]!==w?(P=(0,o.jsxs)(R,{children:[C,w]}),e[49]=C,e[50]=w,e[51]=P):P=e[51];let L;return e[52]!==l||e[53]!==P?(L=(0,o.jsxs)(q,{className:"gap-0 py-0","data-testid":"ai-calls",children:[l,P]}),e[52]=l,e[53]=P,e[54]=L):L=e[54],L},"Pe"),Ee=p(n=>{let e=(0,O.c)(48),{totals:s,trend:a}=n,t=F(),c;e[0]!==s?(c=ke(s),e[0]=s,e[1]=c):c=e[1];let l=c,r;e[2]!==t||e[3]!==a?(r=a.length>=2?(0,o.jsx)(de,{ariaLabel:t("Cost per minute"),className:"h-7 w-24",series:a,testId:"ai-trend"}):void 0,e[2]=t,e[3]=a,e[4]=r):r=e[4];let i;e[5]!==l||e[6]!==t||e[7]!==s.estimatedCost||e[8]!==s.providerCost?(i=l==="none"?t("No cost reported"):(0,o.jsx)("span",{"data-testid":"ai-cost-split",children:t("{provider} provider-reported \xB7 {estimated} estimated",{estimated:E(s.estimatedCost),provider:E(s.providerCost)})}),e[5]=l,e[6]=t,e[7]=s.estimatedCost,e[8]=s.providerCost,e[9]=i):i=e[9];let u;e[10]!==t?(u=t("Total cost"),e[10]=t,e[11]=u):u=e[11];let m;e[12]!==s?(m=B(s),e[12]=s,e[13]=m):m=e[13];let k;e[14]!==l||e[15]!==m?(k=(0,o.jsx)(te,{provenance:l,value:m}),e[14]=l,e[15]=m,e[16]=k):k=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==k?(y=(0,o.jsx)($,{chart:r,footer:i,label:u,testId:"ai-total-cost",value:k}),e[17]=r,e[18]=i,e[19]=u,e[20]=k,e[21]=y):y=e[21];let b;e[22]!==t?(b=t("Input tokens"),e[22]=t,e[23]=b):b=e[23];let T;e[24]!==s.inputTokens?(T=_(s.inputTokens),e[24]=s.inputTokens,e[25]=T):T=e[25];let g;e[26]!==b||e[27]!==T?(g=(0,o.jsx)($,{label:b,testId:"ai-input-tokens",value:T}),e[26]=b,e[27]=T,e[28]=g):g=e[28];let d;e[29]!==t?(d=t("Output tokens"),e[29]=t,e[30]=d):d=e[30];let x;e[31]!==s.outputTokens?(x=_(s.outputTokens),e[31]=s.outputTokens,e[32]=x):x=e[32];let h;e[33]!==d||e[34]!==x?(h=(0,o.jsx)($,{label:d,testId:"ai-output-tokens",value:x}),e[33]=d,e[34]=x,e[35]=h):h=e[35];let f;e[36]!==t?(f=t("Calls"),e[36]=t,e[37]=f):f=e[37];let v;e[38]!==s.calls?(v=_(s.calls),e[38]=s.calls,e[39]=v):v=e[39];let C;e[40]!==f||e[41]!==v?(C=(0,o.jsx)($,{label:f,testId:"ai-calls-total",value:v}),e[40]=f,e[41]=v,e[42]=C):C=e[42];let N;return e[43]!==g||e[44]!==h||e[45]!==C||e[46]!==y?(N=(0,o.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-testid":"ai-totals",children:[y,g,h,C]}),e[43]=g,e[44]=h,e[45]=C,e[46]=y,e[47]=N):N=e[47],N},"Ke"),Ye=p(n=>{let e=(0,O.c)(29),{initialShardKey:s}=n,a=F(),{queryShardKey:t,setShardKey:c,shardKey:l}=le(s),r=ce(t),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let u;e[1]!==t?(u={live:!0,shardKey:t},e[1]=t,e[2]=u):u=e[2];let{data:m,error:k}=D(U.getTraces,i,u),y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={},e[3]=y):y=e[3];let b;e[4]!==t?(b={live:!0,shardKey:t},e[4]=t,e[5]=b):b=e[5];let{data:T}=D(U.getMetricHistory,y,b),g,d;e[6]!==m||e[7]!==T?(d=Oe(T,Ke(m)),g=d.trend.map(Le),e[6]=m,e[7]=T,e[8]=g,e[9]=d):(g=e[8],d=e[9]);let x=g,h;e[10]!==c||e[11]!==l?(h=(0,o.jsx)(re,{onChange:c,testId:"ai-shard-input",value:l}),e[10]=c,e[11]=l,e[12]=h):h=e[12];let f;e[13]!==k||e[14]!==t?(f=k===null?null:(0,o.jsx)(ie,{error:k,shardKey:t,testId:"ai-error"}),e[13]=k,e[14]=t,e[15]=f):f=e[15];let v;e[16]!==r||e[17]!==a||e[18]!==x||e[19]!==d.byFunction||e[20]!==d.byModel||e[21]!==d.calls||e[22]!==d.source||e[23]!==d.totals?(v=d.source==="none"?(0,o.jsx)(ae,{description:a("Spend shows up here once an action calls ctx.ai.model(...) \u2014 tokens and cost per function and per model."),testId:"ai-empty",title:a("No AI usage recorded")}):(0,o.jsxs)(o.Fragment,{children:[d.source==="live"?(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-live-only",children:a("No durable history yet \u2014 these totals come from the live trace ring and reset when the shard hibernates.")}):(0,o.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ai-window",children:a("Totals cover the retained metric history (up to the last 24 hours).")}),(0,o.jsx)(Ee,{totals:d.totals,trend:x}),(0,o.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,o.jsx)(he,{keyLabel:a("Function"),rows:d.byFunction,testId:"ai-by-function",title:a("By function")}),(0,o.jsx)(he,{keyLabel:a("Model"),rows:d.byModel,testId:"ai-by-model",title:a("By model")})]}),d.calls.length===0?(0,o.jsx)(q,{children:(0,o.jsx)(ne,{className:"p-4 text-xs text-muted-foreground","data-testid":"ai-no-calls",children:a("No recent calls in the live trace ring \u2014 it empties when the shard hibernates.")})}):(0,o.jsx)($e,{calls:d.calls,onOpenTrace:r})]}),e[16]=r,e[17]=a,e[18]=x,e[19]=d.byFunction,e[20]=d.byModel,e[21]=d.calls,e[22]=d.source,e[23]=d.totals,e[24]=v):v=e[24];let C;return e[25]!==h||e[26]!==f||e[27]!==v?(C=(0,o.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ai-panel",children:[h,f,v]}),e[25]=h,e[26]=f,e[27]=v,e[28]=C):C=e[28],C},"Ze");function Le(n){return n.providerCost+n.estimatedCost}p(Le,"Ue");export{Ye as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as X0,b as Cf,c as K0,d as qf,e as J0,f as p0,k as r0}from"./chunk-7KJCRT4B.js";import"./chunk-GXTSE66Z.js";import"./chunk-MJTVTUNI.js";import"./chunk-CL3JOU6F.js";import{a as L0}from"./chunk-2DT3QG6Q.js";import"./chunk-BCUOQNI2.js";import"./chunk-P5EVJEGC.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QKUVJIRX.js";import"./chunk-QAOZXPLU.js";import"./chunk-DA2CAFXI.js";import{a as Bf}from"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as x0}from"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import{a as Pd}from"./chunk-4EPW63HS.js";import{a as j0}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import"./chunk-RCXNYW7P.js";import"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{b as Rf}from"./chunk-WCWP4EAW.js";import"./chunk-BX7TFVCC.js";import"./chunk-4PI2OSSP.js";import"./chunk-2W4UO5BC.js";import"./chunk-FBDIQ67D.js";import"./chunk-OK2QU2EV.js";import{a as Y0,k as Q0}from"./chunk-FACXM2UB.js";import"./chunk-ZPQBVYNN.js";import{B as Hf,b as R0,t as Z0,x as Mf,y as V0}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as ly}from"./chunk-GWNGVKLG.js";import{a as q0,b as G0}from"./chunk-6G3E4PJ2.js";import{a as f,b as jn,d as Xa}from"./chunk-5PEAXTYQ.js";var u1=jn(W=>{"use strict";function Xf(l,t){var u=l.length;l.push(t);l:for(;0<u;){var a=u-1>>>1,n=l[a];if(0<Ln(n,t))l[a]=t,l[u]=n,u=a;else break l}}f(Xf,"push");function et(l){return l.length===0?null:l[0]}f(et,"peek");function Jn(l){if(l.length===0)return null;var t=l[0],u=l.pop();if(u!==t){l[0]=u;l:for(var a=0,n=l.length,e=n>>>1;a<e;){var c=2*(a+1)-1,i=l[c],v=c+1,o=l[v];if(0>Ln(i,u))v<n&&0>Ln(o,i)?(l[a]=o,l[v]=u,a=v):(l[a]=i,l[c]=u,a=c);else if(v<n&&0>Ln(o,u))l[a]=o,l[v]=u,a=v;else break l}}return t}f(Jn,"pop");function Ln(l,t){var u=l.sortIndex-t.sortIndex;return u!==0?u:l.id-t.id}f(Ln,"compare");W.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(w0=performance,W.unstable_now=function(){return w0.now()}):(Yf=Date,F0=Yf.now(),W.unstable_now=function(){return Yf.now()-F0});var w0,Yf,F0,Ot=[],Zt=[],ty=1,Kl=null,zl=3,Zf=!1,Za=!1,Va=!1,Vf=!1,k0=typeof setTimeout=="function"?setTimeout:null,I0=typeof clearTimeout=="function"?clearTimeout:null,W0=typeof setImmediate<"u"?setImmediate:null;function Kn(l){for(var t=et(Zt);t!==null;){if(t.callback===null)Jn(Zt);else if(t.startTime<=l)Jn(Zt),t.sortIndex=t.expirationTime,Xf(Ot,t);else break;t=et(Zt)}}f(Kn,"advanceTimers");function xf(l){if(Va=!1,Kn(l),!Za)if(et(Ot)!==null)Za=!0,xu||(xu=!0,Vu());else{var t=et(Zt);t!==null&&jf(xf,t.startTime-l)}}f(xf,"handleTimeout");var xu=!1,xa=-1,P0=5,l1=-1;function t1(){return Vf?!0:!(W.unstable_now()-l1<P0)}f(t1,"shouldYieldToHost");function Gf(){if(Vf=!1,xu){var l=W.unstable_now();l1=l;var t=!0;try{l:{Za=!1,Va&&(Va=!1,I0(xa),xa=-1),Zf=!0;var u=zl;try{t:{for(Kn(l),Kl=et(Ot);Kl!==null&&!(Kl.expirationTime>l&&t1());){var a=Kl.callback;if(typeof a=="function"){Kl.callback=null,zl=Kl.priorityLevel;var n=a(Kl.expirationTime<=l);if(l=W.unstable_now(),typeof n=="function"){Kl.callback=n,Kn(l),t=!0;break t}Kl===et(Ot)&&Jn(Ot),Kn(l)}else Jn(Ot);Kl=et(Ot)}if(Kl!==null)t=!0;else{var e=et(Zt);e!==null&&jf(xf,e.startTime-l),t=!1}}break l}finally{Kl=null,zl=u,Zf=!1}t=void 0}}finally{t?Vu():xu=!1}}}f(Gf,"performWorkUntilDeadline");var Vu;typeof W0=="function"?Vu=f(function(){W0(Gf)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Qf=new MessageChannel,$0=Qf.port2,Qf.port1.onmessage=Gf,Vu=f(function(){$0.postMessage(null)},"schedulePerformWorkUntilDeadline")):Vu=f(function(){k0(Gf,0)},"schedulePerformWorkUntilDeadline");var Qf,$0;function jf(l,t){xa=k0(function(){l(W.unstable_now())},t)}f(jf,"requestHostTimeout");W.unstable_IdlePriority=5;W.unstable_ImmediatePriority=1;W.unstable_LowPriority=4;W.unstable_NormalPriority=3;W.unstable_Profiling=null;W.unstable_UserBlockingPriority=2;W.unstable_cancelCallback=function(l){l.callback=null};W.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P0=0<l?Math.floor(1e3/l):5};W.unstable_getCurrentPriorityLevel=function(){return zl};W.unstable_next=function(l){switch(zl){case 1:case 2:case 3:var t=3;break;default:t=zl}var u=zl;zl=t;try{return l()}finally{zl=u}};W.unstable_requestPaint=function(){Vf=!0};W.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var u=zl;zl=l;try{return t()}finally{zl=u}};W.unstable_scheduleCallback=function(l,t,u){var a=W.unstable_now();switch(typeof u=="object"&&u!==null?(u=u.delay,u=typeof u=="number"&&0<u?a+u:a):u=a,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=u+n,l={id:ty++,callback:t,priorityLevel:l,startTime:u,expirationTime:n,sortIndex:-1},u>a?(l.sortIndex=u,Xf(Zt,l),et(Ot)===null&&l===et(Zt)&&(Va?(I0(xa),xa=-1):Va=!0,jf(xf,u-a))):(l.sortIndex=n,Xf(Ot,l),Za||Zf||(Za=!0,xu||(xu=!0,Vu()))),l};W.unstable_shouldYield=t1;W.unstable_wrapCallback=function(l){var t=zl;return function(){var u=zl;zl=t;try{return l.apply(this,arguments)}finally{zl=u}}}});var n1=jn((Sg,a1)=>{"use strict";a1.exports=u1()});var pd=jn(Df=>{"use strict";var cl=n1(),Kv=q0(),uy=Pd();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)t+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}f(z,"formatProdErrorMessage");function Jv(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}f(Jv,"isValidContainer");function Mn(l){for(var t=l,u=t;u&&!u.alternate;)t=u,(t.flags&4098)!==0&&(l=t.return),u=t.return;for(;t.return;)t=t.return;return t.tag===3?l:null}f(Mn,"getNearestMountedFiber");function pv(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}f(pv,"getSuspenseInstanceFromFiber");function rv(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}f(rv,"getActivityInstanceFromFiber");function e1(l){if(Mn(l)!==l)throw Error(z(188))}f(e1,"assertIsMounted");function ay(l){var t=l.alternate;if(!t){if(t=Mn(l),t===null)throw Error(z(188));return t!==l?null:l}for(var u=l,a=t;;){var n=u.return;if(n===null)break;var e=n.alternate;if(e===null){if(a=n.return,a!==null){u=a;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===u)return e1(n),l;if(e===a)return e1(n),t;e=e.sibling}throw Error(z(188))}if(u.return!==a.return)u=n,a=e;else{for(var c=!1,i=n.child;i;){if(i===u){c=!0,u=n,a=e;break}if(i===a){c=!0,a=n,u=e;break}i=i.sibling}if(!c){for(i=e.child;i;){if(i===u){c=!0,u=e,a=n;break}if(i===a){c=!0,a=e,u=n;break}i=i.sibling}if(!c)throw Error(z(189))}}if(u.alternate!==a)throw Error(z(190))}if(u.tag!==3)throw Error(z(188));return u.stateNode.current===u?l:t}f(ay,"findCurrentFiberUsingSlowPath");function wv(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=wv(l),t!==null)return t;l=l.sibling}return null}f(wv,"findCurrentHostFiberImpl");function Cl(l,t,u,a,n,e){for(;l!==null;){if((l.tag===5||l.tag===27||l.tag===6)&&u(l,a,n,e)||(l.tag!==22||l.memoizedState===null)&&(t||l.tag!==5&&l.tag!==27)&&Cl(l.child,t,u,a,n,e))return!0;l=l.sibling}return!1}f(Cl,"traverseVisibleInstancesAndTextInstances");function Yu(l){for(l=l.return;l!==null;){if(l.tag===3||l.tag===5||l.tag===27)return l;l=l.return}return null}f(Yu,"getFragmentParentInstanceOrContainerFiber");function f1(l){var t=!1;for(l=l.return;l!==null&&(l.tag===4&&(t=!0),!(l.tag===3||l.tag===5||l.tag===27));)l=l.return;return t}f(f1,"fiberIsPortaledIntoHost");function Fv(l){var t=[null,null],u=Yu(l);return u===null||Wv(t,l,u.child,{foundSelf:!1}),t}f(Fv,"getFragmentInstanceOrTextInstanceSiblings");function Wv(l,t,u,a){for(;u!==null;){if(u===t)a.foundSelf=!0;else if(u.tag===5||u.tag===27||u.tag===6){if(a.foundSelf)return l[1]=u,!0;l[0]=u}else if((u.tag!==22||u.memoizedState===null)&&Wv(l,t,u.child,a))return!0;u=u.sibling}return!1}f(Wv,"findFragmentInstanceOrTextInstanceSiblings");function fl(l){switch(l.tag){case 5:case 27:case 6:return l.stateNode;case 3:return l.stateNode.containerInfo;default:throw Error(z(559))}}f(fl,"getInstanceFromHostFiber");var wu=null,zc=null;function ny(l,t,u){return l===u?!0:l===t?(wu=l,!0):!1}f(ny,"isFiberPrecedingCheck");function ey(l,t,u){return l===u?(zc=l,!1):l===t?(zc!==null&&(wu=l),!0):!1}f(ey,"isFiberFollowingCheck");function c1(l){if(l===null)return null;do l=l===null?null:l.return;while(l&&l.tag!==5&&l.tag!==27&&l.tag!==3);return l||null}f(c1,"getParentForFragmentAncestors");function Ec(l,t,u){for(var a=0,n=l;n;n=u(n))a++;n=0;for(var e=t;e;e=u(e))n++;for(;0<a-n;)l=u(l),a--;for(;0<n-a;)t=u(t),n--;for(;a--;){if(l===t||t!==null&&l===t.alternate)return l;l=u(l),t=u(t)}return null}f(Ec,"getLowestCommonAncestor");var J=Object.assign,fy=Symbol.for("react.element"),pn=Symbol.for("react.transitional.element"),wa=Symbol.for("react.portal"),Fu=Symbol.for("react.fragment"),$v=Symbol.for("react.strict_mode"),Oc=Symbol.for("react.profiler"),kv=Symbol.for("react.consumer"),ot=Symbol.for("react.context"),Ci=Symbol.for("react.forward_ref"),sc=Symbol.for("react.suspense"),Nc=Symbol.for("react.suspense_list"),Bi=Symbol.for("react.memo"),Lt=Symbol.for("react.lazy"),Ac=Symbol.for("react.activity"),cy=Symbol.for("react.legacy_hidden"),iy=Symbol.for("react.memo_cache_sentinel"),_c=Symbol.for("react.view_transition"),vy=Symbol.for("react.recoverable"),i1=Symbol.iterator;function ja(l){return l===null||typeof l!="object"?null:(l=i1&&l[i1]||l["@@iterator"],typeof l=="function"?l:null)}f(ja,"getIteratorFn");var my=Symbol.for("react.client.reference");function Dc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===my?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Fu:return"Fragment";case Oc:return"Profiler";case $v:return"StrictMode";case sc:return"Suspense";case Nc:return"SuspenseList";case Ac:return"Activity";case _c:return"ViewTransition"}if(typeof l=="object")switch(l.$$typeof){case wa:return"Portal";case ot:return l.displayName||"Context";case kv:return(l._context.displayName||"Context")+".Consumer";case Ci:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bi:return t=l.displayName||null,t!==null?t:Dc(l.type)||"Memo";case Lt:t=l._payload,l=l._init;try{return Dc(l(t))}catch{}}return null}f(Dc,"getComponentNameFromType");var Fa=Array.isArray,U=Kv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=uy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ou={pending:!1,data:null,method:null,action:null},Uc=[],Wu=-1;function bt(l){return{current:l}}f(bt,"createCursor");function gl(l){0>Wu||(l.current=Uc[Wu],Uc[Wu]=null,Wu--)}f(gl,"pop");function F(l,t){Wu++,Uc[Wu]=l.current,l.current=t}f(F,"push");var gt=bt(null),dn=bt(null),kt=bt(null),Be=bt(null);function Re(l,t){switch(F(kt,t),F(dn,l),F(gt,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?sv(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=sv(t),l=Ed(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}gl(gt),F(gt,l)}f(Re,"pushHostContainer");function ga(){gl(gt),gl(dn),gl(kt)}f(ga,"popHostContainer");function Mc(l){var t=l.memoizedState;t!==null&&(_a._currentValue=t.memoizedState,F(Be,l)),t=gt.current;var u=Ed(t,l.type);t!==u&&(F(dn,l),F(gt,u))}f(Mc,"pushHostContext");function qe(l){dn.current===l&&(gl(gt),gl(dn)),Be.current===l&&(gl(Be),_a._currentValue=Ou)}f(qe,"popHostContext");var Lf,v1;function xt(l){if(Lf===void 0)try{throw Error()}catch(u){var t=u.stack.trim().match(/\n( *(at )?)/);Lf=t&&t[1]||"",v1=-1<u.stack.indexOf(`
|
|
1
|
+
import{a as X0,b as Cf,c as K0,d as qf,e as J0,f as p0,k as r0}from"./chunk-5QUTVSHM.js";import"./chunk-GXTSE66Z.js";import"./chunk-5RX5CQSU.js";import"./chunk-CL3JOU6F.js";import{a as L0}from"./chunk-2DT3QG6Q.js";import"./chunk-BCUOQNI2.js";import"./chunk-P5EVJEGC.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-QKUVJIRX.js";import"./chunk-QAOZXPLU.js";import"./chunk-DA2CAFXI.js";import{a as Bf}from"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as x0}from"./chunk-IHGRWY3Y.js";import"./chunk-OWRKSQPE.js";import{a as Pd}from"./chunk-4EPW63HS.js";import{a as j0}from"./chunk-V3BE427M.js";import"./chunk-CKEQX655.js";import"./chunk-UD5REVU2.js";import"./chunk-RCXNYW7P.js";import"./chunk-UQA2AJGI.js";import"./chunk-T3ZCW3RG.js";import{b as Rf}from"./chunk-OZAOWE7T.js";import"./chunk-BBDTJG2K.js";import"./chunk-4PI2OSSP.js";import"./chunk-2W4UO5BC.js";import"./chunk-4N76XUNG.js";import"./chunk-OK2QU2EV.js";import{f as Y0,k as Q0}from"./chunk-SHHGIT7M.js";import"./chunk-ZPQBVYNN.js";import{B as Hf,b as R0,t as Z0,x as Mf,y as V0}from"./chunk-GNI37YCV.js";import"./chunk-PDBW6GTJ.js";import{a as ly}from"./chunk-GWNGVKLG.js";import{a as q0,b as G0}from"./chunk-6G3E4PJ2.js";import{a as f,b as jn,d as Xa}from"./chunk-5PEAXTYQ.js";var u1=jn(W=>{"use strict";function Xf(l,t){var u=l.length;l.push(t);l:for(;0<u;){var a=u-1>>>1,n=l[a];if(0<Ln(n,t))l[a]=t,l[u]=n,u=a;else break l}}f(Xf,"push");function et(l){return l.length===0?null:l[0]}f(et,"peek");function Jn(l){if(l.length===0)return null;var t=l[0],u=l.pop();if(u!==t){l[0]=u;l:for(var a=0,n=l.length,e=n>>>1;a<e;){var c=2*(a+1)-1,i=l[c],v=c+1,o=l[v];if(0>Ln(i,u))v<n&&0>Ln(o,i)?(l[a]=o,l[v]=u,a=v):(l[a]=i,l[c]=u,a=c);else if(v<n&&0>Ln(o,u))l[a]=o,l[v]=u,a=v;else break l}}return t}f(Jn,"pop");function Ln(l,t){var u=l.sortIndex-t.sortIndex;return u!==0?u:l.id-t.id}f(Ln,"compare");W.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(w0=performance,W.unstable_now=function(){return w0.now()}):(Yf=Date,F0=Yf.now(),W.unstable_now=function(){return Yf.now()-F0});var w0,Yf,F0,Ot=[],Zt=[],ty=1,Kl=null,zl=3,Zf=!1,Za=!1,Va=!1,Vf=!1,k0=typeof setTimeout=="function"?setTimeout:null,I0=typeof clearTimeout=="function"?clearTimeout:null,W0=typeof setImmediate<"u"?setImmediate:null;function Kn(l){for(var t=et(Zt);t!==null;){if(t.callback===null)Jn(Zt);else if(t.startTime<=l)Jn(Zt),t.sortIndex=t.expirationTime,Xf(Ot,t);else break;t=et(Zt)}}f(Kn,"advanceTimers");function xf(l){if(Va=!1,Kn(l),!Za)if(et(Ot)!==null)Za=!0,xu||(xu=!0,Vu());else{var t=et(Zt);t!==null&&jf(xf,t.startTime-l)}}f(xf,"handleTimeout");var xu=!1,xa=-1,P0=5,l1=-1;function t1(){return Vf?!0:!(W.unstable_now()-l1<P0)}f(t1,"shouldYieldToHost");function Gf(){if(Vf=!1,xu){var l=W.unstable_now();l1=l;var t=!0;try{l:{Za=!1,Va&&(Va=!1,I0(xa),xa=-1),Zf=!0;var u=zl;try{t:{for(Kn(l),Kl=et(Ot);Kl!==null&&!(Kl.expirationTime>l&&t1());){var a=Kl.callback;if(typeof a=="function"){Kl.callback=null,zl=Kl.priorityLevel;var n=a(Kl.expirationTime<=l);if(l=W.unstable_now(),typeof n=="function"){Kl.callback=n,Kn(l),t=!0;break t}Kl===et(Ot)&&Jn(Ot),Kn(l)}else Jn(Ot);Kl=et(Ot)}if(Kl!==null)t=!0;else{var e=et(Zt);e!==null&&jf(xf,e.startTime-l),t=!1}}break l}finally{Kl=null,zl=u,Zf=!1}t=void 0}}finally{t?Vu():xu=!1}}}f(Gf,"performWorkUntilDeadline");var Vu;typeof W0=="function"?Vu=f(function(){W0(Gf)},"schedulePerformWorkUntilDeadline"):typeof MessageChannel<"u"?(Qf=new MessageChannel,$0=Qf.port2,Qf.port1.onmessage=Gf,Vu=f(function(){$0.postMessage(null)},"schedulePerformWorkUntilDeadline")):Vu=f(function(){k0(Gf,0)},"schedulePerformWorkUntilDeadline");var Qf,$0;function jf(l,t){xa=k0(function(){l(W.unstable_now())},t)}f(jf,"requestHostTimeout");W.unstable_IdlePriority=5;W.unstable_ImmediatePriority=1;W.unstable_LowPriority=4;W.unstable_NormalPriority=3;W.unstable_Profiling=null;W.unstable_UserBlockingPriority=2;W.unstable_cancelCallback=function(l){l.callback=null};W.unstable_forceFrameRate=function(l){0>l||125<l?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P0=0<l?Math.floor(1e3/l):5};W.unstable_getCurrentPriorityLevel=function(){return zl};W.unstable_next=function(l){switch(zl){case 1:case 2:case 3:var t=3;break;default:t=zl}var u=zl;zl=t;try{return l()}finally{zl=u}};W.unstable_requestPaint=function(){Vf=!0};W.unstable_runWithPriority=function(l,t){switch(l){case 1:case 2:case 3:case 4:case 5:break;default:l=3}var u=zl;zl=l;try{return t()}finally{zl=u}};W.unstable_scheduleCallback=function(l,t,u){var a=W.unstable_now();switch(typeof u=="object"&&u!==null?(u=u.delay,u=typeof u=="number"&&0<u?a+u:a):u=a,l){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=u+n,l={id:ty++,callback:t,priorityLevel:l,startTime:u,expirationTime:n,sortIndex:-1},u>a?(l.sortIndex=u,Xf(Zt,l),et(Ot)===null&&l===et(Zt)&&(Va?(I0(xa),xa=-1):Va=!0,jf(xf,u-a))):(l.sortIndex=n,Xf(Ot,l),Za||Zf||(Za=!0,xu||(xu=!0,Vu()))),l};W.unstable_shouldYield=t1;W.unstable_wrapCallback=function(l){var t=zl;return function(){var u=zl;zl=t;try{return l.apply(this,arguments)}finally{zl=u}}}});var n1=jn((Sg,a1)=>{"use strict";a1.exports=u1()});var pd=jn(Df=>{"use strict";var cl=n1(),Kv=q0(),uy=Pd();function z(l){var t="https://react.dev/errors/"+l;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)t+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+l+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}f(z,"formatProdErrorMessage");function Jv(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}f(Jv,"isValidContainer");function Mn(l){for(var t=l,u=t;u&&!u.alternate;)t=u,(t.flags&4098)!==0&&(l=t.return),u=t.return;for(;t.return;)t=t.return;return t.tag===3?l:null}f(Mn,"getNearestMountedFiber");function pv(l){if(l.tag===13){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}f(pv,"getSuspenseInstanceFromFiber");function rv(l){if(l.tag===31){var t=l.memoizedState;if(t===null&&(l=l.alternate,l!==null&&(t=l.memoizedState)),t!==null)return t.dehydrated}return null}f(rv,"getActivityInstanceFromFiber");function e1(l){if(Mn(l)!==l)throw Error(z(188))}f(e1,"assertIsMounted");function ay(l){var t=l.alternate;if(!t){if(t=Mn(l),t===null)throw Error(z(188));return t!==l?null:l}for(var u=l,a=t;;){var n=u.return;if(n===null)break;var e=n.alternate;if(e===null){if(a=n.return,a!==null){u=a;continue}break}if(n.child===e.child){for(e=n.child;e;){if(e===u)return e1(n),l;if(e===a)return e1(n),t;e=e.sibling}throw Error(z(188))}if(u.return!==a.return)u=n,a=e;else{for(var c=!1,i=n.child;i;){if(i===u){c=!0,u=n,a=e;break}if(i===a){c=!0,a=n,u=e;break}i=i.sibling}if(!c){for(i=e.child;i;){if(i===u){c=!0,u=e,a=n;break}if(i===a){c=!0,a=e,u=n;break}i=i.sibling}if(!c)throw Error(z(189))}}if(u.alternate!==a)throw Error(z(190))}if(u.tag!==3)throw Error(z(188));return u.stateNode.current===u?l:t}f(ay,"findCurrentFiberUsingSlowPath");function wv(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l;for(l=l.child;l!==null;){if(t=wv(l),t!==null)return t;l=l.sibling}return null}f(wv,"findCurrentHostFiberImpl");function Cl(l,t,u,a,n,e){for(;l!==null;){if((l.tag===5||l.tag===27||l.tag===6)&&u(l,a,n,e)||(l.tag!==22||l.memoizedState===null)&&(t||l.tag!==5&&l.tag!==27)&&Cl(l.child,t,u,a,n,e))return!0;l=l.sibling}return!1}f(Cl,"traverseVisibleInstancesAndTextInstances");function Yu(l){for(l=l.return;l!==null;){if(l.tag===3||l.tag===5||l.tag===27)return l;l=l.return}return null}f(Yu,"getFragmentParentInstanceOrContainerFiber");function f1(l){var t=!1;for(l=l.return;l!==null&&(l.tag===4&&(t=!0),!(l.tag===3||l.tag===5||l.tag===27));)l=l.return;return t}f(f1,"fiberIsPortaledIntoHost");function Fv(l){var t=[null,null],u=Yu(l);return u===null||Wv(t,l,u.child,{foundSelf:!1}),t}f(Fv,"getFragmentInstanceOrTextInstanceSiblings");function Wv(l,t,u,a){for(;u!==null;){if(u===t)a.foundSelf=!0;else if(u.tag===5||u.tag===27||u.tag===6){if(a.foundSelf)return l[1]=u,!0;l[0]=u}else if((u.tag!==22||u.memoizedState===null)&&Wv(l,t,u.child,a))return!0;u=u.sibling}return!1}f(Wv,"findFragmentInstanceOrTextInstanceSiblings");function fl(l){switch(l.tag){case 5:case 27:case 6:return l.stateNode;case 3:return l.stateNode.containerInfo;default:throw Error(z(559))}}f(fl,"getInstanceFromHostFiber");var wu=null,zc=null;function ny(l,t,u){return l===u?!0:l===t?(wu=l,!0):!1}f(ny,"isFiberPrecedingCheck");function ey(l,t,u){return l===u?(zc=l,!1):l===t?(zc!==null&&(wu=l),!0):!1}f(ey,"isFiberFollowingCheck");function c1(l){if(l===null)return null;do l=l===null?null:l.return;while(l&&l.tag!==5&&l.tag!==27&&l.tag!==3);return l||null}f(c1,"getParentForFragmentAncestors");function Ec(l,t,u){for(var a=0,n=l;n;n=u(n))a++;n=0;for(var e=t;e;e=u(e))n++;for(;0<a-n;)l=u(l),a--;for(;0<n-a;)t=u(t),n--;for(;a--;){if(l===t||t!==null&&l===t.alternate)return l;l=u(l),t=u(t)}return null}f(Ec,"getLowestCommonAncestor");var J=Object.assign,fy=Symbol.for("react.element"),pn=Symbol.for("react.transitional.element"),wa=Symbol.for("react.portal"),Fu=Symbol.for("react.fragment"),$v=Symbol.for("react.strict_mode"),Oc=Symbol.for("react.profiler"),kv=Symbol.for("react.consumer"),ot=Symbol.for("react.context"),Ci=Symbol.for("react.forward_ref"),sc=Symbol.for("react.suspense"),Nc=Symbol.for("react.suspense_list"),Bi=Symbol.for("react.memo"),Lt=Symbol.for("react.lazy"),Ac=Symbol.for("react.activity"),cy=Symbol.for("react.legacy_hidden"),iy=Symbol.for("react.memo_cache_sentinel"),_c=Symbol.for("react.view_transition"),vy=Symbol.for("react.recoverable"),i1=Symbol.iterator;function ja(l){return l===null||typeof l!="object"?null:(l=i1&&l[i1]||l["@@iterator"],typeof l=="function"?l:null)}f(ja,"getIteratorFn");var my=Symbol.for("react.client.reference");function Dc(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===my?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Fu:return"Fragment";case Oc:return"Profiler";case $v:return"StrictMode";case sc:return"Suspense";case Nc:return"SuspenseList";case Ac:return"Activity";case _c:return"ViewTransition"}if(typeof l=="object")switch(l.$$typeof){case wa:return"Portal";case ot:return l.displayName||"Context";case kv:return(l._context.displayName||"Context")+".Consumer";case Ci:var t=l.render;return l=l.displayName,l||(l=t.displayName||t.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Bi:return t=l.displayName||null,t!==null?t:Dc(l.type)||"Memo";case Lt:t=l._payload,l=l._init;try{return Dc(l(t))}catch{}}return null}f(Dc,"getComponentNameFromType");var Fa=Array.isArray,U=Kv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=uy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ou={pending:!1,data:null,method:null,action:null},Uc=[],Wu=-1;function bt(l){return{current:l}}f(bt,"createCursor");function gl(l){0>Wu||(l.current=Uc[Wu],Uc[Wu]=null,Wu--)}f(gl,"pop");function F(l,t){Wu++,Uc[Wu]=l.current,l.current=t}f(F,"push");var gt=bt(null),dn=bt(null),kt=bt(null),Be=bt(null);function Re(l,t){switch(F(kt,t),F(dn,l),F(gt,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?sv(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=sv(t),l=Ed(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}gl(gt),F(gt,l)}f(Re,"pushHostContainer");function ga(){gl(gt),gl(dn),gl(kt)}f(ga,"popHostContainer");function Mc(l){var t=l.memoizedState;t!==null&&(_a._currentValue=t.memoizedState,F(Be,l)),t=gt.current;var u=Ed(t,l.type);t!==u&&(F(dn,l),F(gt,u))}f(Mc,"pushHostContext");function qe(l){dn.current===l&&(gl(gt),gl(dn)),Be.current===l&&(gl(Be),_a._currentValue=Ou)}f(qe,"popHostContext");var Lf,v1;function xt(l){if(Lf===void 0)try{throw Error()}catch(u){var t=u.stack.trim().match(/\n( *(at )?)/);Lf=t&&t[1]||"",v1=-1<u.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+Lf+l+v1}f(xt,"describeBuiltInComponentFrame");var Kf=!1;function Jf(l,t){if(!l||Kf)return"";Kf=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:f(function(){try{if(t){var T=f(function(){throw Error()},"Fake");if(Object.defineProperty(T.prototype,"props",{set:f(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(E){var y=E}Reflect.construct(l,[],T)}else{try{T.call()}catch(E){y=E}T=!1;try{var g=Object.getOwnPropertyDescriptor(l.prototype,"props");Object.defineProperty(l.prototype,"props",{configurable:!0,set:f(function(){throw Error()},"set")}),T=!0,new l}finally{T&&(g!==void 0?Object.defineProperty(l.prototype,"props",g):delete l.prototype.props)}}}else{try{throw Error()}catch(E){y=E}(T=l())&&typeof T.catch=="function"&&T.catch(function(){})}}catch(E){if(E&&y&&typeof E.stack=="string")return[E.stack,y.stack]}return[null,null]},"DetermineComponentFrameRoot")};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var e=a.DetermineComponentFrameRoot(),c=e[0],i=e[1];if(c&&i){var v=c.split(`
|
|
4
4
|
`),o=i.split(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/studio",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.363",
|
|
4
4
|
"description": "The Lunora Studio: a local admin UI for your schema, data, logs, and advisors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin-ui",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@lingui/message-utils": "^6.9.0",
|
|
61
61
|
"@lunora/advisor": "1.0.0-alpha.277",
|
|
62
62
|
"@lunora/bindings": "1.0.0-alpha.144",
|
|
63
|
-
"@lunora/client": "1.0.0-alpha.
|
|
63
|
+
"@lunora/client": "1.0.0-alpha.272",
|
|
64
64
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
65
|
-
"@lunora/react": "1.0.0-alpha.
|
|
65
|
+
"@lunora/react": "1.0.0-alpha.282",
|
|
66
66
|
"@lunora/wire": "1.0.0-alpha.6",
|
|
67
67
|
"@tanstack/react-query": "5.101.4",
|
|
68
68
|
"@tanstack/react-router": "^1.170.41",
|