adam-agent-server 1.7.0 → 1.8.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 (55) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +16 -13
  3. package/package.json +1 -1
  4. package/web/dist/assets/AlertDialog-B1zj0Qs3.js +51 -0
  5. package/web/dist/assets/{Button-DuQctNms.js → Button-BehrGSvy.js} +1 -1
  6. package/web/dist/assets/{Card-rKfViPS2.js → Card-B5E56u94.js} +1 -1
  7. package/web/dist/assets/ChannelDetail-BaSlX2yb.js +1 -0
  8. package/web/dist/assets/{Channels-dod8Q4oq.js → Channels-CLhgGEmS.js} +2 -2
  9. package/web/dist/assets/Chat-BZpf1DSF.js +2 -0
  10. package/web/dist/assets/{Dashboard-Dl0vA6Ky.js → Dashboard-HR4Qmdwg.js} +1 -1
  11. package/web/dist/assets/{EmptyState-CIdIlMbn.js → EmptyState-tTclFq_B.js} +1 -1
  12. package/web/dist/assets/EnvVarEditor-BzJNsDt0.js +1 -0
  13. package/web/dist/assets/EventDefDetail-CjoqsH0e.js +1 -0
  14. package/web/dist/assets/Events-IeznRpCj.js +1 -0
  15. package/web/dist/assets/Evolution-CUn8g34X.js +6 -0
  16. package/web/dist/assets/GoalDetail-DgPvXb6z.js +1 -0
  17. package/web/dist/assets/Goals-DYrggK-M.js +1 -0
  18. package/web/dist/assets/{Logs-6rf0KT0z.js → Logs-CvFC-GbD.js} +1 -1
  19. package/web/dist/assets/Memories-B5pvI6Oj.js +1 -0
  20. package/web/dist/assets/{PageHeader-CHSgtxPw.js → PageHeader-B2CgcZ-t.js} +1 -1
  21. package/web/dist/assets/Plugins-BuE7GImW.js +1 -0
  22. package/web/dist/assets/{RoleDetail-DJc4CWFN.js → RoleDetail-BBJxaZip.js} +2 -2
  23. package/web/dist/assets/{Roles-6pmjn04G.js → Roles-C5eVA6LM.js} +1 -1
  24. package/web/dist/assets/{SectionHeader-C2WpiwJ5.js → SectionHeader-CmXz6PM3.js} +1 -1
  25. package/web/dist/assets/Settings-BblOdOih.js +1 -0
  26. package/web/dist/assets/{Strategies-Bmke6qZo.js → Strategies-Ddb5HiUS.js} +1 -1
  27. package/web/dist/assets/{Switch-CfTpXW9_.js → Switch-yrTepsdl.js} +1 -1
  28. package/web/dist/assets/{Table-DuOLbyJQ.js → Table-CXAcZ8Ru.js} +1 -1
  29. package/web/dist/assets/TaskDetail-CHwHgfZq.js +2 -0
  30. package/web/dist/assets/Work-Corw0ITh.js +1 -0
  31. package/web/dist/assets/api-Bux34u4-.js +1 -0
  32. package/web/dist/assets/{dist-Bdqp1ixJ.js → dist-CgGno8kE.js} +1 -1
  33. package/web/dist/assets/index-B3_4_qY6.js +2 -0
  34. package/web/dist/assets/index-Cu5neZGw.css +2 -0
  35. package/web/dist/index.html +6 -5
  36. package/web/dist/assets/AlertDialog-CfeiyMrc.js +0 -51
  37. package/web/dist/assets/ChannelDetail-DnL0_h8q.js +0 -1
  38. package/web/dist/assets/Chat-Dv_Izjx3.js +0 -1
  39. package/web/dist/assets/EnvVarEditor-C-gErAzC.js +0 -1
  40. package/web/dist/assets/EventDefDetail-BhJZGNlX.js +0 -1
  41. package/web/dist/assets/Events-DnNZ9-BN.js +0 -1
  42. package/web/dist/assets/Evolution-BBWmrrnr.js +0 -6
  43. package/web/dist/assets/GoalDetail-uqWQCOj3.js +0 -1
  44. package/web/dist/assets/Goals-CylKmR9j.js +0 -1
  45. package/web/dist/assets/Memories-CrBTujU7.js +0 -1
  46. package/web/dist/assets/Plugins-VKUSUcSE.js +0 -1
  47. package/web/dist/assets/Settings-DW1jmrNj.js +0 -1
  48. package/web/dist/assets/TaskDetail-CwJ_UKgt.js +0 -2
  49. package/web/dist/assets/Work-DVdWNBEm.js +0 -1
  50. package/web/dist/assets/index-D4IubNPI.css +0 -2
  51. package/web/dist/assets/index-DYsO5Awn.js +0 -2
  52. /package/web/dist/assets/{NotFound-DitXhq_y.js → NotFound-D-OII_Lp.js} +0 -0
  53. /package/web/dist/assets/{format-CHfBBLog.js → format-BUYXZqDw.js} +0 -0
  54. /package/web/dist/assets/{ui-B_uMx2Fy.js → ui-CerQw0jA.js} +0 -0
  55. /package/web/dist/assets/{useIsMobileLayout-C6KIQjuh.js → useIsMobileLayout-dYzXP1EC.js} +0 -0
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{H as t,S as n,U as r,ct as i,o as a,s as o}from"./vendor-icons-Dk0hMuJz.js";import{t as s}from"./vendor-react-C6faO6LO.js";import{i as c,n as l}from"./dist-Bdqp1ixJ.js";import{t as u}from"./Button-DuQctNms.js";import{i as d}from"./index-DYsO5Awn.js";import{i as f,r as p,t as m}from"./Card-rKfViPS2.js";import{t as h}from"./ui-B_uMx2Fy.js";var g=e(i(),1),_=s(),v=g.forwardRef(({className:e,type:t,...n},r)=>(0,_.jsx)(`input`,{type:t,className:c(`flex h-8 w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none focus:ring-1 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));v.displayName=`Input`;var y=/^[A-Za-z_][A-Za-z0-9_]*$/,b=/key|token|secret|password|credential/i;function x({envVars:e,onSave:i,mode:s,roleId:c,title:x=`Environment Variables`}){let[S,C]=(0,g.useState)([]),[w,T]=(0,g.useState)(!1),[E,D]=(0,g.useState)(new Set),[O,k]=(0,g.useState)([]),[A,j]=(0,g.useState)(!1);(0,g.useEffect)(()=>{C(Object.entries(e??{}).map(([e,t])=>({key:e,value:t,isNew:!1})))},[e]);let M=(0,g.useCallback)(async()=>{try{let e=await l(s===`global`?`/config/env-diff`:`/roles/${c}/env-diff`);k(s===`global`?e.diffs.filter(e=>e.configPath?.startsWith(`defaults.env.`)):e.diffs),j(e.envFileExists)}catch{}},[s,c]);(0,g.useEffect)(()=>{M()},[M]);let N=()=>{let t=Object.fromEntries(S.filter(e=>e.key.trim()).map(e=>[e.key,e.value]));return JSON.stringify(t)!==JSON.stringify(e)},P=()=>{C(e=>[...e,{key:``,value:``,isNew:!0}])},F=e=>{C(t=>t.filter((t,n)=>n!==e))},I=(e,t,n)=>{C(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r))},L=e=>{D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},R=()=>{let e=new Set;for(let t of S){let n=t.key.trim();if(n){if(!y.test(n))return`Invalid key format: "${n}"`;if(n.startsWith(`ANTHROPIC_`))return`ANTHROPIC_* keys are managed in the Anthropic section`;if(e.has(n))return`Duplicate key: "${n}"`;e.add(n)}}return e.size>100?`Maximum 100 environment variables`:null},z=async()=>{let e=R();if(e){d.error(e);return}T(!0);try{let e={};for(let t of S){let n=t.key.trim();n&&(e[n]=t.value)}s===`global`?await l(`/config/env`,{method:`PUT`,body:JSON.stringify(e)}):await l(`/roles/${c}`,{method:`PATCH`,body:JSON.stringify({envVars:e})}),d.success(`Environment variables saved`),i(),M()}catch(e){d.error(e instanceof Error?e.message:`Failed to save`)}finally{T(!1)}},B=async()=>{try{await l(s===`global`?`/config/sync-to-env`:`/roles/${c}/sync-to-env`,{method:`POST`}),d.success(`Synced DB to .env`),M()}catch(e){d.error(e instanceof Error?e.message:`Sync failed`)}},V=async()=>{try{await l(s===`global`?`/config/load-from-env`:`/roles/${c}/load-from-env`,{method:`POST`}),d.success(`Loaded .env to DB`),i(),M()}catch(e){d.error(e instanceof Error?e.message:`Load failed`)}};return(0,_.jsxs)(m,{children:[(0,_.jsxs)(p,{children:[(0,_.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsx)(f,{className:`text-sm`,children:x}),(0,_.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,_.jsxs)(u,{variant:`ghost`,size:`sm`,onClick:P,children:[(0,_.jsx)(n,{size:h.sm}),`Add`]}),N()&&(0,_.jsx)(u,{size:`sm`,onClick:()=>void z(),disabled:w,children:w?`Saving...`:`Save`})]})]}),s===`global`&&(0,_.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mt-1`,children:`ANTHROPIC_* variables are managed in the Anthropic section above.`})]}),O.length>0&&A&&(0,_.jsx)(`div`,{className:`mx-4 mb-3 rounded border border-[var(--app-warning-soft-border)] bg-[var(--app-warning-soft-bg)] p-3`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,_.jsx)(a,{size:14,className:`text-[var(--app-warning)]`}),(0,_.jsxs)(`span`,{className:`text-xs text-[var(--app-warning)]`,children:[`.env and DB differ on `,O.length,` key(s): `,O.map(e=>e.envKey).join(`, `)]})]}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-end`,children:[(0,_.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void B(),children:`DB → .env`}),(0,_.jsx)(u,{variant:`ghost`,size:`sm`,className:`text-xs`,onClick:()=>void V(),children:`.env → DB`})]})]})}),(0,_.jsxs)(`div`,{className:`px-4 pb-4 space-y-2`,children:[S.length===0&&(0,_.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] py-2`,children:`No environment variables configured.`}),S.map((e,n)=>{let i=b.test(e.key),a=E.has(e.key)||e.isNew;return(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center`,children:[(0,_.jsx)(v,{className:`w-full font-mono text-xs md:w-48`,placeholder:`KEY_NAME`,value:e.key,onChange:e=>I(n,`key`,e.target.value)}),(0,_.jsx)(`span`,{className:`hidden text-[var(--app-text-subtle)] md:inline`,children:`=`}),(0,_.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,_.jsx)(v,{className:`font-mono text-xs pr-8`,type:i&&!a?`password`:`text`,placeholder:`value`,value:e.value,onChange:e=>I(n,`value`,e.target.value)}),i&&(0,_.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,onClick:()=>L(e.key),children:a?(0,_.jsx)(r,{size:12}):(0,_.jsx)(t,{size:12})})]}),(0,_.jsx)(u,{variant:`ghost`,size:`sm`,className:`self-end text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)] md:self-auto`,onClick:()=>F(n),children:(0,_.jsx)(o,{size:14})})]},n)})]})]})}export{x as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{at as t,ct as n,y as r}from"./vendor-icons-Dk0hMuJz.js";import{d as i,f as a,t as o}from"./vendor-react-C6faO6LO.js";import{n as s}from"./dist-Bdqp1ixJ.js";import{t as c}from"./Button-DuQctNms.js";import{i as l,t as u}from"./index-DYsO5Awn.js";import{t as d}from"./Card-rKfViPS2.js";import{t as f}from"./SectionHeader-C2WpiwJ5.js";import{t as p}from"./EmptyState-CIdIlMbn.js";import{a as m,i as h,n as g,o as _,r as v,t as y}from"./Table-DuOLbyJQ.js";var b=e(n(),1),x=o(),S={webhook:`info`,directory_watch:`warning`,cron:`success`,manual:`muted`},C={running:`info`,completed:`success`,failed:`destructive`,partial:`warning`,cancelled:`muted`};function w(){let{id:e}=a(),n=i(),[o,w]=(0,b.useState)(null),[T,E]=(0,b.useState)(!0),[D,O]=(0,b.useState)([]),[k,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(0),[N,P]=(0,b.useState)(!1),[F,I]=(0,b.useState)([]),[L,R]=(0,b.useState)(!1),[z,B]=(0,b.useState)(0),[V,H]=(0,b.useState)(!1),[U,W]=(0,b.useState)(`config`),G=(0,b.useCallback)(async()=>{if(e){E(!0);try{w(await s(`/event-defs/${e}`))}catch{l.error(`Event not found`),n(`/events`)}finally{E(!1)}}},[e,n]),K=(0,b.useCallback)(async(t=0)=>{if(e){A(!0);try{let n=t===0?void 0:new Date(Date.now()-10080*60*1e3).toISOString(),r=await s(`/event-defs/${e}/firings?${new URLSearchParams({limit:`20`,...n?{since:n}:{}})}`);O(t===0?r:e=>[...e,...r]),P(r.length===20),M(t)}catch{l.error(`Failed to load firings`)}finally{A(!1)}}},[e]);(0,b.useEffect)(()=>{G()},[G]),(0,b.useEffect)(()=>{U===`firings`&&D.length===0&&K(0)},[U,K,D.length]);let q=(0,b.useCallback)(async(t=0)=>{if(e){R(!0);try{let n=await s(`/event-defs/${e}/dispatches?${new URLSearchParams({limit:`20`,offset:String(t*20)})}`);I(t===0?n:e=>[...e,...n]),H(n.length===20),B(t)}catch{l.error(`Failed to load dispatches`)}finally{R(!1)}}},[e]);return(0,b.useEffect)(()=>{U===`dispatches`&&F.length===0&&q(0)},[U,q,F.length]),T?(0,x.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,x.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):o?(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,x.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>n(`/events`),children:(0,x.jsx)(t,{size:14})}),(0,x.jsx)(f,{title:o.name,description:o.description,compact:!0,action:(0,x.jsx)(`div`,{className:`flex gap-2`,children:(0,x.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>void G(),children:(0,x.jsx)(r,{size:14})})})})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,x.jsx)(u,{variant:S[o.sourceType],children:o.sourceType===`directory_watch`?`file watcher`:o.sourceType}),(0,x.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs font-medium ${o.enabled?`bg-green-900/30 text-green-400`:`bg-gray-800/30 text-gray-400`}`,children:o.enabled?`Enabled`:`Disabled`}),(0,x.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`Created `,new Date(o.createdAt).toLocaleDateString()]})]}),o.sourceType===`webhook`&&(0,x.jsxs)(d,{className:`space-y-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Webhook URL`}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`code`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-3 py-1.5 font-mono text-xs text-[var(--app-text)] break-all`,children:[window.location.origin,`/webhooks/events/`,o.id]}),(0,x.jsx)(c,{size:`sm`,variant:`ghost`,onClick:()=>{if(!o)return;let e=`${window.location.origin}/webhooks/events/${o.id}`;navigator.clipboard.writeText(e),l.success(`Webhook URL copied to clipboard`)},children:`Copy`})]}),(0,x.jsxs)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`Send a POST request with JSON body: `,(0,x.jsx)(`code`,{className:`rounded bg-[var(--app-panel)] px-1`,children:`{ "type": "event.name", "payload": {...} }`})]})]}),(()=>{let e=o.sourceConfig?.cron;return e?(0,x.jsxs)(d,{className:`space-y-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Schedule`}),(0,x.jsx)(`code`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-3 py-1.5 font-mono text-sm text-[var(--app-text)]`,children:e})]}):null})(),(()=>{let e=o.sourceConfig?.path;return e?(0,x.jsxs)(d,{className:`space-y-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Watch Directory`}),(0,x.jsx)(`code`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-3 py-1.5 font-mono text-sm text-[var(--app-text)] break-all`,children:e})]}):null})(),(0,x.jsxs)(`div`,{className:`flex gap-1 border-b border-[var(--app-border)]`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>W(`config`),className:`px-4 py-2 text-sm transition-colors ${U===`config`?`border-b-2 border-[var(--app-accent)] text-[var(--app-text)]`:`text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Configuration`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>W(`firings`),className:`px-4 py-2 text-sm transition-colors ${U===`firings`?`border-b-2 border-[var(--app-accent)] text-[var(--app-text)]`:`text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Firings`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>W(`dispatches`),className:`px-4 py-2 text-sm transition-colors ${U===`dispatches`?`border-b-2 border-[var(--app-accent)] text-[var(--app-text)]`:`text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Dispatches`})]}),U===`firings`&&(0,x.jsx)(d,{padding:!1,children:k&&D.length===0?(0,x.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,x.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):D.length===0?(0,x.jsx)(p,{icon:(0,x.jsx)(r,{size:32}),title:`No firings yet`,description:`This event has not been triggered yet.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(y,{children:[(0,x.jsx)(m,{children:(0,x.jsxs)(_,{children:[(0,x.jsx)(h,{children:`Occurred At`}),(0,x.jsx)(h,{children:`Type`}),(0,x.jsx)(h,{children:`Source`}),(0,x.jsx)(h,{children:`Confidence`}),(0,x.jsx)(h,{children:`Payload`})]})}),(0,x.jsx)(g,{children:D.map(e=>(0,x.jsxs)(_,{children:[(0,x.jsx)(v,{className:`text-xs text-[var(--app-text-muted)] whitespace-nowrap`,children:new Date(e.occurredAt).toLocaleString()}),(0,x.jsx)(v,{children:(0,x.jsx)(`code`,{className:`text-xs font-mono text-[var(--app-text)]`,children:e.type})}),(0,x.jsx)(v,{className:`text-xs text-[var(--app-text-muted)]`,children:e.source}),(0,x.jsx)(v,{className:`text-xs`,children:(0,x.jsx)(`span`,{className:e.confidence<1?`text-yellow-400`:`text-[var(--app-text-muted)]`,children:e.confidence})}),(0,x.jsx)(v,{className:`max-w-[200px]`,children:(0,x.jsxs)(`code`,{className:`text-xs font-mono text-[var(--app-text-muted)] truncate block`,children:[JSON.stringify(e.payload).slice(0,60),JSON.stringify(e.payload).length>60?`...`:``]})})]},e.id))})]}),N&&(0,x.jsx)(`div`,{className:`flex justify-center p-3 border-t border-[var(--app-border)]`,children:(0,x.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>void K(j+1),disabled:k,children:k?`Loading...`:`Load more`})})]})}),U===`dispatches`&&(0,x.jsx)(d,{padding:!1,children:L&&F.length===0?(0,x.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,x.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):F.length===0?(0,x.jsx)(p,{icon:(0,x.jsx)(r,{size:32}),title:`No dispatches yet`,description:`No task template has been dispatched from this event. Bind a template (trigger=event, eventDefId=this event) to see dispatch history.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(y,{children:[(0,x.jsx)(m,{children:(0,x.jsxs)(_,{children:[(0,x.jsx)(h,{children:`Started At`}),(0,x.jsx)(h,{children:`Template`}),(0,x.jsx)(h,{children:`Status`}),(0,x.jsx)(h,{children:`Duration`}),(0,x.jsx)(h,{children:`Error`})]})}),(0,x.jsx)(g,{children:F.map(e=>{let t=e.completedAt?`${e.completedAt-e.startedAt}ms`:`—`;return(0,x.jsxs)(_,{children:[(0,x.jsx)(v,{className:`text-xs text-[var(--app-text-muted)] whitespace-nowrap`,children:new Date(e.startedAt).toLocaleString()}),(0,x.jsx)(v,{children:(0,x.jsx)(`button`,{type:`button`,onClick:()=>n(`/templates/${e.templateId}`),className:`text-[var(--app-text)] hover:text-[var(--app-accent)] transition-colors text-left`,children:e.templateName??e.templateId})}),(0,x.jsx)(v,{children:(0,x.jsx)(u,{variant:C[e.status],children:e.status})}),(0,x.jsx)(v,{className:`text-xs text-[var(--app-text-muted)]`,children:t}),(0,x.jsx)(v,{className:`max-w-[300px]`,children:e.error?(0,x.jsx)(`code`,{className:`text-xs font-mono text-[var(--app-danger)] truncate block`,title:e.error,children:e.error.length>80?`${e.error.slice(0,80)}…`:e.error}):(0,x.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`—`})})]},e.executionId)})})]}),V&&(0,x.jsx)(`div`,{className:`flex justify-center p-3 border-t border-[var(--app-border)]`,children:(0,x.jsx)(c,{variant:`ghost`,size:`sm`,onClick:()=>void q(z+1),disabled:L,children:L?`Loading...`:`Load more`})})]})})]}):null}export{w as EventDefDetail};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{E as t,S as n,T as ee,ct as r,s as te,t as ne,y as re}from"./vendor-icons-Dk0hMuJz.js";import{d as ie,t as i}from"./vendor-react-C6faO6LO.js";import{n as a}from"./dist-Bdqp1ixJ.js";import{a as ae,c as oe,i as o,n as s,o as c,r as l,s as u,t as d}from"./AlertDialog-CfeiyMrc.js";import{t as f}from"./Button-DuQctNms.js";import{i as p,t as se}from"./index-DYsO5Awn.js";import{t as m}from"./Card-rKfViPS2.js";import{t as ce}from"./SectionHeader-C2WpiwJ5.js";import{a as le}from"./format-CHfBBLog.js";import{t as ue}from"./EmptyState-CIdIlMbn.js";import{a as de,i as h,n as fe,o as g,r as _,t as pe}from"./Table-DuOLbyJQ.js";import{t as me}from"./Switch-CfTpXW9_.js";var v=e(r(),1),y=i(),he={webhook:`info`,directory_watch:`warning`,cron:`success`,manual:`muted`};function b(e){let t=e.trim().split(/\s+/);return t.length===5?t.every(e=>/^(\*|(\*\/)?\d+(-\d+)?(,\d+(-\d+)?)*)$/.test(e)):!1}function x(){let e=ie(),[r,i]=(0,v.useState)([]),[x,ge]=(0,v.useState)(!0),[_e,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(``),[T,ve]=(0,v.useState)(`webhook`),[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)(``),[P,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(null),[R,ye]=(0,v.useState)(``),[z,B]=(0,v.useState)(``),[V,be]=(0,v.useState)(`webhook`),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(``),[xe,K]=(0,v.useState)(``),[Se,q]=(0,v.useState)(!1),[J,Y]=(0,v.useState)(null),[X,Z]=(0,v.useState)(null),[Q,Ce]=(0,v.useState)(``),[we,Te]=(0,v.useState)(!1),$=(0,v.useCallback)(async()=>{ge(!0);try{i(await a(`/event-defs`))}catch{p.error(`Failed to load events`)}finally{ge(!1)}},[]);(0,v.useEffect)(()=>{$()},[$]);let Ee=async()=>{if(C.trim()){if(T===`cron`&&!b(A)){N(`Invalid cron expression (expected 5 fields: minute hour day month weekday)`);return}F(!0);try{let e={name:C.trim(),sourceType:T,description:E.trim()||void 0,enabled:!0};T===`directory_watch`&&O.trim()?e.sourceConfig={path:O.trim(),stability_delay_ms:5e3}:T===`cron`&&A.trim()&&(e.sourceConfig={cron:A.trim()}),await a(`/event-defs`,{method:`POST`,body:JSON.stringify(e)}),w(``),D(``),k(``),j(``),N(``),S(!1),$(),p.success(`Event created`)}catch(e){let t=e instanceof Error?e.message:`Failed to create event`;p.error(t)}finally{F(!1)}}},De=e=>{L(e.id),ye(e.name),B(e.description??``),be(e.sourceType),U(e.sourceConfig?.path??``),G(e.sourceConfig?.cron??``),K(``)},Oe=async()=>{if(!(!I||!R.trim())){if(V===`cron`&&!b(W)){K(`Invalid cron expression`);return}q(!0);try{let e={name:R.trim(),description:z.trim()||void 0};V===`directory_watch`?e.sourceConfig={path:H.trim(),stability_delay_ms:5e3}:V===`cron`&&(e.sourceConfig={cron:W.trim()}),await a(`/event-defs/${I}`,{method:`PATCH`,body:JSON.stringify(e)}),L(null),$(),p.success(`Event updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update event`;p.error(t)}finally{q(!1)}}},ke=async e=>{try{await a(`/event-defs/${e.id}`,{method:`PATCH`,body:JSON.stringify({enabled:!e.enabled})}),$()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle`;p.error(t)}},Ae=async e=>{try{await a(`/event-defs/${e}`,{method:`DELETE`}),Y(null),$(),p.success(`Event deleted`)}catch(e){let t=e instanceof Error?e.message:`Failed to delete`;p.error(t)}},je=async e=>{Te(!0);try{let t={};if(Q.trim())try{t.payload=JSON.parse(Q)}catch{t.payload={raw:Q}}await a(`/event-defs/${e}/fire`,{method:`POST`,body:JSON.stringify(t)}),Z(null),Ce(``),p.success(`Event fired`)}catch(e){let t=e instanceof Error?e.message:`Failed to fire event`;p.error(t)}finally{Te(!1)}},Me=r.find(e=>e.id===J);return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(ce,{title:`Events`,description:`Event definitions that trigger automations. Configure webhooks, schedules, or file watchers.`,compact:!0,action:(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>void $(),children:(0,y.jsx)(re,{size:14})}),(0,y.jsxs)(f,{size:`sm`,onClick:()=>S(!_e),children:[(0,y.jsx)(n,{size:14}),`New Event`]})]})}),_e&&(0,y.jsxs)(m,{className:`space-y-3`,children:[(0,y.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`New Event`}),(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Event name`,value:C,onChange:e=>w(e.target.value)}),(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Description (optional)`,value:E,onChange:e=>D(e.target.value)}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Source:`}),(0,y.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:T,onChange:e=>ve(e.target.value),children:[(0,y.jsx)(`option`,{value:`webhook`,children:`Webhook (HTTP)`}),(0,y.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,y.jsx)(`option`,{value:`directory_watch`,children:`File Watcher`}),(0,y.jsx)(`option`,{value:`manual`,children:`Manual`})]})]}),T===`directory_watch`&&(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Watch directory path (absolute)`,value:O,onChange:e=>k(e.target.value)}),T===`cron`&&(0,y.jsxs)(`div`,{className:`space-y-1`,children:[(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Cron expression (minute hour day month weekday)`,value:A,onChange:e=>{j(e.target.value),N(``)}}),M&&(0,y.jsx)(`p`,{className:`text-xs text-[var(--app-danger)]`,children:M})]}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(f,{onClick:()=>void Ee(),disabled:P||!C.trim()||T===`directory_watch`&&!O.trim(),children:P?`Creating...`:`Create`}),(0,y.jsx)(f,{variant:`ghost`,onClick:()=>S(!1),children:`Cancel`})]})]}),I!==null&&(r.find(e=>e.id===I)?(0,y.jsxs)(m,{className:`space-y-3`,children:[(0,y.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Edit Event`}),(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Event name`,value:R,onChange:e=>ye(e.target.value)}),(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)]`,placeholder:`Description (optional)`,value:z,onChange:e=>B(e.target.value)}),V===`directory_watch`&&(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)]`,placeholder:`Watch directory path`,value:H,onChange:e=>U(e.target.value)}),V===`cron`&&(0,y.jsxs)(`div`,{className:`space-y-1`,children:[(0,y.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)]`,placeholder:`Cron expression`,value:W,onChange:e=>{G(e.target.value),K(``)}}),xe&&(0,y.jsx)(`p`,{className:`text-xs text-[var(--app-danger)]`,children:xe})]}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(f,{onClick:()=>void Oe(),disabled:Se||!R.trim(),children:Se?`Saving...`:`Save`}),(0,y.jsx)(f,{variant:`ghost`,onClick:()=>L(null),children:`Cancel`})]})]}):null),(0,y.jsx)(m,{padding:!1,children:x?(0,y.jsx)(`div`,{className:`flex items-center justify-center p-8`,children:(0,y.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):r.length===0?(0,y.jsx)(ue,{icon:(0,y.jsx)(ne,{size:32}),title:`No events`,description:`Events are triggered by webhooks, schedules, or file changes and can start automations.`}):(0,y.jsxs)(pe,{children:[(0,y.jsx)(de,{children:(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{children:`Name`}),(0,y.jsx)(h,{children:`Source`}),(0,y.jsx)(h,{children:`Enabled`}),(0,y.jsx)(h,{children:`Last Fired`}),(0,y.jsx)(h,{children:`Actions`})]})}),(0,y.jsx)(fe,{children:r.map(n=>(0,y.jsxs)(g,{children:[(0,y.jsxs)(_,{children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>e(`/events/${n.id}`),className:`font-medium text-[var(--app-text)] hover:text-[var(--app-accent)] transition-colors text-left`,children:n.name}),n.description&&(0,y.jsx)(`div`,{className:`text-xs text-[var(--app-text-muted)] truncate max-w-[200px]`,children:n.description})]}),(0,y.jsx)(_,{children:(0,y.jsx)(se,{variant:he[n.sourceType],children:n.sourceType===`directory_watch`?`file watcher`:n.sourceType})}),(0,y.jsx)(_,{children:(0,y.jsx)(me,{checked:n.enabled,onCheckedChange:()=>void ke(n),"aria-label":`Toggle ${n.name}`})}),(0,y.jsx)(_,{className:`text-xs text-[var(--app-text-muted)]`,children:n.lastFiredAt?le(n.lastFiredAt):`—`}),(0,y.jsx)(_,{children:(0,y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,y.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>De(n),title:`Edit`,children:(0,y.jsx)(t,{size:12})}),n.sourceType===`manual`&&n.enabled&&(0,y.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>Z(n.id),title:`Fire now`,children:(0,y.jsx)(ee,{size:12})}),(0,y.jsx)(f,{variant:`ghost`,size:`sm`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>Y(n.id),title:`Delete`,children:(0,y.jsx)(te,{size:12})})]})})]},n.id))})]})}),(0,y.jsx)(d,{open:X!==null,onOpenChange:e=>{e||Z(null)},children:(0,y.jsxs)(o,{children:[(0,y.jsxs)(u,{children:[(0,y.jsx)(oe,{children:`Fire Event`}),(0,y.jsx)(ae,{children:`Fire the manual event immediately. Optionally provide a JSON payload.`})]}),(0,y.jsx)(`textarea`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder='{}' focus:border-[var(--app-accent)] focus:outline-none font-mono`,rows:4,placeholder:`{"key": "value"}`,value:Q,onChange:e=>Ce(e.target.value)}),(0,y.jsxs)(c,{children:[(0,y.jsx)(l,{children:`Cancel`}),(0,y.jsx)(s,{onClick:()=>{X&&je(X),Z(null)},disabled:we,children:we?`Firing...`:`Fire Event`})]})]})}),(0,y.jsx)(d,{open:J!==null,onOpenChange:e=>{e||Y(null)},children:(0,y.jsxs)(o,{children:[(0,y.jsxs)(u,{children:[(0,y.jsx)(oe,{children:`Delete Event`}),(0,y.jsxs)(ae,{children:[`Delete “`,Me?.name,`”? This action cannot be undone.`]})]}),(0,y.jsxs)(c,{children:[(0,y.jsx)(l,{children:`Cancel`}),(0,y.jsx)(s,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger)]`,onClick:()=>{J&&Ae(J)},children:`Delete`})]})]})})]})}export{x as Events};
@@ -1,6 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t,y as n,z as r}from"./vendor-icons-Dk0hMuJz.js";import{t as i}from"./vendor-react-C6faO6LO.js";import{n as a}from"./dist-Bdqp1ixJ.js";import{t as o}from"./Button-DuQctNms.js";import{r as s,t as c}from"./index-DYsO5Awn.js";import{t as l}from"./Card-rKfViPS2.js";import{t as u}from"./PageHeader-CHSgtxPw.js";import{a as d}from"./format-CHfBBLog.js";import{t as f}from"./EmptyState-CIdIlMbn.js";var p=e(t(),1),m=i();function h(){let e=s(e=>e.roles),t=s(e=>e.fetchRoles),[i,h]=(0,p.useState)([]),[g,_]=(0,p.useState)(!0),[v,y]=(0,p.useState)(`all`);(0,p.useEffect)(()=>{t()},[t]);let b=(0,p.useCallback)(async()=>{_(!0);try{let e=new URLSearchParams({limit:`50`});v!==`all`&&e.set(`roleId`,v),h(await a(`/evolution-audit?${e}`))}catch{h([])}finally{_(!1)}},[v]);(0,p.useEffect)(()=>{b()},[b]);let x=t=>t?e.find(e=>e.id===t)?.name??t.slice(0,8):`System`;return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsx)(u,{eyebrow:`Learning`,title:`Evolution Audit`,compact:!0,description:`Rule mutations and diagnostic reports across roles.`,metrics:[{label:`Visible`,value:i.length},{label:`Role Filter`,value:v===`all`?`All`:x(v)},{label:`Catalog`,value:e.length}],actions:(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsxs)(`select`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:v,onChange:e=>y(e.target.value),children:[(0,m.jsx)(`option`,{value:`all`,children:`All roles`}),e.map(e=>(0,m.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,m.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:(0,m.jsx)(n,{size:14})})]})}),(0,m.jsx)(l,{children:g?(0,m.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,m.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):i.length===0?(0,m.jsx)(f,{icon:(0,m.jsx)(r,{size:32}),title:`No evolution records`,description:`Evolution occurs when roles accumulate enough task experience.`,className:`py-8`}):(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[i.length,` records`]}),i.map(e=>(0,m.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] p-3`,children:[(0,m.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,m.jsx)(c,{variant:`info`,children:x(e.roleId)}),(0,m.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:d(e.timestamp)}),e.triggerTaskId&&(0,m.jsxs)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:[`triggered by task `,e.triggerTaskId.slice(0,8)]})]}),e.diff.includes(`--- Diagnostic Report ---`)?(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`rounded bg-[var(--app-canvas)] p-2`,children:[(0,m.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-[var(--app-text-muted)]`,children:`Diagnostic Report`}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-[var(--app-text-muted)]`,children:e.diff.split(`--- Rules Diff ---`)[0]?.replace(`--- Diagnostic Report ---
2
- `,``).trim()})]}),(0,m.jsxs)(`div`,{className:`rounded bg-[var(--app-canvas)] p-2`,children:[(0,m.jsx)(`p`,{className:`mb-1 text-[10px] font-medium text-[var(--app-text-muted)]`,children:`Rules Changes`}),(0,m.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap font-mono text-xs`,children:(e.diff.split(`--- Rules Diff ---`)[1]??``).trim().split(`
3
- `).map((e,t)=>(0,m.jsxs)(`span`,{className:e.startsWith(`+`)?`text-[var(--app-success)]`:e.startsWith(`-`)?`text-[var(--app-danger)]`:`text-[var(--app-text-muted)]`,children:[e,`
4
- `]},t))})]})]}):(0,m.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded bg-[var(--app-canvas)] p-2 font-mono text-xs`,children:e.diff.split(`
5
- `).map((e,t)=>(0,m.jsxs)(`span`,{className:e.startsWith(`+`)?`text-[var(--app-success)]`:e.startsWith(`-`)?`text-[var(--app-danger)]`:`text-[var(--app-text-muted)]`,children:[e,`
6
- `]},t))})]},e.id))]})})]})}export{h as Evolution};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{I as t,K as n,at as r,ct as i,l as a,q as o}from"./vendor-icons-Dk0hMuJz.js";import{f as s,r as c,t as l}from"./vendor-react-C6faO6LO.js";import{n as u}from"./dist-Bdqp1ixJ.js";import{t as d}from"./index-DYsO5Awn.js";import{i as f,r as p,t as m}from"./Card-rKfViPS2.js";import{t as h}from"./PageHeader-CHSgtxPw.js";import{t as g}from"./SectionHeader-C2WpiwJ5.js";import{n as _}from"./format-CHfBBLog.js";var v=e(i(),1),y=l();function b(){let{id:e}=s(),[i,l]=(0,v.useState)(null),[b,S]=(0,v.useState)([]),[C,w]=(0,v.useState)(null);if((0,v.useEffect)(()=>{e&&(async()=>{try{let t=await u(`/goals/${e}`);l(t.goal),w(null);try{S((await u(`/strategies?role=${t.goal.roleId}`)).strategies??[])}catch{}}catch(e){w(e instanceof Error?e.message:`Failed to load goal`)}})()},[e]),C)return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(r,{size:14}),` Back to Goals`]}),(0,y.jsx)(m,{className:`text-center text-[var(--app-danger)]`,children:C})]});if(!i)return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(r,{size:14}),` Back to Goals`]}),(0,y.jsx)(m,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let T=i.targetValue>0?Math.min(100,i.currentValue/i.targetValue*100):0,E=i.deadline>0&&i.deadline<Date.now()&&i.status!==`completed`;return(0,y.jsxs)(`div`,{className:`space-y-5`,children:[(0,y.jsxs)(c,{to:`/goals`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,y.jsx)(r,{size:14}),` Back to Goals`]}),(0,y.jsx)(h,{eyebrow:`Goal`,title:i.name,compact:!0,description:i.description||`Progress, delivery targets, and strategy support before raw metrics.`,metrics:[{label:`Status`,value:(0,y.jsx)(d,{variant:(e=>e===`completed`?`success`:e===`executing`||e===`evaluating`?`warning`:e===`failed`?`destructive`:`secondary`)(i.status),children:i.status})},{label:`Role`,value:i.roleId},{label:`Metric`,value:i.metricType},{label:`Progress`,value:`${T.toFixed(1)}%`}]}),(0,y.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:[(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Goal ID`}),(0,y.jsx)(`p`,{className:`mt-2 truncate font-mono text-sm text-[var(--app-text)]`,children:i.id})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Current delta`}),(0,y.jsx)(`p`,{className:`mt-2 text-2xl font-semibold text-[var(--app-text)]`,children:Math.max(i.targetValue-i.currentValue,0)})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Strategies in play`}),(0,y.jsx)(`p`,{className:`mt-2 text-2xl font-semibold text-[var(--app-text)]`,children:b.length})]}),(0,y.jsxs)(m,{className:`surface-panel-muted`,children:[(0,y.jsx)(`p`,{className:`text-section-label`,children:`Deadline state`}),(0,y.jsx)(`p`,{className:`mt-2 text-sm font-medium ${E?`text-[var(--app-danger-soft-text)]`:`text-[var(--app-text)]`}`,children:E?`Overdue`:`On track`})]})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(x,{icon:a,label:`Progress`,value:`${i.currentValue} / ${i.targetValue}`}),(0,y.jsx)(x,{icon:o,label:E?`Overdue`:`Deadline`,value:_(i.deadline),mono:!0}),(0,y.jsx)(x,{icon:n,label:`Budget`,value:`$${i.budgetUsd.toFixed(2)}`}),(0,y.jsx)(x,{icon:t,label:`Created`,value:_(i.createdAt),mono:!0})]}),(0,y.jsx)(g,{title:`Progress`,compact:!0,description:`Completion first, then delivery targets and strategy support.`}),(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsx)(f,{children:`Progress`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`div`,{className:`flex-1 h-3 rounded-full bg-[var(--app-panel-muted)] overflow-hidden`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] ${E?`bg-[var(--app-danger)]`:`bg-[var(--app-accent)]`}`,style:{width:`${T}%`}})}),(0,y.jsxs)(`span`,{className:`text-sm text-[var(--app-text)] font-mono`,children:[T.toFixed(1),`%`]})]}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-[var(--app-text-subtle)]`,children:[(0,y.jsxs)(`span`,{children:[i.currentValue,` current`]}),(0,y.jsxs)(`span`,{children:[i.targetValue,` target`]})]})]}),(i.deliverTo??[]).length>0&&(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsx)(f,{children:`Delivery Targets`})}),(0,y.jsx)(`div`,{className:`space-y-1.5`,children:(i.deliverTo??[]).map((e,t)=>(0,y.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:e.type===`channel`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{variant:`outline`,children:`Channel`}),(0,y.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,y.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{variant:`outline`,children:`Session`}),(0,y.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Chat session`})]})},t))})]}),b.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(g,{title:`Strategy Support`,compact:!0,description:`Strategy candidates already associated with the goal's role.`}),(0,y.jsxs)(m,{children:[(0,y.jsx)(p,{children:(0,y.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,y.jsx)(t,{size:14}),` Strategies (`,b.length,`)`]})}),(0,y.jsx)(`div`,{className:`space-y-2`,children:b.map(e=>(0,y.jsxs)(`div`,{className:`flex items-center justify-between text-sm border-b border-[var(--app-border)] pb-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),(0,y.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.taskType})]}),(0,y.jsxs)(d,{variant:`outline`,children:[e.trialCount,` trials`]})]},e.id))})]})]})]})}function x({icon:e,label:t,value:n,mono:r}){return(0,y.jsxs)(m,{className:`flex flex-col gap-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[var(--app-text-subtle)]`,children:[(0,y.jsx)(e,{size:12}),(0,y.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,y.jsx)(`span`,{className:`text-sm text-[var(--app-text)] truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{b as GoalDetail};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,E as n,S as r,T as i,ct as a,l as o,n as s,s as c,y as l}from"./vendor-icons-Dk0hMuJz.js";import{t as u}from"./vendor-react-C6faO6LO.js";import{n as d}from"./dist-Bdqp1ixJ.js";import{a as f,c as p,i as m,l as h,n as ee,o as g,r as _,s as te,t as v}from"./AlertDialog-CfeiyMrc.js";import{t as y}from"./Button-DuQctNms.js";import{i as b,n as x,r as S,t as C}from"./index-DYsO5Awn.js";import{i as ne,r as re,t as w}from"./Card-rKfViPS2.js";import{t as T}from"./PageHeader-CHSgtxPw.js";import{n as E,t as D}from"./format-CHfBBLog.js";import{t as O}from"./EmptyState-CIdIlMbn.js";var k=e(a(),1),A=u();function j({value:e,onChange:t,label:n=`Delivery Targets`}){let[r,i]=(0,k.useState)([]),[a,o]=(0,k.useState)(!1);(0,k.useEffect)(()=>{let e=!1;return Promise.all([d(`/channels`).catch(()=>({channels:[]})),d(`/chat/sessions`).catch(()=>({sessions:[]}))]).then(([t,n])=>{if(e)return;let r=new Map(t.channels.map(e=>[e.id,e])),a=[];for(let e of n.sessions)if(e.source.type===`channel`&&e.source.channelId&&e.source.chatId){let t=r.get(e.source.channelId);a.push({id:e.id,channelId:e.source.channelId,channelName:t?.name??e.source.channelId.slice(0,8),platform:t?.platform??`unknown`,chatId:e.source.chatId})}let o=new Set;i(a.filter(e=>{let t=`${e.channelId}:${e.chatId}`;return o.has(t)?!1:(o.add(t),!0)}))}),()=>{e=!0}},[]);let s=(t,n)=>e.some(e=>e.type===`channel`&&e.channelId===t&&e.chatId===n),c=(n,r)=>{s(n,r)?t(e.filter(e=>!(e.type===`channel`&&e.channelId===n&&e.chatId===r))):t([...e,{type:`channel`,channelId:n,chatId:r}])},l=e.filter(e=>e.type===`channel`).length;return(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:n}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!a),className:`mt-1 w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-left text-sm text-[var(--app-text)] hover:border-[var(--app-border-strong)] focus:border-[var(--app-accent)] focus:outline-none`,children:l===0?`Default (current session)`:`${l} channel${l>1?`s`:``} selected`}),a&&(0,A.jsxs)(`div`,{className:`absolute z-10 mt-1 w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] py-1 shadow-lg`,children:[r.length===0?(0,A.jsx)(`div`,{className:`px-3 py-2 text-xs text-[var(--app-text-subtle)]`,children:`No active channel conversations. Start a chat on WeChat/Telegram first.`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`px-3 py-1 text-xs text-[var(--app-text-subtle)]`,children:`Channel conversations`}),r.map(e=>(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 px-3 py-1.5 text-xs text-[var(--app-text)] hover:bg-[var(--app-panel-muted)]`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:s(e.channelId,e.chatId),onChange:()=>c(e.channelId,e.chatId),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-muted)]`}),(0,A.jsx)(`span`,{className:`truncate font-medium`,children:e.channelName}),(0,A.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`(`,e.platform,`)`]})]},`${e.channelId}:${e.chatId}`))]}),l>0&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>{t([]),o(!1)},className:`mt-1 w-full border-t border-[var(--app-border)] px-3 py-1 text-left text-xs text-[var(--app-danger)] hover:bg-[var(--app-panel-muted)]`,children:`Clear all`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`w-full border-t border-[var(--app-border)] px-3 py-1 text-left text-xs text-[var(--app-text-subtle)] hover:bg-[var(--app-panel-muted)]`,children:`Done`})]})]})}var M={active:`paused`,paused:`active`,completed:`active`,failed:`active`},N={active:(0,A.jsx)(t,{size:12}),paused:(0,A.jsx)(i,{size:12}),completed:(0,A.jsx)(l,{size:12}),failed:(0,A.jsx)(l,{size:12})};function P(){let e=S(e=>e.goals),t=S(e=>e.fetchGoals),a=S(e=>e.updateGoal),u=S(e=>e.deleteGoal),[P,F]=(0,k.useState)(!1),[I,L]=(0,k.useState)(``),[R,z]=(0,k.useState)(!1),[B,V]=(0,k.useState)(null),[H,U]=(0,k.useState)(null),[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)(``),[J,Y]=(0,k.useState)([]),[X,Z]=(0,k.useState)([]),[Q,ie]=(0,k.useState)([]),[$,ae]=(0,k.useState)([]),oe=e.filter(e=>e.status===`active`).length,se=e.filter(e=>e.status===`paused`).length,ce=e.filter(e=>e.status===`completed`).length;(0,k.useEffect)(()=>{t();let e=setInterval(()=>void t(),1e4);return()=>clearInterval(e)},[t]);let le=async()=>{if(I.trim()){z(!0),V(null);try{await d(`/goals`,{method:`POST`,body:JSON.stringify({input:I.trim(),deliverTo:Q.length>0?Q:void 0,reportTo:$.length>0?$:void 0})}),L(``),F(!1),t()}catch(e){V(e instanceof Error?e.message:`Failed to create goal`)}finally{z(!1)}}};return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsx)(T,{eyebrow:`Operations`,title:`Goals`,compact:!0,description:`Long-running outcomes, budgets, and delivery targets.`,metrics:[{label:`Active`,value:oe},{label:`Paused`,value:se},{label:`Completed`,value:ce}],actions:(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(y,{variant:`ghost`,size:`sm`,onClick:()=>void t(),children:(0,A.jsx)(l,{size:14})}),(0,A.jsxs)(y,{size:`sm`,onClick:()=>F(!P),children:[(0,A.jsx)(r,{size:14}),`New Goal`]})]})}),P&&(0,A.jsxs)(w,{className:`space-y-3`,children:[(0,A.jsx)(`textarea`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-2 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Describe your goal in natural language...`,rows:3,value:I,onChange:e=>L(e.target.value)}),(0,A.jsx)(j,{value:Q,onChange:ie,label:`Deliver To (results)`}),(0,A.jsx)(j,{value:$,onChange:ae,label:`Report To (status)`}),B&&(0,A.jsx)(`p`,{className:`text-xs text-[var(--app-danger)]`,children:B}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(y,{onClick:()=>void le(),disabled:R||!I.trim(),children:R?`Creating...`:`Create`}),(0,A.jsx)(y,{variant:`ghost`,onClick:()=>F(!1),children:`Cancel`})]})]}),e.length===0?(0,A.jsx)(O,{icon:(0,A.jsx)(o,{size:32}),title:`No goals`,description:`Create a goal to start goal-driven task orchestration`}):(0,A.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>{let t=e.targetValue>0?Math.min(100,Math.round(e.currentValue/e.targetValue*100)):0,r=new Date(e.deadline).getTime()<Date.now()&&e.status!==`completed`,o=H===e.id;return(0,A.jsxs)(w,{children:[(0,A.jsxs)(re,{children:[o?(0,A.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:W,onChange:e=>G(e.target.value),autoFocus:!0}):(0,A.jsx)(ne,{className:`max-w-full text-[var(--app-text)] text-sm font-medium truncate sm:max-w-[180px]`,children:e.name}),(0,A.jsx)(C,{variant:x(e.status),children:e.status})]}),o?(0,A.jsx)(`textarea`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none mb-3`,placeholder:`Description...`,rows:2,value:K,onChange:e=>q(e.target.value)}):e.description?(0,A.jsx)(`p`,{className:`text-xs text-[var(--app-text-muted)] mb-3 line-clamp-2`,children:e.description}):null,o&&(0,A.jsxs)(`div`,{className:`mb-3 space-y-2`,children:[(0,A.jsx)(j,{value:J,onChange:Y,label:`Deliver To (results)`}),(0,A.jsx)(j,{value:X,onChange:Z,label:`Report To (status)`})]}),(0,A.jsxs)(`div`,{className:`mb-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,A.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Progress`}),(0,A.jsxs)(`span`,{className:`font-mono text-xs text-[var(--app-text)]`,children:[t,`%`]})]}),(0,A.jsx)(`div`,{className:`h-1.5 rounded-full bg-[var(--app-panel-elevated)]`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full transition-[width] ${t>=100?`bg-[var(--app-success)]`:`bg-[var(--app-accent)]`}`,style:{width:`${t}%`}})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--app-text-subtle)]`,children:[e.currentValue,` / `,e.targetValue]}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--app-text-subtle)]`,children:e.metricType})]})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Role`}),(0,A.jsx)(C,{variant:`muted`,className:`text-[10px]`,children:e.roleId})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Budget`}),(0,A.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:D(e.budgetUsd)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)] ${r?`text-[var(--app-danger)]`:``}`,children:`Deadline`}),(0,A.jsx)(`span`,{className:`text-[var(--app-text)] ${r?`text-[var(--app-danger)]`:``}`,children:E(e.deadline)})]}),(0,A.jsxs)(`div`,{className:`flex justify-between`,children:[(0,A.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Created`}),(0,A.jsx)(`span`,{className:`text-[var(--app-text-muted)]`,children:E(e.createdAt)})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 mt-3 pt-3 border-t border-[var(--app-border)]`,children:o?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(y,{size:`sm`,variant:`ghost`,onClick:async()=>{try{await a(e.id,{name:W,description:K,deliverTo:J,reportTo:X}),U(null),b.success(`Goal updated`)}catch(e){b.error(e instanceof Error?e.message:`Failed to update`)}},children:`Save`}),(0,A.jsx)(y,{size:`sm`,variant:`ghost`,onClick:()=>U(null),children:(0,A.jsx)(s,{size:14})})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(y,{size:`sm`,variant:`ghost`,title:`Edit`,onClick:()=>{U(e.id),G(e.name),q(e.description??``),Y(e.deliverTo??[]),Z(e.reportTo??[])},children:(0,A.jsx)(n,{size:14})}),(0,A.jsxs)(y,{size:`sm`,variant:`ghost`,title:`Change to ${M[e.status]}`,onClick:async()=>{try{await a(e.id,{status:M[e.status]}),b.success(`Status changed to ${M[e.status]}`)}catch(e){b.error(e instanceof Error?e.message:`Failed to update status`)}},children:[N[e.status]??(0,A.jsx)(i,{size:12}),(0,A.jsx)(`span`,{className:`text-xs`,children:M[e.status]})]}),(0,A.jsx)(`div`,{className:`ml-auto`,children:(0,A.jsxs)(v,{children:[(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(y,{size:`sm`,variant:`ghost`,title:`Delete`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,A.jsx)(c,{size:14})})}),(0,A.jsxs)(m,{children:[(0,A.jsxs)(te,{children:[(0,A.jsx)(p,{children:`Delete goal`}),(0,A.jsxs)(f,{children:[`This will permanently delete "`,e.name,`". This action cannot be undone.`]})]}),(0,A.jsxs)(g,{children:[(0,A.jsx)(_,{children:`Cancel`}),(0,A.jsx)(ee,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger-strong)]`,onClick:async()=>{try{await u(e.id),b.success(`Goal deleted`)}catch(e){b.error(e instanceof Error?e.message:`Failed to delete`)}},children:`Delete`})]})]})]})})]})})]},e.id)})})]})}export{P as Goals,j as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{ct as t,g as n,rt as r,y as i}from"./vendor-icons-Dk0hMuJz.js";import{t as a}from"./vendor-react-C6faO6LO.js";import{n as o}from"./dist-Bdqp1ixJ.js";import{t as s}from"./Button-DuQctNms.js";import{r as c,t as l}from"./index-DYsO5Awn.js";import{t as u}from"./Card-rKfViPS2.js";import{t as d}from"./PageHeader-CHSgtxPw.js";import{t as f}from"./SectionHeader-C2WpiwJ5.js";import{a as p}from"./format-CHfBBLog.js";import{t as m}from"./EmptyState-CIdIlMbn.js";var h=e(t(),1),g=a();function _(){let e=c(e=>e.roles),t=c(e=>e.fetchRoles),[a,_]=(0,h.useState)(``),[v,y]=(0,h.useState)([]),[b,x]=(0,h.useState)(!1),[S,C]=(0,h.useState)(``),[w,T]=(0,h.useState)(!1),[E,D]=(0,h.useState)(`all`),[O,k]=(0,h.useState)(new Set);(0,h.useEffect)(()=>{t()},[t]),(0,h.useEffect)(()=>{!a&&e.length>0&&_(e[0].id)},[e,a]);let A=(0,h.useCallback)(async()=>{if(a){x(!0);try{y((await o(`/memories/${a}?limit=100`)).memories)}catch{y([])}finally{x(!1)}}},[a]);(0,h.useEffect)(()=>{a&&A()},[a,A]);let j=async()=>{if(!(!S.trim()||!a)){T(!0);try{y((await o(`/memories/query`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agentId:a,prompt:S.trim(),topK:20})})).memories)}catch{y([])}finally{T(!1)}}},M=()=>{C(``),A()},N=v.filter(e=>E===`high`?e.importance>3:E===`medium`?e.importance===3:E===`low`?e.importance<3:!0),P=e=>e>=4?`text-[var(--app-danger)]`:e===3?`text-[var(--app-warning)]`:`text-[var(--app-text-subtle)]`;return(0,g.jsxs)(`div`,{className:`space-y-5`,children:[(0,g.jsx)(d,{eyebrow:`Knowledge`,title:`Memories`,compact:!0,description:`What each role is retaining and how retrieval changes the visible recall set.`,metrics:[{label:`Role`,value:e.find(e=>e.id===a)?.name??`None`},{label:`Visible`,value:N.length},{label:`High Importance`,value:v.filter(e=>e.importance>3).length}],actions:(0,g.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void A(),children:(0,g.jsx)(i,{size:14})})}),(0,g.jsx)(f,{title:`Recall Controls`,compact:!0,description:`Switch role context, run a retrieval query, or narrow by importance.`}),(0,g.jsx)(u,{className:`surface-panel-muted`,children:(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,g.jsx)(`select`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:a,onChange:e=>_(e.target.value),children:e.map(e=>(0,g.jsx)(`option`,{value:e.id,children:e.name},e.id))}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,g.jsx)(`input`,{className:`w-64 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder-slate-600 focus:border-[var(--app-accent)] focus:outline-none`,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>e.key===`Enter`&&void j(),placeholder:`Search memories...`}),(0,g.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>void j(),disabled:w,children:(0,g.jsx)(n,{size:14})}),S&&(0,g.jsx)(s,{size:`sm`,variant:`ghost`,onClick:M,children:`Clear`})]}),(0,g.jsx)(`div`,{className:`flex gap-1`,children:[`all`,`high`,`medium`,`low`].map(e=>(0,g.jsx)(`button`,{className:`rounded px-2 py-1 text-xs transition-colors ${E===e?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>D(e),children:e},e))})]})}),(0,g.jsx)(u,{children:b||w?(0,g.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,g.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):N.length===0?(0,g.jsx)(m,{icon:(0,g.jsx)(r,{size:32}),title:`No memories`,description:S?`No results for this query`:`This agent has no memories yet`,className:`py-8`}):(0,g.jsxs)(`div`,{className:`space-y-3`,children:[(0,g.jsxs)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[N.length,` memories`]}),N.map(e=>(0,g.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] p-3`,children:[(0,g.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,g.jsx)(l,{variant:e.type===`reflection`?`info`:e.type===`thought`?`warning`:`muted`,children:e.type}),(0,g.jsx)(l,{variant:`muted`,children:e.sourceType}),(0,g.jsx)(`span`,{className:`text-xs font-medium ${P(e.importance)}`,children:`*`.repeat(e.importance)}),e.score!=null&&(0,g.jsxs)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:[`score: `,e.score.toFixed(3)]})]}),(0,g.jsx)(`p`,{className:`whitespace-pre-wrap text-sm text-[var(--app-text)]`,children:e.content}),(0,g.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:e.keywords.map(e=>(0,g.jsx)(`span`,{className:`rounded bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-[10px] text-[var(--app-text-subtle)]`,children:e},e))}),e.type===`reflection`&&e.evidence&&e.evidence.length>0&&(0,g.jsxs)(`div`,{className:`mt-2`,children:[(0,g.jsxs)(`button`,{className:`text-[10px] text-[var(--app-accent)] hover:text-[var(--app-accent)]`,onClick:()=>k(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[O.has(e.id)?`Hide`:`Show`,` evidence (`,e.evidence.length,` memories)`]}),O.has(e.id)&&(0,g.jsx)(`div`,{className:`mt-1.5 space-y-1 border-l-2 border-[var(--app-border)] pl-2`,children:e.evidence.map(e=>{let t=v.find(t=>t.id===e);return(0,g.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:t?t.content.slice(0,120)+(t.content.length>120?`...`:``):(0,g.jsxs)(`span`,{className:`italic`,children:[`Memory `,e.slice(0,8),` (not in current view)`]})},e)})})]}),(0,g.jsxs)(`p`,{className:`mt-1.5 text-[10px] text-[var(--app-text-subtle)]`,children:[p(e.createdAt),` | accessed `,e.retrievedCount,`x | last: `,p(e.lastAccessed)]})]},e.id))]})})]})}export{_ as Memories};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,G as n,M as r,R as i,S as a,ct as o,et as s,g as c,n as ee,nt as te,s as l,u as ne,x as re,y as ie}from"./vendor-icons-Dk0hMuJz.js";import{t as u}from"./vendor-react-C6faO6LO.js";import{n as d}from"./dist-Bdqp1ixJ.js";import{t as f}from"./Button-DuQctNms.js";import{i as p,t as m}from"./index-DYsO5Awn.js";import{t as h}from"./Card-rKfViPS2.js";import{t as ae}from"./PageHeader-CHSgtxPw.js";import{t as oe}from"./SectionHeader-C2WpiwJ5.js";import{a as se}from"./format-CHfBBLog.js";import{t as ce}from"./EmptyState-CIdIlMbn.js";import{t as g}from"./ui-B_uMx2Fy.js";import{t as le}from"./useIsMobileLayout-C6KIQjuh.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./Table-DuOLbyJQ.js";var C=e(o(),1),w=u();function T({manifest:e}){if(!e)return null;let t=[];return e.skills.length>0&&t.push({label:`Skill(${e.skills.length})`,variant:`info`}),e.agents.length>0&&t.push({label:`Agent(${e.agents.length})`,variant:`success`}),e.mcpServers.length>0&&t.push({label:`MCP(${e.mcpServers.length})`,variant:`warning`}),e.hooks.length>0&&t.push({label:`Hook(${e.hooks.length})`,variant:`default`}),e.lspServers.length>0&&t.push({label:`LSP(${e.lspServers.length})`,variant:`default`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,w.jsx)(m,{variant:e.variant,children:e.label},e.label))})}function E({label:e,value:t}){return(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:e}),(0,w.jsx)(`p`,{className:`mt-1 text-sm font-medium text-[var(--app-text)]`,children:t})]})}function D({plugin:e,roles:t,operatingId:n,onInstallToRole:r}){return e.manifest?(0,w.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[e.manifest.description?(0,w.jsx)(`p`,{className:`text-[var(--app-text-muted)]`,children:e.manifest.description}):null,(0,w.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-4`,children:[(0,w.jsx)(E,{label:`Version`,value:e.version?`v${e.version}`:`—`}),(0,w.jsx)(E,{label:`Scope`,value:e.scope}),(0,w.jsx)(E,{label:`Capability Count`,value:e.manifest.skills.length+e.manifest.agents.length+e.manifest.mcpServers.length+e.manifest.hooks.length+e.manifest.lspServers.length}),(0,w.jsx)(E,{label:`Activation`,value:e.globalEnabled?`User On`:`User Off`})]}),(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 px-3 py-2`,children:[(0,w.jsx)(`p`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install Path`}),(0,w.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-[var(--app-text-muted)]`,title:e.installPath,children:e.installPath})]}),(0,w.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[e.manifest.skills.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Skills`}),e.manifest.skills.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.agents.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Agents`}),e.manifest.agents.map(e=>(0,w.jsxs)(`div`,{className:`inline-flex items-baseline gap-1 text-[var(--app-text-muted)]`,children:[(0,w.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.name}),e.description?(0,w.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`; `,e.description]}):null]},e.name))]}),e.manifest.mcpServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`MCP Servers`}),e.manifest.mcpServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.hooks.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`Hooks`}),e.manifest.hooks.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]}),e.manifest.lspServers.length>0&&(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`div`,{className:`mb-2 font-semibold text-[var(--app-text)]`,children:`LSP Servers`}),e.manifest.lspServers.map(e=>(0,w.jsx)(`div`,{className:`text-[var(--app-text-muted)]`,children:e},e))]})]}),t.length>0&&e.scope===`user`?(0,w.jsxs)(`div`,{className:`rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:[(0,w.jsx)(`p`,{className:`mb-2 text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Install to Role`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[10px]`,disabled:n===e.id,onClick:()=>void r(e.id,t.id,t.workspacePath),children:t.name},t.id))})]}):null]}):(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading manifest...`})}function O(){let[e,o]=(0,C.useState)([]),[u,E]=(0,C.useState)([]),[O,ue]=(0,C.useState)([]),[de,fe]=(0,C.useState)(new Set),[pe,k]=(0,C.useState)(!0),[A,j]=(0,C.useState)(!1),[M,N]=(0,C.useState)(null),[P,me]=(0,C.useState)(!1),[F,he]=(0,C.useState)(``),[I,L]=(0,C.useState)(null),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(``),[H,ge]=(0,C.useState)([]),[U,_e]=(0,C.useState)(!1),[W,ve]=(0,C.useState)(new Set),[G,K]=(0,C.useState)(`all`),[q,ye]=(0,C.useState)([]),be=le(),J=(0,C.useCallback)(async()=>{k(!0);try{o((await d(`/plugins`)).plugins)}catch(e){p.error(e instanceof Error?e.message:`Failed to load plugins`)}finally{k(!1)}},[]),Y=(0,C.useCallback)(async()=>{j(!0),N(null);try{let[e,t]=await Promise.all([d(`/plugins/marketplace`).catch(()=>({available:[],installed:[]})),d(`/plugins/marketplaces`)]);ue(e.available),fe(new Set(e.installed.map(e=>e.id))),E(t.sources)}catch(e){N(e instanceof Error?e.message:`Failed to load marketplace`)}finally{j(!1)}},[]),xe=(0,C.useCallback)(async()=>{try{ge((await d(`/plugins/stats?limit=20`)).stats)}catch{}},[]),X=(0,C.useCallback)(async()=>{try{ye((await d(`/roles`)).roles)}catch{}},[]);(0,C.useEffect)(()=>{J(),Y(),X()},[J,Y,X]);let Se=async(e,t)=>{L(e);try{await d(`/plugins/${encodeURIComponent(e)}/${t?`enable`:`disable`}`,{method:`POST`}),p.success(`${e} ${t?`enabled`:`disabled`} globally`),o(n=>n.map(n=>n.id===e?{...n,globalEnabled:t}:n))}catch(e){p.error(e instanceof Error?e.message:`Failed to ${t?`enable`:`disable`} plugin`)}finally{L(null)}},Ce=async e=>{L(e);try{await d(`/plugins/uninstall/${encodeURIComponent(e)}`,{method:`POST`}),p.success(`Plugin uninstalled`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Uninstall failed`)}finally{L(null)}},we=async(e,t,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:`project`,cwd:n})});let r=q.find(e=>e.id===t)?.name??t;p.success(`Installed ${e.split(`@`)[0]} for ${r}`),await J()}catch(e){p.error(e instanceof Error?e.message:`Install to role failed`)}finally{L(null)}},Te=async()=>{if(B.trim())try{await d(`/plugins/install/${encodeURIComponent(B.trim())}`,{method:`POST`,body:JSON.stringify({})}),p.success(`Source added`),V(``),z(!1),await Y()}catch(e){p.error(e instanceof Error?e.message:`Failed to add source`)}},Z=async(e,t=`user`,n)=>{L(e);try{await d(`/plugins/install/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({scope:t,cwd:n})});let r=t===`project`&&n?`${e.split(`@`)[0]} for ${n.split(`/`).pop()}`:e.split(`@`)[0];p.success(`Installed ${r}`),await Promise.all([J(),Y()])}catch(e){p.error(e instanceof Error?e.message:`Install failed`)}finally{L(null)}},Ee=e=>{ve(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=G===`all`?e:e.filter(e=>e.scope===G),$=F?O.filter(e=>e.name.toLowerCase().includes(F.toLowerCase())||e.description.toLowerCase().includes(F.toLowerCase())):O;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(ae,{eyebrow:`Capabilities`,title:`Plugins`,compact:!0,description:`Installed capabilities, scope, and activation.`,metrics:[{label:`Total`,value:e.length},{label:`Project Scope`,value:e.filter(e=>e.scope===`project`).length},{label:`Catalog`,value:O.length}],actions:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,onClick:()=>void J(),children:(0,w.jsx)(ie,{size:14})})}),(0,w.jsx)(oe,{title:`Installed Plugins`,compact:!0,description:`Filter by scope, inspect manifests, and keep every activation path reachable from one place.`}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(i,{size:14,className:`text-[var(--app-text-muted)] flex-shrink-0`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`all`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`all`),children:`All`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`user`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`user`),children:`User`}),(0,w.jsx)(`button`,{className:`rounded-full px-2 py-0.5 text-xs transition-colors ${G===`project`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:bg-[var(--app-panel-muted)]`}`,onClick:()=>K(`project`),children:`Project`}),(0,w.jsx)(`span`,{className:`h-4 w-px bg-[var(--app-panel-muted)] mx-1`}),u.map(e=>(0,w.jsx)(m,{variant:`muted`,className:`text-xs`,children:e.name},e.name)),(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[A&&(0,w.jsx)(r,{size:12,className:`animate-spin text-[var(--app-text-subtle)]`}),A?null:(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>z(!R),children:R?(0,w.jsx)(ee,{size:12}):(0,w.jsx)(a,{size:12})})]})]}),R&&(0,w.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,w.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:B,onChange:e=>V(e.target.value),placeholder:`https://github.com/org/marketplace-repo`,onKeyDown:e=>{e.key===`Enter`&&Te()}}),(0,w.jsx)(f,{size:`sm`,onClick:()=>void Te(),disabled:!B.trim(),children:`Add`})]})]}),pe?(0,w.jsx)(h,{children:(0,w.jsx)(`div`,{className:`py-8 text-center text-sm text-[var(--app-text-subtle)]`,children:`Loading...`})}):Q.length===0?(0,w.jsx)(h,{children:(0,w.jsx)(ce,{icon:(0,w.jsx)(re,{size:32}),title:`No plugins`,description:G===`all`?`No plugins installed. Browse the marketplace or install from a URL.`:`No ${G}-scope plugins installed.`,className:`py-8`})}):be?(0,w.jsx)(`div`,{className:`space-y-3`,children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(h,{children:[(0,w.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,w.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:14}):(0,w.jsx)(t,{size:14})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`})]})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})]}),e.scope===`project`&&e.projectPath?(0,w.jsx)(`p`,{className:`truncate text-[11px] text-[var(--app-text-subtle)]`,title:e.projectPath,children:e.projectPath}):null,(0,w.jsx)(T,{manifest:e.manifest})]})}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]}),i?(0,w.jsx)(`div`,{className:`mt-4 rounded-xl border border-[var(--app-border)] bg-black/10 p-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})}):null]},c)})}):(0,w.jsx)(h,{padding:!1,children:(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{className:`w-8`}),(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Version`}),(0,w.jsx)(v,{children:`Scope`}),(0,w.jsx)(v,{children:`Type`}),(0,w.jsx)(v,{children:`Activation`}),(0,w.jsx)(v,{children:`Actions`})]})}),(0,w.jsx)(y,{children:Q.map((e,n)=>{let i=W.has(e.id),a=e.id.split(`@`)[0],o=I===e.id,c=e.projectPath?`${e.id}:${e.projectPath}`:`${e.id}:${n}`;return(0,w.jsxs)(C.Fragment,{children:[(0,w.jsxs)(b,{className:`group`,children:[(0,w.jsx)(x,{children:(0,w.jsx)(`button`,{onClick:()=>Ee(e.id),className:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:i?(0,w.jsx)(s,{size:g.xs}):(0,w.jsx)(t,{size:g.xs})})}),(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)]`,children:a}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.version?`v${e.version}`:`—`}),(0,w.jsxs)(x,{children:[(0,w.jsx)(m,{variant:e.scope===`user`?`info`:`warning`,children:e.scope}),e.scope===`project`&&e.projectPath&&(0,w.jsx)(`div`,{className:`text-[10px] text-[var(--app-text-subtle)] truncate max-w-[120px]`,title:e.projectPath,children:e.projectPath.split(`/`).pop()})]}),(0,w.jsx)(x,{children:(0,w.jsx)(T,{manifest:e.manifest})}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:e.globalEnabled?`success`:`destructive`,children:e.globalEnabled?`User On`:`User Off`})}),(0,w.jsx)(x,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs`,disabled:o,onClick:()=>void Se(e.id,!e.globalEnabled),children:o?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):e.globalEnabled?`Disable`:`Enable`}),(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs text-[var(--app-danger)]`,disabled:o,onClick:()=>void Ce(e.id),children:(0,w.jsx)(l,{size:g.xs})})]})})]}),i&&(0,w.jsx)(b,{className:`bg-[var(--app-panel)]/50`,children:(0,w.jsx)(x,{colSpan:7,className:`px-6 py-3`,children:(0,w.jsx)(D,{plugin:e,roles:q,operatingId:I,onInstallToRole:we})})},`${e.id}-detail`)]},c)})})]})}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>me(!P),children:[(0,w.jsx)(ne,{size:g.sm,className:`text-[var(--app-text-muted)]`}),`Marketplace (`,O.length,`)`,P?(0,w.jsx)(s,{size:g.xs,className:`ml-auto`}):(0,w.jsx)(t,{size:g.xs,className:`ml-auto`})]}),P&&(0,w.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(c,{size:g.sm,className:`absolute left-2.5 top-2 text-[var(--app-text-subtle)]`}),(0,w.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] pl-8 pr-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,value:F,onChange:e=>he(e.target.value),placeholder:`Search available plugins...`})]}),A?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`Loading marketplace...`}):M?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-danger)] text-center py-2`,children:M}):$.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:F?`No plugins match your search`:`No marketplace plugins available`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Name`}),(0,w.jsx)(v,{children:`Description`}),(0,w.jsx)(v,{children:`Source`}),(0,w.jsx)(v,{children:`Action`})]})}),(0,w.jsx)(y,{children:$.map(e=>{let t=de.has(e.pluginId),i=I===e.pluginId;return(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.name}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)] max-w-[300px] truncate`,title:e.description,children:e.description}),(0,w.jsx)(x,{children:(0,w.jsx)(m,{variant:`muted`,className:`text-[10px]`,children:e.marketplaceName})}),(0,w.jsx)(x,{children:t?(0,w.jsx)(m,{variant:`success`,className:`text-[10px]`,children:`Installed`}):(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,disabled:i,onClick:()=>void Z(e.pluginId),children:i?(0,w.jsx)(r,{size:g.xs,className:`animate-spin`}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(n,{size:g.xs}),` Install`]})}),q.length>0&&(0,w.jsxs)(`div`,{className:`relative group/install`,children:[(0,w.jsx)(f,{variant:`ghost`,size:`sm`,className:`h-6 px-1 text-xs text-[var(--app-text-subtle)]`,children:(0,w.jsx)(s,{size:g.xs})}),(0,w.jsx)(`div`,{className:`absolute right-0 top-full mt-1 z-10 hidden group-hover/install:block bg-[var(--app-panel-elevated)] border border-[var(--app-border)] rounded shadow-lg py-1 min-w-[140px]`,children:q.map(t=>(0,w.jsx)(`button`,{className:`block w-full text-left px-3 py-1 text-xs text-[var(--app-text)] hover:bg-[var(--app-panel-muted)]`,disabled:i,onClick:()=>void Z(e.pluginId,`project`,t.workspacePath),children:t.name},t.id))})]})]})})]},e.pluginId)})})]})]})]}),(0,w.jsxs)(h,{children:[(0,w.jsxs)(`button`,{className:`flex w-full items-center gap-2 text-sm font-semibold text-[var(--app-text)]`,onClick:()=>{!U&&H.length===0&&xe(),_e(!U)},children:[(0,w.jsx)(te,{size:14,className:`text-[var(--app-text-muted)]`}),`Usage Stats`,U?(0,w.jsx)(s,{size:12,className:`ml-auto`}):(0,w.jsx)(t,{size:12,className:`ml-auto`})]}),U&&(0,w.jsx)(`div`,{className:`mt-3`,children:H.length===0?(0,w.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] text-center py-2`,children:`No usage data yet`}):(0,w.jsxs)(S,{children:[(0,w.jsx)(_,{children:(0,w.jsxs)(b,{children:[(0,w.jsx)(v,{children:`Plugin`}),(0,w.jsx)(v,{children:`Usage Count`}),(0,w.jsx)(v,{children:`Last Used`})]})}),(0,w.jsx)(y,{children:H.map(e=>(0,w.jsxs)(b,{children:[(0,w.jsx)(x,{className:`font-medium text-[var(--app-text)] text-xs`,children:e.pluginName}),(0,w.jsx)(x,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.usageCount}),(0,w.jsx)(x,{className:`text-xs text-[var(--app-text-muted)]`,children:e.lastUsed?se(e.lastUsed):`—`})]},e.pluginPath))})]})})]})]})}export{O as Plugins};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,ct as n,j as r,m as i,n as a,y as o}from"./vendor-icons-Dk0hMuJz.js";import{l as s,t as c}from"./vendor-react-C6faO6LO.js";import{n as l}from"./dist-Bdqp1ixJ.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./AlertDialog-CfeiyMrc.js";import{t as v}from"./Button-DuQctNms.js";import{r as y}from"./index-DYsO5Awn.js";import{t as b}from"./Card-rKfViPS2.js";import{t as x}from"./PageHeader-CHSgtxPw.js";import{t as S}from"./SectionHeader-C2WpiwJ5.js";import{i as C}from"./format-CHfBBLog.js";import{t as w}from"./EmptyState-CIdIlMbn.js";import{t as T}from"./ui-B_uMx2Fy.js";import{t as E}from"./EnvVarEditor-C-gErAzC.js";var D=e(n(),1),O=c(),k={anthropic:{label:`Anthropic`,paths:[`anthropic.apiKey`,`anthropic.baseUrl`,`anthropic.model`,`anthropic.defaultOpusModel`,`anthropic.defaultSonnetModel`,`anthropic.defaultHaikuModel`,`anthropic.smallFastModel`]},defaults:{label:`Defaults`,paths:[`defaults.model`,`defaults.effort`,`defaults.maxTurns`,`defaults.maxBudgetUsd`,`defaults.timeout`,`defaults.approvalTimeout`]},server:{label:`Server`,paths:[`server.port`,`server.host`,`server.apiKey`],mutablePaths:[`server.timezone`]},logging:{label:`Logging`,paths:[`logging.level`]},evolution:{label:`Evolution`,paths:[`roles.evolution.triggerEvery`,`roles.evolution.reflectionThreshold`]},chat:{label:`Chat`,paths:[`chat.sessionTimeoutMinutes`,`chat.maxSessionTurns`,`chat.autoTitle`,`chat.archiveExtractMemory`]},workflow:{label:`Workflow`,paths:[`watchdog.rules.artifactCleanup.enabled`,`watchdog.rules.artifactCleanup.ttlDays`,`watchdog.rules.artifactCleanup.orphanGcMinAgeHours`]}},A={anthropic:`Model endpoints and provider-specific defaults.`,defaults:`Global execution defaults applied when a role does not override them.`,server:`Network surface and host-level configuration.`,logging:`Verbosity and runtime observability controls.`,evolution:`Thresholds that govern role adaptation over time.`,chat:`Session lifecycle and archive behavior for chat mode.`,workflow:`Cleanup rules and artifact retention for background work.`},ee=[`defaults.deniedReadPaths`,`defaults.approvalRequired`],j=new Set([`anthropic.apiKey`,`server.apiKey`]),M={"anthropic.apiKey":`API Key`,"anthropic.baseUrl":`Base URL`,"anthropic.model":`Model`,"anthropic.defaultOpusModel":`Default Opus Model`,"anthropic.defaultSonnetModel":`Default Sonnet Model`,"anthropic.defaultHaikuModel":`Default Haiku Model`,"anthropic.smallFastModel":`Small Fast Model`,"defaults.model":`Default Model`,"defaults.effort":`Effort Level`,"defaults.maxTurns":`Max Turns`,"defaults.maxBudgetUsd":`Max Budget (USD)`,"defaults.timeout":`Timeout (seconds)`,"defaults.approvalTimeout":`Approval Timeout (seconds)`,"server.port":`Port`,"server.host":`Host`,"server.apiKey":`API Key (server auth)`,"server.timezone":`Timezone`,"logging.level":`Log Level`,"roles.evolution.triggerEvery":`Evolution Trigger Every (tasks)`,"roles.evolution.reflectionThreshold":`Reflection Threshold (tokens)`,"chat.sessionTimeoutMinutes":`Session Timeout (minutes)`,"chat.maxSessionTurns":`Max Session Turns`,"chat.autoTitle":`Auto-generate Session Title`,"chat.archiveExtractMemory":`Extract Memory on Archive`,"watchdog.rules.artifactCleanup.enabled":`Workflow Artifact Cleanup Enabled`,"watchdog.rules.artifactCleanup.ttlDays":`Artifact Retention (days)`,"watchdog.rules.artifactCleanup.orphanGcMinAgeHours":`Orphan File GC Min Age (hours)`},te={"defaults.effort":[`low`,`medium`,`high`,`max`],"logging.level":[`debug`,`info`,`warn`,`error`],"server.timezone":[`system`,`Asia/Shanghai`,`Asia/Tokyo`,`Asia/Singapore`,`America/New_York`,`America/Los_Angeles`,`America/Chicago`,`Europe/London`,`Europe/Berlin`,`Europe/Paris`,`UTC`]};function N(){let[e,n]=(0,D.useState)({}),[a,c]=(0,D.useState)([]),[T,N]=(0,D.useState)({}),[F,I]=(0,D.useState)(new Set),[L,R]=(0,D.useState)(!1),[z,B]=(0,D.useState)(null),[ne,V]=(0,D.useState)(!0),[H,U]=(0,D.useState)(null),[W,G]=(0,D.useState)({}),[K,q]=(0,D.useState)(new Set),[J,Y]=(0,D.useState)({}),X=y(e=>e.configVersion);(0,D.useEffect)(()=>{if(F.size===0)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[F.size]);let Z=s(({currentLocation:e,nextLocation:t})=>F.size>0&&e.pathname!==t.pathname),Q=(0,D.useCallback)(async()=>{try{let e=await l(`/config`);n(e.config),c(e.mutable);let t={};for(let[n,r]of Object.entries(e.config))t[n]=String(r.value??``);N(t),I(new Set);let r=e.config[`server.timezone`]?.value;r&&C(r);let i={};for(let t of ee){let n=e.config[t];n&&(i[t]=Array.isArray(n.value)?n.value:[])}G(i),q(new Set),U(await l(`/config/env-diff`)),Y((await l(`/config/env`)).env)}catch(e){B({type:`error`,text:e instanceof Error?e.message:`Failed to load config`})}finally{V(!1)}},[]);(0,D.useEffect)(()=>{Q()},[Q]),(0,D.useEffect)(()=>{X>0&&Q()},[X,Q]);let re=async()=>{await l(`/config/sync-to-env`,{method:`POST`}),B({type:`success`,text:`Synced DB values to .env`}),U(null)},ie=async()=>{await l(`/config/load-from-env`,{method:`POST`}),B({type:`success`,text:`Loaded .env values to DB`}),Q()},$=(e,t)=>{N(n=>({...n,[e]:t})),I(t=>new Set(t).add(e)),B(null)},ae=async()=>{if(F.size!==0){R(!0),B(null);try{let t={};for(let n of F){let r=e[n],i=T[n];if(r&&typeof r.value==`number`&&(i=Number(i),isNaN(i))){B({type:`error`,text:`"${M[n]??n}" must be a number`}),R(!1);return}t[n]=i}let n=await l(`/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,...Object.fromEntries(Array.from(K).map(e=>[e,W[e]??[]]))})});if(n.updated.length>0&&(B({type:`success`,text:`Updated ${n.updated.length} setting(s)`}),n.updated.includes(`server.timezone`))){let e=T[`server.timezone`];C(e)}n.errors.length>0&&B({type:`error`,text:n.errors.join(`; `)}),I(new Set),Q()}catch(e){B({type:`error`,text:e instanceof Error?e.message:`Save failed`})}finally{R(!1)}}};return ne?(0,O.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,O.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-[var(--app-border)] border-t-[var(--app-accent)]`})}):Object.keys(e).length===0?(0,O.jsx)(w,{icon:(0,O.jsx)(i,{size:32}),title:`No configuration`,description:`Config API not available`}):(0,O.jsxs)(`div`,{className:`space-y-5`,children:[(0,O.jsx)(x,{eyebrow:`Configuration`,title:`Settings`,compact:!0,description:`Mutable fields, pending edits, and environment drift.`,metrics:[{label:`Editable`,value:a.length},{label:`Pending`,value:F.size+K.size},{label:`Env Drift`,value:H?.diffs.length??0}],actions:(0,O.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>void Q(),children:(0,O.jsx)(o,{size:14})}),F.size>0&&(0,O.jsxs)(v,{size:`sm`,onClick:()=>void ae(),disabled:L,children:[(0,O.jsx)(t,{size:14}),L?`Saving...`:`Save (${F.size})`]})]})}),(0,O.jsx)(S,{title:`Configuration Groups`,compact:!0,description:`Fields stay in place while changeable, restart-required, and pending state are clarified.`}),z&&(0,O.jsx)(`div`,{className:`rounded-lg border px-4 py-3 text-sm ${z.type===`success`?`border-[var(--app-success-soft-border)] bg-[var(--app-success-soft-bg)] text-[var(--app-success-soft-text)]`:`border-[var(--app-danger-soft-border)] bg-[var(--app-danger-soft-bg)] text-[var(--app-danger-soft-text)]`}`,children:z.text}),H&&H.diffs.length>0&&(0,O.jsx)(b,{className:`surface-accent`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`p`,{className:`text-sm font-medium text-[var(--app-text)]`,children:[`.env and DB have `,H.diffs.length,` different value(s)`]}),(0,O.jsx)(`p`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:H.diffs.map(e=>e.envKey).join(`, `)})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-end`,children:[(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:re,children:`Sync DB → .env`}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:ie,children:`Load .env → DB`})]})]})}),Object.entries(k).map(([t,{label:n,paths:i,mutablePaths:o}])=>{let s=[...i,...o??[]],c=s.filter(e=>a.includes(e)).length;return(0,O.jsxs)(b,{children:[(0,O.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-sm font-medium text-[var(--app-text)]`,children:n}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-[var(--app-text-muted)]`,children:A[t]??`Configuration values for this system area.`})]}),(0,O.jsxs)(`div`,{className:`rounded-full border border-[var(--app-border)] bg-black/10 px-3 py-1.5 text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:[c,`/`,s.length,` editable`]})]}),(0,O.jsx)(`div`,{className:`space-y-3`,children:s.map(t=>{let n=e[t];if(!n)return null;let i=a.includes(t),o=M[t]??t,s=T[t]??String(n.value??``),c=F.has(t),l=te[t];return(0,O.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-[var(--app-border)] bg-black/10 px-3 py-3 md:flex-row md:items-center md:gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 md:w-56 md:shrink-0`,children:[!i&&(0,O.jsx)(r,{size:12,className:`text-[var(--app-text-subtle)]`}),(0,O.jsx)(`label`,{className:`text-sm text-[var(--app-text-muted)]`,children:o}),!i&&(0,O.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`restart required`})]}),(0,O.jsx)(`div`,{className:`min-w-0 flex-1`,children:l?(0,O.jsx)(`select`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none disabled:opacity-50`,value:s,onChange:e=>$(t,e.target.value),disabled:!i,children:l.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))}):(0,O.jsx)(`input`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none disabled:opacity-50`,type:j.has(t)?`password`:`text`,value:s,onChange:e=>$(t,e.target.value),disabled:!i,placeholder:j.has(t)?`Enter to update`:void 0})}),(0,O.jsx)(`div`,{className:`text-left md:w-16 md:text-right`,children:c&&i&&(0,O.jsx)(`span`,{className:`text-[10px] text-[var(--app-warning)]`,children:`modified`})})]},t)})})]},t)}),(0,O.jsx)(E,{envVars:J,onSave:()=>void Q(),mode:`global`,title:`Environment Variables`}),(0,O.jsx)(P,{mutablePaths:a,listValues:W,listDirty:K,setListValues:G,setListDirty:e=>q(e),dirty:F}),(0,O.jsx)(_,{open:Z.state===`blocked`,children:(0,O.jsxs)(f,{children:[(0,O.jsxs)(g,{children:[(0,O.jsx)(d,{children:`Unsaved Changes`}),(0,O.jsxs)(u,{children:[`You have `,F.size+K.size,` unsaved change(s). Discard and leave?`]})]}),(0,O.jsxs)(m,{children:[(0,O.jsx)(h,{onClick:()=>Z.reset?.(),children:`Stay`}),(0,O.jsx)(p,{onClick:()=>Z.proceed?.(),children:`Discard`})]})]})})]})}function P({mutablePaths:e,listValues:t,listDirty:n,setListValues:i,setListDirty:o,dirty:s}){let[c,l]=(0,D.useState)(``),[u,d]=(0,D.useState)(``),f=e.includes(`defaults.deniedReadPaths`),p=e.includes(`defaults.approvalRequired`),m=t[`defaults.deniedReadPaths`]??[],h=t[`defaults.approvalRequired`]??[],g=[`~/.ssh`,`~/.aws`,`~/.gnupg`,`/etc/shadow`],_=[`rm -rf *`,`git push*`,`git reset*`,`curl * -X POST*`,`curl * --request POST*`],y=e=>g.some(t=>e===(t.startsWith(`~/`),t)||e===t),x=e=>_.includes(e),S=()=>{let e=c.trim();!e||m.includes(e)||(i(t=>({...t,"defaults.deniedReadPaths":[...m,e]})),o(e=>new Set(e).add(`defaults.deniedReadPaths`)),l(``))},C=e=>{y(e)||(i(t=>({...t,"defaults.deniedReadPaths":m.filter(t=>t!==e)})),o(e=>new Set(e).add(`defaults.deniedReadPaths`)))},w=()=>{let e=u.trim();!e||h.includes(e)||(i(t=>({...t,"defaults.approvalRequired":[...h,e]})),o(e=>new Set(e).add(`defaults.approvalRequired`)),d(``))},E=e=>{x(e)||(i(t=>({...t,"defaults.approvalRequired":h.filter(t=>t!==e)})),o(e=>new Set(e).add(`defaults.approvalRequired`)))},k=s.size+n.size;return(0,O.jsxs)(b,{children:[(0,O.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,O.jsx)(`h2`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Advanced`}),k>0&&(0,O.jsxs)(`span`,{className:`text-[10px] text-[var(--app-warning)]`,children:[n.size,` modified`]})]}),(0,O.jsxs)(`div`,{className:`mb-6`,children:[(0,O.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Denied Read Paths`}),!f&&(0,O.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[(0,O.jsx)(r,{size:T.xs}),` restart required`]})]}),(0,O.jsxs)(`p`,{className:`mb-2 text-xs text-[var(--app-text-subtle)]`,children:[`Paths blocked at both the SDK and OS layer for all roles. System defaults (locked) cannot be removed. Uses `,(0,O.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`*`}),` as wildcard.`]}),(0,O.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:m.map(e=>{let t=y(e);return(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${t?`border-[var(--app-border)] bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)]`:`border-[var(--app-danger-soft-border)] bg-[var(--app-danger-soft-bg)] text-[var(--app-danger-soft-text)]`}`,children:[t&&(0,O.jsx)(r,{size:T.xs}),e,!t&&f&&(0,O.jsx)(`button`,{type:`button`,className:`ml-0.5 text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>C(e),children:(0,O.jsx)(a,{size:T.xs})})]},e)})}),f&&(0,O.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,O.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`/absolute/path or ~/path`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S())}}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>S(),children:`Add`})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,O.jsx)(`h3`,{className:`text-xs font-medium text-[var(--app-text-muted)]`,children:`Approval Required Patterns`}),!p&&(0,O.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[(0,O.jsx)(r,{size:T.xs}),` restart required`]})]}),(0,O.jsxs)(`p`,{className:`mb-2 text-xs text-[var(--app-text-subtle)]`,children:[`Operations matching these glob patterns require user approval before execution. Uses SDK Permission Rule glob syntax (`,(0,O.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`*`}),` = wildcard, e.g.,`,` `,(0,O.jsx)(`code`,{className:`text-[var(--app-text-muted)]`,children:`rm -rf *`}),`).`]}),(0,O.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:h.map(e=>{let t=x(e);return(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs ${t?`border-[var(--app-border)] bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)]`:`border-[var(--app-warning-soft-border)] bg-[var(--app-warning-soft-bg)] text-[var(--app-warning-soft-text)]`}`,children:[t&&(0,O.jsx)(r,{size:T.xs}),e,!t&&p&&(0,O.jsx)(`button`,{type:`button`,className:`ml-0.5 text-[var(--app-warning)] hover:text-[var(--app-warning-soft-text)]`,onClick:()=>E(e),children:(0,O.jsx)(a,{size:T.xs})})]},e)})}),p&&(0,O.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,O.jsx)(`input`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`e.g. "curl * --request POST *"`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())}}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,className:`scale-75`,onClick:()=>w(),children:`Add`})]})]})]})}export{N as Settings};
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{B as t,I as n,K as r,L as i,Y as a,a as o,at as s,ct as c,it as l,p as u,q as d}from"./vendor-icons-Dk0hMuJz.js";import{f,r as p,t as m}from"./vendor-react-C6faO6LO.js";import{n as h,r as g}from"./dist-Bdqp1ixJ.js";import{t as _}from"./Button-DuQctNms.js";import{n as v,t as y}from"./index-DYsO5Awn.js";import{i as b,n as x,r as S,t as C}from"./Card-rKfViPS2.js";import{t as w}from"./PageHeader-CHSgtxPw.js";import{t as T}from"./SectionHeader-C2WpiwJ5.js";import{a as E,n as D,r as O,t as k}from"./format-CHfBBLog.js";import{t as A}from"./ui-B_uMx2Fy.js";var j=e(c(),1),M=m(),N={reasoning:`text-[var(--app-accent)]`,tool_call:`text-[var(--app-accent-strong)]`,tool_result:`text-[var(--app-success)]`,approval_request:`text-[var(--app-warning)]`,approval_response:`text-[var(--app-warning-strong)]`,permission_denied:`text-[var(--app-indicator-alert)]`,error:`text-[var(--app-danger)]`,plugin_error:`text-[var(--app-danger)]`};function P({logs:e}){let[t,n]=(0,j.useState)(new Set);return e.length===0?(0,M.jsx)(`p`,{className:`text-sm text-[var(--app-text-subtle)]`,children:`No execution steps yet.`}):(0,M.jsx)(`div`,{className:`space-y-0`,children:e.map((r,i)=>{let o=i>0?e[i-1].timestamp:null,s=o?r.timestamp-o:null,c=r.type===`plugin_error`,l=t.has(i)?r.content:r.content.length>200?r.content.slice(0,200)+`...`:r.content;return(0,M.jsxs)(`div`,{className:`flex gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,M.jsx)(a,{size:10,className:`mt-1.5 flex-shrink-0 fill-current ${N[r.type]??`text-[var(--app-text-subtle)]`} ${c?`rounded-full ring-2 ring-[var(--app-danger)]`:``}`}),i<e.length-1&&(0,M.jsx)(`div`,{className:`mt-0.5 w-0.5 flex-1 bg-[var(--app-border)]`})]}),(0,M.jsxs)(`div`,{className:`flex-1 pb-4 ${c?`rounded-lg border border-[var(--app-danger)]/40 bg-[var(--app-danger-soft-bg-subtle)] p-3`:``}`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,M.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,r.index]}),(0,M.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:r.toolName??r.type}),c&&(0,M.jsx)(y,{variant:`destructive`,children:`Plugin Error`}),(0,M.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:E(r.timestamp)}),s!=null&&s>0&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,s,`ms`]}),r.truncated&&(0,M.jsx)(y,{variant:`outline`,children:`truncated`})]}),l&&(0,M.jsx)(`button`,{className:`mt-2 w-full rounded-lg border border-[var(--app-border)] bg-white/[0.03] px-3 py-3 text-left font-mono text-xs text-[var(--app-text-muted)] transition-colors hover:border-[var(--app-border-strong)] hover:text-[var(--app-text)]`,onClick:()=>{n(e=>{let t=new Set(e);return t.has(i)?t.delete(i):t.add(i),t})},children:l})]})]},r.id)})})}function F(){let{id:e}=f(),[a,c]=(0,j.useState)(null),[m,E]=(0,j.useState)([]),[N,F]=(0,j.useState)([]),[R,z]=(0,j.useState)([]),[B,V]=(0,j.useState)(null),[H,U]=(0,j.useState)(null),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(!1),[J,Y]=(0,j.useState)(!1),[X,Z]=(0,j.useState)(!1),Q=(0,j.useMemo)(()=>{if(!a)return`No diagnostics yet`;let e=[];return a.error&&e.push(`error`),N.length>0&&e.push(`${N.length} steps`),R.length>0&&e.push(`${R.length} delivery events`),e.length>0?e.join(` · `):`No diagnostics yet`},[R.length,N.length,a]);(0,j.useEffect)(()=>{if(!e)return;let t=!1,n=async()=>{if(!t)try{let n=await h(`/tasks/${e}`);if(t)return;c(n.task),U(null)}catch(e){if(t)return;U(e instanceof Error?e.message:`Failed to load task`)}};n(),h(`/tasks/${e}/plan`).then(e=>{t||E(e.plans)}).catch(()=>{t||E([])}),h(`/tasks/${e}/logs?limit=200`).then(e=>{t||F(e.logs)}).catch(()=>{t||F([])}),g(e).then(e=>{t||z(e)}).catch(()=>{t||z([])});let r=setInterval(n,3e3);return()=>{t=!0,clearInterval(r)}},[e]),(0,j.useEffect)(()=>{if(!a?.roleId||!e)return;let t=!1;return h(`/roles/${a.roleId}/scores?limit=100`).then(n=>{t||V(n.scores.find(t=>t.taskId===e)??null)}).catch(()=>{t||V(null)}),()=>{t=!0}},[a?.roleId,e]);let $=async()=>{if(e){G(!0);try{await h(`/tasks/${e}/cancel`,{method:`POST`}),c(e=>e&&{...e,status:`cancelled`})}finally{G(!1)}}};if(H)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(p,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),(0,M.jsx)(C,{className:`text-center text-[var(--app-danger)]`,children:H})]});if(!a)return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(p,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),(0,M.jsx)(C,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let ee=[`running`,`queued`,`pending`,`paused`].includes(a.status);return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(w,{eyebrow:`Task`,title:`Task Detail`,compact:!0,description:`Summary, execution, result, and diagnostics.`,metrics:[{label:`Status`,value:(0,M.jsx)(y,{variant:v(a.status),children:a.status})},{label:`Task`,value:a.id.slice(0,8)},{label:`Elapsed`,value:a.totalDurationMs?O(a.totalDurationMs):a.startedAt?O(Date.now()-a.startedAt):`—`},{label:`Spend`,value:a.costUsd==null?`—`:k(a.costUsd)}],actions:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(p,{to:`/work`,className:`inline-flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,M.jsx)(s,{size:A.sm}),` Back to Tasks`]}),ee&&(0,M.jsxs)(_,{variant:`destructive`,size:`sm`,onClick:()=>void $(),disabled:W,children:[(0,M.jsx)(l,{size:A.sm}),W?`Cancelling...`:`Cancel Task`]})]})}),(0,M.jsx)(C,{className:`surface-accent text-white`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`p`,{className:`text-kicker text-white/70`,children:`Summary`}),(0,M.jsx)(`p`,{className:`mt-2 text-base leading-7 text-white`,children:a.prompt.length>220&&!K?`${a.prompt.slice(0,220)}…`:a.prompt})]}),(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.prompt.length>220?(0,M.jsxs)(_,{variant:`secondary`,size:`sm`,onClick:()=>q(e=>!e),children:[(0,M.jsx)(t,{size:A.sm}),K?`Collapse prompt`:`Show full prompt`]}):null,(0,M.jsxs)(_,{variant:`secondary`,size:`sm`,onClick:()=>Z(e=>!e),children:[(0,M.jsx)(u,{size:A.sm}),X?`Hide diagnostics`:`Show diagnostics`]})]})]})}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,M.jsx)(L,{icon:d,label:`Created`,value:D(a.createdAt)}),(0,M.jsx)(L,{icon:d,label:`Duration`,value:a.totalDurationMs?O(a.totalDurationMs):a.startedAt?O(Date.now()-a.startedAt):`—`}),(0,M.jsx)(L,{icon:r,label:`Cost`,value:a.costUsd==null?`—`:k(a.costUsd)}),(0,M.jsx)(L,{icon:i,label:`Turns`,value:String(a.numTurns??`—`)})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,M.jsx)(L,{icon:o,label:`Role`,value:a.roleId??`—`,mono:!0}),(0,M.jsx)(L,{icon:n,label:`Parent`,value:a.parentId??`—`,mono:!0}),a.templateId?(0,M.jsxs)(p,{to:`/work`,className:`block`,children:[(0,M.jsx)(L,{icon:n,label:`Template`,value:a.templateId,mono:!0}),(0,M.jsx)(`span`,{className:`mt-0.5 block text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:`View in Automations →`})]}):(0,M.jsx)(L,{icon:n,label:`Template`,value:`—`,mono:!0}),a.sourceSessionId&&(0,M.jsx)(L,{icon:i,label:`Source Session`,value:a.sourceSessionId.slice(0,8),mono:!0})]}),(a.deliverTo||a.reportTo)&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Delivery Targets`}),(0,M.jsx)(x,{children:`Where results and status updates are sent after execution.`})]})}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[a.deliverTo&&a.deliverTo.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Output`}),(0,M.jsx)(`div`,{className:`space-y-1`,children:a.deliverTo.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,M.jsx)(y,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`d-${t}`))})]}),a.reportTo&&a.reportTo.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Status Reports`}),(0,M.jsx)(`div`,{className:`space-y-1`,children:a.reportTo.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,M.jsx)(y,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`r-${t}`))})]})]})]}),B&&(a.status===`completed`||a.status===`failed`)&&(0,M.jsx)(I,{score:B}),a.tokenUsage&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Token Usage`}),(0,M.jsx)(x,{children:`Input and output token totals for this execution.`})]})}),(0,M.jsxs)(`div`,{className:`flex gap-6 text-sm`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Input:`}),` `,(0,M.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:a.tokenUsage.input.toLocaleString()})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Output:`}),` `,(0,M.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:a.tokenUsage.output.toLocaleString()})]})]})]}),m.length>0&&(()=>{let e=m[0],t=e.plan.overallRisk===`high`?`destructive`:e.plan.overallRisk===`medium`?`warning`:`secondary`;return(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Execution Plan`}),(0,M.jsx)(x,{children:`Expected steps, risk, and permissions before execution.`})]}),(0,M.jsxs)(y,{variant:t,children:[e.plan.overallRisk.toUpperCase(),` RISK`]}),(0,M.jsx)(y,{variant:`outline`,children:e.status})]})}),(0,M.jsxs)(`h4`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:[`Plan Steps (`,e.plan.steps.length,`)`]}),(0,M.jsx)(`div`,{className:`space-y-2`,children:e.plan.steps.map(e=>(0,M.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)]/50 p-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,e.index]}),(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:e.description})]}),(0,M.jsx)(y,{variant:e.riskLevel===`high`?`destructive`:e.riskLevel===`medium`?`warning`:`secondary`,children:e.riskLevel})]}),(0,M.jsxs)(`div`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:[`Tools: `,e.toolsNeeded.join(`, `)||`none`]}),e.expectedOutput&&(0,M.jsxs)(`div`,{className:`mt-0.5 text-xs text-[var(--app-text-subtle)]`,children:[`Expected: `,e.expectedOutput]})]},e.index))}),Object.keys(e.plan.requiredPermissions).length>0&&(0,M.jsxs)(`div`,{className:`mt-2`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-1`,children:`Required Permissions`}),(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.keys(e.plan.requiredPermissions).map(e=>(0,M.jsx)(y,{variant:`secondary`,children:e},e))})]}),e.deviationReport&&(0,M.jsxs)(`div`,{className:`mt-3 rounded-md border border-[var(--app-warning-soft-border)] bg-[var(--app-warning-soft-bg-subtle)] p-3`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-warning)] mb-2`,children:`Deviation Report`}),(0,M.jsxs)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2`,children:[`Planned: `,e.deviationReport.stepsPlanned,` | Executed: `,e.deviationReport.stepsExecuted,` | Accuracy: `,(e.deviationReport.overallAccuracy*100).toFixed(0),`%`]}),e.deviationReport.deviations.length>0&&(0,M.jsx)(`div`,{className:`space-y-1`,children:e.deviationReport.deviations.map((e,t)=>(0,M.jsxs)(`div`,{className:`text-xs`,children:[(0,M.jsxs)(`span`,{className:`text-[var(--app-warning)] font-mono`,children:[`[`,e.deviationType,`]`]}),(0,M.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[` Step `,e.stepIndex,`: `]}),(0,M.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.actual})]},t))})]}),e.learnedRules&&e.learnedRules.length>0&&(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:`Learned Rules`}),(0,M.jsx)(`ul`,{className:`space-y-1`,children:e.learnedRules.map((e,t)=>(0,M.jsxs)(`li`,{className:`text-xs text-[var(--app-text-muted)] flex items-start gap-1.5`,children:[(0,M.jsx)(`span`,{className:`text-[var(--app-accent)] mt-0.5`,children:`*`}),e]},t))})]})]})})(),N.length>0&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(b,{children:[`Execution Timeline (`,N.length,` steps)`]}),(0,M.jsx)(x,{children:`Ordered execution events, tool calls, and error markers.`})]})}),(0,M.jsx)(P,{logs:N})]}),a.result&&(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Result`}),(0,M.jsx)(x,{children:`The final task output. Raw text stays collapsed until needed.`})]}),a.result.length>360?(0,M.jsx)(_,{variant:`ghost`,size:`sm`,onClick:()=>Y(e=>!e),children:J?`Collapse`:`Expand`}):null]})}),(0,M.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-[var(--app-panel-elevated)] p-3 font-mono text-xs text-[var(--app-text)]`,children:a.result.length>360&&!J?`${a.result.slice(0,360)}…`:a.result})]}),a.error&&(()=>{let e=[`plugin`,`--plugin-dir`,`failed to load plugin`],t=a.error.toLowerCase(),n=e.some(e=>t.includes(e)),r=n?a.error.split(`
2
- `).find(t=>e.some(e=>t.toLowerCase().includes(e))):null;return(0,M.jsxs)(C,{className:n?`border-[var(--app-danger)]`:``,children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Error`}),(0,M.jsx)(x,{children:`Execution failed or returned an error condition.`})]}),n&&(0,M.jsx)(y,{variant:`warning`,children:`Plugin Issue`})]})}),n&&r&&(0,M.jsx)(`div`,{className:`mb-2 rounded bg-[var(--app-warning-soft-bg-subtle)] px-2 py-1 text-xs text-[var(--app-warning)]`,children:r}),(0,M.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-[var(--app-danger-soft-bg-subtle)] p-3 font-mono text-xs text-[var(--app-danger)]`,children:a.error})]})})(),(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(b,{children:`Diagnostics`}),(0,M.jsx)(x,{children:Q})]})}),X?R.length>0?(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(T,{title:`Delivery Log`,description:`Recent delivery attempts and outcomes.`}),(0,M.jsx)(`div`,{className:`space-y-2`,children:R.map(e=>{let t=e.status===`delivered`?`success`:e.status===`pending`?`secondary`:`destructive`,n=e.target.type===`webhook`?e.target.webhookUrl:e.target.type===`channel`?`channel ${e.target.channelId.slice(0,8)}`:`session ${e.target.sessionId?.slice(0,8)}`;return(0,M.jsxs)(`div`,{className:`surface-panel-muted rounded-lg px-3 py-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(y,{variant:t,children:e.status}),(0,M.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:n}),e.messageType?(0,M.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`(`,e.messageType,`)`]}):null]}),e.error?(0,M.jsx)(`p`,{className:`mt-2 text-xs text-[var(--app-danger-soft-text)]`,children:e.error}):null,(0,M.jsxs)(`p`,{className:`mt-2 text-xs text-[var(--app-text-subtle)]`,children:[D(e.createdAt),e.deliveredAt&&` \u2192 ${D(e.deliveredAt)}`]})]},e.id)})})]}):(0,M.jsx)(`div`,{className:`surface-panel-muted rounded-lg px-4 py-4 text-sm text-[var(--app-text-subtle)]`,children:`No delivery events recorded yet.`}):(0,M.jsx)(`div`,{className:`surface-panel-muted rounded-lg px-4 py-4 text-sm text-[var(--app-text-subtle)]`,children:`Diagnostics are hidden by default because this section can contain raw execution details and operational data.`})]})]})}function I({score:e}){let t=[{label:`Task Success`,value:e.scores.taskSuccess,weight:`30%`},{label:`Plan Accuracy`,value:e.scores.planAccuracy,weight:`25%`},{label:`Permission Compliance`,value:e.scores.permissionCompliance,weight:`25%`},{label:`Efficiency`,value:e.scores.efficiency,weight:`20%`}];return(0,M.jsxs)(C,{children:[(0,M.jsx)(S,{children:(0,M.jsx)(b,{children:`Quality Score`})}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[t.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs`,children:[(0,M.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[e.label,` `,(0,M.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`(`,e.weight,`)`]})]}),(0,M.jsxs)(`span`,{className:`font-mono text-[var(--app-text)]`,children:[(e.value*100).toFixed(0),`%`]})]}),(0,M.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-[var(--app-panel-elevated)]`,children:(0,M.jsx)(`div`,{className:`h-full rounded-full ${e.value<.4?`bg-[var(--app-danger)]`:`bg-[var(--app-accent)]`}`,style:{width:`${e.value*100}%`}})})]},e.label)),(0,M.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-[var(--app-border)] pt-2`,children:[(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`Weighted Score`}),(0,M.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-[var(--app-text)]`,children:[(e.scores.weighted*100).toFixed(0),`%`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`EMA (after this task)`}),(0,M.jsxs)(`span`,{className:`font-mono text-sm font-semibold ${e.emaScore<.4?`text-[var(--app-danger)]`:`text-[var(--app-success)]`}`,children:[(e.emaScore*100).toFixed(0),`%`]})]})]})]})}function L({icon:e,label:t,value:n,mono:r}){return(0,M.jsxs)(C,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[var(--app-text-subtle)]`,children:[(0,M.jsx)(e,{size:12}),(0,M.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,M.jsx)(`span`,{className:`text-sm text-[var(--app-text)] truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{F as TaskDetail};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{$ as t,E as n,N as r,S as i,T as a,V as o,ct as s,et as c,it as l,s as u,tt as d,y as f}from"./vendor-icons-Dk0hMuJz.js";import{r as p,t as m}from"./vendor-react-C6faO6LO.js";import{i as h,n as g}from"./dist-Bdqp1ixJ.js";import{_,a as v,b as y,c as b,d as x,g as ee,i as S,n as C,o as te,p as w,r as ne,s as re,t as ie,u as ae,v as T,x as E}from"./AlertDialog-CfeiyMrc.js";import{i as D,t as O}from"./Button-DuQctNms.js";import{t as oe}from"./vendor-state-DahK0J-G.js";import{i as k,n as A,r as j,t as M}from"./index-DYsO5Awn.js";import{t as N}from"./Card-rKfViPS2.js";import{t as P}from"./PageHeader-CHSgtxPw.js";import{t as se}from"./SectionHeader-C2WpiwJ5.js";import{a as ce,o as le,t as ue}from"./format-CHfBBLog.js";import{t as de}from"./EmptyState-CIdIlMbn.js";import{t as fe}from"./ui-B_uMx2Fy.js";import{t as pe}from"./useIsMobileLayout-C6KIQjuh.js";import{a as me,i as F,n as he,o as ge,r as I,t as _e}from"./Table-DuOLbyJQ.js";import{t as ve}from"./Switch-CfTpXW9_.js";import{Goals as ye,t as be}from"./Goals-CylKmR9j.js";var L=e(s(),1),R=m();function xe(e){let t=e+`CollectionProvider`,[n,r]=y(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=L.useRef(null),a=L.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=T(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:D(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=T(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=D(t,o),c=a(u,n);return L.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return L.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Se=L.createContext(void 0);function Ce(e){let t=L.useContext(Se);return e||t||`ltr`}var z=`rovingFocusGroup.onEntryFocus`,we={bubbles:!1,cancelable:!0},B=`RovingFocusGroup`,[V,Te,H]=xe(B),[Ee,De]=y(B,[H]),[U,Oe]=Ee(B),W=L.forwardRef((e,t)=>(0,R.jsx)(V.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(V.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ke,{...e,ref:t})})}));W.displayName=B;var ke=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=L.useRef(null),p=D(t,f),m=Ce(a),[h,g]=ae({prop:o,defaultProp:s??null,onChange:c,caller:B}),[v,y]=L.useState(!1),b=ee(l),x=Te(n),S=L.useRef(!1),[C,te]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(z,b),()=>e.removeEventListener(z,b)},[b]),(0,R.jsx)(U,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:L.useCallback(e=>g(e),[g]),onItemShiftTab:L.useCallback(()=>y(!0),[]),onFocusableItemAdd:L.useCallback(()=>te(e=>e+1),[]),onFocusableItemRemove:L.useCallback(()=>te(e=>e-1),[]),children:(0,R.jsx)(_.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:E(e.onMouseDown,()=>{S.current=!0}),onFocus:E(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(z,we);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Pe([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:E(e.onBlur,()=>y(!1))})})}),G=`RovingFocusGroupItem`,Ae=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=w(),l=a||c,u=Oe(G,n),d=u.currentTabStopId===l,f=Te(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(V.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(_.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:E(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:E(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:E(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ne(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Fe(n,r+1):n.slice(r+1)}setTimeout(()=>Pe(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ae.displayName=G;var je={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Me(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ne(e,t,n){let r=Me(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return je[r]}function Pe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Fe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ie=W,Le=Ae,K=`Tabs`,[Re,ze]=y(K,[De]),Be=De(),[Ve,q]=Re(K),J=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Ce(s),[d,f]=ae({prop:r,onChange:i,defaultProp:a??``,caller:K});return(0,R.jsx)(Ve,{scope:n,baseId:w(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,R.jsx)(_.div,{dir:u,"data-orientation":o,...l,ref:t})})});J.displayName=K;var He=`TabsList`,Ue=L.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=q(He,n),o=Be(n);return(0,R.jsx)(Ie,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,R.jsx)(_.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Ue.displayName=He;var We=`TabsTrigger`,Ge=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=q(We,n),s=Be(n),c=X(o.baseId,r),l=qe(o.baseId,r),u=r===o.value;return(0,R.jsx)(Le,{asChild:!0,...s,focusable:!i,active:u,children:(0,R.jsx)(_.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:E(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:E(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:E(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Ge.displayName=We;var Y=`TabsContent`,Ke=L.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=q(Y,n),c=X(s.baseId,r),l=qe(s.baseId,r),u=r===s.value,d=L.useRef(u);return L.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(x,{present:i||u,children:({present:n})=>(0,R.jsx)(_.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});Ke.displayName=Y;function X(e,t){return`${e}-trigger-${t}`}function qe(e,t){return`${e}-content-${t}`}var Je=J,Ye=Ue,Xe=Ge,Ze=Ke,Qe=Je,$e=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ye,{ref:n,className:h(`surface-panel-muted inline-flex min-h-11 items-center justify-center gap-1 rounded-full p-1 text-[var(--app-text-muted)]`,e),...t}));$e.displayName=Ye.displayName;var Z=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Xe,{ref:n,className:h(`inline-flex items-center justify-center whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium ring-offset-[var(--app-canvas)] transition-[background-color,color,box-shadow] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:surface-panel data-[state=active]:text-[var(--app-text)] data-[state=active]:shadow-[var(--app-shadow-sm)]`,e),...t}));Z.displayName=Xe.displayName;var Q=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ze,{ref:n,className:h(`mt-4 ring-offset-[var(--app-canvas)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2`,e),...t}));Q.displayName=Ze.displayName;var et=[{label:`All`,value:`all`},{label:`Running`,value:`running`},{label:`Pending`,value:`pending`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`},{label:`Cancelled`,value:`cancelled`},{label:`Blocked`,value:`blocked`}],$=new Set([`pending`,`queued`,`running`,`paused`]);function tt(){let e=j(e=>e.tasks),t=j(e=>e.fetchTasks),[n,a]=(0,L.useState)(`all`),[o,s]=(0,L.useState)(!1),[c,u]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[_,v]=(0,L.useState)(new Set),[y,b]=(0,L.useState)(!1),x=pe();(0,L.useEffect)(()=>{let e=n===`all`?void 0:n;t(e);let r=setInterval(()=>void t(e),5e3);return()=>clearInterval(r)},[t,n]),(0,L.useEffect)(()=>{v(new Set)},[n]);let ee=async()=>{if(c.trim()){h(!0);try{await g(`/tasks`,{method:`POST`,body:JSON.stringify({prompt:c.trim()})}),u(``),s(!1),t(n===`all`?void 0:n)}finally{h(!1)}}},S=e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},C=()=>{let e=w.filter(e=>$.has(e.status)).map(e=>e.id);v(new Set(e))},te=async()=>{if(_.size!==0){b(!0);try{await g(`/tasks/batch-cancel`,{method:`POST`,body:JSON.stringify({taskIds:Array.from(_)})}),v(new Set),t(n===`all`?void 0:n)}finally{b(!1)}}},w=[...e].sort((e,t)=>t.createdAt-e.createdAt),ne=Array.from(_).filter(t=>{let n=e.find(e=>e.id===t);return n&&$.has(n.status)});return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(se,{title:`Tasks`,description:`Review active execution, cancel work, or create the next task.`,compact:!0,action:(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[_.size>0&&(0,R.jsxs)(O,{variant:`destructive`,size:`sm`,onClick:()=>void te(),disabled:y||ne.length===0,children:[(0,R.jsx)(l,{size:fe.sm}),y?`Cancelling...`:`Cancel ${ne.length} task${ne.length===1?``:`s`}`]}),(0,R.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void t(n===`all`?void 0:n),children:(0,R.jsx)(f,{size:fe.sm})}),(0,R.jsxs)(O,{size:`sm`,onClick:()=>s(!o),children:[(0,R.jsx)(i,{size:fe.sm}),`New Task`]})]})}),o&&(0,R.jsxs)(N,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Enter task prompt...`,value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ee()}}),(0,R.jsx)(O,{onClick:()=>void ee(),disabled:m||!c.trim(),children:m?`Creating...`:`Create`}),(0,R.jsx)(O,{variant:`ghost`,onClick:()=>s(!1),children:`Cancel`})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:et.map(e=>(0,R.jsx)(`button`,{onClick:()=>a(e.value),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${n===e.value?`bg-[var(--app-panel-elevated)] text-[var(--app-text)]`:`text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:e.label},e.value))}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[w.some(e=>$.has(e.status))&&(0,R.jsx)(`button`,{onClick:C,className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:`Select all cancellable`}),_.size>0&&(0,R.jsxs)(`button`,{onClick:()=>v(new Set),className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:[`Clear selection (`,_.size,`)`]})]})]}),w.length===0?(0,R.jsx)(N,{padding:!1,children:(0,R.jsx)(de,{icon:(0,R.jsx)(r,{size:32}),title:`No tasks found`,description:n===`all`?`Create a task to get started`:`No tasks with status "${n}"`})}):x?(0,R.jsx)(`div`,{className:`space-y-3`,children:w.map(e=>(0,R.jsx)(N,{className:_.has(e.id)?`border-[var(--app-accent)]/40 bg-[var(--app-accent)]/8`:``,children:(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(`div`,{className:`pt-1`,children:$.has(e.status)?(0,R.jsx)(`button`,{onClick:()=>S(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${_.has(e.id)?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:_.has(e.id)&&(0,R.jsx)(d,{size:12})}):(0,R.jsx)(`span`,{className:`inline-block h-4 w-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,R.jsx)(p,{to:`/tasks/${e.id}`,className:`break-all font-mono text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.id.slice(0,8)}),(0,R.jsx)(`p`,{className:`break-words text-sm font-medium leading-6 text-[var(--app-text)]`,children:le(e.prompt,140)})]}),(0,R.jsx)(M,{variant:A(e.status),children:e.status})]}),(0,R.jsxs)(`div`,{className:`grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Role`}),(0,R.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.roleId?e.roleId.slice(0,12):`—`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Cost`}),(0,R.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.costUsd==null?`—`:ue(e.costUsd)})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Created`}),(0,R.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:ce(e.createdAt)})]})]})]})]})},e.id))}):(0,R.jsx)(N,{padding:!1,children:(0,R.jsxs)(_e,{children:[(0,R.jsx)(me,{children:(0,R.jsxs)(ge,{children:[(0,R.jsx)(F,{className:`w-8`,children:(0,R.jsx)(`button`,{onClick:()=>{_.size>0&&_.size===w.filter(e=>$.has(e.status)).length?v(new Set):C()},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${_.size>0&&_.size===w.filter(e=>$.has(e.status)).length?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:_.size>0&&_.size===w.filter(e=>$.has(e.status)).length&&(0,R.jsx)(d,{size:12})})}),(0,R.jsx)(F,{children:`ID`}),(0,R.jsx)(F,{children:`Prompt`}),(0,R.jsx)(F,{children:`Status`}),(0,R.jsx)(F,{children:`Role`}),(0,R.jsx)(F,{children:`Cost`}),(0,R.jsx)(F,{children:`Created`})]})}),(0,R.jsx)(he,{children:w.map(e=>(0,R.jsxs)(ge,{className:_.has(e.id)?`bg-[var(--app-panel-elevated)]/50`:``,children:[(0,R.jsx)(I,{children:$.has(e.status)?(0,R.jsx)(`button`,{onClick:()=>S(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${_.has(e.id)?`border-[var(--app-accent-strong)] bg-[var(--app-accent)] text-white`:`border-[var(--app-border-strong)] bg-transparent hover:border-[var(--app-text-muted)]`}`,children:_.has(e.id)&&(0,R.jsx)(d,{size:12})}):(0,R.jsx)(`span`,{className:`inline-block w-4`})}),(0,R.jsx)(I,{children:(0,R.jsx)(p,{to:`/tasks/${e.id}`,className:`font-mono text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:e.id.slice(0,8)})}),(0,R.jsx)(I,{children:(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`div`,{className:`break-words font-medium text-[var(--app-text)]`,children:le(e.prompt,120)}),(0,R.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.totalDurationMs?ue(e.costUsd??0):`Awaiting completion`,` · `,ce(e.createdAt)]})]})}),(0,R.jsx)(I,{children:(0,R.jsx)(M,{variant:A(e.status),children:e.status})}),(0,R.jsx)(I,{children:(0,R.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:e.roleId?e.roleId.slice(0,12):`—`})}),(0,R.jsx)(I,{className:`font-mono text-xs`,children:e.costUsd==null?`—`:ue(e.costUsd)}),(0,R.jsx)(I,{className:`text-xs text-[var(--app-text-subtle)]`,children:ce(e.createdAt)})]},e.id))})]})})]})}function nt(e){return`step-${e+1}`}function rt(){let e=j(e=>e.templates),r=j(e=>e.fetchTemplates),s=j(e=>e.goals),l=j(e=>e.fetchGoals),d=j(e=>e.roles),p=j(e=>e.fetchRoles),[m,h]=(0,L.useState)(!1),[_,y]=(0,L.useState)(``),[x,ee]=(0,L.useState)(`manual`),[w,ae]=(0,L.useState)(``),[T,E]=(0,L.useState)(``),[D,oe]=(0,L.useState)(``),[A,P]=(0,L.useState)([{id:`step-1`,prompt:``}]),[le,ue]=(0,L.useState)(!1),[fe,pe]=(0,L.useState)(!1),[ye,xe]=(0,L.useState)(null),[Se,Ce]=(0,L.useState)(null),[z,we]=(0,L.useState)(null),[B,V]=(0,L.useState)(null),[Te,H]=(0,L.useState)(`template_only`),[Ee,De]=(0,L.useState)(!1),[U,Oe]=(0,L.useState)(null),[W,ke]=(0,L.useState)(``),[G,Ae]=(0,L.useState)(`manual`),[je,Me]=(0,L.useState)(``),[Ne,Pe]=(0,L.useState)(``),[Fe,Ie]=(0,L.useState)(``),[Le,K]=(0,L.useState)(``),[Re,ze]=(0,L.useState)(``),[Be,Ve]=(0,L.useState)([]),[q,J]=(0,L.useState)([]),[He,Ue]=(0,L.useState)(!1),[We,Ge]=(0,L.useState)(!1),[Y,Ke]=(0,L.useState)(`prompt`),[X,qe]=(0,L.useState)([]),[Je,Ye]=(0,L.useState)([]),[Xe,Ze]=(0,L.useState)([]),[Qe,$e]=(0,L.useState)(null),[Z,Q]=(0,L.useState)([]),[et,$]=(0,L.useState)(!1),tt=(0,L.useCallback)(async e=>{$(!0);try{let t=await g(`/workflow-executions?templateId=${e}&limit=5`);Q(await Promise.all(t.executions.map(async e=>{try{let t=await g(`/workflow-executions/${e.id}`);return{...t.execution,stepTasks:t.stepTasks}}catch{return{...e,stepTasks:[]}}})))}catch{Q([])}finally{$(!1)}},[]),rt=(0,L.useCallback)(e=>{Qe===e?($e(null),Q([])):($e(e),tt(e))},[Qe,tt]),it=(0,L.useMemo)(()=>Object.fromEntries(e.map(e=>[e.id,e.name])),[e]),at=e=>e.type===`cron`?`Cron: ${e.cron??`—`}`:e.type===`once`?`Once at ${e.runAt?new Date(e.runAt).toLocaleString():`—`}`:e.type===`template_complete`?`When template '${it[e.event?.split(`:`)[1]??``]??`[deleted template]`}' completes`:e.type===`event`?`On event '${Be.find(t=>t.id===e.eventDefId)?.name??`[deleted event]`}'`:e.type;(0,L.useEffect)(()=>{r(),l(),p(),(async()=>{try{Ve(await g(`/event-defs`))}catch{}})()},[r,l,p]);let ot=async()=>{if(_.trim()&&!(Y===`prompt`&&A.every(e=>!e.prompt.trim()))&&!(Y===`goal`&&X.length===0)){pe(!0);try{let e={name:_.trim(),trigger:{type:x,...x===`cron`&&T?{cron:T}:{},...x===`once`&&D?{runAt:new Date(D).toISOString()}:{},...x===`template_complete`&&w?{event:`template_complete:${w}`}:{},...x===`event`&&Le?{eventDefId:Le}:{}},enabled:!0,...Je.length>0?{deliverTo:Je}:{},...le?{config:{continueOnError:!0}}:{}};Y===`prompt`?e.steps=A.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||nt(t),prompt:e.prompt.trim(),...e.roleId?{roleId:e.roleId}:{},...e.dependsOn&&e.dependsOn.length>0?{dependsOn:e.dependsOn}:{},...e.config&&(e.config.timeout!==void 0||e.config.maxTurns!==void 0)?{config:e.config}:{}})):(e.goalIds=X,e.steps=[]),await g(`/task-templates`,{method:`POST`,body:JSON.stringify(e)}),y(``),P([{id:`step-1`,prompt:``}]),E(``),oe(``),ae(``),K(``),qe([]),Ye([]),h(!1),r()}finally{pe(!1)}}},st=async t=>{let n=e.find(e=>e.id===t);xe(t);try{await g(`/task-templates/${t}/run`,{method:`POST`}),k.success(`Triggered: ${n?.name??t}`)}catch(e){let t=e instanceof Error?e.message:`Failed to trigger template`;k.error(`Trigger failed: ${t}`)}finally{xe(null)}},ct=async e=>{we(e),H(`template_only`),V(null);try{V((await g(`/task-templates/${e}/dependents`)).dependents)}catch{V({executionCount:0,taskCount:0})}},lt=async(t,n)=>{let i=e.find(e=>e.id===t);De(!0);try{let e=await g(`/task-templates/${t}?mode=${n}`,{method:`DELETE`}),a=[];e.deletedCounts.workflowExecutions>0&&a.push(`${e.deletedCounts.workflowExecutions} execution${e.deletedCounts.workflowExecutions===1?``:`s`}`),e.deletedCounts.tasks>0&&a.push(`${e.deletedCounts.tasks} task${e.deletedCounts.tasks===1?``:`s`}`);let o=a.length?` (+ ${a.join(`, `)})`:``;k.success(`Deleted: ${i?.name??t}${o}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to delete template`;k.error(`Delete failed: ${t}`)}finally{De(!1)}},ut=async t=>{let n=e.find(e=>e.id===t);if(!n)return;if(![`cron`,`once`,`template_complete`].includes(n.trigger.type)){k.error(`Toggle not applicable for manual triggers`);return}let i=!n.enabled;try{await g(`/task-templates/${t}`,{method:`PATCH`,body:JSON.stringify({enabled:i})}),k.success(`${n.name} ${i?`enabled`:`disabled`}`),r()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle template`;k.error(`Toggle failed: ${t}`)}},dt=e=>{Oe(e.id),ke(e.name),Ae(e.trigger.type===`workflow_complete`?`template_complete`:e.trigger.type),Me(e.trigger.cron??``),Pe(e.trigger.runAt?new Date(e.trigger.runAt).toISOString().slice(0,16):``),J(e.steps.map(e=>({id:e.id,prompt:e.prompt,roleId:e.roleId,dependsOn:e.dependsOn,config:e.config}))),Ue(e.config?.continueOnError??!1),Ze(e.deliverTo??[]),Ie(e.trigger.type===`template_complete`||e.trigger.type===`workflow_complete`?e.trigger.event?.split(`:`)[1]??``:``),ze(e.trigger.eventDefId??``)},ft=async()=>{if(!(!U||!W.trim()||q.every(e=>!e.prompt.trim()))){Ge(!0);try{await g(`/task-templates/${U}`,{method:`PATCH`,body:JSON.stringify({name:W.trim(),trigger:{type:G,...G===`cron`&&je?{cron:je}:{},...G===`once`&&Ne?{runAt:new Date(Ne).toISOString()}:{},...G===`template_complete`&&Fe?{event:`template_complete:${Fe}`}:{},...G===`event`&&Re?{eventDefId:Re}:{}},steps:q.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||nt(t),prompt:e.prompt.trim(),...e.roleId?{roleId:e.roleId}:{},...e.dependsOn&&e.dependsOn.length>0?{dependsOn:e.dependsOn}:{},...e.config&&(e.config.timeout!==void 0||e.config.maxTurns!==void 0)?{config:e.config}:{}})),enabled:e.find(e=>e.id===U)?.enabled??!0,...He?{config:{continueOnError:!0}}:{config:{}},deliverTo:Xe.length>0?Xe:void 0})}),Oe(null),r(),k.success(`Template updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update template`;k.error(t)}finally{Ge(!1)}}},pt=e.find(e=>e.id===Se),mt=e.find(e=>e.id===z);return(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(se,{title:`Automations`,description:`Reusable workflows, manual triggers, and recent workflow runs.`,compact:!0,action:(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void r(),children:(0,R.jsx)(f,{size:14})}),(0,R.jsxs)(O,{size:`sm`,onClick:()=>h(!m),children:[(0,R.jsx)(i,{size:14}),`New Automation`]})]})}),m&&(0,R.jsxs)(N,{className:`space-y-3`,children:[(0,R.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Template name`,value:_,onChange:e=>y(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:x,onChange:e=>ee(e.target.value),children:[(0,R.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,R.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,R.jsx)(`option`,{value:`once`,children:`One-time`}),(0,R.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,R.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),x===`template_complete`&&(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:w,onChange:e=>ae(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==U).map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),x===`event`&&(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Le,onChange:e=>K(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`-- Select event --`}),Be.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),x===`cron`&&(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Cron expression (e.g. */5 * * * *)`,value:T,onChange:e=>E(e.target.value)}),x===`once`&&(0,R.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:D,onChange:e=>oe(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Action type:`}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>Ke(`prompt`),className:`rounded px-2 py-1 text-xs ${Y===`prompt`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Custom Prompt`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>Ke(`goal`),className:`rounded px-2 py-1 text-xs ${Y===`goal`?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-muted)] hover:text-[var(--app-text)]`}`,children:`Goal Reference`})]})]}),Y===`prompt`?(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,R.jsxs)(O,{variant:`ghost`,size:`sm`,onClick:()=>P([...A,{id:nt(A.length),prompt:``}]),children:[(0,R.jsx)(i,{size:12}),` Add Step`]})]}),A.map((e,t)=>(0,R.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,R.jsxs)(`select`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)]`,value:e.roleId??``,onChange:n=>{let r=[...A];r[t]={...e,roleId:n.target.value||void 0},P(r)},children:[(0,R.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),A.length>1&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>P(A.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,R.jsx)(u,{size:12})})]}),(0,R.jsx)(`textarea`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Step ${t+1} prompt${t>0?` (use {{`+A[t-1].id+`.result}} for prev output)`:``}`,rows:2,value:e.prompt,onChange:n=>{let r=[...A];r[t]={...e,prompt:n.target.value},P(r)}}),t>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),A.slice(0,t).map(n=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...A];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},P(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.dependsOn??[]).includes(n.id)?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id))]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,R.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.timeout??``,onChange:n=>{let r=[...A],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},P(r)}})]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,R.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.maxTurns??``,onChange:n=>{let r=[...A],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},P(r)}})]})]})]},e.id))]}):(0,R.jsx)(`div`,{className:`space-y-1`,children:s.length===0?(0,R.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No goals available`}):s.map(e=>(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] hover:text-[var(--app-text)] cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:X.includes(e.id),onChange:t=>{t.target.checked?qe([...X,e.id]):qe(X.filter(t=>t!==e.id))},className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name}),(0,R.jsx)(M,{variant:`muted`,className:`text-[10px]`,children:e.status})]},e.id))}),A.length>1&&(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:le,onChange:e=>ue(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error (skip failed step dependents, run independent steps)`]}),(0,R.jsx)(be,{value:Je,onChange:Ye}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(O,{onClick:()=>void ot(),disabled:fe||!_.trim()||Y===`prompt`&&A.every(e=>!e.prompt.trim())||Y===`goal`&&X.length===0||x===`template_complete`&&!w,children:fe?`Creating...`:`Create`}),(0,R.jsx)(O,{variant:`ghost`,onClick:()=>h(!1),children:`Cancel`})]})]}),U!==null&&(0,R.jsxs)(N,{className:`space-y-3`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Edit Automation`}),(0,R.jsx)(`input`,{className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Template name`,value:W,onChange:e=>ke(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:G,onChange:e=>Ae(e.target.value),children:[(0,R.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,R.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,R.jsx)(`option`,{value:`once`,children:`One-time`}),(0,R.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,R.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),G===`template_complete`&&(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Fe,onChange:e=>Ie(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==U).map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),G===`event`&&(0,R.jsxs)(`select`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Re,onChange:e=>ze(e.target.value),children:[(0,R.jsx)(`option`,{value:``,children:`-- Select event --`}),Be.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),G===`cron`&&(0,R.jsx)(`input`,{className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Cron expression`,value:je,onChange:e=>Me(e.target.value)}),G===`once`&&(0,R.jsx)(`input`,{type:`datetime-local`,className:`flex-1 rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-3 py-1.5 text-sm text-[var(--app-text)] focus:border-[var(--app-accent)] focus:outline-none`,value:Ne,onChange:e=>Pe(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,R.jsxs)(O,{variant:`ghost`,size:`sm`,onClick:()=>J([...q,{id:nt(q.length),prompt:``}]),children:[(0,R.jsx)(i,{size:12}),` Add Step`]})]}),q.map((e,t)=>(0,R.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,R.jsxs)(`select`,{className:`flex-1 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-xs text-[var(--app-text)]`,value:e.roleId??``,onChange:n=>{let r=[...q];r[t]={...e,roleId:n.target.value||void 0},J(r)},children:[(0,R.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),q.length>1&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>J(q.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,R.jsx)(u,{size:12})})]}),(0,R.jsx)(`textarea`,{className:`w-full rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1.5 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)] focus:border-[var(--app-accent)] focus:outline-none`,placeholder:`Step ${t+1} prompt`,rows:2,value:e.prompt,onChange:n=>{let r=[...q];r[t]={...e,prompt:n.target.value},J(r)}}),t>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),q.slice(0,t).map(n=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...q];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},J(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.dependsOn??[]).includes(n.id)?`bg-[var(--app-accent)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id))]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,R.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.timeout??``,onChange:n=>{let r=[...q],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},J(r)}})]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,R.jsx)(`input`,{type:`number`,min:0,placeholder:`default`,className:`w-20 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)]`,value:e.config?.maxTurns??``,onChange:n=>{let r=[...q],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},J(r)}})]})]})]},e.id))]}),q.length>1&&(0,R.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:He,onChange:e=>Ue(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error`]}),(0,R.jsx)(be,{value:Xe,onChange:Ze}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(O,{onClick:()=>void ft(),disabled:We||!W.trim()||q.every(e=>!e.prompt.trim()),children:We?`Saving...`:`Save`}),(0,R.jsx)(O,{variant:`ghost`,onClick:()=>Oe(null),children:`Cancel`})]})]}),(0,R.jsx)(N,{padding:!1,children:e.length===0?(0,R.jsx)(de,{icon:(0,R.jsx)(o,{size:32}),title:`No automations`,description:`Create an automation to run recurring tasks`}):(0,R.jsxs)(_e,{children:[(0,R.jsx)(me,{children:(0,R.jsxs)(ge,{children:[(0,R.jsx)(F,{children:`Name`}),(0,R.jsx)(F,{children:`Trigger`}),(0,R.jsx)(F,{children:`Schedule`}),(0,R.jsx)(F,{children:`Steps`}),(0,R.jsx)(F,{children:`Enabled`}),(0,R.jsx)(F,{children:`Created`}),(0,R.jsx)(F,{children:`Webhook URL`}),(0,R.jsx)(F,{children:`Actions`})]})}),(0,R.jsx)(he,{children:e.map(e=>(0,R.jsxs)(L.Fragment,{children:[(0,R.jsxs)(ge,{children:[(0,R.jsx)(I,{className:`font-medium text-[var(--app-text)]`,children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>rt(e.id),className:`flex items-center gap-1 hover:text-[var(--app-accent)] transition-colors`,children:[Qe===e.id?(0,R.jsx)(c,{size:12}):(0,R.jsx)(t,{size:12}),e.name]})}),(0,R.jsx)(I,{children:(0,R.jsx)(M,{variant:e.trigger.type===`cron`?`info`:(e.trigger.type,`muted`),children:at(e.trigger)})}),(0,R.jsx)(I,{className:`font-mono text-xs`,children:e.trigger.type===`once`&&e.trigger.runAt?new Date(e.trigger.runAt).toLocaleString():e.trigger.cron??`—`}),(0,R.jsx)(I,{className:`font-mono text-xs`,children:e.goalIds&&e.goalIds.length>0?`Goals: ${e.goalIds.length}`:(()=>{let t=new Set(e.steps.filter(e=>e.roleId).map(e=>e.roleId));return t.size>0?`${e.steps.length} steps / ${t.size} roles`:String(e.steps.length)})()}),(0,R.jsx)(I,{children:[`cron`,`once`,`template_complete`].every(t=>e.trigger.type!==t)?(0,R.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`—`}):(0,R.jsx)(ve,{checked:e.enabled,onCheckedChange:()=>void ut(e.id),"aria-label":`Toggle ${e.name}`})}),(0,R.jsx)(I,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.createdAt?ce(e.createdAt):`—`}),(0,R.jsx)(I,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.enabled?`POST /webhooks/${e.id}`:`—`}),(0,R.jsx)(I,{children:(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>dt(e),title:`Edit`,children:(0,R.jsx)(n,{size:12})}),(0,R.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>Ce(e.id),disabled:ye===e.id,title:`Run now`,children:(0,R.jsx)(a,{size:12})}),(0,R.jsx)(O,{variant:`ghost`,size:`sm`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>{ct(e.id)},title:`Delete`,children:(0,R.jsx)(u,{size:12})})]})})]}),Qe===e.id&&(0,R.jsx)(ge,{children:(0,R.jsxs)(I,{colSpan:8,className:`bg-[var(--app-panel)]/50 p-3`,children:[(0,R.jsx)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2 font-medium`,children:`Recent Executions`}),et?(0,R.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading...`}):Z.length===0?(0,R.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No executions yet`}):(0,R.jsx)(`div`,{className:`space-y-1.5`,children:Z.map(t=>{let n=Object.entries(t.stepStatuses),r=n.filter(([,e])=>e.status===`completed`).length,i=n.filter(([,e])=>e.status===`failed`).length,a=n.filter(([,e])=>e.status===`skipped`).length,o=n.filter(([,e])=>e.status===`cancelled`).length,s=n.length,c=new Map(t.stepTasks.filter(e=>e.stepId).map(e=>[e.stepId,e])),l=[...e.steps.map(e=>e.id),...Object.keys(t.stepStatuses).filter(t=>!e.steps.some(e=>e.id===t))];return(0,R.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-canvas)]/50 p-2.5 space-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,R.jsx)(M,{variant:t.status===`completed`?`success`:t.status===`failed`?`destructive`:t.status===`partial`?`warning`:t.status===`cancelled`?`secondary`:`muted`,children:t.status}),(0,R.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:new Date(t.startedAt).toLocaleString()}),s>0&&(0,R.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[r,`/`,s,` steps`,(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[i>0&&(0,R.jsxs)(`span`,{className:`text-[var(--app-danger)]`,children:[i,` failed`]}),a>0&&(0,R.jsxs)(`span`,{className:`text-[var(--app-warning)]`,children:[a,` skipped`]}),o>0&&(0,R.jsxs)(`span`,{className:`text-[var(--app-text)]`,children:[o,` cancelled`]})]})]}),t.completedAt&&(0,R.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[Math.round((t.completedAt-t.startedAt)/1e3),`s`]}),(0,R.jsx)(`span`,{className:`font-mono text-[var(--app-text-subtle)] truncate max-w-[120px]`,children:t.id.slice(0,8)})]}),(0,R.jsx)(`div`,{className:`space-y-1.5`,children:l.map(n=>{let r=t.stepStatuses[n];if(!r)return null;let i=e.steps.find(e=>e.id===n),a=c.get(n),o=a?.roleId??r.roleId??i?.roleId,s=d.find(e=>e.id===o)?.name??o,l=a?.error??r.error??a?.result??r.result;return(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2 rounded bg-[var(--app-panel)]/60 px-2 py-1.5 text-xs`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:n}),s&&(0,R.jsxs)(`span`,{className:`text-[var(--app-warning-soft-text)]`,children:[`@`,s]}),i?.dependsOn&&i.dependsOn.length>0&&(0,R.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`after `,i.dependsOn.join(`, `)]})]}),l&&(0,R.jsx)(`div`,{className:`mt-1 truncate ${r.status===`failed`?`text-[var(--app-danger-soft-text)]`:r.status===`skipped`?`text-[var(--app-warning-soft-text)]`:r.status===`cancelled`?`text-[var(--app-text)]`:`text-[var(--app-text-muted)]`}`,children:l})]}),(0,R.jsx)(M,{variant:r.status===`completed`?`success`:r.status===`failed`?`destructive`:r.status===`skipped`?`warning`:r.status===`cancelled`?`secondary`:`muted`,children:r.status}),(0,R.jsxs)(`div`,{className:`text-right text-[var(--app-text-subtle)]`,children:[a?.completedAt&&(0,R.jsxs)(`div`,{children:[Math.max(0,Math.round((a.completedAt-a.createdAt)/1e3)),`s`]}),a?.id&&(0,R.jsx)(`div`,{className:`font-mono`,children:a.id.slice(0,8)})]})]},`${t.id}-${n}`)})})]},t.id)})})]})})]},e.id))})]})}),(0,R.jsx)(ie,{open:Se!==null,onOpenChange:e=>{e||Ce(null)},children:(0,R.jsxs)(S,{children:[(0,R.jsxs)(re,{children:[(0,R.jsx)(b,{children:`Run Template`}),(0,R.jsxs)(v,{children:[`Run “`,pt?.name,`” now? This will execute the template immediately.`]})]}),(0,R.jsxs)(te,{children:[(0,R.jsx)(ne,{children:`Cancel`}),(0,R.jsx)(C,{onClick:()=>{Se&&st(Se),Ce(null)},children:`Run Now`})]})]})}),(0,R.jsx)(ie,{open:z!==null,onOpenChange:e=>{e||(we(null),V(null),H(`template_only`))},children:(0,R.jsxs)(S,{children:[(0,R.jsxs)(re,{children:[(0,R.jsx)(b,{children:`Delete Template`}),(0,R.jsx)(v,{children:B===null?(0,R.jsx)(R.Fragment,{children:`Loading…`}):B.taskCount===0&&B.executionCount===0?(0,R.jsxs)(R.Fragment,{children:[`Delete “`,mt?.name,`”? This action cannot be undone.`]}):B.taskCount===0?(0,R.jsxs)(R.Fragment,{children:[`“`,mt?.name,`” has `,B.executionCount,` execution`,B.executionCount===1?``:`s`,` which will be removed. Delete?`]}):(0,R.jsxs)(R.Fragment,{children:[`“`,mt?.name,`” has`,` `,B.executionCount>0&&(0,R.jsxs)(R.Fragment,{children:[B.executionCount,` execution`,B.executionCount===1?``:`s`]}),B.executionCount>0&&B.taskCount>0&&` and `,B.taskCount,` task`,B.taskCount===1?``:`s`,`. Choose what to delete:`]})})]}),B!==null&&B.taskCount>0&&(0,R.jsxs)(`div`,{className:`space-y-2 px-1`,children:[(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`template_only`,checked:Te===`template_only`,onChange:()=>H(`template_only`),className:`mt-1`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-sm font-medium`,children:`Template only`}),(0,R.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Removes the automation. Tasks remain under the Tasks tab as history.`})]})]}),(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`with_tasks`,checked:Te===`with_tasks`,onChange:()=>H(`with_tasks`),className:`mt-1`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-sm font-medium`,children:`Template and its tasks`}),(0,R.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Also deletes `,B.taskCount,` task`,B.taskCount===1?``:`s`,` and their score history. Cannot be undone.`]})]})]})]}),(0,R.jsxs)(te,{children:[(0,R.jsx)(ne,{disabled:Ee,children:`Cancel`}),(0,R.jsx)(C,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger)]`,disabled:Ee||B===null,onClick:()=>{z&&lt(z,B&&B.taskCount>0?Te:`template_only`),we(null),V(null),H(`template_only`)},children:`Delete`})]})]})})]})}function it(){let{tasks:e,templates:t,goals:n}=j(oe(e=>({tasks:e.tasks,templates:e.templates,goals:e.goals}))),r=j(e=>e.fetchTasks),i=j(e=>e.fetchTemplates),a=j(e=>e.fetchGoals);return(0,L.useEffect)(()=>{r(),i(),a()},[r,i,a]),(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsx)(P,{eyebrow:`Operations`,title:`Work`,description:`Tasks, automations, and goals in one place.`,metrics:[{label:`Running`,value:e.filter(e=>e.status===`running`).length},{label:`Automations`,value:t.length},{label:`Goals`,value:n.length}],compact:!0}),(0,R.jsxs)(Qe,{defaultValue:`tasks`,children:[(0,R.jsxs)($e,{children:[(0,R.jsx)(Z,{value:`tasks`,children:`Tasks`}),(0,R.jsx)(Z,{value:`automations`,children:`Automations`}),(0,R.jsx)(Z,{value:`goals`,children:`Goals`})]}),(0,R.jsx)(Q,{value:`tasks`,children:(0,R.jsx)(tt,{})}),(0,R.jsx)(Q,{value:`automations`,children:(0,R.jsx)(rt,{})}),(0,R.jsx)(Q,{value:`goals`,children:(0,R.jsx)(ye,{})})]})]})}export{it as Work};
@@ -1,2 +0,0 @@
1
- /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;--color-red-500:oklch(63.7% .237 25.331);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-green-400:oklch(79.2% .209 151.711);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-500:oklch(62.3% .214 259.815);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-widest:.1em;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\[50\%\]{top:50%}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[calc\(100vh-280px\)\]{max-height:calc(100vh - 280px)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-\[10rem\]{min-height:10rem}.min-h-\[24rem\]{min-height:24rem}.w-0\.5{width:calc(var(--spacing) * .5)}.w-2{width:calc(var(--spacing) * 2)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[70\%\]{max-width:70%}.max-w-\[85\%\]{max-width:85%}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--app-border\)\]>:not(:last-child)){border-color:var(--app-border)}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:1rem}.rounded-md{border-radius:.75rem}.rounded-sm{border-radius:.5rem}.rounded-xl{border-radius:1.4rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-\[var\(--app-accent\)\],.border-\[var\(--app-accent\)\]\/40{border-color:var(--app-accent)}@supports (color:color-mix(in lab, red, red)){.border-\[var\(--app-accent\)\]\/40{border-color:color-mix(in oklab, var(--app-accent) 40%, transparent)}}.border-\[var\(--app-accent-soft-border\)\]{border-color:var(--app-accent-soft-border)}.border-\[var\(--app-accent-strong\)\]{border-color:var(--app-accent-strong)}.border-\[var\(--app-border\)\]{border-color:var(--app-border)}.border-\[var\(--app-border-strong\)\]{border-color:var(--app-border-strong)}.border-\[var\(--app-danger\)\],.border-\[var\(--app-danger\)\]\/40{border-color:var(--app-danger)}@supports (color:color-mix(in lab, red, red)){.border-\[var\(--app-danger\)\]\/40{border-color:color-mix(in oklab, var(--app-danger) 40%, transparent)}}.border-\[var\(--app-danger-soft-border\)\]{border-color:var(--app-danger-soft-border)}.border-\[var\(--app-success-soft-border\)\]{border-color:var(--app-success-soft-border)}.border-\[var\(--app-warning-soft-border\)\]{border-color:var(--app-warning-soft-border)}.border-transparent{border-color:#0000}.border-white\/12{border-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.border-white\/12{border-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20{border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-t-\[var\(--app-accent\)\]{border-top-color:var(--app-accent)}.bg-\[color-mix\(in_oklch\,var\(--app-canvas\)_88\%\,transparent\)\]{background-color:var(--app-canvas)}@supports (color:color-mix(in lab, red, red)){.bg-\[color-mix\(in_oklch\,var\(--app-canvas\)_88\%\,transparent\)\]{background-color:color-mix(in oklch,var(--app-canvas) 88%,transparent)}}.bg-\[color-mix\(in_oklch\,var\(--app-canvas\)_90\%\,transparent\)\]{background-color:var(--app-canvas)}@supports (color:color-mix(in lab, red, red)){.bg-\[color-mix\(in_oklch\,var\(--app-canvas\)_90\%\,transparent\)\]{background-color:color-mix(in oklch,var(--app-canvas) 90%,transparent)}}.bg-\[var\(--app-accent\)\],.bg-\[var\(--app-accent\)\]\/8{background-color:var(--app-accent)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-accent\)\]\/8{background-color:color-mix(in oklab, var(--app-accent) 8%, transparent)}}.bg-\[var\(--app-accent-soft-bg\)\]{background-color:var(--app-accent-soft-bg)}.bg-\[var\(--app-border\)\]{background-color:var(--app-border)}.bg-\[var\(--app-canvas\)\],.bg-\[var\(--app-canvas\)\]\/40{background-color:var(--app-canvas)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-canvas\)\]\/40{background-color:color-mix(in oklab, var(--app-canvas) 40%, transparent)}}.bg-\[var\(--app-canvas\)\]\/50{background-color:var(--app-canvas)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-canvas\)\]\/50{background-color:color-mix(in oklab, var(--app-canvas) 50%, transparent)}}.bg-\[var\(--app-danger\)\],.bg-\[var\(--app-danger\)\]\/10{background-color:var(--app-danger)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-danger\)\]\/10{background-color:color-mix(in oklab, var(--app-danger) 10%, transparent)}}.bg-\[var\(--app-danger-soft-bg\)\]{background-color:var(--app-danger-soft-bg)}.bg-\[var\(--app-danger-soft-bg-subtle\)\]{background-color:var(--app-danger-soft-bg-subtle)}.bg-\[var\(--app-header-bg\)\]{background-color:var(--app-header-bg)}.bg-\[var\(--app-panel\)\],.bg-\[var\(--app-panel\)\]\/50{background-color:var(--app-panel)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-panel\)\]\/50{background-color:color-mix(in oklab, var(--app-panel) 50%, transparent)}}.bg-\[var\(--app-panel\)\]\/60{background-color:var(--app-panel)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-panel\)\]\/60{background-color:color-mix(in oklab, var(--app-panel) 60%, transparent)}}.bg-\[var\(--app-panel-elevated\)\],.bg-\[var\(--app-panel-elevated\)\]\/50{background-color:var(--app-panel-elevated)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-panel-elevated\)\]\/50{background-color:color-mix(in oklab, var(--app-panel-elevated) 50%, transparent)}}.bg-\[var\(--app-panel-muted\)\]{background-color:var(--app-panel-muted)}.bg-\[var\(--app-sidebar-bg\)\]{background-color:var(--app-sidebar-bg)}.bg-\[var\(--app-success\)\]{background-color:var(--app-success)}.bg-\[var\(--app-success-soft-bg\)\]{background-color:var(--app-success-soft-bg)}.bg-\[var\(--app-warning-soft-bg\)\]{background-color:var(--app-warning-soft-bg)}.bg-\[var\(--app-warning-soft-bg-subtle\)\]{background-color:var(--app-warning-soft-bg-subtle)}.bg-black{background-color:var(--color-black)}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.bg-black\/10{background-color:color-mix(in oklab, var(--color-black) 10%, transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80{background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-800\/30{background-color:#1e29394d}@supports (color:color-mix(in lab, red, red)){.bg-gray-800\/30{background-color:color-mix(in oklab, var(--color-gray-800) 30%, transparent)}}.bg-green-900\/30{background-color:#0d542b4d}@supports (color:color-mix(in lab, red, red)){.bg-green-900\/30{background-color:color-mix(in oklab, var(--color-green-900) 30%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/\[0\.03\]{background-color:#ffffff08}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.03\]{background-color:color-mix(in oklab, var(--color-white) 3%, transparent)}}.bg-white\/\[0\.04\]{background-color:#ffffff0a}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.04\]{background-color:color-mix(in oklab, var(--color-white) 4%, transparent)}}.bg-white\/\[0\.05\]{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.05\]{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/\[0\.06\]{background-color:#ffffff0f}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.06\]{background-color:color-mix(in oklab, var(--color-white) 6%, transparent)}}.bg-white\/\[0\.08\]{background-color:#ffffff14}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.08\]{background-color:color-mix(in oklab, var(--color-white) 8%, transparent)}}.fill-\[var\(--app-danger\)\]{fill:var(--app-danger)}.fill-\[var\(--app-success\)\]{fill:var(--app-success)}.fill-current{fill:currentColor}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\[0\.18em\]{--tw-tracking:.18em;letter-spacing:.18em}.tracking-\[var\(--app-tracking-micro\)\]{--tw-tracking:var(--app-tracking-micro);letter-spacing:var(--app-tracking-micro)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--app-accent\)\]{color:var(--app-accent)}.text-\[var\(--app-accent-strong\)\]{color:var(--app-accent-strong)}.text-\[var\(--app-danger\)\]{color:var(--app-danger)}.text-\[var\(--app-danger-soft-text\)\]{color:var(--app-danger-soft-text)}.text-\[var\(--app-indicator-alert\)\]{color:var(--app-indicator-alert)}.text-\[var\(--app-kicker\)\]{color:var(--app-kicker)}.text-\[var\(--app-log-adam\)\]{color:var(--app-log-adam)}.text-\[var\(--app-log-embedding\)\]{color:var(--app-log-embedding)}.text-\[var\(--app-log-manager\)\]{color:var(--app-log-manager)}.text-\[var\(--app-log-scheduler\)\]{color:var(--app-log-scheduler)}.text-\[var\(--app-log-store\)\]{color:var(--app-log-store)}.text-\[var\(--app-log-ws\)\]{color:var(--app-log-ws)}.text-\[var\(--app-success\)\]{color:var(--app-success)}.text-\[var\(--app-success-soft-text\)\]{color:var(--app-success-soft-text)}.text-\[var\(--app-text\)\]{color:var(--app-text)}.text-\[var\(--app-text-muted\)\]{color:var(--app-text-muted)}.text-\[var\(--app-text-subtle\)\]{color:var(--app-text-subtle)}.text-\[var\(--app-warning\)\]{color:var(--app-warning)}.text-\[var\(--app-warning-soft-text\)\]{color:var(--app-warning-soft-text)}.text-\[var\(--app-warning-strong\)\]{color:var(--app-warning-strong)}.text-blue-500{color:var(--color-blue-500)}.text-gray-400{color:var(--color-gray-400)}.text-green-400{color:var(--color-green-400)}.text-red-500{color:var(--color-red-500)}.text-slate-100{color:var(--color-slate-100)}.text-white{color:var(--color-white)}.text-white\/45{color:#ffffff73}@supports (color:color-mix(in lab, red, red)){.text-white\/45{color:color-mix(in oklab, var(--color-white) 45%, transparent)}}.text-white\/62{color:#ffffff9e}@supports (color:color-mix(in lab, red, red)){.text-white\/62{color:color-mix(in oklab, var(--color-white) 62%, transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70{color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-white\/76{color:#ffffffc2}@supports (color:color-mix(in lab, red, red)){.text-white\/76{color:color-mix(in oklab, var(--color-white) 76%, transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-slate-500::placeholder{color:var(--color-slate-500)}.placeholder-slate-600::placeholder{color:var(--color-slate-600)}.opacity-60{opacity:.6}.opacity-100{opacity:1}.shadow-\[var\(--app-shadow-accent\)\]{--tw-shadow:var(--app-shadow-accent);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[var\(--app-shadow-danger\)\]{--tw-shadow:var(--app-shadow-danger);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[var\(--app-shadow-lg\)\]{--tw-shadow:var(--app-shadow-lg);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[var\(--app-shadow-md\)\]{--tw-shadow:var(--app-shadow-md);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-\[var\(--app-danger\)\]{--tw-ring-color:var(--app-danger)}.ring-offset-\[var\(--app-canvas\)\]{--tw-ring-offset-color:var(--app-canvas)}.ring-offset-slate-950{--tw-ring-offset-color:var(--color-slate-950)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[background-color\,border-color\,color\,box-shadow\]{transition-property:background-color,border-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.duration-200{animation-duration:.2s}.fade-in-0{--tw-enter-opacity:0}.paused{animation-play-state:paused}.running{animation-play-state:running}.slide-in-from-left-1\/2{--tw-enter-translate-x:-50%}.slide-in-from-top-\[48\%\]{--tw-enter-translate-y:-48%}.slide-out-to-left-1\/2{--tw-exit-translate-x:-50%}.slide-out-to-top-\[48\%\]{--tw-exit-translate-y:-48%}.zoom-in-95{--tw-enter-scale:.95}@media (hover:hover){.group-hover\/install\:block:is(:where(.group\/install):hover *){display:block}}.group-\[\.toast\]\:bg-\[var\(--app-accent\)\]:is(:where(.group).toast *){background-color:var(--app-accent)}.group-\[\.toast\]\:bg-\[var\(--app-panel-elevated\)\]:is(:where(.group).toast *){background-color:var(--app-panel-elevated)}.group-\[\.toast\]\:text-\[var\(--app-text\)\]:is(:where(.group).toast *){color:var(--app-text)}.group-\[\.toast\]\:text-\[var\(--app-text-muted\)\]:is(:where(.group).toast *){color:var(--app-text-muted)}.group-\[\.toast\]\:text-white:is(:where(.group).toast *){color:var(--color-white)}.group-\[\.toaster\]\:border-\[var\(--app-border\)\]:is(:where(.group).toaster *){border-color:var(--app-border)}.group-\[\.toaster\]\:bg-\[var\(--app-panel\)\]:is(:where(.group).toaster *){background-color:var(--app-panel)}.group-\[\.toaster\]\:text-\[var\(--app-text\)\]:is(:where(.group).toaster *){color:var(--app-text)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.placeholder\:text-\[var\(--app-text-subtle\)\]::placeholder{color:var(--app-text-subtle)}@media (hover:hover){.hover\:border-\[var\(--app-border\)\]:hover{border-color:var(--app-border)}.hover\:border-\[var\(--app-border-strong\)\]:hover{border-color:var(--app-border-strong)}.hover\:border-\[var\(--app-text-muted\)\]:hover{border-color:var(--app-text-muted)}.hover\:bg-\[var\(--app-accent\)\]:hover{background-color:var(--app-accent)}.hover\:bg-\[var\(--app-accent-strong\)\]:hover{background-color:var(--app-accent-strong)}.hover\:bg-\[var\(--app-danger\)\]:hover{background-color:var(--app-danger)}.hover\:bg-\[var\(--app-danger-strong\)\]:hover{background-color:var(--app-danger-strong)}.hover\:bg-\[var\(--app-panel-elevated\)\]:hover,.hover\:bg-\[var\(--app-panel-elevated\)\]\/30:hover{background-color:var(--app-panel-elevated)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-\[var\(--app-panel-elevated\)\]\/30:hover{background-color:color-mix(in oklab, var(--app-panel-elevated) 30%, transparent)}}.hover\:bg-\[var\(--app-panel-muted\)\]:hover{background-color:var(--app-panel-muted)}.hover\:bg-\[var\(--app-success-soft-bg-subtle\)\]:hover{background-color:var(--app-success-soft-bg-subtle)}.hover\:bg-\[var\(--app-warning-soft-bg-subtle\)\]:hover{background-color:var(--app-warning-soft-bg-subtle)}.hover\:bg-white\/14:hover{background-color:#ffffff24}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/14:hover{background-color:color-mix(in oklab, var(--color-white) 14%, transparent)}}.hover\:bg-white\/\[0\.1\]:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/\[0\.1\]:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/\[0\.04\]:hover{background-color:color-mix(in oklab, var(--color-white) 4%, transparent)}}.hover\:bg-white\/\[0\.05\]:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/\[0\.05\]:hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.hover\:bg-white\/\[0\.06\]:hover{background-color:#ffffff0f}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/\[0\.06\]:hover{background-color:color-mix(in oklab, var(--color-white) 6%, transparent)}}.hover\:text-\[var\(--app-accent\)\]:hover{color:var(--app-accent)}.hover\:text-\[var\(--app-danger\)\]:hover{color:var(--app-danger)}.hover\:text-\[var\(--app-danger-soft-text\)\]:hover{color:var(--app-danger-soft-text)}.hover\:text-\[var\(--app-success\)\]:hover{color:var(--app-success)}.hover\:text-\[var\(--app-success-soft-text\)\]:hover{color:var(--app-success-soft-text)}.hover\:text-\[var\(--app-text\)\]:hover{color:var(--app-text)}.hover\:text-\[var\(--app-warning\)\]:hover{color:var(--app-warning)}.hover\:text-\[var\(--app-warning-soft-text\)\]:hover{color:var(--app-warning-soft-text)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-\[var\(--app-shadow-lg\)\]:hover{--tw-shadow:var(--app-shadow-lg);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:fixed:focus{position:fixed}.focus\:top-4:focus{top:calc(var(--spacing) * 4)}.focus\:left-4:focus{left:calc(var(--spacing) * 4)}.focus\:z-50:focus{z-index:50}.focus\:rounded-md:focus{border-radius:.75rem}.focus\:border-\[var\(--app-accent\)\]:focus{border-color:var(--app-accent)}.focus\:border-\[var\(--app-border-strong\)\]:focus{border-color:var(--app-border-strong)}.focus\:bg-\[var\(--app-accent\)\]:focus{background-color:var(--app-accent)}.focus\:bg-\[var\(--app-panel-elevated\)\]:focus{background-color:var(--app-panel-elevated)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--app-text\)\]:focus{color:var(--app-text)}.focus\:text-white:focus{color:var(--color-white)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-\[var\(--app-accent\)\]:focus{--tw-ring-color:var(--app-accent)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:ring-offset-\[var\(--app-canvas\)\]:focus{--tw-ring-offset-color:var(--app-canvas)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[var\(--app-canvas\)\]:focus-visible{--tw-ring-offset-color:var(--app-canvas)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:text-\[var\(--app-text\)\][data-state=active]{color:var(--app-text)}.data-\[state\=active\]\:shadow-\[var\(--app-shadow-sm\)\][data-state=active]{--tw-shadow:var(--app-shadow-sm);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[var\(--app-accent\)\][data-state=checked]{background-color:var(--app-accent)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-\[var\(--app-panel-elevated\)\][data-state=open]{background-color:var(--app-panel-elevated)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-\[var\(--app-panel-muted\)\][data-state=unchecked]{background-color:var(--app-panel-muted)}@media (width>=40rem){.sm\:mt-0{margin-top:calc(var(--spacing) * 0)}.sm\:inline{display:inline}.sm\:max-w-\[180px\]{max-width:180px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[repeat\(3\,minmax\(0\,1fr\)\)_auto\]{grid-template-columns:repeat(3,minmax(0,1fr)) auto}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:1rem}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:inline{display:inline}.md\:w-16{width:calc(var(--spacing) * 16)}.md\:w-48{width:calc(var(--spacing) * 48)}.md\:w-56{width:calc(var(--spacing) * 56)}.md\:shrink-0{flex-shrink:0}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:justify-end{justify-content:flex-end}.md\:gap-3{gap:calc(var(--spacing) * 3)}.md\:self-auto{align-self:auto}.md\:text-right{text-align:right}}@media (width>=64rem){.lg\:block{display:block}.lg\:hidden{display:none}.lg\:w-auto{width:auto}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-end{align-items:flex-end}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}.lg\:justify-end{justify-content:flex-end}.lg\:p-5{padding:calc(var(--spacing) * 5)}.lg\:px-4{padding-inline:calc(var(--spacing) * 4)}.lg\:px-5{padding-inline:calc(var(--spacing) * 5)}.lg\:px-6{padding-inline:calc(var(--spacing) * 6)}.lg\:py-3{padding-block:calc(var(--spacing) * 3)}.lg\:py-5{padding-block:calc(var(--spacing) * 5)}.lg\:py-6{padding-block:calc(var(--spacing) * 6)}.lg\:opacity-0{opacity:0}.lg\:group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.lg\:group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}}@media (width>=80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}:root{--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--radius:.625rem;--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--app-canvas:oklch(19% .012 258);--app-panel:oklch(24.8% .015 258);--app-panel-elevated:oklch(28.4% .021 258);--app-panel-muted:oklch(22.4% .011 258);--app-accent-surface:oklch(34% .055 247);--app-critical-surface:oklch(31% .07 23);--app-border:oklch(38% .018 258/.82);--app-border-strong:oklch(47% .025 258/.95);--app-text:oklch(96% .01 258);--app-text-muted:oklch(76% .018 258);--app-text-subtle:oklch(63% .016 258);--app-kicker:oklch(78% .07 229);--app-accent:oklch(71% .16 235);--app-accent-strong:oklch(76% .18 232);--app-success:oklch(76% .15 158);--app-warning:oklch(83% .16 85);--app-danger:oklch(72% .18 28);--app-header-bg:oklch(22% .014 258);--app-sidebar-bg:oklch(20% .014 258);--app-shadow-sm:0 1px 2px #0206172e, 0 1px 1px #0206171f;--app-shadow-md:0 8px 24px #0206173d;--app-shadow-lg:0 16px 40px #02061742;--app-shadow-accent:0 8px 24px var(--app-accent)}@supports (color:color-mix(in lab, red, red)){.dark{--app-shadow-accent:0 8px 24px color-mix(in oklch, var(--app-accent) 26%, transparent)}}.dark{--app-shadow-danger:0 8px 24px var(--app-danger)}@supports (color:color-mix(in lab, red, red)){.dark{--app-shadow-danger:0 8px 24px color-mix(in oklch, var(--app-danger) 24%, transparent)}}.dark{--app-tracking-micro:.16em;--app-tracking-kicker:.18em;--app-accent-strong-hover:oklch(70% .19 232);--app-danger-strong:oklch(65% .2 26);--app-warning-strong:oklch(76% .17 85);--app-danger-soft-bg:oklch(28% .06 26);--app-danger-soft-bg-subtle:oklch(24% .035 26);--app-danger-soft-border:oklch(42% .09 26);--app-danger-soft-text:oklch(85% .12 26);--app-success-soft-bg:oklch(28% .04 158);--app-success-soft-bg-subtle:oklch(24% .025 158);--app-success-soft-border:oklch(42% .06 158);--app-success-soft-text:oklch(85% .11 158);--app-warning-soft-bg:oklch(28% .035 85);--app-warning-soft-bg-subtle:oklch(24% .02 85);--app-warning-soft-border:oklch(44% .06 85);--app-warning-soft-text:oklch(87% .13 85);--app-accent-soft-bg:oklch(30% .08 235);--app-accent-soft-border:oklch(45% .11 235);--app-indicator-alert:oklch(72% .16 55);--app-log-adam:oklch(72% .16 295);--app-log-manager:oklch(78% .14 210);--app-log-scheduler:oklch(78% .14 60);--app-log-ws:oklch(76% .13 190);--app-log-store:oklch(86% .14 95);--app-log-embedding:oklch(78% .14 340)}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:radial-gradient(80% 55% at 18% -8%, var(--app-accent) 0%, transparent 52%), var(--app-canvas);min-height:100vh;font-family:IBM Plex Sans,Avenir Next,Segoe UI,system-ui,sans-serif}@supports (color:color-mix(in lab, red, red)){body{background:radial-gradient(80% 55% at 18% -8%, color-mix(in oklch, var(--app-accent) 10%, transparent) 0%, transparent 52%), var(--app-canvas)}}body{color:var(--app-text);background-attachment:fixed}#root{min-height:100vh}.surface-panel{background:var(--app-panel);border:1px solid var(--app-border);box-shadow:var(--app-shadow-md)}.surface-panel-elevated{background:linear-gradient(180deg, oklch(96% 0 0/.06) 0%, transparent 28%), var(--app-panel-elevated);border:1px solid var(--app-border-strong);box-shadow:var(--app-shadow-lg)}.surface-panel-muted{background:var(--app-panel-muted);border:1px solid var(--app-border)}.surface-accent{background:linear-gradient(135deg,oklch(42% .1 232/.7),#0000 58%),oklch(34% .048 247);border:1px solid oklch(50% .12 235/.85)}.surface-critical{background:linear-gradient(135deg,oklch(52% .18 26/.62),#0000 58%),oklch(31% .06 23);border:1px solid oklch(54% .16 26/.82)}.text-kicker{color:var(--app-kicker);letter-spacing:var(--app-tracking-kicker);text-transform:uppercase;font-size:.7rem;font-weight:600}.text-title{color:var(--app-text);font-size:clamp(1.5rem,1.8vw,2rem);font-weight:600;line-height:1.05}.text-section-label{color:var(--app-text);letter-spacing:var(--app-tracking-micro);text-transform:uppercase;font-size:.92rem;font-weight:600}.surface-focus-metric{background:oklch(96% 0 0/.05);border:1px solid oklch(100% 0 0/.08)}.text-meta{color:var(--app-text-subtle);font-size:.78rem}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-slate-700);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-slate-600)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0), var(--tw-enter-translate-y,0), 0) scale3d(var(--tw-enter-scale,1), var(--tw-enter-scale,1), var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0), var(--tw-exit-translate-y,0), 0) scale3d(var(--tw-exit-scale,1), var(--tw-exit-scale,1), var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}