sparkecoder 0.1.38 → 0.1.40
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.
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__a7aab2da._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_page_tsx_5ac4794b._.js +1 -1
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/web/.next/static/chunks/3425251cd978da61.js +1 -0
- package/web/.next/standalone/web/.next/static/chunks/3c89eb00b6f64d7c.css +1 -0
- package/web/.next/standalone/web/.next/static/{static/chunks/6b8642759b62770c.js → chunks/af2674497ad35311.js} +5 -5
- package/web/.next/standalone/web/.next/static/static/chunks/3425251cd978da61.js +1 -0
- package/web/.next/standalone/web/.next/static/static/chunks/3c89eb00b6f64d7c.css +1 -0
- package/web/.next/{static/chunks/6b8642759b62770c.js → standalone/web/.next/static/static/chunks/af2674497ad35311.js} +5 -5
- package/web/.next/standalone/web/src/app/(main)/page.tsx +49 -3
- package/web/.next/standalone/web/src/components/chat-interface.tsx +23 -28
- package/web/.next/static/chunks/3425251cd978da61.js +1 -0
- package/web/.next/static/chunks/3c89eb00b6f64d7c.css +1 -0
- package/web/.next/{standalone/web/.next/static/chunks/6b8642759b62770c.js → static/chunks/af2674497ad35311.js} +5 -5
- package/web/.next/standalone/web/.next/static/chunks/ad6b9dbb257d62cc.js +0 -1
- package/web/.next/standalone/web/.next/static/chunks/f81a19eca278424b.css +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/ad6b9dbb257d62cc.js +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/f81a19eca278424b.css +0 -1
- package/web/.next/static/chunks/ad6b9dbb257d62cc.js +0 -1
- package/web/.next/static/chunks/f81a19eca278424b.css +0 -1
- /package/web/.next/standalone/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_ssgManifest.js +0 -0
- /package/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_buildManifest.js +0 -0
- /package/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{RyJoI9WcF0eCUVsGPZmWy → jybk5cjreBvhl2R6-xEEB}/_ssgManifest.js +0 -0
package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__a7aab2da._.js
CHANGED
|
@@ -8,6 +8,6 @@ ${a.themeCSS}`),void 0!==a.fontFamily&&(c+=`
|
|
|
8
8
|
|
|
9
9
|
${a0.updateCommand}`;bd(a),a3(!0)}catch(a){console.error("Failed to start update:",a)}finally{a5(!1)}}},a9=a=>a&&"object"==typeof a&&"type"in a&&"value"in a&&("json"===a.type||"text"===a.type)?a.value:a,ba=a=>{let b=[],c=new Map;for(let b of a)if("tool"===b.role&&Array.isArray(b.content)){for(let a of b.content)if("tool-result"===a.type){let b=a.output??a.result;c.set(a.toolCallId,a9(b))}}let d=0;for(let e of a){if("user"===e.role){let a="",c=[];if("string"==typeof e.content)a=e.content;else if(Array.isArray(e.content))for(let b of e.content)"text"===b.type&&"text"in b?a+=b.text:"image"===b.type&&"image"in b?c.push({type:"image",data:b.image,mediaType:b.mediaType}):"file"===b.type&&"data"in b&&c.push({type:"file",data:b.data,mediaType:b.mediaType});b.push({id:e.id,type:"user-message",content:a,messageSequence:d,attachments:c.length>0?c:void 0})}else if("assistant"===e.role){if("string"==typeof e.content)e.content.trim()&&b.push({id:e.id,type:"assistant-text",content:e.content});else if(Array.isArray(e.content))for(let a=0;a<e.content.length;a++){let d=e.content[a];if("reasoning"===d.type&&d.text?.trim())b.push({id:`${e.id}-reasoning-${a}`,type:"reasoning",content:d.text});else if("text"===d.type&&d.text?.trim())b.push({id:`${e.id}-text-${a}`,type:"assistant-text",content:d.text});else if("tool-call"===d.type){let f=c.get(d.toolCallId),g=f?.rejected===!0||f?.status==="rejected";b.push({id:`${e.id}-tool-${a}`,type:"tool-call",toolCall:{toolCallId:d.toolCallId,toolName:d.toolName,input:d.input??d.args,output:f,status:g?"rejected":void 0!==f?"completed":"pending"}})}}}d++}return b},bb=async(b,d)=>{let e=aB.find(a=>a.messageSequence===b);if(!e)return void console.error("No checkpoint found for message sequence:",b);if(window.confirm("Revert to before this message? This will undo all file changes and delete messages from this point.")){aE(!0);try{await (0,v.revertToCheckpoint)(a.id,e.id);let[b,f]=await Promise.all([(0,v.getSessionMessages)(a.id),(0,v.getSessionCheckpoints)(a.id).catch(()=>({checkpoints:[]}))]),g=[...b].sort((a,b)=>new Date(a.createdAt).getTime()-new Date(b.createdAt).getTime()),h=ba(g);c(h),aC(f.checkpoints||[]),aq(""),as(""),aw([]),aF.current="",aG.current="",aH.current=[],d&&J(d)}catch(a){console.error("Failed to revert:",a),alert("Failed to revert: "+(a instanceof Error?a.message:"Unknown error"))}finally{aE(!1)}}},bc=b=>{if("tool-progress"===b.type){if("bash"===b.toolName&&"started"===b.data.status){let a="string"==typeof b.data.terminalId?b.data.terminalId:void 0;if(!a)return;if(aH.current=aH.current.map(b=>"bash"!==b.toolName||b.terminalId||"running"!==b.status&&"streaming"!==b.status?b:{...b,terminalId:a,liveOutput:""}),aw([...aH.current]),!aO.current.has(a)){let b=(0,v.streamTerminal)(a,b=>{aH.current=aH.current.map(c=>c.terminalId===a?{...c,liveOutput:(c.liveOutput||"")+b}:c),aw([...aH.current])},()=>{aO.current.delete(a)});aO.current.set(a,b)}}if("write_file"===b.toolName){let a=b.data;console.log("[FRONTEND] tool-progress received:",b.toolName,a.status,a.isChunked?`chunk=${a.chunkIndex}/${a.chunkCount}`:"",`contentLength=${a.content?.length||0}`,"currentToolCalls:",aH.current.length);let c=aH.current.find(a=>"write_file"===a.toolName&&("running"===a.status||"streaming"===a.status));if("started"===a.status){if(c)aH.current=aH.current.map(a=>"write_file"===a.toolName&&("running"===a.status||"streaming"===a.status)?{...a,liveContent:"",liveOldString:"",liveNewString:""}:a);else{console.log("[FRONTEND] Creating placeholder write_file tool call for:",a.path);let b={toolCallId:`write_file_pending_${Date.now()}`,toolName:"write_file",input:{path:a.relativePath||a.path,mode:a.mode||"full"},status:"streaming",liveContent:"",liveOldString:"",liveNewString:""};aH.current=[...aH.current,b],console.log("[FRONTEND] After adding placeholder, toolCallsRef.current:",aH.current.length)}aw([...aH.current])}else if("content"===a.status){if(console.log("[FRONTEND] Received content for write_file, length:",a.content?.length||0,"existingWriteFile:",!!c),c)console.log("[FRONTEND] Updating existing write_file with content"),aH.current=aH.current.map(b=>{if("write_file"===b.toolName&&("running"===b.status||"streaming"===b.status))if("str_replace"===a.mode)return{...b,liveOldString:a.oldString||"",liveNewString:a.newString||""};else{let c=a.isChunked||void 0!==a.chunkIndex||void 0!==a.chunkCount,d=a.content||"";return{...b,liveContent:c?(b.liveContent||"")+d:d}}return b});else{console.log("[FRONTEND] Creating placeholder with content");let b={toolCallId:`write_file_pending_${Date.now()}`,toolName:"write_file",input:{path:a.relativePath||a.path,mode:a.mode||"full"},status:"streaming",liveContent:"str_replace"!==a.mode&&a.content||"",liveOldString:"str_replace"===a.mode&&a.oldString||"",liveNewString:"str_replace"===a.mode&&a.newString||""};aH.current=[...aH.current,b]}aw([...aH.current])}}if("explore_agent"===b.toolName){let a=b.data;console.log("[FRONTEND] Explore agent tool-progress:",a.status,a.stepType||"");let c=aH.current.find(a=>"explore_agent"===a.toolName&&("running"===a.status||"streaming"===a.status));if("started"===a.status){if(c)aH.current=aH.current.map(a=>"explore_agent"===a.toolName&&("running"===a.status||"streaming"===a.status)?{...a,exploreSteps:[]}:a);else{let a={toolCallId:`explore_agent_pending_${Date.now()}`,toolName:"explore_agent",input:{},status:"streaming",exploreSteps:[]};aH.current=[...aH.current,a]}aw([...aH.current])}else if("step"===a.status&&a.stepType){let b={id:`step_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,type:a.stepType,content:a.stepContent||"",toolName:a.toolName,toolInput:a.toolInput,toolOutput:a.toolOutput,timestamp:Date.now()};aH.current=aH.current.map(a=>"explore_agent"===a.toolName&&("running"===a.status||"streaming"===a.status)?{...a,exploreSteps:[...a.exploreSteps||[],b]}:a),aw([...aH.current])}}return}switch(b.type){case"start":case"data-session":case"text-start":case"text-end":break;case"data-stream-id":ao(b.streamId),aL.current=b.streamId;break;case"data-user-message":b.data?.content&&!aN.current&&c(a=>{let c="",d=[],e=b.data.content;if("string"==typeof e)c=e;else if(Array.isArray(e))for(let a of e)"text"===a.type&&a.text?c+=a.text:"image"===a.type&&a.image?d.push({type:"image",data:a.image,mediaType:a.mediaType}):"file"===a.type&&a.data&&d.push({type:"file",data:a.data,mediaType:a.mediaType});if(a.some(a=>"user-message"===a.type&&a.content===c))return a;let f=b.data.id||`user-${Date.now()}`;return[...a,{id:f,type:"user-message",content:c,attachments:d.length>0?d:void 0}]});break;case"text-delta":aF.current+=b.delta,aq(aF.current);break;case"reasoning-start":au(!0),aG.current="",as("");break;case"reasoning-delta":aG.current+=b.delta,as(aG.current);break;case"reasoning-end":if(au(!1),aG.current.trim()){let a={id:`reasoning-${Date.now()}`,type:"reasoning",content:aG.current};c(b=>[...b,a])}aG.current="",as("");break;case"tool-input-start":if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current};c(b=>[...b,a]),aF.current="",aq("")}let d={toolCallId:b.toolCallId,toolName:b.toolName,input:{},status:"streaming",streamingArgsText:""};aH.current=[...aH.current,d],aw([...aH.current]);break;case"tool-input-delta":aH.current=aH.current.map(a=>a.toolCallId!==b.toolCallId?a:{...a,streamingArgsText:(a.streamingArgsText||"")+b.argsTextDelta}),aw([...aH.current]);break;case"tool-input-available":let e=aH.current.find(a=>a.toolCallId===b.toolCallId),f="write_file"===b.toolName?aH.current.find(a=>"write_file"===a.toolName&&a.toolCallId.startsWith("write_file_pending_")&&"streaming"===a.status):void 0,g="explore_agent"===b.toolName?aH.current.find(a=>"explore_agent"===a.toolName&&a.toolCallId.startsWith("explore_agent_pending_")&&"streaming"===a.status):void 0;if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current};c(b=>[...b,a]),aF.current="",aq("")}let h={toolCallId:b.toolCallId,toolName:b.toolName,input:b.input,status:"running",streamingArgsText:e?.streamingArgsText,liveContent:f?.liveContent,liveOldString:f?.liveOldString,liveNewString:f?.liveNewString,exploreSteps:g?.exploreSteps};f?aH.current=aH.current.map(a=>a.toolCallId===f.toolCallId?h:a):g?aH.current=aH.current.map(a=>a.toolCallId===g.toolCallId?h:a):e?aH.current=aH.current.map(a=>a.toolCallId!==b.toolCallId?a:h):aH.current=[...aH.current,h],aw([...aH.current]);break;case"tool-output-available":let i=aH.current.find(a=>a.toolCallId===b.toolCallId);if(i?.terminalId){let a=aO.current.get(i.terminalId);a&&(a(),aO.current.delete(i.terminalId))}let j=a9(b.output),k=j?.rejected===!0||j?.status==="rejected",l=aH.current.find(a=>a.toolCallId===b.toolCallId);aH.current=aH.current.filter(a=>a.toolCallId!==b.toolCallId),aw([...aH.current]);let m={id:`tool-${b.toolCallId}`,type:"tool-call",toolCall:{toolCallId:b.toolCallId,toolName:l?.toolName||"unknown",input:l?.input||{},output:j,status:k?"rejected":"completed"}};c(a=>{let c=a.findIndex(a=>"tool-call"===a.type&&a.toolCall?.toolCallId===b.toolCallId);if(c>=0){let b=[...a];return b[c]=m,b}return[...a,m]});break;case"data-approval-required":ay(a=>a.some(a=>a.id===b.data.id)?a:[...a,b.data]);break;case"finish-step":if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current};c(b=>[...b,a]),aF.current="",aq("")}break;case"finish":aq(""),as(""),au(!1),aw([]),ao(null),aF.current="",aG.current="",aH.current=[],aK.current=null,aM.current=!1,aN.current=!1,ae(!1),am(!1),Promise.all([(0,v.getSessionMessages)(a.id),(0,v.getSessionCheckpoints)(a.id).catch(()=>({checkpoints:[]}))]).then(([a,b])=>{let d=[...a].sort((a,b)=>new Date(a.createdAt).getTime()-new Date(b.createdAt).getTime()),e=ba(d);c(e),aC(b.checkpoints||[])}).catch(()=>{});break;case"abort":if(aG.current.trim()){let a={id:`reasoning-${Date.now()}`,type:"reasoning",content:aG.current};c(b=>[...b,a])}if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current+" [stopped]"};c(b=>[...b,a])}aq(""),as(""),au(!1),aw([]),ao(null),aF.current="",aG.current="",aH.current=[],aK.current=null,aM.current=!1,aN.current=!1,ae(!1),am(!1);break;case"error":console.error("Agent error:",b.errorText),aK.current=null,ae(!1),am(!1)}};(0,e.useEffect)(()=>{let b=!1;(async()=>{aJ(!0),c([]),aq(""),as(""),aw([]),ay([]),ae(!1),am(!1),ao(null),aF.current="",aG.current="",aH.current=[];try{let[d,e]=await Promise.all([(0,v.getSessionMessages)(a.id),(0,v.getSessionCheckpoints)(a.id).catch(()=>({checkpoints:[]}))]);if(b)return;let f=[...d].sort((a,b)=>new Date(a.createdAt).getTime()-new Date(b.createdAt).getTime()),g=ba(f);c(g),aC(e.checkpoints||[]);let h=await (0,v.getActiveStream)(a.id);if(b)return;h.hasActiveStream&&h.stream&&(console.log("Found active stream, connecting...",h.stream.streamId),aN.current=!1,am(!0),ae(!0),ao(h.stream.streamId),aK.current=(0,v.watchStream)(a.id,bc,{streamId:h.stream.streamId,onStreamId:a=>ao(a)}))}catch(a){b||console.error("Failed to load messages:",a)}finally{b||aJ(!1)}})();let d=aO.current;return()=>{b=!0,aK.current&&(aK.current(),aK.current=null),d.forEach(a=>a()),d.clear()}},[a.id]),(0,e.useEffect)(()=>{let b=!1,c=a.id,d=async()=>{try{let a=await (0,v.getPendingApprovals)(c);if(b)return;ay(a)}catch{}};d();let e=setInterval(d,2e3);return()=>{b=!0,clearInterval(e)}},[a.id]),(0,e.useEffect)(()=>{let b=!1,c=a.id,d=async()=>{try{let a=await (0,v.getSessionTodos)(c);if(b)return;aA(a)}catch{}};d();let e=ad?1e3:5e3,f=setInterval(d,e);return()=>{b=!0,clearInterval(f)}},[a.id,ad]),(0,e.useEffect)(()=>{},[]),(0,e.useEffect)(()=>{let b=!1,d=a.id,e=async()=>{if(!ad&&!aM.current)try{let a=await (0,v.getActiveStream)(d);if(b)return;if(a.hasActiveStream&&a.stream){let e=a.stream.streamId;if(e!==aL.current){if(console.log("New active stream detected, connecting...",e),aM.current=!0,aN.current=!1,aG.current.trim()){let a={id:`reasoning-${Date.now()}`,type:"reasoning",content:aG.current};c(b=>[...b,a]),aG.current="",as("")}if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current};c(b=>[...b,a]),aF.current="",aq("")}for(let a of aH.current){let b={id:`tool-${a.toolCallId}`,type:"tool-call",toolCall:a};c(c=>c.some(b=>"tool-call"===b.type&&b.toolCall?.toolCallId===a.toolCallId)?c:[...c,b])}aH.current=[],aw([]),au(!1);try{let a=await (0,v.getSessionMessages)(d);if(b){aM.current=!1;return}let e=[...a].sort((a,b)=>new Date(a.createdAt).getTime()-new Date(b.createdAt).getTime()),f=ba(e);c(f)}catch(a){console.error("Failed to refresh messages:",a)}if(b){aM.current=!1;return}am(!0),ae(!0),ao(e),aL.current=e,aK.current=(0,v.watchStream)(d,bc,{streamId:e,onStreamId:a=>{ao(a),aL.current=a}}),aM.current=!1}}}catch(a){console.error("Failed to check for new stream:",a),aM.current=!1}},f=setInterval(e,1e3);return()=>{b=!0,clearInterval(f)}},[a.id,ad]),(0,e.useEffect)(()=>{let b=!1,c=a.id,d=async()=>{if(!ad)try{let a=await (0,v.getPendingInput)(c);if(b||ad)return;a.hasPendingInput&&a.text&&(J(b=>b.trim()?b+"\n\n"+a.text:a.text||""),setTimeout(()=>{let a=document.querySelector('textarea[placeholder*="Ask SparkECoder"]');a&&(a.focus(),a.selectionStart=a.value.length,a.selectionEnd=a.value.length)},100))}catch(a){}},e=setInterval(d,500);return()=>{b=!0,clearInterval(e)}},[a.id,ad]);let bd=async(b,d)=>{if(!b.trim()&&(!d||0===d.length)||ad)return;let e=b;try{let c=await (0,v.getDevtoolsContext)(a.id);if(c.connected&&c.context){let a=c.context;e=`[Sparkecode Devtools connected - User is currently viewing: ${a.pageName} (${a.path})]
|
|
10
10
|
|
|
11
|
-
`+b}}catch{}let f=d?.map(a=>({type:a.type,data:a.data,mediaType:a.mediaType,filename:a.filename})),g={id:`user-${Date.now()}`,type:"user-message",content:b||"",attachments:f};c(a=>[...a,g]),J(""),ae(!0),am(!1),aN.current=!0,aq(""),as(""),au(!1),aw([]),aF.current="",aG.current="",aH.current=[],aK.current=(0,v.runAgent)(a.id,e||"Please analyze the attached files.",bc,{onStreamId:a=>ao(a),attachments:d})},be=async a=>{if(ad)return;let b=!!a.text?.trim(),c=!!a.files?.length;if(!b&&!c)return;let d=[];if(c&&a.files.length>0){for(let b of a.files)if(b.url)try{let a=await fetch(b.url),c=await a.blob(),e=await new Promise(a=>{let b=new FileReader;b.onloadend=()=>a(b.result),b.readAsDataURL(c)}),f=b.mediaType||c.type||"application/octet-stream",g=f.startsWith("image/");d.push({type:g?"image":"file",data:e,mediaType:f,filename:b.filename})}catch(a){console.error("Failed to process attachment:",a)}}bd(a.text||"",d.length>0?d:void 0)},bf=async()=>{try{await (0,v.abortStream)(a.id)}catch(a){console.error("Failed to abort stream:",a)}if(aK.current&&(aK.current(),aK.current=null),aG.current.trim()){let a={id:`reasoning-${Date.now()}`,type:"reasoning",content:aG.current};c(b=>[...b,a])}if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current+" [stopped]"};c(b=>[...b,a])}aq(""),as(""),au(!1),aw([]),ao(null),aF.current="",aG.current="",aH.current=[],aM.current=!1,ae(!1),am(!1)},bg=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.approveExecution)(a.id,b.toolCallId)}catch(a){console.error("Failed to approve:",a)}},bh=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.rejectExecution)(a.id,b.toolCallId,"User rejected")}catch(a){console.error("Failed to reject:",a)}},bi=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.approveExecution)(a.id,b.toolCallId);let c=await (0,v.updateToolApproval)(a.id,b.toolName,!1,aX);aY(c.config||{})}catch(a){console.error("Failed to approve and disable:",a)}},bj=async(b,c)=>{try{let d=await (0,v.updateToolApproval)(a.id,b,!c,aX);aY(d.config||{})}catch(a){console.error("Failed to update tool approval:",a)}},bk=a=>({ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",ps1:"powershell",sql:"sql",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",md:"markdown",markdown:"markdown",txt:"plaintext",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",makefile:"makefile"})[a.split(".").pop()?.toLowerCase()||""]||"plaintext";return(0,d.jsxs)("div",{className:"flex flex-col h-full bg-background min-w-0 overflow-x-hidden",children:[(0,d.jsxs)("div",{className:"border-b border-border/50 px-3 sm:px-4 py-2 flex items-center justify-between bg-card/50 backdrop-blur-sm",children:[(0,d.jsxs)("div",{className:"min-w-0 flex items-center gap-2 sm:gap-3",children:[(0,d.jsx)(aa,{}),(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:aT?(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),a7()},className:"flex items-center gap-1",children:[(0,d.jsx)(R.Input,{ref:a_,value:aR,onChange:a=>aS(a.target.value),onBlur:a7,className:"h-7 text-sm font-semibold w-40 px-2",placeholder:"Session name"}),(0,d.jsx)(i.Button,{type:"submit",size:"icon",variant:"ghost",className:"size-6 text-muted-foreground hover:text-foreground",children:(0,d.jsx)(F.Check,{className:"size-3.5"})})]}):(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)("button",{onClick:()=>aU(!0),className:"flex items-center gap-1.5 group hover:bg-muted/50 rounded px-1.5 py-0.5 -mx-1.5 transition-colors",children:[(0,d.jsx)("h2",{className:"font-semibold text-foreground truncate max-w-[200px]",children:aR||"Untitled Session"}),(0,d.jsx)(E.Pencil,{className:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),(0,d.jsx)(j.TooltipContent,{children:"Click to rename"})]})})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)("div",{children:(0,d.jsxs)(z.Select,{value:aP,onValueChange:a6,disabled:ad,children:[(0,d.jsx)(z.SelectTrigger,{className:"h-7 text-xs border-border/50 bg-muted/30 hover:bg-muted/50 transition-colors min-w-[160px]",children:(0,d.jsx)(z.SelectValue,{placeholder:"Select model"})}),(0,d.jsx)(z.SelectContent,{children:aV?.availableModels.map(a=>(0,d.jsx)(z.SelectItem,{value:a.id,className:"text-xs",children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{children:a.name}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.provider})]})},a.id))})]})})}),(0,d.jsx)(j.TooltipContent,{children:ad?"Cannot change model while running":"Switch model for next message"})]})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-muted/30 text-xs text-muted-foreground max-w-[200px]",children:[(0,d.jsx)(I.FolderOpen,{className:"size-3.5 shrink-0"}),(0,d.jsx)("span",{className:"truncate font-mono",children:a.workingDirectory.split("/").pop()||a.workingDirectory})]})}),(0,d.jsx)(j.TooltipContent,{side:"bottom",className:"max-w-md",children:(0,d.jsx)("p",{className:"font-mono text-xs",children:a.workingDirectory})})]})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[al&&(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)(h.Badge,{variant:"outline",className:"gap-1.5 text-xs border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 cursor-help",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),"Watching"]})}),(0,d.jsx)(j.TooltipContent,{children:"Watching stream from another client"})]})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(h.Badge,{variant:ad?"default":"secondary",className:`cursor-help ${ad?"bg-primary/90":""}`,children:ad?al?"streaming":"running":a.status})}),(0,d.jsx)(j.TooltipContent,{children:ad?al?"Receiving streamed response":"Agent is processing":`Session is ${a.status}`})]})}),(0,d.jsxs)(O.Dialog,{open:aZ,onOpenChange:a$,children:[(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(O.DialogTrigger,{asChild:!0,children:(0,d.jsx)(i.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,d.jsx)(G.Settings,{className:"size-4"})})})}),(0,d.jsx)(j.TooltipContent,{children:"Session Settings"})]})}),(0,d.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,d.jsx)(O.DialogHeader,{children:(0,d.jsxs)(O.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,d.jsx)(G.Settings,{className:"size-4"})}),"Session Settings"]})}),(0,d.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(Q.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,d.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:aV?.availableTools.map(a=>{var b;let c=(b=a.id,aX.toolApprovals?.[b]!==void 0?aX.toolApprovals[b]:"bash"===b);return(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,d.jsxs)("div",{className:"space-y-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,d.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,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,d.jsx)(P.Switch,{checked:c,onCheckedChange:()=>bj(a.id,c)})]},a.id)})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings only apply to this session. Changes take effect for future tool calls."})]})]})]})]})]}),a0?.updateAvailable&&!a2&&(0,d.jsxs)("div",{className:"px-4 py-2 border-b border-amber-500/30 bg-amber-500/10 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(L.Download,{className:"size-4 text-amber-600 dark:text-amber-400 shrink-0"}),(0,d.jsxs)("span",{className:"text-sm text-amber-700 dark:text-amber-300",children:["Update available: ",(0,d.jsxs)("strong",{children:["v",a0.latestVersion]}),(0,d.jsxs)("span",{className:"text-amber-600/70 dark:text-amber-400/70 ml-1",children:["(current: v",a0.currentVersion,")"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,d.jsx)(i.Button,{size:"sm",variant:"outline",className:"h-7 text-xs border-amber-500/50 bg-amber-500/20 hover:bg-amber-500/30 text-amber-700 dark:text-amber-300",onClick:a8,disabled:a4,children:a4?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(B.RefreshCw,{className:"size-3 mr-1.5 animate-spin"}),"Creating..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L.Download,{className:"size-3 mr-1.5"}),"Update Now"]})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(i.Button,{size:"icon",variant:"ghost",className:"size-6 text-amber-600 dark:text-amber-400 hover:bg-amber-500/20",onClick:()=>{a3(!0),a0?.latestVersion&&localStorage.setItem("sparkecoder-dismissed-version",a0.latestVersion)},children:(0,d.jsx)(M.X,{className:"size-3.5"})})}),(0,d.jsx)(j.TooltipContent,{children:"Dismiss (won't show again for this version)"})]})})]})]}),az&&az.todos&&az.todos.length>0&&(0,d.jsx)("div",{className:"px-4 py-2 border-b border-border/50 bg-muted/20",children:(0,d.jsx)(w.TodoPanel,{todosData:az})}),ax.length>0&&(0,d.jsx)("div",{className:"p-4 border-b border-border space-y-3",children:ax.map(a=>{let b=a.input;return(0,d.jsxs)(p.Confirmation,{approval:{id:a.id,approved:!1},state:"approval-requested",children:[(0,d.jsx)(p.ConfirmationRequest,{children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg bg-amber-500/20 flex items-center justify-center shrink-0",children:(0,d.jsx)(C.AlertTriangle,{className:"size-4 text-amber-500"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Approval Required"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:(0,d.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-foreground",children:a.toolName})}),(0,d.jsx)("div",{className:"mt-3 rounded-lg border bg-muted/30 overflow-hidden",children:Object.entries(b).map(([a,b])=>(0,d.jsxs)("div",{className:"flex border-b border-border/50 last:border-b-0",children:[(0,d.jsx)("div",{className:"px-3 py-2 bg-muted/50 text-xs font-medium text-muted-foreground w-24 shrink-0",children:a}),(0,d.jsx)("div",{className:"px-3 py-2 text-xs font-mono flex-1 min-w-0 overflow-auto max-h-24",children:"string"==typeof b?(0,d.jsx)("span",{className:"whitespace-pre-wrap break-words",children:b}):(0,d.jsx)("span",{className:"text-muted-foreground",children:JSON.stringify(b)})})]},a))})]})]})}),(0,d.jsxs)(p.ConfirmationActions,{children:[(0,d.jsx)(p.ConfirmationAction,{variant:"outline",onClick:()=>bh(a),children:"Reject"}),(0,d.jsx)(p.ConfirmationAction,{variant:"ghost",onClick:()=>bi(a),className:"text-muted-foreground hover:text-foreground",children:"Don't ask again"}),(0,d.jsx)(p.ConfirmationAction,{variant:"default",onClick:()=>bg(a),children:"Approve"})]})]},a.id)})}),(0,d.jsxs)(k.Conversation,{className:"flex-1 p-4",children:[(0,d.jsxs)(k.ConversationContent,{className:"max-w-3xl mx-auto w-full",children:[aI&&(0,d.jsx)("div",{className:"flex justify-center py-12",children:(0,d.jsx)(q.Loader,{size:24})}),!aI&&0===b.length&&!ap&&(0,d.jsx)(k.ConversationEmptyState,{icon:(0,d.jsxs)("div",{className:"relative overflow-hidden rounded-2xl size-16 shadow-lg ring-1 ring-white/10",children:[(0,d.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:64,height:64,className:"absolute inset-0 size-full object-cover",priority:!0}),ad&&(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),title:"Start a conversation",description:"Ask SparkECoder to help you with coding tasks"}),b.filter(a=>!("tool-call"===a.type&&a.toolCall&&(ax.some(b=>b.toolCallId===a.toolCall?.toolCallId)||av.some(b=>b.toolCallId===a.toolCall?.toolCallId||b.toolName===a.toolCall?.toolName&&("streaming"===b.status||"running"===b.status))))&&!0).map(a=>{if("user-message"===a.type){let b=void 0!==a.messageSequence&&aB.some(b=>b.messageSequence===a.messageSequence);return(0,d.jsxs)(l.Message,{from:"user",children:[(0,d.jsxs)(l.MessageContent,{children:[a.attachments&&a.attachments.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-2 mb-2",children:a.attachments.map((a,b)=>(0,d.jsx)("div",{className:"relative",children:"image"===a.type?(0,d.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-border/50 max-w-[200px]",children:(0,d.jsx)("img",{src:a.data.startsWith("data:")?a.data:`data:${a.mediaType||"image/png"};base64,${a.data}`,alt:a.filename||"Image attachment",className:"max-w-full h-auto max-h-[150px] object-contain"})}):(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-muted/50 border border-border/50",children:[(0,d.jsx)(K.FileIcon,{className:"h-4 w-4 text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-[150px]",children:a.filename||"File"})]})},b))}),a.content&&(0,d.jsx)("p",{className:"whitespace-pre-wrap",children:a.content})]}),b&&!ad&&(0,d.jsx)(l.MessageActions,{className:"justify-end mt-1",children:(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>bb(a.messageSequence,a.content),disabled:aD,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive gap-1",children:[(0,d.jsx)(H.RotateCcw,{className:"h-3 w-3"}),"Revert"]})}),(0,d.jsx)(j.TooltipContent,{children:(0,d.jsx)("p",{children:"Revert to before this message (undo all changes after)"})})]})})})]},a.id)}if("reasoning"===a.type)return(0,d.jsxs)(r.Reasoning,{isStreaming:!1,defaultOpen:!1,children:[(0,d.jsx)(r.ReasoningTrigger,{}),(0,d.jsx)(r.ReasoningContent,{children:a.content||""})]},a.id);if("assistant-text"===a.type)return(0,d.jsx)(l.Message,{from:"assistant",children:(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)(l.MessageContent,{children:(0,d.jsx)(l.MessageResponse,{children:a.content||""})}),(0,d.jsx)(l.MessageActions,{children:(0,d.jsx)(l.MessageAction,{label:"Copy",onClick:()=>navigator.clipboard.writeText(a.content||""),children:(0,d.jsx)(A.Copy,{className:"size-3"})})})]})]})},a.id);if("tool-call"===a.type&&a.toolCall){let b=a.toolCall,c=`tool-${b.toolName}`;if("write_file"===b.toolName)return(0,d.jsx)(S.WriteFileTool,{input:b.input,output:b.output,status:b.status,streamingArgsText:b.streamingArgsText,liveContent:b.liveContent,liveOldString:b.liveOldString,liveNewString:b.liveNewString},a.id);if("read_file"===b.toolName)return(0,d.jsx)(T.ReadFileTool,{input:b.input,output:b.output,status:b.status},a.id);if("bash"===b.toolName)return(0,d.jsx)(U.BashTool,{input:b.input,output:b.output,status:b.status,terminalId:b.terminalId,liveOutput:b.liveOutput},a.id);if("explore_agent"===b.toolName)return(0,d.jsx)(V.SearchTool,{input:b.input,output:b.output,status:b.status,steps:b.exploreSteps},a.id);if("todo"===b.toolName)return(0,d.jsx)(W.TodoTool,{input:b.input,output:b.output,status:b.status},a.id);if("load_skill"===b.toolName)return(0,d.jsx)(X.LoadSkillTool,{input:b.input,output:b.output,status:b.status},a.id);if("linter"===b.toolName)return(0,d.jsx)(Y.LinterTool,{input:b.input,output:b.output,status:b.status},a.id);let e="completed"!==b.status;return(0,d.jsxs)(m.Tool,{defaultOpen:e,children:[(0,d.jsx)(m.ToolHeader,{type:c,state:function(a){switch(a){case"pending":case"streaming":default:return"input-streaming";case"running":return"input-available";case"completed":return"output-available";case"rejected":return"output-denied";case"error":return"output-error"}}(b.status),title:b.toolName}),(0,d.jsxs)(m.ToolContent,{children:[(0,d.jsx)(m.ToolInput,{input:b.input}),(a=>{let b=a.output,c=a.input;if("bash"===a.toolName)return(0,d.jsx)(U.BashTool,{input:a.input,output:a.output,status:a.status,terminalId:a.terminalId,liveOutput:a.liveOutput,className:"mt-2"});if("explore_agent"===a.toolName)return(0,d.jsx)(V.SearchTool,{input:a.input,output:a.output,status:a.status,steps:a.exploreSteps,className:"mt-2"});if("todo"===a.toolName)return(0,d.jsx)(W.TodoTool,{input:a.input,output:a.output,status:a.status,className:"mt-2"});if("load_skill"===a.toolName)return(0,d.jsx)(X.LoadSkillTool,{input:a.input,output:a.output,status:a.status,className:"mt-2"});if("write_file"===a.toolName&&c){let a=c.path||"file",e=c.mode||"full",f=a.split("/").pop()||"file",g=bk(a);if("str_replace"===e){let a=c.old_string||"",e=c.new_string||"";return(0,d.jsxs)("div",{className:"mt-2 max-w-full overflow-hidden space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground"}),(0,d.jsx)("span",{className:"font-medium",children:f}),(0,d.jsx)(h.Badge,{variant:"secondary",className:"text-xs",children:"str_replace"})]}),(0,d.jsxs)("div",{className:"rounded-md border overflow-hidden",children:[(0,d.jsxs)("div",{className:"bg-red-500/10 border-b p-2",children:[(0,d.jsx)("div",{className:"text-xs text-red-500 mb-1",children:"- Remove:"}),(0,d.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-wrap break-words text-red-400",children:a.length>500?a.slice(0,500)+"...":a})]}),(0,d.jsxs)("div",{className:"bg-green-500/10 p-2",children:[(0,d.jsx)("div",{className:"text-xs text-green-500 mb-1",children:"+ Add:"}),(0,d.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-wrap break-words text-green-400",children:e.length>500?e.slice(0,500)+"...":e})]})]}),b&&(0,d.jsxs)("div",{className:`text-xs flex items-center gap-1 ${b.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[(0,d.jsx)("span",{children:b.success?"✓":"✗"}),(0,d.jsx)("span",{children:b.success?`Replaced (${void 0!==b.lineDelta?(b.lineDelta>=0?"+":"")+b.lineDelta+" lines":"done"})`:b.error||"Failed"})]})]})}let i=c.content||"";return(0,d.jsxs)("div",{className:"mt-2 max-w-full overflow-hidden",children:[(0,d.jsxs)(n.Artifact,{children:[(0,d.jsxs)(n.ArtifactHeader,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground shrink-0"}),(0,d.jsx)(n.ArtifactTitle,{className:"truncate",children:f}),(0,d.jsx)(n.ArtifactDescription,{className:"truncate text-xs hidden sm:block",children:a})]}),(0,d.jsx)(n.ArtifactActions,{children:(0,d.jsx)(n.ArtifactAction,{icon:A.Copy,label:"Copy",onClick:()=>navigator.clipboard.writeText(i)})})]}),i&&(0,d.jsx)(n.ArtifactContent,{className:"p-0 max-h-[300px] overflow-auto",children:(0,d.jsx)(o.CodeBlock,{code:i,language:g,showLineNumbers:!0,children:(0,d.jsx)(o.CodeBlockHeader,{className:"sr-only",children:(0,d.jsx)(o.CodeBlockTitle,{children:(0,d.jsx)(o.CodeBlockFilename,{children:f})})})})})]}),b&&(0,d.jsxs)("div",{className:`mt-2 text-xs flex items-center gap-1 ${b.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[(0,d.jsx)("span",{children:b.success?"✓":"✗"}),(0,d.jsx)("span",{children:b.success?`File ${b.action||"written"} successfully`:b.error||"Failed"})]})]})}if("read_file"===a.toolName&&b){let a=c?.path||"file",e=b.content||JSON.stringify(b,null,2),f=a.split("/").pop()||"file",g=bk(a);return(0,d.jsx)("div",{className:"mt-2 max-w-full overflow-hidden",children:(0,d.jsxs)(n.Artifact,{children:[(0,d.jsxs)(n.ArtifactHeader,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground shrink-0"}),(0,d.jsx)(n.ArtifactTitle,{className:"truncate",children:f}),(0,d.jsx)(n.ArtifactDescription,{className:"truncate text-xs hidden sm:block",children:a})]}),(0,d.jsx)(n.ArtifactActions,{children:(0,d.jsx)(n.ArtifactAction,{icon:A.Copy,label:"Copy",onClick:()=>navigator.clipboard.writeText(e)})})]}),(0,d.jsx)(n.ArtifactContent,{className:"p-0 max-h-[300px] overflow-auto",children:(0,d.jsx)(o.CodeBlock,{code:e,language:g,showLineNumbers:!0,children:(0,d.jsx)(o.CodeBlockHeader,{className:"sr-only",children:(0,d.jsx)(o.CodeBlockTitle,{children:(0,d.jsx)(o.CodeBlockFilename,{children:f})})})})})]})})}return b?(0,d.jsx)(m.ToolOutput,{output:(0,d.jsxs)("pre",{className:"text-xs overflow-x-auto max-w-full whitespace-pre-wrap break-words",children:[JSON.stringify(b,null,2).slice(0,500),JSON.stringify(b).length>500?"...":""]}),errorText:"error"===a.status?"Tool execution failed":void 0}):null})(b)]})]},a.id)}return null}),ad&&!ap&&!ar&&0===av.length&&(0,d.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:"Thinking..."})]}),ad&&(at||ar)&&(0,d.jsxs)(r.Reasoning,{isStreaming:at,defaultOpen:!0,children:[(0,d.jsx)(r.ReasoningTrigger,{}),(0,d.jsx)(r.ReasoningContent,{children:ar})]}),ad&&ap&&(0,d.jsx)(l.Message,{from:"assistant",children:(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsxs)(l.MessageContent,{children:[(0,d.jsx)(l.MessageResponse,{children:ap}),(0,d.jsx)("span",{className:"inline-block w-2 h-4 bg-primary animate-pulse ml-1"})]})})]})}),ad&&av.map(a=>"write_file"===a.toolName?(0,d.jsx)(S.WriteFileTool,{input:a.input,output:a.output,status:a.status,streamingArgsText:a.streamingArgsText,liveContent:a.liveContent,liveOldString:a.liveOldString,liveNewString:a.liveNewString},a.toolCallId):"read_file"===a.toolName?(0,d.jsx)(T.ReadFileTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"bash"===a.toolName?(0,d.jsx)(U.BashTool,{input:a.input,output:a.output,status:a.status,terminalId:a.terminalId,liveOutput:a.liveOutput},a.toolCallId):"explore_agent"===a.toolName?(0,d.jsx)(V.SearchTool,{input:a.input,output:a.output,status:a.status,steps:a.exploreSteps},a.toolCallId):"todo"===a.toolName?(0,d.jsx)(W.TodoTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"load_skill"===a.toolName?(0,d.jsx)(X.LoadSkillTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"linter"===a.toolName?(0,d.jsx)(Y.LinterTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):(0,d.jsxs)(m.Tool,{defaultOpen:!0,children:[(0,d.jsx)(m.ToolHeader,{type:`tool-${a.toolName}`,state:"streaming"===a.status?"input-streaming":"input-available",title:a.toolName}),(0,d.jsxs)(m.ToolContent,{children:[(0,d.jsx)(m.ToolInput,{input:a.input}),(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-muted-foreground",children:[(0,d.jsx)(q.Loader,{size:14}),(0,d.jsx)("span",{className:"text-sm",children:"streaming"===a.status?"Receiving...":"Executing..."})]})]})]},a.toolCallId)),ad&&!ap&&0===av.length&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(q.Loader,{size:16}),(0,d.jsx)("span",{className:"text-sm",children:"Thinking..."})]})]}),(0,d.jsx)(k.ConversationScrollButton,{})]}),af&&(0,d.jsxs)("div",{className:"fixed bottom-28 right-4 w-80 max-h-80 overflow-auto border bg-background/95 shadow-lg rounded-md text-xs",children:[(0,d.jsx)("div",{className:"px-3 py-2 border-b font-mono text-muted-foreground",children:"SSE Debug"}),(0,d.jsxs)("div",{className:"px-3 py-2 space-y-1",children:[0===ah.length&&0===aj.length&&(0,d.jsx)("div",{className:"text-muted-foreground",children:"No events yet"}),ah.map((a,b)=>(0,d.jsx)("div",{className:"font-mono",children:a},`evt-${b}`)),aj.map((a,b)=>(0,d.jsx)("div",{className:"font-mono text-red-600",children:a},`err-${b}`))]})]}),(0,d.jsx)("div",{className:"border-t border-border/50 p-4 pb-6 bg-card/30",children:(0,d.jsxs)("div",{className:"max-w-3xl mx-auto",children:[!aI&&0===b.length&&!ap&&!ad&&(0,d.jsx)(u.Suggestions,{className:"mb-3",children:['Create a hello.txt file with "Hello, World!"',"List files in the current directory","Show the current git status"].map(a=>(0,d.jsx)(u.Suggestion,{suggestion:a,onClick:a=>{J(a)}},a))}),(0,d.jsx)($.MentionInputProvider,{children:(0,d.jsxs)(s.PromptInput,{onSubmit:be,className:"shadow-sm",globalDrop:!0,multiple:!0,children:[(0,d.jsx)(s.PromptInputHeader,{children:(0,d.jsx)(ab,{})}),(0,d.jsx)(s.PromptInputBody,{children:(0,d.jsxs)("div",{className:"relative w-full",children:[(0,d.jsx)($.MentionTextarea,{sessionId:a.id,value:t+(N?(!t||t.endsWith(" ")||t.endsWith("\n")?"":" ")+N:""),onChange:a=>{N&&_(""),J(a)},placeholder:"Ask SparkECoder... (@ to mention files, / for commands)",disabled:ad,autoFocus:!0,className:(0,g.cn)("min-h-[80px] focus:ring-2 focus:ring-primary/20 transition-all field-sizing-content max-h-48",N&&"caret-red-500")}),N&&(0,d.jsxs)("div",{className:"absolute bottom-2 right-2 flex items-center gap-1.5 text-xs text-red-500 bg-background/80 backdrop-blur-sm px-2 py-1 rounded-full",children:[(0,d.jsx)("span",{className:"size-2 bg-red-500 rounded-full animate-pulse"}),"Listening..."]})]})}),(0,d.jsxs)(s.PromptInputFooter,{children:[(0,d.jsx)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:(0,d.jsx)("span",{className:"hidden sm:inline",children:"Type @ to mention files, / for commands"})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(Z.SpeechInput,{size:"icon",className:"size-9",onTranscriptionChange:a=>{J(b=>{let c=b&&!b.endsWith(" ")&&!b.endsWith("\n");return b+(c?" ":"")+a})},onInterimTranscription:a=>{_(a)},disabled:ad}),(0,d.jsx)(ac,{input:t+N,isRunning:ad,onStop:bf})]})]})]})})]})})]})}[l,m,o,r,S,T]=_.then?(await _)():_,a.s(["ChatInterface",()=>ad]),c()}catch(a){c(a)}},!1),196069,a=>a.a(async(b,c)=>{try{var d=a.i(256856),e=a.i(755132),f=a.i(832315),g=a.i(845439),h=a.i(979412),i=a.i(252831),j=b([g]);function k({params:a}){let{id:b}=(0,e.use)(a),c=(0,f.useRouter)(),[j,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(!0),[n,o]=(0,e.useState)(null);return((0,e.useEffect)(()=>{!async function(){try{let a=await (0,h.getSession)(b);if(!a)return void o("Session not found");k(a)}catch(a){console.error("Failed to load session:",a),o("Failed to load session")}finally{m(!1)}}()},[b]),l)?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)(i.Loader2,{className:"size-8 animate-spin text-muted-foreground"})}):n||!j?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-4",children:n||"Session not found"}),(0,d.jsx)("button",{onClick:()=>c.push("/"),className:"text-primary hover:underline",children:"Go back home"})]})}):(0,d.jsx)(g.ChatInterface,{session:j})}[g]=j.then?(await j)():j,a.s(["default",()=>k]),c()}catch(a){c(a)}},!1)];
|
|
11
|
+
`+b}}catch{}let f=d?.map(a=>({type:a.type,data:a.data,mediaType:a.mediaType,filename:a.filename})),g={id:`user-${Date.now()}`,type:"user-message",content:b||"",attachments:f};c(a=>[...a,g]),J(""),ae(!0),am(!1),aN.current=!0,aq(""),as(""),au(!1),aw([]),aF.current="",aG.current="",aH.current=[],aK.current=(0,v.runAgent)(a.id,e||"Please analyze the attached files.",bc,{onStreamId:a=>ao(a),attachments:d})},be=async a=>{if(ad)return;let b=!!a.text?.trim(),c=!!a.files?.length;if(!b&&!c)return;let d=[];if(c&&a.files.length>0){for(let b of a.files)if(b.url)try{let a=await fetch(b.url),c=await a.blob(),e=await new Promise(a=>{let b=new FileReader;b.onloadend=()=>a(b.result),b.readAsDataURL(c)}),f=b.mediaType||c.type||"application/octet-stream",g=f.startsWith("image/");d.push({type:g?"image":"file",data:e,mediaType:f,filename:b.filename})}catch(a){console.error("Failed to process attachment:",a)}}bd(a.text||"",d.length>0?d:void 0)},bf=async()=>{try{await (0,v.abortStream)(a.id)}catch(a){console.error("Failed to abort stream:",a)}if(aK.current&&(aK.current(),aK.current=null),aG.current.trim()){let a={id:`reasoning-${Date.now()}`,type:"reasoning",content:aG.current};c(b=>[...b,a])}if(aF.current.trim()){let a={id:`text-${Date.now()}`,type:"assistant-text",content:aF.current+" [stopped]"};c(b=>[...b,a])}aq(""),as(""),au(!1),aw([]),ao(null),aF.current="",aG.current="",aH.current=[],aM.current=!1,ae(!1),am(!1)},bg=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.approveExecution)(a.id,b.toolCallId)}catch(a){console.error("Failed to approve:",a)}},bh=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.rejectExecution)(a.id,b.toolCallId,"User rejected")}catch(a){console.error("Failed to reject:",a)}},bi=async b=>{ay(a=>a.filter(a=>a.id!==b.id));try{await (0,v.approveExecution)(a.id,b.toolCallId);let c=await (0,v.updateToolApproval)(a.id,b.toolName,!1,aX);aY(c.config||{})}catch(a){console.error("Failed to approve and disable:",a)}},bj=async(b,c)=>{try{let d=await (0,v.updateToolApproval)(a.id,b,!c,aX);aY(d.config||{})}catch(a){console.error("Failed to update tool approval:",a)}},bk=a=>({ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",swift:"swift",kt:"kotlin",scala:"scala",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",ps1:"powershell",sql:"sql",html:"html",htm:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",md:"markdown",markdown:"markdown",txt:"plaintext",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",makefile:"makefile"})[a.split(".").pop()?.toLowerCase()||""]||"plaintext";return(0,d.jsxs)("div",{className:"flex flex-col h-full bg-background min-w-0 overflow-x-hidden",children:[(0,d.jsxs)("div",{className:"border-b border-border/50 px-3 sm:px-4 py-2 flex items-center justify-between bg-card/50 backdrop-blur-sm",children:[(0,d.jsxs)("div",{className:"min-w-0 flex items-center gap-2 sm:gap-3",children:[(0,d.jsx)(aa,{}),(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:aT?(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),a7()},className:"flex items-center gap-1",children:[(0,d.jsx)(R.Input,{ref:a_,value:aR,onChange:a=>aS(a.target.value),onBlur:a7,className:"h-7 text-sm font-semibold w-40 px-2",placeholder:"Session name"}),(0,d.jsx)(i.Button,{type:"submit",size:"icon",variant:"ghost",className:"size-6 text-muted-foreground hover:text-foreground",children:(0,d.jsx)(F.Check,{className:"size-3.5"})})]}):(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)("button",{onClick:()=>aU(!0),className:"flex items-center gap-1.5 group hover:bg-muted/50 rounded px-1.5 py-0.5 -mx-1.5 transition-colors",children:[(0,d.jsx)("h2",{className:"font-semibold text-foreground truncate max-w-[200px]",children:aR||"Untitled Session"}),(0,d.jsx)(E.Pencil,{className:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),(0,d.jsx)(j.TooltipContent,{children:"Click to rename"})]})})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-muted/30 text-xs text-muted-foreground max-w-[200px]",children:[(0,d.jsx)(I.FolderOpen,{className:"size-3.5 shrink-0"}),(0,d.jsx)("span",{className:"truncate font-mono",children:a.workingDirectory.split("/").pop()||a.workingDirectory})]})}),(0,d.jsx)(j.TooltipContent,{side:"bottom",className:"max-w-md",children:(0,d.jsx)("p",{className:"font-mono text-xs",children:a.workingDirectory})})]})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[al&&(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)(h.Badge,{variant:"outline",className:"gap-1.5 text-xs border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 cursor-help",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-current animate-pulse"}),"Watching"]})}),(0,d.jsx)(j.TooltipContent,{children:"Watching stream from another client"})]})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(h.Badge,{variant:ad?"default":"secondary",className:`cursor-help ${ad?"bg-primary/90":""}`,children:ad?al?"streaming":"running":a.status})}),(0,d.jsx)(j.TooltipContent,{children:ad?al?"Receiving streamed response":"Agent is processing":`Session is ${a.status}`})]})}),(0,d.jsxs)(O.Dialog,{open:aZ,onOpenChange:a$,children:[(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(O.DialogTrigger,{asChild:!0,children:(0,d.jsx)(i.Button,{size:"icon",variant:"ghost",className:"size-7 hover:bg-accent transition-colors",children:(0,d.jsx)(G.Settings,{className:"size-4"})})})}),(0,d.jsx)(j.TooltipContent,{children:"Session Settings"})]})}),(0,d.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,d.jsx)(O.DialogHeader,{children:(0,d.jsxs)(O.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg bg-muted flex items-center justify-center",children:(0,d.jsx)(G.Settings,{className:"size-4"})}),"Session Settings"]})}),(0,d.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(Q.Label,{className:"text-sm font-medium",children:"Model"}),(0,d.jsxs)(z.Select,{value:aP,onValueChange:a6,disabled:ad,children:[(0,d.jsx)(z.SelectTrigger,{className:"w-full",children:(0,d.jsx)(z.SelectValue,{placeholder:"Select model"})}),(0,d.jsx)(z.SelectContent,{children:aV?.availableModels.map(a=>(0,d.jsx)(z.SelectItem,{value:a.id,children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{children:a.name}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:a.provider})]})},a.id))})]}),ad&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Cannot change model while agent is running"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(Q.Label,{className:"flex items-center gap-2 text-sm font-medium",children:"Tool Approvals"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground -mt-0.5",children:"Toggle on to require approval before tool executes"}),(0,d.jsx)("div",{className:"space-y-1 rounded-lg border p-2.5 bg-muted/30",children:aV?.availableTools.map(a=>{var b;let c=(b=a.id,aX.toolApprovals?.[b]!==void 0?aX.toolApprovals[b]:"bash"===b);return(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors",children:[(0,d.jsxs)("div",{className:"space-y-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:a.name}),a.dangerous&&(0,d.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,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a.description})]}),(0,d.jsx)(P.Switch,{checked:c,onCheckedChange:()=>bj(a.id,c)})]},a.id)})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"These settings only apply to this session. Changes take effect for future tool calls."})]})]})]})]})]}),a0?.updateAvailable&&!a2&&(0,d.jsxs)("div",{className:"px-4 py-2 border-b border-amber-500/30 bg-amber-500/10 flex items-center justify-between gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(L.Download,{className:"size-4 text-amber-600 dark:text-amber-400 shrink-0"}),(0,d.jsxs)("span",{className:"text-sm text-amber-700 dark:text-amber-300",children:["Update available: ",(0,d.jsxs)("strong",{children:["v",a0.latestVersion]}),(0,d.jsxs)("span",{className:"text-amber-600/70 dark:text-amber-400/70 ml-1",children:["(current: v",a0.currentVersion,")"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,d.jsx)(i.Button,{size:"sm",variant:"outline",className:"h-7 text-xs border-amber-500/50 bg-amber-500/20 hover:bg-amber-500/30 text-amber-700 dark:text-amber-300",onClick:a8,disabled:a4,children:a4?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(B.RefreshCw,{className:"size-3 mr-1.5 animate-spin"}),"Creating..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L.Download,{className:"size-3 mr-1.5"}),"Update Now"]})}),(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsx)(i.Button,{size:"icon",variant:"ghost",className:"size-6 text-amber-600 dark:text-amber-400 hover:bg-amber-500/20",onClick:()=>{a3(!0),a0?.latestVersion&&localStorage.setItem("sparkecoder-dismissed-version",a0.latestVersion)},children:(0,d.jsx)(M.X,{className:"size-3.5"})})}),(0,d.jsx)(j.TooltipContent,{children:"Dismiss (won't show again for this version)"})]})})]})]}),az&&az.todos&&az.todos.length>0&&(0,d.jsx)("div",{className:"px-4 py-2 border-b border-border/50 bg-muted/20",children:(0,d.jsx)(w.TodoPanel,{todosData:az})}),ax.length>0&&(0,d.jsx)("div",{className:"p-4 border-b border-border space-y-3",children:ax.map(a=>{let b=a.input;return(0,d.jsxs)(p.Confirmation,{approval:{id:a.id,approved:!1},state:"approval-requested",children:[(0,d.jsx)(p.ConfirmationRequest,{children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg bg-amber-500/20 flex items-center justify-center shrink-0",children:(0,d.jsx)(C.AlertTriangle,{className:"size-4 text-amber-500"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Approval Required"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:(0,d.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-foreground",children:a.toolName})}),(0,d.jsx)("div",{className:"mt-3 rounded-lg border bg-muted/30 overflow-hidden",children:Object.entries(b).map(([a,b])=>(0,d.jsxs)("div",{className:"flex border-b border-border/50 last:border-b-0",children:[(0,d.jsx)("div",{className:"px-3 py-2 bg-muted/50 text-xs font-medium text-muted-foreground w-24 shrink-0",children:a}),(0,d.jsx)("div",{className:"px-3 py-2 text-xs font-mono flex-1 min-w-0 overflow-auto max-h-24",children:"string"==typeof b?(0,d.jsx)("span",{className:"whitespace-pre-wrap break-words",children:b}):(0,d.jsx)("span",{className:"text-muted-foreground",children:JSON.stringify(b)})})]},a))})]})]})}),(0,d.jsxs)(p.ConfirmationActions,{children:[(0,d.jsx)(p.ConfirmationAction,{variant:"outline",onClick:()=>bh(a),children:"Reject"}),(0,d.jsx)(p.ConfirmationAction,{variant:"ghost",onClick:()=>bi(a),className:"text-muted-foreground hover:text-foreground",children:"Don't ask again"}),(0,d.jsx)(p.ConfirmationAction,{variant:"default",onClick:()=>bg(a),children:"Approve"})]})]},a.id)})}),(0,d.jsxs)(k.Conversation,{className:"flex-1 p-4",children:[(0,d.jsxs)(k.ConversationContent,{className:"max-w-3xl mx-auto w-full",children:[aI&&(0,d.jsx)("div",{className:"flex justify-center py-12",children:(0,d.jsx)(q.Loader,{size:24})}),!aI&&0===b.length&&!ap&&(0,d.jsx)(k.ConversationEmptyState,{icon:(0,d.jsxs)("div",{className:"relative overflow-hidden rounded-2xl size-16 shadow-lg ring-1 ring-white/10",children:[(0,d.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:64,height:64,className:"absolute inset-0 size-full object-cover",priority:!0}),ad&&(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})]}),title:"Start a conversation",description:"Ask SparkECoder to help you with coding tasks"}),b.filter(a=>!("tool-call"===a.type&&a.toolCall&&(ax.some(b=>b.toolCallId===a.toolCall?.toolCallId)||av.some(b=>b.toolCallId===a.toolCall?.toolCallId||b.toolName===a.toolCall?.toolName&&("streaming"===b.status||"running"===b.status))))&&!0).map(a=>{if("user-message"===a.type){let b=void 0!==a.messageSequence&&aB.some(b=>b.messageSequence===a.messageSequence);return(0,d.jsxs)(l.Message,{from:"user",children:[(0,d.jsxs)(l.MessageContent,{children:[a.attachments&&a.attachments.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-2 mb-2",children:a.attachments.map((a,b)=>(0,d.jsx)("div",{className:"relative",children:"image"===a.type?(0,d.jsx)("div",{className:"relative rounded-lg overflow-hidden border border-border/50 max-w-[200px]",children:(0,d.jsx)("img",{src:a.data.startsWith("data:")?a.data:`data:${a.mediaType||"image/png"};base64,${a.data}`,alt:a.filename||"Image attachment",className:"max-w-full h-auto max-h-[150px] object-contain"})}):(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-muted/50 border border-border/50",children:[(0,d.jsx)(K.FileIcon,{className:"h-4 w-4 text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-[150px]",children:a.filename||"File"})]})},b))}),a.content&&(0,d.jsx)("p",{className:"whitespace-pre-wrap",children:a.content})]}),b&&!ad&&(0,d.jsx)(l.MessageActions,{className:"justify-end mt-1",children:(0,d.jsx)(j.TooltipProvider,{children:(0,d.jsxs)(j.Tooltip,{children:[(0,d.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,d.jsxs)(i.Button,{variant:"ghost",size:"sm",onClick:()=>bb(a.messageSequence,a.content),disabled:aD,className:"h-6 px-2 text-xs text-muted-foreground hover:text-destructive gap-1",children:[(0,d.jsx)(H.RotateCcw,{className:"h-3 w-3"}),"Revert"]})}),(0,d.jsx)(j.TooltipContent,{children:(0,d.jsx)("p",{children:"Revert to before this message (undo all changes after)"})})]})})})]},a.id)}if("reasoning"===a.type)return(0,d.jsxs)(r.Reasoning,{isStreaming:!1,defaultOpen:!1,children:[(0,d.jsx)(r.ReasoningTrigger,{}),(0,d.jsx)(r.ReasoningContent,{children:a.content||""})]},a.id);if("assistant-text"===a.type)return(0,d.jsx)(l.Message,{from:"assistant",children:(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)(f.default,{src:"/sparke-coder.png",alt:"SparkECoder",width:32,height:32,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)(l.MessageContent,{children:(0,d.jsx)(l.MessageResponse,{children:a.content||""})}),(0,d.jsx)(l.MessageActions,{children:(0,d.jsx)(l.MessageAction,{label:"Copy",onClick:()=>navigator.clipboard.writeText(a.content||""),children:(0,d.jsx)(A.Copy,{className:"size-3"})})})]})]})},a.id);if("tool-call"===a.type&&a.toolCall){let b=a.toolCall,c=`tool-${b.toolName}`;if("write_file"===b.toolName)return(0,d.jsx)(S.WriteFileTool,{input:b.input,output:b.output,status:b.status,streamingArgsText:b.streamingArgsText,liveContent:b.liveContent,liveOldString:b.liveOldString,liveNewString:b.liveNewString},a.id);if("read_file"===b.toolName)return(0,d.jsx)(T.ReadFileTool,{input:b.input,output:b.output,status:b.status},a.id);if("bash"===b.toolName)return(0,d.jsx)(U.BashTool,{input:b.input,output:b.output,status:b.status,terminalId:b.terminalId,liveOutput:b.liveOutput},a.id);if("explore_agent"===b.toolName)return(0,d.jsx)(V.SearchTool,{input:b.input,output:b.output,status:b.status,steps:b.exploreSteps},a.id);if("todo"===b.toolName)return(0,d.jsx)(W.TodoTool,{input:b.input,output:b.output,status:b.status},a.id);if("load_skill"===b.toolName)return(0,d.jsx)(X.LoadSkillTool,{input:b.input,output:b.output,status:b.status},a.id);if("linter"===b.toolName)return(0,d.jsx)(Y.LinterTool,{input:b.input,output:b.output,status:b.status},a.id);let e="completed"!==b.status;return(0,d.jsxs)(m.Tool,{defaultOpen:e,children:[(0,d.jsx)(m.ToolHeader,{type:c,state:function(a){switch(a){case"pending":case"streaming":default:return"input-streaming";case"running":return"input-available";case"completed":return"output-available";case"rejected":return"output-denied";case"error":return"output-error"}}(b.status),title:b.toolName}),(0,d.jsxs)(m.ToolContent,{children:[(0,d.jsx)(m.ToolInput,{input:b.input}),(a=>{let b=a.output,c=a.input;if("bash"===a.toolName)return(0,d.jsx)(U.BashTool,{input:a.input,output:a.output,status:a.status,terminalId:a.terminalId,liveOutput:a.liveOutput,className:"mt-2"});if("explore_agent"===a.toolName)return(0,d.jsx)(V.SearchTool,{input:a.input,output:a.output,status:a.status,steps:a.exploreSteps,className:"mt-2"});if("todo"===a.toolName)return(0,d.jsx)(W.TodoTool,{input:a.input,output:a.output,status:a.status,className:"mt-2"});if("load_skill"===a.toolName)return(0,d.jsx)(X.LoadSkillTool,{input:a.input,output:a.output,status:a.status,className:"mt-2"});if("write_file"===a.toolName&&c){let a=c.path||"file",e=c.mode||"full",f=a.split("/").pop()||"file",g=bk(a);if("str_replace"===e){let a=c.old_string||"",e=c.new_string||"";return(0,d.jsxs)("div",{className:"mt-2 max-w-full overflow-hidden space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground"}),(0,d.jsx)("span",{className:"font-medium",children:f}),(0,d.jsx)(h.Badge,{variant:"secondary",className:"text-xs",children:"str_replace"})]}),(0,d.jsxs)("div",{className:"rounded-md border overflow-hidden",children:[(0,d.jsxs)("div",{className:"bg-red-500/10 border-b p-2",children:[(0,d.jsx)("div",{className:"text-xs text-red-500 mb-1",children:"- Remove:"}),(0,d.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-wrap break-words text-red-400",children:a.length>500?a.slice(0,500)+"...":a})]}),(0,d.jsxs)("div",{className:"bg-green-500/10 p-2",children:[(0,d.jsx)("div",{className:"text-xs text-green-500 mb-1",children:"+ Add:"}),(0,d.jsx)("pre",{className:"text-xs overflow-x-auto whitespace-pre-wrap break-words text-green-400",children:e.length>500?e.slice(0,500)+"...":e})]})]}),b&&(0,d.jsxs)("div",{className:`text-xs flex items-center gap-1 ${b.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[(0,d.jsx)("span",{children:b.success?"✓":"✗"}),(0,d.jsx)("span",{children:b.success?`Replaced (${void 0!==b.lineDelta?(b.lineDelta>=0?"+":"")+b.lineDelta+" lines":"done"})`:b.error||"Failed"})]})]})}let i=c.content||"";return(0,d.jsxs)("div",{className:"mt-2 max-w-full overflow-hidden",children:[(0,d.jsxs)(n.Artifact,{children:[(0,d.jsxs)(n.ArtifactHeader,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground shrink-0"}),(0,d.jsx)(n.ArtifactTitle,{className:"truncate",children:f}),(0,d.jsx)(n.ArtifactDescription,{className:"truncate text-xs hidden sm:block",children:a})]}),(0,d.jsx)(n.ArtifactActions,{children:(0,d.jsx)(n.ArtifactAction,{icon:A.Copy,label:"Copy",onClick:()=>navigator.clipboard.writeText(i)})})]}),i&&(0,d.jsx)(n.ArtifactContent,{className:"p-0 max-h-[300px] overflow-auto",children:(0,d.jsx)(o.CodeBlock,{code:i,language:g,showLineNumbers:!0,children:(0,d.jsx)(o.CodeBlockHeader,{className:"sr-only",children:(0,d.jsx)(o.CodeBlockTitle,{children:(0,d.jsx)(o.CodeBlockFilename,{children:f})})})})})]}),b&&(0,d.jsxs)("div",{className:`mt-2 text-xs flex items-center gap-1 ${b.success?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[(0,d.jsx)("span",{children:b.success?"✓":"✗"}),(0,d.jsx)("span",{children:b.success?`File ${b.action||"written"} successfully`:b.error||"Failed"})]})]})}if("read_file"===a.toolName&&b){let a=c?.path||"file",e=b.content||JSON.stringify(b,null,2),f=a.split("/").pop()||"file",g=bk(a);return(0,d.jsx)("div",{className:"mt-2 max-w-full overflow-hidden",children:(0,d.jsxs)(n.Artifact,{children:[(0,d.jsxs)(n.ArtifactHeader,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(D.FileCode,{className:"size-4 text-muted-foreground shrink-0"}),(0,d.jsx)(n.ArtifactTitle,{className:"truncate",children:f}),(0,d.jsx)(n.ArtifactDescription,{className:"truncate text-xs hidden sm:block",children:a})]}),(0,d.jsx)(n.ArtifactActions,{children:(0,d.jsx)(n.ArtifactAction,{icon:A.Copy,label:"Copy",onClick:()=>navigator.clipboard.writeText(e)})})]}),(0,d.jsx)(n.ArtifactContent,{className:"p-0 max-h-[300px] overflow-auto",children:(0,d.jsx)(o.CodeBlock,{code:e,language:g,showLineNumbers:!0,children:(0,d.jsx)(o.CodeBlockHeader,{className:"sr-only",children:(0,d.jsx)(o.CodeBlockTitle,{children:(0,d.jsx)(o.CodeBlockFilename,{children:f})})})})})]})})}return b?(0,d.jsx)(m.ToolOutput,{output:(0,d.jsxs)("pre",{className:"text-xs overflow-x-auto max-w-full whitespace-pre-wrap break-words",children:[JSON.stringify(b,null,2).slice(0,500),JSON.stringify(b).length>500?"...":""]}),errorText:"error"===a.status?"Tool execution failed":void 0}):null})(b)]})]},a.id)}return null}),ad&&!ap&&!ar&&0===av.length&&(0,d.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:"Thinking..."})]}),ad&&(at||ar)&&(0,d.jsxs)(r.Reasoning,{isStreaming:at,defaultOpen:!0,children:[(0,d.jsx)(r.ReasoningTrigger,{}),(0,d.jsx)(r.ReasoningContent,{children:ar})]}),ad&&ap&&(0,d.jsx)(l.Message,{from:"assistant",children:(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsx)("div",{className:"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0",children:(0,d.jsx)("video",{src:"/sparkecode.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"absolute inset-0 size-full object-cover"})}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsxs)(l.MessageContent,{children:[(0,d.jsx)(l.MessageResponse,{children:ap}),(0,d.jsx)("span",{className:"inline-block w-2 h-4 bg-primary animate-pulse ml-1"})]})})]})}),ad&&av.map(a=>"write_file"===a.toolName?(0,d.jsx)(S.WriteFileTool,{input:a.input,output:a.output,status:a.status,streamingArgsText:a.streamingArgsText,liveContent:a.liveContent,liveOldString:a.liveOldString,liveNewString:a.liveNewString},a.toolCallId):"read_file"===a.toolName?(0,d.jsx)(T.ReadFileTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"bash"===a.toolName?(0,d.jsx)(U.BashTool,{input:a.input,output:a.output,status:a.status,terminalId:a.terminalId,liveOutput:a.liveOutput},a.toolCallId):"explore_agent"===a.toolName?(0,d.jsx)(V.SearchTool,{input:a.input,output:a.output,status:a.status,steps:a.exploreSteps},a.toolCallId):"todo"===a.toolName?(0,d.jsx)(W.TodoTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"load_skill"===a.toolName?(0,d.jsx)(X.LoadSkillTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):"linter"===a.toolName?(0,d.jsx)(Y.LinterTool,{input:a.input,output:a.output,status:a.status},a.toolCallId):(0,d.jsxs)(m.Tool,{defaultOpen:!0,children:[(0,d.jsx)(m.ToolHeader,{type:`tool-${a.toolName}`,state:"streaming"===a.status?"input-streaming":"input-available",title:a.toolName}),(0,d.jsxs)(m.ToolContent,{children:[(0,d.jsx)(m.ToolInput,{input:a.input}),(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-muted-foreground",children:[(0,d.jsx)(q.Loader,{size:14}),(0,d.jsx)("span",{className:"text-sm",children:"streaming"===a.status?"Receiving...":"Executing..."})]})]})]},a.toolCallId)),ad&&!ap&&0===av.length&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,d.jsx)(q.Loader,{size:16}),(0,d.jsx)("span",{className:"text-sm",children:"Thinking..."})]})]}),(0,d.jsx)(k.ConversationScrollButton,{})]}),af&&(0,d.jsxs)("div",{className:"fixed bottom-28 right-4 w-80 max-h-80 overflow-auto border bg-background/95 shadow-lg rounded-md text-xs",children:[(0,d.jsx)("div",{className:"px-3 py-2 border-b font-mono text-muted-foreground",children:"SSE Debug"}),(0,d.jsxs)("div",{className:"px-3 py-2 space-y-1",children:[0===ah.length&&0===aj.length&&(0,d.jsx)("div",{className:"text-muted-foreground",children:"No events yet"}),ah.map((a,b)=>(0,d.jsx)("div",{className:"font-mono",children:a},`evt-${b}`)),aj.map((a,b)=>(0,d.jsx)("div",{className:"font-mono text-red-600",children:a},`err-${b}`))]})]}),(0,d.jsx)("div",{className:"border-t border-border/50 p-4 pb-6 bg-card/30",children:(0,d.jsxs)("div",{className:"max-w-3xl mx-auto",children:[!aI&&0===b.length&&!ap&&!ad&&(0,d.jsx)(u.Suggestions,{className:"mb-3",children:['Create a hello.txt file with "Hello, World!"',"List files in the current directory","Show the current git status"].map(a=>(0,d.jsx)(u.Suggestion,{suggestion:a,onClick:a=>{J(a)}},a))}),(0,d.jsx)($.MentionInputProvider,{children:(0,d.jsxs)(s.PromptInput,{onSubmit:be,className:"shadow-sm",globalDrop:!0,multiple:!0,children:[(0,d.jsx)(s.PromptInputHeader,{children:(0,d.jsx)(ab,{})}),(0,d.jsx)(s.PromptInputBody,{children:(0,d.jsxs)("div",{className:"relative w-full",children:[(0,d.jsx)($.MentionTextarea,{sessionId:a.id,value:t+(N?(!t||t.endsWith(" ")||t.endsWith("\n")?"":" ")+N:""),onChange:a=>{N&&_(""),J(a)},placeholder:"Ask SparkECoder... (@ to mention files, / for commands)",disabled:ad,autoFocus:!0,className:(0,g.cn)("min-h-[80px] focus:ring-2 focus:ring-primary/20 transition-all field-sizing-content max-h-48",N&&"caret-red-500")}),N&&(0,d.jsxs)("div",{className:"absolute bottom-2 right-2 flex items-center gap-1.5 text-xs text-red-500 bg-background/80 backdrop-blur-sm px-2 py-1 rounded-full",children:[(0,d.jsx)("span",{className:"size-2 bg-red-500 rounded-full animate-pulse"}),"Listening..."]})]})}),(0,d.jsxs)(s.PromptInputFooter,{children:[(0,d.jsx)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:(0,d.jsx)("span",{className:"hidden sm:inline",children:"Type @ to mention files, / for commands"})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(Z.SpeechInput,{size:"icon",className:"size-9",onTranscriptionChange:a=>{J(b=>{let c=b&&!b.endsWith(" ")&&!b.endsWith("\n");return b+(c?" ":"")+a})},onInterimTranscription:a=>{_(a)},disabled:ad}),(0,d.jsx)(ac,{input:t+N,isRunning:ad,onStop:bf})]})]})]})})]})})]})}[l,m,o,r,S,T]=_.then?(await _)():_,a.s(["ChatInterface",()=>ad]),c()}catch(a){c(a)}},!1),196069,a=>a.a(async(b,c)=>{try{var d=a.i(256856),e=a.i(755132),f=a.i(832315),g=a.i(845439),h=a.i(979412),i=a.i(252831),j=b([g]);function k({params:a}){let{id:b}=(0,e.use)(a),c=(0,f.useRouter)(),[j,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(!0),[n,o]=(0,e.useState)(null);return((0,e.useEffect)(()=>{!async function(){try{let a=await (0,h.getSession)(b);if(!a)return void o("Session not found");k(a)}catch(a){console.error("Failed to load session:",a),o("Failed to load session")}finally{m(!1)}}()},[b]),l)?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsx)(i.Loader2,{className:"size-8 animate-spin text-muted-foreground"})}):n||!j?(0,d.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-4",children:n||"Session not found"}),(0,d.jsx)("button",{onClick:()=>c.push("/"),className:"text-primary hover:underline",children:"Go back home"})]})}):(0,d.jsx)(g.ChatInterface,{session:j})}[g]=j.then?(await j)():j,a.s(["default",()=>k]),c()}catch(a){c(a)}},!1)];
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=%5Broot-of-the-server%5D__a7aab2da._.js.map
|
package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_page_tsx_5ac4794b._.js
CHANGED
|
@@ -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)(),{sessions:
|
|
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-5",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-5",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 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--RyJoI9WcF0eCUVsGPZmWy--><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/f81a19eca278424b.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/2110d26bc24ed542.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,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";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/2110d26bc24ed542.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/f81a19eca278424b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"RyJoI9WcF0eCUVsGPZmWy\",\"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/f81a19eca278424b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2110d26bc24ed542.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><!--jybk5cjreBvhl2R6_xEEB--><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/3c89eb00b6f64d7c.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/2110d26bc24ed542.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,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";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/2110d26bc24ed542.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/3c89eb00b6f64d7c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"jybk5cjreBvhl2R6-xEEB\",\"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/3c89eb00b6f64d7c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2110d26bc24ed542.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><!--
|
|
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\":\"
|
|
1
|
+
<!DOCTYPE html><!--jybk5cjreBvhl2R6_xEEB--><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,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";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\":\"jybk5cjreBvhl2R6-xEEB\",\"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\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"onHQtP+UceXIUzElrYtiDFqlj9s4nEHJIEA5gFOqbxM=\"\n}"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77589,e=>{"use strict";let t=(0,e.i(292511).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["default",()=>t])},416667,e=>{"use strict";let t=(0,e.i(292511).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",()=>t])},191729,772857,e=>{"use strict";let t=(0,e.i(292511).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["default",()=>t],191729);var r=e.i(414294),l=e.i(430878);e.i(773340);var o=e.i(309945),n=Symbol("radix.slottable");function s(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===n}var i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n,i;let a,c,d,u=(i=n=`Primitive.${t}`,(a=l.forwardRef((e,t)=>{let{children:r,...n}=e;if(l.isValidElement(r)){var s;let e,i,a=(s=r,(i=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(i=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),c=function(e,t){let r={...t};for(let l in t){let o=e[l],n=t[l];/^on[A-Z]/.test(l)?o&&n?r[l]=(...e)=>{let t=n(...e);return o(...e),t}:o&&(r[l]=o):"style"===l?r[l]={...o,...n}:"className"===l&&(r[l]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==l.Fragment&&(c.ref=t?(0,o.composeRefs)(t,a):a),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null})).displayName=`${i}.SlotClone`,c=a,(d=l.forwardRef((e,t)=>{let{children:o,...n}=e,i=l.Children.toArray(o),a=i.find(s);if(a){let e=a.props.children,o=i.map(t=>t!==a?t:l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null);return(0,r.jsx)(c,{...n,ref:t,children:l.isValidElement(e)?l.cloneElement(e,void 0,o):null})}return(0,r.jsx)(c,{...n,ref:t,children:o})})).displayName=`${n}.Slot`,d),p=l.forwardRef((e,l)=>{let{asChild:o,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(o?u:t,{...n,ref:l})});return p.displayName=`Primitive.${t}`,{...e,[t]:p}},{}),a=e.i(395509),c=e.i(897462),d=e.i(542899),u=e.i(995945),p=e.i(992421),f=e.i(241416),m="ScrollArea",[h,x]=function(e,t=[]){let o=[],n=()=>{let t=o.map(e=>l.createContext(e));return function(r){let o=r?.[e]||t;return l.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return n.scopeName=e,[function(t,n){let s=l.createContext(n),i=o.length;o=[...o,n];let a=t=>{let{scope:o,children:n,...a}=t,c=o?.[e]?.[i]||s,d=l.useMemo(()=>a,Object.values(a));return(0,r.jsx)(c.Provider,{value:d,children:n})};return a.displayName=t+"Provider",[a,function(r,o){let a=o?.[e]?.[i]||s,c=l.useContext(a);if(c)return c;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let o=r.reduce((t,{useScope:r,scopeName:l})=>{let o=r(e)[`__scope${l}`];return{...t,...o}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}(n,...t)]}(m),[v,g]=h(m),w=l.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:s="hover",dir:a,scrollHideDelay:c=600,...u}=e,[p,f]=l.useState(null),[m,h]=l.useState(null),[x,g]=l.useState(null),[w,b]=l.useState(null),[y,j]=l.useState(null),[S,C]=l.useState(0),[N,E]=l.useState(0),[R,T]=l.useState(!1),[P,k]=l.useState(!1),A=(0,o.useComposedRefs)(t,e=>f(e)),L=(0,d.useDirection)(a);return(0,r.jsx)(v,{scope:n,type:s,dir:L,scrollHideDelay:c,scrollArea:p,viewport:m,onViewportChange:h,content:x,onContentChange:g,scrollbarX:w,onScrollbarXChange:b,scrollbarXEnabled:R,onScrollbarXEnabledChange:T,scrollbarY:y,onScrollbarYChange:j,scrollbarYEnabled:P,onScrollbarYEnabledChange:k,onCornerWidthChange:C,onCornerHeightChange:E,children:(0,r.jsx)(i.div,{dir:L,...u,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});w.displayName=m;var b="ScrollAreaViewport",y=l.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:s,nonce:a,...c}=e,d=g(b,n),u=l.useRef(null),p=(0,o.useComposedRefs)(t,u,d.onViewportChange);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),(0,r.jsx)(i.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,r.jsx)("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});y.displayName=b;var j="ScrollAreaScrollbar",S=l.forwardRef((e,t)=>{let{forceMount:o,...n}=e,s=g(j,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,c="horizontal"===e.orientation;return l.useEffect(()=>(c?i(!0):a(!0),()=>{c?i(!1):a(!1)}),[c,i,a]),"hover"===s.type?(0,r.jsx)(C,{...n,ref:t,forceMount:o}):"scroll"===s.type?(0,r.jsx)(N,{...n,ref:t,forceMount:o}):"auto"===s.type?(0,r.jsx)(E,{...n,ref:t,forceMount:o}):"always"===s.type?(0,r.jsx)(R,{...n,ref:t}):null});S.displayName=j;var C=l.forwardRef((e,t)=>{let{forceMount:o,...n}=e,s=g(j,e.__scopeScrollArea),[i,c]=l.useState(!1);return l.useEffect(()=>{let e=s.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),c(!0)},l=()=>{t=window.setTimeout(()=>c(!1),s.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",l),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),(0,r.jsx)(a.Presence,{present:o||i,children:(0,r.jsx)(E,{"data-state":i?"visible":"hidden",...n,ref:t})})}),N=l.forwardRef((e,t)=>{var o;let{forceMount:n,...s}=e,i=g(j,e.__scopeScrollArea),c="horizontal"===e.orientation,d=V(()=>p("SCROLL_END"),100),[u,p]=(o={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},l.useReducer((e,t)=>o[e][t]??e,"hidden"));return l.useEffect(()=>{if("idle"===u){let e=window.setTimeout(()=>p("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[u,i.scrollHideDelay,p]),l.useEffect(()=>{let e=i.viewport,t=c?"scrollLeft":"scrollTop";if(e){let r=e[t],l=()=>{let l=e[t];r!==l&&(p("SCROLL"),d()),r=l};return e.addEventListener("scroll",l),()=>e.removeEventListener("scroll",l)}},[i.viewport,c,p,d]),(0,r.jsx)(a.Presence,{present:n||"hidden"!==u,children:(0,r.jsx)(R,{"data-state":"hidden"===u?"hidden":"visible",...s,ref:t,onPointerEnter:(0,f.composeEventHandlers)(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:(0,f.composeEventHandlers)(e.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),E=l.forwardRef((e,t)=>{let o=g(j,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,c]=l.useState(!1),d="horizontal"===e.orientation,u=V(()=>{if(o.viewport){let e=o.viewport.offsetWidth<o.viewport.scrollWidth,t=o.viewport.offsetHeight<o.viewport.scrollHeight;c(d?e:t)}},10);return Y(o.viewport,u),Y(o.content,u),(0,r.jsx)(a.Presence,{present:n||i,children:(0,r.jsx)(R,{"data-state":i?"visible":"hidden",...s,ref:t})})}),R=l.forwardRef((e,t)=>{let{orientation:o="vertical",...n}=e,s=g(j,e.__scopeScrollArea),i=l.useRef(null),a=l.useRef(0),[c,d]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=$(c.viewport,c.content),p={...n,sizes:c,onSizesChange:d,hasThumb:!!(u>0&&u<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:e=>a.current=e};function f(e,t){return function(e,t,r,l="ltr"){let o=O(r),n=t||o/2,s=r.scrollbar.paddingStart+n,i=r.scrollbar.size-r.scrollbar.paddingEnd-(o-n),a=r.content-r.viewport;return B([s,i],"ltr"===l?[0,a]:[-1*a,0])(e)}(e,a.current,c,t)}return"horizontal"===o?(0,r.jsx)(T,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){let e=F(s.viewport.scrollLeft,c,s.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollLeft=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollLeft=f(e,s.dir))}}):"vertical"===o?(0,r.jsx)(P,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){let e=F(s.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{s.viewport&&(s.viewport.scrollTop=e)},onDragScroll:e=>{s.viewport&&(s.viewport.scrollTop=f(e))}}):null}),T=l.forwardRef((e,t)=>{let{sizes:n,onSizesChange:s,...i}=e,a=g(j,e.__scopeScrollArea),[c,d]=l.useState(),u=l.useRef(null),p=(0,o.useComposedRefs)(t,u,a.onScrollbarXChange);return l.useEffect(()=>{u.current&&d(getComputedStyle(u.current))},[u]),(0,r.jsx)(L,{"data-orientation":"horizontal",...i,ref:p,sizes:n,style:{bottom:0,left:"rtl"===a.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===a.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(a.viewport){var l,o;let n=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),l=n,o=r,l>0&&l<o&&t.preventDefault()}},onResize:()=>{u.current&&a.viewport&&c&&s({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:W(c.paddingLeft),paddingEnd:W(c.paddingRight)}})}})}),P=l.forwardRef((e,t)=>{let{sizes:n,onSizesChange:s,...i}=e,a=g(j,e.__scopeScrollArea),[c,d]=l.useState(),u=l.useRef(null),p=(0,o.useComposedRefs)(t,u,a.onScrollbarYChange);return l.useEffect(()=>{u.current&&d(getComputedStyle(u.current))},[u]),(0,r.jsx)(L,{"data-orientation":"vertical",...i,ref:p,sizes:n,style:{top:0,right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(a.viewport){var l,o;let n=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),l=n,o=r,l>0&&l<o&&t.preventDefault()}},onResize:()=>{u.current&&a.viewport&&c&&s({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:W(c.paddingTop),paddingEnd:W(c.paddingBottom)}})}})}),[k,A]=h(j),L=l.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:s,hasThumb:a,onThumbChange:d,onThumbPointerUp:u,onThumbPointerDown:p,onThumbPositionChange:m,onDragScroll:h,onWheelScroll:x,onResize:v,...w}=e,b=g(j,n),[y,S]=l.useState(null),C=(0,o.useComposedRefs)(t,e=>S(e)),N=l.useRef(null),E=l.useRef(""),R=b.viewport,T=s.content-s.viewport,P=(0,c.useCallbackRef)(x),A=(0,c.useCallbackRef)(m),L=V(v,10);function _(e){N.current&&h({x:e.clientX-N.current.left,y:e.clientY-N.current.top})}return l.useEffect(()=>{let e=e=>{let t=e.target;y?.contains(t)&&P(e,T)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[R,y,T,P]),l.useEffect(A,[s,A]),Y(y,L),Y(b.content,L),(0,r.jsx)(k,{scope:n,scrollbar:y,hasThumb:a,onThumbChange:(0,c.useCallbackRef)(d),onThumbPointerUp:(0,c.useCallbackRef)(u),onThumbPositionChange:A,onThumbPointerDown:(0,c.useCallbackRef)(p),children:(0,r.jsx)(i.div,{...w,ref:C,style:{position:"absolute",...w.style},onPointerDown:(0,f.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),N.current=y.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),_(e))}),onPointerMove:(0,f.composeEventHandlers)(e.onPointerMove,_),onPointerUp:(0,f.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=E.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),_="ScrollAreaThumb",D=l.forwardRef((e,t)=>{let{forceMount:l,...o}=e,n=A(_,e.__scopeScrollArea);return(0,r.jsx)(a.Presence,{present:l||n.hasThumb,children:(0,r.jsx)(z,{ref:t,...o})})}),z=l.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:s,...a}=e,c=g(_,n),d=A(_,n),{onThumbPositionChange:u}=d,p=(0,o.useComposedRefs)(t,e=>d.onThumbChange(e)),m=l.useRef(void 0),h=V(()=>{m.current&&(m.current(),m.current=void 0)},100);return l.useEffect(()=>{let e=c.viewport;if(e){let t=()=>{h(),m.current||(m.current=U(e,u),u())};return u(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[c.viewport,h,u]),(0,r.jsx)(i.div,{"data-state":d.hasThumb?"visible":"hidden",...a,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:(0,f.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,l=e.clientY-t.top;d.onThumbPointerDown({x:r,y:l})}),onPointerUp:(0,f.composeEventHandlers)(e.onPointerUp,d.onThumbPointerUp)})});D.displayName=_;var I="ScrollAreaCorner",H=l.forwardRef((e,t)=>{let l=g(I,e.__scopeScrollArea),o=!!(l.scrollbarX&&l.scrollbarY);return"scroll"!==l.type&&o?(0,r.jsx)(M,{...e,ref:t}):null});H.displayName=I;var M=l.forwardRef((e,t)=>{let{__scopeScrollArea:o,...n}=e,s=g(I,o),[a,c]=l.useState(0),[d,u]=l.useState(0),p=!!(a&&d);return Y(s.scrollbarX,()=>{let e=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(e),u(e)}),Y(s.scrollbarY,()=>{let e=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(e),c(e)}),p?(0,r.jsx)(i.div,{...n,ref:t,style:{width:a,height:d,position:"absolute",right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:0,...e.style}}):null});function W(e){return e?parseInt(e,10):0}function $(e,t){let r=e/t;return isNaN(r)?0:r}function O(e){let t=$(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function F(e,t,r="ltr"){let l=O(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=(0,p.clamp)(e,"ltr"===r?[0,s]:[-1*s,0]);return B([0,s],[0,n-l])(i)}function B(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let l=(t[1]-t[0])/(e[1]-e[0]);return t[0]+l*(r-e[0])}}var U=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},l=0;return!function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=r.left!==n.left,i=r.top!==n.top;(s||i)&&t(),r=n,l=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(l)};function V(e,t){let r=(0,c.useCallbackRef)(e),o=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),l.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,t)},[r,t])}function Y(e,t){let r=(0,c.useCallbackRef)(t);(0,u.useLayoutEffect)(()=>{let t=0;if(e){let l=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(t),l.unobserve(e)}}},[e,r])}var X=e.i(555552);function K({className:e,children:t,...l}){return(0,r.jsxs)(w,{"data-slot":"scroll-area",className:(0,X.cn)("relative",e),...l,children:[(0,r.jsx)(y,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,r.jsx)(q,{}),(0,r.jsx)(H,{})]})}function q({className:e,orientation:t="vertical",...l}){return(0,r.jsx)(S,{"data-slot":"scroll-area-scrollbar",orientation:t,className:(0,X.cn)("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...l,children:(0,r.jsx)(D,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}e.s(["ScrollArea",()=>K,"ScrollBar",()=>q],772857)},375635,e=>{"use strict";var t=e.i(414294),r=e.i(430878),l=e.i(353913),o=e.i(292623),n=e.i(504561),s=e.i(996720),i=e.i(461957),a=e.i(846193),c=e.i(77589),c=c,d=e.i(416667),d=d,u=e.i(667249),p=e.i(191729),p=p,f=e.i(904781),m=e.i(87614),h=e.i(666904),x=e.i(77982),v=e.i(772857),g=e.i(524741),w=e.i(739963),b=e.i(300739),y=e.i(555552);function j(){let e=(0,l.useRouter)(),j=(0,l.useSearchParams)(),{sessions:S,isLoading:C}=(0,b.useSessions)(),[N,E]=(0,r.useState)(!1),[R,T]=(0,r.useState)(null),[P,k]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[_,D]=(0,r.useState)(null),[z,I]=(0,r.useState)(null),H=(0,r.useRef)(!1),M=async(e,t)=>{e.preventDefault(),e.stopPropagation();try{await (0,g.deleteSession)(t),(0,b.mutateSessions)()}catch(e){console.error("Failed to delete session:",e)}};(0,r.useEffect)(()=>{(0,w.getConfig)().then(T)},[]),(0,r.useEffect)(()=>{j.has("new")&&R&&R.apiKeyConfigured&&!H.current&&!N&&(H.current=!0,(async()=>{E(!0);try{let t=await (0,g.createSession)({name:`Session ${S.length+1}`,model:R.defaultModel||"anthropic/claude-opus-4-5",toolApprovals:R.defaultToolApprovals||{}});(0,b.mutateSessions)(),e.replace(`/session/${t.id}`)}catch(e){console.error("Failed to auto-create session:",e),E(!1)}})())},[j,R,S.length,N,e]),(0,r.useEffect)(()=>{j.has("latest")&&!C&&S.length>0&&e.replace(`/session/${S[0].id}`)},[j,C,S,e]);let W=async()=>{if(P.trim()&&!A){L(!0),D(null);try{if((await (0,g.setApiKey)("ai-gateway",P.trim())).success){let e=await (0,w.getConfig)();T(e),k("")}else D("Failed to save API key. Please try again.")}catch(e){D("Failed to save API key. Please try again.")}finally{L(!1)}}},$=async()=>{if(!N){E(!0);try{let t=await (0,g.createSession)({name:`Session ${S.length+1}`,model:R?.defaultModel||"anthropic/claude-opus-4-5",toolApprovals:R?.defaultToolApprovals||{}});(0,b.mutateSessions)(),e.push(`/session/${t.id}`)}catch(e){console.error("Failed to create session:",e)}finally{E(!1)}}};return((0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"t"===e.key&&(e.preventDefault(),$())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[N,S.length,R]),R&&!R.apiKeyConfigured)?(0,t.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20",children:(0,t.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,t.jsx)("div",{className:"flex justify-center mb-8",children:(0,t.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10",children:(0,t.jsx)(o.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover",priority:!0})})}),(0,t.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,t.jsxs)("div",{className:"bg-muted/50 rounded-lg p-6 mb-6 text-left",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(a.Key,{className:"size-5 text-amber-500"}),(0,t.jsx)("h2",{className:"font-semibold",children:"API Key Required"})]}),(0,t.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,t.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,t.jsx)(x.Input,{type:"password",placeholder:"Enter your AI Gateway API key",value:P,onChange:e=>k(e.target.value),onKeyDown:e=>"Enter"===e.key&&W(),className:"flex-1"}),(0,t.jsx)(h.Button,{onClick:W,disabled:!P.trim()||A,children:A?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):"Save"})]}),_&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive mb-3",children:[(0,t.jsx)(d.default,{className:"size-4"}),_]}),(0,t.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,t.jsx)(c.default,{className:"size-3"})]})]})]})}):(0,t.jsx)("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-background to-muted/20 overflow-auto",children:(0,t.jsxs)("div",{className:"text-center max-w-lg mx-auto p-8",children:[(0,t.jsx)("div",{className:"flex justify-center mb-8",children:(0,t.jsx)(m.TooltipProvider,{children:(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"relative group cursor-pointer",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-3xl blur-2xl opacity-40 group-hover:opacity-60 transition-opacity bg-primary/30"}),(0,t.jsx)("div",{className:"relative size-28 rounded-2xl overflow-hidden shadow-xl ring-1 ring-white/10 hover-lift",children:(0,t.jsx)(o.default,{src:"/sparke-coder.png",alt:"Sparke - AI Coding Assistant",fill:!0,className:"object-cover sparke-idle",priority:!0})})]})}),(0,t.jsx)(m.TooltipContent,{children:"Meet Sparke, your coding companion!"})]})})}),(0,t.jsx)("h1",{className:"text-3xl font-bold mb-3 text-primary",children:"Welcome to SparkECoder"}),(0,t.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,t.jsx)(h.Button,{size:"lg",onClick:$,disabled:N,className:"gap-2 px-8",children:N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}),"Creating..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Plus,{className:"size-4"}),"Start a Session"]})}),(0,t.jsxs)("p",{className:"mt-6 text-xs text-muted-foreground/70",children:["Press ",(0,t.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"⌘"})," + ",(0,t.jsx)("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"T"})," to create a new session"]}),!C&&S.length>0&&(0,t.jsxs)("div",{className:"mt-10 text-left",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(p.default,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"})]}),(0,t.jsx)("div",{className:"rounded-xl border border-border/60 bg-card/50 backdrop-blur-sm overflow-hidden",children:(0,t.jsx)(v.ScrollArea,{className:(0,y.cn)(S.length>5?"h-[280px]":""),children:(0,t.jsx)("div",{className:"divide-y divide-border/40",children:S.map(e=>{let r,l,o,s,i=z===e.id,a=!0===e.isStreaming;return(0,t.jsxs)(n.default,{href:`/session/${e.id}`,className:(0,y.cn)("flex items-center gap-3 p-3 transition-colors hover:bg-accent/50 group",a&&"bg-emerald-500/5"),onMouseEnter:()=>I(e.id),onMouseLeave:()=>I(null),children:[(0,t.jsx)("div",{className:(0,y.cn)("size-9 rounded-lg flex items-center justify-center shrink-0 transition-colors",a?"bg-emerald-500/10":"bg-muted/60 group-hover:bg-muted"),children:a?(0,t.jsx)("span",{className:"size-2.5 rounded-full bg-emerald-500 animate-pulse"}):(0,t.jsx)(u.MessageSquare,{className:"size-4 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:(0,y.cn)("text-sm font-medium truncate",a&&"text-emerald-600 dark:text-emerald-400"),children:e.name||"Untitled Session"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:a?(0,t.jsx)("span",{className:"text-emerald-600 dark:text-emerald-400",children:"Active now"}):"waiting"===e.status?(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Waiting for input"}):(r=new Date(e.updatedAt||e.createdAt),s=Math.floor((o=Math.floor((l=Math.floor(Math.floor((new Date().getTime()-r.getTime())/1e3)/60))/60))/24),l<1?"just now":1===l?"1 minute ago":l<60?`${l} minutes ago`:1===o?"1 hour ago":o<24?`${o} hours ago`:1===s?"yesterday":s<7?`${s} days ago`:`${Math.floor(s/7)} weeks ago`)})]}),i&&(0,t.jsx)(m.TooltipProvider,{children:(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(h.Button,{size:"icon",variant:"ghost",className:"size-7 shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors",onClick:t=>M(t,e.id),children:(0,t.jsx)(f.Trash2,{className:"size-3.5"})})}),(0,t.jsx)(m.TooltipContent,{children:"Delete session"})]})})]},e.id)})})})})]})]})})}function S(){return(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(i.Loader2,{className:"size-6 animate-spin text-muted-foreground"})}),children:(0,t.jsx)(j,{})})}e.s(["default",()=>S],375635)}]);
|