@nilsr0711/drydock 0.1.2 → 0.1.3

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 (64) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +3 -3
  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_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/adrs/page.js +2 -2
  16. package/.next/standalone/.next/server/app/adrs/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/costs/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/jobs/[id]/page.js +3 -3
  19. package/.next/standalone/.next/server/app/jobs/[id]/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/needs-human/page.js +1 -1
  21. package/.next/standalone/.next/server/app/needs-human/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/page.js +2 -2
  23. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/prompts/page.js +2 -2
  25. package/.next/standalone/.next/server/app/prompts/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/repos/[id]/page.js +2 -2
  27. package/.next/standalone/.next/server/app/repos/[id]/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  29. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app-paths-manifest.json +3 -3
  31. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  32. package/.next/standalone/.next/server/pages/500.html +1 -1
  33. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  35. package/.next/standalone/.next/static/chunks/app/adrs/page-54954f500bc3e3c6.js +1 -0
  36. package/.next/{static/chunks/app/jobs/[id]/page-265e757a89803698.js → standalone/.next/static/chunks/app/jobs/[id]/page-217e04f338b50a7e.js} +1 -1
  37. package/.next/standalone/.next/static/chunks/app/needs-human/{page-88cb4f2c3aaf76c4.js → page-c047e3e842681979.js} +1 -1
  38. package/.next/standalone/.next/static/chunks/app/page-382b7fef1f749214.js +1 -0
  39. package/.next/standalone/.next/static/chunks/app/prompts/page-9e32fb8f51e7873e.js +1 -0
  40. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-55b03bdcf107eefe.js +1 -0
  41. package/.next/standalone/.next/static/chunks/app/settings/{page-b6af5304dba71aa3.js → page-5b2b8683fa6afdf4.js} +1 -1
  42. package/.next/standalone/package.json +1 -1
  43. package/.next/static/chunks/app/adrs/page-54954f500bc3e3c6.js +1 -0
  44. package/.next/{standalone/.next/static/chunks/app/jobs/[id]/page-265e757a89803698.js → static/chunks/app/jobs/[id]/page-217e04f338b50a7e.js} +1 -1
  45. package/.next/static/chunks/app/needs-human/{page-88cb4f2c3aaf76c4.js → page-c047e3e842681979.js} +1 -1
  46. package/.next/static/chunks/app/page-382b7fef1f749214.js +1 -0
  47. package/.next/static/chunks/app/prompts/page-9e32fb8f51e7873e.js +1 -0
  48. package/.next/static/chunks/app/repos/[id]/page-55b03bdcf107eefe.js +1 -0
  49. package/.next/static/chunks/app/settings/{page-b6af5304dba71aa3.js → page-5b2b8683fa6afdf4.js} +1 -1
  50. package/README.md +1 -1
  51. package/bin/drydock.mjs +113 -7
  52. package/package.json +1 -1
  53. package/.next/standalone/.next/static/chunks/app/adrs/page-e75b859d58967540.js +0 -1
  54. package/.next/standalone/.next/static/chunks/app/page-ab315dafdd344c06.js +0 -1
  55. package/.next/standalone/.next/static/chunks/app/prompts/page-562338cf5f420f96.js +0 -1
  56. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-3099a9a513358664.js +0 -1
  57. package/.next/static/chunks/app/adrs/page-e75b859d58967540.js +0 -1
  58. package/.next/static/chunks/app/page-ab315dafdd344c06.js +0 -1
  59. package/.next/static/chunks/app/prompts/page-562338cf5f420f96.js +0 -1
  60. package/.next/static/chunks/app/repos/[id]/page-3099a9a513358664.js +0 -1
  61. /package/.next/standalone/.next/static/{ZVOWTwaHoyx4ZcNdVzldW → g7t6i0qpogjrDGpmNgFei}/_buildManifest.js +0 -0
  62. /package/.next/standalone/.next/static/{ZVOWTwaHoyx4ZcNdVzldW → g7t6i0qpogjrDGpmNgFei}/_ssgManifest.js +0 -0
  63. /package/.next/static/{ZVOWTwaHoyx4ZcNdVzldW → g7t6i0qpogjrDGpmNgFei}/_buildManifest.js +0 -0
  64. /package/.next/static/{ZVOWTwaHoyx4ZcNdVzldW → g7t6i0qpogjrDGpmNgFei}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{4696:(e,s,t)=>{"use strict";t.d(s,{d:()=>x,t:()=>u});var r=t(43031),n=t(64892),a=t(24928),i=t(52263),l=t(95579),o=t(89983),d=t(6636);let c=(0,o.createContext)(null);function u({children:e}){let[s,t]=(0,o.useState)([]),n=(0,o.useCallback)(e=>{t(s=>s.filter(s=>s.id!==e))},[]),a=(0,o.useCallback)(e=>{let s=Date.now()+Math.random(),r={id:s,title:e.title,description:e.description,variant:e.variant??"info"};t(e=>[...e,r]),setTimeout(()=>n(s),5e3)},[n]),i=(0,o.useMemo)(()=>({toast:a,success:(e,s)=>a({title:e,description:s,variant:"success"}),error:(e,s)=>a({title:e,description:s,variant:"error"})}),[a]);return(0,r.jsxs)(c.Provider,{value:i,children:[e,(0,r.jsx)(f,{toasts:s,onDismiss:n})]})}function x(){let e=(0,o.useContext)(c);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let m={success:n.A,error:a.A,info:i.A},p={success:"text-success",error:"text-destructive",info:"text-muted-foreground"};function f({toasts:e,onDismiss:s}){return 0===e.length?null:(0,r.jsx)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:e.map(e=>{let t=m[e.variant];return(0,r.jsxs)("output",{"aria-live":"polite",className:"pointer-events-auto flex items-start gap-3 rounded-xl border border-card-border bg-card p-3 shadow-lg",children:[(0,r.jsx)(t,{className:(0,d.cn)("mt-0.5 h-4 w-4 shrink-0",p[e.variant])}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,r.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,r.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>s(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})})]},e.id)})})}},6636:(e,s,t)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ")}t.d(s,{cn:()=>r})},7848:(e,s,t)=>{"use strict";t.d(s,{DashboardLive:()=>P});var r=t(43031),n=t(23835);let a=(0,n.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var i=t(89983);let l=(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 o=t(95579);let d=(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"}]]),c=(0,n.A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var u=t(67727),x=t(70099),m=t(80821);let p=(0,m.createServerReference)("40142c9da1e26d7aeaa790db9a6795af69a9de4aea",m.callServer,void 0,m.findSourceMapURL,"browseDirectoryAction");function f({onSelect:e,onClose:s}){let[t,n]=(0,i.useState)(null),[a,m]=(0,i.useTransition)(),g=e=>m(async()=>n(await p(e)));return(0,i.useEffect)(()=>{g()},[]),(0,r.jsx)(x.l,{open:!0,onClose:s,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",{className:"flex items-center gap-2 font-semibold",children:[(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),"Choose a folder"]}),(0,r.jsx)(u.$,{size:"icon",variant:"ghost","aria-label":"Close",onClick:s,children:(0,r.jsx)(o.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:t?.path,children:t?.path??"…"}),t?.isGitRepo&&(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-1 rounded bg-success-muted px-1.5 py-0.5 text-xs text-success",children:[(0,r.jsx)(d,{className:"h-3 w-3"}),"git repo"]})]}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto py-2",children:[t?.parent&&(0,r.jsxs)("button",{type:"button",disabled:a,onClick:()=>g(t.parent??void 0),className:"flex w-full items-center gap-2 rounded px-2 py-1 text-left text-sm hover-elevate",children:[(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),".."]}),t?.entries.map(e=>(0,r.jsxs)("button",{type:"button",disabled:a,onClick:()=>g(e.path),className:"flex w-full items-center justify-between gap-2 rounded px-2 py-1 text-left text-sm hover-elevate",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[e.isGitRepo?(0,r.jsx)(d,{className:"h-4 w-4 text-muted-foreground"}):(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),e.name]}),e.isGitRepo&&(0,r.jsx)("span",{className:"rounded bg-success-muted px-1 text-[10px] text-success",children:"git"})]},e.path)),t&&0===t.entries.length&&(0,r.jsx)("p",{className:"px-2 py-1 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)(u.$,{variant:"outline",size:"sm",onClick:s,children:"Cancel"}),(0,r.jsxs)(u.$,{size:"sm",disabled:!t||a,onClick:()=>t&&e(t.path),children:[(0,r.jsx)(c,{}),"Use this folder"]})]})]})})}var g=t(78063);let h={github:{id:"github",label:"GitHub",needsConnection:!1},gitlab:{id:"gitlab",label:"GitLab",needsConnection:!0}},v=["github","gitlab"].map(e=>h[e]);function b({value:e,onChange:s,id:t,className:n}){return(0,r.jsx)(g.l,{id:t,value:e,onChange:e=>s(e.target.value),className:n,children:v.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}var j=t(25774),y=t(52445),N=t(75945);let w=(0,m.createServerReference)("401545d16e784c563161a1b4dd98bf5411129e13eb",m.callServer,void 0,m.findSourceMapURL,"addRepoAction");function k({onDone:e}){let[s,t]=(0,i.useTransition)(),[n,a]=(0,i.useState)(""),[l,o]=(0,i.useState)(""),[d,c]=(0,i.useState)(N.UB),[x,m]=(0,i.useState)("github"),[p,g]=(0,i.useState)(""),[h,v]=(0,i.useState)(""),[C,S]=(0,i.useState)(!1);return(0,r.jsxs)(y.Zp,{children:[(0,r.jsx)(y.Wu,{className:"pt-4",children:(0,r.jsxs)("form",{className:"grid gap-2 sm:grid-cols-2",action:()=>{t(async()=>{await w({path:l,name:n,defaultModel:d,platform:x,apiBaseUrl:"gitlab"===x&&p.trim()||null,apiToken:"gitlab"===x&&h.trim()||null}),e()})},children:[(0,r.jsx)("input",{value:n,onChange:e=>a(e.target.value),placeholder:"Name",required:!0,className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{value:l,onChange:e=>o(e.target.value),placeholder:"/abs/path/to/repo",required:!0,className:"h-9 flex-1 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"}),(0,r.jsx)(u.$,{type:"button",variant:"outline",size:"sm",onClick:()=>S(!0),children:"Browse…"})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Model:"}),(0,r.jsx)(j.o,{value:d,onChange:c})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Platform:"}),(0,r.jsx)(b,{value:x,onChange:m})]}),"gitlab"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{value:p,onChange:e=>g(e.target.value),placeholder:"API base URL (e.g. https://gitlab.com)",className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background sm:col-span-2"}),(0,r.jsx)("input",{value:h,onChange:e=>v(e.target.value),type:"password",placeholder:"Access token (stored locally)",className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background sm:col-span-2"})]}),(0,r.jsx)(u.$,{type:"submit",disabled:s||!l,className:"sm:col-span-2",children:"Save"})]})}),C&&(0,r.jsx)(f,{onClose:()=>S(!1),onSelect:e=>{o(e),n.trim()||a(e.replace(/\/+$/,"").split("/").pop()??""),S(!1)}})]})}var C=t(6636);let S={neutral:"text-foreground",primary:"text-primary",success:"text-success",destructive:"text-destructive"};function R({label:e,value:s,display:t,tone:n="neutral"}){let a=s>0&&"neutral"!==n;return(0,r.jsxs)("div",{className:"rounded-xl border border-card-border bg-card px-4 py-3 shadow-sm",children:[(0,r.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:e}),(0,r.jsx)("div",{className:(0,C.cn)("mt-1 text-2xl font-semibold tabular-nums",a?S[n]:"text-foreground"),children:t??s})]})}function M({summary:e}){return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[(0,r.jsx)(R,{label:"Repos",value:e.repos}),(0,r.jsx)(R,{label:"Queued",value:e.queued}),(0,r.jsx)(R,{label:"Running",value:e.running,tone:"primary"}),(0,r.jsx)(R,{label:"Merged",value:e.merged,tone:"success"}),(0,r.jsx)(R,{label:"Needs human",value:e.needsHuman,tone:"destructive"}),(0,r.jsx)(R,{label:"Spend today",value:e.spendToday,display:`$${e.spendToday.toFixed(2)}`,tone:"primary"})]})}let E=(0,n.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var A=t(42626),$=t.n(A),T=t(22320),L=t(96498),_=t(4696);let z=(0,m.createServerReference)("4013304a93859665f54c2bac312ba5883bf710165f",m.callServer,void 0,m.findSourceMapURL,"removeRepoAction");function D({repo:e}){var s;let t,[n,a]=(0,i.useTransition)(),[l,o]=(0,i.useState)(!1),{success:d,error:c}=(0,_.d)();return(0,r.jsxs)(y.Zp,{className:(0,C.cn)("hover-elevate transition-shadow hover:shadow-md",e.attention&&"border-destructive/50 bg-destructive/5"),children:[(0,r.jsxs)(y.Wu,{className:"space-y-3 p-4",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)($(),{href:`/repos/${e.id}`,className:"font-mono text-sm font-semibold hover:underline",children:e.name}),(0,r.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.path})]}),e.attention&&(0,r.jsxs)(T.E,{tone:"destructive",className:"shrink-0",children:[(0,r.jsx)(E,{className:"h-3 w-3"})," Needs human"]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:["gitlab"===e.platform&&(0,r.jsx)(T.E,{tone:"primary",children:"GitLab"}),(0,r.jsxs)(T.E,{tone:"neutral",children:[e.queued," queued"]}),e.working>0?(0,r.jsxs)(T.E,{status:"working",children:[e.working," working"]}):(0,r.jsx)(T.E,{tone:"neutral",children:"0 working"}),e.ciRunning>0?(0,r.jsxs)(T.E,{status:"ci_running",children:[e.ciRunning," CI"]}):(0,r.jsx)(T.E,{tone:"neutral",children:"0 CI"}),e.needsHuman>0&&(0,r.jsxs)(T.E,{tone:"destructive",children:[e.needsHuman," needs human"]})]}),e.inFlight.length>0&&(0,r.jsx)("ul",{className:"space-y-0.5 text-xs text-muted-foreground",children:e.inFlight.map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(T.E,{status:e.status,className:"px-1.5 py-0"}),(0,r.jsxs)($(),{href:`/jobs/${e.id}`,className:"font-mono hover:underline",children:["#",e.issueNumber]})]},e.id))}),(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{children:["Today:"," ",(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:["$",e.todaySpend.toFixed(2)]})]}),(0,r.jsx)("span",{children:e.lastActivityAt?(s=e.lastActivityAt,(t=Math.floor(Date.now()/1e3)-s)<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*s).toLocaleDateString()):"no activity"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)($(),{href:`/repos/${e.id}`,children:(0,r.jsx)(u.$,{size:"sm",children:"Open"})}),(0,r.jsx)(u.$,{size:"sm",variant:"ghost",disabled:n,onClick:()=>o(!0),children:"Remove"})]})]}),(0,r.jsx)(L.T,{open:l,onOpenChange:o,onConfirm:function(){a(async()=>{try{await z(e.id),d("Repository removed",e.name)}catch(e){c("Failed to remove repository",e instanceof Error?e.message:String(e))}})},title:"Remove repository?",description:`This stops watching ${e.name}. Existing jobs are unaffected.`,confirmLabel:"Remove",variant:"destructive",pending:n})]})}function P({initial:e}){let[s,t]=(0,i.useState)(e),[n,l]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=new EventSource("/api/sse/dashboard");return e.addEventListener("snapshot",e=>{try{t(JSON.parse(e.data))}catch{}}),()=>e.close()},[]);let{repos:o,summary:d}=s;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(M,{summary:d}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-sm font-semibold",children:["Repositories ",(0,r.jsxs)("span",{className:"text-muted-foreground",children:["(",o.length,")"]})]}),(0,r.jsx)(u.$,{size:"sm",onClick:()=>l(e=>!e),children:n?"Cancel":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a,{})," Add repo"]})})]}),n&&(0,r.jsx)(k,{onDone:()=>l(!1)}),0===o.length&&!n&&(0,r.jsx)(y.Zp,{children:(0,r.jsx)(y.Wu,{className:"py-10 text-center text-sm text-muted-foreground",children:"No repositories yet. Add one to start automating issues."})}),(0,r.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:o.map(e=>(0,r.jsx)(D,{repo:e},e.id))})]})]})}},22320:(e,s,t)=>{"use strict";t.d(s,{E:()=>o});var r=t(43031),n=t(6636);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",merged:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning"},l=new Set(["working","ci_running","retrying"]);function o({className:e,status:s,tone:t,children:d,...c}){let u=t??(s?i[s]??"neutral":"neutral"),x=void 0!==s&&l.has(s);return(0,r.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:[x&&(0,r.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,r.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),d??s?.replace(/_/g," ")]})}},25774:(e,s,t)=>{"use strict";t.d(s,{o:()=>i});var r=t(43031),n=t(78063),a=t(75945);function i({value:e,onChange:s,agent:t,id:l,className:o}){let d=t?(0,a.tT)(t):a.L6;return(0,r.jsx)(n.l,{id:l,value:e,onChange:e=>s(e.target.value),className:o,children:d.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}},52445:(e,s,t)=>{"use strict";t.d(s,{Wu:()=>o,ZB:()=>l,Zp:()=>a,aR:()=>i});var r=t(43031),n=t(6636);function a({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",e),...s})}function i({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col gap-1.5 p-5",e),...s})}function l({className:e,...s}){return(0,r.jsx)("h3",{className:(0,n.cn)("text-base font-semibold leading-none tracking-tight",e),...s})}function o({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("p-5 pt-0",e),...s})}},67727:(e,s,t)=>{"use strict";t.d(s,{$:()=>o});var r=t(43031),n=t(89983),a=t(6636);let i={default:"bg-primary text-primary-foreground shadow-xs hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-xs hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-xs hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2"},l={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-8 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg"},o=n.forwardRef(({className:e,variant:s="default",size:t="default",...n},o)=>(0,r.jsx)("button",{ref:o,className:(0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i[s],l[t],e),...n}));o.displayName="Button"},70099:(e,s,t)=>{"use strict";t.d(s,{l:()=>a});var r=t(43031),n=t(89983);function a({open:e,onClose:s,children:t}){return((0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,s]),e)?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-8",onMouseDown:s,children:(0,r.jsx)("div",{role:"dialog","aria-modal":"true",className:"mt-8 w-full max-w-2xl rounded-xl border border-card-border bg-card p-5 shadow-lg",onMouseDown:e=>e.stopPropagation(),children:t})}):null}},75945:(e,s,t)=>{"use strict";t.d(s,{L6:()=>r,UB:()=>n,VJ:()=>i,tT:()=>a});let r=[{id:"claude-opus-4-7",label:"Claude Opus 4.7",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"}],n="claude-opus-4-7";function a(e){return r.filter(s=>s.agent===e)}function i(e){return a(e)[0]?.id??n}},78063:(e,s,t)=>{"use strict";t.d(s,{l:()=>i});var r=t(43031),n=t(89983),a=t(6636);let i=n.forwardRef(({className:e,...s},t)=>(0,r.jsx)("select",{ref:t,className:(0,a.cn)("h-9 rounded-md border border-input bg-background px-2.5 text-sm text-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",e),...s}));i.displayName="Select"},80821:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var n in r)Object.defineProperty(s,n,{enumerable:!0,get:r[n]});let a=t(66966),i=t(99842),l=t(98281)},85548:(e,s,t)=>{Promise.resolve().then(t.bind(t,7848))},96498:(e,s,t)=>{"use strict";t.d(s,{T:()=>i});var r=t(43031),n=t(67727),a=t(70099);function i({open:e,onOpenChange:s,onConfirm:t,title:l,description:o,confirmLabel:d="Confirm",cancelLabel:c="Cancel",variant:u="default",pending:x=!1}){return(0,r.jsx)(a.l,{open:e,onClose:()=>s(!1),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold",children:l}),o&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:o})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(n.$,{variant:"outline",size:"sm",disabled:x,onClick:()=>s(!1),children:c}),(0,r.jsx)(n.$,{variant:"destructive"===u?"destructive":"default",size:"sm",disabled:x,onClick:()=>{t(),s(!1)},children:d})]})]})})}}},e=>{e.O(0,[700,633,586,358],()=>e(e.s=85548)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[942],{125:(e,t,r)=>{"use strict";r.d(t,{PromptEditor:()=>en});var n,i,o=r(43031);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return function t(){for(var r=this,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(r,[].concat(i,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function d(e){return"function"==typeof e}var f=s(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),h=function(e,t){return l(t)||f("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&f("changeField"),t},p=function(e){d(e)||f("selectorType")},g=function(e){d(e)||l(e)||f("handlerType"),l(e)&&Object.values(e).some(function(e){return!d(e)})&&f("handlersType")},m=function(e){e||f("initialIsRequired"),l(e)||f("initialType"),Object.keys(e).length||f("initialContent")};function v(e,t){return d(t)?t(e.current):t}function b(e,t){return e.current=u(u({},e.current),t),t}function x(e,t,r){return d(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var y={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},w=(n=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=n.length?n.apply(this,i):function(){for(var r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return e.apply(t,[].concat(i,n))}})(y),j=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},M={type:"cancelation",msg:"operation is manually canceled"};function E(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(M):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var N=function(e){if(Array.isArray(e))return e}(i=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),g(t);var r={current:e},n=s(x)(r,t),i=s(b)(r),o=s(h)(e),a=s(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return p(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,i,o,a)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,i,o,a=[],c=!0,u=!1;try{i=(t=t.call(e)).next,!1;for(;!(c=(r=i.call(t)).done)&&(a.push(r.value),2!==a.length);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw n}}return a}}(i)||function(e){if(e){if("string"==typeof e)return a(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,2):void 0}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),S=N[0],k=N[1];function O(e){return document.body.appendChild(e)}function R(e){var t,r,n=S(function(e){return{config:e.config,reject:e.reject}}),i=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return i.onload=function(){return e()},i.onerror=n.reject,i}function C(){var e=S(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;A(r),e.resolve(r)},function(t){e.reject(t)})}function A(e){S().monaco||k({monaco:e})}var P=new Promise(function(e,t){return k({resolve:e,reject:t})}),_=function(){var e=S(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(k({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),E(P);if(window.monaco&&window.monaco.editor)return A(window.monaco),e.resolve(window.monaco),E(P);j(O,R)(C)}return E(P)},I=r(89983),L={display:"flex",position:"relative",textAlign:"initial"},T={width:"100%"},U={display:"none"},$={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},V=function({children:e}){return I.createElement("div",{style:$},e)},z=(0,I.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:i,className:o,wrapperProps:a}){return I.createElement("section",{style:{...L,width:e,height:t},...a},!r&&I.createElement(V,null,n),I.createElement("div",{ref:i,style:{...T,...!r&&U},className:o}))}),B=function(e){(0,I.useEffect)(e,[])},D=function(e,t,r=!0){let n=(0,I.useRef)(!0);(0,I.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function W(){}function Z(e,t,r,n){var i,o,a,c,u,s;return i=e,o=n,i.editor.getModel(q(i,o))||(a=e,c=t,u=r,s=n,a.editor.createModel(c,u,s?q(a,s):void 0))}function q(e,t){return e.Uri.parse(t)}(0,I.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:s="light",loading:l="Loading...",options:d={},height:f="100%",width:h="100%",className:p,wrapperProps:g={},beforeMount:m=W,onMount:v=W}){let[b,x]=(0,I.useState)(!1),[y,w]=(0,I.useState)(!0),j=(0,I.useRef)(null),M=(0,I.useRef)(null),E=(0,I.useRef)(null),N=(0,I.useRef)(v),S=(0,I.useRef)(m),k=(0,I.useRef)(!1);B(()=>{let e=_();return e.then(e=>(M.current=e)&&w(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(c||t?.original?.dispose(),u||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),D(()=>{if(j.current&&M.current){let t=j.current.getOriginalEditor(),i=Z(M.current,e||"",n||r||"text",o||"");i!==t.getModel()&&t.setModel(i)}},[o],b),D(()=>{if(j.current&&M.current){let e=j.current.getModifiedEditor(),n=Z(M.current,t||"",i||r||"text",a||"");n!==e.getModel()&&e.setModel(n)}},[a],b),D(()=>{let e=j.current.getModifiedEditor();e.getOption(M.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],b),D(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],b),D(()=>{let{original:e,modified:t}=j.current.getModel();M.current.editor.setModelLanguage(e,n||r||"text"),M.current.editor.setModelLanguage(t,i||r||"text")},[r,n,i],b),D(()=>{M.current?.editor.setTheme(s)},[s],b),D(()=>{j.current?.updateOptions(d)},[d],b);let O=(0,I.useCallback)(()=>{if(!M.current)return;S.current(M.current);let c=Z(M.current,e||"",n||r||"text",o||""),u=Z(M.current,t||"",i||r||"text",a||"");j.current?.setModel({original:c,modified:u})},[r,t,i,e,n,o,a]),R=(0,I.useCallback)(()=>{!k.current&&E.current&&(j.current=M.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...d}),O(),M.current?.editor.setTheme(s),x(!0),k.current=!0)},[d,s,O]);return(0,I.useEffect)(()=>{b&&N.current(j.current,M.current)},[b]),(0,I.useEffect)(()=>{y||b||R()},[y,b,R]),I.createElement(z,{width:h,height:f,isEditorReady:b,loading:l,_ref:E,className:p,wrapperProps:g})});var F=function(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current},G=new Map,H=(0,I.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:i,path:o,theme:a="light",line:c,loading:u="Loading...",options:s={},overrideServices:l={},saveViewState:d=!0,keepCurrentModel:f=!1,width:h="100%",height:p="100%",className:g,wrapperProps:m={},beforeMount:v=W,onMount:b=W,onChange:x,onValidate:y=W}){let[w,j]=(0,I.useState)(!1),[M,E]=(0,I.useState)(!0),N=(0,I.useRef)(null),S=(0,I.useRef)(null),k=(0,I.useRef)(null),O=(0,I.useRef)(b),R=(0,I.useRef)(v),C=(0,I.useRef)(),A=(0,I.useRef)(n),P=F(o),L=(0,I.useRef)(!1),T=(0,I.useRef)(!1);B(()=>{let e=_();return e.then(e=>(N.current=e)&&E(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>S.current?void(C.current?.dispose(),f?d&&G.set(o,S.current.saveViewState()):S.current.getModel()?.dispose(),S.current.dispose()):e.cancel()}),D(()=>{let a=Z(N.current,e||n||"",t||i||"",o||r||"");a!==S.current?.getModel()&&(d&&G.set(P,S.current?.saveViewState()),S.current?.setModel(a),d&&S.current?.restoreViewState(G.get(o)))},[o],w),D(()=>{S.current?.updateOptions(s)},[s],w),D(()=>{S.current&&void 0!==n&&(S.current.getOption(N.current.editor.EditorOption.readOnly)?S.current.setValue(n):n!==S.current.getValue()&&(T.current=!0,S.current.executeEdits("",[{range:S.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),S.current.pushUndoStop(),T.current=!1))},[n],w),D(()=>{let e=S.current?.getModel();e&&i&&N.current?.editor.setModelLanguage(e,i)},[i],w),D(()=>{void 0!==c&&S.current?.revealLine(c)},[c],w),D(()=>{N.current?.editor.setTheme(a)},[a],w);let U=(0,I.useCallback)(()=>{if(!(!k.current||!N.current)&&!L.current){R.current(N.current);let u=o||r,f=Z(N.current,n||e||"",t||i||"",u||"");S.current=N.current?.editor.create(k.current,{model:f,automaticLayout:!0,...s},l),d&&S.current.restoreViewState(G.get(u)),N.current.editor.setTheme(a),void 0!==c&&S.current.revealLine(c),j(!0),L.current=!0}},[e,t,r,n,i,o,s,l,d,a,c]);return(0,I.useEffect)(()=>{w&&O.current(S.current,N.current)},[w]),(0,I.useEffect)(()=>{M||w||U()},[M,w,U]),A.current=n,(0,I.useEffect)(()=>{w&&x&&(C.current?.dispose(),C.current=S.current?.onDidChangeModelContent(e=>{T.current||x(S.current.getValue(),e)}))},[w,x]),(0,I.useEffect)(()=>{if(w){let e=N.current.editor.onDidChangeMarkers(e=>{let t=S.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=N.current.editor.getModelMarkers({resource:t});y?.(e)}});return()=>{e?.dispose()}}return()=>{}},[w,y]),I.createElement(z,{width:h,height:p,isEditorReady:w,loading:u,_ref:k,className:g,wrapperProps:m})}),Y=r(67727),J=r(52445),K=r(4696),Q=r(80821);let X=(0,Q.createServerReference)("607de74a1473ac427360bc914ab1e72ec6fc7563d8",Q.callServer,void 0,Q.findSourceMapURL,"loadTemplateAction"),ee=(0,Q.createServerReference)("409688d9f8b7109c3280b9b44c4fbd61ec472cb2ef",Q.callServer,void 0,Q.findSourceMapURL,"saveTemplateAction"),et="default",er=["$ISSUE_NUM","$BRANCH","$REPO_NAME","$CI_LOG"];function en({repos:e,initialContent:t,initialVersions:r}){let[n,i]=(0,I.useState)(t),[a,c]=(0,I.useState)(e[0]?.id??0),[u,s]=(0,I.useState)(et),[l,d]=(0,I.useState)(r),[f,h]=(0,I.useTransition)(),[p,g]=(0,I.useState)(null),{success:m,error:v}=(0,K.d)();function b(e,t){h(async()=>{try{let r=await X(e,t);i(r.content),d(r.versions),g(null)}catch(e){v("Failed to load template",e instanceof Error?e.message:String(e))}})}let x=function(e,t){let r={$ISSUE_NUM:void 0!==t.ISSUE_NUM?String(t.ISSUE_NUM):"$ISSUE_NUM",$BRANCH:t.BRANCH??"$BRANCH",$REPO_NAME:t.REPO_NAME??"$REPO_NAME",$CI_LOG:t.CI_LOG??"$CI_LOG"},n=e;for(let e of[...er].sort((e,t)=>t.length-e.length))n=n.split(e).join(r[e]??e);return n}(n,{ISSUE_NUM:42,BRANCH:"fix/issue-42",REPO_NAME:"acme",CI_LOG:"example CI failure output"});return(0,o.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,o.jsxs)(J.Zp,{children:[(0,o.jsxs)(J.aR,{children:[(0,o.jsx)(J.ZB,{children:"Editor"}),(0,o.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Variables: ",er.join(", ")]})]}),(0,o.jsxs)(J.Wu,{className:"space-y-2",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)("select",{"aria-label":"Repository",className:"rounded border border-card-border bg-background px-2 py-1 text-sm",value:a,onChange:e=>{let t=Number(e.target.value);c(t),b(t,u)},children:e.map(e=>(0,o.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,o.jsxs)("select",{"aria-label":"Template",className:"rounded border border-card-border bg-background px-2 py-1 text-sm",value:u,onChange:e=>{s(e.target.value),b(a,e.target.value)},children:[(0,o.jsx)("option",{value:et,children:"Main"}),(0,o.jsx)("option",{value:"ci-fix",children:"CI fix"})]})]}),(0,o.jsx)("div",{className:"h-72 border border-card-border",children:(0,o.jsx)(H,{defaultLanguage:"markdown",value:n,onChange:e=>i(e??""),options:{minimap:{enabled:!1},fontSize:13}})}),(0,o.jsx)(Y.$,{disabled:f||!a,onClick:()=>h(async()=>{try{let e=await ee({repoId:a,name:u,content:n});g(e.version);let t=await X(a,u);d(t.versions),m("Template saved",`Version ${e.version}`)}catch(e){v("Failed to save template",e instanceof Error?e.message:String(e))}}),children:"Save version"}),null!==p&&(0,o.jsxs)("span",{className:"ml-2 text-xs text-success",children:["Saved v",p]})]})]}),(0,o.jsxs)(J.Zp,{children:[(0,o.jsx)(J.aR,{children:(0,o.jsx)(J.ZB,{children:"Preview (sample data)"})}),(0,o.jsxs)(J.Wu,{children:[(0,o.jsx)("pre",{className:"whitespace-pre-wrap text-xs",children:x}),(0,o.jsx)("h3",{className:"mt-4 mb-1 text-sm font-semibold",children:"Versions"}),(0,o.jsx)("ul",{className:"text-xs text-muted-foreground",children:l.map(e=>(0,o.jsxs)("li",{children:["v",e.version]},e.version))})]})]})]})}},4696:(e,t,r)=>{"use strict";r.d(t,{d:()=>f,t:()=>d});var n=r(43031),i=r(64892),o=r(24928),a=r(52263),c=r(95579),u=r(89983),s=r(6636);let l=(0,u.createContext)(null);function d({children:e}){let[t,r]=(0,u.useState)([]),i=(0,u.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),o=(0,u.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(()=>i(t),5e3)},[i]),a=(0,u.useMemo)(()=>({toast:o,success:(e,t)=>o({title:e,description:t,variant:"success"}),error:(e,t)=>o({title:e,description:t,variant:"error"})}),[o]);return(0,n.jsxs)(l.Provider,{value:a,children:[e,(0,n.jsx)(g,{toasts:t,onDismiss:i})]})}function f(){let e=(0,u.useContext)(l);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let h={success:i.A,error:o.A,info:a.A},p={success:"text-success",error:"text-destructive",info:"text-muted-foreground"};function g({toasts:e,onDismiss:t}){return 0===e.length?null:(0,n.jsx)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:e.map(e=>{let r=h[e.variant];return(0,n.jsxs)("output",{"aria-live":"polite",className:"pointer-events-auto flex items-start gap-3 rounded-xl border border-card-border bg-card p-3 shadow-lg",children:[(0,n.jsx)(r,{className:(0,s.cn)("mt-0.5 h-4 w-4 shrink-0",p[e.variant])}),(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)(c.A,{className:"h-3.5 w-3.5"})})]},e.id)})})}},6636:(e,t,r)=>{"use strict";function n(...e){return e.filter(Boolean).join(" ")}r.d(t,{cn:()=>n})},11510:(e,t,r)=>{Promise.resolve().then(r.bind(r,125))},23835:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(89983);let i=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,n.createContext)({}),u=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:o,className:u="",children:s,iconNode:l,...d},f)=>{let{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:g=!1,color:m="currentColor",className:v=""}=(0,n.useContext)(c)??{},b=o??g?24*Number(r??p)/Number(t??h):r??p;return(0,n.createElement)("svg",{ref:f,...a,width:t??h??a.width,height:t??h??a.height,stroke:e??m,strokeWidth:b,className:i("lucide",v,u),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...l.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),s=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...a},c)=>(0,n.createElement)(u,{ref:c,iconNode:t,className:i(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...a}));return r.displayName=o(e),r}},24928:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},52263:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},52445:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>u,ZB:()=>c,Zp:()=>o,aR:()=>a});var n=r(43031),i=r(6636);function o({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",e),...t})}function a({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("flex flex-col gap-1.5 p-5",e),...t})}function c({className:e,...t}){return(0,n.jsx)("h3",{className:(0,i.cn)("text-base font-semibold leading-none tracking-tight",e),...t})}function u({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("p-5 pt-0",e),...t})}},64892:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},67727:(e,t,r)=>{"use strict";r.d(t,{$:()=>u});var n=r(43031),i=r(89983),o=r(6636);let a={default:"bg-primary text-primary-foreground shadow-xs hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-xs hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-xs hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2"},c={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-8 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg"},u=i.forwardRef(({className:e,variant:t="default",size:r="default",...i},u)=>(0,n.jsx)("button",{ref:u,className:(0,o.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a[t],c[r],e),...i}));u.displayName="Button"},80821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var i in n)Object.defineProperty(t,i,{enumerable:!0,get:n[i]});let o=r(66966),a=r(99842),c=r(98281)},95579:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},e=>{e.O(0,[633,586,358],()=>e(e.s=11510)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[530],{15247:(e,t,s)=>{"use strict";s.d(t,{RepoAutomationBar:()=>d});var r=s(43031),a=s(89983),n=s(4696),l=s(67603);function o(e){try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function d({repo:e}){let[t,s]=(0,a.useState)(e.autoTriageEnabled),[c,i]=(0,a.useState)(e.autoProcessEnabled),[u,m]=(0,a.useState)(e.autoHealCi),[x,p]=(0,a.useState)(e.autoReviewFeedback),[g,h]=(0,a.useState)(e.autoDecompose),[b,f]=(0,a.useState)(e.verifyPr),[v,j]=(0,a.useState)(e.autoHealDeployments),[y,N]=(0,a.useState)(e.releaseEnabled),[k,S]=(0,a.useState)(e.autoResolveMergeConflicts),[w,C]=(0,a.useState)(e.includeProgressReplies),[R,A]=(0,a.useState)(o(e.readyLabels).join(", ")),[P,L]=(0,a.useState)(o(e.blockingLabels).join(", ")),[E,M]=(0,a.useState)(o(e.autoLabelWhitelist).join(", ")),[D,T]=(0,a.useState)(o(e.priorityAuthors).join(", ")),[I,O]=(0,a.useState)(o(e.trustedReviewers).join(", ")),[U,$]=(0,a.useState)(o(e.ignoredBots).join(", ")),[F,_]=(0,a.useState)(e.minAuthorAssociation),[B,H]=(0,a.useState)(e.deploymentPlatform??""),[z,G]=(0,a.useState)(e.maxAttempts),[V,q]=(0,a.useState)(e.agentInstructions??""),[J,W]=(0,a.useTransition)(),[Q,Y]=(0,a.useState)(!1),{error:K}=(0,n.d)();function X(t){Y(!1),W(async()=>{try{await (0,l.u)(e.id,t),Y(!0),setTimeout(()=>Y(!1),1500)}catch(e){K("Failed to update automation",e instanceof Error?e.message:String(e))}})}let Z=(e,t,s,a,n)=>(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:e,children:[t,(0,r.jsx)("input",{id:e,value:s,onChange:e=>a(e.target.value),onBlur:()=>X({[n]:[...new Set(s.split(/[,\n]/).map(e=>e.trim()).filter(Boolean))]}),placeholder:"comma-separated",className:"rounded border border-card-border bg-background px-2 py-1 text-sm text-foreground"})]});return(0,r.jsxs)("div",{className:"space-y-3 rounded-xl border border-card-border bg-card p-3 text-sm",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,r.jsx)("span",{className:"text-sm font-semibold",children:"Automation"}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:t,onChange:e=>{s(e.target.checked),X({autoTriageEnabled:e.target.checked})}}),"Auto-triage new issues"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:c,onChange:e=>{i(e.target.checked),X({autoProcessEnabled:e.target.checked})}}),"Auto-process ready issues"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:u,onChange:e=>{m(e.target.checked),X({autoHealCi:e.target.checked})}}),"Auto-heal failing CI"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:x,onChange:e=>{p(e.target.checked),X({autoReviewFeedback:e.target.checked})}}),"Address PR review feedback"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:g,onChange:e=>{h(e.target.checked),X({autoDecompose:e.target.checked})}}),"Decompose large issues"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:b,onChange:e=>{f(e.target.checked),X({verifyPr:e.target.checked})}}),"Verify PR satisfies issue"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:v,onChange:e=>{j(e.target.checked),X({autoHealDeployments:e.target.checked})}}),"Heal failed deployments"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:y,onChange:e=>{N(e.target.checked),X({releaseEnabled:e.target.checked})}}),"Manage releases"]}),J&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Saving…"}),Q&&(0,r.jsx)("span",{className:"text-xs text-success",children:"Saved"})]}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Opt-in. All stages are off by default and consume paid agent usage. Triage may only apply whitelisted labels; auto-processing works issues that are ",(0,r.jsx)("em",{children:"ready"})," and not blocked; auto-heal attempts bounded, verified fixes for failing CI (never external or AI-review checks). PR review feedback is applied only for trusted reviewers (bots ignored) and runs the mechanical iteration for you. Decomposing large issues splits them into ordered, tracked subtasks (checklist/heading heuristics, with an agent fallback for prose). Verifying a PR runs a read-only pass after it opens that checks whether the diff actually satisfies the issue and its subtasks, flags what remains, and never changes state on failure. Deployment healing monitors a merged PR's deployment and, on failure, opens a follow-up fix PR with the captured logs. Managing releases evaluates merged PRs since the last tag, decides the semver bump, and publishes a release — gated by a global kill-switch and fully previewable. Drydock never auto-merges — a human always reviews the PR."]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[Z("ready-labels","Ready labels",R,A,"readyLabels"),Z("blocking-labels","Blocking labels",P,L,"blockingLabels"),Z("whitelist","Auto-label whitelist",E,M,"autoLabelWhitelist"),Z("priority-authors","Priority authors",D,T,"priorityAuthors"),Z("trusted-reviewers","Trusted reviewers (feedback)",I,O,"trustedReviewers"),Z("ignored-bots","Ignored bots (feedback)",U,$,"ignoredBots"),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"min-assoc",children:["Act on authors",(0,r.jsxs)("select",{id:"min-assoc",value:F,onChange:e=>{_(e.target.value),X({minAuthorAssociation:e.target.value})},className:"rounded border border-card-border bg-background px-2 py-1 text-sm text-foreground",children:[(0,r.jsx)("option",{value:"approved",children:"Owners / members / collaborators"}),(0,r.jsx)("option",{value:"any",children:"Anyone (public participation)"})]})]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"resolve-conflicts",children:[(0,r.jsx)("input",{id:"resolve-conflicts",type:"checkbox",checked:k,onChange:e=>{S(e.target.checked),X({autoResolveMergeConflicts:e.target.checked})}}),"Repair trivial merge conflicts"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"progress-replies",children:[(0,r.jsx)("input",{id:"progress-replies",type:"checkbox",checked:w,onChange:e=>{C(e.target.checked),X({includeProgressReplies:e.target.checked})}}),"Post progress replies"]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"deploy-platform",children:["Deployment platform (healing)",(0,r.jsxs)("select",{id:"deploy-platform",value:B,onChange:e=>{H(e.target.value),X({deploymentPlatform:e.target.value?e.target.value:null})},className:"rounded border border-card-border bg-background px-2 py-1 text-sm text-foreground",children:[(0,r.jsx)("option",{value:"",children:"Auto-detect"}),(0,r.jsx)("option",{value:"vercel",children:"Vercel"}),(0,r.jsx)("option",{value:"railway",children:"Railway"})]})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"max-attempts",children:["Max attempts",(0,r.jsx)("input",{id:"max-attempts",type:"number",min:1,step:1,value:z,onChange:e=>G(Number(e.target.value)),onBlur:()=>X({maxAttempts:z}),className:"w-24 rounded border border-card-border bg-background px-2 py-1 text-sm text-foreground"})]})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"agent-instructions",children:["Agent instructions",(0,r.jsx)("textarea",{id:"agent-instructions",value:V,maxLength:4e3,rows:4,onChange:e=>q(e.target.value),onBlur:()=>X({agentInstructions:V.trim()||null}),placeholder:'Per-repo guidance injected into the work prompt — e.g. coding conventions, "always run pnpm test", "don\'t touch legacy/", preferred PR style.',className:"rounded border border-card-border bg-background px-2 py-1 font-mono text-sm text-foreground"}),(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["Optional. Appended to the work prompt as a dedicated section. Max"," ",4e3," characters; empty leaves the prompt unchanged."]})]})]})}},22320:(e,t,s)=>{"use strict";s.d(t,{E:()=>d});var r=s(43031),a=s(6636);let n={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"},l={queued:"neutral",working:"primary",ci_running:"warning",ci_failed:"destructive",retrying:"warning",merged:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning"},o=new Set(["working","ci_running","retrying"]);function d({className:e,status:t,tone:s,children:c,...i}){let u=s??(t?l[t]??"neutral":"neutral"),m=void 0!==t&&o.has(t);return(0,r.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",n[u],e),...i,children:[m&&(0,r.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,r.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),c??t?.replace(/_/g," ")]})}},24835:(e,t,s)=>{"use strict";s.d(t,{RepoWebhookPanel:()=>o});var r=s(43031),a=s(89983),n=s(4696),l=s(67603);function o({repo:e}){let[t,s]=(0,a.useState)(e.webhookSecret??""),[d,c]=(0,a.useState)(!1),[i,u]=(0,a.useState)(`/api/webhooks/${e.id}`),[m,x]=(0,a.useTransition)(),[p,g]=(0,a.useState)(!1),{error:h}=(0,n.d)();(0,a.useEffect)(()=>{u(`${window.location.origin}/api/webhooks/${e.id}`)},[e.id]);let b=(e.webhookSecret??"").length>0,f="gitlab"===e.platform;function v(t){g(!1),x(async()=>{try{await (0,l.u)(e.id,{webhookSecret:t.trim()||null}),g(!0),setTimeout(()=>g(!1),1500)}catch(e){h("Failed to update webhook",e instanceof Error?e.message:String(e))}})}return(0,r.jsxs)("div",{className:"space-y-3 rounded-xl border border-card-border bg-card p-3 text-sm",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-sm font-semibold",children:"Webhook sync"}),(0,r.jsx)("span",{className:`rounded px-1.5 py-0.5 text-xs ${b?"bg-success/15 text-success":"bg-muted text-muted-foreground"}`,children:b?"On":"Off"}),m&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Saving…"}),p&&(0,r.jsx)("span",{className:"text-xs text-success",children:"Saved"})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"webhook-secret",children:["Shared secret",(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{id:"webhook-secret",type:d?"text":"password",value:t,onChange:e=>s(e.target.value),onBlur:()=>{(t.trim()||null)!==(e.webhookSecret??null)&&v(t)},placeholder:"Set a secret to enable webhook delivery",className:"min-w-0 flex-1 rounded border border-card-border bg-background px-2 py-1 font-mono text-sm text-foreground"}),(0,r.jsx)("button",{type:"button",onClick:()=>c(e=>!e),className:"rounded border border-card-border px-2 py-1 text-xs text-muted-foreground hover:bg-muted",children:d?"Hide":"Show"}),(0,r.jsx)("button",{type:"button",onClick:()=>{let e,t=(e=new Uint8Array(20),crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join(""));s(t),c(!0),v(t)},className:"rounded border border-card-border px-2 py-1 text-xs text-muted-foreground hover:bg-muted",children:"Generate"}),b&&(0,r.jsx)("button",{type:"button",onClick:()=>{s(""),v("")},className:"rounded border border-card-border px-2 py-1 text-xs text-destructive hover:bg-muted",children:"Disable"})]})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-muted-foreground",htmlFor:"webhook-url",children:["Payload URL",(0,r.jsx)("input",{id:"webhook-url",readOnly:!0,value:i,onFocus:e=>e.currentTarget.select(),className:"rounded border border-card-border bg-background px-2 py-1 font-mono text-xs text-foreground"})]}),(0,r.jsxs)("p",{className:"text-xs 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 ",f?"GitLab":"GitHub"," webhook for"," ",(0,r.jsx)("em",{children:f?"issues and comments":"Issues and Issue comments"})," at the payload URL above with"," ",f?(0,r.jsxs)(r.Fragment,{children:["this secret as the ",(0,r.jsx)("code",{className:"font-mono",children:"Secret token"})]}):(0,r.jsxs)(r.Fragment,{children:["this secret and content type ",(0,r.jsx)("code",{className:"font-mono",children:"application/json"})]}),". Drydock binds ",(0,r.jsx)("code",{className:"font-mono",children:"127.0.0.1"}),", so expose the URL through a tunnel or forwarder (e.g. ",(0,r.jsx)("code",{className:"font-mono",children:"cloudflared"}),","," ",(0,r.jsx)("code",{className:"font-mono",children:"ngrok"}),") to receive deliveries. Each delivery is"," ",f?"token-verified":"HMAC-SHA256 signature-verified","; invalid or unsigned payloads are rejected."]})]})}},25774:(e,t,s)=>{"use strict";s.d(t,{o:()=>l});var r=s(43031),a=s(78063),n=s(75945);function l({value:e,onChange:t,agent:s,id:o,className:d}){let c=s?(0,n.tT)(s):n.L6;return(0,r.jsx)(a.l,{id:o,value:e,onChange:e=>t(e.target.value),className:d,children:c.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}},40256:(e,t,s)=>{"use strict";s.d(t,{RepoReleasePanel:()=>m});var r=s(43031),a=s(89983),n=s(22320),l=s(67727),o=s(4696),d=s(80821);let c=(0,d.createServerReference)("40ad78727d00427eee62c00d5fe4a0c4eb5fd6c2e2",d.callServer,void 0,d.findSourceMapURL,"previewReleaseAction"),i=(0,d.createServerReference)("40de1fe5a29c732fb7eb65c670a9a369946829223a",d.callServer,void 0,d.findSourceMapURL,"publishReleaseAction"),u={detected:"neutral",evaluating:"neutral",proposed:"primary",publishing:"warning",published:"success",skipped:"neutral",error:"destructive"};function m({repoId:e,initialRuns:t}){let[s,d]=(0,a.useState)(t),[x,p]=(0,a.useState)(null),[g,h]=(0,a.useTransition)(),{error:b,success:f}=(0,o.d)();return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Releases"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.$,{variant:"outline",size:"sm",onClick:function(){h(async()=>{try{p(await c(e))}catch(e){b("Preview failed",e instanceof Error?e.message:String(e))}})},disabled:g,children:"Preview"}),(0,r.jsx)(l.$,{size:"sm",onClick:function(){h(async()=>{try{let t=await i(e);d(t),p(null),f("Release published","A release run was cut from the latest changes.")}catch(e){b("Publish failed",e instanceof Error?e.message:String(e))}})},disabled:g,children:"Publish release"})]})]}),x&&(0,r.jsxs)("div",{className:"space-y-1 rounded-lg border border-card-border bg-card p-3 text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-medium",children:"Proposed:"}),(0,r.jsx)(n.E,{tone:"primary",children:x.candidateTag}),(0,r.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,r.jsxs)("ul",{className:"text-xs text-muted-foreground",children:[x.prs.map(e=>(0,r.jsxs)("li",{children:["#",e.number," ",e.title]},e.number)),0===x.prs.length&&(0,r.jsx)("li",{children:"No unreleased pull requests."})]})]}),(0,r.jsxs)("ul",{className:"space-y-1",children:[s.map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:e.mode}),e.tag&&(0,r.jsx)("span",{className:"font-medium",children:e.tag}),null!=e.triggerPrNumber&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["PR #",e.triggerPrNumber]}),(0,r.jsx)(n.E,{tone:u[e.status]??"neutral",children:e.status}),e.errorMessage&&(0,r.jsx)("span",{className:"ml-auto truncate text-xs text-destructive",title:e.errorMessage,children:e.errorMessage})]},e.id)),0===s.length&&(0,r.jsx)("li",{className:"text-sm text-muted-foreground",children:"No release runs yet."})]})]})}},61920:(e,t,s)=>{"use strict";s.d(t,{RepoSettingsBar:()=>i});var r=s(43031),a=s(89983),n=s(66605),l=s(25774),o=s(4696),d=s(75945),c=s(67603);function i({repo:e}){let[t,s]=(0,a.useState)(e.agent),[u,m]=(0,a.useState)(e.defaultModel),[x,p]=(0,a.useState)(e.dailyCostLimitUsd),[g,h]=(0,a.useState)(e.adrGating),[b,f]=(0,a.useState)(e.sequential),[v,j]=(0,a.useTransition)(),[y,N]=(0,a.useState)(!1),{error:k}=(0,o.d)();function S(t){N(!1),j(async()=>{try{await (0,c.u)(e.id,t),N(!0),setTimeout(()=>N(!1),1500)}catch(e){k("Failed to update repository",e instanceof Error?e.message:String(e))}})}return(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-card-border bg-card p-3 text-sm",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Queue label:"}),(0,r.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:e.queueLabel}),(0,r.jsx)("span",{className:"ml-auto text-muted-foreground",children:"Daily limit $"}),(0,r.jsx)("input",{type:"number",min:0,step:1,value:x,onChange:e=>{var t;p(t=Number(e.target.value)),S({dailyCostLimitUsd:t})},className:"w-20 rounded border border-card-border bg-background px-2 py-1 text-sm"}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:g,onChange:e=>{var t;h(t=e.target.checked),S({adrGating:t})}}),"ADR gate"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",children:[(0,r.jsx)("input",{type:"checkbox",checked:b,onChange:e=>{var t;f(t=e.target.checked),S({sequential:t})}}),"Sequential (wait for merge)"]}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Agent:"}),(0,r.jsx)(n.a,{value:t,onChange:function(e){let t=(0,d.VJ)(e);s(e),m(t),S({agent:e,defaultModel:t})}}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"Model:"}),(0,r.jsx)(l.o,{value:u,onChange:function(e){m(e),S({defaultModel:e})},agent:t}),v&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Saving…"}),y&&(0,r.jsx)("span",{className:"text-xs text-success",children:"Saved"})]})}},67603:(e,t,s)=>{"use strict";s.d(t,{u:()=>a});var r=s(80821);let a=(0,r.createServerReference)("60b4ffb77facbef3de2d7373e591218110583105bb",r.callServer,void 0,r.findSourceMapURL,"updateRepoAction")},70099:(e,t,s)=>{"use strict";s.d(t,{l:()=>n});var r=s(43031),a=s(89983);function n({open:e,onClose:t,children:s}){return((0,a.useEffect)(()=>{if(!e)return;let s=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-8",onMouseDown:t,children:(0,r.jsx)("div",{role:"dialog","aria-modal":"true",className:"mt-8 w-full max-w-2xl rounded-xl border border-card-border bg-card p-5 shadow-lg",onMouseDown:e=>e.stopPropagation(),children:s})}):null}},73183:(e,t,s)=>{"use strict";s.d(t,{LogViewer:()=>o});var r=s(43031),a=s(89983),n=s(47744);let l=["status","text","tool_use","tool_result","result","claude_exit","error"];function o({jobId:e,initial:t=[]}){let[s,d]=(0,a.useState)(t),c=(0,a.useRef)(new Set(t.map(e=>e.id)));return(0,a.useEffect)(()=>{let t=new EventSource(`/api/sse/jobs/${e}`),s=e=>t=>{let s=t.lastEventId?Number(t.lastEventId):Date.now();if(c.current.has(s))return;c.current.add(s);let r=t.data;try{r=JSON.parse(t.data)}catch{}d(t=>[...t,{id:s,type:e,payload:r}])};for(let e of l)t.addEventListener(e,s(e));return()=>t.close()},[e]),(0,r.jsx)("div",{className:"h-96 rounded border border-card-border",children:(0,r.jsx)(n.aY,{data:s,followOutput:"smooth",itemContent:(e,t)=>(0,r.jsxs)("div",{className:"px-3 py-1 font-mono text-xs",children:[(0,r.jsx)("span",{className:"mr-2 text-muted-foreground",children:t.type}),(0,r.jsx)("span",{children:"string"==typeof t.payload?t.payload:JSON.stringify(t.payload)})]})})})}},75945:(e,t,s)=>{"use strict";s.d(t,{L6:()=>r,UB:()=>a,VJ:()=>l,tT:()=>n});let r=[{id:"claude-opus-4-7",label:"Claude Opus 4.7",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-7";function n(e){return r.filter(t=>t.agent===e)}function l(e){return n(e)[0]?.id??a}},77071:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,42626,23)),Promise.resolve().then(s.bind(s,94973)),Promise.resolve().then(s.bind(s,73183)),Promise.resolve().then(s.bind(s,15247)),Promise.resolve().then(s.bind(s,40256)),Promise.resolve().then(s.bind(s,61920)),Promise.resolve().then(s.bind(s,24835))},94973:(e,t,s)=>{"use strict";s.d(t,{IssueBoard:()=>k});var r=s(43031),a=s(89983),n=s(22320),l=s(67727),o=s(96498),d=s(70099),c=s(80821);let i=(0,c.createServerReference)("60f8185da31741f275b57b866d309e723334a4e36f",c.callServer,void 0,c.findSourceMapURL,"viewIssueAction"),u=(0,c.createServerReference)("60c4f9de4bd6166ee9f372eedd1023b3a8c8d0adad",c.callServer,void 0,c.findSourceMapURL,"listSubtasksAction"),m=(0,c.createServerReference)("70d1c0f28ea0312c5677b60eceb4f213056acfcda3",c.callServer,void 0,c.findSourceMapURL,"setIssueStateAction"),x=(0,c.createServerReference)("70b85da4517941b7d1571923c3a68ea6bb3fec05a1",c.callServer,void 0,c.findSourceMapURL,"editIssueAction"),p=(0,c.createServerReference)("78419259d1ecda5a1b98a83330d221211a9b4e4672",c.callServer,void 0,c.findSourceMapURL,"setIssueLabelsAction"),g=(0,c.createServerReference)("70d5dd10640e5351881dd9754ece7474c161b21990",c.callServer,void 0,c.findSourceMapURL,"commentIssueAction"),h={pending:{label:"Pending",symbol:"○"},in_progress:{label:"In progress",symbol:"◐"},done:{label:"Done",symbol:"✓"},skipped:{label:"Skipped",symbol:"⊘"},deferred:{label:"Deferred",symbol:"⏸"}};function b({repoId:e,issueNumber:t,open:s,onClose:c}){let[f,v]=(0,a.useState)(null),[j,y]=(0,a.useState)([]),[N,k]=(0,a.useState)(""),[S,w]=(0,a.useState)(""),[C,R]=(0,a.useState)(""),[A,P]=(0,a.useState)(""),[L,E]=(0,a.useState)(null),[M,D]=(0,a.useState)(!1),[T,I]=(0,a.useTransition)();function O(){null!==t&&(i(e,t).then(v).catch(e=>E(e.message)),u(e,t).then(y).catch(()=>y([])))}function U(t){f&&I(()=>{m(e,f.number,t).then(O).catch(e=>E(e.message))})}return((0,a.useEffect)(()=>{s&&null!==t&&(E(null),v(null),y([]),i(e,t).then(e=>{v(e),k(e.title),w(e.body)}).catch(e=>E(e.message)),u(e,t).then(y).catch(()=>y([])))},[s,t,e]),null===t)?null:(0,r.jsxs)(d.l,{open:s,onClose:c,children:[L&&(0,r.jsx)("p",{className:"mb-2 text-xs text-destructive",children:L}),f?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["#",f.number]}),(0,r.jsx)(n.E,{children:f.state}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",className:"ml-auto",disabled:T,onClick:()=>"open"===f.state?D(!0):U("open"),children:"open"===f.state?"Close issue":"Reopen issue"})]}),(0,r.jsx)("input",{value:N,onChange:e=>k(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium"}),(0,r.jsx)("textarea",{value:S,onChange:e=>w(e.target.value),rows:8,className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"}),(0,r.jsx)(l.$,{size:"sm",disabled:T,onClick:()=>I(()=>{x(e,f.number,{title:N,body:S}).then(O).catch(e=>E(e.message))}),children:"Save changes"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Labels"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[f.labels.map(t=>(0,r.jsx)("button",{type:"button",title:"Remove label",disabled:T,onClick:()=>I(()=>{p(e,f.number,[],[t]).then(O).catch(e=>E(e.message))}),children:(0,r.jsxs)(n.E,{children:[t," \xd7"]})},t)),(0,r.jsx)("input",{value:A,onChange:e=>P(e.target.value),placeholder:"add label",className:"w-28 rounded-md border border-input bg-background px-2 py-1 text-xs"}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",disabled:T||!A.trim(),onClick:()=>I(()=>{p(e,f.number,[A.trim()],[]).then(()=>{P(""),O()}).catch(e=>E(e.message))}),children:"Add"})]})]}),j.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Subtasks (",j.filter(e=>"done"===e.status).length,"/",j.length,")"]}),(0,r.jsx)("ol",{className:"space-y-1",children:j.map(e=>{let t=h[e.status]??{label:e.status,symbol:"○"},s="done"===e.status||"skipped"===e.status;return(0,r.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-card-border bg-background px-2 py-1 text-sm",children:[(0,r.jsx)("span",{className:"text-muted-foreground","aria-hidden":!0,children:t.symbol}),(0,r.jsx)("span",{className:s?"text-muted-foreground line-through":"",children:e.title}),(0,r.jsx)("span",{className:"ml-auto",children:(0,r.jsx)(n.E,{children:t.label})})]},e.id)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Comments"}),(0,r.jsxs)("ul",{className:"space-y-2",children:[f.comments.map(e=>(0,r.jsxs)("li",{className:"rounded-md border border-card-border bg-background p-2 text-sm",children:[(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.author," \xb7 ",e.createdAt]}),(0,r.jsx)("p",{className:"whitespace-pre-wrap",children:e.body})]},`${e.author}-${e.createdAt}`)),0===f.comments.length&&(0,r.jsx)("li",{className:"text-sm text-muted-foreground",children:"No comments yet."})]}),(0,r.jsx)("textarea",{value:C,onChange:e=>R(e.target.value),rows:3,placeholder:"Write a comment…",className:"mt-2 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"}),(0,r.jsx)(l.$,{size:"sm",className:"mt-2",disabled:T||!C.trim(),onClick:()=>I(()=>{g(e,f.number,C.trim()).then(()=>{R(""),O()}).catch(e=>E(e.message))}),children:"Comment"})]})]}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),f&&(0,r.jsx)(o.T,{open:M,onOpenChange:D,onConfirm:()=>U("closed"),title:"Close issue?",description:`This closes #${f.number} on GitHub.`,confirmLabel:"Close issue",variant:"destructive",pending:T})]})}let f=(0,c.createServerReference)("40edb32d0f19cf9dfb999aa52424e5effc621586e5",c.callServer,void 0,c.findSourceMapURL,"syncRepoIssuesAction"),v=(0,c.createServerReference)("60d0061590f6703e2098b668fd45e712610c3da7ca",c.callServer,void 0,c.findSourceMapURL,"addToQueueAction"),j=(0,c.createServerReference)("602827ad72db86d5341c318e6263fc1168ac051dbd",c.callServer,void 0,c.findSourceMapURL,"removeFromQueueAction"),y=(0,c.createServerReference)("60e0e52af87bbfe8e7a1521095070a72abd5759720",c.callServer,void 0,c.findSourceMapURL,"reorderIssuesAction");function N(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function k({repoId:e,queueLabel:t,initialIssues:s,pollIntervalSec:o}){let[d,c]=(0,a.useState)(s),[i,u]=(0,a.useState)(""),[m,x]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[h,S]=(0,a.useTransition)(),[w,C]=(0,a.useState)(null);(0,a.useEffect)(()=>c(s),[s]),(0,a.useEffect)(()=>{let t=setInterval(()=>{f(e).then(c).catch(e=>C(e.message))},1e3*Math.max(10,o));return()=>clearInterval(t)},[e,o]);let R=e=>N(e.labels).includes(t),A=e=>{let t=i.toLowerCase();return!t||e.title.toLowerCase().includes(t)||String(e.number).includes(t)||N(e.labels).some(e=>e.toLowerCase().includes(t))},P=d.filter(e=>!R(e)&&A(e)),L=d.filter(e=>R(e)&&A(e));function E({issue:s,index:a,reorderable:l}){return(0,r.jsxs)("li",{draggable:!0,onDragStart:()=>x(s.number),onDragOver:e=>e.preventDefault(),onDrop:t=>{t.stopPropagation(),l&&function(t){if(null===m||m===t)return;let s=d.find(e=>e.number===m);if(!s||!R(s))return;let r=L.map(e=>e.number).filter(e=>e!==m),a=r.indexOf(t);r.splice(a,0,m),x(null),S(()=>{y(e,r).catch(e=>C(e.message))})}(s.number)},className:"issue-row flex cursor-pointer items-center gap-3 rounded-xl border border-card-border bg-card p-3",onClick:()=>g(s.number),children:[l&&(0,r.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground",children:a+1}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"truncate text-sm font-medium",children:["#",s.number," ",s.title]}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[s.triagedAt&&(0,r.jsx)(n.E,{tone:"primary",title:"Labels applied by auto-triage — see the issue comment for reasons",children:"auto-triaged"}),N(s.labels).filter(e=>e!==t).map(e=>(0,r.jsx)(n.E,{children:e},e))]})]}),(0,r.jsx)("span",{className:"cursor-grab text-muted-foreground",title:"Drag",children:"⠿"})]})}return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Issues"}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",d.length,")"]}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",className:"ml-auto",disabled:h,onClick:function(){C(null),S(()=>{f(e).then(c).catch(e=>C(e.message))})},children:h?"Syncing…":"Refresh"})]}),(0,r.jsx)("input",{"aria-label":"Search issues by title or label",value:i,onChange:e=>u(e.target.value),placeholder:"Search by title or label…",className:"w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"}),w&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:w}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{onDragOver:e=>e.preventDefault(),onDrop:function(){if(null===m)return;let t=d.find(e=>e.number===m);x(null),t&&R(t)&&S(()=>{j(e,t.number).then(c).catch(e=>C(e.message))})},className:"space-y-2 rounded-xl border border-dashed border-card-border p-2",children:[(0,r.jsxs)("p",{className:"px-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Backlog (",P.length,")"]}),(0,r.jsxs)("ul",{className:"space-y-2",children:[P.map((e,t)=>(0,r.jsx)(E,{issue:e,index:t,reorderable:!1},e.number)),0===P.length&&(0,r.jsx)("li",{className:"px-1 text-sm text-muted-foreground",children:"No backlog issues."})]})]}),(0,r.jsxs)("div",{onDragOver:e=>e.preventDefault(),onDrop:function(){if(null===m)return;let t=d.find(e=>e.number===m);x(null),!t||R(t)||S(()=>{v(e,t.number).then(c).catch(e=>C(e.message))})},className:"space-y-2 rounded-xl border border-dashed border-card-border p-2",children:[(0,r.jsxs)("p",{className:"px-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Queue (",L.length,")"]}),(0,r.jsxs)("ul",{className:"space-y-2",children:[L.map((e,t)=>(0,r.jsx)(E,{issue:e,index:t,reorderable:!0},e.number)),0===L.length&&(0,r.jsx)("li",{className:"px-1 text-sm text-muted-foreground",children:"Drag issues here to auto-process them."})]})]})]}),(0,r.jsx)(b,{repoId:e,issueNumber:p,open:null!==p,onClose:()=>g(null)})]})}},96498:(e,t,s)=>{"use strict";s.d(t,{T:()=>l});var r=s(43031),a=s(67727),n=s(70099);function l({open:e,onOpenChange:t,onConfirm:s,title:o,description:d,confirmLabel:c="Confirm",cancelLabel:i="Cancel",variant:u="default",pending:m=!1}){return(0,r.jsx)(n.l,{open:e,onClose:()=>t(!1),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold",children:o}),d&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:d})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(a.$,{variant:"outline",size:"sm",disabled:m,onClick:()=>t(!1),children:i}),(0,r.jsx)(a.$,{variant:"destructive"===u?"destructive":"default",size:"sm",disabled:m,onClick:()=>{s(),t(!1)},children:c})]})]})})}}},e=>{e.O(0,[700,750,744,66,633,586,358],()=>e(e.s=77071)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{23835:(e,s,t)=>{"use strict";t.d(s,{A:()=>u});var i=t(89983);let r=(...e)=>e.filter((e,s,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===s).join(" ").trim(),a=e=>{let s=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,t)=>t?t.toUpperCase():s.toLowerCase());return s.charAt(0).toUpperCase()+s.slice(1)};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,i.createContext)({}),o=(0,i.forwardRef)(({color:e,size:s,strokeWidth:t,absoluteStrokeWidth:a,className:o="",children:u,iconNode:c,...d},b)=>{let{size:g=24,strokeWidth:f=2,absoluteStrokeWidth:m=!1,color:h="currentColor",className:p=""}=(0,i.useContext)(n)??{},v=a??m?24*Number(t??f)/Number(s??g):t??f;return(0,i.createElement)("svg",{ref:b,...l,width:s??g??l.width,height:s??g??l.height,stroke:e??h,strokeWidth:v,className:r("lucide",p,o),...!u&&!(e=>{for(let s in e)if(s.startsWith("aria-")||"role"===s||"title"===s)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,s])=>(0,i.createElement)(e,s)),...Array.isArray(u)?u:[u]])}),u=(e,s)=>{let t=(0,i.forwardRef)(({className:t,...l},n)=>(0,i.createElement)(o,{ref:n,iconNode:s,className:r(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,t),...l}));return t.displayName=a(e),t}},24928:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},52263:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},52816:(e,s,t)=>{Promise.resolve().then(t.bind(t,91185))},64892:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},91185:(e,s,t)=>{"use strict";t.d(s,{SettingsForm:()=>f});var i=t(43031),r=t(89983),a=t(66605),l=t(67727),n=t(4696);let o=["needs_human","job_failed","pr_opened","pr_merged","release_published","cost_limit","automation_paused"],u={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",automation_paused:"Automation paused or draining"};var c=t(80821);let d=(0,c.createServerReference)("40f56625b238da668748b30cd1053e2855e7edb65d",c.callServer,void 0,c.findSourceMapURL,"saveSettingsAction"),b=(0,c.createServerReference)("004fc144b9184228f3a3cb1160f1bae6d796ea1bc2",c.callServer,void 0,c.findSourceMapURL,"sendTestNotificationAction"),g="h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background";function f({initial:e}){let[s,t]=(0,r.useState)(e),[c,h]=(0,r.useTransition)(),[p,v]=(0,r.useTransition)(),[x,k]=(0,r.useState)(!1),{success:j,error:y}=(0,n.d)(),N=(e,s)=>{t(t=>({...t,[e]:s})),k(!1)};return(0,i.jsxs)("form",{className:"max-w-md space-y-3",action:()=>h(async()=>{try{await d(s),k(!0),j("Settings saved")}catch(e){y("Failed to save settings",e instanceof Error?e.message:String(e))}}),children:[(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.paused,onChange:e=>N("paused",e.target.checked)}),"Global pause"]}),(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.releaseManagementEnabled,onChange:e=>N("releaseManagementEnabled",e.target.checked)}),"Enable release management (kill-switch)"]}),(0,i.jsx)(m,{label:"Daily cost limit (USD)",children:(0,i.jsx)("input",{type:"number",step:"0.5",value:s.dailyCostLimitUsd,onChange:e=>N("dailyCostLimitUsd",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Poll interval (sec)",children:(0,i.jsx)("input",{type:"number",value:s.pollIntervalSec,onChange:e=>N("pollIntervalSec",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max turns",children:(0,i.jsx)("input",{type:"number",value:s.maxTurns,onChange:e=>N("maxTurns",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max job minutes",children:(0,i.jsx)("input",{type:"number",value:s.maxJobMinutes,onChange:e=>N("maxJobMinutes",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max CI wait minutes",children:(0,i.jsx)("input",{type:"number",value:s.maxCiWaitMinutes,onChange:e=>N("maxCiWaitMinutes",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max job cost (USD, 0 = off)",children:(0,i.jsx)("input",{type:"number",min:"0",step:"0.01",value:s.maxJobCostUsd,onChange:e=>N("maxJobCostUsd",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Default agent",children:(0,i.jsx)(a.a,{value:s.defaultAgent,onChange:e=>N("defaultAgent",e)})}),(0,i.jsx)(m,{label:"Default model",children:(0,i.jsx)("input",{value:s.defaultModel,onChange:e=>N("defaultModel",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"claude CLI path",children:(0,i.jsx)("input",{value:s.claudePath,onChange:e=>N("claudePath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"codex CLI path",children:(0,i.jsx)("input",{value:s.codexPath,onChange:e=>N("codexPath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"gh CLI path",children:(0,i.jsx)("input",{value:s.ghPath,onChange:e=>N("ghPath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max parallel jobs",children:(0,i.jsx)("input",{type:"number",value:s.maxParallelJobs,onChange:e=>N("maxParallelJobs",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Log retention (days)",children:(0,i.jsx)("input",{type:"number",value:s.retentionDays,onChange:e=>N("retentionDays",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Telegram bot token",children:(0,i.jsx)("input",{value:s.telegramBotToken,onChange:e=>N("telegramBotToken",e.target.value),placeholder:"leave empty to disable notifications",className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Telegram chat ID",children:(0,i.jsx)("input",{value:s.telegramChatId,onChange:e=>N("telegramChatId",e.target.value),className:g})}),(0,i.jsxs)("fieldset",{className:"space-y-3 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Slack"}),(0,i.jsx)(m,{label:"Incoming webhook URL",children:(0,i.jsx)("input",{value:s.slackWebhookUrl,onChange:e=>N("slackWebhookUrl",e.target.value),placeholder:"leave empty to disable Slack",className:g})})]}),(0,i.jsxs)("fieldset",{className:"space-y-3 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Email (SMTP)"}),(0,i.jsx)(m,{label:"SMTP host",children:(0,i.jsx)("input",{value:s.smtpHost,onChange:e=>N("smtpHost",e.target.value),placeholder:"leave empty to disable email",className:g})}),(0,i.jsx)(m,{label:"SMTP port",children:(0,i.jsx)("input",{type:"number",value:s.smtpPort,onChange:e=>N("smtpPort",Number(e.target.value)),className:g})}),(0,i.jsx)(m,{label:"SMTP username",children:(0,i.jsx)("input",{value:s.smtpUser,onChange:e=>N("smtpUser",e.target.value),autoComplete:"off",className:g})}),(0,i.jsx)(m,{label:"SMTP password",children:(0,i.jsx)("input",{type:"password",value:s.smtpPass,onChange:e=>N("smtpPass",e.target.value),autoComplete:"new-password",className:g})}),(0,i.jsx)(m,{label:"From address",children:(0,i.jsx)("input",{type:"email",value:s.emailFrom,onChange:e=>N("emailFrom",e.target.value),placeholder:"drydock@example.com",className:g})}),(0,i.jsx)(m,{label:"To address",children:(0,i.jsx)("input",{type:"email",value:s.emailTo,onChange:e=>N("emailTo",e.target.value),placeholder:"you@example.com",className:g})})]}),(0,i.jsxs)("fieldset",{className:"space-y-2 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Notify me about"}),o.map(e=>(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.notifyEvents.includes(e),onChange:t=>N("notifyEvents",t.target.checked?[...s.notifyEvents,e]:s.notifyEvents.filter(s=>s!==e))}),u[e]]},e))]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[(0,i.jsx)(l.$,{type:"submit",disabled:c,children:"Save settings"}),(0,i.jsx)(l.$,{type:"button",variant:"outline",onClick:()=>v(async()=>{try{await d(s),k(!0);let e=await b();if(0===e.length)return void y("No channels configured","Save a channel before sending a test.");let t=e.filter(e=>!e.ok);0===t.length?j(`Test sent to ${e.map(e=>e.channel).join(", ")}`):y("Some channels failed",t.map(e=>`${e.channel}: ${e.error??"unknown error"}`).join("; "))}catch(e){y("Failed to send test",e instanceof Error?e.message:String(e))}}),disabled:p,children:p?"Sending…":"Send test notification"}),x&&(0,i.jsx)("span",{className:"text-xs text-success",children:"Saved"})]})]})}function m({label:e,children:s}){return(0,i.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[(0,i.jsx)("span",{children:e}),s]})}},95579:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},e=>{e.O(0,[750,66,633,586,358],()=>e(e.s=52816)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{23835:(e,s,t)=>{"use strict";t.d(s,{A:()=>u});var i=t(89983);let r=(...e)=>e.filter((e,s,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===s).join(" ").trim(),l=e=>{let s=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,s,t)=>t?t.toUpperCase():s.toLowerCase());return s.charAt(0).toUpperCase()+s.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,i.createContext)({}),o=(0,i.forwardRef)(({color:e,size:s,strokeWidth:t,absoluteStrokeWidth:l,className:o="",children:u,iconNode:c,...d},b)=>{let{size:g=24,strokeWidth:f=2,absoluteStrokeWidth:m=!1,color:h="currentColor",className:p=""}=(0,i.useContext)(n)??{},v=l??m?24*Number(t??f)/Number(s??g):t??f;return(0,i.createElement)("svg",{ref:b,...a,width:s??g??a.width,height:s??g??a.height,stroke:e??h,strokeWidth:v,className:r("lucide",p,o),...!u&&!(e=>{for(let s in e)if(s.startsWith("aria-")||"role"===s||"title"===s)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,s])=>(0,i.createElement)(e,s)),...Array.isArray(u)?u:[u]])}),u=(e,s)=>{let t=(0,i.forwardRef)(({className:t,...a},n)=>(0,i.createElement)(o,{ref:n,iconNode:s,className:r(`lucide-${l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,t),...a}));return t.displayName=l(e),t}},24928:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},52263:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},52816:(e,s,t)=>{Promise.resolve().then(t.bind(t,73036))},64892:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},73036:(e,s,t)=>{"use strict";t.d(s,{SettingsForm:()=>f});var i=t(43031),r=t(89983),l=t(66605),a=t(67727),n=t(4696);let o=["needs_human","job_failed","pr_opened","pr_merged","release_published","cost_limit","automation_paused"],u={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",automation_paused:"Automation paused or draining"};var c=t(80821);let d=(0,c.createServerReference)("4090852f1110128f4139b1cf4a73d044eec532306d",c.callServer,void 0,c.findSourceMapURL,"saveSettingsAction"),b=(0,c.createServerReference)("00b2a962b9d7ed62e5bb201b1481867ab0e71b0d41",c.callServer,void 0,c.findSourceMapURL,"sendTestNotificationAction"),g="h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background";function f({initial:e}){let[s,t]=(0,r.useState)(e),[c,h]=(0,r.useTransition)(),[p,v]=(0,r.useTransition)(),[x,k]=(0,r.useState)(!1),{success:j,error:y}=(0,n.d)(),N=(e,s)=>{t(t=>({...t,[e]:s})),k(!1)};return(0,i.jsxs)("form",{className:"max-w-md space-y-3",action:()=>h(async()=>{try{await d(s),k(!0),j("Settings saved")}catch(e){y("Failed to save settings",e instanceof Error?e.message:String(e))}}),children:[(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.paused,onChange:e=>N("paused",e.target.checked)}),"Global pause"]}),(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.releaseManagementEnabled,onChange:e=>N("releaseManagementEnabled",e.target.checked)}),"Enable release management (kill-switch)"]}),(0,i.jsx)(m,{label:"Daily cost limit (USD)",children:(0,i.jsx)("input",{type:"number",step:"0.5",value:s.dailyCostLimitUsd,onChange:e=>N("dailyCostLimitUsd",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Poll interval (sec)",children:(0,i.jsx)("input",{type:"number",value:s.pollIntervalSec,onChange:e=>N("pollIntervalSec",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max turns",children:(0,i.jsx)("input",{type:"number",value:s.maxTurns,onChange:e=>N("maxTurns",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max job minutes",children:(0,i.jsx)("input",{type:"number",value:s.maxJobMinutes,onChange:e=>N("maxJobMinutes",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max CI wait minutes",children:(0,i.jsx)("input",{type:"number",value:s.maxCiWaitMinutes,onChange:e=>N("maxCiWaitMinutes",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max job cost (USD, 0 = off)",children:(0,i.jsx)("input",{type:"number",min:"0",step:"0.01",value:s.maxJobCostUsd,onChange:e=>N("maxJobCostUsd",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Default agent",children:(0,i.jsx)(l.a,{value:s.defaultAgent,onChange:e=>N("defaultAgent",e)})}),(0,i.jsx)(m,{label:"Default model",children:(0,i.jsx)("input",{value:s.defaultModel,onChange:e=>N("defaultModel",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"claude CLI path",children:(0,i.jsx)("input",{value:s.claudePath,onChange:e=>N("claudePath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"codex CLI path",children:(0,i.jsx)("input",{value:s.codexPath,onChange:e=>N("codexPath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"gh CLI path",children:(0,i.jsx)("input",{value:s.ghPath,onChange:e=>N("ghPath",e.target.value),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Max parallel jobs",children:(0,i.jsx)("input",{type:"number",value:s.maxParallelJobs,onChange:e=>N("maxParallelJobs",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Log retention (days)",children:(0,i.jsx)("input",{type:"number",value:s.retentionDays,onChange:e=>N("retentionDays",Number(e.target.value)),className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Telegram bot token",children:(0,i.jsx)("input",{value:s.telegramBotToken,onChange:e=>N("telegramBotToken",e.target.value),placeholder:"leave empty to disable notifications",className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"})}),(0,i.jsx)(m,{label:"Telegram chat ID",children:(0,i.jsx)("input",{value:s.telegramChatId,onChange:e=>N("telegramChatId",e.target.value),className:g})}),(0,i.jsxs)("fieldset",{className:"space-y-3 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Slack"}),(0,i.jsx)(m,{label:"Incoming webhook URL",children:(0,i.jsx)("input",{value:s.slackWebhookUrl,onChange:e=>N("slackWebhookUrl",e.target.value),placeholder:"leave empty to disable Slack",className:g})})]}),(0,i.jsxs)("fieldset",{className:"space-y-3 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Email (SMTP)"}),(0,i.jsx)(m,{label:"SMTP host",children:(0,i.jsx)("input",{value:s.smtpHost,onChange:e=>N("smtpHost",e.target.value),placeholder:"leave empty to disable email",className:g})}),(0,i.jsx)(m,{label:"SMTP port",children:(0,i.jsx)("input",{type:"number",value:s.smtpPort,onChange:e=>N("smtpPort",Number(e.target.value)),className:g})}),(0,i.jsx)(m,{label:"SMTP username",children:(0,i.jsx)("input",{value:s.smtpUser,onChange:e=>N("smtpUser",e.target.value),autoComplete:"off",className:g})}),(0,i.jsx)(m,{label:"SMTP password",children:(0,i.jsx)("input",{type:"password",value:s.smtpPass,onChange:e=>N("smtpPass",e.target.value),autoComplete:"new-password",className:g})}),(0,i.jsx)(m,{label:"From address",children:(0,i.jsx)("input",{type:"email",value:s.emailFrom,onChange:e=>N("emailFrom",e.target.value),placeholder:"drydock@example.com",className:g})}),(0,i.jsx)(m,{label:"To address",children:(0,i.jsx)("input",{type:"email",value:s.emailTo,onChange:e=>N("emailTo",e.target.value),placeholder:"you@example.com",className:g})})]}),(0,i.jsxs)("fieldset",{className:"space-y-2 border-t border-border pt-3",children:[(0,i.jsx)("legend",{className:"text-sm font-medium text-muted-foreground",children:"Notify me about"}),o.map(e=>(0,i.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,i.jsx)("input",{type:"checkbox",checked:s.notifyEvents.includes(e),onChange:t=>N("notifyEvents",t.target.checked?[...s.notifyEvents,e]:s.notifyEvents.filter(s=>s!==e))}),u[e]]},e))]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[(0,i.jsx)(a.$,{type:"submit",disabled:c,children:"Save settings"}),(0,i.jsx)(a.$,{type:"button",variant:"outline",onClick:()=>v(async()=>{try{await d(s),k(!0);let e=await b();if(0===e.length)return void y("No channels configured","Save a channel before sending a test.");let t=e.filter(e=>!e.ok);0===t.length?j(`Test sent to ${e.map(e=>e.channel).join(", ")}`):y("Some channels failed",t.map(e=>`${e.channel}: ${e.error??"unknown error"}`).join("; "))}catch(e){y("Failed to send test",e instanceof Error?e.message:String(e))}}),disabled:p,children:p?"Sending…":"Send test notification"}),x&&(0,i.jsx)("span",{className:"text-xs text-success",children:"Saved"})]})]})}function m({label:e,children:s}){return(0,i.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[(0,i.jsx)("span",{children:e}),s]})}},95579:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});let i=(0,t(23835).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},e=>{e.O(0,[750,66,633,586,358],()=>e(e.s=52816)),_N_E=e.O()}]);
package/README.md CHANGED
@@ -191,7 +191,7 @@ add a repository, and start queuing issues.
191
191
  drydock --help # all flags
192
192
  drydock --version # installed version
193
193
  drydock --port 8080 --host 0.0.0.0 # bind elsewhere (defaults: 127.0.0.1:3737)
194
- drydock update # update a global install to the latest version
194
+ drydock update # update a global install (reports current latest, skips if already current)
195
195
  ```
196
196
 
197
197
  You still need the `claude` and (for GitHub) `gh` CLIs on `PATH` — see [Requirements](#requirements).
package/bin/drydock.mjs CHANGED
@@ -6,7 +6,7 @@
6
6
  // step or TypeScript runtime so it works straight from the published tarball.
7
7
 
8
8
  import { spawn } from "node:child_process";
9
- import { existsSync, mkdirSync, readFileSync } from "node:fs";
9
+ import { existsSync, mkdirSync, readFileSync, realpathSync } from "node:fs";
10
10
  import { homedir } from "node:os";
11
11
  import { dirname, join, resolve } from "node:path";
12
12
  import { fileURLToPath } from "node:url";
@@ -129,20 +129,107 @@ export function detectInstallKind(packageRoot) {
129
129
  return "local";
130
130
  }
131
131
 
132
+ /** The npm package name this CLI is published under. */
133
+ const PACKAGE_NAME = "@nilsr0711/drydock";
134
+
132
135
  /** The command that updates a global install to the latest published version. */
133
136
  export function updateCommand() {
134
- return { command: "npm", args: ["install", "--global", "@nilsr0711/drydock@latest"] };
137
+ return { command: "npm", args: ["install", "--global", `${PACKAGE_NAME}@latest`] };
138
+ }
139
+
140
+ /**
141
+ * Compare two `x.y.z` versions (a leading `v` is tolerated). Returns 1 if `a` is
142
+ * newer, -1 if older, 0 if equal. Throws if either version is unparseable so
143
+ * callers can fall back rather than silently mis-ordering.
144
+ */
145
+ export function compareVersions(a, b) {
146
+ const parse = (v) => {
147
+ const m = /^v?(\d+)\.(\d+)\.(\d+)/.exec(String(v).trim());
148
+ if (!m) throw new Error(`unparseable version: ${v}`);
149
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
150
+ };
151
+ const pa = parse(a);
152
+ const pb = parse(b);
153
+ for (let i = 0; i < 3; i++) {
154
+ if (pa[i] > pb[i]) return 1;
155
+ if (pa[i] < pb[i]) return -1;
156
+ }
157
+ return 0;
158
+ }
159
+
160
+ /**
161
+ * Decide what `drydock update` should do given the installed version and the
162
+ * latest published version (which may be null/unparseable when the check fails).
163
+ * Degrades gracefully: when the latest version can't be determined, still
164
+ * attempts the install rather than blocking the user.
165
+ *
166
+ * @returns {{ action: "skip" | "install", reason: string, latestVersion?: string }}
167
+ */
168
+ export function planUpdate(currentVersion, latestVersion) {
169
+ if (!latestVersion) return { action: "install", reason: "unknown-latest" };
170
+ let cmp;
171
+ try {
172
+ cmp = compareVersions(latestVersion, currentVersion);
173
+ } catch {
174
+ return { action: "install", reason: "unknown-latest" };
175
+ }
176
+ if (cmp <= 0) return { action: "skip", reason: "up-to-date" };
177
+ return { action: "install", reason: "update-available", latestVersion };
178
+ }
179
+
180
+ /**
181
+ * Resolve the latest published version from the npm registry's `latest`
182
+ * dist-tag. Never throws: returns null on any network/HTTP/parse failure so the
183
+ * caller can fall back to a blind install.
184
+ *
185
+ * @param {string} pkg The (possibly scoped) package name.
186
+ * @param {{ fetchImpl?: typeof fetch }} [opts]
187
+ * @returns {Promise<string | null>}
188
+ */
189
+ export async function resolveLatestVersion(pkg, { fetchImpl = fetch } = {}) {
190
+ try {
191
+ const url = `https://registry.npmjs.org/${encodeURIComponent(pkg)}/latest`;
192
+ const res = await fetchImpl(url, {
193
+ headers: { Accept: "application/json", "User-Agent": "drydock-update" },
194
+ });
195
+ if (!res.ok) return null;
196
+ const body = await res.json();
197
+ return typeof body?.version === "string" ? body.version : null;
198
+ } catch {
199
+ return null;
200
+ }
135
201
  }
136
202
 
137
203
  /** Run the self-update, inheriting stdio so npm's progress is visible. */
138
- function runUpdate() {
204
+ async function runUpdate() {
205
+ const current = readVersion();
206
+ console.error(`Current version: drydock v${current}`);
207
+
208
+ const latest = await resolveLatestVersion(PACKAGE_NAME);
209
+ const plan = planUpdate(current, latest);
210
+
211
+ if (plan.action === "skip") {
212
+ console.error(`drydock is already up to date (v${current}).`);
213
+ process.exit(0);
214
+ }
215
+
216
+ if (plan.reason === "unknown-latest") {
217
+ console.error("Could not determine the latest version; attempting update anyway…");
218
+ } else {
219
+ console.error(`Updating drydock ${current} → ${plan.latestVersion} …`);
220
+ }
221
+
139
222
  const { command, args } = updateCommand();
140
- console.error(`Updating drydock: ${command} ${args.join(" ")}`);
141
223
  const child = spawn(command, args, {
142
224
  shell: process.platform === "win32",
143
225
  stdio: "inherit",
144
226
  });
145
- child.on("exit", (code) => process.exit(code ?? 0));
227
+ child.on("exit", (code) => {
228
+ if (code === 0 && plan.reason === "update-available") {
229
+ console.error(`Updated to drydock v${plan.latestVersion}.`);
230
+ }
231
+ process.exit(code ?? 0);
232
+ });
146
233
  child.on("error", (err) => {
147
234
  console.error(`Update failed: ${err.message}`);
148
235
  process.exit(1);
@@ -244,15 +331,34 @@ async function main(argv) {
244
331
  console.log(readVersion());
245
332
  return;
246
333
  case "update":
247
- runUpdate();
334
+ await runUpdate();
248
335
  return;
249
336
  default:
250
337
  await serve(directive);
251
338
  }
252
339
  }
253
340
 
341
+ /**
342
+ * Decide whether this module is the program entry point. A plain string compare
343
+ * against `process.argv[1]` breaks for global/npx installs, where the bin is a
344
+ * symlink in a bin directory and argv[1] is that link rather than the real file.
345
+ * Resolving the entry path through symlinks (realpath) makes the two comparable,
346
+ * so `drydock`, `drydock --version`, etc. actually run when installed.
347
+ *
348
+ * @param {string} modulePath Absolute path to this module (resolved import.meta.url).
349
+ * @param {string | undefined} entryPath The invoked entry path (process.argv[1]).
350
+ */
351
+ export function isMainModule(modulePath, entryPath) {
352
+ if (!entryPath) return false;
353
+ try {
354
+ return modulePath === realpathSync(entryPath);
355
+ } catch {
356
+ return false;
357
+ }
358
+ }
359
+
254
360
  // Only run when executed directly, not when imported by tests.
255
- if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
361
+ if (isMainModule(fileURLToPath(import.meta.url), process.argv[1])) {
256
362
  main(process.argv.slice(2)).catch((err) => {
257
363
  console.error(err instanceof Error ? err.message : String(err));
258
364
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nilsr0711/drydock",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Local-first tool that autonomously turns GitHub issues into pull requests via the Claude CLI, startable from the terminal with `npx @nilsr0711/drydock`.",
6
6
  "keywords": [
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29],{4696:(e,t,r)=>{"use strict";r.d(t,{d:()=>v,t:()=>u});var s=r(43031),n=r(64892),i=r(24928),a=r(52263),o=r(95579),d=r(89983),c=r(6636);let l=(0,d.createContext)(null);function u({children:e}){let[t,r]=(0,d.useState)([]),n=(0,d.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),i=(0,d.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]),a=(0,d.useMemo)(()=>({toast:i,success:(e,t)=>i({title:e,description:t,variant:"success"}),error:(e,t)=>i({title:e,description:t,variant:"error"})}),[i]);return(0,s.jsxs)(l.Provider,{value:a,children:[e,(0,s.jsx)(m,{toasts:t,onDismiss:n})]})}function v(){let e=(0,d.useContext)(l);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let x={success:n.A,error:i.A,info:a.A},f={success:"text-success",error:"text-destructive",info:"text-muted-foreground"};function m({toasts:e,onDismiss:t}){return 0===e.length?null:(0,s.jsx)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:e.map(e=>{let r=x[e.variant];return(0,s.jsxs)("output",{"aria-live":"polite",className:"pointer-events-auto flex items-start gap-3 rounded-xl border border-card-border bg-card p-3 shadow-lg",children:[(0,s.jsx)(r,{className:(0,c.cn)("mt-0.5 h-4 w-4 shrink-0",f[e.variant])}),(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"})})]},e.id)})})}},6636:(e,t,r)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ")}r.d(t,{cn:()=>s})},52445:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>d,ZB:()=>o,Zp:()=>i,aR:()=>a});var s=r(43031),n=r(6636);function i({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",e),...t})}function a({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col gap-1.5 p-5",e),...t})}function o({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})}},58408:(e,t,r)=>{Promise.resolve().then(r.bind(r,95200))},67727:(e,t,r)=>{"use strict";r.d(t,{$:()=>d});var s=r(43031),n=r(89983),i=r(6636);let a={default:"bg-primary text-primary-foreground shadow-xs hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-xs hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-xs hover-elevate active-elevate-2",ghost:"border border-transparent 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-8 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg"},d=n.forwardRef(({className:e,variant:t="default",size:r="default",...n},d)=>(0,s.jsx)("button",{ref:d,className:(0,i.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a[t],o[r],e),...n}));d.displayName="Button"},70099:(e,t,r)=>{"use strict";r.d(t,{l:()=>i});var s=r(43031),n=r(89983);function i({open:e,onClose:t,children:r}){return((0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),e)?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-8",onMouseDown:t,children:(0,s.jsx)("div",{role:"dialog","aria-modal":"true",className:"mt-8 w-full max-w-2xl rounded-xl border border-card-border bg-card p-5 shadow-lg",onMouseDown:e=>e.stopPropagation(),children:r})}):null}},95200:(e,t,r)=>{"use strict";r.d(t,{AdrReview:()=>x});var s=r(43031),n=r(89983),i=r(1481),a=r(67727),o=r(52445),d=r(96498),c=r(4696),l=r(80821);let u=(0,l.createServerReference)("40de5a57681dbe5ca80648b33c998bde57d759d638",l.callServer,void 0,l.findSourceMapURL,"approveAdrAction"),v=(0,l.createServerReference)("606bb26fdbca82412b870e2892fcc3c8828ac40894",l.callServer,void 0,l.findSourceMapURL,"rejectAdrAction");function x({items:e}){return 0===e.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No pending ADRs."}):(0,s.jsx)("div",{className:"space-y-4",children:e.map(e=>(0,s.jsx)(f,{adr:e},e.id))})}function f({adr:e}){let[t,r]=(0,n.useTransition)(),[l,x]=(0,n.useState)(""),[m,p]=(0,n.useState)(!1),{success:h,error:b}=(0,c.d)();return(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)(o.aR,{children:[(0,s.jsx)(o.ZB,{children:e.title}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.filePath})]}),(0,s.jsxs)(o.Wu,{className:"space-y-3",children:[(0,s.jsx)("div",{className:"prose prose-sm max-w-none rounded border border-card-border p-3",children:(0,s.jsx)(i.oz,{children:e.content})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(a.$,{disabled:t,onClick:function(){r(async()=>{try{await u(e.id),h("ADR approved",e.title)}catch(e){b("Failed to approve ADR",e instanceof Error?e.message:String(e))}})},children:"Approve"}),(0,s.jsx)("input",{"aria-label":"Rejection comment",className:"flex-1 rounded border border-card-border bg-background px-2 py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",placeholder:"Rejection comment",value:l,onChange:e=>x(e.target.value)}),(0,s.jsx)(a.$,{variant:"destructive",disabled:t,onClick:()=>p(!0),children:"Reject"})]})]}),(0,s.jsx)(d.T,{open:m,onOpenChange:p,onConfirm:function(){r(async()=>{try{await v(e.id,l),h("ADR rejected",e.title)}catch(e){b("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:t})]})}},96498:(e,t,r)=>{"use strict";r.d(t,{T:()=>a});var s=r(43031),n=r(67727),i=r(70099);function a({open:e,onOpenChange:t,onConfirm:r,title:o,description:d,confirmLabel:c="Confirm",cancelLabel:l="Cancel",variant:u="default",pending:v=!1}){return(0,s.jsx)(i.l,{open:e,onClose:()=>t(!1),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:o}),d&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:d})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(n.$,{variant:"outline",size:"sm",disabled:v,onClick:()=>t(!1),children:l}),(0,s.jsx)(n.$,{variant:"destructive"===u?"destructive":"default",size:"sm",disabled:v,onClick:()=>{r(),t(!1)},children:c})]})]})})}}},e=>{e.O(0,[77,633,586,358],()=>e(e.s=58408)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{4696:(e,s,t)=>{"use strict";t.d(s,{d:()=>x,t:()=>u});var r=t(43031),n=t(64892),a=t(24928),i=t(52263),l=t(95579),o=t(89983),d=t(6636);let c=(0,o.createContext)(null);function u({children:e}){let[s,t]=(0,o.useState)([]),n=(0,o.useCallback)(e=>{t(s=>s.filter(s=>s.id!==e))},[]),a=(0,o.useCallback)(e=>{let s=Date.now()+Math.random(),r={id:s,title:e.title,description:e.description,variant:e.variant??"info"};t(e=>[...e,r]),setTimeout(()=>n(s),5e3)},[n]),i=(0,o.useMemo)(()=>({toast:a,success:(e,s)=>a({title:e,description:s,variant:"success"}),error:(e,s)=>a({title:e,description:s,variant:"error"})}),[a]);return(0,r.jsxs)(c.Provider,{value:i,children:[e,(0,r.jsx)(f,{toasts:s,onDismiss:n})]})}function x(){let e=(0,o.useContext)(c);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let m={success:n.A,error:a.A,info:i.A},p={success:"text-success",error:"text-destructive",info:"text-muted-foreground"};function f({toasts:e,onDismiss:s}){return 0===e.length?null:(0,r.jsx)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:e.map(e=>{let t=m[e.variant];return(0,r.jsxs)("output",{"aria-live":"polite",className:"pointer-events-auto flex items-start gap-3 rounded-xl border border-card-border bg-card p-3 shadow-lg",children:[(0,r.jsx)(t,{className:(0,d.cn)("mt-0.5 h-4 w-4 shrink-0",p[e.variant])}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,r.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,r.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>s(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})})]},e.id)})})}},6636:(e,s,t)=>{"use strict";function r(...e){return e.filter(Boolean).join(" ")}t.d(s,{cn:()=>r})},22320:(e,s,t)=>{"use strict";t.d(s,{E:()=>o});var r=t(43031),n=t(6636);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",merged:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning"},l=new Set(["working","ci_running","retrying"]);function o({className:e,status:s,tone:t,children:d,...c}){let u=t??(s?i[s]??"neutral":"neutral"),x=void 0!==s&&l.has(s);return(0,r.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:[x&&(0,r.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,r.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,r.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),d??s?.replace(/_/g," ")]})}},25774:(e,s,t)=>{"use strict";t.d(s,{o:()=>i});var r=t(43031),n=t(78063),a=t(75945);function i({value:e,onChange:s,agent:t,id:l,className:o}){let d=t?(0,a.tT)(t):a.L6;return(0,r.jsx)(n.l,{id:l,value:e,onChange:e=>s(e.target.value),className:o,children:d.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}},52445:(e,s,t)=>{"use strict";t.d(s,{Wu:()=>o,ZB:()=>l,Zp:()=>a,aR:()=>i});var r=t(43031),n=t(6636);function a({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",e),...s})}function i({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("flex flex-col gap-1.5 p-5",e),...s})}function l({className:e,...s}){return(0,r.jsx)("h3",{className:(0,n.cn)("text-base font-semibold leading-none tracking-tight",e),...s})}function o({className:e,...s}){return(0,r.jsx)("div",{className:(0,n.cn)("p-5 pt-0",e),...s})}},67727:(e,s,t)=>{"use strict";t.d(s,{$:()=>o});var r=t(43031),n=t(89983),a=t(6636);let i={default:"bg-primary text-primary-foreground shadow-xs hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-xs hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-xs hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2"},l={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-8 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg"},o=n.forwardRef(({className:e,variant:s="default",size:t="default",...n},o)=>(0,r.jsx)("button",{ref:o,className:(0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i[s],l[t],e),...n}));o.displayName="Button"},70099:(e,s,t)=>{"use strict";t.d(s,{l:()=>a});var r=t(43031),n=t(89983);function a({open:e,onClose:s,children:t}){return((0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,s]),e)?(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-8",onMouseDown:s,children:(0,r.jsx)("div",{role:"dialog","aria-modal":"true",className:"mt-8 w-full max-w-2xl rounded-xl border border-card-border bg-card p-5 shadow-lg",onMouseDown:e=>e.stopPropagation(),children:t})}):null}},75945:(e,s,t)=>{"use strict";t.d(s,{L6:()=>r,UB:()=>n,VJ:()=>i,tT:()=>a});let r=[{id:"claude-opus-4-7",label:"Claude Opus 4.7",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"}],n="claude-opus-4-7";function a(e){return r.filter(s=>s.agent===e)}function i(e){return a(e)[0]?.id??n}},78063:(e,s,t)=>{"use strict";t.d(s,{l:()=>i});var r=t(43031),n=t(89983),a=t(6636);let i=n.forwardRef(({className:e,...s},t)=>(0,r.jsx)("select",{ref:t,className:(0,a.cn)("h-9 rounded-md border border-input bg-background px-2.5 text-sm text-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",e),...s}));i.displayName="Select"},80821:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r={callServer:function(){return a.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var n in r)Object.defineProperty(s,n,{enumerable:!0,get:r[n]});let a=t(66966),i=t(99842),l=t(98281)},81349:(e,s,t)=>{"use strict";t.d(s,{DashboardLive:()=>P});var r=t(43031),n=t(23835);let a=(0,n.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var i=t(89983);let l=(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 o=t(95579);let d=(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"}]]),c=(0,n.A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var u=t(67727),x=t(70099),m=t(80821);let p=(0,m.createServerReference)("40b0326247d8ba15a7ec2aa14367a032e935b0c991",m.callServer,void 0,m.findSourceMapURL,"browseDirectoryAction");function f({onSelect:e,onClose:s}){let[t,n]=(0,i.useState)(null),[a,m]=(0,i.useTransition)(),g=e=>m(async()=>n(await p(e)));return(0,i.useEffect)(()=>{g()},[]),(0,r.jsx)(x.l,{open:!0,onClose:s,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",{className:"flex items-center gap-2 font-semibold",children:[(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),"Choose a folder"]}),(0,r.jsx)(u.$,{size:"icon",variant:"ghost","aria-label":"Close",onClick:s,children:(0,r.jsx)(o.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:t?.path,children:t?.path??"…"}),t?.isGitRepo&&(0,r.jsxs)("span",{className:"mt-1 inline-flex items-center gap-1 rounded bg-success-muted px-1.5 py-0.5 text-xs text-success",children:[(0,r.jsx)(d,{className:"h-3 w-3"}),"git repo"]})]}),(0,r.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto py-2",children:[t?.parent&&(0,r.jsxs)("button",{type:"button",disabled:a,onClick:()=>g(t.parent??void 0),className:"flex w-full items-center gap-2 rounded px-2 py-1 text-left text-sm hover-elevate",children:[(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),".."]}),t?.entries.map(e=>(0,r.jsxs)("button",{type:"button",disabled:a,onClick:()=>g(e.path),className:"flex w-full items-center justify-between gap-2 rounded px-2 py-1 text-left text-sm hover-elevate",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[e.isGitRepo?(0,r.jsx)(d,{className:"h-4 w-4 text-muted-foreground"}):(0,r.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}),e.name]}),e.isGitRepo&&(0,r.jsx)("span",{className:"rounded bg-success-muted px-1 text-[10px] text-success",children:"git"})]},e.path)),t&&0===t.entries.length&&(0,r.jsx)("p",{className:"px-2 py-1 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)(u.$,{variant:"outline",size:"sm",onClick:s,children:"Cancel"}),(0,r.jsxs)(u.$,{size:"sm",disabled:!t||a,onClick:()=>t&&e(t.path),children:[(0,r.jsx)(c,{}),"Use this folder"]})]})]})})}var g=t(78063);let h={github:{id:"github",label:"GitHub",needsConnection:!1},gitlab:{id:"gitlab",label:"GitLab",needsConnection:!0}},b=["github","gitlab"].map(e=>h[e]);function v({value:e,onChange:s,id:t,className:n}){return(0,r.jsx)(g.l,{id:t,value:e,onChange:e=>s(e.target.value),className:n,children:b.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}var j=t(25774),y=t(52445),N=t(75945);let w=(0,m.createServerReference)("401fb8bf77b327efde9ce1d88828480e04d4eb02b6",m.callServer,void 0,m.findSourceMapURL,"addRepoAction");function k({onDone:e}){let[s,t]=(0,i.useTransition)(),[n,a]=(0,i.useState)(""),[l,o]=(0,i.useState)(""),[d,c]=(0,i.useState)(N.UB),[x,m]=(0,i.useState)("github"),[p,g]=(0,i.useState)(""),[h,b]=(0,i.useState)(""),[C,S]=(0,i.useState)(!1);return(0,r.jsxs)(y.Zp,{children:[(0,r.jsx)(y.Wu,{className:"pt-4",children:(0,r.jsxs)("form",{className:"grid gap-2 sm:grid-cols-2",action:()=>{t(async()=>{await w({path:l,name:n,defaultModel:d,platform:x,apiBaseUrl:"gitlab"===x&&p.trim()||null,apiToken:"gitlab"===x&&h.trim()||null}),e()})},children:[(0,r.jsx)("input",{value:n,onChange:e=>a(e.target.value),placeholder:"Name",required:!0,className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{value:l,onChange:e=>o(e.target.value),placeholder:"/abs/path/to/repo",required:!0,className:"h-9 flex-1 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"}),(0,r.jsx)(u.$,{type:"button",variant:"outline",size:"sm",onClick:()=>S(!0),children:"Browse…"})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Model:"}),(0,r.jsx)(j.o,{value:d,onChange:c})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"Platform:"}),(0,r.jsx)(v,{value:x,onChange:m})]}),"gitlab"===x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{value:p,onChange:e=>g(e.target.value),placeholder:"API base URL (e.g. https://gitlab.com)",className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background sm:col-span-2"}),(0,r.jsx)("input",{value:h,onChange:e=>b(e.target.value),type:"password",placeholder:"Access token (stored locally)",className:"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background sm:col-span-2"})]}),(0,r.jsx)(u.$,{type:"submit",disabled:s||!l,className:"sm:col-span-2",children:"Save"})]})}),C&&(0,r.jsx)(f,{onClose:()=>S(!1),onSelect:e=>{o(e),n.trim()||a(e.replace(/\/+$/,"").split("/").pop()??""),S(!1)}})]})}var C=t(6636);let S={neutral:"text-foreground",primary:"text-primary",success:"text-success",destructive:"text-destructive"};function R({label:e,value:s,display:t,tone:n="neutral"}){let a=s>0&&"neutral"!==n;return(0,r.jsxs)("div",{className:"rounded-xl border border-card-border bg-card px-4 py-3 shadow-sm",children:[(0,r.jsx)("div",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:e}),(0,r.jsx)("div",{className:(0,C.cn)("mt-1 text-2xl font-semibold tabular-nums",a?S[n]:"text-foreground"),children:t??s})]})}function M({summary:e}){return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[(0,r.jsx)(R,{label:"Repos",value:e.repos}),(0,r.jsx)(R,{label:"Queued",value:e.queued}),(0,r.jsx)(R,{label:"Running",value:e.running,tone:"primary"}),(0,r.jsx)(R,{label:"Merged",value:e.merged,tone:"success"}),(0,r.jsx)(R,{label:"Needs human",value:e.needsHuman,tone:"destructive"}),(0,r.jsx)(R,{label:"Spend today",value:e.spendToday,display:`$${e.spendToday.toFixed(2)}`,tone:"primary"})]})}let E=(0,n.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var A=t(42626),$=t.n(A),T=t(22320),L=t(96498),_=t(4696);let z=(0,m.createServerReference)("4081fe66351cb1edc1bea12c4ff39511d1f5c80b8e",m.callServer,void 0,m.findSourceMapURL,"removeRepoAction");function D({repo:e}){var s;let t,[n,a]=(0,i.useTransition)(),[l,o]=(0,i.useState)(!1),{success:d,error:c}=(0,_.d)();return(0,r.jsxs)(y.Zp,{className:(0,C.cn)("hover-elevate transition-shadow hover:shadow-md",e.attention&&"border-destructive/50 bg-destructive/5"),children:[(0,r.jsxs)(y.Wu,{className:"space-y-3 p-4",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)($(),{href:`/repos/${e.id}`,className:"font-mono text-sm font-semibold hover:underline",children:e.name}),(0,r.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.path})]}),e.attention&&(0,r.jsxs)(T.E,{tone:"destructive",className:"shrink-0",children:[(0,r.jsx)(E,{className:"h-3 w-3"})," Needs human"]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:["gitlab"===e.platform&&(0,r.jsx)(T.E,{tone:"primary",children:"GitLab"}),(0,r.jsxs)(T.E,{tone:"neutral",children:[e.queued," queued"]}),e.working>0?(0,r.jsxs)(T.E,{status:"working",children:[e.working," working"]}):(0,r.jsx)(T.E,{tone:"neutral",children:"0 working"}),e.ciRunning>0?(0,r.jsxs)(T.E,{status:"ci_running",children:[e.ciRunning," CI"]}):(0,r.jsx)(T.E,{tone:"neutral",children:"0 CI"}),e.needsHuman>0&&(0,r.jsxs)(T.E,{tone:"destructive",children:[e.needsHuman," needs human"]})]}),e.inFlight.length>0&&(0,r.jsx)("ul",{className:"space-y-0.5 text-xs text-muted-foreground",children:e.inFlight.map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(T.E,{status:e.status,className:"px-1.5 py-0"}),(0,r.jsxs)($(),{href:`/jobs/${e.id}`,className:"font-mono hover:underline",children:["#",e.issueNumber]})]},e.id))}),(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{children:["Today:"," ",(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:["$",e.todaySpend.toFixed(2)]})]}),(0,r.jsx)("span",{children:e.lastActivityAt?(s=e.lastActivityAt,(t=Math.floor(Date.now()/1e3)-s)<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*s).toLocaleDateString()):"no activity"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)($(),{href:`/repos/${e.id}`,children:(0,r.jsx)(u.$,{size:"sm",children:"Open"})}),(0,r.jsx)(u.$,{size:"sm",variant:"ghost",disabled:n,onClick:()=>o(!0),children:"Remove"})]})]}),(0,r.jsx)(L.T,{open:l,onOpenChange:o,onConfirm:function(){a(async()=>{try{await z(e.id),d("Repository removed",e.name)}catch(e){c("Failed to remove repository",e instanceof Error?e.message:String(e))}})},title:"Remove repository?",description:`This stops watching ${e.name}. Existing jobs are unaffected.`,confirmLabel:"Remove",variant:"destructive",pending:n})]})}function P({initial:e}){let[s,t]=(0,i.useState)(e),[n,l]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=new EventSource("/api/sse/dashboard");return e.addEventListener("snapshot",e=>{try{t(JSON.parse(e.data))}catch{}}),()=>e.close()},[]);let{repos:o,summary:d}=s;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(M,{summary:d}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("h2",{className:"text-sm font-semibold",children:["Repositories ",(0,r.jsxs)("span",{className:"text-muted-foreground",children:["(",o.length,")"]})]}),(0,r.jsx)(u.$,{size:"sm",onClick:()=>l(e=>!e),children:n?"Cancel":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a,{})," Add repo"]})})]}),n&&(0,r.jsx)(k,{onDone:()=>l(!1)}),0===o.length&&!n&&(0,r.jsx)(y.Zp,{children:(0,r.jsx)(y.Wu,{className:"py-10 text-center text-sm text-muted-foreground",children:"No repositories yet. Add one to start automating issues."})}),(0,r.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:o.map(e=>(0,r.jsx)(D,{repo:e},e.id))})]})]})}},85548:(e,s,t)=>{Promise.resolve().then(t.bind(t,81349))},96498:(e,s,t)=>{"use strict";t.d(s,{T:()=>i});var r=t(43031),n=t(67727),a=t(70099);function i({open:e,onOpenChange:s,onConfirm:t,title:l,description:o,confirmLabel:d="Confirm",cancelLabel:c="Cancel",variant:u="default",pending:x=!1}){return(0,r.jsx)(a.l,{open:e,onClose:()=>s(!1),children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h2",{className:"text-base font-semibold",children:l}),o&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:o})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)(n.$,{variant:"outline",size:"sm",disabled:x,onClick:()=>s(!1),children:c}),(0,r.jsx)(n.$,{variant:"destructive"===u?"destructive":"default",size:"sm",disabled:x,onClick:()=>{t(),s(!1)},children:d})]})]})})}}},e=>{e.O(0,[700,633,586,358],()=>e(e.s=85548)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[942],{4696:(e,t,r)=>{"use strict";r.d(t,{d:()=>f,t:()=>d});var n=r(43031),i=r(64892),o=r(24928),a=r(52263),c=r(95579),u=r(89983),s=r(6636);let l=(0,u.createContext)(null);function d({children:e}){let[t,r]=(0,u.useState)([]),i=(0,u.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),o=(0,u.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(()=>i(t),5e3)},[i]),a=(0,u.useMemo)(()=>({toast:o,success:(e,t)=>o({title:e,description:t,variant:"success"}),error:(e,t)=>o({title:e,description:t,variant:"error"})}),[o]);return(0,n.jsxs)(l.Provider,{value:a,children:[e,(0,n.jsx)(g,{toasts:t,onDismiss:i})]})}function f(){let e=(0,u.useContext)(l);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let h={success:i.A,error:o.A,info:a.A},p={success:"text-success",error:"text-destructive",info:"text-muted-foreground"};function g({toasts:e,onDismiss:t}){return 0===e.length?null:(0,n.jsx)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:e.map(e=>{let r=h[e.variant];return(0,n.jsxs)("output",{"aria-live":"polite",className:"pointer-events-auto flex items-start gap-3 rounded-xl border border-card-border bg-card p-3 shadow-lg",children:[(0,n.jsx)(r,{className:(0,s.cn)("mt-0.5 h-4 w-4 shrink-0",p[e.variant])}),(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)(c.A,{className:"h-3.5 w-3.5"})})]},e.id)})})}},6636:(e,t,r)=>{"use strict";function n(...e){return e.filter(Boolean).join(" ")}r.d(t,{cn:()=>n})},6768:(e,t,r)=>{"use strict";r.d(t,{PromptEditor:()=>en});var n,i,o=r(43031);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return function t(){for(var r=this,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(r,[].concat(i,n))}}}function l(e){return({}).toString.call(e).includes("Object")}function d(e){return"function"==typeof e}var f=s(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),h=function(e,t){return l(t)||f("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&f("changeField"),t},p=function(e){d(e)||f("selectorType")},g=function(e){d(e)||l(e)||f("handlerType"),l(e)&&Object.values(e).some(function(e){return!d(e)})&&f("handlersType")},m=function(e){e||f("initialIsRequired"),l(e)||f("initialType"),Object.keys(e).length||f("initialContent")};function v(e,t){return d(t)?t(e.current):t}function b(e,t){return e.current=u(u({},e.current),t),t}function x(e,t,r){return d(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var y={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},w=(n=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=n.length?n.apply(this,i):function(){for(var r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];return e.apply(t,[].concat(i,n))}})(y),j=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},M={type:"cancelation",msg:"operation is manually canceled"};function E(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(M):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var N=function(e){if(Array.isArray(e))return e}(i=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),g(t);var r={current:e},n=s(x)(r,t),i=s(b)(r),o=s(h)(e),a=s(v)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return p(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,i,o,a)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,i,o,a=[],c=!0,u=!1;try{i=(t=t.call(e)).next,!1;for(;!(c=(r=i.call(t)).done)&&(a.push(r.value),2!==a.length);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw n}}return a}}(i)||function(e){if(e){if("string"==typeof e)return a(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,2):void 0}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),S=N[0],k=N[1];function O(e){return document.body.appendChild(e)}function R(e){var t,r,n=S(function(e){return{config:e.config,reject:e.reject}}),i=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return i.onload=function(){return e()},i.onerror=n.reject,i}function C(){var e=S(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;A(r),e.resolve(r)},function(t){e.reject(t)})}function A(e){S().monaco||k({monaco:e})}var P=new Promise(function(e,t){return k({resolve:e,reject:t})}),_=function(){var e=S(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(k({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),E(P);if(window.monaco&&window.monaco.editor)return A(window.monaco),e.resolve(window.monaco),E(P);j(O,R)(C)}return E(P)},I=r(89983),L={display:"flex",position:"relative",textAlign:"initial"},T={width:"100%"},U={display:"none"},$={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},V=function({children:e}){return I.createElement("div",{style:$},e)},z=(0,I.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:i,className:o,wrapperProps:a}){return I.createElement("section",{style:{...L,width:e,height:t},...a},!r&&I.createElement(V,null,n),I.createElement("div",{ref:i,style:{...T,...!r&&U},className:o}))}),B=function(e){(0,I.useEffect)(e,[])},D=function(e,t,r=!0){let n=(0,I.useRef)(!0);(0,I.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function W(){}function Z(e,t,r,n){var i,o,a,c,u,s;return i=e,o=n,i.editor.getModel(q(i,o))||(a=e,c=t,u=r,s=n,a.editor.createModel(c,u,s?q(a,s):void 0))}function q(e,t){return e.Uri.parse(t)}(0,I.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:s="light",loading:l="Loading...",options:d={},height:f="100%",width:h="100%",className:p,wrapperProps:g={},beforeMount:m=W,onMount:v=W}){let[b,x]=(0,I.useState)(!1),[y,w]=(0,I.useState)(!0),j=(0,I.useRef)(null),M=(0,I.useRef)(null),E=(0,I.useRef)(null),N=(0,I.useRef)(v),S=(0,I.useRef)(m),k=(0,I.useRef)(!1);B(()=>{let e=_();return e.then(e=>(M.current=e)&&w(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(c||t?.original?.dispose(),u||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),D(()=>{if(j.current&&M.current){let t=j.current.getOriginalEditor(),i=Z(M.current,e||"",n||r||"text",o||"");i!==t.getModel()&&t.setModel(i)}},[o],b),D(()=>{if(j.current&&M.current){let e=j.current.getModifiedEditor(),n=Z(M.current,t||"",i||r||"text",a||"");n!==e.getModel()&&e.setModel(n)}},[a],b),D(()=>{let e=j.current.getModifiedEditor();e.getOption(M.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],b),D(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],b),D(()=>{let{original:e,modified:t}=j.current.getModel();M.current.editor.setModelLanguage(e,n||r||"text"),M.current.editor.setModelLanguage(t,i||r||"text")},[r,n,i],b),D(()=>{M.current?.editor.setTheme(s)},[s],b),D(()=>{j.current?.updateOptions(d)},[d],b);let O=(0,I.useCallback)(()=>{if(!M.current)return;S.current(M.current);let c=Z(M.current,e||"",n||r||"text",o||""),u=Z(M.current,t||"",i||r||"text",a||"");j.current?.setModel({original:c,modified:u})},[r,t,i,e,n,o,a]),R=(0,I.useCallback)(()=>{!k.current&&E.current&&(j.current=M.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...d}),O(),M.current?.editor.setTheme(s),x(!0),k.current=!0)},[d,s,O]);return(0,I.useEffect)(()=>{b&&N.current(j.current,M.current)},[b]),(0,I.useEffect)(()=>{y||b||R()},[y,b,R]),I.createElement(z,{width:h,height:f,isEditorReady:b,loading:l,_ref:E,className:p,wrapperProps:g})});var F=function(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current},G=new Map,H=(0,I.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:i,path:o,theme:a="light",line:c,loading:u="Loading...",options:s={},overrideServices:l={},saveViewState:d=!0,keepCurrentModel:f=!1,width:h="100%",height:p="100%",className:g,wrapperProps:m={},beforeMount:v=W,onMount:b=W,onChange:x,onValidate:y=W}){let[w,j]=(0,I.useState)(!1),[M,E]=(0,I.useState)(!0),N=(0,I.useRef)(null),S=(0,I.useRef)(null),k=(0,I.useRef)(null),O=(0,I.useRef)(b),R=(0,I.useRef)(v),C=(0,I.useRef)(),A=(0,I.useRef)(n),P=F(o),L=(0,I.useRef)(!1),T=(0,I.useRef)(!1);B(()=>{let e=_();return e.then(e=>(N.current=e)&&E(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>S.current?void(C.current?.dispose(),f?d&&G.set(o,S.current.saveViewState()):S.current.getModel()?.dispose(),S.current.dispose()):e.cancel()}),D(()=>{let a=Z(N.current,e||n||"",t||i||"",o||r||"");a!==S.current?.getModel()&&(d&&G.set(P,S.current?.saveViewState()),S.current?.setModel(a),d&&S.current?.restoreViewState(G.get(o)))},[o],w),D(()=>{S.current?.updateOptions(s)},[s],w),D(()=>{S.current&&void 0!==n&&(S.current.getOption(N.current.editor.EditorOption.readOnly)?S.current.setValue(n):n!==S.current.getValue()&&(T.current=!0,S.current.executeEdits("",[{range:S.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),S.current.pushUndoStop(),T.current=!1))},[n],w),D(()=>{let e=S.current?.getModel();e&&i&&N.current?.editor.setModelLanguage(e,i)},[i],w),D(()=>{void 0!==c&&S.current?.revealLine(c)},[c],w),D(()=>{N.current?.editor.setTheme(a)},[a],w);let U=(0,I.useCallback)(()=>{if(!(!k.current||!N.current)&&!L.current){R.current(N.current);let u=o||r,f=Z(N.current,n||e||"",t||i||"",u||"");S.current=N.current?.editor.create(k.current,{model:f,automaticLayout:!0,...s},l),d&&S.current.restoreViewState(G.get(u)),N.current.editor.setTheme(a),void 0!==c&&S.current.revealLine(c),j(!0),L.current=!0}},[e,t,r,n,i,o,s,l,d,a,c]);return(0,I.useEffect)(()=>{w&&O.current(S.current,N.current)},[w]),(0,I.useEffect)(()=>{M||w||U()},[M,w,U]),A.current=n,(0,I.useEffect)(()=>{w&&x&&(C.current?.dispose(),C.current=S.current?.onDidChangeModelContent(e=>{T.current||x(S.current.getValue(),e)}))},[w,x]),(0,I.useEffect)(()=>{if(w){let e=N.current.editor.onDidChangeMarkers(e=>{let t=S.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=N.current.editor.getModelMarkers({resource:t});y?.(e)}});return()=>{e?.dispose()}}return()=>{}},[w,y]),I.createElement(z,{width:h,height:p,isEditorReady:w,loading:u,_ref:k,className:g,wrapperProps:m})}),Y=r(67727),J=r(52445),K=r(4696),Q=r(80821);let X=(0,Q.createServerReference)("60cf61daa09df5b2e7809dc0566b2260b604bb4a5e",Q.callServer,void 0,Q.findSourceMapURL,"loadTemplateAction"),ee=(0,Q.createServerReference)("40222afb695d34df432ba1fff565559fb8376b3466",Q.callServer,void 0,Q.findSourceMapURL,"saveTemplateAction"),et="default",er=["$ISSUE_NUM","$BRANCH","$REPO_NAME","$CI_LOG"];function en({repos:e,initialContent:t,initialVersions:r}){let[n,i]=(0,I.useState)(t),[a,c]=(0,I.useState)(e[0]?.id??0),[u,s]=(0,I.useState)(et),[l,d]=(0,I.useState)(r),[f,h]=(0,I.useTransition)(),[p,g]=(0,I.useState)(null),{success:m,error:v}=(0,K.d)();function b(e,t){h(async()=>{try{let r=await X(e,t);i(r.content),d(r.versions),g(null)}catch(e){v("Failed to load template",e instanceof Error?e.message:String(e))}})}let x=function(e,t){let r={$ISSUE_NUM:void 0!==t.ISSUE_NUM?String(t.ISSUE_NUM):"$ISSUE_NUM",$BRANCH:t.BRANCH??"$BRANCH",$REPO_NAME:t.REPO_NAME??"$REPO_NAME",$CI_LOG:t.CI_LOG??"$CI_LOG"},n=e;for(let e of[...er].sort((e,t)=>t.length-e.length))n=n.split(e).join(r[e]??e);return n}(n,{ISSUE_NUM:42,BRANCH:"fix/issue-42",REPO_NAME:"acme",CI_LOG:"example CI failure output"});return(0,o.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,o.jsxs)(J.Zp,{children:[(0,o.jsxs)(J.aR,{children:[(0,o.jsx)(J.ZB,{children:"Editor"}),(0,o.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Variables: ",er.join(", ")]})]}),(0,o.jsxs)(J.Wu,{className:"space-y-2",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)("select",{"aria-label":"Repository",className:"rounded border border-card-border bg-background px-2 py-1 text-sm",value:a,onChange:e=>{let t=Number(e.target.value);c(t),b(t,u)},children:e.map(e=>(0,o.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,o.jsxs)("select",{"aria-label":"Template",className:"rounded border border-card-border bg-background px-2 py-1 text-sm",value:u,onChange:e=>{s(e.target.value),b(a,e.target.value)},children:[(0,o.jsx)("option",{value:et,children:"Main"}),(0,o.jsx)("option",{value:"ci-fix",children:"CI fix"})]})]}),(0,o.jsx)("div",{className:"h-72 border border-card-border",children:(0,o.jsx)(H,{defaultLanguage:"markdown",value:n,onChange:e=>i(e??""),options:{minimap:{enabled:!1},fontSize:13}})}),(0,o.jsx)(Y.$,{disabled:f||!a,onClick:()=>h(async()=>{try{let e=await ee({repoId:a,name:u,content:n});g(e.version);let t=await X(a,u);d(t.versions),m("Template saved",`Version ${e.version}`)}catch(e){v("Failed to save template",e instanceof Error?e.message:String(e))}}),children:"Save version"}),null!==p&&(0,o.jsxs)("span",{className:"ml-2 text-xs text-success",children:["Saved v",p]})]})]}),(0,o.jsxs)(J.Zp,{children:[(0,o.jsx)(J.aR,{children:(0,o.jsx)(J.ZB,{children:"Preview (sample data)"})}),(0,o.jsxs)(J.Wu,{children:[(0,o.jsx)("pre",{className:"whitespace-pre-wrap text-xs",children:x}),(0,o.jsx)("h3",{className:"mt-4 mb-1 text-sm font-semibold",children:"Versions"}),(0,o.jsx)("ul",{className:"text-xs text-muted-foreground",children:l.map(e=>(0,o.jsxs)("li",{children:["v",e.version]},e.version))})]})]})]})}},11510:(e,t,r)=>{Promise.resolve().then(r.bind(r,6768))},23835:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(89983);let i=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,n.createContext)({}),u=(0,n.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:o,className:u="",children:s,iconNode:l,...d},f)=>{let{size:h=24,strokeWidth:p=2,absoluteStrokeWidth:g=!1,color:m="currentColor",className:v=""}=(0,n.useContext)(c)??{},b=o??g?24*Number(r??p)/Number(t??h):r??p;return(0,n.createElement)("svg",{ref:f,...a,width:t??h??a.width,height:t??h??a.height,stroke:e??m,strokeWidth:b,className:i("lucide",v,u),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...l.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),s=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...a},c)=>(0,n.createElement)(u,{ref:c,iconNode:t,className:i(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...a}));return r.displayName=o(e),r}},24928:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},52263:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},52445:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>u,ZB:()=>c,Zp:()=>o,aR:()=>a});var n=r(43031),i=r(6636);function o({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",e),...t})}function a({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("flex flex-col gap-1.5 p-5",e),...t})}function c({className:e,...t}){return(0,n.jsx)("h3",{className:(0,i.cn)("text-base font-semibold leading-none tracking-tight",e),...t})}function u({className:e,...t}){return(0,n.jsx)("div",{className:(0,i.cn)("p-5 pt-0",e),...t})}},64892:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},67727:(e,t,r)=>{"use strict";r.d(t,{$:()=>u});var n=r(43031),i=r(89983),o=r(6636);let a={default:"bg-primary text-primary-foreground shadow-xs hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-xs hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-xs hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2"},c={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-8 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg"},u=i.forwardRef(({className:e,variant:t="default",size:r="default",...i},u)=>(0,n.jsx)("button",{ref:u,className:(0,o.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a[t],c[r],e),...i}));u.displayName="Button"},80821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var i in n)Object.defineProperty(t,i,{enumerable:!0,get:n[i]});let o=r(66966),a=r(99842),c=r(98281)},95579:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(23835).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}},e=>{e.O(0,[633,586,358],()=>e(e.s=11510)),_N_E=e.O()}]);