@staff0rd/assist 0.1187.0 → 0.1188.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/commands/github.md +4 -2
- package/dist/.build-files +18 -18
- package/dist/built-version +1 -1
- package/dist/{chunk-PEOCY7Q3.js → chunk-66T4P3GU.js} +1 -1
- package/dist/{chunk-YDSX6BYY.js → chunk-IEDFQBJI.js} +1 -0
- package/dist/{chunk-ODH4PKV4.js → chunk-IT5MTJVS.js} +1 -1
- package/dist/{chunk-XNN2K4S3.js → chunk-RYYZPXIG.js} +1 -1
- package/dist/{chunk-GYM3LVZT.js → chunk-SSRDOW3C.js} +1 -1
- package/dist/{chunk-7GGVRB3G.js → chunk-UNIH25QO.js} +1 -1
- package/dist/{chunk-GIFMD6SW.js → chunk-UZCVA7F5.js} +2 -2
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/{createIssue-ZFRBIC7A.js → createIssue-TDZZAPQQ.js} +7 -7
- package/dist/{doctorNodes-Y5L32TWX.js → doctorNodes-J65UAEA6.js} +3 -3
- package/dist/{edit-2ZO7TOPW.js → edit-R2ZKDIGP.js} +1 -1
- package/dist/{editIssue-MPKFMOLQ.js → editIssue-RBWIZISY.js} +144 -55
- package/dist/index.js +29 -16
- package/dist/{raise-WQ2WINT4.js → raise-BUPAYCZY.js} +1 -1
- package/dist/{restartNode-CAPDQK23.js → restartNode-LKXFQH7A.js} +5 -5
- package/dist/{runDaemon-GHG5TRPX.js → runDaemon-MKBJQQQD.js} +2 -2
- package/dist/{signExtension-GQXLL6CC.js → signExtension-3GB33JGZ.js} +1 -1
- package/dist/{updateNode-RMHEOL4X.js → updateNode-ZOKPR26K.js} +5 -5
- package/dist/{web-IE3MFOE5.js → web-H4VA5QZT.js} +5 -5
- package/dist/{web-3NKRW2FS.js → web-QATICXWA.js} +5 -5
- package/package.json +1 -1
package/agent/commands/github.md
CHANGED
|
@@ -48,14 +48,16 @@ Display the result to the user.
|
|
|
48
48
|
Rework the issue's body in the assist web preview pane. This is what a bare issue reference runs. Run it and nothing else:
|
|
49
49
|
|
|
50
50
|
```
|
|
51
|
-
assist github issue edit <number> -R <owner>/<repo> 2>&1
|
|
51
|
+
assist github issue edit <number> -R <owner>/<repo> [--screenshot '[Group/]Caption=path']... 2>&1
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
If you already know the body you want (e.g. the user asked for a specific rewrite), read the current body with `gh issue view`, compose the revision, and pass it with `--body -` on stdin so the first preview shows your proposal rather than the unchanged body.
|
|
55
55
|
|
|
56
|
+
When you already have an image or video to add to the issue (e.g. a file the user pointed at on disk), pass it with `--screenshot '[Group/]Caption=path'`, once per file, rather than asking the user to drop it into the preview. It is attached under the body's `## Screenshots` section for you; never author that section yourself.
|
|
57
|
+
|
|
56
58
|
For a targeted change to the current body (strike items out, tick a box), run `assist github issue edit <number> -R <owner>/<repo> --fetch` first: it writes the current body to the working file and prints its path without opening a preview. Edit that file in place, then run the command without `--fetch` so the first preview shows your revision. Never run it without `--fetch` just to get the body.
|
|
57
59
|
|
|
58
|
-
Do not check for a web session yourself — the command already knows. In a web session it fetches the issue's current body, opens it in the preview pane, and pushes the pane's markdown back on approval; outside one it just prints the issue. Only the body is ever touched — the title, labels, assignees and state are left alone.
|
|
60
|
+
Do not check for a web session yourself — the command already knows. In a web session it fetches the issue's current body, opens it in the preview pane, and pushes the pane's markdown back on approval; outside one it just prints the issue, or with `--screenshot` attaches the files to the current body directly. Only the body is ever touched — the title, labels, assignees and state are left alone.
|
|
59
61
|
|
|
60
62
|
Display the output so the user can see what happened. If the command exits non-zero, relay what it reported and stop — nothing was pushed. Two cases to relay verbatim:
|
|
61
63
|
|
package/dist/.build-files
CHANGED
|
@@ -69,6 +69,7 @@ chunk-5YO2D7JF.js
|
|
|
69
69
|
chunk-655A7RGF.js
|
|
70
70
|
chunk-664TLOAJ.js
|
|
71
71
|
chunk-66K6EK7O.js
|
|
72
|
+
chunk-66T4P3GU.js
|
|
72
73
|
chunk-67DONCGH.js
|
|
73
74
|
chunk-6DGPQ67E.js
|
|
74
75
|
chunk-6G2ADBNV.js
|
|
@@ -81,7 +82,6 @@ chunk-6VCFPUNV.js
|
|
|
81
82
|
chunk-6Z7XJJNZ.js
|
|
82
83
|
chunk-7DSWCPDZ.js
|
|
83
84
|
chunk-7F22C6MC.js
|
|
84
|
-
chunk-7GGVRB3G.js
|
|
85
85
|
chunk-7HNRCA3N.js
|
|
86
86
|
chunk-7KDF6H4R.js
|
|
87
87
|
chunk-7KVL2L7Z.js
|
|
@@ -163,7 +163,6 @@ chunk-FYYZG4GY.js
|
|
|
163
163
|
chunk-FZDQG67V.js
|
|
164
164
|
chunk-G3CJH2XK.js
|
|
165
165
|
chunk-G3ROBZ4I.js
|
|
166
|
-
chunk-GIFMD6SW.js
|
|
167
166
|
chunk-GIHVMELY.js
|
|
168
167
|
chunk-GL5GKF5A.js
|
|
169
168
|
chunk-GNNMJOUE.js
|
|
@@ -171,7 +170,6 @@ chunk-GQF23TWI.js
|
|
|
171
170
|
chunk-GRXFWFGP.js
|
|
172
171
|
chunk-GVI4JSG7.js
|
|
173
172
|
chunk-GVVK5XFZ.js
|
|
174
|
-
chunk-GYM3LVZT.js
|
|
175
173
|
chunk-H2KHIEQF.js
|
|
176
174
|
chunk-H63MI5HI.js
|
|
177
175
|
chunk-H7EUPSJB.js
|
|
@@ -187,12 +185,14 @@ chunk-I3TEQBTO.js
|
|
|
187
185
|
chunk-IBPSXDUB.js
|
|
188
186
|
chunk-IBVCCKC3.js
|
|
189
187
|
chunk-IDRVSAV5.js
|
|
188
|
+
chunk-IEDFQBJI.js
|
|
190
189
|
chunk-IHZGFTOB.js
|
|
191
190
|
chunk-IISY3AMC.js
|
|
192
191
|
chunk-IKCS5JTK.js
|
|
193
192
|
chunk-IOKBCYSG.js
|
|
194
193
|
chunk-IOYGR6YV.js
|
|
195
194
|
chunk-ISIVSUR5.js
|
|
195
|
+
chunk-IT5MTJVS.js
|
|
196
196
|
chunk-IULYBBGP.js
|
|
197
197
|
chunk-IVBWOIGE.js
|
|
198
198
|
chunk-IXVSWYW2.js
|
|
@@ -256,7 +256,6 @@ chunk-NZYSENRR.js
|
|
|
256
256
|
chunk-O3SCSMQJ.js
|
|
257
257
|
chunk-O6HFT23O.js
|
|
258
258
|
chunk-O6RBWPG2.js
|
|
259
|
-
chunk-ODH4PKV4.js
|
|
260
259
|
chunk-ODLSWRTS.js
|
|
261
260
|
chunk-OLE7XSNB.js
|
|
262
261
|
chunk-OQ6AYXHB.js
|
|
@@ -271,7 +270,6 @@ chunk-P56S7RYB.js
|
|
|
271
270
|
chunk-P7FVAGFQ.js
|
|
272
271
|
chunk-PB3F4XB3.js
|
|
273
272
|
chunk-PDXOHW2M.js
|
|
274
|
-
chunk-PEOCY7Q3.js
|
|
275
273
|
chunk-PIDKNOD6.js
|
|
276
274
|
chunk-PNDUTAZR.js
|
|
277
275
|
chunk-PURNABFX.js
|
|
@@ -301,6 +299,7 @@ chunk-RW6YKTIM.js
|
|
|
301
299
|
chunk-RWVRH774.js
|
|
302
300
|
chunk-RXFNQQZC.js
|
|
303
301
|
chunk-RXKI4XAU.js
|
|
302
|
+
chunk-RYYZPXIG.js
|
|
304
303
|
chunk-RZBCBCNG.js
|
|
305
304
|
chunk-S6XYTJU2.js
|
|
306
305
|
chunk-SDMBTSYP.js
|
|
@@ -309,6 +308,7 @@ chunk-SN2GTNL4.js
|
|
|
309
308
|
chunk-SQX66MN6.js
|
|
310
309
|
chunk-SSKHLBQB.js
|
|
311
310
|
chunk-SSOJWOYS.js
|
|
311
|
+
chunk-SSRDOW3C.js
|
|
312
312
|
chunk-SURCYYQ6.js
|
|
313
313
|
chunk-SVCR2A7L.js
|
|
314
314
|
chunk-SW7FSLHP.js
|
|
@@ -330,10 +330,12 @@ chunk-UFSOFNXQ.js
|
|
|
330
330
|
chunk-UGICWHVH.js
|
|
331
331
|
chunk-UJBW7FVI.js
|
|
332
332
|
chunk-UN4ABKA7.js
|
|
333
|
+
chunk-UNIH25QO.js
|
|
333
334
|
chunk-UP6QV5BJ.js
|
|
334
335
|
chunk-UPGNKZVA.js
|
|
335
336
|
chunk-USKD27FY.js
|
|
336
337
|
chunk-UYSNEOWQ.js
|
|
338
|
+
chunk-UZCVA7F5.js
|
|
337
339
|
chunk-V3AWLJ7P.js
|
|
338
340
|
chunk-VABNWHSE.js
|
|
339
341
|
chunk-VAFCLLQN.js
|
|
@@ -365,7 +367,6 @@ chunk-XDIVXGPQ.js
|
|
|
365
367
|
chunk-XEJODD6D.js
|
|
366
368
|
chunk-XJTXAL22.js
|
|
367
369
|
chunk-XNCJ3OIJ.js
|
|
368
|
-
chunk-XNN2K4S3.js
|
|
369
370
|
chunk-XSJGIJEE.js
|
|
370
371
|
chunk-XT3AOF2P.js
|
|
371
372
|
chunk-XTPBXBZA.js
|
|
@@ -379,7 +380,6 @@ chunk-XZT5S5IY.js
|
|
|
379
380
|
chunk-Y3R4C2P7.js
|
|
380
381
|
chunk-YCFOCDUA.js
|
|
381
382
|
chunk-YDA62L6J.js
|
|
382
|
-
chunk-YDSX6BYY.js
|
|
383
383
|
chunk-YHJHYOBF.js
|
|
384
384
|
chunk-YIBSK5OC.js
|
|
385
385
|
chunk-YJ72SXVD.js
|
|
@@ -463,7 +463,7 @@ configSet-NMSZ27OX.js
|
|
|
463
463
|
configUnset-IINMDUOO.js
|
|
464
464
|
configure-M2ECXTUT.js
|
|
465
465
|
coverage-G7J25BUX.js
|
|
466
|
-
createIssue-
|
|
466
|
+
createIssue-TDZZAPQQ.js
|
|
467
467
|
cyclomatic-CYUIP7H3.js
|
|
468
468
|
daemonStatus-EAZHBC6O.js
|
|
469
469
|
del-6CB5KFFD.js
|
|
@@ -475,13 +475,13 @@ deps-RSUOIZPE.js
|
|
|
475
475
|
docsConfirm-AQGXUXUM.js
|
|
476
476
|
docsScreenshots-VV5F5SK5.js
|
|
477
477
|
docsUnlock-27IXZHHP.js
|
|
478
|
-
doctorNodes-
|
|
478
|
+
doctorNodes-J65UAEA6.js
|
|
479
479
|
done-3VAD7V2R.js
|
|
480
480
|
drainDaemon-ZHP2VY7D.js
|
|
481
481
|
dropRetiredTables-JBLALSG5.js
|
|
482
|
-
edit-
|
|
482
|
+
edit-R2ZKDIGP.js
|
|
483
483
|
editHook-S6MCRMW4.js
|
|
484
|
-
editIssue-
|
|
484
|
+
editIssue-RBWIZISY.js
|
|
485
485
|
editIssueComment-3E3SBBJE.js
|
|
486
486
|
exportBacklog-ZTMILEAX.js
|
|
487
487
|
extension-YYRD5EM6.js
|
|
@@ -555,7 +555,7 @@ prs-2SRUKVTI.js
|
|
|
555
555
|
prsSlackChannel-QGXDVDOM.js
|
|
556
556
|
prsStatus-6G3ZTK36.js
|
|
557
557
|
pullIfConfigured-ATTGJC3C.js
|
|
558
|
-
raise-
|
|
558
|
+
raise-BUPAYCZY.js
|
|
559
559
|
raiseHelpText-IDZI3UAC.js
|
|
560
560
|
ravendbAuth-QCLMPEJ3.js
|
|
561
561
|
ravendbCollections-L4H5PMFE.js
|
|
@@ -582,7 +582,7 @@ repos-HRCIMY6J.js
|
|
|
582
582
|
resolveHarness-ADZRYQZA.js
|
|
583
583
|
resolveModel-2OGVGUM3.js
|
|
584
584
|
restartDaemon-Y7V2QF3N.js
|
|
585
|
-
restartNode-
|
|
585
|
+
restartNode-LKXFQH7A.js
|
|
586
586
|
restructure-OGGDZTXX.js
|
|
587
587
|
review-5635HCXL.js
|
|
588
588
|
reviewPrComments-E5Y5AQ7D.js
|
|
@@ -590,7 +590,7 @@ rewindPhase-S6NGWRFK.js
|
|
|
590
590
|
rulesAdd-75UVUUDX.js
|
|
591
591
|
run-TSPTUSMX.js
|
|
592
592
|
run-ZRNTAO7O.js
|
|
593
|
-
runDaemon-
|
|
593
|
+
runDaemon-MKBJQQQD.js
|
|
594
594
|
runExtract-ALNQ3I3T.js
|
|
595
595
|
runParallelPhase-V2LPUTA3.js
|
|
596
596
|
runRefine-DSGHXEKJ.js
|
|
@@ -612,7 +612,7 @@ show-INQEZ755.js
|
|
|
612
612
|
show-WD57SDPL.js
|
|
613
613
|
showClaudeCodeIcon-E4SAM3GN.js
|
|
614
614
|
showCodexIcon-YUAKV4NI.js
|
|
615
|
-
signExtension-
|
|
615
|
+
signExtension-3GB33JGZ.js
|
|
616
616
|
simulateDivergence-VB4UL4UR.js
|
|
617
617
|
skip-7Q3IVOBV.js
|
|
618
618
|
slack-DX2FRJ7S.js
|
|
@@ -640,7 +640,7 @@ unlinkNode-RKC44U2T.js
|
|
|
640
640
|
unstar-YQDZUJV7.js
|
|
641
641
|
update-FHGTCK6N.js
|
|
642
642
|
update-W7ANHGDR.js
|
|
643
|
-
updateNode-
|
|
643
|
+
updateNode-ZOKPR26K.js
|
|
644
644
|
updatePhase-JEVJRAOR.js
|
|
645
645
|
updatePlan-PYKAHGKE.js
|
|
646
646
|
version-W7VP7LDJ.js
|
|
@@ -648,8 +648,8 @@ viewIssue-CYHIPCFO.js
|
|
|
648
648
|
watchLoop-MV7DVGC6.js
|
|
649
649
|
watchReport-A4W7UOAJ.js
|
|
650
650
|
watchWait-5Y2J5VQY.js
|
|
651
|
-
web-
|
|
652
|
-
web-
|
|
651
|
+
web-H4VA5QZT.js
|
|
652
|
+
web-QATICXWA.js
|
|
653
653
|
withPool-LEJ76IOJ.js
|
|
654
654
|
wontdo-XAQGHSR5.js
|
|
655
655
|
wontfix-W2DXPEE4.js
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.1188.0
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UNIH25QO.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-SSRDOW3C.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -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.1187.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",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.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(`
|
|
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,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
appendScreenshots,
|
|
3
|
-
attachArgs,
|
|
4
|
-
parseScreenshotSpecs,
|
|
5
|
-
runGhWithAttachments,
|
|
6
|
-
stageScreenshots
|
|
7
|
-
} from "./chunk-YDSX6BYY.js";
|
|
8
1
|
import {
|
|
9
2
|
normaliseTypeName,
|
|
10
3
|
resolveIssueType,
|
|
@@ -16,6 +9,13 @@ import {
|
|
|
16
9
|
fetchIssueNodeId,
|
|
17
10
|
resolveCreateIssueParent
|
|
18
11
|
} from "./chunk-TZ5PVDAR.js";
|
|
12
|
+
import {
|
|
13
|
+
appendScreenshots,
|
|
14
|
+
attachArgs,
|
|
15
|
+
parseScreenshotSpecs,
|
|
16
|
+
runGhWithAttachments,
|
|
17
|
+
stageScreenshots
|
|
18
|
+
} from "./chunk-IEDFQBJI.js";
|
|
19
19
|
import "./chunk-WYVUP7Z3.js";
|
|
20
20
|
import {
|
|
21
21
|
validateProposedContent
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
buildDoctorProbes,
|
|
11
11
|
diagnoseLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IT5MTJVS.js";
|
|
13
13
|
import "./chunk-VABNWHSE.js";
|
|
14
14
|
import "./chunk-DS2YJZZY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-SSRDOW3C.js";
|
|
16
16
|
import {
|
|
17
17
|
loadLinkSpecs
|
|
18
18
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
detectPlatform
|
|
31
31
|
} from "./chunk-E36L7ASL.js";
|
|
32
32
|
import "./chunk-GIHVMELY.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-RYYZPXIG.js";
|
|
34
34
|
import "./chunk-5QM5VR3J.js";
|
|
35
35
|
import "./chunk-UFSOFNXQ.js";
|
|
36
36
|
import "./chunk-FLDRXYEM.js";
|
|
@@ -3,6 +3,14 @@ import {
|
|
|
3
3
|
fetchIssueNodeId,
|
|
4
4
|
resolveCreateIssueParent
|
|
5
5
|
} from "./chunk-TZ5PVDAR.js";
|
|
6
|
+
import {
|
|
7
|
+
appendScreenshots,
|
|
8
|
+
attachArgs,
|
|
9
|
+
parseScreenshotSpecs,
|
|
10
|
+
renderScreenshotsSection,
|
|
11
|
+
runGhWithAttachments,
|
|
12
|
+
stageScreenshots
|
|
13
|
+
} from "./chunk-IEDFQBJI.js";
|
|
6
14
|
import "./chunk-WYVUP7Z3.js";
|
|
7
15
|
import {
|
|
8
16
|
validateProposedContent
|
|
@@ -28,6 +36,8 @@ import {
|
|
|
28
36
|
} from "./chunk-UE5PIMY2.js";
|
|
29
37
|
import "./chunk-QRTB7PVR.js";
|
|
30
38
|
import "./chunk-3VDV7VHX.js";
|
|
39
|
+
import "./chunk-B7B26YPF.js";
|
|
40
|
+
import "./chunk-DPCFT55U.js";
|
|
31
41
|
import "./chunk-4BVUY25U.js";
|
|
32
42
|
import "./chunk-ZFX4EZMW.js";
|
|
33
43
|
import "./chunk-DISNKALJ.js";
|
|
@@ -71,14 +81,8 @@ function fetchIssue(number, repo) {
|
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
|
|
74
|
-
// src/commands/github/issue/
|
|
75
|
-
|
|
76
|
-
const match = /github\.com\/([^/]+\/[^/]+)\//.exec(url ?? "");
|
|
77
|
-
return match ? match[1] : "unknown/unknown";
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// src/commands/github/issue/writeIssueWorkingFile.ts
|
|
81
|
-
import { mkdirSync, writeFileSync } from "fs";
|
|
84
|
+
// src/commands/github/issue/resumeIssueBody.ts
|
|
85
|
+
import { existsSync, readFileSync } from "fs";
|
|
82
86
|
|
|
83
87
|
// src/commands/github/issue/issueWorkingFile.ts
|
|
84
88
|
import { join } from "path";
|
|
@@ -92,38 +96,7 @@ function issueWorkingFile(slug, number) {
|
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
// src/commands/github/issue/writeIssueWorkingFile.ts
|
|
96
|
-
function writeIssueWorkingFile(slug, number, target, updatedAt, body) {
|
|
97
|
-
const { dir, bodyPath, metaPath } = issueWorkingFile(slug, number);
|
|
98
|
-
mkdirSync(dir, { recursive: true });
|
|
99
|
-
writeFileSync(bodyPath, body);
|
|
100
|
-
writeFileSync(
|
|
101
|
-
metaPath,
|
|
102
|
-
`${JSON.stringify({ target, updatedAt }, null, 2)}
|
|
103
|
-
`
|
|
104
|
-
);
|
|
105
|
-
return bodyPath;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// src/commands/github/issue/fetchIssueToWorkingFile.ts
|
|
109
|
-
function fetchIssueToWorkingFile(number, repo) {
|
|
110
|
-
const issue = fetchIssue(number, repo);
|
|
111
|
-
const slug = repo ?? slugFromUrl(issue.url);
|
|
112
|
-
const target = `${slug}#${number}`;
|
|
113
|
-
const bodyPath = writeIssueWorkingFile(
|
|
114
|
-
slug,
|
|
115
|
-
number,
|
|
116
|
-
target,
|
|
117
|
-
issue.updatedAt,
|
|
118
|
-
issue.body
|
|
119
|
-
);
|
|
120
|
-
console.log(
|
|
121
|
-
`Wrote the current body of ${target} to ${bodyPath}. Edit it in place, then run 'assist github issue edit ${number}${repo ? ` -R ${repo}` : ""}' to preview the revision.`
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
99
|
// src/commands/github/issue/resumeIssueBody.ts
|
|
126
|
-
import { existsSync, readFileSync } from "fs";
|
|
127
100
|
function resumeIssueBody(slug, number, updatedAt) {
|
|
128
101
|
const { bodyPath, metaPath } = issueWorkingFile(slug, number);
|
|
129
102
|
if (!existsSync(bodyPath) || !existsSync(metaPath)) return void 0;
|
|
@@ -145,6 +118,26 @@ function validateIssueBody(title, body) {
|
|
|
145
118
|
);
|
|
146
119
|
}
|
|
147
120
|
|
|
121
|
+
// src/commands/github/issue/writeIssueWorkingFile.ts
|
|
122
|
+
import { mkdirSync, writeFileSync } from "fs";
|
|
123
|
+
function writeIssueWorkingFile(slug, number, target, updatedAt, body) {
|
|
124
|
+
const { dir, bodyPath, metaPath } = issueWorkingFile(slug, number);
|
|
125
|
+
mkdirSync(dir, { recursive: true });
|
|
126
|
+
writeFileSync(bodyPath, body);
|
|
127
|
+
writeFileSync(
|
|
128
|
+
metaPath,
|
|
129
|
+
`${JSON.stringify({ target, updatedAt }, null, 2)}
|
|
130
|
+
`
|
|
131
|
+
);
|
|
132
|
+
return bodyPath;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/commands/github/issue/slugFromUrl.ts
|
|
136
|
+
function slugFromUrl(url) {
|
|
137
|
+
const match = /github\.com\/([^/]+\/[^/]+)\//.exec(url ?? "");
|
|
138
|
+
return match ? match[1] : "unknown/unknown";
|
|
139
|
+
}
|
|
140
|
+
|
|
148
141
|
// src/commands/github/issue/prepareIssueEdit.ts
|
|
149
142
|
function prepareIssueEdit(number, repo, fresh, proposed) {
|
|
150
143
|
const issue = fetchIssue(number, repo);
|
|
@@ -169,33 +162,107 @@ function prepareIssueEdit(number, repo, fresh, proposed) {
|
|
|
169
162
|
|
|
170
163
|
// src/commands/github/issue/pushIssueBody.ts
|
|
171
164
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
165
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
166
|
+
|
|
167
|
+
// src/commands/github/issue/mergeIssueScreenshots.ts
|
|
168
|
+
var HEADING = "## Screenshots";
|
|
169
|
+
function mergeIssueScreenshots(body, attachments) {
|
|
170
|
+
if (attachments.length === 0) return body;
|
|
171
|
+
const heading = /(^|\n)## Screenshots[ \t]*(?=\n|$)/.exec(body);
|
|
172
|
+
if (!heading) return appendScreenshots(body, attachments);
|
|
173
|
+
const sectionStart = heading.index + heading[0].length;
|
|
174
|
+
const next = body.indexOf("\n## ", sectionStart);
|
|
175
|
+
const sectionEnd = next === -1 ? body.length : next;
|
|
176
|
+
const added = renderScreenshotsSection(attachments).slice(
|
|
177
|
+
`${HEADING}
|
|
178
|
+
|
|
179
|
+
`.length
|
|
180
|
+
);
|
|
181
|
+
const rest = body.slice(sectionEnd);
|
|
182
|
+
return `${body.slice(0, sectionEnd).trimEnd()}
|
|
183
|
+
|
|
184
|
+
${added}${rest ? `
|
|
185
|
+
${rest}` : ""}`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/commands/github/issue/pushIssueBody.ts
|
|
189
|
+
function pushIssueBody(number, repo, bodyPath, attachments = []) {
|
|
190
|
+
const repoArgs = repo ? ["--repo", repo] : [];
|
|
191
|
+
if (attachments.length > 0) {
|
|
192
|
+
const body = mergeIssueScreenshots(
|
|
193
|
+
readFileSync2(bodyPath, "utf8"),
|
|
194
|
+
attachments
|
|
195
|
+
);
|
|
196
|
+
process.stdout.write(
|
|
197
|
+
runGhWithAttachments(
|
|
198
|
+
[
|
|
199
|
+
"issue",
|
|
200
|
+
"edit",
|
|
201
|
+
String(number),
|
|
202
|
+
"--body",
|
|
203
|
+
body,
|
|
204
|
+
...repoArgs,
|
|
205
|
+
...attachArgs(attachments)
|
|
206
|
+
],
|
|
207
|
+
attachments
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
175
212
|
try {
|
|
176
|
-
execFileSync2(
|
|
213
|
+
execFileSync2(
|
|
214
|
+
"gh",
|
|
215
|
+
["issue", "edit", String(number), "--body-file", bodyPath, ...repoArgs],
|
|
216
|
+
{ stdio: "inherit" }
|
|
217
|
+
);
|
|
177
218
|
} catch {
|
|
178
219
|
process.exit(1);
|
|
179
220
|
}
|
|
180
221
|
}
|
|
181
222
|
|
|
223
|
+
// src/commands/github/issue/attachIssueScreenshots.ts
|
|
224
|
+
async function attachIssueScreenshots(number, repo, body, screenshots) {
|
|
225
|
+
const proposed = body ? await readBodyArgument(body) : void 0;
|
|
226
|
+
const issue = prepareIssueEdit(number, repo, true, proposed);
|
|
227
|
+
pushIssueBody(number, repo, issue.bodyPath, screenshots);
|
|
228
|
+
console.log(`Screenshots attached to ${issue.target}`);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/commands/github/issue/fetchIssueToWorkingFile.ts
|
|
232
|
+
function fetchIssueToWorkingFile(number, repo) {
|
|
233
|
+
const issue = fetchIssue(number, repo);
|
|
234
|
+
const slug = repo ?? slugFromUrl(issue.url);
|
|
235
|
+
const target = `${slug}#${number}`;
|
|
236
|
+
const bodyPath = writeIssueWorkingFile(
|
|
237
|
+
slug,
|
|
238
|
+
number,
|
|
239
|
+
target,
|
|
240
|
+
issue.updatedAt,
|
|
241
|
+
issue.body
|
|
242
|
+
);
|
|
243
|
+
console.log(
|
|
244
|
+
`Wrote the current body of ${target} to ${bodyPath}. Edit it in place, then run 'assist github issue edit ${number}${repo ? ` -R ${repo}` : ""}' to preview the revision.`
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
182
248
|
// src/commands/github/issue/pushUnchangedIssue.ts
|
|
183
|
-
function pushUnchangedIssue(number, repo, target, fetchedAt, bodyPath) {
|
|
249
|
+
function pushUnchangedIssue(number, repo, target, fetchedAt, bodyPath, attachments = []) {
|
|
184
250
|
if (fetchIssue(number, repo).updatedAt !== fetchedAt) {
|
|
185
251
|
console.error(
|
|
186
252
|
`${target} was updated on GitHub after it was fetched. Nothing was pushed; the markdown is at ${bodyPath}`
|
|
187
253
|
);
|
|
188
254
|
process.exit(1);
|
|
189
255
|
}
|
|
190
|
-
pushIssueBody(number, repo, bodyPath);
|
|
256
|
+
pushIssueBody(number, repo, bodyPath, attachments);
|
|
191
257
|
console.log(`Issue body updated on ${target}`);
|
|
192
258
|
}
|
|
193
259
|
|
|
194
260
|
// src/commands/github/issue/reviewProposedIssueEdit.ts
|
|
195
261
|
import { randomUUID } from "crypto";
|
|
196
|
-
async function reviewProposedIssueEdit(title, body, working) {
|
|
262
|
+
async function reviewProposedIssueEdit(title, body, working, screenshots = []) {
|
|
197
263
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
198
|
-
if (process.env.ASSIST_SESSION !== "1" || !sessionId)
|
|
264
|
+
if (process.env.ASSIST_SESSION !== "1" || !sessionId)
|
|
265
|
+
return { body, screenshots };
|
|
199
266
|
const decision = await awaitPreviewApproval(
|
|
200
267
|
"GitHub issue edit preview",
|
|
201
268
|
{
|
|
@@ -204,32 +271,38 @@ async function reviewProposedIssueEdit(title, body, working) {
|
|
|
204
271
|
title,
|
|
205
272
|
body,
|
|
206
273
|
prNumber: null,
|
|
207
|
-
kind: "github-issue-edit"
|
|
274
|
+
kind: "github-issue-edit",
|
|
275
|
+
screenshots: screenshots.length ? await stageScreenshots(screenshots) : void 0
|
|
208
276
|
},
|
|
209
277
|
{
|
|
210
278
|
saveEditedBody: working.save,
|
|
211
279
|
rejectionAdvice: `Nothing was pushed. The pane's markdown, including any collapses already applied, is at ${working.path}. Revise that file in place \u2014 do not recompose the body from scratch \u2014 then re-run this command to preview the revision.`
|
|
212
280
|
}
|
|
213
281
|
);
|
|
214
|
-
return
|
|
282
|
+
return {
|
|
283
|
+
body: decision.body ?? body,
|
|
284
|
+
screenshots: decision.screenshots ?? []
|
|
285
|
+
};
|
|
215
286
|
}
|
|
216
287
|
|
|
217
288
|
// src/commands/github/issue/previewIssueEdit.ts
|
|
218
|
-
async function previewIssueEdit(number, repo, fresh, body) {
|
|
289
|
+
async function previewIssueEdit(number, repo, fresh, body, screenshots = []) {
|
|
219
290
|
const proposed = body ? await readBodyArgument(body) : void 0;
|
|
220
291
|
const issue = prepareIssueEdit(number, repo, fresh, proposed);
|
|
221
292
|
const edited = await reviewProposedIssueEdit(
|
|
222
293
|
`Edit ${issue.target}: ${issue.title}`,
|
|
223
294
|
issue.body,
|
|
224
|
-
{ path: issue.bodyPath, save: issue.save }
|
|
295
|
+
{ path: issue.bodyPath, save: issue.save },
|
|
296
|
+
screenshots
|
|
225
297
|
);
|
|
226
|
-
validateIssueBody(issue.title, edited);
|
|
298
|
+
validateIssueBody(issue.title, edited.body);
|
|
227
299
|
pushUnchangedIssue(
|
|
228
300
|
number,
|
|
229
301
|
repo,
|
|
230
302
|
issue.target,
|
|
231
303
|
issue.updatedAt,
|
|
232
|
-
issue.bodyPath
|
|
304
|
+
issue.bodyPath,
|
|
305
|
+
edited.screenshots
|
|
233
306
|
);
|
|
234
307
|
}
|
|
235
308
|
|
|
@@ -264,13 +337,14 @@ function viewIssue(number, repo) {
|
|
|
264
337
|
}
|
|
265
338
|
|
|
266
339
|
// src/commands/github/issue/editIssue.ts
|
|
267
|
-
var USAGE = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--fetch] [--parent <issue>]";
|
|
340
|
+
var USAGE = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--fetch] [--parent <issue>] [--screenshot '[Group/]Caption=path']";
|
|
268
341
|
async function editIssue(numberArg, options) {
|
|
269
342
|
const number = Number.parseInt(numberArg, 10);
|
|
270
343
|
if (!Number.isInteger(number) || number <= 0) {
|
|
271
344
|
console.error(USAGE);
|
|
272
345
|
process.exit(1);
|
|
273
346
|
}
|
|
347
|
+
const screenshots = parseScreenshotSpecs(options.screenshot);
|
|
274
348
|
if (options.parent) {
|
|
275
349
|
setIssueParent(number, options.repo, options.parent);
|
|
276
350
|
return;
|
|
@@ -280,10 +354,25 @@ async function editIssue(numberArg, options) {
|
|
|
280
354
|
return;
|
|
281
355
|
}
|
|
282
356
|
if (!inWebSession()) {
|
|
357
|
+
if (screenshots.length > 0) {
|
|
358
|
+
await attachIssueScreenshots(
|
|
359
|
+
number,
|
|
360
|
+
options.repo,
|
|
361
|
+
options.body,
|
|
362
|
+
screenshots
|
|
363
|
+
);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
283
366
|
viewIssue(number, options.repo);
|
|
284
367
|
return;
|
|
285
368
|
}
|
|
286
|
-
await previewIssueEdit(
|
|
369
|
+
await previewIssueEdit(
|
|
370
|
+
number,
|
|
371
|
+
options.repo,
|
|
372
|
+
options.fresh,
|
|
373
|
+
options.body,
|
|
374
|
+
screenshots
|
|
375
|
+
);
|
|
287
376
|
}
|
|
288
377
|
export {
|
|
289
378
|
editIssue
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-TJGF3Z72.js";
|
|
18
18
|
import {
|
|
19
19
|
package_default
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RYYZPXIG.js";
|
|
21
21
|
import {
|
|
22
22
|
adviceConfigHelp,
|
|
23
23
|
askQuestionConfigHelp,
|
|
@@ -92,7 +92,7 @@ import { Command } from "commander";
|
|
|
92
92
|
// src/commands/registerRootAction.ts
|
|
93
93
|
function registerRootAction(program) {
|
|
94
94
|
program.option("--no-open", "Do not open a browser on startup").action(
|
|
95
|
-
async (options) => (await import("./web-
|
|
95
|
+
async (options) => (await import("./web-QATICXWA.js")).web({
|
|
96
96
|
port: "3100",
|
|
97
97
|
open: options.open
|
|
98
98
|
})
|
|
@@ -645,7 +645,7 @@ function registerShowCommands(cmd) {
|
|
|
645
645
|
|
|
646
646
|
// src/commands/registerBacklog.ts
|
|
647
647
|
function registerWebCommand(cmd) {
|
|
648
|
-
cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-
|
|
648
|
+
cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-H4VA5QZT.js"), "web"));
|
|
649
649
|
}
|
|
650
650
|
var registrars = [
|
|
651
651
|
registerItemCommands,
|
|
@@ -675,7 +675,7 @@ function registerBacklog(program) {
|
|
|
675
675
|
const { setBacklogDir } = await import("./getBacklogDir-FJLWXTYN.js");
|
|
676
676
|
setBacklogDir(thisCommand.opts().dir);
|
|
677
677
|
}).action(
|
|
678
|
-
async (options) => (await import("./web-
|
|
678
|
+
async (options) => (await import("./web-H4VA5QZT.js")).web({ port: "3100", open: options.open })
|
|
679
679
|
);
|
|
680
680
|
for (const register of registrars) {
|
|
681
681
|
register(cmd);
|
|
@@ -988,7 +988,7 @@ function registerExtension(program) {
|
|
|
988
988
|
).action(async (options) => {
|
|
989
989
|
const { extension } = await import("./extension-YYRD5EM6.js");
|
|
990
990
|
const { printExtensionUrl } = await import("./printExtensionUrl-IW2WTSNS.js");
|
|
991
|
-
const { signExtension } = await import("./signExtension-
|
|
991
|
+
const { signExtension } = await import("./signExtension-3GB33JGZ.js");
|
|
992
992
|
if (options.url) return printExtensionUrl();
|
|
993
993
|
return options.sign ? signExtension() : extension();
|
|
994
994
|
});
|
|
@@ -1267,7 +1267,7 @@ When you already have an image or video to include (e.g. a file the user pointed
|
|
|
1267
1267
|
--type, --parent, --project, --status, --label and --milestone are all resolved before the preview, so an unknown name, an unreadable parent, a missing project scope or --status without --project creates nothing.
|
|
1268
1268
|
A bare --parent number is read against --repo, or the current repo; a parent in another repository is allowed.
|
|
1269
1269
|
The project scope is needed for --project: gh auth refresh -h github.com -s project`
|
|
1270
|
-
).action(lazyAction(() => import("./createIssue-
|
|
1270
|
+
).action(lazyAction(() => import("./createIssue-TDZZAPQQ.js"), "createIssue"));
|
|
1271
1271
|
internalCommand(createCommand, "/github create");
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
@@ -1288,10 +1288,23 @@ function registerEditIssue(issueCommand) {
|
|
|
1288
1288
|
).option(
|
|
1289
1289
|
"--parent <issue>",
|
|
1290
1290
|
"Make the issue a sub-issue of this one, as owner/repo#number, a github.com issue URL, or a bare number"
|
|
1291
|
+
).option(
|
|
1292
|
+
"--screenshot <spec>",
|
|
1293
|
+
"Attach an image or video as '[Group/]Caption=path' under ## Screenshots (repeatable)",
|
|
1294
|
+
collect5,
|
|
1295
|
+
[]
|
|
1291
1296
|
).addHelpText(
|
|
1292
1297
|
"after",
|
|
1293
|
-
|
|
1294
|
-
|
|
1298
|
+
`
|
|
1299
|
+
Fetches the issue's current body and opens it in the assist web preview pane, where it can be reworked before it is pushed back.
|
|
1300
|
+
When you already know the body you want, pass it with --body (--body - reads stdin): the first preview then shows that proposal instead of the current body, replacing any working file.
|
|
1301
|
+
To make a targeted change to the current body (strike items out, tick a box), run with --fetch first: it writes the current body to the working file and prints its path without opening a preview. Edit that file in place, then re-run without --fetch or --body so the first preview shows your revision. Never run without --fetch just to get the body.
|
|
1302
|
+
Approving pushes the pane's markdown to the issue; nothing is pushed if the issue moved on GitHub after it was fetched, or outside a web session unless --screenshot is given.
|
|
1303
|
+
Rejecting writes the pane's markdown to a working file and names it: revise that file in place and re-run to preview the revision, which keeps any collapses already applied. A re-run resumes from the working file while the issue has not moved on GitHub; --fresh discards it and re-fetches.
|
|
1304
|
+
Only the body is touched \u2014 the title, labels, assignees and state are left alone.
|
|
1305
|
+
--parent sets the issue's parent instead of editing the body: nothing is previewed and no web session is needed. A bare number is read against --repo, or the current repo; a parent in another repository is allowed.
|
|
1306
|
+
When you already have an image or video to add (e.g. a file the user pointed at), pass it with --screenshot '[Group/]Caption=path' (once per file) rather than asking the reviewer to drop it in; a missing file or an extension gh cannot attach fails before anything is previewed. In a web session it arrives pre-staged beside the editable body, and the reviewer may also drop or paste more screenshots or video into the pane; on approval gh attaches them all (gh ${minGhAttachVersion}+) under the body's ## Screenshots section, after any images already there. Outside a web session the --screenshot files are attached directly to the current body (or --body). Never author a ## Screenshots section yourself.`
|
|
1307
|
+
).action(lazyAction(() => import("./editIssue-RBWIZISY.js"), "editIssue"));
|
|
1295
1308
|
internalCommand(editCommand, "/github");
|
|
1296
1309
|
}
|
|
1297
1310
|
|
|
@@ -1755,7 +1768,7 @@ function registerPrsEdit(prsCommand) {
|
|
|
1755
1768
|
"Attach a screenshot as '[Group/]Caption=path', replacing the ## Screenshots section (repeatable)",
|
|
1756
1769
|
collect6,
|
|
1757
1770
|
[]
|
|
1758
|
-
).addHelpText("after", () => editHelpText()).action(lazyAction(() => import("./edit-
|
|
1771
|
+
).addHelpText("after", () => editHelpText()).action(lazyAction(() => import("./edit-R2ZKDIGP.js"), "edit"));
|
|
1759
1772
|
internalCommand(editCommand, "agents revising their pull request");
|
|
1760
1773
|
}
|
|
1761
1774
|
|
|
@@ -1813,7 +1826,7 @@ function registerPrsRaise(prsCommand) {
|
|
|
1813
1826
|
lazyHelpText(
|
|
1814
1827
|
raiseCommand,
|
|
1815
1828
|
async () => (await import("./raiseHelpText-IDZI3UAC.js")).raiseHelpText
|
|
1816
|
-
).action(lazyAction(() => import("./raise-
|
|
1829
|
+
).action(lazyAction(() => import("./raise-BUPAYCZY.js"), "raise"));
|
|
1817
1830
|
internalCommand(raiseCommand, "/pr");
|
|
1818
1831
|
configHelp(raiseCommand, prsRaiseConfigHelp);
|
|
1819
1832
|
}
|
|
@@ -2665,7 +2678,7 @@ function registerDaemon(program) {
|
|
|
2665
2678
|
const cmd = program.command("daemon").description("Long-lived daemon that owns web session PTYs");
|
|
2666
2679
|
cmd.command("run").description(
|
|
2667
2680
|
"Run the sessions daemon in the foreground (auto-spawned by assist sessions)"
|
|
2668
|
-
).action(lazyAction(() => import("./runDaemon-
|
|
2681
|
+
).action(lazyAction(() => import("./runDaemon-MKBJQQQD.js"), "runDaemon"));
|
|
2669
2682
|
cmd.command("status").description(
|
|
2670
2683
|
"Show sessions daemon status, live sessions, and any stray daemon processes"
|
|
2671
2684
|
).action(lazyAction(() => import("./daemonStatus-EAZHBC6O.js"), "daemonStatus"));
|
|
@@ -2689,7 +2702,7 @@ function registerDiagnoseCommands(nodes, calledBy5) {
|
|
|
2689
2702
|
nodes.command("doctor [name]").description(
|
|
2690
2703
|
"Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
|
|
2691
2704
|
).option("--json", "Output as JSON").action(
|
|
2692
|
-
async (name, _options, command) => (await import("./doctorNodes-
|
|
2705
|
+
async (name, _options, command) => (await import("./doctorNodes-J65UAEA6.js")).doctorNodes(
|
|
2693
2706
|
name,
|
|
2694
2707
|
command.optsWithGlobals()
|
|
2695
2708
|
)
|
|
@@ -2719,14 +2732,14 @@ function registerPeerActionCommands(nodes, calledBy5) {
|
|
|
2719
2732
|
internalCommand(
|
|
2720
2733
|
nodes.command("restart <name>").description(
|
|
2721
2734
|
"Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
|
|
2722
|
-
).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-
|
|
2735
|
+
).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-LKXFQH7A.js"), "restartNode")),
|
|
2723
2736
|
calledBy5
|
|
2724
2737
|
);
|
|
2725
2738
|
internalCommand(
|
|
2726
2739
|
nodes.command("update <name>").description(
|
|
2727
2740
|
"Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
|
|
2728
2741
|
).action(
|
|
2729
|
-
async (name) => (await import("./updateNode-
|
|
2742
|
+
async (name) => (await import("./updateNode-ZOKPR26K.js")).updateNode(name)
|
|
2730
2743
|
),
|
|
2731
2744
|
calledBy5
|
|
2732
2745
|
);
|
|
@@ -2789,7 +2802,7 @@ function registerSetStatusCommand(cmd) {
|
|
|
2789
2802
|
// src/commands/sessions/registerSessionsWeb.ts
|
|
2790
2803
|
function registerSessionsWeb(cmd) {
|
|
2791
2804
|
const webCmd = cmd.command("web").description("Start the sessions web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(
|
|
2792
|
-
async (options, command) => (await import("./web-
|
|
2805
|
+
async (options, command) => (await import("./web-QATICXWA.js")).web({
|
|
2793
2806
|
...options,
|
|
2794
2807
|
open: command.optsWithGlobals().open
|
|
2795
2808
|
})
|
|
@@ -2804,7 +2817,7 @@ function registerSessionsWeb(cmd) {
|
|
|
2804
2817
|
// src/commands/sessions/registerSessions.ts
|
|
2805
2818
|
function registerSessions(program) {
|
|
2806
2819
|
const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
|
|
2807
|
-
async (_options, command) => (await import("./web-
|
|
2820
|
+
async (_options, command) => (await import("./web-QATICXWA.js")).web({
|
|
2808
2821
|
port: "3100",
|
|
2809
2822
|
open: command.optsWithGlobals().open
|
|
2810
2823
|
})
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
linkStatus,
|
|
3
3
|
postToPeer,
|
|
4
4
|
startPeerAction
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-66T4P3GU.js";
|
|
6
|
+
import "./chunk-UNIH25QO.js";
|
|
7
|
+
import "./chunk-IT5MTJVS.js";
|
|
8
8
|
import "./chunk-VABNWHSE.js";
|
|
9
9
|
import "./chunk-DS2YJZZY.js";
|
|
10
10
|
import "./chunk-4HKB2TAG.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-SSRDOW3C.js";
|
|
12
12
|
import "./chunk-J2PPCMCR.js";
|
|
13
13
|
import "./chunk-5CNDLMYO.js";
|
|
14
14
|
import "./chunk-B7VOTF5Q.js";
|
|
15
15
|
import "./chunk-E36L7ASL.js";
|
|
16
16
|
import "./chunk-5H7EHZ3J.js";
|
|
17
17
|
import "./chunk-GIHVMELY.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-RYYZPXIG.js";
|
|
19
19
|
import "./chunk-UFSOFNXQ.js";
|
|
20
20
|
import "./chunk-FLDRXYEM.js";
|
|
21
21
|
import "./chunk-GRXFWFGP.js";
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
isHello,
|
|
129
129
|
linkVersionCheck,
|
|
130
130
|
negotiateProtocol
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-SSRDOW3C.js";
|
|
132
132
|
import {
|
|
133
133
|
loadLinkSpecs
|
|
134
134
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -267,7 +267,7 @@ import {
|
|
|
267
267
|
import "./chunk-APZ6ZTDA.js";
|
|
268
268
|
import "./chunk-BFQSGIN6.js";
|
|
269
269
|
import "./chunk-D7UZLH36.js";
|
|
270
|
-
import "./chunk-
|
|
270
|
+
import "./chunk-RYYZPXIG.js";
|
|
271
271
|
import "./chunk-EW2ZM2PC.js";
|
|
272
272
|
import "./chunk-MYH4MQX2.js";
|
|
273
273
|
import {
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
linkStatus,
|
|
3
3
|
postToPeer,
|
|
4
4
|
startPeerAction
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-66T4P3GU.js";
|
|
6
|
+
import "./chunk-UNIH25QO.js";
|
|
7
|
+
import "./chunk-IT5MTJVS.js";
|
|
8
8
|
import "./chunk-VABNWHSE.js";
|
|
9
9
|
import "./chunk-DS2YJZZY.js";
|
|
10
10
|
import "./chunk-4HKB2TAG.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-SSRDOW3C.js";
|
|
12
12
|
import "./chunk-J2PPCMCR.js";
|
|
13
13
|
import "./chunk-5CNDLMYO.js";
|
|
14
14
|
import "./chunk-B7VOTF5Q.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-A7ONLVZD.js";
|
|
20
20
|
import "./chunk-GIHVMELY.js";
|
|
21
21
|
import "./chunk-2EW62DM5.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RYYZPXIG.js";
|
|
23
23
|
import "./chunk-UFSOFNXQ.js";
|
|
24
24
|
import "./chunk-FLDRXYEM.js";
|
|
25
25
|
import "./chunk-GRXFWFGP.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
web
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UZCVA7F5.js";
|
|
4
4
|
import "./chunk-SURCYYQ6.js";
|
|
5
5
|
import "./chunk-JNCFHWBK.js";
|
|
6
6
|
import "./chunk-JM57BCD6.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-UNIH25QO.js";
|
|
8
|
+
import "./chunk-IT5MTJVS.js";
|
|
9
9
|
import "./chunk-VABNWHSE.js";
|
|
10
10
|
import "./chunk-DS2YJZZY.js";
|
|
11
11
|
import "./chunk-2RUGZQUD.js";
|
|
12
12
|
import "./chunk-PDXOHW2M.js";
|
|
13
13
|
import "./chunk-4HKB2TAG.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-SSRDOW3C.js";
|
|
15
15
|
import "./chunk-J2PPCMCR.js";
|
|
16
16
|
import "./chunk-5CNDLMYO.js";
|
|
17
17
|
import "./chunk-B7VOTF5Q.js";
|
|
@@ -138,7 +138,7 @@ import "./chunk-RW6YKTIM.js";
|
|
|
138
138
|
import "./chunk-APZ6ZTDA.js";
|
|
139
139
|
import "./chunk-BFQSGIN6.js";
|
|
140
140
|
import "./chunk-D7UZLH36.js";
|
|
141
|
-
import "./chunk-
|
|
141
|
+
import "./chunk-RYYZPXIG.js";
|
|
142
142
|
import "./chunk-YUV5QBHU.js";
|
|
143
143
|
import "./chunk-YVL3NXEB.js";
|
|
144
144
|
import "./chunk-UEWARAPX.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
web
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UZCVA7F5.js";
|
|
4
4
|
import "./chunk-SURCYYQ6.js";
|
|
5
5
|
import "./chunk-JNCFHWBK.js";
|
|
6
6
|
import "./chunk-JM57BCD6.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-UNIH25QO.js";
|
|
8
|
+
import "./chunk-IT5MTJVS.js";
|
|
9
9
|
import "./chunk-VABNWHSE.js";
|
|
10
10
|
import "./chunk-DS2YJZZY.js";
|
|
11
11
|
import "./chunk-2RUGZQUD.js";
|
|
12
12
|
import "./chunk-PDXOHW2M.js";
|
|
13
13
|
import "./chunk-4HKB2TAG.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-SSRDOW3C.js";
|
|
15
15
|
import "./chunk-J2PPCMCR.js";
|
|
16
16
|
import "./chunk-5CNDLMYO.js";
|
|
17
17
|
import "./chunk-B7VOTF5Q.js";
|
|
@@ -138,7 +138,7 @@ import "./chunk-RW6YKTIM.js";
|
|
|
138
138
|
import "./chunk-APZ6ZTDA.js";
|
|
139
139
|
import "./chunk-BFQSGIN6.js";
|
|
140
140
|
import "./chunk-D7UZLH36.js";
|
|
141
|
-
import "./chunk-
|
|
141
|
+
import "./chunk-RYYZPXIG.js";
|
|
142
142
|
import "./chunk-YUV5QBHU.js";
|
|
143
143
|
import "./chunk-YVL3NXEB.js";
|
|
144
144
|
import "./chunk-UEWARAPX.js";
|