chorus-codes 0.8.25 → 0.8.27

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 (162) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +4 -4
  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 +4 -4
  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/325.js +1 -1
  101. package/.next/server/chunks/681.js +1 -1
  102. package/.next/server/middleware-build-manifest.js +1 -1
  103. package/.next/server/pages/404.html +1 -1
  104. package/.next/server/pages/500.html +1 -1
  105. package/.next/server/server-reference-manifest.json +1 -1
  106. package/.next/static/chunks/{245-e103518e1c6037c0.js → 245-203bd8285e6b0858.js} +1 -1
  107. package/.next/static/chunks/249-2e840495c38ee022.js +25 -0
  108. package/.next/static/chunks/641-2908cb9553b8753a.js +1 -0
  109. package/.next/static/chunks/690-092c26db4082d49a.js +1 -0
  110. package/.next/static/chunks/app/connect/{page-a3a0af374f90ad4c.js → page-ad4409761e870bd0.js} +1 -1
  111. package/.next/static/chunks/app/demo/[scenario]/{page-6a0e4aec4bb96fee.js → page-39673968f543c473.js} +1 -1
  112. package/.next/static/chunks/app/new/{page-b96d75506030acf8.js → page-b5f609ab9413ac00.js} +1 -1
  113. package/.next/static/chunks/app/onboarding/{page-4be5a1d944e32672.js → page-8b0850fef487abdc.js} +1 -1
  114. package/.next/static/chunks/app/{page-35375a7c8b3d117a.js → page-9bdbaad592d0ce56.js} +1 -1
  115. package/.next/static/chunks/app/personas/{page-3884f8907107a4e6.js → page-440c6033a773100c.js} +1 -1
  116. package/.next/static/chunks/app/runs/[runId]/{page-b5bcf0c093389207.js → page-ffc36f12f1b63ebe.js} +1 -1
  117. package/.next/static/chunks/app/runs/{page-376175c1ac803558.js → page-6962ea572c9e4b74.js} +1 -1
  118. package/.next/static/chunks/app/settings/page-ad7180ee0d142704.js +25 -0
  119. package/.next/static/chunks/app/settings/permissions/{page-c90795aa9299bbe8.js → page-cd767401ac71a29c.js} +1 -1
  120. package/.next/static/chunks/app/templates/page-0112ab3c7ab5185d.js +1 -0
  121. package/.next/static/css/df4972a256406ec7.css +3 -0
  122. package/.next/trace +20 -20
  123. package/.next/trace-build +1 -1
  124. package/README.md +22 -0
  125. package/bin/chorus.mjs +87 -5
  126. package/dist/cli/commands/diagnose.js +255 -0
  127. package/dist/cli/commands/diagnose.js.map +1 -0
  128. package/dist/cli/crash-hook.js +135 -0
  129. package/dist/cli/crash-hook.js.map +1 -0
  130. package/dist/cli/index.js +2 -0
  131. package/dist/cli/index.js.map +1 -1
  132. package/dist/daemon/cli-semaphore.js +266 -0
  133. package/dist/daemon/cli-semaphore.js.map +1 -0
  134. package/dist/daemon/routes/settings.js +39 -0
  135. package/dist/daemon/routes/settings.js.map +1 -1
  136. package/dist/daemon/runner/doer-driver.js +243 -214
  137. package/dist/daemon/runner/doer-driver.js.map +1 -1
  138. package/dist/daemon/runner/fallback-registry.js +110 -0
  139. package/dist/daemon/runner/fallback-registry.js.map +1 -0
  140. package/dist/daemon/runner/reviewer-driver.js +345 -256
  141. package/dist/daemon/runner/reviewer-driver.js.map +1 -1
  142. package/dist/daemon/runner/template-fallback.js +22 -8
  143. package/dist/daemon/runner/template-fallback.js.map +1 -1
  144. package/dist/daemon/runner.js +19 -0
  145. package/dist/daemon/runner.js.map +1 -1
  146. package/dist/lib/db/chats.js +28 -0
  147. package/dist/lib/db/chats.js.map +1 -1
  148. package/dist/lib/db/connection.js +6 -0
  149. package/dist/lib/db/connection.js.map +1 -1
  150. package/dist/lib/db/schema.sql +6 -0
  151. package/dist/lib/settings/concurrency.js +101 -0
  152. package/dist/lib/settings/concurrency.js.map +1 -0
  153. package/package.json +1 -1
  154. package/.next/server/chunks/946.js +0 -1
  155. package/.next/static/chunks/116-8bf7e014066cedde.js +0 -25
  156. package/.next/static/chunks/15-d438a2b057302bed.js +0 -1
  157. package/.next/static/chunks/641-60721f44faf711b9.js +0 -1
  158. package/.next/static/chunks/app/settings/page-1792a3e289409b2d.js +0 -25
  159. package/.next/static/chunks/app/templates/page-1449b0aea2e7cb68.js +0 -1
  160. package/.next/static/css/d2bb161eb5bee944.css +0 -3
  161. /package/.next/static/{47MSfijpKVM6q0E0ye9Mr → p1K3tWuW1MBx6L7K5jGPV}/_buildManifest.js +0 -0
  162. /package/.next/static/{47MSfijpKVM6q0E0ye9Mr → p1K3tWuW1MBx6L7K5jGPV}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1195:(e,t,r)=>{"use strict";r.d(t,{OpencodeFleetCard:()=>x});var s=r(9442),n=r(6074),d=r(5445),a=r(9707),i=r(4030),o=r(2956),l=r(3734),c=r(7847),m=r(4411),u=r(7362);function x({health:e,voices:t}){let[r,i]=(0,n.useState)(!1),[o,g]=(0,n.useState)(t),[h,b]=(0,n.useState)(null),[f,v]=(0,n.useState)(null);async function y(e){v(e.id),b(null);try{let t=await (0,c.updateVoice)(e.id,{enabled:!e.enabled});g(e=>e.map(e=>e.id===t.id?t:e))}catch(e){b(e instanceof m.$?e.message:"Couldn't save. Is the daemon running?")}finally{v(null)}}let N=new Map;for(let e of o){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",s=N.get(r)??[];s.push(e),N.set(r,s)}let j=Array.from(N.keys()).sort(),k=o.filter(e=>e.enabled).length;return(0,s.jsxs)("div",{className:(0,u.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",l.r2.opencode.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",l.r2.opencode.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"OpenCode"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,s.jsx)(p,{status:e.status}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[k," model",1===k?"":"s"," enabled"]})]})]}),(0,s.jsx)(d.A,{className:(0,u.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",r&&"rotate-180")})]}),r&&(0,s.jsxs)("div",{className:"space-y-3 border-t border-border bg-card/50 p-3",children:[h&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:h}),0===o.length?(0,s.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["No OpenCode voices detected yet. Run ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"opencode models"})," ","and restart the daemon."]}):(0,s.jsxs)("div",{className:"space-y-3",children:[j.map(e=>{let t=N.get(e)??[];return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-[11px] font-mono text-muted-foreground/80",children:[e,"/"]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(t=>{let r=t.enabled,n=t.model_id.slice(e.length+1);return(0,s.jsxs)("button",{type:"button",disabled:f===t.id,onClick:()=>y(t),title:t.model_id,className:(0,u.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",r?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,s.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,s.jsx)(a.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:n})]},t.id)})})]},e)}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Templates and the New Chat dialog will only offer models you've enabled here."})]})]})]})}function p({status:e}){switch(e){case"auth_invalid":case"quota_exhausted":case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"auth_invalid"===e?"Auth broken":"quota_exhausted"===e?"Quota out":"Rate-limited"]});default:return(0,s.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,s.jsx)(o.A,{className:"h-3 w-3"}),"Connected"]})}}},2956:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>d,VW:()=>a,YM:()=>u,m_:()=>i,r2:()=>x,u5:()=>l,x0:()=>m,ze:()=>s});let s={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 d(e){return e?s[e]??e:""}function a(e){return e?n[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 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"}}},3761:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},5445:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},5626:(e,t,r)=>{Promise.resolve().then(r.bind(r,6501)),Promise.resolve().then(r.t.bind(r,2573,23)),Promise.resolve().then(r.bind(r,821)),Promise.resolve().then(r.bind(r,9823)),Promise.resolve().then(r.bind(r,8344)),Promise.resolve().then(r.bind(r,1195)),Promise.resolve().then(r.bind(r,8359))},6289:(e,t,r)=>{"use strict";r.d(t,{A:()=>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"}]])},8359:(e,t,r)=>{"use strict";r.d(t,{OpenRouterFleetCard:()=>b});var s=r(9442),n=r(6074),d=r(2573),a=r.n(d),i=r(5445),o=r(4030),l=r(6289),c=r(9707),m=r(3761),u=r(2956),x=r(3734),p=r(7847),g=r(4411),h=r(7362);function b({voices:e,health:t}){let r=t?.status==="auth_invalid",[d,f]=(0,n.useState)(r),[v,y]=(0,n.useState)(e),[N,j]=(0,n.useState)(null),[k,w]=(0,n.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,p.updateVoice)(e.id,{enabled:!e.enabled});y(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof g.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=v.filter(e=>e.enabled).length;return(0,s.jsxs)("div",{className:(0,h.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",x.r2.openrouter.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,h.cn)("h-2 w-2 shrink-0 rounded-full",x.r2.openrouter.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"OpenRouter"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[function(e){switch(e){case"quota_exhausted":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Credits out"]});case"auth_invalid":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Auth broken"]});case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,s.jsx)(m.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,s.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,s.jsx)(u.A,{className:"h-3 w-3"}),"Configured"]})}}(t?.status??"healthy"),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,s.jsx)(i.A,{className:(0,h.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",d&&"rotate-180")})]}),d&&(0,s.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[r&&(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2.5",children:[(0,s.jsx)(o.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-destructive",children:["OpenRouter rejected the saved API key",t?.message?`: ${t.message}`:"."]}),(0,s.jsxs)(a(),{href:"/connect",className:"inline-flex items-center gap-1 rounded border border-destructive/50 bg-destructive/10 px-2 py-1 text-[11px] font-medium text-destructive transition hover:bg-destructive/20",children:["Fix on Connect",(0,s.jsx)(l.A,{className:"h-3 w-3"})]})]})]}),N&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===v.length?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No OpenRouter voices yet. Add some on the Connect page."}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1",children:v.map(e=>(0,s.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,h.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,s.jsx)("div",{className:(0,h.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,s.jsx)(c.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),!r&&(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Add or replace your API key on Connect. Toggles save automatically."})]})]})}},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9823:(e,t,r)=>{"use strict";r.d(t,{LineageFleetCard:()=>h});var s=r(9442),n=r(6074),d=r(5445),a=r(9707),i=r(4030),o=r(3761),l=r(2956),c=r(3734),m=r(7847),u=r(4411),x=r(7362);let p={anthropic:"claude",openai:"codex",google:"gemini",opencode:"opencode",moonshot:"kimi"},g={dot:"bg-muted-foreground/40",gradient:"bg-gradient-to-br from-muted/30 via-card to-card"};function h({lineage:e,label:t,voices:r,health:i}){let o,[l,f]=(0,n.useState)(!1),[v,y]=(0,n.useState)(r),[N,j]=(0,n.useState)(null),[k,w]=(0,n.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,m.updateVoice)(e.id,{enabled:!e.enabled});y(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof u.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=v.filter(e=>e.enabled).length,_=(o=p[e])?c.r2[o]:g;return(0,s.jsxs)("div",{className:(0,x.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",_.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,x.cn)("h-2 w-2 shrink-0 rounded-full",_.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:t}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,s.jsx)(b,{status:i.status}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,s.jsx)(d.A,{className:(0,x.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",l&&"rotate-180")})]}),l&&(0,s.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[N&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===v.length?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No voices detected for this provider yet."}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1",children:v.map(e=>{let t=e.enabled;return(0,s.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,x.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",t?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,s.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,s.jsx)(a.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id)})}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Voice list is curated per chorus release — new models appear after upgrades."})]})]})}function b({status:e}){switch(e){case"auth_invalid":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Auth broken"]});case"quota_exhausted":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Quota out"]});case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,s.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,s.jsx)(l.A,{className:"h-3 w-3"}),"Connected"]})}}}},e=>{e.O(0,[116,832,641,344,506,128,358],()=>e(e.s=5626)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1195:(e,t,r)=>{"use strict";r.d(t,{OpencodeFleetCard:()=>x});var s=r(9442),n=r(6074),d=r(5445),a=r(9707),i=r(4030),o=r(2956),l=r(3734),c=r(7847),m=r(4411),u=r(7362);function x({health:e,voices:t}){let[r,i]=(0,n.useState)(!1),[o,g]=(0,n.useState)(t),[h,b]=(0,n.useState)(null),[f,v]=(0,n.useState)(null);async function y(e){v(e.id),b(null);try{let t=await (0,c.updateVoice)(e.id,{enabled:!e.enabled});g(e=>e.map(e=>e.id===t.id?t:e))}catch(e){b(e instanceof m.$?e.message:"Couldn't save. Is the daemon running?")}finally{v(null)}}let N=new Map;for(let e of o){let t=e.model_id.indexOf("/"),r=t>0?e.model_id.slice(0,t):"other",s=N.get(r)??[];s.push(e),N.set(r,s)}let j=Array.from(N.keys()).sort(),k=o.filter(e=>e.enabled).length;return(0,s.jsxs)("div",{className:(0,u.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",l.r2.opencode.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,u.cn)("h-2 w-2 shrink-0 rounded-full",l.r2.opencode.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"OpenCode"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,s.jsx)(p,{status:e.status}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[k," model",1===k?"":"s"," enabled"]})]})]}),(0,s.jsx)(d.A,{className:(0,u.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",r&&"rotate-180")})]}),r&&(0,s.jsxs)("div",{className:"space-y-3 border-t border-border bg-card/50 p-3",children:[h&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:h}),0===o.length?(0,s.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["No OpenCode voices detected yet. Run ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"opencode models"})," ","and restart the daemon."]}):(0,s.jsxs)("div",{className:"space-y-3",children:[j.map(e=>{let t=N.get(e)??[];return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-[11px] font-mono text-muted-foreground/80",children:[e,"/"]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:t.map(t=>{let r=t.enabled,n=t.model_id.slice(e.length+1);return(0,s.jsxs)("button",{type:"button",disabled:f===t.id,onClick:()=>y(t),title:t.model_id,className:(0,u.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",r?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,s.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,s.jsx)(a.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:n})]},t.id)})})]},e)}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Templates and the New Chat dialog will only offer models you've enabled here."})]})]})]})}function p({status:e}){switch(e){case"auth_invalid":case"quota_exhausted":case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"auth_invalid"===e?"Auth broken":"quota_exhausted"===e?"Quota out":"Rate-limited"]});default:return(0,s.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,s.jsx)(o.A,{className:"h-3 w-3"}),"Connected"]})}}},2956:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3734:(e,t,r)=>{"use strict";r.d(t,{JR:()=>c,QJ:()=>d,VW:()=>a,YM:()=>u,m_:()=>i,r2:()=>x,u5:()=>l,x0:()=>m,ze:()=>s});let s={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 d(e){return e?s[e]??e:""}function a(e){return e?n[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 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"}}},3761:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},5445:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},5626:(e,t,r)=>{Promise.resolve().then(r.bind(r,6501)),Promise.resolve().then(r.t.bind(r,2573,23)),Promise.resolve().then(r.bind(r,821)),Promise.resolve().then(r.bind(r,9823)),Promise.resolve().then(r.bind(r,8344)),Promise.resolve().then(r.bind(r,1195)),Promise.resolve().then(r.bind(r,8359))},6289:(e,t,r)=>{"use strict";r.d(t,{A:()=>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"}]])},8359:(e,t,r)=>{"use strict";r.d(t,{OpenRouterFleetCard:()=>b});var s=r(9442),n=r(6074),d=r(2573),a=r.n(d),i=r(5445),o=r(4030),l=r(6289),c=r(9707),m=r(3761),u=r(2956),x=r(3734),p=r(7847),g=r(4411),h=r(7362);function b({voices:e,health:t}){let r=t?.status==="auth_invalid",[d,f]=(0,n.useState)(r),[v,y]=(0,n.useState)(e),[N,j]=(0,n.useState)(null),[k,w]=(0,n.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,p.updateVoice)(e.id,{enabled:!e.enabled});y(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof g.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=v.filter(e=>e.enabled).length;return(0,s.jsxs)("div",{className:(0,h.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",x.r2.openrouter.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,h.cn)("h-2 w-2 shrink-0 rounded-full",x.r2.openrouter.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"OpenRouter"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[function(e){switch(e){case"quota_exhausted":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Credits out"]});case"auth_invalid":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Auth broken"]});case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,s.jsx)(m.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,s.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,s.jsx)(u.A,{className:"h-3 w-3"}),"Configured"]})}}(t?.status??"healthy"),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,s.jsx)(i.A,{className:(0,h.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",d&&"rotate-180")})]}),d&&(0,s.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[r&&(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2.5",children:[(0,s.jsx)(o.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,s.jsxs)("p",{className:"text-[11px] leading-relaxed text-destructive",children:["OpenRouter rejected the saved API key",t?.message?`: ${t.message}`:"."]}),(0,s.jsxs)(a(),{href:"/connect",className:"inline-flex items-center gap-1 rounded border border-destructive/50 bg-destructive/10 px-2 py-1 text-[11px] font-medium text-destructive transition hover:bg-destructive/20",children:["Fix on Connect",(0,s.jsx)(l.A,{className:"h-3 w-3"})]})]})]}),N&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===v.length?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No OpenRouter voices yet. Add some on the Connect page."}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1",children:v.map(e=>(0,s.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,h.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,s.jsx)("div",{className:(0,h.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,s.jsx)(c.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id))}),!r&&(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Add or replace your API key on Connect. Toggles save automatically."})]})]})}},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9823:(e,t,r)=>{"use strict";r.d(t,{LineageFleetCard:()=>h});var s=r(9442),n=r(6074),d=r(5445),a=r(9707),i=r(4030),o=r(3761),l=r(2956),c=r(3734),m=r(7847),u=r(4411),x=r(7362);let p={anthropic:"claude",openai:"codex",google:"gemini",opencode:"opencode",moonshot:"kimi"},g={dot:"bg-muted-foreground/40",gradient:"bg-gradient-to-br from-muted/30 via-card to-card"};function h({lineage:e,label:t,voices:r,health:i}){let o,[l,f]=(0,n.useState)(!1),[v,y]=(0,n.useState)(r),[N,j]=(0,n.useState)(null),[k,w]=(0,n.useState)(null);async function A(e){w(e.id),j(null);try{let t=await (0,m.updateVoice)(e.id,{enabled:!e.enabled});y(e=>e.map(e=>e.id===t.id?t:e))}catch(e){j(e instanceof u.$?e.message:"Couldn't save. Is the daemon running?")}finally{w(null)}}let C=v.filter(e=>e.enabled).length,_=(o=p[e])?c.r2[o]:g;return(0,s.jsxs)("div",{className:(0,x.cn)("rounded-lg border border-border transition-colors hover:border-foreground/20",_.gradient),children:[(0,s.jsxs)("button",{type:"button",onClick:()=>f(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:(0,x.cn)("h-2 w-2 shrink-0 rounded-full",_.dot)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:t}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,s.jsx)(b,{status:i.status}),(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[C," model",1===C?"":"s"," enabled"]})]})]}),(0,s.jsx)(d.A,{className:(0,x.cn)("h-4 w-4 shrink-0 text-muted-foreground transition-transform",l&&"rotate-180")})]}),l&&(0,s.jsxs)("div",{className:"space-y-2 border-t border-border bg-card/50 p-3",children:[N&&(0,s.jsx)("p",{className:"text-[11px] text-destructive",children:N}),0===v.length?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No voices detected for this provider yet."}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-1",children:v.map(e=>{let t=e.enabled;return(0,s.jsxs)("button",{type:"button",disabled:k===e.id,onClick:()=>A(e),title:e.model_id,className:(0,x.cn)("flex items-center gap-2 rounded border px-2 py-1.5 text-left text-[11px] transition disabled:opacity-60",t?"border-primary/50 bg-primary/10 text-foreground":"border-border bg-card hover:border-muted-foreground/30 text-muted-foreground"),children:[(0,s.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,s.jsx)(a.A,{className:"h-2 w-2"})}),(0,s.jsx)("span",{className:"truncate font-mono",children:e.model_id})]},e.id)})}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:"Toggles save automatically. Voice list is curated per chorus release — new models appear after upgrades."})]})]})}function b({status:e}){switch(e){case"auth_invalid":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Auth broken"]});case"quota_exhausted":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,s.jsx)(i.A,{className:"h-3 w-3"}),"Quota out"]});case"rate_limited":return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-300",children:[(0,s.jsx)(o.A,{className:"h-3 w-3"}),"Rate-limited"]});default:return(0,s.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,s.jsx)(l.A,{className:"h-3 w-3"}),"Connected"]})}}}},e=>{e.O(0,[249,832,641,344,506,128,358],()=>e(e.s=5626)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[406],{2956:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},4052:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},4696:(e,t,r)=>{Promise.resolve().then(r.bind(r,5921))},5921:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>D});var s=r(9442),n=r(6074),a=r(3149);let l=(0,r(3884).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var i=r(8420),d=r(4052),o=r(4372),c=r(63),u=r(5702),m=r(6457),p=r(8191),x=r(9315),h=r(6458),b=r(6891),f=r(1853),g=r(6185),v=r(4030),y=r(7362),j=r(3734);let w=/^[a-z0-9][a-z0-9-]{1,63}$/,N=[{value:"",label:"No preference"},{value:"anthropic",label:j.ze.anthropic},{value:"openai",label:j.ze.openai},{value:"google",label:j.ze.google},{value:"opencode",label:j.ze.opencode},{value:"moonshot",label:j.ze.moonshot}],k={id:"",label:"",one_liner:"",recommended_lineage:"",system_prompt:"# Worldview\n\nDescribe the lens this persona uses to read code and findings.\n\n# What you look for\n\n- ...\n- ...\n\n# Tone\n\nHow the persona writes — terse, exhaustive, contrarian, etc.\n"};function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function C({label:e,hint:t,issue:r,span2:n,children:a}){return(0,s.jsxs)("label",{className:(0,y.cn)("flex flex-col gap-1",n&&"sm:col-span-2"),children:[(0,s.jsxs)("span",{className:"flex items-baseline justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),t&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground/70",children:t})]}),a,r&&(0,s.jsx)("span",{className:"text-[10px] text-destructive",children:r.message})]})}function S({form:e,setField:t,setIdDirty:r,isEdit:n,isBuiltin:a,issues:l}){return(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:[n&&a&&(0,s.jsx)("div",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-200",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(v.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("div",{children:"Built-in persona. Saving demotes it to a user copy so the boot-time seed leaves it alone — you'll no longer receive upstream updates for this id."})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,s.jsx)(C,{label:"Label",hint:"Human-friendly name shown in the picker",issue:l.find(e=>"label"===e.field),children:(0,s.jsx)("input",{type:"text",value:e.label,onChange:e=>t("label",e.target.value),placeholder:"Security Skeptic",className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60"})}),(0,s.jsx)(C,{label:"ID",hint:n?"Locked once created":"Lowercase, dashes — auto-derived from label",issue:l.find(e=>"id"===e.field),children:(0,s.jsx)("input",{type:"text",value:e.id,disabled:n,onChange:e=>{r(!0),t("id",e.target.value)},placeholder:"security-skeptic",className:(0,y.cn)("h-9 w-full rounded-md border border-border bg-background px-3 font-mono text-sm outline-none transition focus:border-primary/60",n&&"cursor-not-allowed opacity-60")})}),(0,s.jsx)(C,{label:"One-liner",hint:"Shown under the label in the persona list",issue:l.find(e=>"one_liner"===e.field),span2:!0,children:(0,s.jsx)("input",{type:"text",value:e.one_liner,onChange:e=>t("one_liner",e.target.value),placeholder:"Reads every diff like an attacker.",className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60"})}),(0,s.jsx)(C,{label:"Recommended lineage",hint:"Optional — pickers can default to this CLI",span2:!0,children:(0,s.jsx)("select",{value:e.recommended_lineage,onChange:e=>t("recommended_lineage",e.target.value),className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60",children:N.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})})]}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(C,{label:"System prompt",hint:"Prepended to the doer / reviewer ask at run time. Markdown.",issue:l.find(e=>"system_prompt"===e.field),children:(0,s.jsx)("textarea",{value:e.system_prompt,onChange:e=>t("system_prompt",e.target.value),spellCheck:!1,className:"min-h-[280px] w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-[12px] leading-relaxed outline-none transition focus:border-primary/60"})})})]})}var A=r(2956);function $({saveError:e,issues:t,valid:r,saving:n,deleting:l,confirmingDelete:d,canSave:o,isEdit:c,isBuiltin:u,onCancel:m,onSave:p,onDelete:x}){return(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border bg-card/40 px-6 py-3",children:[e&&(0,s.jsx)("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[11px] text-destructive",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(v.A,{className:"mt-0.5 h-3 w-3 shrink-0"}),(0,s.jsx)("div",{className:"flex-1 leading-snug",children:e})]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.A,{className:"h-3 w-3 text-emerald-400"}),(0,s.jsx)("span",{children:"Ready to save"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{className:"h-3 w-3 text-destructive/80"}),(0,s.jsxs)("span",{children:[t.length," ",1===t.length?"issue":"issues"," to resolve"]})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[c&&!u&&(0,s.jsxs)("button",{type:"button",onClick:x,disabled:l||n,className:(0,y.cn)("inline-flex h-9 items-center gap-1.5 rounded-md border px-3 text-sm font-medium transition",d?"border-destructive bg-destructive/15 text-destructive hover:bg-destructive/25":"border-border bg-card text-muted-foreground hover:border-destructive/50 hover:text-destructive"),children:[l?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),l?"Deleting…":d?"Click again to confirm":"Delete"]}),(0,s.jsx)("button",{type:"button",onClick:m,className:"h-9 rounded-md border border-border bg-card px-4 text-sm font-medium text-muted-foreground transition hover:border-muted-foreground/30 hover:text-foreground",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",disabled:!o,onClick:p,className:(0,y.cn)("inline-flex h-9 items-center gap-1.5 rounded-md px-4 text-sm font-medium shadow-sm transition",o?"bg-primary text-primary-foreground hover:bg-primary/90":"cursor-not-allowed bg-muted text-muted-foreground/60 shadow-none"),children:[n&&(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}),n?"Saving…":c?"Save changes":"Save persona"]})]})]})]})}function E({editing:e,trigger:t,onSaved:r,onDeleted:a,defaultOpen:l}){let[i,o]=(0,n.useState)(!!l),c=!!e,u=!!e?.builtin,m=(0,n.useMemo)(()=>e?{id:e.id,label:e.label,one_liner:e.one_liner,recommended_lineage:e.recommended_lineage??"",system_prompt:e.system_prompt??""}:k,[e?.id,e?.updated_at]),[p,v]=(0,n.useState)(m),[y,j]=(0,n.useState)(!1),[N,C]=(0,n.useState)(!1),[A,D]=(0,n.useState)(!1),[z,M]=(0,n.useState)(null),[q,I]=(0,n.useState)(c);(0,n.useEffect)(()=>{v(m),M(null),D(!1),I(c)},[m,c]);let O=(0,n.useRef)(m);(0,n.useEffect)(()=>{O.current=m});let L=(0,n.useMemo)(()=>{let e,t;return e=[],(t=c?p.id:p.id||_(p.label))?w.test(t)||e.push({field:"id",message:"id must be lowercase letters, numbers, dashes (2–64 chars)"}):e.push({field:"id",message:"id is required"}),p.label.trim()||e.push({field:"label",message:"label is required"}),p.one_liner.trim()||e.push({field:"one_liner",message:"one-liner is required"}),p.system_prompt.trim()||e.push({field:"system_prompt",message:"system prompt is required"}),e},[p,c]),F=0===L.length;function P(){v(O.current),j(!1),C(!1),M(null),D(!1),I(c)}function R(e){o(e),e||setTimeout(P,200)}async function T(){if(!F||y)return;let t=c?e.id:p.id||_(p.label);j(!0),M(null);try{let e=await (0,g.qI)({id:t,label:p.label.trim(),one_liner:p.one_liner.trim(),system_prompt:p.system_prompt,recommended_lineage:p.recommended_lineage||null});r?.(e.id),R(!1)}catch(e){M(e instanceof g.$v||e instanceof Error?e.message:"Save failed (unknown error)")}finally{j(!1)}}async function V(){if(e&&!u&&!N){if(!A){D(!0),setTimeout(()=>D(e=>!e&&e),8e3);return}C(!0),M(null);try{await (0,g.K7)(e.id),a?.(e.id),R(!1)}catch(e){M(e instanceof g.$v||e instanceof Error?e.message:"Delete failed (unknown error)"),D(!1)}finally{C(!1)}}}let W=F&&!y&&!N,B=t??(c?(0,s.jsx)("button",{type:"button","aria-label":`Edit persona ${e.label}`,className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground",children:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"})}):(0,s.jsxs)("button",{type:"button","aria-label":"New persona",className:"inline-flex shrink-0 items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition hover:bg-primary/90",children:[(0,s.jsx)(x.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"New persona"})]})),K=c?`Edit persona — ${e.label}`:"New persona",Z=c?u?"Saving promotes this built-in to a user-owned row at the same id so your edits survive daemon restarts.":"Edit the worldview, recommended lineage, and system prompt.":"Personas are reusable worldviews that prepend to a doer or reviewer's prompt.";return(0,s.jsxs)(f.lG,{open:i,onOpenChange:R,children:[(0,s.jsx)(f.zM,{asChild:!0,children:B}),(0,s.jsxs)(f.Cf,{showCloseButton:!1,className:"flex max-h-[85vh] w-[min(96vw,720px)] flex-col gap-0 overflow-hidden border-border bg-card p-0 shadow-2xl sm:max-w-none",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-6 py-4",children:[(0,s.jsx)("div",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-md bg-primary/15 text-primary ring-1 ring-primary/20",children:(0,s.jsx)(h.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)(f.L3,{className:"text-[15px] font-semibold leading-tight tracking-tight",children:K}),(0,s.jsx)(f.rr,{className:"mt-0.5 text-xs text-muted-foreground",children:Z})]}),(0,s.jsx)("button",{type:"button",onClick:()=>R(!1),className:"grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition hover:bg-accent hover:text-foreground","aria-label":"Close",children:(0,s.jsx)(b.A,{className:"h-4 w-4"})})]}),(0,s.jsx)(S,{form:p,setField:function(e,t){v(r=>{let s={...r,[e]:t};return"label"!==e||q||c||(s.id=_(String(t))),s})},setIdDirty:I,isEdit:c,isBuiltin:u,issues:L}),(0,s.jsx)($,{saveError:z,issues:L,valid:F,saving:y,deleting:N,confirmingDelete:A,canSave:W,isEdit:c,isBuiltin:u,onCancel:()=>R(!1),onSave:T,onDelete:V})]})]})}function D(){let[e,t]=(0,n.useState)([]),[r,x]=(0,n.useState)(null),[h,b]=(0,n.useState)(""),[f,v]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1),[N,k]=(0,n.useState)(0),[_,C]=(0,n.useState)(null),[S,A]=(0,n.useState)(null),[$,D]=(0,n.useState)(null),[z,M]=(0,n.useState)(null),[q,I]=(0,n.useState)(null),[O,L]=(0,n.useState)(null),F=(0,n.useCallback)(async e=>{try{let r=[...await (0,g.UT)()].sort((e,t)=>e.builtin!==t.builtin?e.builtin?-1:1:e.label.localeCompare(t.label));t(r),e&&r.find(t=>t.id===e)?b(e):r.length>0?b(e=>r.find(t=>t.id===e)?e:r[0].id):b(""),k(e=>e+1)}catch(e){x(e instanceof g.$v?e.message:"Failed to load personas")}},[]);async function P(e){if(!q&&!e.builtin){if(z!==e.id){M(e.id),L(null),setTimeout(()=>{M(t=>t===e.id?null:t)},8e3);return}I(e.id),L(null);try{await (0,g.K7)(e.id),M(null),await F()}catch(e){L(e instanceof g.$v||e instanceof Error?e.message:"Delete failed (unknown error)"),M(null)}finally{I(null)}}}async function R(t){if(!S){A(t.id),D(null);try{let r=t.system_prompt&&t.system_prompt.length>0?t:await (0,g.dW)(t.id),s=new Set(e.map(e=>e.id)),n=function({sourceId:e,taken:t,maxAttempts:r=100,uniqueSuffix:s=Date.now}){let n=`${e}-copy`;if(!t.has(n))return n;for(let e=2;e<r;e++){let r=`${n}-${e}`;if(!t.has(r))return r}return`${n}-${s()}`}({sourceId:t.id,taken:s}),a=await (0,g.qI)({id:n,label:`${r.label} (copy)`,one_liner:r.one_liner,system_prompt:r.system_prompt??"",recommended_lineage:r.recommended_lineage??null,forked_from:r.forked_from??r.id});C(a.id),await F(a.id)}catch(e){D(e instanceof g.$v||e instanceof Error?e.message:"Duplicate failed (unknown error)")}finally{A(null)}}}return((0,n.useEffect)(()=>{F()},[F]),(0,n.useEffect)(()=>{if(!h)return void v(null);let e=!1;return w(!0),(0,g.dW)(h).then(t=>{e||v(t)}).catch(()=>{e||v(null)}).finally(()=>{e||w(!1)}),()=>{e=!0}},[h,N]),r)?(0,s.jsx)(o.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 personas"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r})]})})}):(0,s.jsx)(o.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)(m.z,{eyebrow:"Personas",title:"Reviewer worldviews",subtitle:(0,s.jsxs)(s.Fragment,{children:["Each persona is a set of instructions that teaches the same model to look for different things. Same Claude or Codex, different worldview, wildly different findings. Use any of them via the"," ",(0,s.jsx)("code",{className:"font-mono text-foreground/80",children:"invoke_persona"})," MCP tool from inside Claude Code, Cursor, Codex, or any editor with chorus wired up."]}),action:(0,s.jsx)(E,{onSaved:e=>F(e)})}),$&&(0,s.jsxs)("div",{className:"mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:["Duplicate failed: ",$]}),O&&(0,s.jsxs)("div",{className:"mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:["Delete failed: ",O]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1fr_1.2fr]",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[e.map(e=>{let t=e.id===h;return(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>b(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),b(e.id))},className:`group relative cursor-pointer rounded-xl text-left transition focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 ${t?"ring-2 ring-primary/60 ring-offset-2 ring-offset-background":""}`,children:[(0,s.jsx)(c.Zp,{className:"bg-card p-4 transition group-hover:border-muted-foreground/30",children:(0,s.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold",children:e.label}),e.builtin?(0,s.jsx)(u.E,{variant:"outline",className:"border-border text-[10px]",children:"built-in"}):(0,s.jsx)(u.E,{className:"bg-primary/15 text-[10px] text-primary",children:"user"}),e.recommended_lineage&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${(0,j.VW)(e.recommended_lineage)}`}),(0,j.QJ)(e.recommended_lineage)]})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:e.one_liner}),(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/70",children:["id: ",e.id]})]})})}),(0,s.jsxs)("div",{className:`absolute bottom-3 right-3 flex items-center gap-1.5 transition ${t?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,onClick:t=>{t.stopPropagation(),b(e.id)},onKeyDown:e=>e.stopPropagation(),children:[(0,s.jsx)("button",{type:"button","aria-label":`Duplicate persona ${e.label}`,title:"Duplicate",disabled:S===e.id,onClick:()=>R(e),className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:S===e.id?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(l,{className:"h-3.5 w-3.5"})}),!e.builtin&&(0,s.jsx)("button",{type:"button","aria-label":z===e.id?`Confirm delete persona ${e.label}`:`Delete persona ${e.label}`,title:z===e.id?"Click again to confirm":"Delete",disabled:q===e.id,onClick:()=>P(e),className:`grid h-7 w-7 place-items-center rounded-md border transition disabled:cursor-not-allowed disabled:opacity-50 ${z===e.id?"border-destructive bg-destructive/15 text-destructive":"border-border bg-card text-muted-foreground hover:border-destructive/50 hover:text-destructive"}`,children:q===e.id?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"})}),f&&f.id===e.id?(0,s.jsx)(E,{editing:f,defaultOpen:_===e.id,onSaved:t=>{_===e.id&&C(null),F(t)},onDeleted:()=>{_===e.id&&C(null),F()}},`${e.id}:${_===e.id?"auto":"manual"}`):(0,s.jsx)("button",{type:"button","aria-label":`Edit persona ${e.label}`,title:"Edit",onClick:()=>{b(e.id),C(e.id)},className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground",children:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"})})]})]},e.id)}),0===e.length&&(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-sm text-muted-foreground",children:"No personas yet. Daemon may still be seeding — refresh in a second."})]}),f?(0,s.jsx)(p.N,{filename:`${f.id}.md`,charCount:f.system_prompt?.length??0,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Invoke via"," ",(0,s.jsxs)("code",{className:"rounded bg-muted/40 px-1 font-mono text-[10px] text-foreground/80",children:["invoke_persona(",`{ personaId: "${f.id}" }`,")"]})]}),f.builtin&&(0,s.jsxs)("span",{children:["edit at"," ",(0,s.jsxs)("code",{className:"font-mono text-[10px]",children:["prompts/personas/",f.id,".md"]})]})]}),children:f.system_prompt??""}):y?(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-muted-foreground",children:(0,s.jsx)("p",{className:"text-sm",children:"Loading persona…"})}):(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-muted-foreground",children:(0,s.jsx)("p",{className:"text-sm",children:"Select a persona to view its prompt."})})]})]})})}},6458:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},8420:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>l});var s=r(142);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=s.$,l=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:i}=t,d=Object.keys(l).map(e=>{let t=null==r?void 0:r[e],s=null==i?void 0:i[e];if(null===t)return null;let a=n(t)||n(s);return l[e][a]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return a(e,d,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...o}[t]):({...i,...o})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},9208:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])}},e=>{e.O(0,[116,832,641,344,744,506,128,358],()=>e(e.s=4696)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[406],{2956:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},4052:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},4696:(e,t,r)=>{Promise.resolve().then(r.bind(r,5921))},5921:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>D});var s=r(9442),n=r(6074),a=r(3149);let l=(0,r(3884).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var i=r(8420),d=r(4052),o=r(4372),c=r(63),u=r(5702),m=r(6457),p=r(8191),x=r(9315),h=r(6458),b=r(6891),f=r(1853),g=r(6185),v=r(4030),y=r(7362),j=r(3734);let w=/^[a-z0-9][a-z0-9-]{1,63}$/,N=[{value:"",label:"No preference"},{value:"anthropic",label:j.ze.anthropic},{value:"openai",label:j.ze.openai},{value:"google",label:j.ze.google},{value:"opencode",label:j.ze.opencode},{value:"moonshot",label:j.ze.moonshot}],k={id:"",label:"",one_liner:"",recommended_lineage:"",system_prompt:"# Worldview\n\nDescribe the lens this persona uses to read code and findings.\n\n# What you look for\n\n- ...\n- ...\n\n# Tone\n\nHow the persona writes — terse, exhaustive, contrarian, etc.\n"};function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function C({label:e,hint:t,issue:r,span2:n,children:a}){return(0,s.jsxs)("label",{className:(0,y.cn)("flex flex-col gap-1",n&&"sm:col-span-2"),children:[(0,s.jsxs)("span",{className:"flex items-baseline justify-between gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),t&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground/70",children:t})]}),a,r&&(0,s.jsx)("span",{className:"text-[10px] text-destructive",children:r.message})]})}function S({form:e,setField:t,setIdDirty:r,isEdit:n,isBuiltin:a,issues:l}){return(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:[n&&a&&(0,s.jsx)("div",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-200",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(v.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("div",{children:"Built-in persona. Saving demotes it to a user copy so the boot-time seed leaves it alone — you'll no longer receive upstream updates for this id."})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,s.jsx)(C,{label:"Label",hint:"Human-friendly name shown in the picker",issue:l.find(e=>"label"===e.field),children:(0,s.jsx)("input",{type:"text",value:e.label,onChange:e=>t("label",e.target.value),placeholder:"Security Skeptic",className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60"})}),(0,s.jsx)(C,{label:"ID",hint:n?"Locked once created":"Lowercase, dashes — auto-derived from label",issue:l.find(e=>"id"===e.field),children:(0,s.jsx)("input",{type:"text",value:e.id,disabled:n,onChange:e=>{r(!0),t("id",e.target.value)},placeholder:"security-skeptic",className:(0,y.cn)("h-9 w-full rounded-md border border-border bg-background px-3 font-mono text-sm outline-none transition focus:border-primary/60",n&&"cursor-not-allowed opacity-60")})}),(0,s.jsx)(C,{label:"One-liner",hint:"Shown under the label in the persona list",issue:l.find(e=>"one_liner"===e.field),span2:!0,children:(0,s.jsx)("input",{type:"text",value:e.one_liner,onChange:e=>t("one_liner",e.target.value),placeholder:"Reads every diff like an attacker.",className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60"})}),(0,s.jsx)(C,{label:"Recommended lineage",hint:"Optional — pickers can default to this CLI",span2:!0,children:(0,s.jsx)("select",{value:e.recommended_lineage,onChange:e=>t("recommended_lineage",e.target.value),className:"h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none transition focus:border-primary/60",children:N.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})})]}),(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(C,{label:"System prompt",hint:"Prepended to the doer / reviewer ask at run time. Markdown.",issue:l.find(e=>"system_prompt"===e.field),children:(0,s.jsx)("textarea",{value:e.system_prompt,onChange:e=>t("system_prompt",e.target.value),spellCheck:!1,className:"min-h-[280px] w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-[12px] leading-relaxed outline-none transition focus:border-primary/60"})})})]})}var A=r(2956);function $({saveError:e,issues:t,valid:r,saving:n,deleting:l,confirmingDelete:d,canSave:o,isEdit:c,isBuiltin:u,onCancel:m,onSave:p,onDelete:x}){return(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border bg-card/40 px-6 py-3",children:[e&&(0,s.jsx)("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[11px] text-destructive",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(v.A,{className:"mt-0.5 h-3 w-3 shrink-0"}),(0,s.jsx)("div",{className:"flex-1 leading-snug",children:e})]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.A,{className:"h-3 w-3 text-emerald-400"}),(0,s.jsx)("span",{children:"Ready to save"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{className:"h-3 w-3 text-destructive/80"}),(0,s.jsxs)("span",{children:[t.length," ",1===t.length?"issue":"issues"," to resolve"]})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[c&&!u&&(0,s.jsxs)("button",{type:"button",onClick:x,disabled:l||n,className:(0,y.cn)("inline-flex h-9 items-center gap-1.5 rounded-md border px-3 text-sm font-medium transition",d?"border-destructive bg-destructive/15 text-destructive hover:bg-destructive/25":"border-border bg-card text-muted-foreground hover:border-destructive/50 hover:text-destructive"),children:[l?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"}),l?"Deleting…":d?"Click again to confirm":"Delete"]}),(0,s.jsx)("button",{type:"button",onClick:m,className:"h-9 rounded-md border border-border bg-card px-4 text-sm font-medium text-muted-foreground transition hover:border-muted-foreground/30 hover:text-foreground",children:"Cancel"}),(0,s.jsxs)("button",{type:"button",disabled:!o,onClick:p,className:(0,y.cn)("inline-flex h-9 items-center gap-1.5 rounded-md px-4 text-sm font-medium shadow-sm transition",o?"bg-primary text-primary-foreground hover:bg-primary/90":"cursor-not-allowed bg-muted text-muted-foreground/60 shadow-none"),children:[n&&(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}),n?"Saving…":c?"Save changes":"Save persona"]})]})]})]})}function E({editing:e,trigger:t,onSaved:r,onDeleted:a,defaultOpen:l}){let[i,o]=(0,n.useState)(!!l),c=!!e,u=!!e?.builtin,m=(0,n.useMemo)(()=>e?{id:e.id,label:e.label,one_liner:e.one_liner,recommended_lineage:e.recommended_lineage??"",system_prompt:e.system_prompt??""}:k,[e?.id,e?.updated_at]),[p,v]=(0,n.useState)(m),[y,j]=(0,n.useState)(!1),[N,C]=(0,n.useState)(!1),[A,D]=(0,n.useState)(!1),[z,M]=(0,n.useState)(null),[q,I]=(0,n.useState)(c);(0,n.useEffect)(()=>{v(m),M(null),D(!1),I(c)},[m,c]);let O=(0,n.useRef)(m);(0,n.useEffect)(()=>{O.current=m});let L=(0,n.useMemo)(()=>{let e,t;return e=[],(t=c?p.id:p.id||_(p.label))?w.test(t)||e.push({field:"id",message:"id must be lowercase letters, numbers, dashes (2–64 chars)"}):e.push({field:"id",message:"id is required"}),p.label.trim()||e.push({field:"label",message:"label is required"}),p.one_liner.trim()||e.push({field:"one_liner",message:"one-liner is required"}),p.system_prompt.trim()||e.push({field:"system_prompt",message:"system prompt is required"}),e},[p,c]),F=0===L.length;function P(){v(O.current),j(!1),C(!1),M(null),D(!1),I(c)}function R(e){o(e),e||setTimeout(P,200)}async function T(){if(!F||y)return;let t=c?e.id:p.id||_(p.label);j(!0),M(null);try{let e=await (0,g.qI)({id:t,label:p.label.trim(),one_liner:p.one_liner.trim(),system_prompt:p.system_prompt,recommended_lineage:p.recommended_lineage||null});r?.(e.id),R(!1)}catch(e){M(e instanceof g.$v||e instanceof Error?e.message:"Save failed (unknown error)")}finally{j(!1)}}async function V(){if(e&&!u&&!N){if(!A){D(!0),setTimeout(()=>D(e=>!e&&e),8e3);return}C(!0),M(null);try{await (0,g.K7)(e.id),a?.(e.id),R(!1)}catch(e){M(e instanceof g.$v||e instanceof Error?e.message:"Delete failed (unknown error)"),D(!1)}finally{C(!1)}}}let W=F&&!y&&!N,B=t??(c?(0,s.jsx)("button",{type:"button","aria-label":`Edit persona ${e.label}`,className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground",children:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"})}):(0,s.jsxs)("button",{type:"button","aria-label":"New persona",className:"inline-flex shrink-0 items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition hover:bg-primary/90",children:[(0,s.jsx)(x.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"New persona"})]})),K=c?`Edit persona — ${e.label}`:"New persona",Z=c?u?"Saving promotes this built-in to a user-owned row at the same id so your edits survive daemon restarts.":"Edit the worldview, recommended lineage, and system prompt.":"Personas are reusable worldviews that prepend to a doer or reviewer's prompt.";return(0,s.jsxs)(f.lG,{open:i,onOpenChange:R,children:[(0,s.jsx)(f.zM,{asChild:!0,children:B}),(0,s.jsxs)(f.Cf,{showCloseButton:!1,className:"flex max-h-[85vh] w-[min(96vw,720px)] flex-col gap-0 overflow-hidden border-border bg-card p-0 shadow-2xl sm:max-w-none",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-6 py-4",children:[(0,s.jsx)("div",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-md bg-primary/15 text-primary ring-1 ring-primary/20",children:(0,s.jsx)(h.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)(f.L3,{className:"text-[15px] font-semibold leading-tight tracking-tight",children:K}),(0,s.jsx)(f.rr,{className:"mt-0.5 text-xs text-muted-foreground",children:Z})]}),(0,s.jsx)("button",{type:"button",onClick:()=>R(!1),className:"grid h-7 w-7 place-items-center rounded-md text-muted-foreground transition hover:bg-accent hover:text-foreground","aria-label":"Close",children:(0,s.jsx)(b.A,{className:"h-4 w-4"})})]}),(0,s.jsx)(S,{form:p,setField:function(e,t){v(r=>{let s={...r,[e]:t};return"label"!==e||q||c||(s.id=_(String(t))),s})},setIdDirty:I,isEdit:c,isBuiltin:u,issues:L}),(0,s.jsx)($,{saveError:z,issues:L,valid:F,saving:y,deleting:N,confirmingDelete:A,canSave:W,isEdit:c,isBuiltin:u,onCancel:()=>R(!1),onSave:T,onDelete:V})]})]})}function D(){let[e,t]=(0,n.useState)([]),[r,x]=(0,n.useState)(null),[h,b]=(0,n.useState)(""),[f,v]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1),[N,k]=(0,n.useState)(0),[_,C]=(0,n.useState)(null),[S,A]=(0,n.useState)(null),[$,D]=(0,n.useState)(null),[z,M]=(0,n.useState)(null),[q,I]=(0,n.useState)(null),[O,L]=(0,n.useState)(null),F=(0,n.useCallback)(async e=>{try{let r=[...await (0,g.UT)()].sort((e,t)=>e.builtin!==t.builtin?e.builtin?-1:1:e.label.localeCompare(t.label));t(r),e&&r.find(t=>t.id===e)?b(e):r.length>0?b(e=>r.find(t=>t.id===e)?e:r[0].id):b(""),k(e=>e+1)}catch(e){x(e instanceof g.$v?e.message:"Failed to load personas")}},[]);async function P(e){if(!q&&!e.builtin){if(z!==e.id){M(e.id),L(null),setTimeout(()=>{M(t=>t===e.id?null:t)},8e3);return}I(e.id),L(null);try{await (0,g.K7)(e.id),M(null),await F()}catch(e){L(e instanceof g.$v||e instanceof Error?e.message:"Delete failed (unknown error)"),M(null)}finally{I(null)}}}async function R(t){if(!S){A(t.id),D(null);try{let r=t.system_prompt&&t.system_prompt.length>0?t:await (0,g.dW)(t.id),s=new Set(e.map(e=>e.id)),n=function({sourceId:e,taken:t,maxAttempts:r=100,uniqueSuffix:s=Date.now}){let n=`${e}-copy`;if(!t.has(n))return n;for(let e=2;e<r;e++){let r=`${n}-${e}`;if(!t.has(r))return r}return`${n}-${s()}`}({sourceId:t.id,taken:s}),a=await (0,g.qI)({id:n,label:`${r.label} (copy)`,one_liner:r.one_liner,system_prompt:r.system_prompt??"",recommended_lineage:r.recommended_lineage??null,forked_from:r.forked_from??r.id});C(a.id),await F(a.id)}catch(e){D(e instanceof g.$v||e instanceof Error?e.message:"Duplicate failed (unknown error)")}finally{A(null)}}}return((0,n.useEffect)(()=>{F()},[F]),(0,n.useEffect)(()=>{if(!h)return void v(null);let e=!1;return w(!0),(0,g.dW)(h).then(t=>{e||v(t)}).catch(()=>{e||v(null)}).finally(()=>{e||w(!1)}),()=>{e=!0}},[h,N]),r)?(0,s.jsx)(o.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 personas"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r})]})})}):(0,s.jsx)(o.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)(m.z,{eyebrow:"Personas",title:"Reviewer worldviews",subtitle:(0,s.jsxs)(s.Fragment,{children:["Each persona is a set of instructions that teaches the same model to look for different things. Same Claude or Codex, different worldview, wildly different findings. Use any of them via the"," ",(0,s.jsx)("code",{className:"font-mono text-foreground/80",children:"invoke_persona"})," MCP tool from inside Claude Code, Cursor, Codex, or any editor with chorus wired up."]}),action:(0,s.jsx)(E,{onSaved:e=>F(e)})}),$&&(0,s.jsxs)("div",{className:"mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:["Duplicate failed: ",$]}),O&&(0,s.jsxs)("div",{className:"mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:["Delete failed: ",O]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[1fr_1.2fr]",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[e.map(e=>{let t=e.id===h;return(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>b(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),b(e.id))},className:`group relative cursor-pointer rounded-xl text-left transition focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 ${t?"ring-2 ring-primary/60 ring-offset-2 ring-offset-background":""}`,children:[(0,s.jsx)(c.Zp,{className:"bg-card p-4 transition group-hover:border-muted-foreground/30",children:(0,s.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold",children:e.label}),e.builtin?(0,s.jsx)(u.E,{variant:"outline",className:"border-border text-[10px]",children:"built-in"}):(0,s.jsx)(u.E,{className:"bg-primary/15 text-[10px] text-primary",children:"user"}),e.recommended_lineage&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${(0,j.VW)(e.recommended_lineage)}`}),(0,j.QJ)(e.recommended_lineage)]})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:e.one_liner}),(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/70",children:["id: ",e.id]})]})})}),(0,s.jsxs)("div",{className:`absolute bottom-3 right-3 flex items-center gap-1.5 transition ${t?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,onClick:t=>{t.stopPropagation(),b(e.id)},onKeyDown:e=>e.stopPropagation(),children:[(0,s.jsx)("button",{type:"button","aria-label":`Duplicate persona ${e.label}`,title:"Duplicate",disabled:S===e.id,onClick:()=>R(e),className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:S===e.id?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(l,{className:"h-3.5 w-3.5"})}),!e.builtin&&(0,s.jsx)("button",{type:"button","aria-label":z===e.id?`Confirm delete persona ${e.label}`:`Delete persona ${e.label}`,title:z===e.id?"Click again to confirm":"Delete",disabled:q===e.id,onClick:()=>P(e),className:`grid h-7 w-7 place-items-center rounded-md border transition disabled:cursor-not-allowed disabled:opacity-50 ${z===e.id?"border-destructive bg-destructive/15 text-destructive":"border-border bg-card text-muted-foreground hover:border-destructive/50 hover:text-destructive"}`,children:q===e.id?(0,s.jsx)(a.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(i.A,{className:"h-3.5 w-3.5"})}),f&&f.id===e.id?(0,s.jsx)(E,{editing:f,defaultOpen:_===e.id,onSaved:t=>{_===e.id&&C(null),F(t)},onDeleted:()=>{_===e.id&&C(null),F()}},`${e.id}:${_===e.id?"auto":"manual"}`):(0,s.jsx)("button",{type:"button","aria-label":`Edit persona ${e.label}`,title:"Edit",onClick:()=>{b(e.id),C(e.id)},className:"grid h-7 w-7 place-items-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-muted-foreground/40 hover:bg-accent/60 hover:text-foreground",children:(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"})})]})]},e.id)}),0===e.length&&(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-sm text-muted-foreground",children:"No personas yet. Daemon may still be seeding — refresh in a second."})]}),f?(0,s.jsx)(p.N,{filename:`${f.id}.md`,charCount:f.system_prompt?.length??0,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Invoke via"," ",(0,s.jsxs)("code",{className:"rounded bg-muted/40 px-1 font-mono text-[10px] text-foreground/80",children:["invoke_persona(",`{ personaId: "${f.id}" }`,")"]})]}),f.builtin&&(0,s.jsxs)("span",{children:["edit at"," ",(0,s.jsxs)("code",{className:"font-mono text-[10px]",children:["prompts/personas/",f.id,".md"]})]})]}),children:f.system_prompt??""}):y?(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-muted-foreground",children:(0,s.jsx)("p",{className:"text-sm",children:"Loading persona…"})}):(0,s.jsx)(c.Zp,{className:"bg-card p-4 text-center text-muted-foreground",children:(0,s.jsx)("p",{className:"text-sm",children:"Select a persona to view its prompt."})})]})]})})}},6458:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},8420:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(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"}]])},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>l});var s=r(142);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=s.$,l=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:i}=t,d=Object.keys(l).map(e=>{let t=null==r?void 0:r[e],s=null==i?void 0:i[e];if(null===t)return null;let a=n(t)||n(s);return l[e][a]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return a(e,d,null==t||null==(s=t.compoundVariants)?void 0:s.reduce((e,t)=>{let{class:r,className:s,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...o}[t]):({...i,...o})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},9208:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])}},e=>{e.O(0,[249,832,641,344,744,506,128,358],()=>e(e.s=4696)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[308],{4720:(e,s,n)=>{Promise.resolve().then(n.bind(n,821)),Promise.resolve().then(n.bind(n,1245)),Promise.resolve().then(n.bind(n,8344))}},e=>{e.O(0,[116,832,641,344,245,506,128,358],()=>e(e.s=4720)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[308],{4720:(e,s,n)=>{Promise.resolve().then(n.bind(n,821)),Promise.resolve().then(n.bind(n,1245)),Promise.resolve().then(n.bind(n,8344))}},e=>{e.O(0,[249,832,641,344,245,506,128,358],()=>e(e.s=4720)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[529],{1240:(e,r,t)=>{Promise.resolve().then(t.bind(t,821)),Promise.resolve().then(t.bind(t,8344)),Promise.resolve().then(t.bind(t,2897))},2897:(e,r,t)=>{"use strict";t.d(r,{RunsTable:()=>c});var s=t(9442),a=t(9812),n=t(6891),o=t(2573),l=t.n(o),d=t(6074),i=t(5702),u=t(7296);function c({chats:e}){let[r,t]=(0,d.useState)(""),[o,m]=(0,d.useState)(""),[x,b]=(0,d.useState)(""),v=(0,d.useMemo)(()=>{let r=new Set;for(let t of e)r.add(t.templateId);return Array.from(r).sort()},[e]),g=(0,d.useMemo)(()=>{let r=new Set;for(let t of e)r.add(t.status);return Array.from(r).sort()},[e]),h=(0,d.useMemo)(()=>{let t=r.trim().toLowerCase();return e.filter(e=>(!o||e.templateId===o)&&(!x||e.status===x)&&(!t||(0,u.t)(e.work).toLowerCase().includes(t)||e.work.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||(e.slug??"").toLowerCase().includes(t)))},[e,r,o,x]),f=!!(r||o||x);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(a.A,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)("input",{type:"search",value:r,onChange:e=>t(e.target.value),placeholder:"Search by title, work, chat id, or slug…",className:"w-full rounded-md border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary/40 focus:outline-none"})]}),(0,s.jsxs)("select",{value:o,onChange:e=>m(e.target.value),className:"rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-primary/40 focus:outline-none","aria-label":"Filter by template",children:[(0,s.jsx)("option",{value:"",children:"All templates"}),v.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsxs)("select",{value:x,onChange:e=>b(e.target.value),className:"rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-primary/40 focus:outline-none","aria-label":"Filter by status",children:[(0,s.jsx)("option",{value:"",children:"All statuses"}),g.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),f&&(0,s.jsxs)("button",{type:"button",onClick:()=>{t(""),m(""),b("")},className:"flex items-center gap-1 rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground transition hover:border-destructive/40 hover:text-destructive",children:[(0,s.jsx)(n.A,{className:"h-3 w-3"}),"Clear"]})]}),(0,s.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:h.length===e.length?`${e.length} chat${1===e.length?"":"s"}`:`${h.length} of ${e.length} chat${1===e.length?"":"s"}`}),(0,s.jsx)("div",{className:"space-y-2",children:0===h.length?(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card/30 p-8 text-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:f?"No chats match these filters.":"No chats yet. Start a new one!"})}):h.map(e=>(0,s.jsx)(l(),{href:`/runs/${e.slug||e.id}`,className:"group flex items-start justify-between gap-4 rounded-lg border border-border bg-card p-4 transition hover:border-muted-foreground/30 hover:bg-card/80",children:(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e.status}),(0,s.jsx)(i.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:e.templateId})]}),(0,s.jsx)("h3",{className:"line-clamp-1 text-sm font-medium text-foreground",children:(0,u.t)(e.work)}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]})},e.id))})]})}},5702:(e,r,t)=>{"use strict";t.d(r,{E:()=>d});var s=t(9442);t(6074);var a=t(9056),n=t(8113),o=t(7362);let l=(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:r="default",asChild:t=!1,...a}){let i=t?n.bL:"span";return(0,s.jsx)(i,{"data-slot":"badge","data-variant":r,className:(0,o.cn)(l({variant:r}),e),...a})}},9056:(e,r,t)=>{"use strict";t.d(r,{F:()=>o});var s=t(142);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,o=(e,r)=>t=>{var s;if((null==r?void 0:r.variants)==null)return n(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:o,defaultVariants:l}=r,d=Object.keys(o).map(e=>{let r=null==t?void 0:t[e],s=null==l?void 0:l[e];if(null===r)return null;let n=a(r)||a(s);return o[e][n]}),i=t&&Object.entries(t).reduce((e,r)=>{let[t,s]=r;return void 0===s||(e[t]=s),e},{});return n(e,d,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:s,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...l,...i}[r]):({...l,...i})[r]===t})?[...e,t,s]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},9812:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=(0,t(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=1240)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[529],{1240:(e,r,t)=>{Promise.resolve().then(t.bind(t,821)),Promise.resolve().then(t.bind(t,8344)),Promise.resolve().then(t.bind(t,2897))},2897:(e,r,t)=>{"use strict";t.d(r,{RunsTable:()=>c});var s=t(9442),a=t(9812),n=t(6891),o=t(2573),l=t.n(o),d=t(6074),i=t(5702),u=t(7296);function c({chats:e}){let[r,t]=(0,d.useState)(""),[o,m]=(0,d.useState)(""),[x,b]=(0,d.useState)(""),v=(0,d.useMemo)(()=>{let r=new Set;for(let t of e)r.add(t.templateId);return Array.from(r).sort()},[e]),g=(0,d.useMemo)(()=>{let r=new Set;for(let t of e)r.add(t.status);return Array.from(r).sort()},[e]),h=(0,d.useMemo)(()=>{let t=r.trim().toLowerCase();return e.filter(e=>(!o||e.templateId===o)&&(!x||e.status===x)&&(!t||(0,u.t)(e.work).toLowerCase().includes(t)||e.work.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)||(e.slug??"").toLowerCase().includes(t)))},[e,r,o,x]),f=!!(r||o||x);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(a.A,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)("input",{type:"search",value:r,onChange:e=>t(e.target.value),placeholder:"Search by title, work, chat id, or slug…",className:"w-full rounded-md border border-border bg-card py-2 pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary/40 focus:outline-none"})]}),(0,s.jsxs)("select",{value:o,onChange:e=>m(e.target.value),className:"rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-primary/40 focus:outline-none","aria-label":"Filter by template",children:[(0,s.jsx)("option",{value:"",children:"All templates"}),v.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsxs)("select",{value:x,onChange:e=>b(e.target.value),className:"rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-primary/40 focus:outline-none","aria-label":"Filter by status",children:[(0,s.jsx)("option",{value:"",children:"All statuses"}),g.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),f&&(0,s.jsxs)("button",{type:"button",onClick:()=>{t(""),m(""),b("")},className:"flex items-center gap-1 rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground transition hover:border-destructive/40 hover:text-destructive",children:[(0,s.jsx)(n.A,{className:"h-3 w-3"}),"Clear"]})]}),(0,s.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:h.length===e.length?`${e.length} chat${1===e.length?"":"s"}`:`${h.length} of ${e.length} chat${1===e.length?"":"s"}`}),(0,s.jsx)("div",{className:"space-y-2",children:0===h.length?(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card/30 p-8 text-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:f?"No chats match these filters.":"No chats yet. Start a new one!"})}):h.map(e=>(0,s.jsx)(l(),{href:`/runs/${e.slug||e.id}`,className:"group flex items-start justify-between gap-4 rounded-lg border border-border bg-card p-4 transition hover:border-muted-foreground/30 hover:bg-card/80",children:(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e.status}),(0,s.jsx)(i.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:e.templateId})]}),(0,s.jsx)("h3",{className:"line-clamp-1 text-sm font-medium text-foreground",children:(0,u.t)(e.work)}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]})},e.id))})]})}},5702:(e,r,t)=>{"use strict";t.d(r,{E:()=>d});var s=t(9442);t(6074);var a=t(9056),n=t(8113),o=t(7362);let l=(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:r="default",asChild:t=!1,...a}){let i=t?n.bL:"span";return(0,s.jsx)(i,{"data-slot":"badge","data-variant":r,className:(0,o.cn)(l({variant:r}),e),...a})}},9056:(e,r,t)=>{"use strict";t.d(r,{F:()=>o});var s=t(142);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=s.$,o=(e,r)=>t=>{var s;if((null==r?void 0:r.variants)==null)return n(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:o,defaultVariants:l}=r,d=Object.keys(o).map(e=>{let r=null==t?void 0:t[e],s=null==l?void 0:l[e];if(null===r)return null;let n=a(r)||a(s);return o[e][n]}),i=t&&Object.entries(t).reduce((e,r)=>{let[t,s]=r;return void 0===s||(e[t]=s),e},{});return n(e,d,null==r||null==(s=r.compoundVariants)?void 0:s.reduce((e,r)=>{let{class:t,className:s,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...l,...i}[r]):({...l,...i})[r]===t})?[...e,t,s]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},9812:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});let s=(0,t(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=1240)),_N_E=e.O()}]);
@@ -0,0 +1,25 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{52:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},63:(e,t,r)=>{"use strict";r.d(t,{Zp:()=>o});var s=r(9442);r(6074);var a=r(7362);function o({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"card",className:(0,a.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}},2471:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},3149:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3761:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},3943:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>K});var s=r(9442),a=r(6074),o=r(3884);let n=(0,o.A)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);var l=r(9208),d=r(4372),i=r(6457);let c=(0,o.A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var u=r(3761);let m=(0,o.A)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);var x=r(6441),h=r(5702),p=r(63),f=r(9707),b=r(2471);let g=[{id:"read",name:"Read files",description:"cat, less, head, file open"},{id:"list",name:"List & search",description:"ls, grep, find, ripgrep"},{id:"write",name:"Write files",description:"Edit, Write inside allowed dirs"},{id:"exec",name:"Run commands",description:"Bash, npm, pnpm, python, go"},{id:"net",name:"Network access",description:"curl, fetch, package install"},{id:"outside-cwd",name:"Writes outside working dir",description:"Anything outside the allowed paths below"}],y={read:"auto",list:"auto",write:"ask",exec:"ask",net:"ask","outside-cwd":"block"},v={read:"auto",list:"auto",write:"block",exec:"ask",net:"ask","outside-cwd":"block"},j={auto:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",ask:"bg-amber-500/15 text-amber-300 border-amber-500/30",block:"bg-rose-500/15 text-rose-300 border-rose-500/30"};function w(e){return"auto"===e?"ask":"ask"===e?"block":"auto"}function N({id:e,icon:t,title:r,subtitle:a,children:o}){return(0,s.jsxs)(p.Zp,{id:e,className:"mt-6 scroll-mt-20 bg-card p-5",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,s.jsx)("span",{className:"rounded-md border border-border bg-card/60 p-1.5 text-foreground/70",children:t}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-foreground",children:r}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a})]})]}),o]})}function k({label:e,children:t}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:e}),t]})}function C({policy:e,onCycle:t,role:r}){return(0,s.jsx)("button",{type:"button",onClick:t,className:`justify-self-end rounded-md border px-2.5 py-1 font-mono text-[10px] uppercase tracking-wider transition hover:scale-105 ${j[e]}`,title:`${r}: cycle policy`,children:e})}function A({kind:e,current:t,onSelect:r,icon:a,title:o,tagline:n,features:l,tradeoff:d}){let i=e===t;return(0,s.jsxs)("button",{type:"button",onClick:r,className:`flex w-full items-start gap-3 rounded-lg border p-3.5 text-left transition ${i?"border-primary/40 bg-primary/5 ring-2 ring-primary/30 ring-offset-2 ring-offset-background":"border-border bg-card/40 hover:border-foreground/30"}`,children:[(0,s.jsx)("span",{className:`mt-0.5 grid h-7 w-7 shrink-0 place-items-center rounded-md ${i?"bg-primary/20 text-primary":"bg-card text-muted-foreground"}`,children:a}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-semibold text-foreground",children:o}),(0,s.jsx)(h.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:n})]}),(0,s.jsx)("ul",{className:"mt-1.5 space-y-0.5 text-[11px] text-muted-foreground",children:l.map(e=>(0,s.jsxs)("li",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(f.A,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-400/60"}),(0,s.jsx)("span",{children:e})]},e))}),(0,s.jsxs)("div",{className:"mt-2 flex items-start gap-1.5 text-[10px] text-muted-foreground",children:[(0,s.jsx)(b.A,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground/60"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-medium text-foreground/80",children:"Trade-off:"})," ",d]})]})]}),i&&(0,s.jsx)(f.A,{className:"mt-1 h-4 w-4 shrink-0 text-primary"})]})}function S(){let[e,t]=(0,a.useState)(null),[r,o]=(0,a.useState)(void 0),[n,l]=(0,a.useState)(null),[d,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,x.Dl)().then(r=>{e||(t(r.mode),o(r.descriptions))}).catch(t=>{e||i(t instanceof Error?t.message:"Could not load billing mode.")}),()=>{e=!0}},[]),(0,s.jsxs)(N,{icon:(0,s.jsx)(m,{className:"h-4 w-4"}),title:"Billing mode",subtitle:"How you pay for the AI CLIs chorus drives. Affects what the cost preview shows on the new-chat page — defaults to API rates so the number stays honest until you tell us otherwise.",children:[d&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:d}),(0,s.jsx)("div",{className:"grid gap-2",children:["api","subscription","mixed"].map(a=>{let o=e===a,d=n===a,c=r?.[a];return(0,s.jsxs)("button",{type:"button",onClick:()=>{e===a||n||(l(a),i(null),(0,x.A1)({mode:a}).then(e=>t(e.mode)).catch(e=>{i(e instanceof Error?e.message:"Save failed.")}).finally(()=>l(null)))},disabled:null!==n||null===e,className:`flex flex-col gap-1 rounded-lg border p-3 text-left transition ${o?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"} ${null!==n?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:c?.label??a}),o&&(0,s.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:d?"saving…":"active"})]}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c?.description??""})]},a)})})]})}let T=(0,o.A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);function M(){let[e,t]=(0,a.useState)(null),[r,o]=(0,a.useState)(null),[n,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!1;return(0,x.lT)().then(r=>{e||t(r)}).catch(t=>{e||o(t instanceof Error?t.message:"Could not load concurrency settings.")}),()=>{e=!0}},[]);let d=async e=>{if(!n){l(!0),o(null);try{let r=await (0,x.Wt)(e);t(r)}catch(e){o(e instanceof Error?e.message:"Save failed.")}finally{l(!1)}}};if(!e)return(0,s.jsx)(N,{id:"concurrency",icon:(0,s.jsx)(T,{className:"h-4 w-4"}),title:"Concurrency",subtitle:"Max parallel CLI subprocesses across all chats. Caps memory pressure when stacking heavyweight reviewers.",children:(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:r??"Loading…"})});let{maxParallelCli:i,perCli:c,cliLineages:u=[],defaults:m}=e;return(0,s.jsxs)(N,{id:"concurrency",icon:(0,s.jsx)(T,{className:"h-4 w-4"}),title:"Concurrency",subtitle:"Max parallel CLI subprocesses across all chats (daemon-wide). HTTP shims like OpenRouter bypass these caps — they don't consume local resources.",children:[r&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:r}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("label",{htmlFor:"cc-global",className:"block text-sm font-medium text-foreground",children:"Global cap"}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Total local-CLI subprocesses across the whole daemon. Applies to reviewers + doer combined."})]}),(0,s.jsx)(D,{id:"cc-global",min:1,max:10,value:i,disabled:n,onCommit:e=>d({maxParallelCli:e})})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-4",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Per-CLI caps"}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Tightening a single binary family — e.g. opencode is heavy (~450 MB / proc) so default is 2."}),(0,s.jsx)("div",{className:"mt-3 space-y-2",children:u.map(e=>{let t=c[e]??m?.perCli[e]??2;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("label",{htmlFor:`cc-${e}`,className:"font-mono text-sm text-foreground",children:e}),(0,s.jsx)(D,{id:`cc-${e}`,min:1,max:5,value:t,disabled:n,onCommit:t=>d({perCli:{[e]:t}})})]},e)})})]})]})]})}function D({id:e,min:t,max:r,value:a,disabled:o,onCommit:n}){return(0,s.jsxs)("div",{className:"flex items-center rounded-md border border-border bg-card",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{if(o)return;let e=Math.max(t,a-1);e!==a&&n(e)},disabled:o||a<=t,"aria-label":`Decrease ${e}`,className:"px-2.5 py-1.5 text-sm text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:"−"}),(0,s.jsx)("input",{id:e,type:"text",readOnly:!0,value:a,className:"w-9 border-x border-border bg-transparent text-center font-mono text-sm tabular-nums focus:outline-none"}),(0,s.jsx)("button",{type:"button",onClick:()=>{if(o)return;let e=Math.min(r,a+1);e!==a&&n(e)},disabled:o||a>=r,"aria-label":`Increase ${e}`,className:"px-2.5 py-1.5 text-sm text-muted-foreground transition hover:text-foreground disabled:opacity-30",children:"+"})]})}var E=r(6527),$=r(4030),P=r(6891),_=r(9315),O=r(7978);let L=(0,o.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),R=(0,o.A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),I=(0,o.A)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),U=(0,o.A)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]),z=(0,o.A)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var W=r(3149);let H=(0,o.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);function q(e){return(0,s.jsxs)("div",{className:"mt-2 select-none opacity-60 [&_*]:pointer-events-none","aria-disabled":"true",children:[(0,s.jsxs)(N,{icon:(0,s.jsx)(E.A,{className:"h-4 w-4"}),title:"Per-tool auto-approve",subtitle:"Drivers write code; reviewers don't. Defaults reflect that. Click any chip to cycle auto / ask / block.",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_120px_120px] gap-3 border-b border-border pb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:[(0,s.jsx)("span",{children:"Tool"}),(0,s.jsxs)("span",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-400"}),"Driver"]}),(0,s.jsxs)("span",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-400"}),"Reviewer"]})]}),(0,s.jsx)("div",{className:"mt-1 divide-y divide-border opacity-70",children:g.map(t=>(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_120px_120px] items-center gap-3 py-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:t.name}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:t.description})]}),(0,s.jsx)(C,{policy:e.driverPolicies[t.id],onCycle:()=>e.cyclePolicy("driver",t.id),role:"driver"}),(0,s.jsx)(C,{policy:e.reviewerPolicies[t.id],onCycle:()=>e.cyclePolicy("reviewer",t.id),role:"reviewer"})]},t.id))}),(0,s.jsxs)("p",{className:"mt-3 flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs text-amber-100",children:[(0,s.jsx)($.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"font-semibold",children:"When wired:"})," ",(0,s.jsx)("code",{className:"rounded bg-amber-400/10 px-1 font-mono text-amber-200",children:"ask"})," ","prompts will appear as cards in the chat — you click"," ",(0,s.jsx)("span",{className:"font-semibold",children:"Approve"})," /"," ",(0,s.jsx)("span",{className:"font-semibold",children:"Deny"})," instead of the agent stalling."]})]})]}),(0,s.jsxs)(N,{icon:(0,s.jsx)(E.A,{className:"h-4 w-4"}),title:"Working directories",subtitle:"Each tmux session is started inside one of these paths. Writes outside are blocked.",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:e.allowedDirs.map(t=>(0,s.jsxs)("span",{className:"group inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-[11px] text-foreground",children:[t,(0,s.jsx)("button",{type:"button",onClick:()=>e.setAllowedDirs(e.allowedDirs.filter(e=>e!==t)),className:"text-muted-foreground/50 transition hover:text-rose-400","aria-label":`Remove ${t}`,children:(0,s.jsx)(P.A,{className:"h-3 w-3"})})]},t))}),(0,s.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:e.newDir,onChange:t=>e.setNewDir(t.target.value),onKeyDown:t=>"Enter"===t.key&&e.addDir(),placeholder:"~/code/another-project",className:"flex-1 rounded-md border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),(0,s.jsxs)("button",{type:"button",onClick:e.addDir,className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition hover:bg-primary/90",children:[(0,s.jsx)(_.A,{className:"h-3.5 w-3.5"}),"Add path"]})]})]}),(0,s.jsx)(N,{icon:(0,s.jsx)(O.A,{className:"h-4 w-4"}),title:"Template defaults",subtitle:"Applied to new templates and one-off chats. Per-template values override these.",children:(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsx)(k,{label:"Default driver",children:(0,s.jsxs)("select",{value:e.defaultDriver,onChange:t=>e.setDefaultDriver(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"claude-code",children:"claude-code"}),(0,s.jsx)("option",{value:"cursor",children:"cursor"}),(0,s.jsx)("option",{value:"codex-cli",children:"codex-cli"}),(0,s.jsx)("option",{value:"windsurf",children:"windsurf"}),(0,s.jsx)("option",{value:"external",children:"external (ask each run)"})]})}),(0,s.jsx)(k,{label:"Default agreement threshold",children:(0,s.jsxs)("select",{value:e.defaultThreshold,onChange:t=>e.setDefaultThreshold(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"unanimous",children:"unanimous"}),(0,s.jsx)("option",{value:"majority",children:"majority"}),(0,s.jsx)("option",{value:"any",children:"any"})]})}),(0,s.jsx)(k,{label:"Default cost cap (USD per chat)",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:"$"}),(0,s.jsx)("input",{type:"number",step:"0.10",min:0,value:e.defaultCostCap,onChange:t=>e.setDefaultCostCap(t.target.value),className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-foreground focus:border-foreground/30 focus:outline-none"})]})}),(0,s.jsx)(k,{label:"On model error",children:(0,s.jsxs)("select",{defaultValue:"fallback",className:"w-full rounded-md border border-border bg-card px-3 py-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[(0,s.jsx)("option",{value:"fallback",children:"try next fallback model"}),(0,s.jsx)("option",{value:"fail",children:"mark chat failed"}),(0,s.jsx)("option",{value:"ask-user",children:"surface to me"})]})})]})}),(0,s.jsx)(N,{icon:(0,s.jsx)(c,{className:"h-4 w-4"}),title:"Privacy & data path",subtitle:"How prompts and code reach each LLM. Affects what leaves your machine.",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(A,{current:e.privacyTier,kind:"local",onSelect:()=>e.setPrivacyTier("local"),icon:(0,s.jsx)(L,{className:"h-4 w-4"}),title:"Local-only (BYO CLIs)",tagline:"Strictest",features:["Daemon runs on your machine; CLIs run on your machine.","Prompts go directly from your machine to each provider.","Chorus sees nothing — not even chat IDs."],tradeoff:"No cloud dashboard, no team sharing, no fallback when a CLI is down."}),(0,s.jsx)(A,{current:e.privacyTier,kind:"proxied",onSelect:()=>e.setPrivacyTier("proxied"),icon:(0,s.jsx)(R,{className:"h-4 w-4"}),title:"Proxied credits",tagline:"Recommended for credits",features:["Stateless edge proxy: prompts transit, never persist.","Stripe-pattern: same payload-handling discipline.","Used only when you spend credits to try a model you don't have."],tradeoff:"One extra hop between you and the provider."}),(0,s.jsx)(A,{current:e.privacyTier,kind:"cloud",onSelect:()=>e.setPrivacyTier("cloud"),icon:(0,s.jsx)(I,{className:"h-4 w-4"}),title:"Cloud workspace",tagline:"Team / multi-machine",features:["Code is cloned into Chorus's cloud workspace.","Transcripts + verdicts kept for audit & retro.","Encrypted at rest; SOC 2 in progress."],tradeoff:"Your code lives on our infra. Read the privacy whitepaper before flipping this on."})]})}),(0,s.jsx)(N,{icon:(0,s.jsx)(U,{className:"h-4 w-4"}),title:"Notifications & MCP",subtitle:"How outer orchestrators (your main Claude / Cursor session) get pinged when a chat finishes or blocks.",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>e.setMcpEnabled(!e.mcpEnabled),className:"flex w-full items-center justify-between rounded-md border border-border bg-card/50 px-3 py-3 text-left transition hover:border-foreground/20",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(z,{className:"mt-0.5 h-4 w-4 text-primary"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:"Chorus MCP server"}),(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["Exposes ",(0,s.jsx)("span",{className:"font-mono",children:"mm.create_chat"}),","," ",(0,s.jsx)("span",{className:"font-mono",children:"mm.update_settings"}),","," ",(0,s.jsx)("span",{className:"font-mono",children:"mm.create_template"})," and 9 other tools. Outer Claude / Cursor / Codex can configure Chorus for you."]})]})]}),(0,s.jsx)("span",{className:`flex h-5 w-9 items-center rounded-full border p-0.5 transition ${e.mcpEnabled?"border-emerald-500/40 bg-emerald-500/20":"border-border bg-card"}`,children:(0,s.jsx)("span",{className:`h-3.5 w-3.5 rounded-full transition-transform ${e.mcpEnabled?"translate-x-4 bg-emerald-400":"bg-muted-foreground/50"}`})})]}),(0,s.jsxs)(k,{label:"Webhook URL (optional)",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"url",value:e.webhookUrl,onChange:t=>e.setWebhookUrl(t.target.value),placeholder:"https://hooks.example.com/chorus",className:"flex-1 rounded-md border border-border bg-card px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),(0,s.jsxs)("button",{type:"button",onClick:e.testWebhook,disabled:!e.webhookUrl||"running"===e.webhookTestState,className:`flex items-center gap-1.5 rounded-md border px-3 py-2 text-xs font-medium transition ${"ok"===e.webhookTestState?"border-emerald-500/30 bg-emerald-500/10 text-emerald-300":"fail"===e.webhookTestState?"border-rose-500/30 bg-rose-500/10 text-rose-300":"border-border bg-card text-muted-foreground hover:text-foreground"} disabled:cursor-not-allowed disabled:opacity-50`,children:["running"===e.webhookTestState?(0,s.jsx)(W.A,{className:"h-3.5 w-3.5 animate-spin"}):"ok"===e.webhookTestState?(0,s.jsx)(f.A,{className:"h-3.5 w-3.5"}):"fail"===e.webhookTestState?(0,s.jsx)($.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(H,{className:"h-3.5 w-3.5"}),"ok"===e.webhookTestState?"204 OK":"fail"===e.webhookTestState?"Failed":"running"===e.webhookTestState?"Posting…":"Test"]})]}),(0,s.jsx)("p",{className:"mt-1.5 text-[11px] text-muted-foreground",children:"Posted on chat finished / blocked / errored. Payload includes chat_id, status, synthesis."})]})]})})]})}var F=r(52);function V(){let[e,t]=(0,a.useState)(null),[r,o]=(0,a.useState)(!1),[n,l]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return(0,x.Ci)().then(r=>{e||t(r)}).catch(t=>{e||l(t instanceof Error?t.message:"Could not load telemetry status.")}),()=>{e=!0}},[]);let d=e?.envOverride||e?.fileOverride;return(0,s.jsxs)(N,{icon:(0,s.jsx)(F.A,{className:"h-4 w-4"}),title:"Anonymous telemetry",subtitle:"A small heartbeat sent to chorus.codes once per boot + every 24h. Helps us see what versions / OSes are in the wild. No code, no prompts, no chat content.",children:[n&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:n}),(0,s.jsx)("div",{className:"rounded-lg border border-border bg-card p-3",children:(0,s.jsxs)("label",{className:"flex items-start gap-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:e?.enabled??!1,onChange:s=>{var a;return a=s.target.checked,void(!r&&e&&!d&&(o(!0),l(null),(0,x.WK)(a).then(t).catch(e=>{l(e instanceof Error?e.message:"Save failed.")}).finally(()=>o(!1))))},disabled:r||!e||d,className:"mt-1 h-4 w-4 cursor-pointer accent-primary disabled:cursor-not-allowed"}),(0,s.jsxs)("span",{className:"flex-1",children:[(0,s.jsxs)("span",{className:"block text-sm font-medium",children:["Send anonymous heartbeat",r&&(0,s.jsx)("span",{className:"ml-2 rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:"saving…"})]}),(0,s.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:"Sends: install UUID, chorus version, OS, arch, node major, daemon uptime, count of chats in the last 24h. That's it."})]})]})}),d&&(0,s.jsxs)("div",{className:"mt-3 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-100",children:["Telemetry is currently disabled by"," ",e?.envOverride&&(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TELEMETRY"}),e?.envOverride&&e?.fileOverride&&" and ",e?.fileOverride&&(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"~/.chorus/no-telemetry"}),". The toggle above won't take effect until you remove the override."]}),(0,s.jsxs)("details",{className:"mt-3 text-xs text-muted-foreground",children:[(0,s.jsx)("summary",{className:"cursor-pointer hover:text-foreground",children:"Other ways to opt out"}),(0,s.jsxs)("ul",{className:"mt-2 list-inside list-disc space-y-1 leading-relaxed",children:[(0,s.jsxs)("li",{children:["Set ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TELEMETRY=0"})," ","in your shell — also accepts ",(0,s.jsx)("code",{children:"false"}),", ",(0,s.jsx)("code",{children:"no"}),","," ",(0,s.jsx)("code",{children:"off"}),"."]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"touch ~/.chorus/no-telemetry"})," ","(cargo / brew convention)."]}),(0,s.jsxs)("li",{children:["Reset your install ID:"," ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"rm ~/.chorus/install-id"})," ","— a fresh UUID is minted on the next heartbeat."]})]}),e?.endpoint&&(0,s.jsxs)("p",{className:"mt-2 leading-relaxed",children:["Endpoint: ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:e.endpoint})]})]})]})}let Y=(0,o.A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function B(){let[e,t]=(0,a.useState)(null),[r,o]=(0,a.useState)(void 0),[n,l]=(0,a.useState)(!0),[d,i]=(0,a.useState)(null),[c,u]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return(0,x.oD)().then(r=>{e||(t(r.transport),o(r.descriptions),l(!1!==r.tmuxAvailable))}).catch(t=>{e||u(t instanceof Error?t.message:"Could not load transport setting.")}),()=>{e=!0}},[]),(0,s.jsxs)(N,{id:"transport",icon:(0,s.jsx)(Y,{className:"h-4 w-4"}),title:"Run mode (headless / tmux)",subtitle:"How chorus runs each CLI. Default is headless (faster, lower RAM). Switch to tmux if you want to attach to a live voice and take over mid-run (debug + handoff).",children:[c&&(0,s.jsx)("div",{className:"mb-3 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:c}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:["headless","tmux"].map(a=>{let o=e===a,l=d===a,c=r?.[a],m="tmux"===a&&!n;return(0,s.jsxs)("button",{type:"button",onClick:()=>{e===a||d||(i(a),u(null),(0,x.nr)({transport:a}).then(e=>{t(e.transport)}).catch(e=>{u(e instanceof Error?e.message:"Save failed.")}).finally(()=>i(null)))},disabled:null!==d||null===e||m,title:m?"tmux is not installed on this host. Install it (brew/apt/dnf) then restart the daemon.":void 0,className:`flex flex-col gap-1 rounded-lg border p-3 text-left transition ${o?"border-primary/50 bg-primary/10":"border-border bg-card hover:border-muted-foreground/30"} ${null!==d||m?"opacity-60 cursor-not-allowed":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:c?.label??("headless"===a?"Headless":"Tmux")}),o?(0,s.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-primary",children:l?"saving…":"active"}):m?(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"not installed"}):null]}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:c?.description??("headless"===a?"Subprocess per call. Lower RAM, faster cold start, no permission dialogs.":"Persistent terminal sessions you can attach to for visual debug.")}),m&&(0,s.jsxs)("p",{className:"mt-1 text-[10px] leading-relaxed text-amber-300/80",children:["Install: macOS ",(0,s.jsx)("code",{children:"brew install tmux"})," \xb7 Ubuntu ",(0,s.jsx)("code",{children:"apt install tmux"})," \xb7 Fedora ",(0,s.jsx)("code",{children:"dnf install tmux"}),". Restart the daemon afterwards."]})]},a)})}),(0,s.jsxs)("p",{className:"mt-3 text-[11px] text-muted-foreground",children:["Tip: set ",(0,s.jsx)("code",{className:"rounded bg-muted px-1",children:"CHORUS_TRANSPORT=tmux"})," in your environment to override per-shell without changing this setting."]})]})}function Z(e){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N,{icon:(0,s.jsx)(c,{className:"h-4 w-4"}),title:"Sandbox & first-call permissions",subtitle:"What can chorus-spawned reviewers do on this machine? Pick a profile, toggle prompt auto-approval, choose whether to allow outbound network.",children:(0,s.jsxs)("a",{href:"/settings/permissions",className:"inline-flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition hover:bg-primary/10",children:["Open Permissions page",(0,s.jsx)("span",{"aria-hidden":!0,children:"→"})]})}),(0,s.jsx)(B,{}),(0,s.jsx)(M,{}),(0,s.jsx)(S,{}),(0,s.jsx)(V,{}),(0,s.jsxs)("div",{className:"mt-12 flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm text-amber-100",role:"note",children:[(0,s.jsx)(u.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-400"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-semibold",children:"Coming in v0.8 — preview only"}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-amber-100/80",children:"The sections below show planned controls. They're not wired to the daemon yet — interaction is disabled. The YAML toggle at the top of the page already exposes the schema if you're curious."})]})]}),(0,s.jsx)(q,{...e})]})}function G({yaml:e}){return(0,s.jsxs)(p.Zp,{className:"overflow-hidden bg-card p-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wider text-foreground",children:"settings.yaml"}),(0,s.jsx)(h.E,{variant:"outline",className:"border-border font-mono text-[10px]",children:"~/.chorus/settings.yaml"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[(0,s.jsx)(F.A,{className:"h-3 w-3"}),"live-rendered from form state"]})]}),(0,s.jsx)("textarea",{value:e,readOnly:!0,spellCheck:!1,className:"block min-h-[520px] w-full resize-none border-0 bg-background px-5 py-4 font-mono text-[12px] leading-relaxed text-foreground/90 focus:outline-none"}),(0,s.jsxs)("div",{className:"flex items-center justify-between border-t border-border px-4 py-2.5 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:["Same shape that"," ",(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:"mm.update_settings"})," ","accepts as a patch."]}),(0,s.jsx)("button",{type:"button",className:"rounded-md border border-border bg-card px-2 py-1 text-[10px] text-muted-foreground transition hover:text-foreground",children:"Copy"})]})]})}function K(){let[e,t]=(0,a.useState)("form"),[r,o]=(0,a.useState)(3),[c,u]=(0,a.useState)(y),[m,x]=(0,a.useState)(v),[h,p]=(0,a.useState)(["~/dev","~/work","/tmp/chorus-sandbox"]),[f,b]=(0,a.useState)(""),[j,N]=(0,a.useState)("claude-code"),[k,C]=(0,a.useState)("2.00"),[A,S]=(0,a.useState)("unanimous"),[T,M]=(0,a.useState)(""),[D,E]=(0,a.useState)(!0),[$,P]=(0,a.useState)("local"),[_,O]=(0,a.useState)("idle"),L=(0,a.useMemo)(()=>{var e;let t,s,a;return t=(e={maxConcurrent:r,driverPolicies:c,reviewerPolicies:m,allowedDirs:h,defaultDriver:j,defaultCostCap:k,defaultThreshold:A,mcpEnabled:D,webhookUrl:T}).allowedDirs.map(e=>` - ${e}`).join("\n"),s=g.map(t=>` ${t.id.replace("-","_")}: ${e.driverPolicies[t.id]}`).join("\n"),a=g.map(t=>` ${t.id.replace("-","_")}: ${e.reviewerPolicies[t.id]}`).join("\n"),`# Chorus workspace settings
2
+ # Edit here, or via the Form tab, or via mm.update_settings from any MCP client.
3
+
4
+ concurrency:
5
+ max_concurrent_chats: ${e.maxConcurrent}
6
+
7
+ permissions:
8
+ driver:
9
+ ${s}
10
+ reviewer:
11
+ ${a}
12
+
13
+ allowed_directories:
14
+ ${t}
15
+
16
+ defaults:
17
+ driver: ${e.defaultDriver}
18
+ agreement_threshold: ${e.defaultThreshold}
19
+ cost_cap_usd: ${e.defaultCostCap}
20
+ on_error: fallback
21
+
22
+ notifications:
23
+ mcp_enabled: ${e.mcpEnabled}
24
+ webhook_url: ${e.webhookUrl?`"${e.webhookUrl}"`:'""'}
25
+ `},[r,c,m,h,j,k,A,D,T]);return(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)(i.z,{eyebrow:"Settings",title:"Workspace",subtitle:"Defaults applied to every chat. Templates can override these per-run. The MCP server can read & patch this config — your main Claude can configure Chorus for you.",action:(0,s.jsxs)("div",{className:"flex rounded-md border border-border bg-card p-0.5",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>t("form"),className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition ${"form"===e?"bg-primary/15 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(n,{className:"h-3.5 w-3.5"}),"Form"]}),(0,s.jsxs)("button",{type:"button",onClick:()=>t("yaml"),className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-xs font-medium transition ${"yaml"===e?"bg-primary/15 text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(l.A,{className:"h-3.5 w-3.5"}),"YAML"]})]})}),"yaml"===e?(0,s.jsx)(G,{yaml:L}):(0,s.jsx)(Z,{maxConcurrent:r,setMaxConcurrent:o,driverPolicies:c,reviewerPolicies:m,cyclePolicy:function(e,t){"driver"===e?u(e=>({...e,[t]:w(e[t])})):x(e=>({...e,[t]:w(e[t])}))},allowedDirs:h,setAllowedDirs:p,newDir:f,setNewDir:b,addDir:function(){let e=f.trim();!e||h.includes(e)||(p(t=>[...t,e]),b(""))},defaultDriver:j,setDefaultDriver:N,defaultCostCap:k,setDefaultCostCap:C,defaultThreshold:A,setDefaultThreshold:S,webhookUrl:T,setWebhookUrl:M,mcpEnabled:D,setMcpEnabled:E,privacyTier:$,setPrivacyTier:P,webhookTestState:_,testWebhook:function(){"running"!==_&&(O("running"),setTimeout(()=>{O(T.startsWith("https://")?"ok":"fail"),setTimeout(()=>O("idle"),2200)},1100))}})]})})}},4030:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},4372:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});var s=r(9442),a=r(821),o=r(8344);function n({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)(o.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),o=r(8113),n=r(7362);let l=(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 i=r?o.bL:"span";return(0,s.jsx)(i,{"data-slot":"badge","data-variant":t,className:(0,n.cn)(l({variant:t}),e),...a})}},6457:(e,t,r)=>{"use strict";r.d(t,{z:()=>a});var s=r(9442);function a({eyebrow:e,title:t,subtitle:r,action:o}){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})]}),o&&(0,s.jsx)("div",{className:"shrink-0 self-start sm:self-auto",children:o})]})}},6527:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("folder-lock",[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]])},6624:(e,t,r)=>{Promise.resolve().then(r.bind(r,3943))},7978:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]])},9056:(e,t,r)=>{"use strict";r.d(t,{F:()=>n});var s=r(142);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,o=s.$,n=(e,t)=>r=>{var s;if((null==t?void 0:t.variants)==null)return o(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:n,defaultVariants:l}=t,d=Object.keys(n).map(e=>{let t=null==r?void 0:r[e],s=null==l?void 0:l[e];if(null===t)return null;let o=a(t)||a(s);return n[e][o]}),i=r&&Object.entries(r).reduce((e,t)=>{let[r,s]=t;return void 0===s||(e[r]=s),e},{});return o(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({...l,...i}[t]):({...l,...i})[t]===r})?[...e,r,s]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},9208:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])},9707:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}},e=>{e.O(0,[249,832,641,344,506,128,358],()=>e(e.s=6624)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{3149:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4030:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(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"}]])},4400:(e,s,t)=>{"use strict";t.d(s,{PermissionsForm:()=>b});var a=t(9442),r=t(6074),l=t(3884);let i=(0,l.A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var c=t(6527);let n=(0,l.A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var d=t(9707),o=t(3149),m=t(4030),p=t(6441),x=t(6185);let h=["strict","workspace","full"],u={strict:i,workspace:c.A,full:n};function b({initial:e}){let[s,t]=(0,r.useState)(e),[l,i]=(0,r.useState)(!1),[c,n]=(0,r.useState)(null),[f,g]=(0,r.useState)(null),y=s.profileDescriptions??e.profileDescriptions??{strict:{label:"Strict",description:""},workspace:{label:"Workspace",description:""},full:{label:"Full access",description:""}},k=(0,r.useCallback)(async e=>{i(!0),n(null);try{let s=await (0,p.Ep)(e);t(s),g(Date.now())}catch(e){n(e instanceof x.$v?e.message:"Failed to save — is the daemon running?")}finally{i(!1)}},[]);return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Sandbox profile"}),(0,a.jsx)("div",{className:"grid gap-3",children:h.map(e=>{let t=u[e],r=y[e]??{label:e,description:""},i=s.sandboxProfile===e;return(0,a.jsxs)("button",{type:"button",disabled:l,onClick:()=>k({sandboxProfile:e}),className:`group flex items-start gap-3 rounded-lg border p-4 text-left transition disabled:cursor-not-allowed ${i?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:[(0,a.jsx)(t,{className:`mt-0.5 h-5 w-5 shrink-0 ${i?"text-primary":"text-muted-foreground"}`}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),i&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," Active"]})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.description})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Auto-approve prompts"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-4",children:[(0,a.jsx)("input",{type:"checkbox",checked:s.autoApprovePrompts,disabled:l,onChange:e=>k({autoApprovePrompts:e.target.checked}),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Skip permission prompts inside the spawned CLI"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:["When on, chorus passes ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"--afk"})," to kimi, ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"--approval-mode auto_edit"}),"to gemini, and equivalent flags to other CLIs so reviewers don't hang on per-tool permission prompts. Turn off if you want every action to require an explicit “yes” inside the CLI's TUI (slower, but fully observable)."]})]})]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Network access"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-4",children:[(0,a.jsx)("input",{type:"checkbox",checked:s.networkAccess,disabled:l,onChange:e=>k({networkAccess:e.target.checked}),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Allow outbound network from reviewers"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Off by default. Reviewers can't curl, npm install, or call external APIs. Templates that explicitly need network (e.g. fetching docs, gh CLI) override this per phase. Enable globally only if you trust every template you run."})]})]})]}),(0,a.jsxs)("div",{className:"flex h-6 items-center text-xs",children:[l&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,a.jsx)(o.A,{className:"h-3 w-3 animate-spin"})," Saving…"]}),!l&&c&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-destructive",children:[(0,a.jsx)(m.A,{className:"h-3 w-3"})," ",c]}),!l&&!c&&f&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-emerald-400",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," Saved"]})]})]})}},6527:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("folder-lock",[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]])},9230:(e,s,t)=>{Promise.resolve().then(t.bind(t,4400)),Promise.resolve().then(t.bind(t,821)),Promise.resolve().then(t.bind(t,8344))},9707:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}},e=>{e.O(0,[116,832,641,344,506,128,358],()=>e(e.s=9230)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{3149:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},4030:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(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"}]])},4400:(e,s,t)=>{"use strict";t.d(s,{PermissionsForm:()=>b});var a=t(9442),r=t(6074),l=t(3884);let i=(0,l.A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var c=t(6527);let n=(0,l.A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var d=t(9707),o=t(3149),m=t(4030),p=t(6441),x=t(6185);let h=["strict","workspace","full"],u={strict:i,workspace:c.A,full:n};function b({initial:e}){let[s,t]=(0,r.useState)(e),[l,i]=(0,r.useState)(!1),[c,n]=(0,r.useState)(null),[f,g]=(0,r.useState)(null),y=s.profileDescriptions??e.profileDescriptions??{strict:{label:"Strict",description:""},workspace:{label:"Workspace",description:""},full:{label:"Full access",description:""}},k=(0,r.useCallback)(async e=>{i(!0),n(null);try{let s=await (0,p.Ep)(e);t(s),g(Date.now())}catch(e){n(e instanceof x.$v?e.message:"Failed to save — is the daemon running?")}finally{i(!1)}},[]);return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Sandbox profile"}),(0,a.jsx)("div",{className:"grid gap-3",children:h.map(e=>{let t=u[e],r=y[e]??{label:e,description:""},i=s.sandboxProfile===e;return(0,a.jsxs)("button",{type:"button",disabled:l,onClick:()=>k({sandboxProfile:e}),className:`group flex items-start gap-3 rounded-lg border p-4 text-left transition disabled:cursor-not-allowed ${i?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:[(0,a.jsx)(t,{className:`mt-0.5 h-5 w-5 shrink-0 ${i?"text-primary":"text-muted-foreground"}`}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),i&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-300",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," Active"]})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:r.description})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Auto-approve prompts"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-4",children:[(0,a.jsx)("input",{type:"checkbox",checked:s.autoApprovePrompts,disabled:l,onChange:e=>k({autoApprovePrompts:e.target.checked}),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Skip permission prompts inside the spawned CLI"}),(0,a.jsxs)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:["When on, chorus passes ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"--afk"})," to kimi, ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"--approval-mode auto_edit"}),"to gemini, and equivalent flags to other CLIs so reviewers don't hang on per-tool permission prompts. Turn off if you want every action to require an explicit “yes” inside the CLI's TUI (slower, but fully observable)."]})]})]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Network access"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-card p-4",children:[(0,a.jsx)("input",{type:"checkbox",checked:s.networkAccess,disabled:l,onChange:e=>k({networkAccess:e.target.checked}),className:"mt-1 h-4 w-4 cursor-pointer accent-primary"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium",children:"Allow outbound network from reviewers"}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Off by default. Reviewers can't curl, npm install, or call external APIs. Templates that explicitly need network (e.g. fetching docs, gh CLI) override this per phase. Enable globally only if you trust every template you run."})]})]})]}),(0,a.jsxs)("div",{className:"flex h-6 items-center text-xs",children:[l&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,a.jsx)(o.A,{className:"h-3 w-3 animate-spin"})," Saving…"]}),!l&&c&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-destructive",children:[(0,a.jsx)(m.A,{className:"h-3 w-3"})," ",c]}),!l&&!c&&f&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-emerald-400",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," Saved"]})]})]})}},6527:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("folder-lock",[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]])},9230:(e,s,t)=>{Promise.resolve().then(t.bind(t,4400)),Promise.resolve().then(t.bind(t,821)),Promise.resolve().then(t.bind(t,8344))},9707:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(3884).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}},e=>{e.O(0,[249,832,641,344,506,128,358],()=>e(e.s=9230)),_N_E=e.O()}]);