Compare commits

...

4 Commits

Author SHA1 Message Date
Paolo Ricciuti
c1678b2f36 Merge pull request #64 from sveltejs/changeset-release/main
Version Packages
2025-10-11 00:23:42 +02:00
github-actions[bot]
a8af3c72ca Version Packages 2025-10-10 22:22:02 +00:00
Paolo Ricciuti
534a72cae7 Merge pull request #66 from sveltejs/read-state-with-dollar
feat: `read_state_with_dollar` autofixer
2025-10-11 00:21:36 +02:00
paoloricciuti
3b301d7d9c fix: widen desired_svelte_version validation to accommodate some clients 2025-10-10 23:27:49 +02:00
6 changed files with 38 additions and 15 deletions

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/mcp': patch
---
fix: minor tweaks to the prompt to allow for automatic sync

View File

@@ -1,5 +0,0 @@
---
'@sveltejs/mcp': patch
---
feat: `read_state_with_dollar` autofixer

View File

@@ -15,7 +15,7 @@ export function svelte_autofixer(server: SvelteMcp) {
schema: v.object({
code: v.string(),
desired_svelte_version: v.pipe(
v.union([v.literal(4), v.literal(5), v.literal('4'), v.literal('5')]),
v.union([v.string(), v.number()]),
v.description(
'The desired svelte version...if possible read this from the package.json of the user project, otherwise use some hint from the wording (if the user asks for runes it wants version 5). Default to 5 in case of doubt.',
),
@@ -39,7 +39,30 @@ export function svelte_autofixer(server: SvelteMcp) {
openWorldHint: false,
},
},
async ({ code, filename: filename_or_path, desired_svelte_version }) => {
async ({
code,
filename: filename_or_path,
desired_svelte_version: desired_svelte_version_unchecked,
}) => {
// we validate manually because some clients don't support union in the input schema (looking at you cursor)
const parsed_version = v.safeParse(
v.union([v.literal(4), v.literal(5), v.literal('4'), v.literal('5')]),
desired_svelte_version_unchecked,
);
if (parsed_version.success === false) {
return {
isError: true,
content: [
{
type: 'text',
text: `The desired_svelte_version MUST be either 4 or 5 but received "${desired_svelte_version_unchecked}"`,
},
],
};
}
const desired_svelte_version = parsed_version.output;
const content: {
issues: string[];
suggestions: string[];

View File

@@ -1,5 +1,15 @@
# @sveltejs/mcp
## 0.1.5
### Patch Changes
- fix: widen `desired_svelte_version` validation to accommodate some clients ([`3b301d7`](https://github.com/sveltejs/mcp/commit/3b301d7d9c2f49758023408f505bc4ca79caaff4))
- fix: minor tweaks to the prompt to allow for automatic sync ([#63](https://github.com/sveltejs/mcp/pull/63))
- feat: `read_state_with_dollar` autofixer ([#66](https://github.com/sveltejs/mcp/pull/66))
## 0.1.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/mcp",
"version": "0.1.4",
"version": "0.1.5",
"type": "module",
"license": "MIT",
"mcpName": "dev.svelte/mcp",

View File

@@ -8,13 +8,13 @@
"subfolder": "packages/mcp-stdio",
"source": "github"
},
"version": "0.1.4",
"version": "0.1.5",
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
"packages": [
{
"registryType": "npm",
"identifier": "@sveltejs/mcp",
"version": "0.1.4",
"version": "0.1.5",
"runtimeHint": "npx",
"transport": {
"type": "stdio"