@dmrlzz/davecode 0.6.0 → 0.7.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.
Files changed (83) hide show
  1. package/dist/{ChatApp-RQZ2IZFQ.js → ChatApp-C23NVTME.js} +6 -6
  2. package/dist/{account-FY6THFLW.js → account-GG7UFSNY.js} +3 -3
  3. package/dist/{accounts-ZV3KMLC5.js → accounts-IPOGUMHF.js} +5 -5
  4. package/dist/{budget-OUOEMMOM.js → budget-7QJGPYPF.js} +4 -4
  5. package/dist/{chat-OHVP4BS3.js → chat-3K2KXS3E.js} +8 -8
  6. package/dist/{chunk-FFB2QA5I.js → chunk-3BTE76UD.js} +2 -2
  7. package/dist/{chunk-L7NEDOA3.js → chunk-4FE2YV5U.js} +2 -2
  8. package/dist/{chunk-TP3ORSHY.js → chunk-FKGZERYB.js} +157 -9
  9. package/dist/chunk-FKGZERYB.js.map +1 -0
  10. package/dist/{chunk-2MM5WT5J.js → chunk-JBX6J74G.js} +3 -3
  11. package/dist/{chunk-2P5DJWIJ.js → chunk-KEURMO75.js} +4 -4
  12. package/dist/{chunk-NKRI6SYR.js → chunk-LK2K73DC.js} +2 -2
  13. package/dist/{chunk-2XGDILCW.js → chunk-NBQIMB43.js} +2422 -1599
  14. package/dist/chunk-NBQIMB43.js.map +1 -0
  15. package/dist/{chunk-HL4RIXPM.js → chunk-PGZPSJS7.js} +3 -3
  16. package/dist/{chunk-U5CI774J.js → chunk-U42YONUN.js} +3 -3
  17. package/dist/{config-ZLO3YOUX.js → config-BFEQFGAR.js} +3 -3
  18. package/dist/dashboard/assets/Accounts-CUMFzGls.js +1 -0
  19. package/dist/dashboard/assets/{Callout-CqdcH6dC.js → Callout-DDtTG_BA.js} +1 -1
  20. package/dist/dashboard/assets/Goals-CBGiTkcP.js +1 -0
  21. package/dist/dashboard/assets/{Library-DnCIb76j.js → Library-CKWa3h0E.js} +1 -1
  22. package/dist/dashboard/assets/{Panes-DBqKYuaE.js → Panes-ziAz-CZa.js} +4 -4
  23. package/dist/dashboard/assets/RoutesPage-D2iW-KhM.js +4 -0
  24. package/dist/dashboard/assets/Runner-4e79FB1J.js +1 -0
  25. package/dist/dashboard/assets/Settings-CSae84S0.js +1 -0
  26. package/dist/dashboard/assets/Tasks-CnbZ5PvX.js +2 -0
  27. package/dist/dashboard/assets/Traffic-B12xKOUm.js +1 -0
  28. package/dist/dashboard/assets/Workspace-CMPHlw4f.js +1 -0
  29. package/dist/dashboard/assets/chevron-down-DT349Fth.js +1 -0
  30. package/dist/dashboard/assets/external-link-DCIUScea.js +1 -0
  31. package/dist/dashboard/assets/format-C7Q-B9fI.js +112 -0
  32. package/dist/dashboard/assets/index-4RIBvhr9.css +2 -0
  33. package/dist/dashboard/assets/index-z8TlFwRe.js +50 -0
  34. package/dist/dashboard/assets/{task-errors-DK4-900l.js → task-errors-3F3vbQ7k.js} +1 -1
  35. package/dist/dashboard/assets/x-UBQsC1rW.js +1 -0
  36. package/dist/dashboard/index.html +4 -3
  37. package/dist/{dist-56V3DLJ4.js → dist-VTC5E7Z5.js} +34 -2
  38. package/dist/{doctor-DUOKUSJL.js → doctor-JLFYQ3EP.js} +3 -3
  39. package/dist/{goal-WG37XHUY.js → goal-JM7QYTL2.js} +4 -4
  40. package/dist/index.js +32 -32
  41. package/dist/{init-WW4XPFMM.js → init-6K4EGMTV.js} +3 -3
  42. package/dist/{orchestrate-7YQDBS3E.js → orchestrate-QC5P6IUZ.js} +4 -4
  43. package/dist/{run-QB4SGPEC.js → run-ABQNQ722.js} +3 -3
  44. package/dist/runtime.js +2 -2
  45. package/dist/{start-U4RL377T.js → start-MSO7TGBX.js} +3 -3
  46. package/dist/{status-GHVMGZI5.js → status-U6C4LUCM.js} +4 -4
  47. package/dist/{tasks-VTBJ4B2G.js → tasks-HEVT67YM.js} +4 -4
  48. package/package.json +4 -4
  49. package/dist/chunk-2XGDILCW.js.map +0 -1
  50. package/dist/chunk-TP3ORSHY.js.map +0 -1
  51. package/dist/dashboard/assets/Accounts-CIhOt9FH.js +0 -1
  52. package/dist/dashboard/assets/Goals-CITP2GqG.js +0 -1
  53. package/dist/dashboard/assets/RoutesPage-BNVmKhyU.js +0 -4
  54. package/dist/dashboard/assets/Runner-KR35ZWUE.js +0 -1
  55. package/dist/dashboard/assets/Settings-B5qE-a5O.js +0 -1
  56. package/dist/dashboard/assets/Tasks-bJLfNJmS.js +0 -2
  57. package/dist/dashboard/assets/Traffic-CGfilrRx.js +0 -1
  58. package/dist/dashboard/assets/Workspace-Dc3cvct_.js +0 -1
  59. package/dist/dashboard/assets/format-328qIBHX.js +0 -111
  60. package/dist/dashboard/assets/index-C-bwzlsl.js +0 -50
  61. package/dist/dashboard/assets/index-D9FCfPmM.css +0 -2
  62. /package/dist/{ChatApp-RQZ2IZFQ.js.map → ChatApp-C23NVTME.js.map} +0 -0
  63. /package/dist/{account-FY6THFLW.js.map → account-GG7UFSNY.js.map} +0 -0
  64. /package/dist/{accounts-ZV3KMLC5.js.map → accounts-IPOGUMHF.js.map} +0 -0
  65. /package/dist/{budget-OUOEMMOM.js.map → budget-7QJGPYPF.js.map} +0 -0
  66. /package/dist/{chat-OHVP4BS3.js.map → chat-3K2KXS3E.js.map} +0 -0
  67. /package/dist/{chunk-FFB2QA5I.js.map → chunk-3BTE76UD.js.map} +0 -0
  68. /package/dist/{chunk-L7NEDOA3.js.map → chunk-4FE2YV5U.js.map} +0 -0
  69. /package/dist/{chunk-2MM5WT5J.js.map → chunk-JBX6J74G.js.map} +0 -0
  70. /package/dist/{chunk-2P5DJWIJ.js.map → chunk-KEURMO75.js.map} +0 -0
  71. /package/dist/{chunk-NKRI6SYR.js.map → chunk-LK2K73DC.js.map} +0 -0
  72. /package/dist/{chunk-HL4RIXPM.js.map → chunk-PGZPSJS7.js.map} +0 -0
  73. /package/dist/{chunk-U5CI774J.js.map → chunk-U42YONUN.js.map} +0 -0
  74. /package/dist/{config-ZLO3YOUX.js.map → config-BFEQFGAR.js.map} +0 -0
  75. /package/dist/{dist-56V3DLJ4.js.map → dist-VTC5E7Z5.js.map} +0 -0
  76. /package/dist/{doctor-DUOKUSJL.js.map → doctor-JLFYQ3EP.js.map} +0 -0
  77. /package/dist/{goal-WG37XHUY.js.map → goal-JM7QYTL2.js.map} +0 -0
  78. /package/dist/{init-WW4XPFMM.js.map → init-6K4EGMTV.js.map} +0 -0
  79. /package/dist/{orchestrate-7YQDBS3E.js.map → orchestrate-QC5P6IUZ.js.map} +0 -0
  80. /package/dist/{run-QB4SGPEC.js.map → run-ABQNQ722.js.map} +0 -0
  81. /package/dist/{start-U4RL377T.js.map → start-MSO7TGBX.js.map} +0 -0
  82. /package/dist/{status-GHVMGZI5.js.map → status-U6C4LUCM.js.map} +0 -0
  83. /package/dist/{tasks-VTBJ4B2G.js.map → tasks-HEVT67YM.js.map} +0 -0
@@ -1,2 +0,0 @@
1
- import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{B as a,I as o,Mt as s,S as c,_t as l,b as u,ct as d,dt as f,ft as p,gt as m,ht as h,j as g,l as _,lt as v,mt as y,p as b,pt as x,ut as S}from"./format-328qIBHX.js";import{n as C,t as w}from"./Markdown-CGgIydUh.js";import{t as T}from"./Callout-CqdcH6dC.js";import{n as E,t as D}from"./task-errors-DK4-900l.js";import{t as O}from"./trash-BTuDcSaQ.js";import{A as k,E as A,H as ee,J as te,M as ne,R as re,T as j,V as M,b as N,d as ie,f as ae,i as oe,j as se,l as ce,m as le,n as ue,q as P,r as F,s as de,t as I,u as fe,v as L,x as R,y as z}from"./index-C-bwzlsl.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:o}){let s=a(),l=c(),u=g(),[d,f]=(0,q.useState)(!1),[p,m]=(0,q.useState)(null),v=(t,n)=>s.mutate({id:e.id,patch:{status:t}},{onSuccess:()=>j({tone:`ok`,title:n,description:e.id}),onError:e=>j({tone:`err`,title:`Could not ${n.toLowerCase()}`,description:D(e)})}),y=()=>u.mutate(e.id,{onSuccess:()=>j({tone:`info`,title:`Runner started`,description:e.id}),onError:e=>j({tone:`err`,title:`Could not start the runner`,description:D(e)})}),b=()=>l.mutate(e.id,{onSuccess:()=>{j({tone:`ok`,title:`Task deleted`,description:e.id}),f(!1),i()},onError:e=>m(D(e))}),x=new Map(t.map(e=>[e.id,e])),S=t.filter(t=>t.dependsOn.includes(e.id)),C=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)(ne,{"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)(z,{status:e.status}),n===`ready`&&(0,Y.jsx)(R,{tone:`ok`,children:`ready to run`}),n===`blocked`&&(0,Y.jsx)(R,{tone:`err`,children:`blocked by a failed dependency`}),e.priority!==void 0&&(0,Y.jsxs)(R,{mono:!0,children:[`priority `,e.priority]}),e.attempts!==void 0&&(0,Y.jsxs)(R,{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)(A,{size:`sm`,variant:`primary`,icon:ee,loading:u.isPending,onClick:y,children:`Run now`}),h(e.status).map(e=>(0,Y.jsx)(A,{size:`sm`,variant:e.variant,disabled:s.isPending,onClick:()=>v(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)(A,{size:`sm`,variant:`ghost`,icon:E,onClick:o,children:`Edit`}),(0,Y.jsx)(A,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:O,"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)(P,{"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:[C?(0,Y.jsx)(te,{"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 `,_(Date.parse(e.updatedAt))]}),(0,Y.jsxs)(ie,{open:d,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)(A,{variant:`ghost`,onClick:()=>f(!1),children:`Keep task`}),(0,Y.jsx)(A,{variant:`danger`,icon:O,loading:l.isPending,onClick:b,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)(T,{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=u(),i=a(),[o,s]=(0,q.useState)(()=>e?S(e):f()),[c,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)({}),[v,b]=(0,q.useState)(null),C=r.isPending||i.isPending,w=(e,t)=>s(n=>({...n,[e]:t})),E=n=>s(r=>({...r,title:n,...!e&&!c?{id:m(y(n),t)}:{}}));return(0,Y.jsxs)(`form`,{onSubmit:async a=>{a.preventDefault(),b(null);let s=l(o,t,e?.id);if(_(s),!(Object.keys(s).length>0))try{if(e){let t=x(e,o);p(t)||await i.mutateAsync({id:e.id,patch:t}),j({tone:`ok`,title:`Task updated`,description:e.id})}else{let e=await r.mutateAsync(d(o));j({tone:`ok`,title:`Task created`,description:e.id})}n()}catch(e){b(D(e))}},noValidate:!0,className:`flex flex-col gap-5`,children:[(0,Y.jsx)(H,{label:`Title`,required:!0,error:g.title,children:({id:e,describedBy:t,invalid:n})=>(0,Y.jsx)(V,{id:e,autoFocus:!0,value:o.title,onChange:e=>E(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:g.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:o.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:o.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:o.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:g.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:o.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:o.dependsOn,onChange:e=>w(`dependsOn`,e),error:g.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:o.notes,onChange:e=>w(`notes`,e.target.value),"aria-describedby":t})}),v&&(0,Y.jsx)(T,{tone:`err`,title:e?`Could not save the task`:`Could not create the task`,children:v}),(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)(A,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,Y.jsx)(A,{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)(()=>v(e,t),[e,t]),l=new Set(e.map(e=>e.id)),u=e.length-c.length-+!!t,d=o.trim().toLowerCase(),f=c.filter(e=>!d||e.id.toLowerCase().includes(d)||e.title.toLowerCase().includes(d)),p=n.filter(e=>!l.has(e)),m=(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)(re,{"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:[p.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:()=>m(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)),f.length===0&&p.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.`}),f.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=>m(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=o(),t=b(),{params:n}=se(),r=[`graph`,`board`,`list`].includes(n.get(`view`)??``)?n.get(`view`):`graph`,i=n.get(`task`),a=n.get(`panel`),c=n.get(`new`)===`1`,l=n.get(`edit`),u=e.data?.graph.tasks??[],d=(0,q.useMemo)(()=>ve(u),[u]),f=u.find(e=>e.id===i),p=u.find(e=>e.id===l),m=a??(f?`task`:`state`),h=(0,q.useMemo)(()=>J(u),[u]),g=(0,q.useMemo)(()=>{let e={PENDING:0,IN_PROGRESS:0,SUCCESS:0,FAILED:0};for(let t of u)e[t.status]+=1;return e},[u]),_=u.length?g.SUCCESS/u.length:0,v=e=>{k(`panel`,null),k(`task`,e)},y=e.data?.project;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(ue,{title:`Tasks`,description:y?(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-fg-2`,children:y.name}),` `,(0,Y.jsxs)(`span`,{className:`font-mono text-2xs text-faint`,children:[y.root,`/.davecode/TASK_GRAPH.json`]})]}):`The project task graph the autonomous runner works through.`,actions:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{variant:`primary`,icon:M,onClick:()=>k(`new`,`1`),children:`New task`}),(0,Y.jsx)(I,{label:`Task view`,value:r,onChange:e=>k(`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)(T,{tone:`err`,title:`Could not load the task graph`,children:s(e.error)}),u.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":u.length,"aria-valuenow":g.SUCCESS,children:(0,Y.jsx)(`div`,{className:`h-full rounded-full bg-ok transition-[width] duration-500 ease-snappy`,style:{width:`${_*100}%`}})}),(0,Y.jsxs)(`span`,{className:`tnum text-fg-2`,children:[g.SUCCESS,` of `,u.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}),L[e],` `,(0,Y.jsx)(`span`,{className:`tnum text-fg-2`,children:g[e]})]},e)),h.missing.length>0&&(0,Y.jsxs)(R,{tone:`warn`,children:[h.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)(F,{className:`min-h-[420px]`,children:e.isPending?(0,Y.jsx)(`div`,{className:`p-4`,children:(0,Y.jsx)(ce,{className:`h-[380px] w-full`})}):u.length===0?(0,Y.jsx)(de,{icon:P,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)(A,{variant:`primary`,icon:M,onClick:()=>k(`new`,`1`),children:`New task`}),className:`py-20`}):r===`graph`?(0,Y.jsx)(Ce,{tasks:u,ready:d,selectedId:i,onSelect:v}):r===`board`?(0,Y.jsx)(ke,{tasks:u,ready:d,selectedId:i,onSelect:v}):(0,Y.jsx)(Ae,{tasks:u,ready:d,selectedId:i,onSelect:v})}),(0,Y.jsxs)(F,{className:`xl:sticky xl:top-16 xl:max-h-[calc(100dvh-5rem)] xl:self-start`,children:[(0,Y.jsx)(oe,{title:(0,Y.jsx)(I,{size:`sm`,label:`Side panel`,value:m,onChange:e=>k(`panel`,e),options:[...f?[{value:`task`,label:`Task`,icon:P}]:[],{value:`state`,label:`STATE.md`,icon:C},{value:`architecture`,label:`ARCHITECTURE.md`,icon:C}]})}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:m===`task`&&f?(0,Y.jsx)(be,{task:f,tasks:u,readiness:d.get(f.id),onSelect:v,onEdit:()=>k(`edit`,f.id),onClose:()=>{k(`task`,null),k(`panel`,null)}}):t.isPending?(0,Y.jsx)(fe,{rows:6}):t.isError?(0,Y.jsx)(`p`,{className:`p-4 text-[12px] text-err`,children:s(t.error)}):(0,Y.jsx)(w,{className:`p-4`,source:(m===`architecture`?t.data?.architecture:t.data?.state)||`_This file is empty._`})})]})]}),(0,Y.jsx)($,{open:c,tasks:u,onClose:()=>k(`new`,null)}),(0,Y.jsx)($,{open:!!p,task:p,tasks:u,onClose:()=>k(`edit`,null)})]})}function Oe({r:e}){return e===`ready`?(0,Y.jsx)(R,{tone:`ok`,children:`ready`}):e===`blocked`?(0,Y.jsx)(R,{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":L[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}),L[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)(z,{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};
@@ -1 +0,0 @@
1
- import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{At as a,Ot as o,U as s,W as c,d as l,kt as u,n as d,o as f,s as p,t as m,u as h}from"./format-328qIBHX.js";import{$ as g,A as _,E as v,H as y,M as b,R as x,U as S,Y as C,_ as w,f as T,j as E,m as D,n as O,r as k,s as A,t as j,u as M,x as N}from"./index-C-bwzlsl.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 (${a(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:a(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)(w,{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)(C,{className:`size-3 shrink-0 text-ok`,strokeWidth:2.25}),e.outcome===`failed`&&(0,z.jsx)(b,{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)(N,{tone:`info`,dot:!0,pulse:!0,children:`in flight`}):e.outcome===`failed`?(0,z.jsx)(N,{tone:`err`,dot:!0,children:`failed`}):e.failovers>0?(0,z.jsxs)(N,{tone:`warn`,dot:!0,children:[`ok · `,e.failovers,` failover`,e.failovers>1?`s`:``]}):(0,z.jsx)(N,{tone:`ok`,dot:!0,children:`ok`})}function W({chain:e,accounts:t,onClose:n}){return(0,z.jsx)(T,{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)(D,{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=u(e),r=o(e),s=[[`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?`—`:p(r)},`l`)],[`Tokens`,(0,z.jsxs)(`span`,{className:`tnum font-mono`,children:[f(n.prompt),` in · `,f(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:s.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 o=t.get(n.accountId),s=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)(w,{provider:n.provider,size:`sm`}),(0,z.jsx)(`span`,{className:`truncate text-[13px] font-medium text-fg`,children:o?.label??n.accountId}),(0,z.jsx)(`span`,{className:`ml-auto`,children:n.outcome===`success`?(0,z.jsx)(N,{tone:`ok`,children:`served`}):n.outcome===`failed`?(0,z.jsxs)(N,{tone:`err`,mono:!0,children:[a(n),` `,n.errorKind]}):(0,z.jsx)(N,{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,` · +`,p(s),n.latencyMs!==void 0&&` · took ${p(n.latencyMs)}`,n.outcome===`success`&&` · ${f(n.promptTokens??0)} → ${f(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=c(),{connection:t}=s(),n=l(),{params:r}=E(),[a,f]=(0,R.useState)(``),[b,C]=(0,R.useState)(`all`),[w,T]=(0,R.useState)(``),[D,I]=(0,R.useState)(null),L=(0,R.useMemo)(()=>new Map((n.data??[]).map(e=>[e.id,e])),[n.data]),V=D??e.chains,H=D?Math.max(0,e.chains.length-D.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=a.trim().toLowerCase(),Y=V.filter(e=>K(e,b)&&(!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)(O,{title:`Traffic`,description:`Every request through /v1, with failover hops shown inline.`,actions:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D?(0,z.jsxs)(N,{tone:`warn`,children:[`paused`,H>0&&` · ${H} new`]}):(0,z.jsx)(N,{tone:`ok`,dot:!0,pulse:!0,children:`streaming`}),(0,z.jsx)(v,{icon:D?y:S,onClick:()=>I(D?null:e.chains),"aria-pressed":!!D,children:D?`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)(x,{"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:a,onChange:e=>f(e.target.value),className:`pl-8`,"data-filter-input":!0})]}),(0,z.jsx)(j,{label:`Outcome`,value:b,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=>T(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:g,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:x,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=u(e),n=o(e);return(0,z.jsxs)(`tr`,{onClick:()=>_(`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(),_(`req`,e.requestId)},className:`font-mono text-fg-2 hover:text-fg hover:underline focus-visible:underline`,"aria-label":`Open request ${e.requestId}`,children:h(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?`…`:p(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:[d(t.prompt),` `,(0,z.jsx)(`span`,{className:`text-faint`,children:`→`}),` `,d(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:()=>_(`req`,null)})]})}export{J as Traffic};
@@ -1 +0,0 @@
1
- import{i as e,o as t,r as n}from"./cn-BwE4cei0.js";import{C as r,I as i,Mt as a,Nt as o,P as s,T as c,U as l,d as u,h as d}from"./format-328qIBHX.js";import{t as f}from"./arrow-up-DjhzZprp.js";import{t as p}from"./Markdown-CGgIydUh.js";import{t as m}from"./Callout-CqdcH6dC.js";import{E as h,H as g,L as _,O as v,Y as y,j as b,k as x}from"./index-C-bwzlsl.js";import{GoalDetail as S,isActiveGoal as C,t as w}from"./Goals-CITP2GqG.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}=b(),{connection:t}=l(),n=c(),k=u(),A=i(),j=s(),M=r(),N=d(),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=o(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(``),x(`/?goal=${encodeURIComponent(e.id)}`)},onError:e=>H(a(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)(v,{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)(v,{to:`/goals`,className:`underline`,children:`Setup instructions`})]}),n.isError&&!q&&(0,E.jsx)(m,{tone:`err`,title:`Could not load your work`,children:a(n.error)}),k.isError&&(0,E.jsx)(m,{tone:`err`,title:`Could not load AI connections`,children:a(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)(h,{size:`sm`,variant:`ghost`,icon:_,loading:N.isPending,onClick:()=>N.mutate(G.id,{onError:e=>H(a(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)(y,{"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)(h,{size:`sm`,variant:`primary`,icon:g,loading:M.isPending,disabled:!!W,onClick:()=>{H(void 0),M.mutate(G.id,{onError:e=>H(a(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)(h,{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)(v,{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};