adam-agent-server 1.18.0 → 1.19.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 (131) hide show
  1. package/dist/{App-SIQUVFJY.js → App-522DTURQ.js} +10 -10
  2. package/dist/approval-handler-S3NV7OPO.js +1 -0
  3. package/dist/{artifacts-MAYKOTA2.js → artifacts-NFMM3ORE.js} +1 -1
  4. package/dist/audit-diagnostics-IHU3CJYZ.js +1 -0
  5. package/dist/audit-manager-MUMEEP3C.js +1 -0
  6. package/dist/bree-engine-EEKUQA3U.js +1 -0
  7. package/dist/channels-IDBWHLLE.js +1 -0
  8. package/dist/{channels-2TWTBE6Y.js → channels-ZHCTFSDA.js} +1 -1
  9. package/dist/chat-tool-calls-4BQWZCJH.js +1 -0
  10. package/dist/{chunk-Z2APBKIT.js → chunk-2JM3URDG.js} +1 -1
  11. package/dist/{chunk-OBD4245G.js → chunk-4G4CKAXY.js} +1 -1
  12. package/dist/{chunk-2CE2WUUZ.js → chunk-4ZESWP3J.js} +1 -1
  13. package/dist/{chunk-QYI44EP6.js → chunk-4ZG4UMAK.js} +1 -1
  14. package/dist/{chunk-BE653A45.js → chunk-6GYNUTPP.js} +1 -1
  15. package/dist/{chunk-JROGEBP5.js → chunk-76MMY2XC.js} +1 -1
  16. package/dist/{chunk-BMCNQGUH.js → chunk-7QT2ZX3K.js} +1 -1
  17. package/dist/{chunk-SGLZAIVL.js → chunk-A3YUIWLK.js} +1 -1
  18. package/dist/{chunk-HL373H4P.js → chunk-AMJJ2WGU.js} +1 -1
  19. package/dist/{chunk-NUOTFUNF.js → chunk-CN5NEJXG.js} +1 -1
  20. package/dist/{chunk-O6L4UVLV.js → chunk-DFTRUOT6.js} +1 -1
  21. package/dist/{chunk-JYZTIE2J.js → chunk-DRS5NOAA.js} +1 -1
  22. package/dist/{chunk-6WQFYV3N.js → chunk-EBZCHLYS.js} +1 -1
  23. package/dist/{chunk-SKHMWKJT.js → chunk-EPLSB63A.js} +1 -1
  24. package/dist/{chunk-V2MMQ3SH.js → chunk-FN64ZULV.js} +1 -1
  25. package/dist/chunk-FQHGIY3E.js +1 -0
  26. package/dist/{chunk-NSUXJ2VA.js → chunk-GQS3ED3B.js} +1 -1
  27. package/dist/{chunk-LKGYQJMS.js → chunk-HEHST2E2.js} +1 -1
  28. package/dist/chunk-IAGTZGGV.js +32 -0
  29. package/dist/chunk-ITVCPC7G.js +1 -0
  30. package/dist/{chunk-NXGR3PRY.js → chunk-J2VSAXVU.js} +1 -1
  31. package/dist/{chunk-5G64P4KE.js → chunk-JRRNGKDK.js} +1 -1
  32. package/dist/{chunk-KS24764D.js → chunk-JVYSSJKT.js} +2 -2
  33. package/dist/chunk-JXZCQ5XW.js +1 -0
  34. package/dist/{chunk-LCD5DVS6.js → chunk-KM4EFB4N.js} +1 -1
  35. package/dist/chunk-KQMKRRYW.js +143 -0
  36. package/dist/{chunk-4JHACUZY.js → chunk-L4APYD5A.js} +1 -1
  37. package/dist/{chunk-WY5BOCQP.js → chunk-LMQPGVM7.js} +16 -16
  38. package/dist/chunk-MMVDXKYS.js +14 -0
  39. package/dist/chunk-NKS7LEA7.js +182 -0
  40. package/dist/{chunk-VWX2B6OM.js → chunk-ORFLN4BF.js} +1 -1
  41. package/dist/{chunk-2JIQT2CI.js → chunk-PO66F7UQ.js} +1 -1
  42. package/dist/{chunk-XAPJJAJQ.js → chunk-QJXV4SQE.js} +1 -1
  43. package/dist/{chunk-UCUELFCS.js → chunk-R7Q6FSV4.js} +1 -1
  44. package/dist/{chunk-47HJPIUA.js → chunk-T7EKW3B7.js} +1 -1
  45. package/dist/{chunk-JZBXLN7M.js → chunk-VOH52UDS.js} +1 -1
  46. package/dist/{chunk-HRPMRWHD.js → chunk-VZL2DGC4.js} +1 -1
  47. package/dist/{chunk-IEBAOZED.js → chunk-WDMSZS4W.js} +1 -1
  48. package/dist/{chunk-2A2TXYT3.js → chunk-WG3C43QS.js} +3 -3
  49. package/dist/{chunk-TA5PFK5C.js → chunk-YEGUFMLJ.js} +1 -1
  50. package/dist/{chunk-ZQN6JZIJ.js → chunk-ZGA52HRD.js} +1 -1
  51. package/dist/cli.js +2 -2
  52. package/dist/{config-U624HJKI.js → config-GOJLI3X2.js} +1 -1
  53. package/dist/config-Z6KFEFJO.js +1 -0
  54. package/dist/db-ROXIYW5B.js +1 -0
  55. package/dist/{delivery-log-QMQQHES4.js → delivery-log-TGJZ5HU7.js} +1 -1
  56. package/dist/engine-GN7PJPGQ.js +1 -0
  57. package/dist/{evolution-audit-XF4KZZMP.js → evolution-audit-TFJF666X.js} +1 -1
  58. package/dist/execution-tools-BQD2O25X.js +1 -0
  59. package/dist/{external-api-435WH6V3.js → external-api-DSLQDRZ2.js} +1 -1
  60. package/dist/index.js +41 -39
  61. package/dist/{learner-4CJ7BSCN.js → learner-ACBX3GI7.js} +1 -1
  62. package/dist/{memories-NJFKSOL5.js → memories-RAIR5O2F.js} +1 -1
  63. package/dist/{memory-extractor-UQI75BBK.js → memory-extractor-A6CAOFOX.js} +1 -1
  64. package/dist/{memory-gc-NTZVUGJX.js → memory-gc-W63MGSDH.js} +1 -1
  65. package/dist/memory-service-H4OFUNCF.js +1 -0
  66. package/dist/outbound-gateway-LKRQYPA2.js +1 -0
  67. package/dist/presets-FO6RSGDN.js +1 -0
  68. package/dist/{reflection-job-F4BZA2E3.js → reflection-job-XC2F7GTT.js} +1 -1
  69. package/dist/role-presets-SDA664QG.js +1 -0
  70. package/dist/role-workspace-NGJEJG3H.js +1 -0
  71. package/dist/{roles-WDMUBWQP.js → roles-LZCJ7QFS.js} +1 -1
  72. package/dist/{session-manager-XFUKWEC7.js → session-manager-PU4GH3E4.js} +1 -1
  73. package/dist/skill-registry-XKLE2LXU.js +1 -0
  74. package/dist/{task-templates-BIVCRNXA.js → task-templates-52LAC6OA.js} +1 -1
  75. package/dist/template-dispatch-PJFSWEO2.js +1 -0
  76. package/package.json +1 -1
  77. package/web/dist/assets/{ChannelDetail-D0FBZoAX.js → ChannelDetail-CSq9o5fq.js} +1 -1
  78. package/web/dist/assets/{Channels-Cztxvsa2.js → Channels-CAxTh1Bp.js} +1 -1
  79. package/web/dist/assets/Chat-PUz41HFr.js +2 -0
  80. package/web/dist/assets/{Cost-K8-4xqBe.js → Cost-BHcsPz5T.js} +1 -1
  81. package/web/dist/assets/{Dashboard-BXqFb_Vr.js → Dashboard-BT39_iWc.js} +1 -1
  82. package/web/dist/assets/{EnvVarEditor-FiiJazzp.js → EnvVarEditor-D_1d7bTJ.js} +1 -1
  83. package/web/dist/assets/{EventDefDetail-C3S1G0K8.js → EventDefDetail-jKN3gO_7.js} +1 -1
  84. package/web/dist/assets/{Events-BKxqZ9j6.js → Events-CpeHg3fh.js} +1 -1
  85. package/web/dist/assets/{Evolution-DFcSm6Rw.js → Evolution-DsWyv2_a.js} +1 -1
  86. package/web/dist/assets/{ExtensionDetail-C8aPpyLv.js → ExtensionDetail-CJHNaNii.js} +1 -1
  87. package/web/dist/assets/{Extensions-MLZk05j0.js → Extensions-Pg2vx_ZK.js} +1 -1
  88. package/web/dist/assets/{FeatureRequests-D_4XaQ7F.js → FeatureRequests-3Yl8wTNT.js} +1 -1
  89. package/web/dist/assets/{GoalDetail-DVU7c0aR.js → GoalDetail-L3T1zqqs.js} +1 -1
  90. package/web/dist/assets/{Goals-D3h4WMjU.js → Goals-B-__r-Yq.js} +1 -1
  91. package/web/dist/assets/{Logs-D5MQv6Yw.js → Logs-CMkjUkmu.js} +1 -1
  92. package/web/dist/assets/{Memories-Dls71I2i.js → Memories-Q1eKfPQ2.js} +1 -1
  93. package/web/dist/assets/{Mistakes-BZcTg0vP.js → Mistakes-BROkixt_.js} +1 -1
  94. package/web/dist/assets/{Plugins-CwCHGzI6.js → Plugins-v17MyPVe.js} +1 -1
  95. package/web/dist/assets/{RoleDetail-B2M6ALSl.js → RoleDetail-DCGFBLP1.js} +2 -2
  96. package/web/dist/assets/{Roles-FEHqm_Jf.js → Roles-C7SNebvY.js} +1 -1
  97. package/web/dist/assets/{Settings-rdVQMfqX.js → Settings-QuKwKbKg.js} +1 -1
  98. package/web/dist/assets/{Strategies-CwJ9JQ-X.js → Strategies-CXQYvCkc.js} +1 -1
  99. package/web/dist/assets/{Switch-1JjR4Imr.js → Switch--h1rqagh.js} +1 -1
  100. package/web/dist/assets/{TaskDetail-h12WxjfG.js → TaskDetail-B0G5ZjDD.js} +1 -1
  101. package/web/dist/assets/{Work-CfzFRSZX.js → Work-DbFst_9-.js} +1 -1
  102. package/web/dist/assets/index-D35OGE0z.css +2 -0
  103. package/web/dist/assets/{index-CXEJd-0s.js → index-Dd3NDYZR.js} +2 -2
  104. package/web/dist/assets/{usePluginsWithUsage-4iLJAPjH.js → usePluginsWithUsage-DpTxJuFQ.js} +1 -1
  105. package/web/dist/index.html +2 -2
  106. package/dist/approval-handler-BWA7UIKN.js +0 -1
  107. package/dist/audit-diagnostics-K3LUWXTI.js +0 -1
  108. package/dist/audit-manager-6WL2V6JG.js +0 -1
  109. package/dist/bree-engine-KYD4GKQK.js +0 -1
  110. package/dist/channels-PWDSTYNR.js +0 -1
  111. package/dist/chat-tool-calls-WJDFQ54U.js +0 -1
  112. package/dist/chunk-3UFEOB6P.js +0 -143
  113. package/dist/chunk-MTRLUW7Z.js +0 -1
  114. package/dist/chunk-QTGAK62Z.js +0 -14
  115. package/dist/chunk-TWOJVEO7.js +0 -32
  116. package/dist/chunk-VO24C673.js +0 -1
  117. package/dist/chunk-VPMHZJS2.js +0 -1
  118. package/dist/chunk-ZJ3TS4FL.js +0 -182
  119. package/dist/config-X7A6NA73.js +0 -1
  120. package/dist/db-XODNIJSJ.js +0 -1
  121. package/dist/engine-OQXDHA2R.js +0 -1
  122. package/dist/execution-tools-BR4T4MMW.js +0 -1
  123. package/dist/memory-service-3RLVOF2C.js +0 -1
  124. package/dist/outbound-gateway-NJNSN2ZX.js +0 -1
  125. package/dist/presets-SUJRFRJC.js +0 -1
  126. package/dist/role-presets-VEYTGYA4.js +0 -1
  127. package/dist/role-workspace-AIVHPX5P.js +0 -1
  128. package/dist/skill-registry-LARMNUT5.js +0 -1
  129. package/dist/template-dispatch-6FPJQN6A.js +0 -1
  130. package/web/dist/assets/Chat-Ce72TtUi.js +0 -2
  131. package/web/dist/assets/index-CarTGiGO.css +0 -2
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{G as t,U as n,Y as r,_t as i,at as a,o,rt as s,st as c,v as l,vt as u,xt as d}from"./vendor-icons-Bc_e_XXa.js";import{f as ee,r as f,t as p}from"./vendor-react-bQ_cvNuA.js";import{t as m}from"./Button-CRNb8sD3.js";import{s as te,t as h}from"./api-BP4ZP9kk.js";import{n as ne,t as g}from"./index-CXEJd-0s.js";import{i as _,t as re}from"./ArtifactDetail-DDTEAl2E.js";import{a as v,i as y,r as b,t as x}from"./Card-Cwvv0An8.js";import{t as ie}from"./PageHeader-acLQTYct.js";import{t as ae}from"./SectionHeader-NZWZgoOs.js";import{a as S,n as C,r as w,t as T}from"./format-ZWN4JNj-.js";import{t as E}from"./ui-D1crlGpt.js";var D=e(d(),1),O=p(),k={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 oe({logs:e}){let[t,n]=(0,D.useState)(new Set);return e.length===0?(0,O.jsx)(`p`,{className:`text-sm text-[var(--app-text-subtle)]`,children:`No execution steps yet.`}):(0,O.jsx)(`div`,{className:`space-y-0`,children:e.map((r,i)=>{let a=i>0?e[i-1].timestamp:null,o=a?r.timestamp-a:null,s=r.type===`plugin_error`,l=t.has(i)?r.content:r.content.length>200?r.content.slice(0,200)+`...`:r.content;return(0,O.jsxs)(`div`,{className:`flex gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,O.jsx)(c,{size:10,className:`mt-1.5 flex-shrink-0 fill-current ${k[r.type]??`text-[var(--app-text-subtle)]`} ${s?`rounded-full ring-2 ring-[var(--app-danger)]`:``}`}),i<e.length-1&&(0,O.jsx)(`div`,{className:`mt-0.5 w-0.5 flex-1 bg-[var(--app-border)]`})]}),(0,O.jsxs)(`div`,{className:`flex-1 pb-4 ${s?`rounded-lg border border-[var(--app-danger)]/40 bg-[var(--app-danger-soft-bg-subtle)] p-3`:``}`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,O.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,r.index]}),(0,O.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:r.toolName??r.type}),s&&(0,O.jsx)(g,{variant:`destructive`,children:`Plugin Error`}),(0,O.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:S(r.timestamp)}),o!=null&&o>0&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,o,`ms`]}),r.truncated&&(0,O.jsx)(g,{variant:`outline`,children:`truncated`})]}),l&&(0,O.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 A(){let{id:e}=ee(),[c,d]=(0,D.useState)(null),[p,S]=(0,D.useState)([]),[k,A]=(0,D.useState)([]),[M,N]=(0,D.useState)([]),[P,F]=(0,D.useState)(null),[I,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(!1),[B,ce]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(!1),[G,K]=(0,D.useState)(`overview`),[q,J]=(0,D.useState)([]),[Y,X]=(0,D.useState)(!1),[le,Z]=(0,D.useState)(null),[Q,$]=(0,D.useState)(null),ue=(0,D.useMemo)(()=>{if(!c)return`No diagnostics yet`;let e=[];return c.error&&e.push(`error`),k.length>0&&e.push(`${k.length} steps`),M.length>0&&e.push(`${M.length} delivery events`),e.length>0?e.join(` · `):`No diagnostics yet`},[M.length,k.length,c]);(0,D.useEffect)(()=>{if(!e)return;let t=!1,n=async()=>{if(!t)try{let n=await h(`/tasks/${e}`);if(t)return;d(n.task),L(null)}catch(e){if(t)return;L(e instanceof Error?e.message:`Failed to load task`)}};n(),h(`/tasks/${e}/plan`).then(e=>{t||S(e.plans)}).catch(()=>{t||S([])}),h(`/tasks/${e}/logs?limit=200`).then(e=>{t||A(e.logs)}).catch(()=>{t||A([])}),te(e).then(e=>{t||N(e)}).catch(()=>{t||N([])});let r=setInterval(n,3e3);return()=>{t=!0,clearInterval(r)}},[e]),(0,D.useEffect)(()=>{if(!e||G!==`artifacts`)return;let t=!1;return X(!0),Z(null),h(`/tasks/${e}/artifacts`).then(e=>{t||(J(e.artifacts),X(!1))}).catch(e=>{t||(Z(e instanceof Error?e.message:`Failed to load artifacts`),X(!1))}),()=>{t=!0}},[e,G]),(0,D.useEffect)(()=>{if(!c?.roleId||!e)return;let t=!1;return h(`/roles/${c.roleId}/scores?limit=100`).then(n=>{t||F(n.scores.find(t=>t.taskId===e)??null)}).catch(()=>{t||F(null)}),()=>{t=!0}},[c?.roleId,e]);let de=async()=>{if(e){z(!0);try{await h(`/tasks/${e}/cancel`,{method:`POST`}),d(e=>e&&{...e,status:`cancelled`})}finally{z(!1)}}};if(I)return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(f,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),(0,O.jsx)(x,{className:`text-center text-[var(--app-danger)]`,children:I})]});if(!c)return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(f,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),(0,O.jsx)(x,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let fe=[`running`,`queued`,`pending`,`paused`].includes(c.status);return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsx)(ie,{eyebrow:`Task`,title:`Task Detail`,compact:!0,description:`Summary, execution, result, and diagnostics.`,metrics:[{label:`Status`,value:(0,O.jsx)(g,{variant:ne(c.status),children:c.status})},{label:`Task`,value:c.id.slice(0,8)},{label:`Elapsed`,value:c.totalDurationMs?w(c.totalDurationMs):c.startedAt?w(Date.now()-c.startedAt):`—`},{label:`Spend`,value:c.costUsd==null?`—`:T(c.costUsd)}],actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(f,{to:`/work`,className:`inline-flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),fe&&(0,O.jsxs)(m,{variant:`destructive`,size:`sm`,onClick:()=>void de(),disabled:R,children:[(0,O.jsx)(i,{size:E.sm}),R?`Cancelling...`:`Cancel Task`]})]})}),(0,O.jsxs)(`div`,{className:`flex gap-1 border-b border-[var(--app-border)]`,"data-testid":`task-detail-tabs`,children:[(0,O.jsx)(`button`,{type:`button`,className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${G===`overview`?`border-[var(--app-accent)] text-[var(--app-accent)]`:`border-transparent text-[var(--app-muted)] hover:text-[var(--app-fg)]`}`,onClick:()=>K(`overview`),"data-testid":`tab-overview`,children:`Overview`}),(0,O.jsx)(`button`,{type:`button`,className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${G===`artifacts`?`border-[var(--app-accent)] text-[var(--app-accent)]`:`border-transparent text-[var(--app-muted)] hover:text-[var(--app-fg)]`}`,onClick:()=>K(`artifacts`),"data-testid":`tab-artifacts`,children:`Artifacts`})]}),G===`artifacts`&&(0,O.jsxs)(`div`,{"data-testid":`artifacts-tab-content`,children:[(0,O.jsx)(_,{artifacts:q,selectedId:Q,onSelect:$,loading:Y,error:le}),Q&&(()=>{let e=q.find(e=>e.id===Q);return e?(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,"data-testid":`artifact-modal-backdrop`,onClick:()=>$(null),children:(0,O.jsx)(`div`,{className:`bg-[var(--app-bg)] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-auto`,onClick:e=>e.stopPropagation(),children:(0,O.jsx)(re,{artifact:e,onDeleted:()=>{$(null),J(e=>e.filter(e=>e.id!==Q))},onRedelivered:()=>{}})})}):null})()]}),G===`overview`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(x,{className:`surface-accent text-white`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`p`,{className:`text-kicker text-white/70`,children:`Summary`}),(0,O.jsx)(`p`,{className:`mt-2 text-base leading-7 text-white`,children:c.prompt.length>220&&!B?`${c.prompt.slice(0,220)}…`:c.prompt})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c.prompt.length>220?(0,O.jsxs)(m,{variant:`secondary`,size:`sm`,onClick:()=>ce(e=>!e),children:[(0,O.jsx)(r,{size:E.sm}),B?`Collapse prompt`:`Show full prompt`]}):null,(0,O.jsxs)(m,{variant:`secondary`,size:`sm`,onClick:()=>W(e=>!e),children:[(0,O.jsx)(l,{size:E.sm}),U?`Hide diagnostics`:`Show diagnostics`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,O.jsx)(j,{icon:a,label:`Created`,value:C(c.createdAt)}),(0,O.jsx)(j,{icon:a,label:`Duration`,value:c.totalDurationMs?w(c.totalDurationMs):c.startedAt?w(Date.now()-c.startedAt):`—`}),(0,O.jsx)(j,{icon:s,label:`Cost`,value:c.costUsd==null?`—`:T(c.costUsd)}),(0,O.jsx)(j,{icon:t,label:`Turns`,value:String(c.numTurns??`—`)})]}),(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,O.jsx)(j,{icon:o,label:`Role`,value:c.roleId??`—`,mono:!0}),(0,O.jsx)(j,{icon:n,label:`Parent`,value:c.parentId??`—`,mono:!0}),c.templateId?(0,O.jsxs)(f,{to:`/work`,className:`block`,children:[(0,O.jsx)(j,{icon:n,label:`Template`,value:c.templateId,mono:!0}),(0,O.jsx)(`span`,{className:`mt-0.5 block text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:`View in Automations →`})]}):(0,O.jsx)(j,{icon:n,label:`Template`,value:`—`,mono:!0}),c.sourceSessionId&&(0,O.jsx)(j,{icon:t,label:`Source Session`,value:c.sourceSessionId.slice(0,8),mono:!0})]}),(c.deliverTo||c.reportTo)&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Delivery Targets`}),(0,O.jsx)(b,{children:`Where results and status updates are sent after execution.`})]})}),(0,O.jsxs)(`div`,{className:`space-y-3`,children:[c.deliverTo&&c.deliverTo.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Output`}),(0,O.jsx)(`div`,{className:`space-y-1`,children:c.deliverTo.map((e,t)=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,O.jsx)(g,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`d-${t}`))})]}),c.reportTo&&c.reportTo.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Status Reports`}),(0,O.jsx)(`div`,{className:`space-y-1`,children:c.reportTo.map((e,t)=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,O.jsx)(g,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`r-${t}`))})]})]})]}),P&&(c.status===`completed`||c.status===`failed`)&&(0,O.jsx)(se,{score:P}),c.tokenUsage&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Token Usage`}),(0,O.jsx)(b,{children:`Input and output token totals for this execution.`})]})}),(0,O.jsxs)(`div`,{className:`flex gap-6 text-sm`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Input:`}),` `,(0,O.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:c.tokenUsage.input.toLocaleString()})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Output:`}),` `,(0,O.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:c.tokenUsage.output.toLocaleString()})]})]})]}),p.length>0&&(()=>{let e=p[0],t=e.plan.overallRisk===`high`?`destructive`:e.plan.overallRisk===`medium`?`warning`:`secondary`;return(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Execution Plan`}),(0,O.jsx)(b,{children:`Expected steps, risk, and permissions before execution.`})]}),(0,O.jsxs)(g,{variant:t,children:[e.plan.overallRisk.toUpperCase(),` RISK`]}),(0,O.jsx)(g,{variant:`outline`,children:e.status})]})}),(0,O.jsxs)(`h4`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:[`Plan Steps (`,e.plan.steps.length,`)`]}),(0,O.jsx)(`div`,{className:`space-y-2`,children:e.plan.steps.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)]/50 p-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,e.index]}),(0,O.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:e.description})]}),(0,O.jsx)(g,{variant:e.riskLevel===`high`?`destructive`:e.riskLevel===`medium`?`warning`:`secondary`,children:e.riskLevel})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:[`Tools: `,e.toolsNeeded.join(`, `)||`none`]}),e.expectedOutput&&(0,O.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,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-1`,children:`Required Permissions`}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.keys(e.plan.requiredPermissions).map(e=>(0,O.jsx)(g,{variant:`secondary`,children:e},e))})]}),e.deviationReport&&(0,O.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,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-warning)] mb-2`,children:`Deviation Report`}),(0,O.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,O.jsx)(`div`,{className:`space-y-1`,children:e.deviationReport.deviations.map((e,t)=>(0,O.jsxs)(`div`,{className:`text-xs`,children:[(0,O.jsxs)(`span`,{className:`text-[var(--app-warning)] font-mono`,children:[`[`,e.deviationType,`]`]}),(0,O.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[` Step `,e.stepIndex,`: `]}),(0,O.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.actual})]},t))})]}),e.learnedRules&&e.learnedRules.length>0&&(0,O.jsxs)(`div`,{className:`mt-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:`Learned Rules`}),(0,O.jsx)(`ul`,{className:`space-y-1`,children:e.learnedRules.map((e,t)=>(0,O.jsxs)(`li`,{className:`text-xs text-[var(--app-text-muted)] flex items-start gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-[var(--app-accent)] mt-0.5`,children:`*`}),e]},t))})]})]})})(),k.length>0&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(v,{children:[`Execution Timeline (`,k.length,` steps)`]}),(0,O.jsx)(b,{children:`Ordered execution events, tool calls, and error markers.`})]})}),(0,O.jsx)(oe,{logs:k})]}),c.result&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Result`}),(0,O.jsx)(b,{children:`The final task output. Raw text stays collapsed until needed.`})]}),c.result.length>360?(0,O.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>H(e=>!e),children:V?`Collapse`:`Expand`}):null]})}),(0,O.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:c.result.length>360&&!V?`${c.result.slice(0,360)}…`:c.result})]}),c.error&&(()=>{let e=[`plugin`,`--plugin-dir`,`failed to load plugin`],t=c.error.toLowerCase(),n=e.some(e=>t.includes(e)),r=n?c.error.split(`
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{G as t,U as n,Y as r,_t as i,at as a,o,rt as s,st as c,v as l,vt as u,xt as d}from"./vendor-icons-Bc_e_XXa.js";import{f as ee,r as f,t as p}from"./vendor-react-bQ_cvNuA.js";import{t as m}from"./Button-CRNb8sD3.js";import{s as te,t as h}from"./api-BP4ZP9kk.js";import{n as ne,t as g}from"./index-Dd3NDYZR.js";import{i as _,t as re}from"./ArtifactDetail-DDTEAl2E.js";import{a as v,i as y,r as b,t as x}from"./Card-Cwvv0An8.js";import{t as ie}from"./PageHeader-acLQTYct.js";import{t as ae}from"./SectionHeader-NZWZgoOs.js";import{a as S,n as C,r as w,t as T}from"./format-ZWN4JNj-.js";import{t as E}from"./ui-D1crlGpt.js";var D=e(d(),1),O=p(),k={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 oe({logs:e}){let[t,n]=(0,D.useState)(new Set);return e.length===0?(0,O.jsx)(`p`,{className:`text-sm text-[var(--app-text-subtle)]`,children:`No execution steps yet.`}):(0,O.jsx)(`div`,{className:`space-y-0`,children:e.map((r,i)=>{let a=i>0?e[i-1].timestamp:null,o=a?r.timestamp-a:null,s=r.type===`plugin_error`,l=t.has(i)?r.content:r.content.length>200?r.content.slice(0,200)+`...`:r.content;return(0,O.jsxs)(`div`,{className:`flex gap-3`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,O.jsx)(c,{size:10,className:`mt-1.5 flex-shrink-0 fill-current ${k[r.type]??`text-[var(--app-text-subtle)]`} ${s?`rounded-full ring-2 ring-[var(--app-danger)]`:``}`}),i<e.length-1&&(0,O.jsx)(`div`,{className:`mt-0.5 w-0.5 flex-1 bg-[var(--app-border)]`})]}),(0,O.jsxs)(`div`,{className:`flex-1 pb-4 ${s?`rounded-lg border border-[var(--app-danger)]/40 bg-[var(--app-danger-soft-bg-subtle)] p-3`:``}`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,O.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,r.index]}),(0,O.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:r.toolName??r.type}),s&&(0,O.jsx)(g,{variant:`destructive`,children:`Plugin Error`}),(0,O.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:S(r.timestamp)}),o!=null&&o>0&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`+`,o,`ms`]}),r.truncated&&(0,O.jsx)(g,{variant:`outline`,children:`truncated`})]}),l&&(0,O.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 A(){let{id:e}=ee(),[c,d]=(0,D.useState)(null),[p,S]=(0,D.useState)([]),[k,A]=(0,D.useState)([]),[M,N]=(0,D.useState)([]),[P,F]=(0,D.useState)(null),[I,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(!1),[B,ce]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(!1),[G,K]=(0,D.useState)(`overview`),[q,J]=(0,D.useState)([]),[Y,X]=(0,D.useState)(!1),[le,Z]=(0,D.useState)(null),[Q,$]=(0,D.useState)(null),ue=(0,D.useMemo)(()=>{if(!c)return`No diagnostics yet`;let e=[];return c.error&&e.push(`error`),k.length>0&&e.push(`${k.length} steps`),M.length>0&&e.push(`${M.length} delivery events`),e.length>0?e.join(` · `):`No diagnostics yet`},[M.length,k.length,c]);(0,D.useEffect)(()=>{if(!e)return;let t=!1,n=async()=>{if(!t)try{let n=await h(`/tasks/${e}`);if(t)return;d(n.task),L(null)}catch(e){if(t)return;L(e instanceof Error?e.message:`Failed to load task`)}};n(),h(`/tasks/${e}/plan`).then(e=>{t||S(e.plans)}).catch(()=>{t||S([])}),h(`/tasks/${e}/logs?limit=200`).then(e=>{t||A(e.logs)}).catch(()=>{t||A([])}),te(e).then(e=>{t||N(e)}).catch(()=>{t||N([])});let r=setInterval(n,3e3);return()=>{t=!0,clearInterval(r)}},[e]),(0,D.useEffect)(()=>{if(!e||G!==`artifacts`)return;let t=!1;return X(!0),Z(null),h(`/tasks/${e}/artifacts`).then(e=>{t||(J(e.artifacts),X(!1))}).catch(e=>{t||(Z(e instanceof Error?e.message:`Failed to load artifacts`),X(!1))}),()=>{t=!0}},[e,G]),(0,D.useEffect)(()=>{if(!c?.roleId||!e)return;let t=!1;return h(`/roles/${c.roleId}/scores?limit=100`).then(n=>{t||F(n.scores.find(t=>t.taskId===e)??null)}).catch(()=>{t||F(null)}),()=>{t=!0}},[c?.roleId,e]);let de=async()=>{if(e){z(!0);try{await h(`/tasks/${e}/cancel`,{method:`POST`}),d(e=>e&&{...e,status:`cancelled`})}finally{z(!1)}}};if(I)return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(f,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),(0,O.jsx)(x,{className:`text-center text-[var(--app-danger)]`,children:I})]});if(!c)return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(f,{to:`/work`,className:`flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),(0,O.jsx)(x,{className:`text-center text-[var(--app-text-subtle)]`,children:`Loading...`})]});let fe=[`running`,`queued`,`pending`,`paused`].includes(c.status);return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsx)(ie,{eyebrow:`Task`,title:`Task Detail`,compact:!0,description:`Summary, execution, result, and diagnostics.`,metrics:[{label:`Status`,value:(0,O.jsx)(g,{variant:ne(c.status),children:c.status})},{label:`Task`,value:c.id.slice(0,8)},{label:`Elapsed`,value:c.totalDurationMs?w(c.totalDurationMs):c.startedAt?w(Date.now()-c.startedAt):`—`},{label:`Spend`,value:c.costUsd==null?`—`:T(c.costUsd)}],actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(f,{to:`/work`,className:`inline-flex items-center gap-1.5 text-sm text-[var(--app-text-muted)] hover:text-[var(--app-text)]`,children:[(0,O.jsx)(u,{size:E.sm}),` Back to Tasks`]}),fe&&(0,O.jsxs)(m,{variant:`destructive`,size:`sm`,onClick:()=>void de(),disabled:R,children:[(0,O.jsx)(i,{size:E.sm}),R?`Cancelling...`:`Cancel Task`]})]})}),(0,O.jsxs)(`div`,{className:`flex gap-1 border-b border-[var(--app-border)]`,"data-testid":`task-detail-tabs`,children:[(0,O.jsx)(`button`,{type:`button`,className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${G===`overview`?`border-[var(--app-accent)] text-[var(--app-accent)]`:`border-transparent text-[var(--app-muted)] hover:text-[var(--app-fg)]`}`,onClick:()=>K(`overview`),"data-testid":`tab-overview`,children:`Overview`}),(0,O.jsx)(`button`,{type:`button`,className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${G===`artifacts`?`border-[var(--app-accent)] text-[var(--app-accent)]`:`border-transparent text-[var(--app-muted)] hover:text-[var(--app-fg)]`}`,onClick:()=>K(`artifacts`),"data-testid":`tab-artifacts`,children:`Artifacts`})]}),G===`artifacts`&&(0,O.jsxs)(`div`,{"data-testid":`artifacts-tab-content`,children:[(0,O.jsx)(_,{artifacts:q,selectedId:Q,onSelect:$,loading:Y,error:le}),Q&&(()=>{let e=q.find(e=>e.id===Q);return e?(0,O.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,"data-testid":`artifact-modal-backdrop`,onClick:()=>$(null),children:(0,O.jsx)(`div`,{className:`bg-[var(--app-bg)] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-auto`,onClick:e=>e.stopPropagation(),children:(0,O.jsx)(re,{artifact:e,onDeleted:()=>{$(null),J(e=>e.filter(e=>e.id!==Q))},onRedelivered:()=>{}})})}):null})()]}),G===`overview`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(x,{className:`surface-accent text-white`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`p`,{className:`text-kicker text-white/70`,children:`Summary`}),(0,O.jsx)(`p`,{className:`mt-2 text-base leading-7 text-white`,children:c.prompt.length>220&&!B?`${c.prompt.slice(0,220)}…`:c.prompt})]}),(0,O.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c.prompt.length>220?(0,O.jsxs)(m,{variant:`secondary`,size:`sm`,onClick:()=>ce(e=>!e),children:[(0,O.jsx)(r,{size:E.sm}),B?`Collapse prompt`:`Show full prompt`]}):null,(0,O.jsxs)(m,{variant:`secondary`,size:`sm`,onClick:()=>W(e=>!e),children:[(0,O.jsx)(l,{size:E.sm}),U?`Hide diagnostics`:`Show diagnostics`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,O.jsx)(j,{icon:a,label:`Created`,value:C(c.createdAt)}),(0,O.jsx)(j,{icon:a,label:`Duration`,value:c.totalDurationMs?w(c.totalDurationMs):c.startedAt?w(Date.now()-c.startedAt):`—`}),(0,O.jsx)(j,{icon:s,label:`Cost`,value:c.costUsd==null?`—`:T(c.costUsd)}),(0,O.jsx)(j,{icon:t,label:`Turns`,value:String(c.numTurns??`—`)})]}),(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,O.jsx)(j,{icon:o,label:`Role`,value:c.roleId??`—`,mono:!0}),(0,O.jsx)(j,{icon:n,label:`Parent`,value:c.parentId??`—`,mono:!0}),c.templateId?(0,O.jsxs)(f,{to:`/work`,className:`block`,children:[(0,O.jsx)(j,{icon:n,label:`Template`,value:c.templateId,mono:!0}),(0,O.jsx)(`span`,{className:`mt-0.5 block text-xs text-[var(--app-accent)] hover:text-[var(--app-accent)]`,children:`View in Automations →`})]}):(0,O.jsx)(j,{icon:n,label:`Template`,value:`—`,mono:!0}),c.sourceSessionId&&(0,O.jsx)(j,{icon:t,label:`Source Session`,value:c.sourceSessionId.slice(0,8),mono:!0})]}),(c.deliverTo||c.reportTo)&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Delivery Targets`}),(0,O.jsx)(b,{children:`Where results and status updates are sent after execution.`})]})}),(0,O.jsxs)(`div`,{className:`space-y-3`,children:[c.deliverTo&&c.deliverTo.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Output`}),(0,O.jsx)(`div`,{className:`space-y-1`,children:c.deliverTo.map((e,t)=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,O.jsx)(g,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`d-${t}`))})]}),c.reportTo&&c.reportTo.length>0&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)] mb-1`,children:`Status Reports`}),(0,O.jsx)(`div`,{className:`space-y-1`,children:c.reportTo.map((e,t)=>(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-[var(--app-text)]`,children:[(0,O.jsx)(g,{variant:`outline`,children:e.type===`channel`?`Channel`:`Session`}),e.type===`channel`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`font-mono text-xs`,children:e.channelId.slice(0,8)}),e.chatId&&(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`chat: `,e.chatId.slice(0,8)]})]}):(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:[`session `,e.sessionId?.slice(0,8)]})]},`r-${t}`))})]})]})]}),P&&(c.status===`completed`||c.status===`failed`)&&(0,O.jsx)(se,{score:P}),c.tokenUsage&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Token Usage`}),(0,O.jsx)(b,{children:`Input and output token totals for this execution.`})]})}),(0,O.jsxs)(`div`,{className:`flex gap-6 text-sm`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Input:`}),` `,(0,O.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:c.tokenUsage.input.toLocaleString()})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:`Output:`}),` `,(0,O.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:c.tokenUsage.output.toLocaleString()})]})]})]}),p.length>0&&(()=>{let e=p[0],t=e.plan.overallRisk===`high`?`destructive`:e.plan.overallRisk===`medium`?`warning`:`secondary`;return(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Execution Plan`}),(0,O.jsx)(b,{children:`Expected steps, risk, and permissions before execution.`})]}),(0,O.jsxs)(g,{variant:t,children:[e.plan.overallRisk.toUpperCase(),` RISK`]}),(0,O.jsx)(g,{variant:`outline`,children:e.status})]})}),(0,O.jsxs)(`h4`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:[`Plan Steps (`,e.plan.steps.length,`)`]}),(0,O.jsx)(`div`,{className:`space-y-2`,children:e.plan.steps.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)]/50 p-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`text-xs font-mono text-[var(--app-text-subtle)]`,children:[`#`,e.index]}),(0,O.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:e.description})]}),(0,O.jsx)(g,{variant:e.riskLevel===`high`?`destructive`:e.riskLevel===`medium`?`warning`:`secondary`,children:e.riskLevel})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-xs text-[var(--app-text-muted)]`,children:[`Tools: `,e.toolsNeeded.join(`, `)||`none`]}),e.expectedOutput&&(0,O.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,O.jsxs)(`div`,{className:`mt-2`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-1`,children:`Required Permissions`}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:Object.keys(e.plan.requiredPermissions).map(e=>(0,O.jsx)(g,{variant:`secondary`,children:e},e))})]}),e.deviationReport&&(0,O.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,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-warning)] mb-2`,children:`Deviation Report`}),(0,O.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,O.jsx)(`div`,{className:`space-y-1`,children:e.deviationReport.deviations.map((e,t)=>(0,O.jsxs)(`div`,{className:`text-xs`,children:[(0,O.jsxs)(`span`,{className:`text-[var(--app-warning)] font-mono`,children:[`[`,e.deviationType,`]`]}),(0,O.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[` Step `,e.stepIndex,`: `]}),(0,O.jsx)(`span`,{className:`text-[var(--app-text)]`,children:e.actual})]},t))})]}),e.learnedRules&&e.learnedRules.length>0&&(0,O.jsxs)(`div`,{className:`mt-3`,children:[(0,O.jsx)(`p`,{className:`text-sm font-medium text-[var(--app-text)] mb-2`,children:`Learned Rules`}),(0,O.jsx)(`ul`,{className:`space-y-1`,children:e.learnedRules.map((e,t)=>(0,O.jsxs)(`li`,{className:`text-xs text-[var(--app-text-muted)] flex items-start gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-[var(--app-accent)] mt-0.5`,children:`*`}),e]},t))})]})]})})(),k.length>0&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(v,{children:[`Execution Timeline (`,k.length,` steps)`]}),(0,O.jsx)(b,{children:`Ordered execution events, tool calls, and error markers.`})]})}),(0,O.jsx)(oe,{logs:k})]}),c.result&&(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-3`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Result`}),(0,O.jsx)(b,{children:`The final task output. Raw text stays collapsed until needed.`})]}),c.result.length>360?(0,O.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>H(e=>!e),children:V?`Collapse`:`Expand`}):null]})}),(0,O.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:c.result.length>360&&!V?`${c.result.slice(0,360)}…`:c.result})]}),c.error&&(()=>{let e=[`plugin`,`--plugin-dir`,`failed to load plugin`],t=c.error.toLowerCase(),n=e.some(e=>t.includes(e)),r=n?c.error.split(`
2
2
  `).find(t=>e.some(e=>t.toLowerCase().includes(e))):null;return(0,O.jsxs)(x,{className:n?`border-[var(--app-danger)]`:``,children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Error`}),(0,O.jsx)(b,{children:`Execution failed or returned an error condition.`})]}),n&&(0,O.jsx)(g,{variant:`warning`,children:`Plugin Issue`})]})}),n&&r&&(0,O.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,O.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:c.error})]})})(),(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(v,{children:`Diagnostics`}),(0,O.jsx)(b,{children:ue})]})}),U?M.length>0?(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsx)(ae,{title:`Delivery Log`,description:`Recent delivery attempts and outcomes.`}),(0,O.jsx)(`div`,{className:`space-y-2`,children:M.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,O.jsxs)(`div`,{className:`surface-panel-muted rounded-lg px-3 py-3 text-sm`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,O.jsx)(g,{variant:t,children:e.status}),(0,O.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:n}),e.messageType?(0,O.jsxs)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`(`,e.messageType,`)`]}):null]}),e.error?(0,O.jsx)(`p`,{className:`mt-2 text-xs text-[var(--app-danger-soft-text)]`,children:e.error}):null,(0,O.jsxs)(`p`,{className:`mt-2 text-xs text-[var(--app-text-subtle)]`,children:[C(e.createdAt),e.deliveredAt&&` \u2192 ${C(e.deliveredAt)}`]})]},e.id)})})]}):(0,O.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,O.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 se({score:e}){let t=[{label:`Task Success`,value:e.scores.taskSuccess,weight:`25%`},{label:`Plan Accuracy`,value:e.scores.planAccuracy,weight:`20%`},{label:`Permission Compliance`,value:e.scores.permissionCompliance,weight:`20%`},{label:`Efficiency`,value:e.scores.efficiency,weight:`15%`},{label:`Intent Fulfillment`,value:e.scores.intentFulfillment,weight:`20%`,pending:e.scores.intentFulfillment==null}];return(0,O.jsxs)(x,{children:[(0,O.jsx)(y,{children:(0,O.jsx)(v,{children:`Quality Score`})}),(0,O.jsxs)(`div`,{className:`space-y-3`,children:[t.map(e=>(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs`,children:[(0,O.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[e.label,` `,(0,O.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`(`,e.weight,`)`]})]}),e.pending?(0,O.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,title:`Intent eval pending or failed`,children:`—`}):(0,O.jsxs)(`span`,{className:`font-mono text-[var(--app-text)]`,children:[((e.value??0)*100).toFixed(0),`%`]})]}),!e.pending&&e.value!=null&&(0,O.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-[var(--app-panel-elevated)]`,children:(0,O.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,O.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-[var(--app-border)] pt-2`,children:[(0,O.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`Weighted Score`}),(0,O.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-[var(--app-text)]`,children:[(e.scores.weighted*100).toFixed(0),`%`]})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsx)(`span`,{className:`text-sm text-[var(--app-text)]`,children:`EMA (after this task)`}),(0,O.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 j({icon:e,label:t,value:n,mono:r}){return(0,O.jsxs)(x,{className:`flex flex-col gap-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[var(--app-text-subtle)]`,children:[(0,O.jsx)(e,{size:12}),(0,O.jsx)(`span`,{className:`text-xs`,children:t})]}),(0,O.jsx)(`span`,{className:`text-sm text-[var(--app-text)] truncate ${r?`font-mono text-xs`:``}`,children:n})]})}export{A as TaskDetail};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,B as n,D as r,X as i,_t as a,d as o,ft as s,j as c,l,mt as u,pt as ee,u as te,w as ne,xt as d}from"./vendor-icons-Bc_e_XXa.js";import{r as f,t as p}from"./vendor-react-bQ_cvNuA.js";import"./es2015-BkFSNOYE.js";import{t as m}from"./Button-CRNb8sD3.js";import{t as h}from"./vendor-state-BMVR_B0I.js";import{_ as re,t as g}from"./api-BP4ZP9kk.js";import{a as _,c as ie,f as v,i as ae,l as oe,n as y,o as se,p as b,r as x,s as S,t as C,u as ce}from"./index-CXEJd-0s.js";import{t as w}from"./Card-Cwvv0An8.js";import{t as le}from"./PageHeader-acLQTYct.js";import{t as ue}from"./SectionHeader-NZWZgoOs.js";import{a as T,o as E,t as de}from"./format-ZWN4JNj-.js";import{t as fe}from"./EmptyState-BvQA1o5K.js";import{t as D}from"./ui-D1crlGpt.js";import{t as pe}from"./useIsMobileLayout-BogOiFTv.js";import{a as me,i as O,n as he,o as k,r as A,t as ge}from"./Table-CvSmzzkm.js";import{t as _e}from"./Switch-1JjR4Imr.js";import{Goals as j,t as ve}from"./Goals-D3h4WMjU.js";import{i as M,n as N,r as ye,t as P}from"./Tabs-DWk9HyNd.js";var F=e(d(),1),I=p(),L=[{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`}],R=new Set([`pending`,`queued`,`running`,`paused`]);function be(){let e=v(e=>e.tasks),t=v(e=>e.fetchTasks),[i,o]=(0,F.useState)(`all`),[s,c]=(0,F.useState)(!1),[l,ee]=(0,F.useState)(``),[te,d]=(0,F.useState)(!1),[p,h]=(0,F.useState)(new Set),[re,_]=(0,F.useState)(!1),ie=pe();(0,F.useEffect)(()=>{let e=i===`all`?void 0:i;t(e);let n=setInterval(()=>void t(e),5e3);return()=>clearInterval(n)},[t,i]),(0,F.useEffect)(()=>{h(new Set)},[i]);let ae=async()=>{if(l.trim()){d(!0);try{await g(`/tasks`,{method:`POST`,body:JSON.stringify({prompt:l.trim()})}),ee(``),c(!1),t(i===`all`?void 0:i)}finally{d(!1)}}},oe=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},se=()=>{let e=x.filter(e=>R.has(e.status)).map(e=>e.id);h(new Set(e))},b=async()=>{if(p.size!==0){_(!0);try{await g(`/tasks/batch-cancel`,{method:`POST`,body:JSON.stringify({taskIds:Array.from(p)})}),h(new Set),t(i===`all`?void 0:i)}finally{_(!1)}}},x=[...e].sort((e,t)=>t.createdAt-e.createdAt),S=Array.from(p).filter(t=>{let n=e.find(e=>e.id===t);return n&&R.has(n.status)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(ue,{title:`Tasks`,description:`Review active execution, cancel work, or create the next task.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[p.size>0&&(0,I.jsxs)(m,{variant:`destructive`,size:`sm`,onClick:()=>void b(),disabled:re||S.length===0,children:[(0,I.jsx)(a,{size:D.sm}),re?`Cancelling...`:`Cancel ${S.length} task${S.length===1?``:`s`}`]}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>void t(i===`all`?void 0:i),children:(0,I.jsx)(ne,{size:D.sm})}),(0,I.jsxs)(m,{size:`sm`,onClick:()=>c(!s),children:[(0,I.jsx)(r,{size:D.sm}),`New Task`]})]})}),s&&(0,I.jsxs)(w,{className:`flex gap-2`,children:[(0,I.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:l,onChange:e=>ee(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ae()}}),(0,I.jsx)(m,{onClick:()=>void ae(),disabled:te||!l.trim(),children:te?`Creating...`:`Create`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>c(!1),children:`Cancel`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:L.map(e=>(0,I.jsx)(`button`,{onClick:()=>o(e.value),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${i===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,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[x.some(e=>R.has(e.status))&&(0,I.jsx)(`button`,{onClick:se,className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:`Select all cancellable`}),p.size>0&&(0,I.jsxs)(`button`,{onClick:()=>h(new Set),className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:[`Clear selection (`,p.size,`)`]})]})]}),x.length===0?(0,I.jsx)(w,{padding:!1,children:(0,I.jsx)(fe,{icon:(0,I.jsx)(n,{size:32}),title:`No tasks found`,description:i===`all`?`Create a task to get started`:`No tasks with status "${i}"`})}):ie?(0,I.jsx)(`div`,{className:`space-y-3`,children:x.map(e=>(0,I.jsx)(w,{className:p.has(e.id)?`border-[var(--app-accent)]/40 bg-[var(--app-accent)]/8`:``,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`pt-1`,children:R.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>oe(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.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:p.has(e.id)&&(0,I.jsx)(u,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block h-4 w-4`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,I.jsx)(f,{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,I.jsx)(`p`,{className:`break-words text-sm font-medium leading-6 text-[var(--app-text)]`,children:E(e.prompt,140)})]}),(0,I.jsx)(C,{variant:y(e.status),children:e.status})]}),(0,I.jsxs)(`div`,{className:`grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Role`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.roleId?e.roleId.slice(0,12):`—`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Cost`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.costUsd==null?`—`:de(e.costUsd)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Created`}),(0,I.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:T(e.createdAt)})]})]})]})]})},e.id))}):(0,I.jsx)(w,{padding:!1,children:(0,I.jsxs)(ge,{children:[(0,I.jsx)(me,{children:(0,I.jsxs)(k,{children:[(0,I.jsx)(O,{className:`w-8`,children:(0,I.jsx)(`button`,{onClick:()=>{p.size>0&&p.size===x.filter(e=>R.has(e.status)).length?h(new Set):se()},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.size>0&&p.size===x.filter(e=>R.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:p.size>0&&p.size===x.filter(e=>R.has(e.status)).length&&(0,I.jsx)(u,{size:12})})}),(0,I.jsx)(O,{children:`ID`}),(0,I.jsx)(O,{children:`Prompt`}),(0,I.jsx)(O,{children:`Status`}),(0,I.jsx)(O,{children:`Role`}),(0,I.jsx)(O,{children:`Cost`}),(0,I.jsx)(O,{children:`Created`})]})}),(0,I.jsx)(he,{children:x.map(e=>(0,I.jsxs)(k,{className:p.has(e.id)?`bg-[var(--app-panel-elevated)]/50`:``,children:[(0,I.jsx)(A,{children:R.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>oe(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.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:p.has(e.id)&&(0,I.jsx)(u,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block w-4`})}),(0,I.jsx)(A,{children:(0,I.jsx)(f,{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,I.jsx)(A,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`break-words font-medium text-[var(--app-text)]`,children:E(e.prompt,120)}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.totalDurationMs?de(e.costUsd??0):`Awaiting completion`,` · `,T(e.createdAt)]})]})}),(0,I.jsx)(A,{children:(0,I.jsx)(C,{variant:y(e.status),children:e.status})}),(0,I.jsx)(A,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:e.roleId?e.roleId.slice(0,12):`—`})}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:e.costUsd==null?`—`:de(e.costUsd)}),(0,I.jsx)(A,{className:`text-xs text-[var(--app-text-subtle)]`,children:T(e.createdAt)})]},e.id))})]})})]})}function z(e,t){return e.find(e=>e.contractField===t)?.message??null}function B({label:e,status:t,tooltip:n}){let[r,i]=(0,F.useState)(!1),a=t===`pass`?`text-[var(--app-success-soft-text)]`:t===`fail`?`text-[var(--app-danger-soft-text)]`:`text-[var(--app-text-subtle)]`,o=t===`pass`?`✓`:t===`fail`?`✗`:`—`;return(0,I.jsxs)(`span`,{className:`relative inline-flex items-center gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`cursor-default text-xs font-medium ${a}`,onClick:()=>i(e=>!e),title:n??void 0,children:[e,`:`,o]}),r&&n&&(0,I.jsx)(`span`,{className:`absolute bottom-full left-0 z-50 mb-1 w-48 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] shadow-md`,children:n})]})}function xe({contract:e,retried:t}){let{violations:n,layerCPassed:r}=e,i=z(n,`lengthTarget`),a=z(n,`persona.speakAs`),o=z(n,`mustReferenceArtifacts`),s=z(n,`customAssertions`);return(0,I.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,I.jsx)(B,{label:`长度`,status:i?`fail`:`pass`,tooltip:i}),(0,I.jsx)(B,{label:`身份`,status:a?`fail`:`pass`,tooltip:a}),(0,I.jsx)(B,{label:`上游引用`,status:o?`fail`:`pass`,tooltip:o}),(0,I.jsx)(B,{label:`自定义`,status:r===null?`na`:r?`pass`:`fail`,tooltip:s}),t&&(0,I.jsx)(`span`,{className:`ml-1 rounded-full bg-[var(--app-warning-soft-bg)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--app-warning-soft-text)]`,children:`重试 #1`})]})}function V(e){return`step-${e+1}`}function H(e,t,n){if(!(e===`concat-step-results`||!e)&&e===`primary-artifact`)return t?{mode:`primary-artifact`,primaryArtifact:{stepId:t,...n?{key:n}:{}}}:void 0}function Se(e,t){return{...e??{},...t}}function Ce(){let e=v(e=>e.templates),n=v(e=>e.fetchTemplates),a=v(e=>e.goals),u=v(e=>e.fetchGoals),d=v(e=>e.roles),f=v(e=>e.fetchRoles),[p,h]=(0,F.useState)(!1),[y,le]=(0,F.useState)(``),[E,de]=(0,F.useState)(`manual`),[D,pe]=(0,F.useState)(``),[j,M]=(0,F.useState)(``),[N,ye]=(0,F.useState)(``),[P,L]=(0,F.useState)([{id:`step-1`,prompt:``}]),[R,be]=(0,F.useState)(!1),[z,B]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)(null),[U,Te]=(0,F.useState)(null),[W,Ee]=(0,F.useState)(null),[G,K]=(0,F.useState)(null),[De,q]=(0,F.useState)(`template_only`),[Oe,ke]=(0,F.useState)(!1),[J,Ae]=(0,F.useState)(null),[Y,je]=(0,F.useState)(``),[X,Me]=(0,F.useState)(`manual`),[Ne,Pe]=(0,F.useState)(``),[Fe,Ie]=(0,F.useState)(``),[Le,Re]=(0,F.useState)(``),[ze,Be]=(0,F.useState)(``),[Ve,He]=(0,F.useState)(``),[Ue,We]=(0,F.useState)([]),[Z,Q]=(0,F.useState)([]),[Ge,Ke]=(0,F.useState)(!1),[qe,Je]=(0,F.useState)(!1),[$,Ye]=(0,F.useState)([]),[Xe,Ze]=(0,F.useState)([]),[Qe,$e]=(0,F.useState)([]),[et,tt]=(0,F.useState)(`concat-step-results`),[nt,rt]=(0,F.useState)(``),[it,at]=(0,F.useState)(``),[ot,st]=(0,F.useState)(``),[ct,lt]=(0,F.useState)(`concat-step-results`),[ut,dt]=(0,F.useState)(``),[ft,pt]=(0,F.useState)(``),[mt,ht]=(0,F.useState)(``),[gt,_t]=(0,F.useState)(null),[vt,yt]=(0,F.useState)([]),[bt,xt]=(0,F.useState)(!1),[St,Ct]=(0,F.useState)({}),wt=(0,F.useCallback)(async e=>{xt(!0);try{let t=await g(`/template-executions?templateId=${e}&limit=5`);yt(await Promise.all(t.executions.map(async e=>{try{let t=await g(`/template-executions/${e.id}`);return{...t.execution,stepTasks:t.stepTasks}}catch{return{...e,stepTasks:[]}}})))}catch{yt([])}finally{xt(!1)}},[]),Tt=(0,F.useCallback)(async(e,t)=>{Ct(t=>({...t,[e]:`pending`}));try{await re(e,t),Ct(n=>({...n,[e]:t}))}catch{Ct(t=>{let n={...t};return delete n[e],n}),b.error(`Failed to record feedback`)}},[]),Et=(0,F.useCallback)(e=>{gt===e?(_t(null),yt([])):(_t(e),wt(e))},[gt,wt]),Dt=(0,F.useMemo)(()=>Object.fromEntries(e.map(e=>[e.id,e.name])),[e]),Ot=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 '${Dt[e.event?.split(`:`)[1]??``]??`[deleted template]`}' completes`:e.type===`event`?`On event '${Ue.find(t=>t.id===e.eventDefId)?.name??`[deleted event]`}'`:e.type;(0,F.useEffect)(()=>{n(),u(),f(),(async()=>{try{We(await g(`/event-defs`))}catch{}})()},[n,u,f]);let kt=async()=>{if(y.trim()&&!P.every(e=>!e.prompt.trim())){B(!0);try{let e={name:y.trim(),trigger:{type:E,...E===`cron`&&j?{cron:j}:{},...E===`once`&&N?{runAt:new Date(N).toISOString()}:{},...E===`template_complete`&&D?{event:`template_complete:${D}`}:{},...E===`event`&&ze?{eventDefId:ze}:{}},enabled:!0,...Xe.length>0?{deliverTo:Xe}:{},...(()=>{let e=Se(void 0,{...R?{continueOnError:!0}:{},...H(et,nt,it)?{delivery:H(et,nt,it)}:{}});return Object.keys(e).length>0?{config:e}:{}})()};e.steps=P.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||V(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.consumesFrom?.length?{consumesFrom:e.consumesFrom}:{},...e.consumesFromOptional?.length?{consumesFromOptional:e.consumesFromOptional}:{},...e.persona?{persona:e.persona}:{},...e.outputContract?{outputContract:e.outputContract}:{}})),$.length>0&&(e.goalIds=$),await g(`/task-templates`,{method:`POST`,body:JSON.stringify(e)}),le(``),L([{id:`step-1`,prompt:``}]),M(``),ye(``),pe(``),Be(``),Ye([]),Ze([]),tt(`concat-step-results`),rt(``),at(``),st(``),h(!1),n()}finally{B(!1)}}},At=async t=>{let n=e.find(e=>e.id===t);we(t);try{await g(`/task-templates/${t}/run`,{method:`POST`}),b.success(`Triggered: ${n?.name??t}`)}catch(e){let t=e instanceof Error?e.message:`Failed to trigger template`;b.error(`Trigger failed: ${t}`)}finally{we(null)}},jt=async e=>{Ee(e),q(`template_only`),K(null);try{K((await g(`/task-templates/${e}/dependents`)).dependents)}catch{K({executionCount:0,taskCount:0})}},Mt=async(t,r)=>{let i=e.find(e=>e.id===t);ke(!0);try{let e=await g(`/task-templates/${t}?mode=${r}`,{method:`DELETE`}),a=[];e.deletedCounts.templateExecutions>0&&a.push(`${e.deletedCounts.templateExecutions} template execution${e.deletedCounts.templateExecutions===1?``:`s`}`),e.deletedCounts.tasks>0&&a.push(`${e.deletedCounts.tasks} task${e.deletedCounts.tasks===1?``:`s`}`);let o=a.length?` (+ ${a.join(`, `)})`:``;b.success(`Deleted: ${i?.name??t}${o}`),n()}catch(e){let t=e instanceof Error?e.message:`Failed to delete template`;b.error(`Delete failed: ${t}`)}finally{ke(!1)}},Nt=async t=>{let r=e.find(e=>e.id===t);if(!r)return;if(![`cron`,`once`,`template_complete`].includes(r.trigger.type)){b.error(`Toggle not applicable for manual triggers`);return}let i=!r.enabled;try{await g(`/task-templates/${t}`,{method:`PATCH`,body:JSON.stringify({enabled:i})}),b.success(`${r.name} ${i?`enabled`:`disabled`}`),n()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle template`;b.error(`Toggle failed: ${t}`)}},Pt=e=>{Ae(e.id),je(e.name),Me(e.trigger.type),Pe(e.trigger.cron??``),Ie(e.trigger.runAt?new Date(e.trigger.runAt).toISOString().slice(0,16):``),Q(e.steps.map(e=>({id:e.id,prompt:e.prompt,roleId:e.roleId,dependsOn:e.dependsOn,config:e.config,consumesFrom:e.consumesFrom,consumesFromOptional:e.consumesFromOptional,persona:e.persona,outputContract:e.outputContract,outputAs:e.outputAs}))),Ke(e.config?.continueOnError??!1),lt(e.config?.delivery?.mode??`concat-step-results`),dt(e.config?.delivery?.primaryArtifact?.stepId??``),pt(e.config?.delivery?.primaryArtifact?.key??``),ht(e.config?.delivery?.primaryArtifact?.stepId?e.steps.find(t=>t.id===e.config?.delivery?.primaryArtifact?.stepId)?.outputAs??``:``),$e(e.deliverTo??[]),Re(e.trigger.type===`template_complete`?e.trigger.event?.split(`:`)[1]??``:``),He(e.trigger.eventDefId??``)},Ft=async()=>{if(!(!J||!Y.trim()||Z.every(e=>!e.prompt.trim()))){Je(!0);try{await g(`/task-templates/${J}`,{method:`PATCH`,body:JSON.stringify({name:Y.trim(),trigger:{type:X,...X===`cron`&&Ne?{cron:Ne}:{},...X===`once`&&Fe?{runAt:new Date(Fe).toISOString()}:{},...X===`template_complete`&&Le?{event:`template_complete:${Le}`}:{},...X===`event`&&Ve?{eventDefId:Ve}:{}},steps:Z.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||V(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.consumesFrom?.length?{consumesFrom:e.consumesFrom}:{},...e.consumesFromOptional?.length?{consumesFromOptional:e.consumesFromOptional}:{},...e.persona?{persona:e.persona}:{},...e.outputContract?{outputContract:e.outputContract}:{}})),enabled:e.find(e=>e.id===J)?.enabled??!0,...(()=>{let t=e.find(e=>e.id===J)?.config;return{config:Se(t,{...Ge?{continueOnError:!0}:{continueOnError:!1},...H(ct,ut,ft)?{delivery:H(ct,ut,ft)}:{delivery:void 0}})}})(),deliverTo:Qe.length>0?Qe:void 0})}),Ae(null),n(),b.success(`Template updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update template`;b.error(t)}finally{Je(!1)}}},It=e.find(e=>e.id===U),Lt=e.find(e=>e.id===W);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(ue,{title:`Automations`,description:`Reusable templates, manual triggers, and recent template executions.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>void n(),children:(0,I.jsx)(ne,{size:14})}),(0,I.jsxs)(m,{size:`sm`,onClick:()=>h(!p),children:[(0,I.jsx)(r,{size:14}),`New Automation`]})]})}),p&&(0,I.jsxs)(w,{className:`space-y-3`,children:[(0,I.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:y,onChange:e=>le(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.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:E,onChange:e=>de(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),E===`template_complete`&&(0,I.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:D,onChange:e=>pe(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==J).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),E===`event`&&(0,I.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:ze,onChange:e=>Be(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Ue.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),E===`cron`&&(0,I.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:j,onChange:e=>M(e.target.value)}),E===`once`&&(0,I.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:N,onChange:e=>ye(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:()=>L([...P,{id:V(P.length),prompt:``}]),children:[(0,I.jsx)(r,{size:12}),` Add Step`]})]}),P.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.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=[...P];r[t]={...e,roleId:n.target.value||void 0},L(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),P.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>L(P.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(l,{size:12})})]}),(0,I.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 {{`+P[t-1].id+`.result}} for prev output)`:``}`,rows:2,value:e.prompt,onChange:n=>{let r=[...P];r[t]={...e,prompt:n.target.value},L(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),P.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...P];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.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=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},L(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.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=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},L(r)}})]})]}),t>0&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Consumes:`}),P.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,"aria-label":`consumes ${n.id}`,onClick:()=>{let r=e.consumesFrom??[],i=[...P];i[t]={...e,consumesFrom:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFrom??[]).includes(n.id)?`bg-[var(--app-danger)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id)),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0 ml-1`,children:`(opt)`}),P.slice(0,t).map(n=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`optional-consumes ${n.id}`,onClick:()=>{let r=e.consumesFromOptional??[],i=[...P];i[t]={...e,consumesFromOptional:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFromOptional??[]).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}-opt`))]}),(0,I.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Speak as:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`e.g. 卞旸`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.speakAs??``,onChange:n=>{let r=[...P];r[t]={...e,persona:n.target.value?{speakAs:n.target.value,voiceConstraints:e.persona?.voiceConstraints}:void 0},L(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Voice:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`optional`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.voiceConstraints??``,onChange:n=>{let r=[...P];r[t]={...e,persona:e.persona?.speakAs?{speakAs:e.persona.speakAs,voiceConstraints:n.target.value||void 0}:void 0},L(r)}})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Contract:`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`min`,className:`w-16 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.outputContract?.lengthTarget?.min??``,onChange:n=>{let r=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:i??0,max:e.outputContract?.lengthTarget?.max??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},L(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`—`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`max`,className:`w-16 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.outputContract?.lengthTarget?.max??``,onChange:n=>{let r=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:i??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},L(r)}}),(0,I.jsxs)(`select`,{className:`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.outputContract?.lengthTarget?.unit??`characters`,onChange:n=>{let r=[...P];r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:e.outputContract?.lengthTarget?.max??0,unit:n.target.value}}},L(r)},children:[(0,I.jsx)(`option`,{value:`characters`,children:`chars`}),(0,I.jsx)(`option`,{value:`words`,children:`words`}),(0,I.jsx)(`option`,{value:`bytes`,children:`bytes`})]}),(0,I.jsxs)(`select`,{className:`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.outputContract?.format??``,onChange:n=>{let r=[...P],i=n.target.value;r[t]={...e,outputContract:{...e.outputContract,format:i||void 0}},L(r)},children:[(0,I.jsx)(`option`,{value:``,children:`fmt?`}),(0,I.jsx)(`option`,{value:`markdown`,children:`md`}),(0,I.jsx)(`option`,{value:`text`,children:`txt`}),(0,I.jsx)(`option`,{value:`json`,children:`json`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-0.5 text-[10px] text-[var(--app-text-subtle)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--app-accent)]`,checked:e.outputContract?.mustReferenceArtifacts??!1,onChange:n=>{let r=[...P];r[t]={...e,outputContract:{...e.outputContract,mustReferenceArtifacts:n.target.checked}},L(r)}}),`ref artifacts`]})]})]},e.id))]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Goals`}),a.length===0?(0,I.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No goals available`}):a.map(e=>(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] hover:text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:$.includes(e.id),onChange:t=>{t.target.checked?Ye([...$,e.id]):Ye($.filter(t=>t!==e.id))},className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.name}),(0,I.jsx)(C,{variant:`muted`,className:`text-[10px]`,children:e.status})]},e.id))]}),P.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:R,onChange:e=>be(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,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`text-xs font-medium text-[var(--app-text)]`,children:`投递格式`}),(0,I.jsxs)(`select`,{value:et,onChange:e=>tt(e.target.value),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)] focus:border-[var(--app-accent)] focus:outline-none`,children:[(0,I.jsx)(`option`,{value:`concat-step-results`,children:`拼接每步结果(默认)`}),(0,I.jsx)(`option`,{value:`primary-artifact`,children:`指定主产物`}),(0,I.jsx)(`option`,{value:`custom`,disabled:!0,children:`自定义(即将推出)`})]}),et===`primary-artifact`&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded border border-[var(--app-border)] p-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:`来源 step`}),(0,I.jsxs)(`select`,{value:nt,onChange:e=>{let t=P.find(t=>t.id===e.target.value);rt(e.target.value),st(t?.outputAs??``)},className:`w-full 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`,children:[(0,I.jsx)(`option`,{value:``,children:`选择 step...`}),P.filter(e=>e.prompt.trim()).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),ot&&(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-accent)]`,children:[`Will use step's output: `,(0,I.jsx)(`span`,{className:`font-mono`,children:ot})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:ot?`Or specify custom key:`:`artifact key`}),(0,I.jsx)(`input`,{type:`text`,value:it,onChange:e=>at(e.target.value),placeholder:ot?`留空使用上面的自动解析值`:`手动输入 key`,className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-muted)] focus:border-[var(--app-accent)] focus:outline-none`})]})]})]}),(0,I.jsx)(ve,{value:Xe,onChange:Ze}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{onClick:()=>void kt(),disabled:z||!y.trim()||P.every(e=>!e.prompt.trim())||E===`template_complete`&&!D,children:z?`Creating...`:`Create`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>h(!1),children:`Cancel`})]})]}),J!==null&&(0,I.jsxs)(w,{className:`space-y-3`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Edit Automation`}),(0,I.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:Y,onChange:e=>je(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.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=>Me(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),X===`template_complete`&&(0,I.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=>Re(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==J).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),X===`event`&&(0,I.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:Ve,onChange:e=>He(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Ue.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),X===`cron`&&(0,I.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:Ne,onChange:e=>Pe(e.target.value)}),X===`once`&&(0,I.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:Fe,onChange:e=>Ie(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:()=>Q([...Z,{id:V(Z.length),prompt:``}]),children:[(0,I.jsx)(r,{size:12}),` Add Step`]})]}),Z.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.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=[...Z];r[t]={...e,roleId:n.target.value||void 0},Q(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),Z.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Q(Z.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(l,{size:12})})]}),(0,I.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=[...Z];r[t]={...e,prompt:n.target.value},Q(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),Z.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...Z];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.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=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},Q(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.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=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},Q(r)}})]})]}),t>0&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Consumes:`}),Z.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,"aria-label":`consumes ${n.id}`,onClick:()=>{let r=e.consumesFrom??[],i=[...Z];i[t]={...e,consumesFrom:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFrom??[]).includes(n.id)?`bg-[var(--app-danger)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id)),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0 ml-1`,children:`(opt)`}),Z.slice(0,t).map(n=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`optional-consumes ${n.id}`,onClick:()=>{let r=e.consumesFromOptional??[],i=[...Z];i[t]={...e,consumesFromOptional:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFromOptional??[]).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}-opt`))]}),(0,I.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Speak as:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`e.g. 卞旸`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.speakAs??``,onChange:n=>{let r=[...Z];r[t]={...e,persona:n.target.value?{speakAs:n.target.value,voiceConstraints:e.persona?.voiceConstraints}:void 0},Q(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Voice:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`optional`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.voiceConstraints??``,onChange:n=>{let r=[...Z];r[t]={...e,persona:e.persona?.speakAs?{speakAs:e.persona.speakAs,voiceConstraints:n.target.value||void 0}:void 0},Q(r)}})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Contract:`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`min`,className:`w-16 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.outputContract?.lengthTarget?.min??``,onChange:n=>{let r=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:i??0,max:e.outputContract?.lengthTarget?.max??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},Q(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`—`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`max`,className:`w-16 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.outputContract?.lengthTarget?.max??``,onChange:n=>{let r=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:i??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},Q(r)}}),(0,I.jsxs)(`select`,{className:`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.outputContract?.lengthTarget?.unit??`characters`,onChange:n=>{let r=[...Z];r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:e.outputContract?.lengthTarget?.max??0,unit:n.target.value}}},Q(r)},children:[(0,I.jsx)(`option`,{value:`characters`,children:`chars`}),(0,I.jsx)(`option`,{value:`words`,children:`words`}),(0,I.jsx)(`option`,{value:`bytes`,children:`bytes`})]}),(0,I.jsxs)(`select`,{className:`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.outputContract?.format??``,onChange:n=>{let r=[...Z],i=n.target.value;r[t]={...e,outputContract:{...e.outputContract,format:i||void 0}},Q(r)},children:[(0,I.jsx)(`option`,{value:``,children:`fmt?`}),(0,I.jsx)(`option`,{value:`markdown`,children:`md`}),(0,I.jsx)(`option`,{value:`text`,children:`txt`}),(0,I.jsx)(`option`,{value:`json`,children:`json`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-0.5 text-[10px] text-[var(--app-text-subtle)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--app-accent)]`,checked:e.outputContract?.mustReferenceArtifacts??!1,onChange:n=>{let r=[...Z];r[t]={...e,outputContract:{...e.outputContract,mustReferenceArtifacts:n.target.checked}},Q(r)}}),`ref artifacts`]})]})]},e.id))]}),Z.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,"aria-label":`continue on error`,checked:Ge,onChange:e=>Ke(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error`]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`text-xs font-medium text-[var(--app-text)]`,children:`投递格式`}),(0,I.jsxs)(`select`,{value:ct,onChange:e=>lt(e.target.value),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)] focus:border-[var(--app-accent)] focus:outline-none`,children:[(0,I.jsx)(`option`,{value:`concat-step-results`,children:`拼接每步结果(默认)`}),(0,I.jsx)(`option`,{value:`primary-artifact`,children:`指定主产物`}),(0,I.jsx)(`option`,{value:`custom`,disabled:!0,children:`自定义(即将推出)`})]}),ct===`primary-artifact`&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded border border-[var(--app-border)] p-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:`来源 step`}),(0,I.jsxs)(`select`,{value:ut,onChange:e=>{let t=Z.find(t=>t.id===e.target.value);dt(e.target.value),ht(t?.outputAs??``)},className:`w-full 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`,children:[(0,I.jsx)(`option`,{value:``,children:`选择 step...`}),Z.filter(e=>e.prompt.trim()).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),mt&&(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-accent)]`,children:[`Will use step's output: `,(0,I.jsx)(`span`,{className:`font-mono`,children:mt})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:mt?`Or specify custom key:`:`artifact key`}),(0,I.jsx)(`input`,{type:`text`,value:ft,onChange:e=>pt(e.target.value),placeholder:mt?`留空使用上面的自动解析值`:`手动输入 key`,className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-muted)] focus:border-[var(--app-accent)] focus:outline-none`})]})]})]}),(0,I.jsx)(ve,{value:Qe,onChange:$e}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{onClick:()=>void Ft(),disabled:qe||!Y.trim()||Z.every(e=>!e.prompt.trim()),children:qe?`Saving...`:`Save`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>Ae(null),children:`Cancel`})]})]}),(0,I.jsx)(w,{padding:!1,children:e.length===0?(0,I.jsx)(fe,{icon:(0,I.jsx)(i,{size:32}),title:`No automations`,description:`Create an automation to run recurring tasks`}):(0,I.jsxs)(ge,{children:[(0,I.jsx)(me,{children:(0,I.jsxs)(k,{children:[(0,I.jsx)(O,{children:`Name`}),(0,I.jsx)(O,{children:`Trigger`}),(0,I.jsx)(O,{children:`Schedule`}),(0,I.jsx)(O,{children:`Steps`}),(0,I.jsx)(O,{children:`Enabled`}),(0,I.jsx)(O,{children:`Created`}),(0,I.jsx)(O,{children:`Webhook URL`}),(0,I.jsx)(O,{children:`Actions`})]})}),(0,I.jsx)(he,{children:e.map(e=>(0,I.jsxs)(F.Fragment,{children:[(0,I.jsxs)(k,{children:[(0,I.jsxs)(A,{className:`font-medium text-[var(--app-text)]`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>Et(e.id),className:`flex items-center gap-1 hover:text-[var(--app-accent)] transition-colors`,children:[gt===e.id?(0,I.jsx)(ee,{size:12}):(0,I.jsx)(s,{size:12}),e.name]}),(e.isPreset||e.presetId)&&(0,I.jsx)(C,{variant:`info`,className:`ml-2`,children:`Preset`})]}),(0,I.jsx)(A,{children:(0,I.jsx)(C,{variant:e.trigger.type===`cron`?`info`:(e.trigger.type,`muted`),children:Ot(e.trigger)})}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:e.trigger.type===`once`&&e.trigger.runAt?new Date(e.trigger.runAt).toLocaleString():e.trigger.cron??`—`}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:(()=>{let t=new Set(e.steps.filter(e=>e.roleId).map(e=>e.roleId)),n=t.size>0?`${e.steps.length} steps / ${t.size} roles`:`${e.steps.length} steps`;return e.goalIds&&e.goalIds.length>0?`${n} / ${e.goalIds.length} goals`:n})()}),(0,I.jsx)(A,{children:[`cron`,`once`,`template_complete`].every(t=>e.trigger.type!==t)?(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`—`}):(0,I.jsx)(_e,{checked:e.enabled,onCheckedChange:()=>void Nt(e.id),"aria-label":`Toggle ${e.name}`})}),(0,I.jsx)(A,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.createdAt?T(e.createdAt):`—`}),(0,I.jsx)(A,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.enabled?`POST /webhooks/${e.id}`:`—`}),(0,I.jsx)(A,{children:(0,I.jsxs)(`div`,{className:`flex gap-1`,children:[(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>Pt(e),title:`Edit`,children:(0,I.jsx)(c,{size:12})}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>Te(e.id),disabled:Ce===e.id,title:`Run now`,children:(0,I.jsx)(t,{size:12})}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>{jt(e.id)},title:`Delete`,children:(0,I.jsx)(l,{size:12})})]})})]}),gt===e.id&&(0,I.jsx)(k,{children:(0,I.jsxs)(A,{colSpan:8,className:`bg-[var(--app-panel)]/50 p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2 font-medium`,children:`Recent Template Executions`}),bt?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading...`}):vt.length===0?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No template executions yet`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:vt.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,s=n.filter(([,e])=>e.status===`cancelled`).length,c=n.length,l=new Map(t.stepTasks.filter(e=>e.stepId).map(e=>[e.stepId,e])),u=[...e.steps.map(e=>e.id),...Object.keys(t.stepStatuses).filter(t=>!e.steps.some(e=>e.id===t))];return(0,I.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-canvas)]/50 p-2.5 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(C,{variant:t.status===`completed`?`success`:t.status===`failed`?`destructive`:t.status===`partial`?`warning`:t.status===`cancelled`?`secondary`:`muted`,children:t.status}),(0,I.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:new Date(t.startedAt).toLocaleString()}),c>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[r,`/`,c,` steps`,(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[i>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-danger)]`,children:[i,` failed`]}),a>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning)]`,children:[a,` skipped`]}),s>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text)]`,children:[s,` cancelled`]})]})]}),t.completedAt&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[Math.round((t.completedAt-t.startedAt)/1e3),`s`]}),(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text-subtle)] truncate max-w-[120px]`,children:t.id.slice(0,8)}),(0,I.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,"data-testid":`execution-feedback-buttons`,children:St[t.id]===`good`?(0,I.jsx)(te,{size:13,className:`text-[var(--app-success)]`,"aria-label":`Good — recorded`}):St[t.id]===`bad`?(0,I.jsx)(o,{size:13,className:`text-[var(--app-danger)]`,"aria-label":`Bad — recorded`}):St[t.id]===`pending`?(0,I.jsx)(`span`,{className:`text-[var(--app-text-subtle)] text-[10px]`,children:`...`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>void Tt(t.id,`good`),className:`rounded p-0.5 hover:bg-[var(--app-success-soft)] text-[var(--app-text-subtle)] hover:text-[var(--app-success)] transition-colors`,"aria-label":`Rate good`,title:`Good`,children:(0,I.jsx)(te,{size:13})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void Tt(t.id,`bad`),className:`rounded p-0.5 hover:bg-[var(--app-danger-soft)] text-[var(--app-text-subtle)] hover:text-[var(--app-danger)] transition-colors`,"aria-label":`Rate bad`,title:`Bad`,children:(0,I.jsx)(o,{size:13})})]})})]}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:u.map(n=>{let r=t.stepStatuses[n];if(!r)return null;let i=e.steps.find(e=>e.id===n),a=l.get(n),o=a?.roleId??r.roleId??i?.roleId,s=d.find(e=>e.id===o)?.name??o,c=a?.error??r.error??a?.result??r.result;return(0,I.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,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:n}),s&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning-soft-text)]`,children:[`@`,s]}),i?.dependsOn&&i.dependsOn.length>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`after `,i.dependsOn.join(`, `)]})]}),c&&(0,I.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:c})]}),(0,I.jsx)(C,{variant:r.status===`completed`?`success`:r.status===`failed`?`destructive`:r.status===`skipped`?`warning`:r.status===`cancelled`?`secondary`:`muted`,children:r.status}),r.contract&&(0,I.jsx)(xe,{contract:r.contract,retried:r.contractRetried}),(0,I.jsxs)(`div`,{className:`text-right text-[var(--app-text-subtle)]`,children:[a?.completedAt&&(0,I.jsxs)(`div`,{children:[Math.max(0,Math.round((a.completedAt-a.createdAt)/1e3)),`s`]}),a?.id&&(0,I.jsx)(`div`,{className:`font-mono`,children:a.id.slice(0,8)})]})]},`${t.id}-${n}`)})})]},t.id)})})]})})]},e.id))})]})}),(0,I.jsx)(x,{open:U!==null,onOpenChange:e=>{e||Te(null)},children:(0,I.jsxs)(se,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ce,{children:`Run Template`}),(0,I.jsxs)(S,{children:[`Run “`,It?.name,`” now? This will execute the template immediately.`]})]}),(0,I.jsxs)(ie,{children:[(0,I.jsx)(_,{children:`Cancel`}),(0,I.jsx)(ae,{onClick:()=>{U&&At(U),Te(null)},children:`Run Now`})]})]})}),(0,I.jsx)(x,{open:W!==null,onOpenChange:e=>{e||(Ee(null),K(null),q(`template_only`))},children:(0,I.jsxs)(se,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ce,{children:`Delete Template`}),(0,I.jsx)(S,{children:G===null?(0,I.jsx)(I.Fragment,{children:`Loading…`}):G.taskCount===0&&G.executionCount===0?(0,I.jsxs)(I.Fragment,{children:[`Delete “`,Lt?.name,`”? This action cannot be undone.`]}):G.taskCount===0?(0,I.jsxs)(I.Fragment,{children:[`“`,Lt?.name,`” has `,G.executionCount,` template execution`,G.executionCount===1?``:`s`,` which will be removed. Delete?`]}):(0,I.jsxs)(I.Fragment,{children:[`“`,Lt?.name,`” has`,` `,G.executionCount>0&&(0,I.jsxs)(I.Fragment,{children:[G.executionCount,` template execution`,G.executionCount===1?``:`s`]}),G.executionCount>0&&G.taskCount>0&&` and `,G.taskCount,` task`,G.taskCount===1?``:`s`,`. Choose what to delete:`]})})]}),G!==null&&G.taskCount>0&&(0,I.jsxs)(`div`,{className:`space-y-2 px-1`,children:[(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`template_only`,checked:De===`template_only`,onChange:()=>q(`template_only`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template only`}),(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Removes the automation. Tasks remain under the Tasks tab as history.`})]})]}),(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`with_tasks`,checked:De===`with_tasks`,onChange:()=>q(`with_tasks`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template and its tasks`}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Also deletes `,G.taskCount,` task`,G.taskCount===1?``:`s`,` and their score history. Cannot be undone.`]})]})]})]}),(0,I.jsxs)(ie,{children:[(0,I.jsx)(_,{disabled:Oe,children:`Cancel`}),(0,I.jsx)(ae,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger)]`,disabled:Oe||G===null,onClick:()=>{W&&Mt(W,G&&G.taskCount>0?De:`template_only`),Ee(null),K(null),q(`template_only`)},children:`Delete`})]})]})})]})}function we(){let{tasks:e,templates:t,goals:n}=v(h(e=>({tasks:e.tasks,templates:e.templates,goals:e.goals}))),r=v(e=>e.fetchTasks),i=v(e=>e.fetchTemplates),a=v(e=>e.fetchGoals);return(0,F.useEffect)(()=>{r(),i(),a()},[r,i,a]),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(le,{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,I.jsxs)(P,{defaultValue:`tasks`,children:[(0,I.jsxs)(ye,{children:[(0,I.jsx)(M,{value:`tasks`,children:`Tasks`}),(0,I.jsx)(M,{value:`automations`,children:`Automations`}),(0,I.jsx)(M,{value:`goals`,children:`Goals`})]}),(0,I.jsx)(N,{value:`tasks`,children:(0,I.jsx)(be,{})}),(0,I.jsx)(N,{value:`automations`,children:(0,I.jsx)(Ce,{})}),(0,I.jsx)(N,{value:`goals`,children:(0,I.jsx)(j,{})})]})]})}export{we as Work};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,B as n,D as r,X as i,_t as a,d as o,ft as s,j as c,l,mt as u,pt as ee,u as te,w as ne,xt as d}from"./vendor-icons-Bc_e_XXa.js";import{r as f,t as p}from"./vendor-react-bQ_cvNuA.js";import"./es2015-BkFSNOYE.js";import{t as m}from"./Button-CRNb8sD3.js";import{t as h}from"./vendor-state-BMVR_B0I.js";import{_ as re,t as g}from"./api-BP4ZP9kk.js";import{a as _,c as ie,f as v,i as ae,l as oe,n as y,o as se,p as b,r as x,s as S,t as C,u as ce}from"./index-Dd3NDYZR.js";import{t as w}from"./Card-Cwvv0An8.js";import{t as le}from"./PageHeader-acLQTYct.js";import{t as ue}from"./SectionHeader-NZWZgoOs.js";import{a as T,o as E,t as de}from"./format-ZWN4JNj-.js";import{t as fe}from"./EmptyState-BvQA1o5K.js";import{t as D}from"./ui-D1crlGpt.js";import{t as pe}from"./useIsMobileLayout-BogOiFTv.js";import{a as me,i as O,n as he,o as k,r as A,t as ge}from"./Table-CvSmzzkm.js";import{t as _e}from"./Switch--h1rqagh.js";import{Goals as j,t as ve}from"./Goals-B-__r-Yq.js";import{i as M,n as N,r as ye,t as P}from"./Tabs-DWk9HyNd.js";var F=e(d(),1),I=p(),L=[{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`}],R=new Set([`pending`,`queued`,`running`,`paused`]);function be(){let e=v(e=>e.tasks),t=v(e=>e.fetchTasks),[i,o]=(0,F.useState)(`all`),[s,c]=(0,F.useState)(!1),[l,ee]=(0,F.useState)(``),[te,d]=(0,F.useState)(!1),[p,h]=(0,F.useState)(new Set),[re,_]=(0,F.useState)(!1),ie=pe();(0,F.useEffect)(()=>{let e=i===`all`?void 0:i;t(e);let n=setInterval(()=>void t(e),5e3);return()=>clearInterval(n)},[t,i]),(0,F.useEffect)(()=>{h(new Set)},[i]);let ae=async()=>{if(l.trim()){d(!0);try{await g(`/tasks`,{method:`POST`,body:JSON.stringify({prompt:l.trim()})}),ee(``),c(!1),t(i===`all`?void 0:i)}finally{d(!1)}}},oe=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},se=()=>{let e=x.filter(e=>R.has(e.status)).map(e=>e.id);h(new Set(e))},b=async()=>{if(p.size!==0){_(!0);try{await g(`/tasks/batch-cancel`,{method:`POST`,body:JSON.stringify({taskIds:Array.from(p)})}),h(new Set),t(i===`all`?void 0:i)}finally{_(!1)}}},x=[...e].sort((e,t)=>t.createdAt-e.createdAt),S=Array.from(p).filter(t=>{let n=e.find(e=>e.id===t);return n&&R.has(n.status)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(ue,{title:`Tasks`,description:`Review active execution, cancel work, or create the next task.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[p.size>0&&(0,I.jsxs)(m,{variant:`destructive`,size:`sm`,onClick:()=>void b(),disabled:re||S.length===0,children:[(0,I.jsx)(a,{size:D.sm}),re?`Cancelling...`:`Cancel ${S.length} task${S.length===1?``:`s`}`]}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>void t(i===`all`?void 0:i),children:(0,I.jsx)(ne,{size:D.sm})}),(0,I.jsxs)(m,{size:`sm`,onClick:()=>c(!s),children:[(0,I.jsx)(r,{size:D.sm}),`New Task`]})]})}),s&&(0,I.jsxs)(w,{className:`flex gap-2`,children:[(0,I.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:l,onChange:e=>ee(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ae()}}),(0,I.jsx)(m,{onClick:()=>void ae(),disabled:te||!l.trim(),children:te?`Creating...`:`Create`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>c(!1),children:`Cancel`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 md:flex-row md:items-center md:justify-between`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:L.map(e=>(0,I.jsx)(`button`,{onClick:()=>o(e.value),className:`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${i===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,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[x.some(e=>R.has(e.status))&&(0,I.jsx)(`button`,{onClick:se,className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:`Select all cancellable`}),p.size>0&&(0,I.jsxs)(`button`,{onClick:()=>h(new Set),className:`text-xs text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`,children:[`Clear selection (`,p.size,`)`]})]})]}),x.length===0?(0,I.jsx)(w,{padding:!1,children:(0,I.jsx)(fe,{icon:(0,I.jsx)(n,{size:32}),title:`No tasks found`,description:i===`all`?`Create a task to get started`:`No tasks with status "${i}"`})}):ie?(0,I.jsx)(`div`,{className:`space-y-3`,children:x.map(e=>(0,I.jsx)(w,{className:p.has(e.id)?`border-[var(--app-accent)]/40 bg-[var(--app-accent)]/8`:``,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`pt-1`,children:R.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>oe(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.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:p.has(e.id)&&(0,I.jsx)(u,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block h-4 w-4`})}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,I.jsx)(f,{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,I.jsx)(`p`,{className:`break-words text-sm font-medium leading-6 text-[var(--app-text)]`,children:E(e.prompt,140)})]}),(0,I.jsx)(C,{variant:y(e.status),children:e.status})]}),(0,I.jsxs)(`div`,{className:`grid gap-2 text-xs text-[var(--app-text-subtle)] sm:grid-cols-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Role`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.roleId?e.roleId.slice(0,12):`—`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Cost`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[var(--app-text)]`,children:e.costUsd==null?`—`:de(e.costUsd)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.14em] text-[var(--app-text-subtle)]`,children:`Created`}),(0,I.jsx)(`div`,{className:`mt-1 text-[var(--app-text)]`,children:T(e.createdAt)})]})]})]})]})},e.id))}):(0,I.jsx)(w,{padding:!1,children:(0,I.jsxs)(ge,{children:[(0,I.jsx)(me,{children:(0,I.jsxs)(k,{children:[(0,I.jsx)(O,{className:`w-8`,children:(0,I.jsx)(`button`,{onClick:()=>{p.size>0&&p.size===x.filter(e=>R.has(e.status)).length?h(new Set):se()},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.size>0&&p.size===x.filter(e=>R.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:p.size>0&&p.size===x.filter(e=>R.has(e.status)).length&&(0,I.jsx)(u,{size:12})})}),(0,I.jsx)(O,{children:`ID`}),(0,I.jsx)(O,{children:`Prompt`}),(0,I.jsx)(O,{children:`Status`}),(0,I.jsx)(O,{children:`Role`}),(0,I.jsx)(O,{children:`Cost`}),(0,I.jsx)(O,{children:`Created`})]})}),(0,I.jsx)(he,{children:x.map(e=>(0,I.jsxs)(k,{className:p.has(e.id)?`bg-[var(--app-panel-elevated)]/50`:``,children:[(0,I.jsx)(A,{children:R.has(e.status)?(0,I.jsx)(`button`,{onClick:()=>oe(e.id),className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${p.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:p.has(e.id)&&(0,I.jsx)(u,{size:12})}):(0,I.jsx)(`span`,{className:`inline-block w-4`})}),(0,I.jsx)(A,{children:(0,I.jsx)(f,{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,I.jsx)(A,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`break-words font-medium text-[var(--app-text)]`,children:E(e.prompt,120)}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[e.totalDurationMs?de(e.costUsd??0):`Awaiting completion`,` · `,T(e.createdAt)]})]})}),(0,I.jsx)(A,{children:(0,I.jsx)(C,{variant:y(e.status),children:e.status})}),(0,I.jsx)(A,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-[var(--app-text-subtle)]`,children:e.roleId?e.roleId.slice(0,12):`—`})}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:e.costUsd==null?`—`:de(e.costUsd)}),(0,I.jsx)(A,{className:`text-xs text-[var(--app-text-subtle)]`,children:T(e.createdAt)})]},e.id))})]})})]})}function z(e,t){return e.find(e=>e.contractField===t)?.message??null}function B({label:e,status:t,tooltip:n}){let[r,i]=(0,F.useState)(!1),a=t===`pass`?`text-[var(--app-success-soft-text)]`:t===`fail`?`text-[var(--app-danger-soft-text)]`:`text-[var(--app-text-subtle)]`,o=t===`pass`?`✓`:t===`fail`?`✗`:`—`;return(0,I.jsxs)(`span`,{className:`relative inline-flex items-center gap-0.5`,children:[(0,I.jsxs)(`span`,{className:`cursor-default text-xs font-medium ${a}`,onClick:()=>i(e=>!e),title:n??void 0,children:[e,`:`,o]}),r&&n&&(0,I.jsx)(`span`,{className:`absolute bottom-full left-0 z-50 mb-1 w-48 rounded border border-[var(--app-border)] bg-[var(--app-panel)] px-2 py-1 text-xs text-[var(--app-text)] shadow-md`,children:n})]})}function xe({contract:e,retried:t}){let{violations:n,layerCPassed:r}=e,i=z(n,`lengthTarget`),a=z(n,`persona.speakAs`),o=z(n,`mustReferenceArtifacts`),s=z(n,`customAssertions`);return(0,I.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,I.jsx)(B,{label:`长度`,status:i?`fail`:`pass`,tooltip:i}),(0,I.jsx)(B,{label:`身份`,status:a?`fail`:`pass`,tooltip:a}),(0,I.jsx)(B,{label:`上游引用`,status:o?`fail`:`pass`,tooltip:o}),(0,I.jsx)(B,{label:`自定义`,status:r===null?`na`:r?`pass`:`fail`,tooltip:s}),t&&(0,I.jsx)(`span`,{className:`ml-1 rounded-full bg-[var(--app-warning-soft-bg)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--app-warning-soft-text)]`,children:`重试 #1`})]})}function V(e){return`step-${e+1}`}function H(e,t,n){if(!(e===`concat-step-results`||!e)&&e===`primary-artifact`)return t?{mode:`primary-artifact`,primaryArtifact:{stepId:t,...n?{key:n}:{}}}:void 0}function Se(e,t){return{...e??{},...t}}function Ce(){let e=v(e=>e.templates),n=v(e=>e.fetchTemplates),a=v(e=>e.goals),u=v(e=>e.fetchGoals),d=v(e=>e.roles),f=v(e=>e.fetchRoles),[p,h]=(0,F.useState)(!1),[y,le]=(0,F.useState)(``),[E,de]=(0,F.useState)(`manual`),[D,pe]=(0,F.useState)(``),[j,M]=(0,F.useState)(``),[N,ye]=(0,F.useState)(``),[P,L]=(0,F.useState)([{id:`step-1`,prompt:``}]),[R,be]=(0,F.useState)(!1),[z,B]=(0,F.useState)(!1),[Ce,we]=(0,F.useState)(null),[U,Te]=(0,F.useState)(null),[W,Ee]=(0,F.useState)(null),[G,K]=(0,F.useState)(null),[De,q]=(0,F.useState)(`template_only`),[Oe,ke]=(0,F.useState)(!1),[J,Ae]=(0,F.useState)(null),[Y,je]=(0,F.useState)(``),[X,Me]=(0,F.useState)(`manual`),[Ne,Pe]=(0,F.useState)(``),[Fe,Ie]=(0,F.useState)(``),[Le,Re]=(0,F.useState)(``),[ze,Be]=(0,F.useState)(``),[Ve,He]=(0,F.useState)(``),[Ue,We]=(0,F.useState)([]),[Z,Q]=(0,F.useState)([]),[Ge,Ke]=(0,F.useState)(!1),[qe,Je]=(0,F.useState)(!1),[$,Ye]=(0,F.useState)([]),[Xe,Ze]=(0,F.useState)([]),[Qe,$e]=(0,F.useState)([]),[et,tt]=(0,F.useState)(`concat-step-results`),[nt,rt]=(0,F.useState)(``),[it,at]=(0,F.useState)(``),[ot,st]=(0,F.useState)(``),[ct,lt]=(0,F.useState)(`concat-step-results`),[ut,dt]=(0,F.useState)(``),[ft,pt]=(0,F.useState)(``),[mt,ht]=(0,F.useState)(``),[gt,_t]=(0,F.useState)(null),[vt,yt]=(0,F.useState)([]),[bt,xt]=(0,F.useState)(!1),[St,Ct]=(0,F.useState)({}),wt=(0,F.useCallback)(async e=>{xt(!0);try{let t=await g(`/template-executions?templateId=${e}&limit=5`);yt(await Promise.all(t.executions.map(async e=>{try{let t=await g(`/template-executions/${e.id}`);return{...t.execution,stepTasks:t.stepTasks}}catch{return{...e,stepTasks:[]}}})))}catch{yt([])}finally{xt(!1)}},[]),Tt=(0,F.useCallback)(async(e,t)=>{Ct(t=>({...t,[e]:`pending`}));try{await re(e,t),Ct(n=>({...n,[e]:t}))}catch{Ct(t=>{let n={...t};return delete n[e],n}),b.error(`Failed to record feedback`)}},[]),Et=(0,F.useCallback)(e=>{gt===e?(_t(null),yt([])):(_t(e),wt(e))},[gt,wt]),Dt=(0,F.useMemo)(()=>Object.fromEntries(e.map(e=>[e.id,e.name])),[e]),Ot=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 '${Dt[e.event?.split(`:`)[1]??``]??`[deleted template]`}' completes`:e.type===`event`?`On event '${Ue.find(t=>t.id===e.eventDefId)?.name??`[deleted event]`}'`:e.type;(0,F.useEffect)(()=>{n(),u(),f(),(async()=>{try{We(await g(`/event-defs`))}catch{}})()},[n,u,f]);let kt=async()=>{if(y.trim()&&!P.every(e=>!e.prompt.trim())){B(!0);try{let e={name:y.trim(),trigger:{type:E,...E===`cron`&&j?{cron:j}:{},...E===`once`&&N?{runAt:new Date(N).toISOString()}:{},...E===`template_complete`&&D?{event:`template_complete:${D}`}:{},...E===`event`&&ze?{eventDefId:ze}:{}},enabled:!0,...Xe.length>0?{deliverTo:Xe}:{},...(()=>{let e=Se(void 0,{...R?{continueOnError:!0}:{},...H(et,nt,it)?{delivery:H(et,nt,it)}:{}});return Object.keys(e).length>0?{config:e}:{}})()};e.steps=P.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||V(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.consumesFrom?.length?{consumesFrom:e.consumesFrom}:{},...e.consumesFromOptional?.length?{consumesFromOptional:e.consumesFromOptional}:{},...e.persona?{persona:e.persona}:{},...e.outputContract?{outputContract:e.outputContract}:{}})),$.length>0&&(e.goalIds=$),await g(`/task-templates`,{method:`POST`,body:JSON.stringify(e)}),le(``),L([{id:`step-1`,prompt:``}]),M(``),ye(``),pe(``),Be(``),Ye([]),Ze([]),tt(`concat-step-results`),rt(``),at(``),st(``),h(!1),n()}finally{B(!1)}}},At=async t=>{let n=e.find(e=>e.id===t);we(t);try{await g(`/task-templates/${t}/run`,{method:`POST`}),b.success(`Triggered: ${n?.name??t}`)}catch(e){let t=e instanceof Error?e.message:`Failed to trigger template`;b.error(`Trigger failed: ${t}`)}finally{we(null)}},jt=async e=>{Ee(e),q(`template_only`),K(null);try{K((await g(`/task-templates/${e}/dependents`)).dependents)}catch{K({executionCount:0,taskCount:0})}},Mt=async(t,r)=>{let i=e.find(e=>e.id===t);ke(!0);try{let e=await g(`/task-templates/${t}?mode=${r}`,{method:`DELETE`}),a=[];e.deletedCounts.templateExecutions>0&&a.push(`${e.deletedCounts.templateExecutions} template execution${e.deletedCounts.templateExecutions===1?``:`s`}`),e.deletedCounts.tasks>0&&a.push(`${e.deletedCounts.tasks} task${e.deletedCounts.tasks===1?``:`s`}`);let o=a.length?` (+ ${a.join(`, `)})`:``;b.success(`Deleted: ${i?.name??t}${o}`),n()}catch(e){let t=e instanceof Error?e.message:`Failed to delete template`;b.error(`Delete failed: ${t}`)}finally{ke(!1)}},Nt=async t=>{let r=e.find(e=>e.id===t);if(!r)return;if(![`cron`,`once`,`template_complete`].includes(r.trigger.type)){b.error(`Toggle not applicable for manual triggers`);return}let i=!r.enabled;try{await g(`/task-templates/${t}`,{method:`PATCH`,body:JSON.stringify({enabled:i})}),b.success(`${r.name} ${i?`enabled`:`disabled`}`),n()}catch(e){let t=e instanceof Error?e.message:`Failed to toggle template`;b.error(`Toggle failed: ${t}`)}},Pt=e=>{Ae(e.id),je(e.name),Me(e.trigger.type),Pe(e.trigger.cron??``),Ie(e.trigger.runAt?new Date(e.trigger.runAt).toISOString().slice(0,16):``),Q(e.steps.map(e=>({id:e.id,prompt:e.prompt,roleId:e.roleId,dependsOn:e.dependsOn,config:e.config,consumesFrom:e.consumesFrom,consumesFromOptional:e.consumesFromOptional,persona:e.persona,outputContract:e.outputContract,outputAs:e.outputAs}))),Ke(e.config?.continueOnError??!1),lt(e.config?.delivery?.mode??`concat-step-results`),dt(e.config?.delivery?.primaryArtifact?.stepId??``),pt(e.config?.delivery?.primaryArtifact?.key??``),ht(e.config?.delivery?.primaryArtifact?.stepId?e.steps.find(t=>t.id===e.config?.delivery?.primaryArtifact?.stepId)?.outputAs??``:``),$e(e.deliverTo??[]),Re(e.trigger.type===`template_complete`?e.trigger.event?.split(`:`)[1]??``:``),He(e.trigger.eventDefId??``)},Ft=async()=>{if(!(!J||!Y.trim()||Z.every(e=>!e.prompt.trim()))){Je(!0);try{await g(`/task-templates/${J}`,{method:`PATCH`,body:JSON.stringify({name:Y.trim(),trigger:{type:X,...X===`cron`&&Ne?{cron:Ne}:{},...X===`once`&&Fe?{runAt:new Date(Fe).toISOString()}:{},...X===`template_complete`&&Le?{event:`template_complete:${Le}`}:{},...X===`event`&&Ve?{eventDefId:Ve}:{}},steps:Z.filter(e=>e.prompt.trim()).map((e,t)=>({id:e.id||V(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.consumesFrom?.length?{consumesFrom:e.consumesFrom}:{},...e.consumesFromOptional?.length?{consumesFromOptional:e.consumesFromOptional}:{},...e.persona?{persona:e.persona}:{},...e.outputContract?{outputContract:e.outputContract}:{}})),enabled:e.find(e=>e.id===J)?.enabled??!0,...(()=>{let t=e.find(e=>e.id===J)?.config;return{config:Se(t,{...Ge?{continueOnError:!0}:{continueOnError:!1},...H(ct,ut,ft)?{delivery:H(ct,ut,ft)}:{delivery:void 0}})}})(),deliverTo:Qe.length>0?Qe:void 0})}),Ae(null),n(),b.success(`Template updated`)}catch(e){let t=e instanceof Error?e.message:`Failed to update template`;b.error(t)}finally{Je(!1)}}},It=e.find(e=>e.id===U),Lt=e.find(e=>e.id===W);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(ue,{title:`Automations`,description:`Reusable templates, manual triggers, and recent template executions.`,compact:!0,action:(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>void n(),children:(0,I.jsx)(ne,{size:14})}),(0,I.jsxs)(m,{size:`sm`,onClick:()=>h(!p),children:[(0,I.jsx)(r,{size:14}),`New Automation`]})]})}),p&&(0,I.jsxs)(w,{className:`space-y-3`,children:[(0,I.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:y,onChange:e=>le(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.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:E,onChange:e=>de(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),E===`template_complete`&&(0,I.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:D,onChange:e=>pe(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==J).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),E===`event`&&(0,I.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:ze,onChange:e=>Be(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Ue.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),E===`cron`&&(0,I.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:j,onChange:e=>M(e.target.value)}),E===`once`&&(0,I.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:N,onChange:e=>ye(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:()=>L([...P,{id:V(P.length),prompt:``}]),children:[(0,I.jsx)(r,{size:12}),` Add Step`]})]}),P.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.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=[...P];r[t]={...e,roleId:n.target.value||void 0},L(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),P.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>L(P.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(l,{size:12})})]}),(0,I.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 {{`+P[t-1].id+`.result}} for prev output)`:``}`,rows:2,value:e.prompt,onChange:n=>{let r=[...P];r[t]={...e,prompt:n.target.value},L(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),P.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...P];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.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=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},L(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.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=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},L(r)}})]})]}),t>0&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Consumes:`}),P.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,"aria-label":`consumes ${n.id}`,onClick:()=>{let r=e.consumesFrom??[],i=[...P];i[t]={...e,consumesFrom:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFrom??[]).includes(n.id)?`bg-[var(--app-danger)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id)),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0 ml-1`,children:`(opt)`}),P.slice(0,t).map(n=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`optional-consumes ${n.id}`,onClick:()=>{let r=e.consumesFromOptional??[],i=[...P];i[t]={...e,consumesFromOptional:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},L(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFromOptional??[]).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}-opt`))]}),(0,I.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Speak as:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`e.g. 卞旸`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.speakAs??``,onChange:n=>{let r=[...P];r[t]={...e,persona:n.target.value?{speakAs:n.target.value,voiceConstraints:e.persona?.voiceConstraints}:void 0},L(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Voice:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`optional`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.voiceConstraints??``,onChange:n=>{let r=[...P];r[t]={...e,persona:e.persona?.speakAs?{speakAs:e.persona.speakAs,voiceConstraints:n.target.value||void 0}:void 0},L(r)}})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Contract:`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`min`,className:`w-16 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.outputContract?.lengthTarget?.min??``,onChange:n=>{let r=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:i??0,max:e.outputContract?.lengthTarget?.max??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},L(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`—`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`max`,className:`w-16 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.outputContract?.lengthTarget?.max??``,onChange:n=>{let r=[...P],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:i??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},L(r)}}),(0,I.jsxs)(`select`,{className:`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.outputContract?.lengthTarget?.unit??`characters`,onChange:n=>{let r=[...P];r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:e.outputContract?.lengthTarget?.max??0,unit:n.target.value}}},L(r)},children:[(0,I.jsx)(`option`,{value:`characters`,children:`chars`}),(0,I.jsx)(`option`,{value:`words`,children:`words`}),(0,I.jsx)(`option`,{value:`bytes`,children:`bytes`})]}),(0,I.jsxs)(`select`,{className:`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.outputContract?.format??``,onChange:n=>{let r=[...P],i=n.target.value;r[t]={...e,outputContract:{...e.outputContract,format:i||void 0}},L(r)},children:[(0,I.jsx)(`option`,{value:``,children:`fmt?`}),(0,I.jsx)(`option`,{value:`markdown`,children:`md`}),(0,I.jsx)(`option`,{value:`text`,children:`txt`}),(0,I.jsx)(`option`,{value:`json`,children:`json`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-0.5 text-[10px] text-[var(--app-text-subtle)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--app-accent)]`,checked:e.outputContract?.mustReferenceArtifacts??!1,onChange:n=>{let r=[...P];r[t]={...e,outputContract:{...e.outputContract,mustReferenceArtifacts:n.target.checked}},L(r)}}),`ref artifacts`]})]})]},e.id))]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Goals`}),a.length===0?(0,I.jsx)(`p`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No goals available`}):a.map(e=>(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] hover:text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:$.includes(e.id),onChange:t=>{t.target.checked?Ye([...$,e.id]):Ye($.filter(t=>t!==e.id))},className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.name}),(0,I.jsx)(C,{variant:`muted`,className:`text-[10px]`,children:e.status})]},e.id))]}),P.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:R,onChange:e=>be(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,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`text-xs font-medium text-[var(--app-text)]`,children:`投递格式`}),(0,I.jsxs)(`select`,{value:et,onChange:e=>tt(e.target.value),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)] focus:border-[var(--app-accent)] focus:outline-none`,children:[(0,I.jsx)(`option`,{value:`concat-step-results`,children:`拼接每步结果(默认)`}),(0,I.jsx)(`option`,{value:`primary-artifact`,children:`指定主产物`}),(0,I.jsx)(`option`,{value:`custom`,disabled:!0,children:`自定义(即将推出)`})]}),et===`primary-artifact`&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded border border-[var(--app-border)] p-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:`来源 step`}),(0,I.jsxs)(`select`,{value:nt,onChange:e=>{let t=P.find(t=>t.id===e.target.value);rt(e.target.value),st(t?.outputAs??``)},className:`w-full 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`,children:[(0,I.jsx)(`option`,{value:``,children:`选择 step...`}),P.filter(e=>e.prompt.trim()).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),ot&&(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-accent)]`,children:[`Will use step's output: `,(0,I.jsx)(`span`,{className:`font-mono`,children:ot})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:ot?`Or specify custom key:`:`artifact key`}),(0,I.jsx)(`input`,{type:`text`,value:it,onChange:e=>at(e.target.value),placeholder:ot?`留空使用上面的自动解析值`:`手动输入 key`,className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-muted)] focus:border-[var(--app-accent)] focus:outline-none`})]})]})]}),(0,I.jsx)(ve,{value:Xe,onChange:Ze}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{onClick:()=>void kt(),disabled:z||!y.trim()||P.every(e=>!e.prompt.trim())||E===`template_complete`&&!D,children:z?`Creating...`:`Create`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>h(!1),children:`Cancel`})]})]}),J!==null&&(0,I.jsxs)(w,{className:`space-y-3`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-[var(--app-text)]`,children:`Edit Automation`}),(0,I.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:Y,onChange:e=>je(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Triggered by:`}),(0,I.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=>Me(e.target.value),children:[(0,I.jsx)(`option`,{value:`manual`,children:`Manual`}),(0,I.jsx)(`option`,{value:`cron`,children:`Schedule (Cron)`}),(0,I.jsx)(`option`,{value:`once`,children:`One-time`}),(0,I.jsx)(`option`,{value:`template_complete`,children:`Template completion`}),(0,I.jsx)(`option`,{value:`event`,children:`Event (definition)`})]}),X===`template_complete`&&(0,I.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=>Re(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select target template --`}),e.filter(e=>e.id!==J).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),X===`event`&&(0,I.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:Ve,onChange:e=>He(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`-- Select event --`}),Ue.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),X===`cron`&&(0,I.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:Ne,onChange:e=>Pe(e.target.value)}),X===`once`&&(0,I.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:Fe,onChange:e=>Ie(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-muted)]`,children:`Steps`}),(0,I.jsxs)(m,{variant:`ghost`,size:`sm`,onClick:()=>Q([...Z,{id:V(Z.length),prompt:``}]),children:[(0,I.jsx)(r,{size:12}),` Add Step`]})]}),Z.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border border-[var(--app-border)] p-2 space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-mono text-[var(--app-text-subtle)]`,children:e.id}),(0,I.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=[...Z];r[t]={...e,roleId:n.target.value||void 0},Q(r)},children:[(0,I.jsx)(`option`,{value:``,children:`Role (template default)`}),d.filter(e=>e.source!==`system`).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),Z.length>1&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Q(Z.filter((e,n)=>n!==t)),className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,children:(0,I.jsx)(l,{size:12})})]}),(0,I.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=[...Z];r[t]={...e,prompt:n.target.value},Q(r)}}),t>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`depends on:`}),Z.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let r=e.dependsOn??[],i=[...Z];i[t]={...e,dependsOn:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`timeout(s):`,(0,I.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=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,timeout:i}},Q(r)}})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-[var(--app-text-subtle)]`,children:[`max turns:`,(0,I.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=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,config:{...e.config,maxTurns:i}},Q(r)}})]})]}),t>0&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Consumes:`}),Z.slice(0,t).map(n=>(0,I.jsx)(`button`,{type:`button`,"aria-label":`consumes ${n.id}`,onClick:()=>{let r=e.consumesFrom??[],i=[...Z];i[t]={...e,consumesFrom:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFrom??[]).includes(n.id)?`bg-[var(--app-danger)] text-white`:`bg-[var(--app-panel-elevated)] text-[var(--app-text-subtle)] hover:text-[var(--app-text)]`}`,children:n.id},n.id)),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0 ml-1`,children:`(opt)`}),Z.slice(0,t).map(n=>(0,I.jsxs)(`button`,{type:`button`,"aria-label":`optional-consumes ${n.id}`,onClick:()=>{let r=e.consumesFromOptional??[],i=[...Z];i[t]={...e,consumesFromOptional:r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id]},Q(i)},className:`rounded px-1.5 py-0.5 text-[10px] ${(e.consumesFromOptional??[]).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}-opt`))]}),(0,I.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Speak as:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`e.g. 卞旸`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.speakAs??``,onChange:n=>{let r=[...Z];r[t]={...e,persona:n.target.value?{speakAs:n.target.value,voiceConstraints:e.persona?.voiceConstraints}:void 0},Q(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Voice:`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`optional`,className:`flex-1 min-w-0 rounded border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-1.5 py-0.5 text-xs text-[var(--app-text)] placeholder:text-[var(--app-text-subtle)]`,value:e.persona?.voiceConstraints??``,onChange:n=>{let r=[...Z];r[t]={...e,persona:e.persona?.speakAs?{speakAs:e.persona.speakAs,voiceConstraints:n.target.value||void 0}:void 0},Q(r)}})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)] shrink-0`,children:`Contract:`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`min`,className:`w-16 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.outputContract?.lengthTarget?.min??``,onChange:n=>{let r=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:i??0,max:e.outputContract?.lengthTarget?.max??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},Q(r)}}),(0,I.jsx)(`span`,{className:`text-[10px] text-[var(--app-text-subtle)]`,children:`—`}),(0,I.jsx)(`input`,{type:`number`,min:0,placeholder:`max`,className:`w-16 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.outputContract?.lengthTarget?.max??``,onChange:n=>{let r=[...Z],i=n.target.value===``?void 0:Number(n.target.value);r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:i??0,unit:e.outputContract?.lengthTarget?.unit??`characters`}}},Q(r)}}),(0,I.jsxs)(`select`,{className:`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.outputContract?.lengthTarget?.unit??`characters`,onChange:n=>{let r=[...Z];r[t]={...e,outputContract:{...e.outputContract,lengthTarget:{min:e.outputContract?.lengthTarget?.min??0,max:e.outputContract?.lengthTarget?.max??0,unit:n.target.value}}},Q(r)},children:[(0,I.jsx)(`option`,{value:`characters`,children:`chars`}),(0,I.jsx)(`option`,{value:`words`,children:`words`}),(0,I.jsx)(`option`,{value:`bytes`,children:`bytes`})]}),(0,I.jsxs)(`select`,{className:`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.outputContract?.format??``,onChange:n=>{let r=[...Z],i=n.target.value;r[t]={...e,outputContract:{...e.outputContract,format:i||void 0}},Q(r)},children:[(0,I.jsx)(`option`,{value:``,children:`fmt?`}),(0,I.jsx)(`option`,{value:`markdown`,children:`md`}),(0,I.jsx)(`option`,{value:`text`,children:`txt`}),(0,I.jsx)(`option`,{value:`json`,children:`json`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-0.5 text-[10px] text-[var(--app-text-subtle)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:`accent-[var(--app-accent)]`,checked:e.outputContract?.mustReferenceArtifacts??!1,onChange:n=>{let r=[...Z];r[t]={...e,outputContract:{...e.outputContract,mustReferenceArtifacts:n.target.checked}},Q(r)}}),`ref artifacts`]})]})]},e.id))]}),Z.length>1&&(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-[var(--app-text)] cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,"aria-label":`continue on error`,checked:Ge,onChange:e=>Ke(e.target.checked),className:`rounded border-[var(--app-border-strong)] bg-[var(--app-panel-elevated)]`}),`Continue on error`]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`text-xs font-medium text-[var(--app-text)]`,children:`投递格式`}),(0,I.jsxs)(`select`,{value:ct,onChange:e=>lt(e.target.value),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)] focus:border-[var(--app-accent)] focus:outline-none`,children:[(0,I.jsx)(`option`,{value:`concat-step-results`,children:`拼接每步结果(默认)`}),(0,I.jsx)(`option`,{value:`primary-artifact`,children:`指定主产物`}),(0,I.jsx)(`option`,{value:`custom`,disabled:!0,children:`自定义(即将推出)`})]}),ct===`primary-artifact`&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded border border-[var(--app-border)] p-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:`来源 step`}),(0,I.jsxs)(`select`,{value:ut,onChange:e=>{let t=Z.find(t=>t.id===e.target.value);dt(e.target.value),ht(t?.outputAs??``)},className:`w-full 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`,children:[(0,I.jsx)(`option`,{value:``,children:`选择 step...`}),Z.filter(e=>e.prompt.trim()).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),mt&&(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-accent)]`,children:[`Will use step's output: `,(0,I.jsx)(`span`,{className:`font-mono`,children:mt})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`label`,{className:`text-xs text-[var(--app-text-muted)]`,children:mt?`Or specify custom key:`:`artifact key`}),(0,I.jsx)(`input`,{type:`text`,value:ft,onChange:e=>pt(e.target.value),placeholder:mt?`留空使用上面的自动解析值`:`手动输入 key`,className:`w-full rounded-md border border-[var(--app-border)] bg-[var(--app-panel-elevated)] px-2 py-1 text-sm text-[var(--app-text)] placeholder:text-[var(--app-text-muted)] focus:border-[var(--app-accent)] focus:outline-none`})]})]})]}),(0,I.jsx)(ve,{value:Qe,onChange:$e}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(m,{onClick:()=>void Ft(),disabled:qe||!Y.trim()||Z.every(e=>!e.prompt.trim()),children:qe?`Saving...`:`Save`}),(0,I.jsx)(m,{variant:`ghost`,onClick:()=>Ae(null),children:`Cancel`})]})]}),(0,I.jsx)(w,{padding:!1,children:e.length===0?(0,I.jsx)(fe,{icon:(0,I.jsx)(i,{size:32}),title:`No automations`,description:`Create an automation to run recurring tasks`}):(0,I.jsxs)(ge,{children:[(0,I.jsx)(me,{children:(0,I.jsxs)(k,{children:[(0,I.jsx)(O,{children:`Name`}),(0,I.jsx)(O,{children:`Trigger`}),(0,I.jsx)(O,{children:`Schedule`}),(0,I.jsx)(O,{children:`Steps`}),(0,I.jsx)(O,{children:`Enabled`}),(0,I.jsx)(O,{children:`Created`}),(0,I.jsx)(O,{children:`Webhook URL`}),(0,I.jsx)(O,{children:`Actions`})]})}),(0,I.jsx)(he,{children:e.map(e=>(0,I.jsxs)(F.Fragment,{children:[(0,I.jsxs)(k,{children:[(0,I.jsxs)(A,{className:`font-medium text-[var(--app-text)]`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>Et(e.id),className:`flex items-center gap-1 hover:text-[var(--app-accent)] transition-colors`,children:[gt===e.id?(0,I.jsx)(ee,{size:12}):(0,I.jsx)(s,{size:12}),e.name]}),(e.isPreset||e.presetId)&&(0,I.jsx)(C,{variant:`info`,className:`ml-2`,children:`Preset`})]}),(0,I.jsx)(A,{children:(0,I.jsx)(C,{variant:e.trigger.type===`cron`?`info`:(e.trigger.type,`muted`),children:Ot(e.trigger)})}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:e.trigger.type===`once`&&e.trigger.runAt?new Date(e.trigger.runAt).toLocaleString():e.trigger.cron??`—`}),(0,I.jsx)(A,{className:`font-mono text-xs`,children:(()=>{let t=new Set(e.steps.filter(e=>e.roleId).map(e=>e.roleId)),n=t.size>0?`${e.steps.length} steps / ${t.size} roles`:`${e.steps.length} steps`;return e.goalIds&&e.goalIds.length>0?`${n} / ${e.goalIds.length} goals`:n})()}),(0,I.jsx)(A,{children:[`cron`,`once`,`template_complete`].every(t=>e.trigger.type!==t)?(0,I.jsx)(`span`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`—`}):(0,I.jsx)(_e,{checked:e.enabled,onCheckedChange:()=>void Nt(e.id),"aria-label":`Toggle ${e.name}`})}),(0,I.jsx)(A,{className:`text-xs text-[var(--app-text-subtle)]`,children:e.createdAt?T(e.createdAt):`—`}),(0,I.jsx)(A,{className:`font-mono text-xs text-[var(--app-text-muted)]`,children:e.enabled?`POST /webhooks/${e.id}`:`—`}),(0,I.jsx)(A,{children:(0,I.jsxs)(`div`,{className:`flex gap-1`,children:[(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>Pt(e),title:`Edit`,children:(0,I.jsx)(c,{size:12})}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,onClick:()=>Te(e.id),disabled:Ce===e.id,title:`Run now`,children:(0,I.jsx)(t,{size:12})}),(0,I.jsx)(m,{variant:`ghost`,size:`sm`,className:`text-[var(--app-danger)] hover:text-[var(--app-danger-soft-text)]`,onClick:()=>{jt(e.id)},title:`Delete`,children:(0,I.jsx)(l,{size:12})})]})})]}),gt===e.id&&(0,I.jsx)(k,{children:(0,I.jsxs)(A,{colSpan:8,className:`bg-[var(--app-panel)]/50 p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-muted)] mb-2 font-medium`,children:`Recent Template Executions`}),bt?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Loading...`}):vt.length===0?(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`No template executions yet`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:vt.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,s=n.filter(([,e])=>e.status===`cancelled`).length,c=n.length,l=new Map(t.stepTasks.filter(e=>e.stepId).map(e=>[e.stepId,e])),u=[...e.steps.map(e=>e.id),...Object.keys(t.stepStatuses).filter(t=>!e.steps.some(e=>e.id===t))];return(0,I.jsxs)(`div`,{className:`rounded border border-[var(--app-border)] bg-[var(--app-canvas)]/50 p-2.5 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(C,{variant:t.status===`completed`?`success`:t.status===`failed`?`destructive`:t.status===`partial`?`warning`:t.status===`cancelled`?`secondary`:`muted`,children:t.status}),(0,I.jsx)(`span`,{className:`text-[var(--app-text-subtle)]`,children:new Date(t.startedAt).toLocaleString()}),c>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-muted)]`,children:[r,`/`,c,` steps`,(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[i>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-danger)]`,children:[i,` failed`]}),a>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning)]`,children:[a,` skipped`]}),s>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text)]`,children:[s,` cancelled`]})]})]}),t.completedAt&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[Math.round((t.completedAt-t.startedAt)/1e3),`s`]}),(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text-subtle)] truncate max-w-[120px]`,children:t.id.slice(0,8)}),(0,I.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,"data-testid":`execution-feedback-buttons`,children:St[t.id]===`good`?(0,I.jsx)(te,{size:13,className:`text-[var(--app-success)]`,"aria-label":`Good — recorded`}):St[t.id]===`bad`?(0,I.jsx)(o,{size:13,className:`text-[var(--app-danger)]`,"aria-label":`Bad — recorded`}):St[t.id]===`pending`?(0,I.jsx)(`span`,{className:`text-[var(--app-text-subtle)] text-[10px]`,children:`...`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>void Tt(t.id,`good`),className:`rounded p-0.5 hover:bg-[var(--app-success-soft)] text-[var(--app-text-subtle)] hover:text-[var(--app-success)] transition-colors`,"aria-label":`Rate good`,title:`Good`,children:(0,I.jsx)(te,{size:13})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void Tt(t.id,`bad`),className:`rounded p-0.5 hover:bg-[var(--app-danger-soft)] text-[var(--app-text-subtle)] hover:text-[var(--app-danger)] transition-colors`,"aria-label":`Rate bad`,title:`Bad`,children:(0,I.jsx)(o,{size:13})})]})})]}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:u.map(n=>{let r=t.stepStatuses[n];if(!r)return null;let i=e.steps.find(e=>e.id===n),a=l.get(n),o=a?.roleId??r.roleId??i?.roleId,s=d.find(e=>e.id===o)?.name??o,c=a?.error??r.error??a?.result??r.result;return(0,I.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,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-mono text-[var(--app-text)]`,children:n}),s&&(0,I.jsxs)(`span`,{className:`text-[var(--app-warning-soft-text)]`,children:[`@`,s]}),i?.dependsOn&&i.dependsOn.length>0&&(0,I.jsxs)(`span`,{className:`text-[var(--app-text-subtle)]`,children:[`after `,i.dependsOn.join(`, `)]})]}),c&&(0,I.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:c})]}),(0,I.jsx)(C,{variant:r.status===`completed`?`success`:r.status===`failed`?`destructive`:r.status===`skipped`?`warning`:r.status===`cancelled`?`secondary`:`muted`,children:r.status}),r.contract&&(0,I.jsx)(xe,{contract:r.contract,retried:r.contractRetried}),(0,I.jsxs)(`div`,{className:`text-right text-[var(--app-text-subtle)]`,children:[a?.completedAt&&(0,I.jsxs)(`div`,{children:[Math.max(0,Math.round((a.completedAt-a.createdAt)/1e3)),`s`]}),a?.id&&(0,I.jsx)(`div`,{className:`font-mono`,children:a.id.slice(0,8)})]})]},`${t.id}-${n}`)})})]},t.id)})})]})})]},e.id))})]})}),(0,I.jsx)(x,{open:U!==null,onOpenChange:e=>{e||Te(null)},children:(0,I.jsxs)(se,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ce,{children:`Run Template`}),(0,I.jsxs)(S,{children:[`Run “`,It?.name,`” now? This will execute the template immediately.`]})]}),(0,I.jsxs)(ie,{children:[(0,I.jsx)(_,{children:`Cancel`}),(0,I.jsx)(ae,{onClick:()=>{U&&At(U),Te(null)},children:`Run Now`})]})]})}),(0,I.jsx)(x,{open:W!==null,onOpenChange:e=>{e||(Ee(null),K(null),q(`template_only`))},children:(0,I.jsxs)(se,{children:[(0,I.jsxs)(oe,{children:[(0,I.jsx)(ce,{children:`Delete Template`}),(0,I.jsx)(S,{children:G===null?(0,I.jsx)(I.Fragment,{children:`Loading…`}):G.taskCount===0&&G.executionCount===0?(0,I.jsxs)(I.Fragment,{children:[`Delete “`,Lt?.name,`”? This action cannot be undone.`]}):G.taskCount===0?(0,I.jsxs)(I.Fragment,{children:[`“`,Lt?.name,`” has `,G.executionCount,` template execution`,G.executionCount===1?``:`s`,` which will be removed. Delete?`]}):(0,I.jsxs)(I.Fragment,{children:[`“`,Lt?.name,`” has`,` `,G.executionCount>0&&(0,I.jsxs)(I.Fragment,{children:[G.executionCount,` template execution`,G.executionCount===1?``:`s`]}),G.executionCount>0&&G.taskCount>0&&` and `,G.taskCount,` task`,G.taskCount===1?``:`s`,`. Choose what to delete:`]})})]}),G!==null&&G.taskCount>0&&(0,I.jsxs)(`div`,{className:`space-y-2 px-1`,children:[(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`template_only`,checked:De===`template_only`,onChange:()=>q(`template_only`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template only`}),(0,I.jsx)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:`Removes the automation. Tasks remain under the Tasks tab as history.`})]})]}),(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`deleteMode`,value:`with_tasks`,checked:De===`with_tasks`,onChange:()=>q(`with_tasks`),className:`mt-1`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Template and its tasks`}),(0,I.jsxs)(`div`,{className:`text-xs text-[var(--app-text-subtle)]`,children:[`Also deletes `,G.taskCount,` task`,G.taskCount===1?``:`s`,` and their score history. Cannot be undone.`]})]})]})]}),(0,I.jsxs)(ie,{children:[(0,I.jsx)(_,{disabled:Oe,children:`Cancel`}),(0,I.jsx)(ae,{className:`bg-[var(--app-danger)] hover:bg-[var(--app-danger)]`,disabled:Oe||G===null,onClick:()=>{W&&Mt(W,G&&G.taskCount>0?De:`template_only`),Ee(null),K(null),q(`template_only`)},children:`Delete`})]})]})})]})}function we(){let{tasks:e,templates:t,goals:n}=v(h(e=>({tasks:e.tasks,templates:e.templates,goals:e.goals}))),r=v(e=>e.fetchTasks),i=v(e=>e.fetchTemplates),a=v(e=>e.fetchGoals);return(0,F.useEffect)(()=>{r(),i(),a()},[r,i,a]),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(le,{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,I.jsxs)(P,{defaultValue:`tasks`,children:[(0,I.jsxs)(ye,{children:[(0,I.jsx)(M,{value:`tasks`,children:`Tasks`}),(0,I.jsx)(M,{value:`automations`,children:`Automations`}),(0,I.jsx)(M,{value:`goals`,children:`Goals`})]}),(0,I.jsx)(N,{value:`tasks`,children:(0,I.jsx)(be,{})}),(0,I.jsx)(N,{value:`automations`,children:(0,I.jsx)(Ce,{})}),(0,I.jsx)(N,{value:`goals`,children:(0,I.jsx)(j,{})})]})]})}export{we as Work};
@@ -0,0 +1,2 @@
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-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--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-500:oklch(55.1% .027 264.364);--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-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) 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}.collapse{visibility:collapse}.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-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.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\.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)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.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-1{margin-left:calc(var(--spacing) * 1)}.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-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.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}.min-h-\[140px\]{min-height:140px}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.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-7{width:calc(var(--spacing) * 7)}.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-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-48{width:calc(var(--spacing) * 48)}.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%}.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-none{max-width:none}.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-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.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)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.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-2xl{border-radius:var(--radius-2xl)}.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}.rounded-l-xl{border-top-left-radius:1.4rem;border-bottom-left-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{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.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-text-subtle\)\]{border-color:var(--app-text-subtle)}.border-\[var\(--app-warning-soft-border\)\]{border-color:var(--app-warning-soft-border)}.border-amber-500\/70{border-color:#f99c00b3}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/70{border-color:color-mix(in oklab, var(--color-amber-500) 70%, transparent)}}.border-red-300{border-color:var(--color-red-300)}.border-red-500{border-color:var(--color-red-500)}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.border-red-500\/30{border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.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-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/30{border-color:color-mix(in oklab, var(--color-yellow-500) 30%, 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\)\]\/10{background-color:var(--app-accent)}@supports (color:color-mix(in lab, red, red)){.bg-\[var\(--app-accent\)\]\/10{background-color:color-mix(in oklab, var(--app-accent) 10%, transparent)}}.bg-\[var\(--app-accent-soft-bg\)\]{background-color:var(--app-accent-soft-bg)}.bg-\[var\(--app-bg\)\]{background-color:var(--app-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-selected\)\]{background-color:var(--app-selected)}.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-surface\)\]{background-color:var(--app-surface)}.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-amber-500\/\[0\.06\]{background-color:#f99c000f}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/\[0\.06\]{background-color:color-mix(in oklab, var(--color-amber-500) 6%, transparent)}}.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\/20{background-color:#0003}@supports (color:color-mix(in lab, red, red)){.bg-black\/20{background-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, 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-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.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\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab, var(--color-white) 2%, 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)}}.bg-white\/\[0\.015\]{background-color:#ffffff04}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.015\]{background-color:color-mix(in oklab, var(--color-white) 1.5%, transparent)}}.bg-yellow-500\/5{background-color:#edb2000d}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/5{background-color:color-mix(in oklab, var(--color-yellow-500) 5%, transparent)}}.fill-\[var\(--app-danger\)\]{fill:var(--app-danger)}.fill-\[var\(--app-success\)\]{fill:var(--app-success)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.p-0\.5{padding:calc(var(--spacing) * .5)}.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-0{padding-inline:calc(var(--spacing) * 0)}.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{padding-block:calc(var(--spacing) * 0)}.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)}.py-12{padding-block:calc(var(--spacing) * 12)}.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-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.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)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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\.12em\]{--tw-tracking:.12em;letter-spacing:.12em}.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-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.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-fg\)\]{color:var(--app-accent-fg)}.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-fg\)\]{color:var(--app-fg)}.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-muted\)\]{color:var(--app-muted)}.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-amber-500{color:var(--color-amber-500)}.text-amber-500\/90{color:#f99c00e6}@supports (color:color-mix(in lab, red, red)){.text-amber-500\/90{color:color-mix(in oklab, var(--color-amber-500) 90%, transparent)}}.text-blue-500{color:var(--color-blue-500)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.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-300{color:var(--color-yellow-300)}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.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)}.accent-\[var\(--app-accent\)\]{accent-color:var(--app-accent)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow{--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)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);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-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)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.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\:opacity-100:is(:where(.group):hover *){opacity:1}}.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-muted\)\]::placeholder{color:var(--app-text-muted)}.placeholder\:text-\[var\(--app-text-subtle\)\]::placeholder{color:var(--app-text-subtle)}@media (hover:hover){.hover\:border-\[var\(--app-accent\)\]:hover,.hover\:border-\[var\(--app-accent\)\]\/50:hover{border-color:var(--app-accent)}@supports (color:color-mix(in lab, red, red)){.hover\:border-\[var\(--app-accent\)\]\/50:hover{border-color:color-mix(in oklab, var(--app-accent) 50%, transparent)}}.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\:border-\[var\(--app-text-subtle\)\]:hover{border-color:var(--app-text-subtle)}.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-canvas\)\]:hover{background-color:var(--app-canvas)}.hover\:bg-\[var\(--app-danger\)\]:hover{background-color:var(--app-danger)}.hover\:bg-\[var\(--app-danger-soft\)\]:hover{background-color:var(--app-danger-soft)}.hover\:bg-\[var\(--app-danger-strong\)\]:hover{background-color:var(--app-danger-strong)}.hover\:bg-\[var\(--app-hover\)\]:hover{background-color:var(--app-hover)}.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\)\]:hover{background-color:var(--app-success-soft)}.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-black\/\[0\.02\]:hover{background-color:#00000005}@supports (color:color-mix(in lab, red, red)){.hover\:bg-black\/\[0\.02\]:hover{background-color:color-mix(in oklab, var(--color-black) 2%, transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.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-fg\)\]:hover{color:var(--app-fg)}.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\:text-red-600:hover{color:var(--color-red-600)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}.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-danger\)\]:focus{color:var(--app-danger)}.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\:flex{display:flex}.md\:inline{display:inline}.md\:w-1\/2{width:50%}.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-2\/5{width:40%}.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\:grid-cols-6{grid-template-columns:repeat(6,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)}}@keyframes pulse{50%{opacity:.5}}