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:
38
package.json
38
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "dyad",
|
||||
"productName": "dyad",
|
||||
"version": "0.18.0",
|
||||
"version": "0.28.0",
|
||||
"description": "Free, local, open-source AI app builder",
|
||||
"main": ".vite/build/main.js",
|
||||
"repository": {
|
||||
@@ -12,11 +12,10 @@
|
||||
"node": ">=20"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -rf out && rm -rf scaffold/node_modules",
|
||||
"clean": "rimraf out scaffold/node_modules",
|
||||
"start": "electron-forge start",
|
||||
"dev:engine": "DYAD_ENGINE_URL=http://localhost:8080/v1 npm start",
|
||||
"staging:engine": "DYAD_ENGINE_URL=https://staging---dyad-llm-engine-kq7pivehnq-uc.a.run.app/v1 npm start",
|
||||
"staging:gateway": "DYAD_GATEWAY_URL=https://staging---litellm-gcp-cloud-run-kq7pivehnq-uc.a.run.app/v1 npm start",
|
||||
"dev:engine": "cross-env DYAD_ENGINE_URL=http://localhost:8080/v1 npm start",
|
||||
"staging:engine": "cross-env DYAD_ENGINE_URL=https://staging---dyad-llm-engine-kq7pivehnq-uc.a.run.app/v1 npm start",
|
||||
"package": "npm run clean && electron-forge package",
|
||||
"make": "npm run clean && electron-forge make",
|
||||
"publish": "npm run clean && electron-forge publish",
|
||||
@@ -36,7 +35,7 @@
|
||||
"test:watch": "vitest",
|
||||
"test:ui": "vitest --ui",
|
||||
"extract-codebase": "ts-node scripts/extract-codebase.ts",
|
||||
"prepare": "husky install",
|
||||
"init-precommit": "husky",
|
||||
"pre:e2e": "cross-env E2E_TEST_BUILD=true npm run package",
|
||||
"e2e": "playwright test",
|
||||
"e2e:shard": "playwright test --shard"
|
||||
@@ -61,6 +60,7 @@
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/kill-port": "^2.0.3",
|
||||
"@types/node": "^22.14.0",
|
||||
@@ -71,7 +71,7 @@
|
||||
"@vitest/ui": "^3.1.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"drizzle-kit": "^0.30.6",
|
||||
"electron": "35.1.4",
|
||||
"electron": "38.2.2",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"happy-dom": "^17.4.4",
|
||||
@@ -79,19 +79,25 @@
|
||||
"lint-staged": "^15.5.2",
|
||||
"oxlint": "^1.8.0",
|
||||
"prettier": "3.5.3",
|
||||
"rimraf": "^6.0.1",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^5.4.17",
|
||||
"vitest": "^3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/amazon-bedrock": "^3.0.15",
|
||||
"@ai-sdk/anthropic": "^2.0.4",
|
||||
"@ai-sdk/azure": "^2.0.17",
|
||||
"@ai-sdk/google": "^2.0.6",
|
||||
"@ai-sdk/openai": "^2.0.15",
|
||||
"@ai-sdk/google-vertex": "3.0.16",
|
||||
"@ai-sdk/openai": "2.0.15",
|
||||
"@ai-sdk/openai-compatible": "^1.0.8",
|
||||
"@ai-sdk/provider-utils": "^3.0.3",
|
||||
"@ai-sdk/xai": "^2.0.16",
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@dyad-sh/supabase-management-js": "v1.0.0",
|
||||
"@dyad-sh/supabase-management-js": "v1.0.1",
|
||||
"@lexical/react": "^0.33.1",
|
||||
"@modelcontextprotocol/sdk": "^1.17.5",
|
||||
"@monaco-editor/react": "^4.7.0-rc.0",
|
||||
"@neondatabase/api-client": "^2.1.0",
|
||||
"@neondatabase/serverless": "^1.0.1",
|
||||
@@ -99,7 +105,7 @@
|
||||
"@radix-ui/react-accordion": "^1.2.4",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.13",
|
||||
"@radix-ui/react-checkbox": "^1.3.2",
|
||||
"@radix-ui/react-dialog": "^1.1.7",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-dropdown-menu": "^2.1.7",
|
||||
"@radix-ui/react-label": "^2.1.4",
|
||||
"@radix-ui/react-popover": "^1.1.7",
|
||||
@@ -108,6 +114,7 @@
|
||||
"@radix-ui/react-separator": "^1.1.2",
|
||||
"@radix-ui/react-slot": "^1.2.2",
|
||||
"@radix-ui/react-switch": "^1.2.0",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toggle": "^1.1.3",
|
||||
"@radix-ui/react-toggle-group": "^1.1.3",
|
||||
"@radix-ui/react-tooltip": "^1.1.8",
|
||||
@@ -117,12 +124,13 @@
|
||||
"@tanstack/react-query": "^5.75.5",
|
||||
"@tanstack/react-router": "^1.114.34",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@vercel/sdk": "^1.10.0",
|
||||
"@vercel/sdk": "^1.18.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"ai": "^5.0.15",
|
||||
"better-sqlite3": "^11.9.1",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"dotenv": "^16.4.7",
|
||||
"drizzle-orm": "^0.41.0",
|
||||
@@ -130,6 +138,7 @@
|
||||
"electron-playwright-helpers": "^1.7.1",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"esbuild-register": "^3.6.0",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"fix-path": "^4.0.0",
|
||||
"framer-motion": "^12.6.3",
|
||||
"geist": "^1.3.1",
|
||||
@@ -164,5 +173,10 @@
|
||||
"lint-staged": {
|
||||
"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint",
|
||||
"*.{js,css,md,ts,tsx,jsx,json}": "prettier --write"
|
||||
},
|
||||
"overrides": {
|
||||
"@vercel/sdk": {
|
||||
"@modelcontextprotocol/sdk": "$@modelcontextprotocol/sdk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user