Compare commits

..

2 Commits

Author SHA1 Message Date
Paolo Ricciuti
c8614c2dab fix: update instructions/AGENTS.md
Co-authored-by: jyc.dev <jycouet@gmail.com>
2026-02-06 09:24:07 +01:00
paoloricciuti
544ef3d2db chore: sync AGENTS.md with opencode and docs 2026-02-01 15:21:37 +01:00
5 changed files with 10 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
## Available Svelte MCP Tools:
## Available MCP Tools:
### 1. list-sections

View File

@@ -1,11 +1,5 @@
# @sveltejs/opencode
## 0.1.2
### Patch Changes
- feat: allow for local opencode config ([#156](https://github.com/sveltejs/mcp/pull/156))
## 0.1.1
### Patch Changes

View File

@@ -71,15 +71,8 @@ function get_config_paths() {
}
}
// Project-local: ./.opencode/svelte.json (cwd)
let project_path: string | null = null;
const project_config = join(process.cwd(), '.opencode', 'svelte.json');
if (existsSync(project_config)) {
project_path = project_config;
}
// Lowest priority first, highest priority last (project overrides global)
return [global_path, config_dir_path, project_path];
// returning config_dir first so it has higher priority
return [config_dir_path, global_path];
}
function load_config_file(config_path: string): ConfigLoadResult {
@@ -128,9 +121,6 @@ function merge_with_defaults(user_config: Partial<McpConfig>): McpConfig {
export function get_mcp_config(ctx: PluginInput) {
const config_paths = get_config_paths();
let merged: Partial<McpConfig> = {};
// Iterate from lowest to highest priority, merging as we go
for (const path of config_paths) {
if (path && existsSync(path)) {
const result = load_config_file(path);
@@ -139,28 +129,23 @@ export function get_mcp_config(ctx: PluginInput) {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `${result.parse_error} (${path})\nSkipping this config file`,
message: `${result.parse_error}\nUsing default values`,
variant: 'warning',
duration: 7000,
},
});
}, 7000);
continue;
return default_config;
}
const parsed = v.safeParse(config_schema, result.data);
if (parsed.success) {
merged = {
mcp: { ...merged.mcp, ...parsed.output.mcp },
subagent: { ...merged.subagent, ...parsed.output.subagent },
instructions: { ...merged.instructions, ...parsed.output.instructions },
skills: { ...merged.skills, ...parsed.output.skills },
};
return merge_with_defaults(parsed.output);
} else {
setTimeout(() => {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `Invalid config schema (${path})\nSkipping this config file`,
message: `${result.parse_error}\nUsing default values`,
variant: 'warning',
duration: 7000,
},
@@ -170,5 +155,5 @@ export function get_mcp_config(ctx: PluginInput) {
}
}
return merge_with_defaults(merged);
return default_config;
}

View File

@@ -1,6 +1,6 @@
You are able to use the Svelte MCP server, where you have access to comprehensive Svelte 5 and SvelteKit documentation. Here's how to use the available tools effectively:
## Available Svelte MCP Tools:
## Available MCP Tools:
### 1. list-sections

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/opencode",
"version": "0.1.2",
"version": "0.1.1",
"type": "module",
"license": "MIT",
"homepage": "https://github.com/sveltejs/mcp#readme",