cezarion 0.18.0 → 0.19.0-dev.8638
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -5
- package/web/dist/app-icon.png +0 -0
- package/web/dist/assets/accounts-section-D7EK3_7b.js +1 -0
- package/web/dist/assets/activity-motion-2BQBW4lA.js +2 -0
- package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
- package/web/dist/assets/activity-route-Ct06t8Y9.js +1 -0
- package/web/dist/assets/agent-config-section-D6Lcc7c5.js +7 -0
- package/web/dist/assets/agent-defaults-section-BnDBbzuG.js +1 -0
- package/web/dist/assets/agents-settings-path-7X6_cvUg.js +1 -0
- package/web/dist/assets/appearance-CM6ahUyy.js +1 -0
- package/web/dist/assets/archive-on-merge-field-C7_Fwy2A.js +1 -0
- package/web/dist/assets/arrow-up-right-DKGzsMqY.js +1 -0
- package/web/dist/assets/attention-CBCeJN5w.js +1 -0
- package/web/dist/assets/automation-format-DB34jUyF.js +1 -0
- package/web/dist/assets/automations-route-7B_DF4O1.js +2 -0
- package/web/dist/assets/automations-route-CzqZXK0W.css +1 -0
- package/web/dist/assets/badge-DQ3U69Ht.js +1 -0
- package/web/dist/assets/bot-TkDIw4y-.js +1 -0
- package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
- package/web/dist/assets/button-B7MKxYjT.js +1 -0
- package/web/dist/assets/centered-state-V15AR_qo.js +1 -0
- package/web/dist/assets/cez-idle-CdswdDRd.js +1 -0
- package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
- package/web/dist/assets/check-OP-CVgZG.js +1 -0
- package/web/dist/assets/chevron-down-CHGyCDBH.js +1 -0
- package/web/dist/assets/chevron-right-BENZ-1ZN.js +1 -0
- package/web/dist/assets/{chunk-BO2N2NFS-DE6qKn3r.js → chunk-BO2N2NFS-DQrpGzb-.js} +17 -17
- package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +3 -0
- package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
- package/web/dist/assets/code-editor-B4baSOhz.js +4 -0
- package/web/dist/assets/collapsible-BEV4FO-1.js +1 -0
- package/web/dist/assets/command-KdW7aO0N.js +1 -0
- package/web/dist/assets/commit-list-O4ugJ12w.js +1 -0
- package/web/dist/assets/{core-BCsw8oQw.js → core-DzoyrHjB.js} +2 -2
- package/web/dist/assets/design-icons-CzEoMH9c.js +1 -0
- package/web/dist/assets/dialog-B531GGAo.js +1 -0
- package/web/dist/assets/diff-DKZvZQ2G.js +3 -0
- package/web/dist/assets/diff-controls-BpTFu29H.js +1 -0
- package/web/dist/assets/diff-view-D4yXb2w7.js +11 -0
- package/web/dist/assets/dist-BAoXdNsT.js +1 -0
- package/web/dist/assets/dist-BW234Kg5.js +1 -0
- package/web/dist/assets/dist-C5mlVBmd.js +1 -0
- package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
- package/web/dist/assets/dist-DXO3xwbC.js +1 -0
- package/web/dist/assets/dist-Da4ckcJG.js +1 -0
- package/web/dist/assets/dropdown-menu-4e2iKSMT.js +1 -0
- package/web/dist/assets/es2015-CQth82uv.js +41 -0
- package/web/dist/assets/external-link-BE6y205O.js +1 -0
- package/web/dist/assets/file-preview-CUhut4J9.js +2 -0
- package/web/dist/assets/folder-browser-B7IbnF0d.js +1 -0
- package/web/dist/assets/folder-o-AvL3y3.js +1 -0
- package/web/dist/assets/format-BU7D3IfE.js +1 -0
- package/web/dist/assets/git-toolbar-po0QJciG.js +1 -0
- package/web/dist/assets/github-TgLTixC7.js +1 -0
- package/web/dist/assets/global-activity-route-OHCmn0ZO.js +1 -0
- package/web/dist/assets/{highlighted-body-OFNGDK62-BL-MfFgl.js → highlighted-body-OFNGDK62-Cx8MiNVZ.js} +1 -1
- package/web/dist/assets/highlighter-DvLzHjjY.js +3 -0
- package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
- package/web/dist/assets/html-report-BX3msvci.js +3 -0
- package/web/dist/assets/html-report-frame-uuqkBC0u.js +1 -0
- package/web/dist/assets/image-preview-Sisptm3b.js +1 -0
- package/web/dist/assets/index-C69_Sk06.css +1 -0
- package/web/dist/assets/index-CvVmG4Yu.js +21 -0
- package/web/dist/assets/label-Bt8n7Spq.js +1 -0
- package/web/dist/assets/lib-DrPFkMXk.js +1 -0
- package/web/dist/assets/live-protocol-DMhTnCmf.js +64 -0
- package/web/dist/assets/live-reads-Crd6fVGH.js +1 -0
- package/web/dist/assets/{live-worker-BWdeGzQX.ts → live-worker-DBw-5jVE.ts} +3 -1
- package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
- package/web/dist/assets/markdown-jle_P0a2.js +2 -0
- package/web/dist/assets/mermaid-GHXKKRXX-lTc_AjAC.js +1 -0
- package/web/dist/assets/moon-CRE9nU5R.js +1 -0
- package/web/dist/assets/nav-row-styles-DKeXbc4N.js +1 -0
- package/web/dist/assets/notifications-section-Bhqr3yOz.js +1 -0
- package/web/dist/assets/open-in-menu-BPp88ouw.js +1 -0
- package/web/dist/assets/own-lookup-DS54wXvD.js +1 -0
- package/web/dist/assets/page-shell-7pLJMOgh.js +1 -0
- package/web/dist/assets/page-shell-DQPYcKyL.css +1 -0
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/plus-CxRU2X8C.js +1 -0
- package/web/dist/assets/popover-BPgUYFyu.js +1 -0
- package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/web/dist/assets/preview-pane-connected-CBt_nlmX.js +3 -0
- package/web/dist/assets/project-location-BRxXN249.js +1 -0
- package/web/dist/assets/project-order-AcHI4Dcl.js +1 -0
- package/web/dist/assets/project-rail-sortable-BmVI4_-T.js +1 -0
- package/web/dist/assets/project-router-CLJTc7gv.js +1 -0
- package/web/dist/assets/project-scope-context-Rv6S_BXt.js +4 -0
- package/web/dist/assets/projects-section-DnGSWHZJ.js +1 -0
- package/web/dist/assets/prompt-templates-section-8kBTviSw.js +1 -0
- package/web/dist/assets/queries-qCF-eOqZ.js +1 -0
- package/web/dist/assets/reference-chip-D0v0keVC.js +1 -0
- package/web/dist/assets/remote-settings-notice-D7G8cXSx.js +1 -0
- package/web/dist/assets/repo-git-DqBUjQMh.js +1 -0
- package/web/dist/assets/report-reader-DtSBGt0O.js +1 -0
- package/web/dist/assets/reports-CgbU2SrW.css +1 -0
- package/web/dist/assets/reports-ea3-iuBm.js +1 -0
- package/web/dist/assets/resources-section-CpXFFHXl.js +1 -0
- package/web/dist/assets/run-header-BWTrj0_2.js +2 -0
- package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
- package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
- package/web/dist/assets/saved-draft-BwzBc-_Y.js +1 -0
- package/web/dist/assets/select-aiSr0uTB.js +1 -0
- package/web/dist/assets/session-context-section-BRaZbxVO.js +119 -0
- package/web/dist/assets/settings-agent-picker-DMIqQhkC.js +1 -0
- package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
- package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
- package/web/dist/assets/settings-shell-CqiAPuLq.css +1 -0
- package/web/dist/assets/settings-shell-DwMbZhxp.js +1 -0
- package/web/dist/assets/sidebar-section-ClrORHpO.js +1 -0
- package/web/dist/assets/skills-B97qjJ7j.js +1 -0
- package/web/dist/assets/skills-pM_PouEs.js +1 -0
- package/web/dist/assets/smartphone-Lr8Ug2z_.js +1 -0
- package/web/dist/assets/sortable.esm-CAVTYaA3.js +5 -0
- package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
- package/web/dist/assets/status-dot-BRzVlF2X.js +1 -0
- package/web/dist/assets/switch-SP8pw5uU.js +1 -0
- package/web/dist/assets/tab-link-Bu1g-ArE.js +1 -0
- package/web/dist/assets/task-changes-BEfLx9dF.js +1 -0
- package/web/dist/assets/task-commits-6f0GpNF7.js +1 -0
- package/web/dist/assets/task-files-CA2xTRaM.js +1 -0
- package/web/dist/assets/task-github-item-BWapcDJr.js +1 -0
- package/web/dist/assets/task-groups-4tzKGROI.js +1 -0
- package/web/dist/assets/task-thread-0rKVutjQ.js +9 -0
- package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
- package/web/dist/assets/tasks-table-C5uoZMFs.js +1 -0
- package/web/dist/assets/textarea-vJt9undk.js +1 -0
- package/web/dist/assets/thread-state-C3eDWXYs.js +4 -0
- package/web/dist/assets/toaster-BXnLIU3z.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Ch0ok71s.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-DrAmCxn8.js +1 -0
- package/web/dist/assets/utils-DSMR_WLb.js +1 -0
- package/web/dist/assets/workflows-CW-1K6tq.js +7 -0
- package/web/dist/assets/workflows-DsE0ExV6.css +1 -0
- package/web/dist/assets/workspace-tools-BzDQrP3y.js +1 -0
- package/web/dist/assets/worktrees-section-ay1jJn_w.js +4 -0
- package/web/dist/assets/zoomable-image-CIQl1Wpe.js +1 -0
- package/web/dist/index.html +67 -32
- package/web/dist/live-worker.js +2 -2
- package/web/dist/assets/activity-motion-hhx0e841.js +0 -2
- package/web/dist/assets/activity-route-De0BnSrc.js +0 -1
- package/web/dist/assets/agent-accounts-BCg-578Q.js +0 -18
- package/web/dist/assets/alert-dialog-Dj464rjk.js +0 -1
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
- package/web/dist/assets/button-CHUAMTHK.js +0 -3
- package/web/dist/assets/centered-state-DGyy0SuA.js +0 -1
- package/web/dist/assets/cez-idle-BT0U4GN_.js +0 -1
- package/web/dist/assets/commit-diff-panel-DYtYc_dH.js +0 -1
- package/web/dist/assets/control-locations-CA9TMupq.js +0 -1
- package/web/dist/assets/design-icons-DmYTv2r1.js +0 -1
- package/web/dist/assets/diff-controls-BR2uqhwG.js +0 -1
- package/web/dist/assets/diff-tVGVhYyc.js +0 -3
- package/web/dist/assets/diff-view-CNM3u77o.js +0 -11
- package/web/dist/assets/dropdown-menu-DhrBcVgr.js +0 -1
- package/web/dist/assets/es2015-D345RR4o.js +0 -41
- package/web/dist/assets/file-preview-C1eTdJLJ.js +0 -2
- package/web/dist/assets/git-toolbar-Dwz8p8GW.js +0 -1
- package/web/dist/assets/github-BSezqH6f.js +0 -1
- package/web/dist/assets/github-sidebar-model-Ct0DltOv.js +0 -1
- package/web/dist/assets/global-activity-route-BZiYz-B0.js +0 -1
- package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
- package/web/dist/assets/image-preview-Cq1vDiEo.js +0 -1
- package/web/dist/assets/index-B18AqW0Z.css +0 -1
- package/web/dist/assets/index-D489J7QW.js +0 -14
- package/web/dist/assets/lib-BxQXEXDF.js +0 -1
- package/web/dist/assets/live-protocol-BDY7JJpT.js +0 -64
- package/web/dist/assets/live-refetch-C0kQc3-z.js +0 -1
- package/web/dist/assets/loader-circle-CZkGEdoI.js +0 -1
- package/web/dist/assets/markdown-D7DUNWcJ.js +0 -6
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +0 -1
- package/web/dist/assets/nav-row-styles-BZUUavOF.js +0 -1
- package/web/dist/assets/popover-DRcRI46x.js +0 -1
- package/web/dist/assets/preview-pane-connected-DGkEs_L3.js +0 -3
- package/web/dist/assets/project-router-1m_VlC22.js +0 -1
- package/web/dist/assets/project-scope-context-CaUqlAd7.js +0 -4
- package/web/dist/assets/queries-DYfIpJ-d.js +0 -1
- package/web/dist/assets/repo-git-CU1S5P-y.js +0 -1
- package/web/dist/assets/report-reader-DlZol2Ux.js +0 -1
- package/web/dist/assets/reports-B7QAzibP.css +0 -1
- package/web/dist/assets/reports-DIGGjk7C.js +0 -1
- package/web/dist/assets/run-header-DPjiPKRe.js +0 -2
- package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +0 -1
- package/web/dist/assets/skills-BMwanop_.js +0 -1
- package/web/dist/assets/skills-DFBiAuJG.js +0 -1
- package/web/dist/assets/skills-workflows-C21NystW.css +0 -1
- package/web/dist/assets/sortable.esm-zp_qkYGV.js +0 -5
- package/web/dist/assets/tab-link-DCUifQ46.js +0 -1
- package/web/dist/assets/task-changes-BZXWvQN3.js +0 -1
- package/web/dist/assets/task-commits-ByI9MSfc.js +0 -1
- package/web/dist/assets/task-files-LJbenpiH.js +0 -1
- package/web/dist/assets/task-github-item-B0CU9lGR.js +0 -1
- package/web/dist/assets/task-thread-CXCN__1a.js +0 -9
- package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
- package/web/dist/assets/textarea-DlVUfdWG.js +0 -1
- package/web/dist/assets/thread-state-BLaCzqeX.js +0 -4
- package/web/dist/assets/toaster-B1MyeHiE.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-BkmKad8x.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
- package/web/dist/assets/useInfiniteQuery-qEY8OhKb.js +0 -1
- package/web/dist/assets/useQuery-DOJQOEBO.js +0 -1
- package/web/dist/assets/workflows-Dbxb-d-6.js +0 -7
- package/web/dist/assets/ws-DvGmrP4z.js +0 -1
- package/web/dist/assets/zoomable-image-5pOUaPEg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{m as a}from"./live-reads-Crd6fVGH.js";import{K as o,Mr as s,P as c,Z as l,at as u,pi as d,q as f,r as p,ti as m}from"./project-scope-context-Rv6S_BXt.js";import{n as h}from"./toaster-BXnLIU3z.js";import{A as g,Bt as _,Jt as v,Qt as y,St as b,Wt as x,_ as S,a as C,c as w,f as T,k as E}from"./queries-qCF-eOqZ.js";import{Y as D,c as O,ct as k,ft as A,g as j,it as M,k as N,l as P,m as ee,ot as F,r as I,tt as L,u as te,ut as R,y as ne}from"./design-icons-CzEoMH9c.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as z}from"./external-link-BE6y205O.js";import{t as ie}from"./eye-B8okNWXU.js";import{t as ae}from"./loader-circle-CPBhhDbB.js";import{t as oe}from"./message-square-B-MD-8rD.js";import{t as se}from"./play-CmVAj_fu.js";import{t as B}from"./button-B7MKxYjT.js";import{i as ce,r as le,t as ue}from"./popover-BPgUYFyu.js";import{a as de,i as fe,o as pe,r as me,s as he,t as ge}from"./dialog-B531GGAo.js";import{t as V}from"./project-router-CLJTc7gv.js";import{a as _e,i as H,o as U,r as ve,s as ye,t as be}from"./command-KdW7aO0N.js";import{a as W}from"./format-BU7D3IfE.js";import{d as xe,f as G,i as Se,o as Ce,p as we,s as Te,t as Ee,u as De}from"./skills-pM_PouEs.js";import{$ as Oe,F as ke,G as Ae,H as je,Hn as K,I as Me,J as Ne,K as Pe,L as Fe,M as Ie,N as Le,P as Re,U as ze,W as q,X as Be,Z as Ve,ar as He,et as Ue,it as We,j as Ge,nt as Ke,rt as qe,vn as Je,xn as Ye,xt as J}from"./index-CvVmG4Yu.js";import{t as Xe}from"./markdown-jle_P0a2.js";import{t as Ze}from"./textarea-vJt9undk.js";import{t as Qe}from"./diff-DKZvZQ2G.js";import{t as Y}from"./change-counts-CW7O8g5Y.js";import{t as $e}from"./tab-link-Bu1g-ArE.js";var X=e(t(),1),Z=n(),et={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function tt({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:i(t,`text-success`)}):e===`failing`?(0,Z.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:i(t,`text-danger`)}):e===`pending`?(0,Z.jsx)(ae,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:i(t,`animate-spin text-warning`)}):(0,Z.jsx)(ee,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:i(t,`text-soft-foreground`)})}function nt(e){return e?.available?e.mergeState:null}function rt(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function it(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function at(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function ot(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function st(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ct(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function lt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ut(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function dt(e){return e?et[e]:`Merge`}function ft(e){return e===`conflicting`?`true`:void 0}function pt({check:e}){return(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(tt,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,ct(e.required)]})]}),e.url&&r(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function mt({reason:e}){return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function ht({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:r,refreshPending:a,onRefresh:o,onRunAgent:s,onConfirm:c,onMethodChange:l,onOverrideChange:u}){let d=it(e),f=at(e.reviewDecision),p=ot(e.mergeable);return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Z.jsx)(F,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:d}),(0,Z.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:o,children:[(0,Z.jsx)(D,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,a&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(tt,{state:f}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(tt,{state:p}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,st(e.mergeable)]})]}),e.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,Z.jsx)(pt,{check:e},e.name)),e.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&s?(0,Z.jsx)(B,{className:`mt-4`,onClick:s,children:`Run agent on this PR`}):null,e.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>u(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>l(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:et[e]},e))}),(0,Z.jsx)(B,{disabled:!r,onClick:c,children:dt(t)})]}):null]})]})}function gt({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,Z.jsx)(ge,{open:r,onOpenChange:s,children:(0,Z.jsxs)(me,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(pe,{children:[(0,Z.jsxs)(he,{children:[dt(n),` pull request #`,e,`?`]}),(0,Z.jsx)(fe,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),i&&t.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,Z.jsxs)(de,{children:[(0,Z.jsx)(B,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,Z.jsx)(B,{disabled:a,onClick:c,children:a?`Merging…`:dt(n)})]})]})})}function _t({number:e,onRunAgent:t}){let n=d(),r=T(),i=m({queryKey:_.githubMergeState(e),queryFn:({signal:t})=>f(e,{},{signal:t}),retry:!1}),a=nt(i.data),[o,s]=(0,X.useState)(null),[c,u]=(0,X.useState)(!1),[p,g]=(0,X.useState)(!1),v=y({mutationFn:t=>f(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>h(e instanceof Error?e.message:String(e),{tone:`danger`})}),b=rt(o,a),x=()=>({mergeState:_.githubMergeState(e),list:_.githubPages(50),comments:_.githubComments(`pr`,e),item:_.githubItem(`pr`,e),refStatus:r===void 0?void 0:_.githubRefStatusOf(r)}),S=y({mutationFn:t=>{if(!a||!b)throw Error(`No merge method is available.`);return l(e,{method:b,expectedHeadSha:a.headSha,...p&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{u(!1),h(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{h(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,Z.jsx)(K,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":ft(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(ht,{state:a,selectedMethod:b,overrideRules:p,mergeEnabled:ut(b,a,p),refreshPending:v.isPending,onRefresh:()=>v.mutate(_.githubMergeState(e)),onRunAgent:t,onConfirm:()=>u(!0),onMethodChange:s,onOverrideChange:g}),(0,Z.jsx)(gt,{number:e,state:a,selectedMethod:b,confirming:c,overrideRules:p,mergePending:S.isPending,mergeError:S.error,onOpenChange:u,onMerge:()=>S.mutate(x())})]}):(0,Z.jsx)(mt,{reason:lt(i.data)})}function vt(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function yt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function bt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function xt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}function St({label:e,color:t,plain:n=!1}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:xt(t),className:n?`text-xs font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function Ct(e){return e===`pr`?`pull request`:`issue`}function wt(e,t,n){return e===`pr`&&!!(t||n)}function Tt({backLink:e}){return e?(0,Z.jsxs)(V,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(I,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var Et=i(`text-sm`,`[&_[data-streamdown="code-block"]]:relative [&_[data-streamdown="code-block"]]:my-2.5 [&_[data-streamdown="code-block"]]:gap-0 [&_[data-streamdown="code-block"]]:overflow-hidden [&_[data-streamdown="code-block"]]:rounded-lg [&_[data-streamdown="code-block"]]:border [&_[data-streamdown="code-block"]]:border-border [&_[data-streamdown="code-block"]]:bg-background [&_[data-streamdown="code-block"]]:p-0 [&_[data-streamdown="code-block"]]:![content-visibility:visible] [&_[data-streamdown="code-block"]]:![contain-intrinsic-size:auto]`,`[&_[data-streamdown="code-block-header"]]:h-7 [&_[data-streamdown="code-block-header"]]:border-b [&_[data-streamdown="code-block-header"]]:border-border [&_[data-streamdown="code-block-header"]]:bg-muted/40 [&_[data-streamdown="code-block-header"]]:px-3 [&_[data-streamdown="code-block-header"]]:text-[11px]`,`[&_[data-streamdown="code-block-header"][data-language=""]]:hidden [&_[data-streamdown="code-block-header"]:not([data-language])]:hidden [&_[data-streamdown="code-block-header"]:has(>span:empty)]:hidden`,`[&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:absolute [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:top-1 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:right-1.5 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:mt-0 [&_[data-streamdown="code-block"]>*:has([data-streamdown="code-block-actions"])]:h-auto`,`[&_[data-streamdown="code-block-actions"]]:border-0 [&_[data-streamdown="code-block-actions"]]:bg-transparent [&_[data-streamdown="code-block-actions"]]:p-0 [&_[data-streamdown="code-block-actions"]]:backdrop-blur-none`,`[&_[data-streamdown="image-fallback"]]:inline-flex [&_[data-streamdown="image-fallback"]]:rounded-md [&_[data-streamdown="image-fallback"]]:border [&_[data-streamdown="image-fallback"]]:border-dashed [&_[data-streamdown="image-fallback"]]:border-border [&_[data-streamdown="image-fallback"]]:bg-muted/40 [&_[data-streamdown="image-fallback"]]:px-3 [&_[data-streamdown="image-fallback"]]:py-2 [&_[data-streamdown="image-fallback"]]:not-italic [&_[data-streamdown="image-fallback"]]:after:content-["_—_open_on_GitHub_to_view"]`,`[&_[data-streamdown="code-block-body"]]:rounded-none [&_[data-streamdown="code-block-body"]]:border-0 [&_[data-streamdown="code-block-body"]]:bg-transparent [&_[data-streamdown="code-block-body"]]:px-3.5 [&_[data-streamdown="code-block-body"]]:py-2.5 [&_[data-streamdown="code-block-body"]]:pr-10`);function Dt(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function Ot({item:e,kindWord:t,commentCount:n,hasDiffStat:i,additions:a,deletions:o}){return(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:t}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsx)(`time`,{dateTime:e.createdAt,title:Dt(e.createdAt),children:W(e.createdAt)}),n?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)($t,{count:n})]}):null,i?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,Z.jsx)(Y,{adds:a??0,dels:o??0})})]}):null,`·`,r(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function kt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)($e,{to:J(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,Z.jsx)($e,{to:J(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,Z.jsx)(V,{to:J(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function At({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(St,{label:e,color:t[e]},e)),n?(0,Z.jsx)(en,{checks:n,url:e.url}):null]}):null}function jt({item:e,colors:t,body:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:i(`mt-5`,Et),children:n?(0,Z.jsx)(Xe,{children:n}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,Z.jsx)(Ft,{item:e,colors:t})]})}function Mt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let u=a?.changes??!1,d=Ct(e.kind),f=C(e.kind,e.number,!u).data?.detail,p=f?.body??e.body,m=f?.additions??e.additions,h=f?.deletions??e.deletions,g=wt(e.kind,m,h),_=r??e.comments;return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsx)(Tt,{backLink:i}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsx)(Nt,{action:c,className:`mb-4`,children:(0,Z.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,Z.jsx)(Nt,{action:e.kind===`pr`?void 0:c,children:(0,Z.jsx)(Ot,{item:e,kindWord:d,commentCount:_,hasDiffStat:g,additions:m,deletions:h})}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,Z.jsx)(kt,{item:e,subNav:a,changes:u}),(0,Z.jsx)(At,{item:e,colors:t,checks:n}),u&&e.kind===`pr`?(0,Z.jsx)(Pt,{item:e}):(0,Z.jsx)(jt,{item:e,colors:t,body:p})]}),e.kind===`pr`?(0,Z.jsx)(_t,{number:e.number,onRunAgent:o}):null,l]})}function Nt({action:e,className:t,children:n}){return e?(0,Z.jsxs)(`div`,{"data-slot":`gh-header-row`,className:i(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,Z.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,Z.jsx)(`div`,{className:t,children:n}):(0,Z.jsx)(Z.Fragment,{children:n})}function Pt({item:e}){let t=d(),n=w(e.number),[a,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(null),u=n.data,f=e=>u?.available?u.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],p=f(a),m=p.some(e=>e.path===c)?c:p[0]?.path??null,g=p.findIndex(e=>e.path===m),v=e=>{s(e);let t=f(e),n=m??c,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==c&&l(r)},y=async()=>{let n=u?.available?u.headSha:null,r=_.githubPrChanges(e.number),i=await o(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(l(i.files[0]?.path??null),h(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!u)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!u.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:u.reason});let b=p.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),x=r(e.url)?`${e.url}/files`:null,S=p.find(e=>e.path===m);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[u.files.length,` changed files`]}),(0,Z.jsx)(Y,{adds:u.additions,dels:u.deletions}),(0,Z.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:u.headSha,children:[`head `,u.headSha.slice(0,8)]}),(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void y(),children:`Refresh`})]}),u.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[u.reason??`This response is incomplete.`,` `,x?(0,Z.jsx)(`a`,{href:x,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:a,onChange:e=>v(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsxs)(`div`,{className:`relative mt-2 lg:hidden`,children:[(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:m??``,onChange:e=>l(e.target.value),className:`min-h-11 w-full appearance-none rounded-md border border-input bg-background py-2 pr-8 pl-3 text-sm`,children:p.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(re,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e.path),className:i(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,m===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsx)(Y,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(B,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:g<=0,onClick:()=>l(p[g-1]?.path??null),children:(0,Z.jsx)(He,{})}),(0,Z.jsx)(B,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:g<0||g>=p.length-1,onClick:()=>l(p[g+1]?.path??null),children:(0,Z.jsx)(te,{size:16})})]}),p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Qe,{files:b.filter(e=>e.path===m),wrap:!0,className:`min-w-0`}),S&&!S.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,S.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Ft({item:e,colors:t}){let n=C(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(It(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(K,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(K,{className:`h-14 w-full`}),(0,Z.jsx)(K,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Lt(i).map(e=>e.group===`commits`?(0,Z.jsx)(Rt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(Yt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Bt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var It=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Lt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Rt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:zt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Bt,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:zt.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:W(e[e.length-1].createdAt)})]})})}var zt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Bt({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:i(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:zt[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Kt,{event:e,colors:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:W(e.createdAt)}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Vt({event:e}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(qt,{checks:e.checks})]})}function Ht({event:e,colors:t}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:xt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Ut({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Wt({event:e}){return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Gt={committed:e=>(0,Z.jsx)(Vt,{event:e}),labeled:(e,t)=>(0,Z.jsx)(Ht,{event:e,colors:t}),unlabeled:(e,t)=>(0,Z.jsx)(Ht,{event:e,colors:t}),assigned:e=>(0,Z.jsx)(Ut,{event:e}),unassigned:e=>(0,Z.jsx)(Ut,{event:e}),merged:()=>(0,Z.jsx)(`span`,{children:`merged this`}),closed:()=>(0,Z.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,Z.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,Z.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,Z.jsx)(Wt,{event:e})};function Kt({event:e,colors:t}){return Gt[e.kind]?.(e,t)??null}function qt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:i(`shrink-0`,Qt[e]),children:Zt[e]}):null}var Jt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Yt({comment:e}){let t=e.reviewState?Jt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Xt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(`span`,{children:W(e.createdAt)}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:i(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(z,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:Et,children:e.body?(0,Z.jsx)(Xe,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function Xt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:20,height:20,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-5 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-[11px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Zt={passing:`✓`,failing:`✗`,pending:`○`},Qt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function $t({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function en({checks:e,url:t}){let n=i(`text-[11px] font-medium`,Qt[e],t&&`hover:underline`),r=`${Zt[e]} checks ${e}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function tn({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:i(`shrink-0 font-sans text-[11px] font-semibold`,Qt[e]),children:Zt[e]})}function Q(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function nn(e,t=[]){let n=Q(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=rn(t)),n}function rn(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function an(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function on(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function sn(e,t,n){let r=(n??``).trim();if(!r)return nn(e,t);let i=Q(e),a=r.startsWith(i)?i+an(r.slice(i.length),e):an(r,e),o=on(a,e)?a:`${i}\n\n${a}`;return t.length?o+rn(t):o}function cn(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function ln(e,t,n,r,i={}){return t?{...i,workflow:t,task:sn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:cn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:sn(e,[],r)}:{...i,workflow:`quick-task`,task:sn(e,[],r)}}function un(e){let t=b(),n=S(),r=a(),{runners:i,uninstalled:o,signedOut:s,accounts:c,repoAccount:l,accountFor:u}=Ye(),d=n.data?.defaultRunner,f=Me(e.runner,i,d??i[0]??`claude`),p=n.data?.modelsLocked===!0,m=u(f,e.account),h=v(f,!0,m??l?.[f]),g=ke(p?null:e.model,f,r.data,n.data?.defaultModels,h.data),_=Ie(g,h.data);return{runner:f,runnerExplicit:e.runner!==null,model:g,effort:p?``:Re(e.effort,_),effortOptions:_,runners:i,uninstalled:o,signedOut:s,defaultRunner:d,canRun:t.isSuccess&&i.length>0,modelsLocked:p,providerPending:t.isPending,providerError:t.isError,accounts:c,account:m,repoAccount:l}}function dn(e){return{runner:Fe(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function fn(e){return{...dn(e),...e.account?{agentProfile:e.account}:{}}}function pn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>Je(t,e))}function mn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let o=(0,X.useRef)(null),s=(0,X.useRef)(null),[c,l]=(0,X.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,X.useLayoutEffect)(()=>{let e=o.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;s.current=n instanceof HTMLElement&&e.contains(n)?n:null,l(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,X.useLayoutEffect)(()=>{let e=s.current;s.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[c]);let u=un(e),{runner:d,model:f,effort:p,effortOptions:m,runners:h,canRun:g,modelsLocked:_}=u,y=S(),b=a(),x=v(d,!0,u.account??u.repoAccount?.[d]),C=Le(d,b.data,x.data,[e.model,y.data?.defaultModels?.[d]]),w=n||!g,T=r?u.accounts:[],E=pn(u,T)?(0,Z.jsx)(Pe,{icon:(0,Z.jsx)(M,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:h,uninstalled:u.uninstalled,signedOut:u.signedOut,value:d,accounts:T,account:r?u.account:null,repoAccount:r?u.repoAccount:void 0,disabled:w,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===d?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,D=(0,Z.jsx)(q,{icon:(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:f===``?`Default`:C.find(e=>e.id===f).label,value:f,disabled:w,readOnly:_===!0,disabledHint:_?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Ie(n,x.data);t({...e,model:n,effort:e.effort===null?null:Re(e.effort,r)})},options:C.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Ge(d,b.data,x)},`model`),O=(0,Z.jsx)(q,{icon:(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:m.find(e=>e.value===p)?.label??`auto`,value:p,disabled:w,readOnly:_===!0,disabledHint:_?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:m.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,Z.jsx)(`div`,{ref:o,"data-slot":`engine-row-box`,children:(0,Z.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,Z.jsx)(Ae,{fill:`model-pill`,children:c?[E,O,D]:[E,D,O]})})}):(0,Z.jsxs)(Ae,{children:[E,D,O]})}var hn={workflow:null,skills:[]},gn=`cez-followup-selection`;function _n(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.flatMap(e=>typeof e==`string`?[{id:e}]:!e||typeof e!=`object`||typeof e.id!=`string`?[]:[{id:e.id,...typeof e.path==`string`?{path:e.path}:{}}]):[]}}function vn(){try{let e=localStorage.getItem(gn);return e?_n(JSON.parse(e)):{...hn}}catch{return{...hn}}}function yn(e){try{localStorage.setItem(gn,JSON.stringify(e))}catch{}}var $=`cez-followup-prompt:`;function bn(e){try{return localStorage.getItem($+e)??``}catch{return``}}function xn(e,t){try{t===``?localStorage.removeItem($+e):localStorage.setItem($+e,t)}catch{}}function Sn({item:e,workflows:t,skills:n,workflow:i,onWorkflowChange:a,selectedSkills:o,onSkillsChange:s,engine:l,onEngineChange:f,queuedRunId:p,onQueued:m}){let g=d(),v=E(),b=e.kind===`pr`?`PR`:`issue`,S=un(l),C=x(S.runner,S.account),w=o.filter(e=>C.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),T=w.length!==o.length,[D]=(0,X.useState)(()=>Q(e)),[k,A]=(0,X.useState)(()=>bn(e.url)||D),j=(0,X.useRef)(null),M=(0,X.useRef)(null);(0,X.useEffect)(()=>{xn(e.url,k===D?``:k)},[e.url,k,D]);let N=(0,X.useMemo)(()=>Ke(v.data?.promptTemplates),[v.data?.promptTemplates]),P=e=>{let t=j.current,n=We({prompt:k,base:D,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:M.current}),r=Ue(k,n,e);A(r.text),M.current=r.caret,requestAnimationFrame(()=>{j.current?.focus(),j.current?.setSelectionRange(r.caret,r.caret)})},ee=Oe(N,w.map(e=>e.id)),F=(0,X.useRef)(k);F.current=k;let I=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=qe(F.current,I.current,ee,D);I.current=e.applied,e.text!==F.current&&A(e.text)},[ee,D]);let L=y({mutationFn:async()=>!S.canRun||T?null:u(ln(e,i,w,k,fn(S))),onSuccess:t=>{if(t===null)return;let n=t;n&&m(e.url,n.id),h(`Added to the queue — ${b} #${e.number}`),w.length>0&&v.data!==void 0&&c({skillUsage:w.reduce((e,t)=>Ee(e,t.id),v.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:_.uiState})).catch(()=>{}),xn(e.url,``),A(D),I.current=``,g.invalidateQueries({queryKey:_.runs.all})},onError:e=>h(e.message,{tone:`danger`})}),te=e=>{Be({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!L.isPending&&S.canRun&&L.mutate())},R=e=>s(o.some(t=>G(t)===G(e))?o.filter(t=>G(t)!==G(e)):[...o,Te(e)]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)(Ze,{ref:j,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:k,onChange:e=>A(e.target.value),onSelect:e=>{M.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(ze,{templates:N,onInsert:P}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(wn,{workflows:t,value:i,onChange:a})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(En,{skills:n,skillUsage:v.data?.skillUsage,selected:o,onToggle:R})]}),o.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:o.map(e=>(0,Z.jsx)(Cn,{skill:e,skills:n,unchecked:C.unchecked,onRemove:()=>R(e)},G(e)))}):null,T?(0,Z.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,Z.jsx)(mn,{layout:`row`,pick:l,onChange:f,disabled:L.isPending||!S.canRun,accounts:!0}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(Tn,{resolved:S,disabled:L.isPending||!S.canRun,onPick:e=>f({...l,account:e})})]}),!S.providerPending&&!S.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[S.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(V,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[r(e.url)?(0,Z.jsx)(B,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(B,{variant:`primary`,"data-action":`gh-run`,disabled:L.isPending||!S.canRun||T,onClick:()=>L.mutate(),children:[(0,Z.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,b]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Ve()}),p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(V,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function Cn({skill:e,skills:t,unchecked:n,onRemove:r}){let i=t.find(t=>t.id===e.id&&(e.path===void 0||t.path===e.path)),a=[i?.name??e.id,e.path].filter(Boolean).join(` · `),o=!n&&e.path!==void 0&&!i?` (unavailable)`:n||!i?` (unchecked)`:``;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e.id,onClick:r,title:`Remove skill ${a}`,"aria-label":`Remove skill ${a}`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[a,o,(0,Z.jsx)(A,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function wn({workflows:e,value:t,onChange:n}){let[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),c=(0,X.useRef)(null),l=xe(e,o);return(0,Z.jsxs)(ue,{open:r,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:i(Ne,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,Z.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,(0,Z.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,Z.jsxs)(U,{value:`workflow ${e.name}`,keywords:we(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Tn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:s,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,...e.configDir?{desc:e.configDir}:{}}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(q,{icon:(0,Z.jsx)(k,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function En({skills:e,skillUsage:t,selected:n,onToggle:r}){let[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=De(e,s,t),g=(e,t)=>{let a=n.some(t=>G(t)===G(e));return(0,Z.jsxs)(U,{value:G(e),keywords:we(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":a?`true`:void 0,onSelect:()=>r(Te(e)),children:[(0,Z.jsx)(`span`,{className:i(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,Z.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},G(e))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{skill:l,onClose:()=>u(null)}),(0,Z.jsxs)(ue,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,Z.jsx)(ce,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:i(Ne,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(le,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(be,{shouldFilter:!1,children:[(0,Z.jsx)(_e,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,Z.jsxs)(ye,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[s.trim()&&!e.some(e=>e.id===s.trim())?(0,Z.jsx)(H,{children:(0,Z.jsxs)(U,{value:`typed-skill`,onSelect:()=>r({id:s.trim()}),children:[`Use skill id “`,s.trim(),`” (unchecked)`]})}):null,(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,Z.jsx)(ve,{children:`Nothing matches.`}):null,h?h.length>0?(0,Z.jsx)(H,{children:h.map(e=>g(e,Se(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[f.length>0?(0,Z.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,Se(e)))}):null,p.length>0?(0,Z.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,Z.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var Dn=new WeakMap;function On(){let e=vn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&yn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function kn(){let e=d(),{projectId:t}=p(),n=Dn.get(e);n||Dn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=On());let{snapshot:i,subscribe:a,update:o}=r,s=(0,X.useSyncExternalStore)(a,i,i),c=g(),l=un(s.engine),u=x(l.runner,l.account),f=E(),m=c.data?.workflows;(0,X.useEffect)(()=>{m&&s.workflow!==null&&!m.some(e=>e.name===s.workflow)&&o({workflow:null})},[o,m,s.workflow]);let h=(0,X.useMemo)(()=>Ce(u.data??[],f.data?.skillUsage),[u.data,f.data?.skillUsage]);return{...s,workflows:c,skillList:h,skillsUnchecked:u.unchecked,setWorkflow:e=>o({workflow:e}),setSelectedSkills:e=>o({selectedSkills:e}),setEngine:e=>o({engine:e}),onQueued:(e,t)=>o({queued:new Map(i().queued).set(e,t)})}}export{$t as a,Lt as c,xt as d,bt as f,tn as i,vt as l,Sn as n,Mt as o,nn as r,St as s,kn as t,yt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./bundle-mjs-rHxsej31.js";var n=`/api/v1`,r=``;function i(e){r=e.replace(/\/+$/,``)}function a(){return r}var o=null;function s(e){o=e===``?null:e}function c(){return o}function l(){return o??`default`}var u=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function d(e){return`${r}${n}${f(e)}`}function f(e){return o===null||u.test(e)?e:`/p/${encodeURIComponent(o)}${e}`}var p=/^\/api(?:\/v1)?(\/.*)$/;function m(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=h(e.slice(r));return a===null?e:`${i}${a}`}let n=h(r&&e.startsWith(r)?e.slice(r.length):e);return n===null?e:`${r}${n}`}function h(e){let t=p.exec(e);if(!t)return null;let r=t[1];return r.startsWith(`/p/`)?`${n}${r}`:`${n}${f(r)}`}function g(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var _=t({extend:{classGroups:{shadow:[`shadow-modal`]}}});function v(...t){return _(e(t))}function y(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}export{d as a,l as c,s as d,n as i,m as l,y as n,a as o,g as r,c as s,v as t,i as u};
|
|
@@ -0,0 +1,7 @@
|
|
|
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-7pLJMOgh.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-CvVmG4Yu.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};
|
|
@@ -0,0 +1 @@
|
|
|
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}
|
|
@@ -0,0 +1 @@
|
|
|
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-7pLJMOgh.js";import{Gn as _,Qt as v,Un as y,Vn as b,Xt as x,Zt as S}from"./index-CvVmG4Yu.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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Fr as t,M as n,Nn as r,Pr as i,pi as a}from"./project-scope-context-Rv6S_BXt.js";import{n as o}from"./toaster-BXnLIU3z.js";import{Bt as s,Qt as c,_ as l,vt as u}from"./queries-qCF-eOqZ.js";import{u as d}from"./design-icons-CzEoMH9c.js";import{t as f}from"./button-B7MKxYjT.js";import{t as p}from"./project-router-CLJTc7gv.js";import{t as m}from"./centered-state-V15AR_qo.js";import{Qn as h,gn as g}from"./index-CvVmG4Yu.js";import{n as _,r as v,t as y}from"./remote-settings-notice-D7G8cXSx.js";import{n as b}from"./saved-draft-BwzBc-_Y.js";import{t as x}from"./save-cue-Cd3ZAPBS.js";import{n as S}from"./settings-field-DP9sYv5a.js";import{n as C}from"./project-location-BRxXN249.js";var w=e();function T({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,w.jsxs)(w.Fragment,{children:[t===0&&i===null?(0,w.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,w.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,w.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,w.jsxs)(w.Fragment,{children:[`the project’s `,(0,w.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,w.jsx)(`code`,{className:`break-all`,children:r}),` `,`on the machine running Squawk. `,e.fileEditApplies,` No restart is needed. To edit here, the host operator runs `,(0,w.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,w.jsxs)(`p`,{"data-slot":`${s}-issue`,className:`text-xs text-danger`,children:[`config.json has an invalid `,e.key,` (`,i,`) — saving replaces it.`]}),a===null?null:(0,w.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function E(e,n){let r=e.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(e=>e!==``),a=Number(n);return{commands:r,timeoutSeconds:a,invalid:r.length>20?`Enter at most 20 commands.`:r.some(e=>e.length>4e3)?`Keep each command under ${i.toLocaleString(`en-US`)} characters.`:n.trim()===``||!Number.isInteger(a)||a<1||a>7200?`Enter a whole number of seconds from 1 to ${t}.`:null}}var D={setup:{key:`worktreeSetup`,issueKey:`worktreeSetupIssue`,slot:`worktree-setup`,title:`Prepare new worktrees`,hint:`Runs in order in every new task and worker worktree before the agent starts. The first failure stops setup.`,empty:`No setup commands configured. No commands will run in new worktrees.`,label:`Worktree setup commands, one per line`,example:`npm ci`,fileEditApplies:`Valid file edits apply to new worktrees.`,saved:`Worktree setup saved`,cleared:`Worktree setup cleared`,save:`Save setup`},teardown:{key:`worktreeTeardown`,issueKey:`worktreeTeardownIssue`,slot:`worktree-teardown`,title:`Stop worker services before destroy`,hint:`Runs in order in a worker’s worktree when the worker is destroyed, before its processes stop. The first failure stops teardown; destroy goes on and records it on the worker.`,empty:`No teardown commands configured. Destroy runs no commands in worker worktrees.`,label:`Worktree teardown commands, one per line`,example:`docker compose down`,fileEditApplies:`Valid file edits apply to the next worker destroy.`,saved:`Worktree teardown saved`,cleared:`Worktree teardown cleared`,save:`Save teardown`}};function O(e,t){return t?`One command per line, for example: ${e.example}`:void 0}function k({config:e,copy:i}){let l=a(),d=u(),p=v(),m=C(),h=m===null?null:`${m.replace(/\/$/,``)}/.ai/cezar/config.json`,y=d.data?.capabilities?.settingsAdmin===!0,D=e[i.key],k=e[i.issueKey],A=D?.commands??[],j=D?.timeoutSeconds??900,[M,N]=b(A.join(`
|
|
3
|
+
`)),[P,F]=b(String(j)),{commands:I,timeoutSeconds:L,invalid:R}=E(M,P),z=I.length===A.length&&I.every((e,t)=>e===A[t])&&(I.length===0||L===j),B=k===null&&z;g(y&&!z);let V=c({mutationFn:e=>n(e),onSuccess:e=>{l.setQueryData(s.config,e),N(I.join(`
|
|
4
|
+
`)),o(I.length===0?i.cleared:i.saved)},onError:e=>{o(e.message,{tone:`danger`}),e instanceof r&&e.status===409&&p()}}),H=()=>V.mutate({[i.key]:I.length===0?null:{commands:I,...L===900?{}:{timeoutSeconds:L}}}),U=`block rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50 read-only:bg-muted read-only:text-muted-foreground`;return(0,w.jsxs)(S,{title:i.title,hint:i.hint,children:[(0,w.jsx)(_,{risk:`These commands run on the machine running Squawk`}),(0,w.jsxs)(T,{copy:i,savedCommandCount:A.length,settingsAdmin:d.data?.capabilities?.settingsAdmin,configPath:h,issue:k,invalid:R,children:[(0,w.jsx)(`textarea`,{"data-slot":`${i.slot}-commands`,"data-reports-dirty":``,"aria-label":i.label,rows:4,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,value:M,placeholder:O(i,y),readOnly:!y,disabled:V.isPending,onChange:e=>N(e.target.value),className:`${U} field-sizing-content min-h-24 max-h-[min(24rem,60dvh)] w-full resize-none overflow-y-auto font-mono text-[13px] leading-relaxed`}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(`span`,{children:`Timeout per command`}),(0,w.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:1,max:t,step:1,"data-slot":`${i.slot}-timeout`,"data-reports-dirty":``,value:P,readOnly:!y,disabled:V.isPending,onChange:e=>F(e.target.value),className:`${U} min-h-11 w-28 md:min-h-0`}),(0,w.jsx)(`span`,{children:`seconds`})]}),(0,w.jsx)(x,{show:y&&B&&!V.isPending,children:(0,w.jsx)(f,{type:`button`,variant:`primary`,size:`sm`,className:`min-h-11 md:min-h-0`,"data-action":`${i.slot}-save`,disabled:!y||B||R!==null||V.isPending,onClick:H,children:i.save})})]})]})]})}var A=0,j=1e3;function M(){let e=l();return e.isPending?(0,w.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading worktree settings…`}):e.isError?(0,w.jsx)(m,{icon:(0,w.jsx)(h,{}),tone:`danger`,title:`Worktree settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,w.jsx)(N,{config:e.data})}function N({config:e}){let t=a(),r=c({mutationFn:e=>n(e),onSuccess:e=>t.setQueryData(s.config,e),onError:e=>o(e.message,{tone:`danger`})}),[i,l]=b(String(e.worktreeRetention)),u=Number(i),m=i.trim()===``||!Number.isInteger(u)||u<A||u>j,h=e.worktreeRetention===(m?-1:u);return g(!h),(0,w.jsxs)(`div`,{"data-slot":`worktrees-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,w.jsxs)(S,{title:`Keep N finished worktrees`,hint:`Older finished worktrees are removed to free disk; their branch stays, so the work is recoverable. 0 keeps all. Running and in-review tasks are never removed.`,children:[(0,w.jsxs)(`div`,{"data-reports-dirty":``,className:`flex items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:A,max:j,step:1,"aria-label":`Keep last N finished worktrees`,"data-slot":`resources-worktree-retention`,value:i,disabled:r.isPending,onChange:e=>l(e.target.value),className:`block w-32 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`worktrees`}),(0,w.jsx)(x,{show:h&&!m&&!r.isPending,children:(0,w.jsx)(f,{type:`button`,variant:`primary`,size:`sm`,"data-action":`resources-save-retention`,disabled:h||m||r.isPending,onClick:()=>r.mutate({worktreeRetention:u},{onSuccess:()=>{t.invalidateQueries({queryKey:s.worktrees}),o(u===0?`Keeping all worktrees (unlimited)`:`Keeping the last ${u} finished worktree${u===1?``:`s`}`)}}),children:`Save retention`})})]}),m?(0,w.jsxs)(`p`,{"data-slot":`resources-retention-invalid`,className:`text-xs text-danger`,children:[`Enter a whole number from `,A,` to `,j,` (0 = unlimited).`]}):(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u===0?`Keeping every finished worktree.`:`Keeping the last ${u} finished worktree${u===1?``:`s`} on disk.`})]}),(0,w.jsx)(k,{config:e,copy:D.setup}),(0,w.jsx)(k,{config:e,copy:D.teardown}),(0,w.jsxs)(p,{to:`/git/cleanup`,"data-slot":`worktrees-manage-link`,className:`inline-flex min-h-11 items-center gap-1 self-start text-[13px] font-medium text-link-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring md:min-h-0`,children:[`Manage worktrees on Git`,(0,w.jsx)(d,{"aria-hidden":`true`,className:`size-[14px]`})]})]})}export{M as WorktreesSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,t as a}from"./utils-DSMR_WLb.js";var o=e(t(),1),s=e(n(),1),c=r();function l({src:e,alt:t=``,className:n,...r}){let[l,u]=(0,o.useState)(!1),d=i(e);return(0,o.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`img`,{...r,src:d,alt:t,loading:`lazy`,onClick:()=>u(!0),className:a(`cursor-zoom-in`,n)}),l?(0,s.createPortal)((0,c.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>u(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,c.jsx)(`img`,{src:d,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}export{l as t};
|
package/web/dist/index.html
CHANGED
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
the light mark before first paint when the resolved theme is light. ThemeProvider keeps
|
|
14
14
|
it in sync after that (applyFaviconTheme) — the swap must not need a reload. -->
|
|
15
15
|
<link rel="icon" href="/cezarion-mark-dark.svg" />
|
|
16
|
+
<!-- Home-screen install. The manifest scopes the app to `/`, so opening another project stays
|
|
17
|
+
inside the app instead of showing browser chrome. iOS reads the apple-* tags and takes
|
|
18
|
+
its touch icon only from a PNG. theme-color paints the status bar area; the script below
|
|
19
|
+
sets a first guess and applyThemeColor() in src/lib/theme.ts sets the `--card` token. -->
|
|
20
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
21
|
+
<link rel="apple-touch-icon" href="/app-icon.png" />
|
|
22
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
23
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
24
|
+
<meta name="theme-color" content="#202224" />
|
|
16
25
|
<title>Squawk</title>
|
|
17
26
|
<!-- Theme before first paint — no flash. Mirrors resolveTheme()/applyResolvedTheme() +
|
|
18
27
|
applyFaviconTheme() in src/lib/theme.ts; keep the two in sync. Shares the legacy
|
|
@@ -30,6 +39,9 @@
|
|
|
30
39
|
// The themed tab icon (#143) — same resolved value as the class above.
|
|
31
40
|
var icon = document.querySelector('link[rel="icon"]')
|
|
32
41
|
if (icon) icon.href = light ? '/cezarion-mark-light.svg' : '/cezarion-mark-dark.svg'
|
|
42
|
+
// The status bar color: --card in src/styles/index.css, until applyThemeColor() runs.
|
|
43
|
+
var themeColor = document.querySelector('meta[name="theme-color"]')
|
|
44
|
+
if (themeColor) themeColor.content = light ? '#ffffff' : '#202224'
|
|
33
45
|
} catch (e) {
|
|
34
46
|
// Storage or matchMedia unavailable — the default dark tokens already apply.
|
|
35
47
|
}
|
|
@@ -47,42 +59,65 @@
|
|
|
47
59
|
}
|
|
48
60
|
})()
|
|
49
61
|
</script>
|
|
50
|
-
<script type="module" crossorigin src="/assets/index-
|
|
62
|
+
<script type="module" crossorigin src="/assets/index-CvVmG4Yu.js"></script>
|
|
51
63
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
52
64
|
<link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
|
|
53
|
-
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
55
|
-
<link rel="modulepreload" crossorigin href="/assets/live-protocol-
|
|
56
|
-
<link rel="modulepreload" crossorigin href="/assets/project-scope-context-
|
|
57
|
-
<link rel="modulepreload" crossorigin href="/assets/live-
|
|
58
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
59
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
60
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
61
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
64
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
65
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
66
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
65
|
+
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-rHxsej31.js">
|
|
66
|
+
<link rel="modulepreload" crossorigin href="/assets/utils-DSMR_WLb.js">
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/live-protocol-DMhTnCmf.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/project-scope-context-Rv6S_BXt.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/assets/live-reads-Crd6fVGH.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/toaster-BXnLIU3z.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/queries-qCF-eOqZ.js">
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-KS7C4IRE-Cg8l-LDN.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/cez-idle-CdswdDRd.js">
|
|
75
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BW234Kg5.js">
|
|
76
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-C5mlVBmd.js">
|
|
77
|
+
<link rel="modulepreload" crossorigin href="/assets/label-Bt8n7Spq.js">
|
|
78
|
+
<link rel="modulepreload" crossorigin href="/assets/attention-CBCeJN5w.js">
|
|
79
|
+
<link rel="modulepreload" crossorigin href="/assets/task-groups-4tzKGROI.js">
|
|
80
|
+
<link rel="modulepreload" crossorigin href="/assets/tasks-table-C5uoZMFs.js">
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/design-icons-CzEoMH9c.js">
|
|
68
82
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
75
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
76
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
77
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
78
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
79
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/bot-TkDIw4y-.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-BE6y205O.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/folder-o-AvL3y3.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/smartphone-Lr8Ug2z_.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/square-terminal-B6RYYieR.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/button-B7MKxYjT.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/es2015-CQth82uv.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-DXO3xwbC.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BAoXdNsT.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/dropdown-menu-4e2iKSMT.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/own-lookup-DS54wXvD.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/open-in-menu-BPp88ouw.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/check-OP-CVgZG.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-down-CHGyCDBH.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/nav-row-styles-DKeXbc4N.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-right-BENZ-1ZN.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/folder-browser-B7IbnF0d.js">
|
|
80
100
|
<link rel="modulepreload" crossorigin href="/assets/eye-B8okNWXU.js">
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
84
|
-
<link rel="
|
|
85
|
-
<link rel="
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/loader-circle-CPBhhDbB.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/play-CmVAj_fu.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/popover-BPgUYFyu.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/reference-chip-D0v0keVC.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-Da4ckcJG.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-Czz3Y5qH.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/switch-SP8pw5uU.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/badge-DQ3U69Ht.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/dialog-B531GGAo.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/project-router-CLJTc7gv.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/status-dot-BRzVlF2X.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/command-KdW7aO0N.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/format-BU7D3IfE.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/project-order-AcHI4Dcl.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/skills-pM_PouEs.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/agents-settings-path-7X6_cvUg.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/page-shell-7pLJMOgh.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/centered-state-V15AR_qo.js">
|
|
119
|
+
<link rel="stylesheet" crossorigin href="/assets/page-shell-DQPYcKyL.css">
|
|
120
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C69_Sk06.css">
|
|
86
121
|
</head>
|
|
87
122
|
<body>
|
|
88
123
|
<div id="root"></div>
|
package/web/dist/live-worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as e,l as t,s as n,t as r}from"./assets/live-protocol-DMhTnCmf.js";import{n as i}from"./assets/cez-idle-CdswdDRd.js";var a=new Set;function o(e,t){t?a.add(e):a.delete(e),i(`ws`,a.size>0)}var s=`/api/v1/ws`,c=3e3,l=1e3,u=7e4,d=0,f=1;function p(e,t={}){let n=new Map,r=new Set,i={},a=!1,p=!1,m=0,h=!1,g=null,_,v,y,b=()=>{o(i,a||r.size>0)},x=()=>{clearTimeout(y),y=setTimeout(()=>{y=void 0,g?.close()},u)},S=()=>e??`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${s}`,C=e=>{g?.readyState===f&&g.send(JSON.stringify(e))},w=()=>{let e=globalThis.WebSocket;if(typeof e!=`function`||g&&(g.readyState===d||g.readyState===f))return;let i=new e(S());g=i,a=!0,b(),i.addEventListener(`open`,()=>{if(i===g){a=!1;for(let e of n.keys())r.add(e);b(),x();for(let e of n.keys())C({type:`subscribe`,topic:e})}}),i.addEventListener(`message`,e=>{if(i!==g)return;x(),p=!0,m=0;let t;try{t=JSON.parse(e.data)}catch{return}if(typeof t!=`object`||!t)return;let{type:a,topic:o,data:s}=t;if(a!==`event`||typeof o!=`string`)return;let c=n.get(o);if(c){r.delete(o),b();for(let e of[...c])e(s)}}),i.addEventListener(`close`,()=>{if(i===g){if(g=null,a=!1,b(),clearTimeout(y),y=void 0,!p&&t.onRefused&&++m>=(t.connectAttempts??1)){h=!0,t.onRefused();return}n.size>0&&_===void 0&&(_=setTimeout(()=>{_=void 0,n.size>0&&w()},c))}}),i.addEventListener(`error`,()=>void 0)};return{subscribe(e,t){let i=n.get(e);i||(i=new Set,n.set(e,i));let a=i.size===0;i.add(t),a&&r.add(e),b(),clearTimeout(v),v=void 0,!g&&!h?(clearTimeout(_),_=void 0,w()):a&&C({type:`subscribe`,topic:e});let o=!0;return()=>{o&&(o=!1,i.delete(t),!(i.size>0)&&(n.delete(e),r.delete(e),b(),C({type:`unsubscribe`,topic:e}),n.size===0&&h&&(h=!1,m=0),n.size===0&&v===void 0&&(v=setTimeout(()=>{v=void 0,!(n.size>0)&&(clearTimeout(_),_=void 0,clearTimeout(y),y=void 0,g?.close(),g=null,p=!1,m=0)},l))))}}}}function m(e,t){t.type===`ack`&&t.seq<=e.sent&&t.seq>e.ack&&(e.ack=t.seq,e.unacked=e.unacked.filter(n=>n.seq>t.seq?!0:(e.bytes-=n.bytes,!1))),t.type===`ack-snapshot`&&(e.bytes=Math.max(0,e.bytes-(e.unackedSnapshots.shift()??0)))}var h=1e4;function g(e){let i=new Set,a={workspace:{signature:``,lastFrame:0,proven:!1,failures:0,startedAt:0},runs:{signature:``,lastFrame:0,proven:!1,failures:0,startedAt:0}},o=new Map,s=new Map,c=new Map,l,u=!1,d=!1,f=!1,p=!1,g,_,v=0,y=(e,t,n=v)=>{_===void 0||e.readyGeneration===_||(e.readyGeneration=_,k(e,t,{event:`ready`,data:JSON.stringify({generation:_,seq:n}),id:``}))},b=e=>{`event`in e&&e.event===`ping`&&(f=!0);let t=v,n=x(e);for(let{doc:r,entry:i}of S(`workspace`))n===void 0?y(r,i,t):r.readyGeneration=n,k(r,i,e)},x=e=>{if(!(!(`data`in e)||![`ready`,`run-summary`,`run-deleted`].includes(e.event)))try{let t=JSON.parse(e.data);if(e.event===`ready`&&typeof t.generation==`string`&&typeof t.seq==`number`)return _=t.generation,v=t.seq,t.generation;typeof t.seq==`number`&&(v=Math.max(v,t.seq))}catch{}},S=e=>[...i].flatMap(t=>[...t.entries.values()].filter(t=>!t.paused&&(!e||t.demand.kind===e)).map(e=>({doc:t,entry:e}))),C=(e,t)=>{try{e.port.postMessage(t)}catch{B(e)}},w=!1,T=e=>{e===`live channel refused`&&(w=!0);for(let t of[...i])C(t,{type:`unavailable`,version:4,epoch:t.epoch,reason:e}),B(t)},E=e=>{e instanceof Error&&e.message===`authentication required`&&T(e.message)},D=(e,t,n=!1)=>{let i=a[e];if((n||!i.proven)&&++i.failures>=3){T(r);return}t()},O=(e,t,n)=>{t.paused=!0,t.unacked=[],t.unackedSnapshots=[],t.bytes=0,C(e,{type:`reset`,version:4,epoch:e.epoch,id:t.id,reason:n}),z()},k=(e,t,n)=>{if(`type`in n&&(n.type===`event`||n.type===`snapshot`)){if(n.type===`event`&&n.event.seq<=t.sent)return;let r=new TextEncoder().encode(JSON.stringify(n)).length;if(t.bytes+r>1048576){O(e,t,`subscriber fell behind — reload history`);return}t.bytes+=r,n.type===`snapshot`?t.unackedSnapshots.push(r):(t.sent=n.event.seq,t.unacked.push({seq:t.sent,bytes:r}))}C(e,{type:`frame`,version:4,epoch:e.epoch,id:t.id,frame:n})},A=e=>{let t=g!==void 0&&e!==g;if(g=e,t)for(let{doc:e,entry:t}of S())O(e,t,`server restarted`)},j=e=>{clearTimeout(e.retry),e.retry=void 0;let t=e.controller;e.controller=void 0,t?.abort()},M=n=>{let r=a[n];if(!r.signature||d)return;j(r);let i=new AbortController;if(r.controller=i,r.lastFrame=r.startedAt=Date.now(),n===`workspace`){if(f||p)for(let{doc:e,entry:t}of S(`workspace`))k(e,t,{event:`reconnect`,data:``,id:``});f=!1,p=!1}let o=new Map;if(n===`runs`)for(let{entry:e}of S(`run`)){let n=e.demand,r=o.get(t(n));if(!r||e.ack<r.afterSeq){let{kind:r,...i}=n;o.set(t(i),{...i,afterSeq:e.ack})}}e.stream(n,[...o.values()],e=>{if(!(r.controller!==i||i.signal.aborted)){if(r.lastFrame=Date.now(),r.proven=!0,r.lastFrame-r.startedAt>=h&&(r.failures=0),`type`in e&&e.type===`ready`&&A(e.generation),`data`in e&&e.event===`ready`)try{let t=JSON.parse(e.data);typeof t.generation==`string`&&A(t.generation)}catch{}if(n===`workspace`){b(e);return}for(let{doc:n,entry:r}of S(`run`))r.demand.kind===`run`&&`type`in e&&`runId`in e&&t(e)!==t(r.demand)||k(n,r,e)}},i.signal).catch(E).finally(()=>{if(!(r.controller!==i||i.signal.aborted||d)){if(r.controller=void 0,n===`workspace`&&f){for(let{doc:e,entry:t}of S(`workspace`))k(e,t,{event:`disconnect`,data:``,id:``});f=!1,p=!0}D(n,()=>{r.retry=setTimeout(()=>{r.retry=void 0,M(n)},1500)})}})},N=(t,n)=>{clearTimeout(n.timer),n.timer=void 0;let r=++n.revision;n.controller.abort(),n.controller=new AbortController,clearTimeout(n.deadline);let i=n.controller,a=n.deadline=setTimeout(()=>i.abort(),1e4);e.read(t,n.controller.signal).then(e=>{if(!(c.get(t)!==n||r!==n.revision))for(let{doc:n,entry:r}of S(`read`))r.demand.kind===`read`&&r.demand.path===t&&C(n,{type:`value`,version:4,epoch:n.epoch,id:r.id,...e})}).catch(E).finally(()=>{clearTimeout(a),c.get(t)===n&&r===n.revision&&(n.deadline=void 0,n.nextAt=Date.now()+n.interval,n.timer=setTimeout(()=>N(t,n),n.interval))})},P=()=>{let e=new Set;for(let{doc:n,entry:r}of S(`run`)){let i=t(r.demand);!e.has(i)&&e.size>=32?O(n,r,`shared task capacity reached`):e.add(i)}},F=e=>{let t={workspace:e.length?`workspace`:``,runs:S(`run`).map(({doc:e,entry:t})=>`${e.id}:${e.epoch}:${t.id}`).sort().join(`|`)};for(let e of[`workspace`,`runs`]){let n=a[e];if(n.signature!==t[e]){if(n.signature=t[e],j(n),n.signature){M(e);continue}n.proven=!1,n.failures=0,e===`workspace`&&(f=!1)}}},I=()=>{let t=new Set(S(`topic`).map(({entry:e})=>e.demand.topic));for(let[e,n]of o)t.has(e)||(n(),o.delete(e),s.delete(e));for(let n of t)o.has(n)||o.set(n,e.topic(n,e=>{s.set(n,e);for(let{doc:t,entry:r}of S(`topic`))r.demand.kind===`topic`&&r.demand.topic===n&&C(t,{type:`value`,version:4,epoch:t.epoch,id:r.id,value:e})}))},L=()=>{let e=new Map;for(let{entry:t}of S(`read`))t.demand.kind===`read`&&e.set(t.demand.path,Math.min(e.get(t.demand.path)??1/0,t.demand.intervalMs));for(let[t,n]of c)e.has(t)||(c.delete(t),clearTimeout(n.timer),clearTimeout(n.deadline),n.controller.abort());for(let[t,n]of e){let e=c.get(t);if(e){n<e.interval&&e.timer&&(clearTimeout(e.timer),e.nextAt=Math.min(e.nextAt,Date.now()+n),e.timer=setTimeout(()=>N(t,e),Math.max(0,e.nextAt-Date.now()))),e.interval=n;continue}let r={controller:new AbortController,revision:0,interval:n,nextAt:Date.now()+n};c.set(t,r),r.timer=setTimeout(()=>N(t,r),n)}},R=()=>{if(u=!1,d)return;let e=S(`workspace`);P(),F(e),I(),L(),i.size||(clearInterval(l),l=void 0)};function z(){!u&&!d&&(u=!0,queueMicrotask(R))}function B(e){i.delete(e),e.port.onmessage=null,e.port.onmessageerror=null;try{e.port.close()}catch{}z()}let V=(e,t)=>(t&&(e.readyGeneration=void 0),![...e.entries.values()].some(e=>e.demand.kind===`workspace`)),H=(e,t)=>{let n=[...t.values()].find(e=>e.demand.kind===`workspace`&&!e.paused);n&&y(e,n)},U=e=>{let t=e.demand.kind===`run`?e.demand.afterSeq:0;return{...e,sent:t,ack:t,unacked:[],unackedSnapshots:[],bytes:0,paused:!1}},W=(e,t,n)=>{let r=t.demand;r.kind===`topic`&&s.has(r.topic)&&C(e,{type:`value`,version:4,epoch:e.epoch,id:t.id,value:s.get(r.topic)}),r.kind===`workspace`&&n&&(e.readyGeneration=void 0),r.kind===`workspace`&&f&&(y(e,t),k(e,t,{event:`ping`,data:``,id:``}))};return{attach:e=>{if(d||i.size>=128)return e.close(),()=>{};let t={port:e,id:``,epoch:-1,seenAt:Date.now(),entries:new Map};return i.add(t),e.onmessageerror=()=>B(t),e.onmessage=({data:e})=>{let i=n.safeParse(e);if(!i.success){B(t);return}let a=i.data;if(!(t.id&&a.documentId!==t.id||a.epoch<t.epoch)){if(a.type===`sync`){if(w){C(t,{type:`unavailable`,version:4,epoch:a.epoch,reason:r}),B(t);return}t.id=a.documentId;let e=t.epoch!==a.epoch;t.epoch=a.epoch,t.seenAt=Date.now();let n=new Map,i=V(t,a.workspaceReady);for(let r of a.entries){let a=e?void 0:t.entries.get(r.id),o=a??U(r);n.set(r.id,o),a||W(t,o,i)}if(H(t,n),t.entries=n,!n.size){B(t);return}C(t,{type:`alive`,version:4,epoch:t.epoch}),z()}else if(a.epoch===t.epoch){let e=t.entries.get(a.id);if(!e)return;if((a.type===`ack`||a.type===`ack-snapshot`)&&m(e,a),a.type===`refresh`&&e.demand.kind===`read`){let t=c.get(e.demand.path);t&&N(e.demand.path,t)}}}},e.start(),C(t,{type:`hello`,version:4}),l??=setInterval(()=>{for(let e of[...i])Date.now()-e.seenAt>=15e3&&B(e);for(let e of[`workspace`,`runs`])a[e].controller&&Date.now()-a[e].lastFrame>=4e4&&D(e,()=>M(e),!0)},1e3),()=>B(t)},refuse(){T(r)},dispose(){d=!0;for(let e of[...i])B(e);for(let e of Object.values(a))j(e);for(let e of o.values())e();o.clear(),s.clear();for(let e of c.values())clearTimeout(e.timer),clearTimeout(e.deadline),e.controller.abort();c.clear(),clearInterval(l),l=void 0}}}async function _(e,t,n){if(!e.ok||!e.body)throw Error(`live stream HTTP ${e.status}`);let r=e.body.getReader(),i=new TextDecoder,a=new TextEncoder,o=``,s=[],c=``,l=``,u=0,d=()=>{r.cancel().catch(()=>{})};n.addEventListener(`abort`,d,{once:!0});let f=(e,n)=>{if(u+=a.encode(e).length+n,u>1048576)throw Error(`SSE frame exceeds limit`);if(e===``){s.length&&t({event:c||`message`,data:s.join(`
|
|
2
2
|
`),id:l}),s=[],c=``,u=0;return}if(e.startsWith(`:`))return;let r=e.indexOf(`:`),i=r<0?e:e.slice(0,r),o=r<0?``:e.slice(r+1).replace(/^ /,``);i===`data`?s.push(o):i===`event`?c=o:i===`id`&&!o.includes(`\0`)&&(l=o)};try{for(;;){n.throwIfAborted();let{done:e,value:t}=await r.read();if(e)break;o+=i.decode(t,{stream:!0});let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(t!==`
|
|
3
3
|
`&&t!==`\r`)continue;if(t===`\r`&&e===o.length-1)break;let n=t===`\r`&&o[e+1]===`
|
|
4
|
-
`;f(o.slice(s,e),n?2:1),n&&e++,s=e+1}if(o=o.slice(s),a.encode(o).length+u>1048576)throw Error(`SSE frame exceeds limit`)}n.throwIfAborted()}finally{n.removeEventListener(`abort`,d),await r.cancel().catch(()=>{}),r.releaseLock()}}var
|
|
4
|
+
`;f(o.slice(s,e),n?2:1),n&&e++,s=e+1}if(o=o.slice(s),a.encode(o).length+u>1048576)throw Error(`SSE frame exceeds limit`)}n.throwIfAborted()}finally{n.removeEventListener(`abort`,d),await r.cancel().catch(()=>{}),r.releaseLock()}}var v=p(void 0,{connectAttempts:3,onRefused:()=>y.refuse()}),y=g({async stream(t,n,r,i){let a=await fetch(t===`workspace`?`/api/v1/workspace/events?runs=summary`:`/api/v1/workspace/run-events`,{credentials:`include`,signal:i,...t===`runs`?{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({runs:n})}:{}});if(a.status===401||a.status===403)throw Error(`authentication required`);await _(a,n=>{if(t===`workspace`){r(n);return}if(n.event===`live`)try{let t=e.safeParse(JSON.parse(n.data));t.success&&r(t.data)}catch{}},i)},topic:(e,t)=>v.subscribe(e,t),async read(e,t){let n=await fetch(e,{credentials:`include`,signal:t});if(n.status===401||n.status===403)throw Error(`authentication required`);if(!n.ok)throw Error(`HTTP ${n.status}`);return{value:await n.json()}}}),b=globalThis;b.onconnect=e=>{let t=e.ports[0];t&&y.attach(t)};
|