feat: implement fuzzy search and replace functionality with Levenshtein distance

- Added `applySearchReplace` function to handle search and replace operations with fuzzy matching capabilities.
- Introduced tests for various scenarios including fuzzy matching with typos, exact matches, and handling whitespace differences.
- Created a parser for search/replace blocks to facilitate the new functionality.
- Updated prompts for search-replace operations to clarify usage and examples.
- Added utility functions for text normalization and language detection based on file extensions.
- Implemented a minimal stdio MCP server for local testing with tools for adding numbers and printing environment variables.
This commit is contained in:
Kunthawat Greethong
2025-12-05 11:28:57 +07:00
parent 11986a0196
commit d22227bb13
312 changed files with 30787 additions and 2829 deletions

View File

@@ -0,0 +1,7 @@
- heading "Deep Link Test Prompt" [level=3]
- paragraph: A prompt created via deep link
- button:
- img
- button:
- img
- text: "You are a helpful assistant. Please help with: [task here]"

View File

@@ -0,0 +1,6 @@
- paragraph: tc=basic
- paragraph: This is a simple basic response
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -0,0 +1,20 @@
- paragraph: Create a utility function in src/utils/helper.ts
- img
- text: file1.txt
- button "Edit":
- img
- img
- text: file1.txt typescript
- button "Copy":
- img
- paragraph: More EOM
- img
- text: Approved
- img
- text: less than a minute ago
- img
- text: wrote 1 file(s)
- button "Undo":
- img
- button "Retry":
- img

View File

@@ -0,0 +1,24 @@
- paragraph: Create a simple React component in src/components/Hello.tsx
- img
- text: file1.txt
- button "Cancel":
- img
- img
- text: file1.txt file1.txt
- button [disabled]:
- img
- img
- code:
- textbox "Editor content"
- list
- paragraph: More EOM
- img
- text: Approved
- img
- text: less than a minute ago
- img
- text: wrote 1 file(s)
- button "Undo":
- img
- button "Retry":
- img

View File

@@ -0,0 +1,8 @@
- paragraph: tc=chat2
- paragraph: chat2
- button:
- img
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -0,0 +1,8 @@
- paragraph: tc=chat1 [sleep=medium]
- paragraph: chat1
- button:
- img
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -46,7 +46,8 @@ You need to first add Supabase to your app and then we can add auth.
===
role: user
message: This is my codebase. <dyad-file path="manual/baz.json">
// File contents excluded from context
["even json is included"]
</dyad-file>
<dyad-file path="manual/file.ts">

View File

@@ -46,7 +46,8 @@ You need to first add Supabase to your app and then we can add auth.
===
role: user
message: This is my codebase. <dyad-file path="manual/baz.json">
// File contents excluded from context
["even json is included"]
</dyad-file>
<dyad-file path="manual/file.ts">

View File

@@ -48,7 +48,7 @@
},
{
"path": "manual/baz.json",
"content": "// File contents excluded from context",
"content": "[\"even json is included\"]\n",
"force": true
},
{
@@ -98,7 +98,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -28,7 +28,7 @@
},
{
"path": "manual/baz.json",
"content": "// File contents excluded from context",
"content": "[\"even json is included\"]\n",
"force": true
},
{
@@ -68,7 +68,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -56,7 +56,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": false
"enable_smart_files_context": false,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -64,7 +64,7 @@
},
{
"path": "manual/baz.json",
"content": "// File contents excluded from context",
"content": "[\"even json is included\"]\n",
"force": false
},
{
@@ -114,7 +114,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": false
"enable_smart_files_context": false,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -33,7 +33,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -388,17 +388,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -413,7 +413,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": false
"enable_smart_files_context": false,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -1,7 +1,7 @@
{
"body": {
"model": "anthropic/claude-sonnet-4-20250514",
"max_tokens": 16000,
"max_tokens": 32000,
"temperature": 0,
"messages": [
{
@@ -28,7 +28,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -383,17 +383,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -408,7 +408,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -1,8 +1,7 @@
{
"body": {
"model": "gemini/gemini-2.5-pro",
"max_tokens": 65535,
"temperature": 0,
"model": "gpt-5",
"temperature": 1,
"messages": [
{
"role": "system",
@@ -14,11 +13,7 @@
}
],
"stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true,
"budget_tokens": 4000
},
"reasoning_effort": "medium",
"dyad_options": {
"files": [
{
@@ -33,7 +28,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -388,17 +383,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -414,7 +409,8 @@
],
"enable_lazy_edits": true,
"enable_smart_files_context": true,
"smart_context_mode": "balanced"
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -1,6 +1,10 @@
- paragraph: "[dump] tc=turbo-edits"
- paragraph: "[[dyad-dump-path=*]]"
- button:
- img
- img
- text: less than a minute ago
- button "Request ID":
- img
- button "Retry":
- img

File diff suppressed because one or more lines are too long

View File

@@ -33,7 +33,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -388,17 +388,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -413,7 +413,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -33,7 +33,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -388,17 +388,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -413,7 +413,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -1,7 +1,7 @@
{
"body": {
"model": "anthropic/claude-sonnet-4-20250514",
"max_tokens": 16000,
"max_tokens": 32000,
"temperature": 0,
"messages": [
{

View File

@@ -0,0 +1,14 @@
- paragraph: /Generate an AI_RULES\.md file for this app\. Describe the tech stack in 5-\d+ bullet points and describe clear rules about what libraries to use for what\./
- img
- text: file1.txt
- button "Edit":
- img
- img
- text: file1.txt
- paragraph: More EOM
- button:
- img
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -0,0 +1,14 @@
- paragraph: /Generate an AI_RULES\.md file for this app\. Describe the tech stack in 5-\d+ bullet points and describe clear rules about what libraries to use for what\./
- img
- text: file1.txt
- button "Edit":
- img
- img
- text: file1.txt
- paragraph: More EOM
- button:
- img
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -0,0 +1,7 @@
- paragraph: "[call_tool=calculator_add]"
- img
- text: Tool Call
- img
- text: testing-mcp-server calculator_add
- img
- text: less than a minute ago

View File

@@ -0,0 +1,81 @@
===
role: system
message:
You are an AI App Builder Agent. Your role is to analyze app development requests and gather all necessary information before the actual coding phase begins.
## Core Mission
Determine what tools, APIs, data, or external resources are needed to build the requested application. Prepare everything needed for successful app development without writing any code yourself.
## Tool Usage Decision Framework
### Use Tools When The App Needs:
- **External APIs or services** (payment processing, authentication, maps, social media, etc.)
- **Real-time data** (weather, stock prices, news, current events)
- **Third-party integrations** (Firebase, Supabase, cloud services)
- **Current framework/library documentation** or best practices
### Use Tools To Research:
- Available APIs and their documentation
- Authentication methods and implementation approaches
- Database options and setup requirements
- UI/UX frameworks and component libraries
- Deployment platforms and requirements
- Performance optimization strategies
- Security best practices for the app type
### When Tools Are NOT Needed
If the app request is straightforward and can be built with standard web technologies without external dependencies, respond with:
**"Ok, looks like I don't need any tools, I can start building."**
This applies to simple apps like:
- Basic calculators or converters
- Simple games (tic-tac-toe, memory games)
- Static information displays
- Basic form interfaces
- Simple data visualization with static data
## Critical Constraints
- ABSOLUTELY NO CODE GENERATION
- **Never write HTML, CSS, JavaScript, TypeScript, or any programming code**
- **Do not create component examples or code snippets**
- **Do not provide implementation details or syntax**
- **Do not use <dyad-write>, <dyad-edit>, <dyad-add-dependency> OR ANY OTHER <dyad-*> tags**
- Your job ends with information gathering and requirement analysis
- All actual development happens in the next phase
## Output Structure
When tools are used, provide a brief human-readable summary of the information gathered from the tools.
When tools are not used, simply state: **"Ok, looks like I don't need any tools, I can start building."**
===
role: user
message: [call_tool=calculator_add]
===
role: assistant
message: <dyad-mcp-tool-call server="testing-mcp-server" tool="calculator_add">
{"a":1,"b":2}
</dyad-mcp-tool-call>
<dyad-mcp-tool-result server="testing-mcp-server" tool="calculator_add">
{"content":[{"type":"text","text":"3"}],"isError":false}
</dyad-mcp-tool-result>
<dyad-write path="file1.txt">
A file (2)
</dyad-write>
More
EOM
<dyad-write path="file1.txt">
A file (2)
</dyad-write>
More
EOM
===
role: user
message: [dump]

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-downloads

View File

@@ -1,10 +0,0 @@
- img
- text: 1 error
- button "Run checks":
- img
- button "Fix All":
- img
- img
- img
- text: src/bad-file.tsx 2:3
- paragraph: Cannot find name 'nonExistentFunction'.

View File

@@ -1,4 +0,0 @@
- paragraph: No problems found
- img
- button "Run checks":
- img

View File

@@ -1,10 +0,0 @@
- img
- text: 1 error
- button "Run checks":
- img
- button "Fix All":
- img
- img
- img
- text: src/bad-file.tsx 2:1
- paragraph: Cannot find name 'nonExistentFunction'.

View File

@@ -1,4 +0,0 @@
- paragraph: No problems found
- img
- button "Run checks":
- img

View File

@@ -0,0 +1,21 @@
- paragraph: "Fix these 2 TypeScript compile-time errors:"
- list:
- listitem: src/bad-file.tsx:2:1 - Cannot find name 'nonExistentFunction1'. (TS2304)
- code: const App = () => <div>Minimal imported app</div>; nonExistentFunction1(); // <-- TypeScript compiler error here nonExistentFunction2();
- list:
- listitem: src/bad-file.tsx:4:1 - Cannot find name 'nonExistentFunction3'. (TS2304)
- code: nonExistentFunction2(); nonExistentFunction3(); // <-- TypeScript compiler error here
- paragraph: Please fix all errors in a concise way.
- img
- text: bad-file.ts
- button "Edit":
- img
- img
- text: "src/bad-file.ts Summary: Fix 2 errors and introduce a new error."
- paragraph: "[[dyad-dump-path=*]]"
- button:
- img
- img
- text: less than a minute ago
- button "Retry":
- img

View File

@@ -0,0 +1,19 @@
===
role: user
message: Fix these 2 TypeScript compile-time errors:
1. src/bad-file.tsx:2:1 - Cannot find name 'nonExistentFunction1'. (TS2304)
```
const App = () => <div>Minimal imported app</div>;
nonExistentFunction1(); // <-- TypeScript compiler error here
nonExistentFunction2();
```
2. src/bad-file.tsx:4:1 - Cannot find name 'nonExistentFunction3'. (TS2304)
```
nonExistentFunction2();
nonExistentFunction3(); // <-- TypeScript compiler error here
```
Please fix all errors in a concise way.

View File

@@ -0,0 +1,74 @@
- paragraph: "Please fix the following 2 security issues in a simple and effective way:"
- list:
- listitem:
- strong: SQL Injection in User Lookup
- text: (critical severity)
- strong: What
- text: ": User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands"
- paragraph:
- strong: Risk
- text: ": An attacker could steal all customer data, delete your entire database, or take over admin accounts by manipulating the URL"
- paragraph:
- strong: Potential Solutions
- text: ":"
- list:
- listitem:
- text: "Use parameterized queries:"
- code: "`db.query('SELECT * FROM users WHERE id = ?', [userId])`"
- listitem:
- text: Add input validation to ensure
- code: "`userId`"
- text: is a number
- listitem: Implement an ORM like Prisma or TypeORM that prevents SQL injection by default
- paragraph:
- strong: Relevant Files
- text: ":"
- code: "`src/api/users.ts`"
- list:
- listitem:
- strong: Hardcoded AWS Credentials in Source Code
- text: (critical severity)
- strong: What
- text: ": AWS access keys are stored directly in the codebase and committed to version control, exposing full cloud infrastructure access"
- paragraph:
- strong: Risk
- text: ": Anyone with repository access (including former employees or compromised accounts) could spin up expensive resources, access S3 buckets with customer data, or destroy production infrastructure"
- paragraph:
- strong: Potential Solutions
- text: ":"
- list:
- listitem: Immediately rotate the exposed credentials in AWS IAM
- listitem:
- text: Use environment variables and add
- code: "`.env`"
- text: to
- code: "`.gitignore`"
- listitem: Implement AWS Secrets Manager or similar vault solution
- listitem:
- text: Scan git history and purge the credentials using tools like
- code: "`git-filter-repo`"
- paragraph:
- strong: Relevant Files
- text: ":"
- code: "`src/config/aws.ts`"
- text: ","
- code: "`src/services/s3-uploader.ts`"
- img
- text: file1.txt
- button "Edit":
- img
- img
- text: file1.txt
- paragraph: More EOM
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- img
- text: wrote 1 file(s)
- button "Undo":
- img
- button "Retry":
- img

View File

@@ -0,0 +1,148 @@
- table:
- rowgroup:
- row "Select all issues Level Issue Action":
- cell "Select all issues":
- checkbox "Select all issues"
- cell "Level"
- cell "Issue"
- cell "Action"
- rowgroup:
- 'row "Select SQL Injection in User Lookup critical SQL Injection in User Lookup What: User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands Risk: An attac... Show more Fix Issue"':
- cell "Select SQL Injection in User Lookup":
- checkbox "Select SQL Injection in User Lookup"
- cell "critical":
- img
- 'cell "SQL Injection in User Lookup What: User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands Risk: An attac... Show more"':
- 'button "SQL Injection in User Lookup What: User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands Risk: An attac... Show more"':
- paragraph:
- strong: What
- text: ": User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands"
- paragraph:
- strong: Risk
- text: ": An attac..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Hardcoded AWS Credentials in Source Code critical Hardcoded AWS Credentials in Source Code What: AWS access keys are stored directly in the codebase and committed to version control, exposing full cloud infrastructure access Risk: A... Show more Fix Issue"':
- cell "Select Hardcoded AWS Credentials in Source Code":
- checkbox "Select Hardcoded AWS Credentials in Source Code"
- cell "critical":
- img
- 'cell "Hardcoded AWS Credentials in Source Code What: AWS access keys are stored directly in the codebase and committed to version control, exposing full cloud infrastructure access Risk: A... Show more"':
- 'button "Hardcoded AWS Credentials in Source Code What: AWS access keys are stored directly in the codebase and committed to version control, exposing full cloud infrastructure access Risk: A... Show more"':
- paragraph:
- strong: What
- text: ": AWS access keys are stored directly in the codebase and committed to version control, exposing full cloud infrastructure access"
- paragraph:
- strong: Risk
- text: ": A..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Missing Authentication on Admin Endpoints high Missing Authentication on Admin Endpoints What: Administrative API endpoints can be accessed without authentication, relying only on URL obscurity Risk: An attacker who discovers thes... Show more Fix Issue"':
- cell "Select Missing Authentication on Admin Endpoints":
- checkbox "Select Missing Authentication on Admin Endpoints"
- cell "high":
- img
- 'cell "Missing Authentication on Admin Endpoints What: Administrative API endpoints can be accessed without authentication, relying only on URL obscurity Risk: An attacker who discovers thes... Show more"':
- 'button "Missing Authentication on Admin Endpoints What: Administrative API endpoints can be accessed without authentication, relying only on URL obscurity Risk: An attacker who discovers thes... Show more"':
- paragraph:
- strong: What
- text: ": Administrative API endpoints can be accessed without authentication, relying only on URL obscurity"
- paragraph:
- strong: Risk
- text: ": An attacker who discovers thes..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select JWT Secret Using Default Value high JWT Secret Using Default Value What: The application uses a hardcoded default JWT secret (\"your-secret-key\") for signing authentication tokens Risk: Attackers can forge val... Show more Fix Issue"':
- cell "Select JWT Secret Using Default Value":
- checkbox "Select JWT Secret Using Default Value"
- cell "high":
- img
- 'cell "JWT Secret Using Default Value What: The application uses a hardcoded default JWT secret (\"your-secret-key\") for signing authentication tokens Risk: Attackers can forge val... Show more"':
- 'button "JWT Secret Using Default Value What: The application uses a hardcoded default JWT secret (\"your-secret-key\") for signing authentication tokens Risk: Attackers can forge val... Show more"':
- paragraph:
- strong: What
- text: ": The application uses a hardcoded default JWT secret (\"your-secret-key\") for signing authentication tokens"
- paragraph:
- strong: Risk
- text: ": Attackers can forge val..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Unvalidated File Upload Extensions medium Unvalidated File Upload Extensions What: The file upload endpoint accepts any file type without validating extensions or content, only checking file size Risk: An attacker coul... Show more Fix Issue"':
- cell "Select Unvalidated File Upload Extensions":
- checkbox "Select Unvalidated File Upload Extensions"
- cell "medium":
- img
- 'cell "Unvalidated File Upload Extensions What: The file upload endpoint accepts any file type without validating extensions or content, only checking file size Risk: An attacker coul... Show more"':
- 'button "Unvalidated File Upload Extensions What: The file upload endpoint accepts any file type without validating extensions or content, only checking file size Risk: An attacker coul... Show more"':
- paragraph:
- strong: What
- text: ": The file upload endpoint accepts any file type without validating extensions or content, only checking file size"
- paragraph:
- strong: Risk
- text: ": An attacker coul..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Missing CSRF Protection on State-Changing Operations medium Missing CSRF Protection on State-Changing Operations What: POST, PUT, and DELETE endpoints don''t implement CSRF tokens, making them vulnerable to cross-site request forgery attacks Risk: An atta... Show more Fix Issue"':
- cell "Select Missing CSRF Protection on State-Changing Operations":
- checkbox "Select Missing CSRF Protection on State-Changing Operations"
- cell "medium":
- img
- 'cell "Missing CSRF Protection on State-Changing Operations What: POST, PUT, and DELETE endpoints don''t implement CSRF tokens, making them vulnerable to cross-site request forgery attacks Risk: An atta... Show more"':
- 'button "Missing CSRF Protection on State-Changing Operations What: POST, PUT, and DELETE endpoints don''t implement CSRF tokens, making them vulnerable to cross-site request forgery attacks Risk: An atta... Show more"':
- paragraph:
- strong: What
- text: ": POST, PUT, and DELETE endpoints don't implement CSRF tokens, making them vulnerable to cross-site request forgery attacks"
- paragraph:
- strong: Risk
- text: ": An atta..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Verbose Error Messages Expose Stack Traces low Verbose Error Messages Expose Stack Traces What: Production error responses include full stack traces and internal file paths that are sent to end users Risk: Attackers can use this in... Show more Fix Issue"':
- cell "Select Verbose Error Messages Expose Stack Traces":
- checkbox "Select Verbose Error Messages Expose Stack Traces"
- cell "low":
- img
- 'cell "Verbose Error Messages Expose Stack Traces What: Production error responses include full stack traces and internal file paths that are sent to end users Risk: Attackers can use this in... Show more"':
- 'button "Verbose Error Messages Expose Stack Traces What: Production error responses include full stack traces and internal file paths that are sent to end users Risk: Attackers can use this in... Show more"':
- paragraph:
- strong: What
- text: ": Production error responses include full stack traces and internal file paths that are sent to end users"
- paragraph:
- strong: Risk
- text: ": Attackers can use this in..."
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"
- 'row "Select Missing Security Headers low Missing Security Headers What: The application doesn''t set recommended security headers like `X-Frame-Options`, `X-Content-Type-Options`, and `Strict-Transport-Security` ... Show more Fix Issue"':
- cell "Select Missing Security Headers":
- checkbox "Select Missing Security Headers"
- cell "low":
- img
- 'cell "Missing Security Headers What: The application doesn''t set recommended security headers like `X-Frame-Options`, `X-Content-Type-Options`, and `Strict-Transport-Security` ... Show more"':
- 'button "Missing Security Headers What: The application doesn''t set recommended security headers like `X-Frame-Options`, `X-Content-Type-Options`, and `Strict-Transport-Security` ... Show more"':
- paragraph:
- strong: What
- text: ": The application doesn't set recommended security headers like"
- code: "`X-Frame-Options`"
- text: ","
- code: "`X-Content-Type-Options`"
- text: ", and"
- code: "`Strict-Transport-Security`"
- paragraph: ...
- button "Show more":
- img
- cell "Fix Issue":
- button "Fix Issue"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
- paragraph: "Please fix the following security issue in a simple and effective way:"
- paragraph:
- strong: SQL Injection in User Lookup
- text: (critical severity)
- paragraph:
- strong: What
- text: ": User input flows directly into database queries without validation, allowing attackers to execute arbitrary SQL commands"
- paragraph:
- strong: Risk
- text: ": An attacker could steal all customer data, delete your entire database, or take over admin accounts by manipulating the URL"
- paragraph:
- strong: Potential Solutions
- text: ":"
- list:
- listitem:
- text: "Use parameterized queries:"
- code: "`db.query('SELECT * FROM users WHERE id = ?', [userId])`"
- listitem:
- text: Add input validation to ensure
- code: "`userId`"
- text: is a number
- listitem: Implement an ORM like Prisma or TypeORM that prevents SQL injection by default
- paragraph:
- strong: Relevant Files
- text: ":"
- code: "`src/api/users.ts`"
- img
- text: file1.txt
- button "Edit":
- img
- img
- text: file1.txt
- paragraph: More EOM
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- img
- text: wrote 1 file(s)
- button "Undo":
- img
- button "Retry":
- img

View File

@@ -5,5 +5,4 @@
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- img
- text: Edit with AI h1 src/pages/Index.tsx
- text: h1 src/pages/Index.tsx

View File

@@ -1,3 +1,5 @@
- text: Selected Components (1)
- button "Clear all"
- img
- text: h1 src/pages/Index.tsx:9
- button "Deselect component":

View File

@@ -0,0 +1,10 @@
- text: Selected Components (2)
- button "Clear all"
- img
- text: h1 src/pages/Index.tsx:9
- button "Deselect component":
- img
- img
- text: a src/components/made-with-dyad.tsx:4
- button "Deselect component":
- img

View File

@@ -0,0 +1,8 @@
- region "Notifications (F8)":
- list
- region "Notifications alt+T"
- heading "Welcome to Your Blank App" [level=1]
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- text: a src/components/made-with-dyad.tsx

View File

@@ -0,0 +1,6 @@
- text: Selected Components (1)
- button "Clear all"
- img
- text: a src/components/made-with-dyad.tsx:4
- button "Deselect component":
- img

View File

@@ -5,5 +5,4 @@
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- img
- text: Edit with AI h1 src/pages/Index.tsx
- text: h1 src/pages/Index.tsx

View File

@@ -104,7 +104,9 @@ message: This is a simple basic response
role: user
message: [dump] make it smaller
Selected component: h1 (file: src/pages/Index.tsx)
Selected components:
Component: h1 (file: src/pages/Index.tsx)
Snippet:
```

View File

@@ -1,3 +1,5 @@
- text: Selected Components (1)
- button "Clear all"
- img
- text: h1 src/pages/Index.tsx:9
- button "Deselect component":

View File

@@ -1 +1,8 @@
- text: Edit with AI h1 src/app/page.tsx
- main:
- heading "Blank page" [level=1]
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- text: h1 src/app/page.tsx
- alert
- button "Open Next.js Dev Tools":
- img

View File

@@ -151,7 +151,9 @@ message: This is a simple basic response
role: user
message: [dump] make it smaller
Selected component: h1 (file: src/app/page.tsx)
Selected components:
Component: h1 (file: src/app/page.tsx)
Snippet:
```

View File

@@ -1,3 +1,5 @@
- text: Selected Components (1)
- button "Clear all"
- img
- text: h1 src/app/page.tsx:7
- button "Deselect component":

View File

@@ -2,3 +2,6 @@
- heading "Blank page" [level=1]
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- alert
- button "Open Next.js Dev Tools":
- img

View File

@@ -0,0 +1,8 @@
- region "Notifications (F8)":
- list
- region "Notifications alt+T"
- heading "Welcome to Your Blank App" [level=1]
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/
- text: a src/components/made-with-dyad.tsx

View File

@@ -0,0 +1,27 @@
===
role: user
message: [dump] make both smaller
Selected components:
1. Component: h1 (file: src/pages/Index.tsx)
Snippet:
```
<div className="text-center">
<h1 className="text-4xl font-bold mb-4">Welcome to Your Blank App</h1> // <-- EDIT HERE
<p className="text-xl text-gray-600">
Start building your amazing project here!
</p>
```
2. Component: a (file: src/components/made-with-dyad.tsx)
Snippet:
```
<div className="p-4 text-center">
<a // <-- EDIT HERE
href="https://www.dyad.sh/"
target="_blank"
rel="noopener noreferrer"
```

View File

@@ -0,0 +1,10 @@
- text: Selected Components (2)
- button "Clear all"
- img
- text: h1 src/pages/Index.tsx:9
- button "Deselect component":
- img
- img
- text: a src/components/made-with-dyad.tsx:4
- button "Deselect component":
- img

View File

@@ -0,0 +1,7 @@
- region "Notifications (F8)":
- list
- region "Notifications alt+T"
- heading "Welcome to Your Blank App" [level=1]
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/

View File

@@ -2,7 +2,9 @@
role: user
message: [dump] make it smaller
Selected component: h1 (file: src/pages/Index.tsx)
Selected components:
Component: h1 (file: src/pages/Index.tsx)
Snippet:
```

View File

@@ -0,0 +1,56 @@
- paragraph: tc=read-index
- paragraph: "Read the index page:"
- img
- text: Index.tsx Read src/pages/Index.tsx
- paragraph: Done.
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- button "Request ID":
- img
- paragraph: tc=update-index-1
- paragraph: First read
- img
- text: Index.tsx
- button "Edit":
- img
- img
- text: "src/pages/Index.tsx Summary: replace file"
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- img
- text: wrote 1 file(s)
- button "Request ID":
- img
- paragraph: tc=read-index
- paragraph: "Read the index page:"
- img
- text: Index.tsx Read src/pages/Index.tsx
- paragraph: Done.
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- button "Request ID":
- img
- paragraph: "[dump]"
- paragraph: "[[dyad-dump-path=*]]"
- button:
- img
- img
- text: Approved
- img
- text: less than a minute ago
- button "Request ID":
- img
- button "Retry":
- img

File diff suppressed because one or more lines are too long

View File

@@ -19,6 +19,7 @@
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"proSmartContextOption": "deep",
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,

View File

@@ -0,0 +1 @@
- text: "/Tokens: \\d+,\\d+ \\d+% of [\\d,.]+[bkmBKM]+ Optimize your tokens with Dyad Pro's Smart Context/"

View File

@@ -41,7 +41,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -396,17 +396,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -421,7 +421,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -49,7 +49,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -404,17 +404,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -429,7 +429,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -57,7 +57,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -412,17 +412,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -437,7 +437,9 @@
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -0,0 +1,28 @@
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}

View File

@@ -0,0 +1,29 @@
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"proLazyEditsMode": "v1",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}

View File

@@ -0,0 +1,29 @@
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"proLazyEditsMode": "v2",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}

View File

@@ -0,0 +1,29 @@
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": false,
"proLazyEditsMode": "off",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isTestMode": true
}

View File

@@ -0,0 +1,2 @@
=== src/pages/Index.tsx ===
// FILE IS REPLACED WITH FALLBACK WRITE.

View File

@@ -0,0 +1,20 @@
=== src/pages/Index.tsx ===
// Update this page (the content is just a fallback if you fail to update the page)
import { MadeWithDyad } from "@/components/made-with-dyad";
const Index = () => {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-100">
<div className="text-center">
<h1 className="text-4xl font-bold mb-4">Welcome to the UPDATED App</h1>
<p className="text-xl text-gray-600">
Start building your amazing project here!
</p>
</div>
<MadeWithDyad />
</div>
);
};
export default Index;

View File

@@ -0,0 +1,15 @@
- paragraph: tc=turbo-edits-v2
- paragraph: Example with turbo edit v2
- img
- text: Search & Replace Index.tsx
- img
- text: src/pages/Index.tsx
- paragraph: End of turbo edit
- button:
- img
- img
- text: less than a minute ago
- button "Request ID":
- img
- button "Retry":
- img

View File

@@ -1,7 +1,7 @@
{
"body": {
"model": "gpt-4.1",
"max_tokens": 32768,
"model": "dyad/auto",
"max_tokens": 32000,
"temperature": 0,
"messages": [
{
@@ -10,11 +10,15 @@
},
{
"role": "user",
"content": "[dump] tc=turbo-edits"
"content": "[dump]"
}
],
"stream": true,
"reasoning_effort": "medium",
"thinking": {
"type": "enabled",
"include_thoughts": true,
"budget_tokens": 4000
},
"dyad_options": {
"files": [
{
@@ -29,7 +33,7 @@
},
{
"path": "components.json",
"content": "// File contents excluded from context",
"content": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"default\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": {\n \"config\": \"tailwind.config.ts\",\n \"css\": \"src/index.css\",\n \"baseColor\": \"slate\",\n \"cssVariables\": true,\n \"prefix\": \"\"\n },\n \"aliases\": {\n \"components\": \"@/components\",\n \"utils\": \"@/lib/utils\",\n \"ui\": \"@/components/ui\",\n \"lib\": \"@/lib\",\n \"hooks\": \"@/hooks\"\n }\n}\n",
"force": false
},
{
@@ -384,17 +388,17 @@
},
{
"path": "tsconfig.app.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"strict\": false,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noImplicitAny\": false,\n \"noFallthroughCasesInSwitch\": false,\n\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n }\n },\n \"include\": [\"src\"]\n}\n",
"force": false
},
{
"path": "tsconfig.json",
"content": "// File contents excluded from context",
"content": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n \"noImplicitAny\": false,\n \"noUnusedParameters\": false,\n \"skipLibCheck\": true,\n \"allowJs\": true,\n \"noUnusedLocals\": false,\n \"strictNullChecks\": false\n }\n}\n",
"force": false
},
{
"path": "tsconfig.node.json",
"content": "// File contents excluded from context",
"content": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2023\"],\n \"module\": \"ESNext\",\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"isolatedModules\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"strict\": true,\n \"noUnusedLocals\": false,\n \"noUnusedParameters\": false,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n",
"force": false
},
{
@@ -408,8 +412,10 @@
"force": false
}
],
"enable_lazy_edits": true,
"enable_smart_files_context": true
"enable_lazy_edits": false,
"enable_smart_files_context": true,
"smart_context_mode": "balanced",
"app_id": 1
}
},
"headers": {

View File

@@ -0,0 +1,153 @@
===
role: system
message:
${BUILD_SYSTEM_PREFIX}
# Tech Stack
- You are building a React application.
- Use TypeScript.
- Use React Router. KEEP the routes in src/App.tsx
- Always put source code in the src folder.
- Put pages into src/pages/
- Put components into src/components/
- The main page (default page) is src/pages/Index.tsx
- UPDATE the main page to include the new components. OTHERWISE, the user can NOT see any components!
- ALWAYS try to use the shadcn/ui library.
- Tailwind CSS: always use Tailwind CSS for styling components. Utilize Tailwind classes extensively for layout, spacing, colors, and other design aspects.
Available packages and libraries:
- The lucide-react package is installed for icons.
- You ALREADY have ALL the shadcn/ui components and their dependencies installed. So you don't need to install them again.
- You have ALL the necessary Radix UI components installed.
- Use prebuilt components from the shadcn/ui library after importing them. Note that these files shouldn't be edited, so make new components if you need to change them.
${BUILD_SYSTEM_POSTFIX}
# Search-replace file edits
- Request to apply PRECISE, TARGETED modifications to an existing file by searching for specific sections of content and replacing them. This tool is for SURGICAL EDITS ONLY - specific changes to existing code.
- You can perform multiple distinct search and replace operations within a single `dyad-search-replace` call by providing multiple SEARCH/REPLACE blocks. This is the preferred way to make several targeted changes efficiently.
- The SEARCH section must match exactly ONE existing content section - it must be unique within the file, including whitespace and indentation.
- When applying the diffs, be extra careful to remember to change any closing brackets or other syntax that may be affected by the diff farther down in the file.
- ALWAYS make as many changes in a single 'dyad-search-replace' call as possible using multiple SEARCH/REPLACE blocks.
- Do not use both `dyad-write` and `dyad-search-replace` on the same file within a single response.
- Include a brief description of the changes you are making in the `description` parameter.
Diff format:
```
<<<<<<< SEARCH
[exact content to find including whitespace]
=======
[new content to replace with]
>>>>>>> REPLACE
```
Example:
Original file:
```
def calculate_total(items):
total = 0
for item in items:
total += item
return total
```
Search/Replace content:
```
<<<<<<< SEARCH
def calculate_total(items):
total = 0
for item in items:
total += item
return total
=======
def calculate_total(items):
"""Calculate total with 10% markup"""
return sum(item * 1.1 for item in items)
>>>>>>> REPLACE
```
Search/Replace content with multiple edits:
```
<<<<<<< SEARCH
def calculate_total(items):
sum = 0
=======
def calculate_sum(items):
sum = 0
>>>>>>> REPLACE
<<<<<<< SEARCH
total += item
return total
=======
sum += item
return sum
>>>>>>> REPLACE
```
Usage:
<dyad-search-replace path="path/to/file.js" description="Brief description of the changes you are making">
<<<<<<< SEARCH
def calculate_total(items):
sum = 0
=======
def calculate_sum(items):
sum = 0
>>>>>>> REPLACE
<<<<<<< SEARCH
total += item
return total
=======
sum += item
return sum
>>>>>>> REPLACE
</dyad-search-replace>
If the user wants to use supabase or do something that requires auth, database or server-side functions (e.g. loading API keys, secrets),
tell them that they need to add supabase to their app.
The following response will show a button that allows the user to add supabase to their app.
<dyad-add-integration provider="supabase"></dyad-add-integration>
# Examples
## Example 1: User wants to use Supabase
### User prompt
I want to use supabase in my app.
### Assistant response
You need to first add Supabase to your app.
<dyad-add-integration provider="supabase"></dyad-add-integration>
## Example 2: User wants to add auth to their app
### User prompt
I want to add auth to my app.
### Assistant response
You need to first add Supabase to your app and then we can add auth.
<dyad-add-integration provider="supabase"></dyad-add-integration>
===
role: user
message: [dump]

View File

@@ -0,0 +1,25 @@
- paragraph: tc=turbo-edits-v2-trigger-fallback
- paragraph: Example with turbo edit v2
- img
- text: Search & Replace Index.tsx
- img
- text: src/pages/Index.tsx
- paragraph: End of turbo edit
- img
- text: Warning Could not apply Turbo Edits properly for some of the files; re-generating code......
- img
- img
- text: Index.tsx
- button "Edit":
- img
- img
- text: "src/pages/Index.tsx Summary: Rewrite file."
- paragraph: "[[dyad-dump-path=*]]"
- button:
- img
- img
- text: less than a minute ago
- button "Request ID":
- img
- button "Retry":
- img

File diff suppressed because one or more lines are too long