mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-03 11:12:28 +08:00
chore: great monorepo restructuring
This commit is contained in:
@@ -8,3 +8,4 @@ bun.lockb
|
||||
# Miscellaneous
|
||||
/static/
|
||||
/drizzle/
|
||||
/**/.svelte-kit/*
|
||||
27
apps/mcp-remote/.gitignore
vendored
Normal file
27
apps/mcp-remote/.gitignore
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
node_modules
|
||||
|
||||
# Output
|
||||
.output
|
||||
.vercel
|
||||
.netlify
|
||||
.wrangler
|
||||
/.svelte-kit
|
||||
/build
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Env
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
!.env.test
|
||||
|
||||
# Vite
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
||||
# SQLite
|
||||
*.db
|
||||
dist
|
||||
69
apps/mcp-remote/package.json
Normal file
69
apps/mcp-remote/package.json
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "@sveltejs/mcp-remote",
|
||||
"version": "0.0.1",
|
||||
"description": "The official Svelte MCP server implementation",
|
||||
"type": "module",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
"svelte-mcp": "./dist/lib/stdio.js"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"build:mcp": "tsc --project tsconfig.build.json",
|
||||
"prepublishOnly": "pnpm build:mcp",
|
||||
"preview": "vite preview",
|
||||
"prepare": "svelte-kit sync || echo ''",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"lint:fix": "prettier --write . && eslint . --fix",
|
||||
"test:unit": "vitest",
|
||||
"test": "npm run test:unit -- --run",
|
||||
"test:watch": "npm run test:unit -- --watch",
|
||||
"db:push": "drizzle-kit push",
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:migrate": "drizzle-kit migrate",
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"inspect": "pnpm mcp-inspector"
|
||||
},
|
||||
"keywords": [
|
||||
"svelte",
|
||||
"tmcp",
|
||||
"mcp",
|
||||
"server"
|
||||
],
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.3.2",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@libsql/client": "^0.14.0",
|
||||
"@modelcontextprotocol/inspector": "^0.16.7",
|
||||
"@sveltejs/adapter-vercel": "^5.6.3",
|
||||
"@sveltejs/kit": "^2.22.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
||||
"@types/node": "^24.3.1",
|
||||
"@typescript-eslint/parser": "^8.44.0",
|
||||
"drizzle-kit": "^0.30.2",
|
||||
"drizzle-orm": "^0.40.0",
|
||||
"eslint-config-prettier": "^10.0.1",
|
||||
"eslint-plugin-svelte": "^3.12.3",
|
||||
"globals": "^16.0.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-svelte": "^3.3.3",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^4.0.0",
|
||||
"svelte-eslint-parser": "^1.3.2",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^7.0.4",
|
||||
"vite-plugin-devtools-json": "^1.0.0",
|
||||
"vitest": "^3.2.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sveltejs/mcp-schema": "workspace:^",
|
||||
"@sveltejs/mcp-server": "workspace:^",
|
||||
"@tmcp/transport-http": "^0.6.2"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
import { http_transport } from '$lib/mcp/index.js';
|
||||
import { db } from '$lib/server/db';
|
||||
|
||||
export async function handle({ event, resolve }) {
|
||||
const mcp_response = await http_transport.respond(event.request);
|
||||
const mcp_response = await http_transport.respond(event.request, {
|
||||
db,
|
||||
});
|
||||
// we are deploying on vercel the SSE connection will timeout after 5 minutes...for
|
||||
// the moment we are not sending back any notifications (logs, or list changed notifications)
|
||||
// so it's a waste of resources to keep a connection open that will error
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
apps/mcp-remote/src/lib/index.ts
Normal file
0
apps/mcp-remote/src/lib/index.ts
Normal file
6
apps/mcp-remote/src/lib/mcp/index.ts
Normal file
6
apps/mcp-remote/src/lib/mcp/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { server } from '@sveltejs/mcp-server';
|
||||
import { HttpTransport } from '@tmcp/transport-http';
|
||||
|
||||
export const http_transport = new HttpTransport(server, {
|
||||
cors: true,
|
||||
});
|
||||
13
apps/mcp-remote/src/lib/server/db/index.ts
Normal file
13
apps/mcp-remote/src/lib/server/db/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { createClient } from '@libsql/client';
|
||||
import { drizzle } from 'drizzle-orm/libsql';
|
||||
import * as schema from './schema.js';
|
||||
import { DATABASE_TOKEN, DATABASE_URL } from '$env/static/private';
|
||||
if (!DATABASE_URL) throw new Error('DATABASE_URL is not set');
|
||||
if (!DATABASE_TOKEN) throw new Error('DATABASE_TOKEN is not set');
|
||||
|
||||
const client = createClient({
|
||||
url: DATABASE_URL,
|
||||
authToken: DATABASE_TOKEN,
|
||||
});
|
||||
|
||||
export const db = drizzle(client, { schema, logger: true });
|
||||
2
apps/mcp-remote/src/lib/server/db/schema.ts
Normal file
2
apps/mcp-remote/src/lib/server/db/schema.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// we need to re-export from here to allow for the drizzle config to pick them up for migrations
|
||||
export * from '@sveltejs/mcp-schema/schema';
|
||||
19
apps/mcp-remote/tsconfig.json
Normal file
19
apps/mcp-remote/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
}
|
||||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||
//
|
||||
// To make changes to top-level options such as include and exclude, we recommend extending
|
||||
// the generated config; see https://svelte.dev/docs/kit/configuration#typescript
|
||||
}
|
||||
22
apps/mcp-remote/vite.config.ts
Normal file
22
apps/mcp-remote/vite.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import devtoolsJson from 'vite-plugin-devtools-json';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit(), devtoolsJson()],
|
||||
// we don't have tests yet so we just comment this out for now
|
||||
// test: {
|
||||
// expect: { requireAssertions: true },
|
||||
// projects: [
|
||||
// {
|
||||
// extends: './vite.config.ts',
|
||||
// test: {
|
||||
// name: 'server',
|
||||
// environment: 'node',
|
||||
// include: ['src/**/*.{test,spec}.{js,ts}'],
|
||||
// exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'],
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
});
|
||||
128
eslint.config.js
128
eslint.config.js
@@ -5,87 +5,61 @@ import svelte from 'eslint-plugin-svelte';
|
||||
import globals from 'globals';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import ts from 'typescript-eslint';
|
||||
import svelteConfig from './svelte.config.js';
|
||||
import svelteConfig from './apps/mcp-remote/svelte.config.js';
|
||||
import eslint_plugin_import from 'eslint-plugin-import';
|
||||
|
||||
const gitignore_path = fileURLToPath(new URL('./.gitignore', import.meta.url));
|
||||
|
||||
export default ts.config(
|
||||
includeIgnoreFile(gitignore_path),
|
||||
js.configs.recommended,
|
||||
...ts.configs.recommended,
|
||||
...svelte.configs.recommended,
|
||||
eslint_plugin_import.flatConfigs.recommended,
|
||||
prettier,
|
||||
...svelte.configs.prettier,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser, ...globals.node },
|
||||
},
|
||||
rules: {
|
||||
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
|
||||
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
||||
'no-undef': 'off',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: ['variableLike'],
|
||||
format: ['snake_case', 'UPPER_CASE'],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
],
|
||||
'func-style': ['error', 'declaration', { allowTypeAnnotation: true }],
|
||||
'import/no-unresolved': 'off', // this doesn't work well with typescript path mapping
|
||||
'import/extensions': [
|
||||
'error',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'always',
|
||||
mjs: 'always',
|
||||
cjs: 'always',
|
||||
ts: 'always',
|
||||
svelte: 'always',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['./src/lib/**/*'],
|
||||
rules: {
|
||||
'import/extensions': [
|
||||
'error',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'always',
|
||||
mjs: 'always',
|
||||
cjs: 'always',
|
||||
ts: 'always',
|
||||
svelte: 'always',
|
||||
},
|
||||
],
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
patterns: [
|
||||
{
|
||||
group: ['$lib'],
|
||||
message:
|
||||
"Since we will build the mcp server with typescript we can't use `$lib` imports here, please import with relative paths",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
extraFileExtensions: ['.svelte'],
|
||||
parser: ts.parser,
|
||||
svelteConfig,
|
||||
export default /** @type {ts.Config} */ (
|
||||
ts.config(
|
||||
includeIgnoreFile(gitignore_path),
|
||||
js.configs.recommended,
|
||||
...ts.configs.recommended,
|
||||
...svelte.configs.recommended,
|
||||
eslint_plugin_import.flatConfigs.recommended,
|
||||
prettier,
|
||||
...svelte.configs.prettier,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: { ...globals.browser, ...globals.node },
|
||||
},
|
||||
rules: {
|
||||
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
|
||||
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
||||
'no-undef': 'off',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: ['variableLike'],
|
||||
format: ['snake_case', 'UPPER_CASE'],
|
||||
leadingUnderscore: 'allow',
|
||||
},
|
||||
],
|
||||
'func-style': ['error', 'declaration', { allowTypeAnnotation: true }],
|
||||
'import/no-unresolved': 'off', // this doesn't work well with typescript path mapping
|
||||
'import/extensions': [
|
||||
'error',
|
||||
'ignorePackages',
|
||||
{
|
||||
js: 'always',
|
||||
mjs: 'always',
|
||||
cjs: 'always',
|
||||
ts: 'always',
|
||||
svelte: 'always',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
extraFileExtensions: ['.svelte'],
|
||||
parser: ts.parser,
|
||||
svelteConfig,
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
);
|
||||
|
||||
53
package.json
53
package.json
@@ -1,32 +1,15 @@
|
||||
{
|
||||
"name": "@sveltejs/mcp",
|
||||
"name": "@sveltejs/mcp-mono",
|
||||
"version": "0.0.1",
|
||||
"description": "The official Svelte MCP server implementation",
|
||||
"type": "module",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
"svelte-mcp": "./dist/lib/stdio.js"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node src/index.js",
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"build:mcp": "tsc --project tsconfig.build.json",
|
||||
"prepublishOnly": "pnpm build:mcp",
|
||||
"preview": "vite preview",
|
||||
"prepare": "svelte-kit sync || echo ''",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"format": "prettier --write .",
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"lint:fix": "prettier --write . && eslint . --fix",
|
||||
"test:unit": "vitest",
|
||||
"test": "npm run test:unit -- --run",
|
||||
"test:watch": "npm run test:unit -- --watch",
|
||||
"db:push": "drizzle-kit push",
|
||||
"db:generate": "drizzle-kit generate",
|
||||
"db:migrate": "drizzle-kit migrate",
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"inspect": "pnpm mcp-inspector"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -37,45 +20,19 @@
|
||||
],
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@libsql/client": "^0.14.0",
|
||||
"@eslint/compat": "^1.3.2",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@modelcontextprotocol/inspector": "^0.16.7",
|
||||
"@sveltejs/adapter-vercel": "^5.6.3",
|
||||
"@sveltejs/kit": "^2.22.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.0.0",
|
||||
"@types/eslint-scope": "^8.3.2",
|
||||
"@types/estree": "^1.0.8",
|
||||
"@types/node": "^24.3.1",
|
||||
"@typescript-eslint/types": "^8.43.0",
|
||||
"dotenv": "^17.2.2",
|
||||
"drizzle-kit": "^0.30.2",
|
||||
"drizzle-orm": "^0.40.0",
|
||||
"eslint-config-prettier": "^10.0.1",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-svelte": "^3.12.3",
|
||||
"globals": "^16.0.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-svelte": "^3.3.3",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^4.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^7.0.4",
|
||||
"vite-plugin-devtools-json": "^1.0.0",
|
||||
"typescript-eslint": "^8.44.1",
|
||||
"vitest": "^3.2.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint/compat": "^1.2.5",
|
||||
"@eslint/js": "^9.18.0",
|
||||
"@tmcp/adapter-valibot": "^0.1.4",
|
||||
"@tmcp/transport-http": "^0.6.2",
|
||||
"@tmcp/transport-stdio": "^0.2.0",
|
||||
"@typescript-eslint/parser": "^8.43.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-plugin-svelte": "^3.12.3",
|
||||
"svelte-eslint-parser": "^1.3.2",
|
||||
"tmcp": "^1.13.0",
|
||||
"typescript-eslint": "^8.20.0",
|
||||
"valibot": "^1.1.0",
|
||||
"zimmerframe": "^1.1.4"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"esbuild"
|
||||
|
||||
20
packages/mcp-schema/package.json
Normal file
20
packages/mcp-schema/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@sveltejs/mcp-schema",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
"./utils": "./src/utils.js",
|
||||
"./schema": "./src/schema.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"packageManager": "pnpm@10.15.1",
|
||||
"type": "module",
|
||||
"peerDependencies": {
|
||||
"drizzle-orm": "^0.40.1"
|
||||
}
|
||||
}
|
||||
8
packages/mcp-schema/src/index.js
Normal file
8
packages/mcp-schema/src/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @import * as schema from './schema.js'
|
||||
*/
|
||||
export * from './schema.js';
|
||||
|
||||
/**
|
||||
* @typedef {typeof schema} Schema
|
||||
*/
|
||||
@@ -40,10 +40,7 @@ export const distillation_jobs = sqliteTable('distillation_jobs', {
|
||||
started_at: integer('started_at', { mode: 'timestamp' }),
|
||||
completed_at: integer('completed_at', { mode: 'timestamp' }),
|
||||
error_message: text('error_message'),
|
||||
metadata: text('metadata', { mode: 'json' })
|
||||
.$type<Record<string, unknown>>()
|
||||
.notNull()
|
||||
.default({}),
|
||||
metadata: text('metadata', { mode: 'json' }).notNull().default({}),
|
||||
created_at: integer('created_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date()),
|
||||
@@ -59,10 +56,7 @@ export const content = sqliteTable('content', {
|
||||
content: text('content').notNull(),
|
||||
size_bytes: integer('size_bytes').notNull(),
|
||||
embeddings: float_32_array('embeddings', { dimensions: 1024 }),
|
||||
metadata: text('metadata', { mode: 'json' })
|
||||
.$type<Record<string, unknown>>()
|
||||
.notNull()
|
||||
.default({}),
|
||||
metadata: text('metadata', { mode: 'json' }).notNull().default({}),
|
||||
created_at: integer('created_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date()),
|
||||
@@ -78,10 +72,7 @@ export const content_distilled = sqliteTable('content_distilled', {
|
||||
content: text('content').notNull(),
|
||||
size_bytes: integer('size_bytes').notNull(),
|
||||
embeddings: float_32_array('embeddings', { dimensions: 1024 }),
|
||||
metadata: text('metadata', { mode: 'json' })
|
||||
.$type<Record<string, unknown>>()
|
||||
.notNull()
|
||||
.default({}),
|
||||
metadata: text('metadata', { mode: 'json' }).notNull().default({}),
|
||||
created_at: integer('created_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.$defaultFn(() => new Date()),
|
||||
@@ -3,17 +3,17 @@ import { customType } from 'drizzle-orm/sqlite-core';
|
||||
|
||||
/**
|
||||
* Helper function to convert an array of embeddings into a format that can be inserted into a LibSQL vector column.
|
||||
* @param arr The embeddings array.
|
||||
* @param {number[]} arr The embeddings array.
|
||||
*/
|
||||
export function vector(arr: number[]) {
|
||||
export function vector(arr) {
|
||||
return sql`vector32(${JSON.stringify(arr)})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to calculate the distance between a vector column and an array of embeddings and return it as a columns.
|
||||
* @param column The drizzle column representing the vector.
|
||||
* @param arr The embeddings array.
|
||||
* @param as The name of the returned column. Default is 'distance'.
|
||||
* @param {Column} column The drizzle column representing the vector.
|
||||
* @param {number} arr The embeddings array.
|
||||
* @param {string} as The name of the returned column. Default is 'distance'.
|
||||
*
|
||||
* @example
|
||||
* await db.select({
|
||||
@@ -25,8 +25,10 @@ export function vector(arr: number[]) {
|
||||
* .orderBy(sql`distance`)
|
||||
* .execute();
|
||||
*/
|
||||
export function distance(column: Column, arr: number[], as = 'distance') {
|
||||
return sql<number>`CASE ${column} ISNULL WHEN 1 THEN 1 ELSE vector_distance_cos(${column}, vector32(${JSON.stringify(arr)})) END`.as(
|
||||
export function distance(column, arr, as = 'distance') {
|
||||
return /** @type {typeof sql<number>} */ (
|
||||
sql
|
||||
)`CASE ${column} ISNULL WHEN 1 THEN 1 ELSE vector_distance_cos(${column}, vector32(${JSON.stringify(arr)})) END`.as(
|
||||
as,
|
||||
);
|
||||
}
|
||||
@@ -34,19 +36,27 @@ export function distance(column: Column, arr: number[], as = 'distance') {
|
||||
/**
|
||||
* Custom drizzle type to use the LibSQL vector column type.
|
||||
*/
|
||||
export const float_32_array = customType<{
|
||||
export const float_32_array = /** @type {typeof customType<{
|
||||
data: number[];
|
||||
config: { dimensions: number };
|
||||
configRequired: true;
|
||||
driverData: Buffer;
|
||||
}>({
|
||||
}>} */ (customType)({
|
||||
dataType(config) {
|
||||
return `F32_BLOB(${config.dimensions})`;
|
||||
},
|
||||
fromDriver(value: Buffer) {
|
||||
/**
|
||||
* @param {Buffer} value
|
||||
*/
|
||||
fromDriver(value) {
|
||||
return Array.from(new Float32Array(value.buffer));
|
||||
},
|
||||
toDriver(value: number[]) {
|
||||
/**
|
||||
*
|
||||
* @param {number[]} value
|
||||
* @returns
|
||||
*/
|
||||
toDriver(value) {
|
||||
return vector(value);
|
||||
},
|
||||
});
|
||||
41
packages/mcp-server/package.json
Normal file
41
packages/mcp-server/package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@sveltejs/mcp-server",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"packageManager": "pnpm@10.15.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "vitest"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"drizzle-orm": "^0.40.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sveltejs/mcp-schema": "workspace:^",
|
||||
"@tmcp/adapter-valibot": "^0.1.4",
|
||||
"@typescript-eslint/parser": "^8.44.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-plugin-svelte": "^3.12.3",
|
||||
"svelte": "^5.39.2",
|
||||
"svelte-eslint-parser": "^1.3.2",
|
||||
"tmcp": "^1.13.0",
|
||||
"typescript-eslint": "^8.44.0",
|
||||
"valibot": "^1.1.0",
|
||||
"vitest": "^3.2.4",
|
||||
"zimmerframe": "^1.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/kit": "^2.42.2",
|
||||
"@types/eslint-scope": "^8.3.2",
|
||||
"@types/estree": "^1.0.8",
|
||||
"@typescript-eslint/types": "^8.44.0"
|
||||
}
|
||||
}
|
||||
1
packages/mcp-server/src/index.ts
Normal file
1
packages/mcp-server/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { server, type SvelteMcp } from './mcp/index.js';
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parse } from '../../parse/parse.js';
|
||||
import { walk } from '../../index.js';
|
||||
import { walk } from '../../mcp/autofixers/ast/walk.js';
|
||||
import type { Node } from 'estree';
|
||||
import * as autofixers from './visitors/index.js';
|
||||
|
||||
@@ -81,7 +81,7 @@ export async function add_eslint_issues(
|
||||
const eslint = get_linter(desired_svelte_version);
|
||||
const results = await eslint.lintText(code, { filePath: filename || './Component.svelte' });
|
||||
|
||||
for (const message of results[0].messages) {
|
||||
for (const message of results[0]?.messages ?? []) {
|
||||
if (message.severity === 2) {
|
||||
content.issues.push(`${message.message} at line ${message.line}, column ${message.column}`);
|
||||
} else if (message.severity === 1) {
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ValibotJsonSchemaAdapter } from '@tmcp/adapter-valibot';
|
||||
import { HttpTransport } from '@tmcp/transport-http';
|
||||
import { StdioTransport } from '@tmcp/transport-stdio';
|
||||
import { McpServer } from 'tmcp';
|
||||
import { setup_prompts, setup_resources, setup_tools } from './handlers/index.js';
|
||||
import type { LibSQLDatabase } from 'drizzle-orm/libsql';
|
||||
import type { Schema } from '@sveltejs/mcp-schema';
|
||||
|
||||
const server = new McpServer(
|
||||
export const server = new McpServer(
|
||||
{
|
||||
name: 'Svelte MCP',
|
||||
version: '0.0.1',
|
||||
@@ -21,15 +21,10 @@ const server = new McpServer(
|
||||
instructions:
|
||||
'This is the official Svelte MCP server. It MUST be used whenever svelte development is involved. It can provide official documentation, code examples and correct your code. After you correct the component call this tool again to confirm all the issues are fixed.',
|
||||
},
|
||||
);
|
||||
).withContext<{ db: LibSQLDatabase<Schema> }>();
|
||||
|
||||
export type SvelteMcp = typeof server;
|
||||
|
||||
setup_tools(server);
|
||||
setup_resources(server);
|
||||
setup_prompts(server);
|
||||
|
||||
export const http_transport = new HttpTransport(server, {
|
||||
cors: true,
|
||||
});
|
||||
export const stdio_transport = new StdioTransport(server);
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TSESTree } from '@typescript-eslint/types';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { walk } from '../index.js';
|
||||
import { walk } from '../mcp/autofixers/ast/walk.js';
|
||||
import { parse, type ParseResult } from './parse.js';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -57,8 +57,8 @@ function assert_svelte_file(result: ParseResult) {
|
||||
const name_var = variable_declaration_from_id(result, declaration_id);
|
||||
expect(Array.isArray(name_var.defs)).toBe(true);
|
||||
expect(name_var.defs.length).toBeGreaterThan(0);
|
||||
expect(name_var.defs[0].type).toBe('Variable');
|
||||
expect(name_var.defs[0].name && name_var.defs[0].name.name).toBe('name');
|
||||
expect(name_var.defs[0]?.type).toBe('Variable');
|
||||
expect(name_var.defs[0]?.name && name_var.defs[0].name.name).toBe('name');
|
||||
|
||||
const references_to_name = all_references.filter((rf) => rf.resolved === name_var);
|
||||
expect(references_to_name.length).toBeGreaterThan(0);
|
||||
@@ -76,7 +76,7 @@ function assert_sveltejs_file(result: ParseResult) {
|
||||
const v_var = variable_declaration_from_id(result, declaration_id);
|
||||
expect(Array.isArray(v_var.defs)).toBe(true);
|
||||
expect(v_var.defs.length).toBeGreaterThan(0);
|
||||
expect(v_var.defs[0].type).toBeTruthy();
|
||||
expect(v_var.defs[0]?.type).toBeTruthy();
|
||||
|
||||
const references_to_v = all_references.filter((rf) => rf.resolved === v_var);
|
||||
expect(references_to_v.length).toBeGreaterThanOrEqual(2);
|
||||
357
pnpm-lock.yaml
generated
357
pnpm-lock.yaml
generated
@@ -7,47 +7,62 @@ settings:
|
||||
importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
devDependencies:
|
||||
'@eslint/compat':
|
||||
specifier: ^1.2.5
|
||||
specifier: ^1.3.2
|
||||
version: 1.3.2(eslint@9.36.0)
|
||||
'@eslint/js':
|
||||
specifier: ^9.18.0
|
||||
version: 9.36.0
|
||||
'@tmcp/adapter-valibot':
|
||||
specifier: ^0.1.4
|
||||
version: 0.1.4(tmcp@1.13.0(typescript@5.9.2))(valibot@1.1.0(typescript@5.9.2))
|
||||
'@tmcp/transport-http':
|
||||
specifier: ^0.6.2
|
||||
version: 0.6.2(tmcp@1.13.0(typescript@5.9.2))
|
||||
'@tmcp/transport-stdio':
|
||||
specifier: ^0.2.0
|
||||
version: 0.2.0(tmcp@1.13.0(typescript@5.9.2))
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^8.43.0
|
||||
version: 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
eslint:
|
||||
specifier: ^9.36.0
|
||||
version: 9.36.0
|
||||
'@modelcontextprotocol/inspector':
|
||||
specifier: ^0.16.7
|
||||
version: 0.16.8(@types/node@24.5.2)(typescript@5.9.2)
|
||||
eslint-config-prettier:
|
||||
specifier: ^10.0.1
|
||||
version: 10.1.8(eslint@9.36.0)
|
||||
eslint-plugin-import:
|
||||
specifier: ^2.32.0
|
||||
version: 2.32.0(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)
|
||||
eslint-plugin-svelte:
|
||||
specifier: ^3.12.3
|
||||
version: 3.12.3(eslint@9.36.0)(svelte@5.39.2)(ts-node@10.9.2(@types/node@24.5.2)(typescript@5.9.2))
|
||||
svelte-eslint-parser:
|
||||
specifier: ^1.3.2
|
||||
version: 1.3.2(svelte@5.39.2)
|
||||
tmcp:
|
||||
specifier: ^1.13.0
|
||||
version: 1.13.0(typescript@5.9.2)
|
||||
globals:
|
||||
specifier: ^16.0.0
|
||||
version: 16.4.0
|
||||
prettier:
|
||||
specifier: ^3.4.2
|
||||
version: 3.6.2
|
||||
prettier-plugin-svelte:
|
||||
specifier: ^3.3.3
|
||||
version: 3.4.0(prettier@3.6.2)(svelte@5.39.2)
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
version: 5.9.2
|
||||
typescript-eslint:
|
||||
specifier: ^8.20.0
|
||||
version: 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
valibot:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0(typescript@5.9.2)
|
||||
zimmerframe:
|
||||
specifier: ^1.1.4
|
||||
version: 1.1.4
|
||||
specifier: ^8.44.1
|
||||
version: 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
vitest:
|
||||
specifier: ^3.2.3
|
||||
version: 3.2.4(@types/node@24.5.2)
|
||||
|
||||
apps/mcp-remote:
|
||||
dependencies:
|
||||
'@sveltejs/mcp-schema':
|
||||
specifier: workspace:^
|
||||
version: link:../../packages/mcp-schema
|
||||
'@sveltejs/mcp-server':
|
||||
specifier: workspace:^
|
||||
version: link:../../packages/mcp-server
|
||||
'@tmcp/transport-http':
|
||||
specifier: ^0.6.2
|
||||
version: 0.6.2(tmcp@1.13.0(typescript@5.9.2))
|
||||
devDependencies:
|
||||
'@eslint/compat':
|
||||
specifier: ^1.3.2
|
||||
version: 1.3.2(eslint@9.36.0)
|
||||
'@eslint/js':
|
||||
specifier: ^9.36.0
|
||||
version: 9.36.0
|
||||
'@libsql/client':
|
||||
specifier: ^0.14.0
|
||||
version: 0.14.0
|
||||
@@ -63,21 +78,12 @@ importers:
|
||||
'@sveltejs/vite-plugin-svelte':
|
||||
specifier: ^6.0.0
|
||||
version: 6.2.0(svelte@5.39.2)(vite@7.1.6(@types/node@24.5.2))
|
||||
'@types/eslint-scope':
|
||||
specifier: ^8.3.2
|
||||
version: 8.3.2
|
||||
'@types/estree':
|
||||
specifier: ^1.0.8
|
||||
version: 1.0.8
|
||||
'@types/node':
|
||||
specifier: ^24.3.1
|
||||
version: 24.5.2
|
||||
'@typescript-eslint/types':
|
||||
specifier: ^8.43.0
|
||||
version: 8.44.0
|
||||
dotenv:
|
||||
specifier: ^17.2.2
|
||||
version: 17.2.2
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^8.44.0
|
||||
version: 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
drizzle-kit:
|
||||
specifier: ^0.30.2
|
||||
version: 0.30.6
|
||||
@@ -87,9 +93,9 @@ importers:
|
||||
eslint-config-prettier:
|
||||
specifier: ^10.0.1
|
||||
version: 10.1.8(eslint@9.36.0)
|
||||
eslint-plugin-import:
|
||||
specifier: ^2.32.0
|
||||
version: 2.32.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)
|
||||
eslint-plugin-svelte:
|
||||
specifier: ^3.12.3
|
||||
version: 3.12.3(eslint@9.36.0)(svelte@5.39.2)(ts-node@10.9.2(@types/node@24.5.2)(typescript@5.9.2))
|
||||
globals:
|
||||
specifier: ^16.0.0
|
||||
version: 16.4.0
|
||||
@@ -105,6 +111,9 @@ importers:
|
||||
svelte-check:
|
||||
specifier: ^4.0.0
|
||||
version: 4.3.1(picomatch@4.0.3)(svelte@5.39.2)(typescript@5.9.2)
|
||||
svelte-eslint-parser:
|
||||
specifier: ^1.3.2
|
||||
version: 1.3.2(svelte@5.39.2)
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
version: 5.9.2
|
||||
@@ -118,6 +127,67 @@ importers:
|
||||
specifier: ^3.2.3
|
||||
version: 3.2.4(@types/node@24.5.2)
|
||||
|
||||
packages/mcp-schema:
|
||||
dependencies:
|
||||
drizzle-orm:
|
||||
specifier: ^0.40.1
|
||||
version: 0.40.1(@libsql/client@0.14.0)(gel@2.1.1)
|
||||
|
||||
packages/mcp-server:
|
||||
dependencies:
|
||||
'@sveltejs/mcp-schema':
|
||||
specifier: workspace:^
|
||||
version: link:../mcp-schema
|
||||
'@tmcp/adapter-valibot':
|
||||
specifier: ^0.1.4
|
||||
version: 0.1.4(tmcp@1.13.0(typescript@5.9.2))(valibot@1.1.0(typescript@5.9.2))
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^8.44.0
|
||||
version: 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
drizzle-orm:
|
||||
specifier: ^0.40.0
|
||||
version: 0.40.1(@libsql/client@0.14.0)(gel@2.1.1)
|
||||
eslint:
|
||||
specifier: ^9.36.0
|
||||
version: 9.36.0
|
||||
eslint-plugin-svelte:
|
||||
specifier: ^3.12.3
|
||||
version: 3.12.3(eslint@9.36.0)(svelte@5.39.2)(ts-node@10.9.2(@types/node@24.5.2)(typescript@5.9.2))
|
||||
svelte:
|
||||
specifier: ^5.39.2
|
||||
version: 5.39.2
|
||||
svelte-eslint-parser:
|
||||
specifier: ^1.3.2
|
||||
version: 1.3.2(svelte@5.39.2)
|
||||
tmcp:
|
||||
specifier: ^1.13.0
|
||||
version: 1.13.0(typescript@5.9.2)
|
||||
typescript-eslint:
|
||||
specifier: ^8.44.0
|
||||
version: 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
valibot:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0(typescript@5.9.2)
|
||||
vitest:
|
||||
specifier: ^3.2.4
|
||||
version: 3.2.4(@types/node@24.5.2)
|
||||
zimmerframe:
|
||||
specifier: ^1.1.4
|
||||
version: 1.1.4
|
||||
devDependencies:
|
||||
'@sveltejs/kit':
|
||||
specifier: ^2.42.2
|
||||
version: 2.42.2(@sveltejs/vite-plugin-svelte@6.2.0(svelte@5.39.2)(vite@7.1.6(@types/node@24.5.2)))(svelte@5.39.2)(vite@7.1.6(@types/node@24.5.2))
|
||||
'@types/eslint-scope':
|
||||
specifier: ^8.3.2
|
||||
version: 8.3.2
|
||||
'@types/estree':
|
||||
specifier: ^1.0.8
|
||||
version: 1.0.8
|
||||
'@typescript-eslint/types':
|
||||
specifier: ^8.44.0
|
||||
version: 8.44.0
|
||||
|
||||
packages:
|
||||
|
||||
'@cspotcode/source-map-support@0.8.1':
|
||||
@@ -1327,11 +1397,6 @@ packages:
|
||||
peerDependencies:
|
||||
tmcp: ^1.12.2
|
||||
|
||||
'@tmcp/transport-stdio@0.2.0':
|
||||
resolution: {integrity: sha512-/j4djKFf/Z4juavunU3uVaDQQzPZA8ObLzcgLJQQByADEEClvQQEkXTXT6o0BJXOxkTePPAYFKtjsQV2pxi49Q==}
|
||||
peerDependencies:
|
||||
tmcp: ^1.13.0
|
||||
|
||||
'@tsconfig/node10@1.0.11':
|
||||
resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
|
||||
|
||||
@@ -1385,6 +1450,14 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.44.1':
|
||||
resolution: {integrity: sha512-molgphGqOBT7t4YKCSkbasmu1tb1MgrZ2szGzHbclF7PNmOkSTQVHy+2jXOSnxvR3+Xe1yySHFZoqMpz3TfQsw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^8.44.1
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/parser@8.44.0':
|
||||
resolution: {integrity: sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -1392,22 +1465,45 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/parser@8.44.1':
|
||||
resolution: {integrity: sha512-EHrrEsyhOhxYt8MTg4zTF+DJMuNBzWwgvvOYNj/zm1vnaD/IC5zCXFehZv94Piqa2cRFfXrTFxIvO95L7Qc/cw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/project-service@8.44.0':
|
||||
resolution: {integrity: sha512-ZeaGNraRsq10GuEohKTo4295Z/SuGcSq2LzfGlqiuEvfArzo/VRrT0ZaJsVPuKZ55lVbNk8U6FcL+ZMH8CoyVA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/project-service@8.44.1':
|
||||
resolution: {integrity: sha512-ycSa60eGg8GWAkVsKV4E6Nz33h+HjTXbsDT4FILyL8Obk5/mx4tbvCNsLf9zret3ipSumAOG89UcCs/KRaKYrA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/scope-manager@8.44.0':
|
||||
resolution: {integrity: sha512-87Jv3E+al8wpD+rIdVJm/ItDBe/Im09zXIjFoipOjr5gHUhJmTzfFLuTJ/nPTMc2Srsroy4IBXwcTCHyRR7KzA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/scope-manager@8.44.1':
|
||||
resolution: {integrity: sha512-NdhWHgmynpSvyhchGLXh+w12OMT308Gm25JoRIyTZqEbApiBiQHD/8xgb6LqCWCFcxFtWwaVdFsLPQI3jvhywg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/tsconfig-utils@8.44.0':
|
||||
resolution: {integrity: sha512-x5Y0+AuEPqAInc6yd0n5DAcvtoQ/vyaGwuX5HE9n6qAefk1GaedqrLQF8kQGylLUb9pnZyLf+iEiL9fr8APDtQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/tsconfig-utils@8.44.1':
|
||||
resolution: {integrity: sha512-B5OyACouEjuIvof3o86lRMvyDsFwZm+4fBOqFHccIctYgBjqR3qT39FBYGN87khcgf0ExpdCBeGKpKRhSFTjKQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/type-utils@8.44.0':
|
||||
resolution: {integrity: sha512-9cwsoSxJ8Sak67Be/hD2RNt/fsqmWnNE1iHohG8lxqLSNY8xNfyY7wloo5zpW3Nu9hxVgURevqfcH6vvKCt6yg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -1415,16 +1511,33 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/type-utils@8.44.1':
|
||||
resolution: {integrity: sha512-KdEerZqHWXsRNKjF9NYswNISnFzXfXNDfPxoTh7tqohU/PRIbwTmsjGK6V9/RTYWau7NZvfo52lgVk+sJh0K3g==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/types@8.44.0':
|
||||
resolution: {integrity: sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/types@8.44.1':
|
||||
resolution: {integrity: sha512-Lk7uj7y9uQUOEguiDIDLYLJOrYHQa7oBiURYVFqIpGxclAFQ78f6VUOM8lI2XEuNOKNB7XuvM2+2cMXAoq4ALQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.44.0':
|
||||
resolution: {integrity: sha512-lqNj6SgnGcQZwL4/SBJ3xdPEfcBuhCG8zdcwCPgYcmiPLgokiNDKlbPzCwEwu7m279J/lBYWtDYL+87OEfn8Jw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.44.1':
|
||||
resolution: {integrity: sha512-qnQJ+mVa7szevdEyvfItbO5Vo+GfZ4/GZWWDRRLjrxYPkhM+6zYB2vRYwCsoJLzqFCdZT4mEqyJoyzkunsZ96A==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/utils@8.44.0':
|
||||
resolution: {integrity: sha512-nktOlVcg3ALo0mYlV+L7sWUD58KG4CMj1rb2HUVOO4aL3K/6wcD+NERqd0rrA5Vg06b42YhF6cFxeixsp9Riqg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -1432,10 +1545,21 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/utils@8.44.1':
|
||||
resolution: {integrity: sha512-DpX5Fp6edTlocMCwA+mHY8Mra+pPjRZ0TfHkXI8QFelIKcbADQz1LUPNtzOFUriBB2UYqw4Pi9+xV4w9ZczHFg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.44.0':
|
||||
resolution: {integrity: sha512-zaz9u8EJ4GBmnehlrpoKvj/E3dNbuQ7q0ucyZImm3cLqJ8INTc970B1qEqDX/Rzq65r3TvVTN7kHWPBoyW7DWw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.44.1':
|
||||
resolution: {integrity: sha512-576+u0QD+Jp3tZzvfRfxon0EA2lzcDt3lhUbsC6Lgzy9x2VR4E+JUiNyGHi5T8vk0TV+fpJ5GLG1JsJuWCaKhw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@valibot/to-json-schema@1.3.0':
|
||||
resolution: {integrity: sha512-82Vv6x7sOYhv5YmTRgSppSqj1nn2pMCk5BqCMGWYp0V/fq+qirrbGncqZAtZ09/lrO40ne/7z8ejwE728aVreg==}
|
||||
peerDependencies:
|
||||
@@ -1827,10 +1951,6 @@ packages:
|
||||
resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
dotenv@17.2.2:
|
||||
resolution: {integrity: sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
drizzle-kit@0.30.6:
|
||||
resolution: {integrity: sha512-U4wWit0fyZuGuP7iNmRleQyK2V8wCuv57vf5l3MnG4z4fzNTjY/U13M8owyQ5RavqvqxBifWORaR3wIUzlN64g==}
|
||||
hasBin: true
|
||||
@@ -3309,6 +3429,13 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
typescript-eslint@8.44.1:
|
||||
resolution: {integrity: sha512-0ws8uWGrUVTjEeN2OM4K1pLKHK/4NiNP/vz6ns+LjT/6sqpaYzIVFajZb1fj/IDwpsrrHb3Jy0Qm5u9CPcKaeg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <6.0.0'
|
||||
|
||||
typescript@5.9.2:
|
||||
resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==}
|
||||
engines: {node: '>=14.17'}
|
||||
@@ -4547,10 +4674,6 @@ snapshots:
|
||||
'@tmcp/session-manager': 0.1.2
|
||||
tmcp: 1.13.0(typescript@5.9.2)
|
||||
|
||||
'@tmcp/transport-stdio@0.2.0(tmcp@1.13.0(typescript@5.9.2))':
|
||||
dependencies:
|
||||
tmcp: 1.13.0(typescript@5.9.2)
|
||||
|
||||
'@tsconfig/node10@1.0.11': {}
|
||||
|
||||
'@tsconfig/node12@1.0.11': {}
|
||||
@@ -4612,6 +4735,23 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/scope-manager': 8.44.1
|
||||
'@typescript-eslint/type-utils': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/visitor-keys': 8.44.1
|
||||
eslint: 9.36.0
|
||||
graphemer: 1.4.0
|
||||
ignore: 7.0.5
|
||||
natural-compare: 1.4.0
|
||||
ts-api-utils: 2.1.0(typescript@5.9.2)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.44.0
|
||||
@@ -4624,6 +4764,18 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.44.1
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
'@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/visitor-keys': 8.44.1
|
||||
debug: 4.4.3
|
||||
eslint: 9.36.0
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/project-service@8.44.0(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/tsconfig-utils': 8.44.0(typescript@5.9.2)
|
||||
@@ -4633,15 +4785,33 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/project-service@8.44.1(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
debug: 4.4.3
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/scope-manager@8.44.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.0
|
||||
'@typescript-eslint/visitor-keys': 8.44.0
|
||||
|
||||
'@typescript-eslint/scope-manager@8.44.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
'@typescript-eslint/visitor-keys': 8.44.1
|
||||
|
||||
'@typescript-eslint/tsconfig-utils@8.44.0(typescript@5.9.2)':
|
||||
dependencies:
|
||||
typescript: 5.9.2
|
||||
|
||||
'@typescript-eslint/tsconfig-utils@8.44.1(typescript@5.9.2)':
|
||||
dependencies:
|
||||
typescript: 5.9.2
|
||||
|
||||
'@typescript-eslint/type-utils@8.44.0(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.0
|
||||
@@ -4654,8 +4824,22 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/type-utils@8.44.1(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
'@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
debug: 4.4.3
|
||||
eslint: 9.36.0
|
||||
ts-api-utils: 2.1.0(typescript@5.9.2)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/types@8.44.0': {}
|
||||
|
||||
'@typescript-eslint/types@8.44.1': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.44.0(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/project-service': 8.44.0(typescript@5.9.2)
|
||||
@@ -4672,6 +4856,22 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.44.1(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/project-service': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
'@typescript-eslint/visitor-keys': 8.44.1
|
||||
debug: 4.4.3
|
||||
fast-glob: 3.3.3
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.7.2
|
||||
ts-api-utils: 2.1.0(typescript@5.9.2)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.44.0(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0)
|
||||
@@ -4683,11 +4883,27 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.44.1(eslint@9.36.0)(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0)
|
||||
'@typescript-eslint/scope-manager': 8.44.1
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
'@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2)
|
||||
eslint: 9.36.0
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.44.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.0
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.44.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.44.1
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
||||
'@valibot/to-json-schema@1.3.0(valibot@1.1.0(typescript@5.9.2))':
|
||||
dependencies:
|
||||
valibot: 1.1.0(typescript@5.9.2)
|
||||
@@ -5095,8 +5311,6 @@ snapshots:
|
||||
dependencies:
|
||||
esutils: 2.0.3
|
||||
|
||||
dotenv@17.2.2: {}
|
||||
|
||||
drizzle-kit@0.30.6:
|
||||
dependencies:
|
||||
'@drizzle-team/brocli': 0.10.2
|
||||
@@ -5319,17 +5533,17 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0):
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0):
|
||||
dependencies:
|
||||
debug: 3.2.7
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
eslint: 9.36.0
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0):
|
||||
eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0):
|
||||
dependencies:
|
||||
'@rtsao/scc': 1.1.0
|
||||
array-includes: 3.1.9
|
||||
@@ -5340,7 +5554,7 @@ snapshots:
|
||||
doctrine: 2.1.0
|
||||
eslint: 9.36.0
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0)
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0)
|
||||
hasown: 2.0.2
|
||||
is-core-module: 2.16.1
|
||||
is-glob: 4.0.3
|
||||
@@ -5352,7 +5566,7 @@ snapshots:
|
||||
string.prototype.trimend: 1.0.9
|
||||
tsconfig-paths: 3.15.0
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
transitivePeerDependencies:
|
||||
- eslint-import-resolver-typescript
|
||||
- eslint-import-resolver-webpack
|
||||
@@ -6727,6 +6941,17 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
typescript-eslint@8.44.1(eslint@9.36.0)(typescript@5.9.2):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
'@typescript-eslint/typescript-estree': 8.44.1(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.9.2)
|
||||
eslint: 9.36.0
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
typescript@5.9.2: {}
|
||||
|
||||
unbox-primitive@1.1.0:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
packages:
|
||||
- '*'
|
||||
- './packages/*'
|
||||
- './apps/*'
|
||||
|
||||
useNodeVersion: 22.19.0
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { createClient } from '@libsql/client';
|
||||
import { drizzle } from 'drizzle-orm/libsql';
|
||||
import * as schema from './schema.js';
|
||||
|
||||
if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
|
||||
if (!process.env.DATABASE_TOKEN) throw new Error('DATABASE_TOKEN is not set');
|
||||
|
||||
const client = createClient({
|
||||
url: process.env.DATABASE_URL,
|
||||
authToken: process.env.DATABASE_TOKEN,
|
||||
});
|
||||
|
||||
export const db = drizzle(client, { schema, logger: true });
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
import { stdio_transport } from './mcp/index.js';
|
||||
|
||||
stdio_transport.listen();
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src/lib/stdio.ts", "src/lib/mcp/**/*"],
|
||||
"exclude": ["node_modules", "dist", "src/routes/**/*", "src/app.html", "src/hooks.server.ts"]
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "nodenext",
|
||||
"target": "esnext",
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"noEmit": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"checkJs": true,
|
||||
"allowJs": true,
|
||||
// Recommended Options
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
"verbatimModuleSyntax": true,
|
||||
"isolatedModules": true,
|
||||
"noUncheckedSideEffectImports": true,
|
||||
"moduleDetection": "force",
|
||||
"skipLibCheck": true
|
||||
}
|
||||
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||
//
|
||||
// To make changes to top-level options such as include and exclude, we recommend extending
|
||||
// the generated config; see https://svelte.dev/docs/kit/configuration#typescript
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import devtoolsJson from 'vite-plugin-devtools-json';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { config } from 'dotenv';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
config({ path: ['.env', `.env.${mode}`] });
|
||||
|
||||
return {
|
||||
plugins: [sveltekit(), devtoolsJson()],
|
||||
test: {
|
||||
expect: { requireAssertions: true },
|
||||
projects: [
|
||||
{
|
||||
extends: './vite.config.ts',
|
||||
test: {
|
||||
name: 'server',
|
||||
environment: 'node',
|
||||
include: ['src/**/*.{test,spec}.{js,ts}'],
|
||||
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user