@dmrlzz/davecode 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatApp-BO7QMBWD.js → ChatApp-CJBICQGA.js} +6 -6
- package/dist/{account-UGNLJPQ4.js → account-QWDPJWAA.js} +3 -3
- package/dist/{accounts-NM7IWP53.js → accounts-IQMR72FC.js} +5 -5
- package/dist/{budget-INAW6FXD.js → budget-XANOUVWO.js} +4 -4
- package/dist/{chat-U4QJQ7M6.js → chat-KDDRNC5V.js} +8 -8
- package/dist/{chunk-CWBVNS3L.js → chunk-44AFJL2X.js} +4 -4
- package/dist/{chunk-MOK5D3XJ.js → chunk-AZKACMME.js} +2 -2
- package/dist/{chunk-DZ2FDABF.js → chunk-FYPMA55O.js} +2 -2
- package/dist/{chunk-3Q2KCXLN.js → chunk-HSBJDV3O.js} +2 -2
- package/dist/{chunk-3Q2KCXLN.js.map → chunk-HSBJDV3O.js.map} +1 -1
- package/dist/{chunk-ROIUTNQV.js → chunk-JLATEHS7.js} +2 -2
- package/dist/{chunk-GZJ6JSO7.js → chunk-PGAJIGUF.js} +3 -3
- package/dist/{chunk-GHDOUII5.js → chunk-W7GPBEBZ.js} +2 -2
- package/dist/{chunk-Z6NQDJEN.js → chunk-WQ7MEWDF.js} +3 -3
- package/dist/{config-YEAPBMBX.js → config-YTUPIYZT.js} +3 -3
- package/dist/dashboard/assets/Accounts-cq8RLMoI.js +1 -0
- package/dist/dashboard/assets/{Badge-CGY6DgGx.js → Badge-Z4RBdO9j.js} +2 -2
- package/dist/dashboard/assets/Callout-w8BTYh4k.js +1 -0
- package/dist/dashboard/assets/Field-Cmpgg_1z.js +1 -0
- package/dist/dashboard/assets/Goals-Bw02to72.js +1 -0
- package/dist/dashboard/assets/Library-DK7mlpRb.js +1 -0
- package/dist/dashboard/assets/{Markdown-Xhao3sgL.js → Markdown-DCZ4Awcc.js} +2 -2
- package/dist/dashboard/assets/Panes-_KTf8pbZ.js +8 -0
- package/dist/dashboard/assets/Panes-kHJ-D0s7.css +1 -0
- package/dist/dashboard/assets/RoutesPage-QV0oPRW9.js +4 -0
- package/dist/dashboard/assets/Runner-CkHBLQl0.js +1 -0
- package/dist/dashboard/assets/Settings-BLz2gTBR.js +1 -0
- package/dist/dashboard/assets/Switch-DPYlLseH.js +1 -0
- package/dist/dashboard/assets/Tasks-BiUQSTpt.js +2 -0
- package/dist/dashboard/assets/Traffic-BVfBuC70.js +1 -0
- package/dist/dashboard/assets/Workspace-CJTgiiU5.js +1 -0
- package/dist/dashboard/assets/arrow-up-DjhzZprp.js +1 -0
- package/dist/dashboard/assets/cn-BwE4cei0.js +1 -0
- package/dist/dashboard/assets/forms-DVIUAxAc.js +1 -0
- package/dist/dashboard/assets/index-BDBa5cb0.js +104 -0
- package/dist/dashboard/assets/index-BEmBgsbP.css +2 -0
- package/dist/dashboard/assets/task-errors-Daqwi0ue.js +1 -0
- package/dist/dashboard/assets/trash-BTuDcSaQ.js +1 -0
- package/dist/dashboard/index.html +4 -4
- package/dist/{dist-RRQGUBL3.js → dist-37VQSHHA.js} +2 -2
- package/dist/{doctor-MQYK44S2.js → doctor-PYUQRRCB.js} +3 -3
- package/dist/{goal-6NUX4AIT.js → goal-SXZUDUCL.js} +3 -3
- package/dist/index.js +31 -31
- package/dist/{init-AXYIWAB3.js → init-Z2AFQEEP.js} +3 -3
- package/dist/{run-QRTLHFB3.js → run-AOS7L3RT.js} +3 -3
- package/dist/runtime.js +2 -2
- package/dist/{start-O5I5TSO2.js → start-CEPXKZUE.js} +3 -3
- package/dist/{status-LEA3RVUX.js → status-WNJ3GGKU.js} +4 -4
- package/dist/{tasks-XOTVICVZ.js → tasks-TFUTUMWB.js} +4 -4
- package/package.json +4 -4
- package/dist/dashboard/assets/Accounts-CeVyX4a3.js +0 -1
- package/dist/dashboard/assets/Callout-DauCk_cW.js +0 -1
- package/dist/dashboard/assets/Field-OXMnT9Tb.js +0 -1
- package/dist/dashboard/assets/Goals-DH-KDh8M.js +0 -1
- package/dist/dashboard/assets/Library-C15szLjZ.js +0 -1
- package/dist/dashboard/assets/Panel-Du40pM7n.js +0 -1
- package/dist/dashboard/assets/RoutesPage-Cj1OelGO.js +0 -4
- package/dist/dashboard/assets/Runner-BK1-ZF7h.js +0 -1
- package/dist/dashboard/assets/Settings-C1nzQQhe.js +0 -1
- package/dist/dashboard/assets/Switch-bwtIJ00H.js +0 -1
- package/dist/dashboard/assets/Tasks-x4s8IiPG.js +0 -2
- package/dist/dashboard/assets/Traffic-CV7TaTid.js +0 -1
- package/dist/dashboard/assets/Workspace-DAL-MBc0.js +0 -1
- package/dist/dashboard/assets/arrow-up-goM9r-I9.js +0 -1
- package/dist/dashboard/assets/forms-DtpfI65-.js +0 -1
- package/dist/dashboard/assets/index-BCi-Vuvh.js +0 -104
- package/dist/dashboard/assets/index-CcJFhc98.css +0 -2
- package/dist/dashboard/assets/task-errors-B2pgjUGN.js +0 -1
- package/dist/dashboard/assets/trash-BVojETtF.js +0 -1
- /package/dist/{ChatApp-BO7QMBWD.js.map → ChatApp-CJBICQGA.js.map} +0 -0
- /package/dist/{account-UGNLJPQ4.js.map → account-QWDPJWAA.js.map} +0 -0
- /package/dist/{accounts-NM7IWP53.js.map → accounts-IQMR72FC.js.map} +0 -0
- /package/dist/{budget-INAW6FXD.js.map → budget-XANOUVWO.js.map} +0 -0
- /package/dist/{chat-U4QJQ7M6.js.map → chat-KDDRNC5V.js.map} +0 -0
- /package/dist/{chunk-CWBVNS3L.js.map → chunk-44AFJL2X.js.map} +0 -0
- /package/dist/{chunk-MOK5D3XJ.js.map → chunk-AZKACMME.js.map} +0 -0
- /package/dist/{chunk-DZ2FDABF.js.map → chunk-FYPMA55O.js.map} +0 -0
- /package/dist/{chunk-ROIUTNQV.js.map → chunk-JLATEHS7.js.map} +0 -0
- /package/dist/{chunk-GZJ6JSO7.js.map → chunk-PGAJIGUF.js.map} +0 -0
- /package/dist/{chunk-GHDOUII5.js.map → chunk-W7GPBEBZ.js.map} +0 -0
- /package/dist/{chunk-Z6NQDJEN.js.map → chunk-WQ7MEWDF.js.map} +0 -0
- /package/dist/{config-YEAPBMBX.js.map → config-YTUPIYZT.js.map} +0 -0
- /package/dist/{dist-RRQGUBL3.js.map → dist-37VQSHHA.js.map} +0 -0
- /package/dist/{doctor-MQYK44S2.js.map → doctor-PYUQRRCB.js.map} +0 -0
- /package/dist/{goal-6NUX4AIT.js.map → goal-SXZUDUCL.js.map} +0 -0
- /package/dist/{init-AXYIWAB3.js.map → init-Z2AFQEEP.js.map} +0 -0
- /package/dist/{run-QRTLHFB3.js.map → run-AOS7L3RT.js.map} +0 -0
- /package/dist/{start-O5I5TSO2.js.map → start-CEPXKZUE.js.map} +0 -0
- /package/dist/{status-LEA3RVUX.js.map → status-WNJ3GGKU.js.map} +0 -0
- /package/dist/{tasks-XOTVICVZ.js.map → tasks-TFUTUMWB.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{$ as a,D as o,I as s,O as c,Q as l,at as u,et as d,ft as f,it as p,n as m,nt as h,ot as g,p as _,rt as v,st as y,t as b,tt as x,yt as S}from"./Badge-Z4RBdO9j.js";import{t as C}from"./arrow-up-DjhzZprp.js";import{t as w}from"./Callout-w8BTYh4k.js";import{n as T,t as E}from"./task-errors-Daqwi0ue.js";import{t as D}from"./trash-BTuDcSaQ.js";import{A as O,C as k,E as A,L as j,O as M,_ as N,f as P,h as F,i as I,k as L,m as R,n as z,r as B,s as V,u as H,w as U,z as W}from"./index-BDBa5cb0.js";import{n as G,r as K,t as q}from"./Field-Cmpgg_1z.js";var J={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};J.node;var Y=t(J),X=n(e(),1),Z=r();function Q({open:e,onClose:t,routes:n,defaultRoute:r}){return(0,Z.jsx)(P,{open:e,onClose:t,title:`Edit routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Saved to the global `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`~/.davecode/config.json`}),` and applied to the router immediately.`]}),width:`w-[min(680px,100vw)]`,children:e&&(0,Z.jsx)($,{routes:n,defaultRoute:r,onDone:t})})}function $({routes:e,defaultRoute:t,onDone:n}){let r=_(),c=o(),f=s(),m=r.data??[],[g,y]=(0,X.useState)(()=>v(e,t)),[b,S]=(0,X.useState)(!1),[C,T]=(0,X.useState)(null),O=(0,X.useMemo)(()=>u(g,m),[g,m]),A=l(g,e,t),j=(0,X.useMemo)(()=>{let e=new Map;for(let t of c.data??[]){if(t.owned_by===`davecode`)continue;let n=t.owned_by,r=`${n}/`,i=e.get(n)??[];i.push(t.id.startsWith(r)?t.id.slice(r.length):t.id),e.set(n,i)}return e},[c.data]),M=(e,t)=>y(n=>({...n,routes:n.routes.map(n=>n.key===e?t(n):n)})),N=(e,t,n)=>M(e,e=>({...e,targets:e.targets.map(e=>e.key===t?{...e,...n}:e)})),P=()=>y(e=>{let t=d(h(e.routes));return{routes:[...e.routes,t],defaultKey:e.defaultKey??t.key}}),F=e=>y(t=>{let n=t.routes.filter(t=>t.key!==e);return{routes:n,defaultKey:t.defaultKey===e?n[0]?.key??null:t.defaultKey}});return(0,Z.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),S(!0),T(null),O.valid)try{let e=await f.mutateAsync(p(g));k({tone:`ok`,title:`Routes saved`,description:`${e.routes.length} route${e.routes.length===1?``:`s`}, default davecode/${e.defaultRoute}`}),e.shadowedByProject&&k({tone:`info`,title:`This project overrides routes`,description:`The project .davecode/config.json also sets routing and wins after a restart.`}),n()}catch(e){T(E(e))}},noValidate:!0,className:`flex flex-col gap-4`,children:[g.routes.length===0&&(0,Z.jsxs)(`p`,{className:`rounded-md border border-dashed border-line-strong px-3 py-6 text-center text-[12px] text-muted`,children:[`No routes. Clients can still call `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`provider/model`}),` ids directly. Add a route to expose `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`davecode/<name>`}),`.`]}),g.routes.map(e=>{let t=O.byRoute[e.key],n=g.defaultKey===e.key,r=b;return(0,Z.jsxs)(`section`,{"aria-label":`Route ${e.name||`unnamed`}`,className:i(`flex flex-col gap-3 rounded-lg border bg-raised p-3`,n?`border-accent/50`:`border-line`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(q,{label:`Name`,error:r?t?.name:null,className:`min-w-0 flex-1`,children:({id:t,describedBy:n,invalid:r})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-muted`,children:`davecode/`}),(0,Z.jsx)(G,{id:t,value:e.name,onChange:t=>M(e.key,e=>({...e,name:t.target.value})),"aria-describedby":n,"aria-invalid":r||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})]})}),(0,Z.jsxs)(`label`,{className:`mt-6 flex shrink-0 cursor-pointer items-center gap-1.5 text-[12px] text-fg-2`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:`default-route`,checked:n,onChange:()=>y(t=>({...t,defaultKey:e.key})),className:`size-3.5 accent-accent`}),`Default`]}),(0,Z.jsx)(U,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:D,"aria-label":`Remove route ${e.name||`unnamed`}`,onClick:()=>F(e.key),className:`mt-6 text-err hover:bg-err-soft hover:text-err`})]}),(0,Z.jsx)(q,{label:`Description`,children:({id:t,describedBy:n})=>(0,Z.jsx)(G,{id:t,value:e.description,onChange:t=>M(e.key,e=>({...e,description:t.target.value})),"aria-describedby":n,placeholder:`When to use this route`})}),(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`legend`,{className:`mb-1 text-[12px] font-medium text-fg-2`,children:[`Targets`,` `,(0,Z.jsx)(`span`,{className:`font-normal text-muted`,children:`tried in order, then fail over`})]}),r&&t?.targets&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:t.targets}),(0,Z.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.targets.map((n,i)=>(0,Z.jsx)(ee,{index:i,count:e.targets.length,target:n,accounts:m,models:j.get(n.provider)??[],error:r?t?.target[n.key]:void 0,onChange:t=>N(e.key,n.key,t),onMove:t=>M(e.key,e=>({...e,targets:a(e.targets,i,t)})),onRemove:()=>M(e.key,e=>({...e,targets:e.targets.filter(e=>e.key!==n.key)}))},n.key))}),(0,Z.jsx)(U,{size:`sm`,variant:`secondary`,icon:W,className:`self-start`,onClick:()=>M(e.key,e=>({...e,targets:[...e.targets,x(e.targets.at(-1)?.provider)]})),children:`Add target`})]})]},e.key)}),b&&O.defaultRoute&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:O.defaultRoute}),(0,Z.jsx)(U,{variant:`secondary`,icon:W,className:`self-start`,onClick:P,children:`Add route`}),C&&(0,Z.jsx)(w,{tone:`err`,title:`Could not save the routes`,children:C}),(0,Z.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[!A&&(0,Z.jsx)(`span`,{className:`mr-auto text-[12px] text-muted`,children:`No changes`}),(0,Z.jsx)(U,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,Z.jsx)(U,{type:`submit`,variant:`primary`,loading:f.isPending,disabled:!A,children:`Save routes`})]})]})}function ee({index:e,count:t,target:n,accounts:r,models:i,error:a,onChange:o,onMove:s,onRemove:c}){let l=`models-${n.key}`,u=r.filter(e=>e.provider===n.provider),d=n.accountId&&!r.some(e=>e.id===n.accountId);return(0,Z.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel p-2`,children:[(0,Z.jsx)(`span`,{className:`mt-1.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:e+1}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-2`,children:[(0,Z.jsx)(q,{label:`Provider`,children:({id:e})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(N,{provider:n.provider,size:`sm`}),(0,Z.jsx)(K,{id:e,value:n.provider,onChange:e=>{let t=e.target.value;o({provider:t,...r.find(e=>e.id===n.accountId)?.provider===t?{}:{accountId:``}})},children:g.map(e=>(0,Z.jsx)(`option`,{value:e,children:y(e).label},e))})]})}),(0,Z.jsx)(q,{label:`Model`,error:a?.model,children:({id:e,describedBy:t,invalid:r})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G,{id:e,list:l,value:n.model,onChange:e=>o({model:e.target.value}),"aria-describedby":t,"aria-invalid":r||void 0,spellCheck:!1,autoCapitalize:`off`,placeholder:`claude-sonnet-5-5`,className:`font-mono`}),(0,Z.jsx)(`datalist`,{id:l,children:i.map(e=>(0,Z.jsx)(`option`,{value:e},e))})]})}),(0,Z.jsx)(q,{label:`Account`,error:a?.accountId,className:`sm:col-span-2`,children:({id:e,describedBy:t,invalid:r})=>(0,Z.jsxs)(K,{id:e,value:n.accountId,onChange:e=>o({accountId:e.target.value}),"aria-describedby":t,"aria-invalid":r||void 0,children:[(0,Z.jsx)(`option`,{value:``,children:`Balanced across matching accounts`}),d&&(0,Z.jsxs)(`option`,{value:n.accountId,children:[n.accountId,` (missing)`]}),u.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[`Pinned to `,e.label,` (`,e.id,`)`]},e.id))]})})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex shrink-0 flex-col gap-0.5`,children:[(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:C,"aria-label":`Move target ${e+1} up`,disabled:e===0,onClick:()=>s(e-1)}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:Y,"aria-label":`Move target ${e+1} down`,disabled:e===t-1,onClick:()=>s(e+1)}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:O,"aria-label":`Remove target ${e+1}`,onClick:c})]})]})}function te(e,t){return t.filter(t=>{if(e.accountId)return t.id===e.accountId;if(t.provider!==e.provider)return!1;let n=t.config.models;return!Array.isArray(n)||n.length===0||n.includes(e.model)})}function ne(){let e=c(),{params:t}=L(),n=t.get(`edit`)===`1`,r=_(),i=o(),a=S(),s=r.data??[],l=`${a.gatewayUrl||`http://127.0.0.1:4040`}/v1`,u=e.data?.defaultRoute??`auto`,d=(0,X.useMemo)(()=>{let e=i.data??[];return{total:e.length,routes:e.filter(e=>e.owned_by===`davecode`).length}},[i.data]),p=`curl ${l}/chat/completions \\
|
|
2
|
+
-H "Content-Type: application/json" \\
|
|
3
|
+
-H "Authorization: Bearer $DAVECODE_TOKEN" \\
|
|
4
|
+
-d '{"model": "davecode/${u}", "messages": [{"role": "user", "content": "Hello"}]}'`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(z,{title:`Routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Exposed to clients as`,` `,(0,Z.jsx)(`code`,{className:`font-mono text-fg-2`,children:`davecode/<route>`}),`. Targets are tried in order; the router fails over down the list before the first byte.`]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[i.data&&(0,Z.jsxs)(b,{mono:!0,children:[d.total,` models · `,d.routes,` routes on /v1/models`]}),(0,Z.jsx)(U,{variant:`primary`,icon:T,disabled:!e.data,onClick:()=>M(`edit`,`1`),children:`Edit routes`})]})}),e.isError&&(0,Z.jsx)(w,{tone:`err`,title:`Could not load routes`,children:f(e.error)}),e.isPending?(0,Z.jsx)(B,{children:(0,Z.jsx)(H,{rows:6})}):(e.data?.routes.length??0)===0?(0,Z.jsx)(B,{children:(0,Z.jsx)(V,{icon:j,title:`No routes configured`,description:`Until you add one, clients can call provider/model ids directly. Routes are saved to ~/.davecode/config.json.`,action:(0,Z.jsx)(U,{variant:`primary`,icon:W,onClick:()=>M(`edit`,`1`),children:`Add a route`})})}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:e.data?.routes.map(e=>(0,Z.jsxs)(B,{"aria-labelledby":`route-${e.name}`,children:[(0,Z.jsx)(I,{id:`route-${e.name}`,title:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-mono`,children:[`davecode/`,e.name,(0,Z.jsx)(R,{value:`davecode/${e.name}`,label:`Copy davecode/${e.name}`})]}),actions:e.name===u?(0,Z.jsx)(b,{tone:`accent`,children:`default`}):void 0}),e.description&&(0,Z.jsx)(`p`,{className:`px-3.5 pt-3 text-[12px] text-muted`,children:e.description}),(0,Z.jsx)(`ol`,{className:`flex flex-col p-3.5`,children:e.targets.map((t,n)=>{let r=te(t,s),i=r.filter(e=>e.enabled&&e.status!==`disabled`);return(0,Z.jsxs)(`li`,{className:`relative flex gap-3 pb-3 last:pb-0`,children:[n<e.targets.length-1&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-7 bottom-0 left-[11px] w-px bg-line-strong`}),(0,Z.jsx)(`span`,{className:`z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:n+1}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-md border border-line bg-raised px-2.5 py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(N,{provider:t.provider,size:`sm`}),(0,Z.jsxs)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:[t.provider,`/`,t.model]}),i.length===0&&(0,Z.jsx)(b,{tone:`err`,className:`ml-auto`,children:`no usable account`})]}),(0,Z.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-muted`,children:[(0,Z.jsx)(`span`,{children:t.accountId?`pinned to`:`balanced · ${y(t.provider).label}`}),r.length===0&&(0,Z.jsx)(`span`,{className:`text-faint`,children:`no matching account`}),r.map(e=>(0,Z.jsxs)(A,{to:`/accounts?account=${encodeURIComponent(e.id)}`,className:`inline-flex items-center gap-1.5 text-fg-2 hover:text-fg`,children:[(0,Z.jsx)(m,{tone:F[e.status]}),e.label,(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`(`,e.status,`)`]})]},e.id))]})]})]},`${t.provider}/${t.model}/${t.accountId??``}`)})})]},e.name))}),(0,Z.jsx)(Q,{open:n&&!!e.data,onClose:()=>M(`edit`,null),routes:e.data?.routes??[],defaultRoute:u}),(0,Z.jsxs)(B,{"aria-labelledby":`usage-title`,children:[(0,Z.jsx)(I,{id:`usage-title`,title:`Use a route`,meta:`any OpenAI-compatible client`,actions:(0,Z.jsx)(R,{value:p,label:`Copy snippet`})}),(0,Z.jsx)(`pre`,{className:`overflow-x-auto p-3.5 font-mono text-[12px] leading-5 text-fg-2`,children:p})]})]})}export{ne as RoutesPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{A as a,B as o,N as s,V as c,ft as l,j as u,o as d,pt as f,r as p,t as m}from"./Badge-Z4RBdO9j.js";import{t as h}from"./Callout-w8BTYh4k.js";import{B as g,C as _,E as v,F as y,G as b,I as x,J as S,V as C,d as w,i as T,l as E,n as D,p as O,q as k,r as A,w as j,x as M,y as ee}from"./index-BDBa5cb0.js";var N={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};N.node;var P=t(N),F={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};F.node;var I=t(F),L={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};L.node;var R=t(L),z={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};z.node;var B=t(z),V=n(e(),1),H=r(),U=[`debug`,`info`,`warn`,`error`],W={debug:`text-muted`,info:`text-info`,warn:`text-warn`,error:`text-err`};function G(e){return e.level===`error`?`text-err`:e.level===`warn`?`text-warn`:e.message.startsWith(`$ `)?`text-fg`:e.message.startsWith(`✓`)?`text-ok`:e.message.startsWith(`→`)?`text-info`:e.level===`debug`?`text-muted`:`text-fg-2`}function K({lines:e,onClear:t,className:n}){let[r,a]=(0,V.useState)(()=>new Set([`info`,`warn`,`error`])),[o,s]=(0,V.useState)(`runner`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(!0),[f,m]=(0,V.useState)(!0),h=(0,V.useRef)(null),g=(0,V.useMemo)(()=>{let t={debug:0,info:0,warn:0,error:0};for(let n of e)(o===`all`||n.source===`runner`)&&(t[n.level]+=1);return t},[e,o]),_=c.trim().toLowerCase(),v=(0,V.useMemo)(()=>e.filter(e=>r.has(e.level)&&(o===`all`||e.source===`runner`)&&(!_||e.message.toLowerCase().includes(_)||(e.taskId??e.scope??``).includes(_))),[e,r,o,_]);(0,V.useLayoutEffect)(()=>{let e=h.current;e&&f&&(e.scrollTop=e.scrollHeight)},[v,f]),(0,V.useEffect)(()=>{let e=h.current;if(!e)return;let t=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;m(t)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]);let y=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,H.jsxs)(`section`,{"aria-label":`Runner log`,className:i(`term flex min-h-0 flex-col overflow-hidden rounded-lg border border-line bg-term`,n),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line px-3 py-2`,children:[(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log levels`}),U.map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":r.has(e),onClick:()=>y(e),className:i(`inline-flex h-6 items-center gap-1.5 rounded border px-2 font-mono text-2xs uppercase transition-colors duration-150`,r.has(e)?`border-line-strong bg-hover text-fg`:`border-transparent text-faint hover:text-muted`),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:i(`size-1.5 rounded-full bg-current`,r.has(e)&&W[e])}),e,(0,H.jsx)(`span`,{className:`tnum text-muted`,children:g[e]})]},e))]}),(0,H.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px bg-line-strong`}),(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log source`}),[`runner`,`all`].map(e=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":o===e,onClick:()=>s(e),className:i(`h-6 rounded px-2 text-[12px] transition-colors duration-150`,o===e?`bg-hover text-fg`:`text-muted hover:text-fg-2`),children:e===`runner`?`Runner`:`All logs`},e))]}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(x,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,H.jsx)(`input`,{type:`search`,"aria-label":`Filter log lines`,placeholder:`Filter`,value:c,onChange:e=>l(e.target.value),className:`h-6 w-32 rounded border border-line-strong bg-transparent pr-2 pl-6 font-mono text-[11px] text-fg placeholder:text-faint focus-visible:border-accent focus-visible:outline-none`,"data-filter-input":!0})]}),(0,H.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(e=>!e),"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:i(`inline-flex size-6 items-center justify-center rounded`,u?`bg-hover text-fg`:`text-muted hover:text-fg`),children:(0,H.jsx)(B,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})}),(0,H.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Clear console`,title:`Clear console`,className:`inline-flex size-6 items-center justify-center rounded text-muted hover:bg-hover hover:text-fg`,children:(0,H.jsx)(I,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})})]})]}),(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:h,role:`log`,"aria-live":`off`,"aria-label":`Log lines`,tabIndex:0,className:`absolute inset-0 overflow-auto py-2 font-mono text-[12px] leading-[1.6]`,children:v.length===0?(0,H.jsx)(`p`,{className:`px-3 text-muted`,children:e.length===0?`Waiting for runner output…`:`No lines match the filters.`}):v.map(e=>(0,H.jsxs)(`div`,{className:i(`flex gap-3 px-3 hover:bg-hover/60`,u?`whitespace-pre-wrap break-words`:`whitespace-pre`,e.level===`error`&&`bg-err/[0.06]`),children:[(0,H.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:p(e.ts,!0)}),(0,H.jsx)(`span`,{className:i(`w-10 shrink-0 uppercase select-none`,W[e.level]),children:e.level}),o===`all`&&(0,H.jsx)(`span`,{className:`w-16 shrink-0 truncate text-muted`,children:e.source===`runner`?`runner`:e.scope}),(0,H.jsx)(`span`,{className:i(`min-w-0`,G(e)),children:e.message})]},e.key))}),!f&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let e=h.current;e&&(e.scrollTop=e.scrollHeight),m(!0)},className:`absolute right-4 bottom-3 inline-flex animate-pop-in items-center gap-1.5 rounded-md border border-line-strong bg-raised px-2.5 py-1 text-[12px] text-fg shadow-overlay`,children:[(0,H.jsx)(P,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),`Jump to latest`]})]}),(0,H.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:f?``:`Autoscroll paused.`})]})}var q=[`idle`,`selecting`,`preparing`,`implementing`,`validating`,`repairing`,`merging`],J={idle:`Waiting for work`,selecting:`Picking the next unblocked task`,preparing:`Creating the task branch and loading the brain`,implementing:`Writing code through the gateway`,validating:`Running lint, typecheck and tests`,repairing:`Feeding failures back for another attempt`,merging:`Merging the task branch`,paused:`Paused; resumes at the same step`,stopped:`Stopped`,error:`Stopped on an error`},Y={idle:`neutral`,selecting:`info`,preparing:`info`,implementing:`info`,validating:`info`,repairing:`warn`,merging:`ok`,paused:`warn`,stopped:`neutral`,error:`err`},X=3;function Z(){let e=a(),t=s(),n=c(),{live:r}=o(),p=u(),x=M(1e3),[N,P]=(0,V.useState)(!1),F=f(e.error)&&e.error.status===501,I=F?void 0:e.data,L=I?.state,z=t.data?.graph.tasks.find(e=>e.id===I?.taskId),B=(0,V.useMemo)(()=>{if(!F){if(L&&q.includes(L))return L;for(let e=n.events.length-1;e>=0;e--){let t=n.events[e];if(t?.type===`runner.status`&&q.includes(t.status.state))return t.status.state}}},[F,L,n.events]),U=async e=>{try{let t=await p.mutateAsync(e);_({tone:`info`,title:`Runner ${t.state}`,description:J[t.state]})}catch(t){_({tone:`err`,title:`Could not ${e} the runner`,description:f(t)&&t.code===`runner_unavailable`?`This gateway was started without the autonomous runner.`:l(t)})}},W=L!==void 0&&![`idle`,`paused`,`stopped`,`error`].includes(L),G=!F&&(L===`idle`||L===`paused`||L===`stopped`||L===`error`),Z=I?.startedAt?(x-Date.parse(I.startedAt))/1e3:void 0,Q=I?.repairCycle??0,te=t.data?.graph.tasks.filter(e=>e.status===`SUCCESS`).length??0,$=t.data?.graph.tasks.length??0;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(D,{title:`Runner`,description:`The autonomous engineer: one task at a time, on its own branch, merged only when checks pass.`,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(j,{variant:`primary`,icon:g,disabled:!G||p.isPending,loading:p.isPending&&p.variables===`start`,onClick:()=>U(`start`),children:L===`paused`?`Resume`:`Start`}),(0,H.jsx)(j,{icon:C,disabled:F||!W||p.isPending,loading:p.isPending&&p.variables===`pause`,onClick:()=>U(`pause`),children:`Pause`}),(0,H.jsx)(j,{variant:`danger`,icon:y,disabled:F||L===`stopped`||L===`idle`||L===void 0||p.isPending,onClick:()=>P(!0),children:`Stop`})]})}),F&&(0,H.jsxs)(h,{tone:`warn`,title:`Runner unavailable`,children:[(0,H.jsxs)(`p`,{children:[`This gateway answered `,(0,H.jsx)(`code`,{className:`font-mono text-fg`,children:`501 runner_unavailable`}),`: it is running without the autonomous engine. Routing and the dashboard keep working; start the runner from a project directory to drive the task graph:`]}),(0,H.jsx)(O,{command:`davecode run`,className:`mt-2 max-w-sm`})]}),e.isError&&!F&&(0,H.jsx)(h,{tone:`err`,title:`Could not read the runner status`,children:l(e.error)}),(0,H.jsxs)(A,{"aria-labelledby":`machine-title`,children:[(0,H.jsx)(T,{id:`machine-title`,title:`State machine`,meta:L?J[L]:void 0,actions:L&&(0,H.jsx)(m,{tone:Y[L],dot:!0,pulse:W,children:L})}),(0,H.jsxs)(`div`,{className:`p-4`,children:[e.isPending?(0,H.jsx)(E,{className:`h-16 w-full`}):(0,H.jsx)(`ol`,{className:`flex flex-wrap items-center gap-y-3`,"aria-label":`Runner pipeline`,children:q.map((e,t)=>{let n=e===B,r=n&&W,a=B?q.indexOf(B):-1,o=a>0&&t>0&&t<a&&(e!==`repairing`||Q!==0);return(0,H.jsxs)(`li`,{className:`flex items-center`,"aria-current":n?`step`:void 0,children:[t>0&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:i(`mx-1.5 h-px w-4 sm:w-6`,o||n?`bg-fg-2/50`:`bg-line-strong`)}),(0,H.jsxs)(`span`,{className:i(`inline-flex h-7 items-center gap-1.5 rounded-full border px-3 font-mono text-[12px] transition-colors duration-200`,n?L===`paused`||L===`stopped`||e===`repairing`?`border-warn/50 bg-warn-soft text-warn`:`border-accent/60 bg-accent-soft text-accent-text shadow-[0_0_0_3px_var(--dc-accent-soft)]`:o?`border-line-strong text-fg-2`:`border-line text-faint`),children:[o&&(0,H.jsx)(k,{"aria-hidden":!0,className:`size-3`,strokeWidth:2.25}),e===`repairing`&&!o&&(0,H.jsx)(R,{"aria-hidden":!0,className:`size-3`,strokeWidth:2}),r&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse-dot rounded-full bg-current`}),e,n&&(0,H.jsxs)(`span`,{className:`sr-only`,children:[` (current`,L===e?``:`, ${L}`,`)`]})]})]},e)})}),(0,H.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[(0,H.jsx)(R,{"aria-hidden":!0,className:`mr-1 inline size-3 align-[-2px]`,strokeWidth:2}),`Failed validation loops `,(0,H.jsx)(`span`,{className:`font-mono`,children:`repairing → implementing`}),` up to `,X,` times; then the task is marked FAILED and the runner moves on.`]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,H.jsxs)(A,{"aria-labelledby":`current-title`,className:`xl:order-2 xl:self-start`,children:[(0,H.jsx)(T,{id:`current-title`,title:`Current task`,meta:$?`${te}/${$} tasks done`:void 0}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[e.isPending?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{className:`h-4 w-40`}),(0,H.jsx)(E,{className:`h-4 w-56`})]}):z?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(v,{to:`/tasks?task=${encodeURIComponent(z.id)}`,className:`font-mono text-2xs text-muted hover:text-fg`,children:z.id}),(0,H.jsx)(`p`,{className:`text-[13px] leading-5 font-medium text-fg`,children:z.title})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(ee,{status:z.status}),z.attempts!==void 0&&(0,H.jsxs)(m,{mono:!0,children:[`attempt `,z.attempts]})]}),(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,H.jsx)(b,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),z.branch??`davecode/task-${z.id}`]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Repair cycle`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:Array.from({length:X},(e,t)=>(0,H.jsx)(`span`,{className:i(`h-1.5 w-5 rounded-full`,t<Q?`bg-warn`:`bg-track`)},t))}),(0,H.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[Q,`/`,X]})]})]}),Z!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Running for`}),(0,H.jsx)(`span`,{className:`tnum font-mono text-fg`,children:d(Z)})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[12px] text-muted`,children:[(0,H.jsx)(S,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.5}),F?`No runner attached to this gateway.`:`No task in progress.`]}),I?.lastError&&(0,H.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:I.lastError})]})]}),(0,H.jsx)(K,{lines:n.logs,onClear:()=>r.clearLogs(),className:`h-[480px] xl:order-1`})]}),(0,H.jsx)(w,{open:N,onClose:()=>P(!1),title:`Stop the runner?`,description:`The current step is abandoned. Work done so far stays on the task branch.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(j,{variant:`ghost`,onClick:()=>P(!1),children:`Keep running`}),(0,H.jsx)(j,{variant:`danger`,icon:y,onClick:()=>{P(!1),U(`stop`)},children:`Stop runner`})]}),children:z&&(0,H.jsx)(`p`,{className:`font-mono text-[12px] text-muted`,children:z.id})})]})}export{Z as Runner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r}from"./cn-BwE4cei0.js";import{B as i,E as a,dt as o,ft as s,gt as c,o as l,t as u,vt as d,yt as f}from"./Badge-Z4RBdO9j.js";import{i as p,n as m}from"./forms-DVIUAxAc.js";import{t as h}from"./Callout-w8BTYh4k.js";import{C as g,H as _,P as v,S as y,U as b,Y as x,i as S,n as C,r as w,t as T,w as E}from"./index-BDBa5cb0.js";import{n as D,t as O}from"./Field-Cmpgg_1z.js";var k={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};k.node;var A=t(k),j={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};j.node;var M=t(j),N={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};N.node;var P=t(N),F=n(e(),1),I=r(),L=`https://github.com/DMRLZZ/DaveCode`;function R(){let e=f(),t=a(),{connection:n}=i(),[r,k]=(0,F.useState)(e.gatewayUrl),[j,N]=(0,F.useState)(e.token),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1),[H,U]=(0,F.useState)(null),W=()=>{let e=r.trim();return e&&!p(e)?`Enter an http(s) origin such as http://127.0.0.1:4040, or leave empty.`:null},G=e=>{e.preventDefault();let t=W();z(t),!t&&(d({gatewayUrl:r.trim().replace(/\/+$/,``),token:j.trim()}),g({tone:`ok`,title:`Connection settings saved`,description:`Stored in this browser only.`}))},K=async()=>{let e=W();if(z(e),!e){V(!0),U(null);try{let e=await o({baseUrl:r.trim(),token:j.trim()}).health();U({ok:!0,text:`Connected: DaveCode ${e.version}, ${e.status}, up ${l(e.uptimeSec)}.`})}catch(e){U({ok:!1,text:s(e)})}finally{V(!1)}}},q=c();return(0,I.jsxs)(`div`,{className:`flex max-w-3xl flex-col gap-4`,children:[(0,I.jsx)(C,{title:`Settings`,description:`Preferences are stored in this browser's localStorage.`}),(0,I.jsxs)(w,{"aria-labelledby":`conn-title`,children:[(0,I.jsx)(S,{id:`conn-title`,title:`Gateway connection`}),(0,I.jsxs)(`form`,{onSubmit:G,noValidate:!0,className:`flex flex-col gap-4 p-4`,children:[(0,I.jsx)(O,{label:`Gateway URL`,error:R,hint:`Leave empty when the dashboard is served by the gateway or the Vite dev proxy (same origin).`,children:({id:e,describedBy:t,invalid:n})=>(0,I.jsx)(D,{id:e,type:`url`,value:r,placeholder:`same origin`,onChange:e=>k(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`font-mono`})}),(0,I.jsx)(O,{label:`Bearer token`,hint:`Needed when server.authToken is set. Sent as Authorization: Bearer, and as ?token= for the event stream.`,children:({id:e,describedBy:t})=>(0,I.jsx)(m,{id:e,value:j,onChange:N,placeholder:`not set`,describedBy:t})}),H&&(0,I.jsx)(h,{tone:H.ok?`info`:`err`,title:H.ok?`Gateway reachable`:`Connection failed`,children:H.text}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(E,{type:`submit`,variant:`primary`,children:`Save`}),(0,I.jsx)(E,{icon:P,onClick:K,loading:B,children:`Test connection`}),n.unauthorized&&(0,I.jsx)(u,{tone:`err`,children:`gateway returned 401`})]})]})]}),(0,I.jsxs)(w,{"aria-labelledby":`data-title`,children:[(0,I.jsx)(S,{id:`data-title`,title:`Data source`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,I.jsx)(T,{label:`Data source`,value:e.dataMode,onChange:e=>d({dataMode:e}),options:[{value:`auto`,label:`Auto`},{value:`live`,label:`Live only`},{value:`mock`,label:`Mock data`}]}),(0,I.jsxs)(`p`,{className:`text-[12px] leading-5 text-muted`,children:[(0,I.jsx)(`strong`,{className:`font-medium text-fg-2`,children:`Auto`}),` uses the gateway and falls back to simulated data when it is unreachable, re-checking every 15 s.`,` `,(0,I.jsx)(`strong`,{className:`font-medium text-fg-2`,children:`Mock data`}),` always simulates a busy gateway, handy for demos and screenshots.`]}),q&&(0,I.jsxs)(h,{tone:`info`,children:[`Mock mode is currently forced by `,(0,I.jsx)(`code`,{className:`font-mono`,children:`?mock=1`}),` or`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`VITE_DAVECODE_MOCK=1`}),`; this setting applies once that is removed.`]})]})]}),(0,I.jsxs)(w,{"aria-labelledby":`look-title`,children:[(0,I.jsx)(S,{id:`look-title`,title:`Appearance`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,I.jsx)(T,{label:`Theme`,value:e.theme,onChange:e=>d({theme:e}),options:[{value:`dark`,label:`Dark`,icon:_},{value:`light`,label:`Light`,icon:v},{value:`system`,label:`System`,icon:M}]}),(0,I.jsx)(E,{variant:`ghost`,icon:b,onClick:y.openHelp,children:`Keyboard shortcuts`})]})]}),(0,I.jsxs)(w,{"aria-labelledby":`about-title`,children:[(0,I.jsx)(S,{id:`about-title`,title:`About`}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 text-[13px]`,children:[(0,I.jsxs)(`dl`,{className:`grid grid-cols-[120px_1fr] gap-y-1.5`,children:[(0,I.jsx)(`dt`,{className:`text-muted`,children:`Gateway`}),(0,I.jsx)(`dd`,{className:`font-mono text-fg-2`,children:t.data?`v${t.data.version} · ${t.data.status}`:n.mode===`probing`?`checking…`:`unreachable`}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Data`}),(0,I.jsx)(`dd`,{className:`text-fg-2`,children:n.mode===`mock`?`Simulated (mock mode)`:`Live gateway`}),(0,I.jsx)(`dt`,{className:`text-muted`,children:`Experimental`}),(0,I.jsxs)(`dd`,{className:`flex flex-wrap gap-1.5`,children:[(0,I.jsxs)(u,{tone:t.data?.experimental.geminiWeb?`warn`:`neutral`,mono:!0,children:[`geminiWeb `,t.data?.experimental.geminiWeb?`on`:`off`]}),(0,I.jsxs)(u,{tone:t.data?.experimental.multiAccountRotation?`warn`:`neutral`,mono:!0,children:[`multiAccountRotation `,t.data?.experimental.multiAccountRotation?`on`:`off`]})]})]}),(0,I.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:[[`README`,`${L}#readme`],[`Architecture`,`${L}/blob/main/docs/ARCHITECTURE.md`],[`HTTP API`,`${L}/blob/main/docs/API.md`]].map(([e,t])=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-line px-2.5 text-[12px] text-fg-2 transition-colors duration-150 hover:border-line-strong hover:text-fg`,children:[(0,I.jsx)(x,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),e,(0,I.jsx)(A,{"aria-hidden":!0,className:`size-3 text-muted`,strokeWidth:1.75}),(0,I.jsx)(`span`,{className:`sr-only`,children:`(opens in a new tab)`})]})},e))})]})]})]})}export{R as Settings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./cn-BwE4cei0.js";var r={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};r.node;var i=e(r),a=t();function o({checked:e,onChange:t,label:r,disabled:i,className:o}){return(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":r,disabled:i,onClick:n=>{n.stopPropagation(),t(!e)},className:n(`relative inline-flex h-[18px] w-8 shrink-0 items-center rounded-full border transition-colors duration-150 ease-snappy`,e?`border-accent bg-accent`:`border-line-strong bg-track`,`disabled:cursor-not-allowed disabled:opacity-45`,o),children:(0,a.jsx)(`span`,{"aria-hidden":!0,className:n(`inline-block size-3 rounded-full shadow-sm transition-transform duration-150 ease-snappy`,e?`translate-x-[15px] bg-accent-fg`:`translate-x-[2px] bg-fg-2`)})})}export{i as n,o as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{G as a,H as o,J as s,K as c,L as l,N as u,S as d,U as f,W as p,X as m,Y as h,Z as g,b as _,d as v,ft as y,k as b,m as x,q as S,t as C}from"./Badge-Z4RBdO9j.js";import{n as w,t as T}from"./Markdown-DCZ4Awcc.js";import{t as E}from"./Callout-w8BTYh4k.js";import{n as D,t as O}from"./task-errors-Daqwi0ue.js";import{t as k}from"./trash-BTuDcSaQ.js";import{A as ee,B as te,C as A,G as j,I as ne,K as re,O as M,b as N,d as ie,f as ae,i as oe,k as se,l as ce,m as le,n as ue,r as P,s as de,t as F,u as fe,v as I,w as L,y as R,z}from"./index-BDBa5cb0.js";import{i as B,n as V,t as H}from"./Field-Cmpgg_1z.js";var U={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};U.node;var pe=t(U),W={name:`kanban`,size:24,node:[[`path`,{d:`M5 3v14`,key:`9nsxs2`}],[`path`,{d:`M12 3v8`,key:`1h2ygw`}],[`path`,{d:`M19 3v18`,key:`1sk56x`}]]};W.node;var me=t(W),G={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};G.node;var he=t(G),K={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};K.node;var ge=t(K),q=n(e(),1),_e={nodeWidth:220,nodeHeight:60,gapX:64,gapY:16,padding:16,sweeps:4,direction:`LR`};function J(e,t={}){let n={..._e,...t},r=new Map(e.map(e=>[e.id,e])),i=[],a=[],o=new Map;for(let t of e){let e=[];for(let n of t.dependsOn)r.has(n)?e.push(n):i.push({task:t.id,dependsOn:n});o.set(t.id,e)}let s=new Map,c=new Set,l=e=>{let t=s.get(e);if(t!==void 0)return t;c.add(e);let n=0,r=[];for(let t of o.get(e)??[])c.has(t)?a.push({from:t,to:e}):(r.push(t),n=Math.max(n,l(t)+1));return o.set(e,r),c.delete(e),s.set(e,n),n};for(let t of e)l(t.id);let u=e.length?Math.max(...s.values())+1:0,d=Array.from({length:u},()=>[]),f=[...e].sort((e,t)=>(t.priority??0)-(e.priority??0)||e.id.localeCompare(t.id));for(let e of f)d[s.get(e.id)??0]?.push(e.id);let p=new Map;for(let[e,t]of o)for(let n of t)p.set(n,[...p.get(n)??[],e]);let m=new Map,h=()=>{for(let e of d)e.forEach((e,t)=>{m.set(e,t)})};h();let g=(e,t)=>{let n=(t??[]).map(e=>m.get(e)).filter(e=>e!==void 0);return n.length?n.reduce((e,t)=>e+t,0)/n.length:m.get(e)??0};for(let e=0;e<n.sweeps;e++){for(let e=1;e<d.length;e++){let t=d[e];t&&(t.sort((e,t)=>g(e,o.get(e))-g(t,o.get(t))),h())}for(let e=d.length-2;e>=0;e--){let t=d[e];t&&(t.sort((e,t)=>g(e,p.get(e))-g(t,p.get(t))),h())}}let _=n.direction===`TB`,v=Math.max(0,...d.map(e=>e.length)),y=_?n.nodeWidth:n.nodeHeight,b=_?n.gapX:n.gapY,x=_?n.nodeHeight:n.nodeWidth,S=_?n.gapY:n.gapX,C=v*y+Math.max(0,v-1)*b,w=u*x+Math.max(0,u-1)*S,T=n.padding*2+(_?C:w),E=n.padding*2+(_?w:C),D=[],O=new Map;d.forEach((e,t)=>{let r=e.length*y+Math.max(0,e.length-1)*b,i=n.padding+(C-r)/2;e.forEach((e,r)=>{let a=n.padding+t*(x+S),o=i+r*(y+b),s=_?o:a,c=_?a:o;O.set(e,{x:s,y:c}),D.push({id:e,layer:t,order:r,x:s,y:c})})});let k=[];for(let t of e){let e=O.get(t.id);if(e)for(let r of o.get(t.id)??[]){let i=O.get(r);if(!i)continue;let a;if(_){let t=i.x+n.nodeWidth/2,r=i.y+n.nodeHeight,o=e.x+n.nodeWidth/2,s=e.y,c=Math.max(20,(s-r)/2);a=`M${t},${r} C${t},${r+c} ${o},${s-c} ${o},${s}`}else{let t=i.x+n.nodeWidth,r=i.y+n.nodeHeight/2,o=e.x,s=e.y+n.nodeHeight/2,c=Math.max(24,(o-t)/2);a=`M${t},${r} C${t+c},${r} ${o-c},${s} ${o},${s}`}k.push({from:r,to:t.id,path:a})}}return{nodes:D,edges:k,width:T,height:E,layers:u,missing:i,cycleEdges:a}}function ve(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a)return a;let o=t.get(e);if(!o)return`waiting`;let s={SUCCESS:`done`,IN_PROGRESS:`running`,FAILED:`failed`,PENDING:null}[o.status];if(!s){if(r.has(e))return`waiting`;r.add(e);let n=o.dependsOn.filter(e=>t.has(e)).map(i);r.delete(e),s=n.some(e=>e===`failed`||e===`blocked`)?`blocked`:n.every(e=>e===`done`)?`ready`:`waiting`}return n.set(e,s),s};for(let t of e)i(t.id);return n}function ye(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Map;for(let t of e)for(let e of t.dependsOn)r.set(e,[...r.get(e)??[],t.id]);let i=(e,t)=>{let n=new Set,r=[...t(e)];for(;r.length;){let e=r.pop();e===void 0||n.has(e)||(n.add(e),r.push(...t(e)))}return n};return{up:i(t,e=>n.get(e)?.dependsOn??[]),down:i(t,e=>r.get(e)??[])}}var Y=r();function be({task:e,tasks:t,readiness:n,onSelect:r,onClose:i,onEdit:a}){let o=l(),s=d(),c=b(),[u,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(null),g=(t,n)=>o.mutate({id:e.id,patch:{status:t}},{onSuccess:()=>A({tone:`ok`,title:n,description:e.id}),onError:e=>A({tone:`err`,title:`Could not ${n.toLowerCase()}`,description:O(e)})}),_=()=>c.mutate(e.id,{onSuccess:()=>A({tone:`info`,title:`Runner started`,description:e.id}),onError:e=>A({tone:`err`,title:`Could not start the runner`,description:O(e)})}),y=()=>s.mutate(e.id,{onSuccess:()=>{A({tone:`ok`,title:`Task deleted`,description:e.id}),f(!1),i()},onError:e=>m(O(e))}),x=new Map(t.map(e=>[e.id,e])),S=t.filter(t=>t.dependsOn.includes(e.id)),w=e.status===`SUCCESS`;return(0,Y.jsxs)(`article`,{"aria-labelledby":`task-title`,className:`flex flex-col gap-4 p-4`,children:[(0,Y.jsxs)(`header`,{className:`flex items-start gap-2`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`p`,{className:`flex items-center gap-1 font-mono text-2xs text-muted`,children:[e.id,(0,Y.jsx)(le,{value:e.id,label:`Copy task id`,className:`size-5`})]}),(0,Y.jsx)(`h3`,{id:`task-title`,className:`mt-0.5 text-[15px] leading-5 font-semibold tracking-tight text-fg`,children:e.title})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`Close task details`,className:`-mr-1 inline-flex size-7 items-center justify-center rounded-md text-muted hover:bg-hover hover:text-fg`,children:(0,Y.jsx)(ee,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.75})})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,Y.jsx)(R,{status:e.status}),n===`ready`&&(0,Y.jsx)(C,{tone:`ok`,children:`ready to run`}),n===`blocked`&&(0,Y.jsx)(C,{tone:`err`,children:`blocked by a failed dependency`}),e.priority!==void 0&&(0,Y.jsxs)(C,{mono:!0,children:[`priority `,e.priority]}),e.attempts!==void 0&&(0,Y.jsxs)(C,{mono:!0,children:[`attempt `,e.attempts]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[n===`ready`&&(0,Y.jsx)(L,{size:`sm`,variant:`primary`,icon:te,loading:c.isPending,onClick:_,children:`Run now`}),h(e.status).map(e=>(0,Y.jsx)(L,{size:`sm`,variant:e.variant,disabled:o.isPending,onClick:()=>g(e.to,e.label),children:e.label},e.to)),(0,Y.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,Y.jsx)(L,{size:`sm`,variant:`ghost`,icon:D,onClick:a,children:`Edit`}),(0,Y.jsx)(L,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:k,"aria-label":`Delete task ${e.id}`,onClick:()=>{m(null),f(!0)},className:`text-err hover:bg-err-soft hover:text-err`})]})]}),e.branch&&(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,Y.jsx)(j,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),e.branch]}),e.description&&(0,Y.jsx)(`p`,{className:`text-[13px] leading-5 text-fg-2`,children:e.description}),e.acceptance&&e.acceptance.length>0&&(0,Y.jsxs)(`section`,{"aria-labelledby":`acc-title`,children:[(0,Y.jsx)(`h4`,{id:`acc-title`,className:`eyebrow mb-1.5`,children:`Acceptance criteria`}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.acceptance.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-start gap-2 text-[13px] leading-5 text-fg-2`,children:[w?(0,Y.jsx)(re,{"aria-label":`met`,className:`mt-0.5 size-3.5 shrink-0 text-ok`,strokeWidth:1.75}):(0,Y.jsx)(pe,{"aria-label":`not verified yet`,className:`mt-0.5 size-3.5 shrink-0 text-faint`,strokeWidth:1.75}),e]},e))})]}),e.notes&&(0,Y.jsxs)(`section`,{"aria-labelledby":`notes-title`,children:[(0,Y.jsx)(`h4`,{id:`notes-title`,className:`eyebrow mb-1.5`,children:`Notes`}),(0,Y.jsx)(`p`,{className:`rounded-md border border-line bg-raised p-2.5 text-[12px] leading-5 text-fg-2`,children:e.notes})]}),(0,Y.jsxs)(`section`,{"aria-labelledby":`deps-title`,className:`grid grid-cols-2 gap-3`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{id:`deps-title`,className:`eyebrow mb-1.5`,children:`Depends on`}),(0,Y.jsx)(X,{ids:e.dependsOn,byId:x,onSelect:r})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:`eyebrow mb-1.5`,children:`Unblocks`}),(0,Y.jsx)(X,{ids:S.map(e=>e.id),byId:x,onSelect:r})]})]}),e.updatedAt&&(0,Y.jsxs)(`p`,{className:`text-2xs text-muted`,children:[`Updated `,v(Date.parse(e.updatedAt))]}),(0,Y.jsxs)(ie,{open:u,onClose:()=>f(!1),title:`Delete ${e.id}?`,description:S.length>0?`Other tasks depend on this one, so the gateway will refuse until those dependencies are removed.`:`The task is removed from TASK_GRAPH.json. Its branch and any merged work stay in git.`,footer:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(L,{variant:`ghost`,onClick:()=>f(!1),children:`Keep task`}),(0,Y.jsx)(L,{variant:`danger`,icon:k,loading:s.isPending,onClick:y,children:`Delete task`})]}),children:[(0,Y.jsx)(`p`,{className:`truncate text-[13px] text-fg-2`,children:e.title}),S.length>0&&(0,Y.jsxs)(`p`,{className:`mt-2 font-mono text-[12px] text-muted`,children:[`Needed by `,S.map(e=>e.id).join(`, `)]}),p&&(0,Y.jsx)(E,{tone:`err`,title:`Could not delete the task`,className:`mt-3`,children:p})]})]})}function X({ids:e,byId:t,onSelect:n}){return e.length===0?(0,Y.jsx)(`p`,{className:`text-[12px] text-faint`,children:`None`}):(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>{let r=t.get(e);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`flex w-full min-w-0 items-center gap-1.5 rounded px-1 py-0.5 text-left font-mono text-[12px] text-fg-2 hover:bg-hover hover:text-fg`,children:[r?(0,Y.jsx)(N,{status:r.status}):(0,Y.jsx)(`span`,{className:`text-err`,children:`?`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e})]})},e)})})}var Z=204,Q=56,xe={SUCCESS:`stroke-ok/50`,IN_PROGRESS:`stroke-info/70`,FAILED:`stroke-err/70`,PENDING:`stroke-line-strong`},Se={SUCCESS:`border-line-strong`,IN_PROGRESS:`border-info/50 shadow-[0_0_0_3px_var(--dc-info-soft)]`,FAILED:`border-err/50`,PENDING:`border-line-strong border-dashed`};function Ce({tasks:e,ready:t,selectedId:n,onSelect:r}){let a=(0,q.useMemo)(()=>J(e,{nodeWidth:Z,nodeHeight:Q,gapX:14,gapY:40,padding:20,direction:`TB`}),[e]),[o,s]=(0,q.useState)(null),c=o??n,l=(0,q.useMemo)(()=>c?ye(e,c):null,[e,c]),u=(0,q.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),d=e=>!l||e===c||l.up.has(e)||l.down.has(e),f=(e,t)=>!l||(e===c||l.up.has(e))&&(t===c||l.up.has(t))||(t===c||l.down.has(t))&&(e===c||l.down.has(e));return(0,Y.jsx)(`div`,{className:`relative overflow-x-auto`,children:(0,Y.jsxs)(`div`,{className:`relative mx-auto`,style:{width:a.width,height:a.height},children:[(0,Y.jsxs)(`svg`,{width:a.width,height:a.height,className:`pointer-events-none absolute inset-0`,"aria-hidden":!0,children:[(0,Y.jsx)(`defs`,{children:(0,Y.jsx)(`marker`,{id:`dag-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,Y.jsx)(`path`,{d:`M0,0 L8,4 L0,8 z`,className:`fill-faint`})})}),a.edges.map(e=>{let t=u.get(e.from),n=f(e.from,e.to);return(0,Y.jsx)(`path`,{d:e.path,fill:`none`,strokeWidth:n&&l?1.75:1.25,markerEnd:`url(#dag-arrow)`,className:i(`transition-opacity duration-200`,t?xe[t.status]:`stroke-line-strong`,!n&&`opacity-20`)},`${e.from}->${e.to}`)})]}),a.nodes.map(e=>{let a=u.get(e.id);if(!a)return null;let o=t.get(a.id),c=a.id===n;return(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(a.id),onPointerEnter:()=>s(a.id),onPointerLeave:()=>s(null),onFocus:()=>s(a.id),onBlur:()=>s(null),"aria-pressed":c,"aria-label":`${a.id}: ${a.title}. ${a.status.toLowerCase().replace(`_`,` `)}${o===`ready`?`, ready to run`:o===`blocked`?`, blocked by a failed dependency`:``}`,className:i(`absolute flex flex-col justify-center gap-1 rounded-md border bg-panel px-2.5 text-left transition-[opacity,border-color,box-shadow,transform] duration-200 ease-snappy`,`hover:-translate-y-px hover:border-fg-2/40`,Se[a.status],c&&`border-accent shadow-[0_0_0_3px_var(--dc-accent-soft)]`,!d(a.id)&&`opacity-35`),style:{left:e.x,top:e.y,width:Z,height:Q},children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(N,{status:a.status}),(0,Y.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted`,children:a.id}),o===`ready`&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-ok/30 px-1 text-[10px] leading-4 text-ok`,children:`ready`}),o===`blocked`&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-err/30 px-1 text-[10px] leading-4 text-err`,children:`blocked`}),a.status===`IN_PROGRESS`&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 rounded border border-info/30 px-1 text-[10px] leading-4 text-info`,children:`running`})]}),(0,Y.jsx)(`span`,{className:`truncate text-[12px] leading-4 text-fg`,children:a.title})]},e.id)})]})})}function $({open:e,task:t,tasks:n,onClose:r}){let i=t!==void 0;return(0,Y.jsx)(ae,{open:e,onClose:r,title:i?`Edit task`:`New task`,description:i?(0,Y.jsx)(`span`,{className:`font-mono`,children:t.id}):`The task starts as pending and is picked up in dependency order.`,width:`w-[min(560px,100vw)]`,children:e&&(0,Y.jsx)(we,{task:t,tasks:n,onDone:r},t?.id??`new`)})}function we({task:e,tasks:t,onDone:n}){let r=_(),i=l(),[u,d]=(0,q.useState)(()=>e?p(e):a()),[f,h]=(0,q.useState)(!1),[v,y]=(0,q.useState)({}),[b,x]=(0,q.useState)(null),C=r.isPending||i.isPending,w=(e,t)=>d(n=>({...n,[e]:t})),T=n=>d(r=>({...r,title:n,...!e&&!f?{id:m(s(n),t)}:{}}));return(0,Y.jsxs)(`form`,{onSubmit:async a=>{a.preventDefault(),x(null);let s=g(u,t,e?.id);if(y(s),!(Object.keys(s).length>0))try{if(e){let t=S(e,u);c(t)||await i.mutateAsync({id:e.id,patch:t}),A({tone:`ok`,title:`Task updated`,description:e.id})}else{let e=await r.mutateAsync(o(u));A({tone:`ok`,title:`Task created`,description:e.id})}n()}catch(e){x(O(e))}},noValidate:!0,className:`flex flex-col gap-5`,children:[(0,Y.jsx)(H,{label:`Title`,required:!0,error:v.title,children:({id:e,describedBy:t,invalid:n})=>(0,Y.jsx)(V,{id:e,autoFocus:!0,value:u.title,onChange:e=>T(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,placeholder:`Add the /health endpoint`})}),!e&&(0,Y.jsx)(H,{label:`Id`,required:!0,error:v.id,hint:`Lowercase kebab-case. Used for the branch name and in dependencies; it cannot change later.`,children:({id:e,describedBy:t,invalid:n})=>(0,Y.jsx)(V,{id:e,value:u.id,onChange:e=>{h(!0),w(`id`,e.target.value)},"aria-describedby":t,"aria-invalid":n||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})}),(0,Y.jsx)(H,{label:`Description`,children:({id:e,describedBy:t})=>(0,Y.jsx)(B,{id:e,value:u.description,onChange:e=>w(`description`,e.target.value),"aria-describedby":t,placeholder:`What needs to be done and why.`})}),(0,Y.jsx)(H,{label:`Acceptance criteria`,hint:`One per line. The validator and judge check the result against these.`,children:({id:e,describedBy:t})=>(0,Y.jsx)(B,{id:e,value:u.acceptance,onChange:e=>w(`acceptance`,e.target.value),"aria-describedby":t,placeholder:`GET /health returns 200
|
|
2
|
+
The route has a test`})}),(0,Y.jsx)(H,{label:`Priority`,error:v.priority,hint:`Higher runs first among unblocked tasks. Empty means 0.`,className:`max-w-40`,children:({id:e,describedBy:t,invalid:n})=>(0,Y.jsx)(V,{id:e,inputMode:`decimal`,value:u.priority,onChange:e=>w(`priority`,e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})}),(0,Y.jsx)(Te,{tasks:t,selfId:e?.id,value:u.dependsOn,onChange:e=>w(`dependsOn`,e),error:v.dependsOn}),e&&(0,Y.jsx)(H,{label:`Notes`,hint:`Written by the runner after each attempt; edit to leave a hint.`,children:({id:e,describedBy:t})=>(0,Y.jsx)(B,{id:e,value:u.notes,onChange:e=>w(`notes`,e.target.value),"aria-describedby":t})}),b&&(0,Y.jsx)(E,{tone:`err`,title:e?`Could not save the task`:`Could not create the task`,children:b}),(0,Y.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[(0,Y.jsx)(L,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,Y.jsx)(L,{type:`submit`,variant:`primary`,loading:C,children:e?`Save changes`:`Create task`})]})]})}function Te({tasks:e,selfId:t,value:n,onChange:r,error:a}){let[o,s]=(0,q.useState)(``),c=(0,q.useMemo)(()=>f(e,t),[e,t]),l=new Set(e.map(e=>e.id)),u=e.length-c.length-+!!t,d=o.trim().toLowerCase(),p=c.filter(e=>!d||e.id.toLowerCase().includes(d)||e.title.toLowerCase().includes(d)),m=n.filter(e=>!l.has(e)),h=(e,t)=>r(t?[...n,e]:n.filter(t=>t!==e));return(0,Y.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,"aria-describedby":a?`deps-error`:void 0,children:[(0,Y.jsxs)(`legend`,{className:`mb-1.5 flex w-full items-baseline gap-2 text-[12px] font-medium text-fg-2`,children:[`Depends on`,(0,Y.jsx)(`span`,{className:`tnum font-normal text-muted`,children:n.length===0?`none`:`${n.length} selected`})]}),(0,Y.jsxs)(`div`,{className:`rounded-md border border-line-strong bg-bg`,children:[(0,Y.jsxs)(`div`,{className:`relative border-b border-line`,children:[(0,Y.jsx)(ne,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,Y.jsx)(`input`,{type:`search`,"aria-label":`Filter tasks`,placeholder:`Filter tasks`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-full bg-transparent pr-2.5 pl-8 text-[13px] text-fg placeholder:text-faint focus-visible:outline-none`})]}),(0,Y.jsxs)(`ul`,{className:`max-h-48 overflow-y-auto p-1`,children:[m.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[12px] hover:bg-hover`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>h(e,!1),className:`size-3.5 accent-accent`}),(0,Y.jsx)(`span`,{className:`font-mono text-err`,children:e}),(0,Y.jsx)(`span`,{className:`text-muted`,children:`unknown task, uncheck to remove`})]})},e)),p.length===0&&m.length===0&&(0,Y.jsx)(`li`,{className:`px-2 py-3 text-center text-[12px] text-faint`,children:e.length===0?`No other tasks yet.`:`No tasks match.`}),p.map(e=>{let t=n.includes(e.id);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`label`,{className:i(`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[12px] hover:bg-hover`,t&&`bg-hover/60`),children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:t,onChange:t=>h(e.id,t.target.checked),className:`size-3.5 accent-accent`}),(0,Y.jsx)(N,{status:e.status}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-fg`,children:e.title}),(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-2xs text-muted`,children:e.id})]})},e.id)})]})]}),a?(0,Y.jsx)(`p`,{id:`deps-error`,role:`alert`,className:`text-[12px] leading-4 text-err`,children:a}):(0,Y.jsxs)(`p`,{className:`text-[12px] leading-4 text-muted`,children:[`This task waits until every selected task is done.`,t&&u>0&&` ${u} dependent task${u===1?``:`s`} hidden: choosing them would create a cycle.`]})]})}var Ee=[`IN_PROGRESS`,`PENDING`,`FAILED`,`SUCCESS`];function De(){let e=u(),t=x(),{params:n}=se(),r=[`graph`,`board`,`list`].includes(n.get(`view`)??``)?n.get(`view`):`graph`,i=n.get(`task`),a=n.get(`panel`),o=n.get(`new`)===`1`,s=n.get(`edit`),c=e.data?.graph.tasks??[],l=(0,q.useMemo)(()=>ve(c),[c]),d=c.find(e=>e.id===i),f=c.find(e=>e.id===s),p=a??(d?`task`:`state`),m=(0,q.useMemo)(()=>J(c),[c]),h=(0,q.useMemo)(()=>{let e={PENDING:0,IN_PROGRESS:0,SUCCESS:0,FAILED:0};for(let t of c)e[t.status]+=1;return e},[c]),g=c.length?h.SUCCESS/c.length:0,_=e=>{M(`panel`,null),M(`task`,e)},v=e.data?.project;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(ue,{title:`Tasks`,description:v?(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-fg-2`,children:v.name}),` `,(0,Y.jsxs)(`span`,{className:`font-mono text-2xs text-faint`,children:[v.root,`/.davecode/TASK_GRAPH.json`]})]}):`The project task graph the autonomous runner works through.`,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(L,{variant:`primary`,icon:z,onClick:()=>M(`new`,`1`),children:`New task`}),(0,Y.jsx)(F,{label:`Task view`,value:r,onChange:e=>M(`view`,e===`graph`?null:e),options:[{value:`graph`,label:`Graph`,icon:ge},{value:`board`,label:`Board`,icon:me},{value:`list`,label:`List`,icon:he}]})]})}),e.isError&&(0,Y.jsx)(E,{tone:`err`,title:`Could not load the task graph`,children:y(e.error)}),c.length>0&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-[12px]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Y.jsx)(`div`,{className:`h-1.5 w-40 overflow-hidden rounded-full bg-track`,role:`progressbar`,"aria-label":`Tasks done`,"aria-valuemin":0,"aria-valuemax":c.length,"aria-valuenow":h.SUCCESS,children:(0,Y.jsx)(`div`,{className:`h-full rounded-full bg-ok transition-[width] duration-500 ease-snappy`,style:{width:`${g*100}%`}})}),(0,Y.jsxs)(`span`,{className:`tnum text-fg-2`,children:[h.SUCCESS,` of `,c.length,` done`]})]}),Ee.map(e=>(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted`,children:[(0,Y.jsx)(N,{status:e}),I[e],` `,(0,Y.jsx)(`span`,{className:`tnum text-fg-2`,children:h[e]})]},e)),m.missing.length>0&&(0,Y.jsxs)(C,{tone:`warn`,children:[m.missing.length,` unknown dependencies`]})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_380px]`,children:[(0,Y.jsx)(P,{className:`min-h-[420px]`,children:e.isPending?(0,Y.jsx)(`div`,{className:`p-4`,children:(0,Y.jsx)(ce,{className:`h-[380px] w-full`})}):c.length===0?(0,Y.jsx)(de,{icon:j,title:`No task graph yet`,description:`Describe the work as a DAG of tasks and the runner will pick them up in dependency order. You can also edit .davecode/TASK_GRAPH.json by hand.`,command:`davecode run`,action:(0,Y.jsx)(L,{variant:`primary`,icon:z,onClick:()=>M(`new`,`1`),children:`New task`}),className:`py-20`}):r===`graph`?(0,Y.jsx)(Ce,{tasks:c,ready:l,selectedId:i,onSelect:_}):r===`board`?(0,Y.jsx)(ke,{tasks:c,ready:l,selectedId:i,onSelect:_}):(0,Y.jsx)(Ae,{tasks:c,ready:l,selectedId:i,onSelect:_})}),(0,Y.jsxs)(P,{className:`xl:sticky xl:top-16 xl:max-h-[calc(100dvh-5rem)] xl:self-start`,children:[(0,Y.jsx)(oe,{title:(0,Y.jsx)(F,{size:`sm`,label:`Side panel`,value:p,onChange:e=>M(`panel`,e),options:[...d?[{value:`task`,label:`Task`,icon:j}]:[],{value:`state`,label:`STATE.md`,icon:w},{value:`architecture`,label:`ARCHITECTURE.md`,icon:w}]})}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:p===`task`&&d?(0,Y.jsx)(be,{task:d,tasks:c,readiness:l.get(d.id),onSelect:_,onEdit:()=>M(`edit`,d.id),onClose:()=>{M(`task`,null),M(`panel`,null)}}):t.isPending?(0,Y.jsx)(fe,{rows:6}):t.isError?(0,Y.jsx)(`p`,{className:`p-4 text-[12px] text-err`,children:y(t.error)}):(0,Y.jsx)(T,{className:`p-4`,source:(p===`architecture`?t.data?.architecture:t.data?.state)||`_This file is empty._`})})]})]}),(0,Y.jsx)($,{open:o,tasks:c,onClose:()=>M(`new`,null)}),(0,Y.jsx)($,{open:!!f,task:f,tasks:c,onClose:()=>M(`edit`,null)})]})}function Oe({r:e}){return e===`ready`?(0,Y.jsx)(C,{tone:`ok`,children:`ready`}):e===`blocked`?(0,Y.jsx)(C,{tone:`err`,children:`blocked`}):null}function ke({tasks:e,ready:t,selectedId:n,onSelect:r}){return(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-px overflow-x-auto bg-line sm:grid-cols-2 lg:grid-cols-4`,children:Ee.map(a=>{let o=e.filter(e=>e.status===a).sort((e,t)=>(t.priority??0)-(e.priority??0));return(0,Y.jsxs)(`section`,{"aria-label":I[a],className:`flex min-w-0 flex-col bg-panel`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-2 border-b border-line px-3 py-2 text-[12px] font-medium text-fg-2`,children:[(0,Y.jsx)(N,{status:a}),I[a],(0,Y.jsx)(`span`,{className:`tnum ml-auto text-muted`,children:o.length})]}),(0,Y.jsxs)(`ul`,{className:`flex flex-col gap-2 p-2`,children:[o.length===0&&(0,Y.jsx)(`li`,{className:`px-1 py-3 text-center text-[12px] text-faint`,children:`Empty`}),o.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),"aria-pressed":e.id===n,className:i(`flex w-full flex-col gap-1.5 rounded-md border bg-raised p-2.5 text-left transition-colors duration-150 hover:border-fg-2/30`,e.id===n?`border-accent`:`border-line`),children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono text-2xs text-muted`,children:e.id}),(0,Y.jsx)(`span`,{className:`ml-auto`,children:(0,Y.jsx)(Oe,{r:t.get(e.id)})})]}),(0,Y.jsx)(`span`,{className:`text-[12px] leading-4 text-fg`,children:e.title}),e.dependsOn.length>0&&(0,Y.jsxs)(`span`,{className:`truncate font-mono text-[10px] text-faint`,children:[`after `,e.dependsOn.join(`, `)]})]})},e.id))]})]},a)})})}function Ae({tasks:e,ready:t,selectedId:n,onSelect:r}){let a=(0,q.useMemo)(()=>new Map(J(e).nodes.map(e=>[e.id,e.layer])),[e]),o=[...e].sort((e,t)=>(a.get(e.id)??0)-(a.get(t.id)??0)||(t.priority??0)-(e.priority??0));return(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`w-full min-w-[640px] text-[12px]`,children:[(0,Y.jsx)(`caption`,{className:`sr-only`,children:`Tasks in dependency order`}),(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-line text-left text-muted`,children:[(0,Y.jsx)(`th`,{scope:`col`,className:`px-3.5 py-2 font-medium`,children:`Task`}),(0,Y.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Status`}),(0,Y.jsx)(`th`,{scope:`col`,className:`px-2 py-2 text-right font-medium`,children:`Priority`}),(0,Y.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Depends on`})]})}),(0,Y.jsx)(`tbody`,{children:o.map(e=>(0,Y.jsxs)(`tr`,{className:i(`border-b border-line last:border-b-0`,e.id===n&&`bg-hover/60`),children:[(0,Y.jsx)(`td`,{className:`max-w-0 px-3.5 py-2`,children:(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`block w-full min-w-0 text-left hover:underline`,children:[(0,Y.jsx)(`span`,{className:`block truncate text-[13px] text-fg`,children:e.title}),(0,Y.jsx)(`span`,{className:`block truncate font-mono text-2xs text-muted`,children:e.id})]})}),(0,Y.jsx)(`td`,{className:`px-2 py-2`,children:(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(R,{status:e.status}),(0,Y.jsx)(Oe,{r:t.get(e.id)})]})}),(0,Y.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:e.priority??`—`}),(0,Y.jsx)(`td`,{className:`max-w-0 truncate px-2 py-2 font-mono text-2xs text-muted`,children:e.dependsOn.join(`, `)||`—`})]},e.id))})]})})}export{De as Tasks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{B as a,V as o,c as s,ct as c,f as l,i as u,l as d,lt as f,p,r as m,t as h,ut as g}from"./Badge-Z4RBdO9j.js";import{A as _,B as v,I as y,O as b,V as x,Z as S,_ as C,f as w,k as T,m as E,n as D,q as O,r as k,s as A,t as j,u as M,w as N}from"./index-BDBa5cb0.js";import{n as P,r as F}from"./Field-Cmpgg_1z.js";var I={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};I.node;var L=t(I),R=n(e(),1),z=r();function B({chain:e,accounts:t,className:n}){let r=e.attempts.map(e=>{let n=t.get(e.accountId)?.label??e.accountId;return e.outcome===`failed`?`${n} failed (${g(e)})`:`${n} ${e.outcome}`}).join(`, then `);return(0,z.jsxs)(`div`,{className:i(`flex min-w-0 items-center gap-1`,n),title:r,children:[(0,z.jsx)(`span`,{className:`sr-only`,children:r}),e.attempts.map((n,r)=>(0,z.jsxs)(R.Fragment,{children:[r>0&&(0,z.jsx)(V,{attempt:e.attempts[r-1]}),(0,z.jsx)(H,{attempt:n,account:t.get(n.accountId),compact:e.attempts.length>2&&r<e.attempts.length-1})]},r))]})}function V({attempt:e}){return(0,z.jsxs)(`span`,{"aria-hidden":!0,className:`flex shrink-0 items-center gap-1 text-faint`,children:[(0,z.jsx)(`span`,{className:`h-px w-2 bg-line-strong`}),e?.outcome===`failed`&&(0,z.jsx)(`span`,{className:`rounded border border-err/30 bg-err-soft px-1 font-mono text-[10px] leading-4 text-err`,children:g(e)}),(0,z.jsx)(`span`,{className:`h-px w-2 bg-line-strong`}),(0,z.jsx)(`span`,{className:`-ml-1.5 text-[10px] leading-none`,children:`▸`})]})}function H({attempt:e,account:t,compact:n}){let r=t?.label??e.accountId;return(0,z.jsxs)(`span`,{"aria-hidden":!0,className:i(`inline-flex h-6 max-w-[180px] min-w-0 items-center gap-1.5 rounded border pr-1.5 pl-0.5 text-[12px]`,e.outcome===`failed`?`border-line text-muted`:`border-line-strong bg-raised text-fg`),children:[(0,z.jsx)(C,{provider:e.provider,size:`sm`,className:`size-[18px] border-0 bg-transparent`}),!n&&(0,z.jsx)(`span`,{className:i(`truncate`,e.outcome===`failed`&&`line-through decoration-faint`),children:r}),e.outcome===`success`&&(0,z.jsx)(O,{className:`size-3 shrink-0 text-ok`,strokeWidth:2.25}),e.outcome===`failed`&&(0,z.jsx)(_,{className:`size-3 shrink-0 text-err`,strokeWidth:2.25}),e.outcome===`pending`&&(0,z.jsx)(L,{className:`size-3 shrink-0 animate-spin text-info [animation-duration:1.6s]`,strokeWidth:2})]})}function U({chain:e}){return e.outcome===`pending`?(0,z.jsx)(h,{tone:`info`,dot:!0,pulse:!0,children:`in flight`}):e.outcome===`failed`?(0,z.jsx)(h,{tone:`err`,dot:!0,children:`failed`}):e.failovers>0?(0,z.jsxs)(h,{tone:`warn`,dot:!0,children:[`ok · `,e.failovers,` failover`,e.failovers>1?`s`:``]}):(0,z.jsx)(h,{tone:`ok`,dot:!0,children:`ok`})}function W({chain:e,accounts:t,onClose:n}){return(0,z.jsx)(w,{open:!!e,onClose:n,title:`Request`,description:e&&(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono`,children:[e.requestId,(0,z.jsx)(E,{value:e.requestId,label:`Copy request id`})]}),width:`w-[min(520px,100vw)]`,children:e&&(0,z.jsx)(G,{chain:e,accounts:t})})}function G({chain:e,accounts:t}){let n=f(e),r=c(e),a=[[`Outcome`,(0,z.jsx)(U,{chain:e},`o`)],[`Model`,(0,z.jsx)(`span`,{className:`font-mono`,children:e.model||`—`},`m`)],[`Started`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:m(e.startedTs,!0)},`s`)],[`End-to-end`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:r===void 0?`—`:d(r)},`l`)],[`Tokens`,(0,z.jsxs)(`span`,{className:`tnum font-mono`,children:[s(n.prompt),` in · `,s(n.completion),` out`]},`t`)],[`Failovers`,(0,z.jsx)(`span`,{className:`tnum font-mono`,children:e.failovers},`f`)]];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,z.jsx)(`dl`,{className:`grid grid-cols-[110px_1fr] gap-x-4 gap-y-2 text-[13px]`,children:a.map(([e,t])=>(0,z.jsxs)(`div`,{className:`contents`,children:[(0,z.jsx)(`dt`,{className:`text-muted`,children:e}),(0,z.jsx)(`dd`,{className:`min-w-0 text-fg`,children:t})]},e))}),(0,z.jsxs)(`section`,{"aria-labelledby":`attempts-title`,children:[(0,z.jsx)(`h3`,{id:`attempts-title`,className:`mb-2 text-[12px] font-medium text-fg-2`,children:`Attempts`}),(0,z.jsx)(`ol`,{className:`relative flex flex-col gap-0`,children:e.attempts.map((n,r)=>{let a=t.get(n.accountId),o=n.startedTs-e.startedTs,c=r===e.attempts.length-1;return(0,z.jsxs)(`li`,{className:`relative flex gap-3 pb-4 last:pb-0`,children:[!c&&(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-7 bottom-0 left-[11px] w-px bg-line-strong`}),(0,z.jsx)(`span`,{className:i(`z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border text-[10px] font-semibold`,n.outcome===`success`?`border-ok/40 bg-ok-soft text-ok`:n.outcome===`failed`?`border-err/40 bg-err-soft text-err`:`border-info/40 bg-info-soft text-info`),children:r+1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-md border border-line bg-raised p-2.5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(C,{provider:n.provider,size:`sm`}),(0,z.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg`,children:a?.label??n.accountId}),(0,z.jsx)(`span`,{className:`ml-auto`,children:n.outcome===`success`?(0,z.jsx)(h,{tone:`ok`,children:`served`}):n.outcome===`failed`?(0,z.jsxs)(h,{tone:`err`,mono:!0,children:[g(n),` `,n.errorKind]}):(0,z.jsx)(h,{tone:`info`,dot:!0,pulse:!0,children:`in flight`})})]}),(0,z.jsxs)(`p`,{className:`tnum mt-1.5 font-mono text-2xs text-muted`,children:[n.accountId,` · +`,d(o),n.latencyMs!==void 0&&` · took ${d(n.latencyMs)}`,n.outcome===`success`&&` · ${s(n.promptTokens??0)} → ${s(n.completionTokens??0)} tok`]}),n.errorMessage&&(0,z.jsx)(`p`,{className:`mt-1.5 text-[12px] text-fg-2`,children:n.errorMessage})]})]},r)})})]}),(0,z.jsxs)(`details`,{className:`rounded-md border border-line`,children:[(0,z.jsx)(`summary`,{className:`px-3 py-2 text-[12px] font-medium text-fg-2 select-none hover:text-fg`,children:`Raw chain`}),(0,z.jsx)(`pre`,{className:`max-h-80 overflow-auto border-t border-line p-3 font-mono text-2xs leading-5 text-fg-2`,children:JSON.stringify(e,null,2)})]})]})}function K(e,t){switch(t){case`ok`:return e.outcome===`success`&&e.failovers===0;case`failover`:return e.failovers>0;case`failed`:return e.outcome===`failed`;case`pending`:return e.outcome===`pending`;default:return!0}}var q=250;function J(){let e=o(),{connection:t}=a(),n=p(),{params:r}=T(),[s,g]=(0,R.useState)(``),[_,C]=(0,R.useState)(`all`),[w,E]=(0,R.useState)(``),[O,I]=(0,R.useState)(null),L=(0,R.useMemo)(()=>new Map((n.data??[]).map(e=>[e.id,e])),[n.data]),V=O??e.chains,H=O?Math.max(0,e.chains.length-O.length):0,G=(0,R.useMemo)(()=>{let e={all:0,ok:0,failover:0,failed:0,pending:0};for(let t of V)e.all+=1,K(t,`ok`)&&(e.ok+=1),K(t,`failover`)&&(e.failover+=1),K(t,`failed`)&&(e.failed+=1),K(t,`pending`)&&(e.pending+=1);return e},[V]),J=s.trim().toLowerCase(),Y=V.filter(e=>K(e,_)&&(!w||e.attempts.some(e=>e.accountId===w))&&(!J||e.requestId.toLowerCase().includes(J)||e.model.toLowerCase().includes(J)||e.attempts.some(e=>e.accountId.toLowerCase().includes(J)||(L.get(e.accountId)?.label.toLowerCase().includes(J)??!1)))).slice(0,q),X=r.get(`req`),Z=X?e.chains.find(e=>e.requestId===X):void 0,Q=e.chains.length===0&&t.mode!==`live`;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsx)(D,{title:`Traffic`,description:`Every request through /v1, with failover hops shown inline.`,actions:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[O?(0,z.jsxs)(h,{tone:`warn`,children:[`paused`,H>0&&` · ${H} new`]}):(0,z.jsx)(h,{tone:`ok`,dot:!0,pulse:!0,children:`streaming`}),(0,z.jsx)(N,{icon:O?v:x,onClick:()=>I(O?null:e.chains),"aria-pressed":!!O,children:O?`Resume`:`Pause`})]})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,z.jsx)(y,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,z.jsx)(P,{type:`search`,"aria-label":`Filter requests`,placeholder:`Model, request id or account`,value:s,onChange:e=>g(e.target.value),className:`pl-8`,"data-filter-input":!0})]}),(0,z.jsx)(j,{label:`Outcome`,value:_,onChange:C,options:[{value:`all`,label:`All`,count:G.all},{value:`ok`,label:`OK`,count:G.ok},{value:`failover`,label:`Failover`,count:G.failover},{value:`failed`,label:`Failed`,count:G.failed},{value:`pending`,label:`In flight`,count:G.pending}]}),(0,z.jsxs)(F,{"aria-label":`Filter by account`,value:w,onChange:e=>E(e.target.value),className:`w-auto min-w-44`,children:[(0,z.jsx)(`option`,{value:``,children:`All accounts`}),(n.data??[]).map(e=>(0,z.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,z.jsx)(k,{children:Q?(0,z.jsx)(M,{rows:8}):Y.length===0?e.chains.length===0?(0,z.jsx)(A,{icon:S,title:`No requests yet`,description:`Point any OpenAI-compatible client at the gateway and use a davecode/<route> model.`,command:`curl http://127.0.0.1:4040/v1/chat/completions -H 'content-type: application/json' -d '{"model":"davecode/auto","messages":[{"role":"user","content":"hi"}]}'`}):(0,z.jsx)(A,{icon:y,title:`No matching requests`,description:`Try a different filter.`}):(0,z.jsx)(`div`,{className:`overflow-x-auto`,children:(0,z.jsxs)(`table`,{className:`w-full min-w-[920px] text-[12px]`,children:[(0,z.jsx)(`caption`,{className:`sr-only`,children:`Recent requests, newest first`}),(0,z.jsx)(`thead`,{children:(0,z.jsxs)(`tr`,{className:`border-b border-line text-left text-muted`,children:[(0,z.jsx)(`th`,{scope:`col`,className:`w-24 px-3.5 py-2 font-medium`,children:`Time`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-24 px-2 py-2 font-medium`,children:`Request`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-40 px-2 py-2 font-medium`,children:`Model`}),(0,z.jsx)(`th`,{scope:`col`,className:`px-2 py-2 font-medium`,children:`Accounts`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-20 px-2 py-2 text-right font-medium`,children:`Latency`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-28 px-2 py-2 text-right font-medium`,children:`Tokens in → out`}),(0,z.jsx)(`th`,{scope:`col`,className:`w-36 px-3.5 py-2 text-right font-medium`,children:`Status`})]})}),(0,z.jsx)(`tbody`,{children:Y.map(e=>{let t=f(e),n=c(e);return(0,z.jsxs)(`tr`,{onClick:()=>b(`req`,e.requestId),className:i(`animate-row-in cursor-pointer border-b border-line transition-colors duration-150 last:border-b-0 hover:bg-hover/60`,X===e.requestId&&`bg-hover/60`),children:[(0,z.jsx)(`td`,{className:`tnum px-3.5 py-2 font-mono text-muted`,children:m(e.startedTs)}),(0,z.jsx)(`td`,{className:`px-2 py-2`,children:(0,z.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),b(`req`,e.requestId)},className:`font-mono text-fg-2 hover:text-fg hover:underline focus-visible:underline`,"aria-label":`Open request ${e.requestId}`,children:l(e.requestId)})}),(0,z.jsx)(`td`,{className:`max-w-0 truncate px-2 py-2 font-mono text-fg`,children:e.model||`—`}),(0,z.jsx)(`td`,{className:`max-w-0 px-2 py-1.5`,children:(0,z.jsx)(B,{chain:e,accounts:L})}),(0,z.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:n===void 0?`…`:d(n)}),(0,z.jsx)(`td`,{className:`tnum px-2 py-2 text-right font-mono text-fg-2`,children:t.prompt||t.completion?(0,z.jsxs)(z.Fragment,{children:[u(t.prompt),` `,(0,z.jsx)(`span`,{className:`text-faint`,children:`→`}),` `,u(t.completion)]}):(0,z.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,z.jsx)(`td`,{className:`px-3.5 py-2 text-right`,children:(0,z.jsx)(U,{chain:e})})]},e.requestId)})})]})})}),Y.length===q&&(0,z.jsxs)(`p`,{className:`text-center text-[12px] text-muted`,children:[`Showing the latest `,q,` requests.`]}),(0,z.jsx)(W,{chain:Z,accounts:L,onClose:()=>b(`req`,null)})]})}export{J as Traffic};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t,r as n}from"./cn-BwE4cei0.js";import{B as r,C as i,M as a,N as o,T as s,ft as c,g as l,p as u,pt as d}from"./Badge-Z4RBdO9j.js";import{t as f}from"./arrow-up-DjhzZprp.js";import{t as p}from"./Markdown-DCZ4Awcc.js";import{t as m}from"./Callout-w8BTYh4k.js";import{B as h,D as g,E as _,F as v,k as y,q as b,w as x}from"./index-BDBa5cb0.js";import{GoalDetail as S,isActiveGoal as C,t as w}from"./Goals-Bw02to72.js";var T=t(e(),1),E=n(),D={planning:`Putting a plan together`,running:`Working on it`,reviewing:`Checking the result`,planned:`Your plan is ready`,succeeded:`Done`,failed:`Something needs attention`,cancelled:`Stopped`,budget_exhausted:`Usage limit reached`},O=[{title:`Make something`,prompt:`Help me turn an idea into something useful. First help me define who it is for and what it should do.`},{title:`Understand a project`,prompt:`Explain this project in plain language and write a short getting-started guide for someone without a technical background.`},{title:`Improve a design`,prompt:`Review this project’s interface. Propose a distinctive visual direction, explain the most useful improvements and make a plan before changing code.`}];function k(){let{params:e}=y(),{connection:t}=r(),n=s(),k=u(),A=o(),j=a(),M=i(),N=l(),P=(0,T.useRef)(null),[F,I]=(0,T.useState)(()=>(e.get(`brief`)??``).slice(0,4e3)),[L,R]=(0,T.useState)(`plan`),[z,B]=(0,T.useState)(`50000`),[V,H]=(0,T.useState)(),U=n.data??[],W=U.find(C),G=e.has(`new`)||e.has(`brief`)?void 0:U.find(t=>t.id===e.get(`goal`))??W,K=t.mode===`mock`,q=d(n.error)&&n.error.status===501,J=(k.data??[]).some(e=>e.enabled),Y=n.isPending||n.isError||k.isPending||k.isError||!J||j.isPending||!!W&&L===`work`;function X(e){e.preventDefault(),!Y&&F.trim()&&(H(void 0),j.mutate({objective:F.trim(),dryRun:L===`plan`,maxTokens:Number(z)},{onSuccess:e=>{I(``),g(`/?goal=${encodeURIComponent(e.id)}`)},onError:e=>H(c(e))}))}return(0,E.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[780px] flex-1 flex-col`,children:[K&&(0,E.jsxs)(`p`,{className:`mb-4 text-center text-[12px] text-muted`,children:[`This is a demo.`,` `,(0,E.jsx)(_,{to:`/settings`,className:`underline`,children:`Connect your device`}),` `,`to work on your files.`]}),q&&(0,E.jsxs)(m,{tone:`warn`,title:`Open a project to start`,children:[`Start DaveCode in your project folder.`,` `,(0,E.jsx)(_,{to:`/goals`,className:`underline`,children:`Setup instructions`})]}),n.isError&&!q&&(0,E.jsx)(m,{tone:`err`,title:`Could not load your work`,children:c(n.error)}),k.isError&&(0,E.jsx)(m,{tone:`err`,title:`Could not load AI connections`,children:c(k.error)}),G?(0,E.jsxs)(`div`,{className:`flex flex-1 flex-col gap-7 pb-10 pt-6`,children:[(0,E.jsx)(`div`,{className:`ml-auto max-w-[90%] rounded-2xl bg-raised px-5 py-4 text-[15px] leading-7 text-fg`,children:G.objective}),(0,E.jsxs)(`section`,{"aria-labelledby":`work-status`,className:`px-1`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsx)(`h1`,{id:`work-status`,className:`text-[19px] font-medium tracking-tight text-fg`,children:D[G.status]}),C(G)&&(0,E.jsx)(x,{size:`sm`,variant:`ghost`,icon:v,loading:N.isPending,onClick:()=>N.mutate(G.id,{onError:e=>H(c(e))}),children:`Stop`})]}),G.tasks.length>0&&(0,E.jsx)(`ol`,{className:`mt-5 flex flex-col gap-4`,children:G.tasks.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-3 text-[14px] leading-6 text-fg-2`,children:[e.status===`SUCCESS`?(0,E.jsx)(b,{"aria-hidden":!0,className:`mt-1 size-4 shrink-0 text-fg-2`}):(0,E.jsx)(`span`,{className:`mt-0.5 w-4 shrink-0 text-center text-muted`,"aria-hidden":!0,children:e.id===G.activeTaskId?`→`:`−`}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`span`,{children:e.title}),e.status===`FAILED`&&(0,E.jsx)(`p`,{className:`mt-1 text-[12px] text-err`,children:`This step needs attention.`})]})]},e.id))}),G.summary&&(0,E.jsx)(p,{source:G.summary,className:`mt-6 text-[14px]`}),G.lastError&&(0,E.jsx)(`p`,{role:`alert`,className:`mt-4 text-[13px] text-err`,children:G.lastError}),G.status===`planned`&&(0,E.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(x,{size:`sm`,variant:`primary`,icon:h,loading:M.isPending,disabled:!!W,onClick:()=>{H(void 0),M.mutate(G.id,{onError:e=>H(c(e))})},children:`Execute this plan`}),(0,E.jsx)(`span`,{className:`text-[13px] leading-6 text-muted`,children:`Runs the planned steps above without re-planning.`})]})]}),(0,E.jsxs)(`details`,{className:`text-[12px] text-muted`,children:[(0,E.jsx)(`summary`,{className:`mb-3 cursor-pointer`,children:`Task details`}),(0,E.jsx)(S,{goal:G},G.id)]})]}):(0,E.jsxs)(`section`,{className:`flex flex-1 flex-col items-center justify-center pb-8 pt-16 text-center md:pt-20`,children:[(0,E.jsx)(`h1`,{className:`text-3xl font-medium tracking-tight text-fg md:text-[38px]`,children:`What are we making?`}),(0,E.jsx)(`p`,{className:`mt-3 text-[15px] text-muted`,children:`An idea is a good place to start.`}),(0,E.jsx)(`div`,{className:`mt-8 flex flex-wrap justify-center gap-2`,children:O.map(e=>(0,E.jsx)(`button`,{type:`button`,onClick:()=>{I(e.prompt),R(`plan`),P.current?.focus()},className:`rounded-xl border border-line px-4 py-3 text-[13px] text-fg-2 transition-colors hover:border-line-strong hover:bg-hover`,children:e.title},e.title))})]}),(0,E.jsxs)(`div`,{className:`sticky bottom-0 bg-bg pb-3 pt-3`,children:[(0,E.jsxs)(`form`,{onSubmit:X,className:`rounded-2xl border border-line-strong bg-panel p-4 focus-within:border-faint`,children:[(0,E.jsx)(`label`,{htmlFor:`workspace-composer`,className:`sr-only`,children:`What would you like to do?`}),(0,E.jsx)(`textarea`,{id:`workspace-composer`,ref:P,required:!0,rows:3,maxLength:4e3,value:F,onChange:e=>I(e.target.value),placeholder:`Describe what you have in mind…`,"aria-describedby":V?`workspace-error`:void 0,className:`block w-full resize-none border-0 bg-transparent px-1 py-2 text-[15px] leading-6 text-fg outline-none placeholder:text-muted`}),(0,E.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,E.jsx)(`label`,{className:`sr-only`,htmlFor:`workspace-mode`,children:`How to start`}),(0,E.jsxs)(`select`,{id:`workspace-mode`,value:L,onChange:e=>R(e.target.value),className:`max-w-44 rounded-lg border-0 bg-transparent py-2 pr-3 text-[12px] text-fg-2 outline-accent`,children:[(0,E.jsx)(`option`,{value:`plan`,children:`Plan first`}),(0,E.jsx)(`option`,{value:`work`,children:`Plan and work`})]}),(0,E.jsxs)(`details`,{className:`relative`,children:[(0,E.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1 text-[12px] text-muted`,children:[`Options`,(0,E.jsx)(w,{"aria-hidden":!0,className:`size-3`})]}),(0,E.jsxs)(`div`,{className:`absolute bottom-9 left-0 z-10 w-56 rounded-xl border border-line-strong bg-panel p-4 shadow-overlay`,children:[(0,E.jsx)(`label`,{htmlFor:`workspace-limit`,className:`text-[12px] text-fg-2`,children:`AI usage limit`}),(0,E.jsxs)(`select`,{id:`workspace-limit`,value:z,onChange:e=>B(e.target.value),className:`mt-2 w-full rounded-md border border-line-strong bg-panel px-2 py-2 text-[12px] text-fg`,children:[(0,E.jsx)(`option`,{value:`50000`,children:`50k tokens`}),(0,E.jsx)(`option`,{value:`250000`,children:`250k tokens`}),(0,E.jsx)(`option`,{value:`1000000`,children:`1m tokens`})]}),(0,E.jsx)(`p`,{className:`mt-2 text-[11px] leading-5 text-muted`,children:`A usage limit, not a price cap.`})]})]})]}),(0,E.jsx)(x,{type:`submit`,icon:f,iconOnly:!0,"aria-label":K?`Try demo`:L===`plan`?`Make a plan`:`Start working`,variant:`primary`,disabled:Y||!F.trim(),loading:j.isPending,className:`size-9 rounded-xl`})]})]}),V&&(0,E.jsx)(`p`,{id:`workspace-error`,role:`alert`,className:`mt-2 text-[12px] text-err`,children:V}),!k.isPending&&!k.isError&&!J&&(0,E.jsxs)(`p`,{className:`mt-3 text-center text-[12px] text-muted`,children:[(0,E.jsx)(_,{to:`/accounts`,className:`underline`,children:`Connect an AI tool`}),` `,`to get started.`]}),W&&L===`work`&&(0,E.jsx)(`p`,{role:`status`,className:`mt-3 text-center text-[12px] text-muted`,children:`A task is running. You can still plan the next one.`}),(0,E.jsxs)(`p`,{className:`mt-3 text-center text-[11px] leading-5 text-muted`,children:[L===`plan`?`Planning does not execute tasks.`:`Execution can edit files and merge changes.`,A.data?.project?` Working in ${A.data.project.name}.`:``]})]})]})}export{k as Workspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./cn-BwE4cei0.js";var t={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),f=Symbol.for(`react.view_transition`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ne(e){var t=w.T,n={};n.types=t===null?null:t.types,w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function re(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ne(re.bind(null,e))}var ie={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=ee,e.Children=ie,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.ViewTransition=f,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.addTransitionType=re,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ne,e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ee=o(((e,t)=>{t.exports=d()})),f=c(u(),1),p=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function m(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:p(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var h=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},g=e=>{let t=h(e);return t.charAt(0).toUpperCase()+t.slice(1)},_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),v={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function y(e){return e!=null}function b(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??v.width,a=e.size??e.height??v.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?_(...c):_(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??v[`stroke-width`])*Number(e.size??e.width??v.width)/Number(t.size??t.width??v.width):t.strokeWidth??v[`stroke-width`];return[`svg`,{...Object.entries(v).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&y(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&y(t.width)&&{[r(`width`)]:t.width},...`height`in t&&y(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function x(e,t={}){return b(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var S=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},C=(0,f.createContext)({}),w=()=>(0,f.useContext)(C),T=(0,f.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},ee)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=w()??{},b=!!c||S(d),[C,T,E=[]]=x(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:_(y,s),hasA11yProp:b,attributes:d});return(0,f.createElement)(C,{ref:ee,...T},[...E.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function E(e,t=[],n=[]){let r=typeof e==`string`?m(e,t,n):e,i=(0,f.forwardRef)(({className:e,...t},n)=>(0,f.createElement)(T,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=g(r.name)),i}function D(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=D(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function O(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=D(e))&&(r&&(r+=` `),r+=t);return r}var te=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},k=(e,t)=>({classGroupId:e,validator:t}),A=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),j=`-`,M=[],N=`arbitrary..`,P=e=>{let t=re(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ne(e);let n=e.split(j);return F(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?te(i,t):t:i||M}return n[e]||M}}},F=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=F(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(j):e.slice(t).join(j),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ne=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?N+r:void 0})(),re=e=>{let{theme:t,classGroups:n}=e;return ie(n,t)},ie=(e,t)=>{let n=A();for(let r in e){let i=e[r];I(i,n,r,t)}return n},I=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];L(i,t,n,r)}},L=(e,t,n,r)=>{typeof e==`string`?R(e,t,n):typeof e==`function`?ae(e,t,n,r):z(e,t,n,r)},R=(e,t,n)=>{let r=e===``?t:oe(t,e);r.classGroupId=n},ae=(e,t,n,r)=>{B(e)?I(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(k(n,e)))},z=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];I(o,oe(t,a),n,r)}},oe=(e,t)=>{let n=e,r=t.split(j),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=A(),n.nextPart.set(t,i)),n=i}return n},B=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,se=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},V=`!`,H=`:`,ce=[],le=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ue=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===H){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(V)?(c=s.slice(0,-1),l=!0):s.startsWith(V)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return le(t,l,c,u)};if(t){let e=t+H,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):le(ce,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},de=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},fe=e=>({cache:se(e.cacheSize),parseClassName:ue(e),sortModifiers:de(e),postfixLookupClassGroupIds:pe(e),...P(e)}),pe=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},me=/\s+/,he=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(me),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:ee,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let m=!!p,h;if(m){h=r(f.substring(0,p));let e=h&&o[h]?r(f):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(f);if(!h){if(!m||(h=r(f),!h)){l=t+(l.length>0?` `+l:l);continue}m=!1}let g=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),_=ee?g+V:g,v=_+h;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];s.push(_+t)}l=t+(l.length>0?` `+l:l)}return l},ge=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=_e(n))&&(i&&(i+=` `),i+=r);return i},_e=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=_e(e[r]))&&(n&&(n+=` `),n+=t);return n},ve=(e,...t)=>{let n,r,i,a,o=o=>(n=fe(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=he(e,n);return i(e,a),a};return a=o,(...e)=>a(ge(...e))},ye=[],U=e=>{let t=t=>t[e]||ye;return t.isThemeGetter=!0,t.themeKey=e,t},be=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Se=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ce=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Ee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,De=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>Se.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),Oe=e=>e.endsWith(`%`)&&G(e.slice(0,-1)),q=e=>Ce.test(e),ke=()=>!0,Ae=e=>we.test(e)&&!Te.test(e),je=()=>!1,Me=e=>Ee.test(e),Ne=e=>De.test(e),Pe=e=>!J(e)&&!X(e),Fe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ie=e=>Z(e,Qe,je),J=e=>be.test(e),Y=e=>Z(e,$e,Ae),Le=e=>Z(e,et,G),Re=e=>Z(e,nt,ke),ze=e=>Z(e,tt,je),Be=e=>Z(e,Xe,je),Ve=e=>Z(e,Ze,Ne),He=e=>Z(e,rt,Me),X=e=>xe.test(e),Ue=e=>Q(e,$e),We=e=>Q(e,tt),Ge=e=>Q(e,Xe),Ke=e=>Q(e,Qe),qe=e=>Q(e,Ze),Je=e=>Q(e,rt,!0),Ye=e=>Q(e,nt,!0),Z=(e,t,n)=>{let r=be.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=xe.exec(e);return r?r[1]?t(r[1]):n:!1},Xe=e=>e===`position`||e===`percentage`,Ze=e=>e===`image`||e===`url`,Qe=e=>e===`length`||e===`size`||e===`bg-size`,$e=e=>e===`length`,et=e=>e===`number`,tt=e=>e===`family-name`,nt=e=>e===`number`||e===`weight`,rt=e=>e===`shadow`,it=()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),ee=U(`text-shadow`),f=U(`drop-shadow`),p=U(`blur`),m=U(`perspective`),h=U(`aspect`),g=U(`ease`),_=U(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),X,J],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[X,J,c],w=()=>[W,`full`,`auto`,...C()],T=()=>[K,`none`,`subgrid`,X,J],E=()=>[`auto`,{span:[`full`,K,X,J]},K,X,J],D=()=>[K,`auto`,X,J],O=()=>[`auto`,`min`,`max`,`fr`,X,J],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...C()],j=()=>[W,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],M=()=>[s,W,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],N=()=>[W,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],P=()=>[e,X,J],F=()=>[...y(),Ge,Be,{position:[X,J]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,Ke,Ie,{size:[X,J]}],ie=()=>[Oe,Ue,Y],I=()=>[``,`none`,`full`,l,X,J],L=()=>[``,G,Ue,Y],R=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[G,Oe,Ge,Be],oe=()=>[``,`none`,p,X,J],B=()=>[`none`,G,X,J],se=()=>[`none`,G,X,J],V=()=>[G,X,J],H=()=>[W,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[q],breakpoint:[q],color:[ke],container:[q],"drop-shadow":[q],ease:[`in`,`out`,`in-out`],font:[Pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[q],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[q],shadow:[q],spacing:[`px`,G],text:[q],"text-shadow":[q],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,W,J,X,h]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[Fe],columns:[{columns:[G,`auto`,J,X,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[K,`auto`,X,J]}],basis:[{basis:[W,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[G,W,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,G,X,J]}],shrink:[{shrink:[``,G,X,J]}],order:[{order:[K,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,Ue,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ye,Re]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Oe,J]}],"font-family":[{font:[We,ze,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[G,`none`,X,Le]}],leading:[{leading:[`none`,a,...C()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...R(),`wavy`]}],"text-decoration-thickness":[{decoration:[G,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[G,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[K,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},K,X,J],radial:[``,X,J],conic:[``,K,X,J]},qe,Ve]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...R(),`hidden`,`none`]}],"divide-style":[{divide:[...R(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...R(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[G,X,J]}],"outline-w":[{outline:[``,G,Ue,Y]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,Je,He]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Je,He]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[G,Y]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,ee,Je,He]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[G,X,J]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:oe()}],brightness:[{brightness:[G,X,J]}],contrast:[{contrast:[G,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,f,Je,He]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,G,X,J]}],"hue-rotate":[{"hue-rotate":[G,X,J]}],invert:[{invert:[``,G,X,J]}],saturate:[{saturate:[G,X,J]}],sepia:[{sepia:[``,G,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[G,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[G,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,G,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,G,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[G,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[G,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,G,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[G,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,g,X,J]}],delay:[{delay:[G,X,J]}],animate:[{animate:[`none`,_,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,X,J]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:B()}],"rotate-x":[{"rotate-x":B()}],"rotate-y":[{"rotate-y":B()}],"rotate-z":[{"rotate-z":B()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:H()}],"translate-x":[{"translate-x":H()}],"translate-y":[{"translate-y":H()}],"translate-z":[{"translate-z":H()}],"translate-none":[`translate-none`],zoom:[{zoom:[K,X,J]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[G,Ue,Y,Le]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},at=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>($(e,`cacheSize`,t),$(e,`prefix`,n),$(e,`experimentalParseClassName`,r),ot(e.theme,a.theme),ot(e.classGroups,a.classGroups),ot(e.conflictingClassGroups,a.conflictingClassGroups),ot(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),$(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),$(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),st(e.theme,i.theme),st(e.classGroups,i.classGroups),st(e.conflictingClassGroups,i.conflictingClassGroups),st(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),ct(e,i,`postfixLookupClassGroups`),ct(e,i,`orderSensitiveModifiers`),e),$=(e,t,n)=>{n!==void 0&&(e[t]=n)},ot=(e,t)=>{if(t)for(let n in t)$(e,n,t[n])},st=(e,t)=>{if(t)for(let n in t)ct(e,t,n)},ct=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},lt=((e,...t)=>typeof e==`function`?ve(it,e,...t):ve(()=>at(it(),e),...t))({extend:{classGroups:{"font-size":[{text:[`2xs`]}]}}});function ut(...e){return lt(O(e))}export{o as a,u as i,E as n,c as o,ee as r,ut as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r}from"./cn-BwE4cei0.js";import{n as i,r as a,t as o}from"./Field-Cmpgg_1z.js";var s={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};s.node;var c=t(s),l={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};l.node;var u=t(l),d=n(e(),1),f=r(),p=[{key:`tpm`,label:`Tokens / min`},{key:`rpm`,label:`Requests / min`},{key:`tokens5h`,label:`Tokens / 5 h`},{key:`requests5h`,label:`Requests / 5 h`},{key:`tokensDaily`,label:`Tokens / 24 h`},{key:`requestsDaily`,label:`Requests / 24 h`}];function m(e={}){let t={};for(let{key:n}of p)t[n]=e[n]===void 0?``:String(e[n]);return t}function h(e){let t={},n={};for(let{key:r}of p){let i=e[r].replace(/[,_\s]/g,``);if(!i)continue;let a=Number(i);!Number.isInteger(a)||a<=0?n[r]=`Whole number above 0`:t[r]=a}return{limits:t,errors:n}}function g({value:e,onChange:t,errors:n}){return(0,f.jsx)(`div`,{className:`grid grid-cols-2 gap-x-3 gap-y-3`,children:p.map(({key:r,label:a})=>(0,f.jsx)(o,{label:a,error:n[r],children:({id:n,describedBy:a,invalid:o})=>(0,f.jsx)(i,{id:n,inputMode:`numeric`,placeholder:`unlimited`,value:e[r],"aria-describedby":a,"aria-invalid":o||void 0,onChange:n=>t({...e,[r]:n.target.value}),className:`tnum font-mono`})},r))})}function _({id:e,value:t,onChange:n,placeholder:r,describedBy:a,invalid:o}){let[s,l]=(0,d.useState)(!1);return(0,f.jsxs)(`div`,{className:`relative`,children:[(0,f.jsx)(i,{id:e,type:s?`text`:`password`,autoComplete:`new-password`,spellCheck:!1,autoCapitalize:`off`,value:t,placeholder:r,"aria-describedby":a,"aria-invalid":o||void 0,onChange:e=>n(e.target.value),className:`pr-9 font-mono`}),(0,f.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),"aria-label":s?`Hide secret`:`Show secret`,"aria-pressed":s,className:`absolute top-1/2 right-1 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded text-muted hover:bg-hover hover:text-fg`,children:s?(0,f.jsx)(c,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}):(0,f.jsx)(u,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})})]})}function v(e){return{plan:e?.plan??``,amount:e?.price?String(e.price.amount):``,currency:e?.price?.currency??`USD`,period:e?.price?.period??`month`,paidAt:e?.paidAt?.slice(0,10)??``,renewsAt:e?.renewsAt?.slice(0,10)??``,notes:e?.notes??``}}function y(e){let t={},n={};e.plan.trim()&&(n.plan=e.plan.trim()),e.notes.trim()&&(n.notes=e.notes.trim()),e.paidAt&&(n.paidAt=e.paidAt),e.renewsAt&&(n.renewsAt=e.renewsAt);let r=e.amount.replace(/[,\s]/g,``);if(r){let i=Number(r),a=e.currency.trim().toUpperCase();(!Number.isFinite(i)||i<0)&&(t.amount=`Number, 0 or more`),/^[A-Z]{3}$/.test(a)||(t.currency=`3-letter code`),!t.amount&&!t.currency&&(n.price={amount:i,currency:a,period:e.period})}return{subscription:Object.keys(n).length>0?n:void 0,errors:t}}function b({value:e,onChange:t,errors:n}){let r=(n,r)=>t({...e,[n]:r});return(0,f.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,f.jsx)(o,{label:`Plan`,hint:`As the vendor calls it, e.g. Claude Pro or API pay-as-you-go.`,children:({id:t,describedBy:n})=>(0,f.jsx)(i,{id:t,value:e.plan,placeholder:`Claude Pro`,"aria-describedby":n,onChange:e=>r(`plan`,e.target.value)})}),(0,f.jsxs)(`div`,{className:`grid grid-cols-[1fr_5.5rem_7rem] gap-3`,children:[(0,f.jsx)(o,{label:`Price`,error:n.amount,children:({id:t,describedBy:n,invalid:a})=>(0,f.jsx)(i,{id:t,inputMode:`decimal`,placeholder:`20`,value:e.amount,"aria-describedby":n,"aria-invalid":a||void 0,onChange:e=>r(`amount`,e.target.value),className:`tnum font-mono`})}),(0,f.jsx)(o,{label:`Currency`,error:n.currency,children:({id:t,describedBy:n,invalid:a})=>(0,f.jsx)(i,{id:t,maxLength:3,value:e.currency,"aria-describedby":n,"aria-invalid":a||void 0,onChange:e=>r(`currency`,e.target.value.toUpperCase()),className:`font-mono uppercase`})}),(0,f.jsx)(o,{label:`Per`,children:({id:t})=>(0,f.jsxs)(a,{id:t,value:e.period,onChange:e=>r(`period`,e.target.value),children:[(0,f.jsx)(`option`,{value:`month`,children:`month`}),(0,f.jsx)(`option`,{value:`year`,children:`year`})]})})]}),(0,f.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,f.jsx)(o,{label:`Last paid`,children:({id:t})=>(0,f.jsx)(i,{id:t,type:`date`,value:e.paidAt,onChange:e=>r(`paidAt`,e.target.value),className:`font-mono`})}),(0,f.jsx)(o,{label:`Renews on`,children:({id:t})=>(0,f.jsx)(i,{id:t,type:`date`,value:e.renewsAt,onChange:e=>r(`renewsAt`,e.target.value),className:`font-mono`})})]}),(0,f.jsx)(o,{label:`Notes`,children:({id:t})=>(0,f.jsx)(i,{id:t,value:e.notes,placeholder:`Shared with the team, prepaid credits…`,onChange:e=>r(`notes`,e.target.value)})})]})}function x(e){return e.split(/[\n,]/).map(e=>e.trim()).filter(Boolean)}function S(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}export{m as a,y as c,S as i,v as l,_ as n,h as o,b as r,x as s,g as t};
|