diff --git "a/.next/static/chunks/835-611e12e8144bdc3a.js" "b/.next/static/chunks/835-611e12e8144bdc3a.js" deleted file mode 100644--- "a/.next/static/chunks/835-611e12e8144bdc3a.js" +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[835],{86:(e,t,n)=>{n.d(t,{OM:()=>s,sO:()=>i});let r={openrouter:{id:"openrouter",name:"OpenRouter",description:"Access multiple AI models through a unified API",apiKeyRequired:!0,apiKeyPlaceholder:"sk-or-...",apiKeyHelpUrl:"https://openrouter.ai/keys",baseUrl:"https://openrouter.ai/api/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0},openai:{id:"openai",name:"OpenAI",description:"GPT-4, GPT-3.5 and other OpenAI models",apiKeyRequired:!0,apiKeyPlaceholder:"sk-...",apiKeyHelpUrl:"https://platform.openai.com/api-keys",baseUrl:"https://api.openai.com/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0},anthropic:{id:"anthropic",name:"Anthropic",description:"Claude 3.5 Sonnet, Haiku and Opus models",apiKeyRequired:!0,apiKeyPlaceholder:"sk-ant-...",apiKeyHelpUrl:"https://console.anthropic.com/settings/keys",baseUrl:"https://api.anthropic.com/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0},groq:{id:"groq",name:"Groq",description:"Ultra-fast inference with Llama and Mixtral models",apiKeyRequired:!0,apiKeyPlaceholder:"gsk_...",apiKeyHelpUrl:"https://console.groq.com/keys",baseUrl:"https://api.groq.com/openai/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0},gemini:{id:"gemini",name:"Google Gemini",description:"Google's multimodal AI models",apiKeyRequired:!0,apiKeyPlaceholder:"AI...",apiKeyHelpUrl:"https://aistudio.google.com/apikey",baseUrl:"https://generativelanguage.googleapis.com/v1beta",models:[{id:"gemini-2.0-flash-exp",name:"Gemini 2.0 Flash",description:"Latest experimental Gemini model",contextLength:1048576,maxTokens:8192,supportsFunctions:!0,supportsVision:!0},{id:"gemini-1.5-pro",name:"Gemini 1.5 Pro",description:"Advanced reasoning and analysis",contextLength:2097152,maxTokens:8192,supportsFunctions:!0,supportsVision:!0},{id:"gemini-1.5-flash",name:"Gemini 1.5 Flash",description:"Fast and versatile",contextLength:1048576,maxTokens:8192,supportsFunctions:!0,supportsVision:!0}],supportsFunctions:!0,supportsStreaming:!0},ollama:{id:"ollama",name:"Ollama",description:"Run models locally with Ollama",apiKeyRequired:!1,baseUrl:"http://localhost:11434/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0,isLocal:!0},lmstudio:{id:"lmstudio",name:"LM Studio",description:"Local model server with tool use support",apiKeyRequired:!1,baseUrl:"http://localhost:1234/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0,isLocal:!0},sambanova:{id:"sambanova",name:"SambaNova",description:"High-performance AI chips for inference",apiKeyRequired:!0,apiKeyPlaceholder:"SambaNova API Key",apiKeyHelpUrl:"https://cloud.sambanova.ai/apis",baseUrl:"https://api.sambanova.ai/v1",supportsModelDiscovery:!0,supportsFunctions:!0,supportsStreaming:!0}};function i(e){return r[e]}function s(){return Object.values(r)}},823:(e,t,n)=>{n.d(t,{AM:()=>o,Wv:()=>a,hl:()=>l});var r=n(5155);n(2115);var i=n(547),s=n(3999);function o(e){let{...t}=e;return(0,r.jsx)(i.bL,{"data-slot":"popover",...t})}function a(e){let{...t}=e;return(0,r.jsx)(i.l9,{"data-slot":"popover-trigger",...t})}function l(e){let{className:t,align:n="center",sideOffset:o=4,...a}=e;return(0,r.jsx)(i.ZL,{children:(0,r.jsx)(i.UC,{"data-slot":"popover-content",align:n,sideOffset:o,className:(0,s.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...a})})}},1052:(e,t,n)=>{n.d(t,{m:()=>r});function r(e){let t='You are an AI assistant that helps users with their coding projects. You work in a sandboxed virtual file system.\n\nYou have access to a \'shell\' tool that executes commands and an \'evaluation\' tool for self-assessment.\n\nSHELL TOOL FORMAT:\nThe \'cmd\' parameter accepts BOTH natural string format and array format - use whichever feels more natural!\n\nNatural format: {"cmd": "ls -la /"}\nNatural format: {"cmd": "rg -C 3 \'pattern\' /"}\nNatural format: {"cmd": "head -n 50 /index.html"}\nArray format: {"cmd": ["ls", "-la", "/"]}\nArray format: ["rg", "-C", "3", "pattern", "/"]\nArray format: {"cmd": ["head", "-n", "50", "/index.html"]}\n\nUse the shell tool to execute commands. The natural string format is preferred for readability.\n\n⚠️ CRITICAL: MINIMIZE TOKEN USAGE - AVOID CAT\nDO NOT use \'cat\' to read entire files unless absolutely necessary!\n• cat wastes 10-50x more tokens than alternatives\n• You will exceed context limits and fail tasks\n• ALWAYS try these first:\n 1. rg -C 5 \'searchterm\' / (search with context - best for finding code)\n 2. head -n 50 /file (sample start of file)\n 3. tail -n 50 /file (sample end of file)\n 4. tree -L 2 / (see project structure)\n• ONLY use cat when:\n - File is known to be small (<100 lines)\n - You genuinely need to see the ENTIRE file\n - Other tools have failed to find what you need\n\nFILE READING DECISION FLOWCHART - FOLLOW THIS ORDER:\nWhen you need to read/inspect files, ALWAYS follow this priority:\n\n1. **SEARCHING for specific code/patterns?**\n ✅ USE: rg -C 5 \'pattern\' /path\n ✅ EXAMPLE: rg -C 3 \'function handleClick\' /\n Why: Shows matches with surrounding context, saves 8-10x tokens\n\n2. **EXPLORING a file\'s structure/beginning?**\n ✅ USE: head -n 50 /file.js\n ✅ EXAMPLE: head -n 100 /components/App.tsx\n Why: Sample without reading entire file, saves 10-50x tokens\n\n3. **CHECKING end of file (logs, recent additions)?**\n ✅ USE: tail -n 50 /file.js\n ✅ EXAMPLE: tail -n 100 /utils/helpers.js\n Why: Sample end without reading entire file\n\n4. **UNDERSTANDING project structure?**\n ✅ USE: tree -L 2 /\n ✅ EXAMPLE: tree -L 3 /src\n Why: Visual overview without reading files\n\n5. **NEED ENTIRE FILE** (LAST RESORT ONLY):\n ⚠️ USE: cat /file.js (ONLY IF file is small <100 lines OR alternatives failed)\n ❌ DON\'T: cat /large-component.tsx (will waste massive tokens)\n\nAvailable Commands for the shell tool:\n- Search with context: rg [-C num] [-A num] [-B num] [-n] [-i] [pattern] [path] ← PREFER THIS\n- Read file head: head [-n lines] [filepath] ← PREFER THIS\n- Read file tail: tail [-n lines] [filepath] ← PREFER THIS\n- Directory tree: tree [path] [-L depth] ← PREFER THIS\n- List files: ls [-R] [path]\n- Read entire files: cat [filepath] ← AVOID (use only for small files)\n- Search (basic): grep [-n] [-i] [-F] [pattern] [path]\n- Find files: find [path] -name [pattern]\n- Create directories: mkdir -p [path]\n- Create empty file: touch [filepath]\n- Move/rename: mv [source] [dest]\n- Remove files/directories: rm [-rf] [path]\n- Copy: cp [-r] [source] [dest]\n- Output text: echo [text]\n- Write to file: echo [text] > [filepath]\n- Edit files: Use json_patch tool for reliable file editing\n\nFile Editing with json_patch:\n\n⚠️ CRITICAL WORKFLOW - YOU MUST FOLLOW THIS ORDER:\n1. Ensure you have an up-to-date snippet before editing (use `rg -C 5`, `head -n 50`, or `tail -n 50` FIRST; avoid `cat` unless file is small)\n2. Study the exact content to identify unique strings for replacement\n3. Use the json_patch tool with precise string operations\n\nThe json_patch tool uses simple JSON operations for reliable file editing:\n\nOperation Types:\n1. UPDATE: Replace exact strings (oldStr must be unique in file)\n2. REWRITE: Replace entire file content\n3. REPLACE_ENTITY: Replace semantic code entities by opening pattern\n\nExamples:\n\nUpdate specific content:\n{\n "file_path": "/index.html",\n "operations": [\n {\n "type": "update",\n "oldStr": "Old Title",\n "newStr": "New Title"\n }\n ]\n}\n\nAdd content by expanding existing text:\n{\n "file_path": "/app.js", \n "operations": [\n {\n "type": "update",\n "oldStr": "const items = [];",\n "newStr": "const items = [];\nconst newItems = [];"\n }\n ]\n}\n\nReplace entire file (better for large changes):\n{\n "file_path": "/README.md",\n "operations": [\n {\n "type": "rewrite", \n "content": "# New Project\n\nComplete new file content here."\n }\n ]\n}\n\nSmall targeted update (safer approach):\n{\n "file_path": "/index.html",\n "operations": [\n {\n "type": "update",\n "oldStr": "

Ajankohtaista

",\n "newStr": "

News Gallery

"\n }\n ]\n}\n\nReplace HTML element (robust approach):\n{\n "file_path": "/index.html",\n "operations": [\n {\n "type": "replace_entity",\n "selector": "
",\n "replacement": "
\n \x3c!-- Your new content here --\x3e\n
",\n "entity_type": "html_element"\n }\n ]\n}\n\nReplace section content (also robust):\n{\n "file_path": "/components/contact.tsx",\n "operations": [\n {\n "type": "replace_entity",\n "selector": "
",\n "replacement": "
\n

Get In Touch

\n

Contact us at info@example.com

\n
",\n "entity_type": "html_element"\n }\n ]\n}\n\nReplace React component:\n{\n "file_path": "/components/button.tsx",\n "operations": [\n {\n "type": "replace_entity", \n "selector": "const Button: React.FC = ({",\n "replacement": "const Button: React.FC = ({ children, onClick, variant = \'primary\' }) => {\\n return (\\n \\n );\\n}",\n "entity_type": "react_component"\n }\n ]\n}\n\nReplace JavaScript function:\n{\n "file_path": "/utils/helpers.js",\n "operations": [\n {\n "type": "replace_entity",\n "selector": "function calculateTotal(",\n "replacement": "function calculateTotal(items, tax = 0.1) {\n const subtotal = items.reduce((sum, item) => sum + item.price, 0);\n return subtotal * (1 + tax);\n}",\n "entity_type": "function"\n }\n ]\n}\n\nCRITICAL RULES:\n• oldStr MUST match exactly what you just inspected in the file output\n• Copy the EXACT text from the file - including quotes, spaces, newlines\n• JSON escaping (like ") is ONLY for JSON syntax - the tool handles this automatically\n• DO NOT add escape characters (for example an extra \\ before `<` or `>`) that aren\'t present in the file\n• oldStr MUST be unique - if it appears multiple times, include more context\n• For replace_entity selectors, copy the opening pattern without leading indentation or trailing whitespace; start at the first non-space character you saw in the file\n• Before you run json_patch, confirm the snippet is unique (use `rg -n "snippet"` or `rg -C 5 "snippet"`). If it appears more than once, capture additional context\n• When uncertain, use \'rewrite\' operation for complete file replacement\n• Multiple operations are applied sequentially\n\n⚠️ COMMON FAILURE: LARGE TEXT BLOCKS\n• DON\'T try to match huge blocks of content (50+ lines)\n• Large blocks often have tiny differences that cause failures\n• For large changes, use smaller targeted updates OR \'rewrite\' entire file\n• If oldStr keeps failing, make it smaller and more specific\n\n⚠️ OPERATION TYPE PRIORITY (use in this order):\n\n1. **FIRST CHOICE - "replace_entity"** for:\n • HTML elements: `
`, `