chorus-codes 0.8.44 → 0.8.46

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 (154) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -1
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/connect/page.js +1 -1
  24. package/.next/server/app/connect/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/demo/[scenario]/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/new/page.js +1 -1
  27. package/.next/server/app/new/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/new.html +1 -1
  29. package/.next/server/app/new.rsc +3 -3
  30. package/.next/server/app/new.segments/_full.segment.rsc +3 -3
  31. package/.next/server/app/new.segments/_head.segment.rsc +1 -1
  32. package/.next/server/app/new.segments/_index.segment.rsc +2 -2
  33. package/.next/server/app/new.segments/_tree.segment.rsc +2 -2
  34. package/.next/server/app/new.segments/new/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/new.segments/new.segment.rsc +1 -1
  36. package/.next/server/app/onboarding/page.js +2 -2
  37. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/onboarding.html +1 -1
  39. package/.next/server/app/onboarding.rsc +3 -3
  40. package/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
  41. package/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
  43. package/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  44. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +2 -2
  45. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  46. package/.next/server/app/page.js +1 -1
  47. package/.next/server/app/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/personas/page_client-reference-manifest.js +1 -1
  49. package/.next/server/app/personas.html +1 -1
  50. package/.next/server/app/personas.rsc +3 -3
  51. package/.next/server/app/personas.segments/_full.segment.rsc +3 -3
  52. package/.next/server/app/personas.segments/_head.segment.rsc +1 -1
  53. package/.next/server/app/personas.segments/_index.segment.rsc +2 -2
  54. package/.next/server/app/personas.segments/_tree.segment.rsc +2 -2
  55. package/.next/server/app/personas.segments/personas/__PAGE__.segment.rsc +2 -2
  56. package/.next/server/app/personas.segments/personas.segment.rsc +1 -1
  57. package/.next/server/app/runs/[runId]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/settings/page.js +2 -2
  60. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/settings/permissions/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/settings.html +1 -1
  63. package/.next/server/app/settings.rsc +3 -3
  64. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  65. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  66. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  67. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  68. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  69. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  70. package/.next/server/app/templates/page.js +1 -1
  71. package/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app/templates.html +1 -1
  73. package/.next/server/app/templates.rsc +3 -3
  74. package/.next/server/app/templates.segments/_full.segment.rsc +3 -3
  75. package/.next/server/app/templates.segments/_head.segment.rsc +1 -1
  76. package/.next/server/app/templates.segments/_index.segment.rsc +2 -2
  77. package/.next/server/app/templates.segments/_tree.segment.rsc +2 -2
  78. package/.next/server/app/templates.segments/templates/__PAGE__.segment.rsc +2 -2
  79. package/.next/server/app/templates.segments/templates.segment.rsc +1 -1
  80. package/.next/server/app-paths-manifest.json +1 -1
  81. package/.next/server/chunks/189.js +1 -1
  82. package/.next/server/chunks/325.js +1 -1
  83. package/.next/server/chunks/642.js +1 -1
  84. package/.next/server/chunks/681.js +1 -1
  85. package/.next/server/middleware-build-manifest.js +1 -1
  86. package/.next/server/pages/404.html +1 -1
  87. package/.next/server/pages/500.html +1 -1
  88. package/.next/server/server-reference-manifest.json +1 -1
  89. package/.next/static/chunks/245-f3d2948b0049e981.js +1 -0
  90. package/.next/static/chunks/{641-66f3ba81d2479b02.js → 641-81dca4fb9dc808be.js} +1 -1
  91. package/.next/static/chunks/744-c2e8529e7a5b0221.js +1 -0
  92. package/.next/static/chunks/app/connect/page-14d8e3fa9505959f.js +1 -0
  93. package/.next/static/chunks/app/new/page-4452a15141b14ef3.js +1 -0
  94. package/.next/static/chunks/app/onboarding/page-cc53c4eeeb372cda.js +1 -0
  95. package/.next/static/chunks/app/page-de91de3476faae94.js +1 -0
  96. package/.next/static/chunks/app/settings/page-9e139cc529c0a91c.js +25 -0
  97. package/.next/static/chunks/app/templates/page-4984d1f588c30038.js +1 -0
  98. package/.next/static/css/e8fdba3e08fd4c61.css +3 -0
  99. package/.next/trace +20 -20
  100. package/.next/trace-build +1 -1
  101. package/dist/cli/commands/doctor.js +1 -0
  102. package/dist/cli/commands/doctor.js.map +1 -1
  103. package/dist/cli/commands/init.js +1 -0
  104. package/dist/cli/commands/init.js.map +1 -1
  105. package/dist/cli/commands/quickstart.js +1 -0
  106. package/dist/cli/commands/quickstart.js.map +1 -1
  107. package/dist/daemon/agents/antigravity.js +87 -0
  108. package/dist/daemon/agents/antigravity.js.map +1 -0
  109. package/dist/daemon/agents/index.js +4 -1
  110. package/dist/daemon/agents/index.js.map +1 -1
  111. package/dist/daemon/agents/parsers/antigravity.js +119 -0
  112. package/dist/daemon/agents/parsers/antigravity.js.map +1 -0
  113. package/dist/daemon/agents/parsers/index.js +4 -1
  114. package/dist/daemon/agents/parsers/index.js.map +1 -1
  115. package/dist/daemon/chat-gate.js +285 -0
  116. package/dist/daemon/chat-gate.js.map +1 -0
  117. package/dist/daemon/error-detector.js +20 -2
  118. package/dist/daemon/error-detector.js.map +1 -1
  119. package/dist/daemon/resource-stats.js +80 -0
  120. package/dist/daemon/resource-stats.js.map +1 -0
  121. package/dist/daemon/routes/settings.js +54 -0
  122. package/dist/daemon/routes/settings.js.map +1 -1
  123. package/dist/daemon/runner.js +48 -0
  124. package/dist/daemon/runner.js.map +1 -1
  125. package/dist/lib/cli-detect.js +9 -0
  126. package/dist/lib/cli-detect.js.map +1 -1
  127. package/dist/lib/cli-health.js +1 -0
  128. package/dist/lib/cli-health.js.map +1 -1
  129. package/dist/lib/cli-paths.js +1 -0
  130. package/dist/lib/cli-paths.js.map +1 -1
  131. package/dist/lib/cli-precheck.js +9 -0
  132. package/dist/lib/cli-precheck.js.map +1 -1
  133. package/dist/lib/db/voices.js +1 -1
  134. package/dist/lib/db/voices.js.map +1 -1
  135. package/dist/lib/lineage-maps.js +31 -0
  136. package/dist/lib/lineage-maps.js.map +1 -1
  137. package/dist/lib/settings/chat-concurrency.js +104 -0
  138. package/dist/lib/settings/chat-concurrency.js.map +1 -0
  139. package/dist/lib/template-schema.js +2 -2
  140. package/dist/lib/template-schema.js.map +1 -1
  141. package/dist/lib/voices.js +6 -0
  142. package/dist/lib/voices.js.map +1 -1
  143. package/package.json +1 -1
  144. package/.next/static/chunks/245-686f2a9a3d4d5554.js +0 -1
  145. package/.next/static/chunks/744-a5a2f718e91700bd.js +0 -1
  146. package/.next/static/chunks/app/connect/page-e216744a2daa061b.js +0 -1
  147. package/.next/static/chunks/app/new/page-d65ea7687a1b37ad.js +0 -1
  148. package/.next/static/chunks/app/onboarding/page-9f2b388be3008bdc.js +0 -1
  149. package/.next/static/chunks/app/page-75f1f750029680bd.js +0 -1
  150. package/.next/static/chunks/app/settings/page-e2f6b190d3794681.js +0 -25
  151. package/.next/static/chunks/app/templates/page-0cfb5ce79f29fcd5.js +0 -1
  152. package/.next/static/css/a2b7a8d35dba10d3.css +0 -3
  153. /package/.next/static/{wtStgSmENkySuN6zbUBM6 → W97_xq3XcOw4uiCeSVQNz}/_buildManifest.js +0 -0
  154. /package/.next/static/{wtStgSmENkySuN6zbUBM6 → W97_xq3XcOw4uiCeSVQNz}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[641],{1993:(e,t,n)=>{n.d(t,{K7:()=>d,UT:()=>r,dW:()=>o,qI:()=>s});var i=n(4411);function a(e){return{id:e.id,label:e.label,one_liner:e.one_liner,system_prompt:e.system_prompt,recommended_lineage:e.recommended_lineage,builtin:!!e.builtin,forked_from:e.forked_from??null,created_at:e.created_at,updated_at:e.updated_at}}async function r(){return(await (0,i.T)("/personas")).items.map(a)}async function o(e){return a(await (0,i.T)(`/personas/${encodeURIComponent(e)}`))}async function s(e){return a(await (0,i.T)("/personas",{method:"POST",body:JSON.stringify(e)}))}async function d(e){await (0,i.T)(`/personas/${encodeURIComponent(e)}`,{method:"DELETE"})}},4284:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(9442);function a({className:e}){return(0,i.jsxs)("svg",{viewBox:"0 0 32 32","aria-hidden":"true",className:e,fill:"currentColor",children:[(0,i.jsx)("circle",{cx:"11",cy:"20",r:"3.2",fillOpacity:"0.55"}),(0,i.jsx)("circle",{cx:"21",cy:"20",r:"3.2",fillOpacity:"0.55"}),(0,i.jsx)("circle",{cx:"16",cy:"11",r:"3.2"})]})}},4411:(e,t,n)=>{n.d(t,{$:()=>r,T:()=>o}),n(9298);let i="/api/v1";async function a(){return new URL("/api/daemon",window.location.origin).toString()}class r extends Error{constructor(e,t,n,i){super(n),this.code=e,this.statusCode=t,this.details=i,this.name="DaemonError"}}async function o(e,t={}){let n=await a(),s=e.startsWith("/")?e:`/${e}`,d=s===i||s.startsWith(`${i}/`)?s:`${i}${s}`,c=`${n.replace(/\/$/,"")}${d}`;try{let e=await fetch(c,{...t,headers:{"Content-Type":"application/json",...t.headers}}),n=await e.json().catch(()=>({ok:!1,error:{code:"parse_error",message:"Failed to parse response"}}));if(!n.ok){if("string"==typeof n.error&&"string"==typeof n.message)throw new r(n.error,e.status,n.message);throw new r(n.error?.code||"unknown",e.status,n.error?.message||`Daemon returned ${e.status}`,n.error?.details)}return n.data}catch(e){if(e instanceof r)throw e;if(e instanceof TypeError&&e.message.includes("fetch"))throw new r("connection_failed",0,"Failed to connect to Chorus daemon. Is it running?");throw new r("unknown",0,e instanceof Error?e.message:"Unknown error")}}},6185:(e,t,n)=>{n.d(t,{$v:()=>i.$,jb:()=>w.jb,RL:()=>s,K7:()=>v.K7,I7:()=>y,dW:()=>v.dW,Ih:()=>o,UT:()=>v.UT,eG:()=>f,qI:()=>v.qI,AI:()=>h,Xx:()=>g.Xx,WH:()=>g.WH});var i=n(4411),a=n(9345);function r(e){let t,n;if(e.attached_files)try{let n=JSON.parse(e.attached_files);Array.isArray(n)&&(t=n)}catch{}if(e.template_snapshot)try{let t=JSON.parse(e.template_snapshot),i=a._i.safeParse(t);i.success&&(n={...i.data,phases:i.data.phases.map(e=>({...e,reviewer:e.reviewer?{...e.reviewer,candidatesWithModels:e.reviewer.candidatesWithModels??(e.reviewer.candidates??[]).map(e=>({lineage:e.lineage,models:e.models??[],...void 0!==e.persona?{persona:e.persona}:{}}))}:e.reviewer}))})}catch{}return{id:e.id,slug:e.slug??void 0,work:e.work,templateId:e.template_id,status:e.status,currentPhaseIdx:e.current_phase_idx??0,yolo:!!e.yolo,attachedFiles:t,repoPath:e.repo_path??void 0,prUrl:e.pr_url??void 0,shipError:e.ship_error??void 0,artifact:e.artifact??void 0,verdict:e.verdict??void 0,templateSnapshot:n,createdAt:e.created_at,updatedAt:e.updated_at,finishedAt:e.finished_at??void 0}}async function o(e){let t=new URLSearchParams;e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString()),e?.status&&t.append("status",e.status);let n=t.toString();return(await (0,i.T)(`/chats${n?`?${n}`:""}`)).items.map(r)}async function s(e){return r(await (0,i.T)("/chats",{method:"POST",body:JSON.stringify(e)}))}var d=n(599);let c=new Set(["anthropic","openai","google","opencode","moonshot","any","xai"]),l={anthropic:"claude",openai:"codex",google:"gemini",opencode:"opencode",moonshot:"kimi",any:"claude",xai:"opencode"};function u(e){return e?l[e]??"claude":"claude"}function p(e){let t=e.kind??"review";return{id:e.id??"phase",name:e.title??e.name??e.id??"Phase",description:e.description??"",kind:t,gate:"auto",doer:{lineage:u(e.doer?.lineage),models:e.doer?.models??[],...e.doer?.persona?{persona:e.doer.persona}:{}},reviewer:{require:e.reviewer?.require??1,crossLineage:e.reviewer?.crossLineage??!0,candidates:(e.reviewer?.candidates??[]).map(e=>u(e.lineage)).filter(e=>c.has(Object.keys(l).find(t=>l[t]===e)??"")),candidatesWithModels:(e.reviewer?.candidates??[]).map(e=>({lineage:u(e.lineage),models:e.models??[],...e.persona?{persona:e.persona}:{}}))},inputs:{include:e.inputs?.include??[],exclude:e.inputs?.exclude??[]},iterate:{max:e.iterate?.maxRounds??2,onMax:"ask-user"},blindSpots:[],execution:"parallel",builtin:!0,..."review_only"===t?{artifact:{label:e.artifact?.label??"Artifact to review",hint:e.artifact?.hint??"Paste a unified diff, a markdown draft, code, or any text blob.",maxBytes:e.artifact?.maxBytes??1048576}}:{}}}function m(e){let t={};try{t=d.Ay.parse(e.yaml)??{}}catch{}let n="majority";"number"==typeof t.agreementThreshold?n=t.agreementThreshold>=.99?"unanimous":t.agreementThreshold>=.5?"majority":"any":"string"==typeof t.agreementThreshold&&(n=t.agreementThreshold);let i=(t.phases??[]).map(p);return{id:e.id,name:t.name??e.id,description:t.description??"",category:function(e,t){if(e.category)return e.category;let n=t.toLowerCase();return n.includes("bug")||n.includes("debug")||n.includes("diagnose")?"debug":n.includes("plan")||n.includes("architect")?"plan":n.includes("decide")||n.includes("decision")?"decide":"review"}(t,e.id),phases:i,agreementThreshold:n,onThresholdMet:"auto-finalize"===t.onThresholdMet?"auto-finalize":"ask-user",maxRounds:t.maxRounds??3,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:t.yoloDefault??!1,estimatedBaselineTokens:t.estimatedBaselineTokens,onError:"ask-user",notify:"dashboard-only",yaml:e.yaml,authorHandle:t.author??"chorus",forks:0,popularity:0,source:e.source,isComplete:"number"==typeof e.is_complete?0!==e.is_complete:!1!==e.is_complete}}async function f(){return(await (0,i.T)("/templates")).items.map(m)}async function h(e){return m(await (0,i.T)("/templates",{method:"POST",body:JSON.stringify(e)}))}async function y(e){await (0,i.T)(`/templates/${encodeURIComponent(e)}`,{method:"DELETE"})}var g=n(6441),w=n(8141),v=n(1993);n(7847)},6441:(e,t,n)=>{n.d(t,{A1:()=>f,Ci:()=>h,Df:()=>o,Dl:()=>m,Ep:()=>s,WH:()=>g,WK:()=>y,Wt:()=>p,Xx:()=>d,fk:()=>a,iW:()=>r,lT:()=>u,nr:()=>l,oD:()=>c});var i=n(4411);async function a(){return(await (0,i.T)("/onboard/detect-clis")).items}async function r(e,t){return(0,i.T)("/onboard/validate-cli-path",{method:"POST",body:JSON.stringify({id:e,path:t})})}async function o(e,t){return(0,i.T)("/onboard/save-cli-path",{method:"POST",body:JSON.stringify({id:e,path:t})})}async function s(e){return(0,i.T)("/settings/permissions",{method:"PUT",body:JSON.stringify(e)})}async function d(e){return(0,i.T)("/settings",{method:"PUT",body:JSON.stringify(e)})}async function c(){return(0,i.T)("/settings/transport")}async function l(e){return(0,i.T)("/settings/transport",{method:"PUT",body:JSON.stringify(e)})}async function u(){return(0,i.T)("/settings/concurrency")}async function p(e){return(0,i.T)("/settings/concurrency",{method:"PUT",body:JSON.stringify(e)})}async function m(){return(0,i.T)("/settings/billing")}async function f(e){return(0,i.T)("/settings/billing",{method:"PUT",body:JSON.stringify(e)})}async function h(){return(0,i.T)("/settings/telemetry")}async function y(e){return(0,i.T)("/settings/telemetry",{method:"PUT",body:JSON.stringify({enabled:e})})}async function g(e,t){return(0,i.T)(`/secrets/${e}`,{method:"PUT",body:JSON.stringify(t)})}},7362:(e,t,n)=>{n.d(t,{cn:()=>r});var i=n(142),a=n(9317);function r(...e){return(0,a.QP)((0,i.$)(e))}},7847:(e,t,n)=>{n.d(t,{createVoice:()=>o,listVoices:()=>a,updateVoice:()=>r});var i=n(4411);async function a(e){return(await (0,i.T)(`/voices${function(e){if(!e)return"";let t=[];return e.lineage&&t.push(`lineage=${encodeURIComponent(e.lineage)}`),e.source&&t.push(`source=${encodeURIComponent(e.source)}`),e.provider&&t.push(`provider=${encodeURIComponent(e.provider)}`),void 0!==e.enabled&&t.push(`enabled=${e.enabled?"true":"false"}`),0===t.length?"":`?${t.join("&")}`}(e)}`)).items}async function r(e,t){return(0,i.T)(`/voices/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function o(e){return(0,i.T)("/voices",{method:"POST",body:JSON.stringify(e)})}},8141:(e,t,n)=>{n.d(t,{Ay:()=>r,jb:()=>a});var i=n(4411);async function a(e){return(0,i.T)(`/orchestrators/${e}/connect`,{method:"POST"})}async function r(){return(0,i.T)("/orchestrators/opencode/models")}},9345:(e,t,n)=>{n.d(t,{_i:()=>f});var i=n(5097),a=n(4747);let r=i.ai().int().min(3e4).max(36e5).optional(),o=i.k5(["anthropic","openai","google","opencode","moonshot","openrouter","local","grok","any"]),s=i.k5(["anthropic","openai","google","opencode","moonshot","openrouter","local","grok"]),d=i.Ik({require:i.ai().int().min(0).default(1),crossLineage:i.zM().default(!0),candidates:i.YO(i.Ik({lineage:s,models:i.YO(i.Yj()).optional(),persona:i.Yj().optional()}))}).superRefine((e,t)=>{if(e.require>e.candidates.length&&t.addIssue({code:a.eq.custom,path:["require"],message:`reviewer.require (${e.require}) cannot exceed reviewer.candidates.length (${e.candidates.length}). Either lower require or add more candidates.`}),e.crossLineage&&e.require>0){let n=new Set(e.candidates.map(e=>e.lineage)).size;e.require>n&&t.addIssue({code:a.eq.custom,path:["require"],message:`reviewer.require (${e.require}) exceeds distinct lineages (${n}) in candidates with crossLineage=true. Either lower require, disable crossLineage, or add candidates from more lineages.`})}}),c=i.Ik({include:i.YO(i.Yj()).default([]),exclude:i.YO(i.Yj()).default([])}).default({include:[],exclude:[]}),l=i.Ik({maxRounds:i.ai().int().min(1).default(2),onDisagreement:i.k5(["continue","escalate","accept-doer"]).default("continue"),shareSessionAcrossRounds:i.zM().default(!0),shareSessionAcrossPhases:i.zM().default(!1)}).default({maxRounds:2,onDisagreement:"continue",shareSessionAcrossRounds:!0,shareSessionAcrossPhases:!1}),u=i.Ik({id:i.Yj().min(1),kind:i.k5(["plan","spec","tests","implement","review","verify","divergence"]),title:i.Yj().min(1),description:i.Yj().optional(),doer:i.Ik({lineage:o,models:i.YO(i.Yj()).optional(),persona:i.Yj().optional()}),reviewer:d.optional(),inputs:c,iterate:l,timeoutMs:r}),p=i.Ik({id:i.Yj().min(1),kind:i.eu("review_only"),title:i.Yj().min(1),description:i.Yj().optional(),reviewer:d,artifact:i.Ik({label:i.Yj().min(1).default("Artifact to review"),hint:i.Yj().default("Paste a unified diff, a markdown draft, code, or any text blob."),maxBytes:i.ai().int().min(1).default(1048576)}).default({label:"Artifact to review",hint:"Paste a unified diff, a markdown draft, code, or any text blob.",maxBytes:1048576}),inputs:c,timeoutMs:r}),m=i.gM("kind",[u.extend({kind:i.eu("plan")}),u.extend({kind:i.eu("spec")}),u.extend({kind:i.eu("tests")}),u.extend({kind:i.eu("implement")}),u.extend({kind:i.eu("review")}),u.extend({kind:i.eu("verify")}),u.extend({kind:i.eu("divergence")}),p]),f=i.Ik({id:i.Yj().min(1),name:i.Yj().min(1),description:i.Yj().min(1),author:i.Yj().default("chorus"),agreementThreshold:i.ai().min(0).max(1).default(.66),onThresholdMet:i.k5(["merge","ask","review"]).default("ask"),maxRounds:i.ai().int().min(1).default(3),yoloDefault:i.zM().default(!1),estimatedBaselineTokens:i.ai().int().min(0).optional(),phases:i.YO(m).min(1).refine(e=>{let t=e.filter(e=>"review_only"===e.kind).length;return 0===t||1===t&&1===e.length},{message:"review_only phases cannot be mixed with other phase kinds and only one is allowed (hybrid templates are out of scope)"}).refine(e=>{let t=e.map(e=>e.id);return new Set(t).size===t.length},{message:"phase ids must be unique"}),ship:i.Ik({enabled:i.zM().default(!1),baseBranch:i.Yj().optional(),branchPattern:i.Yj().default("chorus/{chatId}"),titleTemplate:i.Yj().default("chorus: {template} via #{chatId}")}).optional(),fallback:i.Ik({doer:i.YO(i.Ik({lineage:o,models:i.YO(i.Yj()).min(1),persona:i.Yj().optional()})).optional(),reviewer:i.YO(i.Ik({lineage:s,models:i.YO(i.Yj()).min(1),persona:i.Yj().optional()})).optional()}).optional()})}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[641],{1993:(e,t,n)=>{n.d(t,{K7:()=>d,UT:()=>r,dW:()=>o,qI:()=>s});var i=n(4411);function a(e){return{id:e.id,label:e.label,one_liner:e.one_liner,system_prompt:e.system_prompt,recommended_lineage:e.recommended_lineage,builtin:!!e.builtin,forked_from:e.forked_from??null,created_at:e.created_at,updated_at:e.updated_at}}async function r(){return(await (0,i.T)("/personas")).items.map(a)}async function o(e){return a(await (0,i.T)(`/personas/${encodeURIComponent(e)}`))}async function s(e){return a(await (0,i.T)("/personas",{method:"POST",body:JSON.stringify(e)}))}async function d(e){await (0,i.T)(`/personas/${encodeURIComponent(e)}`,{method:"DELETE"})}},4284:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(9442);function a({className:e}){return(0,i.jsxs)("svg",{viewBox:"0 0 32 32","aria-hidden":"true",className:e,fill:"currentColor",children:[(0,i.jsx)("circle",{cx:"11",cy:"20",r:"3.2",fillOpacity:"0.55"}),(0,i.jsx)("circle",{cx:"21",cy:"20",r:"3.2",fillOpacity:"0.55"}),(0,i.jsx)("circle",{cx:"16",cy:"11",r:"3.2"})]})}},4411:(e,t,n)=>{n.d(t,{$:()=>r,T:()=>o}),n(9298);let i="/api/v1";async function a(){return new URL("/api/daemon",window.location.origin).toString()}class r extends Error{constructor(e,t,n,i){super(n),this.code=e,this.statusCode=t,this.details=i,this.name="DaemonError"}}async function o(e,t={}){let n=await a(),s=e.startsWith("/")?e:`/${e}`,d=s===i||s.startsWith(`${i}/`)?s:`${i}${s}`,c=`${n.replace(/\/$/,"")}${d}`;try{let e=await fetch(c,{...t,headers:{"Content-Type":"application/json",...t.headers}}),n=await e.json().catch(()=>({ok:!1,error:{code:"parse_error",message:"Failed to parse response"}}));if(!n.ok){if("string"==typeof n.error&&"string"==typeof n.message)throw new r(n.error,e.status,n.message);throw new r(n.error?.code||"unknown",e.status,n.error?.message||`Daemon returned ${e.status}`,n.error?.details)}return n.data}catch(e){if(e instanceof r)throw e;if(e instanceof TypeError&&e.message.includes("fetch"))throw new r("connection_failed",0,"Failed to connect to Chorus daemon. Is it running?");throw new r("unknown",0,e instanceof Error?e.message:"Unknown error")}}},6185:(e,t,n)=>{n.d(t,{$v:()=>i.$,jb:()=>w.jb,RL:()=>s,K7:()=>v.K7,I7:()=>y,dW:()=>v.dW,Ih:()=>o,UT:()=>v.UT,eG:()=>f,qI:()=>v.qI,AI:()=>h,Xx:()=>g.Xx,WH:()=>g.WH});var i=n(4411),a=n(9345);function r(e){let t,n;if(e.attached_files)try{let n=JSON.parse(e.attached_files);Array.isArray(n)&&(t=n)}catch{}if(e.template_snapshot)try{let t=JSON.parse(e.template_snapshot),i=a._i.safeParse(t);i.success&&(n={...i.data,phases:i.data.phases.map(e=>({...e,reviewer:e.reviewer?{...e.reviewer,candidatesWithModels:e.reviewer.candidatesWithModels??(e.reviewer.candidates??[]).map(e=>({lineage:e.lineage,models:e.models??[],...void 0!==e.persona?{persona:e.persona}:{}}))}:e.reviewer}))})}catch{}return{id:e.id,slug:e.slug??void 0,work:e.work,templateId:e.template_id,status:e.status,currentPhaseIdx:e.current_phase_idx??0,yolo:!!e.yolo,attachedFiles:t,repoPath:e.repo_path??void 0,prUrl:e.pr_url??void 0,shipError:e.ship_error??void 0,artifact:e.artifact??void 0,verdict:e.verdict??void 0,templateSnapshot:n,createdAt:e.created_at,updatedAt:e.updated_at,finishedAt:e.finished_at??void 0}}async function o(e){let t=new URLSearchParams;e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString()),e?.status&&t.append("status",e.status);let n=t.toString();return(await (0,i.T)(`/chats${n?`?${n}`:""}`)).items.map(r)}async function s(e){return r(await (0,i.T)("/chats",{method:"POST",body:JSON.stringify(e)}))}var d=n(599);let c=new Set(["anthropic","openai","google","opencode","moonshot","any","xai"]),l={anthropic:"claude",openai:"codex",google:"gemini",opencode:"opencode",moonshot:"kimi",any:"claude",xai:"opencode"};function u(e){return e?l[e]??"claude":"claude"}function p(e){let t=e.kind??"review";return{id:e.id??"phase",name:e.title??e.name??e.id??"Phase",description:e.description??"",kind:t,gate:"auto",doer:{lineage:u(e.doer?.lineage),models:e.doer?.models??[],...e.doer?.persona?{persona:e.doer.persona}:{}},reviewer:{require:e.reviewer?.require??1,crossLineage:e.reviewer?.crossLineage??!0,candidates:(e.reviewer?.candidates??[]).map(e=>u(e.lineage)).filter(e=>c.has(Object.keys(l).find(t=>l[t]===e)??"")),candidatesWithModels:(e.reviewer?.candidates??[]).map(e=>({lineage:u(e.lineage),models:e.models??[],...e.persona?{persona:e.persona}:{}}))},inputs:{include:e.inputs?.include??[],exclude:e.inputs?.exclude??[]},iterate:{max:e.iterate?.maxRounds??2,onMax:"ask-user"},blindSpots:[],execution:"parallel",builtin:!0,..."review_only"===t?{artifact:{label:e.artifact?.label??"Artifact to review",hint:e.artifact?.hint??"Paste a unified diff, a markdown draft, code, or any text blob.",maxBytes:e.artifact?.maxBytes??1048576}}:{}}}function m(e){let t={};try{t=d.Ay.parse(e.yaml)??{}}catch{}let n="majority";"number"==typeof t.agreementThreshold?n=t.agreementThreshold>=.99?"unanimous":t.agreementThreshold>=.5?"majority":"any":"string"==typeof t.agreementThreshold&&(n=t.agreementThreshold);let i=(t.phases??[]).map(p);return{id:e.id,name:t.name??e.id,description:t.description??"",category:function(e,t){if(e.category)return e.category;let n=t.toLowerCase();return n.includes("bug")||n.includes("debug")||n.includes("diagnose")?"debug":n.includes("plan")||n.includes("architect")?"plan":n.includes("decide")||n.includes("decision")?"decide":"review"}(t,e.id),phases:i,agreementThreshold:n,onThresholdMet:"auto-finalize"===t.onThresholdMet?"auto-finalize":"ask-user",maxRounds:t.maxRounds??3,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:t.yoloDefault??!1,estimatedBaselineTokens:t.estimatedBaselineTokens,onError:"ask-user",notify:"dashboard-only",yaml:e.yaml,authorHandle:t.author??"chorus",forks:0,popularity:0,source:e.source,isComplete:"number"==typeof e.is_complete?0!==e.is_complete:!1!==e.is_complete}}async function f(){return(await (0,i.T)("/templates")).items.map(m)}async function h(e){return m(await (0,i.T)("/templates",{method:"POST",body:JSON.stringify(e)}))}async function y(e){await (0,i.T)(`/templates/${encodeURIComponent(e)}`,{method:"DELETE"})}var g=n(6441),w=n(8141),v=n(1993);n(7847)},6441:(e,t,n)=>{n.d(t,{A1:()=>y,Ci:()=>g,Df:()=>o,Dl:()=>h,Ep:()=>s,R8:()=>m,WH:()=>v,WK:()=>w,Wt:()=>p,Xx:()=>d,Y5:()=>f,fk:()=>a,iW:()=>r,lT:()=>u,nr:()=>l,oD:()=>c});var i=n(4411);async function a(){return(await (0,i.T)("/onboard/detect-clis")).items}async function r(e,t){return(0,i.T)("/onboard/validate-cli-path",{method:"POST",body:JSON.stringify({id:e,path:t})})}async function o(e,t){return(0,i.T)("/onboard/save-cli-path",{method:"POST",body:JSON.stringify({id:e,path:t})})}async function s(e){return(0,i.T)("/settings/permissions",{method:"PUT",body:JSON.stringify(e)})}async function d(e){return(0,i.T)("/settings",{method:"PUT",body:JSON.stringify(e)})}async function c(){return(0,i.T)("/settings/transport")}async function l(e){return(0,i.T)("/settings/transport",{method:"PUT",body:JSON.stringify(e)})}async function u(){return(0,i.T)("/settings/concurrency")}async function p(e){return(0,i.T)("/settings/concurrency",{method:"PUT",body:JSON.stringify(e)})}async function m(){return(0,i.T)("/settings/chat-concurrency")}async function f(e){return(0,i.T)("/settings/chat-concurrency",{method:"PUT",body:JSON.stringify(e)})}async function h(){return(0,i.T)("/settings/billing")}async function y(e){return(0,i.T)("/settings/billing",{method:"PUT",body:JSON.stringify(e)})}async function g(){return(0,i.T)("/settings/telemetry")}async function w(e){return(0,i.T)("/settings/telemetry",{method:"PUT",body:JSON.stringify({enabled:e})})}async function v(e,t){return(0,i.T)(`/secrets/${e}`,{method:"PUT",body:JSON.stringify(t)})}},7362:(e,t,n)=>{n.d(t,{cn:()=>r});var i=n(142),a=n(9317);function r(...e){return(0,a.QP)((0,i.$)(e))}},7847:(e,t,n)=>{n.d(t,{createVoice:()=>o,listVoices:()=>a,updateVoice:()=>r});var i=n(4411);async function a(e){return(await (0,i.T)(`/voices${function(e){if(!e)return"";let t=[];return e.lineage&&t.push(`lineage=${encodeURIComponent(e.lineage)}`),e.source&&t.push(`source=${encodeURIComponent(e.source)}`),e.provider&&t.push(`provider=${encodeURIComponent(e.provider)}`),void 0!==e.enabled&&t.push(`enabled=${e.enabled?"true":"false"}`),0===t.length?"":`?${t.join("&")}`}(e)}`)).items}async function r(e,t){return(0,i.T)(`/voices/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function o(e){return(0,i.T)("/voices",{method:"POST",body:JSON.stringify(e)})}},8141:(e,t,n)=>{n.d(t,{Ay:()=>r,jb:()=>a});var i=n(4411);async function a(e){return(0,i.T)(`/orchestrators/${e}/connect`,{method:"POST"})}async function r(){return(0,i.T)("/orchestrators/opencode/models")}},9345:(e,t,n)=>{n.d(t,{_i:()=>f});var i=n(5097),a=n(4747);let r=i.ai().int().min(3e4).max(36e5).optional(),o=i.k5(["anthropic","openai","google","opencode","moonshot","openrouter","local","grok","antigravity","any"]),s=i.k5(["anthropic","openai","google","opencode","moonshot","openrouter","local","grok","antigravity"]),d=i.Ik({require:i.ai().int().min(0).default(1),crossLineage:i.zM().default(!0),candidates:i.YO(i.Ik({lineage:s,models:i.YO(i.Yj()).optional(),persona:i.Yj().optional()}))}).superRefine((e,t)=>{if(e.require>e.candidates.length&&t.addIssue({code:a.eq.custom,path:["require"],message:`reviewer.require (${e.require}) cannot exceed reviewer.candidates.length (${e.candidates.length}). Either lower require or add more candidates.`}),e.crossLineage&&e.require>0){let n=new Set(e.candidates.map(e=>e.lineage)).size;e.require>n&&t.addIssue({code:a.eq.custom,path:["require"],message:`reviewer.require (${e.require}) exceeds distinct lineages (${n}) in candidates with crossLineage=true. Either lower require, disable crossLineage, or add candidates from more lineages.`})}}),c=i.Ik({include:i.YO(i.Yj()).default([]),exclude:i.YO(i.Yj()).default([])}).default({include:[],exclude:[]}),l=i.Ik({maxRounds:i.ai().int().min(1).default(2),onDisagreement:i.k5(["continue","escalate","accept-doer"]).default("continue"),shareSessionAcrossRounds:i.zM().default(!0),shareSessionAcrossPhases:i.zM().default(!1)}).default({maxRounds:2,onDisagreement:"continue",shareSessionAcrossRounds:!0,shareSessionAcrossPhases:!1}),u=i.Ik({id:i.Yj().min(1),kind:i.k5(["plan","spec","tests","implement","review","verify","divergence"]),title:i.Yj().min(1),description:i.Yj().optional(),doer:i.Ik({lineage:o,models:i.YO(i.Yj()).optional(),persona:i.Yj().optional()}),reviewer:d.optional(),inputs:c,iterate:l,timeoutMs:r}),p=i.Ik({id:i.Yj().min(1),kind:i.eu("review_only"),title:i.Yj().min(1),description:i.Yj().optional(),reviewer:d,artifact:i.Ik({label:i.Yj().min(1).default("Artifact to review"),hint:i.Yj().default("Paste a unified diff, a markdown draft, code, or any text blob."),maxBytes:i.ai().int().min(1).default(1048576)}).default({label:"Artifact to review",hint:"Paste a unified diff, a markdown draft, code, or any text blob.",maxBytes:1048576}),inputs:c,timeoutMs:r}),m=i.gM("kind",[u.extend({kind:i.eu("plan")}),u.extend({kind:i.eu("spec")}),u.extend({kind:i.eu("tests")}),u.extend({kind:i.eu("implement")}),u.extend({kind:i.eu("review")}),u.extend({kind:i.eu("verify")}),u.extend({kind:i.eu("divergence")}),p]),f=i.Ik({id:i.Yj().min(1),name:i.Yj().min(1),description:i.Yj().min(1),author:i.Yj().default("chorus"),agreementThreshold:i.ai().min(0).max(1).default(.66),onThresholdMet:i.k5(["merge","ask","review"]).default("ask"),maxRounds:i.ai().int().min(1).default(3),yoloDefault:i.zM().default(!1),estimatedBaselineTokens:i.ai().int().min(0).optional(),phases:i.YO(m).min(1).refine(e=>{let t=e.filter(e=>"review_only"===e.kind).length;return 0===t||1===t&&1===e.length},{message:"review_only phases cannot be mixed with other phase kinds and only one is allowed (hybrid templates are out of scope)"}).refine(e=>{let t=e.map(e=>e.id);return new Set(t).size===t.length},{message:"phase ids must be unique"}),ship:i.Ik({enabled:i.zM().default(!1),baseBranch:i.Yj().optional(),branchPattern:i.Yj().default("chorus/{chatId}"),titleTemplate:i.Yj().default("chorus: {template} via #{chatId}")}).optional(),fallback:i.Ik({doer:i.YO(i.Ik({lineage:o,models:i.YO(i.Yj()).min(1),persona:i.Yj().optional()})).optional(),reviewer:i.YO(i.Ik({lineage:s,models:i.YO(i.Yj()).min(1),persona:i.Yj().optional()})).optional()}).optional()})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{63:(e,t,r)=>{r.d(t,{Zp:()=>o});var a=r(9442);r(6074);var n=r(7362);function o({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card",className:(0,n.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}},1749:(e,t,r)=>{r.d(t,{$:()=>s});var a=r(9442);r(6074);var n=r(9056),o=r(8113),i=r(7362);let d=(0,n.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function s({className:e,variant:t="default",size:r="default",asChild:n=!1,...l}){let g=n?o.bL:"button";return(0,a.jsx)(g,{"data-slot":"button","data-variant":t,"data-size":r,className:(0,i.cn)(d({variant:t,size:r,className:e})),...l})}},1853:(e,t,r)=>{r.d(t,{Cf:()=>c,L3:()=>b,c7:()=>u,lG:()=>d,rr:()=>f,zM:()=>s});var a=r(9442);r(6074);var n=r(6891),o=r(3703),i=r(7362);function d({...e}){return(0,a.jsx)(o.bL,{"data-slot":"dialog",...e})}function s({...e}){return(0,a.jsx)(o.l9,{"data-slot":"dialog-trigger",...e})}function l({...e}){return(0,a.jsx)(o.ZL,{"data-slot":"dialog-portal",...e})}function g({className:e,...t}){return(0,a.jsx)(o.hJ,{"data-slot":"dialog-overlay",className:(0,i.cn)("fixed inset-0 z-50 bg-black/75 backdrop-blur-sm data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function c({className:e,children:t,showCloseButton:r=!0,...d}){return(0,a.jsxs)(l,{"data-slot":"dialog-portal",children:[(0,a.jsx)(g,{}),(0,a.jsxs)(o.UC,{"data-slot":"dialog-content",className:(0,i.cn)("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...d,children:[t,r&&(0,a.jsxs)(o.bm,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(n.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function u({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function b({className:e,...t}){return(0,a.jsx)(o.hE,{"data-slot":"dialog-title",className:(0,i.cn)("text-lg leading-none font-semibold",e),...t})}function f({className:e,...t}){return(0,a.jsx)(o.VY,{"data-slot":"dialog-description",className:(0,i.cn)("text-sm text-muted-foreground",e),...t})}r(1749)},3734:(e,t,r)=>{r.d(t,{JR:()=>g,QJ:()=>o,VW:()=>i,YM:()=>u,m_:()=>d,r2:()=>b,u5:()=>l,x0:()=>c,ze:()=>a});let a={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},n={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function o(e){return e?a[e]??e:""}function i(e){return e?n[e]??"bg-muted":"bg-muted"}let d={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},s={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function l(e){return e?d[e]??e:""}function g(e){return e?s[e]??"bg-muted":"bg-muted"}let c={claude:"claude-opus-4-7",codex:"gpt-5.5",gemini:"gemini-2.5-pro",opencode:"kimi-k2.6",kimi:"kimi-k2.6",openrouter:"",local:"",grok:"grok-build",antigravity:"gemini-3.5-flash"};function u(e){if(e)return c[e]}let b={claude:{dot:"bg-violet-400",ring:"ring-violet-400/40",gradient:"bg-gradient-to-b from-violet-500/15 to-card"},codex:{dot:"bg-orange-400",ring:"ring-orange-400/40",gradient:"bg-gradient-to-b from-orange-500/15 to-card"},gemini:{dot:"bg-blue-400",ring:"ring-blue-400/40",gradient:"bg-gradient-to-b from-blue-500/15 to-card"},opencode:{dot:"bg-emerald-400",ring:"ring-emerald-400/40",gradient:"bg-gradient-to-b from-emerald-500/15 to-card"},kimi:{dot:"bg-pink-400",ring:"ring-pink-400/40",gradient:"bg-gradient-to-b from-pink-500/15 to-card"},openrouter:{dot:"bg-cyan-400",ring:"ring-cyan-400/40",gradient:"bg-gradient-to-b from-cyan-500/15 to-card"},local:{dot:"bg-teal-400",ring:"ring-teal-400/40",gradient:"bg-gradient-to-b from-teal-500/15 to-card"},grok:{dot:"bg-slate-400",ring:"ring-slate-400/40",gradient:"bg-gradient-to-b from-slate-500/15 to-card"},antigravity:{dot:"bg-sky-400",ring:"ring-sky-400/40",gradient:"bg-gradient-to-b from-sky-500/15 to-card"}}},4372:(e,t,r)=>{r.d(t,{G:()=>i});var a=r(9442),n=r(821),o=r(8344);function i({children:e}){return(0,a.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[(0,a.jsx)(n.AppSidebar,{}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,a.jsx)(o.MobileTopBar,{}),(0,a.jsx)("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}},5702:(e,t,r)=>{r.d(t,{E:()=>s});var a=r(9442);r(6074);var n=r(9056),o=r(8113),i=r(7362);let d=(0,n.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function s({className:e,variant:t="default",asChild:r=!1,...n}){let l=r?o.bL:"span";return(0,a.jsx)(l,{"data-slot":"badge","data-variant":t,className:(0,i.cn)(d({variant:t}),e),...n})}},6457:(e,t,r)=>{r.d(t,{z:()=>n});var a=r(9442);function n({eyebrow:e,title:t,subtitle:r,action:o}){return(0,a.jsxs)("header",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e}),(0,a.jsx)("h1",{className:"mt-1 text-2xl font-semibold tracking-tight",children:t}),r&&(0,a.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-muted-foreground",children:r})]}),o&&(0,a.jsx)("div",{className:"shrink-0 self-start sm:self-auto",children:o})]})}},8191:(e,t,r)=>{r.d(t,{N:()=>o});var a=r(9442),n=r(9208);function o({filename:e,charCount:t,footer:r,maxHeightClassName:i="max-h-[70vh]",children:d}){return(0,a.jsxs)("div",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/60 px-4 py-2.5",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,a.jsx)(n.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e})]}),"number"==typeof t&&(0,a.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:[t.toLocaleString()," chars"]})]}),(0,a.jsx)("pre",{className:`${i} min-h-0 flex-1 overflow-auto whitespace-pre-wrap break-words bg-background px-5 py-4 font-mono text-[12px] leading-relaxed text-foreground/90`,children:d}),r&&(0,a.jsx)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-t border-border bg-card/60 px-4 py-2.5 text-[11px] text-muted-foreground",children:r})]})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[951],{1727:(e,t,r)=>{"use strict";r.d(t,{OrchestratorCard:()=>g});var a=r(9442),n=r(6074),d=r(9707),s=r(3149),i=r(6823),o=r(4030),l=r(6185),c=r(7847),m=r(3734),u=r(7362);let p={claude:"claude-code",codex:"codex-cli",gemini:"gemini-cli",opencode:"opencode-cli",kimi:"kimi-cli"},x={dot:"bg-muted-foreground/40",gradient:"bg-gradient-to-br from-muted/30 via-card to-card"};function g({initial:e,voices:t}){var r;let[h,f]=(0,n.useState)(e),[y,j]=(0,n.useState)(!1),[v,N]=(0,n.useState)(null),[k,w]=(0,n.useState)(!1),A=p[e.name],[C,S]=(0,n.useState)(t),[M,_]=(0,n.useState)(null),[P,O]=(0,n.useState)(null),L=!!A&&C.length>0,$=C.filter(e=>e.enabled).length,E="opencode-cli"===A,R=h.connected,T=h.approvedTools>0&&!R,z=(r=e.name)in m.r2?m.r2[r]:x,V=async()=>{j(!0),N(null);try{let e=await (0,l.jb)(h.name);f(e.status),w(e.added.length>0)}catch(e){N(e instanceof l.$v?e.message:"Failed to connect — is the daemon running?")}finally{j(!1)}},F=async e=>{_(e.id),O(null);try{let t=await (0,c.updateVoice)(e.id,{enabled:!e.enabled});S(e=>e.map(e=>e.id===t.id?t:e))}catch(e){O(e instanceof l.$v?e.message:"Couldn't save. Is the daemon running?")}finally{_(null)}},I=new Map;if(E)for(let e of C){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",a=I.get(r)??[];a.push(e),I.set(r,a)}let G=Array.from(I.keys()).sort();return(0,a.jsxs)("div",{className:(0,u.cn)("flex h-72 flex-col rounded-lg border border-border",z.gradient),children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",z.dot)}),(0,a.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:h.label}),R?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," Connected"]}):T?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[h.approvedTools,"/",h.totalTools," tools"]}):h.supported?(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not connected"}):(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Coming soon"}),L&&(0,a.jsxs)("span",{className:"whitespace-nowrap text-[10px] text-muted-foreground",children:["\xb7 ",$," model",1===$?"":"s"]})]})}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-3 overflow-y-auto border-t border-border bg-card/30 p-4",children:[(0,a.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:h.note}),!h.supported&&(0,a.jsx)("p",{className:"text-[11px] italic text-muted-foreground/70",children:"Wiring will land in a future release."}),h.supported&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:V,disabled:y||R&&!T,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition hover:bg-primary/90 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground",children:[y?(0,a.jsx)(s.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"}),R?"Already connected":T?"Approve remaining tools":`Connect ${h.label}`]}),k&&!v&&(0,a.jsxs)("p",{className:"text-[11px] text-emerald-400",children:["✓ Done. Restart ",h.label," for the change to take effect."]}),v&&(0,a.jsxs)("p",{className:"flex items-start gap-1 text-[11px] text-destructive",children:[(0,a.jsx)(o.A,{className:"mt-0.5 h-3 w-3 shrink-0"})," ",v]})]}),R&&"prompts_once"===h.firstCallBehavior&&(0,a.jsx)("p",{className:"text-[11px] text-amber-300/90",children:'⚠ First chorus.* call will show a one-time prompt — click "Always allow".'}),L&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),P&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:P}),E?(0,a.jsx)("div",{className:"space-y-2",children:G.map(e=>{let t=I.get(e)??[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("p",{className:"text-[10px] font-mono text-muted-foreground/80",children:[e,"/"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(t=>(0,a.jsx)(b,{label:t.model_id.slice(e.length+1),value:t.model_id,selected:t.enabled,disabled:M===t.id,onClick:()=>F(t)},t.id))})]},e)})}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:C.map(e=>(0,a.jsx)(b,{label:e.model_id,value:e.model_id,selected:e.enabled,disabled:M===e.id,onClick:()=>F(e)},e.id))})]})]})]})}function b({label:e,value:t,selected:r,disabled:n,onClick:s}){return(0,a.jsxs)("button",{type:"button",disabled:n,onClick:s,title:t,className:(0,u.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",r?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,a.jsx)("div",{className:(0,u.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",r?"border-primary bg-primary text-primary-foreground":"border-border"),children:r&&(0,a.jsx)(d.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:e})]})}},2545:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},2881:(e,t,r)=>{"use strict";r.d(t,{Eu:()=>s,M5:()=>n,Y8:()=>d});var a=r(4411);async function n(e){return(0,a.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function d(){return(0,a.T)("/openrouter/models")}async function s(e,t){return(0,a.T)("/openrouter/voices",{method:"POST",body:JSON.stringify(t?{modelIds:e,apiKey:t}:{modelIds:e})})}},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>d,VW:()=>s,YM:()=>u,m_:()=>i,r2:()=>p,u5:()=>l,x0:()=>m,ze:()=>a});let a={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},n={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function d(e){return e?a[e]??e:""}function s(e){return e?n[e]??"bg-muted":"bg-muted"}let i={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},o={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function l(e){return e?i[e]??e:""}function c(e){return e?o[e]??"bg-muted":"bg-muted"}let m={claude:"claude-opus-4-7",codex:"gpt-5.5",gemini:"gemini-2.5-pro",opencode:"kimi-k2.6",kimi:"kimi-k2.6",openrouter:"",local:"",grok:"grok-build",antigravity:"gemini-3.5-flash"};function u(e){if(e)return m[e]}let p={claude:{dot:"bg-violet-400",ring:"ring-violet-400/40",gradient:"bg-gradient-to-b from-violet-500/15 to-card"},codex:{dot:"bg-orange-400",ring:"ring-orange-400/40",gradient:"bg-gradient-to-b from-orange-500/15 to-card"},gemini:{dot:"bg-blue-400",ring:"ring-blue-400/40",gradient:"bg-gradient-to-b from-blue-500/15 to-card"},opencode:{dot:"bg-emerald-400",ring:"ring-emerald-400/40",gradient:"bg-gradient-to-b from-emerald-500/15 to-card"},kimi:{dot:"bg-pink-400",ring:"ring-pink-400/40",gradient:"bg-gradient-to-b from-pink-500/15 to-card"},openrouter:{dot:"bg-cyan-400",ring:"ring-cyan-400/40",gradient:"bg-gradient-to-b from-cyan-500/15 to-card"},local:{dot:"bg-teal-400",ring:"ring-teal-400/40",gradient:"bg-gradient-to-b from-teal-500/15 to-card"},grok:{dot:"bg-slate-400",ring:"ring-slate-400/40",gradient:"bg-gradient-to-b from-slate-500/15 to-card"},antigravity:{dot:"bg-sky-400",ring:"ring-sky-400/40",gradient:"bg-gradient-to-b from-sky-500/15 to-card"}}},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).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"}]])},7130:(e,t,r)=>{"use strict";r.d(t,{OpenRouterCard:()=>x});var a=r(9442),n=r(6074),d=r(9707),s=r(2545),i=r(3149),o=r(4030),l=r(9812),c=r(7362),m=r(2881),u=r(7847),p=r(3734);function x({voices:e}){let[t,r]=(0,n.useState)(e),[b,h]=(0,n.useState)(null),[f,y]=(0,n.useState)(!1),[j,v]=(0,n.useState)(!1),[N,k]=(0,n.useState)(""),[w,A]=(0,n.useState)(!1),[C,S]=(0,n.useState)(null),[M,_]=(0,n.useState)(!1),[P,O]=(0,n.useState)(""),[L,$]=(0,n.useState)(new Set),[E,R]=(0,n.useState)(!1),[T,z]=(0,n.useState)(null),[V,F]=(0,n.useState)(null),[I,G]=(0,n.useState)(null),[q,J]=(0,n.useState)(null),Y=t.filter(e=>e.enabled).length,K=t.length>0;async function W(){if(!f){y(!0),S(null),v(!0);try{let{models:e}=await (0,m.Y8)();e.sort((e,t)=>e.id.localeCompare(t.id)),h(e),_(!1)}catch(t){let e=t instanceof Error?t.message:String(t);_(!0),/no openrouter api key/i.test(e)||S(e)}finally{y(!1)}}}async function B(){if(0!==N.trim().length){A(!0),S(null);try{let e=await (0,m.M5)(N.trim());if(!e.valid)return void S(e.error??"Validation failed");k(""),_(!1);let{models:t}=await (0,m.Y8)();t.sort((e,t)=>e.id.localeCompare(t.id)),h(t),v(!0)}catch(e){S(e instanceof Error?e.message:String(e))}finally{A(!1)}}}async function D(){if(0!==L.size){R(!0),z(null),F(null);try{let e=await (0,m.Eu)(Array.from(L)),t=e.added.length,a=e.skipped.length;F(`Added ${t} voice${1===t?"":"s"}`+(a>0?` \xb7 skipped ${a} (unknown id)`:"")),$(new Set);try{let e=await (0,u.listVoices)({source:"api",provider:"openrouter"});r(e)}catch{}}catch(e){z(e instanceof Error?e.message:String(e))}finally{R(!1)}}}async function H(e){G(e.id),J(null);try{let t=await (0,u.updateVoice)(e.id,{enabled:!e.enabled});r(e=>e.map(e=>e.id===t.id?t:e))}catch(e){J(e instanceof Error?e.message:String(e))}finally{G(null)}}let Q=P.trim()?(b??[]).filter(e=>e.id.toLowerCase().includes(P.toLowerCase().trim())||e.name.toLowerCase().includes(P.toLowerCase().trim())):b??[];return(0,a.jsxs)("div",{className:(0,c.cn)("flex h-72 flex-col rounded-lg border border-border",p.r2.openrouter.gradient),children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)("span",{className:(0,c.cn)("h-2 w-2 shrink-0 rounded-full",p.r2.openrouter.dot)}),(0,a.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:"OpenRouter"}),K?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," ",Y," enabled"]}):(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not configured"})]})}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-3 overflow-y-auto border-t border-border bg-card/30 p-4",children:[!K&&(0,a.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:"Voices added here run via OpenRouter's chat-completions API. Costs come back per-call from the API and surface on the run page."}),K&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(e=>(0,a.jsxs)("button",{type:"button",disabled:I===e.id,onClick:()=>H(e),title:e.model_id,className:(0,c.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",e.enabled?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,c.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",e.enabled?"border-primary bg-primary text-primary-foreground":"border-border"),children:e.enabled&&(0,a.jsx)(d.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),q&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:q})]}),(M||!K)&&(0,a.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-background/40 p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Replace API key":"OpenRouter API key"}),(0,a.jsxs)("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground",children:["Get a key ",(0,a.jsx)(s.A,{className:"h-2.5 w-2.5"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"password",value:N,onChange:e=>k(e.target.value),placeholder:"sk-or-v1-…",disabled:w,className:"h-8 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs focus:border-primary/60 focus:outline-none"}),(0,a.jsxs)("button",{type:"button",onClick:B,disabled:w||0===N.trim().length,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-primary/40 bg-primary/10 px-3 text-[11px] font-medium text-primary transition hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[w?(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(d.A,{className:"h-3 w-3"}),w?"Saving…":"Save"]})]}),C&&(0,a.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,a.jsx)(o.A,{className:"h-3 w-3"}),C]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K&&!j&&(0,a.jsxs)("button",{type:"button",onClick:W,disabled:f,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-[11px] font-medium text-foreground transition hover:border-muted-foreground/30 disabled:opacity-50",children:[f?(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add more models"]}),K&&!M&&(0,a.jsx)("button",{type:"button",onClick:()=>_(!0),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"Replace API key"})]}),j&&(0,a.jsxs)(a.Fragment,{children:[f&&(0,a.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Loading catalog…"]}),b&&b.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Add more models":"Pick models"}),(0,a.jsxs)("button",{type:"button",onClick:D,disabled:0===L.size||E,className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-primary/40 bg-primary/10 px-2.5 text-[11px] font-medium text-primary transition hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[E?(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add ",L.size>0?L.size:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background/40 px-2",children:[(0,a.jsx)(l.A,{className:"h-3 w-3 text-muted-foreground"}),(0,a.jsx)("input",{type:"text",value:P,onChange:e=>O(e.target.value),placeholder:"filter by id or name…",className:"h-7 flex-1 bg-transparent text-[11px] focus:outline-none"}),(0,a.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[Q.length,"/",b.length]})]}),V&&(0,a.jsx)("p",{className:"text-[11px] text-emerald-300",children:V}),T&&(0,a.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,a.jsx)(o.A,{className:"h-3 w-3"}),T]}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-border",children:Q.map(e=>{let r=L.has(e.id),n=t.some(t=>t.model_id===e.id);return(0,a.jsxs)("label",{className:(0,c.cn)("flex cursor-pointer items-center gap-2 border-b border-border px-2 py-1.5 text-[11px] last:border-b-0 hover:bg-card/40",n&&"opacity-50"),children:[(0,a.jsx)("input",{type:"checkbox",checked:r,disabled:n,onChange:t=>{$(r=>{let a=new Set(r);return t.target.checked?a.add(e.id):a.delete(e.id),a})},className:"h-3 w-3 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"truncate font-mono text-[11px]",children:[e.id,n&&(0,a.jsx)("span",{className:"ml-1 text-[10px] text-muted-foreground",children:"\xb7 added"})]}),(0,a.jsxs)("div",{className:"truncate text-[10px] text-muted-foreground",children:[e.name,e.contextLength?` \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`:"",void 0!==e.inputCostPerMtok||void 0!==e.outputCostPerMtok?` \xb7 ${g(e.inputCostPerMtok)}/${g(e.outputCostPerMtok)} per Mtok`:""]})]})]},e.id)})})]})]})]})]})}function g(e){return void 0===e?"?":e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}},8799:(e,t,r)=>{Promise.resolve().then(r.bind(r,821)),Promise.resolve().then(r.bind(r,8344)),Promise.resolve().then(r.bind(r,7130)),Promise.resolve().then(r.bind(r,1727))},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9812:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}},e=>{e.O(0,[742,832,641,344,506,128,358],()=>e(e.s=8799)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[359],{63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>n});var s=r(9442);r(6074);var a=r(7362);function n({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card",className:(0,a.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}},862:(e,t,r)=>{"use strict";function s(e){return!!e&&e.phases[0]?.kind==="review_only"}r.d(t,{$:()=>s})},2471:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).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"}]])},2919:(e,t,r)=>{Promise.resolve().then(r.bind(r,6141))},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>n,VW:()=>o,YM:()=>m,m_:()=>i,r2:()=>x,u5:()=>d,x0:()=>u,ze:()=>s});let s={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},a={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function n(e){return e?s[e]??e:""}function o(e){return e?a[e]??"bg-muted":"bg-muted"}let i={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},l={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function d(e){return e?i[e]??e:""}function c(e){return e?l[e]??"bg-muted":"bg-muted"}let u={claude:"claude-opus-4-7",codex:"gpt-5.5",gemini:"gemini-2.5-pro",opencode:"kimi-k2.6",kimi:"kimi-k2.6",openrouter:"",local:"",grok:"grok-build",antigravity:"gemini-3.5-flash"};function m(e){if(e)return u[e]}let x={claude:{dot:"bg-violet-400",ring:"ring-violet-400/40",gradient:"bg-gradient-to-b from-violet-500/15 to-card"},codex:{dot:"bg-orange-400",ring:"ring-orange-400/40",gradient:"bg-gradient-to-b from-orange-500/15 to-card"},gemini:{dot:"bg-blue-400",ring:"ring-blue-400/40",gradient:"bg-gradient-to-b from-blue-500/15 to-card"},opencode:{dot:"bg-emerald-400",ring:"ring-emerald-400/40",gradient:"bg-gradient-to-b from-emerald-500/15 to-card"},kimi:{dot:"bg-pink-400",ring:"ring-pink-400/40",gradient:"bg-gradient-to-b from-pink-500/15 to-card"},openrouter:{dot:"bg-cyan-400",ring:"ring-cyan-400/40",gradient:"bg-gradient-to-b from-cyan-500/15 to-card"},local:{dot:"bg-teal-400",ring:"ring-teal-400/40",gradient:"bg-gradient-to-b from-teal-500/15 to-card"},grok:{dot:"bg-slate-400",ring:"ring-slate-400/40",gradient:"bg-gradient-to-b from-slate-500/15 to-card"},antigravity:{dot:"bg-sky-400",ring:"ring-sky-400/40",gradient:"bg-gradient-to-b from-sky-500/15 to-card"}}},4372:(e,t,r)=>{"use strict";r.d(t,{G:()=>o});var s=r(9442),a=r(821),n=r(8344);function o({children:e}){return(0,s.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[(0,s.jsx)(a.AppSidebar,{}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,s.jsx)(n.MobileTopBar,{}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}},5702:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var s=r(9442);r(6074);var a=r(9056),n=r(8113),o=r(7362);let i=(0,a.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l({className:e,variant:t="default",asChild:r=!1,...a}){let d=r?n.bL:"span";return(0,s.jsx)(d,{"data-slot":"badge","data-variant":t,className:(0,o.cn)(i({variant:t}),e),...a})}},6141:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>N});var s=r(9442),a=r(8821),n=r(2471),o=r(5902),i=r(6074),l=r(4372),d=r(6457),c=r(5702),u=r(6185),m=r(6441),x=r(862);function g({icon:e,label:t,value:r,wide:a,children:n}){let[o,l]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-1.5 text-sm transition hover:border-muted-foreground/40",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:e}),(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:t}),(0,s.jsx)("span",{className:"font-medium",children:r})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-10",onClick:()=>l(!1)}),(0,s.jsx)("div",{className:`absolute left-0 top-full z-20 mt-1 rounded-md border border-border bg-popover p-1.5 shadow-xl ${a?"w-80":"w-56"}`,onClick:()=>l(!1),children:n})]})]})}var p=r(6289);let h=(0,r(3884).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"}]]);var f=r(63),b=r(3734);function v({template:e,prompt:t,setPrompt:r,reviewOnly:a,artifactSpec:n,billingMode:o,costEstimate:i,overCap:l,isPending:d,onStart:c}){return(0,s.jsxs)(s.Fragment,{children:[a&&n&&(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:n.label}),(0,s.jsx)("span",{className:"text-muted-foreground/60",children:"\xb7"}),(0,s.jsxs)("span",{children:["cap ",(n.maxBytes/1024).toLocaleString()," KB"]})]}),(0,s.jsxs)(f.Zp,{className:"overflow-hidden p-0 mb-4",children:[(0,s.jsx)("textarea",{value:t,onChange:e=>r(e.target.value),placeholder:a&&n?n.hint:"Describe what you want chorus to weigh in on. Paste code, errors, design docs — anything the reviewers should see.",className:`block w-full resize-none border-0 bg-transparent px-5 py-4 text-sm text-foreground placeholder:text-muted-foreground/70 focus:outline-none ${a?"font-mono text-[12px] leading-relaxed":""}`,rows:a?16:10,spellCheck:!a}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-card/40 px-5 py-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)(j,{template:e,reviewOnly:a}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 sm:justify-end",children:[(0,s.jsx)(w,{billingMode:o,costEstimate:i,overCap:l,template:e}),(0,s.jsxs)("button",{type:"button",onClick:c,disabled:!t||l||d,className:`inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${!t||l||d?"cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:[d?"Starting...":a?"Send for review":"Start the run",(0,s.jsx)(p.A,{className:"h-4 w-4"})]})]})]})]})]})}function j({template:e,reviewOnly:t}){return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[!t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${(0,b.JR)(e.phases[0]?.doer.lineage)}`}),"Doer: ",e.phases[0]?.doer.lineage]}),(0,s.jsx)("span",{className:"text-muted-foreground/50",children:"\xb7"})]}),(0,s.jsx)(y,{template:e}),e.phases.length>1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground/50",children:"\xb7"}),(0,s.jsxs)("span",{className:"font-mono text-[10px]",children:[e.phases.length," phases"]})]})]})}function y({template:e}){let t=e.phases[0]?.reviewer.candidatesWithModels??[],r=new Map;for(let e of t)r.set(e.lineage,(r.get(e.lineage)??0)+1);return(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-muted-foreground/80",children:"Reviewers:"}),t.map((e,t)=>{let a=(r.get(e.lineage)??0)>1,n=e.models?.[0]?.split("/").pop()??e.models?.[0],o=a&&n?`${e.lineage} \xb7 ${n}`:e.lineage;return(0,s.jsxs)("span",{className:"flex items-center gap-1",title:e.models?.[0]?`${e.lineage} \xb7 ${e.models[0]}`:e.lineage,children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${(0,b.JR)(e.lineage)}`}),o]},`${e.lineage}-${e.models?.[0]??"default"}-${t}`)}),e.phases[0]?.reviewer.crossLineage&&(0,s.jsx)(c.E,{variant:"outline",className:"ml-1 border-border font-mono text-[9px] uppercase",title:"Reviewer must be a different lineage than the doer",children:"cross-lineage"})]})}function w({billingMode:e,costEstimate:t,overCap:r,template:a}){return"subscription"===e?(0,s.jsxs)("div",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",title:`~${t.inputTokens.toLocaleString()} input tokens \xd7 ${t.reviewerCount} reviewers — counts against your CLI subscription quota, not billed per call`,children:["Subscription quota \xb7 ~",t.inputTokens.toLocaleString()," tok"]}):(0,s.jsxs)("div",{className:`flex items-center gap-1.5 font-mono text-[10px] ${r?"text-rose-300":"text-muted-foreground"}`,title:`~${t.inputTokens.toLocaleString()} input tokens \xd7 ${t.reviewerCount} reviewers; up to ${t.maxRounds} round${t.maxRounds>1?"s":""} on disagreement`,children:[(0,s.jsx)(h,{className:"h-3 w-3"}),t.maxRounds>1?`~$${t.usd.toFixed(3)} – $${t.usdRangeMax.toFixed(3)} est`:`~$${t.usd.toFixed(3)} est`,a.costCapUsd>0&&(0,s.jsxs)("span",{className:"text-muted-foreground/60",children:["/ cap $",a.costCapUsd.toFixed(2)]})]})}function N(){return(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)(l.G,{children:(0,s.jsx)("div",{className:"p-8 text-sm text-muted-foreground",children:"Loading…"})}),children:(0,s.jsx)(k,{})})}function k(){let e=(0,o.useSearchParams)(),t=(0,o.useRouter)(),[r,p]=(0,i.useTransition)(),[h,f]=(0,i.useState)([]),[b,j]=(0,i.useState)(null),[y,w]=(0,i.useState)(null);(0,i.useEffect)(()=>{(0,u.eG)().then(f).catch(e=>j(e instanceof u.$v?e.message:"Failed to load templates"))},[]);let[N,k]=(0,i.useState)("api");(0,i.useEffect)(()=>{(0,m.Dl)().then(e=>k(e.mode)).catch(()=>{})},[]);let $=e.get("template")??h[0]?.id??"",[C,S]=(0,i.useState)(""),R=[],L=h.find(e=>e.id===$)??h[0],M=(0,i.useMemo)(()=>(function(e){let{template:t,prompt:r,attachments:s}=e,a=t?.phases?.[0]?.reviewer?.candidates?.length??3,n=Math.max(1,t?.maxRounds??1),o=Math.ceil(r.length/4)+1500*s.length+(t?.estimatedBaselineTokens??800),i=(3e-6*o+.018000000000000002)*a;return{usd:i,usdRangeMax:i*n,inputTokens:o,reviewerCount:a,maxRounds:n}})({template:L,prompt:C,attachments:R}),[C,R,L]),E=!!("subscription"!==N&&L?.costCapUsd&&L.costCapUsd>0&&M.usdRangeMax>L.costCapUsd),[A,F]=(0,i.useState)(!1),[P,T]=(0,i.useState)(""),G=(0,x.$)(L),O=G?L?.phases?.[0]?.artifact:void 0;async function z(){if(L&&C){if(G&&O){let e=new TextEncoder().encode(C).length;if(e>O.maxBytes)return void w(`Artifact is ${e.toLocaleString()} bytes; this template caps at ${O.maxBytes.toLocaleString()}. Trim it down.`)}w(null),p(async()=>{try{let e=P.trim(),r=await (0,u.RL)({work:G?function(e){let t="Review the supplied artifact independently.";if(!e)return t;for(let t of e.split("\n")){let e=t.trim();if(0===e.length||e.startsWith("```")||e.startsWith("~~~"))continue;if(e.length<=80)return e;let r=e.slice(0,80),s=r.lastIndexOf(" ");return(s>40?r.slice(0,s):r)+"…"}return t}(C):C,templateId:L.id,files:R.length>0?R.map(e=>e.name):void 0,...G?{artifact:C}:{},...!G&&e.length>0?{repoPath:e}:{},yolo:A});t.push(`/runs/${r.slug||r.id}`)}catch(e){w(e instanceof u.$v?e.message:"Failed to create chat")}})}}return b?(0,s.jsx)(l.G,{children:(0,s.jsx)("div",{className:"mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 sm:py-8 md:px-8 md:py-10",children:(0,s.jsxs)("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:"Error loading templates"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:b})]})})}):L?(0,s.jsx)(l.G,{children:(0,s.jsxs)("div",{className:"mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 sm:py-8 md:px-8 md:py-10",children:[(0,s.jsx)(d.z,{eyebrow:"New chat",title:G?"Paste an artifact. Get reviews.":"Paste a task. Pick a template.",subtitle:G?"Chorus skips the doer and runs your text past three reviewers. Single pass — revise yourself and resubmit for another round.":"Chorus runs it past your reviewers and reports consensus."}),y&&(0,s.jsx)("div",{className:"mb-4 rounded-lg border border-destructive/50 bg-destructive/10 p-4",children:(0,s.jsx)("p",{className:"text-sm text-destructive",children:y})}),(0,s.jsx)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:(0,s.jsx)(g,{icon:(0,s.jsx)(a.A,{className:"h-3.5 w-3.5"}),label:"Template",value:L?.name||"Select a template",wide:!0,children:(0,s.jsx)("ul",{className:"space-y-1",children:h.map(r=>{let a=!1===r.isComplete;return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",disabled:a,onClick:()=>{if(a)return;let s=new URLSearchParams(e);s.set("template",r.id),t.push(`/new?${s.toString()}`)},className:`block w-full rounded-md p-2 text-left transition ${a?"cursor-not-allowed opacity-50":r.id===$?"bg-accent":"hover:bg-accent/50"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:r.name}),(0,x.$)(r)&&(0,s.jsx)(c.E,{variant:"outline",className:"border-blue-500/30 bg-blue-500/10 font-mono text-[9px] uppercase text-blue-300",children:"review only"}),a&&(0,s.jsx)(c.E,{variant:"outline",className:"border-amber-500/40 bg-amber-500/10 font-mono text-[9px] uppercase text-amber-300",children:"needs setup"})]}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-1",children:a?"Edit this template's YAML to fill in models for your fleet.":r.description})]})},r.id)})})})}),(0,s.jsx)(v,{template:L,prompt:C,setPrompt:S,reviewOnly:G,artifactSpec:O,billingMode:N,costEstimate:M,overCap:E,isPending:r,onStart:z}),E&&(0,s.jsxs)("div",{className:"mb-4 flex items-start gap-2 rounded-md border border-rose-500/30 bg-rose-500/5 px-3 py-2 text-[11px] text-rose-200",children:[(0,s.jsx)(n.A,{className:"mt-0.5 h-3 w-3 shrink-0 text-rose-400"}),(0,s.jsxs)("span",{children:["Estimated cost"," ",(0,s.jsxs)("span",{className:"font-mono",children:["$",M.usd.toFixed(3)]})," ","exceeds template cap"," ",(0,s.jsxs)("span",{className:"font-mono",children:["$",L.costCapUsd.toFixed(2)]}),". Trim attachments, shorten the prompt, or raise the cap in template settings."]})]}),(0,s.jsxs)("div",{className:`mb-4 rounded-lg border border-dashed border-border bg-card/30 p-4 ${G?"opacity-50":""}`,children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-foreground",children:["Target repo"," ",(0,s.jsx)("span",{className:"text-muted-foreground",children:"(optional)"})]}),(0,s.jsx)(c.E,{variant:"outline",className:"border-emerald-500/30 bg-emerald-500/10 font-mono text-[10px] uppercase text-emerald-300",children:"opens PR"})]}),(0,s.jsx)("input",{type:"text",value:G?"":P,onChange:e=>T(e.target.value),disabled:G,placeholder:"/absolute/path/to/repo",className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-60",spellCheck:!1}),(0,s.jsx)("p",{className:"mt-2 text-[11px] text-muted-foreground",children:G?"Review-only templates have no doer and no Ship phase, so there's nothing to commit. Pick a template with a doer (e.g. Tri-Review) to open a PR.":(0,s.jsxs)(s.Fragment,{children:["When set: doer makes real edits in this repo. After reviewers agree, chorus opens a PR via"," ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"gh pr create"})," (no auto-merge — you review + click Merge in GitHub). Leave blank to skip the Ship phase."]})})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>F(e=>!e),className:`mb-4 flex w-full items-start justify-between gap-3 rounded-lg border px-4 py-3 text-left transition ${A?"border-rose-500/40 bg-rose-500/5":"border-dashed border-border bg-card/30 hover:border-foreground/30"}`,children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:`mt-0.5 grid h-7 w-7 place-items-center rounded-md text-sm ${A?"bg-rose-500/20 text-rose-300":"bg-card text-muted-foreground"}`,children:"\uD83D\uDE80"}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Yolo mode"}),(0,s.jsx)(c.E,{variant:"outline",className:"border-rose-500/30 bg-rose-500/10 font-mono text-[10px] uppercase text-rose-300",children:"unsafe"})]}),(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:A?"Reviewer gates auto-approve. Permission prompts auto-allow. The driver merges without asking. Cost cap still enforced.":"Skip every ask-user gate for this single run. Useful for trusted templates or trivial fixes."})]})]}),(0,s.jsx)("span",{className:`flex h-5 w-9 shrink-0 items-center rounded-full border p-0.5 transition ${A?"border-rose-500/40 bg-rose-500/20":"border-border bg-card"}`,children:(0,s.jsx)("span",{className:`h-3.5 w-3.5 rounded-full transition-transform ${A?"translate-x-4 bg-rose-400":"bg-muted-foreground/50"}`})})]})]})}):(0,s.jsx)(l.G,{children:(0,s.jsx)("div",{className:"mx-auto w-full max-w-6xl px-4 py-12 text-sm text-muted-foreground sm:px-6 md:px-8",children:"Loading templates…"})})}},6289:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},6457:(e,t,r)=>{"use strict";r.d(t,{z:()=>a});var s=r(9442);function a({eyebrow:e,title:t,subtitle:r,action:n}){return(0,s.jsxs)("header",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e}),(0,s.jsx)("h1",{className:"mt-1 text-2xl font-semibold tracking-tight",children:t}),r&&(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-muted-foreground",children:r})]}),n&&(0,s.jsx)("div",{className:"shrink-0 self-start sm:self-auto",children:n})]})}},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});var s=r(142);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,o=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],s=null==i?void 0:i[e];if(null===t)return null;let n=a(t)||a(s);return o[e][n]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return n(e,l,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...d}[t]):({...i,...d})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},e=>{e.O(0,[742,832,641,344,506,128,358],()=>e(e.s=2919)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[566],{63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>n});var a=r(9442);r(6074);var i=r(7362);function n({className:e,...t}){return(0,a.jsx)("div",{"data-slot":"card",className:(0,i.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}},1749:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var a=r(9442);r(6074);var i=r(9056),n=r(8113),s=r(7362);let d=(0,i.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o({className:e,variant:t="default",size:r="default",asChild:i=!1,...l}){let c=i?n.bL:"button";return(0,a.jsx)(c,{"data-slot":"button","data-variant":t,"data-size":r,className:(0,s.cn)(d({variant:t,size:r,className:e})),...l})}},1996:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>G});var a=r(9442),i=r(3149),n=r(6289),s=r(5902),d=r(6074),o=r(4284),l=r(1749),c=r(6441),u=r(8141),m=r(7847),p=r(63),g=r(7362);function x({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,g.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...r})}var h=r(2545),b=r(9707),f=r(4030),v=r(2881);let y=["anthropic/claude-sonnet-4.5","openai/gpt-5","google/gemini-2.5-pro","deepseek/deepseek-chat-v3.1","moonshotai/kimi-k2"];function k({apiKeys:e,updateApiKey:t}){let r=e.openrouter??"",[n,s]=(0,d.useState)({kind:"idle"}),[o,l]=(0,d.useState)(null),[c,u]=(0,d.useState)(new Set(y)),[m,j]=(0,d.useState)(!1),[w,N]=(0,d.useState)(null);async function C(){if(0!==r.trim().length&&"saving"!==n.kind){s({kind:"saving"});try{let e=await (0,v.M5)(r.trim());if(!e.valid)return void s({kind:"invalid",message:e.error??"OpenRouter rejected this key."});await S()}catch(e){s({kind:"invalid",message:e instanceof Error?e.message:String(e)})}}}async function S(){s({kind:"loading_catalog"});try{let{models:e}=await (0,v.Y8)();e.sort((e,t)=>e.id.localeCompare(t.id)),l(e),s({kind:"valid",modelCount:e.length})}catch(e){s({kind:"catalog_failed",message:e instanceof Error?e.message:String(e)})}}async function A(){if(0!==c.size&&!m){j(!0),N(null);try{let e=await (0,v.Eu)(Array.from(c)),t=e.added.length,r=e.skipped.length;N(`Added ${t} voice${1===t?"":"s"}`+(r>0?` \xb7 skipped ${r} (unknown id)`:""))}catch(e){N(`Couldn't add voices: ${e instanceof Error?e.message:String(e)}`)}finally{j(!1)}}}return(0,a.jsxs)("section",{className:"mb-8",children:[(0,a.jsxs)("h2",{className:"mb-3 flex flex-wrap items-baseline gap-x-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)("span",{children:"API access"}),(0,a.jsx)("span",{className:"font-normal normal-case text-muted-foreground/70",children:"optional — gives you any model on OpenRouter as a chorus voice"})]}),(0,a.jsxs)(p.Zp,{className:"space-y-3 bg-card p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{htmlFor:"apikey-openrouter",className:"text-sm font-medium",children:"OpenRouter API key"}),(0,a.jsxs)("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:["Get a key ",(0,a.jsx)(h.A,{className:"h-2.5 w-2.5"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(x,{id:"apikey-openrouter",type:"password",autoComplete:"off",spellCheck:!1,placeholder:"sk-or-v1-…",value:r,onChange:e=>{t("openrouter",e.target.value),"idle"!==n.kind&&s({kind:"idle"}),l(null)},className:"flex-1 font-mono text-xs",disabled:"saving"===n.kind||"loading_catalog"===n.kind}),(0,a.jsxs)("button",{type:"button",onClick:C,disabled:0===r.trim().length||"saving"===n.kind||"loading_catalog"===n.kind||"valid"===n.kind,className:(0,g.cn)("inline-flex h-9 items-center gap-1.5 rounded-md border px-3 text-[11px] font-medium transition disabled:cursor-not-allowed disabled:opacity-50","valid"===n.kind?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),children:[("saving"===n.kind||"loading_catalog"===n.kind)&&(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"valid"===n.kind&&(0,a.jsx)(b.A,{className:"h-3 w-3"}),"saving"===n.kind?"Validating…":"loading_catalog"===n.kind?"Loading models…":"valid"===n.kind?"Validated":"Validate & save"]})]}),"invalid"===n.kind&&(0,a.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-destructive",children:[(0,a.jsx)(f.A,{className:"h-3 w-3"}),n.message]}),"catalog_failed"===n.kind&&(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-2",children:[(0,a.jsxs)("p",{className:"flex items-start gap-1.5 text-xs text-amber-100",children:[(0,a.jsx)(f.A,{className:"mt-0.5 h-3 w-3 shrink-0"}),(0,a.jsxs)("span",{children:["Key saved, but couldn't load the model catalog:"," ",n.message]})]}),(0,a.jsx)("button",{type:"button",onClick:S,className:"shrink-0 rounded-md border border-amber-500/40 bg-amber-500/10 px-2.5 py-1 text-[11px] font-medium text-amber-100 hover:bg-amber-500/20",children:"Reload models"})]}),"valid"===n.kind&&o&&(0,a.jsxs)("div",{className:"space-y-2 rounded-md border border-emerald-500/20 bg-emerald-500/5 p-3",children:[(0,a.jsxs)("p",{className:"text-[11px] text-emerald-300",children:["✓ Key valid \xb7 ",n.modelCount," models available. Pick a starter set now or browse the full catalog on the Connect page later."]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:y.filter(e=>o.some(t=>t.id===e)).map(e=>{let t=c.has(e),r=o.find(t=>t.id===e);return(0,a.jsxs)("label",{className:(0,g.cn)("flex cursor-pointer items-center gap-2 rounded border px-2 py-1.5 text-[11px] transition",t?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>{u(r=>{let a=new Set(r);return t.target.checked?a.add(e):a.delete(e),a})},className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate font-mono",children:r?.id??e})]},e)})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:A,disabled:0===c.size||m,className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-primary/40 bg-primary/10 px-2.5 text-[11px] font-medium text-primary transition hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[m?(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add ",c.size>0?c.size:""," voice",1===c.size?"":"s"]}),w&&(0,a.jsx)("p",{className:"text-[11px] text-emerald-300",children:w})]})]}),(0,a.jsxs)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/80",children:["Stored locally in ",(0,a.jsx)("code",{children:"~/.chorus/chorus.db"}),". Used only to call OpenRouter on your behalf. Direct API support for other providers (Anthropic, OpenAI, Google, xAI) is on the roadmap — today, route those models via OpenRouter."]})]})]})}var j=r(3734);let w=[{id:"claude-code",provider:"anthropic",label:"Claude Code",hint:"Anthropic — uses your existing Claude login"},{id:"codex-cli",provider:"openai",label:"Codex CLI",hint:"OpenAI — ChatGPT Plus/Pro subscription"},{id:"gemini-cli",provider:"google",label:"Gemini CLI",hint:"Google — uses your gcloud auth"},{id:"opencode-cli",provider:"opencode",label:"OpenCode",hint:"OpenCode Go — routes Kimi, DeepSeek, Grok"},{id:"kimi-cli",provider:"moonshot",label:"Kimi CLI",hint:"MoonshotAI — kimi-k2 plan"},{id:"grok-cli",provider:"grok",label:"Grok Build",hint:"xAI — grok-build model (SuperGrok Heavy plan required for dispatch)"},{id:"antigravity-cli",provider:"antigravity",label:"Antigravity CLI",hint:"Google — Gemini 3.5 Flash via Google AI Pro (`agy` binary)"},{id:"cursor",provider:"cursor",label:"Cursor",hint:"Cursor IDE — invoke chorus from inside it"},{id:"windsurf",provider:"windsurf",label:"Windsurf",hint:"Windsurf IDE — invoke chorus from inside it"}],N={"claude-code":"claude","codex-cli":"codex","gemini-cli":"gemini","opencode-cli":"opencode","kimi-cli":"kimi"},C={"claude-code":"claude-code","codex-cli":"codex-cli","gemini-cli":"gemini-cli","opencode-cli":"opencode-cli","kimi-cli":"kimi-cli"},S={dot:"bg-muted-foreground/40",gradient:"bg-gradient-to-br from-muted/30 via-card to-card"},A=w.filter(e=>"cursor"!==e.id&&"windsurf"!==e.id);function P(e){return(0,a.jsxs)("section",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"CLI subscriptions"}),(0,a.jsx)("div",{className:"grid grid-cols-1 items-start gap-2 lg:grid-cols-2",children:A.map(t=>{let r=e.selectedClis.has(t.id),n=e.detection[t.id],s=n?.found===!0,d=e.detecting&&!n,o=!s&&!d&&e.manualOpen.has(t.id),l=e.manualBusy.has(t.id),c=s?j.r2[N[t.id]]??S:S;return(0,a.jsxs)("div",{className:(0,g.cn)("flex h-72 flex-col rounded-lg border transition",s?"border-border":"border-border/60 opacity-70",c.gradient),children:[(0,a.jsxs)("button",{type:"button",onClick:()=>s&&e.toggleCli(t.id),disabled:!s,className:(0,g.cn)("flex shrink-0 items-center gap-3 px-4 py-3 text-left transition",s?"hover:bg-card/30":"cursor-not-allowed"),children:[(0,a.jsx)("div",{className:(0,g.cn)("grid h-5 w-5 shrink-0 place-items-center rounded border transition",!s&&"opacity-50",r?"border-primary bg-primary text-primary-foreground":"border-border"),children:r&&(0,a.jsx)(b.A,{className:"h-3 w-3"})}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)("span",{className:(0,g.cn)("h-2 w-2 shrink-0 rounded-full",c.dot)}),(0,a.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:t.label}),s?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-emerald-300",children:[(0,a.jsx)(b.A,{className:"h-3 w-3"})," Installed"]}):d?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Searching…"]}):(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Not found"})]})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-2 overflow-y-auto border-t border-border bg-card/30 p-4",children:[(0,a.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:s&&n.path?(0,a.jsx)("code",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono",children:n.path}):d?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"Probing PATH and known install dirs…"]}):t.hint}),!s&&!d&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>e.toggleManual(t.id),className:"text-[11px] text-muted-foreground transition hover:text-foreground",children:o?"Cancel":"Don't see it? Set path manually →"}),o&&(0,a.jsx)(_,{cliId:t.id,value:e.manualPath[t.id]??"",onChange:r=>e.setManualPath(e=>({...e,[t.id]:r})),error:e.manualError[t.id],busy:l,onSubmit:()=>e.submitManualPath(t.id)})]}),s&&"opencode-cli"===t.id&&r&&(0,a.jsx)(O,{loading:e.opencodeModelsLoading,error:e.opencodeModelsError,models:e.opencodeModels,selected:e.selectedOpencodeModels,onToggle:e.toggleOpencodeModel}),s&&"opencode-cli"!==t.id&&r&&(0,a.jsx)(M,{cliId:t.id,voices:e.cliVoices,savingVoiceIds:e.savingVoiceIds,saveError:e.voiceSaveError,onToggle:e.toggleVoice})]})]},t.id)})}),(0,a.jsx)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:"Cursor and Windsurf are IDEs that invoke chorus, not voices — wire them up on the Connect page after onboarding."})]})}function M({cliId:e,voices:t,savingVoiceIds:r,saveError:i,onToggle:n}){let s=C[e],d=t.filter(e=>e.provider===s).slice().sort((e,t)=>e.id===s?-1:t.id===s?1:e.model_id.localeCompare(t.model_id));if(0===d.length)return(0,a.jsx)("p",{className:"text-[11px] italic text-muted-foreground/70",children:"Models will populate after the daemon finishes seeding (refresh in a few seconds)."});let o=d.filter(e=>e.enabled).length;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground/70",children:[o,"/",d.length," enabled"]})]}),i&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:i}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1",children:d.map(e=>{let t=e.enabled,i=e.id===s;return(0,a.jsxs)("button",{type:"button",disabled:r.has(e.id),onClick:()=>n(e),title:e.model_id,className:(0,g.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",t?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,g.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",t?"border-primary bg-primary text-primary-foreground":"border-border"),children:t&&(0,a.jsx)(b.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:e.model_id}),i&&(0,a.jsx)("span",{className:"shrink-0 rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider text-emerald-300",children:"current"})]},e.id)})})]})}function O({loading:e,error:t,models:r,selected:n,onToggle:s}){return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Pick models to enable"}),(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground/70",children:[n.size," selected"]})]}),e&&(0,a.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 animate-spin"}),"Listing models from"," ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"opencode models"}),"…"]}),t&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:t}),r&&(0,a.jsxs)("div",{className:"space-y-2",children:[Object.entries(r.gateways).filter(([e])=>e.startsWith("opencode")).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("p",{className:"text-[10px] font-mono text-muted-foreground/80",children:[e,"/"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1",children:t.map(t=>{let r=n.has(t);return(0,a.jsxs)("button",{type:"button",onClick:()=>s(t),title:t,className:(0,g.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition",r?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,g.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",r?"border-primary bg-primary text-primary-foreground":"border-border"),children:r&&(0,a.jsx)(b.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:t.slice(e.length+1)})]},t)})})]},e)),(0,a.jsxs)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:["Pre-selected: ",r.defaultPicks.join(", ")||"none",". Change anytime in ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"Settings"}),"."]})]})]})}function _({cliId:e,value:t,onChange:r,error:n,busy:s,onSubmit:d}){let o=function(e){switch(e){case"claude-code":return"claude";case"codex-cli":return"codex";case"gemini-cli":return"gemini";case"opencode-cli":return"opencode";case"kimi-cli":return"kimi";case"grok-cli":return"grok";case"antigravity-cli":return"agy";default:return e}}(e);return(0,a.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-card/50 p-3",children:[(0,a.jsxs)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:["Paste the full path to the"," ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:o})," binary. Run"," ",(0,a.jsxs)("code",{className:"rounded bg-muted px-1",children:["which ",o]})," (macOS / Linux) or ",(0,a.jsxs)("code",{className:"rounded bg-muted px-1",children:["where ",o]})," ","(Windows) to find it. The daemon will run"," ",(0,a.jsxs)("code",{className:"rounded bg-muted px-1",children:[o," --version"]})," with a 2s timeout to confirm the binary works and identifies as the"," ",o," CLI."]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x,{value:t,onChange:e=>r(e.target.value),placeholder:`/full/path/to/${o}`,className:"flex-1 font-mono text-xs",spellCheck:!1,autoComplete:"off"}),(0,a.jsx)(l.$,{type:"button",variant:"secondary",disabled:s,onClick:d,children:s?(0,a.jsx)(i.A,{className:"h-4 w-4 animate-spin"}):"Verify"})]}),n&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:n})]})}let I=[{id:"strict",label:"Strict",hint:"Read-only. Reviewers can inspect code but can't write files, exec shell, or hit the network."},{id:"workspace",label:"Workspace (recommended)",hint:"Read+write inside the chat dir, scoped shell, no network. Default for most teams."},{id:"full",label:"Full access",hint:"No sandbox at all. Only on a personal machine you fully trust."}];function z({sandboxProfile:e,setSandboxProfile:t,autoApprovePrompts:r,setAutoApprovePrompts:i,networkAccess:n,setNetworkAccess:s}){return(0,a.jsxs)("section",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Permissions & sandbox"}),(0,a.jsx)("p",{className:"mb-4 text-xs leading-relaxed text-muted-foreground",children:"Controls what reviewers can do on your machine. You can change this anytime in Settings → Permissions."}),(0,a.jsx)("div",{className:"space-y-2",children:I.map(r=>{let i=e===r.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.id),className:(0,g.cn)("flex w-full items-start gap-3 rounded-lg border p-4 text-left transition",i?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,g.cn)("mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full border transition",i?"border-primary bg-primary text-primary-foreground":"border-border"),children:i&&(0,a.jsx)(b.A,{className:"h-3 w-3"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:r.label}),(0,a.jsx)("div",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.hint})]})]},r.id)})}),(0,a.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:r,onChange:e=>i(e.target.checked),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 text-xs leading-relaxed",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Skip in-CLI permission prompts"}),(0,a.jsxs)("div",{className:"mt-0.5 text-muted-foreground",children:["Passes ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"--afk"})," /"," ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"auto_edit"}),"to spawned reviewers so they don't hang on per-tool prompts. Off = every action requires explicit consent in the CLI's TUI."]})]})]}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:n,onChange:e=>s(e.target.checked),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 text-xs leading-relaxed",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Allow outbound network from reviewers"}),(0,a.jsx)("div",{className:"mt-0.5 text-muted-foreground",children:"Off by default. Templates that explicitly need network override per phase."})]})]})]})]})}var L=r(6185);async function E(e){for(let t of e.selectedClis){let e=w.find(e=>e.id===t);e&&await (0,L.WH)(e.provider,{kind:"cli_subscription",value:e.id,updatedAt:Date.now()})}for(let[t,r]of Object.entries(e.apiKeys)){let e=r.trim();e&&await (0,L.WH)(t,{kind:"api_key",value:e,updatedAt:Date.now()})}await (0,c.Ep)({sandboxProfile:e.sandboxProfile,autoApprovePrompts:e.autoApprovePrompts,networkAccess:e.networkAccess}),e.selectedClis.has("opencode-cli")&&e.opencodeModels&&await V(e),await (0,L.Xx)({onboarded:!0})}async function V(e){let{listVoices:t,updateVoice:a,createVoice:i}=await Promise.resolve().then(r.bind(r,7847)),n=new Map((await t({provider:"opencode-cli"}).catch(()=>[])).map(e=>[e.id,e])),s=e.opencodeModels;s&&await Promise.all(s.flat.map(async t=>{let r=`opencode-cli:${t}`,s=e.selectedOpencodeModels.has(t),d=n.get(r);try{if(d)d.enabled!==s&&await a(r,{enabled:s});else{let e,r,{lineage:a,vendor_family:n}=(r=((e=t.indexOf("/"))>=0?t.slice(e+1):t).toLowerCase()).includes("kimi")?{lineage:"moonshot",vendor_family:null}:r.includes("claude")?{lineage:"anthropic",vendor_family:null}:r.includes("gpt")||/(?:^|[^a-z])o[1-9](?:$|[^a-z0-9])/.test(r)?{lineage:"openai",vendor_family:null}:r.includes("gemini")?{lineage:"google",vendor_family:null}:r.includes("deepseek")?{lineage:"opencode",vendor_family:"deepseek"}:r.includes("llama")||r.includes("meta")?{lineage:"opencode",vendor_family:"meta"}:r.includes("mistral")||r.includes("mixtral")?{lineage:"opencode",vendor_family:"mistral"}:r.includes("grok")||r.includes("xai")?{lineage:"opencode",vendor_family:"xai"}:{lineage:"opencode",vendor_family:null};await i({provider:"opencode-cli",model_id:t,label:t,source:"cli",lineage:a,vendor_family:n,enabled:s})}}catch{}}))}function G(){let e=(0,s.useRouter)(),[t,r]=(0,d.useTransition)(),[p,g]=(0,d.useState)(null),[x,h]=(0,d.useState)(new Set),[b,f]=(0,d.useState)([]),[v,y]=(0,d.useState)(new Set),[j,w]=(0,d.useState)(null),[N,C]=(0,d.useState)({}),[S,A]=(0,d.useState)("workspace"),[M,O]=(0,d.useState)(!0),[_,I]=(0,d.useState)(!1),[V,G]=(0,d.useState)({}),[$,T]=(0,d.useState)(!0),[R,W]=(0,d.useState)(new Set),[D,K]=(0,d.useState)({}),[q,F]=(0,d.useState)({}),[H,Y]=(0,d.useState)(new Set),[J,B]=(0,d.useState)(null),[U,Z]=(0,d.useState)(null),[Q,X]=(0,d.useState)(!1),[ee,et]=(0,d.useState)(new Set);(0,d.useEffect)(()=>{let e=!1;return(0,c.fk)().then(t=>{if(e)return;let r={},a=new Set;for(let e of t)r[e.id]=e,e.found&&a.add(e.id);G(r),a.size>0&&h(a)}).catch(()=>{}).finally(()=>{e||T(!1)}),(0,m.listVoices)({source:"cli"}).then(t=>{e||f(t)}).catch(()=>{}),()=>{e=!0}},[]);let er=async e=>{y(t=>new Set(t).add(e.id)),w(null);try{let t=await (0,m.updateVoice)(e.id,{enabled:!e.enabled});f(e=>e.map(e=>e.id===t.id?t:e))}catch(e){w(e instanceof Error?e.message:"Couldn't save voice toggle.")}finally{y(t=>{let r=new Set(t);return r.delete(e.id),r})}};(0,d.useEffect)(()=>{!x.has("opencode-cli")||!V["opencode-cli"]?.found||J||Q||U||(X(!0),Z(null),(0,u.Ay)().then(e=>{B(e),et(t=>t.size>0?t:new Set(e.defaultPicks))}).catch(e=>{Z(e instanceof Error?e.message:"Couldn't list OpenCode models. Is the CLI authed (run `opencode auth login`)?")}).finally(()=>X(!1)))},[x,V,J,Q,U]);let ea=async e=>{let t=(D[e]||"").trim();if(!t)return void F(t=>({...t,[e]:"Enter the full path to the CLI program (e.g. /usr/local/bin/claude)."}));Y(t=>new Set(t).add(e)),F(t=>({...t,[e]:""}));try{let r=await (0,c.iW)(e,t);if(r.found){try{await (0,c.Df)(e,r.path??t)}catch(t){F(r=>({...r,[e]:`Validation passed but save failed: ${t instanceof Error?t.message:"unknown error"}. Try again, or paste the path again.`}));return}G(t=>({...t,[e]:r})),h(t=>new Set(t).add(e)),(0,m.listVoices)({source:"cli"}).then(f).catch(()=>{}),W(t=>{let r=new Set(t);return r.delete(e),r})}else{let t=r.reason??"couldn't run that path";F(r=>({...r,[e]:`Validation failed: ${t}.`}))}}catch{F(t=>({...t,[e]:"Validation failed. Is the daemon running?"}))}finally{Y(t=>{let r=new Set(t);return r.delete(e),r})}},ei=x.size+Object.values(N).filter(e=>e.trim().length>0).length;return(0,a.jsx)("main",{className:"min-h-screen bg-background text-foreground",children:(0,a.jsxs)("div",{className:"mx-auto w-full max-w-5xl px-4 py-10 sm:px-6 sm:py-14",children:[(0,a.jsxs)("div",{className:"mb-8 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"grid h-10 w-10 place-items-center rounded-md bg-primary/15 text-primary",children:(0,a.jsx)(o.U,{className:"h-6 w-6"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Welcome to Chorus"}),(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Connect at least one model to begin"})]})]}),(0,a.jsx)("p",{className:"mb-8 text-sm leading-relaxed text-muted-foreground",children:"Chorus runs your prompt past 2–4 LLMs of different lineages and synthesises consensus. Pick the CLI subscriptions you already have, or paste API keys. You can change these later in Settings."}),(0,a.jsx)(P,{selectedClis:x,toggleCli:e=>{h(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},detection:V,detecting:$,cliVoices:b,savingVoiceIds:v,voiceSaveError:j,toggleVoice:er,manualOpen:R,toggleManual:e=>{W(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),F(t=>({...t,[e]:""}))},manualPath:D,setManualPath:K,manualError:q,manualBusy:H,submitManualPath:ea,opencodeModels:J,opencodeModelsError:U,opencodeModelsLoading:Q,selectedOpencodeModels:ee,toggleOpencodeModel:e=>{et(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})}}),(0,a.jsx)(k,{apiKeys:N,updateApiKey:(e,t)=>{C(r=>({...r,[e]:t}))}}),(0,a.jsx)(z,{sandboxProfile:S,setSandboxProfile:A,autoApprovePrompts:M,setAutoApprovePrompts:O,networkAccess:_,setNetworkAccess:I}),p&&(0,a.jsx)("div",{className:"mb-6 rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:p}),(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:0===ei?"Pick at least one to continue.":`${ei} ${1===ei?"credential":"credentials"} ready to save.`}),(0,a.jsx)(l.$,{onClick:()=>{(g(null),0===ei)?g("Pick at least one CLI or paste at least one API key to continue."):r(async()=>{try{await E({selectedClis:x,apiKeys:N,sandboxProfile:S,autoApprovePrompts:M,networkAccess:_,opencodeModels:J,selectedOpencodeModels:ee}),e.push("/"),e.refresh()}catch(e){g(e instanceof L.$v?e.message:"Could not save. Is the Chorus daemon running?")}})},disabled:t||0===ei,className:"w-full sm:w-auto",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.A,{className:"mr-1 h-4 w-4 animate-spin"}),"Saving…"]}):(0,a.jsxs)(a.Fragment,{children:["Get started",(0,a.jsx)(n.A,{className:"ml-1 h-4 w-4"})]})})]})]})})}},2545:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},2881:(e,t,r)=>{"use strict";r.d(t,{Eu:()=>s,M5:()=>i,Y8:()=>n});var a=r(4411);async function i(e){return(0,a.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function n(){return(0,a.T)("/openrouter/models")}async function s(e,t){return(0,a.T)("/openrouter/voices",{method:"POST",body:JSON.stringify(t?{modelIds:e,apiKey:t}:{modelIds:e})})}},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>n,VW:()=>s,YM:()=>m,m_:()=>d,r2:()=>p,u5:()=>l,x0:()=>u,ze:()=>a});let a={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},i={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function n(e){return e?a[e]??e:""}function s(e){return e?i[e]??"bg-muted":"bg-muted"}let d={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},o={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function l(e){return e?d[e]??e:""}function c(e){return e?o[e]??"bg-muted":"bg-muted"}let u={claude:"claude-opus-4-7",codex:"gpt-5.5",gemini:"gemini-2.5-pro",opencode:"kimi-k2.6",kimi:"kimi-k2.6",openrouter:"",local:"",grok:"grok-build",antigravity:"gemini-3.5-flash"};function m(e){if(e)return u[e]}let p={claude:{dot:"bg-violet-400",ring:"ring-violet-400/40",gradient:"bg-gradient-to-b from-violet-500/15 to-card"},codex:{dot:"bg-orange-400",ring:"ring-orange-400/40",gradient:"bg-gradient-to-b from-orange-500/15 to-card"},gemini:{dot:"bg-blue-400",ring:"ring-blue-400/40",gradient:"bg-gradient-to-b from-blue-500/15 to-card"},opencode:{dot:"bg-emerald-400",ring:"ring-emerald-400/40",gradient:"bg-gradient-to-b from-emerald-500/15 to-card"},kimi:{dot:"bg-pink-400",ring:"ring-pink-400/40",gradient:"bg-gradient-to-b from-pink-500/15 to-card"},openrouter:{dot:"bg-cyan-400",ring:"ring-cyan-400/40",gradient:"bg-gradient-to-b from-cyan-500/15 to-card"},local:{dot:"bg-teal-400",ring:"ring-teal-400/40",gradient:"bg-gradient-to-b from-teal-500/15 to-card"},grok:{dot:"bg-slate-400",ring:"ring-slate-400/40",gradient:"bg-gradient-to-b from-slate-500/15 to-card"},antigravity:{dot:"bg-sky-400",ring:"ring-sky-400/40",gradient:"bg-gradient-to-b from-sky-500/15 to-card"}}},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).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"}]])},6289:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},8600:(e,t,r)=>{Promise.resolve().then(r.bind(r,1996))},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>s});var a=r(142);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=a.$,s=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:s,defaultVariants:d}=t,o=Object.keys(s).map(e=>{let t=null==r?void 0:r[e],a=null==d?void 0:d[e];if(null===t)return null;let n=i(t)||i(a);return s[e][n]}),l=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return n(e,o,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...i}=t;return Object.entries(i).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...d,...l}[t]):({...d,...l})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}},e=>{e.O(0,[742,641,506,128,358],()=>e(e.s=8600)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1195:(e,t,r)=>{"use strict";r.d(t,{OpencodeFleetCard:()=>x});var n=r(9442),s=r(6074),a=r(5445),d=r(9707),i=r(4030),o=r(2956),l=r(3734),c=r(7847),m=r(4411),u=r(7362);function x({health:e,voices:t}){let[r,i]=(0,s.useState)(!1),[o,p]=(0,s.useState)(t),[b,h]=(0,s.useState)(null),[f,y]=(0,s.useState)(null);async function v(e){y(e.id),h(null);try{let t=await (0,c.updateVoice)(e.id,{enabled:!e.enabled});p(e=>e.map(e=>e.id===t.id?t:e))}catch(e){h(e instanceof m.$?e.message:"Couldn't save. Is the daemon running?")}finally{y(null)}}let N=new Map;for(let e of o){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",n=N.get(r)??[];n.push(e),N.set(r,n)}let j=Array.from(N.keys()).sort(),k=o.filter(e=>e.enabled).length;return(0,n.jsxs)("div",{className:(0,u.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",l.r2.opencode.gradient),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,n.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",l.r2.opencode.dot)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"OpenCode"}),(0,n.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,n.jsx)(g,{status:e.status}),(0,n.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[k," model",1===k?"":"s"," enabled"]})]})]}),(0,n.jsx)(a.A,{className:(0,u.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",r&&"rotate-180")})]}),r&&(0,n.jsxs)("div",{className:"space-y-3 border-t border-border bg-card/50 p-3",children:[b&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:b}),0===o.length?(0,n.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["No OpenCode voices detected yet. Run ",(0,n.jsx)("code",{className:"rounded bg-muted px-1",children:"opencode models"})," ","and restart the daemon."]}):(0,n.jsxs)("div",{className:"space-y-3",children:[j.map(e=>{let t=N.get(e)??[];return(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("p",{className:"text-[11px] font-mono text-muted-foreground/80",children:[e,"/"]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(t=>{let r=t.enabled,s=t.model_id.slice(e.length+1);return(0,n.jsxs)("button",{type:"button",disabled:f===t.id,onClick:()=>v(t),title:t.model_id,className:(0,u.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",r?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,n.jsx)("div",{className:(0,u.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",r?"border-primary bg-primary text-primary-foreground":"border-border"),children:r&&(0,n.jsx)(d.A,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"truncate font-mono",children:s})]},t.id)})})]},e)}),(0,n.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Templates and the New Chat dialog will only offer models you've enabled here."})]})]})]})}function g({status:e}){switch(e){case"auth_invalid":case"quota_exhausted":case"rate_limited":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,n.jsx)(i.A,{className:"h-3 w-3"}),"auth_invalid"===e?"Auth broken":"quota_exhausted"===e?"Quota out":"Rate-limited"]});default:return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),"Connected"]})}}},2956:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>a,VW:()=>d,YM:()=>u,m_:()=>i,r2:()=>x,u5:()=>l,x0:()=>m,ze:()=>n});let n={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},s={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function a(e){return e?n[e]??e:""}function d(e){return e?s[e]??"bg-muted":"bg-muted"}let i={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter",local:"Local LLM",grok:"Grok",antigravity:"Antigravity"},o={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400",local:"bg-teal-400",grok:"bg-slate-400",antigravity:"bg-sky-400"};function l(e){return e?i[e]??e:""}function c(e){return e?o[e]??"bg-muted":"bg-muted"}let m={claude:"claude-opus-4-7",codex:"gpt-5.5",gemini:"gemini-2.5-pro",opencode:"kimi-k2.6",kimi:"kimi-k2.6",openrouter:"",local:"",grok:"grok-build",antigravity:"gemini-3.5-flash"};function u(e){if(e)return m[e]}let x={claude:{dot:"bg-violet-400",ring:"ring-violet-400/40",gradient:"bg-gradient-to-b from-violet-500/15 to-card"},codex:{dot:"bg-orange-400",ring:"ring-orange-400/40",gradient:"bg-gradient-to-b from-orange-500/15 to-card"},gemini:{dot:"bg-blue-400",ring:"ring-blue-400/40",gradient:"bg-gradient-to-b from-blue-500/15 to-card"},opencode:{dot:"bg-emerald-400",ring:"ring-emerald-400/40",gradient:"bg-gradient-to-b from-emerald-500/15 to-card"},kimi:{dot:"bg-pink-400",ring:"ring-pink-400/40",gradient:"bg-gradient-to-b from-pink-500/15 to-card"},openrouter:{dot:"bg-cyan-400",ring:"ring-cyan-400/40",gradient:"bg-gradient-to-b from-cyan-500/15 to-card"},local:{dot:"bg-teal-400",ring:"ring-teal-400/40",gradient:"bg-gradient-to-b from-teal-500/15 to-card"},grok:{dot:"bg-slate-400",ring:"ring-slate-400/40",gradient:"bg-gradient-to-b from-slate-500/15 to-card"},antigravity:{dot:"bg-sky-400",ring:"ring-sky-400/40",gradient:"bg-gradient-to-b from-sky-500/15 to-card"}}},3761:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).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"}]])},5445:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},5626:(e,t,r)=>{Promise.resolve().then(r.bind(r,6501)),Promise.resolve().then(r.t.bind(r,2573,23)),Promise.resolve().then(r.bind(r,821)),Promise.resolve().then(r.bind(r,9823)),Promise.resolve().then(r.bind(r,8344)),Promise.resolve().then(r.bind(r,1195)),Promise.resolve().then(r.bind(r,8359))},6289:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},8359:(e,t,r)=>{"use strict";r.d(t,{OpenRouterFleetCard:()=>h});var n=r(9442),s=r(6074),a=r(2573),d=r.n(a),i=r(5445),o=r(4030),l=r(6289),c=r(9707),m=r(3761),u=r(2956),x=r(3734),g=r(7847),p=r(4411),b=r(7362);function h({voices:e,health:t}){let r=t?.status==="auth_invalid",[a,f]=(0,s.useState)(r),[y,v]=(0,s.useState)(e),[N,j]=(0,s.useState)(null),[k,w]=(0,s.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,g.updateVoice)(e.id,{enabled:!e.enabled});v(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof p.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=y.filter(e=>e.enabled).length;return(0,n.jsxs)("div",{className:(0,b.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",x.r2.openrouter.gradient),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,n.jsx)("span",{className:(0,b.cn)("h-2 w-2 shrink-0 rounded-full",x.r2.openrouter.dot)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"OpenRouter"}),(0,n.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[function(e){switch(e){case"quota_exhausted":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),"Credits out"]});case"auth_invalid":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),"Auth broken"]});case"rate_limited":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,n.jsx)(m.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,n.jsx)(u.A,{className:"h-3 w-3"}),"Configured"]})}}(t?.status??"healthy"),(0,n.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,n.jsx)(i.A,{className:(0,b.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",a&&"rotate-180")})]}),a&&(0,n.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[r&&(0,n.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2.5",children:[(0,n.jsx)(o.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsxs)("p",{className:"text-[11px] leading-relaxed text-destructive",children:["OpenRouter rejected the saved API key",t?.message?`: ${t.message}`:"."]}),(0,n.jsxs)(d(),{href:"/connect",className:"inline-flex items-center gap-1 rounded border border-destructive/50 bg-destructive/10 px-2 py-1 text-[11px] font-medium text-destructive transition hover:bg-destructive/20",children:["Fix on Connect",(0,n.jsx)(l.A,{className:"h-3 w-3"})]})]})]}),N&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===y.length?(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No OpenRouter voices yet. Add some on the Connect page."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-1",children:y.map(e=>(0,n.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,b.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",e.enabled?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-muted-foreground/30"),children:[(0,n.jsx)("div",{className:(0,b.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",e.enabled?"border-primary bg-primary text-primary-foreground":"border-border"),children:e.enabled&&(0,n.jsx)(c.A,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),!r&&(0,n.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Add or replace your API key on Connect. Toggles save automatically."})]})]})}},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9823:(e,t,r)=>{"use strict";r.d(t,{LineageFleetCard:()=>b});var n=r(9442),s=r(6074),a=r(5445),d=r(9707),i=r(4030),o=r(3761),l=r(2956),c=r(3734),m=r(7847),u=r(4411),x=r(7362);let g={anthropic:"claude",openai:"codex",google:"gemini",opencode:"opencode",moonshot:"kimi"},p={dot:"bg-muted-foreground/40",gradient:"bg-gradient-to-br from-muted/30 via-card to-card"};function b({lineage:e,label:t,voices:r,health:i}){let o,[l,f]=(0,s.useState)(!1),[y,v]=(0,s.useState)(r),[N,j]=(0,s.useState)(null),[k,w]=(0,s.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,m.updateVoice)(e.id,{enabled:!e.enabled});v(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof u.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=y.filter(e=>e.enabled).length,_=(o=g[e])?c.r2[o]:p;return(0,n.jsxs)("div",{className:(0,x.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",_.gradient),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,n.jsx)("span",{className:(0,x.cn)("h-2 w-2 shrink-0 rounded-full",_.dot)}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:t}),(0,n.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,n.jsx)(h,{status:i.status}),(0,n.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,n.jsx)(a.A,{className:(0,x.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",l&&"rotate-180")})]}),l&&(0,n.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[N&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===y.length?(0,n.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No voices detected for this provider yet."}):(0,n.jsx)("div",{className:"grid grid-cols-1 gap-1",children:y.map(e=>{let t=e.enabled;return(0,n.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,x.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",t?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,n.jsx)("div",{className:(0,x.cn)("grid h-3 w-3 shrink-0 place-items-center rounded-sm border transition",t?"border-primary bg-primary text-primary-foreground":"border-border"),children:t&&(0,n.jsx)(d.A,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id)})}),(0,n.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Voice list is curated per chorus release — new models appear after upgrades."})]})]})}function h({status:e}){switch(e){case"auth_invalid":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,n.jsx)(i.A,{className:"h-3 w-3"}),"Auth broken"]});case"quota_exhausted":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,n.jsx)(i.A,{className:"h-3 w-3"}),"Quota out"]});case"rate_limited":return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,n.jsx)(l.A,{className:"h-3 w-3"}),"Connected"]})}}}},e=>{e.O(0,[742,832,641,344,506,128,358],()=>e(e.s=5626)),_N_E=e.O()}]);
@@ -0,0 +1,25 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{52:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>n});var s=r(9442);r(6074);var a=r(7362);function n({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card",className:(0,a.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}},2471:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).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"}]])},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3761:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).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"}]])},4372:(e,t,r)=>{"use strict";r.d(t,{G:()=>o});var s=r(9442),a=r(821),n=r(8344);function o({children:e}){return(0,s.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[(0,s.jsx)(a.AppSidebar,{}),(0,s.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,s.jsx)(n.MobileTopBar,{}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}},5702:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var s=r(9442);r(6074);var a=r(9056),n=r(8113),o=r(7362);let d=(0,a.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function l({className:e,variant:t="default",asChild:r=!1,...a}){let i=r?n.bL:"span";return(0,s.jsx)(i,{"data-slot":"badge","data-variant":t,className:(0,o.cn)(d({variant:t}),e),...a})}},6457:(e,t,r)=>{"use strict";r.d(t,{z:()=>a});var s=r(9442);function a({eyebrow:e,title:t,subtitle:r,action:n}){return(0,s.jsxs)("header",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e}),(0,s.jsx)("h1",{className:"mt-1 text-2xl font-semibold tracking-tight",children:t}),r&&(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-muted-foreground",children:r})]}),n&&(0,s.jsx)("div",{className:"shrink-0 self-start sm:self-auto",children:n})]})}},6527:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("folder-lock",[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 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 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]])},6624:(e,t,r)=>{Promise.resolve().then(r.bind(r,8212))},7978:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]])},8212:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ee});var s=r(9442),a=r(6074),n=r(3884);let o=(0,n.A)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);var d=r(9208),l=r(4372),i=r(6457);let c=(0,n.A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var u=r(3761);let m=(0,n.A)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);var x=r(6441),h=r(5702),p=r(63),f=r(9707),b=r(2471);let g=[{id:"read",name:"Read files",description:"cat, less, head, file open"},{id:"list",name:"List & search",description:"ls, grep, find, ripgrep"},{id:"write",name:"Write files",description:"Edit, Write inside allowed dirs"},{id:"exec",name:"Run commands",description:"Bash, npm, pnpm, python, go"},{id:"net",name:"Network access",description:"curl, fetch, package install"},{id:"outside-cwd",name:"Writes outside working dir",description:"Anything outside the allowed paths below"}],y={read:"auto",list:"auto",write:"ask",exec:"ask",net:"ask","outside-cwd":"block"},v={read:"auto",list:"auto",write:"block",exec:"ask",net:"ask","outside-cwd":"block"},j={auto:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",ask:"bg-amber-500/15 text-amber-300 border-amber-500/30",block:"bg-rose-500/15 text-rose-300 border-rose-500/30"};function w(e){return"auto"===e?"ask":"ask"===e?"block":"auto"}function N({id:e,icon:t,title:r,subtitle:a,children:n}){return(0,s.jsxs)(p.Zp,{id:e,className:"mt-6 scroll-mt-20 bg-card p-5",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,s.jsx)("span",{className:"rounded-md border border-border bg-card/60 p-1.5 text-foreground/70",children:t}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-foreground",children:r}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a})]})]}),n]})}function k({label:e,children:t}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:e}),t]})}function C({policy:e,onCycle:t,role:r}){return(0,s.jsx)("button",{type:"button",onClick:t,className:`justify-self-end rounded-md border px-2.5 py-1 font-mono text-[10px] uppercase tracking-wider transition hover:scale-105 ${j[e]}`,title:`${r}: cycle policy`,children:e})}function A({kind:e,current:t,onSelect:r,icon:a,title:n,tagline:o,features:d,tradeoff:l}){let i=e===t;return(0,s.jsxs)("button",{type:"button",onClick:r,className:`flex w-full items-start gap-3 rounded-lg border p-3.5 text-left transition ${i?"border-primary/40 bg-primary/5 ring-2 ring-primary/30 ring-offset-2 ring-offset-background":"border-border bg-card/40 hover:border-foreground/30"}`,children:[(0,s.jsx)("span",{className:`mt-0.5 grid h-7 w-7 shrink-0 place-items-center rounded-md ${i?"bg-primary/20 text-primary":"bg-card text-muted-foreground"}`,children:a}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-foreground",children:n}),(0,s.jsx)(h.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:o})]}),(0,s.jsx)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] text-muted-foreground",children:d.map(e=>(0,s.jsxs)("li",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(f.A,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-400/60"}),(0,s.jsx)("span",{children:e})]},e))}),(0,s.jsxs)("div",{className:"mt-2 flex items-start gap-1.5 text-[10px] text-muted-foreground",children:[(0,s.jsx)(b.A,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/60"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-medium text-foreground/80",children:"Trade-off:"})," ",l]})]})]}),i&&(0,s.jsx)(f.A,{className:"mt-1 h-4 w-4 shrink-0 text-primary"})]})}function M(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(void 0),[o,d]=(0,a.useState)(null),[l,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,x.Dl)().then(r=>{e||(t(r.mode),n(r.descriptions))}).catch(t=>{e||i(t instanceof Error?t.message:"Could not load billing mode.")}),()=>{e=!0}},[]),(0,s.jsxs)(N,{icon:(0,s.jsx)(m,{className:"h-4 w-4"}),title:"Billing mode",subtitle:"How you pay for the AI CLIs chorus drives. Affects what the cost preview shows on the new-chat page — defaults to API rates so the number stays honest until you tell us otherwise.",children:[l&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:l}),(0,s.jsx)("div",{className:"grid gap-2",children:["api","subscription","mixed"].map(a=>{let n=e===a,l=o===a,c=r?.[a];return(0,s.jsxs)("button",{type:"button",onClick:()=>{e===a||o||(d(a),i(null),(0,x.A1)({mode:a}).then(e=>t(e.mode)).catch(e=>{i(e instanceof Error?e.message:"Save failed.")}).finally(()=>d(null)))},disabled:null!==o||null===e,className:`flex flex-col gap-1 rounded-lg border p-3 text-left transition ${n?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"} ${null!==o?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:c?.label??a}),n&&(0,s.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:l?"saving…":"active"})]}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c?.description??""})]},a)})})]})}var S=r(8821);let T=(0,n.A)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var D=r(9315);function E(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!1,r=()=>{(0,x.R8)().then(r=>{e||t(r)}).catch(t=>{e||n(t instanceof Error?t.message:"Could not load chat concurrency settings.")})};r();let s=setInterval(r,5e3);return()=>{e=!0,clearInterval(s)}},[]);let l=async e=>{if(!o){d(!0),n(null);try{let r=await (0,x.Y5)(e);t(e=>({...e,...r,defaults:r.defaults??e?.defaults,live:e?.live}))}catch(e){n(e instanceof Error?e.message:"Save failed.")}finally{d(!1)}}};if(!e)return(0,s.jsx)(N,{id:"chat-concurrency",icon:(0,s.jsx)(S.A,{className:"h-4 w-4"}),title:"Chat concurrency",subtitle:"Max chats fanning out at once + resource-pressure guardrails.",children:(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r??"Loading…"})});let i=e.live,c=e.defaults;return(0,s.jsxs)(N,{id:"chat-concurrency",icon:(0,s.jsx)(S.A,{className:"h-4 w-4"}),title:"Chat concurrency",subtitle:"Max chats fanning out simultaneously. Refuses admission when swap or load are under pressure. Distinct from the per-CLI cap above — this layer prevents the failure mode where N chats \xd7 M reviewers each oversubscribe the host.",children:[r&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:r}),i&&(0,s.jsxs)("div",{className:"mb-4 grid grid-cols-2 gap-x-4 gap-y-1 rounded-md border border-border bg-card/50 px-3 py-2 text-xs",children:[(0,s.jsx)("div",{className:"text-muted-foreground",children:"Active chats"}),(0,s.jsxs)("div",{className:"font-mono text-foreground",children:[i.activeChats,i.queueDepth>0&&(0,s.jsxs)("span",{className:"text-amber-400",children:[" + ",i.queueDepth," queued"]})]}),(0,s.jsx)("div",{className:"text-muted-foreground",children:"Free swap"}),(0,s.jsx)("div",{className:"font-mono text-foreground",children:i.swapFreeMb>0?`${i.swapFreeMb} MB`:(0,s.jsx)("span",{className:"text-muted-foreground",children:"n/a"})}),(0,s.jsx)("div",{className:"text-muted-foreground",children:"Load avg (1m, per-core)"}),(0,s.jsxs)("div",{className:"font-mono text-foreground",children:[(i.loadAvg1/Math.max(1,i.cpuCount)).toFixed(2),(0,s.jsxs)("span",{className:"text-muted-foreground",children:[" (",i.loadAvg1.toFixed(2)," / ",i.cpuCount," cores)"]})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("label",{htmlFor:"cc-chats",className:"block text-sm font-medium text-foreground",children:"Max concurrent chats"}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Hard cap on chats actively fanning out reviewers.",c&&(0,s.jsxs)("span",{className:"text-muted-foreground/70",children:[" Default ",c.maxConcurrentChats,"."]})]})]}),(0,s.jsx)($,{id:"cc-chats",min:1,max:20,value:e.maxConcurrentChats,disabled:o,onCommit:e=>l({maxConcurrentChats:e})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 border-t border-border pt-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("label",{htmlFor:"cc-swap",className:"block text-sm font-medium text-foreground",children:"Min free swap (MB)"}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Refuse admission when free swap drops below this. 0 disables the check (boxes without swap / containers).",c&&(0,s.jsxs)("span",{className:"text-muted-foreground/70",children:[" Default ",c.swapMinFreeMb,"."]})]})]}),(0,s.jsx)($,{id:"cc-swap",min:0,max:16384,step:256,value:e.swapMinFreeMb,disabled:o,onCommit:e=>l({swapMinFreeMb:e})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 border-t border-border pt-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("label",{htmlFor:"cc-load",className:"block text-sm font-medium text-foreground",children:"Max load avg (per core)"}),(0,s.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Refuse admission when 1-min load \xf7 CPU count exceeds this. 0 disables.",c&&(0,s.jsxs)("span",{className:"text-muted-foreground/70",children:[" Default ",c.loadAvgMaxPerCore," on ",c.cpuCount,"-core host."]})]})]}),(0,s.jsx)($,{id:"cc-load",min:0,max:10,step:.5,value:e.loadAvgMaxPerCore,disabled:o,onCommit:e=>l({loadAvgMaxPerCore:e})})]})]})]})}function $({id:e,min:t,max:r,step:a=1,value:n,disabled:o,onCommit:d}){let l=e=>Math.max(t,Math.min(r,e));return(0,s.jsxs)("div",{className:"flex items-center rounded-md border border-border bg-card",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{if(o)return;let e=l(Number((n-a).toFixed(2)));e!==n&&d(e)},disabled:o||n<=t,"aria-label":`Decrease ${e}`,className:"flex items-center justify-center px-2.5 py-1.5 text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:(0,s.jsx)(T,{className:"h-3.5 w-3.5"})}),(0,s.jsx)("input",{id:e,type:"text",readOnly:!0,value:n,className:"w-14 border-x border-border bg-transparent text-center font-mono text-sm tabular-nums focus:outline-none"}),(0,s.jsx)("button",{type:"button",onClick:()=>{if(o)return;let e=l(Number((n+a).toFixed(2)));e!==n&&d(e)},disabled:o||n>=r,"aria-label":`Increase ${e}`,className:"flex items-center justify-center px-2.5 py-1.5 text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:(0,s.jsx)(D.A,{className:"h-3.5 w-3.5"})})]})}let P=(0,n.A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);function _(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!1;return(0,x.lT)().then(r=>{e||t(r)}).catch(t=>{e||n(t instanceof Error?t.message:"Could not load concurrency settings.")}),()=>{e=!0}},[]);let l=async e=>{if(!o){d(!0),n(null);try{let r=await (0,x.Wt)(e);t(r)}catch(e){n(e instanceof Error?e.message:"Save failed.")}finally{d(!1)}}};if(!e)return(0,s.jsx)(N,{id:"concurrency",icon:(0,s.jsx)(P,{className:"h-4 w-4"}),title:"Concurrency",subtitle:"Max parallel CLI subprocesses across all chats. Caps memory pressure when stacking heavyweight reviewers.",children:(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r??"Loading…"})});let{maxParallelCli:i,perCli:c,cliLineages:u=[],defaults:m}=e;return(0,s.jsxs)(N,{id:"concurrency",icon:(0,s.jsx)(P,{className:"h-4 w-4"}),title:"Concurrency",subtitle:"Max parallel CLI subprocesses across all chats (daemon-wide). HTTP shims like OpenRouter bypass these caps — they don't consume local resources.",children:[r&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:r}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("label",{htmlFor:"cc-global",className:"block text-sm font-medium text-foreground",children:"Global cap"}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Total local-CLI subprocesses across the whole daemon. Applies to reviewers + doer combined."})]}),(0,s.jsx)(O,{id:"cc-global",min:1,max:10,value:i,disabled:o,onCommit:e=>l({maxParallelCli:e})})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Per-CLI caps"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Tightening a single binary family — e.g. opencode is heavy (~450 MB / proc) so default is 2."}),(0,s.jsx)("div",{className:"mt-3 space-y-2",children:u.map(e=>{let t=c[e]??m?.perCli[e]??2;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{htmlFor:`cc-${e}`,className:"font-mono text-sm text-foreground",children:e}),(0,s.jsx)(O,{id:`cc-${e}`,min:1,max:5,value:t,disabled:o,onCommit:t=>l({perCli:{[e]:t}})})]},e)})})]})]})]})}function O({id:e,min:t,max:r,value:a,disabled:n,onCommit:o}){return(0,s.jsxs)("div",{className:"flex items-center rounded-md border border-border bg-card",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{if(n)return;let e=Math.max(t,a-1);e!==a&&o(e)},disabled:n||a<=t,"aria-label":`Decrease ${e}`,className:"px-2.5 py-1.5 text-sm text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:"−"}),(0,s.jsx)("input",{id:e,type:"text",readOnly:!0,value:a,className:"w-9 border-x border-border bg-transparent text-center font-mono text-sm tabular-nums focus:outline-none"}),(0,s.jsx)("button",{type:"button",onClick:()=>{if(n)return;let e=Math.min(r,a+1);e!==a&&o(e)},disabled:n||a>=r,"aria-label":`Increase ${e}`,className:"px-2.5 py-1.5 text-sm text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:"+"})]})}var L=r(6527),R=r(4030),F=r(6891),I=r(7978);let U=(0,n.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),z=(0,n.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),W=(0,n.A)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),H=(0,n.A)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]),q=(0,n.A)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var V=r(3149);let B=(0,n.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"}]]);function Y(e){return(0,s.jsxs)("div",{className:"mt-2 select-none opacity-60 [&_*]:pointer-events-none","aria-disabled":"true",children:[(0,s.jsxs)(N,{icon:(0,s.jsx)(L.A,{className:"h-4 w-4"}),title:"Per-tool auto-approve",subtitle:"Drivers write code; reviewers don't. Defaults reflect that. Click any chip to cycle auto / ask / block.",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_120px_120px] gap-3 border-b border-border pb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:[(0,s.jsx)("span",{children:"Tool"}),(0,s.jsxs)("span",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-400"}),"Driver"]}),(0,s.jsxs)("span",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-400"}),"Reviewer"]})]}),(0,s.jsx)("div",{className:"mt-1 divide-y divide-border opacity-70",children:g.map(t=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_120px_120px] items-center gap-3 py-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:t.name}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:t.description})]}),(0,s.jsx)(C,{policy:e.driverPolicies[t.id],onCycle:()=>e.cyclePolicy("driver",t.id),role:"driver"}),(0,s.jsx)(C,{policy:e.reviewerPolicies[t.id],onCycle:()=>e.cyclePolicy("reviewer",t.id),role:"reviewer"})]},t.id))}),(0,s.jsxs)("p",{className:"mt-3 flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-100",children:[(0,s.jsx)(R.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-semibold",children:"When wired:"})," ",(0,s.jsx)("code",{className:"rounded bg-amber-400/10 px-1 font-mono text-amber-200",children:"ask"})," ","prompts will appear as cards in the chat — you click"," ",(0,s.jsx)("span",{className:"font-semibold",children:"Approve"})," /"," ",(0,s.jsx)("span",{className:"font-semibold",children:"Deny"})," instead of the agent stalling."]})]})]}),(0,s.jsxs)(N,{icon:(0,s.jsx)(L.A,{className:"h-4 w-4"}),title:"Working directories",subtitle:"Each tmux session is started inside one of these paths. Writes outside are blocked.",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:e.allowedDirs.map(t=>(0,s.jsxs)("span",{className:"group inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-[11px] text-foreground",children:[t,(0,s.jsx)("button",{type:"button",onClick:()=>e.setAllowedDirs(e.allowedDirs.filter(e=>e!==t)),className:"text-muted-foreground/50 transition hover:text-rose-400","aria-label":`Remove ${t}`,children:(0,s.jsx)(F.A,{className:"h-3 w-3"})})]},t))}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:e.newDir,onChange:t=>e.setNewDir(t.target.value),onKeyDown:t=>"Enter"===t.key&&e.addDir(),placeholder:"~/code/another-project",className:"flex-1 rounded-md border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),(0,s.jsxs)("button",{type:"button",onClick:e.addDir,className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition hover:bg-primary/90",children:[(0,s.jsx)(D.A,{className:"h-3.5 w-3.5"}),"Add path"]})]})]}),(0,s.jsx)(N,{icon:(0,s.jsx)(I.A,{className:"h-4 w-4"}),title:"Template defaults",subtitle:"Applied to new templates and one-off chats. Per-template values override these.",children:(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(k,{label:"Default driver",children:(0,s.jsxs)("select",{value:e.defaultDriver,onChange:t=>e.setDefaultDriver(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"claude-code",children:"claude-code"}),(0,s.jsx)("option",{value:"cursor",children:"cursor"}),(0,s.jsx)("option",{value:"codex-cli",children:"codex-cli"}),(0,s.jsx)("option",{value:"windsurf",children:"windsurf"}),(0,s.jsx)("option",{value:"external",children:"external (ask each run)"})]})}),(0,s.jsx)(k,{label:"Default agreement threshold",children:(0,s.jsxs)("select",{value:e.defaultThreshold,onChange:t=>e.setDefaultThreshold(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"unanimous",children:"unanimous"}),(0,s.jsx)("option",{value:"majority",children:"majority"}),(0,s.jsx)("option",{value:"any",children:"any"})]})}),(0,s.jsx)(k,{label:"Default cost cap (USD per chat)",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:"$"}),(0,s.jsx)("input",{type:"number",step:"0.10",min:0,value:e.defaultCostCap,onChange:t=>e.setDefaultCostCap(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-foreground focus:border-foreground/30 focus:outline-none"})]})}),(0,s.jsx)(k,{label:"On model error",children:(0,s.jsxs)("select",{defaultValue:"fallback",className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"fallback",children:"try next fallback model"}),(0,s.jsx)("option",{value:"fail",children:"mark chat failed"}),(0,s.jsx)("option",{value:"ask-user",children:"surface to me"})]})})]})}),(0,s.jsx)(N,{icon:(0,s.jsx)(c,{className:"h-4 w-4"}),title:"Privacy & data path",subtitle:"How prompts and code reach each LLM. Affects what leaves your machine.",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(A,{current:e.privacyTier,kind:"local",onSelect:()=>e.setPrivacyTier("local"),icon:(0,s.jsx)(U,{className:"h-4 w-4"}),title:"Local-only (BYO CLIs)",tagline:"Strictest",features:["Daemon runs on your machine; CLIs run on your machine.","Prompts go directly from your machine to each provider.","Chorus sees nothing — not even chat IDs."],tradeoff:"No cloud dashboard, no team sharing, no fallback when a CLI is down."}),(0,s.jsx)(A,{current:e.privacyTier,kind:"proxied",onSelect:()=>e.setPrivacyTier("proxied"),icon:(0,s.jsx)(z,{className:"h-4 w-4"}),title:"Proxied credits",tagline:"Recommended for credits",features:["Stateless edge proxy: prompts transit, never persist.","Stripe-pattern: same payload-handling discipline.","Used only when you spend credits to try a model you don't have."],tradeoff:"One extra hop between you and the provider."}),(0,s.jsx)(A,{current:e.privacyTier,kind:"cloud",onSelect:()=>e.setPrivacyTier("cloud"),icon:(0,s.jsx)(W,{className:"h-4 w-4"}),title:"Cloud workspace",tagline:"Team / multi-machine",features:["Code is cloned into Chorus's cloud workspace.","Transcripts + verdicts kept for audit & retro.","Encrypted at rest; SOC 2 in progress."],tradeoff:"Your code lives on our infra. Read the privacy whitepaper before flipping this on."})]})}),(0,s.jsx)(N,{icon:(0,s.jsx)(H,{className:"h-4 w-4"}),title:"Notifications & MCP",subtitle:"How outer orchestrators (your main Claude / Cursor session) get pinged when a chat finishes or blocks.",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>e.setMcpEnabled(!e.mcpEnabled),className:"flex w-full items-center justify-between rounded-md border border-border bg-card/50 px-3 py-3 text-left transition hover:border-foreground/20",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(q,{className:"mt-0.5 h-4 w-4 text-primary"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:"Chorus MCP server"}),(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["Exposes ",(0,s.jsx)("span",{className:"font-mono",children:"mm.create_chat"}),","," ",(0,s.jsx)("span",{className:"font-mono",children:"mm.update_settings"}),","," ",(0,s.jsx)("span",{className:"font-mono",children:"mm.create_template"})," and 9 other tools. Outer Claude / Cursor / Codex can configure Chorus for you."]})]})]}),(0,s.jsx)("span",{className:`flex h-5 w-9 items-center rounded-full border p-0.5 transition ${e.mcpEnabled?"border-emerald-500/40 bg-emerald-500/20":"border-border bg-card"}`,children:(0,s.jsx)("span",{className:`h-3.5 w-3.5 rounded-full transition-transform ${e.mcpEnabled?"translate-x-4 bg-emerald-400":"bg-muted-foreground/50"}`})})]}),(0,s.jsxs)(k,{label:"Webhook URL (optional)",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"url",value:e.webhookUrl,onChange:t=>e.setWebhookUrl(t.target.value),placeholder:"https://hooks.example.com/chorus",className:"flex-1 rounded-md border border-border bg-card px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),(0,s.jsxs)("button",{type:"button",onClick:e.testWebhook,disabled:!e.webhookUrl||"running"===e.webhookTestState,className:`flex items-center gap-1.5 rounded-md border px-3 py-2 text-xs font-medium transition ${"ok"===e.webhookTestState?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"fail"===e.webhookTestState?"border-rose-500/30 bg-rose-500/10 text-rose-300":"border-border bg-card text-muted-foreground hover:text-foreground"} disabled:cursor-not-allowed disabled:opacity-50`,children:["running"===e.webhookTestState?(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 animate-spin"}):"ok"===e.webhookTestState?(0,s.jsx)(f.A,{className:"h-3.5 w-3.5"}):"fail"===e.webhookTestState?(0,s.jsx)(R.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(B,{className:"h-3.5 w-3.5"}),"ok"===e.webhookTestState?"204 OK":"fail"===e.webhookTestState?"Failed":"running"===e.webhookTestState?"Posting…":"Test"]})]}),(0,s.jsx)("p",{className:"mt-1.5 text-[11px] text-muted-foreground",children:"Posted on chat finished / blocked / errored. Payload includes chat_id, status, synthesis."})]})]})})]})}var Z=r(52);function G(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(!1),[o,d]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return(0,x.Ci)().then(r=>{e||t(r)}).catch(t=>{e||d(t instanceof Error?t.message:"Could not load telemetry status.")}),()=>{e=!0}},[]);let l=e?.envOverride||e?.fileOverride;return(0,s.jsxs)(N,{icon:(0,s.jsx)(Z.A,{className:"h-4 w-4"}),title:"Anonymous telemetry",subtitle:"A small heartbeat sent to chorus.codes once per boot + every 24h. Helps us see what versions / OSes are in the wild. No code, no prompts, no chat content.",children:[o&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:o}),(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card p-3",children:(0,s.jsxs)("label",{className:"flex items-start gap-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:e?.enabled??!1,onChange:s=>{var a;return a=s.target.checked,void(!r&&e&&!l&&(n(!0),d(null),(0,x.WK)(a).then(t).catch(e=>{d(e instanceof Error?e.message:"Save failed.")}).finally(()=>n(!1))))},disabled:r||!e||l,className:"mt-1 h-4 w-4 cursor-pointer accent-primary disabled:cursor-not-allowed"}),(0,s.jsxs)("span",{className:"flex-1",children:[(0,s.jsxs)("span",{className:"block text-sm font-medium",children:["Send anonymous heartbeat",r&&(0,s.jsx)("span",{className:"ml-2 rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:"saving…"})]}),(0,s.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:"Sends: install UUID, chorus version, OS, arch, node major, daemon uptime, count of chats in the last 24h. That's it."})]})]})}),l&&(0,s.jsxs)("div",{className:"mt-3 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-100",children:["Telemetry is currently disabled by"," ",e?.envOverride&&(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TELEMETRY"}),e?.envOverride&&e?.fileOverride&&" and ",e?.fileOverride&&(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"~/.chorus/no-telemetry"}),". The toggle above won't take effect until you remove the override."]}),(0,s.jsxs)("details",{className:"mt-3 text-xs text-muted-foreground",children:[(0,s.jsx)("summary",{className:"cursor-pointer hover:text-foreground",children:"Other ways to opt out"}),(0,s.jsxs)("ul",{className:"mt-2 list-inside list-disc space-y-1 leading-relaxed",children:[(0,s.jsxs)("li",{children:["Set ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TELEMETRY=0"})," ","in your shell — also accepts ",(0,s.jsx)("code",{children:"false"}),", ",(0,s.jsx)("code",{children:"no"}),","," ",(0,s.jsx)("code",{children:"off"}),"."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"touch ~/.chorus/no-telemetry"})," ","(cargo / brew convention)."]}),(0,s.jsxs)("li",{children:["Reset your install ID:"," ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"rm ~/.chorus/install-id"})," ","— a fresh UUID is minted on the next heartbeat."]})]}),e?.endpoint&&(0,s.jsxs)("p",{className:"mt-2 leading-relaxed",children:["Endpoint: ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:e.endpoint})]})]})]})}let K=(0,n.A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function J(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)(void 0),[o,d]=(0,a.useState)(!0),[l,i]=(0,a.useState)(null),[c,u]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,x.oD)().then(r=>{e||(t(r.transport),n(r.descriptions),d(!1!==r.tmuxAvailable))}).catch(t=>{e||u(t instanceof Error?t.message:"Could not load transport setting.")}),()=>{e=!0}},[]),(0,s.jsxs)(N,{id:"transport",icon:(0,s.jsx)(K,{className:"h-4 w-4"}),title:"Run mode (headless / tmux)",subtitle:"How chorus runs each CLI. Default is headless (faster, lower RAM). Switch to tmux if you want to attach to a live voice and take over mid-run (debug + handoff).",children:[c&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:c}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:["headless","tmux"].map(a=>{let n=e===a,d=l===a,c=r?.[a],m="tmux"===a&&!o;return(0,s.jsxs)("button",{type:"button",onClick:()=>{e===a||l||(i(a),u(null),(0,x.nr)({transport:a}).then(e=>{t(e.transport)}).catch(e=>{u(e instanceof Error?e.message:"Save failed.")}).finally(()=>i(null)))},disabled:null!==l||null===e||m,title:m?"tmux is not installed on this host. Install it (brew/apt/dnf) then restart the daemon.":void 0,className:`flex flex-col gap-1 rounded-lg border p-3 text-left transition ${n?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"} ${null!==l||m?"opacity-60 cursor-not-allowed":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:c?.label??("headless"===a?"Headless":"Tmux")}),n?(0,s.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:d?"saving…":"active"}):m?(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"not installed"}):null]}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c?.description??("headless"===a?"Subprocess per call. Lower RAM, faster cold start, no permission dialogs.":"Persistent terminal sessions you can attach to for visual debug.")}),m&&(0,s.jsxs)("p",{className:"mt-1 text-[10px] leading-relaxed text-amber-300/80",children:["Install: macOS ",(0,s.jsx)("code",{children:"brew install tmux"})," \xb7 Ubuntu ",(0,s.jsx)("code",{children:"apt install tmux"})," \xb7 Fedora ",(0,s.jsx)("code",{children:"dnf install tmux"}),". Restart the daemon afterwards."]})]},a)})}),(0,s.jsxs)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:["Tip: set ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TRANSPORT=tmux"})," in your environment to override per-shell without changing this setting."]})]})}function Q(e){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N,{icon:(0,s.jsx)(c,{className:"h-4 w-4"}),title:"Sandbox & first-call permissions",subtitle:"What can chorus-spawned reviewers do on this machine? Pick a profile, toggle prompt auto-approval, choose whether to allow outbound network.",children:(0,s.jsxs)("a",{href:"/settings/permissions",className:"inline-flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition hover:bg-primary/10",children:["Open Permissions page",(0,s.jsx)("span",{"aria-hidden":!0,children:"→"})]})}),(0,s.jsx)(J,{}),(0,s.jsx)(_,{}),(0,s.jsx)(E,{}),(0,s.jsx)(M,{}),(0,s.jsx)(G,{}),(0,s.jsxs)("div",{className:"mt-12 flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm text-amber-100",role:"note",children:[(0,s.jsx)(u.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-400"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-semibold",children:"Coming in v0.8 — preview only"}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-amber-100/80",children:"The sections below show planned controls. They're not wired to the daemon yet — interaction is disabled. The YAML toggle at the top of the page already exposes the schema if you're curious."})]})]}),(0,s.jsx)(Y,{...e})]})}function X({yaml:e}){return(0,s.jsxs)(p.Zp,{className:"overflow-hidden bg-card p-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wider text-foreground",children:"settings.yaml"}),(0,s.jsx)(h.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:"~/.chorus/settings.yaml"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[(0,s.jsx)(Z.A,{className:"h-3 w-3"}),"live-rendered from form state"]})]}),(0,s.jsx)("textarea",{value:e,readOnly:!0,spellCheck:!1,className:"block min-h-[520px] w-full resize-none border-0 bg-background px-5 py-4 font-mono text-[12px] leading-relaxed text-foreground/90 focus:outline-none"}),(0,s.jsxs)("div",{className:"flex items-center justify-between border-t border-border px-4 py-2.5 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:["Same shape that"," ",(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:"mm.update_settings"})," ","accepts as a patch."]}),(0,s.jsx)("button",{type:"button",className:"rounded-md border border-border bg-card px-2 py-1 text-[10px] text-muted-foreground transition hover:text-foreground",children:"Copy"})]})]})}function ee(){let[e,t]=(0,a.useState)("form"),[r,n]=(0,a.useState)(3),[c,u]=(0,a.useState)(y),[m,x]=(0,a.useState)(v),[h,p]=(0,a.useState)(["~/dev","~/work","/tmp/chorus-sandbox"]),[f,b]=(0,a.useState)(""),[j,N]=(0,a.useState)("claude-code"),[k,C]=(0,a.useState)("2.00"),[A,M]=(0,a.useState)("unanimous"),[S,T]=(0,a.useState)(""),[D,E]=(0,a.useState)(!0),[$,P]=(0,a.useState)("local"),[_,O]=(0,a.useState)("idle"),L=(0,a.useMemo)(()=>{var e;let t,s,a;return t=(e={maxConcurrent:r,driverPolicies:c,reviewerPolicies:m,allowedDirs:h,defaultDriver:j,defaultCostCap:k,defaultThreshold:A,mcpEnabled:D,webhookUrl:S}).allowedDirs.map(e=>` - ${e}`).join("\n"),s=g.map(t=>` ${t.id.replace("-","_")}: ${e.driverPolicies[t.id]}`).join("\n"),a=g.map(t=>` ${t.id.replace("-","_")}: ${e.reviewerPolicies[t.id]}`).join("\n"),`# Chorus workspace settings
2
+ # Edit here, or via the Form tab, or via mm.update_settings from any MCP client.
3
+
4
+ concurrency:
5
+ max_concurrent_chats: ${e.maxConcurrent}
6
+
7
+ permissions:
8
+ driver:
9
+ ${s}
10
+ reviewer:
11
+ ${a}
12
+
13
+ allowed_directories:
14
+ ${t}
15
+
16
+ defaults:
17
+ driver: ${e.defaultDriver}
18
+ agreement_threshold: ${e.defaultThreshold}
19
+ cost_cap_usd: ${e.defaultCostCap}
20
+ on_error: fallback
21
+
22
+ notifications:
23
+ mcp_enabled: ${e.mcpEnabled}
24
+ webhook_url: ${e.webhookUrl?`"${e.webhookUrl}"`:'""'}
25
+ `},[r,c,m,h,j,k,A,D,S]);return(0,s.jsx)(l.G,{children:(0,s.jsxs)("div",{className:"mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 sm:py-8 md:px-8 md:py-10",children:[(0,s.jsx)(i.z,{eyebrow:"Settings",title:"Workspace",subtitle:"Defaults applied to every chat. Templates can override these per-run. The MCP server can read & patch this config — your main Claude can configure Chorus for you.",action:(0,s.jsxs)("div",{className:"flex rounded-md border border-border bg-card p-0.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>t("form"),className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition ${"form"===e?"bg-primary/15 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(o,{className:"h-3.5 w-3.5"}),"Form"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>t("yaml"),className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition ${"yaml"===e?"bg-primary/15 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}),"YAML"]})]})}),"yaml"===e?(0,s.jsx)(X,{yaml:L}):(0,s.jsx)(Q,{maxConcurrent:r,setMaxConcurrent:n,driverPolicies:c,reviewerPolicies:m,cyclePolicy:function(e,t){"driver"===e?u(e=>({...e,[t]:w(e[t])})):x(e=>({...e,[t]:w(e[t])}))},allowedDirs:h,setAllowedDirs:p,newDir:f,setNewDir:b,addDir:function(){let e=f.trim();!e||h.includes(e)||(p(t=>[...t,e]),b(""))},defaultDriver:j,setDefaultDriver:N,defaultCostCap:k,setDefaultCostCap:C,defaultThreshold:A,setDefaultThreshold:M,webhookUrl:S,setWebhookUrl:T,mcpEnabled:D,setMcpEnabled:E,privacyTier:$,setPrivacyTier:P,webhookTestState:_,testWebhook:function(){"running"!==_&&(O("running"),setTimeout(()=>{O(S.startsWith("https://")?"ok":"fail"),setTimeout(()=>O("idle"),2200)},1100))}})]})})}},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});var s=r(142);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,o=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:d}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],s=null==d?void 0:d[e];if(null===t)return null;let n=a(t)||a(s);return o[e][n]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return n(e,l,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...d,...i}[t]):({...d,...i})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},9208:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}},e=>{e.O(0,[742,832,641,344,506,128,358],()=>e(e.s=6624)),_N_E=e.O()}]);