@staff0rd/assist 0.1201.1 → 0.1202.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/dist/.build-files +20 -20
- package/dist/built-version +1 -1
- package/dist/{chunk-UPGNKZVA.js → chunk-2PROSCII.js} +2 -0
- package/dist/{chunk-ARXTFRDX.js → chunk-5JUSTCY7.js} +1 -1
- package/dist/{chunk-4UNCME4M.js → chunk-GNCIBOPQ.js} +4 -5
- package/dist/{chunk-JLU45T4H.js → chunk-IBG2UFAA.js} +1 -1
- package/dist/{chunk-SP5U6IC5.js → chunk-LFA465WL.js} +1 -1
- package/dist/{chunk-NTA2FTSD.js → chunk-S4FGQFSO.js} +1 -1
- package/dist/{chunk-5V3LHEZ2.js → chunk-SQRMRKKU.js} +1 -1
- package/dist/{chunk-UQCBPHRV.js → chunk-T2BRM7NE.js} +1 -1
- package/dist/{chunk-D33NLT35.js → chunk-ZDORASZC.js} +1 -1
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/{doctorNodes-DMNEZ2R2.js → doctorNodes-Z6DCIXZJ.js} +3 -3
- package/dist/{drainDaemon-ZHP2VY7D.js → drainDaemon-IGOUGC72.js} +1 -1
- package/dist/{fixConflict-5V3DTCGW.js → fixConflict-MI7KKAHW.js} +3 -3
- package/dist/index.js +15 -15
- package/dist/{restartNode-REMHMQUL.js → restartNode-TPOSDMNH.js} +5 -5
- package/dist/{review-XQ6GHRHA.js → review-27MBRMYS.js} +2 -2
- package/dist/{reviewPrComments-PX4MPOTQ.js → reviewPrComments-ZFZRHG2I.js} +3 -3
- package/dist/{runDaemon-JA743KRK.js → runDaemon-QNKKQSV4.js} +17 -3
- package/dist/{signExtension-EC4SK26M.js → signExtension-PM2HRF6H.js} +1 -1
- package/dist/{updateNode-EQSZTNU4.js → updateNode-B2B4MX24.js} +5 -5
- package/dist/{web-3R26MFTV.js → web-4RWILJGP.js} +5 -5
- package/dist/{web-Y6HSWH4J.js → web-UVCA72Y4.js} +5 -5
- package/package.json +1 -1
package/dist/.build-files
CHANGED
|
@@ -36,6 +36,7 @@ chunk-2FMLALED.js
|
|
|
36
36
|
chunk-2JYMVJGZ.js
|
|
37
37
|
chunk-2KG6ZPX4.js
|
|
38
38
|
chunk-2MG2THMQ.js
|
|
39
|
+
chunk-2PROSCII.js
|
|
39
40
|
chunk-2RUGZQUD.js
|
|
40
41
|
chunk-2RYBRXTJ.js
|
|
41
42
|
chunk-2T5HRFWP.js
|
|
@@ -52,7 +53,6 @@ chunk-4CP23TT2.js
|
|
|
52
53
|
chunk-4HKB2TAG.js
|
|
53
54
|
chunk-4JIXM5NT.js
|
|
54
55
|
chunk-4L7TQE67.js
|
|
55
|
-
chunk-4UNCME4M.js
|
|
56
56
|
chunk-4Y4ADPEK.js
|
|
57
57
|
chunk-4YAIQN3S.js
|
|
58
58
|
chunk-4YHDWC5E.js
|
|
@@ -61,11 +61,11 @@ chunk-56USVTPP.js
|
|
|
61
61
|
chunk-5CNDLMYO.js
|
|
62
62
|
chunk-5H7EHZ3J.js
|
|
63
63
|
chunk-5JOVEUBS.js
|
|
64
|
+
chunk-5JUSTCY7.js
|
|
64
65
|
chunk-5Q7MUHCK.js
|
|
65
66
|
chunk-5QM5VR3J.js
|
|
66
67
|
chunk-5QXAQCAJ.js
|
|
67
68
|
chunk-5SXNWSSH.js
|
|
68
|
-
chunk-5V3LHEZ2.js
|
|
69
69
|
chunk-5WVRYPT6.js
|
|
70
70
|
chunk-5YO2D7JF.js
|
|
71
71
|
chunk-627BOMSN.js
|
|
@@ -95,7 +95,6 @@ chunk-AFQMD7AO.js
|
|
|
95
95
|
chunk-AH7XVN5D.js
|
|
96
96
|
chunk-ALAS5LZJ.js
|
|
97
97
|
chunk-APZ6ZTDA.js
|
|
98
|
-
chunk-ARXTFRDX.js
|
|
99
98
|
chunk-AVLELL42.js
|
|
100
99
|
chunk-AYZKB6AU.js
|
|
101
100
|
chunk-B2XNGBON.js
|
|
@@ -118,7 +117,6 @@ chunk-CDDJAXEJ.js
|
|
|
118
117
|
chunk-CDU6M5IX.js
|
|
119
118
|
chunk-CGYVYHMM.js
|
|
120
119
|
chunk-CUOHHT2F.js
|
|
121
|
-
chunk-D33NLT35.js
|
|
122
120
|
chunk-D6WBUFXT.js
|
|
123
121
|
chunk-D7UZLH36.js
|
|
124
122
|
chunk-DGQ7KOW4.js
|
|
@@ -162,6 +160,7 @@ chunk-G3ROBZ4I.js
|
|
|
162
160
|
chunk-G5GN2KBP.js
|
|
163
161
|
chunk-GIHVMELY.js
|
|
164
162
|
chunk-GL5GKF5A.js
|
|
163
|
+
chunk-GNCIBOPQ.js
|
|
165
164
|
chunk-GNNMJOUE.js
|
|
166
165
|
chunk-GQF23TWI.js
|
|
167
166
|
chunk-GRXFWFGP.js
|
|
@@ -180,6 +179,7 @@ chunk-HR7HIPYM.js
|
|
|
180
179
|
chunk-HTWP3CTM.js
|
|
181
180
|
chunk-HXWJKXQQ.js
|
|
182
181
|
chunk-I3TEQBTO.js
|
|
182
|
+
chunk-IBG2UFAA.js
|
|
183
183
|
chunk-IBPSXDUB.js
|
|
184
184
|
chunk-IBVCCKC3.js
|
|
185
185
|
chunk-IDRVSAV5.js
|
|
@@ -204,7 +204,6 @@ chunk-JDYC4JZQ.js
|
|
|
204
204
|
chunk-JFBD33EV.js
|
|
205
205
|
chunk-JHBA5IZR.js
|
|
206
206
|
chunk-JJKKIBF5.js
|
|
207
|
-
chunk-JLU45T4H.js
|
|
208
207
|
chunk-JM57BCD6.js
|
|
209
208
|
chunk-JMEYVW4M.js
|
|
210
209
|
chunk-JNCFHWBK.js
|
|
@@ -227,6 +226,7 @@ chunk-KZX6UIKC.js
|
|
|
227
226
|
chunk-L363MNYZ.js
|
|
228
227
|
chunk-L6SCN5J6.js
|
|
229
228
|
chunk-LDVATRUW.js
|
|
229
|
+
chunk-LFA465WL.js
|
|
230
230
|
chunk-LIKGFVCS.js
|
|
231
231
|
chunk-LIN3HTLF.js
|
|
232
232
|
chunk-LKDW2GWH.js
|
|
@@ -254,7 +254,6 @@ chunk-NGYZK6AF.js
|
|
|
254
254
|
chunk-NH33OKZQ.js
|
|
255
255
|
chunk-NPYFCGGD.js
|
|
256
256
|
chunk-NT7WJQ6X.js
|
|
257
|
-
chunk-NTA2FTSD.js
|
|
258
257
|
chunk-NZYSENRR.js
|
|
259
258
|
chunk-O3SCSMQJ.js
|
|
260
259
|
chunk-O6HFT23O.js
|
|
@@ -301,16 +300,18 @@ chunk-RWVRH774.js
|
|
|
301
300
|
chunk-RXFNQQZC.js
|
|
302
301
|
chunk-RXKI4XAU.js
|
|
303
302
|
chunk-RZBCBCNG.js
|
|
303
|
+
chunk-S4FGQFSO.js
|
|
304
304
|
chunk-S6XYTJU2.js
|
|
305
305
|
chunk-SDMBTSYP.js
|
|
306
306
|
chunk-SHWMHL7S.js
|
|
307
307
|
chunk-SO3IBV6J.js
|
|
308
|
-
chunk-
|
|
308
|
+
chunk-SQRMRKKU.js
|
|
309
309
|
chunk-SQX66MN6.js
|
|
310
310
|
chunk-SSKHLBQB.js
|
|
311
311
|
chunk-SURCYYQ6.js
|
|
312
312
|
chunk-SVCR2A7L.js
|
|
313
313
|
chunk-SW7FSLHP.js
|
|
314
|
+
chunk-T2BRM7NE.js
|
|
314
315
|
chunk-T2DY3T55.js
|
|
315
316
|
chunk-T4TPIDXO.js
|
|
316
317
|
chunk-T7ZPGAB5.js
|
|
@@ -329,8 +330,6 @@ chunk-UJBW7FVI.js
|
|
|
329
330
|
chunk-UN4ABKA7.js
|
|
330
331
|
chunk-UNQHDBU5.js
|
|
331
332
|
chunk-UP6QV5BJ.js
|
|
332
|
-
chunk-UPGNKZVA.js
|
|
333
|
-
chunk-UQCBPHRV.js
|
|
334
333
|
chunk-USKD27FY.js
|
|
335
334
|
chunk-USXVRG3R.js
|
|
336
335
|
chunk-UT4KBNN4.js
|
|
@@ -399,6 +398,7 @@ chunk-Z2YQQYCQ.js
|
|
|
399
398
|
chunk-Z64YKE5O.js
|
|
400
399
|
chunk-Z7CPIHXT.js
|
|
401
400
|
chunk-ZABRGL2F.js
|
|
401
|
+
chunk-ZDORASZC.js
|
|
402
402
|
chunk-ZDSSSQZZ.js
|
|
403
403
|
chunk-ZFX4EZMW.js
|
|
404
404
|
chunk-ZLRZR64W.js
|
|
@@ -476,9 +476,9 @@ deps-RSUOIZPE.js
|
|
|
476
476
|
docsConfirm-AQGXUXUM.js
|
|
477
477
|
docsScreenshots-VV5F5SK5.js
|
|
478
478
|
docsUnlock-JTCIE32Q.js
|
|
479
|
-
doctorNodes-
|
|
479
|
+
doctorNodes-Z6DCIXZJ.js
|
|
480
480
|
done-YSG44MAX.js
|
|
481
|
-
drainDaemon-
|
|
481
|
+
drainDaemon-IGOUGC72.js
|
|
482
482
|
dropRetiredTables-JBLALSG5.js
|
|
483
483
|
edit-JVAW5GKZ.js
|
|
484
484
|
editHook-LIRUJTEJ.js
|
|
@@ -487,7 +487,7 @@ editIssueComment-4X62P25Z.js
|
|
|
487
487
|
exportBacklog-ZTMILEAX.js
|
|
488
488
|
extension-YYRD5EM6.js
|
|
489
489
|
extract-SGYOCBTT.js
|
|
490
|
-
fixConflict-
|
|
490
|
+
fixConflict-MI7KKAHW.js
|
|
491
491
|
fixStructure-4UTN5ED6.js
|
|
492
492
|
fixed-URDHVG6F.js
|
|
493
493
|
forbiddenStrings-CAQE3QI2.js
|
|
@@ -583,15 +583,15 @@ repos-HRCIMY6J.js
|
|
|
583
583
|
resolveHarness-CRWWVE4U.js
|
|
584
584
|
resolveModel-2I3SVZKR.js
|
|
585
585
|
restartDaemon-Y7V2QF3N.js
|
|
586
|
-
restartNode-
|
|
586
|
+
restartNode-TPOSDMNH.js
|
|
587
587
|
restructure-S6KIV6TM.js
|
|
588
|
-
review-
|
|
589
|
-
reviewPrComments-
|
|
588
|
+
review-27MBRMYS.js
|
|
589
|
+
reviewPrComments-ZFZRHG2I.js
|
|
590
590
|
rewindPhase-TCQMOWKB.js
|
|
591
591
|
rulesAdd-ODST2JQ4.js
|
|
592
592
|
run-D7UQIGJU.js
|
|
593
593
|
run-DRGU5WNL.js
|
|
594
|
-
runDaemon-
|
|
594
|
+
runDaemon-QNKKQSV4.js
|
|
595
595
|
runExtract-MJUEAUR5.js
|
|
596
596
|
runParallelPhase-6GQMW5NT.js
|
|
597
597
|
runRefine-K764J34T.js
|
|
@@ -613,7 +613,7 @@ show-GUW62FKK.js
|
|
|
613
613
|
show-IWLHTZEP.js
|
|
614
614
|
showClaudeCodeIcon-E4SAM3GN.js
|
|
615
615
|
showCodexIcon-YUAKV4NI.js
|
|
616
|
-
signExtension-
|
|
616
|
+
signExtension-PM2HRF6H.js
|
|
617
617
|
simulateDivergence-VB4UL4UR.js
|
|
618
618
|
skip-7Q3IVOBV.js
|
|
619
619
|
slack-LGXMV376.js
|
|
@@ -641,7 +641,7 @@ unlinkNode-RKC44U2T.js
|
|
|
641
641
|
unstar-YQDZUJV7.js
|
|
642
642
|
update-FHGTCK6N.js
|
|
643
643
|
update-W7ANHGDR.js
|
|
644
|
-
updateNode-
|
|
644
|
+
updateNode-B2B4MX24.js
|
|
645
645
|
updatePhase-JEVJRAOR.js
|
|
646
646
|
updatePlan-NIDFJK6O.js
|
|
647
647
|
version-5K75T67C.js
|
|
@@ -649,8 +649,8 @@ viewIssue-N6W53LSK.js
|
|
|
649
649
|
watchLoop-MV7DVGC6.js
|
|
650
650
|
watchReport-A4W7UOAJ.js
|
|
651
651
|
watchWait-5Y2J5VQY.js
|
|
652
|
-
web-
|
|
653
|
-
web-
|
|
652
|
+
web-4RWILJGP.js
|
|
653
|
+
web-UVCA72Y4.js
|
|
654
654
|
withPool-LEJ76IOJ.js
|
|
655
655
|
wontdo-XAQGHSR5.js
|
|
656
656
|
wontfix-VUVHWVNB.js
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.1202.0
|
|
@@ -72,6 +72,7 @@ var persistedSessionSchema = z2.object({
|
|
|
72
72
|
autoAdvance: z2.boolean().optional(),
|
|
73
73
|
autoApprove: z2.boolean().optional(),
|
|
74
74
|
reviewStarted: z2.boolean().optional(),
|
|
75
|
+
highLevelReviewHead: z2.string().optional(),
|
|
75
76
|
launchedFrom: z2.string().optional(),
|
|
76
77
|
pendingPrompts: z2.array(z2.string()).optional(),
|
|
77
78
|
pendingDeferredResults: z2.array(z2.string()).optional(),
|
|
@@ -112,6 +113,7 @@ function toPersistedSession(session) {
|
|
|
112
113
|
autoAdvance: session.autoAdvance,
|
|
113
114
|
autoApprove: session.autoApprove,
|
|
114
115
|
reviewStarted: session.reviewStarted,
|
|
116
|
+
highLevelReviewHead: session.highLevelReviewHead,
|
|
115
117
|
launchedFrom: session.launchedFrom,
|
|
116
118
|
pendingPrompts: session.pendingPrompts,
|
|
117
119
|
pendingDeferredResults: session.pendingDeferredResults,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-S4FGQFSO.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-5JUSTCY7.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -5653,11 +5653,10 @@ function toPrSummary(parsed) {
|
|
|
5653
5653
|
author: parsed.author?.name || parsed.author?.login || "unknown",
|
|
5654
5654
|
createdAt: parsed.createdAt ?? "",
|
|
5655
5655
|
url: parsed.url ?? "",
|
|
5656
|
-
isDraft: parsed.isDraft === true
|
|
5657
|
-
...parsed.headRefOid ? { headSha: parsed.headRefOid } : {}
|
|
5656
|
+
isDraft: parsed.isDraft === true
|
|
5658
5657
|
};
|
|
5659
5658
|
}
|
|
5660
|
-
var prFields = "number,title,author,createdAt,url,isDraft
|
|
5659
|
+
var prFields = "number,title,author,createdAt,url,isDraft";
|
|
5661
5660
|
var getPrByNumber = createCachedGhJson(
|
|
5662
5661
|
["pr", "view", "--json", prFields],
|
|
5663
5662
|
(stdout) => toPrSummary(JSON.parse(stdout)),
|
|
@@ -3946,7 +3946,7 @@ ${jx(t,r)}`}function s8r(e,t,r,n){let[o,i]=(0,a8r.useState)(null),{session:a,una
|
|
|
3946
3946
|
`)}var v8r=x(re(),1);var l8o=()=>!1;function JEe(){return(0,v8r.useSyncExternalStore)(EBt,l0e,l8o)}var b8r=e=>({position:"fixed",bottom:`calc(8px + ${yb})`,right:8,zIndex:3e3,background:ic.renderHud.background,color:ic.renderHud.text,font:`11px/1.4 ${e}`,padding:"6px 8px",borderRadius:4,whiteSpace:"pre",cursor:"pointer",userSelect:"none"});var S8r=x(_(),1),c8o=500;function x8r(){let{font:e}=on().tokens,t=(0,Qie.useRef)(null),r=(0,Qie.useRef)(""),n=JEe();return(0,Qie.useEffect)(()=>{if(!n)return;let o=new Map(Y6),i=performance.now(),a=requestAnimationFrame(function s(){a=requestAnimationFrame(s);let l=performance.now();if(l-i<c8o)return;let u=g8r(Y6,o,l-i);o=new Map(Y6),i=l,r.current=y8r(u),t.current&&(t.current.textContent=r.current)});return()=>cancelAnimationFrame(a)},[n]),n?(0,S8r.jsx)("div",{ref:t,style:b8r(e.mono),title:"Click to copy",onClick:()=>jst(t.current,r.current),onKeyDown:()=>jst(t.current,r.current)}):null}var uyt=x(re(),1);var w8r=x(re(),1);var e4e=x(re(),1),Yst=(0,e4e.createContext)([]);function T8r(){return(0,e4e.useContext)(Yst)}var Kst=x(_(),1);function C8r({session:e,children:t}){let r=e?.harness,n=e?.cwd,o=e?.node,i=(0,w8r.useMemo)(()=>n?{harness:r,cwd:n,node:o}:null,[r,n,o]),a=fy(r,n,o);return(0,Kst.jsx)(E9e.Provider,{value:i,children:(0,Kst.jsx)(Yst.Provider,{value:a,children:t})})}var t4e={pending:!1,queued:!1,failed:!1};function Lh(e){let t=e.transfer;return t?t.queued?{...t4e,label:`Transfer to ${t.target} pending`,title:`Transfers to ${t.target} once the agent is idle`,queued:!0}:t.error?{...t4e,label:"Retry transfer",title:`Transfer to ${t.target} failed: ${t.error}`,failed:!0}:{...t4e,label:`Transferring to ${t.target}\u2026`,title:`Transferring to ${t.target}`,pending:!0,stage:t.stage??"snapshotting"}:{...t4e,label:"Transfer",title:"Transfer to node"}}var Jie=x(_(),1),u8o=e=>t=>({display:"flex",flexWrap:"wrap",alignItems:"center",gap:1,px:1.5,py:.75,flexShrink:0,bgcolor:Ar(t.palette[e].main,.1),borderBottom:`1px solid ${Ar(t.palette[e].main,.35)}`});function r4e({tone:e,icon:t,message:r,children:n}){return(0,Jie.jsxs)(H,{role:"status","data-testid":`transfer-banner-${e}`,sx:u8o(e),children:[(0,Jie.jsx)(H,{sx:{display:"flex",color:`${e}.main`},children:t}),(0,Jie.jsx)(be,{variant:"body2",sx:{flex:1,minWidth:0},children:r}),n]})}var o4e=x(re(),1);function n4e(e,t){return Promise.all(t.map(async r=>{let n=await d8o(e,r).catch(o=>(xr(o,`clone location on ${r}`),{}));return[r,n]}))}async function d8o(e,t){let r=await Wt(Ir(`/api/repo-location?origin=${encodeURIComponent(e)}`,t||void 0));return r.ok?r.json():{}}function k8r(e){let t=e.assistArgs;if(!(e.commandType!=="assist"||!t)&&!(t[0]!=="backlog"||t[1]!=="run"||!t[2]))return t}function bq(e,t){if(!t||!k8r(e)||!e.repoGroup)return[];let r=e.node??t.local,n=t.links.filter(o=>o.state==="connected").map(o=>o.name);return[t.local,...n].filter(o=>o!==r)}function xq(e,t,r){let[n,o]=(0,o4e.useState)(null),i=e.repoGroup?.origin,a=bq(e,t).join("\0");return(0,o4e.useEffect)(()=>{if(!r||!i||!a||!t)return;let s=!1;o(null);let l=a.split("\0"),u=d=>d===t.local?"":d;return n4e(i,l.map(u)).then(d=>{s||o(d.flatMap(([f,p])=>{let{cwd:h}=p;return h?[{node:f||t.local,cwd:h}]:[]}))}),()=>{s=!0}},[r,i,a,t]),a?n:[]}var Sq=x(_(),1);function _8r({session:e}){let{nodes:t,transfer:r,dismissError:n}=ab(),o=xq(e,t,!0),i=e.transfer?.target??"",a=o?.find(s=>s.node===i)?.cwd;return(0,Sq.jsxs)(r4e,{tone:"error",icon:(0,Sq.jsx)(TE,{fontSize:"small"}),message:`Transfer to ${i} failed: ${e.transfer?.error}`,children:[(0,Sq.jsx)(tt,{size:"small",color:"error",variant:"outlined",onClick:()=>r(e.id,i,a),children:"Retry"}),(0,Sq.jsx)(tt,{size:"small",color:"inherit",onClick:()=>n(e.id),children:"Dismiss"})]})}var Xst=x(_(),1),E8r=ot([(0,Xst.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,Xst.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"Schedule");var i4e=x(_(),1);function R8r({session:e}){let{cancel:t}=ab();return(0,i4e.jsx)(r4e,{tone:"warning",icon:(0,i4e.jsx)(E8r,{fontSize:"small"}),message:`Transfer to ${e.transfer?.target} queued \u2014 starts once the agent is idle`,children:(0,i4e.jsx)(tt,{size:"small",color:"warning",onClick:()=>t(e.id),children:"Cancel transfer"})})}var Zst=x(_(),1);function P8r({session:e}){let t=Lh(e);return t.queued?(0,Zst.jsx)(R8r,{session:e}):t.failed?(0,Zst.jsx)(_8r,{session:e}):null}var fBr=x(re(),1);var s4e=x(re(),1);function A8r(e){let{activity:t,status:r}=e;return(t?.kind==="backlog"&&r!=="done"?t.phaseName:void 0)??e.subtitle}var Tq={color:"text.disabled",fontFamily:"fontFamilyMono",fontSize:"0.8125rem",whiteSpace:"nowrap",flexShrink:0};var wq=x(_(),1),f8o={...Tq,display:"inline-flex",alignItems:"center",gap:.25,borderRadius:.5,px:.25},L8r={fontSize:"0.875rem"};function p8o(e){let[t=""]=e.split("-");return t===e?e.slice(0,8):t}function I8r({conversationId:e,collapsed:t,harness:r}){let{copied:n,copy:o}=sb(e);return t?(0,wq.jsxs)(Ht,{sx:f8o,onClick:o,title:n?"Copied the full conversation id":`Click to copy the full conversation id ${e}`,children:[p8o(e),n?(0,wq.jsx)(iu,{sx:L8r}):(0,wq.jsx)(h$,{sx:L8r})]}):(0,wq.jsx)(be,{sx:{...Tq,userSelect:"all"},title:`${u3t(r)} conversation ${e}`,children:e})}var XR=x(_(),1);function D8r({session:e,collapsed:t}){let{id:r,claudeSessionId:n,harnessSessionId:o}=e,i=n??o,a=LB(PE(e))?ei(e.cwd):"";return(0,XR.jsxs)(XR.Fragment,{children:[a&&(0,XR.jsx)(be,{sx:{...Tq,color:"text.secondary"},title:e.cwd,children:a}),(0,XR.jsx)(be,{sx:{...Tq,userSelect:"all"},title:`assist session ${r}`,children:`#${r}`}),i&&(0,XR.jsx)(I8r,{conversationId:i,collapsed:t,harness:e.harness})]})}var M8r=x(_(),1);function a4e({label:e}){return(0,M8r.jsx)(H,{component:"span",sx:Oo("primary"),children:e})}var eae=x(_(),1),h8o=xo`
|
|
3947
3947
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|
3948
3948
|
50% { opacity: 0.35; transform: scale(0.8); }
|
|
3949
|
-
`,N8r={flexShrink:0,fontSize:"1.68rem",lineHeight:.6},m8o={...N8r,animation:`${h8o} 1.4s ease-in-out infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}};function O8r({status:e,label:t=!1}){return t?(0,eae.jsxs)(H,{component:"span",sx:Ph(Zu[e]),children:[(0,eae.jsx)(ub,{status:e})," ",e]}):(0,eae.jsx)(be,{variant:"caption",sx:{...NE(e)?m8o:N8r,color:Zu[e]},title:e,children:"\u25CF"})}var cS=x(_(),1),g8o={flexShrink:0,whiteSpace:"nowrap"};function y8o({session:e}){return ige(e)?(0,cS.jsxs)(H,{component:"span",sx:Ph(Zu.running),children:[wE.running," verifying"]}):(0,cS.jsx)(O8r,{status:Ji(e),label:!0})}function B8r({session:e}){let{restored:t}=e;return(0,cS.jsxs)(cS.Fragment,{children:[(0,cS.jsx)(y8o,{session:e}),e.sdk&&(0,cS.jsx)(a4e,{label:"Claude \xB7 SDK"}),t!==void 0&&(0,cS.jsx)(be,{variant:"caption",sx:{...g8o,color:t?"success.main":"warning.main"},children:t?"restored":"not restored"})]})}var tae=x(_(),1),v8o={display:"flex",alignItems:"center",gap:.75,minWidth:0},b8o={color:"text.primary",fontSize:"1.25rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function $8r({session:e}){return(0,tae.jsxs)(H,{sx:v8o,children:[Vme(e.activity).map(t=>(0,tae.jsx)(eme,{itemId:t,cwd:Wl(e)},t)),(0,tae.jsx)(be,{variant:"body1",sx:b8o,children:Vp(e)})]})}var ZR=x(re(),1);function F8r(e,t){let[r,n]=(0,ZR.useState)(0),[o,i]=(0,ZR.useState)(!1),a=(0,ZR.useRef)(0);return(0,ZR.useEffect)(()=>{let s=e.current;if(!s||typeof ResizeObserver>"u")return;let l=new ResizeObserver(()=>n(s.scrollWidth));return l.observe(s),()=>l.disconnect()},[e]),(0,ZR.useEffect)(()=>{o||(a.current=r),t!==null&&a.current>0&&i(a.current>t)},[o,r,t]),{width:r,collapsed:o}}var QR=x(_(),1),x8o={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0,overflow:"hidden"},S8o={display:"flex",alignItems:"center",alignSelf:"flex-start",gap:1},T8o={color:"text.secondary",fontSize:"0.875rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function z8r({session:e,minWidth:t,budget:r,onIdentityWidth:n}){let o=(0,s4e.useRef)(null),{width:i,collapsed:a}=F8r(o,r),s=A8r(e);return(0,s4e.useEffect)(()=>n(i),[i,n]),(0,QR.jsxs)(H,{sx:{...x8o,minWidth:`${t}px`},children:[(0,QR.jsxs)(H,{ref:o,sx:S8o,children:[(0,QR.jsx)(D8r,{session:e,collapsed:a}),(0,QR.jsx)(B8r,{session:e})]}),(0,QR.jsx)($8r,{session:e}),s&&(0,QR.jsx)(be,{sx:T8o,children:s})]})}var lBr=x(re(),1);function H8r({label:e,onClick:t,onKeyDown:r,title:n,ariaLabel:o,disabled:i,pressed:a,shortcut:s}){return{onClick:t,onKeyDown:r,disabled:i,title:s?void 0:n,"aria-label":o??n??e,"aria-pressed":a,"data-shortcut":s}}var w8o={muted:{color:"text.disabled",labelled:"text.secondary",hover:"text.primary"},start:{color:"text.disabled",labelled:"text.secondary",hover:"success.main"},stop:{color:"success.main",hover:"error.main"},starred:{color:"warning.main",hover:"warning.main"},inherit:{color:"inherit"},secondary:{color:"text.secondary",hover:"text.primary"}};function Qst(e,t){let{color:r,labelled:n,hover:o}=w8o[e],i=t&&n?n:r;return o?{color:i,"&:hover":{color:o}}:{color:i}}var l4e=x(_(),1);function U8r({label:e,shortcut:t,children:r}){return t?(0,l4e.jsx)(lr,{describeChild:!0,title:(0,l4e.jsx)(C8o,{label:e,shortcut:t}),children:r}):r}function C8o({label:e,shortcut:t}){return(0,l4e.jsx)(jd,{label:e,chords:vo(t).chords})}var c4e=x(_(),1),k8o={textTransform:"none",flexShrink:0,minWidth:0,px:1,whiteSpace:"nowrap"};function ac({label:e,icon:t,tone:r="muted",size:n="small",...o}){let i=rge(),a=H8r({label:e,...o});return(0,c4e.jsx)(U8r,{label:o.title??e,shortcut:o.shortcut,children:i?(0,c4e.jsx)(tt,{...a,size:"small",startIcon:t,sx:{...k8o,...Qst(r,!0)},children:e}):(0,c4e.jsx)(Mt,{...a,size:n,sx:Qst(r,!1),children:t})})}var Jst=x(_(),1);function W8r({pr:e}){return e.url?(0,Jst.jsx)(ac,{label:"PR",title:"Open PR",icon:(0,Jst.jsx)(Yhe,{sx:{fontSize:14}}),onClick:t=>{t.stopPropagation(),window.open(e.url,"_blank")}}):null}var V8r=x(_(),1),u4e=ot((0,V8r.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17l-.59.59-.58.58V4h16zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47z"}),"RateReviewOutlined");var tlt=x(re(),1);var q8r=x(_(),1);function G8r({review:e,pick:t,capabilities:r}){return eS(r,sst).map(n=>(0,q8r.jsx)(DR,{entry:n,onSelect:(o,i)=>t(o,()=>e.launchAddressComments(i.slice(1)))},n.label))}var Y8r=x(_(),1);function j8r({review:e,highLevel:t,pick:r,capabilities:n}){return eS(n).map(o=>{let i=t?.label&&o.args.includes("--high-level")?t:void 0;return(0,Y8r.jsx)(DR,{entry:i?.label?{...o,label:i.label,alternates:[]}:o,caption:i?.caption,onSelect:(a,s)=>r(a,t&&s===o.args&&s.includes("--high-level")?t.run:()=>e.launchMode(s))},o.label)})}var uS=x(_(),1);function K8r({review:e,highLevel:t,pick:r}){let n=wu(cr());return(0,uS.jsxs)(uS.Fragment,{children:[(0,uS.jsx)(j8r,{review:e,highLevel:t,pick:r,capabilities:n}),(0,uS.jsx)(qn,{}),(0,uS.jsx)(vEe,{value:e.options,onChange:e.setOptions}),(0,uS.jsx)(qn,{}),(0,uS.jsx)(G8r,{review:e,pick:r,capabilities:n})]})}var elt=x(_(),1);function X8r({anchorEl:e,onClose:t,review:r,highLevel:n}){return(0,elt.jsx)(mi,{anchorEl:e,open:!!e,onClose:t,onClick:i=>i.stopPropagation(),children:(0,elt.jsx)(K8r,{review:r,highLevel:n,pick:(i,a)=>{i.stopPropagation(),t(),a()}})})}function Z8r(e,t){let r=e.pendingPrPreview;return r?.kind==="high-level-review"&&r.prNumber===t}function Q8r(e,t){return e.assistArgs?.[0]==="review"&&e.assistArgs.includes("--high-level")&&pb(e)===t}var J8r="No saved slices for #";var _8o=18e4,eOr="Failed to reopen the high-level review";function E8o(e){return e?e.startsWith(J8r)?`${e}. Tick Force re-run to slice it again.`:e:eOr}async function tOr(e,t,r){try{let n=await Wt(Ir("/api/sessions/reopen-high-level-review",r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,prNumber:t}),timeoutMs:_8o});if(n.ok)return null;let o=await n.json().catch(()=>null);return E8o(o?.error)}catch(n){return xr(n,"reopen high-level review"),eOr}}function rOr(e,t,r,n){let{activateSession:o,sendInput:i}=pl(),a=on().palette.primary.main,s=cr();if(!(!e||!Q8r(e,t.number)))return Z8r(e,t.number)?{run:()=>{o(e.id),ou(Nf("preview",e.id),a)}}:r.force?{run:()=>dl(i,e.id,`/review-high-level ${t.number} --force`)}:{label:"Reopen high-level review",caption:t.headSha?`Saved slices for ${t.headSha.slice(0,7)} \xB7 no re-slicing`:void 0,run:()=>{tOr(e.id,t.number,s).then(l=>l&&n(l))}}}var nOr=x(re(),1);function oOr(e,t,r){let{launchAssist:n}=pl(),[o,i]=(0,nOr.useState)(Aie),a={...IR(t),inPlace:!0,launchedFrom:r},s=l=>n(l,e,a);return{options:o,setOptions:i,resetOptions:()=>i(Aie),launchMode:l=>s([...l,String(t.number),...gEe(o)]),launchAddressComments:l=>s(["review-pr-comments",String(t.number),...l])}}var RC=x(_(),1);function iOr({cwd:e,pr:t,session:r}){let n=oOr(e,t,r?.id),[o,i]=(0,tlt.useState)(null),a=rOr(r,t,n.options,i),[s,l]=(0,tlt.useState)(null);return(0,RC.jsxs)(RC.Fragment,{children:[(0,RC.jsx)(ac,{label:"Review",title:"Review PR",icon:(0,RC.jsx)(u4e,{sx:{fontSize:14}}),onClick:u=>{u.stopPropagation(),n.resetOptions(),l(u.currentTarget)}}),(0,RC.jsx)(X8r,{anchorEl:s,onClose:()=>l(null),review:n,highLevel:a}),(0,RC.jsx)(hs,{error:o,onClose:()=>i(null)})]})}var rae=x(_(),1),aOr=ot((0,rae.jsxs)("g",{fillRule:"evenodd",children:[(0,rae.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H4V5h16z"}),(0,rae.jsx)("path",{d:"M19.41 10.42 17.99 9l-3.17 3.17-1.41-1.42L12 12.16 14.82 15zM5 7h5v2H5zm0 4h5v2H5zm0 4h5v2H5z"})]}),"FactCheckOutlined");var uOr=x(re(),1);var JR=x(_(),1);function sOr({content:e,onClose:t}){return(0,JR.jsxs)(Pa,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[(0,JR.jsx)($l,{children:"Review synthesis"}),(0,JR.jsx)(Bl,{dividers:!0,children:(0,JR.jsx)(Zs,{className:"markdown",sx:{lineHeight:1.7,"& p":{mt:0},"& a":{color:"primary.main"},wordBreak:"break-word"},html:Qke(e)})}),(0,JR.jsx)(Jc,{children:(0,JR.jsx)(tt,{onClick:t,children:"Close"})})]})}var d4e=x(re(),1);async function lOr(e,t){try{let r=await Wt(Ir(`/api/review/synthesis?cwd=${encodeURIComponent(e)}`,t));if(r.status===404)return{status:"absent"};if(!r.ok)return{status:"error"};let n=await r.json();return typeof n.synthesis!="string"?{status:"absent"}:{status:"ready",content:n.synthesis}}catch(r){return xr(r,"review synthesis"),{status:"error"}}}function cOr(e,t){let[r,n]=(0,d4e.useState)({status:"loading"}),o=cr();return(0,d4e.useEffect)(()=>{if(!e||!t){n({status:"absent"});return}let i=!1;return n({status:"loading"}),lOr(e,o).then(a=>{i||n(a)}),()=>{i=!0}},[e,t,o]),r}var PC=x(_(),1);function dOr({session:e}){let t=PE(e)==="review",r=cOr(e.cwd,t),[n,o]=(0,uOr.useState)(!1);return r.status!=="ready"?null:(0,PC.jsxs)(PC.Fragment,{children:[(0,PC.jsx)(ac,{label:"Findings",title:"View review findings",icon:(0,PC.jsx)(aOr,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),o(!0)}}),n&&(0,PC.jsx)(ua,{children:(0,PC.jsx)(sOr,{content:r.content,onClose:()=>o(!1)})})]})}var e3=x(_(),1);function fOr({session:e}){let t=YB(e.cwd,pb(e),e.status),r=e.cwd;return(0,e3.jsxs)(e3.Fragment,{children:[t&&r&&(0,e3.jsx)(W8r,{pr:t}),t&&r&&(0,e3.jsx)(iOr,{cwd:r,pr:t,session:e}),(0,e3.jsx)(dOr,{session:e})]})}var rlt=x(_(),1);function pOr({id:e,onRetry:t,shortcut:r,server:n}){return(0,rlt.jsx)(ac,{label:"Retry",title:`Retry session ${e}${n?" (shift+click replaces a running server without asking)":""}`,shortcut:r,icon:(0,rlt.jsx)(HR,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t(n&&i.shiftKey?!0:void 0)}})}var nlt=x(_(),1);function hOr({runName:e,cwd:t,launchedFrom:r}){let{onStart:n}=QB();return(0,nlt.jsx)(ac,{label:e,title:`Start ${e} (shift+click replaces a running server without asking)`,tone:"start",icon:(0,nlt.jsx)(nv,{sx:{fontSize:16}}),onClick:o=>{o.stopPropagation(),n(e,t,o.shiftKey||void 0,r)}})}var h4e=x(re(),1);var f4e={textTransform:"none",fontSize:11,justifyContent:"space-between",maxWidth:"100%",overflow:"hidden"};var Cq=x(_(),1),R8o={[`& .${so.lastButton}`]:{minWidth:0,px:.25}};function mOr({label:e,open:t,onClick:r,onDefaultAction:n,disabled:o=!1}){let i=t?FE:Ks,a=typeof e=="string"?`${e} options`:"options";return(0,Cq.jsxs)(q1,{size:"small",variant:"outlined",disabled:o,sx:R8o,children:[(0,Cq.jsx)(tt,{disabled:o,onClick:n,sx:{...f4e,justifyContent:"center"},children:e}),(0,Cq.jsx)(tt,{disabled:o,onClick:r,"aria-label":a,title:a,"aria-haspopup":"true","aria-expanded":t,children:(0,Cq.jsx)(i,{sx:{fontSize:18}})})]})}var kq=x(_(),1);function p4e({label:e,open:t,onClick:r,onDefaultAction:n,disabled:o=!1,tooltip:i}){if(n)return(0,kq.jsx)(mOr,{label:e,open:t,onClick:r,onDefaultAction:n,disabled:o});let a=(0,kq.jsx)(tt,{size:"small",variant:"outlined",disabled:o,onClick:r,"aria-haspopup":"true","aria-expanded":t,endIcon:t?(0,kq.jsx)(FE,{}):(0,kq.jsx)(Ks,{}),sx:f4e,fullWidth:!0,children:e});return i?(0,kq.jsx)(lr,{describeChild:!0,title:i,children:a}):a}var TM=x(_(),1);function m4e({runs:e,onSelect:t}){let[r,n]=(0,h4e.useState)(!1),o=(0,h4e.useRef)(null),i=()=>n(!1);return(0,TM.jsxs)(Gr,{ref:o,variant:"outlined",sx:{display:"inline-flex",border:"none"},children:[(0,TM.jsx)(p4e,{label:"server",open:r,onClick:()=>n(!r)}),(0,TM.jsx)(mi,{anchorEl:o.current,open:r,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{width:200,maxHeight:200}},list:{dense:!0,disablePadding:!0}},children:e.map(a=>(0,TM.jsx)(Br,{onClick:s=>{i(),t(a.name,s.shiftKey||void 0)},sx:{py:.75},children:(0,TM.jsx)(be,{sx:{fontSize:13},children:a.name})},a.name))})]})}var g4e=x(re(),1);function y4e(e){let[t,r]=(0,g4e.useState)([]),n=cr();return(0,g4e.useEffect)(()=>{if(!e){r([]);return}let o=!1;return Wt(Ir(`/api/server-runs?cwd=${encodeURIComponent(e)}`,n)).then(i=>i.json()).then(i=>{o||r(Array.isArray(i?.runs)?i.runs:[])}).catch(i=>{xr(i,"server runs"),o||r([])}),()=>{o=!0}},[e,n]),t}var wM=x(_(),1);function gOr({session:e}){let t=y4e(e.cwd),{onStart:r}=QB();return t.length>2?(0,wM.jsx)(ua,{children:(0,wM.jsx)(m4e,{runs:t,onSelect:(n,o)=>r(n,e.cwd,o,e.id)})}):(0,wM.jsx)(wM.Fragment,{children:t.map(n=>(0,wM.jsx)(hOr,{runName:n.name,cwd:e.cwd,launchedFrom:e.id},n.name))})}var yOr=x(_(),1),t3=ot((0,yOr.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");var vOr=x(_(),1),r3=ot((0,vOr.jsx)("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder");var v4e=x(_(),1);function bOr({session:e}){let{isStarred:t,toggleStar:r}=oy(),n=t(e);return(0,v4e.jsx)(ac,{label:n?"Unstar":"Star",title:n?"Unstar":"Star",tone:n?"starred":"muted",pressed:n,icon:n?(0,v4e.jsx)(t3,{sx:{fontSize:16}}):(0,v4e.jsx)(r3,{sx:{fontSize:16}}),onClick:o=>{o.stopPropagation(),r(e)}})}var xOr=x(_(),1),SOr=ot((0,xOr.jsx)("path",{d:"M22 9V7h-2v2h-2v2h2v2h2v-2h2V9zM8 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 7c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m6 5H2v-.99C2.2 16.29 5.3 15 8 15s5.8 1.29 6 2zM12.51 4.05C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupAddOutlined");var LOr=x(re(),1);var b4e=x(re(),1);var P8o="assist:prompt-draft:";function n3(e){let t=P8o+e,[r,n]=(0,b4e.useState)(()=>({key:t,prompt:fl(t)[0]??""})),o=r.key===t?r.prompt:fl(t)[0]??"",i=(0,b4e.useCallback)(a=>{n(s=>{let l=s.key===t?s.prompt:fl(t)[0]??"",u=typeof a=="function"?a(l):a;return Dl(t,u?[u]:[]),{key:t,prompt:u}})},[t]);return[o,i]}var TOr={"assist-draft":["draft","--once"],"assist-bug":["bug","--once"],"assist-refine":["refine","--once"]};function A8o(e){return e in TOr}function L8o(e,t){let r=[...TOr[e]],n=t?.trim();return n&&r.push(n),r}function wOr(e,t,r,n,o){if(A8o(e)&&t){r(L8o(e,o),t);return}n(e)}var x4e="Enter prompt...";function AC(e){e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest("form")?.requestSubmit())}var _Or=x(re(),1);var olt=x(re(),1);function COr(e){return e.ctrlKey||e.altKey||e.metaKey?!1:e.key.length===1&&e.key!==" "}function kOr(e,t){let[r,n]=(0,olt.useState)(!1),[o,i]=(0,olt.useState)("");return{open:r,initialFilter:o,onKeyDown:l=>{!e||r||t||COr(l)&&(l.preventDefault(),i(l.key),n(!0))},toggle:()=>{i(""),n(!r)},close:()=>n(!1)}}var T4e=x(_(),1),_q={position:"absolute",top:"100%",left:0,right:0,mt:.25,maxHeight:200,overflowY:"auto",zIndex:10};function S4e({label:e,children:t,disabled:r=!1,onDefaultAction:n,tooltip:o,typeToOpen:i=!1}){let{open:a,initialFilter:s,onKeyDown:l,toggle:u,close:d}=kOr(i,r),f=(0,_Or.useRef)(null);return(0,T4e.jsxs)(Gr,{component:"fieldset",ref:f,variant:"outlined",sx:{position:"relative",border:"none",m:0,p:0},onBlur:p=>{f.current?.contains(p.relatedTarget)||d()},onKeyDown:l,children:[(0,T4e.jsx)(p4e,{label:e,open:a,disabled:r,onClick:u,onDefaultAction:n,tooltip:o}),a&&t(d,s)]})}function EOr(e){return e?{width:320}:{..._q,left:"auto",width:320}}var CM=x(_(),1);function ROr({value:e,onChange:t,onSubmit:r,header:n,anchored:o=!1,commands:i}){return(0,CM.jsx)(Gr,{elevation:o?0:4,sx:EOr(o),children:(0,CM.jsxs)(St,{component:"form",spacing:1,sx:{p:1},onSubmit:a=>{a.preventDefault(),r()},children:[n,(0,CM.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,CM.jsx)(W$,{commands:i,value:e,onChange:t,onKeyDown:AC,placeholder:x4e,size:"small",autoFocus:!0,fullWidth:!0,multiline:!0,maxRows:7,slotProps:{input:{sx:{fontSize:13}}}}),(0,CM.jsx)(tt,{type:"submit",variant:"contained",size:"small",sx:{whiteSpace:"nowrap"},children:"Start"})]})]})})}var ilt=x(_(),1);function POr({session:e,anchorEl:t,onClose:r}){let{launchAgentInStream:n}=pl(),[o,i]=n3(`add-agent:${e.id}`),a=fy(e.harness,t?e.cwd:void 0,e.node);return(0,ilt.jsx)($d,{anchorEl:t,open:!!t,onClose:r,onClick:s=>s.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,ilt.jsx)(ROr,{anchored:!0,commands:a,value:o,onChange:i,onSubmit:()=>{n(e.id,o,e.cwd),i(""),r()}})})}function AOr(e){return e.joinable===!0}var o3=x(_(),1);function IOr({session:e,shortcut:t}){let[r,n]=(0,LOr.useState)(null);return AOr(e)?(0,o3.jsxs)(o3.Fragment,{children:[(0,o3.jsx)(ac,{label:"Add agent",title:"Add another agent to this session's workspace",ariaLabel:"add agent",shortcut:t,icon:(0,o3.jsx)(SOr,{sx:{fontSize:14}}),onClick:o=>{o.stopPropagation(),n(o.currentTarget)}}),(0,o3.jsx)(POr,{session:e,anchorEl:r,onClose:()=>n(null)})]}):null}var zOr=x(re(),1);var alt=x(_(),1);function DOr(e){return(0,alt.jsx)(H1,{viewBox:"-3 -3 30 30",...e,children:(0,alt.jsx)("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}var MOr=x(_(),1),I8o={fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"};function w4e({children:e,sx:t,...r}){return(0,MOr.jsx)(H1,{viewBox:"0 0 16 16",sx:[I8o,t??{}].flat(),...r,children:e})}var slt=x(_(),1);function NOr(e){return(0,slt.jsx)(w4e,{...e,children:(0,slt.jsx)("path",{d:"M11 2l3 1.5v9L11 14 4 8l7-6zM2 6l2 2-2 2"})})}var llt=x(_(),1);function OOr({outlined:e,small:t}){return e?(0,llt.jsx)(NOr,{}):(0,llt.jsx)(DOr,{sx:t?{fontSize:14}:void 0})}var C4e={"& .MuiIconButton-root .MuiSvgIcon-root":{fontSize:15}};var clt=x(_(),1);function BOr({show:e,outlined:t,children:r}){return e?(0,clt.jsx)(lr,{title:"Open in VS Code",children:(0,clt.jsx)(H,{component:"span",sx:t?C4e:void 0,children:r})}):r}var $Or="Failed to open VS Code";async function FOr(e,t){try{let r=await Wt(Ir(`/api/open-in-code?cwd=${encodeURIComponent(e)}`,t),{method:"POST"});return r.ok?null:(await r.json().catch(()=>null))?.error??$Or}catch(r){return xr(r,"open in VS Code"),$Or}}var LC=x(_(),1);function k4e({cwd:e,variant:t="toolbar",shortcut:r}){let[n,o]=(0,zOr.useState)(null),i=t==="card",a=cr();return(0,LC.jsxs)(LC.Fragment,{children:[(0,LC.jsx)(BOr,{show:!r,outlined:!i,children:(0,LC.jsx)(ac,{label:"VS Code",title:r?"Open in VS Code":void 0,ariaLabel:"Open in VS Code",tone:i?"muted":"secondary",size:i?"small":"medium",disabled:!e,shortcut:r,icon:(0,LC.jsx)(OOr,{outlined:!i,small:i}),onClick:s=>{s.stopPropagation(),FOr(e,a).then(l=>l&&o(l))}})}),(0,LC.jsx)(hs,{error:n,onClose:()=>o(null)})]})}var kM=x(_(),1);function HOr({session:e}){return(0,kM.jsxs)(kM.Fragment,{children:[(0,kM.jsx)(IOr,{session:e,shortcut:"focusAddAgent"}),e.cwd&&(0,kM.jsx)(k4e,{cwd:e.cwd,variant:"card",shortcut:e.commandType==="run"?void 0:"focusVsCode"})]})}var WOr=x(re(),1);var nae=x(_(),1);function UOr({session:e,queued:t,targets:r,close:n}){let{transfer:o,cancel:i}=ab();return t?(0,nae.jsx)(Br,{onClick:()=>{n(),i(e.id)},children:"Cancel pending transfer"}):r===null?(0,nae.jsx)(Br,{disabled:!0,children:"Finding nodes\u2026"}):r.length===0?(0,nae.jsx)(Br,{disabled:!0,children:"No connected node has this repo"}):r.map(a=>(0,nae.jsx)(Br,{onClick:()=>{n(),o(e.id,a.node,a.cwd)},children:a.node},a.node))}var IC=x(_(),1);function VOr({session:e}){let{nodes:t}=ab(),[r,n]=(0,WOr.useState)(null),o=Lh(e),i=xq(e,t,r!==null&&!o.queued);return bq(e,t).length===0?null:(0,IC.jsxs)(IC.Fragment,{children:[(0,IC.jsx)(ac,{label:o.label,title:o.title,tone:o.failed?"starred":"muted",disabled:o.pending,icon:(0,IC.jsx)(OE,{sx:{fontSize:14}}),onClick:a=>{a.stopPropagation(),n(a.currentTarget)}}),(0,IC.jsx)(mi,{anchorEl:r,open:r!==null,onClose:()=>n(null),children:(0,IC.jsx)(UOr,{session:e,queued:o.queued,targets:i,close:()=>n(null)})})]})}function dS(e){let{activity:t,status:r}=e;if(!(r==="done"||t?.kind!=="backlog"||t.itemId==null))return{itemId:t.itemId,phase:t.phase,totalPhases:t.totalPhases}}function D8o(e){if(!e)return"";let{childCount:t}=e;return` Its ${t} nested ${t===1?"session":"sessions"} will also be closed.`}function GOr({phase:e,totalPhases:t},r){return`${e??0} of ${t??0} phases completed. Mark this backlog item as done and end its session?${D8o(r)}`}var ult=x(_(),1);function qOr({target:e,childDismiss:t,busy:r,onConfirm:n,onCancel:o}){return(0,ult.jsx)(ua,{children:(0,ult.jsx)(Uo,{title:`Mark ${mn(e.itemId)} done`,message:GOr(e,t),confirmLabel:"Mark done",autoFocusConfirm:!0,busy:r,onConfirm:n,onCancel:o})})}var dlt=x(re(),1);function _4e(e,t,r,n){let[o,i]=(0,dlt.useState)(!1),[a,s]=(0,dlt.useState)(null);return{busy:o,error:a,clearError:()=>s(null),confirm:async()=>{if(!o){i(!0);try{await FB(e,"done",t,n),r()}catch(u){xr(u,"mark item done"),s(`Failed to mark item ${mn(e)} as done`)}finally{i(!1)}}}}}var fS=x(_(),1);function jOr({target:e,cwd:t,onDismiss:r,childDismiss:n,shortcut:o}){let{busy:i,error:a,clearError:s,confirm:l}=_4e(e.itemId,t,()=>{d(),r({closeServerRuns:!0}),n?.onDismissChildren()}),{confirming:u,close:d,triggerHandlers:f,withHint:p}=fs(()=>{l()});return(0,fS.jsxs)(fS.Fragment,{children:[(0,fS.jsx)(ac,{label:"Done",title:p("Mark done"),ariaLabel:"Mark done",shortcut:o,icon:(0,fS.jsx)(iu,{sx:{fontSize:16}}),...f}),u&&(0,fS.jsx)(qOr,{target:e,childDismiss:n,busy:i,onConfirm:l,onCancel:d}),(0,fS.jsx)(ua,{children:(0,fS.jsx)(hs,{error:a,onClose:s})})]})}var Eq=x(_(),1);function YOr({session:e,onDismiss:t,childDismiss:r}){let n=dS(e);return(0,Eq.jsxs)(Eq.Fragment,{children:[" ",n&&(0,Eq.jsx)(jOr,{target:n,cwd:e.cwd,onDismiss:t,childDismiss:r,shortcut:"focusDone"})]})}var eg=x(_(),1);function KOr({session:e,onRetry:t,onRestart:r,onStartOver:n,onDismiss:o,childDismiss:i}){let a=e.status==="stopped"||e.closing===!0;return(0,eg.jsxs)(eg.Fragment,{children:[(0,eg.jsx)(gOr,{session:e}),(0,eg.jsx)(HOr,{session:e}),(0,eg.jsx)(fOr,{session:e}),r&&!a&&(0,eg.jsx)(oge,{id:e.id,onRestart:r,onStartOver:n,harness:e.harness}),t&&(0,eg.jsx)(pOr,{id:e.id,onRetry:t,server:e.server,shortcut:e.commandType==="run"?"focusVsCode":void 0}),(0,eg.jsx)(bOr,{session:e}),(0,eg.jsx)(VOr,{session:e}),(0,eg.jsx)(YOr,{session:e,onDismiss:o,childDismiss:i})]})}var ZOr=x(_(),1);function XOr({session:e}){return e.cwd?(0,ZOr.jsx)(zme,{panelSessionId:e.id,cwd:e.cwd,conversation:db(e),offerBranchDiff:!0,toggleChordHint:!0,countButton:!0}):null}var flt=x(_(),1),M8o={display:"flex",flexShrink:0};function QOr({session:e,onDismiss:t,childDismiss:r}){let{status:n,id:o}=e;return n==="stopped"||e.closing?null:(0,flt.jsx)(H,{sx:M8o,children:(0,flt.jsx)(Zme,{id:o,status:n,onDismiss:t,childDismiss:r})})}var E4e=x(re(),1);function JOr(e=0,t=null){let[,r]=(0,E4e.useState)(0);(0,E4e.useEffect)(()=>{if(t==null)return;let s=setInterval(()=>r(l=>l+1),1e3);return()=>clearInterval(s)},[t]);let n=t==null?e:e+(Date.now()-t),o=Math.floor(n/1e3),i=Math.floor(o/60),a=o%60;return i>=60?`${Math.floor(i/60)}h ${i%60}m`:i>0?`${i}m ${a}s`:`${a}s`}var tBr=x(_(),1);function eBr({session:e}){let t=JOr(e.runningMs,e.runningSince);return(0,tBr.jsx)(be,{variant:"caption",sx:{flexShrink:0,whiteSpace:"nowrap",color:"text.disabled"},children:t})}var R4e=x(_(),1);function rBr({label:e,checked:t,onChange:r,inline:n=!1}){return(0,R4e.jsx)(ua,{children:(0,R4e.jsx)(Bd,{sx:n?{m:0,flexShrink:0}:{m:0,mt:.5},control:(0,R4e.jsx)(zd,{size:"small",checked:t,onChange:o=>r(o.target.checked)}),label:e,slotProps:{typography:{variant:"caption",color:"text.secondary"}}})})}function nBr(e,t){return e==="autoApprove"?t.onSetAutoApprove:t.onSetAutoAdvance}var oae=x(_(),1);function oBr({session:e,onSetAutoApprove:t,onSetAutoAdvance:r}){return(0,oae.jsx)(oae.Fragment,{children:XB(e).map(n=>(0,oae.jsx)(rBr,{inline:!0,label:n.label,checked:n.checked,onChange:nBr(n.key,{onSetAutoApprove:t,onSetAutoAdvance:r})},n.key))})}var P4e=x(re(),1);function iBr(e,t,r){let n=1,o=0;for(let i of e){let a=o===0?i:o+t+i;a>r&&o>0?(n++,o=i):o=a}return n}function aBr(e,t,r){if(e.length===0||e.reduce((s,l)=>s+l,0)+t*(e.length-1)<=r)return;let o=iBr(e,t,r),i=Math.ceil(Math.max(...e)),a=Math.max(i,Math.floor(r));for(;i<a;){let s=Math.floor((i+a)/2);iBr(e,t,s)<=o?a=s:i=s+1}return i+1}function N8o(e,t){return e.gap===t.gap&&e.widths.length===t.widths.length&&e.widths.every((r,n)=>r===t.widths[n])}function O8o(e){let t=getComputedStyle(e);return e.getBoundingClientRect().width+(Number.parseFloat(t.marginLeft)||0)+(Number.parseFloat(t.marginRight)||0)}function plt(e){return Array.from(e.children).flatMap(t=>getComputedStyle(t).display==="contents"?plt(t):[t])}function sBr(e,t){let[r,n]=(0,P4e.useState)({widths:[],gap:0});if((0,P4e.useEffect)(()=>{let o=e.current;if(!o||typeof ResizeObserver>"u")return;let i=()=>{let u={widths:plt(o).map(O8o),gap:Number.parseFloat(getComputedStyle(o).columnGap)||0};n(d=>N8o(d,u)?d:u)},a=new ResizeObserver(i),s=()=>{a.disconnect();for(let u of plt(o))a.observe(u);i()},l=new MutationObserver(s);return l.observe(o,{childList:!0,subtree:!0}),s(),()=>{a.disconnect(),l.disconnect()}},[e]),t!==null)return aBr(r.widths,r.gap,t)}var DC=x(_(),1),B8o={display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:1,flexGrow:0,flexShrink:1,flexBasis:"auto",minWidth:0};function cBr({session:e,labelled:t,available:r,onRetry:n,onRestart:o,onStartOver:i,onDismiss:a,childDismiss:s,onSetAutoApprove:l,onSetAutoAdvance:u}){let d=(0,lBr.useRef)(null),f=sBr(d,r);return(0,DC.jsxs)(H,{ref:d,sx:{...B8o,width:f},children:[(0,DC.jsx)(XOr,{session:e}),(0,DC.jsx)(eBr,{session:e}),(0,DC.jsx)(oBr,{session:e,onSetAutoApprove:l,onSetAutoAdvance:u}),(0,DC.jsx)(y$e.Provider,{value:t,children:(0,DC.jsx)(KOr,{session:e,onRetry:n,onRestart:o,onStartOver:i,onDismiss:a,childDismiss:s})}),(0,DC.jsx)(QOr,{session:e,onDismiss:a,childDismiss:s})]})}var uBr=x(re(),1);var hlt=8,$8o=560,F8o=48,z8o=.5;function dBr(e){let t=n4(e),[r,n]=(0,uBr.useState)(0),o=t===null?r:Math.min(r,Math.max(t-F8o,0));return{floor:o,budget:t===null?null:t*z8o,labelled:t===null||t-o>=$8o,available:t===null?null:t-o-hlt,setIdentityWidth:n}}var iae=x(_(),1),H8o={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:`${hlt}px`,px:1.5,py:.75,borderBottom:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"};function pBr({session:e,...t}){let r=(0,fBr.useRef)(null),n=dBr(r);return(0,iae.jsxs)(H,{ref:r,sx:H8o,"data-top-bar-session-id":e.id,children:[(0,iae.jsx)(z8r,{session:e,minWidth:n.floor,budget:n.budget,onIdentityWidth:n.setIdentityWidth}),!Lh(e).pending&&(0,iae.jsx)(cBr,{session:e,labelled:n.labelled,available:n.available,...t})]})}var mBr=x(_(),1);function hBr({session:e,sessions:t,lifecycle:r}){let n=wme(t).find(o=>o.session.id===e.id)?.children??[];return(0,mBr.jsx)(pBr,{session:e,...r$(e,r),childDismiss:Lme(e,n,r.onDismiss),onSetAutoApprove:o=>r.onSetAutoApprove(e.id,o),onSetAutoAdvance:o=>r.onSetAutoAdvance(e.id,o)},e.id)}var mlt=x(_(),1),U8o={flexShrink:0};function gBr({session:e,sessions:t,lifecycle:r}){return e===void 0?null:(0,mlt.jsx)(H,{"data-testid":"session-top-bar",sx:U8o,children:(0,mlt.jsx)(hBr,{session:e,sessions:t,lifecycle:r})})}var A4e=x(_(),1),yBr={minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden",bgcolor:"background.paper",borderColor:"divider"},W8o={...yBr,width:"50%",borderLeft:1},V8o={...yBr,width:"100%"};function vBr({sessionId:e,panel:t,sessions:r,sendInput:n}){let{closePanel:o,setPanelScope:i,togglePanelMode:a}=fb();return(0,A4e.jsx)(H,{sx:t.mode==="full"?V8o:W8o,children:(0,A4e.jsx)(Tc.Provider,{value:t.node,children:(0,A4e.jsx)(E_e,{cwd:t.cwd,ownerSessionId:e,conversation:t.conversation,scope:t.scope,onScopeChange:s=>i(e,s),sessions:r,sendInput:n,mode:t.mode,onToggleMode:()=>a(e),onClose:()=>o(e),scrollRegionProps:{"data-diff-session-id":e,tabIndex:-1}})})})}var aae=x(_(),1),G8o={display:"flex",flex:1,minHeight:0,overflow:"hidden"};function bBr({sessionId:e,sessions:t,sendInput:r,children:n}){let o=fb().panelFor(e);return(0,aae.jsxs)(H,{sx:G8o,children:[(0,aae.jsx)(H,{sx:{display:o?.mode==="full"?"none":"flex",width:o?"50%":"100%",minWidth:0},children:n}),o&&e!==null&&(0,aae.jsx)(vBr,{sessionId:e,panel:o,sessions:t,sendInput:r},e)]})}var B9r=x(re(),1);var Z$r=x(re(),1);var MC=x(_(),1),q8o={position:"absolute",inset:0,display:"flex",flexDirection:"column",gap:1.5,alignItems:"center",justifyContent:"center"};function xBr({loading:e}){return(0,MC.jsx)(H,{sx:q8o,children:e?(0,MC.jsxs)(MC.Fragment,{children:[(0,MC.jsx)(ao,{size:20}),(0,MC.jsx)(be,{variant:"caption",color:"text.disabled",children:"Loading transcript\u2026"})]}):(0,MC.jsx)(be,{variant:"body2",color:"text.disabled",children:"No transcript available"})})}var SBr=e=>e.tokens.color.wash.shell,Oi={chip:{flex:"none",alignSelf:"center",display:"inline-flex",alignItems:"center",mr:1,px:.75,border:1,borderColor:"secondary.main",borderRadius:e=>`${e.tokens.radius.sm}px`,color:"secondary.main",fontFamily:"fontFamilyMono",fontSize:11.5,fontWeight:600,lineHeight:1.6},field:{borderColor:"secondary.main",bgcolor:SBr,"&.Mui-focused":{borderColor:"secondary.main"},"& textarea":{fontFamily:"fontFamilyMono",fontSize:"0.95em"}},run:{bgcolor:"secondary.main",color:"secondary.contrastText","&:hover":{bgcolor:"secondary.main"}},attached:{color:"secondary.main"},row:{display:"grid",gap:.75,minWidth:0,mb:1.5,pl:1.5,py:1,pr:1,borderLeft:2,borderColor:"secondary.main",borderTopRightRadius:1,borderBottomRightRadius:1,bgcolor:SBr},header:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontFamily:"fontFamilyMono",fontSize:13,fontWeight:500},bang:{color:"secondary.main",fontWeight:600},command:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},output:{m:0,maxHeight:"11em",overflow:"auto",fontFamily:"fontFamilyMono",fontSize:12,lineHeight:1.55,color:"text.secondary",bgcolor:e=>e.tokens.color.well,border:1,borderColor:e=>e.tokens.color.lineSoft,borderRadius:e=>`${e.tokens.radius.sm}px`,px:1,py:.75,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},stderr:{color:"error.main"},link:{color:"primary.main","&:focus-visible":{outline:2,outlineColor:"primary.main"}},meta:{display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:1.25,rowGap:.5,fontSize:12,color:"text.secondary"},ok:{color:"success.main",fontFamily:"fontFamilyMono"},bad:{color:"error.main",fontFamily:"fontFamilyMono"},stop:{ml:"auto",py:0,minWidth:0},discard:{flex:"none",p:.25,color:"text.secondary",borderRadius:e=>`${e.tokens.radius.sm}px`,"&:hover":{color:"text.primary"}}};function j8o(e){return e.length<20||/\s$/.test(e)?!1:/^\S+$/.test(e)||/:\/\/\S*$/.test(e)}function TBr(e,t){return j8o(e)&&/^\S/.test(t)&&!/^https?:\/\//i.test(t)}function Y8o(e,t){return t.length===e.length&&/^\S+$/.test(t)}function K8o(e,t){return e!==void 0&&e.length===t.length&&TBr(e,t)}function wBr(e,t,r){return TBr(t,r)?Y8o(t,r)||K8o(e,t):!1}function CBr(e,t){let r=e(t),n=e(t+1);return!!r&&!!n&&(n.isWrapped||r.isFull)}function X8o(e,t){let r=[];for(let n=t;n-t<64;n++){let o=e(n);if(!o||(r.push(o.text),!CBr(e,n)))break}return r}function kBr(e,t){return{start:t,texts:X8o(e,t)}}function _Br(e,t){let r=t;for(;r>0&&CBr(e,r-1);)r--;return kBr(e,r)}function Z8o(e,t){if(!(t.start===0||!e(t.start-1)))return _Br(e,t.start-1)}function Q8o(e,t){let r=t.start+t.texts.length;return e(r)?kBr(e,r):void 0}function EBr(e){return{endingAt:t=>_Br(e,t),before:t=>Z8o(e,t),after:t=>Q8o(e,t)}}function PBr(e,t,r){let n=e.before(t);return wBr(n?.texts.join(""),t.texts.join(""),r.texts.join(""))}function J8o(e,t){let r=[t],n=e.before(t);for(;n&&r.length<64&&PBr(e,n,r[0]);)r.unshift(n),n=e.before(n);let o=e.after(t);for(;o&&r.length<64&&PBr(e,r[r.length-1],o);)r.push(o),o=e.after(o);return r}function ABr(e,t){let r=EBr(e),n=J8o(r,r.endingAt(t));return{start:n[0]?.start??t,texts:n.flatMap(o=>o.texts)}}var sae=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>]/;function eOo(e){try{return!!new URL(e).host}catch{return!1}}function LBr(e,t,r){let n=t;for(let o of e){if(r<o.length)return{x:r+1,y:n+1};r-=o.length,n++}}function tOo(e,t,r){let n=r[0],o=LBr(e,t,r.index),i=LBr(e,t,r.index+n.length-1);if(!(!eOo(n)||!o||!i))return{text:n,range:{start:o,end:i}}}function rOo(e,t,r){let n=new RegExp(r.source,`${r.flags||""}g`);return[...e.join("").matchAll(n)].flatMap(i=>tOo(e,t,i)??[])}function IBr(e,t,r=sae){if(!e(t-1))return[];let{start:n,texts:o}=ABr(e,t-1);return rOo(o,n,r)}function DBr(e){let t=[],r=0;for(let n of e.matchAll(new RegExp(sae.source,"g")))n.index>r&&t.push({kind:"text",text:e.slice(r,n.index)}),t.push({kind:"url",text:n[0]}),r=n.index+n[0].length;return r<e.length&&t.push({kind:"text",text:e.slice(r)}),t}var lae=x(_(),1);function nOo(e){let t=[];for(let r of e){let n=t.at(-1);n?.stream===r.stream?n.text+=r.text:t.push({...r})}return t}function oOo({text:e}){return DBr(e).map((t,r)=>t.kind==="url"?(0,lae.jsx)(Ur,{href:t.text,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:Oi.link,children:t.text},r):t.text)}function MBr({output:e}){let t=nOo(e.filter(r=>r.text));return t.length?(0,lae.jsx)(H,{component:"pre",sx:Oi.output,children:t.map((r,n)=>(0,lae.jsx)(H,{component:"span",sx:r.stream==="stderr"?Oi.stderr:void 0,children:(0,lae.jsx)(oOo,{text:r.text})},`${n}:${r.stream}`))}):null}function Rq(e){let t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;let r=Math.floor(t/60);return r<60?`${r}m ${t%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function NBr(e){return e<1e4?`${(e/1e3).toFixed(1)}s`:Rq(e/1e3)}var pS=x(_(),1);function OBr({sent:e,exitCode:t,stopped:r,durationMs:n}){return(0,pS.jsxs)(pS.Fragment,{children:[r?(0,pS.jsx)(H,{component:"span",sx:Oi.bad,children:"stopped"}):t!==void 0&&(0,pS.jsxs)(H,{component:"span",sx:t===0?Oi.ok:Oi.bad,children:["exit ",t]}),n!==void 0&&(0,pS.jsx)("span",{children:NBr(n)}),e?(0,pS.jsx)("span",{children:"Sent with your message"}):(0,pS.jsx)(H,{component:"span",sx:Oi.attached,children:"Attached to your next message"})]})}var BBr=x(_(),1),Pq=ot((0,BBr.jsx)("path",{d:"M8 6h8c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2"}),"StopRounded");var glt=x(_(),1);function $Br({onStop:e}){return(0,glt.jsx)(tt,{size:"small",color:"error",startIcon:(0,glt.jsx)(Pq,{fontSize:"small"}),"aria-label":"Stop command",title:"Stop command (Esc)",sx:Oi.stop,onClick:e,children:"Stop"})}var FBr=x(_(),1),zBr=ot((0,FBr.jsx)("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded");var ylt=x(_(),1);function HBr({command:e,onDiscard:t}){return(0,ylt.jsx)(Mt,{size:"small","aria-label":`Discard result of ${e}`,title:"Discard \u2014 don't send with your message",sx:Oi.discard,onClick:t,children:(0,ylt.jsx)(zBr,{fontSize:"small"})})}var cae=x(re(),1);function L4e(e){let[t,r]=(0,cae.useState)(),[n,o]=(0,cae.useState)(()=>Date.now());if((0,cae.useEffect)(()=>{if(e===void 0)return;let i=Date.now();r({seconds:e,at:i}),o(i);let a=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(a)},[e]),e!==void 0)return t?.seconds!==e?e:e+Math.max(0,Math.floor((n-t.at)/1e3))}var WBr=x(_(),1);function UBr({startedAt:e}){let t=L4e(Math.floor((Date.now()-e)/1e3));return(0,WBr.jsxs)("span",{children:["Running \xB7 ",Rq(t??0)]})}var hp=x(_(),1);function I4e(e){let{command:t,output:r,status:n,startedAt:o}=e;return(0,hp.jsxs)(H,{sx:[Oi.row,n==="held"&&{borderLeftStyle:"dashed"}],children:[(0,hp.jsxs)(H,{sx:Oi.header,children:[(0,hp.jsx)(H,{component:"span",sx:Oi.bang,children:"!"}),(0,hp.jsx)(H,{component:"span",sx:Oi.command,title:t,children:t}),n==="held"&&e.onDiscard&&(0,hp.jsx)(HBr,{command:t,onDiscard:e.onDiscard})]}),(0,hp.jsx)(MBr,{output:r}),(0,hp.jsx)(H,{sx:Oi.meta,children:n==="running"?(0,hp.jsxs)(hp.Fragment,{children:[(0,hp.jsx)(UBr,{startedAt:o??Date.now()}),e.onStop&&(0,hp.jsx)($Br,{onStop:e.onStop})]}):(0,hp.jsx)(OBr,{sent:n==="sent",exitCode:e.exitCode,stopped:e.stopped,durationMs:e.durationMs})})]})}var VBr=x(_(),1);function D4e({command:e,stdout:t,stderr:r}){return(0,VBr.jsx)(I4e,{command:e,output:[{stream:"stdout",text:t},{stream:"stderr",text:r}],status:"sent"})}var GBr=x(_(),1),M4e=ot((0,GBr.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");var NC=x(_(),1),vlt="queued-row-actions",iOo={ml:"auto",display:"inline-flex",gap:.25,"& .MuiIconButton-root[data-action='remove']:hover":{color:"error.main"}};function qBr({onEdit:e,onRemove:t}){return(0,NC.jsxs)(H,{component:"span",className:vlt,sx:iOo,children:[e&&(0,NC.jsx)(lr,{title:"Edit",children:(0,NC.jsx)(Mt,{size:"small","aria-label":"Edit queued message",onClick:e,children:(0,NC.jsx)(M4e,{})})}),(0,NC.jsx)(lr,{title:"Remove",children:(0,NC.jsx)(Mt,{size:"small","data-action":"remove","aria-label":"Remove queued message",onClick:t,children:(0,NC.jsx)(Eo,{})})})]})}var jBr=x(re(),1);var aOo=/(^|\s)(\/[^\s/]+)(?=\s|$)/g,sOo=/[.,;:!?)]+$/;function Aq(e,t){let r=new Set(t.map(i=>i.name.toLowerCase())),n=[],o=0;if(r.size>0)for(let i of e.matchAll(aOo)){let a=i[2].replace(sOo,"");if(!r.has(a.slice(1).toLowerCase()))continue;let s=i.index+i[1].length;s>o&&n.push({text:e.slice(o,s),start:o,command:!1}),n.push({text:a,start:s,command:!0}),o=s+a.length}return(o<e.length||n.length===0)&&n.push({text:e.slice(o),start:o,command:!1}),n}var blt=x(_(),1);function N4e({text:e,commands:t,commandSx:r,renderText:n=o=>o}){return Aq(e,t).map(o=>o.command?(0,blt.jsx)(H,{component:"span",sx:r,children:n(o.text)},o.start):(0,blt.jsx)(jBr.Fragment,{children:n(o.text)},o.start))}var xlt=e=>e.tokens.color.selected,Lq={inline:{color:"primary.main",bgcolor:xlt,borderRadius:.5,boxShadow:e=>`0 0 0 2px ${xlt(e)}`},chip:{fontFamily:"fontFamilyMono",fontSize:"0.93em",color:"primary.main",bgcolor:xlt,border:1,borderColor:e=>Ar(e.palette.primary.main,.32),borderRadius:.5,px:.75,py:"1px"}};var XBr=x(re(),1);var O4e=e=>({...o9(e),fontSize:e.typography.body2.fontSize??"inherit",maxWidth:"none",lineHeight:1.6,color:"text.primary",overflowWrap:"anywhere","& .slash-chip":Lq.chip});var Slt=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),lOo=(e,t)=>Aq(e,t).map(r=>r.command?`<span class="slash-chip">${Slt(r.text)}</span>`:Slt(r.text)).join("");function YBr(e,t){return new VD({breaks:t,renderer:{html(r){return Slt(r.text)},text(r){return"tokens"in r&&r.tokens||e.length===0||"escaped"in r&&r.escaped?!1:lOo(r.text,e)}}})}var cOo=YBr([],!1);function KBr(e,t){return(t?YBr(t.commands,!0):cOo).parse(e)}var QBr=x(_(),1);function ZBr({text:e,commands:t}){let r=(0,XBr.useMemo)(()=>KBr(e,t&&{commands:t}),[e,t]);return(0,QBr.jsx)(Zs,{className:"markdown",sx:O4e,html:r})}var e$r=x(re(),1);function JBr(e,t){if(!t)return[{text:e,start:0,match:!1}];let r=e.toLowerCase(),n=t.toLowerCase(),o=[],i=(s,l,u)=>o.push({text:e.slice(s,l),start:s,match:u}),a=0;for(let s=r.indexOf(n);s!==-1;s=r.indexOf(n,a))s>a&&i(a,s,!1),i(s,s+n.length,!0),a=s+n.length;return a<e.length&&i(a,e.length,!1),o}var Tlt=x(_(),1);function t$r({text:e,term:t}){return JBr(e,t).map(r=>r.match?(0,Tlt.jsx)(lme,{children:r.text},r.start):(0,Tlt.jsx)(e$r.Fragment,{children:r.text},r.start))}var uae=x(_(),1),uOo={color:"text.primary",whiteSpace:"pre-wrap",overflowWrap:"anywhere",lineHeight:1.6};function r$r({isUser:e,text:t,term:r}){let n=T8r();return r?(0,uae.jsx)(be,{variant:"body2",sx:uOo,children:(0,uae.jsx)(N4e,{text:t,commands:e?n:[],commandSx:Lq.chip,renderText:o=>(0,uae.jsx)(t$r,{text:o,term:r})})}):(0,uae.jsx)(ZBr,{text:t,commands:e?n:void 0})}var dae=x(_(),1);function n$r({isUser:e,accent:t,queued:r,actions:n}){return(0,dae.jsxs)(be,{variant:"caption",component:"div",sx:{color:t,fontWeight:600,display:"flex",alignItems:"center",mb:.5},children:[(0,dae.jsxs)(H,{component:"span",sx:{opacity:r?.65:1},children:[e?"User":"Assistant",r&&(0,dae.jsx)(H,{component:"span",sx:{fontWeight:500,color:"text.secondary",ml:.75},children:"queued"})]}),n]})}var Iq=x(_(),1),B4e=`.${vlt}`,dOo={[`& ${B4e}`]:{opacity:0,transition:"opacity 120ms"},[`&:hover ${B4e}, &:focus-within ${B4e}`]:{opacity:1},"@media (hover: none)":{[`& ${B4e}`]:{opacity:1}}};function _M({role:e,text:t,term:r,queued:n,actions:o}){let i=e==="user",a=i?"info.main":"success.main";return(0,Iq.jsxs)(H,{sx:{mb:1.5,pl:1.5,py:1,pr:1,borderLeft:2,borderLeftStyle:n?"dashed":"solid",borderColor:a,borderTopRightRadius:1,borderBottomRightRadius:1,bgcolor:i?"action.hover":"transparent",...dOo},children:[(0,Iq.jsx)(n$r,{isUser:i,accent:a,queued:n,actions:o}),(0,Iq.jsx)(H,{sx:{opacity:n?.65:1},children:(0,Iq.jsx)(r$r,{isUser:i,text:t,term:r})})]})}var o$r=x(_(),1),$4e=ot((0,o$r.jsx)("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build");var EM=x(_(),1);function i$r({tool:e,target:t}){return(0,EM.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,py:.5,pl:1},children:[(0,EM.jsx)($4e,{sx:{fontSize:14,color:"text.disabled"}}),(0,EM.jsxs)(be,{variant:"caption",sx:{color:"text.secondary",fontFamily:"fontFamilyMono"},children:[(0,EM.jsx)(H,{component:"span",sx:{color:"warning.main"},children:e}),t&&(0,EM.jsxs)(H,{component:"span",children:[" ",t]})]})]})}function a$r(e){return e===0?"Daemon restarted":`Daemon restarted \xB7 ${e} background ${e===1?"task":"tasks"} killed`}var l$r=x(_(),1),s$r={content:'""',flex:1,height:"1px",bgcolor:"divider"};function fae({label:e}){return(0,l$r.jsx)(H,{role:"separator",sx:{display:"flex",alignItems:"center",gap:1.25,mt:.75,mb:1.75,fontSize:12,color:"text.secondary","&::before":s$r,"&::after":s$r},children:e})}var Dq=x(_(),1);function c$r({message:e,term:t,actions:r}){return e.role==="interrupt"?(0,Dq.jsx)(fae,{label:"Interrupted by you"}):e.role==="restart"?(0,Dq.jsx)(fae,{label:a$r(e.killed)}):e.role==="shell"?(0,Dq.jsx)(D4e,{...e}):e.role==="tool"?(0,Dq.jsx)(i$r,{tool:e.tool,target:e.target}):(0,Dq.jsx)(_M,{role:e.role,text:e.text,term:t,actions:r})}var Mq=x(re(),1),fOo=40;function u$r(e,t,r){let n=(0,Mq.useRef)(null),o=(0,Mq.useRef)(!0);return(0,Mq.useEffect)(()=>{let i=n.current;if(!i||!r)return;let a=()=>{o.current=i.scrollHeight-i.scrollTop-i.clientHeight<=fOo};return i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}),(0,Mq.useEffect)(()=>{if(r&&n.current){o.current&&(n.current.scrollTop=n.current.scrollHeight);return}t&&e.length>0&&n.current?.querySelector("mark")?.scrollIntoView({block:"center"})},[e,t,r]),n}function pOo(e){return e.role==="tool"?`tool:${e.tool}:${e.target}`:e.role==="interrupt"?"interrupt":e.role==="restart"?"restart":e.role==="shell"?`shell:${e.command.slice(0,40)}`:`${e.role}:${e.text.slice(0,40)}`}function hOo(e){let t=new Map;return e.map(r=>{let n=pOo(r),o=t.get(n)??0;return t.set(n,o+1),{...r,key:`${n}#${o}`}})}function d$r(e){let t=[];for(let r of hOo(e)){if(r.role!=="tool"){t.push({kind:"message",message:r});continue}let n=t.at(-1);n?.kind==="tools"?n.calls.push(r):t.push({kind:"tools",key:`run:${r.key}`,calls:[r]})}return t}function hS(e){return/^https?:\/\/\S+$/.test(e.trim())}function f$r(e,t){if(t)return t;let r=e.find(n=>n.name==="url")?.value.trim();return r&&hS(r)?r:void 0}function p$r(e){return e.split(/[\\/]/).pop()||e}var mOo=new Set(["assist","cargo","docker","dotnet","gh","git","go","npm","npx","pnpm","yarn"]),gOo=/'[^']*'|"(?:\\.|[^"\\])*"/g,yOo=/&&|\|\||[;|()`]|\$\(/,vOo=/^\w+=/;function bOo(e){let t=e.trim().split(/\s+/).filter(i=>i&&!vOo.test(i)),[r,n]=t;if(!r||r==="cd"||r.startsWith("-"))return null;let o=r.split("/").pop()||r;return mOo.has(o)&&n&&!n.startsWith("-")?`${o} ${n}`:o}function h$r(e){let r=e.split(`
|
|
3949
|
+
`,N8r={flexShrink:0,fontSize:"1.68rem",lineHeight:.6},m8o={...N8r,animation:`${h8o} 1.4s ease-in-out infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}};function O8r({status:e,label:t=!1}){return t?(0,eae.jsxs)(H,{component:"span",sx:Ph(Zu[e]),children:[(0,eae.jsx)(ub,{status:e})," ",e]}):(0,eae.jsx)(be,{variant:"caption",sx:{...NE(e)?m8o:N8r,color:Zu[e]},title:e,children:"\u25CF"})}var cS=x(_(),1),g8o={flexShrink:0,whiteSpace:"nowrap"};function y8o({session:e}){return ige(e)?(0,cS.jsxs)(H,{component:"span",sx:Ph(Zu.running),children:[wE.running," verifying"]}):(0,cS.jsx)(O8r,{status:Ji(e),label:!0})}function B8r({session:e}){let{restored:t}=e;return(0,cS.jsxs)(cS.Fragment,{children:[(0,cS.jsx)(y8o,{session:e}),e.sdk&&(0,cS.jsx)(a4e,{label:"Claude \xB7 SDK"}),t!==void 0&&(0,cS.jsx)(be,{variant:"caption",sx:{...g8o,color:t?"success.main":"warning.main"},children:t?"restored":"not restored"})]})}var tae=x(_(),1),v8o={display:"flex",alignItems:"center",gap:.75,minWidth:0},b8o={color:"text.primary",fontSize:"1.25rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function $8r({session:e}){return(0,tae.jsxs)(H,{sx:v8o,children:[Vme(e.activity).map(t=>(0,tae.jsx)(eme,{itemId:t,cwd:Wl(e)},t)),(0,tae.jsx)(be,{variant:"body1",sx:b8o,children:Vp(e)})]})}var ZR=x(re(),1);function F8r(e,t){let[r,n]=(0,ZR.useState)(0),[o,i]=(0,ZR.useState)(!1),a=(0,ZR.useRef)(0);return(0,ZR.useEffect)(()=>{let s=e.current;if(!s||typeof ResizeObserver>"u")return;let l=new ResizeObserver(()=>n(s.scrollWidth));return l.observe(s),()=>l.disconnect()},[e]),(0,ZR.useEffect)(()=>{o||(a.current=r),t!==null&&a.current>0&&i(a.current>t)},[o,r,t]),{width:r,collapsed:o}}var QR=x(_(),1),x8o={display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,flexBasis:0,overflow:"hidden"},S8o={display:"flex",alignItems:"center",alignSelf:"flex-start",gap:1},T8o={color:"text.secondary",fontSize:"0.875rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function z8r({session:e,minWidth:t,budget:r,onIdentityWidth:n}){let o=(0,s4e.useRef)(null),{width:i,collapsed:a}=F8r(o,r),s=A8r(e);return(0,s4e.useEffect)(()=>n(i),[i,n]),(0,QR.jsxs)(H,{sx:{...x8o,minWidth:`${t}px`},children:[(0,QR.jsxs)(H,{ref:o,sx:S8o,children:[(0,QR.jsx)(D8r,{session:e,collapsed:a}),(0,QR.jsx)(B8r,{session:e})]}),(0,QR.jsx)($8r,{session:e}),s&&(0,QR.jsx)(be,{sx:T8o,children:s})]})}var lBr=x(re(),1);function H8r({label:e,onClick:t,onKeyDown:r,title:n,ariaLabel:o,disabled:i,pressed:a,shortcut:s}){return{onClick:t,onKeyDown:r,disabled:i,title:s?void 0:n,"aria-label":o??n??e,"aria-pressed":a,"data-shortcut":s}}var w8o={muted:{color:"text.disabled",labelled:"text.secondary",hover:"text.primary"},start:{color:"text.disabled",labelled:"text.secondary",hover:"success.main"},stop:{color:"success.main",hover:"error.main"},starred:{color:"warning.main",hover:"warning.main"},inherit:{color:"inherit"},secondary:{color:"text.secondary",hover:"text.primary"}};function Qst(e,t){let{color:r,labelled:n,hover:o}=w8o[e],i=t&&n?n:r;return o?{color:i,"&:hover":{color:o}}:{color:i}}var l4e=x(_(),1);function U8r({label:e,shortcut:t,children:r}){return t?(0,l4e.jsx)(lr,{describeChild:!0,title:(0,l4e.jsx)(C8o,{label:e,shortcut:t}),children:r}):r}function C8o({label:e,shortcut:t}){return(0,l4e.jsx)(jd,{label:e,chords:vo(t).chords})}var c4e=x(_(),1),k8o={textTransform:"none",flexShrink:0,minWidth:0,px:1,whiteSpace:"nowrap"};function ac({label:e,icon:t,tone:r="muted",size:n="small",...o}){let i=rge(),a=H8r({label:e,...o});return(0,c4e.jsx)(U8r,{label:o.title??e,shortcut:o.shortcut,children:i?(0,c4e.jsx)(tt,{...a,size:"small",startIcon:t,sx:{...k8o,...Qst(r,!0)},children:e}):(0,c4e.jsx)(Mt,{...a,size:n,sx:Qst(r,!1),children:t})})}var Jst=x(_(),1);function W8r({pr:e}){return e.url?(0,Jst.jsx)(ac,{label:"PR",title:"Open PR",icon:(0,Jst.jsx)(Yhe,{sx:{fontSize:14}}),onClick:t=>{t.stopPropagation(),window.open(e.url,"_blank")}}):null}var V8r=x(_(),1),u4e=ot((0,V8r.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17l-.59.59-.58.58V4h16zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47z"}),"RateReviewOutlined");var tlt=x(re(),1);var q8r=x(_(),1);function G8r({review:e,pick:t,capabilities:r}){return eS(r,sst).map(n=>(0,q8r.jsx)(DR,{entry:n,onSelect:(o,i)=>t(o,()=>e.launchAddressComments(i.slice(1)))},n.label))}var Y8r=x(_(),1);function j8r({review:e,highLevel:t,pick:r,capabilities:n}){return eS(n).map(o=>{let i=t?.label&&o.args.includes("--high-level")?t:void 0;return(0,Y8r.jsx)(DR,{entry:i?.label?{...o,label:i.label,alternates:[]}:o,caption:i?.caption,onSelect:(a,s)=>r(a,t&&s===o.args&&s.includes("--high-level")?t.run:()=>e.launchMode(s))},o.label)})}var uS=x(_(),1);function K8r({review:e,highLevel:t,pick:r}){let n=wu(cr());return(0,uS.jsxs)(uS.Fragment,{children:[(0,uS.jsx)(j8r,{review:e,highLevel:t,pick:r,capabilities:n}),(0,uS.jsx)(qn,{}),(0,uS.jsx)(vEe,{value:e.options,onChange:e.setOptions}),(0,uS.jsx)(qn,{}),(0,uS.jsx)(G8r,{review:e,pick:r,capabilities:n})]})}var elt=x(_(),1);function X8r({anchorEl:e,onClose:t,review:r,highLevel:n}){return(0,elt.jsx)(mi,{anchorEl:e,open:!!e,onClose:t,onClick:i=>i.stopPropagation(),children:(0,elt.jsx)(K8r,{review:r,highLevel:n,pick:(i,a)=>{i.stopPropagation(),t(),a()}})})}function Z8r(e,t){let r=e.pendingPrPreview;return r?.kind==="high-level-review"&&r.prNumber===t}function Q8r(e,t){return e.assistArgs?.[0]==="review"&&e.assistArgs.includes("--high-level")&&pb(e)===t}var J8r="No saved slices for #";var _8o=18e4,eOr="Failed to reopen the high-level review";function E8o(e){return e?e.startsWith(J8r)?`${e}. Tick Force re-run to slice it again.`:e:eOr}async function tOr(e,t,r){try{let n=await Wt(Ir("/api/sessions/reopen-high-level-review",r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,prNumber:t}),timeoutMs:_8o});if(n.ok)return null;let o=await n.json().catch(()=>null);return E8o(o?.error)}catch(n){return xr(n,"reopen high-level review"),eOr}}function rOr(e,t,r,n){let{activateSession:o,sendInput:i}=pl(),a=on().palette.primary.main,s=cr();if(!(!e||!Q8r(e,t.number)))return Z8r(e,t.number)?{run:()=>{o(e.id),ou(Nf("preview",e.id),a)}}:r.force?{run:()=>dl(i,e.id,`/review-high-level ${t.number} --force`)}:{label:"Reopen high-level review",caption:e.highLevelReviewHead?`Saved slices for ${e.highLevelReviewHead} \xB7 no re-slicing`:void 0,run:()=>{tOr(e.id,t.number,s).then(l=>l&&n(l))}}}var nOr=x(re(),1);function oOr(e,t,r){let{launchAssist:n}=pl(),[o,i]=(0,nOr.useState)(Aie),a={...IR(t),inPlace:!0,launchedFrom:r},s=l=>n(l,e,a);return{options:o,setOptions:i,resetOptions:()=>i(Aie),launchMode:l=>s([...l,String(t.number),...gEe(o)]),launchAddressComments:l=>s(["review-pr-comments",String(t.number),...l])}}var RC=x(_(),1);function iOr({cwd:e,pr:t,session:r}){let n=oOr(e,t,r?.id),[o,i]=(0,tlt.useState)(null),a=rOr(r,t,n.options,i),[s,l]=(0,tlt.useState)(null);return(0,RC.jsxs)(RC.Fragment,{children:[(0,RC.jsx)(ac,{label:"Review",title:"Review PR",icon:(0,RC.jsx)(u4e,{sx:{fontSize:14}}),onClick:u=>{u.stopPropagation(),n.resetOptions(),l(u.currentTarget)}}),(0,RC.jsx)(X8r,{anchorEl:s,onClose:()=>l(null),review:n,highLevel:a}),(0,RC.jsx)(hs,{error:o,onClose:()=>i(null)})]})}var rae=x(_(),1),aOr=ot((0,rae.jsxs)("g",{fillRule:"evenodd",children:[(0,rae.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H4V5h16z"}),(0,rae.jsx)("path",{d:"M19.41 10.42 17.99 9l-3.17 3.17-1.41-1.42L12 12.16 14.82 15zM5 7h5v2H5zm0 4h5v2H5zm0 4h5v2H5z"})]}),"FactCheckOutlined");var uOr=x(re(),1);var JR=x(_(),1);function sOr({content:e,onClose:t}){return(0,JR.jsxs)(Pa,{open:!0,onClose:t,maxWidth:"md",fullWidth:!0,children:[(0,JR.jsx)($l,{children:"Review synthesis"}),(0,JR.jsx)(Bl,{dividers:!0,children:(0,JR.jsx)(Zs,{className:"markdown",sx:{lineHeight:1.7,"& p":{mt:0},"& a":{color:"primary.main"},wordBreak:"break-word"},html:Qke(e)})}),(0,JR.jsx)(Jc,{children:(0,JR.jsx)(tt,{onClick:t,children:"Close"})})]})}var d4e=x(re(),1);async function lOr(e,t){try{let r=await Wt(Ir(`/api/review/synthesis?cwd=${encodeURIComponent(e)}`,t));if(r.status===404)return{status:"absent"};if(!r.ok)return{status:"error"};let n=await r.json();return typeof n.synthesis!="string"?{status:"absent"}:{status:"ready",content:n.synthesis}}catch(r){return xr(r,"review synthesis"),{status:"error"}}}function cOr(e,t){let[r,n]=(0,d4e.useState)({status:"loading"}),o=cr();return(0,d4e.useEffect)(()=>{if(!e||!t){n({status:"absent"});return}let i=!1;return n({status:"loading"}),lOr(e,o).then(a=>{i||n(a)}),()=>{i=!0}},[e,t,o]),r}var PC=x(_(),1);function dOr({session:e}){let t=PE(e)==="review",r=cOr(e.cwd,t),[n,o]=(0,uOr.useState)(!1);return r.status!=="ready"?null:(0,PC.jsxs)(PC.Fragment,{children:[(0,PC.jsx)(ac,{label:"Findings",title:"View review findings",icon:(0,PC.jsx)(aOr,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),o(!0)}}),n&&(0,PC.jsx)(ua,{children:(0,PC.jsx)(sOr,{content:r.content,onClose:()=>o(!1)})})]})}var e3=x(_(),1);function fOr({session:e}){let t=YB(e.cwd,pb(e),e.status),r=e.cwd;return(0,e3.jsxs)(e3.Fragment,{children:[t&&r&&(0,e3.jsx)(W8r,{pr:t}),t&&r&&(0,e3.jsx)(iOr,{cwd:r,pr:t,session:e}),(0,e3.jsx)(dOr,{session:e})]})}var rlt=x(_(),1);function pOr({id:e,onRetry:t,shortcut:r,server:n}){return(0,rlt.jsx)(ac,{label:"Retry",title:`Retry session ${e}${n?" (shift+click replaces a running server without asking)":""}`,shortcut:r,icon:(0,rlt.jsx)(HR,{sx:{fontSize:14}}),onClick:i=>{i.stopPropagation(),t(n&&i.shiftKey?!0:void 0)}})}var nlt=x(_(),1);function hOr({runName:e,cwd:t,launchedFrom:r}){let{onStart:n}=QB();return(0,nlt.jsx)(ac,{label:e,title:`Start ${e} (shift+click replaces a running server without asking)`,tone:"start",icon:(0,nlt.jsx)(nv,{sx:{fontSize:16}}),onClick:o=>{o.stopPropagation(),n(e,t,o.shiftKey||void 0,r)}})}var h4e=x(re(),1);var f4e={textTransform:"none",fontSize:11,justifyContent:"space-between",maxWidth:"100%",overflow:"hidden"};var Cq=x(_(),1),R8o={[`& .${so.lastButton}`]:{minWidth:0,px:.25}};function mOr({label:e,open:t,onClick:r,onDefaultAction:n,disabled:o=!1}){let i=t?FE:Ks,a=typeof e=="string"?`${e} options`:"options";return(0,Cq.jsxs)(q1,{size:"small",variant:"outlined",disabled:o,sx:R8o,children:[(0,Cq.jsx)(tt,{disabled:o,onClick:n,sx:{...f4e,justifyContent:"center"},children:e}),(0,Cq.jsx)(tt,{disabled:o,onClick:r,"aria-label":a,title:a,"aria-haspopup":"true","aria-expanded":t,children:(0,Cq.jsx)(i,{sx:{fontSize:18}})})]})}var kq=x(_(),1);function p4e({label:e,open:t,onClick:r,onDefaultAction:n,disabled:o=!1,tooltip:i}){if(n)return(0,kq.jsx)(mOr,{label:e,open:t,onClick:r,onDefaultAction:n,disabled:o});let a=(0,kq.jsx)(tt,{size:"small",variant:"outlined",disabled:o,onClick:r,"aria-haspopup":"true","aria-expanded":t,endIcon:t?(0,kq.jsx)(FE,{}):(0,kq.jsx)(Ks,{}),sx:f4e,fullWidth:!0,children:e});return i?(0,kq.jsx)(lr,{describeChild:!0,title:i,children:a}):a}var TM=x(_(),1);function m4e({runs:e,onSelect:t}){let[r,n]=(0,h4e.useState)(!1),o=(0,h4e.useRef)(null),i=()=>n(!1);return(0,TM.jsxs)(Gr,{ref:o,variant:"outlined",sx:{display:"inline-flex",border:"none"},children:[(0,TM.jsx)(p4e,{label:"server",open:r,onClick:()=>n(!r)}),(0,TM.jsx)(mi,{anchorEl:o.current,open:r,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{width:200,maxHeight:200}},list:{dense:!0,disablePadding:!0}},children:e.map(a=>(0,TM.jsx)(Br,{onClick:s=>{i(),t(a.name,s.shiftKey||void 0)},sx:{py:.75},children:(0,TM.jsx)(be,{sx:{fontSize:13},children:a.name})},a.name))})]})}var g4e=x(re(),1);function y4e(e){let[t,r]=(0,g4e.useState)([]),n=cr();return(0,g4e.useEffect)(()=>{if(!e){r([]);return}let o=!1;return Wt(Ir(`/api/server-runs?cwd=${encodeURIComponent(e)}`,n)).then(i=>i.json()).then(i=>{o||r(Array.isArray(i?.runs)?i.runs:[])}).catch(i=>{xr(i,"server runs"),o||r([])}),()=>{o=!0}},[e,n]),t}var wM=x(_(),1);function gOr({session:e}){let t=y4e(e.cwd),{onStart:r}=QB();return t.length>2?(0,wM.jsx)(ua,{children:(0,wM.jsx)(m4e,{runs:t,onSelect:(n,o)=>r(n,e.cwd,o,e.id)})}):(0,wM.jsx)(wM.Fragment,{children:t.map(n=>(0,wM.jsx)(hOr,{runName:n.name,cwd:e.cwd,launchedFrom:e.id},n.name))})}var yOr=x(_(),1),t3=ot((0,yOr.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");var vOr=x(_(),1),r3=ot((0,vOr.jsx)("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder");var v4e=x(_(),1);function bOr({session:e}){let{isStarred:t,toggleStar:r}=oy(),n=t(e);return(0,v4e.jsx)(ac,{label:n?"Unstar":"Star",title:n?"Unstar":"Star",tone:n?"starred":"muted",pressed:n,icon:n?(0,v4e.jsx)(t3,{sx:{fontSize:16}}):(0,v4e.jsx)(r3,{sx:{fontSize:16}}),onClick:o=>{o.stopPropagation(),r(e)}})}var xOr=x(_(),1),SOr=ot((0,xOr.jsx)("path",{d:"M22 9V7h-2v2h-2v2h2v2h2v-2h2V9zM8 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 7c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m6 5H2v-.99C2.2 16.29 5.3 15 8 15s5.8 1.29 6 2zM12.51 4.05C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"}),"GroupAddOutlined");var LOr=x(re(),1);var b4e=x(re(),1);var P8o="assist:prompt-draft:";function n3(e){let t=P8o+e,[r,n]=(0,b4e.useState)(()=>({key:t,prompt:fl(t)[0]??""})),o=r.key===t?r.prompt:fl(t)[0]??"",i=(0,b4e.useCallback)(a=>{n(s=>{let l=s.key===t?s.prompt:fl(t)[0]??"",u=typeof a=="function"?a(l):a;return Dl(t,u?[u]:[]),{key:t,prompt:u}})},[t]);return[o,i]}var TOr={"assist-draft":["draft","--once"],"assist-bug":["bug","--once"],"assist-refine":["refine","--once"]};function A8o(e){return e in TOr}function L8o(e,t){let r=[...TOr[e]],n=t?.trim();return n&&r.push(n),r}function wOr(e,t,r,n,o){if(A8o(e)&&t){r(L8o(e,o),t);return}n(e)}var x4e="Enter prompt...";function AC(e){e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.closest("form")?.requestSubmit())}var _Or=x(re(),1);var olt=x(re(),1);function COr(e){return e.ctrlKey||e.altKey||e.metaKey?!1:e.key.length===1&&e.key!==" "}function kOr(e,t){let[r,n]=(0,olt.useState)(!1),[o,i]=(0,olt.useState)("");return{open:r,initialFilter:o,onKeyDown:l=>{!e||r||t||COr(l)&&(l.preventDefault(),i(l.key),n(!0))},toggle:()=>{i(""),n(!r)},close:()=>n(!1)}}var T4e=x(_(),1),_q={position:"absolute",top:"100%",left:0,right:0,mt:.25,maxHeight:200,overflowY:"auto",zIndex:10};function S4e({label:e,children:t,disabled:r=!1,onDefaultAction:n,tooltip:o,typeToOpen:i=!1}){let{open:a,initialFilter:s,onKeyDown:l,toggle:u,close:d}=kOr(i,r),f=(0,_Or.useRef)(null);return(0,T4e.jsxs)(Gr,{component:"fieldset",ref:f,variant:"outlined",sx:{position:"relative",border:"none",m:0,p:0},onBlur:p=>{f.current?.contains(p.relatedTarget)||d()},onKeyDown:l,children:[(0,T4e.jsx)(p4e,{label:e,open:a,disabled:r,onClick:u,onDefaultAction:n,tooltip:o}),a&&t(d,s)]})}function EOr(e){return e?{width:320}:{..._q,left:"auto",width:320}}var CM=x(_(),1);function ROr({value:e,onChange:t,onSubmit:r,header:n,anchored:o=!1,commands:i}){return(0,CM.jsx)(Gr,{elevation:o?0:4,sx:EOr(o),children:(0,CM.jsxs)(St,{component:"form",spacing:1,sx:{p:1},onSubmit:a=>{a.preventDefault(),r()},children:[n,(0,CM.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"flex-start"},children:[(0,CM.jsx)(W$,{commands:i,value:e,onChange:t,onKeyDown:AC,placeholder:x4e,size:"small",autoFocus:!0,fullWidth:!0,multiline:!0,maxRows:7,slotProps:{input:{sx:{fontSize:13}}}}),(0,CM.jsx)(tt,{type:"submit",variant:"contained",size:"small",sx:{whiteSpace:"nowrap"},children:"Start"})]})]})})}var ilt=x(_(),1);function POr({session:e,anchorEl:t,onClose:r}){let{launchAgentInStream:n}=pl(),[o,i]=n3(`add-agent:${e.id}`),a=fy(e.harness,t?e.cwd:void 0,e.node);return(0,ilt.jsx)($d,{anchorEl:t,open:!!t,onClose:r,onClick:s=>s.stopPropagation(),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,ilt.jsx)(ROr,{anchored:!0,commands:a,value:o,onChange:i,onSubmit:()=>{n(e.id,o,e.cwd),i(""),r()}})})}function AOr(e){return e.joinable===!0}var o3=x(_(),1);function IOr({session:e,shortcut:t}){let[r,n]=(0,LOr.useState)(null);return AOr(e)?(0,o3.jsxs)(o3.Fragment,{children:[(0,o3.jsx)(ac,{label:"Add agent",title:"Add another agent to this session's workspace",ariaLabel:"add agent",shortcut:t,icon:(0,o3.jsx)(SOr,{sx:{fontSize:14}}),onClick:o=>{o.stopPropagation(),n(o.currentTarget)}}),(0,o3.jsx)(POr,{session:e,anchorEl:r,onClose:()=>n(null)})]}):null}var zOr=x(re(),1);var alt=x(_(),1);function DOr(e){return(0,alt.jsx)(H1,{viewBox:"-3 -3 30 30",...e,children:(0,alt.jsx)("path",{d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})})}var MOr=x(_(),1),I8o={fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"};function w4e({children:e,sx:t,...r}){return(0,MOr.jsx)(H1,{viewBox:"0 0 16 16",sx:[I8o,t??{}].flat(),...r,children:e})}var slt=x(_(),1);function NOr(e){return(0,slt.jsx)(w4e,{...e,children:(0,slt.jsx)("path",{d:"M11 2l3 1.5v9L11 14 4 8l7-6zM2 6l2 2-2 2"})})}var llt=x(_(),1);function OOr({outlined:e,small:t}){return e?(0,llt.jsx)(NOr,{}):(0,llt.jsx)(DOr,{sx:t?{fontSize:14}:void 0})}var C4e={"& .MuiIconButton-root .MuiSvgIcon-root":{fontSize:15}};var clt=x(_(),1);function BOr({show:e,outlined:t,children:r}){return e?(0,clt.jsx)(lr,{title:"Open in VS Code",children:(0,clt.jsx)(H,{component:"span",sx:t?C4e:void 0,children:r})}):r}var $Or="Failed to open VS Code";async function FOr(e,t){try{let r=await Wt(Ir(`/api/open-in-code?cwd=${encodeURIComponent(e)}`,t),{method:"POST"});return r.ok?null:(await r.json().catch(()=>null))?.error??$Or}catch(r){return xr(r,"open in VS Code"),$Or}}var LC=x(_(),1);function k4e({cwd:e,variant:t="toolbar",shortcut:r}){let[n,o]=(0,zOr.useState)(null),i=t==="card",a=cr();return(0,LC.jsxs)(LC.Fragment,{children:[(0,LC.jsx)(BOr,{show:!r,outlined:!i,children:(0,LC.jsx)(ac,{label:"VS Code",title:r?"Open in VS Code":void 0,ariaLabel:"Open in VS Code",tone:i?"muted":"secondary",size:i?"small":"medium",disabled:!e,shortcut:r,icon:(0,LC.jsx)(OOr,{outlined:!i,small:i}),onClick:s=>{s.stopPropagation(),FOr(e,a).then(l=>l&&o(l))}})}),(0,LC.jsx)(hs,{error:n,onClose:()=>o(null)})]})}var kM=x(_(),1);function HOr({session:e}){return(0,kM.jsxs)(kM.Fragment,{children:[(0,kM.jsx)(IOr,{session:e,shortcut:"focusAddAgent"}),e.cwd&&(0,kM.jsx)(k4e,{cwd:e.cwd,variant:"card",shortcut:e.commandType==="run"?void 0:"focusVsCode"})]})}var WOr=x(re(),1);var nae=x(_(),1);function UOr({session:e,queued:t,targets:r,close:n}){let{transfer:o,cancel:i}=ab();return t?(0,nae.jsx)(Br,{onClick:()=>{n(),i(e.id)},children:"Cancel pending transfer"}):r===null?(0,nae.jsx)(Br,{disabled:!0,children:"Finding nodes\u2026"}):r.length===0?(0,nae.jsx)(Br,{disabled:!0,children:"No connected node has this repo"}):r.map(a=>(0,nae.jsx)(Br,{onClick:()=>{n(),o(e.id,a.node,a.cwd)},children:a.node},a.node))}var IC=x(_(),1);function VOr({session:e}){let{nodes:t}=ab(),[r,n]=(0,WOr.useState)(null),o=Lh(e),i=xq(e,t,r!==null&&!o.queued);return bq(e,t).length===0?null:(0,IC.jsxs)(IC.Fragment,{children:[(0,IC.jsx)(ac,{label:o.label,title:o.title,tone:o.failed?"starred":"muted",disabled:o.pending,icon:(0,IC.jsx)(OE,{sx:{fontSize:14}}),onClick:a=>{a.stopPropagation(),n(a.currentTarget)}}),(0,IC.jsx)(mi,{anchorEl:r,open:r!==null,onClose:()=>n(null),children:(0,IC.jsx)(UOr,{session:e,queued:o.queued,targets:i,close:()=>n(null)})})]})}function dS(e){let{activity:t,status:r}=e;if(!(r==="done"||t?.kind!=="backlog"||t.itemId==null))return{itemId:t.itemId,phase:t.phase,totalPhases:t.totalPhases}}function D8o(e){if(!e)return"";let{childCount:t}=e;return` Its ${t} nested ${t===1?"session":"sessions"} will also be closed.`}function GOr({phase:e,totalPhases:t},r){return`${e??0} of ${t??0} phases completed. Mark this backlog item as done and end its session?${D8o(r)}`}var ult=x(_(),1);function qOr({target:e,childDismiss:t,busy:r,onConfirm:n,onCancel:o}){return(0,ult.jsx)(ua,{children:(0,ult.jsx)(Uo,{title:`Mark ${mn(e.itemId)} done`,message:GOr(e,t),confirmLabel:"Mark done",autoFocusConfirm:!0,busy:r,onConfirm:n,onCancel:o})})}var dlt=x(re(),1);function _4e(e,t,r,n){let[o,i]=(0,dlt.useState)(!1),[a,s]=(0,dlt.useState)(null);return{busy:o,error:a,clearError:()=>s(null),confirm:async()=>{if(!o){i(!0);try{await FB(e,"done",t,n),r()}catch(u){xr(u,"mark item done"),s(`Failed to mark item ${mn(e)} as done`)}finally{i(!1)}}}}}var fS=x(_(),1);function jOr({target:e,cwd:t,onDismiss:r,childDismiss:n,shortcut:o}){let{busy:i,error:a,clearError:s,confirm:l}=_4e(e.itemId,t,()=>{d(),r({closeServerRuns:!0}),n?.onDismissChildren()}),{confirming:u,close:d,triggerHandlers:f,withHint:p}=fs(()=>{l()});return(0,fS.jsxs)(fS.Fragment,{children:[(0,fS.jsx)(ac,{label:"Done",title:p("Mark done"),ariaLabel:"Mark done",shortcut:o,icon:(0,fS.jsx)(iu,{sx:{fontSize:16}}),...f}),u&&(0,fS.jsx)(qOr,{target:e,childDismiss:n,busy:i,onConfirm:l,onCancel:d}),(0,fS.jsx)(ua,{children:(0,fS.jsx)(hs,{error:a,onClose:s})})]})}var Eq=x(_(),1);function YOr({session:e,onDismiss:t,childDismiss:r}){let n=dS(e);return(0,Eq.jsxs)(Eq.Fragment,{children:[" ",n&&(0,Eq.jsx)(jOr,{target:n,cwd:e.cwd,onDismiss:t,childDismiss:r,shortcut:"focusDone"})]})}var eg=x(_(),1);function KOr({session:e,onRetry:t,onRestart:r,onStartOver:n,onDismiss:o,childDismiss:i}){let a=e.status==="stopped"||e.closing===!0;return(0,eg.jsxs)(eg.Fragment,{children:[(0,eg.jsx)(gOr,{session:e}),(0,eg.jsx)(HOr,{session:e}),(0,eg.jsx)(fOr,{session:e}),r&&!a&&(0,eg.jsx)(oge,{id:e.id,onRestart:r,onStartOver:n,harness:e.harness}),t&&(0,eg.jsx)(pOr,{id:e.id,onRetry:t,server:e.server,shortcut:e.commandType==="run"?"focusVsCode":void 0}),(0,eg.jsx)(bOr,{session:e}),(0,eg.jsx)(VOr,{session:e}),(0,eg.jsx)(YOr,{session:e,onDismiss:o,childDismiss:i})]})}var ZOr=x(_(),1);function XOr({session:e}){return e.cwd?(0,ZOr.jsx)(zme,{panelSessionId:e.id,cwd:e.cwd,conversation:db(e),offerBranchDiff:!0,toggleChordHint:!0,countButton:!0}):null}var flt=x(_(),1),M8o={display:"flex",flexShrink:0};function QOr({session:e,onDismiss:t,childDismiss:r}){let{status:n,id:o}=e;return n==="stopped"||e.closing?null:(0,flt.jsx)(H,{sx:M8o,children:(0,flt.jsx)(Zme,{id:o,status:n,onDismiss:t,childDismiss:r})})}var E4e=x(re(),1);function JOr(e=0,t=null){let[,r]=(0,E4e.useState)(0);(0,E4e.useEffect)(()=>{if(t==null)return;let s=setInterval(()=>r(l=>l+1),1e3);return()=>clearInterval(s)},[t]);let n=t==null?e:e+(Date.now()-t),o=Math.floor(n/1e3),i=Math.floor(o/60),a=o%60;return i>=60?`${Math.floor(i/60)}h ${i%60}m`:i>0?`${i}m ${a}s`:`${a}s`}var tBr=x(_(),1);function eBr({session:e}){let t=JOr(e.runningMs,e.runningSince);return(0,tBr.jsx)(be,{variant:"caption",sx:{flexShrink:0,whiteSpace:"nowrap",color:"text.disabled"},children:t})}var R4e=x(_(),1);function rBr({label:e,checked:t,onChange:r,inline:n=!1}){return(0,R4e.jsx)(ua,{children:(0,R4e.jsx)(Bd,{sx:n?{m:0,flexShrink:0}:{m:0,mt:.5},control:(0,R4e.jsx)(zd,{size:"small",checked:t,onChange:o=>r(o.target.checked)}),label:e,slotProps:{typography:{variant:"caption",color:"text.secondary"}}})})}function nBr(e,t){return e==="autoApprove"?t.onSetAutoApprove:t.onSetAutoAdvance}var oae=x(_(),1);function oBr({session:e,onSetAutoApprove:t,onSetAutoAdvance:r}){return(0,oae.jsx)(oae.Fragment,{children:XB(e).map(n=>(0,oae.jsx)(rBr,{inline:!0,label:n.label,checked:n.checked,onChange:nBr(n.key,{onSetAutoApprove:t,onSetAutoAdvance:r})},n.key))})}var P4e=x(re(),1);function iBr(e,t,r){let n=1,o=0;for(let i of e){let a=o===0?i:o+t+i;a>r&&o>0?(n++,o=i):o=a}return n}function aBr(e,t,r){if(e.length===0||e.reduce((s,l)=>s+l,0)+t*(e.length-1)<=r)return;let o=iBr(e,t,r),i=Math.ceil(Math.max(...e)),a=Math.max(i,Math.floor(r));for(;i<a;){let s=Math.floor((i+a)/2);iBr(e,t,s)<=o?a=s:i=s+1}return i+1}function N8o(e,t){return e.gap===t.gap&&e.widths.length===t.widths.length&&e.widths.every((r,n)=>r===t.widths[n])}function O8o(e){let t=getComputedStyle(e);return e.getBoundingClientRect().width+(Number.parseFloat(t.marginLeft)||0)+(Number.parseFloat(t.marginRight)||0)}function plt(e){return Array.from(e.children).flatMap(t=>getComputedStyle(t).display==="contents"?plt(t):[t])}function sBr(e,t){let[r,n]=(0,P4e.useState)({widths:[],gap:0});if((0,P4e.useEffect)(()=>{let o=e.current;if(!o||typeof ResizeObserver>"u")return;let i=()=>{let u={widths:plt(o).map(O8o),gap:Number.parseFloat(getComputedStyle(o).columnGap)||0};n(d=>N8o(d,u)?d:u)},a=new ResizeObserver(i),s=()=>{a.disconnect();for(let u of plt(o))a.observe(u);i()},l=new MutationObserver(s);return l.observe(o,{childList:!0,subtree:!0}),s(),()=>{a.disconnect(),l.disconnect()}},[e]),t!==null)return aBr(r.widths,r.gap,t)}var DC=x(_(),1),B8o={display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",gap:1,flexGrow:0,flexShrink:1,flexBasis:"auto",minWidth:0};function cBr({session:e,labelled:t,available:r,onRetry:n,onRestart:o,onStartOver:i,onDismiss:a,childDismiss:s,onSetAutoApprove:l,onSetAutoAdvance:u}){let d=(0,lBr.useRef)(null),f=sBr(d,r);return(0,DC.jsxs)(H,{ref:d,sx:{...B8o,width:f},children:[(0,DC.jsx)(XOr,{session:e}),(0,DC.jsx)(eBr,{session:e}),(0,DC.jsx)(oBr,{session:e,onSetAutoApprove:l,onSetAutoAdvance:u}),(0,DC.jsx)(y$e.Provider,{value:t,children:(0,DC.jsx)(KOr,{session:e,onRetry:n,onRestart:o,onStartOver:i,onDismiss:a,childDismiss:s})}),(0,DC.jsx)(QOr,{session:e,onDismiss:a,childDismiss:s})]})}var uBr=x(re(),1);var hlt=8,$8o=560,F8o=48,z8o=.5;function dBr(e){let t=n4(e),[r,n]=(0,uBr.useState)(0),o=t===null?r:Math.min(r,Math.max(t-F8o,0));return{floor:o,budget:t===null?null:t*z8o,labelled:t===null||t-o>=$8o,available:t===null?null:t-o-hlt,setIdentityWidth:n}}var iae=x(_(),1),H8o={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:`${hlt}px`,px:1.5,py:.75,borderBottom:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"};function pBr({session:e,...t}){let r=(0,fBr.useRef)(null),n=dBr(r);return(0,iae.jsxs)(H,{ref:r,sx:H8o,"data-top-bar-session-id":e.id,children:[(0,iae.jsx)(z8r,{session:e,minWidth:n.floor,budget:n.budget,onIdentityWidth:n.setIdentityWidth}),!Lh(e).pending&&(0,iae.jsx)(cBr,{session:e,labelled:n.labelled,available:n.available,...t})]})}var mBr=x(_(),1);function hBr({session:e,sessions:t,lifecycle:r}){let n=wme(t).find(o=>o.session.id===e.id)?.children??[];return(0,mBr.jsx)(pBr,{session:e,...r$(e,r),childDismiss:Lme(e,n,r.onDismiss),onSetAutoApprove:o=>r.onSetAutoApprove(e.id,o),onSetAutoAdvance:o=>r.onSetAutoAdvance(e.id,o)},e.id)}var mlt=x(_(),1),U8o={flexShrink:0};function gBr({session:e,sessions:t,lifecycle:r}){return e===void 0?null:(0,mlt.jsx)(H,{"data-testid":"session-top-bar",sx:U8o,children:(0,mlt.jsx)(hBr,{session:e,sessions:t,lifecycle:r})})}var A4e=x(_(),1),yBr={minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden",bgcolor:"background.paper",borderColor:"divider"},W8o={...yBr,width:"50%",borderLeft:1},V8o={...yBr,width:"100%"};function vBr({sessionId:e,panel:t,sessions:r,sendInput:n}){let{closePanel:o,setPanelScope:i,togglePanelMode:a}=fb();return(0,A4e.jsx)(H,{sx:t.mode==="full"?V8o:W8o,children:(0,A4e.jsx)(Tc.Provider,{value:t.node,children:(0,A4e.jsx)(E_e,{cwd:t.cwd,ownerSessionId:e,conversation:t.conversation,scope:t.scope,onScopeChange:s=>i(e,s),sessions:r,sendInput:n,mode:t.mode,onToggleMode:()=>a(e),onClose:()=>o(e),scrollRegionProps:{"data-diff-session-id":e,tabIndex:-1}})})})}var aae=x(_(),1),G8o={display:"flex",flex:1,minHeight:0,overflow:"hidden"};function bBr({sessionId:e,sessions:t,sendInput:r,children:n}){let o=fb().panelFor(e);return(0,aae.jsxs)(H,{sx:G8o,children:[(0,aae.jsx)(H,{sx:{display:o?.mode==="full"?"none":"flex",width:o?"50%":"100%",minWidth:0},children:n}),o&&e!==null&&(0,aae.jsx)(vBr,{sessionId:e,panel:o,sessions:t,sendInput:r},e)]})}var B9r=x(re(),1);var Z$r=x(re(),1);var MC=x(_(),1),q8o={position:"absolute",inset:0,display:"flex",flexDirection:"column",gap:1.5,alignItems:"center",justifyContent:"center"};function xBr({loading:e}){return(0,MC.jsx)(H,{sx:q8o,children:e?(0,MC.jsxs)(MC.Fragment,{children:[(0,MC.jsx)(ao,{size:20}),(0,MC.jsx)(be,{variant:"caption",color:"text.disabled",children:"Loading transcript\u2026"})]}):(0,MC.jsx)(be,{variant:"body2",color:"text.disabled",children:"No transcript available"})})}var SBr=e=>e.tokens.color.wash.shell,Oi={chip:{flex:"none",alignSelf:"center",display:"inline-flex",alignItems:"center",mr:1,px:.75,border:1,borderColor:"secondary.main",borderRadius:e=>`${e.tokens.radius.sm}px`,color:"secondary.main",fontFamily:"fontFamilyMono",fontSize:11.5,fontWeight:600,lineHeight:1.6},field:{borderColor:"secondary.main",bgcolor:SBr,"&.Mui-focused":{borderColor:"secondary.main"},"& textarea":{fontFamily:"fontFamilyMono",fontSize:"0.95em"}},run:{bgcolor:"secondary.main",color:"secondary.contrastText","&:hover":{bgcolor:"secondary.main"}},attached:{color:"secondary.main"},row:{display:"grid",gap:.75,minWidth:0,mb:1.5,pl:1.5,py:1,pr:1,borderLeft:2,borderColor:"secondary.main",borderTopRightRadius:1,borderBottomRightRadius:1,bgcolor:SBr},header:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontFamily:"fontFamilyMono",fontSize:13,fontWeight:500},bang:{color:"secondary.main",fontWeight:600},command:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},output:{m:0,maxHeight:"11em",overflow:"auto",fontFamily:"fontFamilyMono",fontSize:12,lineHeight:1.55,color:"text.secondary",bgcolor:e=>e.tokens.color.well,border:1,borderColor:e=>e.tokens.color.lineSoft,borderRadius:e=>`${e.tokens.radius.sm}px`,px:1,py:.75,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},stderr:{color:"error.main"},link:{color:"primary.main","&:focus-visible":{outline:2,outlineColor:"primary.main"}},meta:{display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:1.25,rowGap:.5,fontSize:12,color:"text.secondary"},ok:{color:"success.main",fontFamily:"fontFamilyMono"},bad:{color:"error.main",fontFamily:"fontFamilyMono"},stop:{ml:"auto",py:0,minWidth:0},discard:{flex:"none",p:.25,color:"text.secondary",borderRadius:e=>`${e.tokens.radius.sm}px`,"&:hover":{color:"text.primary"}}};function j8o(e){return e.length<20||/\s$/.test(e)?!1:/^\S+$/.test(e)||/:\/\/\S*$/.test(e)}function TBr(e,t){return j8o(e)&&/^\S/.test(t)&&!/^https?:\/\//i.test(t)}function Y8o(e,t){return t.length===e.length&&/^\S+$/.test(t)}function K8o(e,t){return e!==void 0&&e.length===t.length&&TBr(e,t)}function wBr(e,t,r){return TBr(t,r)?Y8o(t,r)||K8o(e,t):!1}function CBr(e,t){let r=e(t),n=e(t+1);return!!r&&!!n&&(n.isWrapped||r.isFull)}function X8o(e,t){let r=[];for(let n=t;n-t<64;n++){let o=e(n);if(!o||(r.push(o.text),!CBr(e,n)))break}return r}function kBr(e,t){return{start:t,texts:X8o(e,t)}}function _Br(e,t){let r=t;for(;r>0&&CBr(e,r-1);)r--;return kBr(e,r)}function Z8o(e,t){if(!(t.start===0||!e(t.start-1)))return _Br(e,t.start-1)}function Q8o(e,t){let r=t.start+t.texts.length;return e(r)?kBr(e,r):void 0}function EBr(e){return{endingAt:t=>_Br(e,t),before:t=>Z8o(e,t),after:t=>Q8o(e,t)}}function PBr(e,t,r){let n=e.before(t);return wBr(n?.texts.join(""),t.texts.join(""),r.texts.join(""))}function J8o(e,t){let r=[t],n=e.before(t);for(;n&&r.length<64&&PBr(e,n,r[0]);)r.unshift(n),n=e.before(n);let o=e.after(t);for(;o&&r.length<64&&PBr(e,r[r.length-1],o);)r.push(o),o=e.after(o);return r}function ABr(e,t){let r=EBr(e),n=J8o(r,r.endingAt(t));return{start:n[0]?.start??t,texts:n.flatMap(o=>o.texts)}}var sae=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\^<>`]*[^\s"':,.!?{}|\\^~[\]`()<>]/;function eOo(e){try{return!!new URL(e).host}catch{return!1}}function LBr(e,t,r){let n=t;for(let o of e){if(r<o.length)return{x:r+1,y:n+1};r-=o.length,n++}}function tOo(e,t,r){let n=r[0],o=LBr(e,t,r.index),i=LBr(e,t,r.index+n.length-1);if(!(!eOo(n)||!o||!i))return{text:n,range:{start:o,end:i}}}function rOo(e,t,r){let n=new RegExp(r.source,`${r.flags||""}g`);return[...e.join("").matchAll(n)].flatMap(i=>tOo(e,t,i)??[])}function IBr(e,t,r=sae){if(!e(t-1))return[];let{start:n,texts:o}=ABr(e,t-1);return rOo(o,n,r)}function DBr(e){let t=[],r=0;for(let n of e.matchAll(new RegExp(sae.source,"g")))n.index>r&&t.push({kind:"text",text:e.slice(r,n.index)}),t.push({kind:"url",text:n[0]}),r=n.index+n[0].length;return r<e.length&&t.push({kind:"text",text:e.slice(r)}),t}var lae=x(_(),1);function nOo(e){let t=[];for(let r of e){let n=t.at(-1);n?.stream===r.stream?n.text+=r.text:t.push({...r})}return t}function oOo({text:e}){return DBr(e).map((t,r)=>t.kind==="url"?(0,lae.jsx)(Ur,{href:t.text,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:Oi.link,children:t.text},r):t.text)}function MBr({output:e}){let t=nOo(e.filter(r=>r.text));return t.length?(0,lae.jsx)(H,{component:"pre",sx:Oi.output,children:t.map((r,n)=>(0,lae.jsx)(H,{component:"span",sx:r.stream==="stderr"?Oi.stderr:void 0,children:(0,lae.jsx)(oOo,{text:r.text})},`${n}:${r.stream}`))}):null}function Rq(e){let t=Math.max(0,Math.floor(e));if(t<60)return`${t}s`;let r=Math.floor(t/60);return r<60?`${r}m ${t%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function NBr(e){return e<1e4?`${(e/1e3).toFixed(1)}s`:Rq(e/1e3)}var pS=x(_(),1);function OBr({sent:e,exitCode:t,stopped:r,durationMs:n}){return(0,pS.jsxs)(pS.Fragment,{children:[r?(0,pS.jsx)(H,{component:"span",sx:Oi.bad,children:"stopped"}):t!==void 0&&(0,pS.jsxs)(H,{component:"span",sx:t===0?Oi.ok:Oi.bad,children:["exit ",t]}),n!==void 0&&(0,pS.jsx)("span",{children:NBr(n)}),e?(0,pS.jsx)("span",{children:"Sent with your message"}):(0,pS.jsx)(H,{component:"span",sx:Oi.attached,children:"Attached to your next message"})]})}var BBr=x(_(),1),Pq=ot((0,BBr.jsx)("path",{d:"M8 6h8c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2"}),"StopRounded");var glt=x(_(),1);function $Br({onStop:e}){return(0,glt.jsx)(tt,{size:"small",color:"error",startIcon:(0,glt.jsx)(Pq,{fontSize:"small"}),"aria-label":"Stop command",title:"Stop command (Esc)",sx:Oi.stop,onClick:e,children:"Stop"})}var FBr=x(_(),1),zBr=ot((0,FBr.jsx)("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded");var ylt=x(_(),1);function HBr({command:e,onDiscard:t}){return(0,ylt.jsx)(Mt,{size:"small","aria-label":`Discard result of ${e}`,title:"Discard \u2014 don't send with your message",sx:Oi.discard,onClick:t,children:(0,ylt.jsx)(zBr,{fontSize:"small"})})}var cae=x(re(),1);function L4e(e){let[t,r]=(0,cae.useState)(),[n,o]=(0,cae.useState)(()=>Date.now());if((0,cae.useEffect)(()=>{if(e===void 0)return;let i=Date.now();r({seconds:e,at:i}),o(i);let a=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(a)},[e]),e!==void 0)return t?.seconds!==e?e:e+Math.max(0,Math.floor((n-t.at)/1e3))}var WBr=x(_(),1);function UBr({startedAt:e}){let t=L4e(Math.floor((Date.now()-e)/1e3));return(0,WBr.jsxs)("span",{children:["Running \xB7 ",Rq(t??0)]})}var hp=x(_(),1);function I4e(e){let{command:t,output:r,status:n,startedAt:o}=e;return(0,hp.jsxs)(H,{sx:[Oi.row,n==="held"&&{borderLeftStyle:"dashed"}],children:[(0,hp.jsxs)(H,{sx:Oi.header,children:[(0,hp.jsx)(H,{component:"span",sx:Oi.bang,children:"!"}),(0,hp.jsx)(H,{component:"span",sx:Oi.command,title:t,children:t}),n==="held"&&e.onDiscard&&(0,hp.jsx)(HBr,{command:t,onDiscard:e.onDiscard})]}),(0,hp.jsx)(MBr,{output:r}),(0,hp.jsx)(H,{sx:Oi.meta,children:n==="running"?(0,hp.jsxs)(hp.Fragment,{children:[(0,hp.jsx)(UBr,{startedAt:o??Date.now()}),e.onStop&&(0,hp.jsx)($Br,{onStop:e.onStop})]}):(0,hp.jsx)(OBr,{sent:n==="sent",exitCode:e.exitCode,stopped:e.stopped,durationMs:e.durationMs})})]})}var VBr=x(_(),1);function D4e({command:e,stdout:t,stderr:r}){return(0,VBr.jsx)(I4e,{command:e,output:[{stream:"stdout",text:t},{stream:"stderr",text:r}],status:"sent"})}var GBr=x(_(),1),M4e=ot((0,GBr.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");var NC=x(_(),1),vlt="queued-row-actions",iOo={ml:"auto",display:"inline-flex",gap:.25,"& .MuiIconButton-root[data-action='remove']:hover":{color:"error.main"}};function qBr({onEdit:e,onRemove:t}){return(0,NC.jsxs)(H,{component:"span",className:vlt,sx:iOo,children:[e&&(0,NC.jsx)(lr,{title:"Edit",children:(0,NC.jsx)(Mt,{size:"small","aria-label":"Edit queued message",onClick:e,children:(0,NC.jsx)(M4e,{})})}),(0,NC.jsx)(lr,{title:"Remove",children:(0,NC.jsx)(Mt,{size:"small","data-action":"remove","aria-label":"Remove queued message",onClick:t,children:(0,NC.jsx)(Eo,{})})})]})}var jBr=x(re(),1);var aOo=/(^|\s)(\/[^\s/]+)(?=\s|$)/g,sOo=/[.,;:!?)]+$/;function Aq(e,t){let r=new Set(t.map(i=>i.name.toLowerCase())),n=[],o=0;if(r.size>0)for(let i of e.matchAll(aOo)){let a=i[2].replace(sOo,"");if(!r.has(a.slice(1).toLowerCase()))continue;let s=i.index+i[1].length;s>o&&n.push({text:e.slice(o,s),start:o,command:!1}),n.push({text:a,start:s,command:!0}),o=s+a.length}return(o<e.length||n.length===0)&&n.push({text:e.slice(o),start:o,command:!1}),n}var blt=x(_(),1);function N4e({text:e,commands:t,commandSx:r,renderText:n=o=>o}){return Aq(e,t).map(o=>o.command?(0,blt.jsx)(H,{component:"span",sx:r,children:n(o.text)},o.start):(0,blt.jsx)(jBr.Fragment,{children:n(o.text)},o.start))}var xlt=e=>e.tokens.color.selected,Lq={inline:{color:"primary.main",bgcolor:xlt,borderRadius:.5,boxShadow:e=>`0 0 0 2px ${xlt(e)}`},chip:{fontFamily:"fontFamilyMono",fontSize:"0.93em",color:"primary.main",bgcolor:xlt,border:1,borderColor:e=>Ar(e.palette.primary.main,.32),borderRadius:.5,px:.75,py:"1px"}};var XBr=x(re(),1);var O4e=e=>({...o9(e),fontSize:e.typography.body2.fontSize??"inherit",maxWidth:"none",lineHeight:1.6,color:"text.primary",overflowWrap:"anywhere","& .slash-chip":Lq.chip});var Slt=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),lOo=(e,t)=>Aq(e,t).map(r=>r.command?`<span class="slash-chip">${Slt(r.text)}</span>`:Slt(r.text)).join("");function YBr(e,t){return new VD({breaks:t,renderer:{html(r){return Slt(r.text)},text(r){return"tokens"in r&&r.tokens||e.length===0||"escaped"in r&&r.escaped?!1:lOo(r.text,e)}}})}var cOo=YBr([],!1);function KBr(e,t){return(t?YBr(t.commands,!0):cOo).parse(e)}var QBr=x(_(),1);function ZBr({text:e,commands:t}){let r=(0,XBr.useMemo)(()=>KBr(e,t&&{commands:t}),[e,t]);return(0,QBr.jsx)(Zs,{className:"markdown",sx:O4e,html:r})}var e$r=x(re(),1);function JBr(e,t){if(!t)return[{text:e,start:0,match:!1}];let r=e.toLowerCase(),n=t.toLowerCase(),o=[],i=(s,l,u)=>o.push({text:e.slice(s,l),start:s,match:u}),a=0;for(let s=r.indexOf(n);s!==-1;s=r.indexOf(n,a))s>a&&i(a,s,!1),i(s,s+n.length,!0),a=s+n.length;return a<e.length&&i(a,e.length,!1),o}var Tlt=x(_(),1);function t$r({text:e,term:t}){return JBr(e,t).map(r=>r.match?(0,Tlt.jsx)(lme,{children:r.text},r.start):(0,Tlt.jsx)(e$r.Fragment,{children:r.text},r.start))}var uae=x(_(),1),uOo={color:"text.primary",whiteSpace:"pre-wrap",overflowWrap:"anywhere",lineHeight:1.6};function r$r({isUser:e,text:t,term:r}){let n=T8r();return r?(0,uae.jsx)(be,{variant:"body2",sx:uOo,children:(0,uae.jsx)(N4e,{text:t,commands:e?n:[],commandSx:Lq.chip,renderText:o=>(0,uae.jsx)(t$r,{text:o,term:r})})}):(0,uae.jsx)(ZBr,{text:t,commands:e?n:void 0})}var dae=x(_(),1);function n$r({isUser:e,accent:t,queued:r,actions:n}){return(0,dae.jsxs)(be,{variant:"caption",component:"div",sx:{color:t,fontWeight:600,display:"flex",alignItems:"center",mb:.5},children:[(0,dae.jsxs)(H,{component:"span",sx:{opacity:r?.65:1},children:[e?"User":"Assistant",r&&(0,dae.jsx)(H,{component:"span",sx:{fontWeight:500,color:"text.secondary",ml:.75},children:"queued"})]}),n]})}var Iq=x(_(),1),B4e=`.${vlt}`,dOo={[`& ${B4e}`]:{opacity:0,transition:"opacity 120ms"},[`&:hover ${B4e}, &:focus-within ${B4e}`]:{opacity:1},"@media (hover: none)":{[`& ${B4e}`]:{opacity:1}}};function _M({role:e,text:t,term:r,queued:n,actions:o}){let i=e==="user",a=i?"info.main":"success.main";return(0,Iq.jsxs)(H,{sx:{mb:1.5,pl:1.5,py:1,pr:1,borderLeft:2,borderLeftStyle:n?"dashed":"solid",borderColor:a,borderTopRightRadius:1,borderBottomRightRadius:1,bgcolor:i?"action.hover":"transparent",...dOo},children:[(0,Iq.jsx)(n$r,{isUser:i,accent:a,queued:n,actions:o}),(0,Iq.jsx)(H,{sx:{opacity:n?.65:1},children:(0,Iq.jsx)(r$r,{isUser:i,text:t,term:r})})]})}var o$r=x(_(),1),$4e=ot((0,o$r.jsx)("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build");var EM=x(_(),1);function i$r({tool:e,target:t}){return(0,EM.jsxs)(H,{sx:{display:"flex",alignItems:"center",gap:1,py:.5,pl:1},children:[(0,EM.jsx)($4e,{sx:{fontSize:14,color:"text.disabled"}}),(0,EM.jsxs)(be,{variant:"caption",sx:{color:"text.secondary",fontFamily:"fontFamilyMono"},children:[(0,EM.jsx)(H,{component:"span",sx:{color:"warning.main"},children:e}),t&&(0,EM.jsxs)(H,{component:"span",children:[" ",t]})]})]})}function a$r(e){return e===0?"Daemon restarted":`Daemon restarted \xB7 ${e} background ${e===1?"task":"tasks"} killed`}var l$r=x(_(),1),s$r={content:'""',flex:1,height:"1px",bgcolor:"divider"};function fae({label:e}){return(0,l$r.jsx)(H,{role:"separator",sx:{display:"flex",alignItems:"center",gap:1.25,mt:.75,mb:1.75,fontSize:12,color:"text.secondary","&::before":s$r,"&::after":s$r},children:e})}var Dq=x(_(),1);function c$r({message:e,term:t,actions:r}){return e.role==="interrupt"?(0,Dq.jsx)(fae,{label:"Interrupted by you"}):e.role==="restart"?(0,Dq.jsx)(fae,{label:a$r(e.killed)}):e.role==="shell"?(0,Dq.jsx)(D4e,{...e}):e.role==="tool"?(0,Dq.jsx)(i$r,{tool:e.tool,target:e.target}):(0,Dq.jsx)(_M,{role:e.role,text:e.text,term:t,actions:r})}var Mq=x(re(),1),fOo=40;function u$r(e,t,r){let n=(0,Mq.useRef)(null),o=(0,Mq.useRef)(!0);return(0,Mq.useEffect)(()=>{let i=n.current;if(!i||!r)return;let a=()=>{o.current=i.scrollHeight-i.scrollTop-i.clientHeight<=fOo};return i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}),(0,Mq.useEffect)(()=>{if(r&&n.current){o.current&&(n.current.scrollTop=n.current.scrollHeight);return}t&&e.length>0&&n.current?.querySelector("mark")?.scrollIntoView({block:"center"})},[e,t,r]),n}function pOo(e){return e.role==="tool"?`tool:${e.tool}:${e.target}`:e.role==="interrupt"?"interrupt":e.role==="restart"?"restart":e.role==="shell"?`shell:${e.command.slice(0,40)}`:`${e.role}:${e.text.slice(0,40)}`}function hOo(e){let t=new Map;return e.map(r=>{let n=pOo(r),o=t.get(n)??0;return t.set(n,o+1),{...r,key:`${n}#${o}`}})}function d$r(e){let t=[];for(let r of hOo(e)){if(r.role!=="tool"){t.push({kind:"message",message:r});continue}let n=t.at(-1);n?.kind==="tools"?n.calls.push(r):t.push({kind:"tools",key:`run:${r.key}`,calls:[r]})}return t}function hS(e){return/^https?:\/\/\S+$/.test(e.trim())}function f$r(e,t){if(t)return t;let r=e.find(n=>n.name==="url")?.value.trim();return r&&hS(r)?r:void 0}function p$r(e){return e.split(/[\\/]/).pop()||e}var mOo=new Set(["assist","cargo","docker","dotnet","gh","git","go","npm","npx","pnpm","yarn"]),gOo=/'[^']*'|"(?:\\.|[^"\\])*"/g,yOo=/&&|\|\||[;|()`]|\$\(/,vOo=/^\w+=/;function bOo(e){let t=e.trim().split(/\s+/).filter(i=>i&&!vOo.test(i)),[r,n]=t;if(!r||r==="cd"||r.startsWith("-"))return null;let o=r.split("/").pop()||r;return mOo.has(o)&&n&&!n.startsWith("-")?`${o} ${n}`:o}function h$r(e){let r=e.split(`
|
|
3950
3950
|
`)[0].replace(gOo,"''").split(yOo).map(bOo).filter(n=>n!==null);return[...new Set(r)].join(", ")}var m$r=40,xOo=new Set(["Edit","MultiEdit","Write","NotebookEdit","apply_patch"]),SOo=new Set(["Bash","exec_command","shell","local_shell"]);function g$r(e){let t=e.target.trim();if(e.description)return e.description;if(hS(t))return t;if(t&&(e.tool==="Read"||xOo.has(e.tool)))return e.tool==="apply_patch"?t:p$r(t);if(SOo.has(e.tool))return h$r(t);let r=t.split(`
|
|
3951
3951
|
`)[0];return r.length>m$r||r!==t?`${r.slice(0,m$r)}\u2026`:r}var C$r=x(re(),1);var y$r=x(_(),1),v$r=ot((0,y$r.jsx)("path",{d:"m16.66 4.52 2.83 2.83-2.83 2.83-2.83-2.83zM9 5v4H5V5zm10 10v4h-4v-4zM9 15v4H5v-4zm7.66-13.31L11 7.34 16.66 13l5.66-5.66zM11 3H3v8h8zm10 10h-8v8h8zm-10 0H3v8h8z"}),"WidgetsOutlined");var i3=x(_(),1),b$r={fontSize:14,color:"text.disabled",flex:"none"};function F4e({tool:e}){return(0,i3.jsxs)(i3.Fragment,{children:[e==="Artifact"?(0,i3.jsx)(v$r,{"data-testid":"artifact-icon",sx:b$r}):(0,i3.jsx)($4e,{sx:b$r}),(0,i3.jsx)(H,{component:"span",sx:{color:"warning.main",fontFamily:"fontFamilyMono"},children:e})]})}var z4e={display:"flex",alignItems:"center",gap:1,width:"100%",justifyContent:"flex-start",py:.5,pl:1,minWidth:0,borderRadius:1,typography:"caption",color:"text.secondary",textAlign:"left","&:hover":{bgcolor:"action.hover"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main"}};var x$r=x(_(),1);function a3({url:e,children:t}){return(0,x$r.jsx)(Ur,{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),sx:{fontFamily:"fontFamilyMono",wordBreak:"break-all"},children:t??e})}var RM=x(_(),1);function S$r({fields:e}){return(0,RM.jsx)(H,{component:"dl",sx:{m:0,ml:4,mb:.5,display:"grid",gridTemplateColumns:"max-content minmax(0, 1fr)",columnGap:1,typography:"caption",fontFamily:"fontFamilyMono",color:"text.secondary"},children:e.map(({name:t,value:r})=>(0,RM.jsxs)(H,{sx:{display:"contents"},children:[(0,RM.jsx)(H,{component:"dt",children:t}),(0,RM.jsx)(H,{component:"dd",sx:{m:0,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:hS(r)?(0,RM.jsx)(a3,{url:r.trim()}):r})]},t))})}var wlt=x(_(),1);function T$r({target:e}){return(0,wlt.jsx)(H,{component:"pre",sx:{m:0,ml:4,mb:.5,typography:"caption",fontFamily:"fontFamilyMono",color:"text.secondary",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:hS(e)?(0,wlt.jsx)(a3,{url:e.trim()}):e})}var Clt=x(_(),1);function w$r({url:e}){return(0,Clt.jsx)(H,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,Clt.jsx)(a3,{url:e,children:e.replace(/^https?:\/\//,"")})})}var OC=x(_(),1);function k$r({tool:e,target:t,description:r,label:n,fields:o,link:i}){let[a,s]=(0,C$r.useState)(!1);return(0,OC.jsxs)(H,{children:[(0,OC.jsxs)(Ht,{component:i?"div":"button","data-preview-skip":!0,"aria-expanded":a,disabled:!t&&!o?.length,onClick:()=>s(l=>!l),sx:z4e,children:[(0,OC.jsx)(F4e,{tool:e}),(0,OC.jsx)(H,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:r?void 0:"fontFamilyMono"},children:n}),i&&(0,OC.jsx)(w$r,{url:i})]}),a&&(o?.length?(0,OC.jsx)(S$r,{fields:o}):(0,OC.jsx)(T$r,{target:t}))]})}var Nq=x(_(),1);function _$r({tool:e,url:t}){return(0,Nq.jsxs)(H,{"data-preview-skip":!0,sx:{...z4e,"&:hover":void 0},children:[(0,Nq.jsx)(F4e,{tool:e}),(0,Nq.jsx)(H,{component:"span",sx:{minWidth:0},children:(0,Nq.jsx)(a3,{url:t})})]})}var klt=x(_(),1);function E$r({tool:e,target:t,description:r,label:n,fields:o,resultUrl:i}){return!r&&!o&&hS(t)?(0,klt.jsx)(_$r,{tool:e,url:t.trim()}):(0,klt.jsx)(k$r,{tool:e,target:t,description:r,label:n??g$r({tool:e,target:t,description:r}),fields:o&&i?[...o,{name:"result",value:i}]:o,link:o&&f$r(o,i)})}var _lt=x(_(),1);function R$r({calls:e}){return(0,_lt.jsx)(H,{sx:{mb:1},children:e.map(t=>(0,_lt.jsx)(E$r,{tool:t.tool,target:t.target,description:t.description,label:t.label,fields:t.fields,resultUrl:t.resultUrl},t.key))})}var L$r=x(re(),1);var H4e=x(_(),1),P$r="Too verbose: say it again, shorter";function A$r({onClick:e}){return(0,H4e.jsx)(lr,{title:P$r,children:(0,H4e.jsx)(Mt,{size:"small","data-preview-skip":!0,"aria-label":P$r,onClick:e,sx:{ml:"auto"},children:(0,H4e.jsx)(H,{component:"span","aria-hidden":!0,sx:t=>({fontSize:t.tokens.density.iconButton.smallIcon,lineHeight:1}),children:"\u{1F644}"})})})}var D$r=x(_(),1);function I$r(e,t){let[r,n]=(0,L$r.useState)(null),o=e.at(-1),i=o?.kind==="message"&&o.message.role==="assistant"?o.message.key:null;return a=>{if(!(!t||a!==i||a===r))return(0,D$r.jsx)(A$r,{onClick:()=>{n(a),t()}})}}var mS=x(_(),1);function M$r({messages:e,loading:t,term:r,tail:n,follow:o,commentLayer:i=s=>s,onTooVerbose:a}){let s=u$r(e,r,o),l=d$r(e),u=I$r(l,a);return t||e.length===0&&!n?(0,mS.jsx)(xBr,{loading:t}):(0,mS.jsx)(H,{ref:s,sx:{position:"absolute",inset:0,overflowY:"auto",p:2},children:(0,mS.jsx)(H,{sx:{maxWidth:820,mx:"auto"},children:i((0,mS.jsxs)(mS.Fragment,{children:[l.map(d=>d.kind==="tools"?(0,mS.jsx)(R$r,{calls:d.calls},d.key):(0,mS.jsx)(c$r,{message:d.message,term:r,actions:u(d.message.key)},d.message.key)),n]}))})})}var Elt=x(_(),1);function Oq({sessionId:e,transcript:t,tail:r,follow:n,commentLayer:o,onTooVerbose:i}){let a=jRt(),s=t?.sessionId===e;return(0,Elt.jsx)(H,{sx:{flex:1,position:"relative",bgcolor:"background.default"},children:(0,Elt.jsx)(M$r,{messages:s?t?.messages??[]:[],loading:!s,term:a,tail:r,follow:n,commentLayer:o,onTooVerbose:i})})}var TOo=new Set(["done","stopped","error"]);function wOo(e,t,r){return e?t?"Resuming conversation\u2026":r?"Message Claude\u2026 (queues until this turn ends)":"Message Claude\u2026":"This session has ended"}function Bq(e){let t=e.status==="running",r=!TOo.has(e.status),n=r&&!!e.sdkResuming,o=e.status==="waiting"&&!n;return{running:t,live:r,resuming:n,enabled:r&&!n,stopping:t&&!!e.sdkInterrupting,placeholder:wOo(r,n,t),suggestion:o?e.sdkPromptSuggestion:void 0}}var COo=/<bash-input>([\s\S]*?)<\/bash-input>\s*(?:<bash-stdout>([\s\S]*?)<\/bash-stdout>)?\s*(?:<bash-stderr>([\s\S]*?)<\/bash-stderr>)?/g;function U4e(e){let t=[],r=e.replace(COo,(n,o,i,a)=>i===void 0&&a===void 0?n:(t.push({command:String(o).trim(),stdout:i??"",stderr:a??""}),""));return t.length?{shells:t,text:r.trim()}:null}var kOo=/^\s*<assist-restart killed="(\d+)">[\s\S]*<\/assist-restart>\s*$/;function N$r(e){if(typeof e!="string")return null;let t=kOo.exec(e);return t?Number(t[1]):null}function _Oo(e){let t=[],r=!1;for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.role==="user"&&o.text!==void 0)t.push(o.sent??o.text);else if(o.role==="restart")r=!0;else if(o.role==="assistant"&&(t.length||r))break}return{texts:t,restart:r}}var O$r=e=>e.replace(/\s+/g," ").trim(),EOo=e=>U4e(e)?.text??e;function B$r(e,t){if(!e?.length)return[];let r=_Oo(t),n=r.texts.map(O$r);return e.filter(o=>N$r(o)===null?!n.some(i=>i.includes(O$r(EOo(o)))):!r.restart)}var BC=x(_(),1);function ROo({text:e}){let t=U4e(e);return t?(0,BC.jsxs)(BC.Fragment,{children:[t.shells.map((r,n)=>(0,BC.jsx)(D4e,{...r},`${n}:${r.command}`)),t.text&&(0,BC.jsx)(_M,{role:"user",text:t.text,term:""})]}):(0,BC.jsx)(_M,{role:"user",text:e,term:""})}function $$r({session:e,transcript:t}){return B$r(e.sdkPending,t?.sessionId===e.id?t.messages:[]).map((n,o)=>(0,BC.jsx)(ROo,{text:n},`${o}:${n}`))}var $C=x(_(),1),PM=" \xB7 ";function Rlt({text:e,rate:t,idle:r}){return(0,$C.jsxs)($C.Fragment,{children:[PM,(0,$C.jsx)(H,{component:"span",sx:{fontFamily:"fontFamilyMono"},children:e}),t&&`${PM}${t}`,r&&(0,$C.jsxs)($C.Fragment,{children:[PM,(0,$C.jsx)(H,{component:"span",sx:{color:"warning.main"},children:r})]})]})}var $q=x(_(),1),POo=xo`
|
|
3952
3952
|
0%, 80%, 100% { opacity: 0.25; }
|
|
@@ -4146,7 +4146,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4146
4146
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4147
4147
|
${r}`}return t}function cZr(e){return lZr(e??"").filter(t=>t.startsWith("@@"))}function UYo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function WYo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4148
4148
|
`)[0]??""}function uZr(e,t){return e.reduce((r,n)=>r+sZr(n,t),0)}function dZr(e,t,r){let n=cZr(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:UYo(a),header:WYo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4149
|
-
`),additions:uZr(o,"+"),deletions:uZr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fZr(e){return e.flatMap(t=>{if(t.kind==="dir")return fZr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function VYo(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 pZr(e,t,r=new Set,n=new Set){let o=fZr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=VYo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(rY));return aZr(o.filter(u=>l.has(u.path)).map(u=>dZr(u,s+1,i)))})}function GYo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>rY(s)===e).length;a>n&&(r=i,n=a)}),r}function hZr(e,t){let r=t.map(()=>[]);for(let n of e)r[GYo(n.path,t)]?.push(n);return r}function mZr(e,t){let r=pZr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hZr(e.tests,t),o=$Pe(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 gZr(e){if(!e.slices)return;let t=mZr(e,e.slices);return{entries:QXr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yZr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var Ugt="assist:high-level-progress:",qYo=`${Ugt}head:`,jYo=720*60*60*1e3,xle=e=>`${Ugt}${e}`,Wgt=e=>`${qYo}${e}`,Hgt=e=>fl(e)[0];function YYo(e,t){let r=e?Hgt(xle(e)):void 0;return e&&Vv(xle(e)),r??(t?Hgt(Wgt(t)):void 0)}function vZr(e,t,r){return Yx(Ugt,jYo),Hgt(xle(e))??YYo(t,r)}function bZr(e,t,r){Dl(xle(e),[r]),t&&Dl(Wgt(t),[r])}function xZr(e,t){Vv(xle(e)),t&&Vv(Wgt(t))}function SZr(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 RN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Vgt=e=>typeof e=="string"?e:"";function TZr(e){return{repo:Vgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Vgt(e.headSha),body:Vgt(e.body)}}var Ggt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wZr(e){let t;try{t=JSON.parse(e)}catch{return Ggt}return typeof t!="object"||t===null?Ggt:{...TZr(t),checks:RN(t.checks,SZr),structure:{...Ggt.structure,...t.structure},criticalDiffs:RN(t.criticalDiffs),criticalPaths:RN(t.criticalPaths),tests:RN(t.tests),testPaths:RN(t.testPaths),collapsedPaths:RN(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 CZr(e){let t=(0,lAe.useMemo)(()=>wZr(e.body),[e.body]),r=(0,lAe.useMemo)(()=>gZr(t),[t]),n=yZr(t),o=(0,lAe.useMemo)(()=>vZr(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 kZr=x(re(),1);function _Zr(e){let[t,r]=(0,kZr.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 EZr=x(re(),1);function RZr(e,t,r,n){(0,EZr.useEffect)(()=>{bZr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AZr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CZr(e),s=XXr(n.checks,i,o?.slicing),l=_Zr(i),u=zXr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Hj(t,r),h={...d,onQueue:l.onQueue};RZr(e.requestId,a,s.items,l.queued);let m=(0,PZr.useMemo)(()=>GXr(n),[n]);return{payload:n,checklist:s,queue:l,details:VXr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var OS=x(_(),1);function LZr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AZr(e,t,r);return(0,OS.jsxs)(H,{sx:s0,children:[(0,OS.jsx)(Nh,{preview:e,draft:!1}),(0,OS.jsx)(dY,{items:e.metadata??[]}),(0,OS.jsx)(qn,{}),(0,OS.jsx)(kXr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,OS.jsx)(qn,{}),(0,OS.jsx)($Xr,{pane:o,onDecision:(i,a)=>{xZr(e.requestId,o.head),n(i,a)}}),(0,OS.jsx)(ff,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FZr=x(re(),1);var PN=x(_(),1);function KYo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IZr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,PN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,PN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:KYo(e)}),(0,PN.jsx)(tt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,PN.jsx)(tt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,PN.jsx)(tt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var XYo={"top-left":ic.miro.topLeft,"bottom-right":ic.miro.bottomRight};function DZr(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?XYo[t]:ic.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var Sle=x(_(),1);function MZr({box:e,role:t,onSelect:r}){let n=DZr(e,t);return(0,Sle.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,Sle.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,Sle.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ic.miro.text,children:e.text})]})}function NZr(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 cAe=x(_(),1);function OZr({boxes:e,selection:t}){return(0,cAe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,cAe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NZr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,cAe.jsx)(MZr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function ZYo(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 BZr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(ZYo):[]}catch{return[]}}var qgt=x(re(),1);function $Zr(){let[e,t]=(0,qgt.useState)(null),[r,n]=(0,qgt.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 G3=x(_(),1);function zZr({preview:e,onDecision:t}){let r=(0,FZr.useMemo)(()=>BZr(e.body),[e.body]),n=$Zr();return(0,G3.jsxs)(H,{sx:s0,children:[(0,G3.jsx)(Nh,{preview:e,draft:!1}),(0,G3.jsx)(qn,{}),(0,G3.jsx)(OZr,{boxes:r,selection:n}),(0,G3.jsx)(qn,{}),(0,G3.jsx)(IZr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var yQr=x(re(),1);function HZr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function uAe(e){return e*22}function UZr(e){return Math.round(e/22)}var WZr={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}},VZr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GZr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qZr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},jgt={p:.25,mt:"2px"},jZr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KZr=x(_(),1),QYo=8;function YZr({drag:e}){return e?(0,KZr.jsx)(H,{sx:jZr,style:{top:e.top-1,left:QYo+uAe(e.depth)}}):null}var XZr=x(_(),1),ZZr=ot((0,XZr.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 Ygt=x(_(),1);function QZr({number:e,onGrip:t}){return(0,Ygt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VZr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,Ygt.jsx)(ZZr,{fontSize:"inherit"})})}var hk=x(_(),1);function JZr({number:e,onAdd:t,onDelete:r}){return(0,hk.jsxs)(hk.Fragment,{children:[(0,hk.jsx)(Mt,{size:"small",className:"criterion-action",sx:jgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,hk.jsx)(Yd,{fontSize:"inherit"})}),(0,hk.jsx)(Mt,{size:"small",className:"criterion-action",sx:jgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,hk.jsx)(Eo,{fontSize:"inherit"})})]})}var dAe=x(re(),1);function eQr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tQr(e){let t=(0,dAe.useRef)(null);return(0,dAe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eQr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var AN=x(_(),1);function rQr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tQr(n.focus?.index===e?n.focus:null),s={marginLeft:uAe(r.depth),opacity:o?.4:1};return(0,AN.jsxs)(H,{sx:WZr,"data-criterion-row":!0,style:s,children:[(0,AN.jsx)(QZr,{number:t,onGrip:i}),(0,AN.jsx)(H,{component:"span",sx:GZr,"aria-hidden":"true",children:`${t}.`}),(0,AN.jsx)(Hi,{multiline:!0,value:r.text,sx:qZr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,AN.jsx)(JZr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cQr=x(re(),1);function nQr(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 q3(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 fAe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:q3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function fg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function pAe(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 oQr(e,t){let r=fg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iQr(e,t,r){let n=r<0?pAe(e,t):oQr(e,t);if(n<0)return null;let o=fg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:fg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function hAe(e,t){let r=fg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:q3(n),index:Math.max(0,t-1)}}function aQr(e,t,r){if(r<0&&e[t].depth===0||r>0&&pAe(e,t)<0)return null;let n=fg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function mAe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function JYo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return mAe(fAe(e,t,o,n.slice(r)),"start")}function eKo(e,t,{shift:r,caret:n}){let o=aQr(e,t,r?-1:1);return mAe(o?{items:o,index:t}:null,n)}function sQr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?JYo(e,t,r):n==="Tab"?eKo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?mAe(iQr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?mAe(hAe(e,t),"end"):null}function lQr(e,t,r){return sQr(e,t,r)??nQr(e,t,r)}function uQr(e,t){let[r,n]=(0,cQr.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=lQr(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(fAe(e,a,e[a].text,""),"start"),onDelete:a=>o(hAe(e,a),"end")}}var mQr=x(re(),1);function tKo(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=fg(t,r);return o>r&&o<i?r:o}function rKo(e,t,r,n){let o=fg(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+UZr(n),s))}function nKo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dQr(e,t,r,n,o){let i=tKo(e,t,r,o);return{target:i,depth:rKo(t,r,i,n),top:nKo(e,i)}}function oKo(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 fQr(e,t,r,n){return o=>{let{boxes:i,origin:a}=oKo(t);return dQr(i,e,r,o.clientX-n,o.clientY-a)}}function pQr(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 hQr(e,t,r,n){let o=fg(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:q3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gQr(e,t,r){let[n,o]=(0,mQr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pQr(s.currentTarget,s.pointerId,fQr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hQr(e,a,d.target,d.depth))})(s)}}}var Tle=x(_(),1),iKo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},aKo=[{text:"",depth:0}];function vQr({items:e,onChange:t}){let r=(0,yQr.useRef)(null),n=e.length>0?e:aKo,o=uQr(n,t),{drag:i,onGrip:a}=gQr(n,r,o.onDrop),s=HZr(n.map(l=>l.depth));return(0,Tle.jsxs)(H,{sx:iKo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,Tle.jsx)(rQr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,Tle.jsx)(YZr,{drag:i})]})}var bQr=x(_(),1),xQr=ot((0,bQr.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 wle=x(_(),1),sKo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SQr({kind:e,onClick:t}){return(0,wle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,wle.jsx)(tt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,wle.jsx)(Yd,{}):(0,wle.jsx)(xQr,{}),onClick:t,children:sKo[e]})})}var Cle=x(re(),1);function TQr(e,t,{color:r,pin:n}){let o=H6(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=>lKo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function lKo(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 wQr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CQr(e,t){for(let r of t){let n=ZNt(e,r);n&&TQr(e,n,r)}}var kle=x(_(),1);function kQr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,Cle.useMemo)(()=>GD(e),[e]),a=(0,Cle.useMemo)(()=>GD(r??""),[r]);return(0,Cle.useLayoutEffect)(()=>{let s=o.current;s&&(wQr(s),CQr(s,n))},[i,a,n,o]),(0,kle.jsxs)(H,{ref:o,children:[(0,kle.jsx)(HD,{segments:i,skipDiagramText:!0}),t,t?(0,kle.jsx)(HD,{segments:a,skipDiagramText:!0}):null]})}var LN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function gAe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[LN("")]:{lineHeight:1.6},[LN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[LN("ul, ol")]:{pl:2.5,mb:2},[LN("li")]:{mb:"6px"},[LN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[LN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[LN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Qr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...o9(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...gAe(e)});var pY=x(_(),1);function EQr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,pY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Qr,children:[(0,pY.jsx)(kQr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,pY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,pY.jsx)(Y$,{rects:a,color:s})]})}function RQr(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 yAe=x(re(),1),PQr=x(_(),1);function Kgt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,yAe.useState)(t);return(0,yAe.useEffect)(()=>i(t),[t]),(0,PQr.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 _le=x(_(),1),Xgt="screenshot-groups";function cKo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AQr({screenshot:e,onUpdate:t}){return(0,_le.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,_le.jsx)(Kgt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||cKo(e.path)})}),(0,_le.jsx)(Kgt,{label:"Group",value:e.group??"",listId:Xgt,onCommit:r=>t(e.id,{group:r})})]})}var j3=x(_(),1),LQr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},uKo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IQr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,j3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,j3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LQr}):(0,j3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LQr}),(0,j3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:uKo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,j3.jsx)(Eo,{fontSize:"small"})}),(0,j3.jsx)(AQr,{screenshot:e,onUpdate:r})]})}var m0=x(_(),1);function dKo(){return(0,m0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,m0.jsx)(ao,{size:16}),(0,m0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function fKo({error:e}){return(0,m0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DQr({uploads:e,empty:t}){return e.length>0?(0,m0.jsx)(m0.Fragment,{children:e.map(r=>r.error?(0,m0.jsx)(fKo,{error:r.error},r.id):(0,m0.jsx)(dKo,{},r.id))}):t?(0,m0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var g0=x(_(),1),pKo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MQr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RQr(e),a=s=>(0,g0.jsx)(IQr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,g0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,g0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,g0.jsx)("datalist",{id:Xgt,children:o.map(([s])=>(0,g0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,g0.jsxs)(H,{sx:{mb:2},children:[(0,g0.jsx)(H,{component:"h3",children:s}),(0,g0.jsx)(H,{sx:pKo,children:l.map(a)})]},s)),(0,g0.jsxs)(St,{spacing:1,children:[i.map(a),(0,g0.jsx)(DQr,{uploads:t,empty:e.length===0})]})]})}var Ele=x(_(),1);function hKo(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,Ele.jsx)(vQr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,Ele.jsx)(SQr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function vAe({pane:e,screenshots:t}){return(0,Ele.jsx)(EQr,{...hKo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,Ele.jsx)(MQr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NQr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OQr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BQr=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}),$Qr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var mk=x(_(),1);function FQr({comments:e,colors:t,onRemove:r}){return(0,mk.jsxs)(H,{sx:NQr,children:[(0,mk.jsxs)(be,{sx:OQr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,mk.jsxs)(H,{sx:BQr,children:[(0,mk.jsx)(V$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,mk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,mk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Qr,children:(0,mk.jsx)(Eo,{})})]},n.id))]})}var HQr=x(_(),1);function zQr(e){return e.comments.length===0?null:(0,HQr.jsx)(FQr,{...e})}var UQr=x(_(),1),bAe=ot((0,UQr.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 YQr=x(re(),1);var WQr=x(_(),1),VQr=ot((0,WQr.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 y0="0.1201.1";var mKo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GQr(e){return e?mKo[e]:"success.main"}function qQr(e){return e.split("-")[0].split(".").map(Number)}function jQr(e,t){if(!e||!t||e===t)return;let r=qQr(e),n=qQr(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 xAe=x(re(),1),Zgt=(0,xAe.createContext)(null);function SAe(){return(0,xAe.useContext)(Zgt)}var IN=x(_(),1),gKo={height:16,fontSize:10},yKo={opacity:.6,fontSize:"0.85em"};function vKo(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 Y3({nodes:e,name:t,showVersion:r=!1}){let n=SAe()??y0,o=e.links.find(a=>a.name===t),i=jQr(o?.peerVersion,n);return(0,IN.jsx)(lr,{title:vKo(e,t),placement:"right",children:(0,IN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,IN.jsx)(VQr,{sx:{fontSize:8,color:GQr(o?.state)}}),t,r&&o?.peerVersion&&(0,IN.jsxs)(H,{component:"span",sx:yKo,children:["v",o.peerVersion]}),i&&(0,IN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:gKo})]})})}var v0=x(_(),1),bKo={textTransform:"none"};function TAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YQr.useState)(null);return(0,v0.jsxs)(v0.Fragment,{children:[(0,v0.jsx)(tt,{size:"small",color:"inherit",startIcon:(0,v0.jsx)(bAe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:bKo,children:(0,v0.jsx)(Y3,{nodes:e,name:r.node})}),(0,v0.jsx)(mi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,v0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,v0.jsx)(Vu,{primary:(0,v0.jsx)(Y3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KQr=x(re(),1);function xKo(e,t){return e?.toLowerCase()===t.toLowerCase()}function wAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KQr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>xKo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(S=>S.name===b&&S.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 K3=x(_(),1);function XQr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=gge(),a=wAe(r,t);return(0,K3.jsxs)(K3.Fragment,{children:[(0,K3.jsx)(tt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,K3.jsx)(TAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,K3.jsx)(tt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Qgt=x(_(),1),SKo={"& .MuiFormControlLabel-label":{fontSize:12}};function Rle({label:e,title:t,checked:r,onChange:n}){return(0,Qgt.jsx)(Bd,{control:(0,Qgt.jsx)(Mp,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:SKo})}var DN=x(_(),1);function CAe({chain:e,newPr:t,onChange:r}){return(0,DN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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 MN=x(_(),1);function ZQr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,MN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,MN.jsx)(CAe,{chain:t,newPr:r,onChange:i}),(0,MN.jsx)(tt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,MN.jsxs)(tt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,MN.jsx)(XQr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JQr=x(_(),1);function QQr({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,JQr.jsx)(ZQr,{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 gk=x(_(),1);function eJr(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,gk.jsxs)(gk.Fragment,{children:[(0,gk.jsx)(zQr,{comments:t,colors:r,onRemove:d}),(0,gk.jsx)(qn,{}),(0,gk.jsx)(QQr,{...e}),(0,gk.jsx)(Lye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var Ple=x(_(),1),TKo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},wKo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tJr({url:e}){return(0,Ple.jsxs)(H,{sx:TKo,children:[(0,Ple.jsx)(tt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,Ple.jsx)(be,{variant:"body2",sx:wKo,title:e,children:e})]})}var Jgt=x(_(),1);function rJr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Jgt.jsx)(tJr,{url:t}):(0,Jgt.jsx)(dY,{items:e.metadata??[]})}function nJr({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 hY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit"||t==="github-issue-comment",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oJr(e,t){return e?`${e}:${t??"pr"}`:void 0}function kAe(e,t,r,n){return{...hY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oJr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iJr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,b_e({quote:r,note:o})),n()}}function aJr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,jx(r,vye(o))),n()}}function _Ae(e,t,r,n){return{onCite:aJr(e,t,r,n),onAddRule:iJr(e,t,r,n)}}function sJr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gJr=x(re(),1);var yk=x(re(),1);var lJr="assist:pr-preview-comments:",eyt=e=>`${lJr}${e}`;function tyt(e){return fl(eyt(e))}function Ale(e,t){Dl(eyt(e),t)}function EAe(e){Vv(eyt(e))}function cJr(){Yx(lJr)}function uJr(e){let t=H6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function CKo(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 dJr(e,t){return e.flatMap(r=>{let n=CKo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fJr(e,t,r){let n=tyt(e);if(n.length>0||!t||!r)return n;let o=dJr(tyt(t),uJr(r));return Ale(e,o),EAe(t),o}function pJr(e,t,r){let[n,o]=(0,yk.useState)([]),i=(0,yk.useRef)(0);(0,yk.useEffect)(()=>{cJr(),o(fJr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,yk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return Ale(e,d),d})},[e]),s=(0,yk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return Ale(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hJr(e,t){let r=e.map((i,a)=>RG(a).solid),n=RG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:RG(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 mJr(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 yJr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=jy(),{comments:d,add:f,remove:p}=pJr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gJr.useMemo)(()=>hJr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mJr(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 PAe=x(re(),1);var ryt="assist:preview-screenshots:",nyt=e=>`${ryt}${e}`,RAe=e=>`${ryt}seeded:${e}`;function vJr(e){return e?(Yx(ryt),fl(nyt(e)).filter(t=>typeof t.path=="string")):[]}function NN(e,t){e&&Dl(nyt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bJr(e){e&&(Vv(nyt(e)),Vv(RAe(e)))}var ON=x(re(),1);var xJr={"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 kKo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xJr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SJr(e){return e.map(t=>({...t,contentType:kKo(t.path),seeded:!0}))}function TJr(e,t,r){if(!e)return SJr(r);let n=vJr(e);if(fl(RAe(e))[0]===t)return n;let o=[...SJr(r),...n.filter(i=>!i.seeded)];return NN(e,o),Dl(RAe(e),[t]),o}function wJr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),ov(`/api/pr-preview/image?${r}`)}function CJr(e,t,r){let[n,o]=(0,ON.useState)([]),i=(0,ON.useRef)(0),a=cr(),s=(0,ON.useRef)(r);return s.current=r,(0,ON.useEffect)(()=>{o(TJr(e,t,s.current).map(l=>({...l,url:wJr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kJr=x(re(),1);function _Jr(e,t){return(0,kJr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return NN(e,i),i})},[e,t])}function EJr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CJr(e,t,r),a=(0,PAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return NN(e,p),p})},[e,o,i]),s=(0,PAe.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 NN(e,h),h})},[e,o]),l=_Jr(e,o),u=(0,PAe.useCallback)(()=>bJr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var mY=x(re(),1);async function RJr(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 Wt(`/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 IJr=x(re(),1);function PJr(e){return e.startsWith("image/")||e.startsWith("video/")}function AJr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PJr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LJr(e){return e?Array.from(e.files).find(t=>PJr(t.type))??null:null}function DJr(e,t){return(0,IJr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AJr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LJr(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 MJr(e,t,r){let[n,o]=(0,mY.useState)([]),i=(0,mY.useRef)(0),a=cr(),s=(0,mY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RJr(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}=DJr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NJr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EJr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MJr(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 VJr=x(re(),1);var OJr="assist:pr-preview-chain:",oyt=e=>`${OJr}${e}`;function BJr(e){if(e)return fl(oyt(e))[0]}function $Jr(e,t){e&&Dl(oyt(e),[t])}function FJr(e){e&&Vv(oyt(e))}function zJr(){Yx(OJr)}function HJr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zJr();let n=BJr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UJr(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 WJr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GJr(e,t,r,n,o,i,a){let[s,l]=(0,VJr.useState)(()=>HJr(n,t,o));return{chain:s,setChain:f=>{l(f),$Jr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UJr(m,p,s,m?i.attachments():[],a()),...WJr(m,h)}),EAe(e),m&&(FJr(t),i.clearPersisted())}}}var ten=x(re(),1);var _Ko=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,EKo=/^ {0,3}#{1,6}[ \t]/;function X3(e){let t=e.split(`
|
|
4149
|
+
`),additions:uZr(o,"+"),deletions:uZr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function fZr(e){return e.flatMap(t=>{if(t.kind==="dir")return fZr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function VYo(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 pZr(e,t,r=new Set,n=new Set){let o=fZr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=VYo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(rY));return aZr(o.filter(u=>l.has(u.path)).map(u=>dZr(u,s+1,i)))})}function GYo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>rY(s)===e).length;a>n&&(r=i,n=a)}),r}function hZr(e,t){let r=t.map(()=>[]);for(let n of e)r[GYo(n.path,t)]?.push(n);return r}function mZr(e,t){let r=pZr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=hZr(e.tests,t),o=$Pe(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 gZr(e){if(!e.slices)return;let t=mZr(e,e.slices);return{entries:QXr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function yZr(e){if(!(!e.repo||!e.headSha))return`${e.repo}#${e.prNumber}@${e.headSha}`}var Ugt="assist:high-level-progress:",qYo=`${Ugt}head:`,jYo=720*60*60*1e3,xle=e=>`${Ugt}${e}`,Wgt=e=>`${qYo}${e}`,Hgt=e=>fl(e)[0];function YYo(e,t){let r=e?Hgt(xle(e)):void 0;return e&&Vv(xle(e)),r??(t?Hgt(Wgt(t)):void 0)}function vZr(e,t,r){return Yx(Ugt,jYo),Hgt(xle(e))??YYo(t,r)}function bZr(e,t,r){Dl(xle(e),[r]),t&&Dl(Wgt(t),[r])}function xZr(e,t){Vv(xle(e)),t&&Vv(Wgt(t))}function SZr(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 RN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Vgt=e=>typeof e=="string"?e:"";function TZr(e){return{repo:Vgt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Vgt(e.headSha),body:Vgt(e.body)}}var Ggt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function wZr(e){let t;try{t=JSON.parse(e)}catch{return Ggt}return typeof t!="object"||t===null?Ggt:{...TZr(t),checks:RN(t.checks,SZr),structure:{...Ggt.structure,...t.structure},criticalDiffs:RN(t.criticalDiffs),criticalPaths:RN(t.criticalPaths),tests:RN(t.tests),testPaths:RN(t.testPaths),collapsedPaths:RN(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 CZr(e){let t=(0,lAe.useMemo)(()=>wZr(e.body),[e.body]),r=(0,lAe.useMemo)(()=>gZr(t),[t]),n=yZr(t),o=(0,lAe.useMemo)(()=>vZr(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 kZr=x(re(),1);function _Zr(e){let[t,r]=(0,kZr.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 EZr=x(re(),1);function RZr(e,t,r,n){(0,EZr.useEffect)(()=>{bZr(e,t,{items:r,reviewComments:n})},[e,t,r,n])}function AZr(e,t,r){let{payload:n,sliced:o,progress:i,head:a}=CZr(e),s=XXr(n.checks,i,o?.slicing),l=_Zr(i),u=zXr(o?.entries??[]),{comments:d,sentTo:f,clearSent:p}=Hj(t,r),h={...d,onQueue:l.onQueue};RZr(e.requestId,a,s.items,l.queued);let m=(0,PZr.useMemo)(()=>GXr(n),[n]);return{payload:n,checklist:s,queue:l,details:VXr(n,h),counts:m,sentTo:f,clearSent:p,sliced:o,nav:u,diffComments:h,head:a}}var OS=x(_(),1);function LZr({preview:e,session:t,sendInput:r,onDecision:n}){let o=AZr(e,t,r);return(0,OS.jsxs)(H,{sx:s0,children:[(0,OS.jsx)(Nh,{preview:e,draft:!1}),(0,OS.jsx)(dY,{items:e.metadata??[]}),(0,OS.jsx)(qn,{}),(0,OS.jsx)(kXr,{payload:o.payload,checklist:o.checklist,details:o.details,counts:o.counts,sliced:o.sliced,nav:o.nav,comments:o.diffComments}),(0,OS.jsx)(qn,{}),(0,OS.jsx)($Xr,{pane:o,onDecision:(i,a)=>{xZr(e.requestId,o.head),n(i,a)}}),(0,OS.jsx)(ff,{sessionName:o.sentTo,onClose:o.clearSent})]})}var FZr=x(re(),1);var PN=x(_(),1);function KYo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function IZr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,PN.jsxs)(St,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,PN.jsx)(be,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:KYo(e)}),(0,PN.jsx)(tt,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,PN.jsx)(tt,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,PN.jsx)(tt,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var XYo={"top-left":ic.miro.topLeft,"bottom-right":ic.miro.bottomRight};function DZr(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?XYo[t]:ic.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var Sle=x(_(),1);function MZr({box:e,role:t,onSelect:r}){let n=DZr(e,t);return(0,Sle.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,Sle.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,Sle.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:ic.miro.text,children:e.text})]})}function NZr(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 cAe=x(_(),1);function OZr({boxes:e,selection:t}){return(0,cAe.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,cAe.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:NZr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,cAe.jsx)(MZr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function ZYo(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 BZr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(ZYo):[]}catch{return[]}}var qgt=x(re(),1);function $Zr(){let[e,t]=(0,qgt.useState)(null),[r,n]=(0,qgt.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 G3=x(_(),1);function zZr({preview:e,onDecision:t}){let r=(0,FZr.useMemo)(()=>BZr(e.body),[e.body]),n=$Zr();return(0,G3.jsxs)(H,{sx:s0,children:[(0,G3.jsx)(Nh,{preview:e,draft:!1}),(0,G3.jsx)(qn,{}),(0,G3.jsx)(OZr,{boxes:r,selection:n}),(0,G3.jsx)(qn,{}),(0,G3.jsx)(IZr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var yQr=x(re(),1);function HZr(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function uAe(e){return e*22}function UZr(e){return Math.round(e/22)}var WZr={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}},VZr={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},GZr={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},qZr={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},jgt={p:.25,mt:"2px"},jZr={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var KZr=x(_(),1),QYo=8;function YZr({drag:e}){return e?(0,KZr.jsx)(H,{sx:jZr,style:{top:e.top-1,left:QYo+uAe(e.depth)}}):null}var XZr=x(_(),1),ZZr=ot((0,XZr.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 Ygt=x(_(),1);function QZr({number:e,onGrip:t}){return(0,Ygt.jsx)(Mt,{size:"small",className:"criterion-action",sx:VZr,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,Ygt.jsx)(ZZr,{fontSize:"inherit"})})}var hk=x(_(),1);function JZr({number:e,onAdd:t,onDelete:r}){return(0,hk.jsxs)(hk.Fragment,{children:[(0,hk.jsx)(Mt,{size:"small",className:"criterion-action",sx:jgt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,hk.jsx)(Yd,{fontSize:"inherit"})}),(0,hk.jsx)(Mt,{size:"small",className:"criterion-action",sx:jgt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,hk.jsx)(Eo,{fontSize:"inherit"})})]})}var dAe=x(re(),1);function eQr(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function tQr(e){let t=(0,dAe.useRef)(null);return(0,dAe.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=eQr(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var AN=x(_(),1);function rQr({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=tQr(n.focus?.index===e?n.focus:null),s={marginLeft:uAe(r.depth),opacity:o?.4:1};return(0,AN.jsxs)(H,{sx:WZr,"data-criterion-row":!0,style:s,children:[(0,AN.jsx)(QZr,{number:t,onGrip:i}),(0,AN.jsx)(H,{component:"span",sx:GZr,"aria-hidden":"true",children:`${t}.`}),(0,AN.jsx)(Hi,{multiline:!0,value:r.text,sx:qZr,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,AN.jsx)(JZr,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var cQr=x(re(),1);function nQr(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 q3(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 fAe(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:q3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function fg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function pAe(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 oQr(e,t){let r=fg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function iQr(e,t,r){let n=r<0?pAe(e,t):oQr(e,t);if(n<0)return null;let o=fg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:fg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function hAe(e,t){let r=fg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:q3(n),index:Math.max(0,t-1)}}function aQr(e,t,r){if(r<0&&e[t].depth===0||r>0&&pAe(e,t)<0)return null;let n=fg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function mAe(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function JYo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return mAe(fAe(e,t,o,n.slice(r)),"start")}function eKo(e,t,{shift:r,caret:n}){let o=aQr(e,t,r?-1:1);return mAe(o?{items:o,index:t}:null,n)}function sQr(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?JYo(e,t,r):n==="Tab"?eKo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?mAe(iQr(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?mAe(hAe(e,t),"end"):null}function lQr(e,t,r){return sQr(e,t,r)??nQr(e,t,r)}function uQr(e,t){let[r,n]=(0,cQr.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=lQr(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(fAe(e,a,e[a].text,""),"start"),onDelete:a=>o(hAe(e,a),"end")}}var mQr=x(re(),1);function tKo(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=fg(t,r);return o>r&&o<i?r:o}function rKo(e,t,r,n){let o=fg(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+UZr(n),s))}function nKo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function dQr(e,t,r,n,o){let i=tKo(e,t,r,o);return{target:i,depth:rKo(t,r,i,n),top:nKo(e,i)}}function oKo(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 fQr(e,t,r,n){return o=>{let{boxes:i,origin:a}=oKo(t);return dQr(i,e,r,o.clientX-n,o.clientY-a)}}function pQr(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 hQr(e,t,r,n){let o=fg(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:q3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function gQr(e,t,r){let[n,o]=(0,mQr.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),pQr(s.currentTarget,s.pointerId,fQr(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(hQr(e,a,d.target,d.depth))})(s)}}}var Tle=x(_(),1),iKo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},aKo=[{text:"",depth:0}];function vQr({items:e,onChange:t}){let r=(0,yQr.useRef)(null),n=e.length>0?e:aKo,o=uQr(n,t),{drag:i,onGrip:a}=gQr(n,r,o.onDrop),s=HZr(n.map(l=>l.depth));return(0,Tle.jsxs)(H,{sx:iKo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,Tle.jsx)(rQr,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,Tle.jsx)(YZr,{drag:i})]})}var bQr=x(_(),1),xQr=ot((0,bQr.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 wle=x(_(),1),sKo={insert:"Add acceptance criteria",convert:"Convert to outline"};function SQr({kind:e,onClick:t}){return(0,wle.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,wle.jsx)(tt,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,wle.jsx)(Yd,{}):(0,wle.jsx)(xQr,{}),onClick:t,children:sKo[e]})})}var Cle=x(re(),1);function TQr(e,t,{color:r,pin:n}){let o=H6(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=>lKo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function lKo(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 wQr(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function CQr(e,t){for(let r of t){let n=ZNt(e,r);n&&TQr(e,n,r)}}var kle=x(_(),1);function kQr({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,Cle.useMemo)(()=>GD(e),[e]),a=(0,Cle.useMemo)(()=>GD(r??""),[r]);return(0,Cle.useLayoutEffect)(()=>{let s=o.current;s&&(wQr(s),CQr(s,n))},[i,a,n,o]),(0,kle.jsxs)(H,{ref:o,children:[(0,kle.jsx)(HD,{segments:i,skipDiagramText:!0}),t,t?(0,kle.jsx)(HD,{segments:a,skipDiagramText:!0}):null]})}var LN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function gAe(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[LN("")]:{lineHeight:1.6},[LN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[LN("ul, ol")]:{pl:2.5,mb:2},[LN("li")]:{mb:"6px"},[LN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[LN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[LN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var _Qr=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...o9(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...gAe(e)});var pY=x(_(),1);function EQr({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,pY.jsxs)(H,{ref:o,onMouseDown:l,sx:_Qr,children:[(0,pY.jsx)(kQr,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,pY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,pY.jsx)(Y$,{rects:a,color:s})]})}function RQr(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 yAe=x(re(),1),PQr=x(_(),1);function Kgt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,yAe.useState)(t);return(0,yAe.useEffect)(()=>i(t),[t]),(0,PQr.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 _le=x(_(),1),Xgt="screenshot-groups";function cKo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function AQr({screenshot:e,onUpdate:t}){return(0,_le.jsxs)(St,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,_le.jsx)(Kgt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||cKo(e.path)})}),(0,_le.jsx)(Kgt,{label:"Group",value:e.group??"",listId:Xgt,onCommit:r=>t(e.id,{group:r})})]})}var j3=x(_(),1),LQr={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},uKo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function IQr({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,j3.jsxs)(H,{sx:{position:"relative"},children:[n?(0,j3.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:LQr}):(0,j3.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:LQr}),(0,j3.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:uKo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,j3.jsx)(Eo,{fontSize:"small"})}),(0,j3.jsx)(AQr,{screenshot:e,onUpdate:r})]})}var m0=x(_(),1);function dKo(){return(0,m0.jsxs)(St,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,m0.jsx)(ao,{size:16}),(0,m0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function fKo({error:e}){return(0,m0.jsx)(be,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function DQr({uploads:e,empty:t}){return e.length>0?(0,m0.jsx)(m0.Fragment,{children:e.map(r=>r.error?(0,m0.jsx)(fKo,{error:r.error},r.id):(0,m0.jsx)(dKo,{},r.id))}):t?(0,m0.jsx)(be,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var g0=x(_(),1),pKo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function MQr({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=RQr(e),a=s=>(0,g0.jsx)(IQr,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,g0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,g0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,g0.jsx)("datalist",{id:Xgt,children:o.map(([s])=>(0,g0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,g0.jsxs)(H,{sx:{mb:2},children:[(0,g0.jsx)(H,{component:"h3",children:s}),(0,g0.jsx)(H,{sx:pKo,children:l.map(a)})]},s)),(0,g0.jsxs)(St,{spacing:1,children:[i.map(a),(0,g0.jsx)(DQr,{uploads:t,empty:e.length===0})]})]})}var Ele=x(_(),1);function hKo(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,Ele.jsx)(vQr,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,Ele.jsx)(SQr,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function vAe({pane:e,screenshots:t}){return(0,Ele.jsx)(EQr,{...hKo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,Ele.jsx)(MQr,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var NQr=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),OQr={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},BQr=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}),$Qr={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var mk=x(_(),1);function FQr({comments:e,colors:t,onRemove:r}){return(0,mk.jsxs)(H,{sx:NQr,children:[(0,mk.jsxs)(be,{sx:OQr,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,mk.jsxs)(H,{sx:BQr,children:[(0,mk.jsx)(V$,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,mk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,mk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:$Qr,children:(0,mk.jsx)(Eo,{})})]},n.id))]})}var HQr=x(_(),1);function zQr(e){return e.comments.length===0?null:(0,HQr.jsx)(FQr,{...e})}var UQr=x(_(),1),bAe=ot((0,UQr.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 YQr=x(re(),1);var WQr=x(_(),1),VQr=ot((0,WQr.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 y0="0.1202.0";var mKo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function GQr(e){return e?mKo[e]:"success.main"}function qQr(e){return e.split("-")[0].split(".").map(Number)}function jQr(e,t){if(!e||!t||e===t)return;let r=qQr(e),n=qQr(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 xAe=x(re(),1),Zgt=(0,xAe.createContext)(null);function SAe(){return(0,xAe.useContext)(Zgt)}var IN=x(_(),1),gKo={height:16,fontSize:10},yKo={opacity:.6,fontSize:"0.85em"};function vKo(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 Y3({nodes:e,name:t,showVersion:r=!1}){let n=SAe()??y0,o=e.links.find(a=>a.name===t),i=jQr(o?.peerVersion,n);return(0,IN.jsx)(lr,{title:vKo(e,t),placement:"right",children:(0,IN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,IN.jsx)(VQr,{sx:{fontSize:8,color:GQr(o?.state)}}),t,r&&o?.peerVersion&&(0,IN.jsxs)(H,{component:"span",sx:yKo,children:["v",o.peerVersion]}),i&&(0,IN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:gKo})]})})}var v0=x(_(),1),bKo={textTransform:"none"};function TAe({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,YQr.useState)(null);return(0,v0.jsxs)(v0.Fragment,{children:[(0,v0.jsx)(tt,{size:"small",color:"inherit",startIcon:(0,v0.jsx)(bAe,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:bKo,children:(0,v0.jsx)(Y3,{nodes:e,name:r.node})}),(0,v0.jsx)(mi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,v0.jsx)(Br,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,v0.jsx)(Vu,{primary:(0,v0.jsx)(Y3,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var KQr=x(re(),1);function xKo(e,t){return e?.toLowerCase()===t.toLowerCase()}function wAe(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=_n(),[d,f]=(0,KQr.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>xKo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(S=>S.name===b&&S.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 K3=x(_(),1);function XQr({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=gge(),a=wAe(r,t);return(0,K3.jsxs)(K3.Fragment,{children:[(0,K3.jsx)(tt,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,K3.jsx)(TAe,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,K3.jsx)(tt,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Qgt=x(_(),1),SKo={"& .MuiFormControlLabel-label":{fontSize:12}};function Rle({label:e,title:t,checked:r,onChange:n}){return(0,Qgt.jsx)(Bd,{control:(0,Qgt.jsx)(Mp,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:SKo})}var DN=x(_(),1);function CAe({chain:e,newPr:t,onChange:r}){return(0,DN.jsxs)(St,{direction:"row",sx:{mr:"auto"},children:[t&&(0,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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,DN.jsx)(Rle,{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 MN=x(_(),1);function ZQr({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,MN.jsxs)(St,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,MN.jsx)(CAe,{chain:t,newPr:r,onChange:i}),(0,MN.jsx)(tt,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,MN.jsxs)(tt,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,MN.jsx)(XQr,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var JQr=x(_(),1);function QQr({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,JQr.jsx)(ZQr,{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 gk=x(_(),1);function eJr(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,gk.jsxs)(gk.Fragment,{children:[(0,gk.jsx)(zQr,{comments:t,colors:r,onRemove:d}),(0,gk.jsx)(qn,{}),(0,gk.jsx)(QQr,{...e}),(0,gk.jsx)(Lye,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var Ple=x(_(),1),TKo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},wKo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function tJr({url:e}){return(0,Ple.jsxs)(H,{sx:TKo,children:[(0,Ple.jsx)(tt,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,Ple.jsx)(be,{variant:"body2",sx:wKo,title:e,children:e})]})}var Jgt=x(_(),1);function rJr({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Jgt.jsx)(tJr,{url:t}):(0,Jgt.jsx)(dY,{items:e.metadata??[]})}function nJr({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 hY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit"||t==="github-issue-comment",editable:t==="github-issue-edit",closeOnly:t==="show"}}function oJr(e,t){return e?`${e}:${t??"pr"}`:void 0}function kAe(e,t,r,n){return{...hY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:oJr(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function iJr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,b_e({quote:r,note:o})),n()}}function aJr(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,jx(r,vye(o))),n()}}function _Ae(e,t,r,n){return{onCite:aJr(e,t,r,n),onAddRule:iJr(e,t,r,n)}}function sJr(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var gJr=x(re(),1);var yk=x(re(),1);var lJr="assist:pr-preview-comments:",eyt=e=>`${lJr}${e}`;function tyt(e){return fl(eyt(e))}function Ale(e,t){Dl(eyt(e),t)}function EAe(e){Vv(eyt(e))}function cJr(){Yx(lJr)}function uJr(e){let t=H6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function CKo(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 dJr(e,t){return e.flatMap(r=>{let n=CKo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function fJr(e,t,r){let n=tyt(e);if(n.length>0||!t||!r)return n;let o=dJr(tyt(t),uJr(r));return Ale(e,o),EAe(t),o}function pJr(e,t,r){let[n,o]=(0,yk.useState)([]),i=(0,yk.useRef)(0);(0,yk.useEffect)(()=>{cJr(),o(fJr(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,yk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return Ale(e,d),d})},[e]),s=(0,yk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return Ale(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function hJr(e,t){let r=e.map((i,a)=>RG(a).solid),n=RG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:RG(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 mJr(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 yJr(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=jy(),{comments:d,add:f,remove:p}=pJr(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,gJr.useMemo)(()=>hJr(d,i),[d,i]),{onAdd:y,onCollapse:v}=mJr(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 PAe=x(re(),1);var ryt="assist:preview-screenshots:",nyt=e=>`${ryt}${e}`,RAe=e=>`${ryt}seeded:${e}`;function vJr(e){return e?(Yx(ryt),fl(nyt(e)).filter(t=>typeof t.path=="string")):[]}function NN(e,t){e&&Dl(nyt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function bJr(e){e&&(Vv(nyt(e)),Vv(RAe(e)))}var ON=x(re(),1);var xJr={"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 kKo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(xJr).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function SJr(e){return e.map(t=>({...t,contentType:kKo(t.path),seeded:!0}))}function TJr(e,t,r){if(!e)return SJr(r);let n=vJr(e);if(fl(RAe(e))[0]===t)return n;let o=[...SJr(r),...n.filter(i=>!i.seeded)];return NN(e,o),Dl(RAe(e),[t]),o}function wJr(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),ov(`/api/pr-preview/image?${r}`)}function CJr(e,t,r){let[n,o]=(0,ON.useState)([]),i=(0,ON.useRef)(0),a=cr(),s=(0,ON.useRef)(r);return s.current=r,(0,ON.useEffect)(()=>{o(TJr(e,t,s.current).map(l=>({...l,url:wJr(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var kJr=x(re(),1);function _Jr(e,t){return(0,kJr.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return NN(e,i),i})},[e,t])}function EJr(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=CJr(e,t,r),a=(0,PAe.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return NN(e,p),p})},[e,o,i]),s=(0,PAe.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 NN(e,h),h})},[e,o]),l=_Jr(e,o),u=(0,PAe.useCallback)(()=>bJr(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var mY=x(re(),1);async function RJr(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 Wt(`/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 IJr=x(re(),1);function PJr(e){return e.startsWith("image/")||e.startsWith("video/")}function AJr(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&PJr(t.type)){let r=t.getAsFile();if(r)return r}return null}function LJr(e){return e?Array.from(e.files).find(t=>PJr(t.type))??null:null}function DJr(e,t){return(0,IJr.useEffect)(()=>{if(!t)return;let o=i=>{let a=AJr(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=LJr(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 MJr(e,t,r){let[n,o]=(0,mY.useState)([]),i=(0,mY.useRef)(0),a=cr(),s=(0,mY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await RJr(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}=DJr(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function NJr({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=EJr(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=MJr(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 VJr=x(re(),1);var OJr="assist:pr-preview-chain:",oyt=e=>`${OJr}${e}`;function BJr(e){if(e)return fl(oyt(e))[0]}function $Jr(e,t){e&&Dl(oyt(e),[t])}function FJr(e){e&&Vv(oyt(e))}function zJr(){Yx(OJr)}function HJr(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};zJr();let n=BJr(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function UJr(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 WJr(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function GJr(e,t,r,n,o,i,a){let[s,l]=(0,VJr.useState)(()=>HJr(n,t,o));return{chain:s,setChain:f=>{l(f),$Jr(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...UJr(m,p,s,m?i.attachments():[],a()),...WJr(m,h)}),EAe(e),m&&(FJr(t),i.clearPersisted())}}}var ten=x(re(),1);var _Ko=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,EKo=/^ {0,3}#{1,6}[ \t]/;function X3(e){let t=e.split(`
|
|
4150
4150
|
`),r=t.findIndex(a=>_Ko.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!EKo.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 AAe(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function LAe(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 RKo=" ";function PKo({text:e,depth:t}){let r=`${RKo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function IAe(e,t){let r=X3(e);return r?[...r.before,...t.map(PKo),...r.after].join(`
|
|
4151
4151
|
`):e}var AKo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,LKo=/^\[[ xX]\][ \t]*/;function IKo(e){return e.slice(0,e.length-e.trimStart().length)}function qJr(e){let t=X3(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=AKo.exec(o);return{width:AAe(i?i[1]:IKo(o)),text:(i?i[2]??"":o.trim()).replace(LKo,"")}}),n=LAe(r.map(o=>o.width));return IAe(e,q3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var jJr=`## Acceptance criteria
|
|
4152
4152
|
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
buildDoctorProbes,
|
|
11
11
|
diagnoseLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-T2BRM7NE.js";
|
|
13
13
|
import "./chunk-VABNWHSE.js";
|
|
14
14
|
import "./chunk-DS2YJZZY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-5JUSTCY7.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-LFA465WL.js";
|
|
34
34
|
import "./chunk-5QM5VR3J.js";
|
|
35
35
|
import "./chunk-UFSOFNXQ.js";
|
|
36
36
|
import "./chunk-FLDRXYEM.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
launchPrSkill
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZDORASZC.js";
|
|
4
|
+
import "./chunk-SQRMRKKU.js";
|
|
5
5
|
import "./chunk-2ZUJA3R6.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-2PROSCII.js";
|
|
7
7
|
import "./chunk-V3AWLJ7P.js";
|
|
8
8
|
import "./chunk-UN4ABKA7.js";
|
|
9
9
|
import "./chunk-XT3AOF2P.js";
|
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-LFA465WL.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-UVCA72Y4.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-4RWILJGP.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-4RWILJGP.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-PM2HRF6H.js");
|
|
992
992
|
if (options.url) return printExtensionUrl();
|
|
993
993
|
return options.sign ? signExtension() : extension();
|
|
994
994
|
});
|
|
@@ -1444,7 +1444,7 @@ function registerFixConflict(program, resumeFlag) {
|
|
|
1444
1444
|
).action(
|
|
1445
1445
|
async (number, options) => {
|
|
1446
1446
|
const { resolveHarness } = await import("./resolveHarness-CRWWVE4U.js");
|
|
1447
|
-
const { fixConflict } = await import("./fixConflict-
|
|
1447
|
+
const { fixConflict } = await import("./fixConflict-MI7KKAHW.js");
|
|
1448
1448
|
return fixConflict(number, {
|
|
1449
1449
|
rebase: options.rebase,
|
|
1450
1450
|
resumeSessionId: options.resumeSession,
|
|
@@ -1471,7 +1471,7 @@ function registerReviewPrComments(program, resumeFlag) {
|
|
|
1471
1471
|
).action(
|
|
1472
1472
|
async (number, opts) => {
|
|
1473
1473
|
const { resolveHarness } = await import("./resolveHarness-CRWWVE4U.js");
|
|
1474
|
-
const { reviewPrComments } = await import("./reviewPrComments-
|
|
1474
|
+
const { reviewPrComments } = await import("./reviewPrComments-ZFZRHG2I.js");
|
|
1475
1475
|
return reviewPrComments(number, {
|
|
1476
1476
|
announce: opts.announce,
|
|
1477
1477
|
auto: opts.auto,
|
|
@@ -2108,7 +2108,7 @@ function registerReview(program) {
|
|
|
2108
2108
|
addReviewModeOptions(addReviewRunOptions(reviewCommand)).action(
|
|
2109
2109
|
async (number, options) => {
|
|
2110
2110
|
const { resolveHarness } = await import("./resolveHarness-CRWWVE4U.js");
|
|
2111
|
-
const { review } = await import("./review-
|
|
2111
|
+
const { review } = await import("./review-27MBRMYS.js");
|
|
2112
2112
|
return review({
|
|
2113
2113
|
...options,
|
|
2114
2114
|
number,
|
|
@@ -2689,7 +2689,7 @@ function registerDaemon(program) {
|
|
|
2689
2689
|
const cmd = program.command("daemon").description("Long-lived daemon that owns web session PTYs");
|
|
2690
2690
|
cmd.command("run").description(
|
|
2691
2691
|
"Run the sessions daemon in the foreground (auto-spawned by assist sessions)"
|
|
2692
|
-
).action(lazyAction(() => import("./runDaemon-
|
|
2692
|
+
).action(lazyAction(() => import("./runDaemon-QNKKQSV4.js"), "runDaemon"));
|
|
2693
2693
|
cmd.command("status").description(
|
|
2694
2694
|
"Show sessions daemon status, live sessions, and any stray daemon processes"
|
|
2695
2695
|
).action(lazyAction(() => import("./daemonStatus-EAZHBC6O.js"), "daemonStatus"));
|
|
@@ -2702,7 +2702,7 @@ function registerDaemon(program) {
|
|
|
2702
2702
|
cmd.command("drain").description(
|
|
2703
2703
|
"Remove all sessions from the local daemon for a clean slate (does not affect the Windows daemon); prompts before closing live sessions, and a session holding unpushed work is stopped, not removed"
|
|
2704
2704
|
).option("--yes", "Close live sessions without confirming").action(
|
|
2705
|
-
async (options) => (await import("./drainDaemon-
|
|
2705
|
+
async (options) => (await import("./drainDaemon-IGOUGC72.js")).drainDaemon(options)
|
|
2706
2706
|
);
|
|
2707
2707
|
configHelp(cmd, autoUpdateConfigHelp);
|
|
2708
2708
|
}
|
|
@@ -2713,7 +2713,7 @@ function registerDiagnoseCommands(nodes, calledBy5) {
|
|
|
2713
2713
|
nodes.command("doctor [name]").description(
|
|
2714
2714
|
"Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
|
|
2715
2715
|
).option("--json", "Output as JSON").action(
|
|
2716
|
-
async (name, _options, command) => (await import("./doctorNodes-
|
|
2716
|
+
async (name, _options, command) => (await import("./doctorNodes-Z6DCIXZJ.js")).doctorNodes(
|
|
2717
2717
|
name,
|
|
2718
2718
|
command.optsWithGlobals()
|
|
2719
2719
|
)
|
|
@@ -2743,14 +2743,14 @@ function registerPeerActionCommands(nodes, calledBy5) {
|
|
|
2743
2743
|
internalCommand(
|
|
2744
2744
|
nodes.command("restart <name>").description(
|
|
2745
2745
|
"Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
|
|
2746
|
-
).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-
|
|
2746
|
+
).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-TPOSDMNH.js"), "restartNode")),
|
|
2747
2747
|
calledBy5
|
|
2748
2748
|
);
|
|
2749
2749
|
internalCommand(
|
|
2750
2750
|
nodes.command("update <name>").description(
|
|
2751
2751
|
"Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
|
|
2752
2752
|
).action(
|
|
2753
|
-
async (name) => (await import("./updateNode-
|
|
2753
|
+
async (name) => (await import("./updateNode-B2B4MX24.js")).updateNode(name)
|
|
2754
2754
|
),
|
|
2755
2755
|
calledBy5
|
|
2756
2756
|
);
|
|
@@ -2813,7 +2813,7 @@ function registerSetStatusCommand(cmd) {
|
|
|
2813
2813
|
// src/commands/sessions/registerSessionsWeb.ts
|
|
2814
2814
|
function registerSessionsWeb(cmd) {
|
|
2815
2815
|
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(
|
|
2816
|
-
async (options, command) => (await import("./web-
|
|
2816
|
+
async (options, command) => (await import("./web-UVCA72Y4.js")).web({
|
|
2817
2817
|
...options,
|
|
2818
2818
|
open: command.optsWithGlobals().open
|
|
2819
2819
|
})
|
|
@@ -2828,7 +2828,7 @@ function registerSessionsWeb(cmd) {
|
|
|
2828
2828
|
// src/commands/sessions/registerSessions.ts
|
|
2829
2829
|
function registerSessions(program) {
|
|
2830
2830
|
const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
|
|
2831
|
-
async (_options, command) => (await import("./web-
|
|
2831
|
+
async (_options, command) => (await import("./web-UVCA72Y4.js")).web({
|
|
2832
2832
|
port: "3100",
|
|
2833
2833
|
open: command.optsWithGlobals().open
|
|
2834
2834
|
})
|
|
@@ -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-IBG2UFAA.js";
|
|
6
|
+
import "./chunk-S4FGQFSO.js";
|
|
7
|
+
import "./chunk-T2BRM7NE.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-5JUSTCY7.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-LFA465WL.js";
|
|
19
19
|
import "./chunk-UFSOFNXQ.js";
|
|
20
20
|
import "./chunk-FLDRXYEM.js";
|
|
21
21
|
import "./chunk-GRXFWFGP.js";
|
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
} from "./chunk-RFMBA6WA.js";
|
|
30
30
|
import {
|
|
31
31
|
checkoutPr
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-SQRMRKKU.js";
|
|
33
33
|
import "./chunk-2ZUJA3R6.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-2PROSCII.js";
|
|
35
35
|
import "./chunk-V3AWLJ7P.js";
|
|
36
36
|
import "./chunk-UN4ABKA7.js";
|
|
37
37
|
import "./chunk-XT3AOF2P.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
launchPrSkill
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZDORASZC.js";
|
|
4
|
+
import "./chunk-SQRMRKKU.js";
|
|
5
5
|
import "./chunk-2ZUJA3R6.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-2PROSCII.js";
|
|
7
7
|
import "./chunk-V3AWLJ7P.js";
|
|
8
8
|
import "./chunk-UN4ABKA7.js";
|
|
9
9
|
import "./chunk-XT3AOF2P.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
describePersistedSession,
|
|
37
37
|
loadPersistedSessions,
|
|
38
38
|
persistLiveSessions
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2PROSCII.js";
|
|
40
40
|
import "./chunk-XT3AOF2P.js";
|
|
41
41
|
import {
|
|
42
42
|
showNotification
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
isHello,
|
|
134
134
|
linkVersionCheck,
|
|
135
135
|
negotiateProtocol
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-5JUSTCY7.js";
|
|
137
137
|
import {
|
|
138
138
|
loadLinkSpecs
|
|
139
139
|
} from "./chunk-J2PPCMCR.js";
|
|
@@ -272,7 +272,7 @@ import {
|
|
|
272
272
|
import "./chunk-APZ6ZTDA.js";
|
|
273
273
|
import "./chunk-ZRIBI33P.js";
|
|
274
274
|
import "./chunk-D7UZLH36.js";
|
|
275
|
-
import "./chunk-
|
|
275
|
+
import "./chunk-LFA465WL.js";
|
|
276
276
|
import "./chunk-EW2ZM2PC.js";
|
|
277
277
|
import "./chunk-MYH4MQX2.js";
|
|
278
278
|
import {
|
|
@@ -943,6 +943,7 @@ function toSessionInfo(session) {
|
|
|
943
943
|
seeding,
|
|
944
944
|
pendingPrPreview,
|
|
945
945
|
pendingShow,
|
|
946
|
+
highLevelReviewHead: highLevelReviewHead2,
|
|
946
947
|
resumedOverPreview,
|
|
947
948
|
undurable
|
|
948
949
|
} = session;
|
|
@@ -970,6 +971,7 @@ function toSessionInfo(session) {
|
|
|
970
971
|
seeding,
|
|
971
972
|
pendingPrPreview,
|
|
972
973
|
pendingShow,
|
|
974
|
+
highLevelReviewHead: highLevelReviewHead2,
|
|
973
975
|
resumedOverPreview,
|
|
974
976
|
undurable,
|
|
975
977
|
promptIssue: promptIssueRef(session.initialPrompt),
|
|
@@ -4494,6 +4496,12 @@ function placeShowPreview(session, show) {
|
|
|
4494
4496
|
return true;
|
|
4495
4497
|
}
|
|
4496
4498
|
|
|
4499
|
+
// src/commands/sessions/daemon/highLevelReviewHead.ts
|
|
4500
|
+
function highLevelReviewHead(preview) {
|
|
4501
|
+
if (preview.kind !== "high-level-review") return void 0;
|
|
4502
|
+
return preview.metadata?.find((m) => m.label === "Head")?.value;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4497
4505
|
// src/commands/sessions/daemon/supersedePendingPreview.ts
|
|
4498
4506
|
function supersedePendingPreview(session, waiters, newRequestId) {
|
|
4499
4507
|
const pending = session.pendingPrPreview;
|
|
@@ -4532,6 +4540,11 @@ function holdBlockingPreview(session, waiters, client, preview, taskId) {
|
|
|
4532
4540
|
preview.requestId
|
|
4533
4541
|
);
|
|
4534
4542
|
session.pendingPrPreview = supersedes ? { ...preview, supersedes } : preview;
|
|
4543
|
+
const head = highLevelReviewHead(preview);
|
|
4544
|
+
if (head) {
|
|
4545
|
+
session.highLevelReviewHead = head;
|
|
4546
|
+
daemonLog(`pr-preview high-level head: id=${session.id} head=${head}`);
|
|
4547
|
+
}
|
|
4535
4548
|
session.pendingPreviewTaskId = typeof taskId === "string" ? taskId : void 0;
|
|
4536
4549
|
if (session.pendingShow) {
|
|
4537
4550
|
daemonLog(
|
|
@@ -6311,6 +6324,7 @@ function restoreBase(id, persisted) {
|
|
|
6311
6324
|
autoAdvance: restoredAutoAdvance(id, persisted),
|
|
6312
6325
|
autoApprove: persisted.autoApprove,
|
|
6313
6326
|
reviewStarted: persisted.reviewStarted,
|
|
6327
|
+
highLevelReviewHead: persisted.highLevelReviewHead,
|
|
6314
6328
|
launchedFrom: persisted.launchedFrom,
|
|
6315
6329
|
pendingPrompts: persisted.pendingPrompts,
|
|
6316
6330
|
pendingDeferredResults: persisted.pendingDeferredResults,
|
|
@@ -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-IBG2UFAA.js";
|
|
6
|
+
import "./chunk-S4FGQFSO.js";
|
|
7
|
+
import "./chunk-T2BRM7NE.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-5JUSTCY7.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-LFA465WL.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-GNCIBOPQ.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-S4FGQFSO.js";
|
|
8
|
+
import "./chunk-T2BRM7NE.js";
|
|
9
9
|
import "./chunk-VABNWHSE.js";
|
|
10
10
|
import "./chunk-DS2YJZZY.js";
|
|
11
11
|
import "./chunk-2RUGZQUD.js";
|
|
12
12
|
import "./chunk-5QXAQCAJ.js";
|
|
13
13
|
import "./chunk-4HKB2TAG.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-5JUSTCY7.js";
|
|
15
15
|
import "./chunk-J2PPCMCR.js";
|
|
16
16
|
import "./chunk-5CNDLMYO.js";
|
|
17
17
|
import "./chunk-B7VOTF5Q.js";
|
|
@@ -139,7 +139,7 @@ import "./chunk-RW6YKTIM.js";
|
|
|
139
139
|
import "./chunk-APZ6ZTDA.js";
|
|
140
140
|
import "./chunk-ZRIBI33P.js";
|
|
141
141
|
import "./chunk-D7UZLH36.js";
|
|
142
|
-
import "./chunk-
|
|
142
|
+
import "./chunk-LFA465WL.js";
|
|
143
143
|
import "./chunk-YUV5QBHU.js";
|
|
144
144
|
import "./chunk-YVL3NXEB.js";
|
|
145
145
|
import "./chunk-UEWARAPX.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
web
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GNCIBOPQ.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-S4FGQFSO.js";
|
|
8
|
+
import "./chunk-T2BRM7NE.js";
|
|
9
9
|
import "./chunk-VABNWHSE.js";
|
|
10
10
|
import "./chunk-DS2YJZZY.js";
|
|
11
11
|
import "./chunk-2RUGZQUD.js";
|
|
12
12
|
import "./chunk-5QXAQCAJ.js";
|
|
13
13
|
import "./chunk-4HKB2TAG.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-5JUSTCY7.js";
|
|
15
15
|
import "./chunk-J2PPCMCR.js";
|
|
16
16
|
import "./chunk-5CNDLMYO.js";
|
|
17
17
|
import "./chunk-B7VOTF5Q.js";
|
|
@@ -139,7 +139,7 @@ import "./chunk-RW6YKTIM.js";
|
|
|
139
139
|
import "./chunk-APZ6ZTDA.js";
|
|
140
140
|
import "./chunk-ZRIBI33P.js";
|
|
141
141
|
import "./chunk-D7UZLH36.js";
|
|
142
|
-
import "./chunk-
|
|
142
|
+
import "./chunk-LFA465WL.js";
|
|
143
143
|
import "./chunk-YUV5QBHU.js";
|
|
144
144
|
import "./chunk-YVL3NXEB.js";
|
|
145
145
|
import "./chunk-UEWARAPX.js";
|