diff --git "a/.next/static/chunks/835-3e178c9782b05497.js" "b/.next/static/chunks/835-3e178c9782b05497.js" new file mode 100644--- /dev/null +++ "b/.next/static/chunks/835-3e178c9782b05497.js" @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[835],{86:(e,t,i)=>{i.d(t,{OM:()=>s,sO:()=>r});let n={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 r(e){return n[e]}function s(){return Object.values(n)}},823:(e,t,i)=>{i.d(t,{AM:()=>o,Wv:()=>a,hl:()=>l});var n=i(5155);i(2115);var r=i(547),s=i(3999);function o(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"popover",...t})}function a(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"popover-trigger",...t})}function l(e){let{className:t,align:i="center",sideOffset:o=4,...a}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsx)(r.UC,{"data-slot":"popover-content",align:i,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,i)=>{i.d(t,{m:()=>n});function n(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\n✅ Natural format: {"cmd": "ls -la /"}\n✅ Natural format: {"cmd": "cat /index.html"}\n✅ Array format: {"cmd": ["ls", "-la", "/"]}\n✅ Array format: {"cmd": ["cat", "/index.html"]}\n\nUse the shell tool to execute commands. The natural string format is preferred for readability.\n\nAvailable Commands for the shell tool:\n- List files: ls\n- Read files: cat [filepath]\n- Number lines: nl [-ba] [filepath] (pair with range slices like `sed -n \'30,60p\' file | nl -ba`; avoid numbering entire files)\n- Search: grep -n -i [pattern] [file]\n- Create directories: mkdir -p [path]\n- Move/rename: mv [source] [dest]\n- Remove files/directories: rm [-rfv] [path]\n- Remove empty directories: rmdir [-v] [path]\n- Copy: cp [-r] [source] [dest]\n- Edit files: Use json_patch tool for reliable file editing\n\nDirectory Removal Guidelines:\n- Use \'rmdir\' for empty directories: rmdir /empty-folder\n- Use \'rm -r\' for directories with content: rm -r /folder-with-files\n- Use \'rm -rf\' to force removal without errors: rm -rf /folder\n- Use \'rm -rfv\' for verbose output: rm -rfv /folder1 /folder2\n- Combine flags as needed: rm -rf, rm -rv, rm -rfv\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`, `sed`, `nl`, or `cat` as needed, and reuse prior output when it is still current)\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 `sed -n \'start,endp\' file`). 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: `
`, `