chorus-codes 0.8.24 → 0.8.26

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.js.nft.json +1 -1
  25. package/.next/server/app/connect/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/demo/[scenario]/page.js +1 -1
  27. package/.next/server/app/demo/[scenario]/page.js.nft.json +1 -1
  28. package/.next/server/app/demo/[scenario]/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/new/page.js +1 -1
  30. package/.next/server/app/new/page.js.nft.json +1 -1
  31. package/.next/server/app/new/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/new.html +1 -1
  33. package/.next/server/app/new.rsc +3 -3
  34. package/.next/server/app/new.segments/_full.segment.rsc +3 -3
  35. package/.next/server/app/new.segments/_head.segment.rsc +1 -1
  36. package/.next/server/app/new.segments/_index.segment.rsc +2 -2
  37. package/.next/server/app/new.segments/_tree.segment.rsc +2 -2
  38. package/.next/server/app/new.segments/new/__PAGE__.segment.rsc +2 -2
  39. package/.next/server/app/new.segments/new.segment.rsc +1 -1
  40. package/.next/server/app/onboarding/page.js +1 -1
  41. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  42. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/onboarding.html +1 -1
  44. package/.next/server/app/onboarding.rsc +3 -3
  45. package/.next/server/app/onboarding.segments/_full.segment.rsc +3 -3
  46. package/.next/server/app/onboarding.segments/_head.segment.rsc +1 -1
  47. package/.next/server/app/onboarding.segments/_index.segment.rsc +2 -2
  48. package/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  49. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +2 -2
  50. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +1 -1
  51. package/.next/server/app/page.js +2 -2
  52. package/.next/server/app/page.js.nft.json +1 -1
  53. package/.next/server/app/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/personas/page.js +1 -1
  55. package/.next/server/app/personas/page.js.nft.json +1 -1
  56. package/.next/server/app/personas/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/personas.html +1 -1
  58. package/.next/server/app/personas.rsc +3 -3
  59. package/.next/server/app/personas.segments/_full.segment.rsc +3 -3
  60. package/.next/server/app/personas.segments/_head.segment.rsc +1 -1
  61. package/.next/server/app/personas.segments/_index.segment.rsc +2 -2
  62. package/.next/server/app/personas.segments/_tree.segment.rsc +2 -2
  63. package/.next/server/app/personas.segments/personas/__PAGE__.segment.rsc +2 -2
  64. package/.next/server/app/personas.segments/personas.segment.rsc +1 -1
  65. package/.next/server/app/runs/[runId]/page.js +2 -2
  66. package/.next/server/app/runs/[runId]/page.js.nft.json +1 -1
  67. package/.next/server/app/runs/[runId]/page_client-reference-manifest.js +1 -1
  68. package/.next/server/app/runs/page.js +2 -2
  69. package/.next/server/app/runs/page.js.nft.json +1 -1
  70. package/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/settings/page.js +3 -3
  72. package/.next/server/app/settings/page.js.nft.json +1 -1
  73. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  74. package/.next/server/app/settings/permissions/page.js +1 -1
  75. package/.next/server/app/settings/permissions/page.js.nft.json +1 -1
  76. package/.next/server/app/settings/permissions/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/settings.html +1 -1
  78. package/.next/server/app/settings.rsc +3 -3
  79. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  80. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  81. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  82. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  83. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  84. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  85. package/.next/server/app/templates/page.js +2 -2
  86. package/.next/server/app/templates/page.js.nft.json +1 -1
  87. package/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app/templates.html +1 -1
  89. package/.next/server/app/templates.rsc +3 -3
  90. package/.next/server/app/templates.segments/_full.segment.rsc +3 -3
  91. package/.next/server/app/templates.segments/_head.segment.rsc +1 -1
  92. package/.next/server/app/templates.segments/_index.segment.rsc +2 -2
  93. package/.next/server/app/templates.segments/_tree.segment.rsc +2 -2
  94. package/.next/server/app/templates.segments/templates/__PAGE__.segment.rsc +2 -2
  95. package/.next/server/app/templates.segments/templates.segment.rsc +1 -1
  96. package/.next/server/app-paths-manifest.json +1 -1
  97. package/.next/server/chunks/189.js +1 -0
  98. package/.next/server/chunks/{144.js → 21.js} +1 -1
  99. package/.next/server/chunks/{668.js → 313.js} +1 -1
  100. package/.next/server/chunks/681.js +1 -1
  101. package/.next/server/middleware-build-manifest.js +1 -1
  102. package/.next/server/pages/404.html +1 -1
  103. package/.next/server/pages/500.html +1 -1
  104. package/.next/server/server-reference-manifest.json +1 -1
  105. package/.next/static/chunks/249-2e840495c38ee022.js +25 -0
  106. package/.next/static/chunks/641-2908cb9553b8753a.js +1 -0
  107. package/.next/static/chunks/690-092c26db4082d49a.js +1 -0
  108. package/.next/static/chunks/app/connect/{page-a3a0af374f90ad4c.js → page-ad4409761e870bd0.js} +1 -1
  109. package/.next/static/chunks/app/demo/[scenario]/{page-6a0e4aec4bb96fee.js → page-39673968f543c473.js} +1 -1
  110. package/.next/static/chunks/app/new/{page-b96d75506030acf8.js → page-b5f609ab9413ac00.js} +1 -1
  111. package/.next/static/chunks/app/onboarding/{page-4be5a1d944e32672.js → page-8b0850fef487abdc.js} +1 -1
  112. package/.next/static/chunks/app/{page-35375a7c8b3d117a.js → page-9bdbaad592d0ce56.js} +1 -1
  113. package/.next/static/chunks/app/personas/{page-3884f8907107a4e6.js → page-440c6033a773100c.js} +1 -1
  114. package/.next/static/chunks/app/runs/[runId]/{page-b5bcf0c093389207.js → page-ffc36f12f1b63ebe.js} +1 -1
  115. package/.next/static/chunks/app/runs/{page-376175c1ac803558.js → page-6962ea572c9e4b74.js} +1 -1
  116. package/.next/static/chunks/app/settings/page-ad7180ee0d142704.js +25 -0
  117. package/.next/static/chunks/app/settings/permissions/{page-c90795aa9299bbe8.js → page-cd767401ac71a29c.js} +1 -1
  118. package/.next/static/chunks/app/templates/page-0112ab3c7ab5185d.js +1 -0
  119. package/.next/static/css/df4972a256406ec7.css +3 -0
  120. package/.next/trace +20 -20
  121. package/.next/trace-build +1 -1
  122. package/dist/daemon/cli-semaphore.js +266 -0
  123. package/dist/daemon/cli-semaphore.js.map +1 -0
  124. package/dist/daemon/routes/settings.js +39 -0
  125. package/dist/daemon/routes/settings.js.map +1 -1
  126. package/dist/daemon/runner/doer-driver.js +243 -214
  127. package/dist/daemon/runner/doer-driver.js.map +1 -1
  128. package/dist/daemon/runner/doer.js +24 -1
  129. package/dist/daemon/runner/doer.js.map +1 -1
  130. package/dist/daemon/runner/reviewer-driver.js +299 -255
  131. package/dist/daemon/runner/reviewer-driver.js.map +1 -1
  132. package/dist/daemon/runner/reviewer.js +27 -1
  133. package/dist/daemon/runner/reviewer.js.map +1 -1
  134. package/dist/daemon/runner.js +19 -0
  135. package/dist/daemon/runner.js.map +1 -1
  136. package/dist/lib/db/chats.js +28 -0
  137. package/dist/lib/db/chats.js.map +1 -1
  138. package/dist/lib/db/connection.js +6 -0
  139. package/dist/lib/db/connection.js.map +1 -1
  140. package/dist/lib/db/schema.sql +6 -0
  141. package/dist/lib/model-pricing.js +306 -0
  142. package/dist/lib/model-pricing.js.map +1 -0
  143. package/dist/lib/settings/concurrency.js +101 -0
  144. package/dist/lib/settings/concurrency.js.map +1 -0
  145. package/package.json +1 -1
  146. package/.next/server/chunks/946.js +0 -1
  147. package/.next/static/chunks/116-8bf7e014066cedde.js +0 -25
  148. package/.next/static/chunks/15-d438a2b057302bed.js +0 -1
  149. package/.next/static/chunks/641-60721f44faf711b9.js +0 -1
  150. package/.next/static/chunks/app/settings/page-1792a3e289409b2d.js +0 -25
  151. package/.next/static/chunks/app/templates/page-1449b0aea2e7cb68.js +0 -1
  152. package/.next/static/css/d2bb161eb5bee944.css +0 -3
  153. /package/.next/static/{jdUcCHB2b5lVrf4v8iQjl → eOeXty5cBGWg7xnmtF6ST}/_buildManifest.js +0 -0
  154. /package/.next/static/{jdUcCHB2b5lVrf4v8iQjl → eOeXty5cBGWg7xnmtF6ST}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[690],{52:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(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"}]])},1304:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},2116:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},2379:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},2471:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(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"}]])},2865:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]])},2956:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3149:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4030:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(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"}]])},4052:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},4579:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("git-pull-request",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]])},4608:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]])},5445:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},5483:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},6458:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])},6758:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},7618:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]])},7978:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(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"}]])},8420:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},8979:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},9056:(e,a,t)=>{t.d(a,{F:()=>y});var l=t(142);let d=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,h=l.$,y=(e,a)=>t=>{var l;if((null==a?void 0:a.variants)==null)return h(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:y,defaultVariants:r}=a,k=Object.keys(y).map(e=>{let a=null==t?void 0:t[e],l=null==r?void 0:r[e];if(null===a)return null;let h=d(a)||d(l);return y[e][h]}),c=t&&Object.entries(t).reduce((e,a)=>{let[t,l]=a;return void 0===l||(e[t]=l),e},{});return h(e,k,null==a||null==(l=a.compoundVariants)?void 0:l.reduce((e,a)=>{let{class:t,className:l,...d}=a;return Object.entries(d).every(e=>{let[a,t]=e;return Array.isArray(t)?t.includes({...r,...c}[a]):({...r,...c})[a]===t})?[...e,t,l]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},9208:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(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"}]])},9410:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("test-tube-diagonal",[["path",{d:"M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01a2.83 2.83 0 0 1 0-4L17 3",key:"1ub6xw"}],["path",{d:"m16 2 6 6",key:"1gw87d"}],["path",{d:"M12 16H4",key:"1cjfip"}]])},9707:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9812:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(3884).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[951],{1727:(e,t,r)=>{"use strict";r.d(t,{OrchestratorCard:()=>g});var n=r(9442),a=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,a.useState)(e),[y,j]=(0,a.useState)(!1),[N,v]=(0,a.useState)(null),[k,w]=(0,a.useState)(!1),A=p[e.name],[C,S]=(0,a.useState)(t),[M,_]=(0,a.useState)(null),[P,O]=(0,a.useState)(null),$=!!A&&C.length>0,E=C.filter(e=>e.enabled).length,R="opencode-cli"===A,T=h.connected,z=h.approvedTools>0&&!T,L=(r=e.name)in m.r2?m.r2[r]:x,V=async()=>{j(!0),v(null);try{let e=await (0,l.jb)(h.name);f(e.status),w(e.added.length>0)}catch(e){v(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(R)for(let e of C){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",n=I.get(r)??[];n.push(e),I.set(r,n)}let q=Array.from(I.keys()).sort();return(0,n.jsxs)("div",{className:(0,u.cn)("flex h-72 flex-col rounded-lg border border-border",L.gradient),children:[(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",L.dot)}),(0,n.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:h.label}),T?(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)(d.A,{className:"h-3 w-3"})," Connected"]}):z?(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:[h.approvedTools,"/",h.totalTools," tools"]}):h.supported?(0,n.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,n.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"}),$&&(0,n.jsxs)("span",{className:"whitespace-nowrap text-[10px] text-muted-foreground",children:["\xb7 ",E," model",1===E?"":"s"]})]})}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col gap-3 overflow-y-auto border-t border-border bg-card/30 p-4",children:[(0,n.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:h.note}),!h.supported&&(0,n.jsx)("p",{className:"text-[11px] italic text-muted-foreground/70",children:"Wiring will land in a future release."}),h.supported&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:V,disabled:y||T&&!z,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,n.jsx)(s.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(i.A,{className:"h-3.5 w-3.5"}),T?"Already connected":z?"Approve remaining tools":`Connect ${h.label}`]}),k&&!N&&(0,n.jsxs)("p",{className:"text-[11px] text-emerald-400",children:["✓ Done. Restart ",h.label," for the change to take effect."]}),N&&(0,n.jsxs)("p",{className:"flex items-start gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"mt-0.5 h-3 w-3 shrink-0"})," ",N]})]}),T&&"prompts_once"===h.firstCallBehavior&&(0,n.jsx)("p",{className:"text-[11px] text-amber-300/90",children:'⚠ First chorus.* call will show a one-time prompt — click "Always allow".'}),$&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),P&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:P}),R?(0,n.jsx)("div",{className:"space-y-2",children:q.map(e=>{let t=I.get(e)??[];return(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("p",{className:"text-[10px] 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=>(0,n.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,n.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:C.map(e=>(0,n.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:a,onClick:s}){return(0,n.jsxs)("button",{type:"button",disabled:a,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,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:e})]})}},2545:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(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:()=>a,Y8:()=>d});var n=r(4411);async function a(e){return(0,n.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function d(){return(0,n.T)("/openrouter/models")}async function s(e,t){return(0,n.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:()=>n});let n=(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:()=>n});let n={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi"},a={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400"};function d(e){return e?n[e]??e:""}function s(e){return e?a[e]??"bg-muted":"bg-muted"}let i={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter"},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"};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:""};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"}}},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"}]])},7130:(e,t,r)=>{"use strict";r.d(t,{OpenRouterCard:()=>x});var n=r(9442),a=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,a.useState)(e),[b,h]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),[v,k]=(0,a.useState)(""),[w,A]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[M,_]=(0,a.useState)(!1),[P,O]=(0,a.useState)(""),[$,E]=(0,a.useState)(new Set),[R,T]=(0,a.useState)(!1),[z,L]=(0,a.useState)(null),[V,F]=(0,a.useState)(null),[I,q]=(0,a.useState)(null),[J,Y]=(0,a.useState)(null),G=t.filter(e=>e.enabled).length,K=t.length>0;async function W(){if(!f){y(!0),S(null),N(!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!==v.trim().length){A(!0),S(null);try{let e=await (0,m.M5)(v.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),N(!0)}catch(e){S(e instanceof Error?e.message:String(e))}finally{A(!1)}}}async function D(){if(0!==$.size){T(!0),L(null),F(null);try{let e=await (0,m.Eu)(Array.from($)),t=e.added.length,n=e.skipped.length;F(`Added ${t} voice${1===t?"":"s"}`+(n>0?` \xb7 skipped ${n} (unknown id)`:"")),E(new Set);try{let e=await (0,u.listVoices)({source:"api",provider:"openrouter"});r(e)}catch{}}catch(e){L(e instanceof Error?e.message:String(e))}finally{T(!1)}}}async function H(e){q(e.id),Y(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){Y(e instanceof Error?e.message:String(e))}finally{q(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,n.jsxs)("div",{className:(0,c.cn)("flex h-72 flex-col rounded-lg border border-border",p.r2.openrouter.gradient),children:[(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)("span",{className:(0,c.cn)("h-2 w-2 shrink-0 rounded-full",p.r2.openrouter.dot)}),(0,n.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:"OpenRouter"}),K?(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)(d.A,{className:"h-3 w-3"})," ",G," enabled"]}):(0,n.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,n.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,n.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,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(e=>(0,n.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,n.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,n.jsx)(d.A,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),J&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:J})]}),(M||!K)&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-background/40 p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Replace API key":"OpenRouter API key"}),(0,n.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,n.jsx)(s.A,{className:"h-2.5 w-2.5"})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"password",value:v,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,n.jsxs)("button",{type:"button",onClick:B,disabled:w||0===v.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,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(d.A,{className:"h-3 w-3"}),w?"Saving…":"Save"]})]}),C&&(0,n.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),C]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K&&!j&&(0,n.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,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add more models"]}),K&&!M&&(0,n.jsx)("button",{type:"button",onClick:()=>_(!0),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"Replace API key"})]}),j&&(0,n.jsxs)(n.Fragment,{children:[f&&(0,n.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Loading catalog…"]}),b&&b.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Add more models":"Pick models"}),(0,n.jsxs)("button",{type:"button",onClick:D,disabled:0===$.size||R,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:[R?(0,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add ",$.size>0?$.size:""]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background/40 px-2",children:[(0,n.jsx)(l.A,{className:"h-3 w-3 text-muted-foreground"}),(0,n.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,n.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[Q.length,"/",b.length]})]}),V&&(0,n.jsx)("p",{className:"text-[11px] text-emerald-300",children:V}),z&&(0,n.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),z]}),(0,n.jsx)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-border",children:Q.map(e=>{let r=$.has(e.id),a=t.some(t=>t.model_id===e.id);return(0,n.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",a&&"opacity-50"),children:[(0,n.jsx)("input",{type:"checkbox",checked:r,disabled:a,onChange:t=>{E(r=>{let n=new Set(r);return t.target.checked?n.add(e.id):n.delete(e.id),n})},className:"h-3 w-3 shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"truncate font-mono text-[11px]",children:[e.id,a&&(0,n.jsx)("span",{className:"ml-1 text-[10px] text-muted-foreground",children:"\xb7 added"})]}),(0,n.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:()=>n});let n=(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:()=>n});let n=(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,[116,832,641,344,506,128,358],()=>e(e.s=8799)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[951],{1727:(e,t,r)=>{"use strict";r.d(t,{OrchestratorCard:()=>g});var n=r(9442),a=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,a.useState)(e),[y,j]=(0,a.useState)(!1),[N,v]=(0,a.useState)(null),[k,w]=(0,a.useState)(!1),A=p[e.name],[C,S]=(0,a.useState)(t),[M,_]=(0,a.useState)(null),[P,O]=(0,a.useState)(null),$=!!A&&C.length>0,E=C.filter(e=>e.enabled).length,R="opencode-cli"===A,T=h.connected,z=h.approvedTools>0&&!T,L=(r=e.name)in m.r2?m.r2[r]:x,V=async()=>{j(!0),v(null);try{let e=await (0,l.jb)(h.name);f(e.status),w(e.added.length>0)}catch(e){v(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(R)for(let e of C){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",n=I.get(r)??[];n.push(e),I.set(r,n)}let q=Array.from(I.keys()).sort();return(0,n.jsxs)("div",{className:(0,u.cn)("flex h-72 flex-col rounded-lg border border-border",L.gradient),children:[(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",L.dot)}),(0,n.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:h.label}),T?(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)(d.A,{className:"h-3 w-3"})," Connected"]}):z?(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:[h.approvedTools,"/",h.totalTools," tools"]}):h.supported?(0,n.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,n.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"}),$&&(0,n.jsxs)("span",{className:"whitespace-nowrap text-[10px] text-muted-foreground",children:["\xb7 ",E," model",1===E?"":"s"]})]})}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col gap-3 overflow-y-auto border-t border-border bg-card/30 p-4",children:[(0,n.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:h.note}),!h.supported&&(0,n.jsx)("p",{className:"text-[11px] italic text-muted-foreground/70",children:"Wiring will land in a future release."}),h.supported&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:V,disabled:y||T&&!z,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,n.jsx)(s.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(i.A,{className:"h-3.5 w-3.5"}),T?"Already connected":z?"Approve remaining tools":`Connect ${h.label}`]}),k&&!N&&(0,n.jsxs)("p",{className:"text-[11px] text-emerald-400",children:["✓ Done. Restart ",h.label," for the change to take effect."]}),N&&(0,n.jsxs)("p",{className:"flex items-start gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"mt-0.5 h-3 w-3 shrink-0"})," ",N]})]}),T&&"prompts_once"===h.firstCallBehavior&&(0,n.jsx)("p",{className:"text-[11px] text-amber-300/90",children:'⚠ First chorus.* call will show a one-time prompt — click "Always allow".'}),$&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),P&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:P}),R?(0,n.jsx)("div",{className:"space-y-2",children:q.map(e=>{let t=I.get(e)??[];return(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("p",{className:"text-[10px] 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=>(0,n.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,n.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:C.map(e=>(0,n.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:a,onClick:s}){return(0,n.jsxs)("button",{type:"button",disabled:a,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,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:e})]})}},2545:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(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:()=>a,Y8:()=>d});var n=r(4411);async function a(e){return(0,n.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function d(){return(0,n.T)("/openrouter/models")}async function s(e,t){return(0,n.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:()=>n});let n=(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:()=>n});let n={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi"},a={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400"};function d(e){return e?n[e]??e:""}function s(e){return e?a[e]??"bg-muted":"bg-muted"}let i={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter"},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"};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:""};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"}}},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"}]])},7130:(e,t,r)=>{"use strict";r.d(t,{OpenRouterCard:()=>x});var n=r(9442),a=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,a.useState)(e),[b,h]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),[v,k]=(0,a.useState)(""),[w,A]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[M,_]=(0,a.useState)(!1),[P,O]=(0,a.useState)(""),[$,E]=(0,a.useState)(new Set),[R,T]=(0,a.useState)(!1),[z,L]=(0,a.useState)(null),[V,F]=(0,a.useState)(null),[I,q]=(0,a.useState)(null),[J,Y]=(0,a.useState)(null),G=t.filter(e=>e.enabled).length,K=t.length>0;async function W(){if(!f){y(!0),S(null),N(!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!==v.trim().length){A(!0),S(null);try{let e=await (0,m.M5)(v.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),N(!0)}catch(e){S(e instanceof Error?e.message:String(e))}finally{A(!1)}}}async function D(){if(0!==$.size){T(!0),L(null),F(null);try{let e=await (0,m.Eu)(Array.from($)),t=e.added.length,n=e.skipped.length;F(`Added ${t} voice${1===t?"":"s"}`+(n>0?` \xb7 skipped ${n} (unknown id)`:"")),E(new Set);try{let e=await (0,u.listVoices)({source:"api",provider:"openrouter"});r(e)}catch{}}catch(e){L(e instanceof Error?e.message:String(e))}finally{T(!1)}}}async function H(e){q(e.id),Y(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){Y(e instanceof Error?e.message:String(e))}finally{q(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,n.jsxs)("div",{className:(0,c.cn)("flex h-72 flex-col rounded-lg border border-border",p.r2.openrouter.gradient),children:[(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-3 px-4 py-3",children:(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)("span",{className:(0,c.cn)("h-2 w-2 shrink-0 rounded-full",p.r2.openrouter.dot)}),(0,n.jsx)("h3",{className:"whitespace-nowrap text-sm font-semibold",children:"OpenRouter"}),K?(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)(d.A,{className:"h-3 w-3"})," ",G," enabled"]}):(0,n.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,n.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,n.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,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Models"}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(e=>(0,n.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,n.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,n.jsx)(d.A,{className:"h-2 w-2"})}),(0,n.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),J&&(0,n.jsx)("p",{className:"text-[11px] text-destructive",children:J})]}),(M||!K)&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-background/40 p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Replace API key":"OpenRouter API key"}),(0,n.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,n.jsx)(s.A,{className:"h-2.5 w-2.5"})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"password",value:v,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,n.jsxs)("button",{type:"button",onClick:B,disabled:w||0===v.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,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(d.A,{className:"h-3 w-3"}),w?"Saving…":"Save"]})]}),C&&(0,n.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),C]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K&&!j&&(0,n.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,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add more models"]}),K&&!M&&(0,n.jsx)("button",{type:"button",onClick:()=>_(!0),className:"text-[11px] text-muted-foreground underline-offset-2 hover:underline",children:"Replace API key"})]}),j&&(0,n.jsxs)(n.Fragment,{children:[f&&(0,n.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"})," Loading catalog…"]}),b&&b.length>0&&(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:K?"Add more models":"Pick models"}),(0,n.jsxs)("button",{type:"button",onClick:D,disabled:0===$.size||R,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:[R?(0,n.jsx)(i.A,{className:"h-3 w-3 animate-spin"}):null,"Add ",$.size>0?$.size:""]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background/40 px-2",children:[(0,n.jsx)(l.A,{className:"h-3 w-3 text-muted-foreground"}),(0,n.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,n.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[Q.length,"/",b.length]})]}),V&&(0,n.jsx)("p",{className:"text-[11px] text-emerald-300",children:V}),z&&(0,n.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-destructive",children:[(0,n.jsx)(o.A,{className:"h-3 w-3"}),z]}),(0,n.jsx)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-border",children:Q.map(e=>{let r=$.has(e.id),a=t.some(t=>t.model_id===e.id);return(0,n.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",a&&"opacity-50"),children:[(0,n.jsx)("input",{type:"checkbox",checked:r,disabled:a,onChange:t=>{E(r=>{let n=new Set(r);return t.target.checked?n.add(e.id):n.delete(e.id),n})},className:"h-3 w-3 shrink-0"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"truncate font-mono text-[11px]",children:[e.id,a&&(0,n.jsx)("span",{className:"ml-1 text-[10px] text-muted-foreground",children:"\xb7 added"})]}),(0,n.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:()=>n});let n=(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:()=>n});let n=(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,[249,832,641,344,506,128,358],()=>e(e.s=8799)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{4372:(e,n,t)=>{"use strict";t.d(n,{G:()=>a});var i=t(9442),o=t(821),r=t(8344);function a({children:e}){return(0,i.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[(0,i.jsx)(o.AppSidebar,{}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,i.jsx)(r.MobileTopBar,{}),(0,i.jsx)("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}},5249:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>R});var i=t(9442),o=t(6074),r=t(5902),a=t(4372),s=t(1245);function d(e,n){let t=[],i=!1,o={onmessage:null,onerror:null,onopen:null,readyState:0,url:"mock://demo",withCredentials:!1,addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0,close:()=>{for(let e of(i=!0,t))clearTimeout(e)}};for(let r of[...e].sort((e,n)=>e.atMs-n.atMs)){let e=setTimeout(()=>{if(i)return;if(n){let e=r.payload;n("string"==typeof e.type?e.type:"",e.payload??{})}let e=o.onmessage;e&&e({data:JSON.stringify(r.payload)})},r.atMs);t.push(e)}return o}let c="review",l="**Verdict: approve**\n\n",p=[{agentName:"codex-cli-0",lineage:"codex",model:"gpt-5.5",binaryUsed:"codex",doneAtMs:3200,durationMs:3e3,usage:{inputTokens:6480,outputTokens:380,costUsd:.0094},answer:"## Codex review: `divide(a, b)`\n\n"+l+'Math is correct, types flow naturally, function is small and obvious. Approving with two notes.\n\n**The current helper:**\n```ts\nexport function divide(a: number, b: number) {\n return a / b;\n}\n```\n\n**Two minors before merge:**\n1. **Add a divide-by-zero guard.** `divide(x, 0)` silently returns `Infinity` — a footgun in any pipeline that math-chains:\n ```ts\n if (b === 0) throw new RangeError("divide: zero divisor");\n ```\n2. **Add a JSDoc block.** Three lines. Saves the next reader from reading the body to learn the type contract.'},{agentName:"gemini-cli-1",lineage:"gemini",model:"gemini-3.1-pro-preview",binaryUsed:"gemini-cli",doneAtMs:4400,durationMs:4200,usage:{inputTokens:6720,outputTokens:720,costUsd:.0258},answer:"## Gemini review: `divide(a, b)`\n\n"+l+'No structural issues. The function does one thing and the implementation matches its name. Approving with a strong suggestion to harden the test surface.\n\n**Suggested spec coverage:**\n```ts\ndescribe("divide", () => {\n it("returns a / b for finite inputs", () => {\n expect(divide(10, 2)).toBe(5);\n });\n it("rejects zero divisor", () => {\n expect(() => divide(10, 0)).toThrow();\n });\n it("rejects NaN", () => {\n expect(() => divide(NaN, 2)).toThrow();\n });\n it("rejects Infinity", () => {\n expect(() => divide(Infinity, 2)).toThrow();\n });\n});\n```\n\nFour cases close every hole I see by construction.'},{agentName:"claude-code-2",lineage:"claude",model:"claude-opus-4-7",binaryUsed:"claude-code",doneAtMs:5400,durationMs:5200,usage:{inputTokens:7100,outputTokens:1240,costUsd:.0517},answer:"## Claude review: `divide(a, b)`\n\n"+l+'Reads cleanly. The function does one thing and is trivially testable. Approving with two notes — neither blocking.\n\n**Note 1 — Zero-guard.**\n`divide(x, 0)` returns `Infinity` in JavaScript. That value flows silently through arithmetic and ends up in logs/dashboards as a real number. A typed error would prevent the silent corruption:\n```ts\nclass DivideError extends Error {}\nif (b === 0) throw new DivideError("zero divisor");\n```\n\n**Note 2 — Currency callers.**\nIf this lives on a billing/ledger hot path, prefer integer-cents or `decimal.js` over floats. IEEE 754 will accumulate cent-level drift in a high-volume ledger:\n```ts\n// safer for currency:\nexport function divideMoney(cents: number, n: number): number {\n return Math.round(cents / n);\n}\n```'},{agentName:"opencode-cli-3",lineage:"opencode",model:"opencode-go/kimi-k2.6",binaryUsed:"opencode",doneAtMs:2700,durationMs:2500,usage:{inputTokens:6240,outputTokens:280,costUsd:.0042},answer:"## Kimi review (via opencode)\n\n"+l+'Pragmatic helper. The math is correct; the holes are at the boundary, not the body. Approving — both fixes below are 60-second jobs that can land in a follow-up if you want to ship now.\n\n**Suggested patch:**\n```ts\n/**\n * Divide two finite numbers. Throws on zero divisor or non-finite input.\n */\nexport function divide(a: number, b: number): number {\n if (b === 0) throw new Error("divide: zero divisor");\n return a / b;\n}\n```\n\nAnd one test:\n```ts\nexpect(() => divide(1, 0)).toThrow("zero divisor");\n```'},{agentName:"opencode-cli-4",lineage:"opencode",model:"opencode-go/deepseek-v4-pro",binaryUsed:"opencode",doneAtMs:6200,durationMs:6e3,usage:{inputTokens:7340,outputTokens:1460,costUsd:.0228},answer:'## DeepSeek review (via opencode)\n\n**Verdict: request changes**\n\nThree blockers in a financial context. This helper would land me in a post-mortem inside three months on a busy ledger.\n\n**Blocker 1 — No divide-by-zero guard.**\n```ts\ndivide(100, 0); // → Infinity, silent corruption downstream\n```\nRequired:\n```ts\nif (b === 0) throw new DivideError("zero");\n```\n\n**Blocker 2 — No input validation.**\n```ts\ndivide("5" as any, 2); // → 2.5 (silent string coercion)\ndivide(NaN, 2); // → NaN (poisons later math)\ndivide(undefined as any, 2); // → NaN\n```\nRequired: `Number.isFinite(a) && Number.isFinite(b)` at the top.\n\n**Blocker 3 — Floats for money.**\nIEEE 754 + currency = audit-trail nightmare. Use integer-cents or `decimal.js`. Reproducer:\n```ts\n0.1 + 0.2 === 0.3; // false\ndivide(0.3, 0.1); // 2.9999999999999996\n```'},{agentName:"opencode-cli-5",lineage:"opencode",model:"opencode-go/qwen3.6-plus",binaryUsed:"opencode",doneAtMs:3700,durationMs:3500,usage:{inputTokens:6420,outputTokens:320,costUsd:.0061},answer:"## Qwen review (via opencode)\n\n"+l+"Reads cleanly. No defects in the body.\n\n**Minor — Missing documentation.**\nThree lines of JSDoc would let editor tooling surface the contract:\n```ts\n/**\n * @param a - dividend (finite number)\n * @param b - divisor (finite, non-zero)\n * @returns the quotient a / b\n */\n```\n\nHelpful for downstream callers, not blocking the merge."}];function u(e){return{participant:`reviewer-${e.agentName}`,role:"reviewer",agentName:e.agentName,lineage:e.lineage,hasAnswer:!1,model:e.model,pending:!1}}let h=[{round:1,participants:p.map(u)}],m={id:"demo-simple-6way",name:"External Review \xb7 Six Voices",description:"Six reviewers critique the artifact independently.",category:"review",agreementThreshold:"majority",onThresholdMet:"ask-user",maxRounds:1,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:!1,onError:"fail",notify:"dashboard-only",yaml:"",authorHandle:"demo",forks:0,popularity:0,phases:[{id:c,name:"External Review",description:"Six lineages critique the supplied artifact independently.",kind:"review_only",gate:"auto",doer:{lineage:"claude",models:[]},reviewer:{require:2,crossLineage:!0,candidates:["codex","gemini","claude","opencode"],candidatesWithModels:p.map(e=>({lineage:e.lineage,models:[e.model]}))},artifact:{label:"Artifact",hint:"",maxBytes:1048576},inputs:{include:[],exclude:[]},iterate:{max:1,onMax:"fail"},blindSpots:[],execution:"parallel",builtin:!0}]},v=e=>({type:"phase_start",payload:{phaseIdx:0,phaseId:c,kind:"review_only",role:"reviewer",agent:e},ts:Date.now()}),g=(e,n,t)=>({type:"phase_progress",payload:{phaseId:c,round:1,role:"reviewer",agent:e,elapsedMs:t,output:n},ts:Date.now()}),f=e=>({type:"participant_done",payload:{phaseId:c,round:1,role:"reviewer",agent:e},ts:Date.now()}),w={"codex-cli-0":"## Reviewing src/util/divide.ts\n\nCurrent implementation:\n```ts\nexport function divide(a: number, b: number) {\n return a / b;\n}\n```\n\nChecking input handling first.\n\nSpotted: no zero-guard. `divide(x, 0)` silently returns `Infinity`. In a billing pipeline that math-chains downstream, that becomes a ledger row.\n\nNo JSDoc either — readers have to read the body to learn the type contract.\n\nVerdict drafting: two minors, leaning approve with notes.","gemini-cli-1":"## Review \xb7 `divide(a, b)`\n\nReading the helper. Checking the type contract first:\n```ts\n(a: number, b: number) => number\n```\n\nCoverage gaps surfacing: `NaN`, `Infinity`, zero divisor — none asserted.\n\nDrafting a four-case spec block to close the holes by construction:\n```ts\nexpect(divide(10, 2)).toBe(5);\nexpect(() => divide(10, 0)).toThrow();\nexpect(() => divide(NaN, 2)).toThrow();\nexpect(() => divide(Infinity, 2)).toThrow();\n```\n\nApproving with this spec block as a follow-up.","claude-code-2":"## Review: divide helper\n\nLoading + cross-referencing the two callers:\n```ts\n// /billing/invoice.ts:42 — currently produces silent Infinity\nconst unitPrice = divide(invoice.total, invoice.quantity);\n\n// /reports/avg.ts:18 — already wraps in try/catch\nconst average = divide(sum, count);\n```\n\n`/billing/invoice.ts:42` is the smoking gun — confirms the silent-Infinity bug class is real, not theoretical.\n\nRecommendation:\n1. Add a zero-guard returning a typed `DivideError`.\n2. Stage `divideMoney(cents, n)` for currency callers in a follow-up.\n\nApproving the helper rewrite with these two notes.","opencode-cli-3":'## Kimi review (via opencode)\n\nInspecting `divide(a, b)`. Quick pass — math is correct, the holes are at the boundary.\n\nSuggested patch:\n```ts\n/** Divide two finite numbers. Throws on zero divisor or non-finite input. */\nexport function divide(a: number, b: number): number {\n if (b === 0) throw new Error("divide: zero divisor");\n return a / b;\n}\n```\n\nApproving — both fixes are 60-second jobs.',"opencode-cli-4":'## DeepSeek review (via opencode)\n\nLoading `divide()` + the two callers + the existing spec.\n\nReproducing the failure modes locally:\n```ts\ndivide(100, 0); // Infinity (silent corruption)\ndivide("5", 2); // 2.5 (silent string coercion)\ndivide(0.3, 0.1); // 2.9999999999999996 (IEEE 754)\n```\n\nThree blockers, all reproducible in <30 lines:\n1. **No divide-by-zero guard** — required: `Number.isFinite` check + typed error.\n2. **No input validation** — TypeScript types are erased at runtime; `as any` slips through.\n3. **Floats for money** — IEEE 754 + currency = audit-trail nightmare. Need integer-cents.\n\nWill request changes.',"opencode-cli-5":"## Qwen review (via opencode)\n\nQuick read — public API surface only.\n\nNo defects in the body. The implementation matches its name.\n\nDocumentation gap noted — three lines of JSDoc would let editor tooling surface the contract:\n```ts\n/**\n * @param a - dividend (finite number)\n * @param b - divisor (finite, non-zero)\n * @returns the quotient a / b\n */\n```\n\nApproving — JSDoc is the only minor."},b=(()=>{let e=[];for(let[n,t]of p.entries())e.push({atMs:200+20*n,payload:v(t.agentName)});for(let n of p){let t=function(e){let n=Math.floor(.3*e.length),t=Math.floor(.65*e.length);return[e.slice(0,n),e.slice(0,t),e]}(w[n.agentName]),i=[.25,.55,.85].map(e=>Math.round(n.doneAtMs*e));for(let[o,r]of t.entries())e.push({atMs:i[o],payload:g(n.agentName,r,i[o])})}for(let n of p)e.push({atMs:n.doneAtMs,payload:f(n.agentName)});let n=Math.max(...p.map(e=>e.doneAtMs));return e.push({atMs:n+200,payload:{type:"phase_done",payload:{phaseId:c,phaseIdx:0,kind:"review_only"},ts:Date.now()}}),e.push({atMs:n+400,payload:{type:"chat_done",payload:{status:"completed",verdict:"request_changes"},ts:Date.now()}}),e})(),y={agentName:"claude-code-doer",lineage:"claude",model:"claude-opus-4-7",binaryUsed:"claude-code",doneAtMs:3700,durationMs:3500},k=[{agentName:"codex-cli-0",lineage:"codex",model:"gpt-5.5",binaryUsed:"codex",doneAtMs:2800,durationMs:2600},{agentName:"gemini-cli-1",lineage:"gemini",model:"gemini-3.1-pro-preview",binaryUsed:"gemini-cli",doneAtMs:3500,durationMs:3300},{agentName:"claude-code-2",lineage:"claude",model:"claude-sonnet-4-6",binaryUsed:"claude-code",doneAtMs:3100,durationMs:2900},{agentName:"opencode-cli-3",lineage:"opencode",model:"opencode-go/kimi-k2.6",binaryUsed:"opencode",doneAtMs:3900,durationMs:3700},{agentName:"opencode-cli-4",lineage:"opencode",model:"opencode-go/deepseek-v4-pro",binaryUsed:"opencode",doneAtMs:4500,durationMs:4300}],T=[y,...k],x=[{id:"plan",name:"Plan",kind:"plan",description:"Doer drafts the implementation approach; three reviewers critique.",streams:["## Plan: divide() helper rewrite\n\n**Goal:** production-safe wrapper over `a / b`.\n\n**Three deliverables:**\n1. Zero-guard returning a typed `DivideError`.\n2. Strict input validation (numbers only, finite, non-NaN).\n3. Switch currency callers to integer-cents (`divideMoney(cents, n)` follow-up PR).\n\n**Acceptance tests:**\n```ts\nexpect(divide(10, 2)).toBe(5);\nexpect(() => divide(10, 0)).toThrow(DivideError);\nexpect(() => divide(NaN, 2)).toThrow(DivideError);\nexpect(() => divide(Infinity, 2)).toThrow(DivideError);\n```\n\n**Risks:** API churn for two callers (`/billing/invoice.ts:42`, `/reports/avg.ts:18`). Mitigation: ship v2 alongside, deprecate v1 over one minor.\n\n**Rollback:** revert single commit; no schema/migration touched.","## Codex review \xb7 plan\n\nReading the plan…\n\nThree-piece breakdown looks right:\n- zero-guard ✓\n- input validation ✓\n- decimal precision ✓\n\nAcceptance tests match the spec contract.\n\n**Approve** — sound plan. One ask: add a `bigint` handling note. The current plan is implicitly Number-only, which is the right call, but worth saying so explicitly so the next reader does not assume `BigInt` support.","## Gemini review \xb7 plan\n\nCross-checking acceptance tests against the spec contract:\n```ts\ndivide(10, 2) // 5 ✓\ndivide(10, 0) // throw ✓\ndivide(NaN, 2) // throw ✓\ndivide(Inf, 2) // throw ✓\n```\n\nConcrete enough to drive TDD.\n\n**Approve** — explicit zero-guard is the right move. One follow-up: surface the deprecation timeline in the PR body so the two affected callers can plan their cutover.","## Claude (sonnet) review \xb7 plan\n\nReading the plan + skimming the existing call sites.\n\nThree-piece breakdown is right. The `divideMoney` carve-out is the right ergonomic — keep `divide` for general arithmetic, steer money paths to integer-cents.\n\n**Approve** — one ask: pin the deprecation timeline (one minor? one major?) so the two callers can plan.","## Kimi review (via opencode) \xb7 plan\n\nPlan looks tight. Three deliverables map cleanly to three commits if you want to split for review.\n\nAcceptance test set is the right shape — unit tests against the contract, not the implementation.\n\n**Approve** — pragmatic and shippable.","## DeepSeek review \xb7 plan\n\nPulling the existing `divide()` implementation for context:\n```ts\nexport function divide(a, b) { return a / b; }\n```\n\nCross-checking against the silent-Infinity bug class.\n\nNeed a non-finite-input row added to the acceptance tests:\n```ts\nexpect(() => divide(Number.POSITIVE_INFINITY, 2)).toThrow(DivideError);\nexpect(() => divide(2, Number.NEGATIVE_INFINITY)).toThrow(DivideError);\n```\n\nThe silent-Infinity bug is what triggered this rewrite, so the test set should explicitly cover both directions.\n\n**Approve with notes** — solid plan, just close that gap."],usage:[{inputTokens:6420,outputTokens:1840,costUsd:.0682},{inputTokens:5800,outputTokens:380,costUsd:.0094},{inputTokens:6020,outputTokens:540,costUsd:.0241},{inputTokens:6020,outputTokens:410,costUsd:.0086},{inputTokens:6240,outputTokens:320,costUsd:.0048},{inputTokens:6280,outputTokens:1140,costUsd:.0488}]},{id:"spec",name:"Spec",kind:"spec",description:"Doer derives the API contract; reviewers check alignment.",streams:['## Spec: `divide(a, b)`\n\n```ts\nexport class DivideError extends Error {\n constructor(public readonly reason: "zero" | "non-finite") {\n super(`divide: ${reason}`);\n this.name = "DivideError";\n }\n}\n\nexport function divide(a: number, b: number): number;\n```\n\n**Contract:**\n- `b === 0` → throws `DivideError("zero")`\n- `!Number.isFinite(a)` → throws `DivideError("non-finite")`\n- `!Number.isFinite(b)` → throws `DivideError("non-finite")`\n- otherwise → returns `a / b`\n\n**Order of checks:** non-finite first so `divide(NaN, 0)` reports the more specific failure.',"## Codex review \xb7 spec\n\nReading the type signature:\n```ts\n(a: number, b: number) => number\n```\n\nClean. Examples cover happy + zero + non-finite.\n\n**Approve** — suggest adding NaN explicitly to the example block:\n```ts\nexpect(() => divide(NaN, 5)).toThrow(/non-finite/);\n```\n\n`Number.isFinite(NaN)` returns false so it is covered, but enumerating it makes the intent explicit.",'## Gemini review \xb7 spec\n\nThe `reason` discriminant on the error class is the right ergonomic for callers that need to branch:\n```ts\ntry { return divide(a, b); }\ncatch (err) {\n if (err instanceof DivideError && err.reason === "zero") return 0;\n throw err;\n}\n```\n\nThat pattern beats string parsing on `err.message`.\n\n**Approve** — no structural concerns.','## Claude (sonnet) review \xb7 spec\n\n`DivideError` class is well-scoped. The `name = "DivideError"` assignment is the kind of detail that pays off in stack traces:\n```\nDivideError: divide: zero\n at /billing/invoice.ts:42\n```\n\n**Approve.**',"## Kimi review (via opencode) \xb7 spec\n\nType signature is unambiguous. The `reason` discriminant lets callers branch on failure type without string parsing.\n\nOrder-of-checks (non-finite first) is the right call.\n\n**Approve** — ready for implement.","## DeepSeek review \xb7 spec\n\nLoading spec + cross-checking against plan.\n\nExamples should include negatives and -Infinity:\n```ts\nexpect(divide(-10, 2)).toBe(-5);\nexpect(divide(10, -2)).toBe(-5);\nexpect(() => divide(Number.NEGATIVE_INFINITY, 2)).toThrow();\n```\n\nThe spec contract handles them correctly via `Number.isFinite`, but the example block sets the test surface and should be exhaustive.\n\n**Approve with notes.**"],usage:[{inputTokens:7240,outputTokens:1620,costUsd:.0731},{inputTokens:6500,outputTokens:320,costUsd:.0086},{inputTokens:6720,outputTokens:460,costUsd:.0218},{inputTokens:6720,outputTokens:380,costUsd:.0078},{inputTokens:6900,outputTokens:280,costUsd:.0042},{inputTokens:6980,outputTokens:980,costUsd:.0431}]},{id:"implement",name:"Implement",kind:"implement",description:"Doer writes the code blind to tests; reviewers find bugs.",streams:['## Implementation: `src/util/divide.ts`\n\n```ts\nexport class DivideError extends Error {\n constructor(public readonly reason: "zero" | "non-finite") {\n super(`divide: ${reason}`);\n this.name = "DivideError";\n }\n}\n\nexport function divide(a: number, b: number): number {\n if (!Number.isFinite(a) || !Number.isFinite(b)) {\n throw new DivideError("non-finite");\n }\n if (b === 0) {\n throw new DivideError("zero");\n }\n return a / b;\n}\n```\n\n**Notes:**\n- Non-finite check first so `divide(NaN, 0)` reports `"non-finite"`, not `"zero"`.\n- `name` set on `DivideError` so stack traces read `DivideError: divide: zero`.','## Codex review \xb7 diff\n\nPulling the diff. Reading each branch:\n\n✓ `Number.isFinite` — rejects NaN, \xb1Infinity, non-numbers via type system.\n✓ Zero-check after — order is correct.\n✓ `DivideError` extends `Error` with `name` set.\n\nOrder of checks decision is the correct call:\n```ts\ndivide(NaN, 0); // → "non-finite" (more specific failure first)\n```\n\n**Approve** — implementation is clean. Nothing to push back on.','## Gemini review \xb7 diff\n\nThe patch matches the spec line-for-line.\n\nThe `name` assignment on `DivideError`:\n```ts\nthis.name = "DivideError";\n```\n\nis the kind of detail that pays off the first time someone reads a stack trace — `DivideError: divide: zero` is actionable; `Error: divide: zero` looks like a generic throw and gets noise-suppressed.\n\n**Approve.**',"## Claude (sonnet) review \xb7 diff\n\nReads cleanly. Inline validation is fine for two args; would extract `isInvalid()` if this grew.\n\nThe `name` assignment on `DivideError` is the right detail — actionable stack traces over generic `Error: ...` lines.\n\n**Approve.**","## Kimi review (via opencode) \xb7 diff\n\nSmall, obvious, complete. 13 lines that do exactly what the spec said.\n\nReads in one breath:\n```ts\nif (!Number.isFinite(a) || !Number.isFinite(b)) throw …;\nif (b === 0) throw …;\nreturn a / b;\n```\n\n**Approve.**","## DeepSeek review \xb7 diff\n\nDiff loaded. Walking each branch.\n\nWant a `-0` test note before merge — JavaScript treats `-0 === 0` as `true`, so the existing zero-guard catches it, but the test pins the behaviour:\n```ts\nexpect(divide(10, -2)).toBe(-5);\nexpect(() => divide(10, -0)).toThrow(/zero/); // -0 === 0\n```\n\nThe `-0` case is the easy miss — without the test, an accidental refactor to `if (b !== 0)` would pass the existing suite.\n\n**Approve with notes.**"],usage:[{inputTokens:8120,outputTokens:1980,costUsd:.0892},{inputTokens:7300,outputTokens:280,costUsd:.0072},{inputTokens:7440,outputTokens:460,costUsd:.0214},{inputTokens:7440,outputTokens:320,costUsd:.0066},{inputTokens:7620,outputTokens:360,costUsd:.0054},{inputTokens:7720,outputTokens:1180,costUsd:.0508}]},{id:"verify",name:"Verify",kind:"verify",description:"Run the test suite; reviewers confirm coverage.",streams:['## Verify\n\n```\n$ pnpm test src/util/divide.test.ts\n\n ✓ divide > returns a / b for valid inputs\n ✓ divide > handles negative dividends\n ✓ divide > handles negative divisors\n ✓ divide > -0 is treated as 0 (throws "zero")\n ✓ divide > throws "zero" for b=0\n ✓ divide > throws "non-finite" for NaN\n ✓ divide > throws "non-finite" for \xb1Infinity\n ✓ divide > non-finite check precedes zero check\n ✓ DivideError > extends Error\n ✓ DivideError > exposes reason discriminant\n\n Tests: 12 passed (12)\n Coverage: 100% lines, 100% branches\n Lint: clean\n Types: clean\n Time: 1.42s\n```',"## Codex review \xb7 verify\n\nTest report loaded.\n\n✓ 12/12 pass, 0 fail, 0 skip\n✓ Coverage 100/100/100\n✓ Lint + types clean\n\nEvery spec case has a corresponding test. The `-0` row is what the implement-phase review asked for; merged correctly.\n\n**Approve** — nothing to add.","## Gemini review \xb7 verify\n\nReading the report:\n```\nTests: 12 passed (12)\nCoverage: 100% lines, 100% branches\n```\n\nNo flakes, no skips. The `Tests: 12 passed (12)` line is exactly what the merge gate looks for.\n\nCoverage 100/100/100 satisfies the production-utility bar.\n\n**Approve.**","## Claude (sonnet) review \xb7 verify\n\n12 tests for a 13-line function is honest coverage, not theatre. Each test asserts a real boundary condition.\n\nThe `non-finite check precedes zero check` assertion is doing real work — it pins the order-of-checks decision so a future refactor cannot silently swap them.\n\n**Approve.**","## Kimi review (via opencode) \xb7 verify\n\n✓ 12/12 pass\n✓ Coverage 100/100/100\n✓ No flakes, no skips\n\nShip it.\n\n**Approve.**","## DeepSeek review \xb7 verify\n\nPulling test report + spec for cross-check.\n\n12 tests for a 13-line function is honest coverage, not theatre. Each test asserts a real boundary:\n\n- happy path \xd7 4\n- zero divisor + -0\n- NaN + \xb1Infinity\n- order-of-checks invariant\n- DivideError shape + discriminant\n\nThe `non-finite check precedes zero check` assertion pins the order-of-checks decision so a future refactor cannot silently swap them.\n\n**Approve.**"],usage:[{inputTokens:8980,outputTokens:1340,costUsd:.0641},{inputTokens:8060,outputTokens:80,costUsd:.0021},{inputTokens:8230,outputTokens:360,costUsd:.0179},{inputTokens:8230,outputTokens:280,costUsd:.0058},{inputTokens:8410,outputTokens:220,costUsd:.0033},{inputTokens:8520,outputTokens:1060,costUsd:.0418}]},{id:"pr",name:"Ship",kind:"pr",description:"Doer drafts the PR; reviewers approve merge.",streams:["## PR draft\n\n**Title:** `feat(util): production-safe divide() with DivideError + 100% branch coverage`\n\n**Body:**\n```\nIntroduces a hardened `divide()` per the attached spec.\n\nWhat:\n- New DivideError class with typed reason discriminant\n- divide(a, b) rejects non-finite + zero divisor\n- 12 new tests; 100% line + branch coverage\n- Two existing callers updated\n\nWhy:\n- Silent Infinity from divide(x, 0) was a footgun in /billing\n- IEEE 754 currency math driving audit-trail drift; companion\n divideMoney(cents, n) lands in #4129\n\nRisk:\n- Two callers updated; no other call sites in repo\n- Rollback: revert this commit (no schema touched)\n- Backward-compat: divide() v1 stays exported for one minor\n\nCloses #4127\n```","## Codex review \xb7 PR\n\nTitle is clear and accurate. Body follows the What/Why/Risk structure the merge gate expects.\n\nTwo-caller scope is small enough to revert cleanly if needed.\n\nCloses link is correct.\n\n**Approve merge.**","## Gemini review \xb7 PR\n\nContext is well-summarised. Calling out `divideMoney` as the follow-up PR (#4129) sets the right expectation for reviewers.\n\n`Closes #4127` ties the work to the original bug report — the audit trail is intact.\n\n**Approve merge.**","## Claude (sonnet) review \xb7 PR\n\nNo surprises. Two-caller scope is bounded, rollback is a single revert, backward-compat note covers the cutover.\n\nOn-call will not be paged at 3am over this one.\n\n**Approve merge.**","## Kimi review (via opencode) \xb7 PR\n\nTitle + body land the message in three sentences. Verify report linked. Risk section names the actual callers.\n\nShip it.\n\n**Approve merge.**","## DeepSeek review \xb7 PR\n\nPR + verify report cross-loaded. Risk + rollback note is the kind of thing on-call appreciates.\n\nVerify report (12 tests, 100% branch) is linked. Closes link to #4127 ties the work to the original bug.\n\nBackward-compat note covers the cutover window:\n> divide() v1 stays exported for one minor before removal\n\nNothing held back.\n\n**Approve merge.**"],usage:[{inputTokens:9420,outputTokens:1480,costUsd:.0712},{inputTokens:8460,outputTokens:60,costUsd:.0017},{inputTokens:8640,outputTokens:320,costUsd:.0163},{inputTokens:8640,outputTokens:280,costUsd:.0058},{inputTokens:8820,outputTokens:240,costUsd:.0036},{inputTokens:8930,outputTokens:920,costUsd:.0388}]}];function N(e,n){return{participant:`${e}-${n.agentName}`,role:e,agentName:n.agentName,lineage:n.lineage,hasAnswer:!1,model:n.model,pending:!1}}function E(e,n,t,i){return{participant:`${e}-${n.agentName}`,role:e,agentName:n.agentName,lineage:n.lineage,hasAnswer:!0,answer:t,durationMs:n.durationMs,model:n.model,binaryUsed:n.binaryUsed,modelUsed:n.model,usage:i}}function M(){return[N("doer",y),...k.map(e=>N("reviewer",e))]}let D=[{round:1,participants:M()}],A={id:"demo-complex-6way",name:"Plan → Ship Workflow",description:"Five-phase workflow with five reviewers per phase.",category:"review",agreementThreshold:"majority",onThresholdMet:"auto-finalize",maxRounds:1,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:!1,onError:"fail",notify:"dashboard-only",yaml:"",authorHandle:"demo",forks:0,popularity:0,phases:x.map(e=>({id:e.id,name:e.name,description:e.description,kind:e.kind,gate:"auto",doer:{lineage:"claude",models:["claude-opus-4-7"]},reviewer:{require:2,crossLineage:!0,candidates:["codex","gemini","opencode"],candidatesWithModels:k.map(e=>({lineage:e.lineage,models:[e.model]}))},artifact:{label:"Artifact",hint:"",maxBytes:1048576},inputs:{include:[],exclude:[]},iterate:{max:1,onMax:"fail"},blindSpots:[],execution:"parallel",builtin:!0}))},I=(e,n,t)=>{let i=[],o=n.id;for(let[r,a]of T.entries())i.push({atMs:t+30*r,payload:{type:"phase_start",payload:{phaseIdx:e,phaseId:o,kind:n.kind,role:0===r?"doer":"reviewer",agent:a.agentName},ts:Date.now()}});for(let[e,r]of T.entries()){let a=0===e?"doer":"reviewer",s=function(e){let n=Math.floor(.3*e.length),t=Math.floor(.65*e.length);return[e.slice(0,n),e.slice(0,t),e]}(n.streams[e]),d=[.25,.55,.85].map(e=>Math.round(r.doneAtMs*e));for(let[e,n]of s.entries())i.push({atMs:t+d[e],payload:{type:"phase_progress",payload:{phaseId:o,round:1,role:a,agent:r.agentName,elapsedMs:d[e],output:n},ts:Date.now()}})}for(let[e,n]of T.entries()){let r=0===e?"doer":"reviewer";i.push({atMs:t+n.doneAtMs,payload:{type:"participant_done",payload:{phaseId:o,round:1,role:r,agent:n.agentName},ts:Date.now()}})}return i.push({atMs:t+5e3-100,payload:{type:"phase_done",payload:{phaseId:o,phaseIdx:e,kind:n.kind},ts:Date.now()}}),i},U=(()=>{let e=[];for(let[n,t]of x.entries())e.push(...I(n,t,200+5e3*n));return e.push({atMs:200+5e3*x.length+300,payload:{type:"chat_done",payload:{status:"merged",verdict:"approve",prUrl:"https://github.com/example/repo/pull/4128"},ts:Date.now()}}),e})(),S={"simple-6way":{template:m,initialRounds:h,work:"Review src/util/divide.ts for production-readiness — six lineages, one pass, blockers welcome.",buildDataSource:function(){let e={currentParticipants:p.map(u)};return{createEventSource:()=>d(b,(n,t)=>{!function(e,n,t){if("participant_done"!==n)return;let i=t.agent;if(!i)return;let o=p.find(e=>e.agentName===i);o&&(e.currentParticipants=e.currentParticipants.map(e=>e.agentName===i?{participant:`reviewer-${o.agentName}`,role:"reviewer",agentName:o.agentName,lineage:o.lineage,hasAnswer:!0,answer:o.answer,durationMs:o.durationMs,model:o.model,binaryUsed:o.binaryUsed,modelUsed:o.model,usage:o.usage}:e))}(e,n,t)}),fetchArtifacts:()=>({rounds:[{round:1,participants:e.currentParticipants}]})}}},"complex-6way":{template:A,initialRounds:D,work:"feat(util): production-safe divide() — Plan → Spec → Implement → Verify → Ship • closes #4127",buildDataSource:function(){let e={currentPhaseIdx:0,currentParticipants:M()};return{createEventSource:()=>d(U,(n,t)=>{!function(e,n,t){if("phase_start"===n){let n=t.phaseIdx;"number"==typeof n&&n!==e.currentPhaseIdx&&(e.currentPhaseIdx=n,e.currentParticipants=M());return}if("participant_done"===n){let n=t.agent;if(!n)return;let i=T.findIndex(e=>e.agentName===n);if(i<0)return;let o=T[i],r=x[e.currentPhaseIdx];if(!r)return;let a=E(0===i?"doer":"reviewer",o,r.streams[i],r.usage[i]);e.currentParticipants=e.currentParticipants.map(e=>e.agentName===n?a:e);return}if("chat_done"===n){let n=x[x.length-1];e.currentParticipants=T.map((e,t)=>E(0===t?"doer":"reviewer",e,n.streams[t],n.usage[t])),e.currentPhaseIdx=x.length-1}}(e,n,t)}),fetchArtifacts:()=>({rounds:[{round:1,participants:e.currentParticipants}]})}}}};function R({params:e}){let{scenario:n}=(0,o.use)(e),t=S[n];t||(0,r.notFound)();let d=(0,o.useMemo)(()=>`demo-${n}-${Math.random().toString(36).slice(2,8)}`,[n]),c=(0,o.useMemo)(()=>t.buildDataSource(),[t]);return(0,i.jsx)(a.G,{children:(0,i.jsx)("div",{className:"mx-auto max-w-[1700px] px-6 py-6",children:(0,i.jsx)(s.LiveRunReal,{chatId:d,initialStatus:"reviewing",initialRounds:t.initialRounds,template:t.template,templateId:t.template.id,work:t.work,demoDataSource:c})})})}},6255:(e,n,t)=>{Promise.resolve().then(t.bind(t,5249))}},e=>{e.O(0,[116,832,641,344,245,506,128,358],()=>e(e.s=6255)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{4372:(e,n,t)=>{"use strict";t.d(n,{G:()=>a});var i=t(9442),o=t(821),r=t(8344);function a({children:e}){return(0,i.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[(0,i.jsx)(o.AppSidebar,{}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,i.jsx)(r.MobileTopBar,{}),(0,i.jsx)("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}},5249:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>R});var i=t(9442),o=t(6074),r=t(5902),a=t(4372),s=t(1245);function d(e,n){let t=[],i=!1,o={onmessage:null,onerror:null,onopen:null,readyState:0,url:"mock://demo",withCredentials:!1,addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0,close:()=>{for(let e of(i=!0,t))clearTimeout(e)}};for(let r of[...e].sort((e,n)=>e.atMs-n.atMs)){let e=setTimeout(()=>{if(i)return;if(n){let e=r.payload;n("string"==typeof e.type?e.type:"",e.payload??{})}let e=o.onmessage;e&&e({data:JSON.stringify(r.payload)})},r.atMs);t.push(e)}return o}let c="review",l="**Verdict: approve**\n\n",p=[{agentName:"codex-cli-0",lineage:"codex",model:"gpt-5.5",binaryUsed:"codex",doneAtMs:3200,durationMs:3e3,usage:{inputTokens:6480,outputTokens:380,costUsd:.0094},answer:"## Codex review: `divide(a, b)`\n\n"+l+'Math is correct, types flow naturally, function is small and obvious. Approving with two notes.\n\n**The current helper:**\n```ts\nexport function divide(a: number, b: number) {\n return a / b;\n}\n```\n\n**Two minors before merge:**\n1. **Add a divide-by-zero guard.** `divide(x, 0)` silently returns `Infinity` — a footgun in any pipeline that math-chains:\n ```ts\n if (b === 0) throw new RangeError("divide: zero divisor");\n ```\n2. **Add a JSDoc block.** Three lines. Saves the next reader from reading the body to learn the type contract.'},{agentName:"gemini-cli-1",lineage:"gemini",model:"gemini-3.1-pro-preview",binaryUsed:"gemini-cli",doneAtMs:4400,durationMs:4200,usage:{inputTokens:6720,outputTokens:720,costUsd:.0258},answer:"## Gemini review: `divide(a, b)`\n\n"+l+'No structural issues. The function does one thing and the implementation matches its name. Approving with a strong suggestion to harden the test surface.\n\n**Suggested spec coverage:**\n```ts\ndescribe("divide", () => {\n it("returns a / b for finite inputs", () => {\n expect(divide(10, 2)).toBe(5);\n });\n it("rejects zero divisor", () => {\n expect(() => divide(10, 0)).toThrow();\n });\n it("rejects NaN", () => {\n expect(() => divide(NaN, 2)).toThrow();\n });\n it("rejects Infinity", () => {\n expect(() => divide(Infinity, 2)).toThrow();\n });\n});\n```\n\nFour cases close every hole I see by construction.'},{agentName:"claude-code-2",lineage:"claude",model:"claude-opus-4-7",binaryUsed:"claude-code",doneAtMs:5400,durationMs:5200,usage:{inputTokens:7100,outputTokens:1240,costUsd:.0517},answer:"## Claude review: `divide(a, b)`\n\n"+l+'Reads cleanly. The function does one thing and is trivially testable. Approving with two notes — neither blocking.\n\n**Note 1 — Zero-guard.**\n`divide(x, 0)` returns `Infinity` in JavaScript. That value flows silently through arithmetic and ends up in logs/dashboards as a real number. A typed error would prevent the silent corruption:\n```ts\nclass DivideError extends Error {}\nif (b === 0) throw new DivideError("zero divisor");\n```\n\n**Note 2 — Currency callers.**\nIf this lives on a billing/ledger hot path, prefer integer-cents or `decimal.js` over floats. IEEE 754 will accumulate cent-level drift in a high-volume ledger:\n```ts\n// safer for currency:\nexport function divideMoney(cents: number, n: number): number {\n return Math.round(cents / n);\n}\n```'},{agentName:"opencode-cli-3",lineage:"opencode",model:"opencode-go/kimi-k2.6",binaryUsed:"opencode",doneAtMs:2700,durationMs:2500,usage:{inputTokens:6240,outputTokens:280,costUsd:.0042},answer:"## Kimi review (via opencode)\n\n"+l+'Pragmatic helper. The math is correct; the holes are at the boundary, not the body. Approving — both fixes below are 60-second jobs that can land in a follow-up if you want to ship now.\n\n**Suggested patch:**\n```ts\n/**\n * Divide two finite numbers. Throws on zero divisor or non-finite input.\n */\nexport function divide(a: number, b: number): number {\n if (b === 0) throw new Error("divide: zero divisor");\n return a / b;\n}\n```\n\nAnd one test:\n```ts\nexpect(() => divide(1, 0)).toThrow("zero divisor");\n```'},{agentName:"opencode-cli-4",lineage:"opencode",model:"opencode-go/deepseek-v4-pro",binaryUsed:"opencode",doneAtMs:6200,durationMs:6e3,usage:{inputTokens:7340,outputTokens:1460,costUsd:.0228},answer:'## DeepSeek review (via opencode)\n\n**Verdict: request changes**\n\nThree blockers in a financial context. This helper would land me in a post-mortem inside three months on a busy ledger.\n\n**Blocker 1 — No divide-by-zero guard.**\n```ts\ndivide(100, 0); // → Infinity, silent corruption downstream\n```\nRequired:\n```ts\nif (b === 0) throw new DivideError("zero");\n```\n\n**Blocker 2 — No input validation.**\n```ts\ndivide("5" as any, 2); // → 2.5 (silent string coercion)\ndivide(NaN, 2); // → NaN (poisons later math)\ndivide(undefined as any, 2); // → NaN\n```\nRequired: `Number.isFinite(a) && Number.isFinite(b)` at the top.\n\n**Blocker 3 — Floats for money.**\nIEEE 754 + currency = audit-trail nightmare. Use integer-cents or `decimal.js`. Reproducer:\n```ts\n0.1 + 0.2 === 0.3; // false\ndivide(0.3, 0.1); // 2.9999999999999996\n```'},{agentName:"opencode-cli-5",lineage:"opencode",model:"opencode-go/qwen3.6-plus",binaryUsed:"opencode",doneAtMs:3700,durationMs:3500,usage:{inputTokens:6420,outputTokens:320,costUsd:.0061},answer:"## Qwen review (via opencode)\n\n"+l+"Reads cleanly. No defects in the body.\n\n**Minor — Missing documentation.**\nThree lines of JSDoc would let editor tooling surface the contract:\n```ts\n/**\n * @param a - dividend (finite number)\n * @param b - divisor (finite, non-zero)\n * @returns the quotient a / b\n */\n```\n\nHelpful for downstream callers, not blocking the merge."}];function u(e){return{participant:`reviewer-${e.agentName}`,role:"reviewer",agentName:e.agentName,lineage:e.lineage,hasAnswer:!1,model:e.model,pending:!1}}let h=[{round:1,participants:p.map(u)}],m={id:"demo-simple-6way",name:"External Review \xb7 Six Voices",description:"Six reviewers critique the artifact independently.",category:"review",agreementThreshold:"majority",onThresholdMet:"ask-user",maxRounds:1,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:!1,onError:"fail",notify:"dashboard-only",yaml:"",authorHandle:"demo",forks:0,popularity:0,phases:[{id:c,name:"External Review",description:"Six lineages critique the supplied artifact independently.",kind:"review_only",gate:"auto",doer:{lineage:"claude",models:[]},reviewer:{require:2,crossLineage:!0,candidates:["codex","gemini","claude","opencode"],candidatesWithModels:p.map(e=>({lineage:e.lineage,models:[e.model]}))},artifact:{label:"Artifact",hint:"",maxBytes:1048576},inputs:{include:[],exclude:[]},iterate:{max:1,onMax:"fail"},blindSpots:[],execution:"parallel",builtin:!0}]},v=e=>({type:"phase_start",payload:{phaseIdx:0,phaseId:c,kind:"review_only",role:"reviewer",agent:e},ts:Date.now()}),g=(e,n,t)=>({type:"phase_progress",payload:{phaseId:c,round:1,role:"reviewer",agent:e,elapsedMs:t,output:n},ts:Date.now()}),f=e=>({type:"participant_done",payload:{phaseId:c,round:1,role:"reviewer",agent:e},ts:Date.now()}),w={"codex-cli-0":"## Reviewing src/util/divide.ts\n\nCurrent implementation:\n```ts\nexport function divide(a: number, b: number) {\n return a / b;\n}\n```\n\nChecking input handling first.\n\nSpotted: no zero-guard. `divide(x, 0)` silently returns `Infinity`. In a billing pipeline that math-chains downstream, that becomes a ledger row.\n\nNo JSDoc either — readers have to read the body to learn the type contract.\n\nVerdict drafting: two minors, leaning approve with notes.","gemini-cli-1":"## Review \xb7 `divide(a, b)`\n\nReading the helper. Checking the type contract first:\n```ts\n(a: number, b: number) => number\n```\n\nCoverage gaps surfacing: `NaN`, `Infinity`, zero divisor — none asserted.\n\nDrafting a four-case spec block to close the holes by construction:\n```ts\nexpect(divide(10, 2)).toBe(5);\nexpect(() => divide(10, 0)).toThrow();\nexpect(() => divide(NaN, 2)).toThrow();\nexpect(() => divide(Infinity, 2)).toThrow();\n```\n\nApproving with this spec block as a follow-up.","claude-code-2":"## Review: divide helper\n\nLoading + cross-referencing the two callers:\n```ts\n// /billing/invoice.ts:42 — currently produces silent Infinity\nconst unitPrice = divide(invoice.total, invoice.quantity);\n\n// /reports/avg.ts:18 — already wraps in try/catch\nconst average = divide(sum, count);\n```\n\n`/billing/invoice.ts:42` is the smoking gun — confirms the silent-Infinity bug class is real, not theoretical.\n\nRecommendation:\n1. Add a zero-guard returning a typed `DivideError`.\n2. Stage `divideMoney(cents, n)` for currency callers in a follow-up.\n\nApproving the helper rewrite with these two notes.","opencode-cli-3":'## Kimi review (via opencode)\n\nInspecting `divide(a, b)`. Quick pass — math is correct, the holes are at the boundary.\n\nSuggested patch:\n```ts\n/** Divide two finite numbers. Throws on zero divisor or non-finite input. */\nexport function divide(a: number, b: number): number {\n if (b === 0) throw new Error("divide: zero divisor");\n return a / b;\n}\n```\n\nApproving — both fixes are 60-second jobs.',"opencode-cli-4":'## DeepSeek review (via opencode)\n\nLoading `divide()` + the two callers + the existing spec.\n\nReproducing the failure modes locally:\n```ts\ndivide(100, 0); // Infinity (silent corruption)\ndivide("5", 2); // 2.5 (silent string coercion)\ndivide(0.3, 0.1); // 2.9999999999999996 (IEEE 754)\n```\n\nThree blockers, all reproducible in <30 lines:\n1. **No divide-by-zero guard** — required: `Number.isFinite` check + typed error.\n2. **No input validation** — TypeScript types are erased at runtime; `as any` slips through.\n3. **Floats for money** — IEEE 754 + currency = audit-trail nightmare. Need integer-cents.\n\nWill request changes.',"opencode-cli-5":"## Qwen review (via opencode)\n\nQuick read — public API surface only.\n\nNo defects in the body. The implementation matches its name.\n\nDocumentation gap noted — three lines of JSDoc would let editor tooling surface the contract:\n```ts\n/**\n * @param a - dividend (finite number)\n * @param b - divisor (finite, non-zero)\n * @returns the quotient a / b\n */\n```\n\nApproving — JSDoc is the only minor."},b=(()=>{let e=[];for(let[n,t]of p.entries())e.push({atMs:200+20*n,payload:v(t.agentName)});for(let n of p){let t=function(e){let n=Math.floor(.3*e.length),t=Math.floor(.65*e.length);return[e.slice(0,n),e.slice(0,t),e]}(w[n.agentName]),i=[.25,.55,.85].map(e=>Math.round(n.doneAtMs*e));for(let[o,r]of t.entries())e.push({atMs:i[o],payload:g(n.agentName,r,i[o])})}for(let n of p)e.push({atMs:n.doneAtMs,payload:f(n.agentName)});let n=Math.max(...p.map(e=>e.doneAtMs));return e.push({atMs:n+200,payload:{type:"phase_done",payload:{phaseId:c,phaseIdx:0,kind:"review_only"},ts:Date.now()}}),e.push({atMs:n+400,payload:{type:"chat_done",payload:{status:"completed",verdict:"request_changes"},ts:Date.now()}}),e})(),y={agentName:"claude-code-doer",lineage:"claude",model:"claude-opus-4-7",binaryUsed:"claude-code",doneAtMs:3700,durationMs:3500},k=[{agentName:"codex-cli-0",lineage:"codex",model:"gpt-5.5",binaryUsed:"codex",doneAtMs:2800,durationMs:2600},{agentName:"gemini-cli-1",lineage:"gemini",model:"gemini-3.1-pro-preview",binaryUsed:"gemini-cli",doneAtMs:3500,durationMs:3300},{agentName:"claude-code-2",lineage:"claude",model:"claude-sonnet-4-6",binaryUsed:"claude-code",doneAtMs:3100,durationMs:2900},{agentName:"opencode-cli-3",lineage:"opencode",model:"opencode-go/kimi-k2.6",binaryUsed:"opencode",doneAtMs:3900,durationMs:3700},{agentName:"opencode-cli-4",lineage:"opencode",model:"opencode-go/deepseek-v4-pro",binaryUsed:"opencode",doneAtMs:4500,durationMs:4300}],T=[y,...k],x=[{id:"plan",name:"Plan",kind:"plan",description:"Doer drafts the implementation approach; three reviewers critique.",streams:["## Plan: divide() helper rewrite\n\n**Goal:** production-safe wrapper over `a / b`.\n\n**Three deliverables:**\n1. Zero-guard returning a typed `DivideError`.\n2. Strict input validation (numbers only, finite, non-NaN).\n3. Switch currency callers to integer-cents (`divideMoney(cents, n)` follow-up PR).\n\n**Acceptance tests:**\n```ts\nexpect(divide(10, 2)).toBe(5);\nexpect(() => divide(10, 0)).toThrow(DivideError);\nexpect(() => divide(NaN, 2)).toThrow(DivideError);\nexpect(() => divide(Infinity, 2)).toThrow(DivideError);\n```\n\n**Risks:** API churn for two callers (`/billing/invoice.ts:42`, `/reports/avg.ts:18`). Mitigation: ship v2 alongside, deprecate v1 over one minor.\n\n**Rollback:** revert single commit; no schema/migration touched.","## Codex review \xb7 plan\n\nReading the plan…\n\nThree-piece breakdown looks right:\n- zero-guard ✓\n- input validation ✓\n- decimal precision ✓\n\nAcceptance tests match the spec contract.\n\n**Approve** — sound plan. One ask: add a `bigint` handling note. The current plan is implicitly Number-only, which is the right call, but worth saying so explicitly so the next reader does not assume `BigInt` support.","## Gemini review \xb7 plan\n\nCross-checking acceptance tests against the spec contract:\n```ts\ndivide(10, 2) // 5 ✓\ndivide(10, 0) // throw ✓\ndivide(NaN, 2) // throw ✓\ndivide(Inf, 2) // throw ✓\n```\n\nConcrete enough to drive TDD.\n\n**Approve** — explicit zero-guard is the right move. One follow-up: surface the deprecation timeline in the PR body so the two affected callers can plan their cutover.","## Claude (sonnet) review \xb7 plan\n\nReading the plan + skimming the existing call sites.\n\nThree-piece breakdown is right. The `divideMoney` carve-out is the right ergonomic — keep `divide` for general arithmetic, steer money paths to integer-cents.\n\n**Approve** — one ask: pin the deprecation timeline (one minor? one major?) so the two callers can plan.","## Kimi review (via opencode) \xb7 plan\n\nPlan looks tight. Three deliverables map cleanly to three commits if you want to split for review.\n\nAcceptance test set is the right shape — unit tests against the contract, not the implementation.\n\n**Approve** — pragmatic and shippable.","## DeepSeek review \xb7 plan\n\nPulling the existing `divide()` implementation for context:\n```ts\nexport function divide(a, b) { return a / b; }\n```\n\nCross-checking against the silent-Infinity bug class.\n\nNeed a non-finite-input row added to the acceptance tests:\n```ts\nexpect(() => divide(Number.POSITIVE_INFINITY, 2)).toThrow(DivideError);\nexpect(() => divide(2, Number.NEGATIVE_INFINITY)).toThrow(DivideError);\n```\n\nThe silent-Infinity bug is what triggered this rewrite, so the test set should explicitly cover both directions.\n\n**Approve with notes** — solid plan, just close that gap."],usage:[{inputTokens:6420,outputTokens:1840,costUsd:.0682},{inputTokens:5800,outputTokens:380,costUsd:.0094},{inputTokens:6020,outputTokens:540,costUsd:.0241},{inputTokens:6020,outputTokens:410,costUsd:.0086},{inputTokens:6240,outputTokens:320,costUsd:.0048},{inputTokens:6280,outputTokens:1140,costUsd:.0488}]},{id:"spec",name:"Spec",kind:"spec",description:"Doer derives the API contract; reviewers check alignment.",streams:['## Spec: `divide(a, b)`\n\n```ts\nexport class DivideError extends Error {\n constructor(public readonly reason: "zero" | "non-finite") {\n super(`divide: ${reason}`);\n this.name = "DivideError";\n }\n}\n\nexport function divide(a: number, b: number): number;\n```\n\n**Contract:**\n- `b === 0` → throws `DivideError("zero")`\n- `!Number.isFinite(a)` → throws `DivideError("non-finite")`\n- `!Number.isFinite(b)` → throws `DivideError("non-finite")`\n- otherwise → returns `a / b`\n\n**Order of checks:** non-finite first so `divide(NaN, 0)` reports the more specific failure.',"## Codex review \xb7 spec\n\nReading the type signature:\n```ts\n(a: number, b: number) => number\n```\n\nClean. Examples cover happy + zero + non-finite.\n\n**Approve** — suggest adding NaN explicitly to the example block:\n```ts\nexpect(() => divide(NaN, 5)).toThrow(/non-finite/);\n```\n\n`Number.isFinite(NaN)` returns false so it is covered, but enumerating it makes the intent explicit.",'## Gemini review \xb7 spec\n\nThe `reason` discriminant on the error class is the right ergonomic for callers that need to branch:\n```ts\ntry { return divide(a, b); }\ncatch (err) {\n if (err instanceof DivideError && err.reason === "zero") return 0;\n throw err;\n}\n```\n\nThat pattern beats string parsing on `err.message`.\n\n**Approve** — no structural concerns.','## Claude (sonnet) review \xb7 spec\n\n`DivideError` class is well-scoped. The `name = "DivideError"` assignment is the kind of detail that pays off in stack traces:\n```\nDivideError: divide: zero\n at /billing/invoice.ts:42\n```\n\n**Approve.**',"## Kimi review (via opencode) \xb7 spec\n\nType signature is unambiguous. The `reason` discriminant lets callers branch on failure type without string parsing.\n\nOrder-of-checks (non-finite first) is the right call.\n\n**Approve** — ready for implement.","## DeepSeek review \xb7 spec\n\nLoading spec + cross-checking against plan.\n\nExamples should include negatives and -Infinity:\n```ts\nexpect(divide(-10, 2)).toBe(-5);\nexpect(divide(10, -2)).toBe(-5);\nexpect(() => divide(Number.NEGATIVE_INFINITY, 2)).toThrow();\n```\n\nThe spec contract handles them correctly via `Number.isFinite`, but the example block sets the test surface and should be exhaustive.\n\n**Approve with notes.**"],usage:[{inputTokens:7240,outputTokens:1620,costUsd:.0731},{inputTokens:6500,outputTokens:320,costUsd:.0086},{inputTokens:6720,outputTokens:460,costUsd:.0218},{inputTokens:6720,outputTokens:380,costUsd:.0078},{inputTokens:6900,outputTokens:280,costUsd:.0042},{inputTokens:6980,outputTokens:980,costUsd:.0431}]},{id:"implement",name:"Implement",kind:"implement",description:"Doer writes the code blind to tests; reviewers find bugs.",streams:['## Implementation: `src/util/divide.ts`\n\n```ts\nexport class DivideError extends Error {\n constructor(public readonly reason: "zero" | "non-finite") {\n super(`divide: ${reason}`);\n this.name = "DivideError";\n }\n}\n\nexport function divide(a: number, b: number): number {\n if (!Number.isFinite(a) || !Number.isFinite(b)) {\n throw new DivideError("non-finite");\n }\n if (b === 0) {\n throw new DivideError("zero");\n }\n return a / b;\n}\n```\n\n**Notes:**\n- Non-finite check first so `divide(NaN, 0)` reports `"non-finite"`, not `"zero"`.\n- `name` set on `DivideError` so stack traces read `DivideError: divide: zero`.','## Codex review \xb7 diff\n\nPulling the diff. Reading each branch:\n\n✓ `Number.isFinite` — rejects NaN, \xb1Infinity, non-numbers via type system.\n✓ Zero-check after — order is correct.\n✓ `DivideError` extends `Error` with `name` set.\n\nOrder of checks decision is the correct call:\n```ts\ndivide(NaN, 0); // → "non-finite" (more specific failure first)\n```\n\n**Approve** — implementation is clean. Nothing to push back on.','## Gemini review \xb7 diff\n\nThe patch matches the spec line-for-line.\n\nThe `name` assignment on `DivideError`:\n```ts\nthis.name = "DivideError";\n```\n\nis the kind of detail that pays off the first time someone reads a stack trace — `DivideError: divide: zero` is actionable; `Error: divide: zero` looks like a generic throw and gets noise-suppressed.\n\n**Approve.**',"## Claude (sonnet) review \xb7 diff\n\nReads cleanly. Inline validation is fine for two args; would extract `isInvalid()` if this grew.\n\nThe `name` assignment on `DivideError` is the right detail — actionable stack traces over generic `Error: ...` lines.\n\n**Approve.**","## Kimi review (via opencode) \xb7 diff\n\nSmall, obvious, complete. 13 lines that do exactly what the spec said.\n\nReads in one breath:\n```ts\nif (!Number.isFinite(a) || !Number.isFinite(b)) throw …;\nif (b === 0) throw …;\nreturn a / b;\n```\n\n**Approve.**","## DeepSeek review \xb7 diff\n\nDiff loaded. Walking each branch.\n\nWant a `-0` test note before merge — JavaScript treats `-0 === 0` as `true`, so the existing zero-guard catches it, but the test pins the behaviour:\n```ts\nexpect(divide(10, -2)).toBe(-5);\nexpect(() => divide(10, -0)).toThrow(/zero/); // -0 === 0\n```\n\nThe `-0` case is the easy miss — without the test, an accidental refactor to `if (b !== 0)` would pass the existing suite.\n\n**Approve with notes.**"],usage:[{inputTokens:8120,outputTokens:1980,costUsd:.0892},{inputTokens:7300,outputTokens:280,costUsd:.0072},{inputTokens:7440,outputTokens:460,costUsd:.0214},{inputTokens:7440,outputTokens:320,costUsd:.0066},{inputTokens:7620,outputTokens:360,costUsd:.0054},{inputTokens:7720,outputTokens:1180,costUsd:.0508}]},{id:"verify",name:"Verify",kind:"verify",description:"Run the test suite; reviewers confirm coverage.",streams:['## Verify\n\n```\n$ pnpm test src/util/divide.test.ts\n\n ✓ divide > returns a / b for valid inputs\n ✓ divide > handles negative dividends\n ✓ divide > handles negative divisors\n ✓ divide > -0 is treated as 0 (throws "zero")\n ✓ divide > throws "zero" for b=0\n ✓ divide > throws "non-finite" for NaN\n ✓ divide > throws "non-finite" for \xb1Infinity\n ✓ divide > non-finite check precedes zero check\n ✓ DivideError > extends Error\n ✓ DivideError > exposes reason discriminant\n\n Tests: 12 passed (12)\n Coverage: 100% lines, 100% branches\n Lint: clean\n Types: clean\n Time: 1.42s\n```',"## Codex review \xb7 verify\n\nTest report loaded.\n\n✓ 12/12 pass, 0 fail, 0 skip\n✓ Coverage 100/100/100\n✓ Lint + types clean\n\nEvery spec case has a corresponding test. The `-0` row is what the implement-phase review asked for; merged correctly.\n\n**Approve** — nothing to add.","## Gemini review \xb7 verify\n\nReading the report:\n```\nTests: 12 passed (12)\nCoverage: 100% lines, 100% branches\n```\n\nNo flakes, no skips. The `Tests: 12 passed (12)` line is exactly what the merge gate looks for.\n\nCoverage 100/100/100 satisfies the production-utility bar.\n\n**Approve.**","## Claude (sonnet) review \xb7 verify\n\n12 tests for a 13-line function is honest coverage, not theatre. Each test asserts a real boundary condition.\n\nThe `non-finite check precedes zero check` assertion is doing real work — it pins the order-of-checks decision so a future refactor cannot silently swap them.\n\n**Approve.**","## Kimi review (via opencode) \xb7 verify\n\n✓ 12/12 pass\n✓ Coverage 100/100/100\n✓ No flakes, no skips\n\nShip it.\n\n**Approve.**","## DeepSeek review \xb7 verify\n\nPulling test report + spec for cross-check.\n\n12 tests for a 13-line function is honest coverage, not theatre. Each test asserts a real boundary:\n\n- happy path \xd7 4\n- zero divisor + -0\n- NaN + \xb1Infinity\n- order-of-checks invariant\n- DivideError shape + discriminant\n\nThe `non-finite check precedes zero check` assertion pins the order-of-checks decision so a future refactor cannot silently swap them.\n\n**Approve.**"],usage:[{inputTokens:8980,outputTokens:1340,costUsd:.0641},{inputTokens:8060,outputTokens:80,costUsd:.0021},{inputTokens:8230,outputTokens:360,costUsd:.0179},{inputTokens:8230,outputTokens:280,costUsd:.0058},{inputTokens:8410,outputTokens:220,costUsd:.0033},{inputTokens:8520,outputTokens:1060,costUsd:.0418}]},{id:"pr",name:"Ship",kind:"pr",description:"Doer drafts the PR; reviewers approve merge.",streams:["## PR draft\n\n**Title:** `feat(util): production-safe divide() with DivideError + 100% branch coverage`\n\n**Body:**\n```\nIntroduces a hardened `divide()` per the attached spec.\n\nWhat:\n- New DivideError class with typed reason discriminant\n- divide(a, b) rejects non-finite + zero divisor\n- 12 new tests; 100% line + branch coverage\n- Two existing callers updated\n\nWhy:\n- Silent Infinity from divide(x, 0) was a footgun in /billing\n- IEEE 754 currency math driving audit-trail drift; companion\n divideMoney(cents, n) lands in #4129\n\nRisk:\n- Two callers updated; no other call sites in repo\n- Rollback: revert this commit (no schema touched)\n- Backward-compat: divide() v1 stays exported for one minor\n\nCloses #4127\n```","## Codex review \xb7 PR\n\nTitle is clear and accurate. Body follows the What/Why/Risk structure the merge gate expects.\n\nTwo-caller scope is small enough to revert cleanly if needed.\n\nCloses link is correct.\n\n**Approve merge.**","## Gemini review \xb7 PR\n\nContext is well-summarised. Calling out `divideMoney` as the follow-up PR (#4129) sets the right expectation for reviewers.\n\n`Closes #4127` ties the work to the original bug report — the audit trail is intact.\n\n**Approve merge.**","## Claude (sonnet) review \xb7 PR\n\nNo surprises. Two-caller scope is bounded, rollback is a single revert, backward-compat note covers the cutover.\n\nOn-call will not be paged at 3am over this one.\n\n**Approve merge.**","## Kimi review (via opencode) \xb7 PR\n\nTitle + body land the message in three sentences. Verify report linked. Risk section names the actual callers.\n\nShip it.\n\n**Approve merge.**","## DeepSeek review \xb7 PR\n\nPR + verify report cross-loaded. Risk + rollback note is the kind of thing on-call appreciates.\n\nVerify report (12 tests, 100% branch) is linked. Closes link to #4127 ties the work to the original bug.\n\nBackward-compat note covers the cutover window:\n> divide() v1 stays exported for one minor before removal\n\nNothing held back.\n\n**Approve merge.**"],usage:[{inputTokens:9420,outputTokens:1480,costUsd:.0712},{inputTokens:8460,outputTokens:60,costUsd:.0017},{inputTokens:8640,outputTokens:320,costUsd:.0163},{inputTokens:8640,outputTokens:280,costUsd:.0058},{inputTokens:8820,outputTokens:240,costUsd:.0036},{inputTokens:8930,outputTokens:920,costUsd:.0388}]}];function N(e,n){return{participant:`${e}-${n.agentName}`,role:e,agentName:n.agentName,lineage:n.lineage,hasAnswer:!1,model:n.model,pending:!1}}function E(e,n,t,i){return{participant:`${e}-${n.agentName}`,role:e,agentName:n.agentName,lineage:n.lineage,hasAnswer:!0,answer:t,durationMs:n.durationMs,model:n.model,binaryUsed:n.binaryUsed,modelUsed:n.model,usage:i}}function M(){return[N("doer",y),...k.map(e=>N("reviewer",e))]}let D=[{round:1,participants:M()}],A={id:"demo-complex-6way",name:"Plan → Ship Workflow",description:"Five-phase workflow with five reviewers per phase.",category:"review",agreementThreshold:"majority",onThresholdMet:"auto-finalize",maxRounds:1,driver:"external",driverHandoff:!1,verificationGate:"auto",costCapUsd:0,yoloDefault:!1,onError:"fail",notify:"dashboard-only",yaml:"",authorHandle:"demo",forks:0,popularity:0,phases:x.map(e=>({id:e.id,name:e.name,description:e.description,kind:e.kind,gate:"auto",doer:{lineage:"claude",models:["claude-opus-4-7"]},reviewer:{require:2,crossLineage:!0,candidates:["codex","gemini","opencode"],candidatesWithModels:k.map(e=>({lineage:e.lineage,models:[e.model]}))},artifact:{label:"Artifact",hint:"",maxBytes:1048576},inputs:{include:[],exclude:[]},iterate:{max:1,onMax:"fail"},blindSpots:[],execution:"parallel",builtin:!0}))},I=(e,n,t)=>{let i=[],o=n.id;for(let[r,a]of T.entries())i.push({atMs:t+30*r,payload:{type:"phase_start",payload:{phaseIdx:e,phaseId:o,kind:n.kind,role:0===r?"doer":"reviewer",agent:a.agentName},ts:Date.now()}});for(let[e,r]of T.entries()){let a=0===e?"doer":"reviewer",s=function(e){let n=Math.floor(.3*e.length),t=Math.floor(.65*e.length);return[e.slice(0,n),e.slice(0,t),e]}(n.streams[e]),d=[.25,.55,.85].map(e=>Math.round(r.doneAtMs*e));for(let[e,n]of s.entries())i.push({atMs:t+d[e],payload:{type:"phase_progress",payload:{phaseId:o,round:1,role:a,agent:r.agentName,elapsedMs:d[e],output:n},ts:Date.now()}})}for(let[e,n]of T.entries()){let r=0===e?"doer":"reviewer";i.push({atMs:t+n.doneAtMs,payload:{type:"participant_done",payload:{phaseId:o,round:1,role:r,agent:n.agentName},ts:Date.now()}})}return i.push({atMs:t+5e3-100,payload:{type:"phase_done",payload:{phaseId:o,phaseIdx:e,kind:n.kind},ts:Date.now()}}),i},U=(()=>{let e=[];for(let[n,t]of x.entries())e.push(...I(n,t,200+5e3*n));return e.push({atMs:200+5e3*x.length+300,payload:{type:"chat_done",payload:{status:"merged",verdict:"approve",prUrl:"https://github.com/example/repo/pull/4128"},ts:Date.now()}}),e})(),S={"simple-6way":{template:m,initialRounds:h,work:"Review src/util/divide.ts for production-readiness — six lineages, one pass, blockers welcome.",buildDataSource:function(){let e={currentParticipants:p.map(u)};return{createEventSource:()=>d(b,(n,t)=>{!function(e,n,t){if("participant_done"!==n)return;let i=t.agent;if(!i)return;let o=p.find(e=>e.agentName===i);o&&(e.currentParticipants=e.currentParticipants.map(e=>e.agentName===i?{participant:`reviewer-${o.agentName}`,role:"reviewer",agentName:o.agentName,lineage:o.lineage,hasAnswer:!0,answer:o.answer,durationMs:o.durationMs,model:o.model,binaryUsed:o.binaryUsed,modelUsed:o.model,usage:o.usage}:e))}(e,n,t)}),fetchArtifacts:()=>({rounds:[{round:1,participants:e.currentParticipants}]})}}},"complex-6way":{template:A,initialRounds:D,work:"feat(util): production-safe divide() — Plan → Spec → Implement → Verify → Ship • closes #4127",buildDataSource:function(){let e={currentPhaseIdx:0,currentParticipants:M()};return{createEventSource:()=>d(U,(n,t)=>{!function(e,n,t){if("phase_start"===n){let n=t.phaseIdx;"number"==typeof n&&n!==e.currentPhaseIdx&&(e.currentPhaseIdx=n,e.currentParticipants=M());return}if("participant_done"===n){let n=t.agent;if(!n)return;let i=T.findIndex(e=>e.agentName===n);if(i<0)return;let o=T[i],r=x[e.currentPhaseIdx];if(!r)return;let a=E(0===i?"doer":"reviewer",o,r.streams[i],r.usage[i]);e.currentParticipants=e.currentParticipants.map(e=>e.agentName===n?a:e);return}if("chat_done"===n){let n=x[x.length-1];e.currentParticipants=T.map((e,t)=>E(0===t?"doer":"reviewer",e,n.streams[t],n.usage[t])),e.currentPhaseIdx=x.length-1}}(e,n,t)}),fetchArtifacts:()=>({rounds:[{round:1,participants:e.currentParticipants}]})}}}};function R({params:e}){let{scenario:n}=(0,o.use)(e),t=S[n];t||(0,r.notFound)();let d=(0,o.useMemo)(()=>`demo-${n}-${Math.random().toString(36).slice(2,8)}`,[n]),c=(0,o.useMemo)(()=>t.buildDataSource(),[t]);return(0,i.jsx)(a.G,{children:(0,i.jsx)("div",{className:"mx-auto max-w-[1700px] px-6 py-6",children:(0,i.jsx)(s.LiveRunReal,{chatId:d,initialStatus:"reviewing",initialRounds:t.initialRounds,template:t.template,templateId:t.template.id,work:t.work,demoDataSource:c})})})}},6255:(e,n,t)=>{Promise.resolve().then(t.bind(t,5249))}},e=>{e.O(0,[249,832,641,344,245,506,128,358],()=>e(e.s=6255)),_N_E=e.O()}]);
@@ -1 +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:()=>l,x0:()=>u,ze:()=>s});let s={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi"},a={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-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"},d={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400"};function l(e){return e?i[e]??e:""}function c(e){return e?d[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:""};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"}}},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:()=>d});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 d({className:e,variant:t="default",asChild:r=!1,...a}){let l=r?n.bL:"span";return(0,s.jsx)(l,{"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),d=r(4372),l=r(6457),c=r(5702),u=r(6185),m=r(6441),x=r(862);function p({icon:e,label:t,value:r,wide:a,children:n}){let[o,d]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(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:()=>d(!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:()=>d(!1),children:n})]})]})}var g=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:d,isPending:l,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)(y,{billingMode:o,costEstimate:i,overCap:d,template:e}),(0,s.jsxs)("button",{type:"button",onClick:c,disabled:!t||d||l,className:`inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${!t||d||l?"cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:[l?"Starting...":a?"Send for review":"Start the run",(0,s.jsx)(g.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)(w,{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 w({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 y({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)(d.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,g]=(0,i.useTransition)(),[h,f]=(0,i.useState)([]),[b,j]=(0,i.useState)(null),[w,y]=(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=[],M=h.find(e=>e.id===$)??h[0],E=(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:M,prompt:C,attachments:R}),[C,R,M]),F=!!("subscription"!==N&&M?.costCapUsd&&M.costCapUsd>0&&E.usdRangeMax>M.costCapUsd),[L,P]=(0,i.useState)(!1),[A,T]=(0,i.useState)(""),O=(0,x.$)(M),G=O?M?.phases?.[0]?.artifact:void 0;async function z(){if(M&&C){if(O&&G){let e=new TextEncoder().encode(C).length;if(e>G.maxBytes)return void y(`Artifact is ${e.toLocaleString()} bytes; this template caps at ${G.maxBytes.toLocaleString()}. Trim it down.`)}y(null),g(async()=>{try{let e=A.trim(),r=await (0,u.RL)({work:O?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:M.id,files:R.length>0?R.map(e=>e.name):void 0,...O?{artifact:C}:{},...!O&&e.length>0?{repoPath:e}:{},yolo:L});t.push(`/runs/${r.slug||r.id}`)}catch(e){y(e instanceof u.$v?e.message:"Failed to create chat")}})}}return b?(0,s.jsx)(d.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})]})})}):M?(0,s.jsx)(d.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)(l.z,{eyebrow:"New chat",title:O?"Paste an artifact. Get reviews.":"Paste a task. Pick a template.",subtitle:O?"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."}),w&&(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:w})}),(0,s.jsx)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:(0,s.jsx)(p,{icon:(0,s.jsx)(a.A,{className:"h-3.5 w-3.5"}),label:"Template",value:M?.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:M,prompt:C,setPrompt:S,reviewOnly:O,artifactSpec:G,billingMode:N,costEstimate:E,overCap:F,isPending:r,onStart:z}),F&&(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:["$",E.usd.toFixed(3)]})," ","exceeds template cap"," ",(0,s.jsxs)("span",{className:"font-mono",children:["$",M.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 ${O?"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:O?"":A,onChange:e=>T(e.target.value),disabled:O,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:O?"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:()=>P(e=>!e),className:`mb-4 flex w-full items-start justify-between gap-3 rounded-lg border px-4 py-3 text-left transition ${L?"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 ${L?"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:L?"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 ${L?"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 ${L?"translate-x-4 bg-rose-400":"bg-muted-foreground/50"}`})})]})]})}):(0,s.jsx)(d.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,d=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]}),l=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return n(e,d,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,...l}[t]):({...i,...l})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},e=>{e.O(0,[116,832,641,344,506,128,358],()=>e(e.s=2919)),_N_E=e.O()}]);
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:()=>l,x0:()=>u,ze:()=>s});let s={anthropic:"Claude",openai:"Codex",google:"Gemini",opencode:"OpenCode",moonshot:"Kimi"},a={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-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"},d={claude:"bg-violet-400",codex:"bg-orange-400",gemini:"bg-blue-400",opencode:"bg-emerald-400",kimi:"bg-pink-400",openrouter:"bg-cyan-400"};function l(e){return e?i[e]??e:""}function c(e){return e?d[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:""};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"}}},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:()=>d});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 d({className:e,variant:t="default",asChild:r=!1,...a}){let l=r?n.bL:"span";return(0,s.jsx)(l,{"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),d=r(4372),l=r(6457),c=r(5702),u=r(6185),m=r(6441),x=r(862);function p({icon:e,label:t,value:r,wide:a,children:n}){let[o,d]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(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:()=>d(!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:()=>d(!1),children:n})]})]})}var g=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:d,isPending:l,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)(y,{billingMode:o,costEstimate:i,overCap:d,template:e}),(0,s.jsxs)("button",{type:"button",onClick:c,disabled:!t||d||l,className:`inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium transition ${!t||d||l?"cursor-not-allowed bg-muted text-muted-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:[l?"Starting...":a?"Send for review":"Start the run",(0,s.jsx)(g.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)(w,{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 w({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 y({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)(d.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,g]=(0,i.useTransition)(),[h,f]=(0,i.useState)([]),[b,j]=(0,i.useState)(null),[w,y]=(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=[],M=h.find(e=>e.id===$)??h[0],E=(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:M,prompt:C,attachments:R}),[C,R,M]),F=!!("subscription"!==N&&M?.costCapUsd&&M.costCapUsd>0&&E.usdRangeMax>M.costCapUsd),[L,P]=(0,i.useState)(!1),[A,T]=(0,i.useState)(""),O=(0,x.$)(M),G=O?M?.phases?.[0]?.artifact:void 0;async function z(){if(M&&C){if(O&&G){let e=new TextEncoder().encode(C).length;if(e>G.maxBytes)return void y(`Artifact is ${e.toLocaleString()} bytes; this template caps at ${G.maxBytes.toLocaleString()}. Trim it down.`)}y(null),g(async()=>{try{let e=A.trim(),r=await (0,u.RL)({work:O?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:M.id,files:R.length>0?R.map(e=>e.name):void 0,...O?{artifact:C}:{},...!O&&e.length>0?{repoPath:e}:{},yolo:L});t.push(`/runs/${r.slug||r.id}`)}catch(e){y(e instanceof u.$v?e.message:"Failed to create chat")}})}}return b?(0,s.jsx)(d.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})]})})}):M?(0,s.jsx)(d.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)(l.z,{eyebrow:"New chat",title:O?"Paste an artifact. Get reviews.":"Paste a task. Pick a template.",subtitle:O?"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."}),w&&(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:w})}),(0,s.jsx)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:(0,s.jsx)(p,{icon:(0,s.jsx)(a.A,{className:"h-3.5 w-3.5"}),label:"Template",value:M?.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:M,prompt:C,setPrompt:S,reviewOnly:O,artifactSpec:G,billingMode:N,costEstimate:E,overCap:F,isPending:r,onStart:z}),F&&(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:["$",E.usd.toFixed(3)]})," ","exceeds template cap"," ",(0,s.jsxs)("span",{className:"font-mono",children:["$",M.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 ${O?"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:O?"":A,onChange:e=>T(e.target.value),disabled:O,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:O?"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:()=>P(e=>!e),className:`mb-4 flex w-full items-start justify-between gap-3 rounded-lg border px-4 py-3 text-left transition ${L?"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 ${L?"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:L?"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 ${L?"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 ${L?"translate-x-4 bg-rose-400":"bg-muted-foreground/50"}`})})]})]})}):(0,s.jsx)(d.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,d=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]}),l=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return n(e,d,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,...l}[t]):({...i,...l})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}},e=>{e.O(0,[249,832,641,344,506,128,358],()=>e(e.s=2919)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[566],{63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>i});var a=r(9442);r(6074);var n=r(7362);function i({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)=>{"use strict";r.d(t,{$:()=>o});var a=r(9442);r(6074);var n=r(9056),i=r(8113),s=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 o({className:e,variant:t="default",size:r="default",asChild:n=!1,...l}){let c=n?i.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:()=>$});var a=r(9442),n=r(3149),i=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),x=r(7362);function g({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,x.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??"",[i,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"!==i.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)(g,{id:"apikey-openrouter",type:"password",autoComplete:"off",spellCheck:!1,placeholder:"sk-or-v1-…",value:r,onChange:e=>{t("openrouter",e.target.value),"idle"!==i.kind&&s({kind:"idle"}),l(null)},className:"flex-1 font-mono text-xs",disabled:"saving"===i.kind||"loading_catalog"===i.kind}),(0,a.jsxs)("button",{type:"button",onClick:C,disabled:0===r.trim().length||"saving"===i.kind||"loading_catalog"===i.kind||"valid"===i.kind,className:(0,x.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"===i.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"===i.kind||"loading_catalog"===i.kind)&&(0,a.jsx)(n.A,{className:"h-3 w-3 animate-spin"}),"valid"===i.kind&&(0,a.jsx)(b.A,{className:"h-3 w-3"}),"saving"===i.kind?"Validating…":"loading_catalog"===i.kind?"Loading models…":"valid"===i.kind?"Validated":"Validate & save"]})]}),"invalid"===i.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"}),i.message]}),"catalog_failed"===i.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:"," ",i.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"===i.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 ",i.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,x.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)(n.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:"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),i=e.detection[t.id],s=i?.found===!0,d=e.detecting&&!i,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,x.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,x.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,x.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,x.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)(n.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&&i.path?(0,a.jsx)("code",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono",children:i.path}):d?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,a.jsx)(n.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)(M,{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)(_,{loading:e.opencodeModelsLoading,error:e.opencodeModelsError,models:e.opencodeModels,selected:e.selectedOpencodeModels,onToggle:e.toggleOpencodeModel}),s&&"opencode-cli"!==t.id&&r&&(0,a.jsx)(O,{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 O({cliId:e,voices:t,savingVoiceIds:r,saveError:n,onToggle:i}){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"]})]}),n&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:n}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1",children:d.map(e=>{let t=e.enabled,n=e.id===s;return(0,a.jsxs)("button",{type:"button",disabled:r.has(e.id),onClick:()=>i(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 text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.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,a.jsx)(b.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:e.model_id}),n&&(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 _({loading:e,error:t,models:r,selected:i,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:[i.size," selected"]})]}),e&&(0,a.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)(n.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=i.has(t);return(0,a.jsxs)("button",{type:"button",onClick:()=>s(t),title:t,className:(0,x.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,x.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 M({cliId:e,value:t,onChange:r,error:i,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";default:return"kimi"}}(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)(g,{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)(n.A,{className:"h-4 w-4 animate-spin"}):"Verify"})]}),i&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:i})]})}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:n,networkAccess:i,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 n=e===r.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.id),className:(0,x.cn)("flex w-full items-start gap-3 rounded-lg border p-4 text-left transition",n?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,x.cn)("mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full border transition",n?"border-primary bg-primary text-primary-foreground":"border-border"),children:n&&(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=>n(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:i,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 E=r(6185);async function V(e){for(let t of e.selectedClis){let e=w.find(e=>e.id===t);e&&await (0,E.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,E.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 L(e),await (0,E.Xx)({onboarded:!0})}async function L(e){let{listVoices:t,updateVoice:a,createVoice:n}=await Promise.resolve().then(r.bind(r,7847)),i=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=i.get(r);try{if(d)d.enabled!==s&&await a(r,{enabled:s});else{let e,r,{lineage:a,vendor_family:i}=(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 n({provider:"opencode-cli",model_id:t,label:t,source:"cli",lineage:a,vendor_family:i,enabled:s})}}catch{}}))}function $(){let e=(0,s.useRouter)(),[t,r]=(0,d.useTransition)(),[p,x]=(0,d.useState)(null),[g,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"),[O,_]=(0,d.useState)(!0),[M,I]=(0,d.useState)(!1),[L,$]=(0,d.useState)({}),[T,R]=(0,d.useState)(!0),[W,D]=(0,d.useState)(new Set),[G,K]=(0,d.useState)({}),[q,F]=(0,d.useState)({}),[Y,H]=(0,d.useState)(new Set),[J,U]=(0,d.useState)(null),[B,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);$(r),a.size>0&&h(a)}).catch(()=>{}).finally(()=>{e||R(!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)(()=>{!g.has("opencode-cli")||!L["opencode-cli"]?.found||J||Q||B||(X(!0),Z(null),(0,u.Ay)().then(e=>{U(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)))},[g,L,J,Q,B]);let ea=async e=>{let t=(G[e]||"").trim();if(!t)return void F(t=>({...t,[e]:"Enter the full path to the CLI program (e.g. /usr/local/bin/claude)."}));H(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}$(t=>({...t,[e]:r})),h(t=>new Set(t).add(e)),(0,m.listVoices)({source:"cli"}).then(f).catch(()=>{}),D(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{H(t=>{let r=new Set(t);return r.delete(e),r})}},en=g.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:g,toggleCli:e=>{h(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},detection:L,detecting:T,cliVoices:b,savingVoiceIds:v,voiceSaveError:j,toggleVoice:er,manualOpen:W,toggleManual:e=>{D(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),F(t=>({...t,[e]:""}))},manualPath:G,setManualPath:K,manualError:q,manualBusy:Y,submitManualPath:ea,opencodeModels:J,opencodeModelsError:B,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:O,setAutoApprovePrompts:_,networkAccess:M,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===en?"Pick at least one to continue.":`${en} ${1===en?"credential":"credentials"} ready to save.`}),(0,a.jsx)(l.$,{onClick:()=>{(x(null),0===en)?x("Pick at least one CLI or paste at least one API key to continue."):r(async()=>{try{await V({selectedClis:g,apiKeys:N,sandboxProfile:S,autoApprovePrompts:O,networkAccess:M,opencodeModels:J,selectedOpencodeModels:ee}),e.push("/"),e.refresh()}catch(e){x(e instanceof E.$v?e.message:"Could not save. Is the Chorus daemon running?")}})},disabled:t||0===en,className:"w-full sm:w-auto",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.A,{className:"mr-1 h-4 w-4 animate-spin"}),"Saving…"]}):(0,a.jsxs)(a.Fragment,{children:["Get started",(0,a.jsx)(i.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:()=>n,Y8:()=>i});var a=r(4411);async function n(e){return(0,a.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function i(){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:()=>i,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"},n={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400"};function i(e){return e?a[e]??e:""}function s(e){return e?n[e]??"bg-muted":"bg-muted"}let d={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter"},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"};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:""};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"}}},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 n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=a.$,s=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return i(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 i=n(t)||n(a);return s[e][i]}),l=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return i(e,o,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...n}=t;return Object.entries(n).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,[116,641,506,128,358],()=>e(e.s=8600)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[566],{63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>i});var a=r(9442);r(6074);var n=r(7362);function i({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)=>{"use strict";r.d(t,{$:()=>o});var a=r(9442);r(6074);var n=r(9056),i=r(8113),s=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 o({className:e,variant:t="default",size:r="default",asChild:n=!1,...l}){let c=n?i.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:()=>$});var a=r(9442),n=r(3149),i=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),x=r(7362);function g({className:e,type:t,...r}){return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,x.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??"",[i,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"!==i.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)(g,{id:"apikey-openrouter",type:"password",autoComplete:"off",spellCheck:!1,placeholder:"sk-or-v1-…",value:r,onChange:e=>{t("openrouter",e.target.value),"idle"!==i.kind&&s({kind:"idle"}),l(null)},className:"flex-1 font-mono text-xs",disabled:"saving"===i.kind||"loading_catalog"===i.kind}),(0,a.jsxs)("button",{type:"button",onClick:C,disabled:0===r.trim().length||"saving"===i.kind||"loading_catalog"===i.kind||"valid"===i.kind,className:(0,x.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"===i.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"===i.kind||"loading_catalog"===i.kind)&&(0,a.jsx)(n.A,{className:"h-3 w-3 animate-spin"}),"valid"===i.kind&&(0,a.jsx)(b.A,{className:"h-3 w-3"}),"saving"===i.kind?"Validating…":"loading_catalog"===i.kind?"Loading models…":"valid"===i.kind?"Validated":"Validate & save"]})]}),"invalid"===i.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"}),i.message]}),"catalog_failed"===i.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:"," ",i.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"===i.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 ",i.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,x.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)(n.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:"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),i=e.detection[t.id],s=i?.found===!0,d=e.detecting&&!i,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,x.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,x.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,x.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,x.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)(n.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&&i.path?(0,a.jsx)("code",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono",children:i.path}):d?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,a.jsx)(n.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)(M,{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)(_,{loading:e.opencodeModelsLoading,error:e.opencodeModelsError,models:e.opencodeModels,selected:e.selectedOpencodeModels,onToggle:e.toggleOpencodeModel}),s&&"opencode-cli"!==t.id&&r&&(0,a.jsx)(O,{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 O({cliId:e,voices:t,savingVoiceIds:r,saveError:n,onToggle:i}){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"]})]}),n&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:n}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-1",children:d.map(e=>{let t=e.enabled,n=e.id===s;return(0,a.jsxs)("button",{type:"button",disabled:r.has(e.id),onClick:()=>i(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 text-muted-foreground hover:border-muted-foreground/30"),children:[(0,a.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,a.jsx)(b.A,{className:"h-2 w-2"})}),(0,a.jsx)("span",{className:"truncate font-mono",children:e.model_id}),n&&(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 _({loading:e,error:t,models:r,selected:i,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:[i.size," selected"]})]}),e&&(0,a.jsxs)("p",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)(n.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=i.has(t);return(0,a.jsxs)("button",{type:"button",onClick:()=>s(t),title:t,className:(0,x.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,x.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 M({cliId:e,value:t,onChange:r,error:i,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";default:return"kimi"}}(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)(g,{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)(n.A,{className:"h-4 w-4 animate-spin"}):"Verify"})]}),i&&(0,a.jsx)("p",{className:"text-[11px] text-destructive",children:i})]})}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:n,networkAccess:i,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 n=e===r.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.id),className:(0,x.cn)("flex w-full items-start gap-3 rounded-lg border p-4 text-left transition",n?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"),children:[(0,a.jsx)("div",{className:(0,x.cn)("mt-0.5 grid h-5 w-5 shrink-0 place-items-center rounded-full border transition",n?"border-primary bg-primary text-primary-foreground":"border-border"),children:n&&(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=>n(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:i,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 E=r(6185);async function V(e){for(let t of e.selectedClis){let e=w.find(e=>e.id===t);e&&await (0,E.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,E.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 L(e),await (0,E.Xx)({onboarded:!0})}async function L(e){let{listVoices:t,updateVoice:a,createVoice:n}=await Promise.resolve().then(r.bind(r,7847)),i=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=i.get(r);try{if(d)d.enabled!==s&&await a(r,{enabled:s});else{let e,r,{lineage:a,vendor_family:i}=(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 n({provider:"opencode-cli",model_id:t,label:t,source:"cli",lineage:a,vendor_family:i,enabled:s})}}catch{}}))}function $(){let e=(0,s.useRouter)(),[t,r]=(0,d.useTransition)(),[p,x]=(0,d.useState)(null),[g,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"),[O,_]=(0,d.useState)(!0),[M,I]=(0,d.useState)(!1),[L,$]=(0,d.useState)({}),[T,R]=(0,d.useState)(!0),[W,D]=(0,d.useState)(new Set),[G,K]=(0,d.useState)({}),[q,F]=(0,d.useState)({}),[Y,H]=(0,d.useState)(new Set),[J,U]=(0,d.useState)(null),[B,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);$(r),a.size>0&&h(a)}).catch(()=>{}).finally(()=>{e||R(!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)(()=>{!g.has("opencode-cli")||!L["opencode-cli"]?.found||J||Q||B||(X(!0),Z(null),(0,u.Ay)().then(e=>{U(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)))},[g,L,J,Q,B]);let ea=async e=>{let t=(G[e]||"").trim();if(!t)return void F(t=>({...t,[e]:"Enter the full path to the CLI program (e.g. /usr/local/bin/claude)."}));H(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}$(t=>({...t,[e]:r})),h(t=>new Set(t).add(e)),(0,m.listVoices)({source:"cli"}).then(f).catch(()=>{}),D(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{H(t=>{let r=new Set(t);return r.delete(e),r})}},en=g.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:g,toggleCli:e=>{h(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},detection:L,detecting:T,cliVoices:b,savingVoiceIds:v,voiceSaveError:j,toggleVoice:er,manualOpen:W,toggleManual:e=>{D(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),F(t=>({...t,[e]:""}))},manualPath:G,setManualPath:K,manualError:q,manualBusy:Y,submitManualPath:ea,opencodeModels:J,opencodeModelsError:B,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:O,setAutoApprovePrompts:_,networkAccess:M,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===en?"Pick at least one to continue.":`${en} ${1===en?"credential":"credentials"} ready to save.`}),(0,a.jsx)(l.$,{onClick:()=>{(x(null),0===en)?x("Pick at least one CLI or paste at least one API key to continue."):r(async()=>{try{await V({selectedClis:g,apiKeys:N,sandboxProfile:S,autoApprovePrompts:O,networkAccess:M,opencodeModels:J,selectedOpencodeModels:ee}),e.push("/"),e.refresh()}catch(e){x(e instanceof E.$v?e.message:"Could not save. Is the Chorus daemon running?")}})},disabled:t||0===en,className:"w-full sm:w-auto",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.A,{className:"mr-1 h-4 w-4 animate-spin"}),"Saving…"]}):(0,a.jsxs)(a.Fragment,{children:["Get started",(0,a.jsx)(i.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:()=>n,Y8:()=>i});var a=r(4411);async function n(e){return(0,a.T)("/openrouter/save-key",{method:"POST",body:JSON.stringify({apiKey:e})})}async function i(){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:()=>i,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"},n={anthropic:"bg-violet-400",openai:"bg-orange-400",google:"bg-blue-400",opencode:"bg-emerald-400",moonshot:"bg-pink-400"};function i(e){return e?a[e]??e:""}function s(e){return e?n[e]??"bg-muted":"bg-muted"}let d={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",kimi:"Kimi",openrouter:"OpenRouter"},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"};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:""};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"}}},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 n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=a.$,s=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return i(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 i=n(t)||n(a);return s[e][i]}),l=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return i(e,o,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...n}=t;return Object.entries(n).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,[249,641,506,128,358],()=>e(e.s=8600)),_N_E=e.O()}]);