@hearsay-tools/squawk 0.19.0-dev.9180 → 0.19.0-dev.9184
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/dist/ci-wait/controller.d.ts +7 -7
- package/dist/delegation/routes.d.ts +78 -78
- package/dist/features/hosts/routes.d.ts +64 -64
- package/dist/features/reports/routes.d.ts +2 -2
- package/dist/features/webhooks/routes.d.ts +38 -38
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/models-routes.d.ts +12 -12
- package/dist/server/projects-routes.d.ts +41 -41
- package/dist/server/providers-routes.d.ts +58 -58
- package/dist/server/repo-routes.d.ts +13 -13
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +312 -312
- package/dist/server/server.d.ts +58 -58
- package/dist/server/workspace-live-routes.d.ts +5 -5
- package/dist/server/workspace-routes.d.ts +85 -85
- package/package.json +4 -4
- package/web/dist/assets/{accounts-section-BDUoikVg.js → accounts-section-DYQC-wSh.js} +1 -1
- package/web/dist/assets/{activity-motion-CYdEr0hu.js → activity-motion-XvrmbNgR.js} +1 -1
- package/web/dist/assets/{activity-route-D8BPLoZj.js → activity-route-Dj8ltoqG.js} +1 -1
- package/web/dist/assets/{agent-config-section-BO8w2cry.js → agent-config-section-D16TRCE_.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BBcv7Vbh.js → agent-defaults-section-Dm0khLjs.js} +1 -1
- package/web/dist/assets/{appearance-yF_NXlq5.js → appearance-CP6zVctf.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-Dh1M21D6.js → archive-on-merge-field-BA8aUtRQ.js} +1 -1
- package/web/dist/assets/{ask-card-2E9m5VRA.js → ask-card-CLdlwd68.js} +1 -1
- package/web/dist/assets/{automations-route-D27bK2j6.js → automations-route-BVDO_Kai.js} +1 -1
- package/web/dist/assets/{commit-list-sFxchD2V.js → commit-list-Bdekr2K7.js} +1 -1
- package/web/dist/assets/{diff-C5-32cRp.js → diff-Du0FsqAK.js} +2 -2
- package/web/dist/assets/{diff-controls-Ci36iPlK.js → diff-controls-DTC_6oqk.js} +1 -1
- package/web/dist/assets/{diff-view-CCtuYJNL.js → diff-view-TKooupFV.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-BACqR1hj.js → discard-changes-dialog-Bg-3Xbox.js} +1 -1
- package/web/dist/assets/{file-preview-B7T7jFYo.js → file-preview-DMJCprVk.js} +1 -1
- package/web/dist/assets/{git-toolbar-UkRnjuDs.js → git-toolbar-COhBdctn.js} +1 -1
- package/web/dist/assets/{github-CkbZgMnJ.js → github-DUTSv2Hs.js} +1 -1
- package/web/dist/assets/{global-activity-route-j37l-BQU.js → global-activity-route-CypEKUv_.js} +1 -1
- package/web/dist/assets/{index-DkQ5xrLr.js → index-BV3EQb9T.js} +4 -4
- package/web/dist/assets/index-Bh7COq0B.css +1 -0
- package/web/dist/assets/{markdown-FIfZPsax.js → markdown-0uCxcToP.js} +1 -1
- package/web/dist/assets/{option-select-DylfDjGi.js → option-select-DQJEHmHf.js} +1 -1
- package/web/dist/assets/{preferences-section-DjWfc1i-.js → preferences-section-Cvl5vyfN.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-CfiPFvTH.js → preview-pane-connected-i3GJtDL3.js} +1 -1
- package/web/dist/assets/{project-location-CEX0-MZp.js → project-location-BcjOhqun.js} +1 -1
- package/web/dist/assets/{projects-section-Czmf0wFK.js → projects-section-CAOFPkDQ.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-DK4CV73w.js → prompt-templates-section-BXTfLET4.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-Dott-jyP.js → remote-settings-notice-CUK4ZFYF.js} +1 -1
- package/web/dist/assets/{repo-git-Djt3N2wP.js → repo-git-Dx85MEuK.js} +1 -1
- package/web/dist/assets/{report-reader-CrdDix7Z.js → report-reader-BDdY5kpz.js} +1 -1
- package/web/dist/assets/{reports-Iw4LUvz2.js → reports-DWKpm_us.js} +1 -1
- package/web/dist/assets/{resources-section-D3wUzdUQ.js → resources-section-D9tzbv9w.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-xyC7GvRB.js → review-notes-drafts-BSkmq3Nj.js} +1 -1
- package/web/dist/assets/{review-panel-3x_2lbej.js → review-panel-C9UZjWFl.js} +1 -1
- package/web/dist/assets/{review-strip-CDYpq9_S.js → review-strip-qTG5JaOw.js} +1 -1
- package/web/dist/assets/{run-header-DZ0rkryR.js → run-header-BrUcSJu6.js} +1 -1
- package/web/dist/assets/{select-DC_G2no3.js → select-BUsS7uOZ.js} +1 -1
- package/web/dist/assets/{session-context-section-DEUv-ISr.js → session-context-section-Bgzou-NG.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-BrFN2RaQ.js → settings-agent-picker-CH3CQhOh.js} +1 -1
- package/web/dist/assets/{settings-save-bar-C0pFHqte.js → settings-save-bar-cyvALSgW.js} +1 -1
- package/web/dist/assets/{settings-shell-BWWbVxv-.js → settings-shell-Cl-cu4r5.js} +1 -1
- package/web/dist/assets/{sidebar-section-BGo1zjJt.js → sidebar-section-Cj2fDrhV.js} +1 -1
- package/web/dist/assets/{skills-qFMQz6sm.js → skills-DLMbRR_5.js} +1 -1
- package/web/dist/assets/{task-changes-DKJHAtKC.js → task-changes-ito4fOGh.js} +1 -1
- package/web/dist/assets/{task-commits-Dtt60D0o.js → task-commits-BYOIU9zy.js} +1 -1
- package/web/dist/assets/{task-file-scope-FTt7SiGn.js → task-file-scope-B8EEJyHp.js} +1 -1
- package/web/dist/assets/{task-files-DVz4222z.js → task-files-CF0QKnm-.js} +1 -1
- package/web/dist/assets/{task-github-item-CJpKQ6cU.js → task-github-item-C6Fu8MvM.js} +1 -1
- package/web/dist/assets/{task-thread-DiYtqka4.js → task-thread-BWrvepxB.js} +1 -1
- package/web/dist/assets/{thread-state-pO7Wy_7R.js → thread-state-8E0eYXGu.js} +1 -1
- package/web/dist/assets/{use-finish-run-5S30Eu3d.js → use-finish-run-a2qZy6zr.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-BB_VmbF7.js → use-hand-to-agent-state-DT1ngmHe.js} +1 -1
- package/web/dist/assets/use-path-bases-CZ6F93wt.js +1 -0
- package/web/dist/assets/{workflows-DLuBawpi.js → workflows-2e0Sm6F1.js} +1 -1
- package/web/dist/assets/{workspace-tools-D4jshe-2.js → workspace-tools-D4DO9w12.js} +1 -1
- package/web/dist/assets/{worktrees-section-CESTBOem.js → worktrees-section-8-d6zWQ-.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BVRdRJAN.css +0 -1
- package/web/dist/assets/use-path-bases-npA-uKvg.js +0 -1
package/web/dist/assets/{use-hand-to-agent-state-BB_VmbF7.js → use-hand-to-agent-state-DT1ngmHe.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Gt as r,O as i,St as a,Vt as o,d as s,en as c,g as l,i as u,in as d,k as f,s as p,un as m}from"./queries-D9mg7sFY.js";import{Fi as h,R as g,Wn as _,X as v,Z as y,a as b,lt as ee,n as x,tt as S,wi as C}from"./toaster-2ud_VdfV.js";import{o as w,s as T}from"./dist-CCX8mhHc.js";import{t as E}from"./host-storage-B72yoDU1.js";import{A as D,Z as O,_ as k,b as A,ct as j,d as te,ft as M,h as N,l as P,mt as F,ot as I,r as ne,rt as L,u as re,ut as ie}from"./design-icons-QbNMZniQ.js";import{t as R}from"./external-link-BE6y205O.js";import{t as ae}from"./eye-B8okNWXU.js";import{t as oe}from"./loader-circle-CPBhhDbB.js";import{t as se}from"./message-square-B-MD-8rD.js";import{t as ce}from"./play-CmVAj_fu.js";import{t as z}from"./button-BV_AiLj2.js";import{i as le,r as ue,t as de}from"./popover-BQolmvDR.js";import{a as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./dialog-DKr-j9S6.js";import{t as B}from"./project-router-CwD1firw.js";import{a as ve,i as V,o as H,r as ye,s as be,t as xe}from"./command-4D8sPZJy.js";import{d as Se,f as U,i as Ce,o as we,p as Te,s as Ee,t as De,u as Oe}from"./skills-pM_PouEs.js";import{a as ke,t as Ae}from"./agent-accounts-C2ILQhZy.js";import{B as je,Bn as Me,H as Ne,I as Pe,J as Fe,L as Ie,Q as Le,R as Re,V as ze,Vn as Be,X as W,Y as Ve,Z as He,dt as Ue,et as We,it as Ge,kt as G,lt as Ke,ot as qe,rt as Je,sr as K,st as Ye,ut as Xe,wr as Ze,z as Qe,zn as q}from"./index-DkQ5xrLr.js";import{t as $e}from"./textarea-BGp28xFr.js";import{t as et}from"./markdown-FIfZPsax.js";import{t as tt}from"./diff-C5-32cRp.js";import{t as J}from"./change-counts-BLLRvt46.js";import{t as nt}from"./option-select-DylfDjGi.js";import{t as rt}from"./tab-link-BJDe5cT4.js";var Y=e(t(),1),X=n(),it={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Z({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:w(t,`text-semantic-green`)}):e===`failing`?(0,X.jsx)(k,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:w(t,`text-semantic-red`)}):e===`pending`?(0,X.jsx)(oe,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:w(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,X.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:w(t,`text-semantic-info`)}):e===`conflict`?(0,X.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:w(t,`text-semantic-conflict`)}):(0,X.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:w(t,`text-soft-foreground`)})}function at(e){return e?.available?e.mergeState:null}function ot(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function st(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 ct(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function lt(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ut(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function dt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ft(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function pt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function mt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function ht(e){return e?it[e]:`Merge`}function gt(e){return e===`conflicting`?`true`:void 0}function _t({check:e}){return(0,X.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(Z,{state:e.state}),(0,X.jsxs)(`span`,{children:[e.name,` · `,e.state,ft(e.required)]})]}),e.url&&T(e.url)?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function vt({reason:e}){return(0,X.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function yt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:r,refreshPending:i,onRefresh:a,onRunAgent:o,onConfirm:s,onMethodChange:c,onOverrideChange:l}){let u=st(e),d=ct(e.reviewDecision),f=ut(e.mergeable);return(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,X.jsx)(j,{size:16,"aria-hidden":`true`,className:w(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h3`,{className:`font-semibold`,children:u}),(0,X.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,disabled:i,onClick:a,children:[(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:w(`size-3.5`,i&&`animate-spin`)}),`Refresh`]})]}),(0,X.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Be(e.headSha),`) → `,e.baseRef]}),(0,X.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{state:d}),(0,X.jsxs)(`span`,{children:[`Reviews: `,lt(e.reviewDecision)]})]}),(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{state:f}),(0,X.jsxs)(`span`,{children:[`Conflicts: `,dt(e.mergeable)]})]}),e.checks.length===0?(0,X.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,X.jsx)(_t,{check:e},e.name)),e.blockers.map(e=>(0,X.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&o?(0,X.jsx)(z,{className:`mt-4`,onClick:o,children:`Run agent on this PR`}):null,e.canOverride?(0,X.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>l(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,X.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,X.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,X.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,X.jsx)(nt,{"aria-label":`Merge method`,value:t??``,onValueChange:e=>c(e),options:e.methods.map(e=>({value:e,label:it[e]})),className:`w-full min-w-0 flex-1 bg-background sm:w-auto`}),(0,X.jsx)(z,{disabled:!r,onClick:s,children:ht(t)})]}):null]})]})}function bt({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,X.jsx)(_e,{open:r,onOpenChange:s,children:(0,X.jsxs)(he,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,X.jsxs)(me,{children:[(0,X.jsxs)(ge,{children:[ht(n),` pull request #`,e,`?`]}),(0,X.jsx)(pe,{asChild:!0,children:(0,X.jsxs)(`div`,{children:[(0,X.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,X.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,X.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,X.jsxs)(fe,{children:[(0,X.jsx)(z,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,X.jsx)(z,{disabled:a,onClick:c,children:a?`Merging…`:ht(n)})]})]})})}function xt({number:e,onRunAgent:t}){let n=h(),r=s(),i=C({queryKey:o.githubMergeState(e),queryFn:({signal:t})=>y(e,{},{signal:t}),retry:!1}),a=at(i.data),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(!1),g=m({mutationFn:t=>y(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>x(e instanceof Error?e.message:String(e),{tone:`danger`})}),_=ot(c,a),v=()=>({mergeState:o.githubMergeState(e),list:o.githubPages(50),comments:o.githubComments(`pr`,e),item:o.githubItem(`pr`,e),refStatus:r===void 0?void 0:o.githubRefStatusOf(r)}),b=m({mutationFn:t=>{if(!a||!_)throw Error(`No merge method is available.`);return S(e,{method:_,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{d(!1),x(`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)=>{x(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,X.jsx)(K,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,X.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":gt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,X.jsx)(yt,{state:a,selectedMethod:_,overrideRules:f,mergeEnabled:mt(_,a,f),refreshPending:g.isPending,onRefresh:()=>g.mutate(o.githubMergeState(e)),onRunAgent:t,onConfirm:()=>d(!0),onMethodChange:l,onOverrideChange:p}),(0,X.jsx)(bt,{number:e,state:a,selectedMethod:_,confirming:u,overrideRules:f,mergePending:b.isPending,mergeError:b.error,onOpenChange:d,onMerge:()=>b.mutate(v())})]}):(0,X.jsx)(vt,{reason:pt(i.data)})}function St(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 Ct(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 wt(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 Tt(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 Et(e){return!e||!/^[0-9a-fA-F]{6}$/.test(e)?{backgroundColor:`var(--border)`}:{backgroundColor:`#${e}`}}function Dt({label:e,color:t,className:n}){return(0,X.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,title:e,style:Tt(t),className:w(`rounded-full border px-1.5 py-px text-[12px] font-medium`,n),children:e})}function Ot(e){return e===`pr`?`pull request`:`issue`}function kt(e,t,n){return e===`pr`&&!!(t||n)}function At({backLink:e}){return e?(0,X.jsxs)(B,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(ne,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var jt=w(`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-xs`,`[&_[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 Mt(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function Nt({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:i,deletions:a}){return(0,X.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,X.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,X.jsx)(`span`,{children:t}),`·`,(0,X.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,X.jsx)(q,{iso:e.createdAt,title:Mt(e.createdAt)}),n?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsx)(on,{count:n})]}):null,r?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,X.jsx)(J,{adds:i??0,dels:a??0})})]}):null,`·`,T(e.url)?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,X.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Pt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,X.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,X.jsx)(rt,{to:G(`prs`,t.filter,e.number,``,t.narrows),active:!n,children:`Conversation`}),(0,X.jsx)(rt,{to:G(`prs`,t.filter,e.number,`/changes`,t.narrows),active:n,children:`Changes`})]}):(0,X.jsx)(B,{to:G(`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 Ft({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,X.jsx)(Dt,{label:e,color:t[e]},e)),n?(0,X.jsx)(sn,{checks:n,url:e.url}):null]}):null}function It({item:e,colors:t,body:n}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"data-slot":`gh-body`,className:w(`mt-5`,jt),children:n?(0,X.jsx)(et,{children:n}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,X.jsx)(Vt,{item:e,colors:t})]})}function Lt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=Ot(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=kt(e.kind,h,g),v=r??e.comments;return(0,X.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,X.jsx)(At,{backLink:i}),(0,X.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,X.jsx)(Rt,{action:c,className:`mb-4`,children:(0,X.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,X.jsx)(Rt,{action:e.kind===`pr`?void 0:c,children:(0,X.jsx)(Nt,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,X.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,X.jsx)(Pt,{item:e,subNav:a,changes:d}),(0,X.jsx)(Ft,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,X.jsx)(zt,{item:e}):(0,X.jsx)(It,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,X.jsx)(xt,{number:e.number,onRunAgent:o}):null,l]})}function Rt({action:e,className:t,children:n}){return e?(0,X.jsxs)(`div`,{"data-slot":`gh-header-row`,className:w(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,X.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,X.jsx)(`div`,{className:t,children:n}):(0,X.jsx)(X.Fragment,{children:n})}function zt({item:e}){let t=h(),n=p(e.number),[r,i]=(0,Y.useState)(``),[a,s]=(0,Y.useState)(null),c=n.data,l=e=>c?.available?c.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],u=l(r),d=u.some(e=>e.path===a)?a:u[0]?.path??null,f=u.findIndex(e=>e.path===d),m=e=>{i(e);let t=l(e),n=d??a,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==a&&s(r)},g=async()=>{let n=c?.available?c.headSha:null,r=o.githubPrChanges(e.number),i=await v(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(s(i.files[0]?.path??null),x(`The reviewed revision changed.`))};if(n.isPending)return(0,X.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!c)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!c.available)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:c.reason});let _=u.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??``})),y=T(e.url)?`${e.url}/files`:null,b=u.find(e=>e.path===d);return(0,X.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,X.jsxs)(`strong`,{children:[c.files.length,` changed files`]}),(0,X.jsx)(J,{adds:c.additions,dels:c.deletions}),(0,X.jsx)(Me,{sha:c.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,X.jsx)(z,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto`,onClick:()=>void g(),children:`Refresh`})]}),c.truncated?(0,X.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[c.reason??`This response is incomplete.`,` `,y?(0,X.jsx)(`a`,{href:y,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,X.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,X.jsxs)(`aside`,{className:`min-w-0`,children:[(0,X.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>m(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,X.jsx)(nt,{"aria-label":`Select changed file`,value:d??``,onValueChange:s,options:u.map(e=>({value:e.path,label:e.path})),className:`mt-2 w-full min-w-0 bg-background lg:hidden`,contentClassName:`max-w-[calc(100vw-2rem)]`}),(0,X.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:u.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:w(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,d===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,X.jsx)(J,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,X.jsx)(z,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,disabled:f<=0,onClick:()=>s(u[f-1]?.path??null),children:(0,X.jsx)(Ze,{})}),(0,X.jsx)(z,{"aria-label":`Next file`,variant:`outline`,size:`icon`,disabled:f<0||f>=u.length-1,onClick:()=>s(u[f+1]?.path??null),children:(0,X.jsx)(te,{size:16})})]}),u.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(tt,{files:_.filter(e=>e.path===d),wrap:!0,className:`min-w-0`}),b&&!b.patch?(0,X.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,b.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Bt(e){let t=e.filter(e=>e.kind===`review`).length,n=e.length-t,r=`${n} comment${n===1?``:`s`}`;return t===0?r:`${r} · ${t} review${t===1?``:`s`}`}function Vt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,Y.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(Ht(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,X.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsx)(K,{className:`mb-3 h-3 w-24`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(K,{className:`h-14 w-full`}),(0,X.jsx)(K,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,X.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,X.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,Bt(r.comments)]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Ut(i).map(e=>e.group===`commits`?(0,X.jsx)(Wt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,X.jsx)(tn,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,X.jsx)(Kt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Ht=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Ut(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 Wt({commits:e,colors:t}){let[n,r]=(0,Y.useState)(!1),i=e[0]?.actor??`?`;return n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,X.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,X.jsx)(`span`,{"aria-hidden":`true`,children:Gt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,X.jsx)(Kt,{event:e,colors:t},e.id))]}):(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,X.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,X.jsx)(`span`,{"aria-hidden":`true`,children:Gt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,X.jsx)(q,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Gt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Kt({event:e,colors:t}){return(0,X.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:w(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Gt[e.kind]}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,X.jsx)(Qt,{event:e,colors:t}),(0,X.jsx)(q,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function qt({event:e}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,X.jsx)(Me,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,X.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,X.jsx)($t,{checks:e.checks})]})}function Jt({event:e,colors:t}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,X.jsx)(`span`,{"data-slot":`gh-event-label`,style:Tt(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,X.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Yt({event:e}){return(0,X.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Xt({event:e}){return(0,X.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Zt={committed:e=>(0,X.jsx)(qt,{event:e}),labeled:(e,t)=>(0,X.jsx)(Jt,{event:e,colors:t}),unlabeled:(e,t)=>(0,X.jsx)(Jt,{event:e,colors:t}),assigned:e=>(0,X.jsx)(Yt,{event:e}),unassigned:e=>(0,X.jsx)(Yt,{event:e}),merged:()=>(0,X.jsx)(`span`,{children:`merged this`}),closed:()=>(0,X.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,X.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,X.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,X.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,X.jsx)(Xt,{event:e})};function Qt({event:e,colors:t}){return Zt[e.kind]?.(e,t)??null}function $t({checks:e}){return e?(0,X.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:w(`shrink-0`,an[e]),children:rn[e]}):null}var en={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function tn({comment:e}){let t=e.reviewState?en[e.reviewState]:null;return(0,X.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(nn,{url:e.avatarUrl,login:e.author}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,X.jsx)(q,{iso:e.createdAt}),t?(0,X.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:w(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,X.jsx)(`div`,{"data-slot":`gh-thread-body`,className:jt,children:e.body?(0,X.jsx)(et,{children:e.body}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function nn({url:e,login:t}){let[n,r]=(0,Y.useState)(!1);return e&&!n?(0,X.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,X.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-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var rn={passing:`✓`,failing:`✗`,pending:`○`},an={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},Q={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function on({count:e}){return e?(0,X.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,X.jsx)(se,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function sn({checks:e,url:t}){let n=w(`text-xs font-medium`,an[e],t&&`hover:underline`),r=`${rn[e]} ${Q[e]}`;return t?(0,X.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,X.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function cn({checks:e}){return(0,X.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:Q[e],"aria-label":Q[e],className:w(`shrink-0 font-sans text-xs font-semibold`,an[e]),children:rn[e]})}function ln(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function un(e,t=[]){let n=ln(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=dn(t)),n}function dn(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function fn(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 pn(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 mn(e,t,n){let r=(n??``).trim();if(!r)return un(e,t);let i=ln(e),a=r.startsWith(i)?i+fn(r.slice(i.length),e):fn(r,e),o=pn(a,e)?a:`${i}\n\n${a}`;return t.length?o+dn(t):o}function hn(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 gn(e,t,n,r,i={}){return t?{...i,workflow:t,task:mn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:hn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:mn(e,[],r)}:{...i,workflow:`quick-task`,task:mn(e,[],r)}}function $(e){let t=a(),n=l(),r=c(),{runners:i,uninstalled:o,signedOut:s,accounts:u,repoAccount:f,accountFor:p}=ke(),m=n.data?.defaultRunner,h=ze(e.runner,i,m??i[0]??`claude`),g=n.data?.modelsLocked===!0,_=p(h,e.account),v=d(h,!0,_??f?.[h]),y=je(g?null:e.model,h,r.data,n.data?.defaultModels,v.data),b=Ie(y,v.data);return{runner:h,runnerExplicit:e.runner!==null,model:y,effort:g?``:Qe(e.effort,b),effortOptions:b,runners:i,uninstalled:o,signedOut:s,defaultRunner:m,canRun:t.isSuccess&&i.length>0,modelsLocked:g,providerPending:t.isPending,providerError:t.isError,accounts:u,account:_,repoAccount:f}}function _n(e){return{runner:Ne(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 vn(e){return{..._n(e),...e.account?{agentProfile:e.account}:{}}}function yn(e,t){return e.find(e=>e.id===t)?.label??(t===``?`Runner default`:t)}function bn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>Ae(t,e))}function xn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),[s,u]=(0,Y.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,Y.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,u(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,Y.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let f=$(e),{runner:p,model:m,effort:h,effortOptions:g,runners:_,canRun:v,modelsLocked:y}=f,b=l(),ee=c(),x=d(p,!0,f.account??f.repoAccount?.[p]),S=Re(p,ee.data,x.data,[e.model,b.data?.defaultModels?.[p]]),C=n||!v,w=r?f.accounts:[],T=bn(f,w)?(0,X.jsx)(Le,{icon:(0,X.jsx)(I,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:f.uninstalled,signedOut:f.signedOut,value:p,accounts:w,account:r?f.account:null,repoAccount:r?f.repoAccount:void 0,disabled:C,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===p?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,E=(0,X.jsx)(W,{icon:(0,X.jsx)(A,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:yn(S,m),value:m,disabled:C,readOnly:y===!0,disabledHint:y?`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:Qe(e.effort,r)})},options:S.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Pe(p,ee.data,x)},`model`),O=(0,X.jsx)(W,{icon:(0,X.jsx)(D,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:g.find(e=>e.value===h)?.label??`Runner default`,value:h,disabled:C,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:g.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,X.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,X.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,X.jsx)(He,{fill:`model-pill`,children:s?[T,O,E]:[T,E,O]})})}):(0,X.jsxs)(He,{children:[T,E,O]})}var Sn={workflow:null,skills:[]},Cn=`cez-followup-selection`;function wn(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 Tn(){try{let e=localStorage.getItem(E(Cn));return e?wn(JSON.parse(e)):{...Sn}}catch{return{...Sn}}}function En(e){try{localStorage.setItem(E(Cn),JSON.stringify(e))}catch{}}var Dn=`cez-followup-prompt:`;function On(e){try{return localStorage.getItem(E(Dn+e))??``}catch{return``}}function kn(e,t){try{let n=E(Dn+e);t===``?localStorage.removeItem(n):localStorage.setItem(n,t)}catch{}}function An({item:e,workflows:t,skills:n,workflow:a,onWorkflowChange:s,selectedSkills:c,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:p}){let _=h(),v=i(),y=e.kind===`pr`?`PR`:`issue`,b=$(u),S=r(b.runner,b.account),C=c.filter(e=>S.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),w=C.length!==c.length,[E]=(0,Y.useState)(()=>ln(e)),[D,O]=(0,Y.useState)(()=>On(e.url)||E),k=(0,Y.useRef)(null),A=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{kn(e.url,D===E?``:D)},[e.url,D,E]);let j=(0,Y.useMemo)(()=>Ke(v.data?.promptTemplates),[v.data?.promptTemplates]),te=e=>{let t=k.current,n=Ue({prompt:D,base:E,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:A.current}),r=Ye(D,n,e);O(r.text),A.current=r.caret,requestAnimationFrame(()=>{k.current?.focus(),k.current?.setSelectionRange(r.caret,r.caret)})},M=qe(j,C.map(e=>e.id)),N=(0,Y.useRef)(D);N.current=D;let F=(0,Y.useRef)(``);(0,Y.useEffect)(()=>{let e=Xe(N.current,F.current,M,E);F.current=e.applied,e.text!==N.current&&O(e.text)},[M,E]);let I=m({mutationFn:async()=>!b.canRun||w?null:ee(gn(e,a,C,D,vn(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&p(e.url,n.id),x(`Added to the queue — ${y} #${e.number}`),C.length>0&&v.data!==void 0&&g({skillUsage:C.reduce((e,t)=>De(e,t.id),v.data.skillUsage)}).then(()=>_.invalidateQueries({queryKey:o.uiState})).catch(()=>{}),kn(e.url,``),O(E),F.current=``,_.invalidateQueries({queryKey:o.runs.all})},onError:e=>x(e.message,{tone:`danger`})}),ne=e=>{Je(e)&&(e.preventDefault(),!I.isPending&&b.canRun&&I.mutate())},L=e=>l(c.some(t=>U(t)===U(e))?c.filter(t=>U(t)!==U(e)):[...c,Ee(e)]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,X.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,X.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,X.jsx)(`span`,{children:`Instructions for the agent`}),(0,X.jsx)($e,{ref:k,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:D,onChange:e=>O(e.target.value),onSelect:e=>{A.current=e.currentTarget.selectionStart},onKeyDown:ne,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,X.jsx)(Ve,{templates:j,onInsert:te}),(0,X.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Workflow`}),(0,X.jsx)(Mn,{workflows:t,value:a,onChange:s})]}),(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Skills · select one or more`}),(0,X.jsx)(Pn,{skills:n,skillUsage:v.data?.skillUsage,selected:c,onToggle:L})]}),c.length>0?(0,X.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:c.map(e=>(0,X.jsx)(jn,{skill:e,skills:n,unchecked:S.unchecked,onRemove:()=>L(e)},U(e)))}):null,w?(0,X.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,X.jsx)(xn,{layout:`row`,pick:u,onChange:d,disabled:I.isPending||!b.canRun,accounts:!0}),(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Account`}),(0,X.jsx)(Nn,{resolved:b,disabled:I.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,X.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,X.jsx)(B,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,X.jsxs)(`p`,{className:`text-xs 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,X.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[T(e.url)?(0,X.jsx)(z,{asChild:!0,variant:`outline`,children:(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,X.jsxs)(z,{variant:`primary`,"data-action":`gh-run`,disabled:I.isPending||!b.canRun||w,onClick:()=>I.mutate(),children:[(0,X.jsx)(ce,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,X.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:Ge()}),f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,X.jsx)(B,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function jn({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,X.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,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function Mn({workflows:e,value:t,onChange:n}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),s=(0,Y.useRef)(null),c=Se(e,a);return(0,X.jsxs)(de,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,X.jsx)(le,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:w(We,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,X.jsx)(M,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,X.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,X.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ue,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(xe,{shouldFilter:!1,children:[(0,X.jsx)(ve,{placeholder:`Search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,X.jsxs)(be,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,X.jsx)(ye,{children:`Nothing matches.`}):null,(0,X.jsx)(V,{children:c.map(e=>{let r=t===e.name;return(0,X.jsxs)(H,{value:`workflow ${e.name}`,keywords:Te(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Nn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:_,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,X.jsx)(W,{icon:(0,X.jsx)(ie,{"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 Pn({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),[c,l]=(0,Y.useState)(null),u=(0,Y.useRef)(null),{mostUsed:d,project:f,global:p,ranked:m}=Oe(e,o,t),h=(e,t)=>{let i=n.some(t=>U(t)===U(e));return(0,X.jsxs)(H,{value:U(e),keywords:Te(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":i?`true`:void 0,onSelect:()=>r(Ee(e)),children:[(0,X.jsx)(`span`,{className:w(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,X.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,X.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},U(e))};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Fe,{skill:c,onClose:()=>l(null)}),(0,X.jsxs)(de,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,X.jsx)(le,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:w(We,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,X.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,X.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ue,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(xe,{shouldFilter:!1,children:[(0,X.jsx)(ve,{placeholder:`Search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,X.jsxs)(be,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[o.trim()&&!e.some(e=>e.id===o.trim())?(0,X.jsx)(V,{children:(0,X.jsxs)(H,{value:`typed-skill`,onSelect:()=>r({id:o.trim()}),children:[`Use skill id “`,o.trim(),`” (unchecked)`]})}):null,(m?m.length===0:d.length===0&&f.length===0&&p.length===0)?(0,X.jsx)(ye,{children:`Nothing matches.`}):null,m?m.length>0?(0,X.jsx)(V,{children:m.map(e=>h(e,Ce(e)))}):null:(0,X.jsxs)(X.Fragment,{children:[d.length>0?(0,X.jsx)(V,{heading:`Most used`,children:d.map(e=>h(e,Ce(e)))}):null,f.length>0?(0,X.jsx)(V,{heading:`Project skills`,children:f.map(e=>h(e,!0))}):null,p.length>0?(0,X.jsx)(V,{heading:`Global`,children:p.map(e=>h(e,!1))}):null]})]})]})})]})]})}var Fn=new WeakMap;function In(){let e=Tn(),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)&&En({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Ln(){let e=h(),{projectId:t}=b(),n=Fn.get(e);n||Fn.set(e,n=new Map);let a=n.get(t);a||n.set(t,a=In());let{snapshot:o,subscribe:s,update:c}=a,l=(0,Y.useSyncExternalStore)(s,o,o),u=f(),d=$(l.engine),p=r(d.runner,d.account),m=i(),g=u.data?.workflows;(0,Y.useEffect)(()=>{g&&l.workflow!==null&&!g.some(e=>e.name===l.workflow)&&c({workflow:null})},[c,g,l.workflow]);let _=(0,Y.useMemo)(()=>we(p.data??[],m.data?.skillUsage),[p.data,m.data?.skillUsage]);return{...l,workflows:u,skillList:_,skillsUnchecked:p.unchecked,setWorkflow:e=>c({workflow:e}),setSelectedSkills:e=>c({selectedSkills:e}),setEngine:e=>c({engine:e}),onQueued:(e,t)=>c({queued:new Map(o().queued).set(e,t)})}}export{sn as a,At as c,Ut as d,St as f,wt as h,nn as i,Lt as l,Et as m,An as n,cn as o,Ct as p,un as r,on as s,Ln as t,Dt as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Gt as r,O as i,St as a,Vt as o,d as s,en as c,g as l,i as u,in as d,k as f,s as p,un as m}from"./queries-D9mg7sFY.js";import{Fi as h,R as g,Wn as _,X as v,Z as y,a as b,lt as ee,n as x,tt as S,wi as C}from"./toaster-2ud_VdfV.js";import{o as w,s as T}from"./dist-CCX8mhHc.js";import{t as E}from"./host-storage-B72yoDU1.js";import{A as D,Z as O,_ as k,b as A,ct as j,d as te,ft as M,h as N,l as P,mt as F,ot as I,r as ne,rt as L,u as re,ut as ie}from"./design-icons-QbNMZniQ.js";import{t as R}from"./external-link-BE6y205O.js";import{t as ae}from"./eye-B8okNWXU.js";import{t as oe}from"./loader-circle-CPBhhDbB.js";import{t as se}from"./message-square-B-MD-8rD.js";import{t as ce}from"./play-CmVAj_fu.js";import{t as z}from"./button-BV_AiLj2.js";import{i as le,r as ue,t as de}from"./popover-BQolmvDR.js";import{a as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./dialog-DKr-j9S6.js";import{t as B}from"./project-router-CwD1firw.js";import{a as ve,i as V,o as H,r as ye,s as be,t as xe}from"./command-4D8sPZJy.js";import{d as Se,f as U,i as Ce,o as we,p as Te,s as Ee,t as De,u as Oe}from"./skills-pM_PouEs.js";import{a as ke,t as Ae}from"./agent-accounts-C2ILQhZy.js";import{B as je,Bn as Me,H as Ne,I as Pe,J as Fe,L as Ie,Q as Le,R as Re,V as ze,Vn as Be,X as W,Y as Ve,Z as He,dt as Ue,et as We,it as Ge,kt as G,lt as Ke,ot as qe,rt as Je,sr as K,st as Ye,ut as Xe,wr as Ze,z as Qe,zn as q}from"./index-BV3EQb9T.js";import{t as $e}from"./textarea-BGp28xFr.js";import{t as et}from"./markdown-0uCxcToP.js";import{t as tt}from"./diff-Du0FsqAK.js";import{t as J}from"./change-counts-BLLRvt46.js";import{t as nt}from"./option-select-DQJEHmHf.js";import{t as rt}from"./tab-link-BJDe5cT4.js";var Y=e(t(),1),X=n(),it={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Z({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:w(t,`text-semantic-green`)}):e===`failing`?(0,X.jsx)(k,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:w(t,`text-semantic-red`)}):e===`pending`?(0,X.jsx)(oe,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:w(t,`animate-spin text-semantic-amber motion-reduce:animate-none`)}):e===`review`?(0,X.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-review`,className:w(t,`text-semantic-info`)}):e===`conflict`?(0,X.jsx)(j,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-conflict`,className:w(t,`text-semantic-conflict`)}):(0,X.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:w(t,`text-soft-foreground`)})}function at(e){return e?.available?e.mergeState:null}function ot(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function st(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 ct(e){return e===`approved`||e===`not-required`?`passing`:e===`review-required`?`review`:e===`unknown`?`unknown`:`failing`}function lt(e){switch(e){case`approved`:return`Approved`;case`not-required`:return`Not required`;case`review-required`:return`Waiting for review`;case`changes-requested`:return`Changes requested`;case`unknown`:return`Unknown`}}function ut(e){return e===`mergeable`?`passing`:e===`conflicting`?`conflict`:`unknown`}function dt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ft(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function pt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function mt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function ht(e){return e?it[e]:`Merge`}function gt(e){return e===`conflicting`?`true`:void 0}function _t({check:e}){return(0,X.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(Z,{state:e.state}),(0,X.jsxs)(`span`,{children:[e.name,` · `,e.state,ft(e.required)]})]}),e.url&&T(e.url)?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function vt({reason:e}){return(0,X.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function yt({state:e,selectedMethod:t,overrideRules:n,mergeEnabled:r,refreshPending:i,onRefresh:a,onRunAgent:o,onConfirm:s,onMethodChange:c,onOverrideChange:l}){let u=st(e),d=ct(e.reviewDecision),f=ut(e.mergeable);return(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-semantic-green`}):(0,X.jsx)(j,{size:16,"aria-hidden":`true`,className:w(`mt-0.5 size-5 shrink-0`,e.mergeable===`conflicting`?`text-semantic-conflict`:`text-semantic-amber`)}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h3`,{className:`font-semibold`,children:u}),(0,X.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,disabled:i,onClick:a,children:[(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:w(`size-3.5`,i&&`animate-spin`)}),`Refresh`]})]}),(0,X.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-soft-foreground`,children:[e.headRef,` (`,Be(e.headSha),`) → `,e.baseRef]}),(0,X.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{state:d}),(0,X.jsxs)(`span`,{children:[`Reviews: `,lt(e.reviewDecision)]})]}),(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Z,{state:f}),(0,X.jsxs)(`span`,{children:[`Conflicts: `,dt(e.mergeable)]})]}),e.checks.length===0?(0,X.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,X.jsx)(_t,{check:e},e.name)),e.blockers.map(e=>(0,X.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&o?(0,X.jsx)(z,{className:`mt-4`,onClick:o,children:`Run agent on this PR`}):null,e.canOverride?(0,X.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>l(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,X.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,X.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,X.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,X.jsx)(nt,{"aria-label":`Merge method`,value:t??``,onValueChange:e=>c(e),options:e.methods.map(e=>({value:e,label:it[e]})),className:`w-full min-w-0 flex-1 bg-background sm:w-auto`}),(0,X.jsx)(z,{disabled:!r,onClick:s,children:ht(t)})]}):null]})]})}function bt({number:e,state:t,selectedMethod:n,confirming:r,overrideRules:i,mergePending:a,mergeError:o,onOpenChange:s,onMerge:c}){return(0,X.jsx)(_e,{open:r,onOpenChange:s,children:(0,X.jsxs)(he,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,X.jsxs)(me,{children:[(0,X.jsxs)(ge,{children:[ht(n),` pull request #`,e,`?`]}),(0,X.jsx)(pe,{asChild:!0,children:(0,X.jsxs)(`div`,{children:[(0,X.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,X.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-semantic-amber`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),o?(0,X.jsx)(`p`,{className:`text-sm text-danger`,children:o.message}):null,(0,X.jsxs)(fe,{children:[(0,X.jsx)(z,{variant:`outline`,disabled:a,onClick:()=>s(!1),children:`Cancel`}),(0,X.jsx)(z,{disabled:a,onClick:c,children:a?`Merging…`:ht(n)})]})]})})}function xt({number:e,onRunAgent:t}){let n=h(),r=s(),i=C({queryKey:o.githubMergeState(e),queryFn:({signal:t})=>y(e,{},{signal:t}),retry:!1}),a=at(i.data),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(!1),g=m({mutationFn:t=>y(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>x(e instanceof Error?e.message:String(e),{tone:`danger`})}),_=ot(c,a),v=()=>({mergeState:o.githubMergeState(e),list:o.githubPages(50),comments:o.githubComments(`pr`,e),item:o.githubItem(`pr`,e),refStatus:r===void 0?void 0:o.githubRefStatusOf(r)}),b=m({mutationFn:t=>{if(!a||!_)throw Error(`No merge method is available.`);return S(e,{method:_,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{d(!1),x(`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)=>{x(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,X.jsx)(K,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,X.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":gt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-card-edge bg-card p-4 shadow-card`,children:[(0,X.jsx)(yt,{state:a,selectedMethod:_,overrideRules:f,mergeEnabled:mt(_,a,f),refreshPending:g.isPending,onRefresh:()=>g.mutate(o.githubMergeState(e)),onRunAgent:t,onConfirm:()=>d(!0),onMethodChange:l,onOverrideChange:p}),(0,X.jsx)(bt,{number:e,state:a,selectedMethod:_,confirming:u,overrideRules:f,mergePending:b.isPending,mergeError:b.error,onOpenChange:d,onMerge:()=>b.mutate(v())})]}):(0,X.jsx)(vt,{reason:pt(i.data)})}function St(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 Ct(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 wt(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 Tt(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 Et(e){return!e||!/^[0-9a-fA-F]{6}$/.test(e)?{backgroundColor:`var(--border)`}:{backgroundColor:`#${e}`}}function Dt({label:e,color:t,className:n}){return(0,X.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,title:e,style:Tt(t),className:w(`rounded-full border px-1.5 py-px text-[12px] font-medium`,n),children:e})}function Ot(e){return e===`pr`?`pull request`:`issue`}function kt(e,t,n){return e===`pr`&&!!(t||n)}function At({backLink:e}){return e?(0,X.jsxs)(B,{to:e.to,"data-slot":`gh-back`,className:`mb-3 inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(ne,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}var jt=w(`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-xs`,`[&_[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 Mt(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function Nt({item:e,kindWord:t,commentCount:n,hasDiffStat:r,additions:i,deletions:a}){return(0,X.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,X.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,e.number]}),`·`,(0,X.jsx)(`span`,{children:t}),`·`,(0,X.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,X.jsx)(q,{iso:e.createdAt,title:Mt(e.createdAt)}),n?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsx)(on,{count:n})]}):null,r?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsx)(`span`,{"data-slot":`gh-diffstat`,children:(0,X.jsx)(J,{adds:i??0,dels:a??0})})]}):null,`·`,T(e.url)?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,X.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Pt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,X.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,X.jsx)(rt,{to:G(`prs`,t.filter,e.number,``,t.narrows),active:!n,children:`Conversation`}),(0,X.jsx)(rt,{to:G(`prs`,t.filter,e.number,`/changes`,t.narrows),active:n,children:`Changes`})]}):(0,X.jsx)(B,{to:G(`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 Ft({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,X.jsx)(Dt,{label:e,color:t[e]},e)),n?(0,X.jsx)(sn,{checks:n,url:e.url}):null]}):null}function It({item:e,colors:t,body:n}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"data-slot":`gh-body`,className:w(`mt-5`,jt),children:n?(0,X.jsx)(et,{children:n}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no description)`})}),(0,X.jsx)(Vt,{item:e,colors:t})]})}function Lt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,headerAction:c,children:l}){let d=a?.changes??!1,f=Ot(e.kind),p=u(e.kind,e.number,!d).data?.detail,m=p?.body??e.body,h=p?.additions??e.additions,g=p?.deletions??e.deletions,_=kt(e.kind,h,g),v=r??e.comments;return(0,X.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,X.jsx)(At,{backLink:i}),(0,X.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,X.jsx)(Rt,{action:c,className:`mb-4`,children:(0,X.jsxs)(`h2`,{className:`min-w-0 text-[22px] leading-snug font-semibold tracking-tight`,children:[`#`,e.number,` `,e.title]})}):null,(0,X.jsx)(Rt,{action:e.kind===`pr`?void 0:c,children:(0,X.jsx)(Nt,{item:e,kindWord:f,commentCount:v,hasDiffStat:_,additions:h,deletions:g})}),e.kind===`pr`?null:(0,X.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-semibold tracking-tight`,children:e.title}),s,(0,X.jsx)(Pt,{item:e,subNav:a,changes:d}),(0,X.jsx)(Ft,{item:e,colors:t,checks:n}),d&&e.kind===`pr`?(0,X.jsx)(zt,{item:e}):(0,X.jsx)(It,{item:e,colors:t,body:m})]}),e.kind===`pr`?(0,X.jsx)(xt,{number:e.number,onRunAgent:o}):null,l]})}function Rt({action:e,className:t,children:n}){return e?(0,X.jsxs)(`div`,{"data-slot":`gh-header-row`,className:w(`flex flex-wrap items-center gap-x-3 gap-y-2`,t),children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),(0,X.jsx)(`div`,{"data-slot":`gh-header-action`,className:`flex shrink-0 items-center gap-2`,children:e})]}):t?(0,X.jsx)(`div`,{className:t,children:n}):(0,X.jsx)(X.Fragment,{children:n})}function zt({item:e}){let t=h(),n=p(e.number),[r,i]=(0,Y.useState)(``),[a,s]=(0,Y.useState)(null),c=n.data,l=e=>c?.available?c.files.filter(t=>t.path.toLowerCase().includes(e.toLowerCase())):[],u=l(r),d=u.some(e=>e.path===a)?a:u[0]?.path??null,f=u.findIndex(e=>e.path===d),m=e=>{i(e);let t=l(e),n=d??a,r=t.some(e=>e.path===n)?n:t[0]?.path??n;r!==a&&s(r)},g=async()=>{let n=c?.available?c.headSha:null,r=o.githubPrChanges(e.number),i=await v(e.number,{refresh:!0});t.setQueryData(r,i),i.available&&n&&n!==i.headSha&&(s(i.files[0]?.path??null),x(`The reviewed revision changed.`))};if(n.isPending)return(0,X.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!c)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!c.available)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:c.reason});let _=u.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??``})),y=T(e.url)?`${e.url}/files`:null,b=u.find(e=>e.path===d);return(0,X.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,X.jsxs)(`strong`,{children:[c.files.length,` changed files`]}),(0,X.jsx)(J,{adds:c.additions,dels:c.deletions}),(0,X.jsx)(Me,{sha:c.headSha,variant:`inline`,prefix:`head `,className:`text-muted-foreground`}),(0,X.jsx)(z,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto`,onClick:()=>void g(),children:`Refresh`})]}),c.truncated?(0,X.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-pending-strong/40 bg-pending/10 p-3 text-xs`,children:[c.reason??`This response is incomplete.`,` `,y?(0,X.jsx)(`a`,{href:y,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,X.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,X.jsxs)(`aside`,{className:`min-w-0`,children:[(0,X.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>m(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,X.jsx)(nt,{"aria-label":`Select changed file`,value:d??``,onValueChange:s,options:u.map(e=>({value:e.path,label:e.path})),className:`mt-2 w-full min-w-0 bg-background lg:hidden`,contentClassName:`max-w-[calc(100vw-2rem)]`}),(0,X.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:u.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:w(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,d===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,X.jsx)(J,{adds:e.additions,dels:e.deletions})]})},e.path))})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,X.jsx)(z,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,disabled:f<=0,onClick:()=>s(u[f-1]?.path??null),children:(0,X.jsx)(Ze,{})}),(0,X.jsx)(z,{"aria-label":`Next file`,variant:`outline`,size:`icon`,disabled:f<0||f>=u.length-1,onClick:()=>s(u[f+1]?.path??null),children:(0,X.jsx)(te,{size:16})})]}),u.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(tt,{files:_.filter(e=>e.path===d),wrap:!0,className:`min-w-0`}),b&&!b.patch?(0,X.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,b.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Bt(e){let t=e.filter(e=>e.kind===`review`).length,n=e.length-t,r=`${n} comment${n===1?``:`s`}`;return t===0?r:`${r} · ${t} review${t===1?``:`s`}`}function Vt({item:e,colors:t}){let n=u(e.kind,e.number),r=n.data,i=(0,Y.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(Ht(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,X.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsx)(K,{className:`mb-3 h-3 w-24`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(K,{className:`h-14 w-full`}),(0,X.jsx)(K,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,X.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,X.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:[`Activity · `,Bt(r.comments)]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Ut(i).map(e=>e.group===`commits`?(0,X.jsx)(Wt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,X.jsx)(tn,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,X.jsx)(Kt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Ht=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Ut(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 Wt({commits:e,colors:t}){let[n,r]=(0,Y.useState)(!1),i=e[0]?.actor??`?`;return n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,X.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,X.jsx)(`span`,{"aria-hidden":`true`,children:Gt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,X.jsx)(Kt,{event:e,colors:t},e.id))]}):(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,X.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,X.jsx)(`span`,{"aria-hidden":`true`,children:Gt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,X.jsx)(q,{iso:e[e.length-1].createdAt,className:`shrink-0`})]})})}var Gt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Kt({event:e,colors:t}){return(0,X.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:w(`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Gt[e.kind]}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,X.jsx)(Qt,{event:e,colors:t}),(0,X.jsx)(q,{iso:e.createdAt,className:`shrink-0`}),e.url?(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function qt({event:e}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,X.jsx)(Me,{sha:e.sha,variant:`inline`,className:`shrink-0 text-xs text-muted-foreground`}):null,e.message?(0,X.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,X.jsx)($t,{checks:e.checks})]})}function Jt({event:e,colors:t}){return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,X.jsx)(`span`,{"data-slot":`gh-event-label`,style:Tt(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,X.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Yt({event:e}){return(0,X.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Xt({event:e}){return(0,X.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Zt={committed:e=>(0,X.jsx)(qt,{event:e}),labeled:(e,t)=>(0,X.jsx)(Jt,{event:e,colors:t}),unlabeled:(e,t)=>(0,X.jsx)(Jt,{event:e,colors:t}),assigned:e=>(0,X.jsx)(Yt,{event:e}),unassigned:e=>(0,X.jsx)(Yt,{event:e}),merged:()=>(0,X.jsx)(`span`,{children:`merged this`}),closed:()=>(0,X.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,X.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,X.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,X.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,X.jsx)(Xt,{event:e})};function Qt({event:e,colors:t}){return Zt[e.kind]?.(e,t)??null}function $t({checks:e}){return e?(0,X.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:w(`shrink-0`,an[e]),children:rn[e]}):null}var en={approved:{label:`Approved`,tone:`border-success/40 text-semantic-green`},changes_requested:{label:`Changes requested`,tone:`border-danger/40 text-semantic-red`},commented:{label:`Commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`Dismissed`,tone:`border-border text-muted-foreground`}};function tn({comment:e}){let t=e.reviewState?en[e.reviewState]:null;return(0,X.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(nn,{url:e.avatarUrl,login:e.author}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,X.jsx)(q,{iso:e.createdAt}),t?(0,X.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:w(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,X.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,X.jsx)(R,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,X.jsx)(`div`,{"data-slot":`gh-thread-body`,className:jt,children:e.body?(0,X.jsx)(et,{children:e.body}):(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`(no body)`})})]})}function nn({url:e,login:t}){let[n,r]=(0,Y.useState)(!1);return e&&!n?(0,X.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,X.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-xs font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var rn={passing:`✓`,failing:`✗`,pending:`○`},an={passing:`text-semantic-green`,failing:`text-semantic-red`,pending:`text-semantic-amber`},Q={passing:`Checks passing`,failing:`Checks failing`,pending:`Checks pending`};function on({count:e}){return e?(0,X.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,X.jsx)(se,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function sn({checks:e,url:t}){let n=w(`text-xs font-medium`,an[e],t&&`hover:underline`),r=`${rn[e]} ${Q[e]}`;return t?(0,X.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,X.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function cn({checks:e}){return(0,X.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:Q[e],"aria-label":Q[e],className:w(`shrink-0 font-sans text-xs font-semibold`,an[e]),children:rn[e]})}function ln(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function un(e,t=[]){let n=ln(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=dn(t)),n}function dn(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function fn(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 pn(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 mn(e,t,n){let r=(n??``).trim();if(!r)return un(e,t);let i=ln(e),a=r.startsWith(i)?i+fn(r.slice(i.length),e):fn(r,e),o=pn(a,e)?a:`${i}\n\n${a}`;return t.length?o+dn(t):o}function hn(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 gn(e,t,n,r,i={}){return t?{...i,workflow:t,task:mn(e,n.map(e=>e.id),r)}:n.length?{...i,steps:hn(n.map(e=>e.id)).map((e,t)=>({...e,...n[t]?.path===void 0?{}:{skillPath:n[t].path}})),task:mn(e,[],r)}:{...i,workflow:`quick-task`,task:mn(e,[],r)}}function $(e){let t=a(),n=l(),r=c(),{runners:i,uninstalled:o,signedOut:s,accounts:u,repoAccount:f,accountFor:p}=ke(),m=n.data?.defaultRunner,h=ze(e.runner,i,m??i[0]??`claude`),g=n.data?.modelsLocked===!0,_=p(h,e.account),v=d(h,!0,_??f?.[h]),y=je(g?null:e.model,h,r.data,n.data?.defaultModels,v.data),b=Ie(y,v.data);return{runner:h,runnerExplicit:e.runner!==null,model:y,effort:g?``:Qe(e.effort,b),effortOptions:b,runners:i,uninstalled:o,signedOut:s,defaultRunner:m,canRun:t.isSuccess&&i.length>0,modelsLocked:g,providerPending:t.isPending,providerError:t.isError,accounts:u,account:_,repoAccount:f}}function _n(e){return{runner:Ne(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 vn(e){return{..._n(e),...e.account?{agentProfile:e.account}:{}}}function yn(e,t){return e.find(e=>e.id===t)?.label??(t===``?`Runner default`:t)}function bn(e,t){let{runners:n,uninstalled:r,signedOut:i}=e;return n.length>1||r.length>0||i.length>0||n.some(e=>Ae(t,e))}function xn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),[s,u]=(0,Y.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,Y.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,u(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,Y.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let f=$(e),{runner:p,model:m,effort:h,effortOptions:g,runners:_,canRun:v,modelsLocked:y}=f,b=l(),ee=c(),x=d(p,!0,f.account??f.repoAccount?.[p]),S=Re(p,ee.data,x.data,[e.model,b.data?.defaultModels?.[p]]),C=n||!v,w=r?f.accounts:[],T=bn(f,w)?(0,X.jsx)(Le,{icon:(0,X.jsx)(I,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,uninstalled:f.uninstalled,signedOut:f.signedOut,value:p,accounts:w,account:r?f.account:null,repoAccount:r?f.repoAccount:void 0,disabled:C,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===p?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,E=(0,X.jsx)(W,{icon:(0,X.jsx)(A,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:yn(S,m),value:m,disabled:C,readOnly:y===!0,disabledHint:y?`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:Qe(e.effort,r)})},options:S.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Pe(p,ee.data,x)},`model`),O=(0,X.jsx)(W,{icon:(0,X.jsx)(D,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:g.find(e=>e.value===h)?.label??`Runner default`,value:h,disabled:C,readOnly:y===!0,disabledHint:y?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:g.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,X.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,X.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,X.jsx)(He,{fill:`model-pill`,children:s?[T,O,E]:[T,E,O]})})}):(0,X.jsxs)(He,{children:[T,E,O]})}var Sn={workflow:null,skills:[]},Cn=`cez-followup-selection`;function wn(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 Tn(){try{let e=localStorage.getItem(E(Cn));return e?wn(JSON.parse(e)):{...Sn}}catch{return{...Sn}}}function En(e){try{localStorage.setItem(E(Cn),JSON.stringify(e))}catch{}}var Dn=`cez-followup-prompt:`;function On(e){try{return localStorage.getItem(E(Dn+e))??``}catch{return``}}function kn(e,t){try{let n=E(Dn+e);t===``?localStorage.removeItem(n):localStorage.setItem(n,t)}catch{}}function An({item:e,workflows:t,skills:n,workflow:a,onWorkflowChange:s,selectedSkills:c,onSkillsChange:l,engine:u,onEngineChange:d,queuedRunId:f,onQueued:p}){let _=h(),v=i(),y=e.kind===`pr`?`PR`:`issue`,b=$(u),S=r(b.runner,b.account),C=c.filter(e=>S.unchecked||e.path===void 0||n.some(t=>t.id===e.id&&(e.path===void 0||t.path===e.path))),w=C.length!==c.length,[E]=(0,Y.useState)(()=>ln(e)),[D,O]=(0,Y.useState)(()=>On(e.url)||E),k=(0,Y.useRef)(null),A=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{kn(e.url,D===E?``:D)},[e.url,D,E]);let j=(0,Y.useMemo)(()=>Ke(v.data?.promptTemplates),[v.data?.promptTemplates]),te=e=>{let t=k.current,n=Ue({prompt:D,base:E,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:A.current}),r=Ye(D,n,e);O(r.text),A.current=r.caret,requestAnimationFrame(()=>{k.current?.focus(),k.current?.setSelectionRange(r.caret,r.caret)})},M=qe(j,C.map(e=>e.id)),N=(0,Y.useRef)(D);N.current=D;let F=(0,Y.useRef)(``);(0,Y.useEffect)(()=>{let e=Xe(N.current,F.current,M,E);F.current=e.applied,e.text!==N.current&&O(e.text)},[M,E]);let I=m({mutationFn:async()=>!b.canRun||w?null:ee(gn(e,a,C,D,vn(b))),onSuccess:t=>{if(t===null)return;let n=t;n&&p(e.url,n.id),x(`Added to the queue — ${y} #${e.number}`),C.length>0&&v.data!==void 0&&g({skillUsage:C.reduce((e,t)=>De(e,t.id),v.data.skillUsage)}).then(()=>_.invalidateQueries({queryKey:o.uiState})).catch(()=>{}),kn(e.url,``),O(E),F.current=``,_.invalidateQueries({queryKey:o.runs.all})},onError:e=>x(e.message,{tone:`danger`})}),ne=e=>{Je(e)&&(e.preventDefault(),!I.isPending&&b.canRun&&I.mutate())},L=e=>l(c.some(t=>U(t)===U(e))?c.filter(t=>U(t)!==U(e)):[...c,Ee(e)]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,X.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,X.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,X.jsx)(`span`,{children:`Instructions for the agent`}),(0,X.jsx)($e,{ref:k,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:D,onChange:e=>O(e.target.value),onSelect:e=>{A.current=e.currentTarget.selectionStart},onKeyDown:ne,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,X.jsx)(Ve,{templates:j,onInsert:te}),(0,X.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Workflow`}),(0,X.jsx)(Mn,{workflows:t,value:a,onChange:s})]}),(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Skills · select one or more`}),(0,X.jsx)(Pn,{skills:n,skillUsage:v.data?.skillUsage,selected:c,onToggle:L})]}),c.length>0?(0,X.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:c.map(e=>(0,X.jsx)(jn,{skill:e,skills:n,unchecked:S.unchecked,onRemove:()=>L(e)},U(e)))}):null,w?(0,X.jsx)(`p`,{role:`alert`,children:`A selected skill path is unavailable. Remove it or choose a current copy before starting.`}):null,(0,X.jsx)(xn,{layout:`row`,pick:u,onChange:d,disabled:I.isPending||!b.canRun,accounts:!0}),(0,X.jsxs)(`div`,{className:`gh-field`,children:[(0,X.jsx)(`span`,{children:`Account`}),(0,X.jsx)(Nn,{resolved:b,disabled:I.isPending||!b.canRun,onPick:e=>d({...u,account:e})})]}),!b.providerPending&&!b.canRun?(0,X.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[b.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,X.jsx)(B,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,X.jsxs)(`p`,{className:`text-xs 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,X.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[T(e.url)?(0,X.jsx)(z,{asChild:!0,variant:`outline`,children:(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,X.jsxs)(z,{variant:`primary`,"data-action":`gh-run`,disabled:I.isPending||!b.canRun||w,onClick:()=>I.mutate(),children:[(0,X.jsx)(ce,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,y]}),(0,X.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-xs font-medium text-muted-foreground`,children:Ge()}),f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,X.jsx)(B,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function jn({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,X.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,X.jsx)(F,{size:16,"aria-hidden":`true`,className:`size-3`})]})}function Mn({workflows:e,value:t,onChange:n}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),s=(0,Y.useRef)(null),c=Se(e,a);return(0,X.jsxs)(de,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,X.jsx)(le,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:w(We,t&&`border-foreground/60 font-mono text-xs font-semibold text-foreground`),children:[(0,X.jsx)(M,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,X.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,X.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ue,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(xe,{shouldFilter:!1,children:[(0,X.jsx)(ve,{placeholder:`Search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,X.jsxs)(be,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,X.jsx)(ye,{children:`Nothing matches.`}):null,(0,X.jsx)(V,{children:c.map(e=>{let r=t===e.name;return(0,X.jsxs)(H,{value:`workflow ${e.name}`,keywords:Te(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function Nn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:_,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,X.jsx)(W,{icon:(0,X.jsx)(ie,{"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 Pn({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),[c,l]=(0,Y.useState)(null),u=(0,Y.useRef)(null),{mostUsed:d,project:f,global:p,ranked:m}=Oe(e,o,t),h=(e,t)=>{let i=n.some(t=>U(t)===U(e));return(0,X.jsxs)(H,{value:U(e),keywords:Te(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.id,"data-selected":i?`true`:void 0,onSelect:()=>r(Ee(e)),children:[(0,X.jsx)(`span`,{className:w(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.path?(0,X.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:e.path}):null,e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,X.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,X.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},U(e))};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Fe,{skill:c,onClose:()=>l(null)}),(0,X.jsxs)(de,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,X.jsx)(le,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:w(We,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,X.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,X.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ue,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(xe,{shouldFilter:!1,children:[(0,X.jsx)(ve,{placeholder:`Search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,X.jsxs)(be,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[o.trim()&&!e.some(e=>e.id===o.trim())?(0,X.jsx)(V,{children:(0,X.jsxs)(H,{value:`typed-skill`,onSelect:()=>r({id:o.trim()}),children:[`Use skill id “`,o.trim(),`” (unchecked)`]})}):null,(m?m.length===0:d.length===0&&f.length===0&&p.length===0)?(0,X.jsx)(ye,{children:`Nothing matches.`}):null,m?m.length>0?(0,X.jsx)(V,{children:m.map(e=>h(e,Ce(e)))}):null:(0,X.jsxs)(X.Fragment,{children:[d.length>0?(0,X.jsx)(V,{heading:`Most used`,children:d.map(e=>h(e,Ce(e)))}):null,f.length>0?(0,X.jsx)(V,{heading:`Project skills`,children:f.map(e=>h(e,!0))}):null,p.length>0?(0,X.jsx)(V,{heading:`Global`,children:p.map(e=>h(e,!1))}):null]})]})]})})]})]})}var Fn=new WeakMap;function In(){let e=Tn(),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)&&En({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Ln(){let e=h(),{projectId:t}=b(),n=Fn.get(e);n||Fn.set(e,n=new Map);let a=n.get(t);a||n.set(t,a=In());let{snapshot:o,subscribe:s,update:c}=a,l=(0,Y.useSyncExternalStore)(s,o,o),u=f(),d=$(l.engine),p=r(d.runner,d.account),m=i(),g=u.data?.workflows;(0,Y.useEffect)(()=>{g&&l.workflow!==null&&!g.some(e=>e.name===l.workflow)&&c({workflow:null})},[c,g,l.workflow]);let _=(0,Y.useMemo)(()=>we(p.data??[],m.data?.skillUsage),[p.data,m.data?.skillUsage]);return{...l,workflows:u,skillList:_,skillsUnchecked:p.unchecked,setWorkflow:e=>c({workflow:e}),setSelectedSkills:e=>c({selectedSkills:e}),setEngine:e=>c({engine:e}),onQueued:(e,t)=>c({queued:new Map(o().queued).set(e,t)})}}export{sn as a,At as c,Ut as d,St as f,wt as h,nn as i,Lt as l,Et as m,An as n,cn as o,Ct as p,un as r,on as s,Ln as t,Dt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ft as e}from"./queries-D9mg7sFY.js";import{n as t}from"./project-location-BcjOhqun.js";function n(){return{home:e().data?.homeDir??null,root:t()}}export{n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Gt as r,O as i,Vt as a,k as o,un as s}from"./queries-D9mg7sFY.js";import{Cn as c,Fi as l,M as u,j as d,n as f,p,u as m}from"./toaster-2ud_VdfV.js";import{g as h}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as g}from"./dist-CCX8mhHc.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-BV_AiLj2.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DKr-j9S6.js";import{c as D,f as he,u as ge}from"./page-shell-BdjH5hyc.js";import{i as _e,l as ve,o as ye}from"./skills-pM_PouEs.js";import{t as be}from"./centered-state-N8vWM_Hw.js";import{$t as O,O as xe,an as k,en as A,in as Se,lr as j,nn as Ce,on as M,rn as N,tn as P,wn as F}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Gt as r,O as i,Vt as a,k as o,un as s}from"./queries-D9mg7sFY.js";import{Cn as c,Fi as l,M as u,j as d,n as f,p,u as m}from"./toaster-2ud_VdfV.js";import{g as h}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as g}from"./dist-CCX8mhHc.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,Z as re,a as b,ct as ie,dt as x,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as S,st as ue,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as C}from"./button-BV_AiLj2.js";import{i as w,o as pe,r as T,s as me,t as E}from"./dialog-DKr-j9S6.js";import{c as D,f as he,u as ge}from"./page-shell-BdjH5hyc.js";import{i as _e,l as ve,o as ye}from"./skills-pM_PouEs.js";import{t as be}from"./centered-state-N8vWM_Hw.js";import{$t as O,O as xe,an as k,en as A,in as Se,lr as j,nn as Ce,on as M,rn as N,tn as P,wn as F}from"./index-BV3EQb9T.js";import{t as I}from"./textarea-BGp28xFr.js";import{_ as L,a as we,c as Te,f as Ee,g as De,h as Oe,i as ke,m as Ae,n as je,o as Me,p as Ne,r as R,t as Pe,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as Ie}from"./option-select-DQJEHmHf.js";import{t as Le}from"./discard-changes-dialog-Bg-3Xbox.js";var z=e(t(),1);function B(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 Re(e,t){return{id:V(e,t),name:e,skill:e,prompt:`{{task}}`}}function V(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 r}function ze(e,t,n){return{id:V(e,n),[e]:t.trim()}}function H(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&H(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function U(e){return e.some(e=>{let t=H(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(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 Ue(e,t){return e.filter((e,n)=>n!==t)}function We(e){let t=e.map(e=>e.id),n=e.map(()=>({sources:[]}));return e.forEach((e,r)=>{if(!e.onFail)return;let i=e.onFail.retry,a=e.onFail.max??2,o=t.indexOf(i),s=n[r]?.sources??[];if(o===-1||o>=r){n[r]={link:{kind:o===-1?`missing`:`not-earlier`,target:i,max:a},sources:s};return}n[r]={link:{kind:`ok`,target:i,targetIndex:o,max:a},sources:s},n[o]?.sources.push(r)}),n}function W(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 G(e,t,n){let r=` `.repeat(n);return!t.includes(`
|
|
2
2
|
`)||/^\s/.test(t)?[`${r}${e}: ${W(t)}`]:[`${r}${e}: |`,...t.split(`
|
|
3
3
|
`).map(e=>`${r} ${e}`)]}function K(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${W(e.name)}`),e.skill&&t.push(` skill: ${W(e.skill)}`),t}function q(e){let t=[];return e.model&&t.push(` model: ${W(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${W(e.effort)}`),e.runner&&t.push(` runner: ${W(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${W(e.agentProfile)}`),t}function J(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(W).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(W).join(`, `)}]`),t}function Y(e){return e.onFail?[` onFail:`,` retry: ${W(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function Ge(e){return[` - id: ${W(e.id)}`,...K(e),...e.prompt?G(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${W(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...q(e),...J(e),...e.command?G(`command`,e.command,4):[],...Y(e)]}function Ke(e,t,n){let r=[`name: ${W(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...G(`description`,t.trim(),0));let i=B(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${W(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...Ge(e))}else r.push(`skills: []`);return`${r.join(`
|
|
4
4
|
`)}\n`}function qe(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`chain`}function Je(e){let t=B(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Ye(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 Xe(e,t,n){let r=B(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var X=n(),Z=[{value:`skill`,label:`Skill`,icon:S},{value:`prompt`,label:`Prompt`,icon:te},{value:`command`,label:`Command`,icon:le}],Q={prompt:{field:`Prompt the agent runs`,placeholder:`Review the change for {{task}}…`,add:`Add prompt step`,blank:`A prompt step needs text.`},command:{field:`Shell command`,placeholder:`npm test`,add:`Add command step`,blank:`A command step needs text.`}};function Ze({kind:e,onKindChange:t}){return(0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":`Step kind`,"data-slot":`wb-add-kind`,className:`grid grid-cols-3 gap-0.5 rounded-lg border border-border bg-muted/60 p-1 sm:inline-flex sm:w-fit`,children:Z.map(n=>(0,X.jsxs)(`label`,{className:g(`flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-md border border-transparent px-2 py-1.5 sm:px-3 text-[13px] font-medium transition-colors has-[:focus-visible]:outline-2`,e===n.value?`border-border bg-card text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(`input`,{type:`radio`,name:`workflow-add-kind`,className:`sr-only`,value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),(0,X.jsx)(n.icon,{"aria-hidden":`true`,className:`size-3.5 max-sm:hidden`}),n.label]},n.value))})}function Qe({query:e,onQueryChange:t,matches:n,skillsCount:r,error:i,selectedSkill:a,onSelectSkill:o}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{"aria-label":`Filter skills`,placeholder:`Filter skills…`,value:e,onChange:e=>t(e.target.value)}),i===null?(0,X.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Available skills`,className:`grid max-h-80 gap-2 overflow-y-auto`,children:[n.map(e=>(0,X.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,X.jsx)(`input`,{type:`radio`,name:`workflow-add-skill`,className:`sr-only`,value:e.id,checked:a===e.id,onChange:()=>o(e.id)}),(0,X.jsxs)(`span`,{className:`min-w-0 break-words text-sm`,children:[(0,X.jsx)(`span`,{className:`block`,children:e.name}),(0,X.jsx)(`span`,{className:`mt-2 block text-xs text-muted-foreground`,children:e.description}),e.path?(0,X.jsx)(`span`,{className:`block break-all text-xs`,children:e.path}):null]})]},JSON.stringify([e.id,e.path]))),n.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?`No skills available in this project.`:`No matching skills.`}):null]}):(0,X.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not load skills: `,i]}),e.trim()&&!n.some(t=>t.id===e.trim())?(0,X.jsxs)(C,{onClick:()=>o(e.trim()),children:[`Use skill id “`,e.trim(),`” (unchecked)`]}):null]})}function $e({open:e,onOpenChange:t,kind:n,onKindChange:r,text:i,onTextChange:a,stepsCount:o,onCloseAutoFocus:s,onCancel:c,onAdd:l,onAddText:u,...d}){let f=o>=8,p=d.selectedSkill;return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{"data-slot":`wb-add-dialog`,onCloseAutoFocus:s,className:`max-h-[85dvh] overflow-y-auto sm:max-w-[660px] [&_button:not([data-button-size])]:min-h-11`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Add step`}),(0,X.jsx)(w,{className:`sr-only`,children:`Choose a skill, write a prompt or a shell command to append to this workflow.`})]}),(0,X.jsx)(Ze,{kind:n,onKindChange:r}),n===`skill`?(0,X.jsx)(Qe,{...d}):(0,X.jsx)(I,{"aria-label":Q[n].field,placeholder:Q[n].placeholder,value:i,rows:4,className:g(n===`command`&&`font-mono`),onChange:e=>a(e.target.value)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,X.jsx)(C,{variant:`outline`,onClick:c,children:`Cancel`}),n===`skill`?(0,X.jsx)(C,{variant:`primary`,disabled:!p||f,onClick:()=>{p&&l(p)},children:`Add selected skill`}):(0,X.jsx)(C,{variant:`primary`,disabled:!i.trim()||f,onClick:()=>u(n,i),children:Q[n].add})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Append the new step, then reorder it in the existing canvas.`}),f?(0,X.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 et({kind:e,text:t,index:n,editing:r,onTextChange:i}){let a=(0,z.useId)(),o=!t.trim();return(0,X.jsxs)(X.Fragment,{children:[r?(0,X.jsx)(I,{"data-slot":`wb-step-text`,"aria-label":`Step ${n+1} ${e}`,"aria-invalid":o||void 0,"aria-describedby":o?a:void 0,value:t,rows:3,className:g(`mt-2`,e===`command`&&`font-mono`),onChange:e=>i(e.target.value)}):null,o?(0,X.jsx)(`p`,{id:a,"data-slot":`wb-step-text-error`,className:`mt-1 text-xs text-danger`,children:Q[e].blank}):null]})}function tt({kind:e,index:t,editing:n,onEditingChange:r}){return(0,X.jsxs)(C,{variant:`outline`,size:`sm`,"data-slot":`wb-step-edit`,"aria-label":n?`Done editing step ${t+1}`:`Edit ${e} of step ${t+1}`,"aria-expanded":n,onClick:()=>r(!n),children:[n?(0,X.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}):(0,X.jsx)(v,{"aria-hidden":`true`,className:`size-4`}),n?`Done`:`Edit ${e}`]})}function nt({workflows:e,trimmedName:t,onLoadWorkflow:n}){return(0,X.jsx)(Ie,{id:`workflow-load`,"data-slot":`wb-load-picker`,"data-page-shell-action":``,"aria-label":`Workflow`,value:e.some(e=>e.name===t)?t:``,placeholder:`Choose a workflow`,onValueChange:t=>{let r=e.find(e=>e.name===t);r&&n(r)},options:e.map(e=>({value:e.name,label:e.name})),className:`w-56 max-w-full min-w-0 border-border bg-card font-medium text-foreground max-md:w-full`})}function rt({draft:e,trimmedName:t,nameRef:n,onDraft:r,renamedFrom:i}){return(0,X.jsxs)(`section`,{"data-slot":`wb-details`,"data-reports-dirty":``,className:`flex min-w-0 flex-col gap-3`,children:[(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Name`}),(0,X.jsx)(j,{id:`workflow-name`,ref:n,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:e.name,"aria-describedby":i===void 0?void 0:`workflow-rename-note`,onChange:t=>r({...e,name:t.target.value}),className:`h-10 bg-card text-sm max-md:h-11 @xl:max-w-sm`}),(0,X.jsx)(`p`,{id:`workflow-rename-note`,"aria-live":`polite`,className:`text-xs text-muted-foreground empty:hidden @xl:col-start-2`,children:i===void 0?null:(0,X.jsxs)(`span`,{"data-slot":`wb-rename-note`,children:[`Saving creates a new workflow “`,t,`”. “`,i,`” stays as it is.`]})})]}),(0,X.jsxs)(`div`,{"data-slot":`wb-details-line`,className:`grid min-w-0 gap-1.5 @xl:grid-cols-[96px_minmax(0,1fr)] @xl:items-center @xl:gap-x-3`,children:[(0,X.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,X.jsx)(I,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,placeholder:`What this workflow does`,value:e.description,onChange:t=>r({...e,description:t.target.value}),className:`min-h-10 w-full bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function it({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,X.jsxs)(`div`,{"data-slot":`wb-actions`,className:`contents`,children:[(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-import`,onClick:n,children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-4`}),`Import`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-export`,title:`Download workflow.yaml`,onClick:r,children:[(0,X.jsx)(de,{"aria-hidden":`true`,className:`size-4`}),`Export`]}),(0,X.jsxs)(D,{type:`button`,variant:`outline`,"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,X.jsx)(x,{"aria-hidden":`true`,className:`size-4`}),`Auto-build`]}),(0,X.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,X.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`wb-delete`,className:`text-danger hover:text-danger`,title:`Delete the saved workflow file`,onClick:a,children:[(0,X.jsx)(ue,{"aria-hidden":`true`,className:`size-4`}),`Delete`]}):null]})}function at({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,X.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button:not([data-button-size])]:min-h-11`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,X.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,X.jsx)(I,{"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,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,X.jsxs)(C,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,X.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,X.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,X.jsx)(se,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,X.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function ot({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,X.jsx)(E,{open:e,onOpenChange:t,children:(0,X.jsxs)(T,{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:not([data-button-size])]:min-h-11`,children:[(0,X.jsx)(me,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,X.jsx)(w,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,X.jsx)(I,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Yt as i,en as a,vt as o,xt as s}from"./queries-D9mg7sFY.js";import{n as c}from"./toaster-2ud_VdfV.js";import{n as l}from"./chunk-KS7C4IRE-BdLLx37K.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-BV_AiLj2.js";import{t as p}from"./status-dot-DTU7afRv.js";import{f as m,o as h}from"./page-shell-BdjH5hyc.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{In as _,Rn as v,cn as y,cr as b,or as x,sn as S,ur as C}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Yt as i,en as a,vt as o,xt as s}from"./queries-D9mg7sFY.js";import{n as c}from"./toaster-2ud_VdfV.js";import{n as l}from"./chunk-KS7C4IRE-BdLLx37K.js";import{t as u}from"./chevron-right-BENZ-1ZN.js";import{t as d}from"./external-link-BE6y205O.js";import{t as f}from"./button-BV_AiLj2.js";import{t as p}from"./status-dot-DTU7afRv.js";import{f as m,o as h}from"./page-shell-BdjH5hyc.js";import{t as g}from"./agents-settings-path-7X6_cvUg.js";import{In as _,Rn as v,cn as y,cr as b,or as x,sn as S,ur as C}from"./index-BV3EQb9T.js";var w=e(t(),1),T=n();function E(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,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e},t):(0,T.jsx)(`span`,{children:e},t))}return n.map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>2?(0,T.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.slice(1,-1)},t):e?(0,T.jsx)(`span`,{children:e},t):null)}function D(e,t){let n=i(t,e);return n?{label:n.displayName,isAgent:!0}:{label:e,isAgent:!1}}function O({mode:e,version:t,rawVersion:n}){return e?(0,T.jsx)(`span`,{"data-slot":`tool-dry-run`,title:n,className:`shrink-0 rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:e.label}):t?(0,T.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`· `,t]}):null}var k=`text-xs font-medium`;function A({projectsDir:e,home:t,onAction:n}){return(0,T.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-card-edge bg-card px-6 py-4 shadow-card max-md:px-4`,"aria-labelledby":`projects-heading`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{id:`projects-heading`,className:`text-sm font-semibold text-foreground`,children:`Projects`}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-[1.5] text-muted-foreground`,children:`Start a repository, open a local folder, or clone from GitHub.`})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,"data-action":`new-project`,onClick:()=>n(`new`),children:`New project`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`local`),children:`Open local folder`}),(0,T.jsx)(f,{variant:`outline`,size:`sm`,className:k,onClick:()=>n(`clone`),children:`Clone from GitHub`})]})]}),e?(0,T.jsxs)(`p`,{"data-slot":`projects-checkout`,className:`flex min-w-0 items-baseline gap-1.5 text-xs text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:`New clones go to`}),(0,T.jsx)(v,{value:e,bases:{home:t,root:null},className:`text-foreground`})]}):null]})}function j({recovery:e}){let t=`${k} ml-auto`;return e.kind===`settings`?(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(l,{to:e.to,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})}):(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:t,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-slot":`tool-setup`,children:[e.label,(0,T.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})})}function M({health:e,runners:t,copying:n,onCopy:r,recheckStatus:i,onRecheck:a}){return(0,T.jsxs)(`section`,{className:`space-y-4 rounded-xl border border-card-edge bg-card p-6 shadow-card max-md:p-4`,"aria-labelledby":`tools-heading`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{id:`tools-heading`,className:`text-base font-semibold text-foreground`,children:`Tools diagnostics`}),(0,T.jsx)(`p`,{className:`mt-1 text-[13px] leading-[1.5] text-muted-foreground`,children:`Check the tools available to this local workspace.`})]}),(0,T.jsx)(f,{asChild:!0,variant:`outline`,size:`sm`,className:k,children:(0,T.jsxs)(l,{to:g,"data-slot":`tools-settings`,children:[`Tool settings`,(0,T.jsx)(u,{className:`size-3.5 shrink-0`,"aria-hidden":`true`})]})})]}),e.isError?(0,T.jsx)(`p`,{role:`alert`,className:`text-sm text-semantic-red`,children:`Could not refresh tool diagnostics. Recheck to retry.`}):null,!e.data&&!e.isError?(0,T.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Checking installed tools…`}):null,e.data?(0,T.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=S(e),r=D(e.name,t),i=_(e),a=y(e,t);return(0,T.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,T.jsxs)(`dt`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(p,{tone:i.availability.tone,shape:i.availability.shape}),(0,T.jsx)(`span`,{className:r.isAgent?`text-[14px] font-semibold text-foreground`:`font-mono text-[13px] font-semibold text-foreground`,children:r.label})]}),(0,T.jsxs)(`dd`,{className:`flex min-w-0 items-center gap-x-1.5 text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`shrink-0`,children:i.availability.label}),(0,T.jsx)(O,{mode:i.mode,version:i.version,rawVersion:i.rawVersion}),a?(0,T.jsx)(j,{recovery:a}):null]}),n?(0,T.jsx)(`dd`,{"data-slot":`tool-hint`,className:`min-w-0 break-words text-xs leading-relaxed text-muted-foreground sm:col-start-2`,children:E(n)}):null]},e.name)})}):null,e.data?.checks.length===0?(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tool diagnostics reported by this server.`}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,T.jsx)(f,{variant:`outline`,className:`rounded-lg px-3.5 text-xs font-medium`,disabled:e.isFetching,onClick:()=>void a(),children:e.isFetching?`Checking tools…`:`Recheck tools`}),(0,T.jsx)(f,{variant:`outline`,className:`rounded-lg px-3.5 text-xs font-medium`,disabled:!e.data||n,onClick:()=>void r(),children:n?`Copying…`:`Copy diagnostics`}),(0,T.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-xs text-muted-foreground`,children:i?(0,T.jsx)(`span`,{"data-slot":`recheck-status`,children:i}):null})]})]})}function N(e,t){let n=e.filter(e=>e.available).length;return`Rechecked at ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} — ${n} of ${e.length} ${e.length===1?`tool`:`tools`} available.`}function P(){let e=o(),t=s().data?.projectsDir,n=r().data?.homeDir??null,i=a().data,[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(!1),[p,g]=(0,w.useState)(null),_=async()=>{g(null);let t=await e.refetch();t.isError||!t.data||g(N(t.data.checks,new Date))},v=async()=>{if(!(!e.data||d)){f(!0);try{await navigator.clipboard.writeText(JSON.stringify({version:e.data.version,checks:e.data.checks},null,2)),c(`Diagnostics copied`)}catch{c(`Could not copy diagnostics. Please try again.`,{tone:`danger`})}finally{f(!1)}}},y=e.data?.checks.length??4;return(0,T.jsxs)(h,{route:`workspace-tools`,density:e.data?m(y):`full`,bodyClassName:`gap-5`,header:{title:`Workspace tools`,subtitle:`Check local CLI tools, then add projects.`},children:[(0,T.jsx)(M,{health:e,runners:i,copying:d,onCopy:v,recheckStatus:p,onRecheck:_}),(0,T.jsx)(A,{projectsDir:t,home:n,onAction:u}),l===`new`?(0,T.jsx)(x,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`local`?(0,T.jsx)(C,{open:!0,onOpenChange:e=>{e||u(null)}}):null,l===`clone`?(0,T.jsx)(b,{open:!0,onOpenChange:e=>{e||u(null)}}):null]})}export{P as WorkspaceToolsRoute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Vt as r,g as i,un as a,vt as o}from"./queries-D9mg7sFY.js";import{Cn as s,Fi as c,I as l,Kn as u,n as d,qn as f}from"./toaster-2ud_VdfV.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-CwD1firw.js";import{t as h}from"./centered-state-N8vWM_Hw.js";import{_r as g}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Vt as r,g as i,un as a,vt as o}from"./queries-D9mg7sFY.js";import{Cn as s,Fi as c,I as l,Kn as u,n as d,qn as f}from"./toaster-2ud_VdfV.js";import{d as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./project-router-CwD1firw.js";import{t as h}from"./centered-state-N8vWM_Hw.js";import{_r as g}from"./index-BV3EQb9T.js";import{n as _,r as v,t as y}from"./remote-settings-notice-CUK4ZFYF.js";import{n as b}from"./settings-field-AyinSFR_.js";import{n as x}from"./project-location-BcjOhqun.js";import{r as S}from"./settings-save-bar-cyvALSgW.js";import{n as C}from"./saved-draft-BwzBc-_Y.js";var w=e(t(),1),T=n();function E({copy:e,savedCommandCount:t,settingsAdmin:n,configPath:r,issue:i,invalid:a,children:o}){let s=e.slot;return(0,T.jsxs)(T.Fragment,{children:[t===0&&i===null?(0,T.jsx)(`p`,{"data-slot":`${s}-empty`,className:`text-xs text-muted-foreground`,children:e.empty}):null,o,n===!1?(0,T.jsxs)(`p`,{"data-slot":`${s}-readonly`,className:`text-xs text-foreground`,children:[`Edit `,(0,T.jsxs)(`code`,{children:[e.key,`.commands`]}),` in`,` `,r===null?(0,T.jsxs)(T.Fragment,{children:[`the project’s `,(0,T.jsx)(`code`,{children:`.ai/cezar/config.json`})]}):(0,T.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,T.jsx)(`code`,{children:y}),`.`]}):null,i===null?null:(0,T.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,T.jsx)(`p`,{"data-slot":`${s}-invalid`,className:`text-xs text-danger`,children:a})]})}function D(e,t){let n=e.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(e=>e!==``),r=Number(t);return{commands:n,timeoutSeconds:r,invalid:n.length>20?`Enter at most 20 commands.`:n.some(e=>e.length>4e3)?`Keep each command under ${u.toLocaleString(`en-US`)} characters.`:t.trim()===``||!Number.isInteger(r)||r<1||r>7200?`Enter a whole number of seconds from 1 to ${f}.`:null}}var O={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.`},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.`}};function k(e,t){return t?`One command per line, for example: ${e.example}`:void 0}function A({config:e,copy:t}){let n=c(),i=o(),u=v(),p=x(),m=p===null?null:`${p.replace(/\/$/,``)}/.ai/cezar/config.json`,h=i.data?.capabilities?.settingsAdmin===!0,g=e[t.key],y=e[t.issueKey],O=g?.commands??[],A=g?.timeoutSeconds??900,[j,M]=C(O.join(`
|
|
3
3
|
`)),[N,P]=C(String(A)),{commands:F,timeoutSeconds:I,invalid:L}=D(j,N),R=F.length===O.length&&F.every((e,t)=>e===O[t])&&(F.length===0||I===A),z=a({mutationFn:e=>l(e),onSuccess:e=>{n.setQueryData(r.config,e),M(F.join(`
|
|
4
4
|
`))},onError:e=>{d(e.message,{tone:`danger`}),e instanceof s&&e.status===409&&u()}}),B=()=>z.mutateAsync({[t.key]:F.length===0?null:{commands:F,...I===900?{}:{timeoutSeconds:I}}}),[V,H]=(0,w.useState)(null);S({dirty:h&&(y!==null&&y!==V||!R),holdsReload:h&&!R,invalid:L!==null,save:B,discard:()=>{M(O.join(`
|
package/web/dist/index.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
}
|
|
60
60
|
})()
|
|
61
61
|
</script>
|
|
62
|
-
<script type="module" crossorigin src="/assets/index-
|
|
62
|
+
<script type="module" crossorigin src="/assets/index-BV3EQb9T.js"></script>
|
|
63
63
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="/assets/host-context-DDbYAKpm.js">
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
<link rel="modulepreload" crossorigin href="/assets/centered-state-N8vWM_Hw.js">
|
|
127
127
|
<link rel="modulepreload" crossorigin href="/assets/html-report-BX3msvci.js">
|
|
128
128
|
<link rel="stylesheet" crossorigin href="/assets/page-shell-CEIoW56O.css">
|
|
129
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
129
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bh7COq0B.css">
|
|
130
130
|
</head>
|
|
131
131
|
<body>
|
|
132
132
|
<div id="root"></div>
|