sparkecoder 0.1.87 → 0.1.93

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 (125) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/index.d.ts +3 -3
  3. package/dist/agent/index.js +158 -68
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/cli.js +416 -108
  6. package/dist/cli.js.map +1 -1
  7. package/dist/db/index.d.ts +2 -2
  8. package/dist/{index-BvIissiB.d.ts → index-Bn0Zox8f.d.ts} +23 -23
  9. package/dist/index.d.ts +5 -5
  10. package/dist/index.js +272 -97
  11. package/dist/index.js.map +1 -1
  12. package/dist/{schema-CohdIL13.d.ts → schema-EmpbnQeQ.d.ts} +3 -3
  13. package/dist/{search-CCffrVJE.d.ts → search-BRnGaIl-.d.ts} +7 -7
  14. package/dist/server/index.js +272 -97
  15. package/dist/server/index.js.map +1 -1
  16. package/dist/tools/index.d.ts +30 -3
  17. package/dist/tools/index.js +38 -4
  18. package/dist/tools/index.js.map +1 -1
  19. package/package.json +5 -5
  20. package/web/.next/BUILD_ID +1 -1
  21. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  22. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  23. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  24. package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
  25. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  27. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  29. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  30. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  31. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  33. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  34. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  35. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +2 -2
  36. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  37. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  39. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
  43. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  44. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +3 -3
  45. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +3 -3
  46. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  47. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
  48. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +2 -2
  50. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +2 -2
  52. package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  53. package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  55. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +3 -3
  56. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +3 -3
  57. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
  59. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +2 -2
  63. package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
  64. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  65. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +3 -3
  66. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +3 -3
  67. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  68. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
  69. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +2 -2
  71. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  72. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +2 -2
  73. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  74. package/web/.next/standalone/web/.next/server/app/docs.rsc +3 -3
  75. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +3 -3
  76. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  77. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  78. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
  80. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +2 -2
  81. package/web/.next/standalone/web/.next/server/app/embed/[id]/page_client-reference-manifest.js +1 -1
  82. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  83. package/web/.next/standalone/web/.next/server/app/index.rsc +4 -4
  84. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
  85. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
  86. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +4 -4
  87. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  88. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
  89. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  90. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__36edac7c._.js +1 -1
  91. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +1 -1
  92. package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_page_tsx_5ac4794b._.js +1 -1
  93. package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_components_sessions-sidebar_tsx_92510070._.js +1 -1
  94. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  95. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  96. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  97. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  98. package/web/.next/{static/chunks/26eb5fab5216f3cc.js → standalone/web/.next/static/chunks/58fd0aaa2746b444.js} +1 -1
  99. package/web/.next/standalone/web/.next/static/chunks/9fce2ce79c4c834e.js +1 -0
  100. package/web/.next/standalone/web/.next/static/chunks/{8d3efc76109d2efc.js → a888d448ceab1abe.js} +1 -1
  101. package/web/.next/standalone/web/.next/static/static/chunks/{26eb5fab5216f3cc.js → 58fd0aaa2746b444.js} +1 -1
  102. package/web/.next/standalone/web/.next/static/static/chunks/9fce2ce79c4c834e.js +1 -0
  103. package/web/.next/{static/chunks/8d3efc76109d2efc.js → standalone/web/.next/static/static/chunks/a888d448ceab1abe.js} +1 -1
  104. package/web/.next/standalone/web/package-lock.json +27 -27
  105. package/web/.next/standalone/web/package.json +1 -1
  106. package/web/.next/standalone/web/src/app/(main)/page.tsx +2 -2
  107. package/web/.next/standalone/web/src/app/api/config/route.ts +3 -2
  108. package/web/.next/standalone/web/src/components/sessions-sidebar.tsx +1 -1
  109. package/web/.next/standalone/web/src/lib/config.ts +2 -1
  110. package/web/.next/{standalone/web/.next/static/chunks/26eb5fab5216f3cc.js → static/chunks/58fd0aaa2746b444.js} +1 -1
  111. package/web/.next/static/chunks/9fce2ce79c4c834e.js +1 -0
  112. package/web/.next/{standalone/web/.next/static/static/chunks/8d3efc76109d2efc.js → static/chunks/a888d448ceab1abe.js} +1 -1
  113. package/web/package.json +1 -1
  114. package/web/.next/standalone/web/.next/static/chunks/b31b0765abe0c427.js +0 -1
  115. package/web/.next/standalone/web/.next/static/static/chunks/b31b0765abe0c427.js +0 -1
  116. package/web/.next/static/chunks/b31b0765abe0c427.js +0 -1
  117. /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_buildManifest.js +0 -0
  118. /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_clientMiddlewareManifest.json +0 -0
  119. /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_ssgManifest.js +0 -0
  120. /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/-ax3tJNqBGukss29jpu41}/_buildManifest.js +0 -0
  121. /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/-ax3tJNqBGukss29jpu41}/_clientMiddlewareManifest.json +0 -0
  122. /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/-ax3tJNqBGukss29jpu41}/_ssgManifest.js +0 -0
  123. /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_buildManifest.js +0 -0
  124. /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_clientMiddlewareManifest.json +0 -0
  125. /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → -ax3tJNqBGukss29jpu41}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[918622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},640881,(a,b,c)=>{"use strict";b.exports=a.r(918622)},755132,(a,b,c)=>{"use strict";b.exports=a.r(640881).vendored["react-ssr"].React},555941,a=>{"use strict";let b="http://localhost:3141";function c(){}function d(){return b}let e={availableModels:[{id:"anthropic/claude-opus-4-6",name:"Claude Opus 4.6",provider:"Anthropic"},{id:"anthropic/claude-opus-4-5",name:"Claude Opus 4.5",provider:"Anthropic"},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-haiku-4-5",name:"Claude Haiku 4.5",provider:"Anthropic"},{id:"openai/gpt-5-2-codex",name:"GPT-5.2 Codex",provider:"OpenAI"},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"Google"},{id:"xai/grok-code-fast-1",name:"Grok Code Fast",provider:"xAI"}],availableTools:[{id:"bash",name:"Bash",description:"Execute shell commands",dangerous:!0},{id:"write_file",name:"Write File",description:"Create or edit files",dangerous:!0},{id:"read_file",name:"Read File",description:"Read file contents",dangerous:!1}],defaultModel:"anthropic/claude-opus-4-6",defaultToolApprovals:{},serverConnected:!1,apiKeyConfigured:!1,apiBaseUrl:b};async function f(){try{let a=new AbortController,c=setTimeout(()=>a.abort(),3e3),d=await fetch(`${b}/health`,{signal:a.signal});if(clearTimeout(c),!d.ok)return{...e,apiBaseUrl:b};let f=await d.json();return{...e,defaultModel:f.config?.defaultModel||e.defaultModel,defaultToolApprovals:f.config?.defaultToolApprovals||{},serverConnected:!0,apiKeyConfigured:f.apiKeyConfigured??!1,apiBaseUrl:b}}catch{return{...e,apiBaseUrl:b}}}a.s(["getApiUrl",()=>d,"getConfig",()=>f,"initApiUrl",()=>c])},956805,a=>{"use strict";var b=a.i(755132),c=a.i(555941);function d(){return(0,b.useEffect)(()=>{(0,c.initApiUrl)()},[]),null}a.s(["ApiInit",()=>d])}];
1
+ module.exports=[918622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},640881,(a,b,c)=>{"use strict";b.exports=a.r(918622)},755132,(a,b,c)=>{"use strict";b.exports=a.r(640881).vendored["react-ssr"].React},555941,a=>{"use strict";let b="http://localhost:3141";function c(){}function d(){return b}let e={availableModels:[{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",provider:"Anthropic"},{id:"anthropic/claude-opus-4-6",name:"Claude Opus 4.6",provider:"Anthropic"},{id:"anthropic/claude-opus-4-5",name:"Claude Opus 4.5",provider:"Anthropic"},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-haiku-4-5",name:"Claude Haiku 4.5",provider:"Anthropic"},{id:"openai/gpt-5-2-codex",name:"GPT-5.2 Codex",provider:"OpenAI"},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"Google"},{id:"xai/grok-code-fast-1",name:"Grok Code Fast",provider:"xAI"}],availableTools:[{id:"bash",name:"Bash",description:"Execute shell commands",dangerous:!0},{id:"write_file",name:"Write File",description:"Create or edit files",dangerous:!0},{id:"read_file",name:"Read File",description:"Read file contents",dangerous:!1}],defaultModel:"anthropic/claude-opus-4.7",defaultToolApprovals:{},serverConnected:!1,apiKeyConfigured:!1,apiBaseUrl:b};async function f(){try{let a=new AbortController,c=setTimeout(()=>a.abort(),3e3),d=await fetch(`${b}/health`,{signal:a.signal});if(clearTimeout(c),!d.ok)return{...e,apiBaseUrl:b};let f=await d.json();return{...e,defaultModel:f.config?.defaultModel||e.defaultModel,defaultToolApprovals:f.config?.defaultToolApprovals||{},serverConnected:!0,apiKeyConfigured:f.apiKeyConfigured??!1,apiBaseUrl:b}}catch{return{...e,apiBaseUrl:b}}}a.s(["getApiUrl",()=>d,"getConfig",()=>f,"initApiUrl",()=>c])},956805,a=>{"use strict";var b=a.i(755132),c=a.i(555941);function d(){return(0,b.useEffect)(()=>{(0,c.initApiUrl)()},[]),null}a.s(["ApiInit",()=>d])}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__be5e2967._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[908810,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(832315),e=a.i(746881),f=a.i(546640),g=a.i(916454),h=a.i(252831),i=a.i(221557),j=a.i(917999),j=j,k=a.i(290293),k=k,l=a.i(544244),m=a.i(784268),m=m,n=a.i(762491),o=a.i(670923),p=a.i(476031),q=a.i(338706),r=a.i(331893),s=a.i(979412),t=a.i(555941),u=a.i(828278),v=a.i(156033);function w(){let a=(0,d.useRouter)(),w=(0,d.useSearchParams)(),{sessions:x,isLoading:y}=(0,u.useSessions)(),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(null),[D,E]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(null),[J,K]=(0,c.useState)(null),L=(0,c.useRef)(!1),M=async(a,b)=>{a.preventDefault(),a.stopPropagation();try{await (0,s.deleteSession)(b),(0,u.mutateSessions)()}catch(a){console.error("Failed to delete session:",a)}};(0,c.useEffect)(()=>{(0,t.getConfig)().then(C)},[]),(0,c.useEffect)(()=>{w.has("new")&&B&&B.apiKeyConfigured&&!L.current&&!z&&(L.current=!0,(async()=>{A(!0);try{let b=await (0,s.createSession)({name:`Session ${x.length+1}`,model:B.defaultModel||"anthropic/claude-opus-4-6",toolApprovals:B.defaultToolApprovals||{}});(0,u.mutateSessions)(),a.replace(`/session/${b.id}`)}catch(a){console.error("Failed to auto-create session:",a),A(!1)}})())},[w,B,x.length,z,a]),(0,c.useEffect)(()=>{w.has("latest")&&!y&&x.length>0&&a.replace(`/session/${x[0].id}`)},[w,y,x,a]);let N=async()=>{if(D.trim()&&!F){G(!0),I(null);try{if((await (0,s.setApiKey)("ai-gateway",D.trim())).success){let a=await (0,t.getConfig)();C(a),E("")}else I("Failed to save API key. Please try again.")}catch(a){I("Failed to save API key. Please try again.")}finally{G(!1)}}},O=async()=>{if(!z){A(!0);try{let b=await (0,s.createSession)({name:`Session ${x.length+1}`,model:B?.defaultModel||"anthropic/claude-opus-4-6",toolApprovals:B?.defaultToolApprovals||{}});(0,u.mutateSessions)(),a.push(`/session/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{A(!1)}}};return((0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"t"===a.key&&(a.preventDefault(),O())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[z,x.length,B]),B&&!B.apiKeyConfigured)?(0,b.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20",children:(0,b.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,b.jsx)("div",{className:"flex justify-center mb-8",children:(0,b.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10",children:(0,b.jsx)(e.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover",priority:!0})})}),(0,b.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,b.jsxs)("div",{className:"bg-muted/50 rounded-lg p-6 mb-6 text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)(i.Key,{className:"size-5 text-amber-500"}),(0,b.jsx)("h2",{className:"font-semibold",children:"API Key Required"})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"SparkECoder uses the Vercel AI Gateway. Enter your API key to get started."}),(0,b.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,b.jsx)(q.Input,{type:"password",placeholder:"Enter your AI Gateway API key",value:D,onChange:a=>E(a.target.value),onKeyDown:a=>"Enter"===a.key&&N(),className:"flex-1"}),(0,b.jsx)(p.Button,{onClick:N,disabled:!D.trim()||F,children:F?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):"Save"})]}),H&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive mb-3",children:[(0,b.jsx)(k.default,{className:"size-4"}),H]}),(0,b.jsxs)("a",{href:"https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-primary hover:underline",children:["Get an API key from Vercel",(0,b.jsx)(j.default,{className:"size-3"})]})]})]})}):(0,b.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20 overflow-auto",children:(0,b.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,b.jsx)("div",{className:"flex justify-center mb-8",children:(0,b.jsx)(o.TooltipProvider,{children:(0,b.jsxs)(o.Tooltip,{children:[(0,b.jsx)(o.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"relative group cursor-pointer",children:[(0,b.jsx)("div",{className:"absolute inset-0 rounded-3xl blur-2xl opacity-40 group-hover:opacity-60 transition-opacity bg-primary/30"}),(0,b.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10 hover-lift",children:(0,b.jsx)(e.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover sparke-idle",priority:!0})})]})}),(0,b.jsx)(o.TooltipContent,{children:"Meet Sparke, your coding companion!"})]})})}),(0,b.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,b.jsx)("p",{className:"text-muted-foreground mb-8 leading-relaxed",children:"Your AI-powered coding assistant. Start a new session to begin building amazing things."}),(0,b.jsx)(p.Button,{size:"lg",onClick:O,disabled:z,className:"gap-2 px-8",children:z?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}),"Creating..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Plus,{className:"size-4"}),"Start a Session"]})}),(0,b.jsxs)("p",{className:"mt-6 text-xs text-muted-foreground/70",children:["Press ",(0,b.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"⌘"})," + ",(0,b.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"T"})," to create a new session"]}),!y&&x.length>0&&(0,b.jsxs)("div",{className:"mt-10 text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)(m.default,{className:"size-4 text-muted-foreground"}),(0,b.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"})]}),(0,b.jsx)("div",{className:"rounded-xl border border-border/60 bg-card/50 backdrop-blur-sm overflow-hidden",children:(0,b.jsx)(r.ScrollArea,{className:(0,v.cn)(x.length>5?"h-[280px]":""),children:(0,b.jsx)("div",{className:"divide-y divide-border/40",children:x.map(a=>{let c,d,e,g,h=J===a.id,i=!0===a.isStreaming;return(0,b.jsxs)(f.default,{href:`/session/${a.id}`,className:(0,v.cn)("flex items-center gap-3 p-3 transition-colors hover:bg-accent/50 group",i&&"bg-emerald-500/5"),onMouseEnter:()=>K(a.id),onMouseLeave:()=>K(null),children:[(0,b.jsx)("div",{className:(0,v.cn)("size-9 rounded-lg flex items-center justify-center shrink-0 transition-colors",i?"bg-emerald-500/10":"bg-muted/60 group-hover:bg-muted"),children:i?(0,b.jsx)("span",{className:"size-2.5 rounded-full bg-emerald-500 animate-pulse"}):(0,b.jsx)(l.MessageSquare,{className:"size-4 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:(0,v.cn)("text-sm font-medium truncate",i&&"text-emerald-600 dark:text-emerald-400"),children:a.name||"Untitled Session"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:i?(0,b.jsx)("span",{className:"text-emerald-600 dark:text-emerald-400",children:"Active now"}):"waiting"===a.status?(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Waiting for input"}):(c=new Date(a.updatedAt||a.createdAt),g=Math.floor((e=Math.floor((d=Math.floor(Math.floor((new Date().getTime()-c.getTime())/1e3)/60))/60))/24),d<1?"just now":1===d?"1 minute ago":d<60?`${d} minutes ago`:1===e?"1 hour ago":e<24?`${e} hours ago`:1===g?"yesterday":g<7?`${g} days ago`:`${Math.floor(g/7)} weeks ago`)})]}),h&&(0,b.jsx)(o.TooltipProvider,{children:(0,b.jsxs)(o.Tooltip,{children:[(0,b.jsx)(o.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(p.Button,{size:"icon",variant:"ghost",className:"size-7 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:b=>M(b,a.id),children:(0,b.jsx)(n.Trash2,{className:"size-3.5"})})}),(0,b.jsx)(o.TooltipContent,{children:"Delete session"})]})})]},a.id)})})})})]})]})})}function x(){return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,b.jsx)(h.Loader2,{className:"size-6 animate-spin text-muted-foreground"})}),children:(0,b.jsx)(w,{})})}a.s(["default",()=>x],908810)}];
1
+ module.exports=[908810,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(832315),e=a.i(746881),f=a.i(546640),g=a.i(916454),h=a.i(252831),i=a.i(221557),j=a.i(917999),j=j,k=a.i(290293),k=k,l=a.i(544244),m=a.i(784268),m=m,n=a.i(762491),o=a.i(670923),p=a.i(476031),q=a.i(338706),r=a.i(331893),s=a.i(979412),t=a.i(555941),u=a.i(828278),v=a.i(156033);function w(){let a=(0,d.useRouter)(),w=(0,d.useSearchParams)(),{sessions:x,isLoading:y}=(0,u.useSessions)(),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(null),[D,E]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(null),[J,K]=(0,c.useState)(null),L=(0,c.useRef)(!1),M=async(a,b)=>{a.preventDefault(),a.stopPropagation();try{await (0,s.deleteSession)(b),(0,u.mutateSessions)()}catch(a){console.error("Failed to delete session:",a)}};(0,c.useEffect)(()=>{(0,t.getConfig)().then(C)},[]),(0,c.useEffect)(()=>{w.has("new")&&B&&B.apiKeyConfigured&&!L.current&&!z&&(L.current=!0,(async()=>{A(!0);try{let b=await (0,s.createSession)({name:`Session ${x.length+1}`,model:B.defaultModel||"anthropic/claude-opus-4.7",toolApprovals:B.defaultToolApprovals||{}});(0,u.mutateSessions)(),a.replace(`/session/${b.id}`)}catch(a){console.error("Failed to auto-create session:",a),A(!1)}})())},[w,B,x.length,z,a]),(0,c.useEffect)(()=>{w.has("latest")&&!y&&x.length>0&&a.replace(`/session/${x[0].id}`)},[w,y,x,a]);let N=async()=>{if(D.trim()&&!F){G(!0),I(null);try{if((await (0,s.setApiKey)("ai-gateway",D.trim())).success){let a=await (0,t.getConfig)();C(a),E("")}else I("Failed to save API key. Please try again.")}catch(a){I("Failed to save API key. Please try again.")}finally{G(!1)}}},O=async()=>{if(!z){A(!0);try{let b=await (0,s.createSession)({name:`Session ${x.length+1}`,model:B?.defaultModel||"anthropic/claude-opus-4.7",toolApprovals:B?.defaultToolApprovals||{}});(0,u.mutateSessions)(),a.push(`/session/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{A(!1)}}};return((0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"t"===a.key&&(a.preventDefault(),O())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[z,x.length,B]),B&&!B.apiKeyConfigured)?(0,b.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20",children:(0,b.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,b.jsx)("div",{className:"flex justify-center mb-8",children:(0,b.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10",children:(0,b.jsx)(e.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover",priority:!0})})}),(0,b.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,b.jsxs)("div",{className:"bg-muted/50 rounded-lg p-6 mb-6 text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)(i.Key,{className:"size-5 text-amber-500"}),(0,b.jsx)("h2",{className:"font-semibold",children:"API Key Required"})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"SparkECoder uses the Vercel AI Gateway. Enter your API key to get started."}),(0,b.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,b.jsx)(q.Input,{type:"password",placeholder:"Enter your AI Gateway API key",value:D,onChange:a=>E(a.target.value),onKeyDown:a=>"Enter"===a.key&&N(),className:"flex-1"}),(0,b.jsx)(p.Button,{onClick:N,disabled:!D.trim()||F,children:F?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):"Save"})]}),H&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive mb-3",children:[(0,b.jsx)(k.default,{className:"size-4"}),H]}),(0,b.jsxs)("a",{href:"https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-primary hover:underline",children:["Get an API key from Vercel",(0,b.jsx)(j.default,{className:"size-3"})]})]})]})}):(0,b.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20 overflow-auto",children:(0,b.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,b.jsx)("div",{className:"flex justify-center mb-8",children:(0,b.jsx)(o.TooltipProvider,{children:(0,b.jsxs)(o.Tooltip,{children:[(0,b.jsx)(o.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"relative group cursor-pointer",children:[(0,b.jsx)("div",{className:"absolute inset-0 rounded-3xl blur-2xl opacity-40 group-hover:opacity-60 transition-opacity bg-primary/30"}),(0,b.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10 hover-lift",children:(0,b.jsx)(e.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover sparke-idle",priority:!0})})]})}),(0,b.jsx)(o.TooltipContent,{children:"Meet Sparke, your coding companion!"})]})})}),(0,b.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,b.jsx)("p",{className:"text-muted-foreground mb-8 leading-relaxed",children:"Your AI-powered coding assistant. Start a new session to begin building amazing things."}),(0,b.jsx)(p.Button,{size:"lg",onClick:O,disabled:z,className:"gap-2 px-8",children:z?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}),"Creating..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Plus,{className:"size-4"}),"Start a Session"]})}),(0,b.jsxs)("p",{className:"mt-6 text-xs text-muted-foreground/70",children:["Press ",(0,b.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"⌘"})," + ",(0,b.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"T"})," to create a new session"]}),!y&&x.length>0&&(0,b.jsxs)("div",{className:"mt-10 text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)(m.default,{className:"size-4 text-muted-foreground"}),(0,b.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"})]}),(0,b.jsx)("div",{className:"rounded-xl border border-border/60 bg-card/50 backdrop-blur-sm overflow-hidden",children:(0,b.jsx)(r.ScrollArea,{className:(0,v.cn)(x.length>5?"h-[280px]":""),children:(0,b.jsx)("div",{className:"divide-y divide-border/40",children:x.map(a=>{let c,d,e,g,h=J===a.id,i=!0===a.isStreaming;return(0,b.jsxs)(f.default,{href:`/session/${a.id}`,className:(0,v.cn)("flex items-center gap-3 p-3 transition-colors hover:bg-accent/50 group",i&&"bg-emerald-500/5"),onMouseEnter:()=>K(a.id),onMouseLeave:()=>K(null),children:[(0,b.jsx)("div",{className:(0,v.cn)("size-9 rounded-lg flex items-center justify-center shrink-0 transition-colors",i?"bg-emerald-500/10":"bg-muted/60 group-hover:bg-muted"),children:i?(0,b.jsx)("span",{className:"size-2.5 rounded-full bg-emerald-500 animate-pulse"}):(0,b.jsx)(l.MessageSquare,{className:"size-4 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:(0,v.cn)("text-sm font-medium truncate",i&&"text-emerald-600 dark:text-emerald-400"),children:a.name||"Untitled Session"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:i?(0,b.jsx)("span",{className:"text-emerald-600 dark:text-emerald-400",children:"Active now"}):"waiting"===a.status?(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Waiting for input"}):(c=new Date(a.updatedAt||a.createdAt),g=Math.floor((e=Math.floor((d=Math.floor(Math.floor((new Date().getTime()-c.getTime())/1e3)/60))/60))/24),d<1?"just now":1===d?"1 minute ago":d<60?`${d} minutes ago`:1===e?"1 hour ago":e<24?`${e} hours ago`:1===g?"yesterday":g<7?`${g} days ago`:`${Math.floor(g/7)} weeks ago`)})]}),h&&(0,b.jsx)(o.TooltipProvider,{children:(0,b.jsxs)(o.Tooltip,{children:[(0,b.jsx)(o.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(p.Button,{size:"icon",variant:"ghost",className:"size-7 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:b=>M(b,a.id),children:(0,b.jsx)(n.Trash2,{className:"size-3.5"})})}),(0,b.jsx)(o.TooltipContent,{children:"Delete session"})]})})]},a.id)})})})})]})]})})}function x(){return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,b.jsx)(h.Loader2,{className:"size-6 animate-spin text-muted-foreground"})}),children:(0,b.jsx)(w,{})})}a.s(["default",()=>x],908810)}];
2
2
 
3
3
  //# sourceMappingURL=web_src_app_%28main%29_page_tsx_5ac4794b._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[881326,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(832315),e=a.i(546640),f=a.i(746881),g=a.i(916454),h=a.i(544244),i=a.i(762491),j=a.i(252831),k=a.i(179743),l=a.i(335520);let m=(0,l.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var n=a.i(17655),o=a.i(221557),p=a.i(95041),q=a.i(300274),r=a.i(211487),r=r;let s=(0,l.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),t=(0,l.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);var u=a.i(952631),v=a.i(189854),w=a.i(958792),x=a.i(507031),y=a.i(476031),z=a.i(806634),A=a.i(338706),B=a.i(878137),C=a.i(679609),D=a.i(946253),E=a.i(670923),F=a.i(979412),G=a.i(605571),H=a.i(642392),I=a.i(555941),J=a.i(156033),K=a.i(828278),L=a.i(7478);function M(){let a=(0,d.useRouter)(),l=(0,d.usePathname)(),{state:M,toggleSidebar:N}=(0,x.useSidebar)(),{sessions:O,isLoading:P}=(0,K.useSessions)(),[Q,R]=(0,c.useState)(!1),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(!1),[W,X]=(0,c.useState)(null),[Y,Z]=(0,c.useState)(null),$=(0,c.useRef)(null),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)({}),[af,ag]=(0,c.useState)(!1),[ah,ai]=(0,c.useState)(""),aj={type:"object",properties:{},required:[]},[ak,al]=(0,c.useState)(aj),[am,an]=(0,c.useState)(""),[ao,ap]=(0,c.useState)(""),[aq,ar]=(0,c.useState)(""),[as,at]=(0,c.useState)(""),[au,av]=(0,c.useState)("50"),[aw,ax]=(0,c.useState)(!1),[ay,az]=(0,c.useState)([]),[aA,aB]=(0,c.useState)(null),[aC,aD]=(0,c.useState)(""),[aE,aF]=(0,c.useState)(!1),[aG,aH]=(0,c.useState)(!1),{enabled:aI,setEnabled:aJ}=(0,L.useNotificationSound)(),aK=l.startsWith("/embed/"),aL=l.startsWith("/session/")?l.split("/session/")[1]:l.startsWith("/embed/")?l.split("/embed/")[1]:null,aM=aK?"/embed":"/session",aN=O.some(a=>a.isStreaming),aO=async()=>{let a=await (0,I.getConfig)();X(a),ac(a.defaultModel),ae(a.defaultToolApprovals)},aP=async()=>{try{let a=await (0,F.getApiKeys)();az(a.providers)}catch(a){console.error("Failed to load API keys:",a)}};(0,c.useEffect)(()=>{aO(),aP()},[]),(0,c.useEffect)(()=>{U&&aP()},[U]);let aQ=async a=>{if(aC.trim()){aH(!0);try{await (0,F.setApiKey)(a,aC),await aP(),aB(null),aD(""),aF(!1)}catch(a){console.error("Failed to save API key:",a)}finally{aH(!1)}}},aR=()=>{aB(null),aD(""),aF(!1)};(0,c.useEffect)(()=>{$.current&&(aN?$.current.play().catch(()=>{}):($.current.pause(),$.current.currentTime=0))},[aN]);let aS=async()=>{if(!Q){R(!0);try{let b=await (0,F.createSession)({name:`Session ${O.length+1}`,model:W?.defaultModel||"anthropic/claude-opus-4-6",toolApprovals:ad});(0,K.mutateSessions)(),a.push(`${aM}/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{R(!1)}}},aT=async()=>{R(!0);try{let b=await (0,F.createSession)({name:_||`Session ${O.length+1}`,model:ab,toolApprovals:ad});(0,K.mutateSessions)(),aU(),T(!1),a.push(`${aM}/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{R(!1)}},aU=()=>{aa(""),W&&(ac(W.defaultModel),ae(W.defaultToolApprovals))},aV=()=>{ai(""),al(aj),an(""),ap(""),ar(""),at(W?.defaultModel||""),av("50")},aW=async()=>{if(ah.trim()){if(an(""),!ak||"object"!=typeof ak)return void an("Schema must be a JSON object");ax(!0);try{let b=await (0,F.createTask)({prompt:ah,outputSchema:ak,webhookUrl:ao||void 0,model:as||W?.defaultModel,name:aq||void 0,maxIterations:parseInt(au)||50});(0,K.mutateSessions)(),ag(!1),aV(),a.push(`${aM}/${b.taskId}`)}catch(a){console.error("Failed to create task:",a)}finally{ax(!1)}}},aX=async(b,c)=>{b.preventDefault(),b.stopPropagation();try{await (0,F.deleteSession)(c),(0,K.mutateSessions)(),aL===c&&a.push("/")}catch(a){console.error("Failed to delete session:",a)}},aY=a=>{ae(b=>({...b,[a]:!b[a]}))},aZ="collapsed"===M;return(0,b.jsxs)(x.Sidebar,{collapsible:aK?"offcanvas":"icon",className:"border-r border-border/50",children:[(0,b.jsxs)(x.SidebarHeader,{className:(0,J.cn)(aZ?"p-2 space-y-2":"p-3 space-y-3"),children:[!aZ&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsxs)("div",{className:"relative shrink-0 overflow-hidden rounded-xl size-10 shadow-md ring-1 ring-white/10",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"Sparke",width:40,height:40,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,b.jsx)("video",{ref:$,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,J.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",aN?"opacity-100":"opacity-0")})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[(0,b.jsx)("h1",{className:"text-lg font-bold text-foreground",children:"SparkECoder"}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",onClick:N,children:(0,b.jsx)(m,{className:"size-4"})})}),(0,b.jsxs)(E.TooltipContent,{side:"bottom",children:["Collapse ",(0,b.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})})]})]}),(0,b.jsxs)("div",{className:"flex gap-2 w-full",children:[(0,b.jsxs)(y.Button,{onClick:aS,disabled:Q,className:"flex-1 justify-center gap-2 h-9",children:[Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(g.Plus,{className:"size-4"}),"New Agent"]}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{variant:"outline",onClick:()=>{W||aO(),ag(!0)},className:"h-9 px-2.5",children:(0,b.jsx)(u.ListChecks,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"bottom",children:"New Task"})]})})]})]}),aZ&&(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",onClick:N,className:"size-8 mx-auto",children:(0,b.jsx)(n.PanelLeft,{className:"size-4"})})}),(0,b.jsxs)(E.TooltipContent,{side:"right",children:["Expand ",(0,b.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})}),(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-8 shadow-md ring-1 ring-white/10 mx-auto",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,b.jsx)("video",{ref:$,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,J.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",aN?"opacity-100":"opacity-0")})]}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",onClick:aS,disabled:Q,className:"size-8 mx-auto",children:Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(g.Plus,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"New Agent"})]})}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"outline",onClick:()=>{W||aO(),ag(!0)},className:"size-8 mx-auto",children:(0,b.jsx)(u.ListChecks,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"New Task"})]})})]})]}),(0,b.jsx)(z.Dialog,{open:S,onOpenChange:a=>{T(a),a&&aU()},children:(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-primary flex items-center justify-center",children:(0,b.jsx)(k.Settings,{className:"size-4 text-primary-foreground"})}),"New Agent"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"name",className:"text-sm font-medium",children:"Session Name"}),(0,b.jsx)(A.Input,{id:"name",placeholder:"My Coding Project (optional)",value:_,onChange:a=>aa(a.target.value),className:"transition-all focus:ring-2 focus:ring-primary/20"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Model"}),(0,b.jsxs)(D.Select,{value:ab,onValueChange:ac,children:[(0,b.jsx)(D.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:W?.availableTools.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,b.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,b.jsx)(C.Switch,{checked:ad[a.id]??!1,onCheckedChange:()=>aY(a.id)})]},a.id))})]}),(0,b.jsxs)(y.Button,{onClick:aT,disabled:Q,className:"w-full",children:[Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin mr-2"}):(0,b.jsx)(g.Plus,{className:"size-4 mr-2"}),"Create Session"]})]})]})}),(0,b.jsx)(z.Dialog,{open:af,onOpenChange:a=>{ag(a),a&&aV()},children:(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-lg",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-blue-600 flex items-center justify-center",children:(0,b.jsx)(u.ListChecks,{className:"size-4 text-white"})}),"New Task"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-prompt",className:"text-sm font-medium",children:"What should the agent do?"}),(0,b.jsx)(G.Textarea,{id:"task-prompt",placeholder:"e.g. Refactor the auth module to use JWT tokens...",value:ah,onChange:a=>ai(a.target.value),rows:3,autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Expected output shape"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground -mt-0.5",children:"Define the JSON structure the agent must return"}),(0,b.jsx)("div",{className:(0,J.cn)("rounded-md border bg-muted/30 overflow-hidden transition-colors",am&&"border-red-500"),children:(0,b.jsx)(H.VisualJson,{value:ak,onChange:a=>{al(a),an("")},children:(0,b.jsx)(H.TreeView,{className:"h-44 text-sm"})})}),am&&(0,b.jsx)("p",{className:"text-xs text-red-500 mt-1",children:am})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsxs)(D.Select,{value:as,onValueChange:at,children:[(0,b.jsx)(D.SelectTrigger,{className:"h-9",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-name",className:"text-xs text-muted-foreground",children:"Name"}),(0,b.jsx)(A.Input,{id:"task-name",placeholder:"Optional",value:aq,onChange:a=>ar(a.target.value),className:"h-9"})]})]}),(0,b.jsxs)("details",{className:"group",children:[(0,b.jsxs)("summary",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",children:[(0,b.jsx)(v.ChevronDown,{className:"size-3 transition-transform group-open:rotate-180"}),"Advanced"]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-webhook",className:"text-xs text-muted-foreground",children:"Webhook URL"}),(0,b.jsx)(A.Input,{id:"task-webhook",placeholder:"https://...",value:ao,onChange:a=>ap(a.target.value),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-iterations",className:"text-xs text-muted-foreground",children:"Max iterations"}),(0,b.jsx)(A.Input,{id:"task-iterations",type:"number",min:1,max:500,value:au,onChange:a=>av(a.target.value),className:"h-9"})]})]})]}),(0,b.jsx)(y.Button,{onClick:aW,disabled:aw||!ah.trim(),className:"w-full",children:aw?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin mr-2"}),"Creating..."]}):"Start Task"})]})]})}),(0,b.jsx)(x.SidebarContent,{className:"px-2",children:(0,b.jsx)(x.SidebarGroup,{className:"p-0",children:(0,b.jsx)(x.SidebarGroupContent,{children:(0,b.jsx)(x.SidebarMenu,{className:"gap-1",children:P?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(j.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):0===O.length?!aZ&&(0,b.jsxs)("div",{className:"text-center py-8 px-4",children:[(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-12 mx-auto mb-3 shadow-md ring-1 ring-white/10",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:48,height:48,className:"absolute inset-0 size-full object-cover"}),aN&&(0,b.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),(0,b.jsx)("p",{className:"text-sm text-foreground",children:"No sessions yet"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Click New Agent above"})]}):O.map(a=>{let c,d,f,g,j=a.id===aL,k=Y===a.id,l=!0===a.isStreaming,m=!aZ&&(k||j);return(0,b.jsx)(x.SidebarMenuItem,{onMouseEnter:()=>Z(a.id),onMouseLeave:()=>Z(null),children:aZ?(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(e.default,{href:`${aM}/${a.id}`,className:(0,J.cn)("flex items-center justify-center size-8 rounded-lg transition-colors mx-auto",j?"bg-accent":"hover:bg-accent/60",l&&!j&&"bg-emerald-500/10"),children:l?(0,b.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}):(0,b.jsx)(h.MessageSquare,{className:(0,J.cn)("size-4",j?"text-primary":"text-muted-foreground")})})}),(0,b.jsxs)(E.TooltipContent,{side:"right",children:[a.name||"Untitled",l&&" (Running)"]})]})}):(0,b.jsx)(x.SidebarMenuButton,{asChild:!0,isActive:j,className:(0,J.cn)("h-9 transition-all duration-150","hover:bg-accent/60",j&&"bg-accent",l&&!j&&"bg-emerald-500/5"),children:(0,b.jsxs)(e.default,{href:`${aM}/${a.id}`,className:"flex items-center gap-2.5 px-2",children:[l?(0,b.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse shrink-0"}):(0,b.jsx)(h.MessageSquare,{className:(0,J.cn)("size-4 shrink-0",j?"text-primary":"text-muted-foreground")}),(0,b.jsx)("span",{className:(0,J.cn)("truncate flex-1 text-sm",l&&"text-emerald-600 dark:text-emerald-400"),children:a.name||"Untitled"}),a.config?.task?.enabled&&(0,b.jsxs)(w.Badge,{variant:"outline",className:(0,J.cn)("shrink-0 text-[10px] px-1.5 py-0 h-4 font-medium gap-1","completed"===a.config.task.status&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400","failed"===a.config.task.status&&"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400","running"===a.config.task.status&&"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400"),children:[(0,b.jsx)(u.ListChecks,{className:"size-2.5"}),"Task"]}),m?(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-6 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:b=>aX(b,a.id),children:(0,b.jsx)(i.Trash2,{className:"size-3.5"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"Delete session"})]})}):l&&!a.config?.task?.enabled?(0,b.jsx)("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400 shrink-0 font-medium",children:"Active"}):"waiting"===a.status?(0,b.jsx)("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 shrink-0 font-medium",children:"Waiting"}):"error"===a.status?(0,b.jsx)("span",{className:"text-[10px] text-red-600 dark:text-red-400 shrink-0 font-medium",children:"Error"}):(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0 tabular-nums",children:(c=new Date(a.createdAt),g=Math.floor((f=Math.floor((d=Math.floor(Math.floor((new Date().getTime()-c.getTime())/1e3)/60))/60))/24),d<1?"now":d<60?`${d}m`:f<24?`${f}h`:g<7?`${g}d`:`${Math.floor(g/7)}w`)})]})})},a.id)})})})})}),(0,b.jsx)(x.SidebarFooter,{className:(0,J.cn)("border-t border-border/50",aZ?"p-2":"p-3"),children:(0,b.jsx)("div",{className:"flex items-center justify-between",children:aZ?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:(0,b.jsx)("span",{className:(0,J.cn)("size-2 rounded-full",W?.serverConnected?"bg-emerald-500 animate-pulse":"bg-red-500")})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:W?.serverConnected?"Connected":"Disconnected"})]})}),(0,b.jsx)(z.Dialog,{open:U,onOpenChange:V,children:(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(z.DialogTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-8",children:(0,b.jsx)(k.Settings,{className:"size-4"})})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"Settings"})]})})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[W?.serverConnected?(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400",children:[(0,b.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),(0,b.jsx)("span",{children:"Connected"})]}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-red-500",children:[(0,b.jsx)("span",{className:"size-1.5 rounded-full bg-current"}),(0,b.jsx)("span",{children:"Disconnected"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:O.length})]}),(0,b.jsxs)(z.Dialog,{open:U,onOpenChange:V,children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(z.DialogTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,b.jsx)(k.Settings,{className:"size-4"})})})}),(0,b.jsx)(E.TooltipContent,{side:"top",children:"Settings"})]})}),(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,b.jsx)(k.Settings,{className:"size-4"})}),"Settings"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Default Model"}),(0,b.jsxs)(D.Select,{value:ab,onValueChange:ac,children:[(0,b.jsx)(D.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:W?.availableTools.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,b.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,b.jsx)(C.Switch,{checked:ad[a.id]??!1,onCheckedChange:()=>aY(a.id)})]},a.id))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,b.jsx)(o.Key,{className:"size-4"}),"API Keys"]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Configure API keys for different providers. Keys are stored securely on your machine."}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:ay.map(a=>(0,b.jsx)("div",{className:"py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:aA===a.provider?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:a.envVar})]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(A.Input,{type:aE?"text":"password",value:aC,onChange:a=>aD(a.target.value),placeholder:"Paste your API key...",className:"pr-8 text-sm font-mono",autoFocus:!0}),(0,b.jsx)(y.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>aF(!aE),children:aE?(0,b.jsx)(s,{className:"size-4"}):(0,b.jsx)(r.default,{className:"size-4"})})]}),(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:()=>aQ(a.provider),disabled:aG||!aC.trim(),children:aG?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(p.Check,{className:"size-4 text-green-500"})}),(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:aR,children:(0,b.jsx)(q.X,{className:"size-4 text-muted-foreground"})})]})]}):(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),a.configured&&(0,b.jsx)("span",{className:(0,J.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===a.source?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"bg-green-500/20 text-green-600 dark:text-green-400"),children:"env"===a.source?"from env":"saved"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:a.configured?a.maskedKey:"Not configured"})]}),(0,b.jsx)(y.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>aB(a.provider),children:a.configured?"Update":"Add"})]})},a.provider))})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,b.jsx)(t,{className:"size-4"}),"Notification Sound"]}),(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-2.5 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Play sound when done"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Ding when the assistant finishes responding"})]}),(0,b.jsx)(C.Switch,{checked:aI,onCheckedChange:aJ})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings apply to new sessions. You can also change the model per-session in the chat header."})]})]})]})]})})})]})}a.s(["SessionsSidebar",()=>M],881326)}];
1
+ module.exports=[881326,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(832315),e=a.i(546640),f=a.i(746881),g=a.i(916454),h=a.i(544244),i=a.i(762491),j=a.i(252831),k=a.i(179743),l=a.i(335520);let m=(0,l.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var n=a.i(17655),o=a.i(221557),p=a.i(95041),q=a.i(300274),r=a.i(211487),r=r;let s=(0,l.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),t=(0,l.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);var u=a.i(952631),v=a.i(189854),w=a.i(958792),x=a.i(507031),y=a.i(476031),z=a.i(806634),A=a.i(338706),B=a.i(878137),C=a.i(679609),D=a.i(946253),E=a.i(670923),F=a.i(979412),G=a.i(605571),H=a.i(642392),I=a.i(555941),J=a.i(156033),K=a.i(828278),L=a.i(7478);function M(){let a=(0,d.useRouter)(),l=(0,d.usePathname)(),{state:M,toggleSidebar:N}=(0,x.useSidebar)(),{sessions:O,isLoading:P}=(0,K.useSessions)(),[Q,R]=(0,c.useState)(!1),[S,T]=(0,c.useState)(!1),[U,V]=(0,c.useState)(!1),[W,X]=(0,c.useState)(null),[Y,Z]=(0,c.useState)(null),$=(0,c.useRef)(null),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(""),[ad,ae]=(0,c.useState)({}),[af,ag]=(0,c.useState)(!1),[ah,ai]=(0,c.useState)(""),aj={type:"object",properties:{},required:[]},[ak,al]=(0,c.useState)(aj),[am,an]=(0,c.useState)(""),[ao,ap]=(0,c.useState)(""),[aq,ar]=(0,c.useState)(""),[as,at]=(0,c.useState)(""),[au,av]=(0,c.useState)("50"),[aw,ax]=(0,c.useState)(!1),[ay,az]=(0,c.useState)([]),[aA,aB]=(0,c.useState)(null),[aC,aD]=(0,c.useState)(""),[aE,aF]=(0,c.useState)(!1),[aG,aH]=(0,c.useState)(!1),{enabled:aI,setEnabled:aJ}=(0,L.useNotificationSound)(),aK=l.startsWith("/embed/"),aL=l.startsWith("/session/")?l.split("/session/")[1]:l.startsWith("/embed/")?l.split("/embed/")[1]:null,aM=aK?"/embed":"/session",aN=O.some(a=>a.isStreaming),aO=async()=>{let a=await (0,I.getConfig)();X(a),ac(a.defaultModel),ae(a.defaultToolApprovals)},aP=async()=>{try{let a=await (0,F.getApiKeys)();az(a.providers)}catch(a){console.error("Failed to load API keys:",a)}};(0,c.useEffect)(()=>{aO(),aP()},[]),(0,c.useEffect)(()=>{U&&aP()},[U]);let aQ=async a=>{if(aC.trim()){aH(!0);try{await (0,F.setApiKey)(a,aC),await aP(),aB(null),aD(""),aF(!1)}catch(a){console.error("Failed to save API key:",a)}finally{aH(!1)}}},aR=()=>{aB(null),aD(""),aF(!1)};(0,c.useEffect)(()=>{$.current&&(aN?$.current.play().catch(()=>{}):($.current.pause(),$.current.currentTime=0))},[aN]);let aS=async()=>{if(!Q){R(!0);try{let b=await (0,F.createSession)({name:`Session ${O.length+1}`,model:W?.defaultModel||"anthropic/claude-opus-4.7",toolApprovals:ad});(0,K.mutateSessions)(),a.push(`${aM}/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{R(!1)}}},aT=async()=>{R(!0);try{let b=await (0,F.createSession)({name:_||`Session ${O.length+1}`,model:ab,toolApprovals:ad});(0,K.mutateSessions)(),aU(),T(!1),a.push(`${aM}/${b.id}`)}catch(a){console.error("Failed to create session:",a)}finally{R(!1)}},aU=()=>{aa(""),W&&(ac(W.defaultModel),ae(W.defaultToolApprovals))},aV=()=>{ai(""),al(aj),an(""),ap(""),ar(""),at(W?.defaultModel||""),av("50")},aW=async()=>{if(ah.trim()){if(an(""),!ak||"object"!=typeof ak)return void an("Schema must be a JSON object");ax(!0);try{let b=await (0,F.createTask)({prompt:ah,outputSchema:ak,webhookUrl:ao||void 0,model:as||W?.defaultModel,name:aq||void 0,maxIterations:parseInt(au)||50});(0,K.mutateSessions)(),ag(!1),aV(),a.push(`${aM}/${b.taskId}`)}catch(a){console.error("Failed to create task:",a)}finally{ax(!1)}}},aX=async(b,c)=>{b.preventDefault(),b.stopPropagation();try{await (0,F.deleteSession)(c),(0,K.mutateSessions)(),aL===c&&a.push("/")}catch(a){console.error("Failed to delete session:",a)}},aY=a=>{ae(b=>({...b,[a]:!b[a]}))},aZ="collapsed"===M;return(0,b.jsxs)(x.Sidebar,{collapsible:aK?"offcanvas":"icon",className:"border-r border-border/50",children:[(0,b.jsxs)(x.SidebarHeader,{className:(0,J.cn)(aZ?"p-2 space-y-2":"p-3 space-y-3"),children:[!aZ&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsxs)("div",{className:"relative shrink-0 overflow-hidden rounded-xl size-10 shadow-md ring-1 ring-white/10",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"Sparke",width:40,height:40,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,b.jsx)("video",{ref:$,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,J.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",aN?"opacity-100":"opacity-0")})]}),(0,b.jsxs)("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[(0,b.jsx)("h1",{className:"text-lg font-bold text-foreground",children:"SparkECoder"}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",onClick:N,children:(0,b.jsx)(m,{className:"size-4"})})}),(0,b.jsxs)(E.TooltipContent,{side:"bottom",children:["Collapse ",(0,b.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})})]})]}),(0,b.jsxs)("div",{className:"flex gap-2 w-full",children:[(0,b.jsxs)(y.Button,{onClick:aS,disabled:Q,className:"flex-1 justify-center gap-2 h-9",children:[Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(g.Plus,{className:"size-4"}),"New Agent"]}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{variant:"outline",onClick:()=>{W||aO(),ag(!0)},className:"h-9 px-2.5",children:(0,b.jsx)(u.ListChecks,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"bottom",children:"New Task"})]})})]})]}),aZ&&(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",onClick:N,className:"size-8 mx-auto",children:(0,b.jsx)(n.PanelLeft,{className:"size-4"})})}),(0,b.jsxs)(E.TooltipContent,{side:"right",children:["Expand ",(0,b.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})}),(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-8 shadow-md ring-1 ring-white/10 mx-auto",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,b.jsx)("video",{ref:$,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,J.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",aN?"opacity-100":"opacity-0")})]}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",onClick:aS,disabled:Q,className:"size-8 mx-auto",children:Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(g.Plus,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"New Agent"})]})}),(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"outline",onClick:()=>{W||aO(),ag(!0)},className:"size-8 mx-auto",children:(0,b.jsx)(u.ListChecks,{className:"size-4"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"New Task"})]})})]})]}),(0,b.jsx)(z.Dialog,{open:S,onOpenChange:a=>{T(a),a&&aU()},children:(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-primary flex items-center justify-center",children:(0,b.jsx)(k.Settings,{className:"size-4 text-primary-foreground"})}),"New Agent"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"name",className:"text-sm font-medium",children:"Session Name"}),(0,b.jsx)(A.Input,{id:"name",placeholder:"My Coding Project (optional)",value:_,onChange:a=>aa(a.target.value),className:"transition-all focus:ring-2 focus:ring-primary/20"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Model"}),(0,b.jsxs)(D.Select,{value:ab,onValueChange:ac,children:[(0,b.jsx)(D.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:W?.availableTools.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,b.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,b.jsx)(C.Switch,{checked:ad[a.id]??!1,onCheckedChange:()=>aY(a.id)})]},a.id))})]}),(0,b.jsxs)(y.Button,{onClick:aT,disabled:Q,className:"w-full",children:[Q?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin mr-2"}):(0,b.jsx)(g.Plus,{className:"size-4 mr-2"}),"Create Session"]})]})]})}),(0,b.jsx)(z.Dialog,{open:af,onOpenChange:a=>{ag(a),a&&aV()},children:(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-lg",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-blue-600 flex items-center justify-center",children:(0,b.jsx)(u.ListChecks,{className:"size-4 text-white"})}),"New Task"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-prompt",className:"text-sm font-medium",children:"What should the agent do?"}),(0,b.jsx)(G.Textarea,{id:"task-prompt",placeholder:"e.g. Refactor the auth module to use JWT tokens...",value:ah,onChange:a=>ai(a.target.value),rows:3,autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Expected output shape"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground -mt-0.5",children:"Define the JSON structure the agent must return"}),(0,b.jsx)("div",{className:(0,J.cn)("rounded-md border bg-muted/30 overflow-hidden transition-colors",am&&"border-red-500"),children:(0,b.jsx)(H.VisualJson,{value:ak,onChange:a=>{al(a),an("")},children:(0,b.jsx)(H.TreeView,{className:"h-44 text-sm"})})}),am&&(0,b.jsx)("p",{className:"text-xs text-red-500 mt-1",children:am})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsxs)(D.Select,{value:as,onValueChange:at,children:[(0,b.jsx)(D.SelectTrigger,{className:"h-9",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-name",className:"text-xs text-muted-foreground",children:"Name"}),(0,b.jsx)(A.Input,{id:"task-name",placeholder:"Optional",value:aq,onChange:a=>ar(a.target.value),className:"h-9"})]})]}),(0,b.jsxs)("details",{className:"group",children:[(0,b.jsxs)("summary",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",children:[(0,b.jsx)(v.ChevronDown,{className:"size-3 transition-transform group-open:rotate-180"}),"Advanced"]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-webhook",className:"text-xs text-muted-foreground",children:"Webhook URL"}),(0,b.jsx)(A.Input,{id:"task-webhook",placeholder:"https://...",value:ao,onChange:a=>ap(a.target.value),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{htmlFor:"task-iterations",className:"text-xs text-muted-foreground",children:"Max iterations"}),(0,b.jsx)(A.Input,{id:"task-iterations",type:"number",min:1,max:500,value:au,onChange:a=>av(a.target.value),className:"h-9"})]})]})]}),(0,b.jsx)(y.Button,{onClick:aW,disabled:aw||!ah.trim(),className:"w-full",children:aw?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin mr-2"}),"Creating..."]}):"Start Task"})]})]})}),(0,b.jsx)(x.SidebarContent,{className:"px-2",children:(0,b.jsx)(x.SidebarGroup,{className:"p-0",children:(0,b.jsx)(x.SidebarGroupContent,{children:(0,b.jsx)(x.SidebarMenu,{className:"gap-1",children:P?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(j.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):0===O.length?!aZ&&(0,b.jsxs)("div",{className:"text-center py-8 px-4",children:[(0,b.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-12 mx-auto mb-3 shadow-md ring-1 ring-white/10",children:[(0,b.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:48,height:48,className:"absolute inset-0 size-full object-cover"}),aN&&(0,b.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),(0,b.jsx)("p",{className:"text-sm text-foreground",children:"No sessions yet"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Click New Agent above"})]}):O.map(a=>{let c,d,f,g,j=a.id===aL,k=Y===a.id,l=!0===a.isStreaming,m=!aZ&&(k||j);return(0,b.jsx)(x.SidebarMenuItem,{onMouseEnter:()=>Z(a.id),onMouseLeave:()=>Z(null),children:aZ?(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(e.default,{href:`${aM}/${a.id}`,className:(0,J.cn)("flex items-center justify-center size-8 rounded-lg transition-colors mx-auto",j?"bg-accent":"hover:bg-accent/60",l&&!j&&"bg-emerald-500/10"),children:l?(0,b.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}):(0,b.jsx)(h.MessageSquare,{className:(0,J.cn)("size-4",j?"text-primary":"text-muted-foreground")})})}),(0,b.jsxs)(E.TooltipContent,{side:"right",children:[a.name||"Untitled",l&&" (Running)"]})]})}):(0,b.jsx)(x.SidebarMenuButton,{asChild:!0,isActive:j,className:(0,J.cn)("h-9 transition-all duration-150","hover:bg-accent/60",j&&"bg-accent",l&&!j&&"bg-emerald-500/5"),children:(0,b.jsxs)(e.default,{href:`${aM}/${a.id}`,className:"flex items-center gap-2.5 px-2",children:[l?(0,b.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse shrink-0"}):(0,b.jsx)(h.MessageSquare,{className:(0,J.cn)("size-4 shrink-0",j?"text-primary":"text-muted-foreground")}),(0,b.jsx)("span",{className:(0,J.cn)("truncate flex-1 text-sm",l&&"text-emerald-600 dark:text-emerald-400"),children:a.name||"Untitled"}),a.config?.task?.enabled&&(0,b.jsxs)(w.Badge,{variant:"outline",className:(0,J.cn)("shrink-0 text-[10px] px-1.5 py-0 h-4 font-medium gap-1","completed"===a.config.task.status&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400","failed"===a.config.task.status&&"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400","running"===a.config.task.status&&"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400"),children:[(0,b.jsx)(u.ListChecks,{className:"size-2.5"}),"Task"]}),m?(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-6 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:b=>aX(b,a.id),children:(0,b.jsx)(i.Trash2,{className:"size-3.5"})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"Delete session"})]})}):l&&!a.config?.task?.enabled?(0,b.jsx)("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400 shrink-0 font-medium",children:"Active"}):"waiting"===a.status?(0,b.jsx)("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 shrink-0 font-medium",children:"Waiting"}):"error"===a.status?(0,b.jsx)("span",{className:"text-[10px] text-red-600 dark:text-red-400 shrink-0 font-medium",children:"Error"}):(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0 tabular-nums",children:(c=new Date(a.createdAt),g=Math.floor((f=Math.floor((d=Math.floor(Math.floor((new Date().getTime()-c.getTime())/1e3)/60))/60))/24),d<1?"now":d<60?`${d}m`:f<24?`${f}h`:g<7?`${g}d`:`${Math.floor(g/7)}w`)})]})})},a.id)})})})})}),(0,b.jsx)(x.SidebarFooter,{className:(0,J.cn)("border-t border-border/50",aZ?"p-2":"p-3"),children:(0,b.jsx)("div",{className:"flex items-center justify-between",children:aZ?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:(0,b.jsx)("span",{className:(0,J.cn)("size-2 rounded-full",W?.serverConnected?"bg-emerald-500 animate-pulse":"bg-red-500")})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:W?.serverConnected?"Connected":"Disconnected"})]})}),(0,b.jsx)(z.Dialog,{open:U,onOpenChange:V,children:(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(z.DialogTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-8",children:(0,b.jsx)(k.Settings,{className:"size-4"})})})}),(0,b.jsx)(E.TooltipContent,{side:"right",children:"Settings"})]})})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[W?.serverConnected?(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400",children:[(0,b.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),(0,b.jsx)("span",{children:"Connected"})]}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5 text-red-500",children:[(0,b.jsx)("span",{className:"size-1.5 rounded-full bg-current"}),(0,b.jsx)("span",{children:"Disconnected"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:O.length})]}),(0,b.jsxs)(z.Dialog,{open:U,onOpenChange:V,children:[(0,b.jsx)(E.TooltipProvider,{children:(0,b.jsxs)(E.Tooltip,{children:[(0,b.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(z.DialogTrigger,{asChild:!0,children:(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,b.jsx)(k.Settings,{className:"size-4"})})})}),(0,b.jsx)(E.TooltipContent,{side:"top",children:"Settings"})]})}),(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsxs)(z.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,b.jsx)(k.Settings,{className:"size-4"})}),"Settings"]})}),(0,b.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(B.Label,{className:"text-sm font-medium",children:"Default Model"}),(0,b.jsxs)(D.Select,{value:ab,onValueChange:ac,children:[(0,b.jsx)(D.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,b.jsx)(D.SelectValue,{placeholder:"Select a model"})}),(0,b.jsx)(D.SelectContent,{children:W?.availableModels.map(a=>(0,b.jsx)(D.SelectItem,{value:a.id,children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{children:a.name}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:W?.availableTools.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,b.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,b.jsx)(C.Switch,{checked:ad[a.id]??!1,onCheckedChange:()=>aY(a.id)})]},a.id))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,b.jsx)(o.Key,{className:"size-4"}),"API Keys"]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Configure API keys for different providers. Keys are stored securely on your machine."}),(0,b.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:ay.map(a=>(0,b.jsx)("div",{className:"py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:aA===a.provider?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:a.envVar})]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(A.Input,{type:aE?"text":"password",value:aC,onChange:a=>aD(a.target.value),placeholder:"Paste your API key...",className:"pr-8 text-sm font-mono",autoFocus:!0}),(0,b.jsx)(y.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>aF(!aE),children:aE?(0,b.jsx)(s,{className:"size-4"}):(0,b.jsx)(r.default,{className:"size-4"})})]}),(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:()=>aQ(a.provider),disabled:aG||!aC.trim(),children:aG?(0,b.jsx)(j.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(p.Check,{className:"size-4 text-green-500"})}),(0,b.jsx)(y.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:aR,children:(0,b.jsx)(q.X,{className:"size-4 text-muted-foreground"})})]})]}):(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),a.configured&&(0,b.jsx)("span",{className:(0,J.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===a.source?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"bg-green-500/20 text-green-600 dark:text-green-400"),children:"env"===a.source?"from env":"saved"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:a.configured?a.maskedKey:"Not configured"})]}),(0,b.jsx)(y.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>aB(a.provider),children:a.configured?"Update":"Add"})]})},a.provider))})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsxs)(B.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,b.jsx)(t,{className:"size-4"}),"Notification Sound"]}),(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-2.5 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:"Play sound when done"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Ding when the assistant finishes responding"})]}),(0,b.jsx)(C.Switch,{checked:aI,onCheckedChange:aJ})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings apply to new sessions. You can also change the model per-session in the chat header."})]})]})]})]})})})]})}a.s(["SessionsSidebar",()=>M],881326)}];
2
2
 
3
3
  //# sourceMappingURL=web_src_components_sessions-sidebar_tsx_92510070._.js.map
@@ -1 +1 @@
1
- <!DOCTYPE html><!--uUaN7Xe5kF_pP6zhfaeYi--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/><link rel="stylesheet" href="/_next/static/chunks/2473c16c0c2f6b5f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/chunks/74b64476a24dd71e.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/b9ad1584d4e11d12.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-597558bb7b6982f6.js" async=""></script><script src="/_next/static/chunks/b31b0765abe0c427.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a0a0a"/><title>SparkeCoder - AI-Powered Coding Agent</title><meta name="description" content="SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming."/><meta name="author" content="SparkeCoder Team"/><link rel="manifest" href="/manifest.json"/><meta name="keywords" content="AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming"/><meta name="creator" content="SparkeCoder"/><meta name="publisher" content="SparkeCoder"/><meta name="robots" content="index, follow"/><meta name="googlebot" content="index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"/><meta name="category" content="technology"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="SparkeCoder"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><meta property="og:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta property="og:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta property="og:site_name" content="SparkeCoder"/><meta property="og:locale" content="en_US"/><meta property="og:image" content="http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png"/><meta property="og:image:width" content="512"/><meta property="og:image:height" content="512"/><meta property="og:image:type" content="image/png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta name="twitter:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta name="twitter:image" content="http://localhost:3001/twitter-image.png?twitter-image.ce342317.png"/><meta name="twitter:image:width" content="512"/><meta name="twitter:image:height" content="512"/><meta name="twitter:image:type" content="image/png"/><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/icon.png?icon.fdefec0f.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-icon.png?apple-icon.d6d14cbd.png" sizes="180x180" type="image/png"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[760800,[\"/_next/static/chunks/b31b0765abe0c427.js\"],\"ApiInit\"]\n3:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n5:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\na:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nc:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"style\"]\n:HL[\"/_next/static/chunks/74b64476a24dd71e.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"uUaN7Xe5kF_pP6zhfaeYi\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/74b64476a24dd71e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/b31b0765abe0c427.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=5\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#ffffff\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#0a0a0a\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n7:null\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"title\",\"0\",{\"children\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"SparkeCoder Team\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"keywords\",\"content\":\"AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming\"}],[\"$\",\"meta\",\"5\",{\"name\":\"creator\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"6\",{\"name\":\"publisher\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"7\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"8\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"9\",{\"name\":\"category\",\"content\":\"technology\"}],[\"$\",\"meta\",\"10\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"11\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"12\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"13\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:site_name\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image\",\"content\":\"http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:image:type\",\"content\":\"image/png\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"http://localhost:3001/twitter-image.png?twitter-image.ce342317.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image:type\",\"content\":\"image/png\"}],[\"$\",\"link\",\"30\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"31\",{\"rel\":\"icon\",\"href\":\"/icon.png?icon.fdefec0f.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"32\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?apple-icon.d6d14cbd.png\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"33\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--_ax3tJNqBGukss29jpu41--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/><link rel="stylesheet" href="/_next/static/chunks/2473c16c0c2f6b5f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/chunks/74b64476a24dd71e.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/b9ad1584d4e11d12.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-597558bb7b6982f6.js" async=""></script><script src="/_next/static/chunks/9fce2ce79c4c834e.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a0a0a"/><title>SparkeCoder - AI-Powered Coding Agent</title><meta name="description" content="SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming."/><meta name="author" content="SparkeCoder Team"/><link rel="manifest" href="/manifest.json"/><meta name="keywords" content="AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming"/><meta name="creator" content="SparkeCoder"/><meta name="publisher" content="SparkeCoder"/><meta name="robots" content="index, follow"/><meta name="googlebot" content="index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"/><meta name="category" content="technology"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="SparkeCoder"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><meta property="og:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta property="og:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta property="og:site_name" content="SparkeCoder"/><meta property="og:locale" content="en_US"/><meta property="og:image" content="http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png"/><meta property="og:image:width" content="512"/><meta property="og:image:height" content="512"/><meta property="og:image:type" content="image/png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta name="twitter:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta name="twitter:image" content="http://localhost:3001/twitter-image.png?twitter-image.ce342317.png"/><meta name="twitter:image:width" content="512"/><meta name="twitter:image:height" content="512"/><meta name="twitter:image:type" content="image/png"/><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/icon.png?icon.fdefec0f.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-icon.png?apple-icon.d6d14cbd.png" sizes="180x180" type="image/png"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[760800,[\"/_next/static/chunks/9fce2ce79c4c834e.js\"],\"ApiInit\"]\n3:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n5:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\na:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nc:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n:HL[\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"style\"]\n:HL[\"/_next/static/chunks/74b64476a24dd71e.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"-ax3tJNqBGukss29jpu41\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2473c16c0c2f6b5f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/74b64476a24dd71e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/9fce2ce79c4c834e.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=5\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#ffffff\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#0a0a0a\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n7:null\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"title\",\"0\",{\"children\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"SparkeCoder Team\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"keywords\",\"content\":\"AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming\"}],[\"$\",\"meta\",\"5\",{\"name\":\"creator\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"6\",{\"name\":\"publisher\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"7\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"8\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"9\",{\"name\":\"category\",\"content\":\"technology\"}],[\"$\",\"meta\",\"10\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"11\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"12\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"13\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:site_name\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image\",\"content\":\"http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:image:type\",\"content\":\"image/png\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"http://localhost:3001/twitter-image.png?twitter-image.ce342317.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image:type\",\"content\":\"image/png\"}],[\"$\",\"link\",\"30\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"31\",{\"rel\":\"icon\",\"href\":\"/icon.png?icon.fdefec0f.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"32\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?apple-icon.d6d14cbd.png\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"33\",{}]]\n"])</script></body></html>
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><!--uUaN7Xe5kF_pP6zhfaeYi--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/b9ad1584d4e11d12.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-597558bb7b6982f6.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
- @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n3:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\n9:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nb:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"uUaN7Xe5kF_pP6zhfaeYi\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--_ax3tJNqBGukss29jpu41--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/b9ad1584d4e11d12.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-597558bb7b6982f6.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
2
+ @media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n3:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\n9:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nb:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"-ax3tJNqBGukss29jpu41\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"c:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n6:null\na:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Lc\",\"1\",{}]]\n"])</script></body></html>
@@ -1 +1 @@
1
- self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"+hgW8SzHiWV+oubfiKHeoF7SGsQQ4kZkyJuCJMUBCcE=\"\n}"
1
+ self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"CvRCbC8eJb7NkSRXB3zVqV+Abb3PpkJL9TyQnXQ920Y=\"\n}"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": {},
3
3
  "edge": {},
4
- "encryptionKey": "+hgW8SzHiWV+oubfiKHeoF7SGsQQ4kZkyJuCJMUBCcE="
4
+ "encryptionKey": "CvRCbC8eJb7NkSRXB3zVqV+Abb3PpkJL9TyQnXQ920Y="
5
5
  }
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,996720,e=>{"use strict";var s=e.i(257868);e.s(["Plus",()=>s.default])},667249,e=>{"use strict";let s=(0,e.i(292511).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>s],667249)},846193,e=>{"use strict";let s=(0,e.i(292511).default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);e.s(["Key",()=>s],846193)},421722,e=>{"use strict";var s=e.i(414294),t=e.i(430878),a=e.i(353913),i=e.i(504561),l=e.i(292623),r=e.i(996720),n=e.i(667249),d=e.i(904781),o=e.i(461957),c=e.i(816187),m=e.i(292511);let x=(0,m.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var h=e.i(220563),u=e.i(846193),p=e.i(719583),j=e.i(707387),g=e.i(481298),g=g;let f=(0,m.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),N=(0,m.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);var v=e.i(79092),b=e.i(372379),y=e.i(928574),k=e.i(529757),S=e.i(666904),C=e.i(836191),T=e.i(77982),z=e.i(634066),w=e.i(865259),M=e.i(553880),L=e.i(87614),P=e.i(524741),A=e.i(455706),D=e.i(743053),B=e.i(739963),I=e.i(555552),F=e.i(300739),$=e.i(335130);function q(){let e=(0,a.useRouter)(),m=(0,a.usePathname)(),{state:q,toggleSidebar:E}=(0,k.useSidebar)(),{sessions:V,isLoading:K}=(0,F.useSessions)(),[O,R]=(0,t.useState)(!1),[U,W]=(0,t.useState)(!1),[H,J]=(0,t.useState)(!1),[G,X]=(0,t.useState)(null),[Y,Q]=(0,t.useState)(null),Z=(0,t.useRef)(null),[_,ee]=(0,t.useState)(""),[es,et]=(0,t.useState)(""),[ea,ei]=(0,t.useState)({}),[el,er]=(0,t.useState)(!1),[en,ed]=(0,t.useState)(""),eo={type:"object",properties:{},required:[]},[ec,em]=(0,t.useState)(eo),[ex,eh]=(0,t.useState)(""),[eu,ep]=(0,t.useState)(""),[ej,eg]=(0,t.useState)(""),[ef,eN]=(0,t.useState)(""),[ev,eb]=(0,t.useState)("50"),[ey,ek]=(0,t.useState)(!1),[eS,eC]=(0,t.useState)([]),[eT,ez]=(0,t.useState)(null),[ew,eM]=(0,t.useState)(""),[eL,eP]=(0,t.useState)(!1),[eA,eD]=(0,t.useState)(!1),{enabled:eB,setEnabled:eI}=(0,$.useNotificationSound)(),eF=m.startsWith("/embed/"),e$=m.startsWith("/session/")?m.split("/session/")[1]:m.startsWith("/embed/")?m.split("/embed/")[1]:null,eq=eF?"/embed":"/session",eE=V.some(e=>e.isStreaming),eV=async()=>{let e=await (0,B.getConfig)();X(e),et(e.defaultModel),ei(e.defaultToolApprovals)},eK=async()=>{try{let e=await (0,P.getApiKeys)();eC(e.providers)}catch(e){console.error("Failed to load API keys:",e)}};(0,t.useEffect)(()=>{eV(),eK()},[]),(0,t.useEffect)(()=>{H&&eK()},[H]);let eO=async e=>{if(ew.trim()){eD(!0);try{await (0,P.setApiKey)(e,ew),await eK(),ez(null),eM(""),eP(!1)}catch(e){console.error("Failed to save API key:",e)}finally{eD(!1)}}},eR=()=>{ez(null),eM(""),eP(!1)};(0,t.useEffect)(()=>{Z.current&&(eE?Z.current.play().catch(()=>{}):(Z.current.pause(),Z.current.currentTime=0))},[eE]);let eU=async()=>{if(!O){R(!0);try{let s=await (0,P.createSession)({name:`Session ${V.length+1}`,model:G?.defaultModel||"anthropic/claude-opus-4-6",toolApprovals:ea});(0,F.mutateSessions)(),e.push(`${eq}/${s.id}`)}catch(e){console.error("Failed to create session:",e)}finally{R(!1)}}},eW=async()=>{R(!0);try{let s=await (0,P.createSession)({name:_||`Session ${V.length+1}`,model:es,toolApprovals:ea});(0,F.mutateSessions)(),eH(),W(!1),e.push(`${eq}/${s.id}`)}catch(e){console.error("Failed to create session:",e)}finally{R(!1)}},eH=()=>{ee(""),G&&(et(G.defaultModel),ei(G.defaultToolApprovals))},eJ=()=>{ed(""),em(eo),eh(""),ep(""),eg(""),eN(G?.defaultModel||""),eb("50")},eG=async()=>{if(en.trim()){if(eh(""),!ec||"object"!=typeof ec)return void eh("Schema must be a JSON object");ek(!0);try{let s=await (0,P.createTask)({prompt:en,outputSchema:ec,webhookUrl:eu||void 0,model:ef||G?.defaultModel,name:ej||void 0,maxIterations:parseInt(ev)||50});(0,F.mutateSessions)(),er(!1),eJ(),e.push(`${eq}/${s.taskId}`)}catch(e){console.error("Failed to create task:",e)}finally{ek(!1)}}},eX=async(s,t)=>{s.preventDefault(),s.stopPropagation();try{await (0,P.deleteSession)(t),(0,F.mutateSessions)(),e$===t&&e.push("/")}catch(e){console.error("Failed to delete session:",e)}},eY=e=>{ei(s=>({...s,[e]:!s[e]}))},eQ="collapsed"===q;return(0,s.jsxs)(k.Sidebar,{collapsible:eF?"offcanvas":"icon",className:"border-r border-border/50",children:[(0,s.jsxs)(k.SidebarHeader,{className:(0,I.cn)(eQ?"p-2 space-y-2":"p-3 space-y-3"),children:[!eQ&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative shrink-0 overflow-hidden rounded-xl size-10 shadow-md ring-1 ring-white/10",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"Sparke",width:40,height:40,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,s.jsx)("video",{ref:Z,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,I.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",eE?"opacity-100":"opacity-0")})]}),(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[(0,s.jsx)("h1",{className:"text-lg font-bold text-foreground",children:"SparkECoder"}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",onClick:E,children:(0,s.jsx)(x,{className:"size-4"})})}),(0,s.jsxs)(L.TooltipContent,{side:"bottom",children:["Collapse ",(0,s.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 w-full",children:[(0,s.jsxs)(S.Button,{onClick:eU,disabled:O,className:"flex-1 justify-center gap-2 h-9",children:[O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(r.Plus,{className:"size-4"}),"New Agent"]}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{variant:"outline",onClick:()=>{G||eV(),er(!0)},className:"h-9 px-2.5",children:(0,s.jsx)(v.ListChecks,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"bottom",children:"New Task"})]})})]})]}),eQ&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",onClick:E,className:"size-8 mx-auto",children:(0,s.jsx)(h.PanelLeft,{className:"size-4"})})}),(0,s.jsxs)(L.TooltipContent,{side:"right",children:["Expand ",(0,s.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-8 shadow-md ring-1 ring-white/10 mx-auto",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,s.jsx)("video",{ref:Z,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,I.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",eE?"opacity-100":"opacity-0")})]}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",onClick:eU,disabled:O,className:"size-8 mx-auto",children:O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(r.Plus,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"New Agent"})]})}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"outline",onClick:()=>{G||eV(),er(!0)},className:"size-8 mx-auto",children:(0,s.jsx)(v.ListChecks,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"New Task"})]})})]})]}),(0,s.jsx)(C.Dialog,{open:U,onOpenChange:e=>{W(e),e&&eH()},children:(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary flex items-center justify-center",children:(0,s.jsx)(c.Settings,{className:"size-4 text-primary-foreground"})}),"New Agent"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"name",className:"text-sm font-medium",children:"Session Name"}),(0,s.jsx)(T.Input,{id:"name",placeholder:"My Coding Project (optional)",value:_,onChange:e=>ee(e.target.value),className:"transition-all focus:ring-2 focus:ring-primary/20"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Model"}),(0,s.jsxs)(M.Select,{value:es,onValueChange:et,children:[(0,s.jsx)(M.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:G?.availableTools.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:e.name}),e.dangerous&&(0,s.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),(0,s.jsx)(w.Switch,{checked:ea[e.id]??!1,onCheckedChange:()=>eY(e.id)})]},e.id))})]}),(0,s.jsxs)(S.Button,{onClick:eW,disabled:O,className:"w-full",children:[O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}):(0,s.jsx)(r.Plus,{className:"size-4 mr-2"}),"Create Session"]})]})]})}),(0,s.jsx)(C.Dialog,{open:el,onOpenChange:e=>{er(e),e&&eJ()},children:(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-lg",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-blue-600 flex items-center justify-center",children:(0,s.jsx)(v.ListChecks,{className:"size-4 text-white"})}),"New Task"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-prompt",className:"text-sm font-medium",children:"What should the agent do?"}),(0,s.jsx)(A.Textarea,{id:"task-prompt",placeholder:"e.g. Refactor the auth module to use JWT tokens...",value:en,onChange:e=>ed(e.target.value),rows:3,autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Expected output shape"}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground -mt-0.5",children:"Define the JSON structure the agent must return"}),(0,s.jsx)("div",{className:(0,I.cn)("rounded-md border bg-muted/30 overflow-hidden transition-colors",ex&&"border-red-500"),children:(0,s.jsx)(D.VisualJson,{value:ec,onChange:e=>{em(e),eh("")},children:(0,s.jsx)(D.TreeView,{className:"h-44 text-sm"})})}),ex&&(0,s.jsx)("p",{className:"text-xs text-red-500 mt-1",children:ex})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,s.jsxs)(M.Select,{value:ef,onValueChange:eN,children:[(0,s.jsx)(M.SelectTrigger,{className:"h-9",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-name",className:"text-xs text-muted-foreground",children:"Name"}),(0,s.jsx)(T.Input,{id:"task-name",placeholder:"Optional",value:ej,onChange:e=>eg(e.target.value),className:"h-9"})]})]}),(0,s.jsxs)("details",{className:"group",children:[(0,s.jsxs)("summary",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",children:[(0,s.jsx)(b.ChevronDown,{className:"size-3 transition-transform group-open:rotate-180"}),"Advanced"]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-webhook",className:"text-xs text-muted-foreground",children:"Webhook URL"}),(0,s.jsx)(T.Input,{id:"task-webhook",placeholder:"https://...",value:eu,onChange:e=>ep(e.target.value),className:"h-9"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-iterations",className:"text-xs text-muted-foreground",children:"Max iterations"}),(0,s.jsx)(T.Input,{id:"task-iterations",type:"number",min:1,max:500,value:ev,onChange:e=>eb(e.target.value),className:"h-9"})]})]})]}),(0,s.jsx)(S.Button,{onClick:eG,disabled:ey||!en.trim(),className:"w-full",children:ey?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}),"Creating..."]}):"Start Task"})]})]})}),(0,s.jsx)(k.SidebarContent,{className:"px-2",children:(0,s.jsx)(k.SidebarGroup,{className:"p-0",children:(0,s.jsx)(k.SidebarGroupContent,{children:(0,s.jsx)(k.SidebarMenu,{className:"gap-1",children:K?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):0===V.length?!eQ&&(0,s.jsxs)("div",{className:"text-center py-8 px-4",children:[(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-12 mx-auto mb-3 shadow-md ring-1 ring-white/10",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:48,height:48,className:"absolute inset-0 size-full object-cover"}),eE&&(0,s.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),(0,s.jsx)("p",{className:"text-sm text-foreground",children:"No sessions yet"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Click New Agent above"})]}):V.map(e=>{let t,a,l,r,o=e.id===e$,c=Y===e.id,m=!0===e.isStreaming,x=!eQ&&(c||o);return(0,s.jsx)(k.SidebarMenuItem,{onMouseEnter:()=>Q(e.id),onMouseLeave:()=>Q(null),children:eQ?(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(i.default,{href:`${eq}/${e.id}`,className:(0,I.cn)("flex items-center justify-center size-8 rounded-lg transition-colors mx-auto",o?"bg-accent":"hover:bg-accent/60",m&&!o&&"bg-emerald-500/10"),children:m?(0,s.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}):(0,s.jsx)(n.MessageSquare,{className:(0,I.cn)("size-4",o?"text-primary":"text-muted-foreground")})})}),(0,s.jsxs)(L.TooltipContent,{side:"right",children:[e.name||"Untitled",m&&" (Running)"]})]})}):(0,s.jsx)(k.SidebarMenuButton,{asChild:!0,isActive:o,className:(0,I.cn)("h-9 transition-all duration-150","hover:bg-accent/60",o&&"bg-accent",m&&!o&&"bg-emerald-500/5"),children:(0,s.jsxs)(i.default,{href:`${eq}/${e.id}`,className:"flex items-center gap-2.5 px-2",children:[m?(0,s.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse shrink-0"}):(0,s.jsx)(n.MessageSquare,{className:(0,I.cn)("size-4 shrink-0",o?"text-primary":"text-muted-foreground")}),(0,s.jsx)("span",{className:(0,I.cn)("truncate flex-1 text-sm",m&&"text-emerald-600 dark:text-emerald-400"),children:e.name||"Untitled"}),e.config?.task?.enabled&&(0,s.jsxs)(y.Badge,{variant:"outline",className:(0,I.cn)("shrink-0 text-[10px] px-1.5 py-0 h-4 font-medium gap-1","completed"===e.config.task.status&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400","failed"===e.config.task.status&&"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400","running"===e.config.task.status&&"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400"),children:[(0,s.jsx)(v.ListChecks,{className:"size-2.5"}),"Task"]}),x?(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-6 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:s=>eX(s,e.id),children:(0,s.jsx)(d.Trash2,{className:"size-3.5"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"Delete session"})]})}):m&&!e.config?.task?.enabled?(0,s.jsx)("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400 shrink-0 font-medium",children:"Active"}):"waiting"===e.status?(0,s.jsx)("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 shrink-0 font-medium",children:"Waiting"}):"error"===e.status?(0,s.jsx)("span",{className:"text-[10px] text-red-600 dark:text-red-400 shrink-0 font-medium",children:"Error"}):(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0 tabular-nums",children:(t=new Date(e.createdAt),r=Math.floor((l=Math.floor((a=Math.floor(Math.floor((new Date().getTime()-t.getTime())/1e3)/60))/60))/24),a<1?"now":a<60?`${a}m`:l<24?`${l}h`:r<7?`${r}d`:`${Math.floor(r/7)}w`)})]})})},e.id)})})})})}),(0,s.jsx)(k.SidebarFooter,{className:(0,I.cn)("border-t border-border/50",eQ?"p-2":"p-3"),children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:eQ?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)("span",{className:(0,I.cn)("size-2 rounded-full",G?.serverConnected?"bg-emerald-500 animate-pulse":"bg-red-500")})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:G?.serverConnected?"Connected":"Disconnected"})]})}),(0,s.jsx)(C.Dialog,{open:H,onOpenChange:J,children:(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(C.DialogTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-8",children:(0,s.jsx)(c.Settings,{className:"size-4"})})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"Settings"})]})})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[G?.serverConnected?(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400",children:[(0,s.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),(0,s.jsx)("span",{children:"Connected"})]}):(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-red-500",children:[(0,s.jsx)("span",{className:"size-1.5 rounded-full bg-current"}),(0,s.jsx)("span",{children:"Disconnected"})]}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:V.length})]}),(0,s.jsxs)(C.Dialog,{open:H,onOpenChange:J,children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(C.DialogTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,s.jsx)(c.Settings,{className:"size-4"})})})}),(0,s.jsx)(L.TooltipContent,{side:"top",children:"Settings"})]})}),(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,s.jsx)(c.Settings,{className:"size-4"})}),"Settings"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Default Model"}),(0,s.jsxs)(M.Select,{value:es,onValueChange:et,children:[(0,s.jsx)(M.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:G?.availableTools.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:e.name}),e.dangerous&&(0,s.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),(0,s.jsx)(w.Switch,{checked:ea[e.id]??!1,onCheckedChange:()=>eY(e.id)})]},e.id))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(u.Key,{className:"size-4"}),"API Keys"]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Configure API keys for different providers. Keys are stored securely on your machine."}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:eS.map(e=>(0,s.jsx)("div",{className:"py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:eT===e.provider?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium capitalize",children:e.provider}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.envVar})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(T.Input,{type:eL?"text":"password",value:ew,onChange:e=>eM(e.target.value),placeholder:"Paste your API key...",className:"pr-8 text-sm font-mono",autoFocus:!0}),(0,s.jsx)(S.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>eP(!eL),children:eL?(0,s.jsx)(f,{className:"size-4"}):(0,s.jsx)(g.default,{className:"size-4"})})]}),(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:()=>eO(e.provider),disabled:eA||!ew.trim(),children:eA?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(p.Check,{className:"size-4 text-green-500"})}),(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:eR,children:(0,s.jsx)(j.X,{className:"size-4 text-muted-foreground"})})]})]}):(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium capitalize",children:e.provider}),e.configured&&(0,s.jsx)("span",{className:(0,I.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===e.source?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"bg-green-500/20 text-green-600 dark:text-green-400"),children:"env"===e.source?"from env":"saved"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:e.configured?e.maskedKey:"Not configured"})]}),(0,s.jsx)(S.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>ez(e.provider),children:e.configured?"Update":"Add"})]})},e.provider))})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(N,{className:"size-4"}),"Notification Sound"]}),(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-2.5 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Play sound when done"}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Ding when the assistant finishes responding"})]}),(0,s.jsx)(w.Switch,{checked:eB,onCheckedChange:eI})]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings apply to new sessions. You can also change the model per-session in the chat header."})]})]})]})]})})})]})}e.s(["SessionsSidebar",()=>q],421722)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,996720,e=>{"use strict";var s=e.i(257868);e.s(["Plus",()=>s.default])},667249,e=>{"use strict";let s=(0,e.i(292511).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>s],667249)},846193,e=>{"use strict";let s=(0,e.i(292511).default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);e.s(["Key",()=>s],846193)},421722,e=>{"use strict";var s=e.i(414294),t=e.i(430878),a=e.i(353913),i=e.i(504561),l=e.i(292623),r=e.i(996720),n=e.i(667249),d=e.i(904781),o=e.i(461957),c=e.i(816187),m=e.i(292511);let x=(0,m.default)("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var h=e.i(220563),u=e.i(846193),p=e.i(719583),j=e.i(707387),g=e.i(481298),g=g;let f=(0,m.default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),N=(0,m.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);var v=e.i(79092),b=e.i(372379),y=e.i(928574),k=e.i(529757),S=e.i(666904),C=e.i(836191),T=e.i(77982),z=e.i(634066),w=e.i(865259),M=e.i(553880),L=e.i(87614),P=e.i(524741),A=e.i(455706),D=e.i(743053),B=e.i(739963),I=e.i(555552),F=e.i(300739),$=e.i(335130);function q(){let e=(0,a.useRouter)(),m=(0,a.usePathname)(),{state:q,toggleSidebar:E}=(0,k.useSidebar)(),{sessions:V,isLoading:K}=(0,F.useSessions)(),[O,R]=(0,t.useState)(!1),[U,W]=(0,t.useState)(!1),[H,J]=(0,t.useState)(!1),[G,X]=(0,t.useState)(null),[Y,Q]=(0,t.useState)(null),Z=(0,t.useRef)(null),[_,ee]=(0,t.useState)(""),[es,et]=(0,t.useState)(""),[ea,ei]=(0,t.useState)({}),[el,er]=(0,t.useState)(!1),[en,ed]=(0,t.useState)(""),eo={type:"object",properties:{},required:[]},[ec,em]=(0,t.useState)(eo),[ex,eh]=(0,t.useState)(""),[eu,ep]=(0,t.useState)(""),[ej,eg]=(0,t.useState)(""),[ef,eN]=(0,t.useState)(""),[ev,eb]=(0,t.useState)("50"),[ey,ek]=(0,t.useState)(!1),[eS,eC]=(0,t.useState)([]),[eT,ez]=(0,t.useState)(null),[ew,eM]=(0,t.useState)(""),[eL,eP]=(0,t.useState)(!1),[eA,eD]=(0,t.useState)(!1),{enabled:eB,setEnabled:eI}=(0,$.useNotificationSound)(),eF=m.startsWith("/embed/"),e$=m.startsWith("/session/")?m.split("/session/")[1]:m.startsWith("/embed/")?m.split("/embed/")[1]:null,eq=eF?"/embed":"/session",eE=V.some(e=>e.isStreaming),eV=async()=>{let e=await (0,B.getConfig)();X(e),et(e.defaultModel),ei(e.defaultToolApprovals)},eK=async()=>{try{let e=await (0,P.getApiKeys)();eC(e.providers)}catch(e){console.error("Failed to load API keys:",e)}};(0,t.useEffect)(()=>{eV(),eK()},[]),(0,t.useEffect)(()=>{H&&eK()},[H]);let eO=async e=>{if(ew.trim()){eD(!0);try{await (0,P.setApiKey)(e,ew),await eK(),ez(null),eM(""),eP(!1)}catch(e){console.error("Failed to save API key:",e)}finally{eD(!1)}}},eR=()=>{ez(null),eM(""),eP(!1)};(0,t.useEffect)(()=>{Z.current&&(eE?Z.current.play().catch(()=>{}):(Z.current.pause(),Z.current.currentTime=0))},[eE]);let eU=async()=>{if(!O){R(!0);try{let s=await (0,P.createSession)({name:`Session ${V.length+1}`,model:G?.defaultModel||"anthropic/claude-opus-4.7",toolApprovals:ea});(0,F.mutateSessions)(),e.push(`${eq}/${s.id}`)}catch(e){console.error("Failed to create session:",e)}finally{R(!1)}}},eW=async()=>{R(!0);try{let s=await (0,P.createSession)({name:_||`Session ${V.length+1}`,model:es,toolApprovals:ea});(0,F.mutateSessions)(),eH(),W(!1),e.push(`${eq}/${s.id}`)}catch(e){console.error("Failed to create session:",e)}finally{R(!1)}},eH=()=>{ee(""),G&&(et(G.defaultModel),ei(G.defaultToolApprovals))},eJ=()=>{ed(""),em(eo),eh(""),ep(""),eg(""),eN(G?.defaultModel||""),eb("50")},eG=async()=>{if(en.trim()){if(eh(""),!ec||"object"!=typeof ec)return void eh("Schema must be a JSON object");ek(!0);try{let s=await (0,P.createTask)({prompt:en,outputSchema:ec,webhookUrl:eu||void 0,model:ef||G?.defaultModel,name:ej||void 0,maxIterations:parseInt(ev)||50});(0,F.mutateSessions)(),er(!1),eJ(),e.push(`${eq}/${s.taskId}`)}catch(e){console.error("Failed to create task:",e)}finally{ek(!1)}}},eX=async(s,t)=>{s.preventDefault(),s.stopPropagation();try{await (0,P.deleteSession)(t),(0,F.mutateSessions)(),e$===t&&e.push("/")}catch(e){console.error("Failed to delete session:",e)}},eY=e=>{ei(s=>({...s,[e]:!s[e]}))},eQ="collapsed"===q;return(0,s.jsxs)(k.Sidebar,{collapsible:eF?"offcanvas":"icon",className:"border-r border-border/50",children:[(0,s.jsxs)(k.SidebarHeader,{className:(0,I.cn)(eQ?"p-2 space-y-2":"p-3 space-y-3"),children:[!eQ&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative shrink-0 overflow-hidden rounded-xl size-10 shadow-md ring-1 ring-white/10",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"Sparke",width:40,height:40,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,s.jsx)("video",{ref:Z,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,I.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",eE?"opacity-100":"opacity-0")})]}),(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[(0,s.jsx)("h1",{className:"text-lg font-bold text-foreground",children:"SparkECoder"}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",onClick:E,children:(0,s.jsx)(x,{className:"size-4"})})}),(0,s.jsxs)(L.TooltipContent,{side:"bottom",children:["Collapse ",(0,s.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 w-full",children:[(0,s.jsxs)(S.Button,{onClick:eU,disabled:O,className:"flex-1 justify-center gap-2 h-9",children:[O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(r.Plus,{className:"size-4"}),"New Agent"]}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{variant:"outline",onClick:()=>{G||eV(),er(!0)},className:"h-9 px-2.5",children:(0,s.jsx)(v.ListChecks,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"bottom",children:"New Task"})]})})]})]}),eQ&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",onClick:E,className:"size-8 mx-auto",children:(0,s.jsx)(h.PanelLeft,{className:"size-4"})})}),(0,s.jsxs)(L.TooltipContent,{side:"right",children:["Expand ",(0,s.jsx)("kbd",{className:"ml-1 text-[10px] opacity-60",children:"⌘B"})]})]})}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-8 shadow-md ring-1 ring-white/10 mx-auto",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover",priority:!0}),(0,s.jsx)("video",{ref:Z,src:"/sparkecode.mp4",muted:!0,loop:!0,playsInline:!0,className:(0,I.cn)("absolute inset-0 size-full object-cover transition-opacity duration-300",eE?"opacity-100":"opacity-0")})]}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",onClick:eU,disabled:O,className:"size-8 mx-auto",children:O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(r.Plus,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"New Agent"})]})}),(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"outline",onClick:()=>{G||eV(),er(!0)},className:"size-8 mx-auto",children:(0,s.jsx)(v.ListChecks,{className:"size-4"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"New Task"})]})})]})]}),(0,s.jsx)(C.Dialog,{open:U,onOpenChange:e=>{W(e),e&&eH()},children:(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary flex items-center justify-center",children:(0,s.jsx)(c.Settings,{className:"size-4 text-primary-foreground"})}),"New Agent"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"name",className:"text-sm font-medium",children:"Session Name"}),(0,s.jsx)(T.Input,{id:"name",placeholder:"My Coding Project (optional)",value:_,onChange:e=>ee(e.target.value),className:"transition-all focus:ring-2 focus:ring-primary/20"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Model"}),(0,s.jsxs)(M.Select,{value:es,onValueChange:et,children:[(0,s.jsx)(M.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:G?.availableTools.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:e.name}),e.dangerous&&(0,s.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),(0,s.jsx)(w.Switch,{checked:ea[e.id]??!1,onCheckedChange:()=>eY(e.id)})]},e.id))})]}),(0,s.jsxs)(S.Button,{onClick:eW,disabled:O,className:"w-full",children:[O?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}):(0,s.jsx)(r.Plus,{className:"size-4 mr-2"}),"Create Session"]})]})]})}),(0,s.jsx)(C.Dialog,{open:el,onOpenChange:e=>{er(e),e&&eJ()},children:(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-lg",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-blue-600 flex items-center justify-center",children:(0,s.jsx)(v.ListChecks,{className:"size-4 text-white"})}),"New Task"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-prompt",className:"text-sm font-medium",children:"What should the agent do?"}),(0,s.jsx)(A.Textarea,{id:"task-prompt",placeholder:"e.g. Refactor the auth module to use JWT tokens...",value:en,onChange:e=>ed(e.target.value),rows:3,autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Expected output shape"}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground -mt-0.5",children:"Define the JSON structure the agent must return"}),(0,s.jsx)("div",{className:(0,I.cn)("rounded-md border bg-muted/30 overflow-hidden transition-colors",ex&&"border-red-500"),children:(0,s.jsx)(D.VisualJson,{value:ec,onChange:e=>{em(e),eh("")},children:(0,s.jsx)(D.TreeView,{className:"h-44 text-sm"})})}),ex&&(0,s.jsx)("p",{className:"text-xs text-red-500 mt-1",children:ex})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-xs text-muted-foreground",children:"Model"}),(0,s.jsxs)(M.Select,{value:ef,onValueChange:eN,children:[(0,s.jsx)(M.SelectTrigger,{className:"h-9",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-name",className:"text-xs text-muted-foreground",children:"Name"}),(0,s.jsx)(T.Input,{id:"task-name",placeholder:"Optional",value:ej,onChange:e=>eg(e.target.value),className:"h-9"})]})]}),(0,s.jsxs)("details",{className:"group",children:[(0,s.jsxs)("summary",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none hover:text-foreground transition-colors",children:[(0,s.jsx)(b.ChevronDown,{className:"size-3 transition-transform group-open:rotate-180"}),"Advanced"]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-webhook",className:"text-xs text-muted-foreground",children:"Webhook URL"}),(0,s.jsx)(T.Input,{id:"task-webhook",placeholder:"https://...",value:eu,onChange:e=>ep(e.target.value),className:"h-9"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{htmlFor:"task-iterations",className:"text-xs text-muted-foreground",children:"Max iterations"}),(0,s.jsx)(T.Input,{id:"task-iterations",type:"number",min:1,max:500,value:ev,onChange:e=>eb(e.target.value),className:"h-9"})]})]})]}),(0,s.jsx)(S.Button,{onClick:eG,disabled:ey||!en.trim(),className:"w-full",children:ey?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin mr-2"}),"Creating..."]}):"Start Task"})]})]})}),(0,s.jsx)(k.SidebarContent,{className:"px-2",children:(0,s.jsx)(k.SidebarGroup,{className:"p-0",children:(0,s.jsx)(k.SidebarGroupContent,{children:(0,s.jsx)(k.SidebarMenu,{className:"gap-1",children:K?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(o.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):0===V.length?!eQ&&(0,s.jsxs)("div",{className:"text-center py-8 px-4",children:[(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl size-12 mx-auto mb-3 shadow-md ring-1 ring-white/10",children:[(0,s.jsx)(l.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:48,height:48,className:"absolute inset-0 size-full object-cover"}),eE&&(0,s.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),(0,s.jsx)("p",{className:"text-sm text-foreground",children:"No sessions yet"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Click New Agent above"})]}):V.map(e=>{let t,a,l,r,o=e.id===e$,c=Y===e.id,m=!0===e.isStreaming,x=!eQ&&(c||o);return(0,s.jsx)(k.SidebarMenuItem,{onMouseEnter:()=>Q(e.id),onMouseLeave:()=>Q(null),children:eQ?(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(i.default,{href:`${eq}/${e.id}`,className:(0,I.cn)("flex items-center justify-center size-8 rounded-lg transition-colors mx-auto",o?"bg-accent":"hover:bg-accent/60",m&&!o&&"bg-emerald-500/10"),children:m?(0,s.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}):(0,s.jsx)(n.MessageSquare,{className:(0,I.cn)("size-4",o?"text-primary":"text-muted-foreground")})})}),(0,s.jsxs)(L.TooltipContent,{side:"right",children:[e.name||"Untitled",m&&" (Running)"]})]})}):(0,s.jsx)(k.SidebarMenuButton,{asChild:!0,isActive:o,className:(0,I.cn)("h-9 transition-all duration-150","hover:bg-accent/60",o&&"bg-accent",m&&!o&&"bg-emerald-500/5"),children:(0,s.jsxs)(i.default,{href:`${eq}/${e.id}`,className:"flex items-center gap-2.5 px-2",children:[m?(0,s.jsx)("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse shrink-0"}):(0,s.jsx)(n.MessageSquare,{className:(0,I.cn)("size-4 shrink-0",o?"text-primary":"text-muted-foreground")}),(0,s.jsx)("span",{className:(0,I.cn)("truncate flex-1 text-sm",m&&"text-emerald-600 dark:text-emerald-400"),children:e.name||"Untitled"}),e.config?.task?.enabled&&(0,s.jsxs)(y.Badge,{variant:"outline",className:(0,I.cn)("shrink-0 text-[10px] px-1.5 py-0 h-4 font-medium gap-1","completed"===e.config.task.status&&"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400","failed"===e.config.task.status&&"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400","running"===e.config.task.status&&"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400"),children:[(0,s.jsx)(v.ListChecks,{className:"size-2.5"}),"Task"]}),x?(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-6 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:s=>eX(s,e.id),children:(0,s.jsx)(d.Trash2,{className:"size-3.5"})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"Delete session"})]})}):m&&!e.config?.task?.enabled?(0,s.jsx)("span",{className:"inline-flex items-center gap-1 text-[10px] text-emerald-600 dark:text-emerald-400 shrink-0 font-medium",children:"Active"}):"waiting"===e.status?(0,s.jsx)("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 shrink-0 font-medium",children:"Waiting"}):"error"===e.status?(0,s.jsx)("span",{className:"text-[10px] text-red-600 dark:text-red-400 shrink-0 font-medium",children:"Error"}):(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0 tabular-nums",children:(t=new Date(e.createdAt),r=Math.floor((l=Math.floor((a=Math.floor(Math.floor((new Date().getTime()-t.getTime())/1e3)/60))/60))/24),a<1?"now":a<60?`${a}m`:l<24?`${l}h`:r<7?`${r}d`:`${Math.floor(r/7)}w`)})]})})},e.id)})})})})}),(0,s.jsx)(k.SidebarFooter,{className:(0,I.cn)("border-t border-border/50",eQ?"p-2":"p-3"),children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:eQ?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 w-full",children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)("span",{className:(0,I.cn)("size-2 rounded-full",G?.serverConnected?"bg-emerald-500 animate-pulse":"bg-red-500")})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:G?.serverConnected?"Connected":"Disconnected"})]})}),(0,s.jsx)(C.Dialog,{open:H,onOpenChange:J,children:(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(C.DialogTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-8",children:(0,s.jsx)(c.Settings,{className:"size-4"})})})}),(0,s.jsx)(L.TooltipContent,{side:"right",children:"Settings"})]})})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[G?.serverConnected?(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400",children:[(0,s.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),(0,s.jsx)("span",{children:"Connected"})]}):(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-red-500",children:[(0,s.jsx)("span",{className:"size-1.5 rounded-full bg-current"}),(0,s.jsx)("span",{children:"Disconnected"})]}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:V.length})]}),(0,s.jsxs)(C.Dialog,{open:H,onOpenChange:J,children:[(0,s.jsx)(L.TooltipProvider,{children:(0,s.jsxs)(L.Tooltip,{children:[(0,s.jsx)(L.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(C.DialogTrigger,{asChild:!0,children:(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,s.jsx)(c.Settings,{className:"size-4"})})})}),(0,s.jsx)(L.TooltipContent,{side:"top",children:"Settings"})]})}),(0,s.jsxs)(C.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsx)(C.DialogHeader,{children:(0,s.jsxs)(C.DialogTitle,{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,s.jsx)(c.Settings,{className:"size-4"})}),"Settings"]})}),(0,s.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(z.Label,{className:"text-sm font-medium",children:"Default Model"}),(0,s.jsxs)(M.Select,{value:es,onValueChange:et,children:[(0,s.jsx)(M.SelectTrigger,{className:"transition-all hover:border-primary/50",children:(0,s.jsx)(M.SelectValue,{placeholder:"Select a model"})}),(0,s.jsx)(M.SelectContent,{children:G?.availableModels.map(e=>(0,s.jsx)(M.SelectItem,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:e.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.provider})]})},e.id))})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:G?.availableTools.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:e.name}),e.dangerous&&(0,s.jsx)("span",{className:"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium",children:"risky"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e.description})]}),(0,s.jsx)(w.Switch,{checked:ea[e.id]??!1,onCheckedChange:()=>eY(e.id)})]},e.id))})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(u.Key,{className:"size-4"}),"API Keys"]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Configure API keys for different providers. Keys are stored securely on your machine."}),(0,s.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:eS.map(e=>(0,s.jsx)("div",{className:"py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:eT===e.provider?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium capitalize",children:e.provider}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.envVar})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(T.Input,{type:eL?"text":"password",value:ew,onChange:e=>eM(e.target.value),placeholder:"Paste your API key...",className:"pr-8 text-sm font-mono",autoFocus:!0}),(0,s.jsx)(S.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>eP(!eL),children:eL?(0,s.jsx)(f,{className:"size-4"}):(0,s.jsx)(g.default,{className:"size-4"})})]}),(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:()=>eO(e.provider),disabled:eA||!ew.trim(),children:eA?(0,s.jsx)(o.Loader2,{className:"size-4 animate-spin"}):(0,s.jsx)(p.Check,{className:"size-4 text-green-500"})}),(0,s.jsx)(S.Button,{size:"icon",variant:"ghost",className:"shrink-0",onClick:eR,children:(0,s.jsx)(j.X,{className:"size-4 text-muted-foreground"})})]})]}):(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium capitalize",children:e.provider}),e.configured&&(0,s.jsx)("span",{className:(0,I.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===e.source?"bg-blue-500/20 text-blue-600 dark:text-blue-400":"bg-green-500/20 text-green-600 dark:text-green-400"),children:"env"===e.source?"from env":"saved"})]}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono",children:e.configured?e.maskedKey:"Not configured"})]}),(0,s.jsx)(S.Button,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>ez(e.provider),children:e.configured?"Update":"Add"})]})},e.provider))})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(z.Label,{className:"flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(N,{className:"size-4"}),"Notification Sound"]}),(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border p-2.5 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-0",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Play sound when done"}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Ding when the assistant finishes responding"})]}),(0,s.jsx)(w.Switch,{checked:eB,onCheckedChange:eI})]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings apply to new sessions. You can also change the model per-session in the chat header."})]})]})]})]})})})]})}e.s(["SessionsSidebar",()=>q],421722)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,739963,e=>{"use strict";let o="sparkecoder_api_url",i="http://localhost:3141",a=!1;function t(){if(a)return;a=!0;let e=new URLSearchParams(window.location.search),i=e.get("apiUrl");if(i){localStorage.setItem(o,i),e.delete("apiUrl");let a=e.toString()?`${window.location.pathname}?${e.toString()}`:window.location.pathname;window.history.replaceState({},"",a),console.log(`[SparkECoder] API URL set to: ${i}`)}}function r(){return a||t(),localStorage.getItem(o)||i}let n={availableModels:[{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",provider:"Anthropic"},{id:"anthropic/claude-opus-4-6",name:"Claude Opus 4.6",provider:"Anthropic"},{id:"anthropic/claude-opus-4-5",name:"Claude Opus 4.5",provider:"Anthropic"},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-haiku-4-5",name:"Claude Haiku 4.5",provider:"Anthropic"},{id:"openai/gpt-5-2-codex",name:"GPT-5.2 Codex",provider:"OpenAI"},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"Google"},{id:"xai/grok-code-fast-1",name:"Grok Code Fast",provider:"xAI"}],availableTools:[{id:"bash",name:"Bash",description:"Execute shell commands",dangerous:!0},{id:"write_file",name:"Write File",description:"Create or edit files",dangerous:!0},{id:"read_file",name:"Read File",description:"Read file contents",dangerous:!1}],defaultModel:"anthropic/claude-opus-4.7",defaultToolApprovals:{},serverConnected:!1,apiKeyConfigured:!1,apiBaseUrl:i};async function l(){let e=r();try{let o=new AbortController,i=setTimeout(()=>o.abort(),3e3),a=await fetch(`${e}/health`,{signal:o.signal});if(clearTimeout(i),!a.ok)return{...n,apiBaseUrl:e};let t=await a.json();return{...n,defaultModel:t.config?.defaultModel||n.defaultModel,defaultToolApprovals:t.config?.defaultToolApprovals||{},serverConnected:!0,apiKeyConfigured:t.apiKeyConfigured??!1,apiBaseUrl:e}}catch{return{...n,apiBaseUrl:e}}}e.s(["getApiUrl",()=>r,"getConfig",()=>l,"initApiUrl",()=>t])},760800,e=>{"use strict";var o=e.i(430878),i=e.i(739963);function a(){return(0,o.useEffect)(()=>{(0,i.initApiUrl)()},[]),null}e.s(["ApiInit",()=>a])}]);