@staff0rd/assist 0.1188.0 → 0.1189.1
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/.build-files +173 -174
- package/dist/{acceptanceCriteria-BTQDLULJ.js → acceptanceCriteria-Z7IS3JQO.js} +1 -1
- package/dist/{add-MZCK3R75.js → add-R7G76G7G.js} +3 -3
- package/dist/{addActivity-IJ7GPTGZ.js → addActivity-UKZ2MJZY.js} +6 -6
- package/dist/{addPhase-ORSNDH7W.js → addPhase-N73554MQ.js} +9 -9
- package/dist/{advise-ZVSZMEXH.js → advise-XBZMABJX.js} +7 -7
- package/dist/{ask-U5DHNRPN.js → ask-PLVOYYSQ.js} +5 -5
- package/dist/{askCheck-A2XWWDWT.js → askCheck-3JRXFKWA.js} +12 -12
- package/dist/{askDesign-WMNM7RLO.js → askDesign-JEJFPAEZ.js} +7 -7
- package/dist/{askQuestion-HH2PCX3D.js → askQuestion-QRQSYRXK.js} +4 -4
- package/dist/{associateGithub-C6SLR3UC.js → associateGithub-3QPKQWBG.js} +4 -3
- package/dist/{associateJira-WOGV7V3U.js → associateJira-WE6KVOXN.js} +1 -1
- package/dist/{branch-ALJBAHML.js → branch-I7ECHXRK.js} +7 -8
- package/dist/built-version +1 -1
- package/dist/{check-QRHG4J7G.js → check-ID7FFCHZ.js} +3 -3
- package/dist/{chunk-ORSRBZ2X.js → chunk-2T5HRFWP.js} +1 -1
- package/dist/{chunk-XY5OS2GH.js → chunk-4AZGXA6X.js} +1 -1
- package/dist/{chunk-LSBUNT4X.js → chunk-5Q7MUHCK.js} +4 -3
- package/dist/{chunk-PDXOHW2M.js → chunk-5QXAQCAJ.js} +2 -2
- package/dist/{chunk-SSRDOW3C.js → chunk-5S5DDD5H.js} +1 -1
- package/dist/{chunk-ND2FWXCR.js → chunk-627BOMSN.js} +1 -1
- package/dist/{chunk-OZTCLQ2P.js → chunk-6SKKK2RR.js} +1 -1
- package/dist/{chunk-UZCVA7F5.js → chunk-7EBZ3T5F.js} +9 -9
- package/dist/{chunk-66T4P3GU.js → chunk-A27F2WNF.js} +1 -1
- package/dist/{chunk-HPV2ZVOX.js → chunk-BOXQXHJ3.js} +1 -1
- package/dist/{chunk-7DSWCPDZ.js → chunk-C5FRRC73.js} +1 -1
- package/dist/{chunk-RVABNGZW.js → chunk-CDDJAXEJ.js} +13 -16
- package/dist/{chunk-CPJ3KOSP.js → chunk-D24GLTCK.js} +1 -1
- package/dist/{chunk-DIAC4XYA.js → chunk-DP5YM3WJ.js} +1 -1
- package/dist/{chunk-HCANRBFK.js → chunk-DPHNPX75.js} +1 -1
- package/dist/{chunk-ZKH6WPY5.js → chunk-DQUUWYB3.js} +6 -2
- package/dist/{chunk-RYYZPXIG.js → chunk-EH45Y7OB.js} +1 -1
- package/dist/{chunk-WGDN4CNI.js → chunk-EOUZVOHM.js} +1 -1
- package/dist/{chunk-SN2GTNL4.js → chunk-EQZXAFIP.js} +1 -1
- package/dist/{chunk-XXUZRL3Q.js → chunk-ETL3RMC4.js} +2 -2
- package/dist/{chunk-IT5MTJVS.js → chunk-FBKXEMIP.js} +1 -1
- package/dist/{chunk-DZBGDSCK.js → chunk-FGCGH2CT.js} +1 -1
- package/dist/{chunk-SSOJWOYS.js → chunk-FKM6PT3Q.js} +1 -1
- package/dist/{chunk-6SOPR77J.js → chunk-G5GN2KBP.js} +1 -1
- package/dist/{chunk-6ON5FZRW.js → chunk-G7UI2W7U.js} +1 -1
- package/dist/{chunk-JH524KAM.js → chunk-HBEQCMHL.js} +2 -2
- package/dist/{chunk-RSSSZURM.js → chunk-HCSEDZIN.js} +1 -1
- package/dist/{chunk-AUATODOI.js → chunk-HEFN57NV.js} +21 -11
- package/dist/{chunk-DISNKALJ.js → chunk-HR7HIPYM.js} +2 -2
- package/dist/{chunk-UGICWHVH.js → chunk-HXWJKXQQ.js} +1 -1
- package/dist/{chunk-F42QFS5Z.js → chunk-IFMJH2XY.js} +2 -2
- package/dist/{chunk-3THS5WUD.js → chunk-IOAF6P3G.js} +1 -1
- package/dist/{chunk-PNDUTAZR.js → chunk-IS5SG2SN.js} +6 -6
- package/dist/{chunk-6VCFPUNV.js → chunk-IXDML4IQ.js} +9 -9
- package/dist/{chunk-XTQP2MUZ.js → chunk-JDYC4JZQ.js} +1 -1
- package/dist/{chunk-WXAG6MRL.js → chunk-JJKRUHWS.js} +1 -1
- package/dist/{chunk-QQDELJQD.js → chunk-JS2XXDJN.js} +4 -4
- package/dist/{chunk-VAGZIGNN.js → chunk-JUVR4JSY.js} +1 -1
- package/dist/{chunk-QQVNL74P.js → chunk-K5JPUERO.js} +1 -1
- package/dist/{chunk-FJLEKQLN.js → chunk-KMLHCI35.js} +11 -3
- package/dist/{chunk-E2IZIDQ3.js → chunk-LMGUZFL5.js} +3 -3
- package/dist/{chunk-5MJTFJGT.js → chunk-LQFDAJIS.js} +1 -1
- package/dist/{chunk-UNIH25QO.js → chunk-MD6T7L6G.js} +1 -1
- package/dist/{chunk-ANCYNQJA.js → chunk-MPY2OF65.js} +3 -3
- package/dist/{chunk-JW6QOUMN.js → chunk-NT7WJQ6X.js} +1 -1
- package/dist/{chunk-NA7DJG7B.js → chunk-O3YZV2FA.js} +1 -1
- package/dist/{chunk-M6MAQU3Z.js → chunk-P7SERZI6.js} +1 -1
- package/dist/{chunk-FZDQG67V.js → chunk-PCJ25T4O.js} +2 -2
- package/dist/{chunk-KTUSVJW3.js → chunk-POV5HHVD.js} +2 -2
- package/dist/{chunk-5UX4ZTFR.js → chunk-PPPKJV3H.js} +8 -11
- package/dist/{chunk-ZDWZ2VI3.js → chunk-PS3TSUFD.js} +1 -1
- package/dist/{chunk-7NPZZRMK.js → chunk-PVJZDW3D.js} +4 -4
- package/dist/{chunk-QFY6KBY4.js → chunk-PXXN6TT2.js} +2 -2
- package/dist/{chunk-6GYYLGSL.js → chunk-QADVHG7P.js} +1 -1
- package/dist/{chunk-D454WT4M.js → chunk-QO3TSFL2.js} +1 -1
- package/dist/{chunk-XDIVXGPQ.js → chunk-R62CNGZO.js} +7 -13
- package/dist/{chunk-2HT3GIJD.js → chunk-SO3IBV6J.js} +9 -5
- package/dist/{chunk-AFN4FULQ.js → chunk-UC5YRU4P.js} +5 -8
- package/dist/{chunk-YJL4PXQB.js → chunk-UNQHDBU5.js} +2 -2
- package/dist/{chunk-HCYTW3DN.js → chunk-USXVRG3R.js} +2 -2
- package/dist/{chunk-4QF7YVZ5.js → chunk-UT4KBNN4.js} +3 -3
- package/dist/{chunk-TM3TO23X.js → chunk-VLJWAMAH.js} +2 -2
- package/dist/{chunk-26ZJFULO.js → chunk-WNX2SQIT.js} +2 -2
- package/dist/{chunk-VVN4TAH6.js → chunk-XCMXBJ67.js} +2 -2
- package/dist/{chunk-LKRWILE6.js → chunk-YO266JVW.js} +1 -1
- package/dist/{chunk-7TAUUXVY.js → chunk-YTUCNHG7.js} +1 -1
- package/dist/{chunk-NE4V3VA5.js → chunk-Z7CPIHXT.js} +1 -1
- package/dist/{chunk-QYYVW7BX.js → chunk-ZNA4X3WZ.js} +2 -2
- package/dist/{chunk-N3QOIXVQ.js → chunk-ZQCL465S.js} +2 -2
- package/dist/{chunk-SY4PNEQP.js → chunk-ZQGAGLBO.js} +2 -2
- package/dist/{chunk-BFQSGIN6.js → chunk-ZRIBI33P.js} +1 -1
- package/dist/{chunk-C6WGPBBN.js → chunk-ZWPML4IH.js} +1 -1
- package/dist/{cliHook-2K2PQZOJ.js → cliHook-73D3GLQ6.js} +10 -10
- package/dist/{cliHookCheck-AWYDTDE5.js → cliHookCheck-PMQBVFAV.js} +5 -5
- package/dist/{codeCommentSet-PHABBDQP.js → codeCommentSet-PI3AKFET.js} +4 -4
- package/dist/{codexHook-HLMVUPGF.js → codexHook-WGJ4XIVO.js} +12 -12
- package/dist/{codexHookTrust-YYBCCR7P.js → codexHookTrust-2IW2D4XD.js} +2 -2
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/{comment-O7CAONH7.js → comment-5VFL65DI.js} +8 -8
- package/dist/{commentIssue-4IYYW234.js → commentIssue-JQCEL3GH.js} +5 -5
- package/dist/{commit-TMVTH55J.js → commit-UBFHBWPL.js} +63 -50
- package/dist/coverage-FZKHWD7V.js +30 -0
- package/dist/{createIssue-TDZZAPQQ.js → createIssue-ZEZ4APQ7.js} +7 -7
- package/dist/{docsUnlock-27IXZHHP.js → docsUnlock-JTCIE32Q.js} +5 -5
- package/dist/{doctorNodes-J65UAEA6.js → doctorNodes-5ELOM4GO.js} +3 -3
- package/dist/{done-3VAD7V2R.js → done-YSG44MAX.js} +7 -7
- package/dist/{edit-R2ZKDIGP.js → edit-CGFJYKXA.js} +6 -6
- package/dist/{editHook-S6MCRMW4.js → editHook-LIRUJTEJ.js} +10 -10
- package/dist/{editIssue-RBWIZISY.js → editIssue-X4C4ULTM.js} +7 -7
- package/dist/{editIssueComment-3E3SBBJE.js → editIssueComment-L6RLH4GX.js} +8 -8
- package/dist/{fixConflict-ORCRRXKK.js → fixConflict-5JCFZ2XI.js} +6 -6
- package/dist/{fixed-Y4CY77XC.js → fixed-URDHVG6F.js} +8 -9
- package/dist/index.js +119 -119
- package/dist/{init-TXWUSTMQ.js → init-IIKNVPHD.js} +1 -1
- package/dist/{init-TNGZPSA5.js → init-NWHLIEFT.js} +2 -2
- package/dist/{inspect-PFLCMDPC.js → inspect-6WWA6KRF.js} +26 -18
- package/dist/{jiraAuth-4Z5EVL7A.js → jiraAuth-WYWRFU44.js} +10 -6
- package/dist/{launchMode-V5JZGAQP.js → launchMode-OWNRIQDE.js} +20 -21
- package/dist/{lint-5AA42LMF.js → lint-6VLQFO4Y.js} +3 -3
- package/dist/{list-Y6M6QQTB.js → list-HK2TLDFA.js} +1 -2
- package/dist/{list-ZX7F2OVV.js → list-UISZTO6R.js} +8 -8
- package/dist/{listComments-CTM5UMWI.js → listComments-JOZBDVEL.js} +5 -5
- package/dist/{migrate-DLSTMFQW.js → migrate-ZHCPLIYA.js} +18 -11
- package/dist/{migrations-SJDOA65U.js → migrations-RCUFQMKT.js} +7 -6
- package/dist/{newCli-4FUEKQTH.js → newCli-4TOKKGIR.js} +28 -20
- package/dist/{newProject-UG7JLZE5.js → newProject-XYIY27BQ.js} +1 -1
- package/dist/{next-MUFPBSR3.js → next-B2BBVZPZ.js} +19 -20
- package/dist/{next-LYYOYPYK.js → next-R4LL53TW.js} +1 -1
- package/dist/{noVenv-DONW2S6P.js → noVenv-5SN25UJR.js} +4 -3
- package/dist/{notify-ZCHPP6ME.js → notify-ZLGE4CCO.js} +3 -3
- package/dist/{permitCliReads-6FVIMWRO.js → permitCliReads-LPRVXYMU.js} +3 -3
- package/dist/{phaseDone-RP54LWOJ.js → phaseDone-YJAHCOSB.js} +8 -8
- package/dist/{piHook-RPXIGRLL.js → piHook-I3ZWJEB7.js} +10 -10
- package/dist/{postSlackMessage-USP3GJV3.js → postSlackMessage-LCK42KAO.js} +5 -5
- package/dist/{printComments-7ROHUEPO.js → printComments-EMV3SE6H.js} +3 -3
- package/dist/{propose-AA5ND2CO.js → propose-OCR3WXJK.js} +10 -10
- package/dist/{prs-2SRUKVTI.js → prs-RSBCBF4N.js} +17 -5
- package/dist/{prsStatus-6G3ZTK36.js → prsStatus-AEZDQ4HE.js} +17 -5
- package/dist/{pullIfConfigured-ATTGJC3C.js → pullIfConfigured-AJ6X5WXS.js} +1 -1
- package/dist/{raise-BUPAYCZY.js → raise-SJ5JLPBS.js} +20 -16
- package/dist/{ravendbAuth-QCLMPEJ3.js → ravendbAuth-SDXPMPDN.js} +5 -5
- package/dist/{ravendbCollections-L4H5PMFE.js → ravendbCollections-DLILEMS5.js} +1 -1
- package/dist/{ravendbQuery-Z4HJQ2MU.js → ravendbQuery-V3EUJBF3.js} +1 -1
- package/dist/{readTime-HERHP2II.js → readTime-ZEHDGH7D.js} +11 -7
- package/dist/{refine-B5J2AJSZ.js → refine-7U4G6XCC.js} +21 -22
- package/dist/{releasesConfigure-7OOTDLID.js → releasesConfigure-UZEGE5B6.js} +2 -2
- package/dist/{reply-GTYV733P.js → reply-VL6NV6IF.js} +9 -9
- package/dist/{resolveHarness-ADZRYQZA.js → resolveHarness-CRWWVE4U.js} +2 -2
- package/dist/{resolveModel-2OGVGUM3.js → resolveModel-2I3SVZKR.js} +2 -2
- package/dist/{restartNode-LKXFQH7A.js → restartNode-7UBTJEIK.js} +5 -5
- package/dist/{restructure-OGGDZTXX.js → restructure-S6KIV6TM.js} +2 -2
- package/dist/{review-5635HCXL.js → review-76EOEYFP.js} +76 -44
- package/dist/{reviewPrComments-E5Y5AQ7D.js → reviewPrComments-KV5QES7A.js} +6 -6
- package/dist/{rewindPhase-S6NGWRFK.js → rewindPhase-TCQMOWKB.js} +11 -11
- package/dist/{rulesAdd-75UVUUDX.js → rulesAdd-DR25M5KY.js} +5 -5
- package/dist/{run-ZRNTAO7O.js → run-D7UQIGJU.js} +17 -18
- package/dist/{run-TSPTUSMX.js → run-DRGU5WNL.js} +16 -17
- package/dist/{runDaemon-MKBJQQQD.js → runDaemon-DFIENXL3.js} +58 -43
- package/dist/{runExtract-ALNQ3I3T.js → runExtract-7H2MKKFQ.js} +4 -4
- package/dist/{runParallelPhase-V2LPUTA3.js → runParallelPhase-6GQMW5NT.js} +10 -10
- package/dist/{runRefine-DSGHXEKJ.js → runRefine-K764J34T.js} +22 -23
- package/dist/{runScope-YQ4HHYKE.js → runScope-3HBSV5JL.js} +6 -7
- package/dist/{scan-A4DFCQZJ.js → scan-YJDDBQHO.js} +4 -4
- package/dist/{schemaConfirm-UDCEVEA7.js → schemaConfirm-LGQZ6P26.js} +5 -5
- package/dist/{schemaLock-4VUXSRRD.js → schemaLock-7M77VOHT.js} +5 -5
- package/dist/{schemaUnlock-QZRZFQJ4.js → schemaUnlock-MNFBCAYL.js} +8 -8
- package/dist/{screenshot-WDAF3QYG.js → screenshot-LWB5RY43.js} +14 -3
- package/dist/{search-XUG36ZL2.js → search-6HQCNWYZ.js} +8 -8
- package/dist/{show-WD57SDPL.js → show-GUW62FKK.js} +6 -6
- package/dist/{show-INQEZ755.js → show-IWLHTZEP.js} +6 -6
- package/dist/{signExtension-3GB33JGZ.js → signExtension-LYNKTDHS.js} +1 -1
- package/dist/{slack-DX2FRJ7S.js → slack-VILAGICW.js} +5 -5
- package/dist/{startIssue-MAZ7G4IH.js → startIssue-RIWXAHMV.js} +4 -4
- package/dist/{sync-TZRANWCY.js → sync-YJJ7WQJ6.js} +3 -3
- package/dist/{unassignIssue-OXNUC2QQ.js → unassignIssue-3CHBWPCW.js} +4 -4
- package/dist/{updateNode-ZOKPR26K.js → updateNode-FLPQ72DN.js} +5 -5
- package/dist/{updatePlan-PYKAHGKE.js → updatePlan-QZVWDL2U.js} +9 -9
- package/dist/{version-W7VP7LDJ.js → version-5K75T67C.js} +1 -1
- package/dist/{viewIssue-CYHIPCFO.js → viewIssue-N6W53LSK.js} +1 -1
- package/dist/{web-QATICXWA.js → web-W5KEZESL.js} +20 -20
- package/dist/{web-H4VA5QZT.js → web-ZUASK5RP.js} +20 -20
- package/dist/{wontfix-W2DXPEE4.js → wontfix-XV5XJADI.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-3OMKOT6D.js +0 -14
- package/dist/coverage-G7J25BUX.js +0 -17
|
@@ -4140,7 +4140,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4140
4140
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4141
4141
|
${r}`}return t}function cXr(e){return lXr(e??"").filter(t=>t.startsWith("@@"))}function ojo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function ijo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4142
4142
|
`)[0]??""}function uXr(e,t){return e.reduce((r,n)=>r+sXr(n,t),0)}function dXr(e,t,r){let n=cXr(e.patch),o=[],i=[];return n.forEach((a,s)=>{let l=r.get(`${e.path}#${s}`)??[];l.includes(t)?o.push(a):i.push({oldStart:ojo(a),header:ijo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4143
|
-
`),additions:uXr(o,"+"),deletions:uXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fXr(e){return e.flatMap(t=>{if(t.kind==="dir")return fXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function ajo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function pXr(e,t,r=new Set,n=new Set){let o=fXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=ajo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Vj));return aXr(o.filter(u=>l.has(u.path)).map(u=>dXr(u,s+1,i)))})}function sjo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Vj(s)===e).length;a>n&&(r=i,n=a)}),r}function hXr(e,t){let r=t.map(()=>[]);for(let n of e)r[sjo(n.path,t)]?.push(n);return r}function mXr(e,t){let r=pXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hXr(e.tests,t),o=yPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function gXr(e){if(!e.slices)return;let t=mXr(e,e.slices);return{entries:QKr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var ugt="assist:high-level-progress:",ljo=`${ugt}head:`,cjo=720*60*60*1e3,ile=e=>`${ugt}${e}`,dgt=e=>`${ljo}${e}`,cgt=e=>dl(e)[0];function ujo(e,t){let r=e?cgt(ile(e)):void 0;return e&&Fv(ile(e)),r??(t?cgt(dgt(t)):void 0)}function vXr(e,t,r){return Hx(ugt,cjo),cgt(ile(e))??ujo(t,r)}function bXr(e,t,r){Il(ile(e),[r]),t&&Il(dgt(t),[r])}function xXr(e,t){Fv(ile(e)),t&&Fv(dgt(t))}function SXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function gN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var fgt=e=>typeof e=="string"?e:"";function TXr(e){return{repo:fgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:fgt(e.headSha),body:fgt(e.body)}}var pgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wXr(e){let t;try{t=JSON.parse(e)}catch{return pgt}return typeof t!="object"||t===null?pgt:{...TXr(t),checks:gN(t.checks,SXr),structure:{...pgt.structure,...t.structure},criticalDiffs:gN(t.criticalDiffs),criticalPaths:gN(t.criticalPaths),tests:gN(t.tests),testPaths:gN(t.testPaths),collapsedPaths:gN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function CXr(e){let t=(0,zPe.useMemo)(()=>wXr(e.body),[e.body]),r=(0,zPe.useMemo)(()=>gXr(t),[t]),n=yXr(t),o=(0,zPe.useMemo)(()=>vXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var kXr=S(re(),1);function _Xr(e){let[t,r]=(0,kXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var EXr=S(re(),1);function RXr(e,t,r,n){(0,EXr.useEffect)(()=>{bXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AXr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CXr(e),s=XKr(n.checks,i,o?.slicing),l=_Xr(i),u=zKr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Q3e(t,r),h={...d,onQueue:l.onQueue};RXr(e.requestId,a,s.items,l.queued);let m=(0,PXr.useMemo)(()=>GKr(n),[n]);return{payload:n,checklist:s,queue:l,details:VKr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var PS=S(_(),1);function LXr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AXr(e,t,r);return(0,PS.jsxs)(H,{sx:n0,children:[(0,PS.jsx)(Ih,{preview:e,draft:!1}),(0,PS.jsx)(Jj,{items:e.metadata??[]}),(0,PS.jsx)(qn,{}),(0,PS.jsx)(kKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,PS.jsx)(qn,{}),(0,PS.jsx)($Kr,{pane:o,onDecision:(i,a)=>{xXr(e.requestId,o.head),n(i,a)}}),(0,PS.jsx)(kh,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FXr=S(re(),1);var yN=S(_(),1);function djo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IXr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,yN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,yN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:djo(e)}),(0,yN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,yN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,yN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var fjo={"top-left":oc.miro.topLeft,"bottom-right":oc.miro.bottomRight};function DXr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?fjo[t]:oc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ale=S(_(),1);function MXr({box:e,role:t,onSelect:r}){let n=DXr(e,t);return(0,ale.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ale.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ale.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:oc.miro.text,children:e.text})]})}function NXr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var HPe=S(_(),1);function OXr({boxes:e,selection:t}){return(0,HPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,HPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NXr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,HPe.jsx)(MXr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function pjo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function BXr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(pjo):[]}catch{return[]}}var hgt=S(re(),1);function $Xr(){let[e,t]=(0,hgt.useState)(null),[r,n]=(0,hgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var N3=S(_(),1);function zXr({preview:e,onDecision:t}){let r=(0,FXr.useMemo)(()=>BXr(e.body),[e.body]),n=$Xr();return(0,N3.jsxs)(H,{sx:n0,children:[(0,N3.jsx)(Ih,{preview:e,draft:!1}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(OXr,{boxes:r,selection:n}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(IXr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Vc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Vc())})]})}var yZr=S(re(),1);function HXr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function UPe(e){return e*22}function UXr(e){return Math.round(e/22)}var WXr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},VXr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GXr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qXr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},mgt={p:.25,mt:"2px"},jXr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KXr=S(_(),1),hjo=8;function YXr({drag:e}){return e?(0,KXr.jsx)(H,{sx:jXr,style:{top:e.top-1,left:hjo+UPe(e.depth)}}):null}var XXr=S(_(),1),ZXr=ot((0,XXr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var ggt=S(_(),1);function QXr({number:e,onGrip:t}){return(0,ggt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VXr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,ggt.jsx)(ZXr,{fontSize:"inherit"})})}var sk=S(_(),1);function JXr({number:e,onAdd:t,onDelete:r}){return(0,sk.jsxs)(sk.Fragment,{children:[(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,sk.jsx)(Kd,{fontSize:"inherit"})}),(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,sk.jsx)(_o,{fontSize:"inherit"})})]})}var WPe=S(re(),1);function eZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tZr(e){let t=(0,WPe.useRef)(null);return(0,WPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var vN=S(_(),1);function rZr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tZr(n.focus?.index===e?n.focus:null),s={marginLeft:UPe(r.depth),opacity:o?.4:1};return(0,vN.jsxs)(H,{sx:WXr,"data-criterion-row":!0,style:s,children:[(0,vN.jsx)(QXr,{number:t,onGrip:i}),(0,vN.jsx)(H,{component:"span",sx:GXr,"aria-hidden":"true",children:`${t}.`}),(0,vN.jsx)(zi,{multiline:!0,value:r.text,sx:qXr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,vN.jsx)(JXr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cZr=S(re(),1);function nZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function O3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function VPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:O3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function lg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function GPe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function oZr(e,t){let r=lg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iZr(e,t,r){let n=r<0?GPe(e,t):oZr(e,t);if(n<0)return null;let o=lg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:lg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function qPe(e,t){let r=lg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:O3(n),index:Math.max(0,t-1)}}function aZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&GPe(e,t)<0)return null;let n=lg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function jPe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function mjo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return jPe(VPe(e,t,o,n.slice(r)),"start")}function gjo(e,t,{shift:r,caret:n}){let o=aZr(e,t,r?-1:1);return jPe(o?{items:o,index:t}:null,n)}function sZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?mjo(e,t,r):n==="Tab"?gjo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?jPe(iZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?jPe(qPe(e,t),"end"):null}function lZr(e,t,r){return sZr(e,t,r)??nZr(e,t,r)}function uZr(e,t){let[r,n]=(0,cZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=lZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(VPe(e,a,e[a].text,""),"start"),onDelete:a=>o(qPe(e,a),"end")}}var mZr=S(re(),1);function yjo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=lg(t,r);return o>r&&o<i?r:o}function vjo(e,t,r,n){let o=lg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+UXr(n),s))}function bjo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dZr(e,t,r,n,o){let i=yjo(e,t,r,o);return{target:i,depth:vjo(t,r,i,n),top:bjo(e,i)}}function xjo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function fZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=xjo(t);return dZr(i,e,r,o.clientX-n,o.clientY-a)}}function pZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function hZr(e,t,r,n){let o=lg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:O3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gZr(e,t,r){let[n,o]=(0,mZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pZr(s.currentTarget,s.pointerId,fZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hZr(e,a,d.target,d.depth))})(s)}}}var sle=S(_(),1),Sjo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},Tjo=[{text:"",depth:0}];function vZr({items:e,onChange:t}){let r=(0,yZr.useRef)(null),n=e.length>0?e:Tjo,o=uZr(n,t),{drag:i,onGrip:a}=gZr(n,r,o.onDrop),s=HXr(n.map(l=>l.depth));return(0,sle.jsxs)(H,{sx:Sjo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,sle.jsx)(rZr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,sle.jsx)(YXr,{drag:i})]})}var bZr=S(_(),1),xZr=ot((0,bZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var lle=S(_(),1),wjo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SZr({kind:e,onClick:t}){return(0,lle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,lle.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,lle.jsx)(Kd,{}):(0,lle.jsx)(xZr,{}),onClick:t,children:wjo[e]})})}var cle=S(re(),1);function TZr(e,t,{color:r,pin:n}){let o=L6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>Cjo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function Cjo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function wZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CZr(e,t){for(let r of t){let n=aNt(e,r);n&&TZr(e,n,r)}}var ule=S(_(),1);function kZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,cle.useMemo)(()=>ND(e),[e]),a=(0,cle.useMemo)(()=>ND(r??""),[r]);return(0,cle.useLayoutEffect)(()=>{let s=o.current;s&&(wZr(s),CZr(s,n))},[i,a,n,o]),(0,ule.jsxs)(H,{ref:o,children:[(0,ule.jsx)(LD,{segments:i,skipDiagramText:!0}),t,t?(0,ule.jsx)(LD,{segments:a,skipDiagramText:!0}):null]})}var bN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function YPe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[bN("")]:{lineHeight:1.6},[bN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[bN("ul, ol")]:{pl:2.5,mb:2},[bN("li")]:{mb:"6px"},[bN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[bN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[bN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Zr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...V$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...YPe(e)});var tY=S(_(),1);function EZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,tY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Zr,children:[(0,tY.jsx)(kZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,tY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,tY.jsx)(M$,{rects:a,color:s})]})}function RZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var KPe=S(re(),1),PZr=S(_(),1);function ygt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,KPe.useState)(t);return(0,KPe.useEffect)(()=>i(t),[t]),(0,PZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var dle=S(_(),1),vgt="screenshot-groups";function kjo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AZr({screenshot:e,onUpdate:t}){return(0,dle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,dle.jsx)(ygt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||kjo(e.path)})}),(0,dle.jsx)(ygt,{label:"Group",value:e.group??"",listId:vgt,onCommit:r=>t(e.id,{group:r})})]})}var B3=S(_(),1),LZr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},_jo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IZr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,B3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,B3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LZr}):(0,B3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LZr}),(0,B3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:_jo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,B3.jsx)(_o,{fontSize:"small"})}),(0,B3.jsx)(AZr,{screenshot:e,onUpdate:r})]})}var d0=S(_(),1);function Ejo(){return(0,d0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,d0.jsx)(io,{size:16}),(0,d0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function Rjo({error:e}){return(0,d0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DZr({uploads:e,empty:t}){return e.length>0?(0,d0.jsx)(d0.Fragment,{children:e.map(r=>r.error?(0,d0.jsx)(Rjo,{error:r.error},r.id):(0,d0.jsx)(Ejo,{},r.id))}):t?(0,d0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var f0=S(_(),1),Pjo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MZr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RZr(e),a=s=>(0,f0.jsx)(IZr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,f0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,f0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,f0.jsx)("datalist",{id:vgt,children:o.map(([s])=>(0,f0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,f0.jsxs)(H,{sx:{mb:2},children:[(0,f0.jsx)(H,{component:"h3",children:s}),(0,f0.jsx)(H,{sx:Pjo,children:l.map(a)})]},s)),(0,f0.jsxs)(St,{spacing:1,children:[i.map(a),(0,f0.jsx)(DZr,{uploads:t,empty:e.length===0})]})]})}var fle=S(_(),1);function Ajo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,fle.jsx)(vZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,fle.jsx)(SZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function XPe({pane:e,screenshots:t}){return(0,fle.jsx)(EZr,{...Ajo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,fle.jsx)(MZr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NZr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OZr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BZr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),$Zr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var lk=S(_(),1);function FZr({comments:e,colors:t,onRemove:r}){return(0,lk.jsxs)(H,{sx:NZr,children:[(0,lk.jsxs)(be,{sx:OZr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,lk.jsxs)(H,{sx:BZr,children:[(0,lk.jsx)(A$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,lk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,lk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Zr,children:(0,lk.jsx)(_o,{})})]},n.id))]})}var HZr=S(_(),1);function zZr(e){return e.comments.length===0?null:(0,HZr.jsx)(FZr,{...e})}var UZr=S(_(),1),ZPe=ot((0,UZr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var YZr=S(re(),1);var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var p0="0.1188.0";var Ljo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GZr(e){return e?Ljo[e]:"success.main"}function qZr(e){return e.split("-")[0].split(".").map(Number)}function jZr(e,t){if(!e||!t||e===t)return;let r=qZr(e),n=qZr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var QPe=S(re(),1),bgt=(0,QPe.createContext)(null);function JPe(){return(0,QPe.useContext)(bgt)}var xN=S(_(),1),Ijo={height:16,fontSize:10},Djo={opacity:.6,fontSize:"0.85em"};function Mjo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function $3({nodes:e,name:t,showVersion:r=!1}){let n=JPe()??p0,o=e.links.find(a=>a.name===t),i=jZr(o?.peerVersion,n);return(0,xN.jsx)(lr,{title:Mjo(e,t),placement:"right",children:(0,xN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,xN.jsx)(VZr,{sx:{fontSize:8,color:GZr(o?.state)}}),t,r&&o?.peerVersion&&(0,xN.jsxs)(H,{component:"span",sx:Djo,children:["v",o.peerVersion]}),i&&(0,xN.jsx)(yn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:Ijo})]})})}var h0=S(_(),1),Njo={textTransform:"none"};function eAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YZr.useState)(null);return(0,h0.jsxs)(h0.Fragment,{children:[(0,h0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,h0.jsx)(ZPe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Njo,children:(0,h0.jsx)($3,{nodes:e,name:r.node})}),(0,h0.jsx)(fi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,h0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,h0.jsx)(Vu,{primary:(0,h0.jsx)($3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KZr=S(re(),1);function Ojo(e,t){return e?.toLowerCase()===t.toLowerCase()}function tAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KZr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>Ojo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var F3=S(_(),1);function XZr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Xme(),a=tAe(r,t);return(0,F3.jsxs)(F3.Fragment,{children:[(0,F3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,F3.jsx)(eAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,F3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var xgt=S(_(),1),Bjo={"& .MuiFormControlLabel-label":{fontSize:12}};function ple({label:e,title:t,checked:r,onChange:n}){return(0,xgt.jsx)($d,{control:(0,xgt.jsx)(Ip,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Bjo})}var SN=S(_(),1);function rAe({chain:e,newPr:t,onChange:r}){return(0,SN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,SN.jsx)(ple,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,SN.jsx)(ple,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,SN.jsx)(ple,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,SN.jsx)(ple,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var TN=S(_(),1);function ZZr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,TN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,TN.jsx)(rAe,{chain:t,newPr:r,onChange:i}),(0,TN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,TN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,TN.jsx)(XZr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JZr=S(_(),1);function QZr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,JZr.jsx)(ZZr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var ck=S(_(),1);function eQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,ck.jsxs)(ck.Fragment,{children:[(0,ck.jsx)(zZr,{comments:t,colors:r,onRemove:d}),(0,ck.jsx)(qn,{}),(0,ck.jsx)(QZr,{...e}),(0,ck.jsx)(dye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var hle=S(_(),1),$jo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},Fjo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tQr({url:e}){return(0,hle.jsxs)(H,{sx:$jo,children:[(0,hle.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,hle.jsx)(be,{variant:"body2",sx:Fjo,title:e,children:e})]})}var Sgt=S(_(),1);function rQr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Sgt.jsx)(tQr,{url:t}):(0,Sgt.jsx)(Jj,{items:e.metadata??[]})}function nQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function rY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function nAe(e,t,r,n){return{...rY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,Jke({quote:r,note:o})),n()}}function aQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,zx(r,Qge(o))),n()}}function oAe(e,t,r,n){return{onCite:aQr(e,t,r,n),onAddRule:iQr(e,t,r,n)}}function sQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gQr=S(re(),1);var uk=S(re(),1);var lQr="assist:pr-preview-comments:",Tgt=e=>`${lQr}${e}`;function wgt(e){return dl(Tgt(e))}function mle(e,t){Il(Tgt(e),t)}function iAe(e){Fv(Tgt(e))}function cQr(){Hx(lQr)}function uQr(e){let t=L6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function zjo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function dQr(e,t){return e.flatMap(r=>{let n=zjo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fQr(e,t,r){let n=wgt(e);if(n.length>0||!t||!r)return n;let o=dQr(wgt(t),uQr(r));return mle(e,o),iAe(t),o}function pQr(e,t,r){let[n,o]=(0,uk.useState)([]),i=(0,uk.useRef)(0);(0,uk.useEffect)(()=>{cQr(),o(fQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,uk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return mle(e,d),d})},[e]),s=(0,uk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return mle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hQr(e,t){let r=e.map((i,a)=>mG(a).solid),n=mG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:mG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function mQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function yQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Wy(),{comments:d,add:f,remove:p}=pQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gQr.useMemo)(()=>hQr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var sAe=S(re(),1);var Cgt="assist:preview-screenshots:",kgt=e=>`${Cgt}${e}`,aAe=e=>`${Cgt}seeded:${e}`;function vQr(e){return e?(Hx(Cgt),dl(kgt(e)).filter(t=>typeof t.path=="string")):[]}function wN(e,t){e&&Il(kgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bQr(e){e&&(Fv(kgt(e)),Fv(aAe(e)))}var CN=S(re(),1);var xQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function Hjo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SQr(e){return e.map(t=>({...t,contentType:Hjo(t.path),seeded:!0}))}function TQr(e,t,r){if(!e)return SQr(r);let n=vQr(e);if(dl(aAe(e))[0]===t)return n;let o=[...SQr(r),...n.filter(i=>!i.seeded)];return wN(e,o),Il(aAe(e),[t]),o}function wQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),fT(`/api/pr-preview/image?${r}`)}function CQr(e,t,r){let[n,o]=(0,CN.useState)([]),i=(0,CN.useRef)(0),a=ur(),s=(0,CN.useRef)(r);return s.current=r,(0,CN.useEffect)(()=>{o(TQr(e,t,s.current).map(l=>({...l,url:wQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kQr=S(re(),1);function _Qr(e,t){return(0,kQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return wN(e,i),i})},[e,t])}function EQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CQr(e,t,r),a=(0,sAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return wN(e,p),p})},[e,o,i]),s=(0,sAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return wN(e,h),h})},[e,o]),l=_Qr(e,o),u=(0,sAe.useCallback)(()=>bQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var nY=S(re(),1);async function RQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Ut(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var IQr=S(re(),1);function PQr(e){return e.startsWith("image/")||e.startsWith("video/")}function AQr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LQr(e){return e?Array.from(e.files).find(t=>PQr(t.type))??null:null}function DQr(e,t){return(0,IQr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AQr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LQr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function MQr(e,t,r){let[n,o]=(0,nY.useState)([]),i=(0,nY.useRef)(0),a=ur(),s=(0,nY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=DQr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NQr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MQr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var VQr=S(re(),1);var OQr="assist:pr-preview-chain:",_gt=e=>`${OQr}${e}`;function BQr(e){if(e)return dl(_gt(e))[0]}function $Qr(e,t){e&&Il(_gt(e),[t])}function FQr(e){e&&Fv(_gt(e))}function zQr(){Hx(OQr)}function HQr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zQr();let n=BQr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UQr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function WQr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GQr(e,t,r,n,o,i,a){let[s,l]=(0,VQr.useState)(()=>HQr(n,t,o));return{chain:s,setChain:f=>{l(f),$Qr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UQr(m,p,s,m?i.attachments():[],a()),...WQr(m,h)}),iAe(e),m&&(FQr(t),i.clearPersisted())}}}var tJr=S(re(),1);var Ujo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Wjo=/^ {0,3}#{1,6}[ \t]/;function z3(e){let t=e.split(`
|
|
4143
|
+
`),additions:uXr(o,"+"),deletions:uXr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fXr(e){return e.flatMap(t=>{if(t.kind==="dir")return fXr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function ajo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function pXr(e,t,r=new Set,n=new Set){let o=fXr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=ajo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(Vj));return aXr(o.filter(u=>l.has(u.path)).map(u=>dXr(u,s+1,i)))})}function sjo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>Vj(s)===e).length;a>n&&(r=i,n=a)}),r}function hXr(e,t){let r=t.map(()=>[]);for(let n of e)r[sjo(n.path,t)]?.push(n);return r}function mXr(e,t){let r=pXr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hXr(e.tests,t),o=yPe(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function gXr(e){if(!e.slices)return;let t=mXr(e,e.slices);return{entries:QKr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yXr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var ugt="assist:high-level-progress:",ljo=`${ugt}head:`,cjo=720*60*60*1e3,ile=e=>`${ugt}${e}`,dgt=e=>`${ljo}${e}`,cgt=e=>dl(e)[0];function ujo(e,t){let r=e?cgt(ile(e)):void 0;return e&&Fv(ile(e)),r??(t?cgt(dgt(t)):void 0)}function vXr(e,t,r){return Hx(ugt,cjo),cgt(ile(e))??ujo(t,r)}function bXr(e,t,r){Il(ile(e),[r]),t&&Il(dgt(t),[r])}function xXr(e,t){Fv(ile(e)),t&&Fv(dgt(t))}function SXr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function gN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var fgt=e=>typeof e=="string"?e:"";function TXr(e){return{repo:fgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:fgt(e.headSha),body:fgt(e.body)}}var pgt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wXr(e){let t;try{t=JSON.parse(e)}catch{return pgt}return typeof t!="object"||t===null?pgt:{...TXr(t),checks:gN(t.checks,SXr),structure:{...pgt.structure,...t.structure},criticalDiffs:gN(t.criticalDiffs),criticalPaths:gN(t.criticalPaths),tests:gN(t.tests),testPaths:gN(t.testPaths),collapsedPaths:gN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.draft?{draft:t.draft}:{}}}function CXr(e){let t=(0,zPe.useMemo)(()=>wXr(e.body),[e.body]),r=(0,zPe.useMemo)(()=>gXr(t),[t]),n=yXr(t),o=(0,zPe.useMemo)(()=>vXr(e.requestId,e.supersedes,n)??t.draft??t.saved,[e.requestId,e.supersedes,n,t]);return{payload:t,sliced:r,progress:o,head:n}}var kXr=S(re(),1);function _Xr(e){let[t,r]=(0,kXr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var EXr=S(re(),1);function RXr(e,t,r,n){(0,EXr.useEffect)(()=>{bXr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AXr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CXr(e),s=XKr(n.checks,i,o?.slicing),l=_Xr(i),u=zKr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Q3e(t,r),h={...d,onQueue:l.onQueue};RXr(e.requestId,a,s.items,l.queued);let m=(0,PXr.useMemo)(()=>GKr(n),[n]);return{payload:n,checklist:s,queue:l,details:VKr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var PS=S(_(),1);function LXr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AXr(e,t,r);return(0,PS.jsxs)(H,{sx:n0,children:[(0,PS.jsx)(Ih,{preview:e,draft:!1}),(0,PS.jsx)(Jj,{items:e.metadata??[]}),(0,PS.jsx)(qn,{}),(0,PS.jsx)(kKr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,PS.jsx)(qn,{}),(0,PS.jsx)($Kr,{pane:o,onDecision:(i,a)=>{xXr(e.requestId,o.head),n(i,a)}}),(0,PS.jsx)(kh,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FXr=S(re(),1);var yN=S(_(),1);function djo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IXr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,yN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,yN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:djo(e)}),(0,yN.jsx)(nt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,yN.jsx)(nt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,yN.jsx)(nt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var fjo={"top-left":oc.miro.topLeft,"bottom-right":oc.miro.bottomRight};function DXr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?fjo[t]:oc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ale=S(_(),1);function MXr({box:e,role:t,onSelect:r}){let n=DXr(e,t);return(0,ale.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ale.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ale.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:oc.miro.text,children:e.text})]})}function NXr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var HPe=S(_(),1);function OXr({boxes:e,selection:t}){return(0,HPe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,HPe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NXr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,HPe.jsx)(MXr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function pjo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function BXr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(pjo):[]}catch{return[]}}var hgt=S(re(),1);function $Xr(){let[e,t]=(0,hgt.useState)(null),[r,n]=(0,hgt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var N3=S(_(),1);function zXr({preview:e,onDecision:t}){let r=(0,FXr.useMemo)(()=>BXr(e.body),[e.body]),n=$Xr();return(0,N3.jsxs)(H,{sx:n0,children:[(0,N3.jsx)(Ih,{preview:e,draft:!1}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(OXr,{boxes:r,selection:n}),(0,N3.jsx)(qn,{}),(0,N3.jsx)(IXr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Vc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Vc())})]})}var yZr=S(re(),1);function HXr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function UPe(e){return e*22}function UXr(e){return Math.round(e/22)}var WXr={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},VXr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GXr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qXr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},mgt={p:.25,mt:"2px"},jXr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KXr=S(_(),1),hjo=8;function YXr({drag:e}){return e?(0,KXr.jsx)(H,{sx:jXr,style:{top:e.top-1,left:hjo+UPe(e.depth)}}):null}var XXr=S(_(),1),ZXr=ot((0,XXr.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var ggt=S(_(),1);function QXr({number:e,onGrip:t}){return(0,ggt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VXr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,ggt.jsx)(ZXr,{fontSize:"inherit"})})}var sk=S(_(),1);function JXr({number:e,onAdd:t,onDelete:r}){return(0,sk.jsxs)(sk.Fragment,{children:[(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,sk.jsx)(Kd,{fontSize:"inherit"})}),(0,sk.jsx)(Mt,{size:"small",className:"criterion-action",sx:mgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,sk.jsx)(_o,{fontSize:"inherit"})})]})}var WPe=S(re(),1);function eZr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tZr(e){let t=(0,WPe.useRef)(null);return(0,WPe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eZr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var vN=S(_(),1);function rZr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tZr(n.focus?.index===e?n.focus:null),s={marginLeft:UPe(r.depth),opacity:o?.4:1};return(0,vN.jsxs)(H,{sx:WXr,"data-criterion-row":!0,style:s,children:[(0,vN.jsx)(QXr,{number:t,onGrip:i}),(0,vN.jsx)(H,{component:"span",sx:GXr,"aria-hidden":"true",children:`${t}.`}),(0,vN.jsx)(zi,{multiline:!0,value:r.text,sx:qXr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,vN.jsx)(JXr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cZr=S(re(),1);function nZr(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function O3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function VPe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:O3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function lg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function GPe(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function oZr(e,t){let r=lg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iZr(e,t,r){let n=r<0?GPe(e,t):oZr(e,t);if(n<0)return null;let o=lg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:lg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function qPe(e,t){let r=lg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:O3(n),index:Math.max(0,t-1)}}function aZr(e,t,r){if(r<0&&e[t].depth===0||r>0&&GPe(e,t)<0)return null;let n=lg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function jPe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function mjo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return jPe(VPe(e,t,o,n.slice(r)),"start")}function gjo(e,t,{shift:r,caret:n}){let o=aZr(e,t,r?-1:1);return jPe(o?{items:o,index:t}:null,n)}function sZr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?mjo(e,t,r):n==="Tab"?gjo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?jPe(iZr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?jPe(qPe(e,t),"end"):null}function lZr(e,t,r){return sZr(e,t,r)??nZr(e,t,r)}function uZr(e,t){let[r,n]=(0,cZr.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=lZr(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(VPe(e,a,e[a].text,""),"start"),onDelete:a=>o(qPe(e,a),"end")}}var mZr=S(re(),1);function yjo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=lg(t,r);return o>r&&o<i?r:o}function vjo(e,t,r,n){let o=lg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+UXr(n),s))}function bjo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dZr(e,t,r,n,o){let i=yjo(e,t,r,o);return{target:i,depth:vjo(t,r,i,n),top:bjo(e,i)}}function xjo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function fZr(e,t,r,n){return o=>{let{boxes:i,origin:a}=xjo(t);return dZr(i,e,r,o.clientX-n,o.clientY-a)}}function pZr(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function hZr(e,t,r,n){let o=lg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:O3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gZr(e,t,r){let[n,o]=(0,mZr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pZr(s.currentTarget,s.pointerId,fZr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hZr(e,a,d.target,d.depth))})(s)}}}var sle=S(_(),1),Sjo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},Tjo=[{text:"",depth:0}];function vZr({items:e,onChange:t}){let r=(0,yZr.useRef)(null),n=e.length>0?e:Tjo,o=uZr(n,t),{drag:i,onGrip:a}=gZr(n,r,o.onDrop),s=HXr(n.map(l=>l.depth));return(0,sle.jsxs)(H,{sx:Sjo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,sle.jsx)(rZr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,sle.jsx)(YXr,{drag:i})]})}var bZr=S(_(),1),xZr=ot((0,bZr.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var lle=S(_(),1),wjo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SZr({kind:e,onClick:t}){return(0,lle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,lle.jsx)(nt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,lle.jsx)(Kd,{}):(0,lle.jsx)(xZr,{}),onClick:t,children:wjo[e]})})}var cle=S(re(),1);function TZr(e,t,{color:r,pin:n}){let o=L6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>Cjo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function Cjo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function wZr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CZr(e,t){for(let r of t){let n=aNt(e,r);n&&TZr(e,n,r)}}var ule=S(_(),1);function kZr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,cle.useMemo)(()=>ND(e),[e]),a=(0,cle.useMemo)(()=>ND(r??""),[r]);return(0,cle.useLayoutEffect)(()=>{let s=o.current;s&&(wZr(s),CZr(s,n))},[i,a,n,o]),(0,ule.jsxs)(H,{ref:o,children:[(0,ule.jsx)(LD,{segments:i,skipDiagramText:!0}),t,t?(0,ule.jsx)(LD,{segments:a,skipDiagramText:!0}):null]})}var bN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function YPe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[bN("")]:{lineHeight:1.6},[bN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[bN("ul, ol")]:{pl:2.5,mb:2},[bN("li")]:{mb:"6px"},[bN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[bN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[bN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Zr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...V$(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...YPe(e)});var tY=S(_(),1);function EZr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,tY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Zr,children:[(0,tY.jsx)(kZr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,tY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,tY.jsx)(M$,{rects:a,color:s})]})}function RZr(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var KPe=S(re(),1),PZr=S(_(),1);function ygt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,KPe.useState)(t);return(0,KPe.useEffect)(()=>i(t),[t]),(0,PZr.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var dle=S(_(),1),vgt="screenshot-groups";function kjo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AZr({screenshot:e,onUpdate:t}){return(0,dle.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,dle.jsx)(ygt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||kjo(e.path)})}),(0,dle.jsx)(ygt,{label:"Group",value:e.group??"",listId:vgt,onCommit:r=>t(e.id,{group:r})})]})}var B3=S(_(),1),LZr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},_jo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IZr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,B3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,B3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LZr}):(0,B3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LZr}),(0,B3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:_jo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,B3.jsx)(_o,{fontSize:"small"})}),(0,B3.jsx)(AZr,{screenshot:e,onUpdate:r})]})}var d0=S(_(),1);function Ejo(){return(0,d0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,d0.jsx)(io,{size:16}),(0,d0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function Rjo({error:e}){return(0,d0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DZr({uploads:e,empty:t}){return e.length>0?(0,d0.jsx)(d0.Fragment,{children:e.map(r=>r.error?(0,d0.jsx)(Rjo,{error:r.error},r.id):(0,d0.jsx)(Ejo,{},r.id))}):t?(0,d0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var f0=S(_(),1),Pjo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MZr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RZr(e),a=s=>(0,f0.jsx)(IZr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,f0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,f0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,f0.jsx)("datalist",{id:vgt,children:o.map(([s])=>(0,f0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,f0.jsxs)(H,{sx:{mb:2},children:[(0,f0.jsx)(H,{component:"h3",children:s}),(0,f0.jsx)(H,{sx:Pjo,children:l.map(a)})]},s)),(0,f0.jsxs)(St,{spacing:1,children:[i.map(a),(0,f0.jsx)(DZr,{uploads:t,empty:e.length===0})]})]})}var fle=S(_(),1);function Ajo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,fle.jsx)(vZr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,fle.jsx)(SZr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function XPe({pane:e,screenshots:t}){return(0,fle.jsx)(EZr,{...Ajo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,fle.jsx)(MZr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NZr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OZr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BZr=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),$Zr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var lk=S(_(),1);function FZr({comments:e,colors:t,onRemove:r}){return(0,lk.jsxs)(H,{sx:NZr,children:[(0,lk.jsxs)(be,{sx:OZr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,lk.jsxs)(H,{sx:BZr,children:[(0,lk.jsx)(A$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,lk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,lk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Zr,children:(0,lk.jsx)(_o,{})})]},n.id))]})}var HZr=S(_(),1);function zZr(e){return e.comments.length===0?null:(0,HZr.jsx)(FZr,{...e})}var UZr=S(_(),1),ZPe=ot((0,UZr.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var YZr=S(re(),1);var WZr=S(_(),1),VZr=ot((0,WZr.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var p0="0.1189.1";var Ljo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GZr(e){return e?Ljo[e]:"success.main"}function qZr(e){return e.split("-")[0].split(".").map(Number)}function jZr(e,t){if(!e||!t||e===t)return;let r=qZr(e),n=qZr(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var QPe=S(re(),1),bgt=(0,QPe.createContext)(null);function JPe(){return(0,QPe.useContext)(bgt)}var xN=S(_(),1),Ijo={height:16,fontSize:10},Djo={opacity:.6,fontSize:"0.85em"};function Mjo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function $3({nodes:e,name:t,showVersion:r=!1}){let n=JPe()??p0,o=e.links.find(a=>a.name===t),i=jZr(o?.peerVersion,n);return(0,xN.jsx)(lr,{title:Mjo(e,t),placement:"right",children:(0,xN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,xN.jsx)(VZr,{sx:{fontSize:8,color:GZr(o?.state)}}),t,r&&o?.peerVersion&&(0,xN.jsxs)(H,{component:"span",sx:Djo,children:["v",o.peerVersion]}),i&&(0,xN.jsx)(yn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:Ijo})]})})}var h0=S(_(),1),Njo={textTransform:"none"};function eAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YZr.useState)(null);return(0,h0.jsxs)(h0.Fragment,{children:[(0,h0.jsx)(nt,{size:"small",color:"inherit",startIcon:(0,h0.jsx)(ZPe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:Njo,children:(0,h0.jsx)($3,{nodes:e,name:r.node})}),(0,h0.jsx)(fi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,h0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,h0.jsx)(Vu,{primary:(0,h0.jsx)($3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KZr=S(re(),1);function Ojo(e,t){return e?.toLowerCase()===t.toLowerCase()}function tAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KZr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>Ojo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(x=>x.name===b&&x.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var F3=S(_(),1);function XZr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=Xme(),a=tAe(r,t);return(0,F3.jsxs)(F3.Fragment,{children:[(0,F3.jsx)(nt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,F3.jsx)(eAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,F3.jsx)(nt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var xgt=S(_(),1),Bjo={"& .MuiFormControlLabel-label":{fontSize:12}};function ple({label:e,title:t,checked:r,onChange:n}){return(0,xgt.jsx)($d,{control:(0,xgt.jsx)(Ip,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:Bjo})}var SN=S(_(),1);function rAe({chain:e,newPr:t,onChange:r}){return(0,SN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,SN.jsx)(ple,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,SN.jsx)(ple,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,SN.jsx)(ple,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,SN.jsx)(ple,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var TN=S(_(),1);function ZZr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,TN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,TN.jsx)(rAe,{chain:t,newPr:r,onChange:i}),(0,TN.jsx)(nt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,TN.jsxs)(nt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,TN.jsx)(XZr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JZr=S(_(),1);function QZr({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,JZr.jsx)(ZZr,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var ck=S(_(),1);function eQr(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,ck.jsxs)(ck.Fragment,{children:[(0,ck.jsx)(zZr,{comments:t,colors:r,onRemove:d}),(0,ck.jsx)(qn,{}),(0,ck.jsx)(QZr,{...e}),(0,ck.jsx)(dye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var hle=S(_(),1),$jo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},Fjo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tQr({url:e}){return(0,hle.jsxs)(H,{sx:$jo,children:[(0,hle.jsx)(nt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,hle.jsx)(be,{variant:"body2",sx:Fjo,title:e,children:e})]})}var Sgt=S(_(),1);function rQr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Sgt.jsx)(tQr,{url:t}):(0,Sgt.jsx)(Jj,{items:e.metadata??[]})}function nQr({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function rY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oQr(e,t){return e?`${e}:${t??"pr"}`:void 0}function nAe(e,t,r,n){return{...rY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oQr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,Jke({quote:r,note:o})),n()}}function aQr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&ul(t,e,zx(r,Qge(o))),n()}}function oAe(e,t,r,n){return{onCite:aQr(e,t,r,n),onAddRule:iQr(e,t,r,n)}}function sQr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gQr=S(re(),1);var uk=S(re(),1);var lQr="assist:pr-preview-comments:",Tgt=e=>`${lQr}${e}`;function wgt(e){return dl(Tgt(e))}function mle(e,t){Il(Tgt(e),t)}function iAe(e){Fv(Tgt(e))}function cQr(){Hx(lQr)}function uQr(e){let t=L6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function zjo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function dQr(e,t){return e.flatMap(r=>{let n=zjo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fQr(e,t,r){let n=wgt(e);if(n.length>0||!t||!r)return n;let o=dQr(wgt(t),uQr(r));return mle(e,o),iAe(t),o}function pQr(e,t,r){let[n,o]=(0,uk.useState)([]),i=(0,uk.useRef)(0);(0,uk.useEffect)(()=>{cQr(),o(fQr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,uk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return mle(e,d),d})},[e]),s=(0,uk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return mle(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hQr(e,t){let r=e.map((i,a)=>mG(a).solid),n=mG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:mG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function mQr(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function yQr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Wy(),{comments:d,add:f,remove:p}=pQr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gQr.useMemo)(()=>hQr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mQr(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var sAe=S(re(),1);var Cgt="assist:preview-screenshots:",kgt=e=>`${Cgt}${e}`,aAe=e=>`${Cgt}seeded:${e}`;function vQr(e){return e?(Hx(Cgt),dl(kgt(e)).filter(t=>typeof t.path=="string")):[]}function wN(e,t){e&&Il(kgt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bQr(e){e&&(Fv(kgt(e)),Fv(aAe(e)))}var CN=S(re(),1);var xQr={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function Hjo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xQr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SQr(e){return e.map(t=>({...t,contentType:Hjo(t.path),seeded:!0}))}function TQr(e,t,r){if(!e)return SQr(r);let n=vQr(e);if(dl(aAe(e))[0]===t)return n;let o=[...SQr(r),...n.filter(i=>!i.seeded)];return wN(e,o),Il(aAe(e),[t]),o}function wQr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),fT(`/api/pr-preview/image?${r}`)}function CQr(e,t,r){let[n,o]=(0,CN.useState)([]),i=(0,CN.useRef)(0),a=ur(),s=(0,CN.useRef)(r);return s.current=r,(0,CN.useEffect)(()=>{o(TQr(e,t,s.current).map(l=>({...l,url:wQr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kQr=S(re(),1);function _Qr(e,t){return(0,kQr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return wN(e,i),i})},[e,t])}function EQr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CQr(e,t,r),a=(0,sAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return wN(e,p),p})},[e,o,i]),s=(0,sAe.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return wN(e,h),h})},[e,o]),l=_Qr(e,o),u=(0,sAe.useCallback)(()=>bQr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var nY=S(re(),1);async function RQr(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await Ut(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var IQr=S(re(),1);function PQr(e){return e.startsWith("image/")||e.startsWith("video/")}function AQr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PQr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LQr(e){return e?Array.from(e.files).find(t=>PQr(t.type))??null:null}function DQr(e,t){return(0,IQr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AQr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LQr(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function MQr(e,t,r){let[n,o]=(0,nY.useState)([]),i=(0,nY.useRef)(0),a=ur(),s=(0,nY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RQr(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=DQr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NQr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EQr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MQr(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var VQr=S(re(),1);var OQr="assist:pr-preview-chain:",_gt=e=>`${OQr}${e}`;function BQr(e){if(e)return dl(_gt(e))[0]}function $Qr(e,t){e&&Il(_gt(e),[t])}function FQr(e){e&&Fv(_gt(e))}function zQr(){Hx(OQr)}function HQr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zQr();let n=BQr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UQr(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function WQr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GQr(e,t,r,n,o,i,a){let[s,l]=(0,VQr.useState)(()=>HQr(n,t,o));return{chain:s,setChain:f=>{l(f),$Qr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UQr(m,p,s,m?i.attachments():[],a()),...WQr(m,h)}),iAe(e),m&&(FQr(t),i.clearPersisted())}}}var tJr=S(re(),1);var Ujo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,Wjo=/^ {0,3}#{1,6}[ \t]/;function z3(e){let t=e.split(`
|
|
4144
4144
|
`),r=t.findIndex(a=>Ujo.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!Wjo.test(t[n]);)n+=1;let o=r+1;for(;o<n&&t[o].trim()==="";)o+=1;let i=n;for(;i>o&&t[i-1].trim()==="";)i-=1;return o===n&&(o=r+1,i=r+1),{before:t.slice(0,o),lines:t.slice(o,i),after:t.slice(i)}}function lAe(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function cAe(e){let t=[];return e.map(r=>{for(;t.length>0&&r<t[t.length-1];)t.pop();return(t.length===0||r>t[t.length-1])&&t.push(r),t.length-1})}var Vjo=" ";function Gjo({text:e,depth:t}){let r=`${Vjo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function uAe(e,t){let r=z3(e);return r?[...r.before,...t.map(Gjo),...r.after].join(`
|
|
4145
4145
|
`):e}var qjo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,jjo=/^\[[ xX]\][ \t]*/;function Yjo(e){return e.slice(0,e.length-e.trimStart().length)}function qQr(e){let t=z3(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=qjo.exec(o);return{width:lAe(i?i[1]:Yjo(o)),text:(i?i[2]??"":o.trim()).replace(jjo,"")}}),n=cAe(r.map(o=>o.width));return uAe(e,O3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var jQr=`## Acceptance criteria
|
|
4146
4146
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
comment
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VLJWAMAH.js";
|
|
4
|
+
import "./chunk-G7UI2W7U.js";
|
|
5
5
|
import "./chunk-ZLRZR64W.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-SO3IBV6J.js";
|
|
7
7
|
import "./chunk-C3MGHR3N.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-D24GLTCK.js";
|
|
9
9
|
import "./chunk-QS2S63AF.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-P7SERZI6.js";
|
|
11
11
|
import "./chunk-3VDV7VHX.js";
|
|
12
12
|
import "./chunk-ZFX4EZMW.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-HR7HIPYM.js";
|
|
14
14
|
import "./chunk-GIHVMELY.js";
|
|
15
15
|
import "./chunk-2EW62DM5.js";
|
|
16
16
|
import "./chunk-GNNMJOUE.js";
|
|
17
17
|
import "./chunk-RXFNQQZC.js";
|
|
18
18
|
import "./chunk-DUNO7WBT.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-ZRIBI33P.js";
|
|
20
20
|
import "./chunk-D7UZLH36.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-R62CNGZO.js";
|
|
22
22
|
import "./chunk-Q6PZLPK4.js";
|
|
23
23
|
import "./chunk-JJKKIBF5.js";
|
|
24
24
|
export {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reviewProposedIssueComment
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JJKRUHWS.js";
|
|
4
4
|
import {
|
|
5
5
|
validateProposedContent
|
|
6
6
|
} from "./chunk-ABLDOQ4B.js";
|
|
7
7
|
import "./chunk-AVLELL42.js";
|
|
8
8
|
import "./chunk-C3MGHR3N.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-D24GLTCK.js";
|
|
10
10
|
import "./chunk-QS2S63AF.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-P7SERZI6.js";
|
|
12
12
|
import "./chunk-3VDV7VHX.js";
|
|
13
13
|
import "./chunk-GIHVMELY.js";
|
|
14
14
|
import "./chunk-2EW62DM5.js";
|
|
15
15
|
import "./chunk-GNNMJOUE.js";
|
|
16
16
|
import "./chunk-RXFNQQZC.js";
|
|
17
17
|
import "./chunk-DUNO7WBT.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZRIBI33P.js";
|
|
19
19
|
import "./chunk-D7UZLH36.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-R62CNGZO.js";
|
|
21
21
|
import "./chunk-Q6PZLPK4.js";
|
|
22
22
|
import "./chunk-JJKKIBF5.js";
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pushCommit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CDDJAXEJ.js";
|
|
4
4
|
import {
|
|
5
5
|
backlogRefError,
|
|
6
6
|
findBacklogRefs
|
|
@@ -14,18 +14,18 @@ import {
|
|
|
14
14
|
isDocsLocked,
|
|
15
15
|
isLockedDocsRelativePath,
|
|
16
16
|
isSchemaRelativePath
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EOUZVOHM.js";
|
|
18
18
|
import {
|
|
19
19
|
isSchemaLocked
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PS3TSUFD.js";
|
|
21
21
|
import "./chunk-CUOHHT2F.js";
|
|
22
22
|
import {
|
|
23
23
|
currentExecutionIdentity
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IFMJH2XY.js";
|
|
25
25
|
import "./chunk-ZMH7UZNP.js";
|
|
26
26
|
import {
|
|
27
27
|
gitRefUrl
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2T5HRFWP.js";
|
|
29
29
|
import {
|
|
30
30
|
recordSessionRefs
|
|
31
31
|
} from "./chunk-HTWP3CTM.js";
|
|
@@ -35,30 +35,27 @@ import {
|
|
|
35
35
|
} from "./chunk-FPWL4VRC.js";
|
|
36
36
|
import {
|
|
37
37
|
tryGit
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import
|
|
40
|
-
shellQuote
|
|
41
|
-
} from "./chunk-3OMKOT6D.js";
|
|
42
|
-
import "./chunk-DISNKALJ.js";
|
|
38
|
+
} from "./chunk-MPY2OF65.js";
|
|
39
|
+
import "./chunk-HR7HIPYM.js";
|
|
43
40
|
import "./chunk-6QO66MJ4.js";
|
|
44
41
|
import "./chunk-ZZVYRC77.js";
|
|
45
42
|
import "./chunk-J6ULAU7G.js";
|
|
46
43
|
import "./chunk-IBVCCKC3.js";
|
|
47
44
|
import "./chunk-FAYB2ZL6.js";
|
|
48
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-ETL3RMC4.js";
|
|
49
46
|
import "./chunk-MRUIXQXS.js";
|
|
50
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-DP5YM3WJ.js";
|
|
51
48
|
import "./chunk-5SXNWSSH.js";
|
|
52
49
|
import "./chunk-W7TRZLEM.js";
|
|
53
50
|
import "./chunk-P26XSDFU.js";
|
|
54
51
|
import "./chunk-GNNMJOUE.js";
|
|
55
52
|
import "./chunk-RXFNQQZC.js";
|
|
56
53
|
import "./chunk-DUNO7WBT.js";
|
|
57
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-ZRIBI33P.js";
|
|
58
55
|
import "./chunk-D7UZLH36.js";
|
|
59
56
|
import "./chunk-EW2ZM2PC.js";
|
|
60
57
|
import "./chunk-MYH4MQX2.js";
|
|
61
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-R62CNGZO.js";
|
|
62
59
|
import "./chunk-ES5IPLDM.js";
|
|
63
60
|
import "./chunk-5QM5VR3J.js";
|
|
64
61
|
import {
|
|
@@ -80,7 +77,7 @@ import "./chunk-6DGPQ67E.js";
|
|
|
80
77
|
import "./chunk-SSKHLBQB.js";
|
|
81
78
|
|
|
82
79
|
// src/commands/commit.ts
|
|
83
|
-
import { execSync as
|
|
80
|
+
import { execSync as execSync6 } from "child_process";
|
|
84
81
|
|
|
85
82
|
// src/commands/commit/buildCommitMessage.ts
|
|
86
83
|
function buildCommitMessage(subject, refs) {
|
|
@@ -139,10 +136,13 @@ function currentBranch() {
|
|
|
139
136
|
}
|
|
140
137
|
|
|
141
138
|
// src/commands/commit/findConflictMarkers.ts
|
|
142
|
-
import {
|
|
143
|
-
function gitCheckOutput(
|
|
139
|
+
import { execFileSync } from "child_process";
|
|
140
|
+
function gitCheckOutput(args) {
|
|
144
141
|
try {
|
|
145
|
-
return
|
|
142
|
+
return execFileSync("git", args, {
|
|
143
|
+
encoding: "utf8",
|
|
144
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
145
|
+
});
|
|
146
146
|
} catch (error) {
|
|
147
147
|
const stdout = error.stdout;
|
|
148
148
|
if (typeof stdout === "string") return stdout;
|
|
@@ -150,17 +150,16 @@ function gitCheckOutput(cmd) {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
function checkCommands(files) {
|
|
153
|
-
if (files.length === 0) return ["
|
|
154
|
-
const scope = files.map(shellQuote).join(" ");
|
|
153
|
+
if (files.length === 0) return [["diff", "--cached", "--check"]];
|
|
155
154
|
return [
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
["diff", "--check", "--", ...files],
|
|
156
|
+
["diff", "--cached", "--check", "--", ...files]
|
|
158
157
|
];
|
|
159
158
|
}
|
|
160
159
|
function findConflictMarkers(files) {
|
|
161
160
|
const found = /* @__PURE__ */ new Set();
|
|
162
|
-
for (const
|
|
163
|
-
for (const line of gitCheckOutput(
|
|
161
|
+
for (const args of checkCommands(files)) {
|
|
162
|
+
for (const line of gitCheckOutput(args).split("\n")) {
|
|
164
163
|
if (!line.includes("leftover conflict marker")) continue;
|
|
165
164
|
const file = line.slice(0, line.indexOf(":"));
|
|
166
165
|
if (file) found.add(file);
|
|
@@ -171,7 +170,7 @@ function findConflictMarkers(files) {
|
|
|
171
170
|
function findUnmergedPaths() {
|
|
172
171
|
let output;
|
|
173
172
|
try {
|
|
174
|
-
output =
|
|
173
|
+
output = execFileSync("git", ["ls-files", "-u"], {
|
|
175
174
|
encoding: "utf8",
|
|
176
175
|
stdio: ["pipe", "pipe", "pipe"]
|
|
177
176
|
});
|
|
@@ -215,7 +214,7 @@ function abortOnConflicts(files, pulled) {
|
|
|
215
214
|
// src/commands/commit/collectCommitRefs.ts
|
|
216
215
|
function collectCommitRefs(message) {
|
|
217
216
|
const refs = [];
|
|
218
|
-
const branch = tryGit("rev-parse --abbrev-ref HEAD");
|
|
217
|
+
const branch = tryGit("rev-parse", "--abbrev-ref", "HEAD");
|
|
219
218
|
if (branch && branch !== "HEAD") {
|
|
220
219
|
refs.push({
|
|
221
220
|
kind: "branch",
|
|
@@ -223,7 +222,7 @@ function collectCommitRefs(message) {
|
|
|
223
222
|
url: gitRefUrl("branch", branch)
|
|
224
223
|
});
|
|
225
224
|
}
|
|
226
|
-
const sha = tryGit("rev-parse HEAD");
|
|
225
|
+
const sha = tryGit("rev-parse", "HEAD");
|
|
227
226
|
if (sha) {
|
|
228
227
|
const ref = {
|
|
229
228
|
kind: "commit",
|
|
@@ -233,19 +232,19 @@ function collectCommitRefs(message) {
|
|
|
233
232
|
const subject = message.split("\n", 1)[0];
|
|
234
233
|
if (subject) ref.title = subject;
|
|
235
234
|
refs.push(ref);
|
|
236
|
-
const parent = tryGit("rev-parse HEAD^");
|
|
235
|
+
const parent = tryGit("rev-parse", "HEAD^");
|
|
237
236
|
if (parent) refs.push({ kind: "commit-parent", ref: parent });
|
|
238
237
|
}
|
|
239
238
|
return refs;
|
|
240
239
|
}
|
|
241
240
|
|
|
242
241
|
// src/commands/commit/pullKeepingIndex.ts
|
|
243
|
-
import { execSync as
|
|
242
|
+
import { execFileSync as execFileSync3, execSync as execSync3 } from "child_process";
|
|
244
243
|
|
|
245
244
|
// src/commands/commit/recoverAutostash.ts
|
|
246
|
-
import { execFileSync } from "child_process";
|
|
245
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
247
246
|
function git(...args) {
|
|
248
|
-
return
|
|
247
|
+
return execFileSync2("git", args, {
|
|
249
248
|
encoding: "utf8",
|
|
250
249
|
stdio: ["pipe", "pipe", "pipe"]
|
|
251
250
|
});
|
|
@@ -299,29 +298,44 @@ function recoverAutostash(head, before) {
|
|
|
299
298
|
|
|
300
299
|
// src/commands/commit/pullKeepingIndex.ts
|
|
301
300
|
function git2(args, input) {
|
|
302
|
-
return
|
|
301
|
+
return execFileSync3("git", ["--literal-pathspecs", ...args], {
|
|
303
302
|
encoding: "utf8",
|
|
304
303
|
input,
|
|
305
304
|
maxBuffer: 256 * 1024 * 1024,
|
|
306
305
|
stdio: "pipe"
|
|
307
306
|
});
|
|
308
307
|
}
|
|
308
|
+
function currentHead() {
|
|
309
|
+
try {
|
|
310
|
+
return git2(["rev-parse", "--verify", "-q", "HEAD"]).trim();
|
|
311
|
+
} catch {
|
|
312
|
+
return "";
|
|
313
|
+
}
|
|
314
|
+
}
|
|
309
315
|
function restoreIndex(paths, patch) {
|
|
310
316
|
const pathspec = paths.join("\0");
|
|
311
|
-
|
|
317
|
+
const fromStdin = ["--pathspec-from-file=-", "--pathspec-file-nul"];
|
|
318
|
+
git2(["reset", "-q", ...fromStdin], pathspec);
|
|
312
319
|
try {
|
|
313
|
-
git2("apply --cached --binary", patch);
|
|
320
|
+
git2(["apply", "--cached", "--binary"], patch);
|
|
314
321
|
} catch {
|
|
315
|
-
git2("add -A
|
|
322
|
+
git2(["add", "-A", ...fromStdin], pathspec);
|
|
316
323
|
}
|
|
317
324
|
}
|
|
318
325
|
function pullKeepingIndex() {
|
|
319
|
-
const paths = git2("diff --cached --name-only -z --no-renames").split("\0").filter(Boolean);
|
|
320
|
-
const patch = git2(
|
|
321
|
-
|
|
326
|
+
const paths = git2(["diff", "--cached", "--name-only", "-z", "--no-renames"]).split("\0").filter(Boolean);
|
|
327
|
+
const patch = git2([
|
|
328
|
+
"diff-index",
|
|
329
|
+
"--cached",
|
|
330
|
+
"-p",
|
|
331
|
+
"--binary",
|
|
332
|
+
"--no-renames",
|
|
333
|
+
"HEAD"
|
|
334
|
+
]);
|
|
335
|
+
const head = currentHead();
|
|
322
336
|
const stashesBefore = listStashShas();
|
|
323
337
|
try {
|
|
324
|
-
|
|
338
|
+
execSync3("git pull --autostash", { stdio: "inherit" });
|
|
325
339
|
} finally {
|
|
326
340
|
recoverAutostash(head, stashesBefore);
|
|
327
341
|
}
|
|
@@ -338,9 +352,9 @@ function shouldPull(config) {
|
|
|
338
352
|
}
|
|
339
353
|
|
|
340
354
|
// src/commands/commit/listStagedFiles.ts
|
|
341
|
-
import { execSync as
|
|
355
|
+
import { execSync as execSync4 } from "child_process";
|
|
342
356
|
function listStagedFiles() {
|
|
343
|
-
return
|
|
357
|
+
return execSync4("git diff --cached --name-only --relative", {
|
|
344
358
|
cwd: getProjectRoot(),
|
|
345
359
|
encoding: "utf8"
|
|
346
360
|
}).split("\n").filter(Boolean);
|
|
@@ -361,10 +375,10 @@ async function refuseLockedDocs() {
|
|
|
361
375
|
}
|
|
362
376
|
|
|
363
377
|
// src/commands/commit/refuseLockedSchema.ts
|
|
364
|
-
import {
|
|
378
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
365
379
|
function gitShow(spec, root) {
|
|
366
380
|
try {
|
|
367
|
-
return
|
|
381
|
+
return execFileSync4("git", ["show", spec], {
|
|
368
382
|
cwd: root,
|
|
369
383
|
encoding: "utf8",
|
|
370
384
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -398,19 +412,18 @@ async function refuseLockedSchema() {
|
|
|
398
412
|
}
|
|
399
413
|
|
|
400
414
|
// src/commands/commit/commitStaged.ts
|
|
401
|
-
import { execSync as
|
|
415
|
+
import { execFileSync as execFileSync5, execSync as execSync5 } from "child_process";
|
|
402
416
|
function commitStaged(message) {
|
|
403
|
-
|
|
404
|
-
return
|
|
417
|
+
execFileSync5("git", ["commit", "-m", message], { stdio: "inherit" });
|
|
418
|
+
return execSync5("git rev-parse --short=7 HEAD", {
|
|
405
419
|
encoding: "utf8"
|
|
406
420
|
}).trim();
|
|
407
421
|
}
|
|
408
422
|
|
|
409
423
|
// src/commands/commit/stageFiles.ts
|
|
410
|
-
import {
|
|
424
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
411
425
|
function stageFiles(files) {
|
|
412
|
-
|
|
413
|
-
execSync8(`git add ${escaped}`, { stdio: "inherit" });
|
|
426
|
+
execFileSync6("git", ["add", ...files], { stdio: "inherit" });
|
|
414
427
|
}
|
|
415
428
|
|
|
416
429
|
// src/commands/commit/execCommit.ts
|
|
@@ -494,7 +507,7 @@ function validateMessage(message, config) {
|
|
|
494
507
|
// src/commands/commit.ts
|
|
495
508
|
async function commit(args, options = {}) {
|
|
496
509
|
if (args[0] === "status") {
|
|
497
|
-
|
|
510
|
+
execSync6("git status && echo '---DIFF---' && git diff", {
|
|
498
511
|
stdio: "inherit"
|
|
499
512
|
});
|
|
500
513
|
return;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/commands/coverage.ts
|
|
2
|
+
import { spawnSync } from "child_process";
|
|
3
|
+
function coverage() {
|
|
4
|
+
const result = spawnSync(
|
|
5
|
+
"npx",
|
|
6
|
+
[
|
|
7
|
+
"vitest",
|
|
8
|
+
"run",
|
|
9
|
+
"--coverage",
|
|
10
|
+
"--coverage.include=src/**/*.ts",
|
|
11
|
+
"--coverage.all",
|
|
12
|
+
"--coverage.reporter=text"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
encoding: "utf8",
|
|
16
|
+
timeout: 12e4,
|
|
17
|
+
shell: process.platform === "win32"
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
const output = `${result.stdout ?? ""}${result.stderr ?? ""}`;
|
|
21
|
+
const match = output.match(/All files\s*\|\s*([\d.]+)/);
|
|
22
|
+
if (!match) {
|
|
23
|
+
console.error("Could not determine coverage from vitest output.");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
console.log(`${match[1]}%`);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
coverage
|
|
30
|
+
};
|
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
} from "./chunk-ABLDOQ4B.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveIssueRepoTarget
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-DPHNPX75.js";
|
|
26
|
+
import "./chunk-SO3IBV6J.js";
|
|
27
27
|
import "./chunk-YIBSK5OC.js";
|
|
28
28
|
import "./chunk-AVLELL42.js";
|
|
29
29
|
import "./chunk-C3MGHR3N.js";
|
|
30
30
|
import "./chunk-FVZP4ULO.js";
|
|
31
31
|
import {
|
|
32
32
|
awaitPreviewApproval
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-D24GLTCK.js";
|
|
34
34
|
import "./chunk-QS2S63AF.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-P7SERZI6.js";
|
|
36
36
|
import "./chunk-3VDV7VHX.js";
|
|
37
37
|
import "./chunk-B7B26YPF.js";
|
|
38
38
|
import {
|
|
@@ -47,15 +47,15 @@ import {
|
|
|
47
47
|
runGhGraphqlJson
|
|
48
48
|
} from "./chunk-4BVUY25U.js";
|
|
49
49
|
import "./chunk-ZFX4EZMW.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-HR7HIPYM.js";
|
|
51
51
|
import "./chunk-GIHVMELY.js";
|
|
52
52
|
import "./chunk-2EW62DM5.js";
|
|
53
53
|
import "./chunk-GNNMJOUE.js";
|
|
54
54
|
import "./chunk-RXFNQQZC.js";
|
|
55
55
|
import "./chunk-DUNO7WBT.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-ZRIBI33P.js";
|
|
57
57
|
import "./chunk-D7UZLH36.js";
|
|
58
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-R62CNGZO.js";
|
|
59
59
|
import "./chunk-Q6PZLPK4.js";
|
|
60
60
|
import "./chunk-JJKKIBF5.js";
|
|
61
61
|
|