@nilsr0711/drydock 0.1.7 → 0.1.8

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.
Files changed (147) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  15. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/adrs/page.js +2 -2
  18. package/.next/standalone/.next/server/app/adrs/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/adrs/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/analytics/page.js +1 -1
  21. package/.next/standalone/.next/server/app/analytics/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/control/shutdown/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/cost/export/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/health/route.js +1 -1
  26. package/.next/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/sse/dashboard/route.js +1 -1
  28. package/.next/standalone/.next/server/app/api/sse/dashboard/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/sse/jobs/[id]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/webhooks/[repoId]/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/costs/page.js +1 -1
  32. package/.next/standalone/.next/server/app/costs/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/costs/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/jobs/[id]/page.js +3 -3
  35. package/.next/standalone/.next/server/app/jobs/[id]/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/jobs/[id]/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/jobs/page.js +2 -2
  38. package/.next/standalone/.next/server/app/jobs/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/jobs/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/needs-human/page.js +2 -2
  41. package/.next/standalone/.next/server/app/needs-human/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/needs-human/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/page.js +2 -2
  44. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/prompts/page.js +2 -2
  47. package/.next/standalone/.next/server/app/prompts/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/prompts/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/repos/[id]/page.js +2 -2
  50. package/.next/standalone/.next/server/app/repos/[id]/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/repos/[id]/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  53. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app-paths-manifest.json +1 -1
  56. package/.next/standalone/.next/server/chunks/304.js +1 -1
  57. package/.next/standalone/.next/server/chunks/387.js +34 -0
  58. package/.next/standalone/.next/server/chunks/40.js +1 -1
  59. package/.next/standalone/.next/server/chunks/403.js +1 -0
  60. package/.next/standalone/.next/server/chunks/521.js +1 -1
  61. package/.next/standalone/.next/server/chunks/578.js +1 -1
  62. package/.next/standalone/.next/server/chunks/614.js +2 -2
  63. package/.next/standalone/.next/server/chunks/685.js +1 -0
  64. package/.next/standalone/.next/server/chunks/786.js +1 -1
  65. package/.next/standalone/.next/server/chunks/83.js +1 -1
  66. package/.next/standalone/.next/server/chunks/908.js +1 -1
  67. package/.next/standalone/.next/server/chunks/99.js +14 -11
  68. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  69. package/.next/standalone/.next/server/pages/500.html +1 -1
  70. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  72. package/.next/standalone/.next/static/chunks/1298-0d60333e56ac8b2c.js +1 -0
  73. package/.next/standalone/.next/static/chunks/3433-ece700d2e393c23b.js +1 -0
  74. package/.next/standalone/.next/static/chunks/3894-4f48e3cc5be58e10.js +1 -0
  75. package/.next/standalone/.next/static/chunks/5080-16cb43874ff5c536.js +1 -0
  76. package/.next/standalone/.next/static/chunks/{1642-a1ea35450c1b5c95.js → 8264-c27834f1552f983a.js} +1 -1
  77. package/.next/{static/chunks/4624-5e23973d35b58ca5.js → standalone/.next/static/chunks/8745-8b3833b3d2afa30c.js} +1 -1
  78. package/.next/standalone/.next/static/chunks/app/adrs/page-0c221fc18d1e89af.js +1 -0
  79. package/.next/standalone/.next/static/chunks/app/costs/{page-24d086bf67620e30.js → page-5d66d93815eea63a.js} +1 -1
  80. package/.next/standalone/.next/static/chunks/app/jobs/[id]/page-6ef8bc39b5181817.js +1 -0
  81. package/.next/standalone/.next/static/chunks/app/jobs/page-98215ec1497b829e.js +1 -0
  82. package/.next/standalone/.next/static/chunks/app/layout-402d4ab34259b89b.js +1 -0
  83. package/.next/standalone/.next/static/chunks/app/needs-human/page-b69ac22856c0a0b1.js +1 -0
  84. package/.next/standalone/.next/static/chunks/app/page-ccefa99d40734a8c.js +1 -0
  85. package/.next/standalone/.next/static/chunks/app/prompts/page-bcd1063eb5d64aa5.js +1 -0
  86. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-2bd4b35a0b28042e.js +1 -0
  87. package/.next/standalone/.next/static/chunks/app/settings/page-13a04ecac139b74c.js +1 -0
  88. package/.next/standalone/.next/static/css/{bdce0893cf6b9cb9.css → 600a5b5311ad42be.css} +1 -1
  89. package/.next/standalone/drizzle/0034_human_instruction.sql +1 -0
  90. package/.next/standalone/drizzle/0035_agent_release.sql +4 -0
  91. package/.next/standalone/mcp-server.cjs +42934 -0
  92. package/.next/standalone/package.json +5 -3
  93. package/.next/static/chunks/1298-0d60333e56ac8b2c.js +1 -0
  94. package/.next/static/chunks/3433-ece700d2e393c23b.js +1 -0
  95. package/.next/static/chunks/3894-4f48e3cc5be58e10.js +1 -0
  96. package/.next/static/chunks/5080-16cb43874ff5c536.js +1 -0
  97. package/.next/static/chunks/{1642-a1ea35450c1b5c95.js → 8264-c27834f1552f983a.js} +1 -1
  98. package/.next/{standalone/.next/static/chunks/4624-5e23973d35b58ca5.js → static/chunks/8745-8b3833b3d2afa30c.js} +1 -1
  99. package/.next/static/chunks/app/adrs/page-0c221fc18d1e89af.js +1 -0
  100. package/.next/static/chunks/app/costs/{page-24d086bf67620e30.js → page-5d66d93815eea63a.js} +1 -1
  101. package/.next/static/chunks/app/jobs/[id]/page-6ef8bc39b5181817.js +1 -0
  102. package/.next/static/chunks/app/jobs/page-98215ec1497b829e.js +1 -0
  103. package/.next/static/chunks/app/layout-402d4ab34259b89b.js +1 -0
  104. package/.next/static/chunks/app/needs-human/page-b69ac22856c0a0b1.js +1 -0
  105. package/.next/static/chunks/app/page-ccefa99d40734a8c.js +1 -0
  106. package/.next/static/chunks/app/prompts/page-bcd1063eb5d64aa5.js +1 -0
  107. package/.next/static/chunks/app/repos/[id]/page-2bd4b35a0b28042e.js +1 -0
  108. package/.next/static/chunks/app/settings/page-13a04ecac139b74c.js +1 -0
  109. package/.next/static/css/{bdce0893cf6b9cb9.css → 600a5b5311ad42be.css} +1 -1
  110. package/README.md +60 -21
  111. package/bin/drydock.mjs +77 -2
  112. package/drizzle/0034_human_instruction.sql +1 -0
  113. package/drizzle/0035_agent_release.sql +4 -0
  114. package/package.json +5 -3
  115. package/.next/standalone/.next/server/chunks/382.js +0 -31
  116. package/.next/standalone/.next/server/chunks/468.js +0 -1
  117. package/.next/standalone/.next/server/chunks/822.js +0 -1
  118. package/.next/standalone/.next/static/chunks/1298-7ac9c00c70b27598.js +0 -1
  119. package/.next/standalone/.next/static/chunks/3433-719d6f55f39342d8.js +0 -1
  120. package/.next/standalone/.next/static/chunks/3894-c7b01dcfcf83d89b.js +0 -1
  121. package/.next/standalone/.next/static/chunks/7690-6dcfd9ae4cbf4e7d.js +0 -1
  122. package/.next/standalone/.next/static/chunks/app/adrs/page-1dfee698ea4c111f.js +0 -1
  123. package/.next/standalone/.next/static/chunks/app/jobs/[id]/page-8a9e4ed64c3303fe.js +0 -1
  124. package/.next/standalone/.next/static/chunks/app/jobs/page-4180ccc9acd3ddba.js +0 -1
  125. package/.next/standalone/.next/static/chunks/app/layout-189fa697d72d1fdf.js +0 -1
  126. package/.next/standalone/.next/static/chunks/app/needs-human/page-e458ffa78c06a6fa.js +0 -1
  127. package/.next/standalone/.next/static/chunks/app/page-add53cbf6d87a3f5.js +0 -1
  128. package/.next/standalone/.next/static/chunks/app/prompts/page-ff6cc30777232933.js +0 -1
  129. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-cd11007841a5d73f.js +0 -1
  130. package/.next/standalone/.next/static/chunks/app/settings/page-280668b9c92e9b48.js +0 -1
  131. package/.next/static/chunks/1298-7ac9c00c70b27598.js +0 -1
  132. package/.next/static/chunks/3433-719d6f55f39342d8.js +0 -1
  133. package/.next/static/chunks/3894-c7b01dcfcf83d89b.js +0 -1
  134. package/.next/static/chunks/7690-6dcfd9ae4cbf4e7d.js +0 -1
  135. package/.next/static/chunks/app/adrs/page-1dfee698ea4c111f.js +0 -1
  136. package/.next/static/chunks/app/jobs/[id]/page-8a9e4ed64c3303fe.js +0 -1
  137. package/.next/static/chunks/app/jobs/page-4180ccc9acd3ddba.js +0 -1
  138. package/.next/static/chunks/app/layout-189fa697d72d1fdf.js +0 -1
  139. package/.next/static/chunks/app/needs-human/page-e458ffa78c06a6fa.js +0 -1
  140. package/.next/static/chunks/app/page-add53cbf6d87a3f5.js +0 -1
  141. package/.next/static/chunks/app/prompts/page-ff6cc30777232933.js +0 -1
  142. package/.next/static/chunks/app/repos/[id]/page-cd11007841a5d73f.js +0 -1
  143. package/.next/static/chunks/app/settings/page-280668b9c92e9b48.js +0 -1
  144. /package/.next/standalone/.next/static/{-sJQutzNDvUvcdmf3YlJA → qSEvPCWIslg9lcxt6XQhl}/_buildManifest.js +0 -0
  145. /package/.next/standalone/.next/static/{-sJQutzNDvUvcdmf3YlJA → qSEvPCWIslg9lcxt6XQhl}/_ssgManifest.js +0 -0
  146. /package/.next/static/{-sJQutzNDvUvcdmf3YlJA → qSEvPCWIslg9lcxt6XQhl}/_buildManifest.js +0 -0
  147. /package/.next/static/{-sJQutzNDvUvcdmf3YlJA → qSEvPCWIslg9lcxt6XQhl}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{296:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},739:(e,t,s)=>{"use strict";s.d(t,{s:()=>l});var r=s(515),a=s(6845),n=s(5832);function l({ts:e,className:t}){let s=(0,a.p)();return(0,r.jsx)("span",{className:t,children:s?(0,n.KW)(e):"…"})}},1104:(e,t,s)=>{Promise.resolve().then(s.bind(s,5742))},1837:(e,t,s)=>{"use strict";s.d(t,{L6:()=>r,UB:()=>a,VJ:()=>l,tT:()=>n});let r=[{id:"claude-opus-4-8",label:"Claude Opus 4.8",agent:"claude"},{id:"claude-fable-5",label:"Claude Fable 5",agent:"claude"},{id:"claude-opus-4-7",label:"Claude Opus 4.7",agent:"claude"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",agent:"claude"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",agent:"claude"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",agent:"claude"},{id:"gpt-5-codex",label:"GPT-5 Codex",agent:"codex"},{id:"gpt-5",label:"GPT-5",agent:"codex"},{id:"gpt-5-mini",label:"GPT-5 Mini",agent:"codex"}],a="claude-opus-4-8";function n(e){return r.filter(t=>t.agent===e)}function l(e){return"openrouter"===e?"":n(e)[0]?.id??a}},2718:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},2836:(e,t,s)=>{"use strict";s.d(t,{Sparkline:()=>l});var r=s(515),a=s(1171),n=s(4497);function l({data:e,width:t=132,height:s=36,tone:i="chart-1",fill:d=!0,strokeWidth:c=1.75,average:o=!1}){let u=`sp${(0,a.useId)().replace(/:/g,"")}`;if(0===e.length)return null;let x=Math.min(...e),h=Math.max(...e)-x||1,m=e.length>1?t/(e.length-1):t,p=e.map((e,t)=>[t*m,s-3-(e-x)/h*(s-6)]),g=p.map((e,t)=>`${t?"L":"M"}${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(" "),f=`${g} L${t} ${s} L0 ${s} Z`,j=(0,n.U)(i),b=p[p.length-1]??[0,s-3],v=s-3-(e.reduce((e,t)=>e+t,0)/e.length-x)/h*(s-6);return(0,r.jsxs)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:"overflow-visible","aria-hidden":"true",children:[d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:u,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:"0.22"}),(0,r.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:"0"})]})}),(0,r.jsx)("path",{d:f,fill:`url(#${u})`})]}),o&&e.length>1&&(0,r.jsx)("line",{x1:0,x2:t,y1:v,y2:v,stroke:"hsl(var(--muted-foreground) / 0.45)",strokeWidth:1,strokeDasharray:"3 3"}),(0,r.jsx)("path",{d:g,fill:"none",stroke:j,strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("circle",{cx:b[0],cy:b[1],r:2.5,fill:j})]})}},3798:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},4266:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4276:(e,t,s)=>{"use strict";s.d(t,{h:()=>d});var r=s(515),a=s(6512),n=s(5832),l=s(5172);let i={neutral:{chip:"bg-secondary text-muted-foreground",val:"text-foreground",bg:""},primary:{chip:"bg-primary/15 text-primary",val:"text-primary",bg:"bg-primary/[0.04]"},success:{chip:"bg-success-muted text-success",val:"text-success",bg:"bg-success/[0.05]"},warning:{chip:"bg-warning-muted text-warning",val:"text-warning",bg:"bg-warning/[0.05]"},destructive:{chip:"bg-destructive/15 text-destructive",val:"text-destructive",bg:"bg-destructive/[0.05]"}};function d({icon:e,label:t,value:s,sub:c,tone:o="neutral",active:u,onClick:x,hint:h}){let m=!!u&&"neutral"!==o,p=i[o],g=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:(0,n.cn)("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",m?p.chip:"bg-secondary text-muted-foreground"),children:e&&(0,r.jsx)(e,{className:"h-4 w-4"})}),h&&(0,r.jsx)("span",{className:"text-muted-foreground/60",children:(0,r.jsx)(l.m,{content:h,children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:(0,n.cn)("text-2xl font-semibold tnum tracking-tight",m?p.val:"text-foreground"),children:s}),(0,r.jsx)("div",{className:"mt-0.5 text-[13px] font-medium text-muted-foreground",children:t}),c&&(0,r.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground/80",children:c})]})]}),f=(0,n.cn)("group relative flex flex-col gap-3 rounded-xl border border-card-border bg-card p-4 text-left shadow-sm transition-colors",m&&p.bg,x&&"hover-elevate focus-ring");return x?(0,r.jsx)("button",{type:"button",onClick:x,className:f,children:g}):(0,r.jsx)("div",{className:f,children:g})}},4393:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},4497:(e,t,s)=>{"use strict";function r(e){return e?`hsl(var(--${e}))`:"hsl(var(--muted-foreground))"}s.d(t,{U:()=>r})},4783:(e,t,s)=>{"use strict";s.d(t,{F:()=>x,W:()=>h});var r=s(515),a=s(6512),n=s(8131),l=s(4877),i=s(5662),d=s(5529),c=s(9214),o=s(5832);let u={info:{cls:"border-primary/30 bg-primary/5 text-foreground",icon:a.A,ic:"text-primary"},success:{cls:"border-success-border bg-success-muted text-foreground",icon:n.A,ic:"text-success"},warning:{cls:"border-warning-border bg-warning-muted text-foreground",icon:l.A,ic:"text-warning"},destructive:{cls:"border-destructive/30 bg-destructive/5 text-foreground",icon:i.A,ic:"text-destructive"}};function x({tone:e="info",title:t,children:s,action:a,icon:n,className:l}){let i=u[e],d=n??i.icon;return(0,r.jsxs)("div",{className:(0,o.cn)("flex gap-3 rounded-xl border p-4",i.cls,l),role:"alert",children:[(0,r.jsx)(d,{className:(0,o.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",i.ic)}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[t&&(0,r.jsx)("p",{className:"text-sm font-semibold",children:t}),s&&(0,r.jsx)("div",{className:"mt-0.5 text-pretty text-sm text-muted-foreground",children:s})]}),a&&(0,r.jsx)("div",{className:"shrink-0",children:a})]})}function h({title:e="Something went wrong",description:t,action:s,className:a}){return(0,r.jsx)(d.Zp,{className:(0,o.cn)("border-destructive/30",a),children:(0,r.jsx)(c.p,{icon:i.A,tone:"destructive",title:e,description:t,action:s})})}},5172:(e,t,s)=>{"use strict";s.d(t,{V:()=>d,m:()=>i});var r=s(515),a=s(4393),n=s(5832);let l={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"};function i({content:e,children:t,side:s="top",className:a}){return(0,r.jsxs)("span",{className:"group/tt relative inline-flex",children:[t,(0,r.jsx)("span",{role:"tooltip",className:(0,n.cn)("pointer-events-none absolute z-50 w-max max-w-[260px] rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs leading-relaxed text-popover-foreground shadow-lg","translate-y-0.5 opacity-0 transition-all duration-150 group-focus-within/tt:opacity-100 group-hover/tt:translate-y-0 group-hover/tt:opacity-100",l[s],a),children:e})]})}function d({content:e,side:t="top"}){return(0,r.jsx)(i,{content:e,side:t,children:(0,r.jsx)("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground focus-ring","aria-label":"Help",children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})})})}},5662:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]])},5742:(e,t,s)=>{"use strict";s.d(t,{DashboardLive:()=>er});var r=s(515),a=s(296),n=s(1330);let l=(0,n.A)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var i=s(6512),d=s(2235),c=s(1171);let o=(0,n.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=s(5378),x=s(4266),h=s(6644),m=s(395),p=s(7901),g=s(5097);let f=(0,g.createServerReference)("404a78f2971f8deaa5a40c97c4559144db1a759d3d",g.callServer,void 0,g.findSourceMapURL,"browseDirectoryAction");function j({onSelect:e,onClose:t}){let[s,a]=(0,c.useState)(null),[n,i]=(0,c.useTransition)(),d=e=>i(async()=>a(await f(e)));return(0,c.useEffect)(()=>{d()},[]),(0,r.jsx)(p.l,{open:!0,onClose:t,labelledById:"dir-picker-title",children:(0,r.jsxs)("div",{className:"flex max-h-[70vh] flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-card-border pb-3",children:[(0,r.jsxs)("span",{id:"dir-picker-title",className:"flex items-center gap-2 text-base font-semibold tracking-tight",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,r.jsx)(o,{className:"h-[18px] w-[18px]"})}),"Choose a folder"]}),(0,r.jsx)(m.$,{size:"icon-sm",variant:"ghost","aria-label":"Close",onClick:t,children:(0,r.jsx)(u.A,{})})]}),(0,r.jsxs)("div",{className:"border-b border-card-border py-3",children:[(0,r.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",title:s?.path,children:s?.path??"…"}),s?.isGitRepo&&(0,r.jsxs)(h.E,{tone:"success",className:"mt-1.5",children:[(0,r.jsx)(l,{className:"h-3 w-3"}),"git repo"]})]}),(0,r.jsxs)("div",{className:"scrollbar-none min-h-0 flex-1 overflow-auto py-2",children:[s?.parent&&(0,r.jsxs)("button",{type:"button",disabled:n,onClick:()=>d(s.parent??void 0),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover-elevate disabled:opacity-50",children:[(0,r.jsx)(o,{className:"h-4 w-4 text-muted-foreground"}),".."]}),s?.entries.map(e=>(0,r.jsxs)("button",{type:"button",disabled:n,onClick:()=>d(e.path),className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-sm hover-elevate disabled:opacity-50",children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[e.isGitRepo?(0,r.jsx)(l,{className:"h-4 w-4 shrink-0 text-primary"}):(0,r.jsx)(o,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"truncate",children:e.name})]}),e.isGitRepo&&(0,r.jsx)(h.E,{tone:"success",children:"git"})]},e.path)),s&&0===s.entries.length&&(0,r.jsx)("p",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No subfolders."})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-card-border pt-3",children:[(0,r.jsx)(m.$,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),(0,r.jsxs)(m.$,{size:"sm",disabled:!s||n,onClick:()=>s&&e(s.path),children:[(0,r.jsx)(x.A,{}),"Use this folder"]})]})]})})}var b=s(8067);let v={github:{id:"github",label:"GitHub",needsConnection:!1},gitlab:{id:"gitlab",label:"GitLab",needsConnection:!0}},y=["github","gitlab"].map(e=>v[e]);function N({value:e,onChange:t,id:s,className:a}){return(0,r.jsx)(b.l,{id:s,value:e,onChange:e=>t(e.target.value),className:a,children:y.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}var w=s(9754),k=s(5529),A=s(7217),C=s(7405),$=s(1837);let S=(0,g.createServerReference)("40ff46484b8d0230f28e7853cff3b0037220bc4029",g.callServer,void 0,g.findSourceMapURL,"detectDefaultBranchAction"),M=(0,g.createServerReference)("40fd63aacb5de1dd97754363caf4af17282a4ba203",g.callServer,void 0,g.findSourceMapURL,"addRepoAction");function R({onDone:e}){let[t,s]=(0,c.useTransition)(),[n,i]=(0,c.useState)(""),[d,o]=(0,c.useState)(""),[u,x]=(0,c.useState)($.UB),[h,p]=(0,c.useState)("github"),[g,f]=(0,c.useState)(""),[b,v]=(0,c.useState)(""),[y,F]=(0,c.useState)(""),E=(0,c.useRef)(!1),L=(0,c.useRef)(0),[D,T]=(0,c.useState)(!1);function U(e){let t=e.trim();if(E.current||!t)return;let r=++L.current;s(async()=>{let e=await S(t);E.current||r!==L.current||F(e)})}return(0,r.jsxs)(k.Zp,{className:"dd-fade-up p-5",children:[(0,r.jsxs)("form",{className:"grid gap-4 sm:grid-cols-2",action:()=>{s(async()=>{await M({path:d,name:n,defaultModel:u,platform:h,defaultBranch:y.trim()||void 0,apiBaseUrl:"gitlab"===h&&g.trim()||null,apiToken:"gitlab"===h&&b.trim()||null}),e()})},children:[(0,r.jsx)(A.D,{label:"Name",htmlFor:"repo-name",children:(0,r.jsx)(C.p,{id:"repo-name",value:n,onChange:e=>i(e.target.value),placeholder:"my-project",required:!0})}),(0,r.jsx)(A.D,{label:"Local path",htmlFor:"repo-path",hint:"Drydock watches this working copy and runs the agent in an isolated worktree.",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(l,{className:"pointer-events-none absolute left-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(C.p,{id:"repo-path",value:d,onChange:e=>o(e.target.value),onBlur:e=>U(e.target.value),placeholder:"/abs/path/to/repo",required:!0,className:"pl-9 font-mono"})]}),(0,r.jsx)(m.$,{type:"button",variant:"outline",size:"sm",onClick:()=>T(!0),children:"Browse…"})]})}),(0,r.jsx)(A.D,{label:"Default model",htmlFor:"repo-model",children:(0,r.jsx)(w.o,{id:"repo-model",value:u,onChange:x})}),(0,r.jsx)(A.D,{label:"Forge",htmlFor:"repo-platform",children:(0,r.jsx)(N,{id:"repo-platform",value:h,onChange:p})}),(0,r.jsx)(A.D,{label:"Default branch",htmlFor:"repo-default-branch",hint:"Auto-detected from the clone; the base for worktrees and PRs.",children:(0,r.jsx)(C.p,{id:"repo-default-branch",value:y,onChange:e=>{E.current=!0,F(e.target.value)},placeholder:"main",className:"font-mono"})}),"gitlab"===h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.D,{label:"API base URL",htmlFor:"repo-api-url",className:"sm:col-span-2",children:(0,r.jsx)(C.p,{id:"repo-api-url",value:g,onChange:e=>f(e.target.value),placeholder:"https://gitlab.com"})}),(0,r.jsx)(A.D,{label:"Access token",htmlFor:"repo-api-token",hint:"Stored locally on this machine.",className:"sm:col-span-2",children:(0,r.jsx)(C.p,{id:"repo-api-token",value:b,onChange:e=>v(e.target.value),type:"password",placeholder:"Access token"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:col-span-2",children:[(0,r.jsxs)(m.$,{type:"submit",disabled:t||!d,children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add repository"]}),(0,r.jsx)(m.$,{type:"button",variant:"ghost",onClick:e,children:"Cancel"})]})]}),D&&(0,r.jsx)(j,{onClose:()=>T(!1),onSelect:e=>{o(e),n.trim()||i(e.replace(/\/+$/,"").split("/").pop()??""),U(e),T(!1)}})]})}var F=s(4913),E=s(9583),L=s(2718);let D=(0,n.A)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]),T=(0,n.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var U=s(4877),H=s(2414),z=s(4276),q=s(5832);function B({summary:e}){let t=(0,d.useRouter)();return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[(0,r.jsx)(z.h,{icon:l,label:"Repositories",value:e.repos}),(0,r.jsx)(z.h,{icon:L.A,label:"Queued",value:e.queued,tone:"primary",active:e.queued>0}),(0,r.jsx)(z.h,{icon:D,label:"Running",value:e.running,tone:"primary",active:e.running>0}),(0,r.jsx)(z.h,{icon:T,label:"Merged",value:e.merged,tone:"success",active:!0}),(0,r.jsx)(z.h,{icon:U.A,label:"Needs human",value:e.needsHuman,tone:"destructive",active:e.needsHuman>0,onClick:()=>t.push("/needs-human"),hint:"Jobs that hit a guardrail and paused for review."}),(0,r.jsx)(z.h,{icon:H.A,label:"Spend today",value:(0,q.UK)(e.spendToday),tone:"primary",active:!0,sub:"across all repos"})]})}var G=s(9199);let O=(0,n.A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]),I=(0,n.A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);var V=s(742),P=s.n(V),Z=s(9694),_=s(739),W=s(8479);let K=(0,g.createServerReference)("40fcc887f9ff7ac5868aa79ea734267acaafdf2939",g.callServer,void 0,g.findSourceMapURL,"removeRepoAction");function J({repo:e}){let[t,s]=(0,c.useTransition)(),[a,n]=(0,c.useState)(!1),{success:i,error:d}=(0,W.d)(),o=e.working+e.ciRunning>0;return(0,r.jsxs)(k.Zp,{hover:!0,className:(0,q.cn)("flex flex-col gap-3 p-4",e.attention&&"border-destructive/40 bg-destructive/[0.04]"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)(P(),{href:`/repos/${e.id}`,className:"group flex min-w-0 items-center gap-2 rounded-md text-left focus-ring",children:[(0,r.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-secondary text-muted-foreground",children:(0,r.jsx)(l,{className:"h-[15px] w-[15px]"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block truncate font-mono text-sm font-semibold group-hover:underline",children:e.name}),(0,r.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.path})]})]}),e.attention?(0,r.jsxs)(h.E,{tone:"destructive",className:"shrink-0",children:[(0,r.jsx)(U.A,{className:"h-[11px] w-[11px]"})," Needs human"]}):o?(0,r.jsx)(h.E,{status:"working",className:"shrink-0",children:"Active"}):(0,r.jsx)(h.E,{tone:"neutral",className:"shrink-0",children:"Idle"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:["gitlab"===e.platform&&(0,r.jsx)(h.E,{tone:"primary",children:"GitLab"}),(0,r.jsxs)(h.E,{tone:"neutral",children:[e.queued," queued"]}),e.working>0?(0,r.jsxs)(h.E,{status:"working",children:[e.working," working"]}):(0,r.jsx)(h.E,{tone:"neutral",children:"0 working"}),e.ciRunning>0?(0,r.jsxs)(h.E,{status:"ci_running",children:[e.ciRunning," CI"]}):(0,r.jsx)(h.E,{tone:"neutral",children:"0 CI"}),e.needsHuman>0&&(0,r.jsxs)(h.E,{tone:"destructive",children:[e.needsHuman," needs human"]})]}),e.inFlight.length>0&&(0,r.jsx)("ul",{className:"flex flex-col gap-1 border-t border-card-border pt-2.5 text-xs",children:e.inFlight.slice(0,3).map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-2",children:[(0,r.jsx)(h.E,{status:e.status,className:"shrink-0 px-1.5 py-0"}),(0,r.jsx)(P(),{href:`/jobs/${e.id}`,className:"truncate text-muted-foreground transition-colors hover:text-foreground",children:(0,r.jsxs)("span",{className:"font-mono text-foreground/80",children:["#",e.issueNumber]})})]},e.id))}),(0,r.jsxs)("div",{className:"mt-auto flex items-center justify-between border-t border-card-border pt-2.5 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(H.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"tnum text-foreground/90",children:(0,q.UK)(e.todaySpend)})," today"]}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(O,{className:"h-3 w-3"}),(0,r.jsx)(_.s,{ts:e.lastActivityAt})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(P(),{href:`/repos/${e.id}`,children:(0,r.jsx)(m.$,{size:"sm",children:"Open workspace"})}),(0,r.jsx)(m.$,{size:"sm",variant:"ghost",disabled:t,onClick:()=>n(!0),"aria-label":"Remove repository",children:(0,r.jsx)(I,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)(Z.T,{open:a,onOpenChange:n,onConfirm:function(){s(async()=>{try{await K(e.id),i("Repository removed",e.name)}catch(e){d("Failed to remove repository",e instanceof Error?e.message:String(e))}})},title:"Remove repository?",description:`This stops watching ${e.name} and deletes its local job history. Repos with active jobs cannot be removed — abort or finish them first.`,confirmLabel:"Remove",variant:"destructive",pending:t})]})}var Q=s(4783),X=s(4497);function Y({value:e,limit:t,size:s=132,label:a="Spend today"}){let n=t>0?Math.min(e/t,1):0,l=t>0&&e>=t,i=(0,X.U)(l||n>=.95?"destructive":n>=.8?"warning":"primary"),d=(s-18)/2,c=2*Math.PI*d,o=.75*c,u=s/2;return(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsxs)("div",{className:"relative",style:{width:s,height:.82*s},children:[(0,r.jsxs)("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,style:{transform:"rotate(135deg)"},role:"img","aria-label":`${a}: $${e.toFixed(2)} of $${t.toFixed(0)} limit`,children:[(0,r.jsx)("circle",{cx:u,cy:u,r:d,fill:"none",stroke:"hsl(var(--secondary))",strokeWidth:9,strokeDasharray:`${o} ${c}`,strokeLinecap:"round"}),(0,r.jsx)("circle",{cx:u,cy:u,r:d,fill:"none",stroke:i,strokeWidth:9,strokeDasharray:`${o*n} ${c}`,strokeLinecap:"round"})]}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pb-1",children:[(0,r.jsxs)("span",{className:"tnum text-[26px] font-semibold leading-none",style:{color:i},children:["$",e.toFixed(2)]}),(0,r.jsxs)("span",{className:"mt-1 text-xs text-muted-foreground tnum",children:["of $",t.toFixed(0)," limit"]})]})]}),(0,r.jsx)("div",{className:"mt-1 flex items-center gap-1.5 text-xs",children:l?(0,r.jsx)(h.E,{tone:"destructive",children:"Limit reached"}):n>=.8?(0,r.jsxs)(h.E,{tone:"warning",children:[Math.round(100*n),"% used"]}):(0,r.jsxs)("span",{className:"text-muted-foreground",children:[a,t>0&&(0,r.jsxs)(r.Fragment,{children:[" \xb7 ",Math.round(100*n),"% of budget"]})]})})]})}var ee=s(9214),et=s(2836),es=s(5172);function er({initial:e,spend7d:t}){let s=(0,d.useRouter)(),[n,o]=(0,c.useState)(e),[u,x]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let e=new EventSource("/api/sse/dashboard");return e.addEventListener("snapshot",e=>{try{o(JSON.parse(e.data))}catch{}}),()=>e.close()},[]);let{repos:h,summary:p}=n,g=0===h.length,f=Math.max(h.reduce((e,t)=>e+(t.dailyLimitUsd??10),0),p.spendToday,10),j=t&&t.length>0?[...t.slice(0,-1),p.spendToday]:[p.spendToday];return(0,r.jsxs)("div",{className:"dd-fade-up",children:[(0,r.jsx)(G.z,{title:"Dashboard",subtitle:"Every watched repository, its in-flight work, and today's spend — live.",actions:(0,r.jsx)(m.$,{onClick:()=>x(e=>!e),children:u?"Cancel":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add repo"]})})}),(0,r.jsx)(B,{summary:p}),(0,r.jsxs)("div",{className:"mt-6 grid gap-6 lg:grid-cols-3",children:[(0,r.jsxs)("div",{className:"lg:col-span-2",children:[(0,r.jsx)("div",{className:"mb-3 flex items-center justify-between",children:(0,r.jsxs)("h2",{className:"text-base font-semibold",children:["Repositories"," ",(0,r.jsxs)("span",{className:"font-normal text-muted-foreground",children:["(",h.length,")"]})]})}),u&&(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(R,{onDone:()=>x(!1)})}),g&&!u?(0,r.jsx)(k.Zp,{children:(0,r.jsx)(ee.p,{icon:l,tone:"primary",title:"No repositories yet",description:"Add a local repository and Drydock will start turning its labelled issues into pull requests.",action:(0,r.jsxs)(m.$,{onClick:()=>x(!0),children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add your first repo"]})})}):(0,r.jsx)("div",{className:"dd-stagger grid gap-3 sm:grid-cols-2",children:h.map((e,t)=>(0,r.jsx)("div",{style:{animationDelay:`${50*t}ms`},children:(0,r.jsx)(J,{repo:e})},e.id))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)(k.Zp,{pad:"lg",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:"Daily budget"}),(0,r.jsx)(es.m,{content:"Combined spend today against the sum of per-repo daily limits. Turns amber at 80%, red near the cap.",children:(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),(0,r.jsx)("div",{className:"mt-2 flex justify-center",children:(0,r.jsx)(Y,{value:p.spendToday,limit:f})}),(0,r.jsxs)("div",{className:"mt-4 border-t border-card-border pt-3",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:"Spend \xb7 last 7 days"}),(0,r.jsxs)("span",{className:"tnum text-foreground/80",children:[(0,q.UK)(p.spendToday)," today"]})]}),(0,r.jsx)(et.Sparkline,{data:j,width:300,height:44,tone:"chart-1",average:!0})]})]}),(0,r.jsx)(F.C,{view:n.claudeUsage}),(0,r.jsx)(E.L,{view:n.codexUsage}),p.needsHuman>0?(0,r.jsx)(Q.F,{tone:"destructive",title:`${p.needsHuman} ${1===p.needsHuman?"job needs":"jobs need"} a human`,action:(0,r.jsx)(m.$,{size:"sm",variant:"outline",onClick:()=>s.push("/needs-human"),children:"Review"}),children:"A guardrail paused work before anything risky was written."}):(0,r.jsx)(Q.F,{tone:"success",title:"All clear",children:"No jobs are waiting on a human right now."})]})]})]})}},7217:(e,t,s)=>{"use strict";s.d(t,{D:()=>l});var r=s(515),a=s(5832);function n({htmlFor:e,className:t,children:s}){return(0,r.jsx)("label",{htmlFor:e,className:(0,a.cn)("text-sm font-medium text-foreground",t),children:s})}function l({label:e,hint:t,htmlFor:s,children:i,className:d}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",d),children:[e&&(0,r.jsx)(n,{htmlFor:s,children:e}),i,t&&(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},7405:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var r=s(515),a=s(1171),n=s(5832);let l=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)("input",{ref:s,className:(0,n.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));l.displayName="Input"},8067:(e,t,s)=>{"use strict";s.d(t,{l:()=>i});var r=s(515),a=s(3798),n=s(1171),l=s(5832);let i=n.forwardRef(({className:e,children:t,...s},n)=>(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("select",{ref:n,className:(0,l.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:t}),(0,r.jsx)(a.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));i.displayName="Select"},9199:(e,t,s)=>{"use strict";s.d(t,{z:()=>c});var r=s(515),a=s(9662),n=s(742),l=s.n(n),i=s(1171),d=s(5832);function c({title:e,subtitle:t,breadcrumb:s,actions:n,icon:o,className:u}){return(0,r.jsxs)("div",{className:(0,d.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",u),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[s&&s.length>0&&(0,r.jsx)("nav",{className:"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:s.map((e,t)=>(0,r.jsxs)(i.Fragment,{children:[t>0&&(0,r.jsx)(a.A,{className:"h-3 w-3 opacity-60","aria-hidden":!0}),e.href?(0,r.jsx)(l(),{href:e.href,className:"rounded transition-colors hover:text-foreground focus-ring",children:e.label}):(0,r.jsx)("span",{className:"text-foreground/80",children:e.label})]},e.href??e.label))}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[o&&(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,r.jsx)(o,{className:"h-[17px] w-[17px]"})}),(0,r.jsx)("h1",{className:"text-pretty text-2xl font-bold tracking-tight",children:e})]}),t&&(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),n&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:n})]})}},9214:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var r=s(515),a=s(5832);let n={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function l({icon:e,tone:t="neutral",title:s,description:i,action:d,secondary:c,className:o,compact:u}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center text-center",u?"py-10":"py-16",o),children:[e&&(0,r.jsx)("div",{className:(0,a.cn)("flex items-center justify-center rounded-2xl",u?"h-12 w-12":"h-16 w-16",n[t]),children:(0,r.jsx)(e,{className:u?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,r.jsx)("h3",{className:"mt-4 text-base font-semibold",children:s}),i&&(0,r.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:i}),(d||c)&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[d,c]})]})}},9662:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},9754:(e,t,s)=>{"use strict";s.d(t,{o:()=>l});var r=s(515),a=s(8067),n=s(1837);function l({value:e,onChange:t,agent:s,openrouterModels:i=[],id:d,className:c}){if("openrouter"===s)return(0,r.jsxs)(a.l,{id:d,value:e,onChange:e=>t(e.target.value),className:c,children:[0===i.length&&(0,r.jsx)("option",{value:"",disabled:!0,children:"No synced models — refresh the catalog in Settings"}),i.length>0&&""!==e&&!i.some(t=>t.id===e)&&(0,r.jsxs)("option",{value:e,disabled:!0,children:[e," (no longer in catalog)"]}),i.map(e=>(0,r.jsx)("option",{value:e.id,children:e.isFree?`${e.label} (free)`:e.label},e.id))]});let o=s?(0,n.tT)(s):n.L6;return(0,r.jsx)(a.l,{id:d,value:e,onChange:e=>t(e.target.value),className:c,children:o.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}}},e=>{e.O(0,[9843,1642,3433,7690,9655,4234,7358],()=>e(e.s=1104)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[942],{395:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var s=r(515),n=r(1171),a=r(5832);let i={default:"bg-primary text-primary-foreground shadow-sm hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-sm hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-sm hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2",success:"bg-success text-white shadow-sm hover-elevate active-elevate-2"},o={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-6 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg","icon-sm":"h-8 w-8 rounded-md"},l=n.forwardRef(({className:e,variant:t="default",size:r="default",type:n="button",...l},d)=>(0,s.jsx)("button",{ref:d,type:n,className:(0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i[t],o[r],e),...l}));l.displayName="Button"},598:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var s=r(515),n=r(8108),a=r(5832);function i({size:e=16,className:t}){return(0,s.jsx)(n.A,{width:e,height:e,className:(0,a.cn)("dd-spin",t),"aria-hidden":!0})}},1139:(e,t,r)=>{"use strict";r.d(t,{v:()=>n});var s=r(5097);let n=(0,s.createServerReference)("6030172ec23da9d8d9b85f482f488a3ff5648350ca",s.callServer,void 0,s.findSourceMapURL,"loadTemplateAction")},1417:(e,t,r)=>{"use strict";r.d(t,{PromptEditor:()=>C});var s=r(515),n=r(9919),a=r(3372),i=r(5378),o=r(9339),l=r(4847),d=r(6473),c=r(6106),u=r(1171),m=r(6644),x=r(395),p=r(5529),f=r(9214),v=r(7217),h=r(5897),g=r(8067),b=r(598),j=r(8479),N=r(1139),w=r(5135),y=r(2801);let S=["$ISSUE_NUM","$ISSUE_TITLE","$ISSUE_BODY","$BRANCH","$REPO_NAME","$CI_LOG"];var _=r(5832);let E=[{value:y._.main,label:"Main"},{value:y._.ciFix,label:"CI fix"},{value:y._.plan,label:"Plan"},{value:y._.limitResume,label:"Limit resume"}];function $(e){return new Date(1e3*e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function C({repos:e,initialContent:t,initialVersions:r}){let[I,A]=(0,u.useState)(t),[U,R]=(0,u.useState)(e[0]?.id??0),[k,M]=(0,u.useState)(y._.main),[D,O]=(0,u.useState)(r),[T,B]=(0,u.useTransition)(),[L,P]=(0,u.useState)(null),[F,z]=(0,u.useState)(null),{success:Z,error:G}=(0,j.d)();function H(e,t){B(async()=>{try{let r=await (0,N.v)(e,t);A(r.content),O(r.versions),P(null),z(null)}catch(e){G("Failed to load template",e instanceof Error?e.message:String(e))}})}let W=function(e,t){let r={$ISSUE_NUM:void 0!==t.ISSUE_NUM?String(t.ISSUE_NUM):"$ISSUE_NUM",$ISSUE_TITLE:t.ISSUE_TITLE??"$ISSUE_TITLE",$ISSUE_BODY:t.ISSUE_BODY??"$ISSUE_BODY",$BRANCH:t.BRANCH??"$BRANCH",$REPO_NAME:t.REPO_NAME??"$REPO_NAME",$CI_LOG:t.CI_LOG??"$CI_LOG"},s=e;for(let e of[...S].sort((e,t)=>t.length-e.length))s=s.split(e).join(r[e]??e);return s}(I,{ISSUE_NUM:42,ISSUE_TITLE:"Example issue title",ISSUE_BODY:"Example issue body with the full context the agent needs.",BRANCH:"fix/issue-42",REPO_NAME:"acme",CI_LOG:"example CI failure output"});return(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(p.Zp,{pad:"none",children:[(0,s.jsxs)(p.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)(p.ZB,{children:"Editor"}),T&&(0,s.jsx)(b.y,{size:16,className:"text-muted-foreground"})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Variables:"," ",(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:S.join(", ")})]})]}),(0,s.jsxs)(p.Wu,{className:"space-y-3 px-5 pb-5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,s.jsx)(v.D,{label:"Repository",htmlFor:"prompt-repo",className:"min-w-[180px] flex-1",children:(0,s.jsx)(g.l,{id:"prompt-repo","aria-label":"Repository",value:U,onChange:e=>{let t=Number(e.target.value);R(t),H(t,k)},children:e.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,s.jsx)(v.D,{label:"Template",children:(0,s.jsx)(h.I,{value:k,onChange:e=>{M(e),H(U,e)},options:E})})]}),F?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-card-border bg-secondary/50 px-3 py-2 text-xs text-muted-foreground",children:[(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsxs)("span",{children:["Diffing"," ",(0,s.jsxs)("span",{className:"font-medium text-foreground",children:["v",F.version]})," (",$(F.updatedAt),") vs active"]}),(0,s.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 rounded transition-colors hover:text-foreground focus-ring",onClick:()=>z(null),children:[(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),"Close diff"]})]}),(0,s.jsx)("div",{className:"h-72 overflow-hidden rounded-lg border border-card-border",children:(0,s.jsx)(n.zC,{language:"markdown",original:F.content,modified:I,options:{minimap:{enabled:!1},fontSize:13,readOnly:!0,renderSideBySide:!0}})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(x.$,{variant:"ghost",size:"sm",onClick:()=>z(null),children:"Cancel"}),(0,s.jsxs)(x.$,{disabled:T,variant:"outline",size:"sm",onClick:function(){F&&B(async()=>{try{let e=await (0,w.m)({repoId:U,name:k,content:F.content});P(e.version);let t=await (0,N.v)(U,k);A(t.content),O(t.versions),z(null),Z("Version restored",`Saved as v${e.version}`)}catch(e){G("Failed to restore version",e instanceof Error?e.message:String(e))}})},children:[(0,s.jsx)(o.A,{className:"h-4 w-4"}),"Restore v",F.version]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"h-72 overflow-hidden rounded-lg border border-card-border",children:(0,s.jsx)(n.Ay,{defaultLanguage:"markdown",value:I,onChange:e=>A(e??""),options:{minimap:{enabled:!1},fontSize:13}})}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[null!==L&&(0,s.jsxs)("span",{className:"text-xs text-success",children:["Saved v",L]}),(0,s.jsxs)(x.$,{disabled:T||!U,size:"sm",onClick:()=>B(async()=>{try{let e=await (0,w.m)({repoId:U,name:k,content:I});P(e.version);let t=await (0,N.v)(U,k);O(t.versions),Z("Template saved",`Version ${e.version}`)}catch(e){G("Failed to save template",e instanceof Error?e.message:String(e))}}),children:[(0,s.jsx)(l.A,{className:"h-4 w-4"}),"Save version"]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)(p.Zp,{pad:"none",children:[(0,s.jsx)(p.aR,{children:(0,s.jsxs)(p.ZB,{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-4 w-4 text-muted-foreground"}),"Preview",(0,s.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"(sample data)"})]})}),(0,s.jsx)(p.Wu,{className:"px-5 pb-5",children:(0,s.jsx)("pre",{className:"scrollbar-none max-h-72 overflow-auto whitespace-pre-wrap rounded-lg border border-card-border bg-secondary/40 p-3 font-mono text-xs leading-relaxed",children:W})})]}),(0,s.jsxs)(p.Zp,{pad:"none",children:[(0,s.jsx)(p.aR,{children:(0,s.jsxs)(p.ZB,{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground"}),"Version history"]})}),(0,s.jsx)(p.Wu,{className:"px-5 pb-5",children:0===D.length?(0,s.jsx)(f.p,{compact:!0,icon:c.A,title:"No versions yet",description:"Past versions appear here after you save changes."}):(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:D.map(e=>{let t=e.version===D[0]?.version,r=F?.version===e.version;return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:(0,_.cn)("flex w-full items-center gap-2 rounded-lg border px-3 py-2 text-left text-sm transition-colors focus-ring",r?"border-primary/40 bg-primary/10 text-primary":"border-transparent text-muted-foreground hover-elevate hover:text-foreground"),onClick:()=>{z(t=>t?.version===e.version?null:e)},title:t?"Active version":"Click to diff against active",children:[(0,s.jsxs)("span",{className:"font-mono font-semibold tnum",children:["v",e.version]}),t&&(0,s.jsx)(m.E,{tone:"success",children:"active"}),(0,s.jsx)("span",{className:"ml-auto tnum text-xs text-muted-foreground",children:$(e.updatedAt)})]})},e.version)})})})]})]})]})}},2049:(e,t,r)=>{Promise.resolve().then(r.bind(r,9290)),Promise.resolve().then(r.t.bind(r,742,23)),Promise.resolve().then(r.bind(r,1417))},2801:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});let s={main:"default",ciFix:"ci-fix",plan:"plan",limitResume:"limit-resume"}},5135:(e,t,r)=>{"use strict";r.d(t,{m:()=>n});var s=r(5097);let n=(0,s.createServerReference)("40997a0f75158e6053a9b7c0d68fa06915f0dd55e8",s.callServer,void 0,s.findSourceMapURL,"saveTemplateAction")},5529:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>d,ZB:()=>l,Zp:()=>i,aR:()=>o});var s=r(515),n=r(5832);let a={none:"",sm:"p-4",default:"p-5",lg:"p-6"};function i({className:e,pad:t,hover:r,...o}){return(0,s.jsx)("div",{className:(0,n.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",r&&"hover-elevate transition-shadow hover:shadow-md",t&&a[t],e),...o})}function o({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col gap-1.5 p-5",e),...t})}function l({className:e,...t}){return(0,s.jsx)("h3",{className:(0,n.cn)("text-base font-semibold leading-none tracking-tight",e),...t})}function d({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("p-5 pt-0",e),...t})}},5832:(e,t,r)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ")}function n(e){if(!e)return"no activity";let t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:new Date(1e3*e).toLocaleDateString()}function a(e){if(e>=3600){let t=Math.floor(e/3600),r=Math.round(e%3600/60);return r>0?`${t}h ${r}m`:`${t}h`}return e>=60?`${Math.floor(e/60)}m ${e%60}s`:`${e}s`}function i(e,t=2){return`$${e.toFixed(t)}`}r.d(t,{KW:()=>n,UK:()=>i,a3:()=>a,cn:()=>s})},5897:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(515),n=r(5832);function a({value:e,onChange:t,options:r,size:i="default",disabled:o=!1}){return(0,s.jsx)("div",{className:(0,n.cn)("inline-flex items-center gap-0.5 rounded-lg border border-border bg-secondary/50 p-0.5","sm"===i&&"text-xs"),children:r.map(r=>(0,s.jsx)("button",{type:"button",disabled:o,onClick:()=>t(r.value),className:(0,n.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e===r.value?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r.label},r.value))})}},6644:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var s=r(515),n=r(5832);let a={neutral:"border-border bg-secondary text-secondary-foreground",primary:"border-primary/40 bg-primary/10 text-primary",success:"border-success-border bg-success-muted text-success-foreground",warning:"border-warning-border bg-warning-muted text-warning-foreground",destructive:"border-destructive/40 bg-destructive/10 text-destructive"},i={queued:"neutral",working:"primary",ci_running:"warning",ci_failed:"destructive",retrying:"warning",waiting_limit:"warning",merged:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning",open:"neutral",triaged:"primary",releasing:"primary"},o=new Set(["working","ci_running","retrying","releasing"]);function l({className:e,status:t,tone:r,children:d,...c}){let u=r??(t?i[t]??"neutral":"neutral"),m=void 0!==t&&o.has(t);return(0,s.jsxs)("span",{className:(0,n.cn)("inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-0.5 text-[11px] font-semibold leading-4",a[u],e),...c,children:[m&&(0,s.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,s.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,s.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),d??t?.replace(/_/g," ")]})}},7217:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});var s=r(515),n=r(5832);function a({htmlFor:e,className:t,children:r}){return(0,s.jsx)("label",{htmlFor:e,className:(0,n.cn)("text-sm font-medium text-foreground",t),children:r})}function i({label:e,hint:t,htmlFor:r,children:o,className:l}){return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-1.5",l),children:[e&&(0,s.jsx)(a,{htmlFor:r,children:e}),o,t&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},8067:(e,t,r)=>{"use strict";r.d(t,{l:()=>o});var s=r(515),n=r(3798),a=r(1171),i=r(5832);let o=a.forwardRef(({className:e,children:t,...r},a)=>(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{ref:a,className:(0,i.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t}),(0,s.jsx)(n.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));o.displayName="Select"},8479:(e,t,r)=>{"use strict";r.d(t,{t:()=>m,d:()=>x});var s=r(515),n=r(8131),a=r(6003),i=r(6512),o=r(5378),l=r(1171);function d(e){return"error"===e?"assertive":"polite"}var c=r(5832);let u=(0,l.createContext)(null);function m({children:e}){let[t,r]=(0,l.useState)([]),n=(0,l.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),a=(0,l.useCallback)(e=>{let t=Date.now()+Math.random(),s={id:t,title:e.title,description:e.description,variant:e.variant??"info"};r(e=>[...e,s]),setTimeout(()=>n(t),5e3)},[n]),i=(0,l.useMemo)(()=>({toast:a,success:(e,t)=>a({title:e,description:t,variant:"success"}),error:(e,t)=>a({title:e,description:t,variant:"error"}),info:(e,t)=>a({title:e,description:t,variant:"info"})}),[a]);return(0,s.jsxs)(u.Provider,{value:i,children:[e,(0,s.jsx)(h,{toasts:t,onDismiss:n})]})}function x(){let e=(0,l.useContext)(u);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let p={success:n.A,error:a.A,info:i.A},f={success:{icon:"text-success",bar:"bg-success"},error:{icon:"text-destructive",bar:"bg-destructive"},info:{icon:"text-primary",bar:"bg-primary"}};function v({toast:e,onDismiss:t}){let r=p[e.variant],n=f[e.variant];return(0,s.jsxs)("div",{className:"dd-toast dd-toast-in pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-xl border border-card-border bg-card p-3.5 shadow-lg",children:[(0,s.jsx)(r,{className:(0,c.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",n.icon)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,s.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>t(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("span",{className:(0,c.cn)("dd-toast-progress absolute bottom-0 left-0 h-0.5 w-full",n.bar),style:{animationDuration:"5000ms"}})]})}function h({toasts:e,onDismiss:t}){let r=e.filter(e=>"assertive"===d(e.variant)),n=e.filter(e=>"polite"===d(e.variant));return(0,s.jsxs)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:[(0,s.jsx)("div",{role:"alert","aria-live":"assertive","aria-atomic":"false",className:"flex flex-col gap-2",children:r.map(e=>(0,s.jsx)(v,{toast:e,onDismiss:t},e.id))}),(0,s.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"flex flex-col gap-2",children:n.map(e=>(0,s.jsx)(v,{toast:e,onDismiss:t},e.id))})]})}},9214:(e,t,r)=>{"use strict";r.d(t,{p:()=>i});var s=r(515),n=r(5832);let a={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function i({icon:e,tone:t="neutral",title:r,description:o,action:l,secondary:d,className:c,compact:u}){return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center text-center",u?"py-10":"py-16",c),children:[e&&(0,s.jsx)("div",{className:(0,n.cn)("flex items-center justify-center rounded-2xl",u?"h-12 w-12":"h-16 w-16",a[t]),children:(0,s.jsx)(e,{className:u?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,s.jsx)("h3",{className:"mt-4 text-base font-semibold",children:r}),o&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:o}),(l||d)&&(0,s.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[l,d]})]})}}},e=>{e.O(0,[9843,6263,9655,4234,7358],()=>e(e.s=2049)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1149],{31:(e,t,s)=>{"use strict";s.d(t,{RepoAutomationBar:()=>M});var a=s(515),n=s(988),r=s(8652),l=s(6188);let i=(0,s(1330).A)("heart-pulse",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]]);var o=s(6998),d=s(2655),c=s(5595),u=s(1171),m=s(7241),h=s(9754),p=s(4783),x=s(7217),g=s(8379),f=s(7405),b=s(8067),v=s(1059),j=s(9),y=s(8479),w=s(5172),k=s(1837),N=s(8737);function S(e){try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function A(e){return[...new Set(e.split(/[,\n]/).map(e=>e.trim()).filter(Boolean))]}function C({label:e,help:t,checked:s,onChange:n,children:r}){return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(v.d,{checked:s,onChange:n,"aria-label":e}),(0,a.jsx)("span",{className:"text-sm",children:e}),t&&(0,a.jsx)(w.V,{content:t})]}),s&&r&&(0,a.jsx)("div",{className:"dd-fade-up mt-3 grid gap-3 border-l-2 border-border pl-4 sm:grid-cols-2",children:r})]})}function R({label:e,value:t,onChange:s,onBlur:n,help:r}){return(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[e,r&&(0,a.jsx)(w.V,{content:r})]}),children:(0,a.jsx)(f.p,{value:t,onChange:e=>s(e.target.value),onBlur:n,placeholder:"comma-separated",className:"h-8 font-mono text-xs"})})}function M({repo:e}){let[t,s]=(0,u.useState)(e.autoTriageEnabled),[L,P]=(0,u.useState)(e.autoProcessEnabled),[D,$]=(0,u.useState)(e.autoHealCi),[I,q]=(0,u.useState)(e.mergeWithoutChecks),[z,E]=(0,u.useState)(e.autoReviewFeedback),[F,T]=(0,u.useState)(e.autoDecompose),[B,O]=(0,u.useState)(e.planFirst),[U,H]=(0,u.useState)(e.verifyPr),[V,G]=(0,u.useState)(e.autoPrAudit),[W,J]=(0,u.useState)(e.prAuditAgent??("openrouter"===e.agent?"claude":e.agent)),[Q,_]=(0,u.useState)(e.prAuditModel??(e.prAuditAgent&&e.prAuditAgent!==e.agent?(0,k.VJ)(e.prAuditAgent):e.defaultModel)),[Z,K]=(0,u.useState)(e.prAuditLanguage),[X,Y]=(0,u.useState)(e.prAuditPostOnPr),[ee,et]=(0,u.useState)(e.autoHealDeployments),[es,ea]=(0,u.useState)(e.releaseEnabled),[en,er]=(0,u.useState)(e.autoResolveMergeConflicts),[el,ei]=(0,u.useState)(e.includeProgressReplies),[eo,ed]=(0,u.useState)(S(e.readyLabels).join(", ")),[ec,eu]=(0,u.useState)(S(e.blockingLabels).join(", ")),[em,eh]=(0,u.useState)(S(e.autoLabelWhitelist).join(", ")),[ep,ex]=(0,u.useState)(S(e.priorityAuthors).join(", ")),[eg,ef]=(0,u.useState)(S(e.trustedReviewers).join(", ")),[eb,ev]=(0,u.useState)(S(e.trustedBots).join(", ")),[ej,ey]=(0,u.useState)(S(e.ignoredBots).join(", ")),[ew,ek]=(0,u.useState)(e.minAuthorAssociation),[eN,eS]=(0,u.useState)(e.deploymentPlatform??""),[eA,eC]=(0,u.useState)(e.maxAttempts),[eR,eM]=(0,u.useState)(e.escalateModelOnRetry),[eL,eP]=(0,u.useState)("docker"===e.sandbox),[eD,e$]=(0,u.useState)(e.sandboxImage??""),[eI,eq]=(0,u.useState)(e.sandboxAllowNetwork),[ez,eE]=(0,u.useState)(e.sandboxCpus??""),[eF,eT]=(0,u.useState)(e.sandboxMemory??""),[eB,eO]=(0,u.useState)(e.agentInstructions??""),[eU,eH]=(0,u.useTransition)(),[eV,eG]=(0,u.useState)(!1),{error:eW}=(0,y.d)();function eJ(t){eG(!1),eH(async()=>{try{await (0,N.u)(e.id,t),eG(!0),setTimeout(()=>eG(!1),1500)}catch(e){eW("Failed to update automation",e instanceof Error?e.message:String(e))}})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(p.F,{tone:"info",icon:n.A,title:"Bounded & configurable",children:"Most stages are off by default and consume paid agent usage; PR review-feedback is on by default and can be turned off below. Drydock auto-merges a PR only once its configured gates pass — and merging a PR with no automated checks at all requires the explicit opt-in below."}),(0,a.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,a.jsx)(g.L,{icon:r.A,legend:"Triage",tone:"primary",description:"Classify and label brand-new issues.",children:(0,a.jsxs)(C,{label:"Auto-triage new issues",checked:t,onChange:e=>{s(e),eJ({autoTriageEnabled:e})},help:"Reads each new issue and applies whitelisted labels. Never processes — only classifies.",children:[(0,a.jsx)(R,{label:"Auto-label whitelist",value:em,onChange:eh,onBlur:()=>eJ({autoLabelWhitelist:A(em)}),help:"Triage may only apply labels from this list."}),(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Act on authors",(0,a.jsx)(w.V,{content:"Restrict automation to issues from trusted authors."})]}),children:(0,a.jsxs)(b.l,{value:ew,onChange:e=>{let t=e.target.value;ek(t),eJ({minAuthorAssociation:t})},className:"h-8 text-xs",children:[(0,a.jsx)("option",{value:"approved",children:"Owners / members / collaborators"}),(0,a.jsx)("option",{value:"any",children:"Anyone (public participation)"})]})})]})}),(0,a.jsxs)(g.L,{icon:l.A,legend:"Processing",tone:"primary",description:"Turn ready issues into pull requests.",children:[(0,a.jsxs)(C,{label:"Auto-process ready issues",checked:L,onChange:e=>{P(e),eJ({autoProcessEnabled:e})},help:"Works issues that are ready and not blocked, opening a PR for each.",children:[(0,a.jsx)(R,{label:"Ready labels",value:eo,onChange:ed,onBlur:()=>eJ({readyLabels:A(eo)}),help:"Only issues carrying one of these labels are eligible."}),(0,a.jsx)(R,{label:"Blocking labels",value:ec,onChange:eu,onBlur:()=>eJ({blockingLabels:A(ec)}),help:"Any of these labels holds an issue back."}),(0,a.jsx)(R,{label:"Priority authors",value:ep,onChange:ex,onBlur:()=>eJ({priorityAuthors:A(ep)}),help:"Issues from these authors jump the queue."}),(0,a.jsx)(x.D,{label:"Max attempts",children:(0,a.jsx)(f.p,{type:"number",min:1,value:eA,onChange:e=>eC(Number(e.target.value)),onBlur:()=>eJ({maxAttempts:eA}),className:"h-8 w-24 text-xs"})})]}),(0,a.jsx)(C,{label:"Escalate model on retry",checked:eR,onChange:e=>{eM(e),eJ({escalateModelOnRetry:e})},help:"When a failed job is requeued, the next attempt runs the next-stronger model in this agent's ladder (capped at the strongest). Each attempt is priced at the model it actually ran."}),(0,a.jsx)(C,{label:"Decompose large issues",checked:F,onChange:e=>{T(e),eJ({autoDecompose:e})},help:"Splits big issues into ordered, tracked subtasks before working them."}),(0,a.jsx)(C,{label:"Plan before implementing",checked:B,onChange:e=>{O(e),eJ({planFirst:e})},help:"A read-only planning pass before implementation; the plan is posted on the issue and embedded in the work prompt. Falls back to a normal run on failure."}),(0,a.jsx)(C,{label:"Verify PR satisfies issue",checked:U,onChange:e=>{H(e),eJ({verifyPr:e})},help:"A read-only pass after the PR opens that checks the diff against the issue and flags gaps. Never changes state on failure."}),(0,a.jsxs)(C,{label:"Audit PRs with an AI review",checked:V,onChange:e=>{G(e),eJ({autoPrAudit:e})},help:"A read-only, whole-PR review (Bugbot/CodeRabbit style) posted on the issue after the PR opens. Advisory only — it never merges, blocks, or edits anything.",children:[(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Audit agent",(0,a.jsx)(w.V,{content:"CLI agent that runs the audit. Switching agents resets the audit model to that agent's default."})]}),children:(0,a.jsx)(m.a,{value:W,onChange:e=>{if("openrouter"===e)return;let t=(0,k.VJ)(e);J(e),_(t),eJ({prAuditAgent:e,prAuditModel:t})},className:"h-8 text-xs"})}),(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Audit model",(0,a.jsx)(w.V,{content:"Model used for the audit run."})]}),children:(0,a.jsx)(h.o,{value:Q,onChange:e=>{_(e),eJ({prAuditModel:e})},agent:W,className:"h-8 text-xs"})}),(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Review language",(0,a.jsx)(w.V,{content:"Language the review is written in (e.g. en, de, pt-BR). English is the default."})]}),children:(0,a.jsx)(f.p,{value:Z,onChange:e=>K(e.target.value),onBlur:()=>{let e=Z.trim()||"en";(K(e),/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{1,8})*$/.test(e))?eJ({prAuditLanguage:e}):eW("Invalid review language",`"${e}" is not a language code — use a simple or BCP 47 code like en, de, or pt-BR.`)},placeholder:"en",className:"h-8 w-24 font-mono text-xs"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 self-end pb-1.5",children:[(0,a.jsx)(v.d,{checked:X,onChange:e=>{Y(e),eJ({prAuditPostOnPr:e})},"aria-label":"Also comment on the PR"}),(0,a.jsx)("span",{className:"text-sm",children:"Also comment on the PR"}),(0,a.jsx)(w.V,{content:"Mirror the review on the pull request in addition to the issue."})]})]}),(0,a.jsxs)(C,{label:"Address PR review feedback",checked:z,onChange:e=>{E(e),eJ({autoReviewFeedback:e})},help:"Runs the mechanical iteration for trusted reviewers and allowlisted bots.",children:[(0,a.jsx)(R,{label:"Trusted reviewers",value:eg,onChange:ef,onBlur:()=>eJ({trustedReviewers:A(eg)}),help:"Only feedback from these reviewers is acted on."}),(0,a.jsx)(R,{label:"Trusted bots",value:eb,onChange:ev,onBlur:()=>eJ({trustedBots:A(eb)}),help:"Bot reviewers (e.g. cursor[bot]) whose findings are acted on. Bots not listed here are ignored."}),(0,a.jsx)(R,{label:"Ignored bots",value:ej,onChange:ey,onBlur:()=>eJ({ignoredBots:A(ej)}),help:"Review comments from these bots are always skipped, even if also listed as trusted."})]}),(0,a.jsx)(C,{label:"Repair trivial merge conflicts",checked:en,onChange:e=>{er(e),eJ({autoResolveMergeConflicts:e})},help:"Rebases and resolves mechanical conflicts; complex ones still escalate."})]}),(0,a.jsxs)(g.L,{icon:i,legend:"CI & deploy healing",tone:"warning",description:"Keep checks and deployments green.",children:[(0,a.jsx)(C,{label:"Auto-heal failing CI",checked:D,onChange:e=>{$(e),eJ({autoHealCi:e})},help:"Attempts bounded, verified fixes for failing CI. Never touches external or AI-review checks."}),(0,a.jsx)(C,{label:"Merge PRs with no CI checks",checked:I,onChange:e=>{q(e),eJ({mergeWithoutChecks:e})},help:"For repos with manual-only or review-bot-only CI. After the merge-gate settle window, merges a PR that reports no checks at all — with NO automated verification. Leave off unless this repo truly has no automated CI."}),(0,a.jsx)(C,{label:"Heal failed deployments",checked:ee,onChange:e=>{et(e),eJ({autoHealDeployments:e})},help:"Monitors a merged PR's deployment and, on failure, opens a follow-up fix PR with the captured logs.",children:(0,a.jsx)(x.D,{label:"Deployment platform",children:(0,a.jsxs)(b.l,{value:eN,onChange:e=>{let t=e.target.value;eS(t),eJ({deploymentPlatform:t||null})},className:"h-8 text-xs",children:[(0,a.jsx)("option",{value:"",children:"Auto-detect"}),(0,a.jsx)("option",{value:"vercel",children:"Vercel"}),(0,a.jsx)("option",{value:"railway",children:"Railway"})]})})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(g.L,{icon:o.A,legend:"Releases",tone:"success",description:"Cut releases from merged work.",children:(0,a.jsx)(C,{label:"Manage releases",checked:es,onChange:e=>{ea(e),eJ({releaseEnabled:e})},help:"Evaluates merged PRs since the last tag, picks the semver bump, and publishes — gated by a global kill-switch and fully previewable."})}),(0,a.jsx)(g.L,{icon:d.A,legend:"Sandbox",tone:"warning",description:"Isolate agent execution in a container.",children:(0,a.jsxs)(C,{label:"Run the agent in a container",checked:eL,onChange:e=>{eP(e),eJ({sandbox:e?"docker":"none"})},help:"Runs this repo's agent sessions inside a container with the worktree bind-mounted as the only writable host path. Requires Docker or Podman on the host and an image that carries the agent CLI plus the repo's toolchain (devcontainer.json image is used if present). Git push still happens on the host.",children:[(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Image override",(0,a.jsx)(w.V,{content:"Container image to run in. Leave blank to use the repo's devcontainer.json image, else the global default image from Settings."})]}),children:(0,a.jsx)(f.p,{value:eD,onChange:e=>e$(e.target.value),onBlur:()=>eJ({sandboxImage:eD.trim()||null}),placeholder:"devcontainer / global default",className:"h-8 font-mono text-xs"})}),(0,a.jsx)(x.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Resource caps",(0,a.jsx)(w.V,{content:"Optional --cpus and --memory limits (e.g. 2 and 4g). Leave blank for no limit."})]}),children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(f.p,{value:ez,onChange:e=>eE(e.target.value),onBlur:()=>{let e=ez.trim();e&&!/^\d+(\.\d+)?$/.test(e)?eW("Invalid CPU limit","Use a positive number like 0.5, 1, or 2."):eJ({sandboxCpus:e||null})},placeholder:"cpus",className:"h-8 w-20 font-mono text-xs"}),(0,a.jsx)(f.p,{value:eF,onChange:e=>eT(e.target.value),onBlur:()=>{let e=eF.trim();e&&!/^\d+(\.\d+)?\s*[bkmg]?$/i.test(e)?eW("Invalid memory limit","Use a value like 512m, 2g, or 4096."):eJ({sandboxMemory:e||null})},placeholder:"memory",className:"h-8 w-24 font-mono text-xs"})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 self-end pb-1.5 sm:col-span-2",children:[(0,a.jsx)(v.d,{checked:eI,onChange:e=>{eq(e),eJ({sandboxAllowNetwork:e})},"aria-label":"Allow network access"}),(0,a.jsx)("span",{className:"text-sm",children:"Allow network access"}),(0,a.jsx)(w.V,{content:"Off (default) runs the container with --network none. Turn on only if the toolchain must fetch dependencies during the run."})]})]})}),(0,a.jsx)(g.L,{icon:c.A,legend:"Notifications",description:"How Drydock talks back on the issue.",children:(0,a.jsx)(C,{label:"Post progress replies",checked:el,onChange:e=>{ei(e),eJ({includeProgressReplies:e})},help:"Comments status updates on the issue as the job advances."})})]})]}),(0,a.jsx)(x.D,{label:"Agent instructions",hint:(0,a.jsxs)(a.Fragment,{children:["Optional. Appended to the work prompt as a dedicated section — coding conventions, “always run pnpm test”, “don’t touch legacy/”, preferred PR style. Max ",4e3," characters; empty leaves the prompt unchanged."]}),children:(0,a.jsx)(j.T,{value:eB,maxLength:4e3,rows:3,onChange:e=>eO(e.target.value),onBlur:()=>eJ({agentInstructions:eB.trim()||null}),placeholder:"Per-repo guidance injected into the work prompt…",className:"font-mono text-xs"})}),(0,a.jsx)("div",{"aria-live":"polite",className:"h-4 text-xs text-muted-foreground",children:eU?"Saving…":eV?"Saved":""})]})}},82:(e,t,s)=>{"use strict";s.d(t,{RepoReleasePanel:()=>p});var a=s(515),n=s(6998),r=s(1171),l=s(6644),i=s(395),o=s(9214),d=s(8479),c=s(5097);let u=(0,c.createServerReference)("406aa2a7a1c6a7f04aa6c87ce1e364ef1e61195c82",c.callServer,void 0,c.findSourceMapURL,"previewReleaseAction"),m=(0,c.createServerReference)("4081976aa504ae125cf426e6e894f3e547e6cbb8ee",c.callServer,void 0,c.findSourceMapURL,"publishReleaseAction"),h={detected:"neutral",evaluating:"neutral",proposed:"primary",publishing:"warning",published:"success",skipped:"neutral",error:"destructive"};function p({repoId:e,initialRuns:t}){let[s,c]=(0,r.useState)(t),[x,g]=(0,r.useState)(null),[f,b]=(0,r.useTransition)(),{error:v,success:j,info:y}=(0,d.d)();return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"})," Releases"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:function(){b(async()=>{try{g(await u(e))}catch(e){v("Preview failed",e instanceof Error?e.message:String(e))}})},disabled:f,children:"Preview"}),(0,a.jsx)(i.$,{size:"sm",onClick:function(){b(async()=>{try{let t=await m(e);c(t),g(null);let s=t[0];s?.status==="published"?j("Release published",s.tag?`Cut ${s.tag}.`:"A release was cut."):s?.status==="skipped"?y("No release cut","No release was recommended for the latest changes."):s?.status==="error"?v("Publish failed",s.errorMessage??"The release run did not complete."):y("Release started",`Run is ${s?.status??"in progress"}.`)}catch(e){v("Publish failed",e instanceof Error?e.message:String(e))}})},disabled:f,children:"Publish release"})]})]}),x&&(0,a.jsxs)("div",{className:"space-y-2 rounded-lg border border-card-border bg-secondary/30 p-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Proposed:"}),(0,a.jsx)(l.E,{tone:"primary",children:x.candidateTag}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x.fromTag?`from ${x.fromTag}`:"first release"," \xb7 ",x.bump," \xb7"," ",x.shouldRelease?"release recommended":"no release recommended"]})]}),(0,a.jsxs)("ul",{className:"flex flex-col gap-0.5 text-xs text-muted-foreground",children:[x.prs.map(e=>(0,a.jsxs)("li",{className:"truncate",children:[(0,a.jsxs)("span",{className:"font-mono",children:["#",e.number]})," ",e.title]},e.number)),0===x.prs.length&&(0,a.jsx)("li",{children:"No unreleased pull requests."})]})]}),0===s.length?(0,a.jsx)(o.p,{compact:!0,icon:n.A,title:"No release runs yet",description:"Preview or publish a release to cut one from your merged work."}):(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:s.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-3 rounded-lg border border-border p-3",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-success"}),e.tag?(0,a.jsx)("span",{className:"font-mono text-sm font-semibold",children:e.tag}):(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.mode}),e.tag&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.mode}),null!=e.triggerPrNumber&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["PR #",e.triggerPrNumber]}),(0,a.jsx)(l.E,{tone:h[e.status]??"neutral",children:e.status}),e.errorMessage&&(0,a.jsx)("span",{className:"ml-auto max-w-[40%] truncate text-xs text-destructive",title:e.errorMessage,children:e.errorMessage})]},e.id))})]})}},296:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},601:(e,t,s)=>{"use strict";s.d(t,{RepoPromptsSection:()=>A});var a=s(515),n=s(6188),r=s(8652),l=s(5595),i=s(6512),o=s(3164),d=s(742),c=s.n(d),u=s(1171),m=s(4783),h=s(6644),p=s(395),x=s(5897),g=s(9),f=s(8479),b=s(1139),v=s(5135),j=s(5097);let y=(0,j.createServerReference)("609cdd9a1dbf528a7f2faf706ffbf674d866f06489",j.callServer,void 0,j.findSourceMapURL,"deleteTemplateAction");var w=s(2801),k=s(5832);let N=[{id:"work",name:w._.main,title:"Work prompt",icon:n.A,desc:"Injected when the agent starts an issue."},{id:"triage",name:"triage",title:"Triage prompt",icon:r.A,desc:"Classifies and labels new issues."},{id:"review",name:"review-feedback",title:"Review-feedback prompt",icon:l.A,desc:"Runs when a trusted reviewer comments."}];function S({repo:e,stage:t}){let{success:s,error:n}=(0,f.d)(),[r,l]=(0,u.useState)("standard"),[o,d]=(0,u.useState)(""),[m,j]=(0,u.useState)(""),[w,k]=(0,u.useState)(!1),[N,A]=(0,u.useTransition)();(0,u.useEffect)(()=>{let s=!0;return(0,b.v)(e.id,t.name).then(e=>{s&&(d(e.content),j(e.content),l(e.hasRow?"custom":"standard"),k(!0))}).catch(e=>{s&&(n("Failed to load prompt",e instanceof Error?e.message:String(e)),k(!0))}),()=>{s=!1}},[e.id,t.name,n]);let C=m.trim()!==o.trim(),R=t.icon;return(0,a.jsxs)("div",{className:"rounded-lg border border-border p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,a.jsx)(R,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold",children:t.title}),"standard"===r?(0,a.jsx)(h.E,{tone:"neutral",children:"Standard"}):(0,a.jsx)(h.E,{tone:"primary",children:"Custom"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:t.desc})]}),(0,a.jsx)(x.I,{value:r,onChange:function(s){"custom"===s?l("custom"):A(async()=>{try{let s=await y(e.id,t.name);d(s.content),j(s.content),l("standard")}catch(e){n("Failed to revert to standard",e instanceof Error?e.message:String(e))}})},disabled:!w||N,options:[{value:"standard",label:"Standard"},{value:"custom",label:"Custom"}]})]}),"standard"===r?(0,a.jsxs)("div",{className:"mt-3 rounded-lg border border-dashed border-border bg-secondary/30 p-3",children:[(0,a.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed text-muted-foreground",children:w?o:"Loading…"}),(0,a.jsxs)("p",{className:"mt-2 inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3 w-3"})," Inherits the global default.",(0,a.jsx)(c(),{href:"/prompts",className:"text-primary hover:underline",children:"Edit the standard →"})]})]}):(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(g.T,{value:m,onChange:e=>j(e.target.value),rows:4,disabled:!w||N,className:"font-mono text-xs leading-relaxed"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-end gap-2",children:[(0,a.jsx)(p.$,{size:"sm",variant:"ghost",disabled:!C||N,onClick:()=>j(o),children:"Discard changes"}),(0,a.jsx)(p.$,{size:"sm",disabled:!C||N,onClick:function(){A(async()=>{try{await (0,v.m)({repoId:e.id,name:t.name,content:m}),d(m),s("Prompt saved",`${t.title} \xb7 ${e.name}`)}catch(e){n("Failed to save prompt",e instanceof Error?e.message:String(e))}})},children:"Save override"})]})]})]})}function A({repo:e,className:t}){return(0,a.jsxs)("div",{className:(0,k.cn)("flex flex-col gap-3",t),children:[(0,a.jsxs)(m.F,{tone:"info",icon:o.A,title:"Per-repo prompt overrides",children:["Each stage uses the global"," ",(0,a.jsx)(c(),{href:"/prompts",className:"font-medium text-primary hover:underline",children:"standard prompt"})," ","unless you switch it to ",(0,a.jsx)("span",{className:"font-medium",children:"Custom"})," here. Overrides apply only to ",e.name,"."]}),N.map(t=>(0,a.jsx)(S,{repo:e,stage:t},t.id))]})}},988:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},1024:(e,t,s)=>{"use strict";s.d(t,{Section:()=>o});var a=s(515),n=s(3798),r=s(1171),l=s(5832);let i={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function o({icon:e,title:t,description:s,defaultOpen:d=!0,right:c,collapsible:u=!0,children:m,tone:h="neutral",id:p}){let[x,g]=(0,r.useState)(d),f=(0,r.useId)(),b=()=>g(e=>!e),v=e&&(0,a.jsx)("span",{className:(0,l.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",i[h]),children:e}),j=(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:s})]});return(0,a.jsxs)("section",{id:p,className:"rounded-xl border border-card-border bg-card shadow-sm",children:[(0,a.jsxs)("div",{className:(0,l.cn)("flex items-center gap-3 p-4",!x&&"rounded-b-xl"),children:[u?(0,a.jsxs)("button",{type:"button",onClick:b,"aria-expanded":x,"aria-controls":f,className:"-m-1.5 flex min-w-0 flex-1 items-center gap-3 rounded-lg p-1.5 text-left hover-elevate focus-ring",children:[v,j]}):(0,a.jsxs)(a.Fragment,{children:[v,j]}),c&&(0,a.jsx)("div",{className:"flex items-center gap-2",children:c}),u&&(0,a.jsx)("button",{type:"button",onClick:b,"aria-label":x?"Collapse section":"Expand section","aria-expanded":x,"aria-controls":f,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover-elevate focus-ring",children:(0,a.jsx)(n.A,{className:(0,l.cn)("h-[18px] w-[18px] transition-transform duration-200",x&&"rotate-180")})})]}),x&&(0,a.jsx)("div",{id:f,className:"dd-fade-up border-t border-card-border p-4 sm:p-5",children:m})]})}},1139:(e,t,s)=>{"use strict";s.d(t,{v:()=>n});var a=s(5097);let n=(0,a.createServerReference)("6030172ec23da9d8d9b85f482f488a3ff5648350ca",a.callServer,void 0,a.findSourceMapURL,"loadTemplateAction")},1866:(e,t,s)=>{"use strict";s.d(t,{RepoWebhookPanel:()=>m});var a=s(515);let n=(0,s(1330).A)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);var r=s(1171),l=s(6644),i=s(395),o=s(7217),d=s(7405),c=s(8479),u=s(8737);function m({repo:e}){let[t,s]=(0,r.useState)(e.webhookSecret??""),[h,p]=(0,r.useState)(!1),[x,g]=(0,r.useState)(`/api/webhooks/${e.id}`),[f,b]=(0,r.useTransition)(),[v,j]=(0,r.useState)(!1),{error:y}=(0,c.d)();(0,r.useEffect)(()=>{g(`${window.location.origin}/api/webhooks/${e.id}`)},[e.id]);let w=(e.webhookSecret??"").length>0,k="gitlab"===e.platform;function N(t){j(!1),b(async()=>{try{await (0,u.u)(e.id,{webhookSecret:t.trim()||null}),j(!0),setTimeout(()=>j(!1),1500)}catch(e){y("Failed to update webhook",e instanceof Error?e.message:String(e))}})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(n,{className:"h-3.5 w-3.5 text-muted-foreground"})," Webhook sync"]}),(0,a.jsx)(l.E,{tone:w?"success":"neutral",children:w?"On":"Off"}),f&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Saving…"}),v&&(0,a.jsx)("span",{className:"text-xs text-success",children:"Saved"})]}),(0,a.jsx)(o.D,{label:"Shared secret",htmlFor:"webhook-secret",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.p,{id:"webhook-secret",type:h?"text":"password",value:t,onChange:e=>s(e.target.value),onBlur:()=>{(t.trim()||null)!==(e.webhookSecret??null)&&N(t)},placeholder:"Set a secret to enable webhook delivery",className:"min-w-0 flex-1 font-mono"}),(0,a.jsx)(i.$,{type:"button",variant:"outline",size:"sm",onClick:()=>p(e=>!e),children:h?"Hide":"Show"}),(0,a.jsx)(i.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e,t=(e=new Uint8Array(20),crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join(""));s(t),p(!0),N(t)},children:"Generate"}),w&&(0,a.jsx)(i.$,{type:"button",variant:"destructive",size:"sm",onClick:()=>{s(""),N("")},children:"Disable"})]})}),(0,a.jsx)(o.D,{label:"Payload URL",htmlFor:"webhook-url",children:(0,a.jsx)(d.p,{id:"webhook-url",readOnly:!0,value:x,onFocus:e=>e.currentTarget.select(),className:"font-mono text-xs"})}),(0,a.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["Opt-in. Polling stays on as the default and continues unchanged whether or not webhooks are configured — the two paths share the same idempotent sync, so a change is never double-processed. Point a ",k?"GitLab":"GitHub"," webhook for"," ",(0,a.jsx)("em",{children:k?"issues, comments and pipelines":"Issues, Issue comments, Check suites, Check runs, Pull request reviews and Pull request review comments"})," ","at the payload URL above with"," ",k?(0,a.jsxs)(a.Fragment,{children:["this secret as the ",(0,a.jsx)("code",{className:"font-mono",children:"Secret token"})]}):(0,a.jsxs)(a.Fragment,{children:["this secret and content type ",(0,a.jsx)("code",{className:"font-mono",children:"application/json"})]}),". Issue events drive the sync. Finished check",k?" (pipeline)":""," events wake the CI babysitter, and review events trigger the review-feedback sweep, so merges and feedback land within seconds instead of at the next poll. Drydock binds"," ",(0,a.jsx)("code",{className:"font-mono",children:"127.0.0.1"}),", so expose the URL through a tunnel or forwarder (e.g. ",(0,a.jsx)("code",{className:"font-mono",children:"cloudflared"}),","," ",(0,a.jsx)("code",{className:"font-mono",children:"ngrok"}),") to receive deliveries. Each delivery is"," ",k?"token-verified":"HMAC-SHA256 signature-verified","; invalid or unsigned payloads are rejected."]})]})}},2718:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},2801:(e,t,s)=>{"use strict";s.d(t,{_:()=>a});let a={main:"default",ciFix:"ci-fix",plan:"plan",limitResume:"limit-resume"}},2836:(e,t,s)=>{"use strict";s.d(t,{Sparkline:()=>l});var a=s(515),n=s(1171),r=s(4497);function l({data:e,width:t=132,height:s=36,tone:i="chart-1",fill:o=!0,strokeWidth:d=1.75,average:c=!1}){let u=`sp${(0,n.useId)().replace(/:/g,"")}`;if(0===e.length)return null;let m=Math.min(...e),h=Math.max(...e)-m||1,p=e.length>1?t/(e.length-1):t,x=e.map((e,t)=>[t*p,s-3-(e-m)/h*(s-6)]),g=x.map((e,t)=>`${t?"L":"M"}${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(" "),f=`${g} L${t} ${s} L0 ${s} Z`,b=(0,r.U)(i),v=x[x.length-1]??[0,s-3],j=s-3-(e.reduce((e,t)=>e+t,0)/e.length-m)/h*(s-6);return(0,a.jsxs)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:"overflow-visible","aria-hidden":"true",children:[o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:u,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:"0.22"}),(0,a.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:"0"})]})}),(0,a.jsx)("path",{d:f,fill:`url(#${u})`})]}),c&&e.length>1&&(0,a.jsx)("line",{x1:0,x2:t,y1:j,y2:j,stroke:"hsl(var(--muted-foreground) / 0.45)",strokeWidth:1,strokeDasharray:"3 3"}),(0,a.jsx)("path",{d:g,fill:"none",stroke:b,strokeWidth:d,strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("circle",{cx:v[0],cy:v[1],r:2.5,fill:b})]})}},3164:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},4054:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},4414:(e,t,s)=>{"use strict";s.d(t,{RepoSettingsBar:()=>v});var a=s(515);let n=(0,s(1330).A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var r=s(7561),l=s(988),i=s(1171),o=s(7241),d=s(9754),c=s(7217),u=s(8379),m=s(7405),h=s(1059),p=s(8479),x=s(5172),g=s(1837),f=s(8737);function b({text:e,help:t}){return(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[e,(0,a.jsx)(x.V,{content:t})]})}function v({repo:e,openrouter:t}){let[s,j]=(0,i.useState)(e.agent),[y,w]=(0,i.useState)(e.defaultModel),[k,N]=(0,i.useState)(e.dailyCostLimitUsd.toString()),[S,A]=(0,i.useState)(e.maxJobMinutes?.toString()??""),[C,R]=(0,i.useState)(e.maxCiWaitMinutes?.toString()??""),[M,L]=(0,i.useState)(e.mergeGateMinutes.toString()),[P,D]=(0,i.useState)(e.adrGating),[$,I]=(0,i.useState)(e.sequential),[q,z]=(0,i.useTransition)(),[E,F]=(0,i.useState)(!1),{error:T}=(0,p.d)();function B(t){F(!1),z(async()=>{try{await (0,f.u)(e.id,t),F(!0),setTimeout(()=>F(!1),1500)}catch(e){T("Failed to update repository",e instanceof Error?e.message:String(e))}})}function O(e,t){"maxJobMinutes"===e?A(t):R(t);let s=""===t?null:Number(t);(null===s||Number.isInteger(s)&&!(s<0))&&B({[e]:s})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(u.L,{icon:n,legend:"Agent & model",tone:"primary",description:"Which agent picks up issues in this repo, and the model it defaults to.",children:(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Queue label",help:"Issues carrying this GitHub label enter the repo's processing queue."}),children:(0,a.jsx)("code",{className:"inline-flex h-9 w-fit max-w-full items-center truncate rounded-lg bg-secondary px-3 font-mono text-xs text-muted-foreground",children:e.queueLabel})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Agent",help:"CLI agent used for new jobs in this repo."}),htmlFor:"repo-agent-select",children:(0,a.jsx)(o.a,{id:"repo-agent-select",value:s,onChange:function(e){let s="openrouter"===e?t.defaultModel||(t.models[0]?.id??""):(0,g.VJ)(e);"openrouter"===e&&""===s?T("No synced OpenRouter models","Refresh the catalog in Settings first."):(j(e),w(s),B({agent:e,defaultModel:s}))},agents:t.enabled||"openrouter"===s?["claude","codex","openrouter"]:["claude","codex"]})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Model",help:"Default model for new jobs — switching agents resets it to that agent's default."}),htmlFor:"repo-model-select",children:(0,a.jsx)(d.o,{id:"repo-model-select",value:y,onChange:function(e){w(e),B({defaultModel:e})},agent:s,openrouterModels:t.models})})]})}),(0,a.jsx)(u.L,{icon:r.A,legend:"Limits & timing",tone:"warning",description:"Spend and runtime guardrails for jobs in this repo.",children:(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Daily limit ($)",help:"Hard cap on agent spend per day for this repo. New jobs wait once the cap is hit."}),htmlFor:"repo-daily-limit",children:(0,a.jsx)(m.p,{id:"repo-daily-limit",type:"number",min:0,step:1,value:k,onChange:e=>{var t;let s;return N(t=e.target.value),s=Number(t),void(""!==t.trim()&&Number.isFinite(s)&&!(s<0)&&B({dailyCostLimitUsd:s}))}})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Max job minutes",help:"Abort jobs that run longer than this. Leave empty to use the global default."}),htmlFor:"repo-max-job-minutes",children:(0,a.jsx)(m.p,{id:"repo-max-job-minutes",type:"number",min:0,step:1,value:S,onChange:e=>O("maxJobMinutes",e.target.value),placeholder:"Global default"})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Max CI wait minutes",help:"How long to wait for CI before giving up. Leave empty to use the global default."}),htmlFor:"repo-max-ci-wait-minutes",children:(0,a.jsx)(m.p,{id:"repo-max-ci-wait-minutes",type:"number",min:0,step:1,value:C,onChange:e=>O("maxCiWaitMinutes",e.target.value),placeholder:"Global default"})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Merge gate minutes",help:"Hold the auto-merge after green CI so late bot or human reviews can land first. 0 merges immediately."}),htmlFor:"repo-merge-gate-minutes",children:(0,a.jsx)(m.p,{id:"repo-merge-gate-minutes",type:"number",min:0,step:1,value:M,onChange:e=>{var t;let s;return L(t=e.target.value),s=Number(t),void(""!==t&&Number.isInteger(s)&&!(s<0)&&B({mergeGateMinutes:s}))},placeholder:"0 = merge on green"})})]})}),(0,a.jsx)(u.L,{icon:l.A,legend:"Gates",description:"Checks that hold work before it lands.",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsxs)("label",{htmlFor:"repo-adr-gate",className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(h.d,{id:"repo-adr-gate",checked:P,onChange:function(e){D(e),B({adrGating:e})},"aria-label":"ADR gate"}),"ADR gate"]}),(0,a.jsx)(x.V,{content:"Hold the merge while ADRs await review — the job parks as needs-human until pending decisions are approved."})]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsxs)("label",{htmlFor:"repo-sequential",className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(h.d,{id:"repo-sequential",checked:$,onChange:function(e){I(e),B({sequential:e})},"aria-label":"Sequential (wait for merge)"}),"Sequential"]}),(0,a.jsx)(x.V,{content:"Process one issue at a time — wait for the open PR to merge before starting the next job."})]}),(0,a.jsx)("span",{"aria-live":"polite",className:"ml-auto text-xs text-muted-foreground",children:q?"Saving…":E?"Saved":""})]})})]})}},4497:(e,t,s)=>{"use strict";function a(e){return e?`hsl(var(--${e}))`:"hsl(var(--muted-foreground))"}s.d(t,{U:()=>a})},4602:(e,t,s)=>{Promise.resolve().then(s.bind(s,9290)),Promise.resolve().then(s.t.bind(s,742,23)),Promise.resolve().then(s.bind(s,5446)),Promise.resolve().then(s.bind(s,715)),Promise.resolve().then(s.bind(s,31)),Promise.resolve().then(s.bind(s,601)),Promise.resolve().then(s.bind(s,82)),Promise.resolve().then(s.bind(s,4414)),Promise.resolve().then(s.bind(s,1866)),Promise.resolve().then(s.bind(s,1024)),Promise.resolve().then(s.bind(s,2836))},4847:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},5135:(e,t,s)=>{"use strict";s.d(t,{m:()=>n});var a=s(5097);let n=(0,a.createServerReference)("40997a0f75158e6053a9b7c0d68fa06915f0dd55e8",a.callServer,void 0,a.findSourceMapURL,"saveTemplateAction")},5446:(e,t,s)=>{"use strict";s.d(t,{IssueBoard:()=>ea});var a=s(515),n=s(1330);let r=(0,n.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),l=(0,n.A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),i=(0,n.A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var o=s(5378),d=s(296),c=s(9564),u=s(2718),m=s(1528),h=s(6998),p=s(8652),x=s(1171);let g=(0,n.A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var f=s(4054),b=s(4847),v=s(9320),j=s(5595),y=s(7241),w=s(9754),k=s(4783),N=s(6644),S=s(395),A=s(9694),C=s(7901),R=s(9214),M=s(7217),L=s(7405),P=s(9),D=s(5097);let $=(0,D.createServerReference)("6003eba99a7cf5bc7fa9967a0706bfa1838924afb2",D.callServer,void 0,D.findSourceMapURL,"viewIssueAction"),I=(0,D.createServerReference)("60eabaacff459852d9a4c65318e1f5f3af0f8a1c3c",D.callServer,void 0,D.findSourceMapURL,"listSubtasksAction"),q=(0,D.createServerReference)("7072926bc1bfbc88d26c7c57c60193191e2dd21c2d",D.callServer,void 0,D.findSourceMapURL,"setIssueStateAction"),z=(0,D.createServerReference)("7088a73060e2fb01e0e2562c14954015dc541865b3",D.callServer,void 0,D.findSourceMapURL,"startIssueAction"),E=(0,D.createServerReference)("602dce4b14453b4518567ca38bcc13ce3f3ce76fe4",D.callServer,void 0,D.findSourceMapURL,"removeFromQueueAction"),F=(0,D.createServerReference)("70b0e23a05537efb81cb606a449c9bb98467cbd4bd",D.callServer,void 0,D.findSourceMapURL,"addToQueueAction"),T=(0,D.createServerReference)("700903b9129943d3b489d05465990a033f4c419e56",D.callServer,void 0,D.findSourceMapURL,"editIssueAction"),B=(0,D.createServerReference)("784d415ac7886ea8db0614d9a993b85b509a5d8999",D.callServer,void 0,D.findSourceMapURL,"setIssueLabelsAction"),O=(0,D.createServerReference)("7029508c5f49d4d04208ad53a349fbfe2b749d44de",D.callServer,void 0,D.findSourceMapURL,"commentIssueAction");var U=s(1837);let H={pending:{label:"Pending",symbol:"○",tone:"neutral"},in_progress:{label:"In progress",symbol:"◐",tone:"primary"},done:{label:"Done",symbol:"✓",tone:"success"},skipped:{label:"Skipped",symbol:"⊘",tone:"neutral"},deferred:{label:"Deferred",symbol:"⏸",tone:"warning"}};function V({repoId:e,issueNumber:t,open:s,onClose:n,queueLabel:r,defaultModel:l,defaultAgent:i}){let[o,d]=(0,x.useState)(null),[c,u]=(0,x.useState)([]),[m,p]=(0,x.useState)(""),[D,G]=(0,x.useState)(""),[W,J]=(0,x.useState)(""),[Q,_]=(0,x.useState)(""),[Z,K]=(0,x.useState)(l),[X,Y]=(0,x.useState)(i),[ee,et]=(0,x.useState)(null),[es,ea]=(0,x.useState)(!1),[en,er]=(0,x.useTransition)();function el(){null!==t&&($(e,t).then(d).catch(e=>et(e.message)),I(e,t).then(u).catch(()=>u([])))}function ei(t){o&&er(()=>{q(e,o.number,t).then(el).catch(e=>et(e.message))})}if((0,x.useEffect)(()=>{K(l),Y(i)},[l,i]),(0,x.useEffect)(()=>{s&&null!==t&&(et(null),d(null),u([]),$(e,t).then(e=>{d(e),p(e.title),G(e.body)}).catch(e=>et(e.message)),I(e,t).then(u).catch(()=>u([])))},[s,t,e]),null===t)return null;let eo=`issue-modal-title-${t}`;return(0,a.jsxs)(C.l,{open:s,onClose:n,labelledById:eo,children:[(0,a.jsxs)("span",{id:eo,className:"sr-only",children:["Issue #",t]}),ee&&(0,a.jsx)(k.F,{tone:"destructive",className:"mb-3",children:ee}),o?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs font-mono text-muted-foreground tnum",children:["#",o.number]}),(0,a.jsx)(N.E,{status:o.state}),(0,a.jsx)(S.$,{size:"sm",variant:"outline",className:"ml-auto",disabled:en,onClick:()=>"open"===o.state?ea(!0):ei("open"),children:"open"===o.state?"Close issue":"Reopen issue"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-card-border bg-secondary/40 p-4",children:[(0,a.jsxs)("h3",{className:"mb-3 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(g,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Run settings"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,a.jsx)(M.D,{label:"Agent",htmlFor:"modal-agent-select",children:(0,a.jsx)(y.a,{id:"modal-agent-select",value:X,onChange:e=>{Y(e),K((0,U.VJ)(e))}})}),(0,a.jsx)(M.D,{label:"Model",htmlFor:"modal-model-select",children:(0,a.jsx)(w.o,{id:"modal-model-select",value:Z,onChange:K,agent:X})}),(0,a.jsxs)(S.$,{size:"sm",disabled:en,onClick:()=>er(()=>{z(e,o.number,{model:Z!==l?Z:void 0,agent:X!==i?X:void 0}).then(()=>n()).catch(e=>et(e.message))}),children:[(0,a.jsx)(f.A,{}),"Start job now"]}),o.labels.includes(r)?(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en,onClick:()=>er(()=>{E(e,o.number).then(el).catch(e=>et(e.message))}),children:"Dequeue"}):(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en,onClick:()=>er(()=>{F(e,o.number,{model:Z!==l?Z:void 0,agent:X!==i?X:void 0}).then(el).catch(e=>et(e.message))}),children:"Add to queue"})]}),Z!==l||X!==i?(0,a.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:["Override active — repo default:"," ",(0,a.jsx)("span",{className:"font-medium text-foreground",children:l})]}):null]}),(0,a.jsx)(L.p,{value:m,onChange:e=>p(e.target.value),className:"font-medium"}),(0,a.jsx)(P.T,{value:D,onChange:e=>G(e.target.value),rows:8}),(0,a.jsxs)(S.$,{size:"sm",disabled:en,onClick:()=>er(()=>{T(e,o.number,{title:m,body:D}).then(el).catch(e=>et(e.message))}),children:[(0,a.jsx)(b.A,{}),"Save changes"]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Labels"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.labels.map(t=>(0,a.jsx)("button",{type:"button",title:"Remove label",disabled:en,className:"rounded-md focus-ring disabled:opacity-50",onClick:()=>er(()=>{B(e,o.number,[],[t]).then(el).catch(e=>et(e.message))}),children:(0,a.jsxs)(N.E,{className:"cursor-pointer",children:[t," \xd7"]})},t)),(0,a.jsx)(L.p,{value:Q,onChange:e=>_(e.target.value),placeholder:"add label",className:"h-8 w-28 text-xs"}),(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en||!Q.trim(),onClick:()=>er(()=>{B(e,o.number,[Q.trim()],[]).then(()=>{_(""),el()}).catch(e=>et(e.message))}),children:"Add"})]})]}),c.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Subtasks (",c.filter(e=>"done"===e.status).length,"/",c.length,")"]}),(0,a.jsx)("ol",{className:"space-y-1.5",children:c.map(e=>{let t=H[e.status]??{label:e.status,symbol:"○",tone:"neutral"},s="done"===e.status||"skipped"===e.status;return(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded-lg border border-card-border bg-secondary/40 px-3 py-1.5 text-sm",children:[(0,a.jsx)("span",{className:"text-muted-foreground","aria-hidden":!0,children:t.symbol}),(0,a.jsx)("span",{className:s?"text-muted-foreground line-through":"",children:e.title}),(0,a.jsx)("span",{className:"ml-auto",children:(0,a.jsx)(N.E,{tone:t.tone,children:t.label})})]},e.id)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(j.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Comments"]}),(0,a.jsxs)("ul",{className:"space-y-2",children:[o.comments.map(e=>(0,a.jsxs)("li",{className:"rounded-lg border border-card-border bg-secondary/40 p-3 text-sm",children:[(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"font-medium text-foreground",children:e.author})," \xb7 ",e.createdAt]}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-pretty",children:e.body})]},`${e.author}-${e.createdAt}`)),0===o.comments.length&&(0,a.jsx)("li",{children:(0,a.jsx)(R.p,{compact:!0,icon:j.A,title:"No comments yet",description:"Discussion from GitHub shows up here."})})]}),(0,a.jsx)(P.T,{value:W,onChange:e=>J(e.target.value),rows:3,placeholder:"Write a comment…",className:"mt-2"}),(0,a.jsx)(S.$,{size:"sm",className:"mt-2",disabled:en||!W.trim(),onClick:()=>er(()=>{O(e,o.number,W.trim()).then(()=>{J(""),el()}).catch(e=>et(e.message))}),children:"Comment"})]})]}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),o&&(0,a.jsx)(A.T,{open:es,onOpenChange:ea,onConfirm:()=>ei("closed"),title:"Close issue?",description:`This closes #${o.number} on GitHub.`,confirmLabel:"Close issue",variant:"destructive",pending:en})]})}var G=s(4148),W=s(8479),J=s(5172);let Q=(0,D.createServerReference)("402b4d0a084d74a542bd5e68a4e346d99a2c2fb656",D.callServer,void 0,D.findSourceMapURL,"syncRepoIssuesAction"),_=(0,D.createServerReference)("60b9133bada35485d05f7b139b053e21ba8b57d7bc",D.callServer,void 0,D.findSourceMapURL,"reorderIssuesAction"),Z=(0,D.createServerReference)("607c5a4c4dc706fb3a46264121179bae12a54df26a",D.callServer,void 0,D.findSourceMapURL,"bulkAddToQueueAction"),K=(0,D.createServerReference)("60c4ca7d30a901f49d1379857320b5000765341812",D.callServer,void 0,D.findSourceMapURL,"bulkRemoveFromQueueAction"),X=(0,D.createServerReference)("70782ef64129fb275bd4f420c29400bb22fa476948",D.callServer,void 0,D.findSourceMapURL,"bulkApplyLabelAction");var Y=s(5832);function ee(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function et({issue:e,reorderable:t,queueLabel:s,queueIndex:n,queueSize:c,isDragging:u,isOver:m,isFlash:h,selected:p,pending:x,onToggleSelect:g,onOpen:f,onAddToQueue:b,onRemoveFromQueue:v,onMoveUp:j,onMoveDown:y,onDragStartRow:w,onDragEnterRow:k,onDragEndRow:A,onDropRow:C}){let R=ee(e.labels).filter(e=>e!==s),M=`issue-select-${e.number}`;return(0,a.jsxs)("div",{draggable:!0,onDragStart:t=>{w(),t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain",String(e.number))}catch{}},onDragEnter:k,onDragOver:e=>e.preventDefault(),onDragEnd:A,onDrop:e=>{e.preventDefault(),e.stopPropagation(),C()},className:(0,Y.cn)("issue-row group flex items-center gap-3 rounded-lg border border-transparent bg-card px-3 py-2.5 hover-elevate",u&&"opacity-40",m&&"ring-1 ring-primary/70",h&&"bg-success/[0.06] ring-1 ring-success/70"),children:[(0,a.jsx)(r,{"aria-hidden":!0,className:"h-[15px] w-[15px] shrink-0 cursor-grab text-muted-foreground/40 group-hover:text-muted-foreground active:cursor-grabbing"}),(0,a.jsx)(G.S,{id:M,checked:p,onChange:g,"aria-label":`Select #${e.number} for bulk actions`,className:"shrink-0"}),t&&(0,a.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary text-[11px] font-semibold tabular-nums text-primary-foreground",children:n+1}),(0,a.jsxs)("button",{type:"button",onClick:f,className:"flex min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-ring",children:[(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:["#",e.number]}),(0,a.jsx)("span",{className:"truncate text-sm group-hover:text-foreground",children:e.title})]}),(0,a.jsxs)("div",{className:"hidden shrink-0 items-center gap-1.5 md:flex",children:[e.triagedAt&&(0,a.jsx)(J.m,{content:"Labels applied by auto-triage — see the issue comment for reasons",children:(0,a.jsx)(N.E,{tone:"primary",children:"auto-triaged"})}),R.slice(0,2).map(e=>(0,a.jsx)("span",{className:"rounded-md bg-secondary px-1.5 py-0.5 text-[11px] text-muted-foreground",children:e},e))]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-0.5",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Move #${e.number} up in queue`,disabled:0===n||x,onClick:j,className:"h-7 w-7",children:(0,a.jsx)(l,{})}),(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Move #${e.number} down in queue`,disabled:n===c-1||x,onClick:y,className:"h-7 w-7",children:(0,a.jsx)(i,{})}),(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Remove #${e.number} from queue`,disabled:x,onClick:v,className:"h-7 w-7 text-destructive hover:text-destructive",children:(0,a.jsx)(o.A,{})})]}):(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Add #${e.number} to queue`,disabled:x,onClick:b,className:"h-7 w-7",children:(0,a.jsx)(d.A,{})})})]})}function es({zone:e,icon:t,title:s,count:n,hint:r,empty:l,emptyDrop:i,dropping:o,isEmpty:d,onDropZone:c,onClearOver:u,children:m}){return(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),e.currentTarget===e.target&&u()},onDrop:e=>{e.preventDefault(),c()},"data-zone":e,className:(0,Y.cn)("rounded-xl border p-2 transition-colors",o?"border-dashed border-primary/45 bg-primary/[0.03]":"border-card-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[(0,a.jsx)(t,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:s}),(0,a.jsx)(N.E,{tone:"neutral",children:n}),(0,a.jsx)("span",{className:"ml-auto hidden text-xs text-muted-foreground sm:block",children:r})]}),d?(0,a.jsx)("div",{className:(0,Y.cn)("m-1 rounded-lg border border-dashed px-3 py-6 text-center text-xs transition-colors",o?"border-primary/50 text-primary":"border-border text-muted-foreground"),children:o?i:l}):(0,a.jsx)("div",{className:"flex flex-col gap-0.5 p-1",children:m})]})}function ea({repoId:e,queueLabel:t,initialIssues:s,pollIntervalSec:n,defaultModel:l,defaultAgent:i}){let[d,g]=(0,x.useState)(s),[f,b]=(0,x.useState)(""),[v,j]=(0,x.useState)(null),[y,w]=(0,x.useState)(null),[k,N]=(0,x.useState)(null),[A,C]=(0,x.useState)(null),[R,M]=(0,x.useState)(new Set),[P,D]=(0,x.useState)(""),[$,I]=(0,x.useTransition)(),[q,z]=(0,x.useState)(null),{success:T}=(0,W.d)();(0,x.useEffect)(()=>g(s),[s]),(0,x.useEffect)(()=>{let t=setInterval(()=>{Q(e).then(g).catch(e=>z(e.message))},1e3*Math.max(10,n));return()=>clearInterval(t)},[e,n]);let B=e=>ee(e.labels).includes(t),O=e=>{let t=f.toLowerCase();return!t||e.title.toLowerCase().includes(t)||String(e.number).includes(t)||ee(e.labels).some(e=>e.toLowerCase().includes(t))},U=d.filter(e=>!B(e)&&O(e)),H=d.filter(e=>B(e)&&O(e));function G(){j(null),w(null)}function J(){if(null===v)return;let t=d.find(e=>e.number===v),s=t?.title;G(),!t||B(t)||I(()=>{F(e,v).then(e=>{g(e),N(v),setTimeout(()=>N(e=>e===v?null:e),1200),T("Issue queued",`#${v} ${s??""}`.trim())}).catch(e=>z(e.message))})}function en(){if(null===v)return;let t=d.find(e=>e.number===v);G(),t&&B(t)&&I(()=>{E(e,t.number).then(g).catch(e=>z(e.message))})}function er(){M(new Set)}function el(e){let t=[...R];0!==t.length&&(z(null),I(()=>{e(t).then(e=>{g(e),er()}).catch(e=>z(e.message))}))}let ei=d.filter(B).map(e=>e.number),eo=null!==v;function ed(s,n){return(0,a.jsx)(et,{issue:s,reorderable:n,queueLabel:t,queueIndex:ei.indexOf(s.number),queueSize:ei.length,isDragging:v===s.number,isOver:y===s.number&&null!==v&&v!==s.number,isFlash:k===s.number,selected:R.has(s.number),pending:$,onToggleSelect:()=>{var e;return e=s.number,void M(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onOpen:()=>C(s.number),onAddToQueue:()=>{var t;return t=s.number,void I(()=>{F(e,t).then(g).catch(e=>z(e.message))})},onRemoveFromQueue:()=>{var t;return t=s.number,void I(()=>{E(e,t).then(g).catch(e=>z(e.message))})},onMoveUp:()=>{let t;return t=function(e,t){let s=e.indexOf(t);if(s<=0)return e;let a=[...e],n=a[s-1];return a[s-1]=a[s],a[s]=n,a}(ei,s.number),void I(()=>{_(e,t).catch(e=>z(e.message))})},onMoveDown:()=>{let t;return t=function(e,t){let s=e.indexOf(t);if(-1===s||s===e.length-1)return e;let a=[...e],n=a[s+1];return a[s+1]=a[s],a[s]=n,a}(ei,s.number),void I(()=>{_(e,t).catch(e=>z(e.message))})},onDragStartRow:()=>j(s.number),onDragEnterRow:()=>w(s.number),onDragEndRow:G,onDropRow:()=>{let t;!(t=null===v?void 0:d.find(e=>e.number===v))?G():B(t)===n?n?function(t){if(G(),null===v||v===t)return;let s=d.find(e=>e.number===v);if(!s||!B(s))return;let a=function(e,t,s){if(t===s||!e.includes(t))return e;let a=e.filter(e=>e!==t),n=a.indexOf(s);return -1===n?e:(a.splice(n,0,t),a)}(d.filter(B).map(e=>e.number),v,t);I(()=>{_(e,a).catch(e=>z(e.message))})}(s.number):G():n?J():en()}},s.number)}return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)(r,{className:"h-3.5 w-3.5"})," Drag to set priority, or drop an issue into the queue to schedule it."]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative w-full sm:w-56",children:[(0,a.jsx)(c.A,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(L.p,{"aria-label":"Search issues by title or label",value:f,onChange:e=>b(e.target.value),placeholder:"Filter issues",className:"h-8 pl-8 text-xs"})]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$||0===U.length,onClick:function(){let t=U.map(e=>e.number);0!==t.length&&(z(null),I(()=>{Z(e,t).then(g).catch(e=>z(e.message))}))},children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"})," Queue all"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:function(){z(null),I(()=>{Q(e).then(g).catch(e=>z(e.message))})},children:[(0,a.jsx)(m.A,{className:(0,Y.cn)("h-3.5 w-3.5",$&&"dd-spin")}),$?"Syncing…":"Refresh"]})]})]}),q&&(0,a.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:q}),R.size>0&&(0,a.jsxs)("div",{className:"dd-fade-up flex flex-wrap items-center gap-2 rounded-xl border border-primary/40 bg-primary/[0.04] p-2",children:[(0,a.jsxs)("span",{className:"px-1 text-sm font-medium",children:[R.size," selected"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:()=>el(t=>Z(e,t)),children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"})," Add to queue"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:()=>el(t=>K(e,t)),children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"})," Remove from queue"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(L.p,{"aria-label":"Label to apply to selected issues",value:P,onChange:e=>D(e.target.value),placeholder:"label…",className:"h-8 w-28 text-xs"}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$||""===P.trim(),onClick:()=>{let t=P.trim();el(s=>X(e,s,t)),D("")},children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"})," Apply label"]})]}),(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"ml-auto",disabled:$,onClick:er,children:"Clear"})]}),(0,a.jsx)(es,{zone:"queue",icon:u.A,title:"Queue",count:H.length,hint:"top = next to run",empty:"Nothing queued. Drag an issue up from the backlog, or use the + button.",emptyDrop:"Drop here",dropping:eo,onDropZone:J,onClearOver:()=>w(null),isEmpty:0===H.length,children:H.map(e=>ed(e,!0))}),(0,a.jsx)(es,{zone:"backlog",icon:p.A,title:"Backlog \xb7 triage",count:U.length,hint:"drag up to schedule",empty:"Backlog is empty.",emptyDrop:"Drop here",dropping:eo,onDropZone:en,onClearOver:()=>w(null),isEmpty:0===U.length,children:U.map(e=>ed(e,!1))}),(0,a.jsx)(V,{repoId:e,issueNumber:A,open:null!==A,onClose:()=>C(null),queueLabel:t,defaultModel:l,defaultAgent:i})]})}},5595:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},5897:(e,t,s)=>{"use strict";s.d(t,{I:()=>r});var a=s(515),n=s(5832);function r({value:e,onChange:t,options:s,size:l="default",disabled:i=!1}){return(0,a.jsx)("div",{className:(0,n.cn)("inline-flex items-center gap-0.5 rounded-lg border border-border bg-secondary/50 p-0.5","sm"===l&&"text-xs"),children:s.map(s=>(0,a.jsx)("button",{type:"button",disabled:i,onClick:()=>t(s.value),className:(0,n.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e===s.value?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}},6188:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("git-pull-request-arrow",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]])},6998:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},8379:(e,t,s)=>{"use strict";s.d(t,{L:()=>l});var a=s(515),n=s(5832);let r={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function l({icon:e,legend:t,description:s,tone:i="neutral",children:o}){return(0,a.jsxs)("fieldset",{className:"rounded-lg border border-border p-4",children:[(0,a.jsxs)("legend",{className:"flex items-center gap-2 px-1",children:[(0,a.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md",r[i]),children:(0,a.jsx)(e,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:t})]}),s&&(0,a.jsx)("p",{className:"mb-3 mt-1 text-xs text-muted-foreground",children:s}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:o})]})}},8652:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},8737:(e,t,s)=>{"use strict";s.d(t,{u:()=>n});var a=s(5097);let n=(0,a.createServerReference)("60861191b2d2651b7286a7965542afae3ae420dd40",a.callServer,void 0,a.findSourceMapURL,"updateRepoAction")},9320:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])},9564:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(1330).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}},e=>{e.O(0,[9843,1642,4624,3433,1298,3894,9655,4234,7358],()=>e(e.s=4602)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{395:(e,a,t)=>{"use strict";t.d(a,{$:()=>i});var s=t(515),r=t(1171),n=t(5832);let l={default:"bg-primary text-primary-foreground shadow-sm hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-sm hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-sm hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2",success:"bg-success text-white shadow-sm hover-elevate active-elevate-2"},o={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-6 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg","icon-sm":"h-8 w-8 rounded-md"},i=r.forwardRef(({className:e,variant:a="default",size:t="default",type:r="button",...i},d)=>(0,s.jsx)("button",{ref:d,type:r,className:(0,n.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",l[a],o[t],e),...i}));i.displayName="Button"},1528:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(1330).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},2211:(e,a,t)=>{"use strict";t.d(a,{SettingsForm:()=>O});var s=t(515),r=t(5662),n=t(1330);let l=(0,n.A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),o=(0,n.A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);var i=t(2655);let d=(0,n.A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),c=(0,n.A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),u=(0,n.A)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);var m=t(1528);let h=(0,n.A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var p=t(8762),x=t(2235),g=t(1171),f=t(7241),v=t(9754),b=t(4783),j=t(395),y=t(5529),N=t(4148),w=t(7217),k=t(7405),C=t(8067),A=t(598),M=t(1059),D=t(8479);let S=["needs_human","job_failed","pr_opened","pr_merged","release_published","cost_limit","claude_limit","codex_limit","openrouter_limit","auth_expired","automation_paused"],R={needs_human:"Job needs human",job_failed:"Job aborted or failed",pr_opened:"Pull request opened",pr_merged:"Pull request merged",release_published:"Release published",cost_limit:"Daily cost limit reached",claude_limit:"Claude usage limit reached or cleared",codex_limit:"Codex usage limit reached or cleared",openrouter_limit:"OpenRouter limit reached or cleared",auth_expired:"Credentials expired or restored",automation_paused:"Automation paused or draining"};var P=t(5097);let _=(0,P.createServerReference)("400cb75b50864ab4e5773316481a0f4d0300adb012",P.callServer,void 0,P.findSourceMapURL,"testOpenRouterConnectionAction"),T=(0,P.createServerReference)("40bb83dbce8c0dd698e1c9f3ff88d8a372d3372cff",P.callServer,void 0,P.findSourceMapURL,"refreshOpenRouterCatalogAction");var L=t(7635);let $=(0,P.createServerReference)("40a385ca6c1b8479def93fa7e48a72fcfaf4c58010",P.callServer,void 0,P.findSourceMapURL,"saveSettingsAction"),E=(0,P.createServerReference)("00f17bccf1224c648f7e7a74f84441484b3c19a422",P.callServer,void 0,P.findSourceMapURL,"sendTestNotificationAction");function O({initial:e,openrouter:a}){let[t,n]=(0,g.useState)(e),[P,U]=(0,g.useTransition)(),[I,F]=(0,g.useTransition)(),[z,W]=(0,g.useTransition)(),[H,Z]=(0,g.useTransition)(),J=(0,x.useRouter)(),{success:K,error:q,info:B}=(0,D.d)(),G=(e,a)=>{n(t=>({...t,[e]:a}))};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[t.paused&&(0,s.jsx)(b.F,{tone:"warning",icon:r.A,title:"Global kill-switch is on",children:"All automation is suspended across every repository. Manual runs still work."}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(l,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"Automation & limits"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"One switch to halt everything, plus how aggressively the dock works."})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Global kill-switch"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Immediately pause all triage, processing, healing and releases."})]}),(0,s.jsx)(M.d,{checked:t.paused,disabled:z,onChange:e=>{G("paused",e),W(async()=>{try{await (0,L.$)(e),B(e?"Automation suspended":"Automation resumed")}catch(a){G("paused",!e),q("Failed to toggle automation",a instanceof Error?a.message:String(a))}})},"aria-label":"Global kill-switch"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Release management"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Let the dock tag and publish releases automatically."})]}),(0,s.jsx)(M.d,{checked:t.releaseManagementEnabled,onChange:e=>G("releaseManagementEnabled",e),"aria-label":"Release management"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Auto-wait on Claude usage limits"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Park jobs when the Claude quota is exhausted and resume them automatically once it resets, instead of paging you."})]}),(0,s.jsx)(M.d,{checked:t.claudeLimitAutoWait,onChange:e=>G("claudeLimitAutoWait",e),"aria-label":"Auto-wait on Claude usage limits"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Auto-wait on Codex usage limits"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Park jobs when the Codex quota or rate limit is exhausted and resume them automatically once capacity returns, instead of paging you."})]}),(0,s.jsx)(M.d,{checked:t.codexLimitAutoWait,onChange:e=>G("codexLimitAutoWait",e),"aria-label":"Auto-wait on Codex usage limits"})]}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[(0,s.jsx)(w.D,{label:"Poll interval (s)",hint:"How often to check for new issues.",children:(0,s.jsx)(k.p,{type:"number",value:t.pollIntervalSec,onChange:e=>G("pollIntervalSec",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Concurrent jobs",hint:"Max runs in flight at once.",children:(0,s.jsx)(k.p,{type:"number",value:t.maxParallelJobs,onChange:e=>G("maxParallelJobs",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Daily cost limit (USD)",hint:"Stops new runs once reached today.",children:(0,s.jsx)(k.p,{type:"number",step:"0.5",value:t.dailyCostLimitUsd,onChange:e=>G("dailyCostLimitUsd",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Max turns",hint:"Hard cap on agent turns per job.",children:(0,s.jsx)(k.p,{type:"number",value:t.maxTurns,onChange:e=>G("maxTurns",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Max job minutes",hint:"Abort a run after this wall-clock time.",children:(0,s.jsx)(k.p,{type:"number",value:t.maxJobMinutes,onChange:e=>G("maxJobMinutes",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Max CI wait (min)",hint:"How long to wait for CI before giving up.",children:(0,s.jsx)(k.p,{type:"number",value:t.maxCiWaitMinutes,onChange:e=>G("maxCiWaitMinutes",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Max job cost (USD)",hint:"0 disables the per-job cost cap.",children:(0,s.jsx)(k.p,{type:"number",min:"0",step:"0.01",value:t.maxJobCostUsd,onChange:e=>G("maxJobCostUsd",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"Default agent",hint:"Used when a repo has none set.",children:(0,s.jsx)(f.a,{value:t.defaultAgent,onChange:e=>{"openrouter"!==e&&G("defaultAgent",e)}})}),(0,s.jsx)(w.D,{label:"Default model",hint:"Used when a repo has none set.",children:(0,s.jsx)(v.o,{value:t.defaultModel,onChange:e=>G("defaultModel",e),agent:t.defaultAgent})})]})]})]}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,s.jsx)(o,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"Execution paths"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Where to find the CLIs the dock shells out to."})]})]}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,s.jsx)(w.D,{label:"claude CLI path",children:(0,s.jsx)(k.p,{value:t.claudePath,onChange:e=>G("claudePath",e.target.value),spellCheck:!1})}),(0,s.jsx)(w.D,{label:"codex CLI path",children:(0,s.jsx)(k.p,{value:t.codexPath,onChange:e=>G("codexPath",e.target.value),spellCheck:!1})}),(0,s.jsx)(w.D,{label:"gh CLI path",children:(0,s.jsx)(k.p,{value:t.ghPath,onChange:e=>G("ghPath",e.target.value),spellCheck:!1})})]})]}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(i.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"Sandboxed execution"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Defaults for repos that run the agent inside a container. Enable it per repo from the repo's automation panel."})]})]}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(w.D,{label:"Default container image",hint:"Used when a sandboxed repo names no image and has no devcontainer.json. Must carry the agent CLI plus the repo's toolchain.",children:(0,s.jsx)(k.p,{value:t.sandboxDefaultImage,onChange:e=>G("sandboxDefaultImage",e.target.value),spellCheck:!1,className:"font-mono text-sm"})}),(0,s.jsx)(w.D,{label:"Container runtime",hint:"“Auto” probes docker, then podman.",children:(0,s.jsxs)(C.l,{value:t.containerRuntime,onChange:e=>G("containerRuntime",e.target.value),children:[(0,s.jsx)("option",{value:"auto",children:"Auto-detect (docker → podman)"}),(0,s.jsx)("option",{value:"docker",children:"Docker"}),(0,s.jsx)("option",{value:"podman",children:"Podman"})]})})]})]}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(d,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"Notification channels"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Configure one or more channels, then send yourself a test."})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(w.D,{label:"Telegram bot token",hint:"Leave empty to disable Telegram.",children:(0,s.jsx)(k.p,{value:t.telegramBotToken,onChange:e=>G("telegramBotToken",e.target.value),autoComplete:"off",spellCheck:!1})}),(0,s.jsx)(w.D,{label:"Telegram chat ID",children:(0,s.jsx)(k.p,{value:t.telegramChatId,onChange:e=>G("telegramChatId",e.target.value),spellCheck:!1})})]}),(0,s.jsx)("div",{className:"grid gap-4",children:(0,s.jsx)(w.D,{label:"Slack incoming webhook URL",hint:"Leave empty to disable Slack.",children:(0,s.jsx)(k.p,{value:t.slackWebhookUrl,onChange:e=>G("slackWebhookUrl",e.target.value),spellCheck:!1})})}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(w.D,{label:"SMTP host",hint:"Leave empty to disable email.",children:(0,s.jsx)(k.p,{value:t.smtpHost,onChange:e=>G("smtpHost",e.target.value)})}),(0,s.jsx)(w.D,{label:"SMTP port",children:(0,s.jsx)(k.p,{type:"number",value:t.smtpPort,onChange:e=>G("smtpPort",Number(e.target.value))})}),(0,s.jsx)(w.D,{label:"SMTP username",children:(0,s.jsx)(k.p,{value:t.smtpUser,onChange:e=>G("smtpUser",e.target.value),autoComplete:"off"})}),(0,s.jsx)(w.D,{label:"SMTP password",children:(0,s.jsx)(k.p,{type:"password",value:t.smtpPass,onChange:e=>G("smtpPass",e.target.value),autoComplete:"new-password"})}),(0,s.jsx)(w.D,{label:"From address",children:(0,s.jsx)(k.p,{type:"email",value:t.emailFrom,onChange:e=>G("emailFrom",e.target.value),placeholder:"drydock@example.com"})}),(0,s.jsx)(w.D,{label:"To address",children:(0,s.jsx)(k.p,{type:"email",value:t.emailTo,onChange:e=>G("emailTo",e.target.value),placeholder:"you@example.com"})})]}),(0,s.jsx)(w.D,{label:"Notify me about",children:(0,s.jsx)("div",{className:"grid gap-2.5 sm:grid-cols-2",children:S.map(e=>(0,s.jsxs)("label",{htmlFor:`notify-${e}`,className:"flex cursor-pointer items-center gap-2.5 text-sm text-foreground",children:[(0,s.jsx)(N.S,{id:`notify-${e}`,checked:t.notifyEvents.includes(e),onChange:a=>G("notifyEvents",a?[...t.notifyEvents,e]:t.notifyEvents.filter(a=>a!==e)),"aria-label":R[e]}),R[e]]},e))})})]})]}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,s.jsx)(c,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"OpenRouter"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Optional API backend with an auto-syncing model catalog, including free models."})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Enable OpenRouter"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Adds OpenRouter-hosted models as a selectable agent per repository. Repository code is sent to OpenRouter and its upstream model providers."})]}),(0,s.jsx)(M.d,{checked:t.openrouterEnabled,onChange:e=>G("openrouterEnabled",e),"aria-label":"Enable OpenRouter"})]}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(w.D,{label:"API key",hint:"Stored locally; DRYDOCK_OPENROUTER_API_KEY overrides it. Never logged.",children:(0,s.jsx)(k.p,{type:"password",autoComplete:"off",placeholder:"sk-or-v1-…",value:t.openrouterApiKey,onChange:e=>G("openrouterApiKey",e.target.value)})}),(0,s.jsx)(w.D,{label:"Catalog refresh (hours)",hint:"Minimum 0.25 (15 minutes).",children:(0,s.jsx)(k.p,{type:"number",min:"0.25",step:"0.25",value:t.openrouterCatalogRefreshHours,onChange:e=>{let a=Number(e.target.value);Number.isFinite(a)&&!(a<.25)&&G("openrouterCatalogRefreshHours",a)}})}),(0,s.jsx)(w.D,{label:"Default model",hint:"Used when a repo or job has none set.",children:(0,s.jsx)(v.o,{agent:"openrouter",openrouterModels:a.models,value:t.openrouterDefaultModel,onChange:e=>G("openrouterDefaultModel",e)})}),(0,s.jsx)(w.D,{label:"App attribution",hint:"Optional HTTP-Referer / X-Title headers.",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(k.p,{placeholder:"https://your-site.example",value:t.openrouterSiteUrl,onChange:e=>G("openrouterSiteUrl",e.target.value)}),(0,s.jsx)(k.p,{placeholder:"App name",value:t.openrouterAppName,onChange:e=>G("openrouterAppName",e.target.value)})]})})]}),(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Free models only"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Restrict every OpenRouter run to zero-cost catalog models."})]}),(0,s.jsx)(M.d,{checked:t.openrouterFreeModelsOnly,onChange:e=>G("openrouterFreeModelsOnly",e),"aria-label":"Free models only"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Auto-wait on limits"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Park jobs on OpenRouter 429s and resume them once the window resets."})]}),(0,s.jsx)(M.d,{checked:t.openrouterLimitAutoWait,onChange:e=>G("openrouterLimitAutoWait",e),"aria-label":"Auto-wait on OpenRouter limits"})]})]}),t.openrouterEnabled&&a.stale&&(0,s.jsx)(b.F,{tone:"warning",icon:r.A,title:"Model catalog is stale",children:a.lastError?`The last sync failed: ${a.lastError}. Pickers keep using the last-good snapshot.`:"The catalog has not synced recently. Pickers keep using the last-good snapshot."}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:a.modelCount>0?`${a.modelCount} models synced${a.lastSuccessAt?` \xb7 last sync ${new Date(1e3*a.lastSuccessAt).toLocaleString()}`:""}`:"No models synced yet."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(j.$,{variant:"outline",onClick:()=>Z(async()=>{try{await $(t);let e=await _();e.ok?K("OpenRouter connection OK"):q("OpenRouter connection failed",e.error)}catch(e){q("OpenRouter connection failed",e instanceof Error?e.message:String(e))}}),disabled:H,children:[H?(0,s.jsx)(A.y,{size:16}):(0,s.jsx)(u,{className:"h-4 w-4"}),"Test connection"]}),(0,s.jsxs)(j.$,{variant:"outline",onClick:()=>Z(async()=>{try{await $(t);let e=await T();e.ok?(K(`Catalog refreshed — ${e.modelCount} models synced`),J.refresh()):q("Catalog refresh failed",e.error)}catch(e){q("Catalog refresh failed",e instanceof Error?e.message:String(e))}}),disabled:H,children:[H?(0,s.jsx)(A.y,{size:16}):(0,s.jsx)(m.A,{className:"h-4 w-4"}),"Refresh models"]})]})]})]})]}),(0,s.jsxs)(y.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,s.jsx)(h,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:"Retention"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"How long to keep job logs before they are pruned."})]})]}),(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-3",children:(0,s.jsx)(w.D,{label:"Log retention (days)",hint:"Older job logs are deleted automatically.",children:(0,s.jsx)(k.p,{type:"number",value:t.retentionDays,onChange:e=>G("retentionDays",Number(e.target.value))})})})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,s.jsxs)(j.$,{variant:"outline",onClick:()=>F(async()=>{try{await $(t);let e=await E();if(0===e.length)return void q("No channels configured","Save a channel before sending a test.");let a=e.filter(e=>!e.ok);0===a.length?K(`Test sent to ${e.map(e=>e.channel).join(", ")}`):q("Some channels failed",a.map(e=>`${e.channel}: ${e.error??"unknown error"}`).join("; "))}catch(e){q("Failed to send test",e instanceof Error?e.message:String(e))}}),disabled:I,children:[I?(0,s.jsx)(A.y,{size:16}):(0,s.jsx)(p.A,{className:"h-4 w-4"}),I?"Sending…":"Send test notification"]}),(0,s.jsxs)(j.$,{onClick:()=>U(async()=>{try{await $(t),K("Settings saved")}catch(e){q("Failed to save settings",e instanceof Error?e.message:String(e))}}),disabled:P,children:[P&&(0,s.jsx)(A.y,{size:16}),P?"Saving…":"Save changes"]})]})]})}},2235:(e,a,t)=>{"use strict";var s=t(2067);t.o(s,"usePathname")&&t.d(a,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(a,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(a,{useSearchParams:function(){return s.useSearchParams}})},5529:(e,a,t)=>{"use strict";t.d(a,{Wu:()=>d,ZB:()=>i,Zp:()=>l,aR:()=>o});var s=t(515),r=t(5832);let n={none:"",sm:"p-4",default:"p-5",lg:"p-6"};function l({className:e,pad:a,hover:t,...o}){return(0,s.jsx)("div",{className:(0,r.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",t&&"hover-elevate transition-shadow hover:shadow-md",a&&n[a],e),...o})}function o({className:e,...a}){return(0,s.jsx)("div",{className:(0,r.cn)("flex flex-col gap-1.5 p-5",e),...a})}function i({className:e,...a}){return(0,s.jsx)("h3",{className:(0,r.cn)("text-base font-semibold leading-none tracking-tight",e),...a})}function d({className:e,...a}){return(0,s.jsx)("div",{className:(0,r.cn)("p-5 pt-0",e),...a})}},5662:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(1330).A)("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]])},5832:(e,a,t)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ")}function r(e){if(!e)return"no activity";let a=Math.floor(Date.now()/1e3)-e;return a<60?"just now":a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:a<604800?`${Math.floor(a/86400)}d ago`:new Date(1e3*e).toLocaleDateString()}function n(e){if(e>=3600){let a=Math.floor(e/3600),t=Math.round(e%3600/60);return t>0?`${a}h ${t}m`:`${a}h`}return e>=60?`${Math.floor(e/60)}m ${e%60}s`:`${e}s`}function l(e,a=2){return`$${e.toFixed(a)}`}t.d(a,{KW:()=>r,UK:()=>l,a3:()=>n,cn:()=>s})},7635:(e,a,t)=>{"use strict";t.d(a,{$:()=>r});var s=t(5097);let r=(0,s.createServerReference)("40d6ac063e31ed3ee52059d74d9460570a55d99e84",s.callServer,void 0,s.findSourceMapURL,"togglePauseAction")},7671:(e,a,t)=>{Promise.resolve().then(t.bind(t,9290)),Promise.resolve().then(t.t.bind(t,742,23)),Promise.resolve().then(t.bind(t,2211))},8108:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(1330).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},8479:(e,a,t)=>{"use strict";t.d(a,{t:()=>m,d:()=>h});var s=t(515),r=t(8131),n=t(6003),l=t(6512),o=t(5378),i=t(1171);function d(e){return"error"===e?"assertive":"polite"}var c=t(5832);let u=(0,i.createContext)(null);function m({children:e}){let[a,t]=(0,i.useState)([]),r=(0,i.useCallback)(e=>{t(a=>a.filter(a=>a.id!==e))},[]),n=(0,i.useCallback)(e=>{let a=Date.now()+Math.random(),s={id:a,title:e.title,description:e.description,variant:e.variant??"info"};t(e=>[...e,s]),setTimeout(()=>r(a),5e3)},[r]),l=(0,i.useMemo)(()=>({toast:n,success:(e,a)=>n({title:e,description:a,variant:"success"}),error:(e,a)=>n({title:e,description:a,variant:"error"}),info:(e,a)=>n({title:e,description:a,variant:"info"})}),[n]);return(0,s.jsxs)(u.Provider,{value:l,children:[e,(0,s.jsx)(f,{toasts:a,onDismiss:r})]})}function h(){let e=(0,i.useContext)(u);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let p={success:r.A,error:n.A,info:l.A},x={success:{icon:"text-success",bar:"bg-success"},error:{icon:"text-destructive",bar:"bg-destructive"},info:{icon:"text-primary",bar:"bg-primary"}};function g({toast:e,onDismiss:a}){let t=p[e.variant],r=x[e.variant];return(0,s.jsxs)("div",{className:"dd-toast dd-toast-in pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-xl border border-card-border bg-card p-3.5 shadow-lg",children:[(0,s.jsx)(t,{className:(0,c.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",r.icon)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,s.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>a(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("span",{className:(0,c.cn)("dd-toast-progress absolute bottom-0 left-0 h-0.5 w-full",r.bar),style:{animationDuration:"5000ms"}})]})}function f({toasts:e,onDismiss:a}){let t=e.filter(e=>"assertive"===d(e.variant)),r=e.filter(e=>"polite"===d(e.variant));return(0,s.jsxs)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:[(0,s.jsx)("div",{role:"alert","aria-live":"assertive","aria-atomic":"false",className:"flex flex-col gap-2",children:t.map(e=>(0,s.jsx)(g,{toast:e,onDismiss:a},e.id))}),(0,s.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"flex flex-col gap-2",children:r.map(e=>(0,s.jsx)(g,{toast:e,onDismiss:a},e.id))})]})}},8762:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(1330).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}},e=>{e.O(0,[9843,1642,1298,9655,4234,7358],()=>e(e.s=7671)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1298],{598:(e,t,r)=>{r.d(t,{y:()=>s});var n=r(515),i=r(8108),o=r(5832);function s({size:e=16,className:t}){return(0,n.jsx)(i.A,{width:e,height:e,className:(0,o.cn)("dd-spin",t),"aria-hidden":!0})}},1059:(e,t,r)=>{r.d(t,{d:()=>o});var n=r(515),i=r(5832);function o({checked:e,onChange:t,disabled:r,id:s,"aria-label":a}){return(0,n.jsx)("button",{type:"button",role:"switch",id:s,"aria-checked":e,"aria-label":a,disabled:r,onClick:()=>!r&&t?.(!e),className:(0,i.cn)("relative inline-flex h-[22px] w-[38px] shrink-0 items-center rounded-full transition-colors focus-ring",e?"bg-primary":"bg-input",r&&"pointer-events-none opacity-50"),children:(0,n.jsx)("span",{className:(0,i.cn)("inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}},1837:(e,t,r)=>{r.d(t,{L6:()=>n,UB:()=>i,VJ:()=>s,tT:()=>o});let n=[{id:"claude-opus-4-8",label:"Claude Opus 4.8",agent:"claude"},{id:"claude-fable-5",label:"Claude Fable 5",agent:"claude"},{id:"claude-opus-4-7",label:"Claude Opus 4.7",agent:"claude"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",agent:"claude"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",agent:"claude"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",agent:"claude"},{id:"gpt-5-codex",label:"GPT-5 Codex",agent:"codex"},{id:"gpt-5",label:"GPT-5",agent:"codex"},{id:"gpt-5-mini",label:"GPT-5 Mini",agent:"codex"}],i="claude-opus-4-8";function o(e){return n.filter(t=>t.agent===e)}function s(e){return"openrouter"===e?"":o(e)[0]?.id??i}},2655:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(1330).A)("container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]])},3798:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(1330).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},4148:(e,t,r)=>{r.d(t,{S:()=>s});var n=r(515),i=r(4266),o=r(5832);function s({checked:e,onChange:t,disabled:r,id:a,className:u,"aria-label":l}){return(0,n.jsx)("button",{type:"button",role:"checkbox",id:a,"aria-checked":e,"aria-label":l,disabled:r,onClick:()=>!r&&t?.(!e),className:(0,o.cn)("flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors focus-ring",e?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:border-muted-foreground",r&&"pointer-events-none opacity-50",u),children:e&&(0,n.jsx)(i.A,{className:"h-[13px] w-[13px]",strokeWidth:3})})}},4266:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(1330).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4783:(e,t,r)=>{r.d(t,{F:()=>p,W:()=>h});var n=r(515),i=r(6512),o=r(8131),s=r(4877),a=r(5662),u=r(5529),l=r(9214),d=r(5832);let c={info:{cls:"border-primary/30 bg-primary/5 text-foreground",icon:i.A,ic:"text-primary"},success:{cls:"border-success-border bg-success-muted text-foreground",icon:o.A,ic:"text-success"},warning:{cls:"border-warning-border bg-warning-muted text-foreground",icon:s.A,ic:"text-warning"},destructive:{cls:"border-destructive/30 bg-destructive/5 text-foreground",icon:a.A,ic:"text-destructive"}};function p({tone:e="info",title:t,children:r,action:i,icon:o,className:s}){let a=c[e],u=o??a.icon;return(0,n.jsxs)("div",{className:(0,d.cn)("flex gap-3 rounded-xl border p-4",a.cls,s),role:"alert",children:[(0,n.jsx)(u,{className:(0,d.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",a.ic)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[t&&(0,n.jsx)("p",{className:"text-sm font-semibold",children:t}),r&&(0,n.jsx)("div",{className:"mt-0.5 text-pretty text-sm text-muted-foreground",children:r})]}),i&&(0,n.jsx)("div",{className:"shrink-0",children:i})]})}function h({title:e="Something went wrong",description:t,action:r,className:i}){return(0,n.jsx)(u.Zp,{className:(0,d.cn)("border-destructive/30",i),children:(0,n.jsx)(l.p,{icon:a.A,tone:"destructive",title:e,description:t,action:r})})}},7217:(e,t,r)=>{r.d(t,{D:()=>s});var n=r(515),i=r(5832);function o({htmlFor:e,className:t,children:r}){return(0,n.jsx)("label",{htmlFor:e,className:(0,i.cn)("text-sm font-medium text-foreground",t),children:r})}function s({label:e,hint:t,htmlFor:r,children:a,className:u}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",u),children:[e&&(0,n.jsx)(o,{htmlFor:r,children:e}),a,t&&(0,n.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},7241:(e,t,r)=>{r.d(t,{a:()=>F});var n=r(515),i=r(8067);let o={"claude-fable-5":{inputPerMTok:10,outputPerMTok:50,cacheWritePerMTok:12.5,cacheReadPerMTok:1},"claude-opus-4-8":{inputPerMTok:5,outputPerMTok:25,cacheWritePerMTok:6.25,cacheReadPerMTok:.5},"claude-opus-4-7":{inputPerMTok:5,outputPerMTok:25,cacheWritePerMTok:6.25,cacheReadPerMTok:.5},"claude-sonnet-4-6":{inputPerMTok:3,outputPerMTok:15,cacheWritePerMTok:3.75,cacheReadPerMTok:.3},"claude-sonnet-4-5":{inputPerMTok:3,outputPerMTok:15,cacheWritePerMTok:3.75,cacheReadPerMTok:.3},"claude-haiku-4-5":{inputPerMTok:1,outputPerMTok:5,cacheWritePerMTok:1.25,cacheReadPerMTok:.1}},s=Object.values(o).reduce((e,t)=>t.outputPerMTok>e.outputPerMTok?t:e,{inputPerMTok:0,outputPerMTok:0,cacheWritePerMTok:0,cacheReadPerMTok:0});var a=r(4502);let u=a.Ik({input_tokens:a.ai().optional(),output_tokens:a.ai().optional(),cache_creation_input_tokens:a.ai().optional(),cache_read_input_tokens:a.ai().optional()}).passthrough(),l=a.Ik({type:a.eu("system"),subtype:a.Yj().optional(),session_id:a.Yj().optional(),model:a.Yj().optional()}),d=a.Ik({type:a.eu("assistant"),message:a.Ik({role:a.eu("assistant"),content:a.YO(a.g1(a.Yj(),a.L5())),usage:u.optional()})}),c=a.Ik({type:a.eu("user"),message:a.Ik({role:a.eu("user"),content:a.YO(a.g1(a.Yj(),a.L5()))})}),p=a.Ik({status:a.Yj().optional(),resetsAt:a.ai().optional(),rateLimitType:a.Yj().optional()}).passthrough(),h=a.Ik({type:a.eu("rate_limit_event"),rate_limit_info:p.optional(),session_id:a.Yj().optional()}),m=a.Ik({type:a.eu("result"),subtype:a.Yj().optional(),session_id:a.Yj().optional(),is_error:a.zM().optional(),result:a.Yj().optional(),total_cost_usd:a.ai().optional(),usage:u.optional()}),k=a.gM("type",[l,d,c,h,m]);function f(e){return e instanceof Error?e.message:String(e)}function g(e){let t=[];for(let r of e)"text"===r.type&&"string"==typeof r.text?t.push({kind:"text",text:r.text}):"tool_use"===r.type?t.push({kind:"tool_use",name:String(r.name??"unknown"),id:String(r.id??""),input:r.input}):"tool_result"===r.type&&t.push({kind:"tool_result",toolUseId:String(r.tool_use_id??""),isError:!!r.is_error});return t}class b{push(e){this.buffer+=e;let t=[],r=this.buffer.indexOf("\n");for(;-1!==r;){let e=this.buffer.slice(0,r);this.buffer=this.buffer.slice(r+1);let n=this.consume(e);n&&t.push(n),r=this.buffer.indexOf("\n")}return t}flush(){let e=this.buffer;this.buffer="";let t=this.consume(e);return t?[t]:[]}consume(e){let t;try{t=function(e){var t;let r,n=e.trim();if(!n)return null;let i=JSON.parse(n);return r={type:(t=k.parse(i)).type,chunks:[],inputTokens:0,outputTokens:0,cacheCreationInputTokens:0,cacheReadInputTokens:0,isError:!1,raw:t},"system"===t.type?(r.sessionId=t.session_id,r.model=t.model):"assistant"===t.type?(r.chunks=g(t.message.content),r.inputTokens=t.message.usage?.input_tokens??0,r.outputTokens=t.message.usage?.output_tokens??0,r.cacheCreationInputTokens=t.message.usage?.cache_creation_input_tokens??0,r.cacheReadInputTokens=t.message.usage?.cache_read_input_tokens??0):"user"===t.type?r.chunks=g(t.message.content):"rate_limit_event"===t.type?(r.sessionId=t.session_id,r.rateLimitInfo=t.rate_limit_info):(r.sessionId=t.session_id,r.resultText=t.result,r.costUsd=t.total_cost_usd,r.inputTokens=t.usage?.input_tokens??0,r.outputTokens=t.usage?.output_tokens??0,r.cacheCreationInputTokens=t.usage?.cache_creation_input_tokens??0,r.cacheReadInputTokens=t.usage?.cache_read_input_tokens??0,r.isError=t.is_error??!1),r}(e)}catch(t){return this.onParseError?.({line:e.trim(),message:f(t)}),null}return t?(t.sessionId&&(this.sessionId=t.sessionId),t.model&&(this.model=t.model),t.rateLimitInfo&&(this.rateLimit=t.rateLimitInfo),"result"===t.type?(t.inputTokens>0&&(this.totalInputTokens=t.inputTokens),t.outputTokens>0&&(this.totalOutputTokens=t.outputTokens),t.cacheCreationInputTokens>0&&(this.totalCacheCreationInputTokens=t.cacheCreationInputTokens),t.cacheReadInputTokens>0&&(this.totalCacheReadInputTokens=t.cacheReadInputTokens),void 0!==t.costUsd&&(this.costUsd=t.costUsd),void 0!==t.resultText&&(this.resultText=t.resultText),this.resultIsError=t.isError):(this.totalInputTokens+=t.inputTokens,this.totalOutputTokens+=t.outputTokens,this.totalCacheCreationInputTokens+=t.cacheCreationInputTokens,this.totalCacheReadInputTokens+=t.cacheReadInputTokens),t):null}constructor(){this.buffer="",this.totalInputTokens=0,this.totalOutputTokens=0,this.totalCacheCreationInputTokens=0,this.totalCacheReadInputTokens=0,this.costUsd=0,this.resultIsError=!1}}let x="[REDACTED]",_=[/\bgh[pousr]_[A-Za-z0-9]{36,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{50,}\b/g,/\bglpat-[A-Za-z0-9_-]{20,}\b/g,/(Bearer )[A-Za-z0-9._~+/-]+=*/g,/(https?:\/\/)[^\s/@:"\\]+:[^\s/@"\\]+(?=@)/g,/(PRIVATE-TOKEN:\s*)[^\s"\\]+/gi,/(Basic )[A-Za-z0-9+/]+=*/g,/\b(?:AKIA|ASIA|AGPA|AIDA|ANPA|AROA)[0-9A-Z]{16}\b/g,/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g,/\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g,/\d{8,10}:[A-Za-z0-9_-]{35}\b/g];function T(e){let t=e;for(let e of _)t=t.replace(e,(e,t)=>"string"==typeof t?`${t}${x}`:x);return t}let y=[{kind:"auth",pattern:/invalid api key/i},{kind:"auth",pattern:/please run \/login/i},{kind:"auth",pattern:/authentication_error/i},{kind:"auth",pattern:/api error:?\s*401\b/i},{kind:"auth",pattern:/oauth token (?:has )?(?:expired|been revoked)/i},{kind:"billing",pattern:/credit balance is too low/i},{kind:"billing",pattern:/billing_error/i},{kind:"usage_limit",pattern:/usage limit reached/i},{kind:"usage_limit",pattern:/\b(?:\d+-hour|session|weekly) limit reached/i},{kind:"usage_limit",pattern:/limit will reset at/i},{kind:"rate_limit",pattern:/rate.?limit_error/i},{kind:"rate_limit",pattern:/api error:?\s*429\b/i},{kind:"rate_limit",pattern:/too many requests/i},{kind:"rate_limit",pattern:/\brate.?limit(?:ed)?\b.{0,60}\b(?:exceeded|reached|hit)\b/i},{kind:"rate_limit",pattern:/\b(?:exceeded|reached|hit)\b.{0,60}\brate.?limit/i},{kind:"overloaded",pattern:/overloaded_error/i},{kind:"overloaded",pattern:/api error:?\s*529\b/i}],v=/limit reached\|(\d{9,12})\b/i,M=/retry[- ]?after[:\s]+(\d+)\s*(?:s|sec|second)/i,I=[{kind:"auth",pattern:/unexpected status 401\b/i},{kind:"auth",pattern:/\b401 unauthorized\b/i},{kind:"auth",pattern:/access token could not be refreshed/i},{kind:"auth",pattern:/please log out and sign in again/i},{kind:"auth",pattern:/\bnot logged in\b/i},{kind:"auth",pattern:/(?:chatgpt|api key) login is required/i},{kind:"auth",pattern:/missing environment variable.{0,5}OPENAI_API_KEY/i},{kind:"auth",pattern:/re-?run `?codex login`?/i},{kind:"billing",pattern:/quota exceeded\. check your plan and billing/i},{kind:"billing",pattern:/insufficient_quota/i},{kind:"billing",pattern:/exceeded your current quota/i},{kind:"billing",pattern:/\bout of credits\b/i},{kind:"billing",pattern:/\bspend cap\b/i},{kind:"billing",pattern:/to use codex with your chatgpt plan/i},{kind:"usage_limit",pattern:/you.?ve hit your usage limit/i},{kind:"usage_limit",pattern:/usage_limit_reached/i},{kind:"rate_limit",pattern:/rate.?limit_exceeded/i},{kind:"rate_limit",pattern:/rate limit reached for/i},{kind:"rate_limit",pattern:/last status:?\s*429\b/i},{kind:"rate_limit",pattern:/unexpected status 429\b/i},{kind:"rate_limit",pattern:/too many requests/i},{kind:"overloaded",pattern:/selected model is at capacity/i},{kind:"overloaded",pattern:/currently experiencing high demand/i},{kind:"overloaded",pattern:/server_is_overloaded/i},{kind:"overloaded",pattern:/last status:?\s*5\d\d\b/i},{kind:"overloaded",pattern:/unexpected status 5\d\d\b/i}],j=/try again in ([\d.]+)\s*s(?:ec(?:ond)?s?)?\b/i,P="gpt-5-codex",w={"gpt-5-codex":{inputPerMTok:1.25,outputPerMTok:10,cacheWritePerMTok:0,cacheReadPerMTok:0},"gpt-5":{inputPerMTok:1.25,outputPerMTok:10,cacheWritePerMTok:0,cacheReadPerMTok:0},"gpt-5-mini":{inputPerMTok:.25,outputPerMTok:2,cacheWritePerMTok:0,cacheReadPerMTok:0}},A=Object.values(w).reduce((e,t)=>t.outputPerMTok>e.outputPerMTok?t:e,{inputPerMTok:0,outputPerMTok:0,cacheWritePerMTok:0,cacheReadPerMTok:0}),C=a.Ik({input_tokens:a.ai().optional(),cached_input_tokens:a.ai().optional(),output_tokens:a.ai().optional(),reasoning_output_tokens:a.ai().optional()}).passthrough(),N=a.Ik({used_percent:a.ai().optional(),window_minutes:a.ai().optional(),resets_in_seconds:a.ai().optional()}).passthrough(),R=a.Ik({primary:N.nullish(),secondary:N.nullish()}).passthrough(),S=a.Ik({id:a.Yj().optional(),item_type:a.Yj().optional(),text:a.Yj().optional(),command:a.Yj().optional(),exit_code:a.ai().optional(),server:a.Yj().optional(),tool:a.Yj().optional()}).passthrough(),E=a.Ik({type:a.Yj(),thread_id:a.Yj().optional(),usage:C.optional(),rate_limits:R.nullish(),item:S.optional(),error:a.Ik({message:a.Yj().optional()}).passthrough().optional(),message:a.Yj().optional()}).passthrough();function O(e){if(e&&"number"==typeof e.used_percent)return{usedPercent:e.used_percent,windowMinutes:e.window_minutes,resetsInSeconds:e.resets_in_seconds}}class Y{push(e){this.buffer+=e;let t=[],r=this.buffer.indexOf("\n");for(;-1!==r;){let e=this.buffer.slice(0,r);this.buffer=this.buffer.slice(r+1);let n=this.consume(e);n&&t.push(n),r=this.buffer.indexOf("\n")}return t}flush(){let e=this.buffer;this.buffer="";let t=this.consume(e);return t?[t]:[]}consume(e){let t;try{t=function(e){let t=e.trim();if(!t)return null;let r=JSON.parse(t);return E.parse(r)}(e)}catch(t){return this.onParseError?.({line:e.trim(),message:f(t)}),null}if(!t)return null;let r=function(e){let t=R.nullish().safeParse(e.rate_limits);if(!t.success||!t.data)return;let r=O(t.data.primary),n=O(t.data.secondary);if(r||n)return{primary:r,secondary:n}}(t);if(r&&(this.rateLimits=r),"turn.failed"===t.type||"error"===t.type){this.resultIsError=!0;let e=t.error?.message??t.message;e&&(this.resultText=e)}else"turn.completed"===t.type&&(this.resultIsError=!1,this.resultText=void 0);let n=function(e){let t={type:"assistant",chunks:[],inputTokens:0,outputTokens:0,cacheCreationInputTokens:0,cacheReadInputTokens:0,isError:!1,raw:e};if("thread.started"===e.type)return{...t,type:"system",sessionId:e.thread_id};if("item.completed"===e.type&&e.item)return{...t,type:"assistant",chunks:function(e){let t=e.id??"";switch(e.item_type){case"assistant_message":case"reasoning":return e.text?[{kind:"text",text:e.text}]:[];case"command_execution":return[{kind:"tool_use",name:"command",id:t,input:{command:e.command,exit_code:e.exit_code}}];case"file_change":return[{kind:"tool_use",name:"edit",id:t,input:e}];case"mcp_tool_call":return[{kind:"tool_use",name:`${e.server??"mcp"}/${e.tool??"tool"}`,id:t,input:e}];default:return[]}}(e.item)};if("turn.completed"===e.type){let r=e.usage;return{...t,type:"result",inputTokens:r?.input_tokens??0,outputTokens:(r?.output_tokens??0)+(r?.reasoning_output_tokens??0)}}return"turn.failed"===e.type||"error"===e.type?{...t,type:"result",isError:!0}:null}(t);return n?(n.sessionId&&(this.sessionId=n.sessionId),this.totalInputTokens+=n.inputTokens,this.totalOutputTokens+=n.outputTokens,n):null}constructor(){this.buffer="",this.totalInputTokens=0,this.totalOutputTokens=0,this.totalCacheCreationInputTokens=0,this.totalCacheReadInputTokens=0,this.costUsd=0}}let L=/openrouter http (\d{3})/i,W=/retry[- ]?after[:\s]+(\d+)\s*(?:s\b|sec|second)/i,z="openrouter is an HTTP provider; it has no CLI surface (dispatch on provider.kind)",U={claude:{id:"claude",label:"Claude Code",defaultCommand:"claude",supportsResume:!0,resumeModel:"claude-haiku-4-5",resumeMaxTurns:15,defaultModel:"claude-opus-4-8",buildStartArgs:({prompt:e,model:t,maxTurns:r})=>["-p",e,"--max-turns",String(r),"--permission-mode","acceptEdits","--model",t,"--output-format","stream-json","--verbose"],buildResumeArgs:({prompt:e,sessionId:t,model:r,maxTurns:n})=>["-p",e,"--resume",t,"--max-turns",String(n),"--model",r,"--output-format","stream-json","--verbose"],buildOneShotArgs:({prompt:e,model:t})=>["-p",e,"--model",t],buildStreamOneShotArgs:({prompt:e,model:t})=>["-p",e,"--model",t,"--output-format","stream-json","--verbose"],createParser:()=>new b,classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n");if(!r.trim())return;let n=y.find(e=>e.pattern.test(r));if(!n)return;let i={agent:"claude",kind:n.kind,rawSnippet:(t=n.pattern,T((r.split("\n").find(e=>t.test(e))??r).trim()).slice(0,300))};if("usage_limit"===n.kind){let e=r.match(v)?.[1];e&&(i.resetAt=Number(e))}if("rate_limit"===n.kind||"overloaded"===n.kind){let e=r.match(M)?.[1];e&&(i.retryAfterMs=1e3*Number(e))}return i},estimateCost:function(e,t,r,n=0,i=0){let a=function(e){if(!e)return s;let t=o[e];return t||(console.warn(`[drydock] Unknown model id "${e}" — using max-priced fallback to avoid under-counting cost`),s)}(e);return t/1e6*a.inputPerMTok+r/1e6*a.outputPerMTok+n/1e6*a.cacheWritePerMTok+i/1e6*a.cacheReadPerMTok}},codex:{id:"codex",label:"Codex CLI",defaultCommand:"codex",supportsResume:!0,resumeModel:P,resumeMaxTurns:15,defaultModel:P,buildStartArgs:({prompt:e,model:t})=>["exec","--json","--sandbox","workspace-write","--model",t,e],buildResumeArgs:({prompt:e,sessionId:t,model:r})=>["exec","resume",t,"--json","--sandbox","workspace-write","--model",r,e],buildOneShotArgs:({prompt:e,model:t})=>["exec","--model",t,e],buildStreamOneShotArgs:()=>null,createParser:()=>new Y,classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n");if(!r.trim())return;let n=I.find(e=>e.pattern.test(r));if(!n)return;let i={agent:"codex",kind:n.kind,rawSnippet:(t=n.pattern,T((r.split("\n").find(e=>t.test(e))??r).trim()).slice(0,300))};if("rate_limit"===n.kind||"overloaded"===n.kind){let e=r.match(j)?.[1],t=e?Math.ceil(1e3*Number(e)):NaN;Number.isFinite(t)&&t>=0&&(i.retryAfterMs=t)}return i},captureUsage:e=>e instanceof Y?e.rateLimits:void 0,estimateCost:function(e,t,r){let n=function(e){if(!e)return A;let t=w[e];return t||(console.warn(`[drydock] Unknown codex model id "${e}" — using max-priced fallback to avoid under-counting cost`),A)}(e);return t/1e6*n.inputPerMTok+r/1e6*n.outputPerMTok}},openrouter:{id:"openrouter",kind:"http",label:"OpenRouter",defaultCommand:"",supportsResume:!1,resumeModel:"",resumeMaxTurns:20,defaultModel:"",buildStartArgs(){throw Error(z)},buildResumeArgs:()=>null,buildOneShotArgs(){throw Error(z)},buildStreamOneShotArgs:()=>null,createParser(){throw Error(z)},classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n"),n=r.match(L)?.[1];if(!n)return;let i=(t=Number(n),401===t||403===t?"auth":402===t?"billing":429===t?/\b(?:free|daily|quota)\b/i.test(r)?"usage_limit":"rate_limit":408===t||t>=500&&t<600?"overloaded":void 0);if(!i)return;let o={agent:"openrouter",kind:i,rawSnippet:T((r.split("\n").find(e=>L.test(e))??r).trim()).slice(0,300)},s=r.match(W)?.[1];return s&&("rate_limit"===i||"overloaded"===i)&&(o.retryAfterMs=1e3*Number(s)),o},estimateCost:()=>0}},Z=["claude","codex","openrouter"].map(e=>U[e]),q=["claude","codex"];function F({value:e,onChange:t,id:r,className:o,agents:s=q}){let a=Z.filter(e=>s.includes(e.id));return(0,n.jsx)(i.l,{id:r,value:e,onChange:e=>t(e.target.value),className:o,children:a.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))})}},7405:(e,t,r)=>{r.d(t,{p:()=>s});var n=r(515),i=r(1171),o=r(5832);let s=i.forwardRef(({className:e,...t},r)=>(0,n.jsx)("input",{ref:r,className:(0,o.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));s.displayName="Input"},8067:(e,t,r)=>{r.d(t,{l:()=>a});var n=r(515),i=r(3798),o=r(1171),s=r(5832);let a=o.forwardRef(({className:e,children:t,...r},o)=>(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("select",{ref:o,className:(0,s.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t}),(0,n.jsx)(i.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));a.displayName="Select"},9214:(e,t,r)=>{r.d(t,{p:()=>s});var n=r(515),i=r(5832);let o={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function s({icon:e,tone:t="neutral",title:r,description:a,action:u,secondary:l,className:d,compact:c}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col items-center justify-center text-center",c?"py-10":"py-16",d),children:[e&&(0,n.jsx)("div",{className:(0,i.cn)("flex items-center justify-center rounded-2xl",c?"h-12 w-12":"h-16 w-16",o[t]),children:(0,n.jsx)(e,{className:c?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,n.jsx)("h3",{className:"mt-4 text-base font-semibold",children:r}),a&&(0,n.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:a}),(u||l)&&(0,n.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[u,l]})]})}},9754:(e,t,r)=>{r.d(t,{o:()=>s});var n=r(515),i=r(8067),o=r(1837);function s({value:e,onChange:t,agent:r,openrouterModels:a=[],id:u,className:l}){if("openrouter"===r)return(0,n.jsxs)(i.l,{id:u,value:e,onChange:e=>t(e.target.value),className:l,children:[0===a.length&&(0,n.jsx)("option",{value:"",disabled:!0,children:"No synced models — refresh the catalog in Settings"}),a.length>0&&""!==e&&!a.some(t=>t.id===e)&&(0,n.jsxs)("option",{value:e,disabled:!0,children:[e," (no longer in catalog)"]}),a.map(e=>(0,n.jsx)("option",{value:e.id,children:e.isFree?`${e.label} (free)`:e.label},e.id))]});let d=r?(0,o.tT)(r):o.L6;return(0,n.jsx)(i.l,{id:u,value:e,onChange:e=>t(e.target.value),className:l,children:d.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3433],{395:(e,t,r)=>{r.d(t,{$:()=>l});var n=r(515),a=r(1171),s=r(5832);let i={default:"bg-primary text-primary-foreground shadow-sm hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-sm hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-sm hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2",success:"bg-success text-white shadow-sm hover-elevate active-elevate-2"},o={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-6 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg","icon-sm":"h-8 w-8 rounded-md"},l=a.forwardRef(({className:e,variant:t="default",size:r="default",type:a="button",...l},d)=>(0,n.jsx)("button",{ref:d,type:a,className:(0,s.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i[t],o[r],e),...l}));l.displayName="Button"},5529:(e,t,r)=>{r.d(t,{Wu:()=>d,ZB:()=>l,Zp:()=>i,aR:()=>o});var n=r(515),a=r(5832);let s={none:"",sm:"p-4",default:"p-5",lg:"p-6"};function i({className:e,pad:t,hover:r,...o}){return(0,n.jsx)("div",{className:(0,a.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",r&&"hover-elevate transition-shadow hover:shadow-md",t&&s[t],e),...o})}function o({className:e,...t}){return(0,n.jsx)("div",{className:(0,a.cn)("flex flex-col gap-1.5 p-5",e),...t})}function l({className:e,...t}){return(0,n.jsx)("h3",{className:(0,a.cn)("text-base font-semibold leading-none tracking-tight",e),...t})}function d({className:e,...t}){return(0,n.jsx)("div",{className:(0,a.cn)("p-5 pt-0",e),...t})}},5832:(e,t,r)=>{function n(...e){return e.filter(Boolean).join(" ")}function a(e){if(!e)return"no activity";let t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:new Date(1e3*e).toLocaleDateString()}function s(e){if(e>=3600){let t=Math.floor(e/3600),r=Math.round(e%3600/60);return r>0?`${t}h ${r}m`:`${t}h`}return e>=60?`${Math.floor(e/60)}m ${e%60}s`:`${e}s`}function i(e,t=2){return`$${e.toFixed(t)}`}r.d(t,{KW:()=>a,UK:()=>i,a3:()=>s,cn:()=>n})},6644:(e,t,r)=>{r.d(t,{E:()=>l});var n=r(515),a=r(5832);let s={neutral:"border-border bg-secondary text-secondary-foreground",primary:"border-primary/40 bg-primary/10 text-primary",success:"border-success-border bg-success-muted text-success-foreground",warning:"border-warning-border bg-warning-muted text-warning-foreground",destructive:"border-destructive/40 bg-destructive/10 text-destructive"},i={queued:"neutral",working:"primary",ci_running:"warning",ci_failed:"destructive",retrying:"warning",waiting_limit:"warning",merged:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning",open:"neutral",triaged:"primary",releasing:"primary"},o=new Set(["working","ci_running","retrying","releasing"]);function l({className:e,status:t,tone:r,children:d,...c}){let u=r??(t?i[t]??"neutral":"neutral"),m=void 0!==t&&o.has(t);return(0,n.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-0.5 text-[11px] font-semibold leading-4",s[u],e),...c,children:[m&&(0,n.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,n.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,n.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),d??t?.replace(/_/g," ")]})}},6845:(e,t,r)=>{r.d(t,{p:()=>s});var n=r(1171);let a=()=>()=>{};function s(){return(0,n.useSyncExternalStore)(a,()=>!0,()=>!1)}},7901:(e,t,r)=>{r.d(t,{l:()=>c});var n=r(515),a=r(5378),s=r(1171);function i(e){return Array.from(e.querySelectorAll('a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])'))}var o=r(5832);let l={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"},d={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-2xl"};function c({open:e,onClose:t,onOpenChange:r,labelledById:u,title:m,description:x,icon:f,tone:v="primary",footer:p,size:g="xl",className:h,children:b}){let w=(0,s.useRef)(null),y=(0,s.useRef)(null),[j,N]=(0,s.useState)(e),[k,C]=(0,s.useState)(!1),$=(0,s.useId)(),D=()=>{r?r(!1):t?.()},E=(0,s.useRef)(D);if(E.current=D,(0,s.useEffect)(()=>{let t;return e?(N(!0),t=setTimeout(()=>C(!0),10)):(C(!1),t=setTimeout(()=>N(!1),180)),()=>clearTimeout(t)},[e]),(0,s.useEffect)(()=>{if(!e||!j)return;y.current=document.activeElement;let t=w.current;function r(e){if("Escape"===e.key){e.preventDefault(),E.current();return}let t=w.current;if("Tab"===e.key&&t){var r,n;let a,s,o;e.preventDefault();let l=i(t);if(0===l.length)return;(r=document.activeElement,n=e.shiftKey,a=l.indexOf(r),s=l[l.length-1],o=l[0],-1===a?n?s:o:l[((n?a-1:a+1)+l.length)%l.length]).focus()}}return t&&(i(t)[0]??t).focus(),document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r),y.current instanceof HTMLElement&&y.current.focus(),y.current=null}},[e,j]),!j)return null;let _=null!=m?$:void 0,M=u??_,A=null!=m||null!=x||null!=f;return(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:p-8",children:[(0,n.jsx)("div",{className:(0,o.cn)("fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-200",k?"opacity-100":"opacity-0"),onMouseDown:D}),(0,n.jsx)("div",{ref:w,role:"dialog","aria-modal":"true","aria-labelledby":M,tabIndex:-1,className:(0,o.cn)("relative mt-8 w-full rounded-xl border border-card-border bg-card text-card-foreground shadow-2xl outline-none","transition-all duration-200",k?"scale-100 opacity-100 translate-y-0":"scale-[0.97] opacity-0 translate-y-2",d[g],h),onMouseDown:e=>e.stopPropagation(),children:A?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-start gap-3 p-5",children:[f&&(0,n.jsx)("span",{className:(0,o.cn)("flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",l[v]),children:(0,n.jsx)(f,{className:"h-[18px] w-[18px]"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[null!=m&&(0,n.jsx)("h2",{id:_,className:"text-base font-semibold tracking-tight",children:m}),null!=x&&(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground text-pretty",children:x})]}),(0,n.jsx)("button",{type:"button","aria-label":"Close",onClick:D,className:"-mr-1 -mt-1 shrink-0 rounded-md p-1 text-muted-foreground hover-elevate",children:(0,n.jsx)(a.A,{className:"h-4 w-4"})})]}),null!=b&&(0,n.jsx)("div",{className:"px-5 pb-2",children:b}),null!=p&&(0,n.jsx)("div",{className:"flex justify-end gap-2 p-5 pt-3",children:p})]}):(0,n.jsxs)("div",{className:"p-5",children:[b,null!=p&&(0,n.jsx)("div",{className:"mt-4 flex justify-end gap-2",children:p})]})})]})}},8479:(e,t,r)=>{r.d(t,{t:()=>m,d:()=>x});var n=r(515),a=r(8131),s=r(6003),i=r(6512),o=r(5378),l=r(1171);function d(e){return"error"===e?"assertive":"polite"}var c=r(5832);let u=(0,l.createContext)(null);function m({children:e}){let[t,r]=(0,l.useState)([]),a=(0,l.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),s=(0,l.useCallback)(e=>{let t=Date.now()+Math.random(),n={id:t,title:e.title,description:e.description,variant:e.variant??"info"};r(e=>[...e,n]),setTimeout(()=>a(t),5e3)},[a]),i=(0,l.useMemo)(()=>({toast:s,success:(e,t)=>s({title:e,description:t,variant:"success"}),error:(e,t)=>s({title:e,description:t,variant:"error"}),info:(e,t)=>s({title:e,description:t,variant:"info"})}),[s]);return(0,n.jsxs)(u.Provider,{value:i,children:[e,(0,n.jsx)(g,{toasts:t,onDismiss:a})]})}function x(){let e=(0,l.useContext)(u);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let f={success:a.A,error:s.A,info:i.A},v={success:{icon:"text-success",bar:"bg-success"},error:{icon:"text-destructive",bar:"bg-destructive"},info:{icon:"text-primary",bar:"bg-primary"}};function p({toast:e,onDismiss:t}){let r=f[e.variant],a=v[e.variant];return(0,n.jsxs)("div",{className:"dd-toast dd-toast-in pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-xl border border-card-border bg-card p-3.5 shadow-lg",children:[(0,n.jsx)(r,{className:(0,c.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",a.icon)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,n.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,n.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>t(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,n.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("span",{className:(0,c.cn)("dd-toast-progress absolute bottom-0 left-0 h-0.5 w-full",a.bar),style:{animationDuration:"5000ms"}})]})}function g({toasts:e,onDismiss:t}){let r=e.filter(e=>"assertive"===d(e.variant)),a=e.filter(e=>"polite"===d(e.variant));return(0,n.jsxs)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:[(0,n.jsx)("div",{role:"alert","aria-live":"assertive","aria-atomic":"false",className:"flex flex-col gap-2",children:r.map(e=>(0,n.jsx)(p,{toast:e,onDismiss:t},e.id))}),(0,n.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"flex flex-col gap-2",children:a.map(e=>(0,n.jsx)(p,{toast:e,onDismiss:t},e.id))})]})}},9694:(e,t,r)=>{r.d(t,{T:()=>l});var n=r(515),a=r(4877),s=r(6512),i=r(395),o=r(7901);function l({open:e,onOpenChange:t,onConfirm:r,title:d,description:c,confirmLabel:u="Confirm",cancelLabel:m="Cancel",variant:x="default",pending:f=!1,icon:v}){let p="destructive"===x,g=v??(p?a.A:s.A);return(0,n.jsx)(o.l,{open:e,onOpenChange:t,title:d,description:c,icon:g,tone:p?"destructive":"primary",size:"sm",footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.$,{variant:"outline",size:"sm",disabled:f,onClick:()=>t(!1),children:m}),(0,n.jsx)(i.$,{variant:p?"destructive":"default",size:"sm",disabled:f,onClick:()=>{r(),t(!1)},children:u})]})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3894],{9:(e,t,r)=>{r.d(t,{T:()=>a});var s=r(515),n=r(1171),o=r(5832);let a=n.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{ref:r,className:(0,o.cn)("min-h-[80px] w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground leading-relaxed","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));a.displayName="Textarea"},715:(e,t,r)=>{r.d(t,{LogViewer:()=>O});var s=r(515),n=r(6512),o=r(1753),a=r(5803),l=r(2863),i=r(8131),d=r(159),c=r(5662),u=r(6819),p=r(1365),x=r(2961),m=r(3611),f=r(1171),g=r(2497),h=r(6644),b=r(598),y=r(8479),j=r(6845),N=r(5832);let v=["status","text","tool_use","tool_result","result","claude_exit","error"],w={status:{icon:n.A,color:"text-muted-foreground",chip:"bg-secondary text-muted-foreground",label:"status"},text:{icon:o.A,color:"text-primary",chip:"bg-primary/10 text-primary",label:"assistant"},tool_use:{icon:a.A,color:"text-primary",chip:"bg-primary/10 text-primary",label:"tool"},tool_result:{icon:l.A,color:"text-success",chip:"bg-success-muted text-success",label:"result"},result:{icon:i.A,color:"text-success",chip:"bg-success-muted text-success",label:"done"},claude_exit:{icon:d.A,color:"text-muted-foreground",chip:"bg-secondary text-muted-foreground",label:"exit"},error:{icon:c.A,color:"text-destructive",chip:"bg-destructive/10 text-destructive",label:"error"}},k={icon:n.A,color:"text-muted-foreground",chip:"bg-secondary text-muted-foreground",label:"event"};function S(e){return new Date(1e3*e).toTimeString().slice(0,8)}function _(e,t){if(e&&"object"==typeof e&&t in e){let r=e[t];return null==r?void 0:String(r)}}let A=new Set(["merged","needs_human","aborted","interrupted"]);function C(e,t){if("result"===e||"claude_exit"===e)return!0;if("status"!==e)return!1;let r=_(t,"to");return void 0!==r&&A.has(r)}function E({type:e,payload:t}){if("text"===e)return(0,s.jsx)("p",{className:"leading-relaxed text-foreground/90",children:"string"==typeof t?t:_(t,"text")??JSON.stringify(t)});if("status"===e){let e=_(t,"from"),r=_(t,"to"),n=_(t,"reason");return e||r?(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e??"?"," ",(0,s.jsx)("span",{className:"text-muted-foreground/60",children:"→"})," ",(0,s.jsx)("span",{className:"text-foreground",children:r??"?"}),n&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",n]})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:_(t,"message")??n??("string"==typeof t?t:JSON.stringify(t))})}if("error"===e)return(0,s.jsx)("span",{className:"text-destructive",children:_(t,"message")??("string"==typeof t?t:JSON.stringify(t))});if("claude_exit"===e){let e=_(t,"exitCode")??_(t,"code"),r=_(t,"reason");return(0,s.jsxs)("span",{className:"text-muted-foreground",children:["exited code ",(0,s.jsx)("span",{className:"text-foreground",children:e??"?"}),r&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",r]})]})}if("tool_use"===e){let e=_(t,"name")??"tool",r=(t&&"object"==typeof t?t.input:void 0)??{},n=r.file_path??r.command??r.pattern??r.summary??Object.values(r)[0]??"";return(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-semibold text-primary",children:e}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"("}),(0,s.jsx)("span",{className:"text-foreground/80",children:String(n)}),(0,s.jsx)("span",{className:"text-muted-foreground",children:")"}),!!r.summary&&!!r.file_path&&(0,s.jsxs)("span",{className:"text-muted-foreground",children:[" — ",String(r.summary)]})]})}if("tool_result"===e){let e=t&&"object"==typeof t&&t.ok,r=_(t,"summary")??"",n=e?i.A:c.A;return(0,s.jsxs)("span",{className:(0,N.cn)("inline-flex items-center gap-1.5",e?"text-success":"text-destructive"),children:[(0,s.jsx)(n,{className:"h-3 w-3 shrink-0"}),(0,s.jsx)("span",{className:"text-foreground/80",children:r})]})}if("result"===e){let e=t??{},r="number"==typeof e.costUsd?e.costUsd:void 0,n="number"==typeof e.durationSec?e.durationSec:void 0,o="number"==typeof e.turns?e.turns:void 0,a="number"==typeof e.inputTokens?e.inputTokens:void 0,l="number"==typeof e.outputTokens?e.outputTokens:void 0,i="rounded bg-secondary px-1.5 py-0.5 text-[11px] tnum";return(0,s.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-2 align-middle",children:[(0,s.jsx)(h.E,{tone:"success",children:"done"}),null!=r&&(0,s.jsxs)("span",{className:i,children:["$",r.toFixed(2)]}),null!=n&&(0,s.jsxs)("span",{className:i,children:[Math.floor(n/60),"m ",n%60,"s"]}),null!=o&&(0,s.jsxs)("span",{className:i,children:[o," turns"]}),null!=a&&null!=l&&(0,s.jsxs)("span",{className:i,children:[(a/1e3).toFixed(0),"k in \xb7 ",(l/1e3).toFixed(1),"k out"]})]})}return(0,s.jsx)("span",{className:"text-muted-foreground",children:"string"==typeof t?t:JSON.stringify(t)})}function T({line:e,showClock:t}){let r=w[e.type]??k,n=r.icon,o=t&&e.ts?S(e.ts):"";return(0,s.jsxs)("div",{className:(0,N.cn)("dd-log-in flex gap-2.5 rounded-md px-2.5 py-1.5 hover:bg-secondary/40","error"===e.type&&"bg-destructive/[0.06]"),children:[(0,s.jsx)("span",{className:"shrink-0 select-none pt-0.5 text-[11px] tnum text-muted-foreground/60",children:o}),(0,s.jsx)(n,{className:(0,N.cn)("mt-0.5 h-[13px] w-[13px] shrink-0",r.color)}),(0,s.jsx)("span",{className:(0,N.cn)("w-[68px] shrink-0 pt-0.5 text-[10px] font-semibold uppercase tracking-wide",r.color),children:r.label}),(0,s.jsx)("div",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words pt-0.5",children:(0,s.jsx)(E,{type:e.type,payload:e.payload})})]})}function O({jobId:e,initial:t=[],active:r=!0}){let[n,o]=(0,f.useState)(t),[a,l]=(0,f.useState)(()=>!r||t.some(e=>C(e.type,e.payload))),[i,d]=(0,f.useState)(!0),[c,_]=(0,f.useState)(()=>new Set),[A,E]=(0,f.useState)(!1),$=(0,f.useRef)(new Set(t.map(e=>e.id))),F=(0,j.p)(),{success:J,error:L}=(0,y.d)();(0,f.useEffect)(()=>{if(!r||a)return;let t=new EventSource(`/api/sse/jobs/${e}`),s=e=>t=>{let r=t.lastEventId?Number(t.lastEventId):Date.now();if($.current.has(r))return;$.current.add(r);let s=t.data;try{s=JSON.parse(t.data)}catch{}o(t=>[...t,{id:r,type:e,payload:s,ts:Math.floor(Date.now()/1e3)}]),C(e,s)&&l(!0)};for(let e of v)t.addEventListener(e,s(e));return()=>t.close()},[e,r,a]);let z=(0,f.useMemo)(()=>n.filter(e=>!c.has(e.type)),[n,c]),D=!a,M=c.size;return(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl border border-card-border bg-card shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-card-border bg-secondary/40 px-3 py-2",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,s.jsx)(u.A,{className:"h-[15px] w-[15px] text-muted-foreground"})," Log stream"]}),D?(0,s.jsx)(h.E,{status:"working",children:"live"}):(0,s.jsxs)(h.E,{tone:"neutral",children:["complete \xb7 ",n.length," events"]}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>E(e=>!e),className:(0,N.cn)("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium hover-elevate focus-ring",M>0&&"text-primary"),children:[(0,s.jsx)(p.A,{className:"h-3.5 w-3.5"})," Filter",M>0&&(0,s.jsxs)("span",{className:"tnum",children:["\xb7 ",v.length-M]})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:(0,N.cn)("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium hover-elevate focus-ring",i?"text-primary":"text-muted-foreground"),"aria-pressed":i,children:[(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"})," Autoscroll"]}),(0,s.jsxs)("button",{type:"button",onClick:function(){let e=n.map(e=>{let t=e.ts?`[${S(e.ts)}] `:"",r="string"==typeof e.payload?e.payload:JSON.stringify(e.payload);return`${t}${e.type} ${r}`}).join("\n"),t=navigator.clipboard;t?t.writeText(e).then(()=>J("Log copied",`${n.length} events`)).catch(()=>L("Copy failed","Could not write to the clipboard.")):L("Copy failed","The clipboard is unavailable in this context.")},className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground hover-elevate focus-ring",children:[(0,s.jsx)(m.A,{className:"h-3.5 w-3.5"})," Copy"]})]})]}),A&&(0,s.jsx)("div",{className:"dd-fade-up flex flex-wrap items-center gap-1.5 border-b border-card-border bg-secondary/20 px-3 py-2",children:v.map(e=>{let t=!c.has(e),r=w[e]??k,n=r.icon;return(0,s.jsxs)("button",{type:"button",onClick:()=>{_(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},className:(0,N.cn)("inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] font-medium transition-colors focus-ring",t?`${r.chip} border-transparent`:"border-border text-muted-foreground/60 line-through"),children:[(0,s.jsx)(n,{className:"h-[11px] w-[11px]"})," ",r.label]},e)})}),(0,s.jsx)("div",{role:"log","aria-live":"polite","aria-label":"Job log stream",className:"h-[460px] bg-background/40 px-1 py-1 font-mono text-xs",children:(0,s.jsx)(g.aY,{data:z,followOutput:!!i&&"smooth",itemContent:(e,t)=>(0,s.jsx)(T,{line:t,showClock:F}),components:{Footer:()=>D?(0,s.jsxs)("div",{className:"flex items-center gap-2.5 px-2.5 py-1.5 text-muted-foreground",children:[(0,s.jsx)("span",{className:"w-[42px]"}),(0,s.jsx)(b.y,{size:13}),(0,s.jsx)("span",{className:"text-[11px]",children:"streaming…"})]}):null}})})]})}},5172:(e,t,r)=>{r.d(t,{V:()=>i,m:()=>l});var s=r(515),n=r(4393),o=r(5832);let a={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"};function l({content:e,children:t,side:r="top",className:n}){return(0,s.jsxs)("span",{className:"group/tt relative inline-flex",children:[t,(0,s.jsx)("span",{role:"tooltip",className:(0,o.cn)("pointer-events-none absolute z-50 w-max max-w-[260px] rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs leading-relaxed text-popover-foreground shadow-lg","translate-y-0.5 opacity-0 transition-all duration-150 group-focus-within/tt:opacity-100 group-hover/tt:translate-y-0 group-hover/tt:opacity-100",a[r],n),children:e})]})}function i({content:e,side:t="top"}){return(0,s.jsx)(l,{content:e,side:t,children:(0,s.jsx)("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground focus-ring","aria-label":"Help",children:(0,s.jsx)(n.A,{className:"h-3.5 w-3.5"})})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7690],{2235:(e,t,n)=>{var s=n(2067);n.o(s,"usePathname")&&n.d(t,{usePathname:function(){return s.usePathname}}),n.o(s,"useRouter")&&n.d(t,{useRouter:function(){return s.useRouter}}),n.o(s,"useSearchParams")&&n.d(t,{useSearchParams:function(){return s.useSearchParams}})},2414:(e,t,n)=>{n.d(t,{A:()=>s});let s=(0,n(1330).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},3823:(e,t,n)=>{n.d(t,{A:()=>s});let s=(0,n(1330).A)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]])},4913:(e,t,n)=>{n.d(t,{C:()=>m,B:()=>f});var s=n(515),r=n(3823),a=n(1171),l=n(4502);l.Ik({status:l.k5(["ok","warning","blocked"]),windowType:l.Yj(),resetsAt:l.ai().nullable(),capturedAt:l.ai()});var u=n(6845),i=n(6644),d=n(5529);let o={neutral:"bg-secondary text-muted-foreground",success:"bg-success/10 text-success",warning:"bg-warning/10 text-warning",destructive:"bg-destructive/10 text-destructive"};function c(e){return e&&"unknown"!==e?"five_hour"===e?"5h window":"weekly"===e?"weekly window":e.replace(/_/g," "):null}function x(e){let[,t]=(0,a.useReducer)(e=>e+1,0);(0,a.useEffect)(()=>{if(!e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[e])}function h(e){return function(e,t){if(null===e||e<=t)return null;let n=e-t;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400){let e=Math.floor(n/3600),t=Math.floor(n%3600/60);return t>0?`${e}h ${t}m`:`${e}h`}let s=Math.floor(n/86400),r=Math.floor(n%86400/3600);return r>0?`${s}d ${r}h`:`${s}d`}(e.resetsAt,Math.floor(Date.now()/1e3))}function f({view:e}){let t,n=(0,u.p)()?h(e):null;x(null!==n),t="blocked"===e.state?n?`Claude limited \xb7 ${n}`:"Claude limited":"warning"===e.state?n?`Claude \xb7 ${n}`:"Claude limit near":"ok"===e.state?"Claude OK":"Claude usage —";let a="unknown"===e.state?"Claude subscription usage: no recent reading yet":`Claude ${c(e.windowType)??"subscription"} — ${e.label}${n?` \xb7 resets in ${n}`:""}`;return(0,s.jsxs)(i.E,{tone:e.tone,title:a,className:"shrink-0",children:[(0,s.jsx)(r.A,{className:"h-3 w-3","aria-hidden":!0}),t]})}function m({view:e}){let t,n=(0,u.p)()?h(e):null;x(null!==n);let a=c(e.windowType);return t="unknown"===e.state?"No recent reading yet.":e.blocked?n?`Parked — resets in ${n}`:"Parked until the window resets":n?`Resets in ${n}`:a?`${a} active`:"Within limits",(0,s.jsxs)(d.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:`flex h-8 w-8 items-center justify-center rounded-lg ${o[e.tone]}`,children:(0,s.jsx)(r.A,{className:"h-4 w-4","aria-hidden":!0})}),(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Claude usage"})]}),(0,s.jsx)(i.E,{tone:e.tone,children:e.label})]}),(0,s.jsxs)("div",{className:"mt-3 flex items-baseline justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:t}),a&&"unknown"!==e.state&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground/70",children:a})]})]})}},9583:(e,t,n)=>{n.d(t,{L:()=>b,_:()=>w});var s=n(515),r=n(3823),a=n(1171),l=n(4502);let u=l.Ik({usedPercent:l.ai(),resetsAt:l.ai().optional(),windowMinutes:l.ai().optional()});function i(e,t){if(null===e||e<=t)return null;let n=e-t;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;if(n<86400){let e=Math.floor(n/3600),t=Math.floor(n%3600/60);return t>0?`${e}h ${t}m`:`${e}h`}let s=Math.floor(n/86400),r=Math.floor(n%86400/3600);return r>0?`${s}d ${r}h`:`${s}d`}l.Ik({capturedAt:l.ai(),primary:u.optional(),secondary:u.optional()});var d=n(6845),o=n(6644),c=n(5529);let x={neutral:"bg-secondary text-muted-foreground",success:"bg-success/10 text-success",warning:"bg-warning/10 text-warning",destructive:"bg-destructive/10 text-destructive"},h={neutral:"bg-muted-foreground/40",success:"bg-success",warning:"bg-warning",destructive:"bg-destructive"};function f(e){let[,t]=(0,a.useReducer)(e=>e+1,0);(0,a.useEffect)(()=>{if(!e)return;let n=setInterval(t,1e3);return()=>clearInterval(n)},[e])}function m(e){return Math.round(Math.min(Math.max(e,0),100))}function w({view:e}){let t,n=(0,d.p)()?i(e.resetsAt,Math.floor(Date.now()/1e3)):null;f(null!==n),t="blocked"===e.state?n?`Codex limited \xb7 ${n}`:"Codex limited":null!==e.usedPercent?`Codex ${m(e.usedPercent)}%`:"Codex usage —";let a="unknown"===e.state?"Codex OAuth usage: no recent reading yet":`Codex OAuth — ${e.label}${null!==e.usedPercent?` (${m(e.usedPercent)}% used)`:""}${n?` \xb7 resets in ${n}`:""}`;return(0,s.jsxs)(o.E,{tone:e.tone,title:a,className:"shrink-0",children:[(0,s.jsx)(r.A,{className:"h-3 w-3","aria-hidden":!0}),t]})}function g({label:e,window:t,tone:n,now:r}){let a=i(t.resetsAt??null,r);return(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:function(e,t){if(void 0===e)return t;if(e>=10020)return"weekly window";if(e>=60){let t=Math.round(e/60);return`${t}h window`}return`${e}m window`}(t.windowMinutes,e)}),(0,s.jsxs)("span",{className:"tnum text-muted-foreground",children:[m(t.usedPercent),"%"]})]}),(0,s.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,s.jsx)("div",{className:`h-full rounded-full ${h[n]}`,style:{width:`${m(t.usedPercent)}%`}})}),a&&(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground/80",children:["resets in ",a]})]})}function p(e){return e>=90?"destructive":e>=75?"warning":"success"}function b({view:e}){let t=(0,d.p)(),n=Math.floor(Date.now()/1e3),a=t&&e.blocked?i(e.resetsAt,n):null;return f((e.primary?.resetsAt??e.resetsAt)!==null&&t),(0,s.jsxs)(c.Zp,{pad:"lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:`flex h-8 w-8 items-center justify-center rounded-lg ${x[e.tone]}`,children:(0,s.jsx)(r.A,{className:"h-4 w-4","aria-hidden":!0})}),(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Codex usage"})]}),(0,s.jsx)(o.E,{tone:e.tone,children:e.label})]}),"unknown"===e.state?(0,s.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"No quota reading yet. Codex reports its OAuth usage as it runs."}):(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[e.blocked&&(0,s.jsxs)("div",{className:"rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:["Quota exhausted — work is parked",a?`, resets in ${a}`:"","."]}),e.primary&&(0,s.jsx)(g,{label:"5h window",window:e.primary,tone:p(e.primary.usedPercent),now:n}),e.secondary&&(0,s.jsx)(g,{label:"weekly window",window:e.secondary,tone:p(e.secondary.usedPercent),now:n}),!e.primary&&!e.secondary&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No window details reported."})]})]})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6029],{739:(e,t,s)=>{"use strict";s.d(t,{s:()=>c});var r=s(515),n=s(6845),a=s(5832);function c({ts:e,className:t}){let s=(0,n.p)();return(0,r.jsx)("span",{className:t,children:s?(0,a.KW)(e):"…"})}},4940:(e,t,s)=>{Promise.resolve().then(s.bind(s,5704))},5704:(e,t,s)=>{"use strict";s.d(t,{AdrReview:()=>v});var r=s(515),n=s(3639),a=s(1171),c=s(5138),i=s(9199),d=s(6644),l=s(395),o=s(5529),x=s(9694),u=s(9214),m=s(7405),p=s(739),f=s(8479),h=s(5097);let j=(0,h.createServerReference)("403e034e393c8ec019adf822a5775a005a81f11232",h.callServer,void 0,h.findSourceMapURL,"approveAdrAction"),g=(0,h.createServerReference)("60b75e117c3b22f053fff0ca500ba16bcef831dccf",h.callServer,void 0,h.findSourceMapURL,"rejectAdrAction");function v({items:e}){let[t,s]=(0,a.useState)(()=>new Set),c=e.filter(e=>"pending_review"===e.status&&!t.has(e.id)).length;return(0,r.jsxs)("div",{className:"dd-fade-up max-w-3xl",children:[(0,r.jsx)(i.z,{title:"ADRs",subtitle:"Architecture decisions the agent recorded — review before they harden.",icon:n.A,actions:c>0?(0,r.jsxs)(d.E,{tone:"destructive",children:[c," pending"]}):void 0}),0===e.length?(0,r.jsx)(o.Zp,{children:(0,r.jsx)(u.p,{icon:n.A,title:"No decisions yet",description:"When the agent makes a notable architectural call, it'll log an ADR here for you to review."})}):(0,r.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,r.jsx)(b,{adr:e,onResolved:()=>{let t;return t=e.id,s(e=>new Set(e).add(t))}},e.id))})]})}function b({adr:e,onResolved:t}){var s;let n,i,[u,h]=(0,a.useTransition)(),[v,N]=(0,a.useState)(""),[w,y]=(0,a.useState)(!1),[A,R]=(0,a.useState)(null),{success:S,error:k}=(0,f.d)(),_="pending_review"===e.status&&null===A,D=(n=(s=e.filePath).split("/").pop()??s,(i=n.match(/^(\d{1,4})/)?.[1])?`ADR-${i.padStart(3,"0")}`:n.replace(/\.mdx?$/,""));return(0,r.jsxs)(o.Zp,{pad:"default",className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-semibold text-muted-foreground",children:D}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate font-medium",children:e.title}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,r.jsx)(p.s,{ts:e.createdAt})})]}),_?(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)(l.$,{size:"sm",variant:"outline",disabled:u,onClick:function(){h(async()=>{try{await j(e.id),R("approved"),t(),S("ADR approved",e.title)}catch(e){k("Failed to approve ADR",e instanceof Error?e.message:String(e))}})},children:"Accept"}),(0,r.jsx)(l.$,{size:"sm",variant:"ghost",disabled:u,onClick:()=>y(!0),children:"Reject"})]}):(0,r.jsx)(d.E,{tone:"rejected"===A?"neutral":"success",children:"rejected"===A?"rejected":"accepted"})]}),(0,r.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none rounded-lg border border-card-border bg-secondary/40 p-4 [&_pre]:bg-card",children:(0,r.jsx)(c.oz,{children:e.content})}),_&&(0,r.jsx)(m.p,{"aria-label":"Rejection comment",placeholder:"Optional rejection comment",value:v,onChange:e=>N(e.target.value)}),(0,r.jsx)(x.T,{open:w,onOpenChange:y,onConfirm:function(){h(async()=>{try{await g(e.id,v),R("rejected"),t(),S("ADR rejected",e.title)}catch(e){k("Failed to reject ADR",e instanceof Error?e.message:String(e))}})},title:"Reject ADR?",description:`This rejects "${e.title}" and notifies the run.`,confirmLabel:"Reject",variant:"destructive",pending:u})]})}},7405:(e,t,s)=>{"use strict";s.d(t,{p:()=>c});var r=s(515),n=s(1171),a=s(5832);let c=n.forwardRef(({className:e,...t},s)=>(0,r.jsx)("input",{ref:s,className:(0,a.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));c.displayName="Input"},9199:(e,t,s)=>{"use strict";s.d(t,{z:()=>l});var r=s(515),n=s(9662),a=s(742),c=s.n(a),i=s(1171),d=s(5832);function l({title:e,subtitle:t,breadcrumb:s,actions:a,icon:o,className:x}){return(0,r.jsxs)("div",{className:(0,d.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",x),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[s&&s.length>0&&(0,r.jsx)("nav",{className:"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:s.map((e,t)=>(0,r.jsxs)(i.Fragment,{children:[t>0&&(0,r.jsx)(n.A,{className:"h-3 w-3 opacity-60","aria-hidden":!0}),e.href?(0,r.jsx)(c(),{href:e.href,className:"rounded transition-colors hover:text-foreground focus-ring",children:e.label}):(0,r.jsx)("span",{className:"text-foreground/80",children:e.label})]},e.href??e.label))}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[o&&(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,r.jsx)(o,{className:"h-[17px] w-[17px]"})}),(0,r.jsx)("h1",{className:"text-pretty text-2xl font-bold tracking-tight",children:e})]}),t&&(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),a&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:a})]})}},9214:(e,t,s)=>{"use strict";s.d(t,{p:()=>c});var r=s(515),n=s(5832);let a={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function c({icon:e,tone:t="neutral",title:s,description:i,action:d,secondary:l,className:o,compact:x}){return(0,r.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center text-center",x?"py-10":"py-16",o),children:[e&&(0,r.jsx)("div",{className:(0,n.cn)("flex items-center justify-center rounded-2xl",x?"h-12 w-12":"h-16 w-16",a[t]),children:(0,r.jsx)(e,{className:x?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,r.jsx)("h3",{className:"mt-4 text-base font-semibold",children:s}),i&&(0,r.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:i}),(d||l)&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[d,l]})]})}}},e=>{e.O(0,[9843,4443,3433,9655,4234,7358],()=>e(e.s=4940)),_N_E=e.O()}]);