@nilsr0711/drydock 0.1.8 → 0.1.9

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 (119) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +4 -4
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/adrs/page.js +2 -2
  18. package/.next/standalone/.next/server/app/adrs/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/adrs/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/analytics/page.js +1 -1
  21. package/.next/standalone/.next/server/app/analytics/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/control/shutdown/route.js +1 -1
  24. package/.next/standalone/.next/server/app/api/control/shutdown/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/cost/export/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/health/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/sse/dashboard/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/sse/jobs/[id]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/webhooks/[repoId]/route.js +1 -1
  31. package/.next/standalone/.next/server/app/api/webhooks/[repoId]/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/costs/page.js +1 -1
  33. package/.next/standalone/.next/server/app/costs/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/costs/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/jobs/[id]/page.js +3 -3
  36. package/.next/standalone/.next/server/app/jobs/[id]/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/jobs/[id]/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/jobs/page.js +2 -2
  39. package/.next/standalone/.next/server/app/jobs/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/jobs/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/needs-human/page.js +2 -2
  42. package/.next/standalone/.next/server/app/needs-human/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/needs-human/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/page.js +2 -2
  45. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/prompts/page.js +2 -2
  48. package/.next/standalone/.next/server/app/prompts/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/prompts/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/repos/[id]/page.js +2 -2
  51. package/.next/standalone/.next/server/app/repos/[id]/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/repos/[id]/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  54. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app-paths-manifest.json +4 -4
  57. package/.next/standalone/.next/server/chunks/152.js +3 -0
  58. package/.next/standalone/.next/server/chunks/304.js +1 -1
  59. package/.next/standalone/.next/server/chunks/387.js +14 -14
  60. package/.next/standalone/.next/server/chunks/40.js +1 -1
  61. package/.next/standalone/.next/server/chunks/475.js +19 -0
  62. package/.next/standalone/.next/server/chunks/50.js +1 -0
  63. package/.next/standalone/.next/server/chunks/521.js +1 -1
  64. package/.next/standalone/.next/server/chunks/614.js +2 -2
  65. package/.next/standalone/.next/server/chunks/668.js +1 -0
  66. package/.next/standalone/.next/server/chunks/786.js +1 -1
  67. package/.next/standalone/.next/server/chunks/908.js +1 -1
  68. package/.next/standalone/.next/server/chunks/{685.js → 944.js} +1 -1
  69. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  70. package/.next/standalone/.next/server/pages/500.html +1 -1
  71. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  73. package/.next/standalone/.next/static/chunks/6634-74f0b66587b57037.js +1 -0
  74. package/.next/standalone/.next/static/chunks/8382-5201fc3dd1f64e60.js +1 -0
  75. package/.next/standalone/.next/static/chunks/app/adrs/page-ca11e90e9404af90.js +1 -0
  76. package/.next/standalone/.next/static/chunks/app/jobs/[id]/page-dfb41b4785fd7cbb.js +1 -0
  77. package/.next/{static/chunks/app/layout-402d4ab34259b89b.js → standalone/.next/static/chunks/app/layout-134301ff0a9b828d.js} +1 -1
  78. package/.next/standalone/.next/static/chunks/app/needs-human/page-569fc0e6aefc7677.js +1 -0
  79. package/.next/standalone/.next/static/chunks/app/page-504585be128c823c.js +1 -0
  80. package/.next/standalone/.next/static/chunks/app/prompts/page-c6bf6a4c782035ac.js +1 -0
  81. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-c0c4531c2af46526.js +1 -0
  82. package/.next/standalone/.next/static/chunks/app/settings/page-84a44ab52a0ff49d.js +1 -0
  83. package/.next/standalone/drizzle/0036_adopt_claude_mem.sql +1 -0
  84. package/.next/standalone/mcp-server.cjs +304 -81
  85. package/.next/standalone/package.json +1 -1
  86. package/.next/static/chunks/6634-74f0b66587b57037.js +1 -0
  87. package/.next/static/chunks/8382-5201fc3dd1f64e60.js +1 -0
  88. package/.next/static/chunks/app/adrs/page-ca11e90e9404af90.js +1 -0
  89. package/.next/static/chunks/app/jobs/[id]/page-dfb41b4785fd7cbb.js +1 -0
  90. package/.next/{standalone/.next/static/chunks/app/layout-402d4ab34259b89b.js → static/chunks/app/layout-134301ff0a9b828d.js} +1 -1
  91. package/.next/static/chunks/app/needs-human/page-569fc0e6aefc7677.js +1 -0
  92. package/.next/static/chunks/app/page-504585be128c823c.js +1 -0
  93. package/.next/static/chunks/app/prompts/page-c6bf6a4c782035ac.js +1 -0
  94. package/.next/static/chunks/app/repos/[id]/page-c0c4531c2af46526.js +1 -0
  95. package/.next/static/chunks/app/settings/page-84a44ab52a0ff49d.js +1 -0
  96. package/README.md +11 -5
  97. package/drizzle/0036_adopt_claude_mem.sql +1 -0
  98. package/package.json +1 -1
  99. package/.next/standalone/.next/server/chunks/99.js +0 -21
  100. package/.next/standalone/.next/static/chunks/1298-0d60333e56ac8b2c.js +0 -1
  101. package/.next/standalone/.next/static/chunks/app/adrs/page-0c221fc18d1e89af.js +0 -1
  102. package/.next/standalone/.next/static/chunks/app/jobs/[id]/page-6ef8bc39b5181817.js +0 -1
  103. package/.next/standalone/.next/static/chunks/app/needs-human/page-b69ac22856c0a0b1.js +0 -1
  104. package/.next/standalone/.next/static/chunks/app/page-ccefa99d40734a8c.js +0 -1
  105. package/.next/standalone/.next/static/chunks/app/prompts/page-bcd1063eb5d64aa5.js +0 -1
  106. package/.next/standalone/.next/static/chunks/app/repos/[id]/page-2bd4b35a0b28042e.js +0 -1
  107. package/.next/standalone/.next/static/chunks/app/settings/page-13a04ecac139b74c.js +0 -1
  108. package/.next/static/chunks/1298-0d60333e56ac8b2c.js +0 -1
  109. package/.next/static/chunks/app/adrs/page-0c221fc18d1e89af.js +0 -1
  110. package/.next/static/chunks/app/jobs/[id]/page-6ef8bc39b5181817.js +0 -1
  111. package/.next/static/chunks/app/needs-human/page-b69ac22856c0a0b1.js +0 -1
  112. package/.next/static/chunks/app/page-ccefa99d40734a8c.js +0 -1
  113. package/.next/static/chunks/app/prompts/page-bcd1063eb5d64aa5.js +0 -1
  114. package/.next/static/chunks/app/repos/[id]/page-2bd4b35a0b28042e.js +0 -1
  115. package/.next/static/chunks/app/settings/page-13a04ecac139b74c.js +0 -1
  116. /package/.next/standalone/.next/static/{qSEvPCWIslg9lcxt6XQhl → gBXyOslZ8CoJrAVnOEHDm}/_buildManifest.js +0 -0
  117. /package/.next/standalone/.next/static/{qSEvPCWIslg9lcxt6XQhl → gBXyOslZ8CoJrAVnOEHDm}/_ssgManifest.js +0 -0
  118. /package/.next/static/{qSEvPCWIslg9lcxt6XQhl → gBXyOslZ8CoJrAVnOEHDm}/_buildManifest.js +0 -0
  119. /package/.next/static/{qSEvPCWIslg9lcxt6XQhl → gBXyOslZ8CoJrAVnOEHDm}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8382],{598:(e,t,r)=>{r.d(t,{y:()=>o});var n=r(515),i=r(8108),s=r(5832);function o({size:e=16,className:t}){return(0,n.jsx)(i.A,{width:e,height:e,className:(0,s.cn)("dd-spin",t),"aria-hidden":!0})}},1059:(e,t,r)=>{r.d(t,{d:()=>s});var n=r(515),i=r(5832);function s({checked:e,onChange:t,disabled:r,id:o,"aria-label":a}){return(0,n.jsx)("button",{type:"button",role:"switch",id:o,"aria-checked":e,"aria-label":a,disabled:r,onClick:()=>!r&&t?.(!e),className:(0,i.cn)("relative inline-flex h-[22px] w-[38px] shrink-0 items-center rounded-full transition-colors focus-ring",e?"bg-primary":"bg-input",r&&"pointer-events-none opacity-50"),children:(0,n.jsx)("span",{className:(0,i.cn)("inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}},1837:(e,t,r)=>{r.d(t,{L6:()=>n,UB:()=>i,VJ:()=>o,tT:()=>s});let n=[{id:"claude-opus-4-8",label:"Claude Opus 4.8",agent:"claude"},{id:"claude-fable-5",label:"Claude Fable 5",agent:"claude"},{id:"claude-opus-4-7",label:"Claude Opus 4.7",agent:"claude"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",agent:"claude"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",agent:"claude"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",agent:"claude"},{id:"gpt-5-codex",label:"GPT-5 Codex",agent:"codex"},{id:"gpt-5",label:"GPT-5",agent:"codex"},{id:"gpt-5-mini",label:"GPT-5 Mini",agent:"codex"}],i="claude-opus-4-8";function s(e){return n.filter(t=>t.agent===e)}function o(e){return"openrouter"===e?"":s(e)[0]?.id??i}},4148:(e,t,r)=>{r.d(t,{S:()=>o});var n=r(515),i=r(4266),s=r(5832);function o({checked:e,onChange:t,disabled:r,id:a,className:u,"aria-label":l}){return(0,n.jsx)("button",{type:"button",role:"checkbox",id:a,"aria-checked":e,"aria-label":l,disabled:r,onClick:()=>!r&&t?.(!e),className:(0,s.cn)("flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors focus-ring",e?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:border-muted-foreground",r&&"pointer-events-none opacity-50",u),children:e&&(0,n.jsx)(i.A,{className:"h-[13px] w-[13px]",strokeWidth:3})})}},4783:(e,t,r)=>{r.d(t,{F:()=>p,W:()=>h});var n=r(515),i=r(6512),s=r(8131),o=r(4877),a=r(5662),u=r(5529),l=r(9214),d=r(5832);let c={info:{cls:"border-primary/30 bg-primary/5 text-foreground",icon:i.A,ic:"text-primary"},success:{cls:"border-success-border bg-success-muted text-foreground",icon:s.A,ic:"text-success"},warning:{cls:"border-warning-border bg-warning-muted text-foreground",icon:o.A,ic:"text-warning"},destructive:{cls:"border-destructive/30 bg-destructive/5 text-foreground",icon:a.A,ic:"text-destructive"}};function p({tone:e="info",title:t,children:r,action:i,icon:s,className:o}){let a=c[e],u=s??a.icon;return(0,n.jsxs)("div",{className:(0,d.cn)("flex gap-3 rounded-xl border p-4",a.cls,o),role:"alert",children:[(0,n.jsx)(u,{className:(0,d.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",a.ic)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[t&&(0,n.jsx)("p",{className:"text-sm font-semibold",children:t}),r&&(0,n.jsx)("div",{className:"mt-0.5 text-pretty text-sm text-muted-foreground",children:r})]}),i&&(0,n.jsx)("div",{className:"shrink-0",children:i})]})}function h({title:e="Something went wrong",description:t,action:r,className:i}){return(0,n.jsx)(u.Zp,{className:(0,d.cn)("border-destructive/30",i),children:(0,n.jsx)(l.p,{icon:a.A,tone:"destructive",title:e,description:t,action:r})})}},7217:(e,t,r)=>{r.d(t,{D:()=>o});var n=r(515),i=r(5832);function s({htmlFor:e,className:t,children:r}){return(0,n.jsx)("label",{htmlFor:e,className:(0,i.cn)("text-sm font-medium text-foreground",t),children:r})}function o({label:e,hint:t,htmlFor:r,children:a,className:u}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col gap-1.5",u),children:[e&&(0,n.jsx)(s,{htmlFor:r,children:e}),a,t&&(0,n.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},7241:(e,t,r)=>{r.d(t,{a:()=>$});var n=r(515),i=r(8067);let s={"claude-fable-5":{inputPerMTok:10,outputPerMTok:50,cacheWritePerMTok:12.5,cacheReadPerMTok:1},"claude-opus-4-8":{inputPerMTok:5,outputPerMTok:25,cacheWritePerMTok:6.25,cacheReadPerMTok:.5},"claude-opus-4-7":{inputPerMTok:5,outputPerMTok:25,cacheWritePerMTok:6.25,cacheReadPerMTok:.5},"claude-sonnet-4-6":{inputPerMTok:3,outputPerMTok:15,cacheWritePerMTok:3.75,cacheReadPerMTok:.3},"claude-sonnet-4-5":{inputPerMTok:3,outputPerMTok:15,cacheWritePerMTok:3.75,cacheReadPerMTok:.3},"claude-haiku-4-5":{inputPerMTok:1,outputPerMTok:5,cacheWritePerMTok:1.25,cacheReadPerMTok:.1}},o=Object.values(s).reduce((e,t)=>t.outputPerMTok>e.outputPerMTok?t:e,{inputPerMTok:0,outputPerMTok:0,cacheWritePerMTok:0,cacheReadPerMTok:0});var a=r(4502);let u=a.Ik({input_tokens:a.ai().optional(),output_tokens:a.ai().optional(),cache_creation_input_tokens:a.ai().optional(),cache_read_input_tokens:a.ai().optional()}).passthrough(),l=a.Ik({type:a.eu("system"),subtype:a.Yj().optional(),session_id:a.Yj().optional(),model:a.Yj().optional()}),d=a.Ik({type:a.eu("assistant"),message:a.Ik({role:a.eu("assistant"),content:a.YO(a.g1(a.Yj(),a.L5())),usage:u.optional()})}),c=a.Ik({type:a.eu("user"),message:a.Ik({role:a.eu("user"),content:a.YO(a.g1(a.Yj(),a.L5()))})}),p=a.Ik({status:a.Yj().optional(),resetsAt:a.ai().optional(),rateLimitType:a.Yj().optional()}).passthrough(),h=a.Ik({type:a.eu("rate_limit_event"),rate_limit_info:p.optional(),session_id:a.Yj().optional()}),m=a.Ik({type:a.eu("result"),subtype:a.Yj().optional(),session_id:a.Yj().optional(),is_error:a.zM().optional(),result:a.Yj().optional(),total_cost_usd:a.ai().optional(),usage:u.optional()}),k=a.gM("type",[l,d,c,h,m]);function f(e){return e instanceof Error?e.message:String(e)}function g(e){let t=[];for(let r of e)"text"===r.type&&"string"==typeof r.text?t.push({kind:"text",text:r.text}):"tool_use"===r.type?t.push({kind:"tool_use",name:String(r.name??"unknown"),id:String(r.id??""),input:r.input}):"tool_result"===r.type&&t.push({kind:"tool_result",toolUseId:String(r.tool_use_id??""),isError:!!r.is_error});return t}class b{push(e){this.buffer+=e;let t=[],r=this.buffer.indexOf("\n");for(;-1!==r;){let e=this.buffer.slice(0,r);this.buffer=this.buffer.slice(r+1);let n=this.consume(e);n&&t.push(n),r=this.buffer.indexOf("\n")}return t}flush(){let e=this.buffer;this.buffer="";let t=this.consume(e);return t?[t]:[]}consume(e){let t;try{t=function(e){var t;let r,n=e.trim();if(!n)return null;let i=JSON.parse(n);return r={type:(t=k.parse(i)).type,chunks:[],inputTokens:0,outputTokens:0,cacheCreationInputTokens:0,cacheReadInputTokens:0,isError:!1,raw:t},"system"===t.type?(r.sessionId=t.session_id,r.model=t.model):"assistant"===t.type?(r.chunks=g(t.message.content),r.inputTokens=t.message.usage?.input_tokens??0,r.outputTokens=t.message.usage?.output_tokens??0,r.cacheCreationInputTokens=t.message.usage?.cache_creation_input_tokens??0,r.cacheReadInputTokens=t.message.usage?.cache_read_input_tokens??0):"user"===t.type?r.chunks=g(t.message.content):"rate_limit_event"===t.type?(r.sessionId=t.session_id,r.rateLimitInfo=t.rate_limit_info):(r.sessionId=t.session_id,r.resultText=t.result,r.resultSubtype=t.subtype,r.costUsd=t.total_cost_usd,r.inputTokens=t.usage?.input_tokens??0,r.outputTokens=t.usage?.output_tokens??0,r.cacheCreationInputTokens=t.usage?.cache_creation_input_tokens??0,r.cacheReadInputTokens=t.usage?.cache_read_input_tokens??0,r.isError=t.is_error??!1),r}(e)}catch(t){return this.onParseError?.({line:e.trim(),message:f(t)}),null}return t?(t.sessionId&&(this.sessionId=t.sessionId),t.model&&(this.model=t.model),t.rateLimitInfo&&(this.rateLimit=t.rateLimitInfo),"result"===t.type?(t.inputTokens>0&&(this.totalInputTokens=t.inputTokens),t.outputTokens>0&&(this.totalOutputTokens=t.outputTokens),t.cacheCreationInputTokens>0&&(this.totalCacheCreationInputTokens=t.cacheCreationInputTokens),t.cacheReadInputTokens>0&&(this.totalCacheReadInputTokens=t.cacheReadInputTokens),void 0!==t.costUsd&&(this.costUsd=t.costUsd),void 0!==t.resultText&&(this.resultText=t.resultText),void 0!==t.resultSubtype&&(this.resultSubtype=t.resultSubtype),this.resultIsError=t.isError):(this.totalInputTokens+=t.inputTokens,this.totalOutputTokens+=t.outputTokens,this.totalCacheCreationInputTokens+=t.cacheCreationInputTokens,this.totalCacheReadInputTokens+=t.cacheReadInputTokens),t):null}constructor(){this.buffer="",this.totalInputTokens=0,this.totalOutputTokens=0,this.totalCacheCreationInputTokens=0,this.totalCacheReadInputTokens=0,this.costUsd=0,this.resultIsError=!1}}let x="[REDACTED]",_=[/\bgh[pousr]_[A-Za-z0-9]{36,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{50,}\b/g,/\bglpat-[A-Za-z0-9_-]{20,}\b/g,/(Bearer )[A-Za-z0-9._~+/-]+=*/g,/(https?:\/\/)[^\s/@:"\\]+:[^\s/@"\\]+(?=@)/g,/(PRIVATE-TOKEN:\s*)[^\s"\\]+/gi,/(Basic )[A-Za-z0-9+/]+=*/g,/\b(?:AKIA|ASIA|AGPA|AIDA|ANPA|AROA)[0-9A-Z]{16}\b/g,/\bsk-ant-[A-Za-z0-9_-]{20,}\b/g,/\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g,/\d{8,10}:[A-Za-z0-9_-]{35}\b/g];function T(e){let t=e;for(let e of _)t=t.replace(e,(e,t)=>"string"==typeof t?`${t}${x}`:x);return t}let y=[{kind:"auth",pattern:/invalid api key/i},{kind:"auth",pattern:/please run \/login/i},{kind:"auth",pattern:/authentication_error/i},{kind:"auth",pattern:/api error:?\s*401\b/i},{kind:"auth",pattern:/oauth token (?:has )?(?:expired|been revoked)/i},{kind:"billing",pattern:/credit balance is too low/i},{kind:"billing",pattern:/billing_error/i},{kind:"usage_limit",pattern:/usage limit reached/i},{kind:"usage_limit",pattern:/\b(?:\d+-hour|session|weekly) limit reached/i},{kind:"usage_limit",pattern:/limit will reset at/i},{kind:"rate_limit",pattern:/rate.?limit_error/i},{kind:"rate_limit",pattern:/api error:?\s*429\b/i},{kind:"rate_limit",pattern:/too many requests/i},{kind:"rate_limit",pattern:/\brate.?limit(?:ed)?\b.{0,60}\b(?:exceeded|reached|hit)\b/i},{kind:"rate_limit",pattern:/\b(?:exceeded|reached|hit)\b.{0,60}\brate.?limit/i},{kind:"overloaded",pattern:/overloaded_error/i},{kind:"overloaded",pattern:/api error:?\s*529\b/i}],v=/limit reached\|(\d{9,12})\b/i,I=/retry[- ]?after[:\s]+(\d+)\s*(?:s|sec|second)/i;function M(e){return e>0?["--max-turns",String(e)]:[]}let j=[{kind:"auth",pattern:/unexpected status 401\b/i},{kind:"auth",pattern:/\b401 unauthorized\b/i},{kind:"auth",pattern:/access token could not be refreshed/i},{kind:"auth",pattern:/please log out and sign in again/i},{kind:"auth",pattern:/\bnot logged in\b/i},{kind:"auth",pattern:/(?:chatgpt|api key) login is required/i},{kind:"auth",pattern:/missing environment variable.{0,5}OPENAI_API_KEY/i},{kind:"auth",pattern:/re-?run `?codex login`?/i},{kind:"billing",pattern:/quota exceeded\. check your plan and billing/i},{kind:"billing",pattern:/insufficient_quota/i},{kind:"billing",pattern:/exceeded your current quota/i},{kind:"billing",pattern:/\bout of credits\b/i},{kind:"billing",pattern:/\bspend cap\b/i},{kind:"billing",pattern:/to use codex with your chatgpt plan/i},{kind:"usage_limit",pattern:/you.?ve hit your usage limit/i},{kind:"usage_limit",pattern:/usage_limit_reached/i},{kind:"rate_limit",pattern:/rate.?limit_exceeded/i},{kind:"rate_limit",pattern:/rate limit reached for/i},{kind:"rate_limit",pattern:/last status:?\s*429\b/i},{kind:"rate_limit",pattern:/unexpected status 429\b/i},{kind:"rate_limit",pattern:/too many requests/i},{kind:"overloaded",pattern:/selected model is at capacity/i},{kind:"overloaded",pattern:/currently experiencing high demand/i},{kind:"overloaded",pattern:/server_is_overloaded/i},{kind:"overloaded",pattern:/last status:?\s*5\d\d\b/i},{kind:"overloaded",pattern:/unexpected status 5\d\d\b/i}],P=/try again in ([\d.]+)\s*s(?:ec(?:ond)?s?)?\b/i,w="gpt-5-codex",A={"gpt-5-codex":{inputPerMTok:1.25,outputPerMTok:10,cacheWritePerMTok:0,cacheReadPerMTok:0},"gpt-5":{inputPerMTok:1.25,outputPerMTok:10,cacheWritePerMTok:0,cacheReadPerMTok:0},"gpt-5-mini":{inputPerMTok:.25,outputPerMTok:2,cacheWritePerMTok:0,cacheReadPerMTok:0}},C=Object.values(A).reduce((e,t)=>t.outputPerMTok>e.outputPerMTok?t:e,{inputPerMTok:0,outputPerMTok:0,cacheWritePerMTok:0,cacheReadPerMTok:0}),N=a.Ik({input_tokens:a.ai().optional(),cached_input_tokens:a.ai().optional(),output_tokens:a.ai().optional(),reasoning_output_tokens:a.ai().optional()}).passthrough(),R=a.Ik({used_percent:a.ai().optional(),window_minutes:a.ai().optional(),resets_in_seconds:a.ai().optional()}).passthrough(),S=a.Ik({primary:R.nullish(),secondary:R.nullish()}).passthrough(),E=a.Ik({id:a.Yj().optional(),item_type:a.Yj().optional(),text:a.Yj().optional(),command:a.Yj().optional(),exit_code:a.ai().optional(),server:a.Yj().optional(),tool:a.Yj().optional()}).passthrough(),O=a.Ik({type:a.Yj(),thread_id:a.Yj().optional(),usage:N.optional(),rate_limits:S.nullish(),item:E.optional(),error:a.Ik({message:a.Yj().optional()}).passthrough().optional(),message:a.Yj().optional()}).passthrough();function Y(e){if(e&&"number"==typeof e.used_percent)return{usedPercent:e.used_percent,windowMinutes:e.window_minutes,resetsInSeconds:e.resets_in_seconds}}class W{push(e){this.buffer+=e;let t=[],r=this.buffer.indexOf("\n");for(;-1!==r;){let e=this.buffer.slice(0,r);this.buffer=this.buffer.slice(r+1);let n=this.consume(e);n&&t.push(n),r=this.buffer.indexOf("\n")}return t}flush(){let e=this.buffer;this.buffer="";let t=this.consume(e);return t?[t]:[]}consume(e){let t;try{t=function(e){let t=e.trim();if(!t)return null;let r=JSON.parse(t);return O.parse(r)}(e)}catch(t){return this.onParseError?.({line:e.trim(),message:f(t)}),null}if(!t)return null;let r=function(e){let t=S.nullish().safeParse(e.rate_limits);if(!t.success||!t.data)return;let r=Y(t.data.primary),n=Y(t.data.secondary);if(r||n)return{primary:r,secondary:n}}(t);if(r&&(this.rateLimits=r),"turn.failed"===t.type||"error"===t.type){this.resultIsError=!0;let e=t.error?.message??t.message;e&&(this.resultText=e)}else"turn.completed"===t.type&&(this.resultIsError=!1,this.resultText=void 0);let n=function(e){let t={type:"assistant",chunks:[],inputTokens:0,outputTokens:0,cacheCreationInputTokens:0,cacheReadInputTokens:0,isError:!1,raw:e};if("thread.started"===e.type)return{...t,type:"system",sessionId:e.thread_id};if("item.completed"===e.type&&e.item)return{...t,type:"assistant",chunks:function(e){let t=e.id??"";switch(e.item_type){case"assistant_message":case"reasoning":return e.text?[{kind:"text",text:e.text}]:[];case"command_execution":return[{kind:"tool_use",name:"command",id:t,input:{command:e.command,exit_code:e.exit_code}}];case"file_change":return[{kind:"tool_use",name:"edit",id:t,input:e}];case"mcp_tool_call":return[{kind:"tool_use",name:`${e.server??"mcp"}/${e.tool??"tool"}`,id:t,input:e}];default:return[]}}(e.item)};if("turn.completed"===e.type){let r=e.usage;return{...t,type:"result",inputTokens:r?.input_tokens??0,outputTokens:(r?.output_tokens??0)+(r?.reasoning_output_tokens??0)}}return"turn.failed"===e.type||"error"===e.type?{...t,type:"result",isError:!0}:null}(t);return n?(n.sessionId&&(this.sessionId=n.sessionId),this.totalInputTokens+=n.inputTokens,this.totalOutputTokens+=n.outputTokens,n):null}constructor(){this.buffer="",this.totalInputTokens=0,this.totalOutputTokens=0,this.totalCacheCreationInputTokens=0,this.totalCacheReadInputTokens=0,this.costUsd=0}}let L=/openrouter http (\d{3})/i,U=/retry[- ]?after[:\s]+(\d+)\s*(?:s\b|sec|second)/i,z="openrouter is an HTTP provider; it has no CLI surface (dispatch on provider.kind)",Z={claude:{id:"claude",label:"Claude Code",defaultCommand:"claude",supportsResume:!0,resumeModel:"claude-haiku-4-5",resumeMaxTurns:15,defaultModel:"claude-opus-4-8",buildStartArgs:({prompt:e,model:t,maxTurns:r,bypassPermissions:n})=>["-p",e,...M(r),...n?["--dangerously-skip-permissions"]:["--permission-mode","acceptEdits"],"--model",t,"--output-format","stream-json","--verbose"],buildResumeArgs:({prompt:e,sessionId:t,model:r,maxTurns:n,bypassPermissions:i})=>["-p",e,"--resume",t,...M(n),...i?["--dangerously-skip-permissions"]:[],"--model",r,"--output-format","stream-json","--verbose"],buildOneShotArgs:({prompt:e,model:t})=>["-p",e,"--model",t],buildStreamOneShotArgs:({prompt:e,model:t})=>["-p",e,"--model",t,"--output-format","stream-json","--verbose"],createParser:()=>new b,classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n");if(!r.trim())return;let n=y.find(e=>e.pattern.test(r));if(!n)return;let i={agent:"claude",kind:n.kind,rawSnippet:(t=n.pattern,T((r.split("\n").find(e=>t.test(e))??r).trim()).slice(0,300))};if("usage_limit"===n.kind){let e=r.match(v)?.[1];e&&(i.resetAt=Number(e))}if("rate_limit"===n.kind||"overloaded"===n.kind){let e=r.match(I)?.[1];e&&(i.retryAfterMs=1e3*Number(e))}return i},estimateCost:function(e,t,r,n=0,i=0){let a=function(e){if(!e)return o;let t=s[e];return t||(console.warn(`[drydock] Unknown model id "${e}" — using max-priced fallback to avoid under-counting cost`),o)}(e);return t/1e6*a.inputPerMTok+r/1e6*a.outputPerMTok+n/1e6*a.cacheWritePerMTok+i/1e6*a.cacheReadPerMTok}},codex:{id:"codex",label:"Codex CLI",defaultCommand:"codex",supportsResume:!0,resumeModel:w,resumeMaxTurns:15,defaultModel:w,buildStartArgs:({prompt:e,model:t})=>["exec","--json","--sandbox","workspace-write","--model",t,e],buildResumeArgs:({prompt:e,sessionId:t,model:r})=>["exec","resume",t,"--json","--sandbox","workspace-write","--model",r,e],buildOneShotArgs:({prompt:e,model:t})=>["exec","--model",t,e],buildStreamOneShotArgs:()=>null,createParser:()=>new W,classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n");if(!r.trim())return;let n=j.find(e=>e.pattern.test(r));if(!n)return;let i={agent:"codex",kind:n.kind,rawSnippet:(t=n.pattern,T((r.split("\n").find(e=>t.test(e))??r).trim()).slice(0,300))};if("rate_limit"===n.kind||"overloaded"===n.kind){let e=r.match(P)?.[1],t=e?Math.ceil(1e3*Number(e)):NaN;Number.isFinite(t)&&t>=0&&(i.retryAfterMs=t)}return i},captureUsage:e=>e instanceof W?e.rateLimits:void 0,estimateCost:function(e,t,r){let n=function(e){if(!e)return C;let t=A[e];return t||(console.warn(`[drydock] Unknown codex model id "${e}" — using max-priced fallback to avoid under-counting cost`),C)}(e);return t/1e6*n.inputPerMTok+r/1e6*n.outputPerMTok}},openrouter:{id:"openrouter",kind:"http",label:"OpenRouter",defaultCommand:"",supportsResume:!1,resumeModel:"",resumeMaxTurns:20,defaultModel:"",buildStartArgs(){throw Error(z)},buildResumeArgs:()=>null,buildOneShotArgs(){throw Error(z)},buildStreamOneShotArgs:()=>null,createParser(){throw Error(z)},classifyFailure:function(e){var t;if(0===e.exitCode&&!e.resultIsError)return;let r=[e.resultText,e.stderr].filter(Boolean).join("\n"),n=r.match(L)?.[1];if(!n)return;let i=(t=Number(n),401===t||403===t?"auth":402===t?"billing":429===t?/\b(?:free|daily|quota)\b/i.test(r)?"usage_limit":"rate_limit":408===t||t>=500&&t<600?"overloaded":void 0);if(!i)return;let s={agent:"openrouter",kind:i,rawSnippet:T((r.split("\n").find(e=>L.test(e))??r).trim()).slice(0,300)},o=r.match(U)?.[1];return o&&("rate_limit"===i||"overloaded"===i)&&(s.retryAfterMs=1e3*Number(o)),s},estimateCost:()=>0}},F=["claude","codex","openrouter"].map(e=>Z[e]),q=["claude","codex"];function $({value:e,onChange:t,id:r,className:s,agents:o=q}){let a=F.filter(e=>o.includes(e.id));return(0,n.jsx)(i.l,{id:r,value:e,onChange:e=>t(e.target.value),className:s,children:a.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))})}},7405:(e,t,r)=>{r.d(t,{p:()=>o});var n=r(515),i=r(1171),s=r(5832);let o=i.forwardRef(({className:e,...t},r)=>(0,n.jsx)("input",{ref:r,className:(0,s.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));o.displayName="Input"},8067:(e,t,r)=>{r.d(t,{l:()=>a});var n=r(515),i=r(3798),s=r(1171),o=r(5832);let a=s.forwardRef(({className:e,children:t,...r},s)=>(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("select",{ref:s,className:(0,o.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t}),(0,n.jsx)(i.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));a.displayName="Select"},9214:(e,t,r)=>{r.d(t,{p:()=>o});var n=r(515),i=r(5832);let s={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function o({icon:e,tone:t="neutral",title:r,description:a,action:u,secondary:l,className:d,compact:c}){return(0,n.jsxs)("div",{className:(0,i.cn)("flex flex-col items-center justify-center text-center",c?"py-10":"py-16",d),children:[e&&(0,n.jsx)("div",{className:(0,i.cn)("flex items-center justify-center rounded-2xl",c?"h-12 w-12":"h-16 w-16",s[t]),children:(0,n.jsx)(e,{className:c?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,n.jsx)("h3",{className:"mt-4 text-base font-semibold",children:r}),a&&(0,n.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:a}),(u||l)&&(0,n.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[u,l]})]})}},9754:(e,t,r)=>{r.d(t,{o:()=>o});var n=r(515),i=r(8067),s=r(1837);function o({value:e,onChange:t,agent:r,openrouterModels:a=[],id:u,className:l}){if("openrouter"===r)return(0,n.jsxs)(i.l,{id:u,value:e,onChange:e=>t(e.target.value),className:l,children:[0===a.length&&(0,n.jsx)("option",{value:"",disabled:!0,children:"No synced models — refresh the catalog in Settings"}),a.length>0&&""!==e&&!a.some(t=>t.id===e)&&(0,n.jsxs)("option",{value:e,disabled:!0,children:[e," (no longer in catalog)"]}),a.map(e=>(0,n.jsx)("option",{value:e.id,children:e.isFree?`${e.label} (free)`:e.label},e.id))]});let d=r?(0,s.tT)(r):s.L6;return(0,n.jsx)(i.l,{id:u,value:e,onChange:e=>t(e.target.value),className:l,children:d.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6029],{100:(e,t,s)=>{"use strict";s.d(t,{AdrReview:()=>v});var r=s(515),n=s(3639),a=s(1171),c=s(5138),i=s(9199),d=s(6644),l=s(395),o=s(5529),x=s(9694),u=s(9214),m=s(7405),p=s(739),f=s(8479),h=s(5097);let j=(0,h.createServerReference)("40a3216b4d580d681f99c38045144e4fb223b5a18a",h.callServer,void 0,h.findSourceMapURL,"approveAdrAction"),g=(0,h.createServerReference)("60ffd5b3676f2a5a09a2ee0a8dfb8c9b2fa9f45695",h.callServer,void 0,h.findSourceMapURL,"rejectAdrAction");function v({items:e}){let[t,s]=(0,a.useState)(()=>new Set),c=e.filter(e=>"pending_review"===e.status&&!t.has(e.id)).length;return(0,r.jsxs)("div",{className:"dd-fade-up max-w-3xl",children:[(0,r.jsx)(i.z,{title:"ADRs",subtitle:"Architecture decisions the agent recorded — review before they harden.",icon:n.A,actions:c>0?(0,r.jsxs)(d.E,{tone:"destructive",children:[c," pending"]}):void 0}),0===e.length?(0,r.jsx)(o.Zp,{children:(0,r.jsx)(u.p,{icon:n.A,title:"No decisions yet",description:"When the agent makes a notable architectural call, it'll log an ADR here for you to review."})}):(0,r.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,r.jsx)(b,{adr:e,onResolved:()=>{let t;return t=e.id,s(e=>new Set(e).add(t))}},e.id))})]})}function b({adr:e,onResolved:t}){var s;let n,i,[u,h]=(0,a.useTransition)(),[v,N]=(0,a.useState)(""),[w,y]=(0,a.useState)(!1),[A,R]=(0,a.useState)(null),{success:S,error:k}=(0,f.d)(),_="pending_review"===e.status&&null===A,D=(n=(s=e.filePath).split("/").pop()??s,(i=n.match(/^(\d{1,4})/)?.[1])?`ADR-${i.padStart(3,"0")}`:n.replace(/\.mdx?$/,""));return(0,r.jsxs)(o.Zp,{pad:"default",className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-semibold text-muted-foreground",children:D}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate font-medium",children:e.title}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,r.jsx)(p.s,{ts:e.createdAt})})]}),_?(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)(l.$,{size:"sm",variant:"outline",disabled:u,onClick:function(){h(async()=>{try{await j(e.id),R("approved"),t(),S("ADR approved",e.title)}catch(e){k("Failed to approve ADR",e instanceof Error?e.message:String(e))}})},children:"Accept"}),(0,r.jsx)(l.$,{size:"sm",variant:"ghost",disabled:u,onClick:()=>y(!0),children:"Reject"})]}):(0,r.jsx)(d.E,{tone:"rejected"===A?"neutral":"success",children:"rejected"===A?"rejected":"accepted"})]}),(0,r.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none rounded-lg border border-card-border bg-secondary/40 p-4 [&_pre]:bg-card",children:(0,r.jsx)(c.oz,{children:e.content})}),_&&(0,r.jsx)(m.p,{"aria-label":"Rejection comment",placeholder:"Optional rejection comment",value:v,onChange:e=>N(e.target.value)}),(0,r.jsx)(x.T,{open:w,onOpenChange:y,onConfirm:function(){h(async()=>{try{await g(e.id,v),R("rejected"),t(),S("ADR rejected",e.title)}catch(e){k("Failed to reject ADR",e instanceof Error?e.message:String(e))}})},title:"Reject ADR?",description:`This rejects "${e.title}" and notifies the run.`,confirmLabel:"Reject",variant:"destructive",pending:u})]})}},739:(e,t,s)=>{"use strict";s.d(t,{s:()=>c});var r=s(515),n=s(6845),a=s(5832);function c({ts:e,className:t}){let s=(0,n.p)();return(0,r.jsx)("span",{className:t,children:s?(0,a.KW)(e):"…"})}},4940:(e,t,s)=>{Promise.resolve().then(s.bind(s,100))},7405:(e,t,s)=>{"use strict";s.d(t,{p:()=>c});var r=s(515),n=s(1171),a=s(5832);let c=n.forwardRef(({className:e,...t},s)=>(0,r.jsx)("input",{ref:s,className:(0,a.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));c.displayName="Input"},9199:(e,t,s)=>{"use strict";s.d(t,{z:()=>l});var r=s(515),n=s(9662),a=s(742),c=s.n(a),i=s(1171),d=s(5832);function l({title:e,subtitle:t,breadcrumb:s,actions:a,icon:o,className:x}){return(0,r.jsxs)("div",{className:(0,d.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",x),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[s&&s.length>0&&(0,r.jsx)("nav",{className:"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:s.map((e,t)=>(0,r.jsxs)(i.Fragment,{children:[t>0&&(0,r.jsx)(n.A,{className:"h-3 w-3 opacity-60","aria-hidden":!0}),e.href?(0,r.jsx)(c(),{href:e.href,className:"rounded transition-colors hover:text-foreground focus-ring",children:e.label}):(0,r.jsx)("span",{className:"text-foreground/80",children:e.label})]},e.href??e.label))}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[o&&(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,r.jsx)(o,{className:"h-[17px] w-[17px]"})}),(0,r.jsx)("h1",{className:"text-pretty text-2xl font-bold tracking-tight",children:e})]}),t&&(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),a&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:a})]})}},9214:(e,t,s)=>{"use strict";s.d(t,{p:()=>c});var r=s(515),n=s(5832);let a={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function c({icon:e,tone:t="neutral",title:s,description:i,action:d,secondary:l,className:o,compact:x}){return(0,r.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center text-center",x?"py-10":"py-16",o),children:[e&&(0,r.jsx)("div",{className:(0,n.cn)("flex items-center justify-center rounded-2xl",x?"h-12 w-12":"h-16 w-16",a[t]),children:(0,r.jsx)(e,{className:x?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,r.jsx)("h3",{className:"mt-4 text-base font-semibold",children:s}),i&&(0,r.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:i}),(d||l)&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[d,l]})]})}}},e=>{e.O(0,[9843,4443,3433,9655,4234,7358],()=>e(e.s=4940)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3747],{598:(e,t,s)=>{"use strict";s.d(t,{y:()=>i});var r=s(515),a=s(8108),n=s(5832);function i({size:e=16,className:t}){return(0,r.jsx)(a.A,{width:e,height:e,className:(0,n.cn)("dd-spin",t),"aria-hidden":!0})}},2235:(e,t,s)=>{"use strict";var r=s(2067);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},2414:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},2674:(e,t,s)=>{"use strict";s.d(t,{JobStopButton:()=>o});var r=s(515);let a=(0,s(1330).A)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var n=s(1171),i=s(395),c=s(9694),l=s(8479),d=s(7996);function o({jobId:e}){let[t,s]=(0,n.useTransition)(),[u,h]=(0,n.useState)(!1),{success:m,error:p}=(0,l.d)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.$,{variant:"destructive",size:"sm",disabled:t,onClick:()=>h(!0),children:[(0,r.jsx)(a,{className:"h-3.5 w-3.5"}),"Stop"]}),(0,r.jsx)(c.T,{open:u,onOpenChange:h,onConfirm:function(){s(async()=>{try{await (0,d.A)(e),m("Job stopped",`Job #${e} aborted`)}catch(e){p("Failed to stop job",e instanceof Error?e.message:String(e))}})},icon:a,title:"Stop job?",description:`This terminates the running agent for job #${e} and marks it aborted.`,confirmLabel:"Stop",variant:"destructive",pending:t})]})}},3366:(e,t,s)=>{"use strict";s.d(t,{ResumeWithInstructions:()=>p});var r=s(515);let a=(0,s(1330).A)("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);var n=s(8762),i=s(5378),c=s(2235),l=s(1171),d=s(395),o=s(9),u=s(8479),h=s(5097);let m=(0,h.createServerReference)("60d5637398d15b44490626ec9dbfb9dcbafc153010",h.callServer,void 0,h.findSourceMapURL,"resumeJobWithInstructionAction");function p({jobId:e,label:t,defaultOpen:s=!1,onResumed:h}){let x=(0,c.useRouter)(),{success:f,error:g}=(0,u.d)(),[v,y]=(0,l.useState)(s),[b,k]=(0,l.useState)(""),[j,w]=(0,l.useTransition)(),A=b.trim();function N(){A&&w(async()=>{try{await m(e,A),f("Job resumed with instructions",t),k(""),y(s),h?.(),x.refresh()}catch(e){g("Failed to resume job",e instanceof Error?e.message:String(e))}})}return v?(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,r.jsx)(o.T,{value:b,onChange:e=>k(e.target.value),disabled:j,placeholder:"Tell the agent how to proceed — e.g. “use the existing xByY helper”, “skip the migration, it’s already applied”.","aria-label":"Instructions for the agent",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),N())}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)(d.$,{size:"sm",disabled:j||!A,onClick:N,children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"})," Resume"]}),!s&&(0,r.jsxs)(d.$,{variant:"ghost",size:"sm",disabled:j,onClick:()=>{y(!1),k("")},children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"})," Cancel"]})]})]}):(0,r.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>y(!0),children:[(0,r.jsx)(a,{className:"h-3.5 w-3.5"})," Resume with instructions"]})}},4276:(e,t,s)=>{"use strict";s.d(t,{h:()=>l});var r=s(515),a=s(6512),n=s(5832),i=s(5172);let c={neutral:{chip:"bg-secondary text-muted-foreground",val:"text-foreground",bg:""},primary:{chip:"bg-primary/15 text-primary",val:"text-primary",bg:"bg-primary/[0.04]"},success:{chip:"bg-success-muted text-success",val:"text-success",bg:"bg-success/[0.05]"},warning:{chip:"bg-warning-muted text-warning",val:"text-warning",bg:"bg-warning/[0.05]"},destructive:{chip:"bg-destructive/15 text-destructive",val:"text-destructive",bg:"bg-destructive/[0.05]"}};function l({icon:e,label:t,value:s,sub:d,tone:o="neutral",active:u,onClick:h,hint:m}){let p=!!u&&"neutral"!==o,x=c[o],f=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:(0,n.cn)("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",p?x.chip:"bg-secondary text-muted-foreground"),children:e&&(0,r.jsx)(e,{className:"h-4 w-4"})}),m&&(0,r.jsx)("span",{className:"text-muted-foreground/60",children:(0,r.jsx)(i.m,{content:m,children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:(0,n.cn)("text-2xl font-semibold tnum tracking-tight",p?x.val:"text-foreground"),children:s}),(0,r.jsx)("div",{className:"mt-0.5 text-[13px] font-medium text-muted-foreground",children:t}),d&&(0,r.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground/80",children:d})]})]}),g=(0,n.cn)("group relative flex flex-col gap-3 rounded-xl border border-card-border bg-card p-4 text-left shadow-sm transition-colors",p&&x.bg,h&&"hover-elevate focus-ring");return h?(0,r.jsx)("button",{type:"button",onClick:h,className:g,children:f}):(0,r.jsx)("div",{className:g,children:f})}},4283:(e,t,s)=>{"use strict";s.d(t,{JobMetrics:()=>h});var r=s(515),a=s(2414),n=s(7561),i=s(1528);let c=(0,s(1330).A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var l=s(1171),d=s(4276),o=s(5832);let u=["assistant","result"];function h({jobId:e,issueNumber:t,subject:s,model:m,initialCostUsd:p,inputTokens:x,outputTokens:f,startedAt:g,finishedAt:v,nowSec:y,attempts:b,active:k=!0}){let[j,w]=(0,l.useState)(p),[A,N]=(0,l.useState)({input:x,output:f}),[S,M]=(0,l.useState)(y);(0,l.useEffect)(()=>{if(!k)return;let t=new EventSource(`/api/sse/jobs/${e}`),s=e=>{try{let t=JSON.parse(e.data);"number"==typeof t.costUsd&&w(t.costUsd),("number"==typeof t.inputTokens||"number"==typeof t.outputTokens)&&N(e=>({input:"number"==typeof t.inputTokens?t.inputTokens:e.input,output:"number"==typeof t.outputTokens?t.outputTokens:e.output}))}catch{}};for(let e of u)t.addEventListener(e,s);return()=>t.close()},[e,k]),(0,l.useEffect)(()=>{if(!k||null!=v)return;let e=setInterval(()=>M(Math.floor(Date.now()/1e3)),1e3);return()=>clearInterval(e)},[k,v]);let R=null!=g?Math.max(0,(v??S)-g):null,P=`${(A.input/1e3).toFixed(0)}k in \xb7 ${(A.output/1e3).toFixed(1)}k out \xb7 ${s??`#${t}`}`;return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,r.jsx)(d.h,{icon:a.A,label:"Cost",value:(0,o.UK)(j),sub:P,tone:"primary",active:!0}),(0,r.jsx)(d.h,{icon:n.A,label:"Duration",value:null!=R?(0,o.a3)(R):"—"}),(0,r.jsx)(d.h,{icon:i.A,label:"Attempts",value:b??"—",tone:null!=b&&b>2?"warning":"neutral",active:null!=b&&b>2}),(0,r.jsx)(d.h,{icon:c,label:"Model",value:(0,r.jsx)("span",{className:"font-mono text-base",children:(m??"—").replace("claude-","")})})]})}},4877:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},5097:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return n.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in r)Object.defineProperty(t,a,{enumerable:!0,get:r[a]});let n=s(2258),i=s(7886),c=s(349)},5378:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6003:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},6512:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},6732:(e,t,s)=>{"use strict";s.d(t,{PrQuestionPanel:()=>g});var r=s(515);let a=(0,s(1330).A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var n=s(8762),i=s(2235),c=s(1171),l=s(6644),d=s(395),o=s(5529),u=s(9),h=s(8479),m=s(5097);let p=(0,m.createServerReference)("60e2a61f57d24df39ad2142957deac4ade6a81def2",m.callServer,void 0,m.findSourceMapURL,"askPrQuestionAction"),x={answering:"warning",answered:"success",error:"destructive"},f={answering:"answering…",answered:"answered",error:"error"};function g({jobId:e,initialQuestions:t}){let s=(0,i.useRouter)(),{error:m}=(0,h.d)(),[v,y]=(0,c.useState)(""),[b,k]=(0,c.useTransition)(),j=t.some(e=>"answering"===e.status);function w(){let t=v.trim();t&&!b&&k(async()=>{try{await p(e,t),y(""),s.refresh()}catch(e){m("Failed to ask",e instanceof Error?e.message:String(e))}})}return(0,c.useEffect)(()=>{if(!j)return;let e=setInterval(()=>s.refresh(),2500);return()=>clearInterval(e)},[j,s]),(0,r.jsxs)(o.Zp,{pad:"lg",className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,r.jsx)(a,{className:"h-[17px] w-[17px]"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-base font-semibold",children:"Ask about this PR"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"A read-only assistant answers from the PR's assembled context."})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(u.T,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&w()},placeholder:"e.g. Why did this change the queue logic? Is the failing test related?",rows:3,className:"resize-y"}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"⌘/Ctrl+Enter to send"}),(0,r.jsxs)(d.$,{size:"sm",onClick:w,disabled:b||0===v.trim().length,children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),b?"Asking…":"Ask"]})]})]}),0===t.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No questions yet. The agent answers read-only, from the PR's assembled context."}):(0,r.jsx)("ul",{className:"space-y-3",children:t.map(e=>(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-background p-3",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-start justify-between gap-2",children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:e.question}),(0,r.jsx)(l.E,{tone:x[e.status]??"neutral",children:f[e.status]??e.status})]}),"answered"===e.status&&e.answer&&(0,r.jsx)("p",{className:"whitespace-pre-wrap text-sm text-muted-foreground",children:e.answer}),"error"===e.status&&(0,r.jsx)("p",{className:"text-sm text-destructive",children:e.errorMessage??"Answering failed."}),"answering"===e.status&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Working on an answer…"})]},e.id))})]})}},7934:(e,t,s)=>{Promise.resolve().then(s.bind(s,9290)),Promise.resolve().then(s.t.bind(s,742,23)),Promise.resolve().then(s.bind(s,4283)),Promise.resolve().then(s.bind(s,2674)),Promise.resolve().then(s.bind(s,715)),Promise.resolve().then(s.bind(s,8085)),Promise.resolve().then(s.bind(s,6732)),Promise.resolve().then(s.bind(s,3366))},7996:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(5097);let a=(0,r.createServerReference)("4059e24a265e6119e48b22392e63bd485d23f1e520",r.callServer,void 0,r.findSourceMapURL,"abortJobAction")},8085:(e,t,s)=>{"use strict";s.d(t,{PrAuditButton:()=>o});var r=s(515);let a=(0,s(1330).A)("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var n=s(1171),i=s(395),c=s(8479),l=s(5097);let d=(0,l.createServerReference)("402591c8e547ac5a174e39071ffa15a4cb027f9c6f",l.callServer,void 0,l.findSourceMapURL,"runPrAuditAction");function o({jobId:e}){let[t,s]=(0,n.useTransition)(),{success:l,error:u}=(0,c.d)();return(0,r.jsxs)(i.$,{variant:"outline",size:"sm",disabled:t,onClick:function(){s(async()=>{try{let{prNumber:t}=await d(e);l("PR audit started",`Reviewing PR #${t} — the result lands on the issue.`)}catch(e){u("Failed to start PR audit",e instanceof Error?e.message:String(e))}})},children:[(0,r.jsx)(a,{className:"h-3.5 w-3.5"}),t?"Starting…":"Run PR audit"]})}},8131:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},8762:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])}},e=>{e.O(0,[9843,8745,3433,3894,9655,4234,7358],()=>e(e.s=7934)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{293:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},2194:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,8353,23)),Promise.resolve().then(a.t.bind(a,2332,23)),Promise.resolve().then(a.t.bind(a,5689,23)),Promise.resolve().then(a.bind(a,8167)),Promise.resolve().then(a.bind(a,3728))},2332:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_3c557b",variable:"__variable_3c557b"}},3164:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},3639:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},3728:(e,t,a)=>{"use strict";a.d(t,{Providers:()=>l});var s=a(515),r=a(5241),n=a(8479);function l({children:e}){return(0,s.jsx)(r.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,disableTransitionOnChange:!0,children:(0,s.jsx)(n.t,{children:e})})}},4054:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},4842:(e,t,a)=>{"use strict";a.d(t,{$:()=>r});var s=a(5097);let r=(0,s.createServerReference)("400b7e089db13cfc69fd6459bffc9c6112ef81686e",s.callServer,void 0,s.findSourceMapURL,"togglePauseAction")},5241:(e,t,a)=>{"use strict";a.d(t,{D:()=>d,N:()=>m});var s=a(1171),r=(e,t,a,s,r,n,l,o)=>{let i=document.documentElement,c=["light","dark"];function d(t){var a;(Array.isArray(e)?e:[e]).forEach(e=>{let a="class"===e,s=a&&n?r.map(e=>n[e]||e):r;a?(i.classList.remove(...s),i.classList.add(n&&n[t]?n[t]:t)):i.setAttribute(e,t)}),a=t,o&&c.includes(a)&&(i.style.colorScheme=a)}if(s)d(s);else try{let e=localStorage.getItem(t)||a,s=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(s)}catch(e){}},n=["light","dark"],l="(prefers-color-scheme: dark)",o="u"<typeof window,i=s.createContext(void 0),c={setTheme:e=>{},themes:[]},d=()=>{var e;return null!=(e=s.useContext(i))?e:c},m=e=>s.useContext(i)?s.createElement(s.Fragment,null,e.children):s.createElement(h,{...e}),u=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:a=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:c=u,defaultTheme:d=a?"system":"light",attribute:m="data-theme",value:h,children:b,nonce:g,scriptProps:v})=>{let[k,w]=s.useState(()=>f(o,d)),[j,N]=s.useState(()=>"system"===k?y():k),A=h?Object.values(h):c,S=s.useCallback(e=>{let s=e;if(!s)return;"system"===e&&a&&(s=y());let l=h?h[s]:s,o=t?x(g):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...A),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(m)?m.forEach(c):c(m),r){let e=n.includes(d)?d:null,t=n.includes(s)?s:e;i.style.colorScheme=t}null==o||o()},[g]),M=s.useCallback(e=>{let t="function"==typeof e?e(k):e;w(t);try{localStorage.setItem(o,t)}catch(e){}},[k]),E=s.useCallback(t=>{N(y(t)),"system"===k&&a&&!e&&S("system")},[k,e]);s.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(E),E(e),()=>e.removeListener(E)},[E]),s.useEffect(()=>{let e=e=>{e.key===o&&(e.newValue?w(e.newValue):M(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[M]),s.useEffect(()=>{S(null!=e?e:k)},[e,k]);let C=s.useMemo(()=>({theme:k,setTheme:M,forcedTheme:e,resolvedTheme:"system"===k?j:k,themes:a?[...c,"system"]:c,systemTheme:a?j:void 0}),[k,M,e,j,a,c]);return s.createElement(i.Provider,{value:C},s.createElement(p,{forcedTheme:e,storageKey:o,attribute:m,enableSystem:a,enableColorScheme:r,defaultTheme:d,value:h,themes:c,nonce:g,scriptProps:v}),b)},p=s.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:n,enableColorScheme:l,defaultTheme:o,value:i,themes:c,nonce:d,scriptProps:m})=>{let u=JSON.stringify([a,t,o,e,c,i,n,l]).slice(1,-1);return s.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${u})`}})}),f=(e,t)=>{let a;if(!o){try{a=localStorage.getItem(e)||void 0}catch(e){}return a||t}},x=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},y=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},5689:()=>{},8167:(e,t,a)=>{"use strict";a.d(t,{AppShell:()=>U});var s=a(515),r=a(293),n=a(4877),l=a(9320),o=a(1330);let i=(0,o.A)("chart-no-axes-column",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]]);var c=a(3164),d=a(3639),m=a(2414);let u=(0,o.A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),h=(0,o.A)("anchor",[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]),p=(0,o.A)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);var f=a(742),x=a.n(f),y=a(2235),b=a(4913),g=a(9583);let v=(0,o.A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);function k({failures:e}){return 0===e.length?null:(0,s.jsx)("div",{role:"alert",className:"border-t border-destructive/30 bg-destructive/10",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl items-start gap-2 px-4 py-1.5 text-xs text-destructive",children:[(0,s.jsx)(v,{className:"mt-0.5 h-[13px] w-[13px] shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"font-semibold",children:"Credential check failed — new jobs are paused until auth is restored."})," ",e.map(e=>(0,s.jsxs)("span",{className:"after:content-['_']",children:[(0,s.jsxs)("span",{className:"font-medium",children:[e.label,":"]})," ",e.message]},e.target))]})]})})}let w=(0,o.A)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var j=a(1171),N=a(9694),A=a(8479),S=a(5097);let M=(0,S.createServerReference)("00ba57b24c8b2b63a3f8d024c1179a22985e3c1498",S.callServer,void 0,S.findSourceMapURL,"emergencyStopAction");function E(){let[e,t]=(0,j.useTransition)(),[a,r]=(0,j.useState)(!1),{success:n,error:l}=(0,A.d)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",disabled:e,onClick:()=>r(!0),"aria-label":"Emergency stop — pause automation and abort all running jobs",className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-destructive/30 px-2.5 text-xs font-medium text-destructive hover-elevate focus-ring disabled:opacity-60",children:[(0,s.jsx)(w,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Stop all"})]}),(0,s.jsx)(N.T,{open:a,onOpenChange:r,onConfirm:function(){t(async()=>{try{let{aborted:e}=await M();n("Emergency stop",1===e?"Automation paused, 1 job aborted":`Automation paused, ${e} jobs aborted`)}catch(e){l("Emergency stop failed",e instanceof Error?e.message:String(e))}})},title:"Emergency stop?",description:"This pauses automation and aborts every running job, terminating their agents immediately.",confirmLabel:"Stop all",variant:"destructive",pending:e})]})}var C=a(4054),_=a(4842),T=a(5832);function z({paused:e}){let[t,a]=(0,j.useState)(e),[r,n]=(0,j.useTransition)(),{success:l,error:o}=(0,A.d)();return(0,j.useEffect)(()=>a(e),[e]),(0,s.jsxs)("button",{type:"button",onClick:function(){let e=!t;n(async()=>{try{let t=await (0,_.$)(e);a(t.paused),l(t.paused?"Automation paused":"Automation resumed")}catch(e){o("Failed to toggle pause",e instanceof Error?e.message:String(e))}})},disabled:r,"aria-pressed":t,"aria-label":t?"Resume automation":"Pause automation",className:(0,T.cn)("inline-flex h-8 items-center gap-1.5 rounded-lg px-2.5 text-xs font-medium hover-elevate focus-ring disabled:opacity-60",t?"text-warning":"text-muted-foreground"),children:[t?(0,s.jsx)(C.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(p,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:t?"Resume":"Pause"})]})}let V=(0,o.A)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),P=(0,o.A)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var L=a(5241);function H(){let{resolvedTheme:e,setTheme:t}=(0,L.D)(),[a,r]=(0,j.useState)(!1);(0,j.useEffect)(()=>r(!0),[]);let n="dark"===e;return(0,s.jsx)("button",{type:"button","aria-label":"Toggle theme",onClick:()=>t(n?"light":"dark"),className:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover-elevate focus-ring",children:a&&!n?(0,s.jsx)(V,{className:"h-4 w-4"}):(0,s.jsx)(P,{className:"h-4 w-4"})})}let I=(0,o.A)("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);var R=a(5378),q=a(6644);let F="drydock:update-dismissed";function O({status:e,installKind:t}){let[a,r]=(0,j.useState)(null),[n,l]=(0,j.useState)(!1);return((0,j.useEffect)(()=>{try{r(localStorage.getItem(F))}catch{}l(!0)},[]),n&&e.updateAvailable&&e.latestVersion&&e.latestVersion!==a)?(0,s.jsxs)(q.E,{tone:"success",className:"h-8 gap-1.5 px-2.5",children:[(0,s.jsx)(I,{className:"h-3.5 w-3.5 shrink-0"}),e.releaseUrl?(0,s.jsxs)("a",{href:e.releaseUrl,target:"_blank",rel:"noreferrer",className:"rounded-sm hover:underline focus-ring",title:"global"===t?"Run `drydock update` to upgrade":"View the release on GitHub",children:["Update available: v",e.latestVersion]}):(0,s.jsxs)("span",{children:["Update available: v",e.latestVersion]}),"global"===t&&(0,s.jsx)("code",{className:"rounded bg-success/15 px-1 font-mono",children:"drydock update"}),(0,s.jsx)("button",{type:"button",onClick:()=>{try{e.latestVersion&&localStorage.setItem(F,e.latestVersion)}catch{}r(e.latestVersion)},"aria-label":"Dismiss update notice",className:"-mr-1 rounded p-0.5 hover-elevate focus-ring",children:(0,s.jsx)(R.A,{className:"h-3 w-3"})})]}):null}let D=[{href:"/",label:"Dashboard",icon:r.A},{href:"/needs-human",label:"Needs human",icon:n.A},{href:"/jobs",label:"Jobs",icon:l.A},{href:"/analytics",label:"Analytics",icon:i},{href:"/prompts",label:"Prompts",icon:c.A},{href:"/adrs",label:"ADRs",icon:d.A},{href:"/costs",label:"Costs",icon:m.A},{href:"/settings",label:"Settings",icon:u}];function U({children:e,adrPending:t=0,needsHuman:a=0,paused:r=!1,updateStatus:n,installKind:l="local",credentialFailures:o=[],claudeUsage:i,codexUsage:c}){let d=(0,y.usePathname)();return(0,s.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,s.jsx)("a",{href:"#main",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:ring-2 focus:ring-ring",children:"Skip to main content"}),(0,s.jsxs)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/85 backdrop-blur-md",children:[(0,s.jsxs)("div",{className:"mx-auto flex h-14 max-w-7xl items-center gap-2 px-4",children:[(0,s.jsxs)(x(),{href:"/",className:"mr-2 flex shrink-0 items-center gap-2 rounded-md focus-ring",children:[(0,s.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm",children:(0,s.jsx)(h,{className:"h-4 w-4"})}),(0,s.jsx)("span",{className:"text-base font-bold tracking-tight",children:"Drydock"})]}),(0,s.jsx)("nav",{className:"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto scrollbar-none",children:D.map(e=>{var r;let n="/"===(r=e.href)?"/"===d:d.startsWith(r),l=e.icon,o="/needs-human"===e.href?a:"/adrs"===e.href?t:0;return(0,s.jsxs)(x(),{href:e.href,"aria-current":n?"page":void 0,className:(0,T.cn)("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-sm transition-colors hover-elevate",n?"font-medium text-foreground":"text-muted-foreground"),children:[(0,s.jsx)(l,{className:(0,T.cn)("h-[15px] w-[15px]",n&&"text-primary")}),e.label,o>0&&(0,s.jsx)("span",{className:"ml-0.5 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-4 text-destructive-foreground tnum",children:o}),n&&(0,s.jsx)("span",{className:"absolute inset-x-2 -bottom-[7px] h-0.5 rounded-full bg-primary"})]},e.href)})}),(0,s.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[i&&(0,s.jsx)(b.B,{view:i}),c&&(0,s.jsx)(g._,{view:c}),n&&(0,s.jsx)(O,{status:n,installKind:l}),(0,s.jsx)(z,{paused:r}),(0,s.jsx)(E,{}),(0,s.jsx)("div",{className:"mx-1 h-5 w-px bg-border"}),(0,s.jsx)(H,{})]})]}),r&&(0,s.jsx)("div",{className:"border-t border-warning-border bg-warning-muted",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl items-center gap-2 px-4 py-1.5 text-xs text-warning-foreground",children:[(0,s.jsx)(p,{className:"h-[13px] w-[13px]"})," Automation is paused globally. No new jobs will start."]})}),(0,s.jsx)(k,{failures:o})]}),(0,s.jsx)("main",{id:"main",className:"mx-auto max-w-7xl px-4 py-6 sm:py-8",children:e})]})}},8353:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},9320:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])}},e=>{e.O(0,[643,9843,8264,3433,5080,9655,4234,7358],()=>e(e.s=2194)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{293:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},2194:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,8353,23)),Promise.resolve().then(a.t.bind(a,2332,23)),Promise.resolve().then(a.t.bind(a,5689,23)),Promise.resolve().then(a.bind(a,7408)),Promise.resolve().then(a.bind(a,3728))},2332:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_3c557b",variable:"__variable_3c557b"}},3123:(e,t,a)=>{"use strict";a.d(t,{$:()=>r});var s=a(5097);let r=(0,s.createServerReference)("40000b4b84e28d5ae3c149ab9bea206d1cb6c08e36",s.callServer,void 0,s.findSourceMapURL,"togglePauseAction")},3164:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},3639:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},3728:(e,t,a)=>{"use strict";a.d(t,{Providers:()=>l});var s=a(515),r=a(5241),n=a(8479);function l({children:e}){return(0,s.jsx)(r.N,{attribute:"class",defaultTheme:"dark",enableSystem:!1,disableTransitionOnChange:!0,children:(0,s.jsx)(n.t,{children:e})})}},4054:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},5241:(e,t,a)=>{"use strict";a.d(t,{D:()=>d,N:()=>m});var s=a(1171),r=(e,t,a,s,r,n,l,o)=>{let i=document.documentElement,c=["light","dark"];function d(t){var a;(Array.isArray(e)?e:[e]).forEach(e=>{let a="class"===e,s=a&&n?r.map(e=>n[e]||e):r;a?(i.classList.remove(...s),i.classList.add(n&&n[t]?n[t]:t)):i.setAttribute(e,t)}),a=t,o&&c.includes(a)&&(i.style.colorScheme=a)}if(s)d(s);else try{let e=localStorage.getItem(t)||a,s=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(s)}catch(e){}},n=["light","dark"],l="(prefers-color-scheme: dark)",o="u"<typeof window,i=s.createContext(void 0),c={setTheme:e=>{},themes:[]},d=()=>{var e;return null!=(e=s.useContext(i))?e:c},m=e=>s.useContext(i)?s.createElement(s.Fragment,null,e.children):s.createElement(h,{...e}),u=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:a=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:c=u,defaultTheme:d=a?"system":"light",attribute:m="data-theme",value:h,children:b,nonce:g,scriptProps:v})=>{let[k,w]=s.useState(()=>x(o,d)),[j,N]=s.useState(()=>"system"===k?y():k),A=h?Object.values(h):c,S=s.useCallback(e=>{let s=e;if(!s)return;"system"===e&&a&&(s=y());let l=h?h[s]:s,o=t?f(g):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...A),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(m)?m.forEach(c):c(m),r){let e=n.includes(d)?d:null,t=n.includes(s)?s:e;i.style.colorScheme=t}null==o||o()},[g]),M=s.useCallback(e=>{let t="function"==typeof e?e(k):e;w(t);try{localStorage.setItem(o,t)}catch(e){}},[k]),E=s.useCallback(t=>{N(y(t)),"system"===k&&a&&!e&&S("system")},[k,e]);s.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(E),E(e),()=>e.removeListener(E)},[E]),s.useEffect(()=>{let e=e=>{e.key===o&&(e.newValue?w(e.newValue):M(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[M]),s.useEffect(()=>{S(null!=e?e:k)},[e,k]);let C=s.useMemo(()=>({theme:k,setTheme:M,forcedTheme:e,resolvedTheme:"system"===k?j:k,themes:a?[...c,"system"]:c,systemTheme:a?j:void 0}),[k,M,e,j,a,c]);return s.createElement(i.Provider,{value:C},s.createElement(p,{forcedTheme:e,storageKey:o,attribute:m,enableSystem:a,enableColorScheme:r,defaultTheme:d,value:h,themes:c,nonce:g,scriptProps:v}),b)},p=s.memo(({forcedTheme:e,storageKey:t,attribute:a,enableSystem:n,enableColorScheme:l,defaultTheme:o,value:i,themes:c,nonce:d,scriptProps:m})=>{let u=JSON.stringify([a,t,o,e,c,i,n,l]).slice(1,-1);return s.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${u})`}})}),x=(e,t)=>{let a;if(!o){try{a=localStorage.getItem(e)||void 0}catch(e){}return a||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},y=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},5689:()=>{},7408:(e,t,a)=>{"use strict";a.d(t,{AppShell:()=>U});var s=a(515),r=a(293),n=a(4877),l=a(9320),o=a(1330);let i=(0,o.A)("chart-no-axes-column",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]]);var c=a(3164),d=a(3639),m=a(2414);let u=(0,o.A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),h=(0,o.A)("anchor",[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]),p=(0,o.A)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);var x=a(742),f=a.n(x),y=a(2235),b=a(4913),g=a(9583);let v=(0,o.A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);function k({failures:e}){return 0===e.length?null:(0,s.jsx)("div",{role:"alert",className:"border-t border-destructive/30 bg-destructive/10",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl items-start gap-2 px-4 py-1.5 text-xs text-destructive",children:[(0,s.jsx)(v,{className:"mt-0.5 h-[13px] w-[13px] shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"font-semibold",children:"Credential check failed — new jobs are paused until auth is restored."})," ",e.map(e=>(0,s.jsxs)("span",{className:"after:content-['_']",children:[(0,s.jsxs)("span",{className:"font-medium",children:[e.label,":"]})," ",e.message]},e.target))]})]})})}let w=(0,o.A)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var j=a(1171),N=a(9694),A=a(8479),S=a(5097);let M=(0,S.createServerReference)("00660de086391aa26430a4d805574659cf6b4370ea",S.callServer,void 0,S.findSourceMapURL,"emergencyStopAction");function E(){let[e,t]=(0,j.useTransition)(),[a,r]=(0,j.useState)(!1),{success:n,error:l}=(0,A.d)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",disabled:e,onClick:()=>r(!0),"aria-label":"Emergency stop — pause automation and abort all running jobs",className:"inline-flex h-8 items-center gap-1.5 rounded-lg border border-destructive/30 px-2.5 text-xs font-medium text-destructive hover-elevate focus-ring disabled:opacity-60",children:[(0,s.jsx)(w,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Stop all"})]}),(0,s.jsx)(N.T,{open:a,onOpenChange:r,onConfirm:function(){t(async()=>{try{let{aborted:e}=await M();n("Emergency stop",1===e?"Automation paused, 1 job aborted":`Automation paused, ${e} jobs aborted`)}catch(e){l("Emergency stop failed",e instanceof Error?e.message:String(e))}})},title:"Emergency stop?",description:"This pauses automation and aborts every running job, terminating their agents immediately.",confirmLabel:"Stop all",variant:"destructive",pending:e})]})}var C=a(4054),_=a(3123),T=a(5832);function z({paused:e}){let[t,a]=(0,j.useState)(e),[r,n]=(0,j.useTransition)(),{success:l,error:o}=(0,A.d)();return(0,j.useEffect)(()=>a(e),[e]),(0,s.jsxs)("button",{type:"button",onClick:function(){let e=!t;n(async()=>{try{let t=await (0,_.$)(e);a(t.paused),l(t.paused?"Automation paused":"Automation resumed")}catch(e){o("Failed to toggle pause",e instanceof Error?e.message:String(e))}})},disabled:r,"aria-pressed":t,"aria-label":t?"Resume automation":"Pause automation",className:(0,T.cn)("inline-flex h-8 items-center gap-1.5 rounded-lg px-2.5 text-xs font-medium hover-elevate focus-ring disabled:opacity-60",t?"text-warning":"text-muted-foreground"),children:[t?(0,s.jsx)(C.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(p,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:t?"Resume":"Pause"})]})}let V=(0,o.A)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),P=(0,o.A)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);var L=a(5241);function H(){let{resolvedTheme:e,setTheme:t}=(0,L.D)(),[a,r]=(0,j.useState)(!1);(0,j.useEffect)(()=>r(!0),[]);let n="dark"===e;return(0,s.jsx)("button",{type:"button","aria-label":"Toggle theme",onClick:()=>t(n?"light":"dark"),className:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover-elevate focus-ring",children:a&&!n?(0,s.jsx)(V,{className:"h-4 w-4"}):(0,s.jsx)(P,{className:"h-4 w-4"})})}let I=(0,o.A)("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);var R=a(5378),q=a(6644);let F="drydock:update-dismissed";function O({status:e,installKind:t}){let[a,r]=(0,j.useState)(null),[n,l]=(0,j.useState)(!1);return((0,j.useEffect)(()=>{try{r(localStorage.getItem(F))}catch{}l(!0)},[]),n&&e.updateAvailable&&e.latestVersion&&e.latestVersion!==a)?(0,s.jsxs)(q.E,{tone:"success",className:"h-8 gap-1.5 px-2.5",children:[(0,s.jsx)(I,{className:"h-3.5 w-3.5 shrink-0"}),e.releaseUrl?(0,s.jsxs)("a",{href:e.releaseUrl,target:"_blank",rel:"noreferrer",className:"rounded-sm hover:underline focus-ring",title:"global"===t?"Run `drydock update` to upgrade":"View the release on GitHub",children:["Update available: v",e.latestVersion]}):(0,s.jsxs)("span",{children:["Update available: v",e.latestVersion]}),"global"===t&&(0,s.jsx)("code",{className:"rounded bg-success/15 px-1 font-mono",children:"drydock update"}),(0,s.jsx)("button",{type:"button",onClick:()=>{try{e.latestVersion&&localStorage.setItem(F,e.latestVersion)}catch{}r(e.latestVersion)},"aria-label":"Dismiss update notice",className:"-mr-1 rounded p-0.5 hover-elevate focus-ring",children:(0,s.jsx)(R.A,{className:"h-3 w-3"})})]}):null}let D=[{href:"/",label:"Dashboard",icon:r.A},{href:"/needs-human",label:"Needs human",icon:n.A},{href:"/jobs",label:"Jobs",icon:l.A},{href:"/analytics",label:"Analytics",icon:i},{href:"/prompts",label:"Prompts",icon:c.A},{href:"/adrs",label:"ADRs",icon:d.A},{href:"/costs",label:"Costs",icon:m.A},{href:"/settings",label:"Settings",icon:u}];function U({children:e,adrPending:t=0,needsHuman:a=0,paused:r=!1,updateStatus:n,installKind:l="local",credentialFailures:o=[],claudeUsage:i,codexUsage:c}){let d=(0,y.usePathname)();return(0,s.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,s.jsx)("a",{href:"#main",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:ring-2 focus:ring-ring",children:"Skip to main content"}),(0,s.jsxs)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/85 backdrop-blur-md",children:[(0,s.jsxs)("div",{className:"mx-auto flex h-14 max-w-7xl items-center gap-2 px-4",children:[(0,s.jsxs)(f(),{href:"/",className:"mr-2 flex shrink-0 items-center gap-2 rounded-md focus-ring",children:[(0,s.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary text-primary-foreground shadow-sm",children:(0,s.jsx)(h,{className:"h-4 w-4"})}),(0,s.jsx)("span",{className:"text-base font-bold tracking-tight",children:"Drydock"})]}),(0,s.jsx)("nav",{className:"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto scrollbar-none",children:D.map(e=>{var r;let n="/"===(r=e.href)?"/"===d:d.startsWith(r),l=e.icon,o="/needs-human"===e.href?a:"/adrs"===e.href?t:0;return(0,s.jsxs)(f(),{href:e.href,"aria-current":n?"page":void 0,className:(0,T.cn)("relative flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-sm transition-colors hover-elevate",n?"font-medium text-foreground":"text-muted-foreground"),children:[(0,s.jsx)(l,{className:(0,T.cn)("h-[15px] w-[15px]",n&&"text-primary")}),e.label,o>0&&(0,s.jsx)("span",{className:"ml-0.5 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-4 text-destructive-foreground tnum",children:o}),n&&(0,s.jsx)("span",{className:"absolute inset-x-2 -bottom-[7px] h-0.5 rounded-full bg-primary"})]},e.href)})}),(0,s.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[i&&(0,s.jsx)(b.B,{view:i}),c&&(0,s.jsx)(g._,{view:c}),n&&(0,s.jsx)(O,{status:n,installKind:l}),(0,s.jsx)(z,{paused:r}),(0,s.jsx)(E,{}),(0,s.jsx)("div",{className:"mx-1 h-5 w-px bg-border"}),(0,s.jsx)(H,{})]})]}),r&&(0,s.jsx)("div",{className:"border-t border-warning-border bg-warning-muted",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-7xl items-center gap-2 px-4 py-1.5 text-xs text-warning-foreground",children:[(0,s.jsx)(p,{className:"h-[13px] w-[13px]"})," Automation is paused globally. No new jobs will start."]})}),(0,s.jsx)(k,{failures:o})]}),(0,s.jsx)("main",{id:"main",className:"mx-auto max-w-7xl px-4 py-6 sm:py-8",children:e})]})}},8353:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},9320:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(1330).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])}},e=>{e.O(0,[643,9843,8264,3433,5080,9655,4234,7358],()=>e(e.s=2194)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8608],{9:(e,t,s)=>{"use strict";s.d(t,{T:()=>n});var r=s(515),a=s(1171),i=s(5832);let n=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)("textarea",{ref:s,className:(0,i.cn)("min-h-[80px] w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground leading-relaxed","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));n.displayName="Textarea"},196:(e,t,s)=>{"use strict";s.d(t,{NeedsHumanList:()=>S});var r=s(515),a=s(4877),i=s(8131),n=s(293),c=s(6819),l=s(9339);let d=(0,s(1330).A)("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var o=s(742),u=s.n(o),h=s(2235),m=s(1171),x=s(9199),p=s(3366),f=s(6644),y=s(395),g=s(5529),b=s(9694),v=s(9214),j=s(739),N=s(8479),k=s(5097);let w=(0,k.createServerReference)("400d3fe629a81919d0d820b9bc711ea1d3d3474715",k.callServer,void 0,k.findSourceMapURL,"requeueJobAction");var A=s(7996);function S({jobs:e}){let t=(0,h.useRouter)(),[,s]=(0,m.useTransition)(),[o,k]=(0,m.useState)(null),[M,R]=(0,m.useState)(null),{success:$,error:z}=(0,N.d)();return(0,r.jsxs)("div",{className:"dd-fade-up",children:[(0,r.jsx)(x.z,{title:"Needs human",subtitle:"Jobs a guardrail paused for review. Nothing risky was written.",icon:a.A}),0===e.length?(0,r.jsx)(g.Zp,{children:(0,r.jsx)(v.p,{icon:i.A,tone:"success",title:"All clear",description:"No jobs are waiting on a human. Drydock will surface anything that hits a guardrail here.",action:(0,r.jsxs)(y.$,{variant:"outline",onClick:()=>t.push("/"),children:[(0,r.jsx)(n.A,{className:"h-[15px] w-[15px]"})," Back to dashboard"]})})}):(0,r.jsx)("div",{className:"dd-stagger flex flex-col gap-3",children:e.map((e,i)=>(0,r.jsxs)(g.Zp,{pad:"none",className:"border-destructive/30",style:{animationDelay:`${60*i}ms`},children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-start gap-3 p-4",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-destructive/10 text-destructive",children:(0,r.jsx)(a.A,{className:"h-[17px] w-[17px]"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)(u(),{href:`/jobs/${e.id}`,className:"flex flex-wrap items-center gap-2 text-left focus-ring rounded",children:[(0,r.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.repoName," #",e.issueNumber]}),(0,r.jsx)(f.E,{tone:"destructive",children:"needs human"}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["\xb7 ",e.attempts," attempts \xb7 ",(0,r.jsx)(j.s,{ts:e.parkedAt})]})]}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground text-pretty",children:e.errorMessage??"No error message recorded."})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2",children:[(0,r.jsxs)(y.$,{variant:"outline",size:"sm",onClick:()=>t.push(`/jobs/${e.id}`),children:[(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"})," Log"]}),(0,r.jsxs)(y.$,{variant:"outline",size:"sm",disabled:o===e.id,onClick:()=>{k(e.id),s(async()=>{try{await w(e.id),$("Job requeued",`${e.repoName} #${e.issueNumber}`),t.refresh()}catch(e){z("Failed to requeue job",e instanceof Error?e.message:String(e))}finally{k(null)}})},children:[(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})," Requeue"]}),(0,r.jsxs)(y.$,{variant:"destructive",size:"sm",disabled:o===e.id,onClick:()=>R(e),children:[(0,r.jsx)(d,{className:"h-3.5 w-3.5"})," Abort"]})]})]}),(0,r.jsx)("div",{className:"border-border/60 border-t px-4 py-3",children:(0,r.jsx)(p.ResumeWithInstructions,{jobId:e.id,label:`${e.repoName} #${e.issueNumber}`})})]},e.id))}),(0,r.jsx)(b.T,{open:null!==M,onOpenChange:e=>!e&&R(null),onConfirm:()=>M&&void(k(M.id),s(async()=>{try{await (0,A.A)(M.id),$("Job aborted",`${M.repoName} #${M.issueNumber}`),t.refresh()}catch(e){z("Failed to abort job",e instanceof Error?e.message:String(e))}finally{k(null)}})),title:"Abort job?",description:M?`This permanently aborts ${M.repoName} #${M.issueNumber}.`:void 0,confirmLabel:"Abort",variant:"destructive",icon:d,pending:null!==o})]})}},293:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},739:(e,t,s)=>{"use strict";s.d(t,{s:()=>n});var r=s(515),a=s(6845),i=s(5832);function n({ts:e,className:t}){let s=(0,a.p)();return(0,r.jsx)("span",{className:t,children:s?(0,i.KW)(e):"…"})}},2235:(e,t,s)=>{"use strict";var r=s(2067);s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},2457:(e,t,s)=>{Promise.resolve().then(s.bind(s,196))},3366:(e,t,s)=>{"use strict";s.d(t,{ResumeWithInstructions:()=>x});var r=s(515);let a=(0,s(1330).A)("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);var i=s(8762),n=s(5378),c=s(2235),l=s(1171),d=s(395),o=s(9),u=s(8479),h=s(5097);let m=(0,h.createServerReference)("60d5637398d15b44490626ec9dbfb9dcbafc153010",h.callServer,void 0,h.findSourceMapURL,"resumeJobWithInstructionAction");function x({jobId:e,label:t,defaultOpen:s=!1,onResumed:h}){let p=(0,c.useRouter)(),{success:f,error:y}=(0,u.d)(),[g,b]=(0,l.useState)(s),[v,j]=(0,l.useState)(""),[N,k]=(0,l.useTransition)(),w=v.trim();function A(){w&&k(async()=>{try{await m(e,w),f("Job resumed with instructions",t),j(""),b(s),h?.(),p.refresh()}catch(e){y("Failed to resume job",e instanceof Error?e.message:String(e))}})}return g?(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,r.jsx)(o.T,{value:v,onChange:e=>j(e.target.value),disabled:N,placeholder:"Tell the agent how to proceed — e.g. “use the existing xByY helper”, “skip the migration, it’s already applied”.","aria-label":"Instructions for the agent",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),A())}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)(d.$,{size:"sm",disabled:N||!w,onClick:A,children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"})," Resume"]}),!s&&(0,r.jsxs)(d.$,{variant:"ghost",size:"sm",disabled:N,onClick:()=>{b(!1),j("")},children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"})," Cancel"]})]})]}):(0,r.jsxs)(d.$,{variant:"outline",size:"sm",onClick:()=>b(!0),children:[(0,r.jsx)(a,{className:"h-3.5 w-3.5"})," Resume with instructions"]})}},4877:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},5097:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return i.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}};for(var a in r)Object.defineProperty(t,a,{enumerable:!0,get:r[a]});let i=s(2258),n=s(7886),c=s(349)},5378:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6003:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},6512:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).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"}]])},6819:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]])},7996:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(5097);let a=(0,r.createServerReference)("4059e24a265e6119e48b22392e63bd485d23f1e520",r.callServer,void 0,r.findSourceMapURL,"abortJobAction")},8131:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},8762:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},9199:(e,t,s)=>{"use strict";s.d(t,{z:()=>d});var r=s(515),a=s(9662),i=s(742),n=s.n(i),c=s(1171),l=s(5832);function d({title:e,subtitle:t,breadcrumb:s,actions:i,icon:o,className:u}){return(0,r.jsxs)("div",{className:(0,l.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",u),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[s&&s.length>0&&(0,r.jsx)("nav",{className:"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:s.map((e,t)=>(0,r.jsxs)(c.Fragment,{children:[t>0&&(0,r.jsx)(a.A,{className:"h-3 w-3 opacity-60","aria-hidden":!0}),e.href?(0,r.jsx)(n(),{href:e.href,className:"rounded transition-colors hover:text-foreground focus-ring",children:e.label}):(0,r.jsx)("span",{className:"text-foreground/80",children:e.label})]},e.href??e.label))}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[o&&(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,r.jsx)(o,{className:"h-[17px] w-[17px]"})}),(0,r.jsx)("h1",{className:"text-pretty text-2xl font-bold tracking-tight",children:e})]}),t&&(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),i&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:i})]})}},9214:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var r=s(515),a=s(5832);let i={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function n({icon:e,tone:t="neutral",title:s,description:c,action:l,secondary:d,className:o,compact:u}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center text-center",u?"py-10":"py-16",o),children:[e&&(0,r.jsx)("div",{className:(0,a.cn)("flex items-center justify-center rounded-2xl",u?"h-12 w-12":"h-16 w-16",i[t]),children:(0,r.jsx)(e,{className:u?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,r.jsx)("h3",{className:"mt-4 text-base font-semibold",children:s}),c&&(0,r.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:c}),(l||d)&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[l,d]})]})}},9339:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},9662:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])}},e=>{e.O(0,[9843,3433,9655,4234,7358],()=>e(e.s=2457)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{296:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},739:(e,t,s)=>{"use strict";s.d(t,{s:()=>i});var r=s(515),a=s(6845),n=s(5832);function i({ts:e,className:t}){let s=(0,a.p)();return(0,r.jsx)("span",{className:t,children:s?(0,n.KW)(e):"…"})}},1104:(e,t,s)=>{Promise.resolve().then(s.bind(s,4917))},1837:(e,t,s)=>{"use strict";s.d(t,{L6:()=>r,UB:()=>a,VJ:()=>i,tT:()=>n});let r=[{id:"claude-opus-4-8",label:"Claude Opus 4.8",agent:"claude"},{id:"claude-fable-5",label:"Claude Fable 5",agent:"claude"},{id:"claude-opus-4-7",label:"Claude Opus 4.7",agent:"claude"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",agent:"claude"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",agent:"claude"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",agent:"claude"},{id:"gpt-5-codex",label:"GPT-5 Codex",agent:"codex"},{id:"gpt-5",label:"GPT-5",agent:"codex"},{id:"gpt-5-mini",label:"GPT-5 Mini",agent:"codex"}],a="claude-opus-4-8";function n(e){return r.filter(t=>t.agent===e)}function i(e){return"openrouter"===e?"":n(e)[0]?.id??a}},2718:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]])},2836:(e,t,s)=>{"use strict";s.d(t,{Sparkline:()=>i});var r=s(515),a=s(1171),n=s(4497);function i({data:e,width:t=132,height:s=36,tone:l="chart-1",fill:d=!0,strokeWidth:o=1.75,average:c=!1}){let u=`sp${(0,a.useId)().replace(/:/g,"")}`;if(0===e.length)return null;let x=Math.min(...e),m=Math.max(...e)-x||1,h=e.length>1?t/(e.length-1):t,p=e.map((e,t)=>[t*h,s-3-(e-x)/m*(s-6)]),g=p.map((e,t)=>`${t?"L":"M"}${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(" "),f=`${g} L${t} ${s} L0 ${s} Z`,j=(0,n.U)(l),b=p[p.length-1]??[0,s-3],v=s-3-(e.reduce((e,t)=>e+t,0)/e.length-x)/m*(s-6);return(0,r.jsxs)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:"overflow-visible","aria-hidden":"true",children:[d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:u,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:"0.22"}),(0,r.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:"0"})]})}),(0,r.jsx)("path",{d:f,fill:`url(#${u})`})]}),c&&e.length>1&&(0,r.jsx)("line",{x1:0,x2:t,y1:v,y2:v,stroke:"hsl(var(--muted-foreground) / 0.45)",strokeWidth:1,strokeDasharray:"3 3"}),(0,r.jsx)("path",{d:g,fill:"none",stroke:j,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("circle",{cx:b[0],cy:b[1],r:2.5,fill:j})]})}},3798:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},4266:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4276:(e,t,s)=>{"use strict";s.d(t,{h:()=>d});var r=s(515),a=s(6512),n=s(5832),i=s(5172);let l={neutral:{chip:"bg-secondary text-muted-foreground",val:"text-foreground",bg:""},primary:{chip:"bg-primary/15 text-primary",val:"text-primary",bg:"bg-primary/[0.04]"},success:{chip:"bg-success-muted text-success",val:"text-success",bg:"bg-success/[0.05]"},warning:{chip:"bg-warning-muted text-warning",val:"text-warning",bg:"bg-warning/[0.05]"},destructive:{chip:"bg-destructive/15 text-destructive",val:"text-destructive",bg:"bg-destructive/[0.05]"}};function d({icon:e,label:t,value:s,sub:o,tone:c="neutral",active:u,onClick:x,hint:m}){let h=!!u&&"neutral"!==c,p=l[c],g=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:(0,n.cn)("flex h-8 w-8 items-center justify-center rounded-lg transition-colors",h?p.chip:"bg-secondary text-muted-foreground"),children:e&&(0,r.jsx)(e,{className:"h-4 w-4"})}),m&&(0,r.jsx)("span",{className:"text-muted-foreground/60",children:(0,r.jsx)(i.m,{content:m,children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:(0,n.cn)("text-2xl font-semibold tnum tracking-tight",h?p.val:"text-foreground"),children:s}),(0,r.jsx)("div",{className:"mt-0.5 text-[13px] font-medium text-muted-foreground",children:t}),o&&(0,r.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground/80",children:o})]})]}),f=(0,n.cn)("group relative flex flex-col gap-3 rounded-xl border border-card-border bg-card p-4 text-left shadow-sm transition-colors",h&&p.bg,x&&"hover-elevate focus-ring");return x?(0,r.jsx)("button",{type:"button",onClick:x,className:f,children:g}):(0,r.jsx)("div",{className:f,children:g})}},4393:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},4497:(e,t,s)=>{"use strict";function r(e){return e?`hsl(var(--${e}))`:"hsl(var(--muted-foreground))"}s.d(t,{U:()=>r})},4783:(e,t,s)=>{"use strict";s.d(t,{F:()=>x,W:()=>m});var r=s(515),a=s(6512),n=s(8131),i=s(4877),l=s(5662),d=s(5529),o=s(9214),c=s(5832);let u={info:{cls:"border-primary/30 bg-primary/5 text-foreground",icon:a.A,ic:"text-primary"},success:{cls:"border-success-border bg-success-muted text-foreground",icon:n.A,ic:"text-success"},warning:{cls:"border-warning-border bg-warning-muted text-foreground",icon:i.A,ic:"text-warning"},destructive:{cls:"border-destructive/30 bg-destructive/5 text-foreground",icon:l.A,ic:"text-destructive"}};function x({tone:e="info",title:t,children:s,action:a,icon:n,className:i}){let l=u[e],d=n??l.icon;return(0,r.jsxs)("div",{className:(0,c.cn)("flex gap-3 rounded-xl border p-4",l.cls,i),role:"alert",children:[(0,r.jsx)(d,{className:(0,c.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",l.ic)}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[t&&(0,r.jsx)("p",{className:"text-sm font-semibold",children:t}),s&&(0,r.jsx)("div",{className:"mt-0.5 text-pretty text-sm text-muted-foreground",children:s})]}),a&&(0,r.jsx)("div",{className:"shrink-0",children:a})]})}function m({title:e="Something went wrong",description:t,action:s,className:a}){return(0,r.jsx)(d.Zp,{className:(0,c.cn)("border-destructive/30",a),children:(0,r.jsx)(o.p,{icon:l.A,tone:"destructive",title:e,description:t,action:s})})}},4917:(e,t,s)=>{"use strict";s.d(t,{DashboardLive:()=>el});var r=s(515),a=s(296),n=s(1330);let i=(0,n.A)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var l=s(6512),d=s(2235),o=s(1171);let c=(0,n.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=s(5378),x=s(4266),m=s(6644),h=s(395),p=s(7901),g=s(5097);let f=(0,g.createServerReference)("40196e07b942547e18f0601c98ad514e690f1c47fa",g.callServer,void 0,g.findSourceMapURL,"browseDirectoryAction");function j({onSelect:e,onClose:t}){let[s,a]=(0,o.useState)(null),[n,l]=(0,o.useTransition)(),d=e=>l(async()=>a(await f(e)));return(0,o.useEffect)(()=>{d()},[]),(0,r.jsx)(p.l,{open:!0,onClose:t,labelledById:"dir-picker-title",children:(0,r.jsxs)("div",{className:"flex max-h-[70vh] flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-card-border pb-3",children:[(0,r.jsxs)("span",{id:"dir-picker-title",className:"flex items-center gap-2 text-base font-semibold tracking-tight",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,r.jsx)(c,{className:"h-[18px] w-[18px]"})}),"Choose a folder"]}),(0,r.jsx)(h.$,{size:"icon-sm",variant:"ghost","aria-label":"Close",onClick:t,children:(0,r.jsx)(u.A,{})})]}),(0,r.jsxs)("div",{className:"border-b border-card-border py-3",children:[(0,r.jsx)("p",{className:"truncate font-mono text-xs text-muted-foreground",title:s?.path,children:s?.path??"…"}),s?.isGitRepo&&(0,r.jsxs)(m.E,{tone:"success",className:"mt-1.5",children:[(0,r.jsx)(i,{className:"h-3 w-3"}),"git repo"]})]}),(0,r.jsxs)("div",{className:"scrollbar-none min-h-0 flex-1 overflow-auto py-2",children:[s?.parent&&(0,r.jsxs)("button",{type:"button",disabled:n,onClick:()=>d(s.parent??void 0),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover-elevate disabled:opacity-50",children:[(0,r.jsx)(c,{className:"h-4 w-4 text-muted-foreground"}),".."]}),s?.entries.map(e=>(0,r.jsxs)("button",{type:"button",disabled:n,onClick:()=>d(e.path),className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-sm hover-elevate disabled:opacity-50",children:[(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[e.isGitRepo?(0,r.jsx)(i,{className:"h-4 w-4 shrink-0 text-primary"}):(0,r.jsx)(c,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"truncate",children:e.name})]}),e.isGitRepo&&(0,r.jsx)(m.E,{tone:"success",children:"git"})]},e.path)),s&&0===s.entries.length&&(0,r.jsx)("p",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No subfolders."})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-card-border pt-3",children:[(0,r.jsx)(h.$,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),(0,r.jsxs)(h.$,{size:"sm",disabled:!s||n,onClick:()=>s&&e(s.path),children:[(0,r.jsx)(x.A,{}),"Use this folder"]})]})]})})}var b=s(8067);let v={github:{id:"github",label:"GitHub",needsConnection:!1},gitlab:{id:"gitlab",label:"GitLab",needsConnection:!0}},y=["github","gitlab"].map(e=>v[e]);function w({value:e,onChange:t,id:s,className:a}){return(0,r.jsx)(b.l,{id:s,value:e,onChange:e=>t(e.target.value),className:a,children:y.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}var N=s(9754),k=s(5529),A=s(7217),$=s(7405),C=s(1837);let S=(0,g.createServerReference)("40328ee6b94d3714897e8dc923d8ac524f3b739202",g.callServer,void 0,g.findSourceMapURL,"detectDefaultBranchAction"),M=(0,g.createServerReference)("40aee73460344615dd6abf795f8eee1a3244be843e",g.callServer,void 0,g.findSourceMapURL,"addRepoAction");function R({onDone:e}){let[t,s]=(0,o.useTransition)(),[n,l]=(0,o.useState)(""),[d,c]=(0,o.useState)(""),[u,x]=(0,o.useState)(C.UB),[m,p]=(0,o.useState)("github"),[g,f]=(0,o.useState)(""),[b,v]=(0,o.useState)(""),[y,F]=(0,o.useState)(""),L=(0,o.useRef)(!1),E=(0,o.useRef)(0),[T,D]=(0,o.useState)(!1);function U(e){let t=e.trim();if(L.current||!t)return;let r=++E.current;s(async()=>{let e=await S(t);L.current||r!==E.current||F(e)})}return(0,r.jsxs)(k.Zp,{className:"dd-fade-up p-5",children:[(0,r.jsxs)("form",{className:"grid gap-4 sm:grid-cols-2",action:()=>{s(async()=>{await M({path:d,name:n,defaultModel:u,platform:m,defaultBranch:y.trim()||void 0,apiBaseUrl:"gitlab"===m&&g.trim()||null,apiToken:"gitlab"===m&&b.trim()||null}),e()})},children:[(0,r.jsx)(A.D,{label:"Name",htmlFor:"repo-name",children:(0,r.jsx)($.p,{id:"repo-name",value:n,onChange:e=>l(e.target.value),placeholder:"my-project",required:!0})}),(0,r.jsx)(A.D,{label:"Local path",htmlFor:"repo-path",hint:"Drydock watches this working copy and runs the agent in an isolated worktree.",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(i,{className:"pointer-events-none absolute left-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)($.p,{id:"repo-path",value:d,onChange:e=>c(e.target.value),onBlur:e=>U(e.target.value),placeholder:"/abs/path/to/repo",required:!0,className:"pl-9 font-mono"})]}),(0,r.jsx)(h.$,{type:"button",variant:"outline",size:"sm",onClick:()=>D(!0),children:"Browse…"})]})}),(0,r.jsx)(A.D,{label:"Default model",htmlFor:"repo-model",children:(0,r.jsx)(N.o,{id:"repo-model",value:u,onChange:x})}),(0,r.jsx)(A.D,{label:"Forge",htmlFor:"repo-platform",children:(0,r.jsx)(w,{id:"repo-platform",value:m,onChange:p})}),(0,r.jsx)(A.D,{label:"Default branch",htmlFor:"repo-default-branch",hint:"Auto-detected from the clone; the base for worktrees and PRs.",children:(0,r.jsx)($.p,{id:"repo-default-branch",value:y,onChange:e=>{L.current=!0,F(e.target.value)},placeholder:"main",className:"font-mono"})}),"gitlab"===m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.D,{label:"API base URL",htmlFor:"repo-api-url",className:"sm:col-span-2",children:(0,r.jsx)($.p,{id:"repo-api-url",value:g,onChange:e=>f(e.target.value),placeholder:"https://gitlab.com"})}),(0,r.jsx)(A.D,{label:"Access token",htmlFor:"repo-api-token",hint:"Stored locally on this machine.",className:"sm:col-span-2",children:(0,r.jsx)($.p,{id:"repo-api-token",value:b,onChange:e=>v(e.target.value),type:"password",placeholder:"Access token"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:col-span-2",children:[(0,r.jsxs)(h.$,{type:"submit",disabled:t||!d,children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add repository"]}),(0,r.jsx)(h.$,{type:"button",variant:"ghost",onClick:e,children:"Cancel"})]})]}),T&&(0,r.jsx)(j,{onClose:()=>D(!1),onSelect:e=>{c(e),n.trim()||l(e.replace(/\/+$/,"").split("/").pop()??""),U(e),D(!1)}})]})}var F=s(4913),L=s(9583),E=s(2718);let T=(0,n.A)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]),D=(0,n.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var U=s(4877),H=s(2414),z=s(4276),q=s(5832);function G({summary:e}){let t=(0,d.useRouter)();return(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:[(0,r.jsx)(z.h,{icon:i,label:"Repositories",value:e.repos}),(0,r.jsx)(z.h,{icon:E.A,label:"Queued",value:e.queued,tone:"primary",active:e.queued>0}),(0,r.jsx)(z.h,{icon:T,label:"Running",value:e.running,tone:"primary",active:e.running>0}),(0,r.jsx)(z.h,{icon:D,label:"Merged",value:e.merged,tone:"success",active:!0}),(0,r.jsx)(z.h,{icon:U.A,label:"Needs human",value:e.needsHuman,tone:"destructive",active:e.needsHuman>0,onClick:()=>t.push("/needs-human"),hint:"Jobs that hit a guardrail and paused for review."}),(0,r.jsx)(z.h,{icon:H.A,label:"Spend today",value:(0,q.UK)(e.spendToday),tone:"primary",active:!0,sub:"across all repos"})]})}var V=s(9199);let B=(0,n.A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]),O=(0,n.A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);var I=s(742),P=s.n(I),Z=s(9694),_=s(739),W=s(8479);let J=(0,g.createServerReference)("4054080db167d1cf1abb31c2d68ee13cfd3f079979",g.callServer,void 0,g.findSourceMapURL,"removeRepoAction");function K({repo:e}){let[t,s]=(0,o.useTransition)(),[a,n]=(0,o.useState)(!1),{success:l,error:d}=(0,W.d)(),c=e.working+e.ciRunning>0;return(0,r.jsxs)(k.Zp,{hover:!0,className:(0,q.cn)("flex flex-col gap-3 p-4",e.attention&&"border-destructive/40 bg-destructive/[0.04]"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)(P(),{href:`/repos/${e.id}`,className:"group flex min-w-0 items-center gap-2 rounded-md text-left focus-ring",children:[(0,r.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-secondary text-muted-foreground",children:(0,r.jsx)(i,{className:"h-[15px] w-[15px]"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block truncate font-mono text-sm font-semibold group-hover:underline",children:e.name}),(0,r.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.path})]})]}),e.attention?(0,r.jsxs)(m.E,{tone:"destructive",className:"shrink-0",children:[(0,r.jsx)(U.A,{className:"h-[11px] w-[11px]"})," Needs human"]}):c?(0,r.jsx)(m.E,{status:"working",className:"shrink-0",children:"Active"}):(0,r.jsx)(m.E,{tone:"neutral",className:"shrink-0",children:"Idle"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:["gitlab"===e.platform&&(0,r.jsx)(m.E,{tone:"primary",children:"GitLab"}),(0,r.jsxs)(m.E,{tone:"neutral",children:[e.queued," queued"]}),e.working>0?(0,r.jsxs)(m.E,{status:"working",children:[e.working," working"]}):(0,r.jsx)(m.E,{tone:"neutral",children:"0 working"}),e.ciRunning>0?(0,r.jsxs)(m.E,{status:"ci_running",children:[e.ciRunning," CI"]}):(0,r.jsx)(m.E,{tone:"neutral",children:"0 CI"}),e.needsHuman>0&&(0,r.jsxs)(m.E,{tone:"destructive",children:[e.needsHuman," needs human"]})]}),e.inFlight.length>0&&(0,r.jsx)("ul",{className:"flex flex-col gap-1 border-t border-card-border pt-2.5 text-xs",children:e.inFlight.slice(0,3).map(e=>(0,r.jsxs)("li",{className:"flex items-center gap-2",children:[(0,r.jsx)(m.E,{status:e.status,className:"shrink-0 px-1.5 py-0"}),(0,r.jsx)(P(),{href:`/jobs/${e.id}`,className:"truncate text-muted-foreground transition-colors hover:text-foreground",children:(0,r.jsxs)("span",{className:"font-mono text-foreground/80",children:["#",e.issueNumber]})})]},e.id))}),(0,r.jsxs)("div",{className:"mt-auto flex items-center justify-between border-t border-card-border pt-2.5 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(H.A,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"tnum text-foreground/90",children:(0,q.UK)(e.todaySpend)})," today"]}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(B,{className:"h-3 w-3"}),(0,r.jsx)(_.s,{ts:e.lastActivityAt})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(P(),{href:`/repos/${e.id}`,children:(0,r.jsx)(h.$,{size:"sm",children:"Open workspace"})}),(0,r.jsx)(h.$,{size:"sm",variant:"ghost",disabled:t,onClick:()=>n(!0),"aria-label":"Remove repository",children:(0,r.jsx)(O,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)(Z.T,{open:a,onOpenChange:n,onConfirm:function(){s(async()=>{try{await J(e.id),l("Repository removed",e.name)}catch(e){d("Failed to remove repository",e instanceof Error?e.message:String(e))}})},title:"Remove repository?",description:`This stops watching ${e.name} and deletes its local job history. Repos with active jobs cannot be removed — abort or finish them first.`,confirmLabel:"Remove",variant:"destructive",pending:t})]})}var Q=s(4783),X=s(4497);function Y({value:e,limit:t,size:s=132,label:a="Spend today"}){let n=t>0?Math.min(e/t,1):0,i=t<=0,l=t>0&&e>=t,d=(0,X.U)(l||n>=.95?"destructive":n>=.8?"warning":"primary"),o=(s-18)/2,c=2*Math.PI*o,u=.75*c,x=s/2;return(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsxs)("div",{className:"relative",style:{width:s,height:.82*s},children:[(0,r.jsxs)("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,style:{transform:"rotate(135deg)"},role:"img","aria-label":i?`${a}: $${e.toFixed(2)}, no daily limit`:`${a}: $${e.toFixed(2)} of $${t.toFixed(0)} limit`,children:[(0,r.jsx)("circle",{cx:x,cy:x,r:o,fill:"none",stroke:"hsl(var(--secondary))",strokeWidth:9,strokeDasharray:`${u} ${c}`,strokeLinecap:"round"}),(0,r.jsx)("circle",{cx:x,cy:x,r:o,fill:"none",stroke:d,strokeWidth:9,strokeDasharray:`${u*n} ${c}`,strokeLinecap:"round"})]}),(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pb-1",children:[(0,r.jsxs)("span",{className:"tnum text-[26px] font-semibold leading-none",style:{color:d},children:["$",e.toFixed(2)]}),(0,r.jsx)("span",{className:"mt-1 text-xs text-muted-foreground tnum",children:i?"Unlimited":`of $${t.toFixed(0)} limit`})]})]}),(0,r.jsx)("div",{className:"mt-1 flex items-center gap-1.5 text-xs",children:l?(0,r.jsx)(m.E,{tone:"destructive",children:"Limit reached"}):n>=.8?(0,r.jsxs)(m.E,{tone:"warning",children:[Math.round(100*n),"% used"]}):(0,r.jsxs)("span",{className:"text-muted-foreground",children:[a,t>0&&(0,r.jsxs)(r.Fragment,{children:[" \xb7 ",Math.round(100*n),"% of budget"]})]})})]})}var ee=s(9214),et=s(2836),es=s(5172);let er=null,ea=!1;function en(){let e;if(er)return er;let t=(e=window).AudioContext??e.webkitAudioContext;return t?er=new t:null}function ei(e,t,s,r){let a=e.createOscillator(),n=e.createGain();a.type="sine",a.frequency.value=t,n.gain.setValueAtTime(1e-4,s),n.gain.exponentialRampToValueAtTime(.18,s+.02),n.gain.exponentialRampToValueAtTime(1e-4,s+r),a.connect(n).connect(e.destination),a.start(s),a.stop(s+r)}function el({initial:e,spend7d:t,soundEnabled:s=!0}){let n=(0,d.useRouter)(),{toast:c}=(0,W.d)(),[u,x]=(0,o.useState)(e),[m,p]=(0,o.useState)(!1),g=(0,o.useRef)(new Set(e.needsHumanJobs.map(e=>e.id))),f=(0,o.useRef)(s);f.current=s;let j=(0,o.useRef)(c);j.current=c,(0,o.useEffect)(()=>{!function(){if(ea)return;ea=!0;let e=()=>{en()?.resume().catch(()=>{}),window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",e)};window.addEventListener("pointerdown",e),window.addEventListener("keydown",e)}();let e=new EventSource("/api/sse/dashboard");return e.addEventListener("snapshot",e=>{var t;let s,r;try{s=JSON.parse(e.data)}catch{return}x(s);let a=s.needsHumanJobs??[],n=(t=g.current,r=new Set(t),a.filter(e=>!r.has(e.id)));for(let e of a)g.current.add(e.id);if(0!==n.length)for(let e of(f.current&&function(){let e=en();if(e?.state!=="running")return;let t=e.currentTime;ei(e,660,t,.18),ei(e,880,t+.16,.22)}(),n))j.current({title:`${e.repoName} #${e.issueNumber} needs a human`,description:"A guardrail paused work before anything risky was written.",variant:"error",href:`/jobs/${e.id}`}),function(e){let t="Notification"in window;if(t&&function({supported:e,permission:t,hidden:s}){return e&&"granted"===t&&s}({supported:t,permission:Notification.permission,hidden:"u">typeof document&&document.hidden}))try{let t=new Notification(`${e.repoName} #${e.issueNumber} needs a human`,{body:"A guardrail paused work before anything risky was written.",tag:`needs-human-${e.id}`});t.onclick=()=>{window.focus(),window.location.assign(`/jobs/${e.id}`),t.close()}}catch{}}(e)}),()=>e.close()},[]);let{repos:b,summary:v}=u,y=0===b.length,w=b.some(e=>(e.dailyLimitUsd??10)<=0)?0:Math.max(b.reduce((e,t)=>e+(t.dailyLimitUsd??10),0),v.spendToday,10),N=t&&t.length>0?[...t.slice(0,-1),v.spendToday]:[v.spendToday];return(0,r.jsxs)("div",{className:"dd-fade-up",children:[(0,r.jsx)(V.z,{title:"Dashboard",subtitle:"Every watched repository, its in-flight work, and today's spend — live.",actions:(0,r.jsx)(h.$,{onClick:()=>p(e=>!e),children:m?"Cancel":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add repo"]})})}),(0,r.jsx)(G,{summary:v}),(0,r.jsxs)("div",{className:"mt-6 grid gap-6 lg:grid-cols-3",children:[(0,r.jsxs)("div",{className:"lg:col-span-2",children:[(0,r.jsx)("div",{className:"mb-3 flex items-center justify-between",children:(0,r.jsxs)("h2",{className:"text-base font-semibold",children:["Repositories"," ",(0,r.jsxs)("span",{className:"font-normal text-muted-foreground",children:["(",b.length,")"]})]})}),m&&(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(R,{onDone:()=>p(!1)})}),y&&!m?(0,r.jsx)(k.Zp,{children:(0,r.jsx)(ee.p,{icon:i,tone:"primary",title:"No repositories yet",description:"Add a local repository and Drydock will start turning its labelled issues into pull requests.",action:(0,r.jsxs)(h.$,{onClick:()=>p(!0),children:[(0,r.jsx)(a.A,{className:"h-[15px] w-[15px]"})," Add your first repo"]})})}):(0,r.jsx)("div",{className:"dd-stagger grid gap-3 sm:grid-cols-2",children:b.map((e,t)=>(0,r.jsx)("div",{style:{animationDelay:`${50*t}ms`},children:(0,r.jsx)(K,{repo:e})},e.id))})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)(k.Zp,{pad:"lg",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-base font-semibold",children:"Daily budget"}),(0,r.jsx)(es.m,{content:"Combined spend today against the sum of per-repo daily limits. Turns amber at 80%, red near the cap.",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),(0,r.jsx)("div",{className:"mt-2 flex justify-center",children:(0,r.jsx)(Y,{value:v.spendToday,limit:w})}),(0,r.jsxs)("div",{className:"mt-4 border-t border-card-border pt-3",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:"Spend \xb7 last 7 days"}),(0,r.jsxs)("span",{className:"tnum text-foreground/80",children:[(0,q.UK)(v.spendToday)," today"]})]}),(0,r.jsx)(et.Sparkline,{data:N,width:300,height:44,tone:"chart-1",average:!0})]})]}),(0,r.jsx)(F.C,{view:u.claudeUsage}),(0,r.jsx)(L.L,{view:u.codexUsage}),v.needsHuman>0?(0,r.jsx)(Q.F,{tone:"destructive",title:`${v.needsHuman} ${1===v.needsHuman?"job needs":"jobs need"} a human`,action:(0,r.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>n.push("/needs-human"),children:"Review"}),children:"A guardrail paused work before anything risky was written."}):(0,r.jsx)(Q.F,{tone:"success",title:"All clear",children:"No jobs are waiting on a human right now."})]})]})]})}},5172:(e,t,s)=>{"use strict";s.d(t,{V:()=>d,m:()=>l});var r=s(515),a=s(4393),n=s(5832);let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",right:"left-full top-1/2 -translate-y-1/2 ml-2",left:"right-full top-1/2 -translate-y-1/2 mr-2"};function l({content:e,children:t,side:s="top",className:a}){return(0,r.jsxs)("span",{className:"group/tt relative inline-flex",children:[t,(0,r.jsx)("span",{role:"tooltip",className:(0,n.cn)("pointer-events-none absolute z-50 w-max max-w-[260px] rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs leading-relaxed text-popover-foreground shadow-lg","translate-y-0.5 opacity-0 transition-all duration-150 group-focus-within/tt:opacity-100 group-hover/tt:translate-y-0 group-hover/tt:opacity-100",i[s],a),children:e})]})}function d({content:e,side:t="top"}){return(0,r.jsx)(l,{content:e,side:t,children:(0,r.jsx)("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground focus-ring","aria-label":"Help",children:(0,r.jsx)(a.A,{className:"h-3.5 w-3.5"})})})}},5662:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("octagon-alert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]])},7217:(e,t,s)=>{"use strict";s.d(t,{D:()=>i});var r=s(515),a=s(5832);function n({htmlFor:e,className:t,children:s}){return(0,r.jsx)("label",{htmlFor:e,className:(0,a.cn)("text-sm font-medium text-foreground",t),children:s})}function i({label:e,hint:t,htmlFor:s,children:l,className:d}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",d),children:[e&&(0,r.jsx)(n,{htmlFor:s,children:e}),l,t&&(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},7405:(e,t,s)=>{"use strict";s.d(t,{p:()=>i});var r=s(515),a=s(1171),n=s(5832);let i=a.forwardRef(({className:e,...t},s)=>(0,r.jsx)("input",{ref:s,className:(0,n.cn)("h-9 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground","placeholder:text-muted-foreground transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t}));i.displayName="Input"},8067:(e,t,s)=>{"use strict";s.d(t,{l:()=>l});var r=s(515),a=s(3798),n=s(1171),i=s(5832);let l=n.forwardRef(({className:e,children:t,...s},n)=>(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("select",{ref:n,className:(0,i.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...s,children:t}),(0,r.jsx)(a.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));l.displayName="Select"},9199:(e,t,s)=>{"use strict";s.d(t,{z:()=>o});var r=s(515),a=s(9662),n=s(742),i=s.n(n),l=s(1171),d=s(5832);function o({title:e,subtitle:t,breadcrumb:s,actions:n,icon:c,className:u}){return(0,r.jsxs)("div",{className:(0,d.cn)("mb-6 flex flex-wrap items-end justify-between gap-4",u),children:[(0,r.jsxs)("div",{className:"min-w-0",children:[s&&s.length>0&&(0,r.jsx)("nav",{className:"mb-1.5 flex items-center gap-1.5 text-xs text-muted-foreground",children:s.map((e,t)=>(0,r.jsxs)(l.Fragment,{children:[t>0&&(0,r.jsx)(a.A,{className:"h-3 w-3 opacity-60","aria-hidden":!0}),e.href?(0,r.jsx)(i(),{href:e.href,className:"rounded transition-colors hover:text-foreground focus-ring",children:e.label}):(0,r.jsx)("span",{className:"text-foreground/80",children:e.label})]},e.href??e.label))}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[c&&(0,r.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,r.jsx)(c,{className:"h-[17px] w-[17px]"})}),(0,r.jsx)("h1",{className:"text-pretty text-2xl font-bold tracking-tight",children:e})]}),t&&(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),n&&(0,r.jsx)("div",{className:"flex items-center gap-2",children:n})]})}},9214:(e,t,s)=>{"use strict";s.d(t,{p:()=>i});var r=s(515),a=s(5832);let n={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function i({icon:e,tone:t="neutral",title:s,description:l,action:d,secondary:o,className:c,compact:u}){return(0,r.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center text-center",u?"py-10":"py-16",c),children:[e&&(0,r.jsx)("div",{className:(0,a.cn)("flex items-center justify-center rounded-2xl",u?"h-12 w-12":"h-16 w-16",n[t]),children:(0,r.jsx)(e,{className:u?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,r.jsx)("h3",{className:"mt-4 text-base font-semibold",children:s}),l&&(0,r.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:l}),(d||o)&&(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[d,o]})]})}},9662:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(1330).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},9754:(e,t,s)=>{"use strict";s.d(t,{o:()=>i});var r=s(515),a=s(8067),n=s(1837);function i({value:e,onChange:t,agent:s,openrouterModels:l=[],id:d,className:o}){if("openrouter"===s)return(0,r.jsxs)(a.l,{id:d,value:e,onChange:e=>t(e.target.value),className:o,children:[0===l.length&&(0,r.jsx)("option",{value:"",disabled:!0,children:"No synced models — refresh the catalog in Settings"}),l.length>0&&""!==e&&!l.some(t=>t.id===e)&&(0,r.jsxs)("option",{value:e,disabled:!0,children:[e," (no longer in catalog)"]}),l.map(e=>(0,r.jsx)("option",{value:e.id,children:e.isFree?`${e.label} (free)`:e.label},e.id))]});let c=s?(0,n.tT)(s):n.L6;return(0,r.jsx)(a.l,{id:d,value:e,onChange:e=>t(e.target.value),className:o,children:c.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))})}}},e=>{e.O(0,[9843,8264,3433,5080,9655,4234,7358],()=>e(e.s=1104)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[942],{297:(e,t,r)=>{"use strict";r.d(t,{m:()=>n});var s=r(5097);let n=(0,s.createServerReference)("40351ea90748f20b6ea53d3973d2f011d8331ea1fe",s.callServer,void 0,s.findSourceMapURL,"saveTemplateAction")},395:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var s=r(515),n=r(1171),a=r(5832);let i={default:"bg-primary text-primary-foreground shadow-sm hover-elevate active-elevate-2",secondary:"bg-secondary text-secondary-foreground hover-elevate active-elevate-2",outline:"border border-border bg-transparent shadow-sm hover-elevate active-elevate-2",destructive:"bg-destructive text-destructive-foreground shadow-sm hover-elevate active-elevate-2",ghost:"border border-transparent hover-elevate active-elevate-2",success:"bg-success text-white shadow-sm hover-elevate active-elevate-2"},o={default:"h-9 px-4 py-2 rounded-lg text-sm",sm:"h-8 px-3 rounded-md text-xs",lg:"h-10 px-6 rounded-lg text-sm",icon:"h-9 w-9 rounded-lg","icon-sm":"h-8 w-8 rounded-md"},l=n.forwardRef(({className:e,variant:t="default",size:r="default",type:n="button",...l},d)=>(0,s.jsx)("button",{ref:d,type:n,className:(0,a.cn)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i[t],o[r],e),...l}));l.displayName="Button"},598:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var s=r(515),n=r(8108),a=r(5832);function i({size:e=16,className:t}){return(0,s.jsx)(n.A,{width:e,height:e,className:(0,a.cn)("dd-spin",t),"aria-hidden":!0})}},1417:(e,t,r)=>{"use strict";r.d(t,{PromptEditor:()=>$});var s=r(515),n=r(9919),a=r(3372),i=r(5378),o=r(9339),l=r(4847),d=r(6473),c=r(6106),u=r(1171),m=r(6644),x=r(395),f=r(5529),p=r(9214),h=r(7217),v=r(5897),g=r(8067),b=r(598),N=r(8479),j=r(6615),w=r(297),y=r(2801);let S=["$ISSUE_NUM","$ISSUE_TITLE","$ISSUE_BODY","$BRANCH","$REPO_NAME","$CI_LOG","$PR_FORMAT","$INSTRUCTION","$DEFAULT_BRANCH"];var _=r(5832);let R=[{value:y._.main,label:"Main"},{value:y._.prFormat,label:"PR format"},{value:y._.ciFix,label:"CI fix"},{value:y._.plan,label:"Plan"},{value:y._.limitResume,label:"Limit resume"},{value:y._.turnResume,label:"Turn resume"},{value:y._.humanResume,label:"Human resume"}];function E(e){return new Date(1e3*e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function $({repos:e,initialContent:t,initialVersions:r}){let[A,C]=(0,u.useState)(t),[I,T]=(0,u.useState)(e[0]?.id??0),[U,M]=(0,u.useState)(y._.main),[O,k]=(0,u.useState)(r),[D,B]=(0,u.useTransition)(),[F,L]=(0,u.useState)(null),[P,H]=(0,u.useState)(null),{success:z,error:Z}=(0,N.d)();function Y(e,t){B(async()=>{try{let r=await (0,j.v)(e,t);C(r.content),k(r.versions),L(null),H(null)}catch(e){Z("Failed to load template",e instanceof Error?e.message:String(e))}})}let G=function(e,t){let r={$ISSUE_NUM:void 0!==t.ISSUE_NUM?String(t.ISSUE_NUM):"$ISSUE_NUM",$ISSUE_TITLE:t.ISSUE_TITLE??"$ISSUE_TITLE",$ISSUE_BODY:t.ISSUE_BODY??"$ISSUE_BODY",$BRANCH:t.BRANCH??"$BRANCH",$REPO_NAME:t.REPO_NAME??"$REPO_NAME",$CI_LOG:t.CI_LOG??"$CI_LOG",$PR_FORMAT:t.PR_FORMAT??"$PR_FORMAT",$INSTRUCTION:t.INSTRUCTION??"$INSTRUCTION",$DEFAULT_BRANCH:t.DEFAULT_BRANCH??"$DEFAULT_BRANCH"},s=e;for(let e of[...S].sort((e,t)=>t.length-e.length))s=s.split(e).join(r[e]??e);return s}(A,{ISSUE_NUM:42,ISSUE_TITLE:"Example issue title",ISSUE_BODY:"Example issue body with the full context the agent needs.",BRANCH:"fix/issue-42",REPO_NAME:"acme",CI_LOG:"example CI failure output",PR_FORMAT:"TL;DR of the change.\n\n## Problem\n…\n\n## Solution\n…",INSTRUCTION:"Use the existing xByY helper instead of adding a new one."});return(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(f.Zp,{pad:"none",children:[(0,s.jsxs)(f.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)(f.ZB,{children:"Editor"}),D&&(0,s.jsx)(b.y,{size:16,className:"text-muted-foreground"})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Variables:"," ",(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:S.join(", ")})]})]}),(0,s.jsxs)(f.Wu,{className:"space-y-3 px-5 pb-5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,s.jsx)(h.D,{label:"Repository",htmlFor:"prompt-repo",className:"min-w-[180px] flex-1",children:(0,s.jsx)(g.l,{id:"prompt-repo","aria-label":"Repository",value:I,onChange:e=>{let t=Number(e.target.value);T(t),Y(t,U)},children:e.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,s.jsx)(h.D,{label:"Template",children:(0,s.jsx)(v.I,{value:U,onChange:e=>{M(e),Y(I,e)},options:R})})]}),P?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-card-border bg-secondary/50 px-3 py-2 text-xs text-muted-foreground",children:[(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,s.jsxs)("span",{children:["Diffing"," ",(0,s.jsxs)("span",{className:"font-medium text-foreground",children:["v",P.version]})," (",E(P.updatedAt),") vs active"]}),(0,s.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 rounded transition-colors hover:text-foreground focus-ring",onClick:()=>H(null),children:[(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),"Close diff"]})]}),(0,s.jsx)("div",{className:"h-72 overflow-hidden rounded-lg border border-card-border",children:(0,s.jsx)(n.zC,{language:"markdown",original:P.content,modified:A,options:{minimap:{enabled:!1},fontSize:13,readOnly:!0,renderSideBySide:!0}})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(x.$,{variant:"ghost",size:"sm",onClick:()=>H(null),children:"Cancel"}),(0,s.jsxs)(x.$,{disabled:D,variant:"outline",size:"sm",onClick:function(){P&&B(async()=>{try{let e=await (0,w.m)({repoId:I,name:U,content:P.content});L(e.version);let t=await (0,j.v)(I,U);C(t.content),k(t.versions),H(null),z("Version restored",`Saved as v${e.version}`)}catch(e){Z("Failed to restore version",e instanceof Error?e.message:String(e))}})},children:[(0,s.jsx)(o.A,{className:"h-4 w-4"}),"Restore v",P.version]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"h-72 overflow-hidden rounded-lg border border-card-border",children:(0,s.jsx)(n.Ay,{defaultLanguage:"markdown",value:A,onChange:e=>C(e??""),options:{minimap:{enabled:!1},fontSize:13}})}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[null!==F&&(0,s.jsxs)("span",{className:"text-xs text-success",children:["Saved v",F]}),(0,s.jsxs)(x.$,{disabled:D||!I,size:"sm",onClick:()=>B(async()=>{try{let e=await (0,w.m)({repoId:I,name:U,content:A});L(e.version);let t=await (0,j.v)(I,U);k(t.versions),z("Template saved",`Version ${e.version}`)}catch(e){Z("Failed to save template",e instanceof Error?e.message:String(e))}}),children:[(0,s.jsx)(l.A,{className:"h-4 w-4"}),"Save version"]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)(f.Zp,{pad:"none",children:[(0,s.jsx)(f.aR,{children:(0,s.jsxs)(f.ZB,{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-4 w-4 text-muted-foreground"}),"Preview",(0,s.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"(sample data)"})]})}),(0,s.jsx)(f.Wu,{className:"px-5 pb-5",children:(0,s.jsx)("pre",{className:"scrollbar-none max-h-72 overflow-auto whitespace-pre-wrap rounded-lg border border-card-border bg-secondary/40 p-3 font-mono text-xs leading-relaxed",children:G})})]}),(0,s.jsxs)(f.Zp,{pad:"none",children:[(0,s.jsx)(f.aR,{children:(0,s.jsxs)(f.ZB,{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground"}),"Version history"]})}),(0,s.jsx)(f.Wu,{className:"px-5 pb-5",children:0===O.length?(0,s.jsx)(p.p,{compact:!0,icon:c.A,title:"No versions yet",description:"Past versions appear here after you save changes."}):(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:O.map(e=>{let t=e.version===O[0]?.version,r=P?.version===e.version;return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:(0,_.cn)("flex w-full items-center gap-2 rounded-lg border px-3 py-2 text-left text-sm transition-colors focus-ring",r?"border-primary/40 bg-primary/10 text-primary":"border-transparent text-muted-foreground hover-elevate hover:text-foreground"),onClick:()=>{H(t=>t?.version===e.version?null:e)},title:t?"Active version":"Click to diff against active",children:[(0,s.jsxs)("span",{className:"font-mono font-semibold tnum",children:["v",e.version]}),t&&(0,s.jsx)(m.E,{tone:"success",children:"active"}),(0,s.jsx)("span",{className:"ml-auto tnum text-xs text-muted-foreground",children:E(e.updatedAt)})]})},e.version)})})})]})]})]})}},2049:(e,t,r)=>{Promise.resolve().then(r.bind(r,9290)),Promise.resolve().then(r.t.bind(r,742,23)),Promise.resolve().then(r.bind(r,1417))},2801:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});let s={main:"default",ciFix:"ci-fix",plan:"plan",limitResume:"limit-resume",turnResume:"turn-resume",humanResume:"human-resume",prFormat:"pr-format",release:"release"}},5529:(e,t,r)=>{"use strict";r.d(t,{Wu:()=>d,ZB:()=>l,Zp:()=>i,aR:()=>o});var s=r(515),n=r(5832);let a={none:"",sm:"p-4",default:"p-5",lg:"p-6"};function i({className:e,pad:t,hover:r,...o}){return(0,s.jsx)("div",{className:(0,n.cn)("rounded-xl border border-card-border bg-card text-card-foreground shadow-sm",r&&"hover-elevate transition-shadow hover:shadow-md",t&&a[t],e),...o})}function o({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col gap-1.5 p-5",e),...t})}function l({className:e,...t}){return(0,s.jsx)("h3",{className:(0,n.cn)("text-base font-semibold leading-none tracking-tight",e),...t})}function d({className:e,...t}){return(0,s.jsx)("div",{className:(0,n.cn)("p-5 pt-0",e),...t})}},5832:(e,t,r)=>{"use strict";function s(...e){return e.filter(Boolean).join(" ")}function n(e){if(!e)return"no activity";let t=Math.floor(Date.now()/1e3)-e;return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:new Date(1e3*e).toLocaleDateString()}function a(e){if(e>=3600){let t=Math.floor(e/3600),r=Math.round(e%3600/60);return r>0?`${t}h ${r}m`:`${t}h`}return e>=60?`${Math.floor(e/60)}m ${e%60}s`:`${e}s`}function i(e,t=2){return`$${e.toFixed(t)}`}r.d(t,{KW:()=>n,UK:()=>i,a3:()=>a,cn:()=>s})},5897:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(515),n=r(5832);function a({value:e,onChange:t,options:r,size:i="default",disabled:o=!1}){return(0,s.jsx)("div",{className:(0,n.cn)("inline-flex items-center gap-0.5 rounded-lg border border-border bg-secondary/50 p-0.5","sm"===i&&"text-xs"),children:r.map(r=>(0,s.jsx)("button",{type:"button",disabled:o,onClick:()=>t(r.value),className:(0,n.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e===r.value?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:r.label},r.value))})}},6615:(e,t,r)=>{"use strict";r.d(t,{v:()=>n});var s=r(5097);let n=(0,s.createServerReference)("60126324f0952a224a0ab7a0fd69c420f6b2e1e458",s.callServer,void 0,s.findSourceMapURL,"loadTemplateAction")},6644:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var s=r(515),n=r(5832);let a={neutral:"border-border bg-secondary text-secondary-foreground",primary:"border-primary/40 bg-primary/10 text-primary",success:"border-success-border bg-success-muted text-success-foreground",warning:"border-warning-border bg-warning-muted text-warning-foreground",destructive:"border-destructive/40 bg-destructive/10 text-destructive"},i={queued:"neutral",working:"primary",ci_running:"warning",ci_failed:"destructive",retrying:"warning",waiting_limit:"warning",merged:"success",released:"success",needs_human:"destructive",aborted:"neutral",interrupted:"warning",open:"neutral",triaged:"primary",releasing:"primary"},o=new Set(["working","ci_running","retrying","releasing"]);function l({className:e,status:t,tone:r,children:d,...c}){let u=r??(t?i[t]??"neutral":"neutral"),m=void 0!==t&&o.has(t);return(0,s.jsxs)("span",{className:(0,n.cn)("inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-0.5 text-[11px] font-semibold leading-4",a[u],e),...c,children:[m&&(0,s.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,s.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60"}),(0,s.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-current"})]}),d??t?.replace(/_/g," ")]})}},7217:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});var s=r(515),n=r(5832);function a({htmlFor:e,className:t,children:r}){return(0,s.jsx)("label",{htmlFor:e,className:(0,n.cn)("text-sm font-medium text-foreground",t),children:r})}function i({label:e,hint:t,htmlFor:r,children:o,className:l}){return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-1.5",l),children:[e&&(0,s.jsx)(a,{htmlFor:r,children:e}),o,t&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:t})]})}},8067:(e,t,r)=>{"use strict";r.d(t,{l:()=>o});var s=r(515),n=r(3798),a=r(1171),i=r(5832);let o=a.forwardRef(({className:e,children:t,...r},a)=>(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("select",{ref:a,className:(0,i.cn)("h-9 w-full appearance-none cursor-pointer rounded-lg border border-input bg-background pl-3 pr-9 text-sm text-foreground","transition focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t}),(0,s.jsx)(n.A,{className:"pointer-events-none absolute right-2.5 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-muted-foreground"})]}));o.displayName="Select"},8479:(e,t,r)=>{"use strict";r.d(t,{t:()=>m,d:()=>x});var s=r(515),n=r(8131),a=r(6003),i=r(6512),o=r(5378),l=r(1171);function d(e){return"error"===e?"assertive":"polite"}var c=r(5832);let u=(0,l.createContext)(null);function m({children:e}){let[t,r]=(0,l.useState)([]),n=(0,l.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]),a=(0,l.useCallback)(e=>{let t=Date.now()+Math.random(),s={id:t,title:e.title,description:e.description,variant:e.variant??"info",href:e.href};r(e=>[...e,s]),setTimeout(()=>n(t),5e3)},[n]),i=(0,l.useMemo)(()=>({toast:a,success:(e,t)=>a({title:e,description:t,variant:"success"}),error:(e,t)=>a({title:e,description:t,variant:"error"}),info:(e,t)=>a({title:e,description:t,variant:"info"})}),[a]);return(0,s.jsxs)(u.Provider,{value:i,children:[e,(0,s.jsx)(v,{toasts:t,onDismiss:n})]})}function x(){let e=(0,l.useContext)(u);if(!e)throw Error("useToast must be used within a ToastProvider");return e}let f={success:n.A,error:a.A,info:i.A},p={success:{icon:"text-success",bar:"bg-success"},error:{icon:"text-destructive",bar:"bg-destructive"},info:{icon:"text-primary",bar:"bg-primary"}};function h({toast:e,onDismiss:t}){let r=f[e.variant],n=p[e.variant];return(0,s.jsxs)("div",{className:"dd-toast dd-toast-in pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-xl border border-card-border bg-card p-3.5 shadow-lg",children:[(0,s.jsx)(r,{className:(0,c.cn)("mt-0.5 h-[18px] w-[18px] shrink-0",n.icon)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e.href?(0,s.jsx)("a",{href:e.href,className:"text-sm font-medium underline-offset-2 hover:underline",children:e.title}):(0,s.jsx)("p",{className:"text-sm font-medium",children:e.title}),e.description&&(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]}),(0,s.jsx)("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>t(e.id),className:"shrink-0 rounded-md p-0.5 text-muted-foreground hover-elevate",children:(0,s.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("span",{className:(0,c.cn)("dd-toast-progress absolute bottom-0 left-0 h-0.5 w-full",n.bar),style:{animationDuration:"5000ms"}})]})}function v({toasts:e,onDismiss:t}){let r=e.filter(e=>"assertive"===d(e.variant)),n=e.filter(e=>"polite"===d(e.variant));return(0,s.jsxs)("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2",children:[(0,s.jsx)("div",{role:"alert","aria-live":"assertive","aria-atomic":"false",className:"flex flex-col gap-2",children:r.map(e=>(0,s.jsx)(h,{toast:e,onDismiss:t},e.id))}),(0,s.jsx)("div",{"aria-live":"polite","aria-atomic":"false",className:"flex flex-col gap-2",children:n.map(e=>(0,s.jsx)(h,{toast:e,onDismiss:t},e.id))})]})}},9214:(e,t,r)=>{"use strict";r.d(t,{p:()=>i});var s=r(515),n=r(5832);let a={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function i({icon:e,tone:t="neutral",title:r,description:o,action:l,secondary:d,className:c,compact:u}){return(0,s.jsxs)("div",{className:(0,n.cn)("flex flex-col items-center justify-center text-center",u?"py-10":"py-16",c),children:[e&&(0,s.jsx)("div",{className:(0,n.cn)("flex items-center justify-center rounded-2xl",u?"h-12 w-12":"h-16 w-16",a[t]),children:(0,s.jsx)(e,{className:u?"h-[22px] w-[22px]":"h-7 w-7"})}),(0,s.jsx)("h3",{className:"mt-4 text-base font-semibold",children:r}),o&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-pretty text-sm text-muted-foreground",children:o}),(l||d)&&(0,s.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[l,d]})]})}}},e=>{e.O(0,[9843,6263,9655,4234,7358],()=>e(e.s=2049)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1149],{297:(e,t,s)=>{"use strict";s.d(t,{m:()=>n});var a=s(5097);let n=(0,a.createServerReference)("40351ea90748f20b6ea53d3973d2f011d8331ea1fe",a.callServer,void 0,a.findSourceMapURL,"saveTemplateAction")},663:(e,t,s)=>{"use strict";s.d(t,{RepoWebhookPanel:()=>m});var a=s(515),n=s(8493),r=s(1171),l=s(6644),i=s(395),o=s(7217),d=s(7405),c=s(8479),u=s(4183);function m({repo:e}){let[t,s]=(0,r.useState)(e.webhookSecret??""),[h,p]=(0,r.useState)(!1),[x,g]=(0,r.useState)(`/api/webhooks/${e.id}`),[f,b]=(0,r.useTransition)(),[v,j]=(0,r.useState)(!1),{error:y}=(0,c.d)();(0,r.useEffect)(()=>{g(`${window.location.origin}/api/webhooks/${e.id}`)},[e.id]);let w=(e.webhookSecret??"").length>0,N="gitlab"===e.platform;function S(t){j(!1),b(async()=>{try{await (0,u.u)(e.id,{webhookSecret:t.trim()||null}),j(!0),setTimeout(()=>j(!1),1500)}catch(e){y("Failed to update webhook",e instanceof Error?e.message:String(e))}})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"})," Webhook sync"]}),(0,a.jsx)(l.E,{tone:w?"success":"neutral",children:w?"On":"Off"}),f&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Saving…"}),v&&(0,a.jsx)("span",{className:"text-xs text-success",children:"Saved"})]}),(0,a.jsx)(o.D,{label:"Shared secret",htmlFor:"webhook-secret",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.p,{id:"webhook-secret",type:h?"text":"password",value:t,onChange:e=>s(e.target.value),onBlur:()=>{(t.trim()||null)!==(e.webhookSecret??null)&&S(t)},placeholder:"Set a secret to enable webhook delivery",className:"min-w-0 flex-1 font-mono"}),(0,a.jsx)(i.$,{type:"button",variant:"outline",size:"sm",onClick:()=>p(e=>!e),children:h?"Hide":"Show"}),(0,a.jsx)(i.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e,t=(e=new Uint8Array(20),crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join(""));s(t),p(!0),S(t)},children:"Generate"}),w&&(0,a.jsx)(i.$,{type:"button",variant:"destructive",size:"sm",onClick:()=>{s(""),S("")},children:"Disable"})]})}),(0,a.jsx)(o.D,{label:"Payload URL",htmlFor:"webhook-url",children:(0,a.jsx)(d.p,{id:"webhook-url",readOnly:!0,value:x,onFocus:e=>e.currentTarget.select(),className:"font-mono text-xs"})}),(0,a.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["Opt-in. Polling stays on as the default and continues unchanged whether or not webhooks are configured — the two paths share the same idempotent sync, so a change is never double-processed. Point a ",N?"GitLab":"GitHub"," webhook for"," ",(0,a.jsx)("em",{children:N?"issues, comments and pipelines":"Issues, Issue comments, Check suites, Check runs, Pull request reviews and Pull request review comments"})," ","at the payload URL above with"," ",N?(0,a.jsxs)(a.Fragment,{children:["this secret as the ",(0,a.jsx)("code",{className:"font-mono",children:"Secret token"})]}):(0,a.jsxs)(a.Fragment,{children:["this secret and content type ",(0,a.jsx)("code",{className:"font-mono",children:"application/json"})]}),". Issue events drive the sync. Finished check",N?" (pipeline)":""," events wake the CI babysitter, and review events trigger the review-feedback sweep, so merges and feedback land within seconds instead of at the next poll. Drydock binds"," ",(0,a.jsx)("code",{className:"font-mono",children:"127.0.0.1"}),", so expose the URL through a tunnel or forwarder (e.g. ",(0,a.jsx)("code",{className:"font-mono",children:"cloudflared"}),","," ",(0,a.jsx)("code",{className:"font-mono",children:"ngrok"}),") to receive deliveries. Each delivery is"," ",N?"token-verified":"HMAC-SHA256 signature-verified","; invalid or unsigned payloads are rejected."]})]})}},1024:(e,t,s)=>{"use strict";s.d(t,{Section:()=>o});var a=s(515),n=s(3798),r=s(1171),l=s(5832);let i={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function o({icon:e,title:t,description:s,defaultOpen:d=!0,right:c,collapsible:u=!0,children:m,tone:h="neutral",id:p}){let[x,g]=(0,r.useState)(d),f=(0,r.useId)(),b=()=>g(e=>!e),v=e&&(0,a.jsx)("span",{className:(0,l.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",i[h]),children:e}),j=(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h2",{className:"text-base font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:s})]});return(0,a.jsxs)("section",{id:p,className:"rounded-xl border border-card-border bg-card shadow-sm",children:[(0,a.jsxs)("div",{className:(0,l.cn)("flex items-center gap-3 p-4",!x&&"rounded-b-xl"),children:[u?(0,a.jsxs)("button",{type:"button",onClick:b,"aria-expanded":x,"aria-controls":f,className:"-m-1.5 flex min-w-0 flex-1 items-center gap-3 rounded-lg p-1.5 text-left hover-elevate focus-ring",children:[v,j]}):(0,a.jsxs)(a.Fragment,{children:[v,j]}),c&&(0,a.jsx)("div",{className:"flex items-center gap-2",children:c}),u&&(0,a.jsx)("button",{type:"button",onClick:b,"aria-label":x?"Collapse section":"Expand section","aria-expanded":x,"aria-controls":f,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover-elevate focus-ring",children:(0,a.jsx)(n.A,{className:(0,l.cn)("h-[18px] w-[18px] transition-transform duration-200",x&&"rotate-180")})})]}),x&&(0,a.jsx)("div",{id:f,className:"dd-fade-up border-t border-card-border p-4 sm:p-5",children:m})]})}},1080:(e,t,s)=>{"use strict";s.d(t,{RepoPromptsSection:()=>C});var a=s(515),n=s(6188),r=s(8652),l=s(5595),i=s(592),o=s(6512),d=s(3164),c=s(742),u=s.n(c),m=s(1171),h=s(4783),p=s(6644),x=s(395),g=s(5897),f=s(9),b=s(8479),v=s(6615),j=s(297),y=s(5097);let w=(0,y.createServerReference)("6088db15317c3c87ffee58091f528b3f85324fdc10",y.callServer,void 0,y.findSourceMapURL,"deleteTemplateAction");var N=s(2801),S=s(5832);let k=[{id:"work",name:N._.main,title:"Work prompt",icon:n.A,desc:"Injected when the agent starts an issue."},{id:"triage",name:"triage",title:"Triage prompt",icon:r.A,desc:"Classifies and labels new issues."},{id:"review",name:"review-feedback",title:"Review-feedback prompt",icon:l.A,desc:"Runs when a trusted reviewer comments."},{id:"release",name:N._.release,title:"Release prompt",icon:i.A,desc:"Drives the manual agent-run release (issue #256)."}];function A({repo:e,stage:t}){let{success:s,error:n}=(0,b.d)(),[r,l]=(0,m.useState)("standard"),[i,d]=(0,m.useState)(""),[c,h]=(0,m.useState)(""),[y,N]=(0,m.useState)(!1),[S,k]=(0,m.useTransition)();(0,m.useEffect)(()=>{let s=!0;return(0,v.v)(e.id,t.name).then(e=>{s&&(d(e.content),h(e.content),l(e.hasRow?"custom":"standard"),N(!0))}).catch(e=>{s&&(n("Failed to load prompt",e instanceof Error?e.message:String(e)),N(!0))}),()=>{s=!1}},[e.id,t.name,n]);let C=c.trim()!==i.trim(),R=t.icon;return(0,a.jsxs)("div",{className:"rounded-lg border border-border p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-secondary text-muted-foreground",children:(0,a.jsx)(R,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold",children:t.title}),"standard"===r?(0,a.jsx)(p.E,{tone:"neutral",children:"Standard"}):(0,a.jsx)(p.E,{tone:"primary",children:"Custom"})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:t.desc})]}),(0,a.jsx)(g.I,{value:r,onChange:function(s){"custom"===s?l("custom"):k(async()=>{try{let s=await w(e.id,t.name);d(s.content),h(s.content),l("standard")}catch(e){n("Failed to revert to standard",e instanceof Error?e.message:String(e))}})},disabled:!y||S,options:[{value:"standard",label:"Standard"},{value:"custom",label:"Custom"}]})]}),"standard"===r?(0,a.jsxs)("div",{className:"mt-3 rounded-lg border border-dashed border-border bg-secondary/30 p-3",children:[(0,a.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed text-muted-foreground",children:y?i:"Loading…"}),(0,a.jsxs)("p",{className:"mt-2 inline-flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[(0,a.jsx)(o.A,{className:"h-3 w-3"})," Inherits the global default.",(0,a.jsx)(u(),{href:"/prompts",className:"text-primary hover:underline",children:"Edit the standard →"})]})]}):(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)(f.T,{value:c,onChange:e=>h(e.target.value),rows:4,disabled:!y||S,className:"font-mono text-xs leading-relaxed"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-end gap-2",children:[(0,a.jsx)(x.$,{size:"sm",variant:"ghost",disabled:!C||S,onClick:()=>h(i),children:"Discard changes"}),(0,a.jsx)(x.$,{size:"sm",disabled:!C||S,onClick:function(){k(async()=>{try{await (0,j.m)({repoId:e.id,name:t.name,content:c}),d(c),s("Prompt saved",`${t.title} \xb7 ${e.name}`)}catch(e){n("Failed to save prompt",e instanceof Error?e.message:String(e))}})},children:"Save override"})]})]})]})}function C({repo:e,className:t}){return(0,a.jsxs)("div",{className:(0,S.cn)("flex flex-col gap-3",t),children:[(0,a.jsxs)(h.F,{tone:"info",icon:d.A,title:"Per-repo prompt overrides",children:["Each stage uses the global"," ",(0,a.jsx)(u(),{href:"/prompts",className:"font-medium text-primary hover:underline",children:"standard prompt"})," ","unless you switch it to ",(0,a.jsx)("span",{className:"font-medium",children:"Custom"})," here. Overrides apply only to ",e.name,"."]}),k.map(t=>(0,a.jsx)(A,{repo:e,stage:t},t.id))]})}},2381:(e,t,s)=>{"use strict";s.d(t,{IssueBoard:()=>es});var a=s(515),n=s(8777),r=s(2323),l=s(2116),i=s(5378),o=s(296),d=s(9564),c=s(2718),u=s(1528),m=s(6998),h=s(8652),p=s(1171),x=s(5437),g=s(4054),f=s(4847),b=s(9320),v=s(5595),j=s(7241),y=s(9754),w=s(4783),N=s(6644),S=s(395),k=s(9694),A=s(7901),C=s(9214),R=s(7217),L=s(7405),P=s(9),M=s(5097);let D=(0,M.createServerReference)("60a1fbb43a257356d756462cc2695ef6a6255ffca3",M.callServer,void 0,M.findSourceMapURL,"viewIssueAction"),$=(0,M.createServerReference)("602a76c2114d37037598ea9842b02d600951593481",M.callServer,void 0,M.findSourceMapURL,"listSubtasksAction"),I=(0,M.createServerReference)("70a43a0d282fbb085ace9c26454fbfcb7c9dae899a",M.callServer,void 0,M.findSourceMapURL,"setIssueStateAction"),E=(0,M.createServerReference)("7047ed536a730f858b9456d0892129275f533dcf2b",M.callServer,void 0,M.findSourceMapURL,"startIssueAction"),F=(0,M.createServerReference)("605133eb35c690a9a5271377efe20141db5c9471e5",M.callServer,void 0,M.findSourceMapURL,"removeFromQueueAction"),T=(0,M.createServerReference)("70a7d76e0a5018a9dc45b5ac117852ac9ecc20d8a0",M.callServer,void 0,M.findSourceMapURL,"addToQueueAction"),B=(0,M.createServerReference)("7037108719b68f9f245bacf60f67696c2006c90167",M.callServer,void 0,M.findSourceMapURL,"editIssueAction"),O=(0,M.createServerReference)("78c227ded2618103847f7c040946e7cd39f5c8278e",M.callServer,void 0,M.findSourceMapURL,"setIssueLabelsAction"),q=(0,M.createServerReference)("70683988929cc82de99b5bdec65d1a94dbc22dbddb",M.callServer,void 0,M.findSourceMapURL,"commentIssueAction");var z=s(1837);let U={pending:{label:"Pending",symbol:"○",tone:"neutral"},in_progress:{label:"In progress",symbol:"◐",tone:"primary"},done:{label:"Done",symbol:"✓",tone:"success"},skipped:{label:"Skipped",symbol:"⊘",tone:"neutral"},deferred:{label:"Deferred",symbol:"⏸",tone:"warning"}};function V({repoId:e,issueNumber:t,open:s,onClose:n,queueLabel:r,defaultModel:l,defaultAgent:i}){let[o,d]=(0,p.useState)(null),[c,u]=(0,p.useState)([]),[h,M]=(0,p.useState)(""),[H,G]=(0,p.useState)(""),[W,_]=(0,p.useState)(""),[J,Q]=(0,p.useState)(""),[Z,K]=(0,p.useState)(l),[X,Y]=(0,p.useState)(i),[ee,et]=(0,p.useState)(null),[es,ea]=(0,p.useState)(!1),[en,er]=(0,p.useTransition)();function el(){null!==t&&(D(e,t).then(d).catch(e=>et(e.message)),$(e,t).then(u).catch(()=>u([])))}function ei(t){o&&er(()=>{I(e,o.number,t).then(el).catch(e=>et(e.message))})}if((0,p.useEffect)(()=>{K(l),Y(i)},[l,i]),(0,p.useEffect)(()=>{s&&null!==t&&(et(null),d(null),u([]),D(e,t).then(e=>{d(e),M(e.title),G(e.body)}).catch(e=>et(e.message)),$(e,t).then(u).catch(()=>u([])))},[s,t,e]),null===t)return null;let eo=`issue-modal-title-${t}`;return(0,a.jsxs)(A.l,{open:s,onClose:n,labelledById:eo,children:[(0,a.jsxs)("span",{id:eo,className:"sr-only",children:["Issue #",t]}),ee&&(0,a.jsx)(w.F,{tone:"destructive",className:"mb-3",children:ee}),o?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs font-mono text-muted-foreground tnum",children:["#",o.number]}),(0,a.jsx)(N.E,{status:o.state}),(0,a.jsx)(S.$,{size:"sm",variant:"outline",className:"ml-auto",disabled:en,onClick:()=>"open"===o.state?ea(!0):ei("open"),children:"open"===o.state?"Close issue":"Reopen issue"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-card-border bg-secondary/40 p-4",children:[(0,a.jsxs)("h3",{className:"mb-3 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Run settings"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,a.jsx)(R.D,{label:"Agent",htmlFor:"modal-agent-select",children:(0,a.jsx)(j.a,{id:"modal-agent-select",value:X,onChange:e=>{Y(e),K((0,z.VJ)(e))}})}),(0,a.jsx)(R.D,{label:"Model",htmlFor:"modal-model-select",children:(0,a.jsx)(y.o,{id:"modal-model-select",value:Z,onChange:K,agent:X})}),(0,a.jsxs)(S.$,{size:"sm",disabled:en,onClick:()=>er(()=>{E(e,o.number,{model:Z!==l?Z:void 0,agent:X!==i?X:void 0}).then(()=>n()).catch(e=>et(e.message))}),children:[(0,a.jsx)(g.A,{}),"Start job now"]}),o.labels.includes(r)?(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en,onClick:()=>er(()=>{F(e,o.number).then(el).catch(e=>et(e.message))}),children:"Dequeue"}):(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en,onClick:()=>er(()=>{T(e,o.number,{model:Z!==l?Z:void 0,agent:X!==i?X:void 0}).then(el).catch(e=>et(e.message))}),children:"Add to queue"})]}),Z!==l||X!==i?(0,a.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:["Override active — repo default:"," ",(0,a.jsx)("span",{className:"font-medium text-foreground",children:l})]}):null]}),(0,a.jsx)(L.p,{value:h,onChange:e=>M(e.target.value),className:"font-medium"}),(0,a.jsx)(P.T,{value:H,onChange:e=>G(e.target.value),rows:8}),(0,a.jsxs)(S.$,{size:"sm",disabled:en,onClick:()=>er(()=>{B(e,o.number,{title:h,body:H}).then(el).catch(e=>et(e.message))}),children:[(0,a.jsx)(f.A,{}),"Save changes"]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Labels"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.labels.map(t=>(0,a.jsx)("button",{type:"button",title:"Remove label",disabled:en,className:"rounded-md focus-ring disabled:opacity-50",onClick:()=>er(()=>{O(e,o.number,[],[t]).then(el).catch(e=>et(e.message))}),children:(0,a.jsxs)(N.E,{className:"cursor-pointer",children:[t," \xd7"]})},t)),(0,a.jsx)(L.p,{value:J,onChange:e=>Q(e.target.value),placeholder:"add label",className:"h-8 w-28 text-xs"}),(0,a.jsx)(S.$,{size:"sm",variant:"outline",disabled:en||!J.trim(),onClick:()=>er(()=>{O(e,o.number,[J.trim()],[]).then(()=>{Q(""),el()}).catch(e=>et(e.message))}),children:"Add"})]})]}),c.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(b.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Subtasks (",c.filter(e=>"done"===e.status).length,"/",c.length,")"]}),(0,a.jsx)("ol",{className:"space-y-1.5",children:c.map(e=>{let t=U[e.status]??{label:e.status,symbol:"○",tone:"neutral"},s="done"===e.status||"skipped"===e.status;return(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded-lg border border-card-border bg-secondary/40 px-3 py-1.5 text-sm",children:[(0,a.jsx)("span",{className:"text-muted-foreground","aria-hidden":!0,children:t.symbol}),(0,a.jsx)("span",{className:s?"text-muted-foreground line-through":"",children:e.title}),(0,a.jsx)("span",{className:"ml-auto",children:(0,a.jsx)(N.E,{tone:t.tone,children:t.label})})]},e.id)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Comments"]}),(0,a.jsxs)("ul",{className:"space-y-2",children:[o.comments.map(e=>(0,a.jsxs)("li",{className:"rounded-lg border border-card-border bg-secondary/40 p-3 text-sm",children:[(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"font-medium text-foreground",children:e.author})," \xb7 ",e.createdAt]}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-pretty",children:e.body})]},`${e.author}-${e.createdAt}`)),0===o.comments.length&&(0,a.jsx)("li",{children:(0,a.jsx)(C.p,{compact:!0,icon:v.A,title:"No comments yet",description:"Discussion from GitHub shows up here."})})]}),(0,a.jsx)(P.T,{value:W,onChange:e=>_(e.target.value),rows:3,placeholder:"Write a comment…",className:"mt-2"}),(0,a.jsx)(S.$,{size:"sm",className:"mt-2",disabled:en||!W.trim(),onClick:()=>er(()=>{q(e,o.number,W.trim()).then(()=>{_(""),el()}).catch(e=>et(e.message))}),children:"Comment"})]})]}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),o&&(0,a.jsx)(k.T,{open:es,onOpenChange:ea,onConfirm:()=>ei("closed"),title:"Close issue?",description:`This closes #${o.number} on GitHub.`,confirmLabel:"Close issue",variant:"destructive",pending:en})]})}var H=s(4148),G=s(8479),W=s(5172);let _=(0,M.createServerReference)("40e4e0566b5915a5c717b6a6a234d7f0b5e7ae8ab8",M.callServer,void 0,M.findSourceMapURL,"syncRepoIssuesAction"),J=(0,M.createServerReference)("60ffbfb54c1eedad8bdb1dadf09eba3a4563a1c4d7",M.callServer,void 0,M.findSourceMapURL,"reorderIssuesAction"),Q=(0,M.createServerReference)("6054a5f157537c63e0121c428d9e584ccb689168b5",M.callServer,void 0,M.findSourceMapURL,"bulkAddToQueueAction"),Z=(0,M.createServerReference)("609a8e9cdaef62b5521521ddb1ecdbc0eeda496910",M.callServer,void 0,M.findSourceMapURL,"bulkRemoveFromQueueAction"),K=(0,M.createServerReference)("70508bed778ffcbfb01bf813fdd5a53db7f95f1a48",M.callServer,void 0,M.findSourceMapURL,"bulkApplyLabelAction");var X=s(5832);function Y(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function ee({issue:e,reorderable:t,queueLabel:s,queueIndex:d,queueSize:c,isDragging:u,isOver:m,isFlash:h,selected:p,pending:x,onToggleSelect:g,onOpen:f,onAddToQueue:b,onRemoveFromQueue:v,onMoveUp:j,onMoveDown:y,onDragStartRow:w,onDragEnterRow:k,onDragEndRow:A,onDropRow:C}){let R=Y(e.labels).filter(e=>e!==s),L=`issue-select-${e.number}`;return(0,a.jsxs)("div",{draggable:!0,onDragStart:t=>{w(),t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain",String(e.number))}catch{}},onDragEnter:k,onDragOver:e=>e.preventDefault(),onDragEnd:A,onDrop:e=>{e.preventDefault(),e.stopPropagation(),C()},className:(0,X.cn)("issue-row group flex items-center gap-3 rounded-lg border border-transparent bg-card px-3 py-2.5 hover-elevate",u&&"opacity-40",m&&"ring-1 ring-primary/70",h&&"bg-success/[0.06] ring-1 ring-success/70"),children:[(0,a.jsx)(n.A,{"aria-hidden":!0,className:"h-[15px] w-[15px] shrink-0 cursor-grab text-muted-foreground/40 group-hover:text-muted-foreground active:cursor-grabbing"}),(0,a.jsx)(H.S,{id:L,checked:p,onChange:g,"aria-label":`Select #${e.number} for bulk actions`,className:"shrink-0"}),t&&(0,a.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary text-[11px] font-semibold tabular-nums text-primary-foreground",children:d+1}),(0,a.jsxs)("button",{type:"button",onClick:f,className:"flex min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-ring",children:[(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:["#",e.number]}),(0,a.jsx)("span",{className:"truncate text-sm group-hover:text-foreground",children:e.title})]}),(0,a.jsxs)("div",{className:"hidden shrink-0 items-center gap-1.5 md:flex",children:[e.triagedAt&&(0,a.jsx)(W.m,{content:"Labels applied by auto-triage — see the issue comment for reasons",children:(0,a.jsx)(N.E,{tone:"primary",children:"auto-triaged"})}),R.slice(0,2).map(e=>(0,a.jsx)("span",{className:"rounded-md bg-secondary px-1.5 py-0.5 text-[11px] text-muted-foreground",children:e},e))]}),(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-0.5",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Move #${e.number} up in queue`,disabled:0===d||x,onClick:j,className:"h-7 w-7",children:(0,a.jsx)(r.A,{})}),(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Move #${e.number} down in queue`,disabled:d===c-1||x,onClick:y,className:"h-7 w-7",children:(0,a.jsx)(l.A,{})}),(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Remove #${e.number} from queue`,disabled:x,onClick:v,className:"h-7 w-7 text-destructive hover:text-destructive",children:(0,a.jsx)(i.A,{})})]}):(0,a.jsx)(S.$,{type:"button",size:"icon-sm",variant:"ghost","aria-label":`Add #${e.number} to queue`,disabled:x,onClick:b,className:"h-7 w-7",children:(0,a.jsx)(o.A,{})})})]})}function et({zone:e,icon:t,title:s,count:n,hint:r,empty:l,emptyDrop:i,dropping:o,isEmpty:d,onDropZone:c,onClearOver:u,children:m}){return(0,a.jsxs)("div",{onDragOver:e=>{e.preventDefault(),e.currentTarget===e.target&&u()},onDrop:e=>{e.preventDefault(),c()},"data-zone":e,className:(0,X.cn)("rounded-xl border p-2 transition-colors",o?"border-dashed border-primary/45 bg-primary/[0.03]":"border-card-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[(0,a.jsx)(t,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:s}),(0,a.jsx)(N.E,{tone:"neutral",children:n}),(0,a.jsx)("span",{className:"ml-auto hidden text-xs text-muted-foreground sm:block",children:r})]}),d?(0,a.jsx)("div",{className:(0,X.cn)("m-1 rounded-lg border border-dashed px-3 py-6 text-center text-xs transition-colors",o?"border-primary/50 text-primary":"border-border text-muted-foreground"),children:o?i:l}):(0,a.jsx)("div",{className:"flex flex-col gap-0.5 p-1",children:m})]})}function es({repoId:e,queueLabel:t,initialIssues:s,pollIntervalSec:r,defaultModel:l,defaultAgent:o}){let[x,g]=(0,p.useState)(s),[f,b]=(0,p.useState)(""),[v,j]=(0,p.useState)(null),[y,w]=(0,p.useState)(null),[N,k]=(0,p.useState)(null),[A,C]=(0,p.useState)(null),[R,P]=(0,p.useState)(new Set),[M,D]=(0,p.useState)(""),[$,I]=(0,p.useTransition)(),[E,B]=(0,p.useState)(null),{success:O}=(0,G.d)();(0,p.useEffect)(()=>g(s),[s]),(0,p.useEffect)(()=>{let t=setInterval(()=>{_(e).then(g).catch(e=>B(e.message))},1e3*Math.max(10,r));return()=>clearInterval(t)},[e,r]);let q=e=>Y(e.labels).includes(t),z=e=>{let t=f.toLowerCase();return!t||e.title.toLowerCase().includes(t)||String(e.number).includes(t)||Y(e.labels).some(e=>e.toLowerCase().includes(t))},U=x.filter(e=>!q(e)&&z(e)),H=x.filter(e=>q(e)&&z(e));function W(){j(null),w(null)}function ea(){if(null===v)return;let t=x.find(e=>e.number===v),s=t?.title;W(),!t||q(t)||I(()=>{T(e,v).then(e=>{g(e),k(v),setTimeout(()=>k(e=>e===v?null:e),1200),O("Issue queued",`#${v} ${s??""}`.trim())}).catch(e=>B(e.message))})}function en(){if(null===v)return;let t=x.find(e=>e.number===v);W(),t&&q(t)&&I(()=>{F(e,t.number).then(g).catch(e=>B(e.message))})}function er(){P(new Set)}function el(e){let t=[...R];0!==t.length&&(B(null),I(()=>{e(t).then(e=>{g(e),er()}).catch(e=>B(e.message))}))}let ei=x.filter(q).map(e=>e.number),eo=null!==v;function ed(s,n){return(0,a.jsx)(ee,{issue:s,reorderable:n,queueLabel:t,queueIndex:ei.indexOf(s.number),queueSize:ei.length,isDragging:v===s.number,isOver:y===s.number&&null!==v&&v!==s.number,isFlash:N===s.number,selected:R.has(s.number),pending:$,onToggleSelect:()=>{var e;return e=s.number,void P(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},onOpen:()=>C(s.number),onAddToQueue:()=>{var t;return t=s.number,void I(()=>{T(e,t).then(g).catch(e=>B(e.message))})},onRemoveFromQueue:()=>{var t;return t=s.number,void I(()=>{F(e,t).then(g).catch(e=>B(e.message))})},onMoveUp:()=>{let t;return t=function(e,t){let s=e.indexOf(t);if(s<=0)return e;let a=[...e],n=a[s-1];return a[s-1]=a[s],a[s]=n,a}(ei,s.number),void I(()=>{J(e,t).catch(e=>B(e.message))})},onMoveDown:()=>{let t;return t=function(e,t){let s=e.indexOf(t);if(-1===s||s===e.length-1)return e;let a=[...e],n=a[s+1];return a[s+1]=a[s],a[s]=n,a}(ei,s.number),void I(()=>{J(e,t).catch(e=>B(e.message))})},onDragStartRow:()=>j(s.number),onDragEnterRow:()=>w(s.number),onDragEndRow:W,onDropRow:()=>{let t;!(t=null===v?void 0:x.find(e=>e.number===v))?W():q(t)===n?n?function(t){if(W(),null===v||v===t)return;let s=x.find(e=>e.number===v);if(!s||!q(s))return;let a=function(e,t,s){if(t===s||!e.includes(t))return e;let a=e.filter(e=>e!==t),n=a.indexOf(s);return -1===n?e:(a.splice(n,0,t),a)}(x.filter(q).map(e=>e.number),v,t);I(()=>{J(e,a).catch(e=>B(e.message))})}(s.number):W():n?ea():en()}},s.number)}return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5"})," Drag to set priority, or drop an issue into the queue to schedule it."]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative w-full sm:w-56",children:[(0,a.jsx)(d.A,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(L.p,{"aria-label":"Search issues by title or label",value:f,onChange:e=>b(e.target.value),placeholder:"Filter issues",className:"h-8 pl-8 text-xs"})]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$||0===U.length,onClick:function(){let t=U.map(e=>e.number);0!==t.length&&(B(null),I(()=>{Q(e,t).then(g).catch(e=>B(e.message))}))},children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"})," Queue all"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:function(){B(null),I(()=>{_(e).then(g).catch(e=>B(e.message))})},children:[(0,a.jsx)(u.A,{className:(0,X.cn)("h-3.5 w-3.5",$&&"dd-spin")}),$?"Syncing…":"Refresh"]})]})]}),E&&(0,a.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:E}),R.size>0&&(0,a.jsxs)("div",{className:"dd-fade-up flex flex-wrap items-center gap-2 rounded-xl border border-primary/40 bg-primary/[0.04] p-2",children:[(0,a.jsxs)("span",{className:"px-1 text-sm font-medium",children:[R.size," selected"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:()=>el(t=>Q(e,t)),children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"})," Add to queue"]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$,onClick:()=>el(t=>Z(e,t)),children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})," Remove from queue"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(L.p,{"aria-label":"Label to apply to selected issues",value:M,onChange:e=>D(e.target.value),placeholder:"label…",className:"h-8 w-28 text-xs"}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",disabled:$||""===M.trim(),onClick:()=>{let t=M.trim();el(s=>K(e,s,t)),D("")},children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})," Apply label"]})]}),(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"ml-auto",disabled:$,onClick:er,children:"Clear"})]}),(0,a.jsx)(et,{zone:"queue",icon:c.A,title:"Queue",count:H.length,hint:"top = next to run",empty:"Nothing queued. Drag an issue up from the backlog, or use the + button.",emptyDrop:"Drop here",dropping:eo,onDropZone:ea,onClearOver:()=>w(null),isEmpty:0===H.length,children:H.map(e=>ed(e,!0))}),(0,a.jsx)(et,{zone:"backlog",icon:h.A,title:"Backlog \xb7 triage",count:U.length,hint:"drag up to schedule",empty:"Backlog is empty.",emptyDrop:"Drop here",dropping:eo,onDropZone:en,onClearOver:()=>w(null),isEmpty:0===U.length,children:U.map(e=>ed(e,!1))}),(0,a.jsx)(V,{repoId:e,issueNumber:A,open:null!==A,onClose:()=>C(null),queueLabel:t,defaultModel:l,defaultAgent:o})]})}},2801:(e,t,s)=>{"use strict";s.d(t,{_:()=>a});let a={main:"default",ciFix:"ci-fix",plan:"plan",limitResume:"limit-resume",turnResume:"turn-resume",humanResume:"human-resume",prFormat:"pr-format",release:"release"}},2836:(e,t,s)=>{"use strict";s.d(t,{Sparkline:()=>l});var a=s(515),n=s(1171),r=s(4497);function l({data:e,width:t=132,height:s=36,tone:i="chart-1",fill:o=!0,strokeWidth:d=1.75,average:c=!1}){let u=`sp${(0,n.useId)().replace(/:/g,"")}`;if(0===e.length)return null;let m=Math.min(...e),h=Math.max(...e)-m||1,p=e.length>1?t/(e.length-1):t,x=e.map((e,t)=>[t*p,s-3-(e-m)/h*(s-6)]),g=x.map((e,t)=>`${t?"L":"M"}${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(" "),f=`${g} L${t} ${s} L0 ${s} Z`,b=(0,r.U)(i),v=x[x.length-1]??[0,s-3],j=s-3-(e.reduce((e,t)=>e+t,0)/e.length-m)/h*(s-6);return(0,a.jsxs)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:"overflow-visible","aria-hidden":"true",children:[o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:u,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:"0.22"}),(0,a.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:"0"})]})}),(0,a.jsx)("path",{d:f,fill:`url(#${u})`})]}),c&&e.length>1&&(0,a.jsx)("line",{x1:0,x2:t,y1:j,y2:j,stroke:"hsl(var(--muted-foreground) / 0.45)",strokeWidth:1,strokeDasharray:"3 3"}),(0,a.jsx)("path",{d:g,fill:"none",stroke:b,strokeWidth:d,strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("circle",{cx:v[0],cy:v[1],r:2.5,fill:b})]})}},4183:(e,t,s)=>{"use strict";s.d(t,{u:()=>n});var a=s(5097);let n=(0,a.createServerReference)("600ab73aefdfa18cb73f40404e31cac1a432251128",a.callServer,void 0,a.findSourceMapURL,"updateRepoAction")},4497:(e,t,s)=>{"use strict";function a(e){return e?`hsl(var(--${e}))`:"hsl(var(--muted-foreground))"}s.d(t,{U:()=>a})},4602:(e,t,s)=>{Promise.resolve().then(s.bind(s,9290)),Promise.resolve().then(s.t.bind(s,742,23)),Promise.resolve().then(s.bind(s,2381)),Promise.resolve().then(s.bind(s,715)),Promise.resolve().then(s.bind(s,9079)),Promise.resolve().then(s.bind(s,1080)),Promise.resolve().then(s.bind(s,5362)),Promise.resolve().then(s.bind(s,4860)),Promise.resolve().then(s.bind(s,663)),Promise.resolve().then(s.bind(s,1024)),Promise.resolve().then(s.bind(s,2836))},4860:(e,t,s)=>{"use strict";s.d(t,{RepoSettingsBar:()=>v});var a=s(515),n=s(1765),r=s(7561),l=s(988),i=s(1171),o=s(7241),d=s(9754),c=s(7217),u=s(8379),m=s(7405),h=s(1059),p=s(8479),x=s(5172),g=s(1837),f=s(4183);function b({text:e,help:t}){return(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[e,(0,a.jsx)(x.V,{content:t})]})}function v({repo:e,openrouter:t}){let[s,j]=(0,i.useState)(e.agent),[y,w]=(0,i.useState)(e.defaultModel),[N,S]=(0,i.useState)(e.dailyCostLimitUsd.toString()),[k,A]=(0,i.useState)(e.maxJobMinutes?.toString()??""),[C,R]=(0,i.useState)(e.maxCiWaitMinutes?.toString()??""),[L,P]=(0,i.useState)(e.mergeGateMinutes.toString()),[M,D]=(0,i.useState)(e.adrGating),[$,I]=(0,i.useState)(e.sequential),[E,F]=(0,i.useTransition)(),[T,B]=(0,i.useState)(!1),{error:O}=(0,p.d)();function q(t){B(!1),F(async()=>{try{await (0,f.u)(e.id,t),B(!0),setTimeout(()=>B(!1),1500)}catch(e){O("Failed to update repository",e instanceof Error?e.message:String(e))}})}function z(e,t){"maxJobMinutes"===e?A(t):R(t);let s=""===t?null:Number(t);(null===s||Number.isInteger(s)&&!(s<0))&&q({[e]:s})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(u.L,{icon:n.A,legend:"Agent & model",tone:"primary",description:"Which agent picks up issues in this repo, and the model it defaults to.",children:(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Queue label",help:"Issues carrying this GitHub label enter the repo's processing queue."}),children:(0,a.jsx)("code",{className:"inline-flex h-9 w-fit max-w-full items-center truncate rounded-lg bg-secondary px-3 font-mono text-xs text-muted-foreground",children:e.queueLabel})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Agent",help:"CLI agent used for new jobs in this repo."}),htmlFor:"repo-agent-select",children:(0,a.jsx)(o.a,{id:"repo-agent-select",value:s,onChange:function(e){let s="openrouter"===e?t.defaultModel||(t.models[0]?.id??""):(0,g.VJ)(e);"openrouter"===e&&""===s?O("No synced OpenRouter models","Refresh the catalog in Settings first."):(j(e),w(s),q({agent:e,defaultModel:s}))},agents:t.enabled||"openrouter"===s?["claude","codex","openrouter"]:["claude","codex"]})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Model",help:"Default model for new jobs — switching agents resets it to that agent's default."}),htmlFor:"repo-model-select",children:(0,a.jsx)(d.o,{id:"repo-model-select",value:y,onChange:function(e){w(e),q({defaultModel:e})},agent:s,openrouterModels:t.models})})]})}),(0,a.jsx)(u.L,{icon:r.A,legend:"Limits & timing",tone:"warning",description:"Spend and runtime guardrails for jobs in this repo.",children:(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Daily limit ($)",help:"Hard cap on agent spend per day for this repo. New jobs wait once the cap is hit. 0 = off (unlimited)."}),htmlFor:"repo-daily-limit",children:(0,a.jsx)(m.p,{id:"repo-daily-limit",type:"number",min:0,step:1,value:N,onChange:e=>{var t;let s;return S(t=e.target.value),s=Number(t),void(""!==t.trim()&&Number.isFinite(s)&&!(s<0)&&q({dailyCostLimitUsd:s}))}})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Max job minutes",help:"Abort jobs that run longer than this. Leave empty to use the global default."}),htmlFor:"repo-max-job-minutes",children:(0,a.jsx)(m.p,{id:"repo-max-job-minutes",type:"number",min:0,step:1,value:k,onChange:e=>z("maxJobMinutes",e.target.value),placeholder:"Global default"})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Max CI wait minutes",help:"How long to wait for CI before giving up. Leave empty to use the global default."}),htmlFor:"repo-max-ci-wait-minutes",children:(0,a.jsx)(m.p,{id:"repo-max-ci-wait-minutes",type:"number",min:0,step:1,value:C,onChange:e=>z("maxCiWaitMinutes",e.target.value),placeholder:"Global default"})}),(0,a.jsx)(c.D,{label:(0,a.jsx)(b,{text:"Merge gate minutes",help:"Hold the auto-merge after green CI so late bot or human reviews can land first. 0 merges immediately."}),htmlFor:"repo-merge-gate-minutes",children:(0,a.jsx)(m.p,{id:"repo-merge-gate-minutes",type:"number",min:0,step:1,value:L,onChange:e=>{var t;let s;return P(t=e.target.value),s=Number(t),void(""!==t&&Number.isInteger(s)&&!(s<0)&&q({mergeGateMinutes:s}))},placeholder:"0 = merge on green"})})]})}),(0,a.jsx)(u.L,{icon:l.A,legend:"Gates",description:"Checks that hold work before it lands.",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsxs)("label",{htmlFor:"repo-adr-gate",className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(h.d,{id:"repo-adr-gate",checked:M,onChange:function(e){D(e),q({adrGating:e})},"aria-label":"ADR gate"}),"ADR gate"]}),(0,a.jsx)(x.V,{content:"Hold the merge while ADRs await review — the job parks as needs-human until pending decisions are approved."})]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsxs)("label",{htmlFor:"repo-sequential",className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(h.d,{id:"repo-sequential",checked:$,onChange:function(e){I(e),q({sequential:e})},"aria-label":"Sequential (wait for merge)"}),"Sequential"]}),(0,a.jsx)(x.V,{content:"Process one issue at a time — wait for the open PR to merge before starting the next job."})]}),(0,a.jsx)("span",{"aria-live":"polite",className:"ml-auto text-xs text-muted-foreground",children:E?"Saving…":T?"Saved":""})]})})]})}},5362:(e,t,s)=>{"use strict";s.d(t,{RepoReleasePanel:()=>v});var a=s(515),n=s(6998),r=s(1753),l=s(742),i=s.n(l),o=s(2235),d=s(1171),c=s(6644),u=s(395),m=s(9214),h=s(8479),p=s(5097);let x=(0,p.createServerReference)("40eb0cd08d486262bdc5adbc5edf1ea9dd7a068984",p.callServer,void 0,p.findSourceMapURL,"previewReleaseAction"),g=(0,p.createServerReference)("4017f4c60354ec828a2b4dc3e092cf89c175312713",p.callServer,void 0,p.findSourceMapURL,"publishReleaseAction"),f=(0,p.createServerReference)("402c2d333c4b3a3763cb53eca63ea7bfb346ebe744",p.callServer,void 0,p.findSourceMapURL,"startReleaseAction"),b={detected:"neutral",evaluating:"neutral",proposed:"primary",publishing:"warning",published:"success",skipped:"neutral",error:"destructive"};function v({repoId:e,initialRuns:t}){let[s,l]=(0,d.useState)(t),[p,j]=(0,d.useState)(null),[y,w]=(0,d.useTransition)(),{error:N,success:S,info:k}=(0,h.d)(),A=(0,o.useRouter)();return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"})," Releases"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u.$,{variant:"outline",size:"sm",onClick:function(){w(async()=>{try{j(await x(e))}catch(e){N("Preview failed",e instanceof Error?e.message:String(e))}})},disabled:y,children:"Preview"}),(0,a.jsx)(u.$,{variant:"outline",size:"sm",onClick:function(){w(async()=>{try{let t=await g(e);l(t),j(null);let s=t[0];s?.status==="published"?S("Release published",s.tag?`Cut ${s.tag}.`:"A release was cut."):s?.status==="skipped"?k("No release cut","No release was recommended for the latest changes."):s?.status==="error"?N("Publish failed",s.errorMessage??"The release run did not complete."):k("Release started",`Run is ${s?.status??"in progress"}.`)}catch(e){N("Publish failed",e instanceof Error?e.message:String(e))}})},disabled:y,children:"Publish release"}),(0,a.jsxs)(u.$,{size:"sm",onClick:function(){w(async()=>{try{let{jobId:t,runs:s}=await f(e);l(s),j(null),k("Release started","An agent is figuring out and running this repo's release."),A.push(`/jobs/${t}`)}catch(e){N("Release failed to start",e instanceof Error?e.message:String(e))}})},disabled:y,children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5"})," Run release (agent)"]})]})]}),p&&(0,a.jsxs)("div",{className:"space-y-2 rounded-lg border border-card-border bg-secondary/30 p-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Proposed:"}),(0,a.jsx)(c.E,{tone:"primary",children:p.candidateTag}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[p.fromTag?`from ${p.fromTag}`:"first release"," \xb7 ",p.bump," \xb7"," ",p.shouldRelease?"release recommended":"no release recommended"]})]}),(0,a.jsxs)("ul",{className:"flex flex-col gap-0.5 text-xs text-muted-foreground",children:[p.prs.map(e=>(0,a.jsxs)("li",{className:"truncate",children:[(0,a.jsxs)("span",{className:"font-mono",children:["#",e.number]})," ",e.title]},e.number)),0===p.prs.length&&(0,a.jsx)("li",{children:"No unreleased pull requests."})]})]}),0===s.length?(0,a.jsx)(m.p,{compact:!0,icon:n.A,title:"No release runs yet",description:"Preview or publish a release to cut one from your merged work."}):(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:s.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-3 rounded-lg border border-border p-3",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-success"}),e.tag?(0,a.jsx)("span",{className:"font-mono text-sm font-semibold",children:e.tag}):(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.mode}),e.tag&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.mode}),null!=e.triggerPrNumber&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["PR #",e.triggerPrNumber]}),null!=e.jobId&&(0,a.jsx)(i(),{href:`/jobs/${e.jobId}`,className:"text-xs text-primary underline-offset-2 hover:underline",children:"job log"}),(0,a.jsx)(c.E,{tone:b[e.status]??"neutral",children:e.status}),e.errorMessage&&(0,a.jsx)("span",{className:"ml-auto max-w-[40%] truncate text-xs text-destructive",title:e.errorMessage,children:e.errorMessage})]},e.id))})]})}},5897:(e,t,s)=>{"use strict";s.d(t,{I:()=>r});var a=s(515),n=s(5832);function r({value:e,onChange:t,options:s,size:l="default",disabled:i=!1}){return(0,a.jsx)("div",{className:(0,n.cn)("inline-flex items-center gap-0.5 rounded-lg border border-border bg-secondary/50 p-0.5","sm"===l&&"text-xs"),children:s.map(s=>(0,a.jsx)("button",{type:"button",disabled:i,onClick:()=>t(s.value),className:(0,n.cn)("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-ring","disabled:cursor-not-allowed disabled:opacity-50",e===s.value?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}},6615:(e,t,s)=>{"use strict";s.d(t,{v:()=>n});var a=s(5097);let n=(0,a.createServerReference)("60126324f0952a224a0ab7a0fd69c420f6b2e1e458",a.callServer,void 0,a.findSourceMapURL,"loadTemplateAction")},8379:(e,t,s)=>{"use strict";s.d(t,{L:()=>l});var a=s(515),n=s(5832);let r={neutral:"bg-secondary text-muted-foreground",primary:"bg-primary/10 text-primary",success:"bg-success-muted text-success",warning:"bg-warning-muted text-warning",destructive:"bg-destructive/10 text-destructive"};function l({icon:e,legend:t,description:s,tone:i="neutral",children:o}){return(0,a.jsxs)("fieldset",{className:"rounded-lg border border-border p-4",children:[(0,a.jsxs)("legend",{className:"flex items-center gap-2 px-1",children:[(0,a.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md",r[i]),children:(0,a.jsx)(e,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("span",{className:"text-sm font-semibold",children:t})]}),s&&(0,a.jsx)("p",{className:"mb-3 mt-1 text-xs text-muted-foreground",children:s}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:o})]})}},9079:(e,t,s)=>{"use strict";s.d(t,{RepoAutomationBar:()=>P});var a=s(515),n=s(988),r=s(8652),l=s(6188),i=s(5166),o=s(6998),d=s(2655),c=s(8334),u=s(5595),m=s(1171),h=s(7241),p=s(9754),x=s(4783),g=s(7217),f=s(8379),b=s(7405),v=s(8067),j=s(1059),y=s(9),w=s(8479),N=s(5172),S=s(1837),k=s(4183);function A(e){try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function C(e){return[...new Set(e.split(/[,\n]/).map(e=>e.trim()).filter(Boolean))]}function R({label:e,help:t,checked:s,onChange:n,children:r}){return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(j.d,{checked:s,onChange:n,"aria-label":e}),(0,a.jsx)("span",{className:"text-sm",children:e}),t&&(0,a.jsx)(N.V,{content:t})]}),s&&r&&(0,a.jsx)("div",{className:"dd-fade-up mt-3 grid gap-3 border-l-2 border-border pl-4 sm:grid-cols-2",children:r})]})}function L({label:e,value:t,onChange:s,onBlur:n,help:r}){return(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[e,r&&(0,a.jsx)(N.V,{content:r})]}),children:(0,a.jsx)(b.p,{value:t,onChange:e=>s(e.target.value),onBlur:n,placeholder:"comma-separated",className:"h-8 font-mono text-xs"})})}function P({repo:e}){let[t,s]=(0,m.useState)(e.autoTriageEnabled),[M,D]=(0,m.useState)(e.autoProcessEnabled),[$,I]=(0,m.useState)(e.autoHealCi),[E,F]=(0,m.useState)(e.mergeWithoutChecks),[T,B]=(0,m.useState)(e.autoReviewFeedback),[O,q]=(0,m.useState)(e.autoDecompose),[z,U]=(0,m.useState)(e.planFirst),[V,H]=(0,m.useState)(e.verifyPr),[G,W]=(0,m.useState)(e.autoPrAudit),[_,J]=(0,m.useState)(e.prAuditAgent??("openrouter"===e.agent?"claude":e.agent)),[Q,Z]=(0,m.useState)(e.prAuditModel??(e.prAuditAgent&&e.prAuditAgent!==e.agent?(0,S.VJ)(e.prAuditAgent):e.defaultModel)),[K,X]=(0,m.useState)(e.prAuditLanguage),[Y,ee]=(0,m.useState)(e.prAuditPostOnPr),[et,es]=(0,m.useState)(e.autoHealDeployments),[ea,en]=(0,m.useState)(e.releaseEnabled),[er,el]=(0,m.useState)(e.autoResolveMergeConflicts),[ei,eo]=(0,m.useState)(e.includeProgressReplies),[ed,ec]=(0,m.useState)(A(e.readyLabels).join(", ")),[eu,em]=(0,m.useState)(A(e.blockingLabels).join(", ")),[eh,ep]=(0,m.useState)(A(e.autoLabelWhitelist).join(", ")),[ex,eg]=(0,m.useState)(A(e.priorityAuthors).join(", ")),[ef,eb]=(0,m.useState)(A(e.trustedReviewers).join(", ")),[ev,ej]=(0,m.useState)(A(e.trustedBots).join(", ")),[ey,ew]=(0,m.useState)(A(e.ignoredBots).join(", ")),[eN,eS]=(0,m.useState)(e.minAuthorAssociation),[ek,eA]=(0,m.useState)(e.deploymentPlatform??""),[eC,eR]=(0,m.useState)(e.maxAttempts),[eL,eP]=(0,m.useState)(e.escalateModelOnRetry),[eM,eD]=(0,m.useState)("docker"===e.sandbox),[e$,eI]=(0,m.useState)(e.sandboxImage??""),[eE,eF]=(0,m.useState)(e.sandboxAllowNetwork),[eT,eB]=(0,m.useState)(e.sandboxCpus??""),[eO,eq]=(0,m.useState)(e.sandboxMemory??""),[ez,eU]=(0,m.useState)(e.adoptClaudeMem),[eV,eH]=(0,m.useState)(e.agentInstructions??""),[eG,eW]=(0,m.useTransition)(),[e_,eJ]=(0,m.useState)(!1),{error:eQ}=(0,w.d)();function eZ(t){eJ(!1),eW(async()=>{try{await (0,k.u)(e.id,t),eJ(!0),setTimeout(()=>eJ(!1),1500)}catch(e){eQ("Failed to update automation",e instanceof Error?e.message:String(e))}})}return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(x.F,{tone:"info",icon:n.A,title:"Bounded & configurable",children:"Most stages are off by default and consume paid agent usage; PR review-feedback is on by default and can be turned off below. Drydock auto-merges a PR only once its configured gates pass — and merging a PR with no automated checks at all requires the explicit opt-in below."}),(0,a.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,a.jsx)(f.L,{icon:r.A,legend:"Triage",tone:"primary",description:"Classify and label brand-new issues.",children:(0,a.jsxs)(R,{label:"Auto-triage new issues",checked:t,onChange:e=>{s(e),eZ({autoTriageEnabled:e})},help:"Reads each new issue and applies whitelisted labels. Never processes — only classifies.",children:[(0,a.jsx)(L,{label:"Auto-label whitelist",value:eh,onChange:ep,onBlur:()=>eZ({autoLabelWhitelist:C(eh)}),help:"Triage may only apply labels from this list."}),(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Act on authors",(0,a.jsx)(N.V,{content:"Restrict automation to issues from trusted authors."})]}),children:(0,a.jsxs)(v.l,{value:eN,onChange:e=>{let t=e.target.value;eS(t),eZ({minAuthorAssociation:t})},className:"h-8 text-xs",children:[(0,a.jsx)("option",{value:"approved",children:"Owners / members / collaborators"}),(0,a.jsx)("option",{value:"any",children:"Anyone (public participation)"})]})})]})}),(0,a.jsxs)(f.L,{icon:l.A,legend:"Processing",tone:"primary",description:"Turn ready issues into pull requests.",children:[(0,a.jsxs)(R,{label:"Auto-process ready issues",checked:M,onChange:e=>{D(e),eZ({autoProcessEnabled:e})},help:"Works issues that are ready and not blocked, opening a PR for each.",children:[(0,a.jsx)(L,{label:"Ready labels",value:ed,onChange:ec,onBlur:()=>eZ({readyLabels:C(ed)}),help:"Only issues carrying one of these labels are eligible."}),(0,a.jsx)(L,{label:"Blocking labels",value:eu,onChange:em,onBlur:()=>eZ({blockingLabels:C(eu)}),help:"Any of these labels holds an issue back."}),(0,a.jsx)(L,{label:"Priority authors",value:ex,onChange:eg,onBlur:()=>eZ({priorityAuthors:C(ex)}),help:"Issues from these authors jump the queue."}),(0,a.jsx)(g.D,{label:"Max attempts",children:(0,a.jsx)(b.p,{type:"number",min:1,value:eC,onChange:e=>eR(Number(e.target.value)),onBlur:()=>eZ({maxAttempts:eC}),className:"h-8 w-24 text-xs"})})]}),(0,a.jsx)(R,{label:"Escalate model on retry",checked:eL,onChange:e=>{eP(e),eZ({escalateModelOnRetry:e})},help:"When a failed job is requeued, the next attempt runs the next-stronger model in this agent's ladder (capped at the strongest). Each attempt is priced at the model it actually ran."}),(0,a.jsx)(R,{label:"Decompose large issues",checked:O,onChange:e=>{q(e),eZ({autoDecompose:e})},help:"Splits big issues into ordered, tracked subtasks before working them."}),(0,a.jsx)(R,{label:"Plan before implementing",checked:z,onChange:e=>{U(e),eZ({planFirst:e})},help:"A read-only planning pass before implementation; the plan is posted on the issue and embedded in the work prompt. Falls back to a normal run on failure."}),(0,a.jsx)(R,{label:"Verify PR satisfies issue",checked:V,onChange:e=>{H(e),eZ({verifyPr:e})},help:"A read-only pass after the PR opens that checks the diff against the issue and flags gaps. Never changes state on failure."}),(0,a.jsxs)(R,{label:"Audit PRs with an AI review",checked:G,onChange:e=>{W(e),eZ({autoPrAudit:e})},help:"A read-only, whole-PR review (Bugbot/CodeRabbit style) posted on the issue after the PR opens. Advisory only — it never merges, blocks, or edits anything.",children:[(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Audit agent",(0,a.jsx)(N.V,{content:"CLI agent that runs the audit. Switching agents resets the audit model to that agent's default."})]}),children:(0,a.jsx)(h.a,{value:_,onChange:e=>{if("openrouter"===e)return;let t=(0,S.VJ)(e);J(e),Z(t),eZ({prAuditAgent:e,prAuditModel:t})},className:"h-8 text-xs"})}),(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Audit model",(0,a.jsx)(N.V,{content:"Model used for the audit run."})]}),children:(0,a.jsx)(p.o,{value:Q,onChange:e=>{Z(e),eZ({prAuditModel:e})},agent:_,className:"h-8 text-xs"})}),(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Review language",(0,a.jsx)(N.V,{content:"Language the review is written in (e.g. en, de, pt-BR). English is the default."})]}),children:(0,a.jsx)(b.p,{value:K,onChange:e=>X(e.target.value),onBlur:()=>{let e=K.trim()||"en";(X(e),/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{1,8})*$/.test(e))?eZ({prAuditLanguage:e}):eQ("Invalid review language",`"${e}" is not a language code — use a simple or BCP 47 code like en, de, or pt-BR.`)},placeholder:"en",className:"h-8 w-24 font-mono text-xs"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 self-end pb-1.5",children:[(0,a.jsx)(j.d,{checked:Y,onChange:e=>{ee(e),eZ({prAuditPostOnPr:e})},"aria-label":"Also comment on the PR"}),(0,a.jsx)("span",{className:"text-sm",children:"Also comment on the PR"}),(0,a.jsx)(N.V,{content:"Mirror the review on the pull request in addition to the issue."})]})]}),(0,a.jsxs)(R,{label:"Address PR review feedback",checked:T,onChange:e=>{B(e),eZ({autoReviewFeedback:e})},help:"Runs the mechanical iteration for trusted reviewers and allowlisted bots.",children:[(0,a.jsx)(L,{label:"Trusted reviewers",value:ef,onChange:eb,onBlur:()=>eZ({trustedReviewers:C(ef)}),help:"Only feedback from these reviewers is acted on."}),(0,a.jsx)(L,{label:"Trusted bots",value:ev,onChange:ej,onBlur:()=>eZ({trustedBots:C(ev)}),help:"Bot reviewers (e.g. cursor[bot]) whose findings are acted on. Bots not listed here are ignored."}),(0,a.jsx)(L,{label:"Ignored bots",value:ey,onChange:ew,onBlur:()=>eZ({ignoredBots:C(ey)}),help:"Review comments from these bots are always skipped, even if also listed as trusted."})]}),(0,a.jsx)(R,{label:"Repair trivial merge conflicts",checked:er,onChange:e=>{el(e),eZ({autoResolveMergeConflicts:e})},help:"Rebases and resolves mechanical conflicts; complex ones still escalate."})]}),(0,a.jsxs)(f.L,{icon:i.A,legend:"CI & deploy healing",tone:"warning",description:"Keep checks and deployments green.",children:[(0,a.jsx)(R,{label:"Auto-heal failing CI",checked:$,onChange:e=>{I(e),eZ({autoHealCi:e})},help:"Attempts bounded, verified fixes for failing CI. Never touches external or AI-review checks."}),(0,a.jsx)(R,{label:"Merge PRs with no CI checks",checked:E,onChange:e=>{F(e),eZ({mergeWithoutChecks:e})},help:"For repos with manual-only or review-bot-only CI. After the merge-gate settle window, merges a PR that reports no checks at all — with NO automated verification. Leave off unless this repo truly has no automated CI."}),(0,a.jsx)(R,{label:"Heal failed deployments",checked:et,onChange:e=>{es(e),eZ({autoHealDeployments:e})},help:"Monitors a merged PR's deployment and, on failure, opens a follow-up fix PR with the captured logs.",children:(0,a.jsx)(g.D,{label:"Deployment platform",children:(0,a.jsxs)(v.l,{value:ek,onChange:e=>{let t=e.target.value;eA(t),eZ({deploymentPlatform:t||null})},className:"h-8 text-xs",children:[(0,a.jsx)("option",{value:"",children:"Auto-detect"}),(0,a.jsx)("option",{value:"vercel",children:"Vercel"}),(0,a.jsx)("option",{value:"railway",children:"Railway"})]})})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(f.L,{icon:o.A,legend:"Releases",tone:"success",description:"Cut releases from merged work.",children:(0,a.jsx)(R,{label:"Manage releases",checked:ea,onChange:e=>{en(e),eZ({releaseEnabled:e})},help:"Evaluates merged PRs since the last tag, picks the semver bump, and publishes — gated by a global kill-switch and fully previewable."})}),(0,a.jsx)(f.L,{icon:d.A,legend:"Sandbox",tone:"warning",description:"Isolate agent execution in a container.",children:(0,a.jsxs)(R,{label:"Run the agent in a container",checked:eM,onChange:e=>{eD(e),eZ({sandbox:e?"docker":"none"})},help:"Runs this repo's agent sessions inside a container with the worktree bind-mounted as the only writable host path. Requires Docker or Podman on the host and an image that carries the agent CLI plus the repo's toolchain (devcontainer.json image is used if present). Git push still happens on the host.",children:[(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Image override",(0,a.jsx)(N.V,{content:"Container image to run in. Leave blank to use the repo's devcontainer.json image, else the global default image from Settings."})]}),children:(0,a.jsx)(b.p,{value:e$,onChange:e=>eI(e.target.value),onBlur:()=>eZ({sandboxImage:e$.trim()||null}),placeholder:"devcontainer / global default",className:"h-8 font-mono text-xs"})}),(0,a.jsx)(g.D,{label:(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["Resource caps",(0,a.jsx)(N.V,{content:"Optional --cpus and --memory limits (e.g. 2 and 4g). Leave blank for no limit."})]}),children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(b.p,{value:eT,onChange:e=>eB(e.target.value),onBlur:()=>{let e=eT.trim();e&&!/^\d+(\.\d+)?$/.test(e)?eQ("Invalid CPU limit","Use a positive number like 0.5, 1, or 2."):eZ({sandboxCpus:e||null})},placeholder:"cpus",className:"h-8 w-20 font-mono text-xs"}),(0,a.jsx)(b.p,{value:eO,onChange:e=>eq(e.target.value),onBlur:()=>{let e=eO.trim();e&&!/^\d+(\.\d+)?\s*[bkmg]?$/i.test(e)?eQ("Invalid memory limit","Use a value like 512m, 2g, or 4096."):eZ({sandboxMemory:e||null})},placeholder:"memory",className:"h-8 w-24 font-mono text-xs"})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 self-end pb-1.5 sm:col-span-2",children:[(0,a.jsx)(j.d,{checked:eE,onChange:e=>{eF(e),eZ({sandboxAllowNetwork:e})},"aria-label":"Allow network access"}),(0,a.jsx)("span",{className:"text-sm",children:"Allow network access"}),(0,a.jsx)(N.V,{content:"Off (default) runs the container with --network none. Turn on only if the toolchain must fetch dependencies during the run."})]})]})}),(0,a.jsx)(f.L,{icon:c.A,legend:"Memory",description:"Carry agent memory back to the parent project.",children:(0,a.jsx)(R,{label:"Adopt claude-mem memory on cleanup",checked:ez,onChange:e=>{eU(e),eZ({adoptClaudeMem:e})},help:"Requires the claude-mem plugin. Before a job's throwaway worktree is removed, runs claude-mem's adoption so a merged job's memory is consolidated into the parent project instead of being stranded in a per-worktree bucket. Best-effort: skipped silently if claude-mem is not installed."})}),(0,a.jsx)(f.L,{icon:u.A,legend:"Notifications",description:"How Drydock talks back on the issue.",children:(0,a.jsx)(R,{label:"Post progress replies",checked:ei,onChange:e=>{eo(e),eZ({includeProgressReplies:e})},help:"Comments status updates on the issue as the job advances."})})]})]}),(0,a.jsx)(g.D,{label:"Agent instructions",hint:(0,a.jsxs)(a.Fragment,{children:["Optional. Appended to the work prompt as a dedicated section — coding conventions, “always run pnpm test”, “don’t touch legacy/”, preferred PR style. Max ",4e3," characters; empty leaves the prompt unchanged."]}),children:(0,a.jsx)(y.T,{value:eV,maxLength:4e3,rows:3,onChange:e=>eH(e.target.value),onBlur:()=>eZ({agentInstructions:eV.trim()||null}),placeholder:"Per-repo guidance injected into the work prompt…",className:"font-mono text-xs"})}),(0,a.jsx)("div",{"aria-live":"polite",className:"h-4 text-xs text-muted-foreground",children:eG?"Saving…":e_?"Saved":""})]})}}},e=>{e.O(0,[9843,8264,8745,6634,3433,8382,3894,9655,4234,7358],()=>e(e.s=4602)),_N_E=e.O()}]);