@hearsay-tools/squawk 0.18.0-pr4407.8607 → 0.18.0-pr4411.8615

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 (156) hide show
  1. package/dist/automations/tools.d.ts +8 -8
  2. package/dist/delegation/routes.d.ts +65 -65
  3. package/dist/delegation/transport.d.ts +65 -65
  4. package/dist/features/mcp/cli.d.ts +14 -0
  5. package/dist/features/mcp/cli.js +87 -0
  6. package/dist/features/mcp/cli.js.map +1 -0
  7. package/dist/features/mcp/index.d.ts +9 -0
  8. package/dist/features/mcp/index.js +13 -0
  9. package/dist/features/mcp/index.js.map +1 -0
  10. package/dist/features/mcp/stdio.d.ts +10 -0
  11. package/dist/features/mcp/stdio.js +41 -0
  12. package/dist/features/mcp/stdio.js.map +1 -0
  13. package/dist/features/mcp/tools.d.ts +19 -0
  14. package/dist/features/mcp/tools.js +476 -0
  15. package/dist/features/mcp/tools.js.map +1 -0
  16. package/dist/release/stable.d.ts +8 -0
  17. package/dist/release/stable.js +12 -0
  18. package/dist/release/stable.js.map +1 -1
  19. package/dist/server/automations-routes.d.ts +150 -150
  20. package/dist/server/live-routes.d.ts +6 -6
  21. package/dist/server/project-settings-routes.d.ts +107 -107
  22. package/dist/server/provider-sign-in-routes.d.ts +2 -2
  23. package/dist/server/runner-install-routes.d.ts +10 -10
  24. package/dist/server/runs-routes.d.ts +291 -291
  25. package/dist/server/server.d.ts +76 -76
  26. package/dist/server/workspace-live-routes.d.ts +6 -6
  27. package/dist/task-cli/cli.js +54 -221
  28. package/dist/task-cli/cli.js.map +1 -1
  29. package/dist/task-cli/discovery.d.ts +22 -1
  30. package/dist/task-cli/discovery.js +69 -17
  31. package/dist/task-cli/discovery.js.map +1 -1
  32. package/dist/task-cli/http.d.ts +15 -13
  33. package/dist/task-cli/http.js +16 -6
  34. package/dist/task-cli/http.js.map +1 -1
  35. package/dist/task-cli/operations.d.ts +156 -0
  36. package/dist/task-cli/operations.js +388 -0
  37. package/dist/task-cli/operations.js.map +1 -0
  38. package/dist/task-cli/watch.d.ts +31 -8
  39. package/dist/task-cli/watch.js +159 -91
  40. package/dist/task-cli/watch.js.map +1 -1
  41. package/package.json +4 -4
  42. package/web/dist/assets/accounts-section-COizLyTO.js +1 -0
  43. package/web/dist/assets/activity-motion-DfI5xoMG.js +2 -0
  44. package/web/dist/assets/activity-route-BQs2vBeo.js +1 -0
  45. package/web/dist/assets/agent-config-section-BwBo-HRw.js +7 -0
  46. package/web/dist/assets/agent-defaults-section-h-Gjb_gh.js +1 -0
  47. package/web/dist/assets/{appearance-rXtZGJD_.js → appearance-Bcl2amXv.js} +1 -1
  48. package/web/dist/assets/{archive-on-merge-field-C7_Fwy2A.js → archive-on-merge-field-Bm8miJjt.js} +1 -1
  49. package/web/dist/assets/attention-8bNiiAFt.js +1 -0
  50. package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
  51. package/web/dist/assets/automations-route-rSezHxBp.js +2 -0
  52. package/web/dist/assets/{commit-list-yW-pZ7Bc.js → commit-list-DtEqtn9o.js} +1 -1
  53. package/web/dist/assets/{diff-CfS2Qosw.js → diff-BK789dS0.js} +2 -2
  54. package/web/dist/assets/{diff-controls-DUiipGjf.js → diff-controls-BFqQNxRu.js} +1 -1
  55. package/web/dist/assets/{diff-view-pPxrBBze.js → diff-view-BEgQ7jZV.js} +1 -1
  56. package/web/dist/assets/file-preview-CDWTFZ4P.js +2 -0
  57. package/web/dist/assets/{folder-browser-B7IbnF0d.js → folder-browser-BfclRPcX.js} +1 -1
  58. package/web/dist/assets/{git-toolbar-Dwndizit.js → git-toolbar-Pugtjt-9.js} +1 -1
  59. package/web/dist/assets/github-CvpaGHe6.js +1 -0
  60. package/web/dist/assets/global-activity-route-Di_ICsRI.js +1 -0
  61. package/web/dist/assets/{image-preview-Bvd30ghX.js → image-preview-Dx2w5oIn.js} +1 -1
  62. package/web/dist/assets/index-CGjknHnV.css +1 -0
  63. package/web/dist/assets/index-CJFT0IZP.js +21 -0
  64. package/web/dist/assets/{label-Bt8n7Spq.js → label-DEH7fJN4.js} +1 -1
  65. package/web/dist/assets/live-reads-BJ9eDISf.js +1 -0
  66. package/web/dist/assets/live-refetch-VoLPvzhe.js +1 -0
  67. package/web/dist/assets/markdown-Dv0r75AX.js +4 -0
  68. package/web/dist/assets/{nav-row-styles-DKeXbc4N.js → nav-row-styles-DqKjMToI.js} +1 -1
  69. package/web/dist/assets/{notifications-section-ALnp6W1u.js → notifications-section-DCiqPl3M.js} +1 -1
  70. package/web/dist/assets/open-in-menu-HM5l7Bwk.js +1 -0
  71. package/web/dist/assets/{preview-pane-connected-rud-axMx.js → preview-pane-connected-WV9oolnn.js} +1 -1
  72. package/web/dist/assets/project-location-CfJLc6aJ.js +1 -0
  73. package/web/dist/assets/{project-router-CLJTc7gv.js → project-router-Bii3ofOk.js} +1 -1
  74. package/web/dist/assets/project-scope-context-BdqKyBHa.js +4 -0
  75. package/web/dist/assets/projects-section-D2cACaaG.js +1 -0
  76. package/web/dist/assets/{prompt-templates-section-BQdQIVys.js → prompt-templates-section-toLPd5u2.js} +1 -1
  77. package/web/dist/assets/queries-C7VNk-nW.js +1 -0
  78. package/web/dist/assets/{reference-chip-D0v0keVC.js → reference-chip-rylFalfg.js} +1 -1
  79. package/web/dist/assets/{remote-settings-notice-DeCObYJC.js → remote-settings-notice-N9vtBTIK.js} +1 -1
  80. package/web/dist/assets/repo-git-DJym0aRY.js +1 -0
  81. package/web/dist/assets/report-reader-CjskGtxS.js +1 -0
  82. package/web/dist/assets/reports-B-G9HA48.js +1 -0
  83. package/web/dist/assets/reports-CNFNb36Z.css +1 -0
  84. package/web/dist/assets/{resources-section-B19JoAbk.js → resources-section-B88h1y0Q.js} +1 -1
  85. package/web/dist/assets/run-header-B-olCSdg.js +2 -0
  86. package/web/dist/assets/{select-CEH-C-jh.js → select-BaydzE-I.js} +1 -1
  87. package/web/dist/assets/{session-context-section-C33VjuF4.js → session-context-section-BJKRXbss.js} +2 -2
  88. package/web/dist/assets/settings-agent-picker-6xZMIC_D.js +1 -0
  89. package/web/dist/assets/settings-shell-BkTgs1S9.js +1 -0
  90. package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
  91. package/web/dist/assets/{sidebar-section-DOTH6fiq.js → sidebar-section-B57HIEgv.js} +1 -1
  92. package/web/dist/assets/skills-pBrfwrKF.js +1 -0
  93. package/web/dist/assets/{tab-link-Bu1g-ArE.js → tab-link-B1CULYRs.js} +1 -1
  94. package/web/dist/assets/task-changes-CXldTh93.js +1 -0
  95. package/web/dist/assets/task-commits-BZ3B_GPB.js +1 -0
  96. package/web/dist/assets/task-files-BSfmCkJc.js +1 -0
  97. package/web/dist/assets/task-github-item-v2bygvdO.js +1 -0
  98. package/web/dist/assets/{task-groups-4tzKGROI.js → task-groups-BbnYlkYj.js} +1 -1
  99. package/web/dist/assets/task-thread-BPWnJ7Qx.js +9 -0
  100. package/web/dist/assets/{tasks-table-C5uoZMFs.js → tasks-table-Cx7AM7lZ.js} +1 -1
  101. package/web/dist/assets/{thread-state-_-bLdUA2.js → thread-state-R0MTvwlo.js} +1 -1
  102. package/web/dist/assets/toaster-Bo5vCbz-.js +1 -0
  103. package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
  104. package/web/dist/assets/use-hand-to-agent-state-BckHuhr8.js +1 -0
  105. package/web/dist/assets/useInfiniteQuery--iQKfpUQ.js +1 -0
  106. package/web/dist/assets/useQuery-BSyhc3l3.js +1 -0
  107. package/web/dist/assets/workflows-BBc2PFDB.js +7 -0
  108. package/web/dist/assets/workflows-C6suai0L.css +1 -0
  109. package/web/dist/assets/workspace-tools-CiTG-ArW.js +1 -0
  110. package/web/dist/assets/{worktrees-section-CN78zo2m.js → worktrees-section-C07tNayi.js} +4 -4
  111. package/web/dist/index.html +18 -17
  112. package/web/dist/assets/accounts-section-DbLoty0g.js +0 -1
  113. package/web/dist/assets/activity-motion-DsIybVZn.js +0 -2
  114. package/web/dist/assets/activity-route-BXehwJ4N.js +0 -1
  115. package/web/dist/assets/agent-config-section-BKANTX-h.js +0 -7
  116. package/web/dist/assets/agent-defaults-section-D7ohQxAI.js +0 -1
  117. package/web/dist/assets/arrow-up-right-DKGzsMqY.js +0 -1
  118. package/web/dist/assets/attention-CBCeJN5w.js +0 -1
  119. package/web/dist/assets/automations-route-CzqZXK0W.css +0 -1
  120. package/web/dist/assets/automations-route-h7bwC5xx.js +0 -2
  121. package/web/dist/assets/file-preview-CGAcZe9q.js +0 -2
  122. package/web/dist/assets/github-DJ0jdSaa.js +0 -1
  123. package/web/dist/assets/global-activity-route-BV9RmVEz.js +0 -1
  124. package/web/dist/assets/html-report-BX3msvci.js +0 -3
  125. package/web/dist/assets/html-report-frame-uuqkBC0u.js +0 -1
  126. package/web/dist/assets/index-B-_22hXp.js +0 -21
  127. package/web/dist/assets/index-C69_Sk06.css +0 -1
  128. package/web/dist/assets/live-reads-Crd6fVGH.js +0 -1
  129. package/web/dist/assets/markdown-BDjWFex4.js +0 -2
  130. package/web/dist/assets/open-in-menu-BPp88ouw.js +0 -1
  131. package/web/dist/assets/page-shell-DPQBoUpR.css +0 -1
  132. package/web/dist/assets/page-shell-h8a6oznS.js +0 -1
  133. package/web/dist/assets/project-location-BRxXN249.js +0 -1
  134. package/web/dist/assets/project-scope-context-Rv6S_BXt.js +0 -4
  135. package/web/dist/assets/projects-section-BTyOG2uL.js +0 -1
  136. package/web/dist/assets/queries-qCF-eOqZ.js +0 -1
  137. package/web/dist/assets/repo-git-CegVXOtZ.js +0 -1
  138. package/web/dist/assets/report-reader-zqO4yokN.js +0 -1
  139. package/web/dist/assets/reports-CgbU2SrW.css +0 -1
  140. package/web/dist/assets/reports-DP-sxf1p.js +0 -1
  141. package/web/dist/assets/run-header-PqdYTt5O.js +0 -2
  142. package/web/dist/assets/settings-agent-picker-4PfVRtdT.js +0 -1
  143. package/web/dist/assets/settings-shell-CE1EKMmX.js +0 -1
  144. package/web/dist/assets/settings-shell-CqiAPuLq.css +0 -1
  145. package/web/dist/assets/skills-BuxDnPg-.js +0 -1
  146. package/web/dist/assets/task-changes-D8rzLeLg.js +0 -1
  147. package/web/dist/assets/task-commits-BpcYm-FY.js +0 -1
  148. package/web/dist/assets/task-files-DaaC4c18.js +0 -1
  149. package/web/dist/assets/task-github-item-D8kwUMZL.js +0 -1
  150. package/web/dist/assets/task-thread-9E6bYoV6.js +0 -9
  151. package/web/dist/assets/toaster-BXnLIU3z.js +0 -1
  152. package/web/dist/assets/use-hand-to-agent-state-B-chm1Rk.js +0 -1
  153. package/web/dist/assets/use-hand-to-agent-state-Ch0ok71s.css +0 -1
  154. package/web/dist/assets/workflows-Df3RjnXf.js +0 -7
  155. package/web/dist/assets/workflows-DsE0ExV6.css +0 -1
  156. package/web/dist/assets/workspace-tools-CAQH-2K5.js +0 -1
@@ -1,7 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{D as i,Nn as a,O as o,c as s,d as c,pi as l}from"./project-scope-context-Rv6S_BXt.js";import{n as u}from"./toaster-BXnLIU3z.js";import{A as d,Bt as f,Qt as p,Wt as ee,k as te}from"./queries-qCF-eOqZ.js";import{h as m}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{J as h,L as g,S as _,X as ne,at as re,b as ie,c as ae,ft as v,i as oe,l as se,lt as ce,n as le,ot as ue,st as de,tt as y,v as b,x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./button-B7MKxYjT.js";import{i as fe,p as C,r as w,t as T}from"./dropdown-menu-4e2iKSMT.js";import{i as E,o as D,r as pe,s as O,t as k}from"./dialog-B531GGAo.js";import{i as A,l as me,o as he}from"./skills-pM_PouEs.js";import{d as ge,l as _e,s as ve}from"./page-shell-h8a6oznS.js";import{t as ye}from"./centered-state-V15AR_qo.js";import{Gt as j,Ht as M,Jt as N,Kt as P,T as be,Ut as F,Wn as I,Wt as L,Yt as R,qt as z}from"./index-B-_22hXp.js";import{_ as xe,a as Se,c as Ce,f as we,g as Te,h as Ee,i as De,m as B,n as Oe,o as ke,p as Ae,r as V,t as H,u as je}from"./sortable.esm-CAVTYaA3.js";import{t as U}from"./textarea-vJt9undk.js";var W=e(t(),1);function G(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Me(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return{id:r,name:e,skill:e,prompt:`{{task}}`}}function Ne(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function Pe(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Fe(e,t){return e.filter((e,n)=>n!==t)}function K(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function q(e,t,n){let r=` `.repeat(n);return t.includes(`
2
- `)?[`${r}${e}: |`,...t.split(`
3
- `).map(e=>`${r} ${e}`)]:[`${r}${e}: ${K(t)}`]}function J(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${K(e.name)}`),e.skill&&t.push(` skill: ${K(e.skill)}`),t}function Y(e){let t=[];return e.model&&t.push(` model: ${K(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${K(e.effort)}`),e.runner&&t.push(` runner: ${K(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${K(e.agentProfile)}`),t}function X(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(K).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(K).join(`, `)}]`),t}function Z(e){return e.onFail?[` onFail:`,` retry: ${K(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ie(e){return[` - id: ${K(e.id)}`,...J(e),...e.prompt?q(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${K(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...Y(e),...X(e),...e.command?q(`command`,e.command,4):[],...Z(e)]}function Le(e,t,n){let r=[`name: ${K(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...q(`description`,t.trim(),0));let i=G(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${K(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ie(e))}else r.push(`skills: []`);return`${r.join(`
4
- `)}\n`}function Re(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`workflow`}function ze(e){let t=G(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Be(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ve(e,t,n){let r=G(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var Q=n();function He({workflows:e,draft:t,trimmedName:n,nameRef:r,onDraft:i,onLoadWorkflow:a}){return(0,Q.jsxs)(`section`,{"data-slot":`wb-metadata`,className:`grid min-w-0 grid-cols-1 gap-3 @xl:grid-cols-2 @4xl:grid-cols-[minmax(180px,240px)_minmax(200px,280px)_minmax(0,1fr)] @xl:items-start`,children:[(0,Q.jsxs)(`div`,{"data-slot":`wb-load`,className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-load`,className:`text-xs font-medium text-foreground`,children:`Load an existing workflow`}),(0,Q.jsxs)(`div`,{className:`relative flex min-w-0 items-center`,children:[(0,Q.jsxs)(`select`,{id:`workflow-load`,value:e.some(e=>e.name===n)?n:``,onChange:t=>{let n=e.find(e=>e.name===t.target.value);n&&a(n)},className:`h-10 w-full min-w-0 appearance-none rounded-lg border border-border bg-card pr-9 pl-3.5 text-xs font-medium text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:h-11`,children:[(0,Q.jsx)(`option`,{value:``,disabled:!0,children:`Choose a workflow`}),e.map(e=>(0,Q.jsx)(`option`,{value:e.name,"data-slot":`wb-load-option`,"data-name":e.name,children:e.name},e.name))]}),(0,Q.jsx)(se,{"aria-hidden":`true`,className:`pointer-events-none absolute right-3 size-4 text-muted-foreground`})]})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Workflow name`}),(0,Q.jsx)(I,{id:`workflow-name`,ref:r,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:t.name,onChange:e=>i({...t,name:e.target.value}),className:`h-10 bg-card text-sm max-md:h-11`})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 @xl:col-span-2 @4xl:col-span-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,Q.jsx)(U,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,value:t.description,onChange:e=>i({...t,description:e.target.value}),className:`min-h-10 bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function Ue({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-actions`,className:`grid grid-cols-[max-content_max-content] items-center justify-start gap-2 sm:flex sm:flex-wrap [&_button]:min-h-11 [&_button]:border [&_button]:border-border [&_button]:bg-card`,children:[(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,className:`col-span-2 justify-self-start`,onClick:n,children:[(0,Q.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,className:`col-span-2 justify-self-start`,title:`Download workflow.yaml`,onClick:r,children:[(0,Q.jsx)(ie,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":t,"aria-describedby":`wb-auto-hint`,title:`Auto-build: describe the chain in words and an agent drafts its steps for you to review`,onClick:i,children:[(0,Q.jsx)(ce,{"aria-hidden":`true`,className:`size-3`}),`Auto-build`]}),(0,Q.jsx)(`span`,{id:`wb-auto-hint`,className:`sr-only`,children:`Describe the chain in words and an agent drafts its steps for you to review.`}),e?(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-delete`,className:`relative text-danger hover:text-danger sm:ms-3 sm:before:absolute sm:before:-start-[13px] sm:before:top-1/2 sm:before:h-5 sm:before:w-px sm:before:-translate-y-1/2 sm:before:bg-border sm:before:content-['']`,title:`Delete the saved workflow file`,onClick:a,children:[(0,Q.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null]})}function We({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,Q.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,Q.jsx)(U,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Q.jsxs)(S,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,Q.jsx)(ce,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,Q.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,Q.jsx)(v,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,Q.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function Ge({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,Q.jsx)(k,{open:e,onOpenChange:t,children:(0,Q.jsxs)(pe,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Q.jsx)(O,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,Q.jsx)(E,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,Q.jsx)(U,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
5
- skills:
6
- - test-conventions
7
- - commit-style`,value:n,onChange:e=>r(e.target.value),className:`mt-4 min-h-[124px] bg-background p-4 font-mono text-[13px] leading-relaxed`}),(0,Q.jsx)(`p`,{className:`mt-4 text-[13px] text-muted-foreground`,children:`Paste a portable workflow definition. Imported steps appear in execution order.`}),i===``?null:(0,Q.jsx)(`p`,{"data-slot":`wb-import-error`,role:`alert`,className:`mt-2 text-xs text-danger`,children:i}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Q.jsx)(S,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-import-run`,disabled:a,onClick:o,children:`Import`}),(0,Q.jsx)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:s,children:`Cancel`})]})]})})}function Ke({paletteSkills:e,query:t,onQueryChange:n,error:r,inFlow:i,onAdd:a,yaml:o}){return(0,Q.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:`Available skills`}),(0,Q.jsxs)(`div`,{className:`sw-search relative mt-4`,children:[(0,Q.jsx)(ne,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsx)(I,{"data-slot":`wb-filter`,placeholder:`Find a skill…`,"aria-label":`Filter skills`,value:t,onChange:e=>n(e.target.value),className:`h-11 pl-9 text-xs`})]}),(0,Q.jsx)(ot,{skills:e,query:t,error:r,inFlow:i,onAdd:a}),(0,Q.jsx)(`h3`,{className:`mt-5 text-sm font-semibold`,children:`workflow.yaml`}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs leading-relaxed text-muted-foreground`,children:`Export the workflow to use this chain in another project.`}),(0,Q.jsxs)(`details`,{className:`mt-4 min-w-0`,children:[(0,Q.jsxs)(`summary`,{"data-slot":`wb-yaml-toggle`,className:`inline-flex min-h-[44px] cursor-pointer items-center rounded-lg border border-border px-3 text-xs font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(_,{"aria-hidden":`true`,className:`mr-2 size-4`}),`View YAML`]}),(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(ct,{yaml:o})}),(0,Q.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 max-h-96 overflow-auto rounded-lg border border-border bg-background p-3 font-mono text-[11px] leading-relaxed whitespace-pre text-muted-foreground`,children:o})]})]})}function qe({dragging:e,steps:t,skills:n}){return e?.type===`palette`?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,Q.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 text-link-foreground`}),e.skill]}):e?.type===`step`?(0,Q.jsx)(at,{step:e.step,index:t.findIndex(t=>t.id===e.step.id),skills:n,overlay:!0}):null}function Je({open:e,onOpenChange:t,query:n,onQueryChange:r,matches:i,skillsCount:a,error:o,selectedSkill:s,onSelectSkill:c,stepsCount:l,onCloseAutoFocus:u,onCancel:d,onAdd:f}){return(0,Q.jsx)(k,{open:e,onOpenChange:t,children:(0,Q.jsxs)(pe,{"data-slot":`wb-add-dialog`,onCloseAutoFocus:u,className:`max-h-[85dvh] overflow-y-auto sm:max-w-[660px] [&_button]:min-h-11`,children:[(0,Q.jsxs)(D,{children:[(0,Q.jsx)(O,{className:`text-xl font-normal`,children:`Add step`}),(0,Q.jsx)(E,{className:`sr-only`,children:`Choose a skill to append to this workflow.`})]}),(0,Q.jsx)(I,{"aria-label":`Filter skills`,placeholder:`Filter skills…`,value:n,onChange:e=>r(e.target.value)}),o===null?(0,Q.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Available skills`,className:`grid max-h-80 gap-2 overflow-y-auto`,children:[i.map(e=>(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg py-2 has-[:checked]:bg-accent-strong/10 has-[:focus-visible]:outline-2`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`workflow-add-skill`,className:`sr-only`,value:e.id,checked:s===e.id,onChange:()=>c(e.id)}),(0,Q.jsxs)(`span`,{className:`min-w-0 break-words text-sm`,children:[(0,Q.jsx)(`span`,{className:`block`,children:e.name}),(0,Q.jsx)(`span`,{className:`mt-2 block text-xs text-muted-foreground`,children:e.description}),e.path?(0,Q.jsx)(`span`,{className:`block break-all text-xs`,children:e.path}):null]})]},JSON.stringify([e.id,e.path]))),i.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a===0?`No skills available in this project.`:`No matching skills.`}):null]}):(0,Q.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not load skills: `,o]}),n.trim()&&!i.some(e=>e.id===n.trim())?(0,Q.jsxs)(S,{onClick:()=>c(n.trim()),children:[`Use skill id “`,n.trim(),`” (unchecked)`]}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Q.jsx)(S,{variant:`outline`,onClick:d,children:`Cancel`}),(0,Q.jsx)(S,{variant:`primary`,disabled:!s||l>=8,onClick:()=>{s&&f(s)},children:`Add selected skill`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Append the selected skill, then reorder it in the existing canvas.`}),l>=8?(0,Q.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[`A workflow can contain up to `,8,` steps. Remove a step before adding another.`]}):null]})})}function Ye({trimmedName:e,savedFile:t,overwriteOpen:n,onOverwriteDismiss:r,deleteOpen:i,onDeleteDismiss:a,onOverwrite:o,onDelete:s}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(M,{open:n,onOpenChange:e=>!e&&r(),children:(0,Q.jsxs)(j,{"data-slot":`wb-overwrite-dialog`,className:`sw-workflow-confirm sm:max-w-[660px]`,children:[(0,Q.jsxs)(N,{children:[(0,Q.jsxs)(R,{children:[`“`,e,`” already exists`]}),(0,Q.jsx)(P,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{children:`Keep the file`}),(0,Q.jsx)(F,{"data-slot":`wb-overwrite-confirm`,className:`bg-danger text-danger-foreground`,onClick:o,children:`Overwrite`})]})]})}),(0,Q.jsx)(M,{open:i,onOpenChange:e=>!e&&a(),children:(0,Q.jsxs)(j,{"data-slot":`wb-delete-dialog`,className:`sw-workflow-confirm sm:max-w-[660px]`,children:[(0,Q.jsxs)(N,{children:[(0,Q.jsxs)(R,{children:[`Delete workflow “`,e,`”?`]}),(0,Q.jsxs)(P,{children:[`Removes `,t?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,Q.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/workflows/`}),`. There is no undo.`]})]}),(0,Q.jsxs)(z,{children:[(0,Q.jsx)(L,{children:`Keep the file`}),(0,Q.jsx)(F,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:s,children:`Delete workflow`})]})]})})]})}function Xe(e){return e.name??e.skill??e.id}function Ze(e){return e.prompt?.trim()===`{{task}}`?void 0:e.prompt?.trim()}function Qe(e){let t=e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``;return`$ ${e.command}${t}`}function $e(e,t){return Ze(e)||t?.description||`Not listed by this runner and account. Step open will check the skill id.`}function et(e,t){return e.command?Qe(e):e.skill?$e(e,t):e.prompt??``}function tt(e,t){return e.skill&&!t?`unknown`:null}function nt(e){return e.command?`Command step${e.onFail?` · Retry ×${e.onFail.max??2}`:``}`:e.skill?`Skill step`:`Prompt step`}function rt({index:e,title:t,badge:n,onRemove:i,gripProps:a}){return(0,Q.jsxs)(`div`,{"data-slot":`wb-step-heading`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${e+1}: ${t}`,className:`group/grip inline-flex h-[26px] shrink-0 cursor-grab items-center justify-center gap-0.5 rounded-md text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 active:cursor-grabbing`,...a,children:[(0,Q.jsx)(g,{"aria-hidden":`true`,className:`size-4 opacity-70 transition-opacity group-hover/grip:opacity-100`}),(0,Q.jsx)(`span`,{className:`rounded bg-accent-strong/10 px-2 py-1 font-mono text-[12px] text-link-foreground`,children:String(e+1).padStart(2,`0`)})]}),(0,Q.jsx)(`div`,{className:`min-w-0 flex-1 break-words text-sm font-medium [overflow-wrap:anywhere]`,children:t}),n?(0,Q.jsx)(`span`,{"data-slot":`wb-step-badge`,className:r(`shrink-0 rounded-full border px-2 py-px font-mono text-[11px]`,n===`unknown`&&`border-danger/35 text-danger`),children:n}):null,i?(0,Q.jsxs)(T,{children:[(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(S,{"data-slot":`wb-step-actions`,variant:`ghost`,size:`icon`,className:`size-[26px]`,"aria-label":`Step ${e+1} actions: ${t}`,children:(0,Q.jsx)(x,{"aria-hidden":`true`,className:`size-4`})})}),(0,Q.jsx)(w,{align:`end`,children:(0,Q.jsxs)(fe,{"data-slot":`wb-step-remove`,"aria-label":`Remove step ${e+1}: ${t}`,onSelect:i,children:[(0,Q.jsx)(re,{"aria-hidden":`true`}),` Remove step`]})})]}):null]})}function it({index:e,onMoveUp:t,onMoveDown:n}){return(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 @min-[900px]:hidden`,children:[(0,Q.jsxs)(S,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":`Move step ${e+1} up`,disabled:!t,onClick:t,children:[(0,Q.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),`Move up`]}),(0,Q.jsxs)(S,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":`Move step ${e+1} down`,disabled:!n,onClick:n,children:[(0,Q.jsx)(le,{"aria-hidden":`true`,className:`size-4`}),`Move down`]})]})}function at({step:e,index:t,skills:n,onRemove:i,gripProps:a,onMoveUp:o,onMoveDown:s,overlay:c=!1}){let l=n.find(t=>t.id===e.skill),u=Xe(e),d=et(e,l),f=tt(e,l);return(0,Q.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:r(`rounded-lg border border-border bg-background p-4`,c&&`shadow-md`),children:[(0,Q.jsx)(rt,{index:t,title:u,badge:f,onRemove:i,gripProps:a}),d?(0,Q.jsx)(`div`,{"data-slot":`wb-step-summary`,className:`mt-1.5 break-words text-xs leading-relaxed text-muted-foreground`,children:d}):null,(0,Q.jsx)(`p`,{"data-slot":`wb-step-kind`,className:`mt-1.5 text-[11.5px] text-link-foreground`,children:nt(e)}),c?null:(0,Q.jsx)(it,{index:t,onMoveUp:o,onMoveDown:s})]})}function ot({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,Q.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=me(e,t);return(0,Q.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:a.length>0?a.map(e=>(0,Q.jsx)(st,{skill:e,inFlow:r.has(e.id),onAdd:i},JSON.stringify([e.id,e.path]))):(0,Q.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:`This runner reports no skills.`})})}function st({skill:e,inFlow:t,onAdd:n}){let{attributes:i,listeners:a,setNodeRef:o,isDragging:s}=Ae({id:`palette:${JSON.stringify([e.id,e.path])}`,data:{type:`palette`,skill:e.id}});return(0,Q.jsxs)(`div`,{ref:o,"data-slot":`wb-skill`,"data-skill":e.id,"data-in-flow":t||void 0,title:e.description??``,className:r(`flex min-h-11 cursor-grab items-center gap-2 rounded-md py-1 transition-colors hover:bg-muted`,s&&`opacity-40`),...i,...a,children:[(0,Q.jsxs)(`span`,{className:r(`min-w-0 flex-1 break-words text-xs`,A(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:[e.name,e.path?(0,Q.jsx)(`span`,{className:`block break-all text-xs text-soft-foreground`,children:e.path}):null]}),(0,Q.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.id),className:`inline-flex size-11 shrink-0 items-center justify-center rounded-md text-link-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,Q.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`})})]})}function ct({yaml:e}){let[t,n]=(0,W.useState)(!1),r=(0,W.useRef)(null);return(0,W.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,Q.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ae,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(b,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}var lt=`wb-canvas`;function $(){return{name:`my-workflow`,description:``,steps:[]}}function ut(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function dt(){let{name:e}=m();return(0,Q.jsx)(ft,{routeName:e},e??``)}function ft({routeName:e}){let t=d(),n=ee(),r=te(),m=l(),[g,_]=(0,W.useState)(null),[ne,re]=(0,W.useState)(``),[ie,v]=(0,W.useState)(!1),[oe,se]=(0,W.useState)(``),[ce,le]=(0,W.useState)(null),[de,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(``),[fe,C]=(0,W.useState)(``),[w,T]=(0,W.useState)(!1),[E,D]=(0,W.useState)(``),[pe,O]=(0,W.useState)(!1),[k,A]=(0,W.useState)(!1),j=(0,W.useId)(),[M,N]=(0,W.useState)(null),[P,F]=(0,W.useState)(null),I=(0,W.useRef)(null),L=(0,W.useRef)(null),R=t.data?.workflows??[],z=n.data??[],xe=he(z,r.data?.skillUsage),De=me(xe,oe,r.data?.skillUsage);(0,W.useEffect)(()=>{if(g!==null||t.data===void 0)return;let n=t.data.workflows,r=(e?n.find(t=>t.name===e):void 0)??n.find(e=>e.source===`file`);_(r?ut(r):$())},[g,t.data,e]);let B=e=>_(t=>t===null?t:{...t,steps:e}),Ae=p({mutationFn:e=>i(e),onSuccess:e=>{_({name:e.name,description:e.description??``,steps:e.steps}),y(!1),x(``),C(``),u(`Imported "${e.name}" — review, then Save.`)},onError:e=>C(e.message)}),V=p({mutationFn:e=>o(e),onSuccess:e=>{_(t=>{let n=t??$(),{name:r,steps:i}=Be(e,n.name);return{...n,name:r,steps:i}}),T(!1),D(``),u(e.fallback?`Planner unavailable — added a single step. Edit, then Save.`:`Built "${e.name??g?.name??`workflow`}" — review, tweak, then Save.`,e.fallback?{tone:`danger`}:void 0)},onError:e=>u(e instanceof Error?e.message:String(e),{tone:`danger`})}),H=p({mutationFn:e=>s({...Ve(g?.name??``,g?.description??``,g?.steps??[]),...e?{overwrite:!0}:{}}),onSuccess:e=>{O(!1),u(`Saved — ${e.path.split(`/`).pop()??e.path}`),m.invalidateQueries({queryKey:f.workflows})},onError:e=>{e instanceof a&&e.exists===!0?O(!0):u(e instanceof Error?e.message:String(e),{tone:`danger`})}}),U=p({mutationFn:e=>c(e),onSuccess:(e,t)=>{A(!1),u(`Deleted "${t}".`),_($()),m.invalidateQueries({queryKey:f.workflows})},onError:e=>{A(!1),u(e instanceof Error?e.message:String(e),{tone:`danger`})}}),G=Te(Ee(je,{activationConstraint:{distance:4}}),Ee(Ce,{coordinateGetter:Oe}));if(t.isError)return(0,Q.jsx)(_e,{route:`workflows`,density:`empty`,className:`@container`,children:(0,Q.jsx)(ye,{icon:(0,Q.jsx)(ue,{}),tone:`danger`,title:`Could not load workflows`,subtitle:t.error.message})});if(g===null)return(0,Q.jsx)(be,{});let K=g.steps,q=g.name.trim(),J=R.find(e=>e.name===q&&e.source===`file`),Y=Le(g.name,g.description,K),X=J!==void 0&&Le(J.name,J.description??``,J.steps??[])===Y,Z=(e,t=K.length)=>{if(K.length>=8){u(`A workflow holds at most 8 steps.`,{tone:`danger`});return}B(Ne(K,Me(e,K),t))};return(0,Q.jsxs)(_e,{route:`workflows`,density:ge(K.length),className:`@container`,header:{title:`Workflows`,subtitle:`Portable skill chains. Steps run from top to bottom.`,status:X?(0,Q.jsx)(`span`,{id:j,"data-slot":`wb-save-cue`,className:`whitespace-nowrap text-xs text-muted-foreground`,children:`No unsaved changes`}):void 0,secondaryActions:(0,Q.jsxs)(ve,{type:`button`,variant:`outline`,"data-slot":`wb-new`,onClick:()=>_($()),children:[(0,Q.jsx)(h,{"aria-hidden":`true`,className:`size-4`}),`New workflow`]}),primaryAction:(0,Q.jsxs)(ve,{type:`button`,variant:`primary`,"data-slot":`wb-save`,disabled:H.isPending||X,"aria-describedby":X?j:void 0,onClick:()=>{if(q===``){I.current?.focus();return}if(K.length===0){u(`Add at least one step first.`,{tone:`danger`});return}H.mutate(!1)},children:[(0,Q.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),`Save workflow`]})},children:[(0,Q.jsxs)(Se,{sensors:G,collisionDetection:we,onDragStart:e=>{let t=e.active.data.current;N(t??null)},onDragOver:e=>{F(e.over?String(e.over.id):null)},onDragEnd:e=>{N(null),F(null);let{active:t,over:n}=e;if(n===null)return;let r=t.data.current;if(r?.type===`palette`){let e=n.id===lt?K.length:K.findIndex(e=>e.id===n.id);Z(r.skill,e===-1?K.length:e);return}if(n.id===t.id)return;let i=K.findIndex(e=>e.id===t.id),a=K.findIndex(e=>e.id===n.id);i!==-1&&a!==-1&&B(Pe(K,i,a))},onDragCancel:()=>{N(null),F(null)},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4 pb-[calc(32px+env(safe-area-inset-bottom))]`,children:[(0,Q.jsx)(He,{workflows:R,draft:g,trimmedName:q,nameRef:I,onDraft:_,onLoadWorkflow:e=>_(ut(e))}),(0,Q.jsx)(Ue,{savedFile:J,autoOpen:w,onImportToggle:()=>{C(``),T(!1),y(e=>!e)},onExport:()=>{let e=new Blob([Y],{type:`text/yaml`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${Re(g.name)}.yaml`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)},onAutoToggle:()=>{y(!1),T(e=>!e)},onDeleteRequest:()=>A(!0)}),w?(0,Q.jsx)(We,{text:E,onTextChange:D,pending:V.isPending,onRun:()=>{let e=E.trim();e===``||V.isPending||V.mutate(e)},onCancel:()=>{T(!1),D(``)}}):null,(0,Q.jsx)(Ge,{open:de,onOpenChange:y,text:b,onTextChange:x,error:fe,pending:Ae.isPending,onRun:()=>{let e=b.trim();e!==``&&Ae.mutate(e)},onCancel:()=>{y(!1),x(``),C(``)}}),(0,Q.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] @min-[700px]:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,Q.jsxs)(`section`,{"data-slot":`wb-main`,className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,title:`A workflow holds at most 8 steps`,children:[`Steps · `,K.length,` of `,8,` max`,(0,Q.jsx)(`span`,{"data-slot":`wb-count`,className:`sr-only`,children:ze(K)})]}),(0,Q.jsx)(pt,{steps:K,skills:z,dragging:M!==null,overId:P,activeStepId:M?.type===`step`?M.step.id:null,onRemove:e=>B(Fe(K,e)),onMove:(e,t)=>B(Pe(K,e,t))}),(0,Q.jsxs)(S,{ref:L,variant:`outline`,className:`mt-4 min-h-11`,onClick:()=>{le(null),se(``),v(!0)},children:[(0,Q.jsx)(h,{"aria-hidden":`true`,className:`size-4`}),`Add step`]}),(0,Q.jsxs)(`p`,{className:`mt-4 text-xs leading-relaxed text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`hidden @min-[900px]:inline`,children:`Drag to reorder. The agent follows this sequence from top to bottom.`}),(0,Q.jsx)(`span`,{className:`@min-[900px]:hidden`,children:`Use Move up / Move down to reorder without dragging.`})]})]}),(0,Q.jsx)(Ke,{paletteSkills:xe,query:ne,onQueryChange:re,error:n.isError?n.error.message:null,inFlow:new Set(K.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>Z(e),yaml:Y})]})]}),(0,Q.jsx)(ke,{children:(0,Q.jsx)(ht,{dragging:M,steps:K,skills:z})})]}),(0,Q.jsx)(Je,{open:ie,onOpenChange:v,query:oe,onQueryChange:se,matches:De,skillsCount:z.length,error:n.isError?n.error.message:null,selectedSkill:ce,onSelectSkill:le,stepsCount:K.length,onCloseAutoFocus:e=>{e.preventDefault(),L.current?.focus()},onCancel:()=>v(!1),onAdd:e=>{Z(e),v(!1)}}),(0,Q.jsx)(Ye,{trimmedName:q,savedFile:J,overwriteOpen:pe,onOverwriteDismiss:()=>O(!1),deleteOpen:k,onDeleteDismiss:()=>A(!1),onOverwrite:()=>H.mutate(!0),onDelete:()=>U.mutate(q)})]})}function pt({steps:e,skills:t,dragging:n,overId:i,activeStepId:a,onRemove:o,onMove:s}){let{setNodeRef:c,isOver:l}=B({id:lt}),u=n&&i===lt;return(0,Q.jsx)(`div`,{ref:c,"data-slot":`wb-steps`,"data-dragging":n||void 0,className:r(`relative mt-3 rounded-lg transition-colors`,l?`border-accent-strong/60 bg-accent-strong/5`:`border-muted-foreground/25`),children:e.length===0?(0,Q.jsx)(`p`,{className:r(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,l?`text-link-foreground`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,Q.jsxs)(H,{items:e.map(e=>e.id),strategy:De,children:[(0,Q.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((r,c)=>(0,Q.jsx)(mt,{step:r,index:c,skills:t,dragging:n,insertBefore:n&&i===r.id&&a!==r.id,onRemove:()=>o(c),onMoveUp:c>0?()=>s(c,c-1):void 0,onMoveDown:c<e.length-1?()=>s(c,c+1):void 0},r.id))}),(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:r(`absolute inset-x-0 mt-1 h-[3px] rounded-full transition-colors`,u?`bg-accent-strong`:`bg-transparent`)})]})})}function mt({step:e,index:t,insertBefore:n,onRemove:i,onMoveUp:a,onMoveDown:o}){let s=ee(e.runner,e.agentProfile),{attributes:c,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:p}=V({id:e.id,data:{type:`step`,step:e}});return(0,Q.jsxs)(`li`,{ref:u,style:{transform:xe.Transform.toString(d),transition:f},className:r(`relative`,p&&`opacity-40`),children:[n?(0,Q.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-accent-strong`}):null,(0,Q.jsx)(at,{step:e,index:t,skills:s.data??[],onRemove:i,onMoveUp:a,onMoveDown:o,gripProps:{...c,...l}})]})}function ht(e){let t=e.dragging?.type===`step`?e.dragging.step:void 0,n=ee(t?.runner,t?.agentProfile,!!t);return(0,Q.jsx)(qe,{...e,skills:t?n.data??[]:e.skills})}export{dt as WorkflowsRoute};
@@ -1 +0,0 @@
1
- [data-route=skills] :is([data-slot=skills-list],[data-slot=skills-detail]),[data-route=workflows] :is([data-slot=wb-main],[data-slot=wb-aside],[data-slot=wb-auto-panel],[data-slot=wb-import-panel]){border-radius:10px}[data-slot=skills-section]>header a{gap:8px}[data-slot=skill-row]{gap:10px;min-height:0}[data-slot=skill-row]>span:nth-child(2){font-size:11px;line-height:1.65}[data-slot=skill-detail]{flex-direction:column;gap:16px;display:flex}[data-slot=skill-detail]>:is(p,section){margin-block-start:0}.sw-detail-source{background:color-mix(in oklch, var(--accent-strong) 10%, transparent);height:26px;color:var(--link-foreground);white-space:pre;border-radius:5px;align-items:center;padding-inline:8px;font-weight:500;display:inline-flex}.sw-detail-source [data-slot=skill-source]{color:inherit;font-size:inherit;font-weight:inherit;background:0 0;padding:0}[data-slot=skill-used-by]>p{margin-block-start:16px;line-height:1.6}[data-slot=skill-body]{margin-block-start:0;font-size:13px;line-height:1.65}[data-slot=skill-body] h1,[data-slot=skill-body] h2{font-size:18px;font-weight:600}[data-slot=skill-body] h3{font-size:14px;font-weight:600}[data-slot=wb-metadata]{gap:14px}[data-slot=wb-load] label{font-size:12px}[data-slot=wb-name]{padding-inline:12px}[data-slot=wb-actions] button{border-radius:8px;gap:8px;padding-inline:12px}[data-slot=wb-actions] svg{width:16px;height:16px}[data-slot=wb-auto-panel]{border-color:color-mix(in oklch, var(--accent-strong) 35%, var(--border))}[data-slot=wb-auto-cancel]{border:1px solid var(--border);background:var(--card)}[data-slot=wb-palette]{gap:4px;margin-block-start:12px}[data-slot=wb-skill]{padding:0}[data-slot=wb-skill-add]{width:24px}[data-slot=wb-aside] h2{font-size:16px}[data-slot=wb-aside] h3{margin-block-start:16px}[data-slot=wb-step-grip] span{justify-content:center;align-items:center;min-width:28px;height:26px;padding:0 4px;font-family:inherit;font-size:12px;font-weight:500;display:inline-flex}[data-slot=wb-step-heading]>div{font-weight:500}[data-slot=wb-main]>p:last-of-type{font-size:11px}[data-slot=wb-import-panel]>div{flex-direction:row-reverse;justify-content:flex-end;gap:12px;margin-block-start:16px}[data-slot=wb-import-cancel]{border:1px solid var(--border)}[data-slot=wb-import-panel]{flex-direction:column;display:flex}[data-slot=wb-import-error]{order:1;margin-block-start:16px;font-size:12px}@media (width<=767px){[data-route=skills],[data-route=workflows]{padding-block-end:32px}[data-slot=skills-section]>header a{gap:10px;padding-inline:14px}[data-slot=wb-import-panel]{z-index:50;max-height:calc(100dvh - 57px);position:fixed;inset-block:57px auto;inset-inline:0;overflow-y:auto}}@container (width<=649px){[data-slot=skill-row][aria-current=page]{border-color:var(--border);background:0 0}}[data-slot=skill-row]:before{display:none}[data-slot=skill-row]:has([data-source=team])>span:first-child>span{font-weight:500;line-height:1.6}[data-slot=skill-row] [data-source=team]{font-weight:400}[data-slot=skill-row][aria-current=page],[data-slot=skill-row][data-highlighted],[data-slot=skills-section]>header a[aria-current=page]{background:var(--task-brand-selected)}[data-slot=skill-detail]>div:first-child{gap:16px}[data-slot=skill-detail]>div:first-child :is(h2,h3),[data-slot=skill-path]{line-height:1.6}[data-slot=skill-body] .thread-markdown{flex-direction:column;gap:16px;display:flex}[data-slot=skill-body] .thread-markdown>*{margin:0}[data-slot=skill-body] .thread-markdown :is(p,ul,ol){color:var(--muted-foreground)}[data-slot=skill-body] .thread-markdown ul{flex-direction:column;gap:16px;padding-inline-start:12px;font-size:12px;display:flex}[data-slot=skill-body] .thread-markdown li{margin:0;padding:0}[data-slot=wb-skill]>span{color:var(--muted-foreground);font-weight:400}@container (width<=649px){[data-slot=skill-row][aria-current=page]{background:0 0}}[data-slot=wb-import-panel]{gap:0}.sw-workflow-confirm{border-radius:12px;padding:24px}.sw-workflow-confirm [data-slot=alert-dialog-title]{font-size:20px;font-weight:400}.sw-workflow-confirm [data-slot=alert-dialog-footer]{justify-content:flex-start}.sw-workflow-confirm button{min-height:44px}@media (width<=767px){[data-slot=dialog-overlay]:has(+[data-slot=wb-import-panel]){background:0 0}[data-slot=wb-import-panel]{width:100%;max-width:100%;inset-block-start:57px;inset-inline-start:0;transform:none}}[data-slot=skills-section]>header a{font-size:13px;font-weight:600}.sw-detail-source,[data-slot=wb-step-grip] span{background:var(--task-brand-selected)}[data-route=workflows] [data-slot=page-shell-body] button{border-radius:8px;font-size:12px;font-weight:500}:is([data-slot=wb-import-panel],[data-slot=wb-add-dialog],.sw-workflow-confirm) button{border-radius:8px;font-size:12px;font-weight:400}.sw-workflow-confirm [data-slot=alert-dialog-title]{line-height:1.6}.sw-workflow-confirm [data-slot=alert-dialog-description]{font-size:13px;line-height:1.6}.sw-workflow-confirm [data-slot=alert-dialog-header]{text-align:start;gap:16px}[data-slot=wb-step-actions] svg,[data-slot=wb-skill-add] svg{width:18px;height:18px}[data-slot=wb-save] svg,[data-slot=wb-auto-run] svg{width:16px;height:16px}[data-slot=skill-row] [data-slot=skill-source]{line-height:1.5}:is([data-slot=wb-import-panel],[data-slot=wb-add-dialog],.sw-workflow-confirm){box-shadow:none}[data-slot=wb-import-panel] [data-slot=dialog-title]{line-height:1.6}[data-slot=wb-add-dialog] [data-slot=dialog-header]{text-align:start}[data-slot=skills-section]>header a{padding-inline:11px}[data-slot=skill-body] .thread-markdown :is(h1,h2,h3){line-height:1.5}[data-slot=skill-body] .thread-markdown :is(p,ul,ol){line-height:1.6}[data-slot=skill-body] .thread-markdown ul{padding-inline-start:0;list-style-position:inside}:is([data-slot=skills-filter],[data-route=workflows] :is(input,textarea,select)){border-color:var(--border);border-radius:8px}:is([data-slot=skills-filter],[data-route=workflows] :is(input,textarea)):focus-visible{border-color:var(--ring)}[data-slot=wb-filter]{background:var(--card)}[data-slot=wb-metadata]>label{line-height:1.5}[data-slot=wb-auto-panel]{border-color:var(--composer-border);padding:19px}[data-slot=wb-auto-panel]>h2,[data-slot=wb-auto-panel]>p{line-height:1.6}[data-slot=wb-auto-panel]>div{gap:8px;margin-block-start:16px}[data-slot=wb-auto-text]{border-radius:8px;padding:15px}@media (width<=767px){[data-slot=skills-section]>header a{padding-inline:13px}}[data-slot=skill-body] .thread-markdown :is(h1,h2){font-size:18px}[data-slot=skill-body] .thread-markdown h3{font-size:14px}[data-slot=wb-step-heading] :is([data-slot=wb-step-grip],[data-slot=wb-step-actions]){width:26px;min-width:26px;height:26px;min-height:26px;position:relative}[data-slot=wb-step-heading] [data-slot=wb-step-grip]{gap:4px;width:auto}[data-slot=wb-step-heading] :is([data-slot=wb-step-grip],[data-slot=wb-step-actions]):after{content:"";position:absolute;inset:-9px}@media (width<=767px){[data-slot=wb-import-panel]{gap:18px;padding:19px}[data-slot=wb-import-panel]>*{margin:0}[data-slot=wb-import-panel] [data-slot=dialog-title]{line-height:1.5}[data-slot=wb-import-panel]>p{font-size:12px;line-height:1.5}[data-slot=wb-import-text]{border-radius:12px;padding:15px;line-height:1.8}[data-slot=wb-import-panel]>div{margin-block-start:0}[data-slot=wb-import-panel] button{height:50px;min-height:50px;padding-inline:15px}}[data-slot=wb-step-grip] span{border-radius:5px}[data-slot=wb-main],[data-slot=wb-aside]{padding:19px}[data-slot=wb-step]{padding:12px 14px}[data-slot=wb-step-heading]>div{line-height:24px}[data-slot=wb-step-summary],[data-slot=wb-main]>p:first-child,[data-slot=wb-main] footer p,[data-slot=wb-aside]>p{line-height:19px}[data-slot=wb-main]>p:last-of-type{line-height:18px}[data-slot=wb-main] footer{padding-block-start:15px}[data-slot=wb-aside]>p{margin-block-start:16px}[data-slot=wb-aside] h3{line-height:21px}[data-slot=wb-load] label{line-height:16px}[data-slot=wb-auto-run]{gap:8px;padding-inline:12px}[data-slot=wb-actions] button,[data-slot=wb-main]>button,[data-slot=wb-step]>div:last-child button,[data-slot=wb-auto-cancel],[data-slot=wb-yaml-toggle]{gap:8px;padding-inline:11px}[data-slot=skills-section]>header a{gap:10px;height:43px;min-height:43px;padding-inline:13px;position:relative}[data-slot=skills-section]>header a:after{content:"";position:absolute;inset-block:-.5px;inset-inline:0}[data-slot=skill-row]>span:first-child{font-size:13px;line-height:21px}[data-slot=skill-row]:has([data-source=team])>span:first-child>span{line-height:21px}[data-slot=skill-row]>span:nth-child(2){line-height:18px}[data-slot=skill-detail]>div:first-child :is(h2,h3){line-height:30px}[data-slot=skill-used-by]>h3,[data-slot=skill-used-by]>p{line-height:19px}[data-slot=skill-body] .thread-markdown p{line-height:21px}[data-slot=skill-body] .thread-markdown :is(ul,ol){line-height:19px}[data-slot=skill-body] .thread-markdown ul{list-style:none}[data-slot=skill-body] .thread-markdown ul>li:before{content:"• ";white-space:pre}@media (width<=639px){[data-slot=wb-main] footer{gap:14px}}@media (width>=768px){[data-slot=skill-detail]>div:first-child :is(h2,h3){line-height:38px}[data-slot=wb-skill]{min-height:36px;padding-block:4px}[data-slot=wb-skill-add]{height:32px}}[data-slot=wb-auto-panel]>h2{line-height:29px}[data-slot=wb-auto-panel]>p{line-height:21px}[data-slot=wb-auto-panel]>p:last-child{font-size:11px;line-height:18px}[data-slot=wb-auto-text]{line-height:22px}@container (width<=649px){[data-slot=skill-row][aria-current=page]{box-shadow:inset 0 -1px var(--border)}}[data-slot=wb-yaml-toggle] svg{margin-inline-end:0}[data-slot=wb-description]{field-sizing:content;color:var(--foreground);padding:9px 12px;font-size:13px;line-height:20px}
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{l as r,m as i}from"./live-reads-Crd6fVGH.js";import{n as a}from"./toaster-BXnLIU3z.js";import{vt as o,xt as s,zt as c}from"./queries-qCF-eOqZ.js";import{n as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import"./tasks-table-C5uoZMFs.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./button-B7MKxYjT.js";import{t as f}from"./status-dot-BRzVlF2X.js";import{r as p,t as m}from"./agents-settings-path-7X6_cvUg.js";import{a as h,d as g}from"./page-shell-h8a6oznS.js";import{Gn as _,Qt as v,Un as y,Vn as b,Xt as x,Zt as S}from"./index-B-_22hXp.js";var C=e(t(),1),w=n();function T(e){let t=e.replace(/\binstall\b/g,(e,t)=>t===0?`Install`:e),n=t.split(/(`[^`]+`)/g);if(n.length===1){let e=t.split(/(\bgh auth login\b)/g);return e.length===1?t:e.map((e,t)=>e===`gh auth login`?(0,w.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11.5px] text-foreground`,children:e},t):(0,w.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,w.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11.5px] text-foreground`,children:e.slice(1,-1)},t):e?(0,w.jsx)(`span`,{children:e},t):null)}function E(e,t){let n=r(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}var D=/DRY_RUN=1\b/;function O({version:e}){return e?D.test(e)?(0,w.jsx)(`span`,{"data-slot":`tool-dry-run`,title:e,className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:`Dry run`}):(0,w.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,e]}):null}var k=`h-8 text-xs font-medium max-md:h-11 no-hover:h-11`;function A({health:e,projects:t,repository:n,onAction:r}){let i=!!(e.data?.repoRoot||n||t.data?.projectsDir);return(0,w.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-border bg-card p-6 max-md:p-4`,"aria-labelledby":`add-project-heading`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{id:`add-project-heading`,className:`text-base font-semibold text-foreground`,children:`Add project`}),(0,w.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a new repository, open an existing local folder, or clone a GitHub repository.`})]}),i?(0,w.jsxs)(`div`,{className:`border-y border-border py-3.5`,children:[(0,w.jsx)(`h3`,{className:`mb-2.5 text-[11px] font-semibold tracking-wide text-muted-foreground uppercase`,children:`Active project`}),(0,w.jsxs)(`dl`,{className:`space-y-2 text-[13px] leading-[1.5] text-muted-foreground`,children:[e.data?.repoRoot?(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Local folder`}),(0,w.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:e.data.repo?.root??e.data.repoRoot})]}):null,n?(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Repository`}),(0,w.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:n.replace(/^https:\/\//,``)})]}):null,t.data?.projectsDir?(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-x-4 gap-y-0.5 sm:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Checkout folder`}),(0,w.jsx)(`dd`,{className:`min-w-0 font-mono text-xs break-all`,children:t.data.projectsDir})]}):null]})]}):null,(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,w.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,"data-action":`new-project`,onClick:()=>r(`new`),children:`New project`}),(0,w.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,onClick:()=>r(`local`),children:`Open local folder`}),(0,w.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,onClick:()=>r(`clone`),children:`Clone from GitHub`})]})]})}function j({health:e,runners:t,copying:n,onCopy:r}){return(0,w.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-border bg-card p-6 max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,w.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,w.jsx)(d,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,w.jsxs)(l,{to:m,"data-slot":`tools-settings`,children:[`Tool settings`,(0,w.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,w.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,w.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,w.jsx)(`dl`,{className:`divide-y divide-border border-y border-border text-[13px] leading-[1.5] text-muted-foreground`,children:e.data.checks.map(e=>{let n=x(e),r=E(e.name,t);return(0,w.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":e.available,className:`grid grid-cols-1 gap-x-4 gap-y-1 py-3 sm:grid-cols-[160px_minmax(0,1fr)] sm:items-center`,children:[(0,w.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,w.jsx)(f,{tone:v(e)}),(0,w.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,w.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,w.jsx)(`span`,{className:`shrink-0`,children:S(e)}),(0,w.jsx)(O,{version:e.version}),e.available?null:(0,w.jsx)(d,{asChild:!0,variant:`outline`,size:`sm`,className:`${k} ml-auto`,children:(0,w.jsxs)(l,{to:p(e.name),"data-slot":`tool-setup`,children:[`Set up`,(0,w.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),n?(0,w.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:T(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[(0,w.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,w.jsx)(d,{variant:`outline`,className:`h-10 rounded-lg px-3.5 text-xs font-medium max-md:h-11`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`})]})]})}function M(){let e=o(),t=s(),n=i().data,r=c(e.data?.repo?.remote),[l,u]=(0,C.useState)(null),[d,f]=(0,C.useState)(!1),p=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),a(`Diagnostics copied`)}catch{a(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},m=e.data?.checks.length??4;return(0,w.jsxs)(h,{route:`workspace-tools`,density:e.data?g(m):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Add projects and inspect local workspace CLI diagnostics.`},children:[(0,w.jsx)(A,{health:e,projects:t,repository:r,onAction:u}),(0,w.jsx)(j,{health:e,runners:n,copying:d,onCopy:p}),l===`new`?(0,w.jsx)(b,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,w.jsx)(_,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,w.jsx)(y,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{M as WorkspaceToolsRoute};