From 61f0c1433d4fb8b3d796cbfb155cac162f22da5f Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Mon, 6 Jul 2026 09:08:08 +0200 Subject: [PATCH 1/2] feat(mcp): expose the frozen 6 tools locally - stdio + daemon /mcp (M3) --- e2e/mcp-daemon.test.ts | 123 ++++ e2e/mcp-stdio.test.ts | 116 ++++ package-lock.json | 1106 +++++++++++++++++++++++++++++++++- package.json | 2 + src/cli.ts | 2 + src/commands/mcp.test.ts | 35 ++ src/commands/mcp.ts | 18 + src/daemon-entry.ts | 9 +- src/daemon/mcp-http.test.ts | 108 ++++ src/daemon/mcp-http.ts | 37 ++ src/daemon/server.ts | 13 +- src/mcp/local-server.test.ts | 72 +++ src/mcp/local-server.ts | 32 + src/package-guard.test.ts | 7 +- 14 files changed, 1654 insertions(+), 26 deletions(-) create mode 100644 e2e/mcp-daemon.test.ts create mode 100644 e2e/mcp-stdio.test.ts create mode 100644 src/commands/mcp.test.ts create mode 100644 src/commands/mcp.ts create mode 100644 src/daemon/mcp-http.test.ts create mode 100644 src/daemon/mcp-http.ts create mode 100644 src/mcp/local-server.test.ts create mode 100644 src/mcp/local-server.ts diff --git a/e2e/mcp-daemon.test.ts b/e2e/mcp-daemon.test.ts new file mode 100644 index 0000000..0eedab6 --- /dev/null +++ b/e2e/mcp-daemon.test.ts @@ -0,0 +1,123 @@ +import { existsSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { expect, test } from '@playwright/test'; +import { assertCliBuilt, createCliMachine, freePort, type CliMachine } from './helpers.js'; + +// M3 daemon MCP tier: the daemon exposes the frozen 6 memory__* tools at POST /mcp (stateless +// Streamable HTTP). An ephemeral port + isolated AGENTAGE_CONFIG_DIR keep it off the real daemon / +// :4243; stop only signals the pid this test started. Asserts the full contract: 6 tools, @/ +// routing, and dual-channel output (rendered markdown text AND structuredContent). @p0 + +const pidOf = (m: CliMachine): number | null => { + const p = join(m.configDir, 'daemon.pid'); + return existsSync(p) ? Number.parseInt(readFileSync(p, 'utf-8').trim(), 10) : null; +}; + +const alive = (pid: number): boolean => { + try { + process.kill(pid, 0); + return true; + } catch { + return false; + } +}; + +interface RpcResult { + serverInfo?: { name: string }; + instructions?: string; + tools?: Array<{ name: string }>; + content?: Array<{ type: string; text: string }>; + structuredContent?: Record; +} + +// A stateless MCP call: plain fetch with the required Accept header (application/json + +// text/event-stream); enableJsonResponse means a single JSON-RPC object comes back. +const mcpRpc = async (port: number, method: string, params: unknown): Promise => { + const res = await fetch(`http://127.0.0.1:${port}/mcp`, { + method: 'POST', + headers: { 'Content-Type': 'application/json', Accept: 'application/json, text/event-stream' }, + body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }), + }); + expect(res.ok, `POST /mcp ${method} -> ${res.status}`).toBe(true); + const body = (await res.json()) as { result?: RpcResult; error?: { message: string } }; + expect(body.error, JSON.stringify(body.error)).toBeUndefined(); + return body.result ?? {}; +}; + +const callTool = (port: number, name: string, args: Record): Promise => + mcpRpc(port, 'tools/call', { name, arguments: args }); + +test.describe('daemon /mcp exposes the frozen tools @p0', () => { + test.beforeAll(() => assertCliBuilt()); + + test('initialize + tools/list + all six tools over :port/mcp', async () => { + const port = await freePort(); + const m = createCliMachine({ AGENTAGE_NO_DAEMON: '', AGENTAGE_DAEMON_PORT: String(port) }); + let daemonPid: number | null = null; + try { + const add = await m.exec(['vault', 'add', 'main', '--local', join(m.configDir, 'main')]); + expect(add.code, add.stderr).toBe(0); + + const start = await m.exec(['daemon', 'start']); + expect(start.code, start.stderr).toBe(0); + daemonPid = pidOf(m); + expect(daemonPid, 'daemon.pid written').not.toBeNull(); + + const init = await mcpRpc(port, 'initialize', { + protocolVersion: '2025-06-18', + capabilities: {}, + clientInfo: { name: 'e2e', version: '0' }, + }); + expect(init.serverInfo?.name).toBe('agentage-memory'); + expect((init.instructions ?? '').length).toBeGreaterThan(0); + + const list = await mcpRpc(port, 'tools/list', {}); + expect((list.tools ?? []).map((t) => t.name).sort()).toEqual([ + 'memory__delete', + 'memory__edit', + 'memory__list', + 'memory__read', + 'memory__search', + 'memory__write', + ]); + + // write -> dual channel: rendered markdown in content[0].text AND a typed structuredContent. + const write = await callTool(port, 'memory__write', { + path: 'notes/e.md', + body: 'daemon mcp quokka', + }); + expect(write.content?.[0]?.type).toBe('text'); + expect(write.content?.[0]?.text).toContain('notes/e.md'); + expect(write.structuredContent?.path).toBe('notes/e.md'); + expect(typeof write.structuredContent?.updated).toBe('string'); + + const search = await callTool(port, 'memory__search', { query: 'quokka' }); + const results = search.structuredContent?.results as Array<{ path: string }>; + expect(results.map((r) => r.path)).toEqual(['notes/e.md']); + expect(search.content?.[0]?.text).toContain('quokka'); + + const read = await callTool(port, 'memory__read', { path: 'notes/e.md' }); + expect(read.structuredContent?.body).toContain('daemon mcp quokka'); + expect(read.content?.[0]?.text).toContain('daemon mcp quokka'); + + const listTool = await callTool(port, 'memory__list', {}); + expect(Array.isArray(listTool.structuredContent?.entries)).toBe(true); + + const edit = await callTool(port, 'memory__edit', { + path: 'notes/e.md', + mode: 'append', + body: 'more', + }); + expect(edit.structuredContent?.path).toBe('notes/e.md'); + + const del = await callTool(port, 'memory__delete', { path: 'notes/e.md' }); + expect(del.structuredContent?.deleted).toBe(true); + + const stop = await m.exec(['daemon', 'stop']); + expect(stop.code, stop.stderr).toBe(0); + } finally { + if (daemonPid !== null && alive(daemonPid)) process.kill(daemonPid, 'SIGKILL'); + m.cleanup(); + } + }); +}); diff --git a/e2e/mcp-stdio.test.ts b/e2e/mcp-stdio.test.ts new file mode 100644 index 0000000..2296021 --- /dev/null +++ b/e2e/mcp-stdio.test.ts @@ -0,0 +1,116 @@ +import { spawn } from 'node:child_process'; +import { join } from 'node:path'; +import { expect, test } from '@playwright/test'; +import { assertCliBuilt, CLI_BIN, createCliMachine } from './helpers.js'; + +// M3 stdio MCP tier: `agentage mcp` serves the frozen 6 tools over stdio to a client that spawns +// the process (Cursor, Windsurf, Zed). Own process, isolated AGENTAGE_CONFIG_DIR; clean shutdown on +// stdin EOF. @p0 + +interface RpcResult { + serverInfo?: { name: string }; + instructions?: string; + tools?: Array<{ name: string }>; + content?: Array<{ type: string; text: string }>; + structuredContent?: Record; +} + +interface StdioMcp { + request: (method: string, params: unknown) => Promise; + notify: (method: string, params: unknown) => void; + close: () => Promise; +} + +// Drive `agentage mcp` over newline-delimited JSON-RPC on stdio: match responses by id. +const startStdioMcp = (configDir: string): StdioMcp => { + const env: NodeJS.ProcessEnv = { ...process.env, AGENTAGE_CONFIG_DIR: configDir, NO_COLOR: '1' }; + const child = spawn(process.execPath, [CLI_BIN, 'mcp'], { env }); + child.stderr.on('data', () => {}); + const pending = new Map void>(); + let buf = ''; + let nextId = 0; + child.stdout.on('data', (chunk: Buffer) => { + buf += chunk.toString(); + for (let nl = buf.indexOf('\n'); nl >= 0; nl = buf.indexOf('\n')) { + const line = buf.slice(0, nl).trim(); + buf = buf.slice(nl + 1); + if (!line) continue; + const msg = JSON.parse(line) as { id?: number; result?: RpcResult }; + if (typeof msg.id === 'number' && pending.has(msg.id)) { + pending.get(msg.id)?.(msg.result ?? {}); + pending.delete(msg.id); + } + } + }); + const send = (payload: object): void => void child.stdin.write(`${JSON.stringify(payload)}\n`); + return { + request: (method, params) => + new Promise((resolve) => { + const id = ++nextId; + pending.set(id, resolve); + send({ jsonrpc: '2.0', id, method, params }); + }), + notify: (method, params) => send({ jsonrpc: '2.0', method, params }), + close: () => + new Promise((resolve) => { + const t = setTimeout(() => child.kill('SIGTERM'), 3000); + child.on('close', (code) => { + clearTimeout(t); + resolve(code ?? 0); + }); + child.stdin.end(); + }), + }; +}; + +test.describe('agentage mcp over stdio @p0', () => { + test.beforeAll(() => assertCliBuilt()); + + test('initialize + tools/list + a tool call, clean EOF shutdown', async () => { + const m = createCliMachine(); + try { + const add = await m.exec(['vault', 'add', 'main', '--local', join(m.configDir, 'main')]); + expect(add.code, add.stderr).toBe(0); + + const mcp = startStdioMcp(m.configDir); + + const init = await mcp.request('initialize', { + protocolVersion: '2025-06-18', + capabilities: {}, + clientInfo: { name: 'e2e', version: '0' }, + }); + expect(init.serverInfo?.name).toBe('agentage-memory'); + expect((init.instructions ?? '').length).toBeGreaterThan(0); + mcp.notify('notifications/initialized', {}); + + const list = await mcp.request('tools/list', {}); + expect((list.tools ?? []).map((t) => t.name).sort()).toEqual([ + 'memory__delete', + 'memory__edit', + 'memory__list', + 'memory__read', + 'memory__search', + 'memory__write', + ]); + + const write = await mcp.request('tools/call', { + name: 'memory__write', + arguments: { path: 'stdio.md', body: 'stdio wombat' }, + }); + expect(write.content?.[0]?.type).toBe('text'); + expect(write.content?.[0]?.text).toContain('stdio.md'); + expect(write.structuredContent?.path).toBe('stdio.md'); + + const read = await mcp.request('tools/call', { + name: 'memory__read', + arguments: { path: 'stdio.md' }, + }); + expect(read.structuredContent?.body).toContain('stdio wombat'); + + const code = await mcp.close(); + expect(code, 'clean exit on stdin EOF').toBe(0); + } finally { + m.cleanup(); + } + }); +}); diff --git a/package-lock.json b/package-lock.json index 3e3b179..9cc25db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,8 @@ "license": "MIT", "dependencies": { "@agentage/memory-core": "^0.1.1", + "@agentage/server-memory": "0.0.2", + "@modelcontextprotocol/sdk": "1.29.0", "chalk": "latest", "commander": "latest", "open": "latest" @@ -50,6 +52,24 @@ "npm": ">=10.0.0" } }, + "node_modules/@agentage/server-memory": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@agentage/server-memory/-/server-memory-0.0.2.tgz", + "integrity": "sha512-YwwWUzTWxWpQlAboSxsEB2QkUPkZq7H4Os+i9EJvGhoU7l1mRlWwc3Pj2KFe0AjvzaJNNSi4pgTE2y1AoDxuyA==", + "license": "MIT", + "dependencies": { + "@agentage/memory-core": "^0.1.0", + "@modelcontextprotocol/sdk": "^1.29.0", + "zod": "^4.4.3" + }, + "bin": { + "agentage-server-memory": "dist/bin/server-memory.js" + }, + "engines": { + "node": ">=22.0.0", + "npm": ">=10.0.0" + } + }, "node_modules/@anthropic-ai/sdk": { "version": "0.110.0", "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.110.0.tgz", @@ -270,6 +290,18 @@ "node": "^20.19.0 || ^22.13.0 || >=24" } }, + "node_modules/@hono/node-server": { + "version": "1.19.14", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz", + "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -350,6 +382,46 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz", + "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz", @@ -1123,6 +1195,19 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/acorn": { "version": "8.16.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", @@ -1146,6 +1231,39 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -1178,6 +1296,43 @@ "node": "18 || 20 || >=22" } }, + "node_modules/body-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/brace-expansion": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", @@ -1206,6 +1361,44 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/chai": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", @@ -1237,6 +1430,28 @@ "node": ">=20" } }, + "node_modules/content-disposition": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -1244,11 +1459,45 @@ "dev": true, "license": "MIT" }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -1263,7 +1512,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -1324,6 +1572,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -1334,6 +1591,53 @@ "node": ">=8" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", @@ -1341,6 +1645,24 @@ "dev": true, "license": "MIT" }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -1626,6 +1948,36 @@ "node": ">=0.10.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.0.tgz", + "integrity": "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/expect-type": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", @@ -1636,11 +1988,71 @@ "node": ">=12.0.0" } }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.5.2.tgz", + "integrity": "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, "license": "MIT" }, "node_modules/fast-diff": { @@ -1671,6 +2083,22 @@ "dev": true, "license": "Unlicense" }, + "node_modules/fast-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -1702,6 +2130,27 @@ "node": ">=16.0.0" } }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -1740,6 +2189,24 @@ "dev": true, "license": "ISC" }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1755,22 +2222,80 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { - "is-glob": "^4.0.3" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">=10.13.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", @@ -1778,6 +2303,39 @@ "node": ">=8" } }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.12.27", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.27.tgz", + "integrity": "sha512-1yrb/+w6HWQJrUCLkJ2IF5jNIPvvFkblV5RNOYl6bV+OA6p9GLcMpHFFGTosSvHvcAUibuUukRqhlYI4z32C7Q==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -1785,6 +2343,42 @@ "dev": true, "license": "MIT" }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/ignore": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", @@ -1805,6 +2399,30 @@ "node": ">=0.8.19" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz", + "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -1873,6 +2491,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, "node_modules/is-wsl": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", @@ -1892,7 +2516,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -1934,6 +2557,15 @@ "node": ">=8" } }, + "node_modules/jose": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz", + "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/js-tokens": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", @@ -1962,6 +2594,18 @@ "node": ">=16" } }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -2308,6 +2952,61 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/minimatch": { "version": "10.2.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", @@ -2328,7 +3027,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/nanoid": { @@ -2357,6 +3055,36 @@ "dev": true, "license": "MIT" }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/obug": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", @@ -2368,6 +3096,27 @@ ], "license": "MIT" }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, "node_modules/open": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", @@ -2438,6 +3187,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2452,12 +3210,21 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/pathe": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", @@ -2485,6 +3252,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, "node_modules/playwright": { "version": "1.61.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz", @@ -2612,6 +3388,19 @@ "node": ">=6.0.0" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2622,6 +3411,59 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rolldown": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz", @@ -2656,6 +3498,22 @@ "@rolldown/binding-win32-x64-msvc": "1.0.3" } }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/run-applescript": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", @@ -2668,6 +3526,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, "node_modules/semver": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", @@ -2681,11 +3545,61 @@ "node": ">=10" } }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -2698,12 +3612,83 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -2739,6 +3724,15 @@ "fast-sha256": "^1.3.0" } }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.0.0.tgz", @@ -2819,6 +3813,15 @@ "node": ">=14.0.0" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, "node_modules/ts-algebra": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-2.0.0.tgz", @@ -2860,6 +3863,37 @@ "node": ">= 0.8.0" } }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -2881,6 +3915,15 @@ "dev": true, "license": "MIT" }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2891,6 +3934,15 @@ "punycode": "^2.1.0" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vite": { "version": "8.0.16", "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.16.tgz", @@ -3063,7 +4115,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -3102,6 +4153,12 @@ "node": ">=0.10.0" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, "node_modules/wsl-utils": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz", @@ -3154,6 +4211,15 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } } } } diff --git a/package.json b/package.json index 98b98ab..9604b4d 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,8 @@ }, "dependencies": { "@agentage/memory-core": "^0.1.1", + "@agentage/server-memory": "^0.0.2", + "@modelcontextprotocol/sdk": "^1.29.0", "chalk": "latest", "commander": "latest", "open": "latest" diff --git a/src/cli.ts b/src/cli.ts index e6b30b3..d01beb5 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -2,6 +2,7 @@ import { Command } from 'commander'; import { registerDaemon } from './commands/daemon-cmd.js'; +import { registerMcp } from './commands/mcp.js'; import { registerMemory } from './commands/memory.js'; import { registerSetup } from './commands/setup.js'; import { registerStatus } from './commands/status.js'; @@ -27,6 +28,7 @@ registerStatus(program); registerVault(program); registerMemory(program); registerDaemon(program); +registerMcp(program); registerUpdate(program); program.parseAsync().catch((err: unknown) => { diff --git a/src/commands/mcp.test.ts b/src/commands/mcp.test.ts new file mode 100644 index 0000000..f7efffb --- /dev/null +++ b/src/commands/mcp.test.ts @@ -0,0 +1,35 @@ +import { Command } from 'commander'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { registerMcp } from './mcp.js'; + +const { loadLocalMemoryServer, connect } = vi.hoisted(() => { + const connect = vi.fn(async () => {}); + return { loadLocalMemoryServer: vi.fn(async () => ({ connect })), connect }; +}); +vi.mock('../mcp/local-server.js', () => ({ loadLocalMemoryServer })); + +const run = async (args: string[]): Promise => { + const program = new Command(); + program.exitOverride(); + registerMcp(program); + await program.parseAsync(['node', 'agentage', ...args]); +}; + +afterEach(() => { + connect.mockClear(); + loadLocalMemoryServer.mockClear(); +}); + +describe('agentage mcp', () => { + it('registers the mcp command', () => { + const program = new Command(); + registerMcp(program); + expect(program.commands.map((c) => c.name())).toContain('mcp'); + }); + + it('loads the local memory server and connects a stdio transport', async () => { + await run(['mcp']); + expect(loadLocalMemoryServer).toHaveBeenCalledTimes(1); + expect(connect).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/commands/mcp.ts b/src/commands/mcp.ts new file mode 100644 index 0000000..3606513 --- /dev/null +++ b/src/commands/mcp.ts @@ -0,0 +1,18 @@ +import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; +import { type Command } from 'commander'; +import { loadLocalMemoryServer } from '../mcp/local-server.js'; + +// `agentage mcp`: serve the frozen 6 memory tools over stdio to a client that spawns this process +// (Cursor, Windsurf, Zed). In-process engine - its own process - so stdout is the JSON-RPC wire and +// nothing else may print there. The transport keeps the process alive until stdin EOF. +const mcpAction = async (): Promise => { + const server = await loadLocalMemoryServer(); + await server.connect(new StdioServerTransport()); +}; + +export const registerMcp = (program: Command): void => { + program + .command('mcp') + .description('Serve the local memory to on-machine AI clients as an MCP server over stdio') + .action(() => mcpAction()); +}; diff --git a/src/daemon-entry.ts b/src/daemon-entry.ts index a2be186..2f305b7 100644 --- a/src/daemon-entry.ts +++ b/src/daemon-entry.ts @@ -7,13 +7,18 @@ import { writePortFile, } from './daemon/lifecycle.js'; import { createDaemonServer } from './daemon/server.js'; +import { loadLocalMemoryServer } from './mcp/local-server.js'; import { VERSION } from './utils/version.js'; -// The forked, long-lived engine host: one loopback HTTP server that owns a single in-process +// The detached, long-lived engine host: one loopback HTTP server that owns a single in-process // engine and serialises every vault mutation, avoiding concurrent git index.lock collisions. const main = async (): Promise => { const port = resolvePort(); - const server = createDaemonServer({ getClient: createClientProvider(), version: VERSION }); + const server = createDaemonServer({ + getClient: createClientProvider(), + buildMcpServer: loadLocalMemoryServer, + version: VERSION, + }); await server.start(port); writePidFile(process.pid); writePortFile(port); diff --git a/src/daemon/mcp-http.test.ts b/src/daemon/mcp-http.test.ts new file mode 100644 index 0000000..497e4e6 --- /dev/null +++ b/src/daemon/mcp-http.test.ts @@ -0,0 +1,108 @@ +import { createRegistry, type VaultsConfig } from '@agentage/memory-core'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { afterEach, describe, expect, it } from 'vitest'; +import { createLocalMemoryServer } from '../mcp/local-server.js'; +import { createDaemonServer, type DaemonServer } from './server.js'; + +const config: VaultsConfig = { + version: 1, + default: 'main', + vaults: { main: { path: join(tmpdir(), 'agentage-mcp-http-test'), mcp: ['local'] } }, +}; + +const start = async (): Promise<{ port: number; srv: DaemonServer }> => { + const srv = createDaemonServer({ + getClient: () => { + throw new Error('memory verbs not used in this test'); + }, + buildMcpServer: async () => createLocalMemoryServer(await createRegistry(config)), + version: '9.9.9', + }); + await srv.start(0); + const addr = srv.server.address(); + return { port: typeof addr === 'object' && addr ? addr.port : 0, srv }; +}; + +const rpc = async ( + port: number, + body: unknown +): Promise<{ status: number; json: { result?: Record } }> => { + const res = await fetch(`http://127.0.0.1:${port}/mcp`, { + method: 'POST', + headers: { 'Content-Type': 'application/json', Accept: 'application/json, text/event-stream' }, + body: JSON.stringify(body), + }); + return { status: res.status, json: (await res.json()) as { result?: Record } }; +}; + +let running: DaemonServer | undefined; +afterEach(async () => { + await running?.stop(); + running = undefined; +}); + +describe('daemon POST /mcp (stateless Streamable HTTP)', () => { + it('answers initialize with the frozen server identity + instructions', async () => { + const { port, srv } = await start(); + running = srv; + const { status, json } = await rpc(port, { + jsonrpc: '2.0', + id: 1, + method: 'initialize', + params: { + protocolVersion: '2025-06-18', + capabilities: {}, + clientInfo: { name: 't', version: '0' }, + }, + }); + expect(status).toBe(200); + expect((json.result?.serverInfo as { name: string }).name).toBe('agentage-memory'); + expect(typeof json.result?.instructions).toBe('string'); + expect((json.result?.instructions as string).length).toBeGreaterThan(0); + }); + + it('lists the frozen six tools', async () => { + const { port, srv } = await start(); + running = srv; + const { json } = await rpc(port, { jsonrpc: '2.0', id: 2, method: 'tools/list', params: {} }); + const tools = json.result?.tools as Array<{ name: string }>; + expect(tools.map((t) => t.name).sort()).toEqual([ + 'memory__delete', + 'memory__edit', + 'memory__list', + 'memory__read', + 'memory__search', + 'memory__write', + ]); + }); + + it('rejects GET with 405 (stateless, POST only)', async () => { + const { port, srv } = await start(); + running = srv; + const res = await fetch(`http://127.0.0.1:${port}/mcp`, { method: 'GET' }); + expect(res.status).toBe(405); + }); + + it('leaves /mcp unmounted (404) when no builder is supplied', async () => { + const srv = createDaemonServer({ + getClient: () => { + throw new Error('unused'); + }, + version: '9.9.9', + }); + await srv.start(0); + running = srv; + const addr = srv.server.address(); + const port = typeof addr === 'object' && addr ? addr.port : 0; + const res = await fetch(`http://127.0.0.1:${port}/mcp`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json, text/event-stream', + }, + body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/list', params: {} }), + }); + expect(res.status).toBe(404); + }); +}); diff --git a/src/daemon/mcp-http.ts b/src/daemon/mcp-http.ts new file mode 100644 index 0000000..3e80ea2 --- /dev/null +++ b/src/daemon/mcp-http.ts @@ -0,0 +1,37 @@ +import { type IncomingMessage, type ServerResponse } from 'node:http'; +import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; + +const jsonRpcError = (res: ServerResponse, status: number, message: string): void => { + res.writeHead(status, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ jsonrpc: '2.0', error: { code: -32000, message }, id: null })); +}; + +// Stateless Streamable HTTP (JSON, no session), mirroring the cloud memory endpoint: a fresh MCP +// server + transport per POST, torn down when the response closes. GET/DELETE are 405 - stateless +// exposes no server-initiated SSE stream or session teardown. Loopback trust: no auth on the socket. +export const handleMcp = async ( + req: IncomingMessage, + res: ServerResponse, + buildServer: () => Promise +): Promise => { + if (req.method !== 'POST') { + jsonRpcError(res, 405, 'Method not allowed: this endpoint is stateless (POST only).'); + return; + } + const server = await buildServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + enableJsonResponse: true, + }); + res.on('close', () => { + void transport.close(); + void server.close(); + }); + try { + await server.connect(transport); + await transport.handleRequest(req, res); + } catch { + if (!res.headersSent) jsonRpcError(res, 500, 'Internal server error'); + } +}; diff --git a/src/daemon/server.ts b/src/daemon/server.ts index e48c428..2b9b674 100644 --- a/src/daemon/server.ts +++ b/src/daemon/server.ts @@ -1,11 +1,15 @@ import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http'; +import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { type MemoryClient } from '../lib/memory-client.js'; import { dispatchMemory, isMemoryVerb } from './actions.js'; +import { handleMcp } from './mcp-http.js'; const LOOPBACK = '127.0.0.1'; export interface DaemonServerOptions { getClient: () => MemoryClient | Promise; + // Builds a fresh MCP server per request for POST /mcp; omit to leave the endpoint unmounted. + buildMcpServer?: () => Promise; version: string; startedAt?: number; } @@ -37,8 +41,9 @@ const send = (res: ServerResponse, status: number, body: unknown): void => { res.end(JSON.stringify(body)); }; -// Loopback-only JSON HTTP: GET /api/health + POST /api/memory/. No auth (local socket -// trust); the six verbs are the whole surface, dispatched to one shared MemoryClient. +// Loopback-only JSON HTTP: GET /api/health + POST /api/memory/ (the CLI verbs) + POST /mcp +// (the frozen 6 tools for on-machine AI clients, stateless Streamable HTTP). No auth (local socket +// trust); the verbs dispatch to one shared MemoryClient, /mcp builds a fresh server per request. export const createDaemonServer = (opts: DaemonServerOptions): DaemonServer => { const startedAt = opts.startedAt ?? Date.now(); let served = 0; @@ -54,6 +59,10 @@ export const createDaemonServer = (opts: DaemonServerOptions): DaemonServer => { served, }); } + if ((url.split('?')[0] ?? url) === '/mcp') { + if (!opts.buildMcpServer) return send(res, 404, { error: 'not found' }); + return handleMcp(req, res, opts.buildMcpServer); + } const match = url.match(/^\/api\/memory\/([a-z]+)$/); if (req.method === 'POST' && match) { const verb = match[1]; diff --git a/src/mcp/local-server.test.ts b/src/mcp/local-server.test.ts new file mode 100644 index 0000000..016a192 --- /dev/null +++ b/src/mcp/local-server.test.ts @@ -0,0 +1,72 @@ +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { createRegistry, type VaultsConfig } from '@agentage/memory-core'; +import { createMemoryServer } from '@agentage/server-memory'; +import { Client } from '@modelcontextprotocol/sdk/client/index.js'; +import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js'; +import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { describe, expect, it } from 'vitest'; +import { VERSION } from '../utils/version.js'; +import { createLocalMemoryServer } from './local-server.js'; + +// Two local vaults, never touched on disk: listTools reads only tool metadata and the backends are +// lazy, so no dir is created - but the multi-vault @/ instructions line is still exercised. +const config: VaultsConfig = { + version: 1, + default: 'main', + vaults: { + main: { path: join(tmpdir(), 'agentage-contract-main'), mcp: ['local'] }, + work: { path: join(tmpdir(), 'agentage-contract-work'), mcp: ['local'] }, + }, +}; + +interface Contract { + tools: unknown; + instructions: string | undefined; +} + +// Drive the server over an in-memory transport: initialize + tools/list, then read back the tool +// list and the per-connection instructions (both part of the frozen contract). +const roundtrip = async (server: McpServer): Promise => { + const [clientT, serverT] = InMemoryTransport.createLinkedPair(); + const client = new Client({ name: 'contract-test', version: '0.0.0' }); + await Promise.all([server.connect(serverT), client.connect(clientT)]); + const { tools } = await client.listTools(); + const contract: Contract = { tools, instructions: client.getInstructions() }; + await client.close(); + return contract; +}; + +describe('local MCP contract fidelity', () => { + it('tools/list + instructions match @agentage/server-memory built directly', async () => { + const local = await roundtrip(createLocalMemoryServer(await createRegistry(config))); + // Canonical server built straight from the package (all vaults are local, so same surface). + // Same builder = trivially equal today; the diff guards a future local reimplementation drift. + const canonical = await roundtrip( + createMemoryServer(await createRegistry(config), { scope: 'local', version: VERSION }) + ); + expect(local.tools).toEqual(canonical.tools); + expect(local.instructions).toEqual(canonical.instructions); + }); + + it('exposes exactly the frozen six memory__* tools', async () => { + const { tools } = await roundtrip(createLocalMemoryServer(await createRegistry(config))); + const names = (tools as Array<{ name: string }>).map((t) => t.name).sort(); + expect(names).toEqual([ + 'memory__delete', + 'memory__edit', + 'memory__list', + 'memory__read', + 'memory__search', + 'memory__write', + ]); + }); + + it('every tool carries annotations and a non-empty cross-model description', async () => { + const { tools } = await roundtrip(createLocalMemoryServer(await createRegistry(config))); + for (const t of tools as Array<{ description?: string; annotations?: object }>) { + expect(t.description && t.description.length).toBeGreaterThan(40); + expect(t.annotations).toBeDefined(); + } + }); +}); diff --git a/src/mcp/local-server.ts b/src/mcp/local-server.ts new file mode 100644 index 0000000..52a5ff0 --- /dev/null +++ b/src/mcp/local-server.ts @@ -0,0 +1,32 @@ +import { createRegistry, type VaultHandle, type VaultRegistry } from '@agentage/memory-core'; +import { createMemoryServer } from '@agentage/server-memory'; +import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { loadVaultsConfig } from '../lib/vaults.js'; +import { VERSION } from '../utils/version.js'; + +// Restrict a registry to its offline (git working-copy) vaults, so the local MCP surface exposes +// exactly what the DirectClient does - never a network-backed vault over the no-auth loopback. +const localOnly = (registry: VaultRegistry): VaultRegistry => { + const local = registry.list().filter((h) => h.backend.capabilities().kind === 'local'); + const byId = new Map(local.map((h) => [h.id, h])); + const def = registry.default(); + const defaultHandle = def && byId.has(def.id) ? def : undefined; + return { + list: () => local, + get: (id) => byId.get(id), + default: () => defaultHandle, + surfaced: () => local, + watch: () => () => {}, + close: async () => {}, + }; +}; + +// Build the frozen 6-tool MCP server over one registry, reusing @agentage/server-memory's contract +// layer verbatim (descriptions, schemas, annotations, per-connection instructions) - zero drift. +export const createLocalMemoryServer = (registry: VaultRegistry): McpServer => + createMemoryServer(localOnly(registry), { scope: 'local', version: VERSION }); + +// The whole local stack: read this machine's vaults.json (the same config the daemon + CLI verbs +// load) -> registry -> an MCP server over the surfaced local vaults. +export const loadLocalMemoryServer = async (): Promise => + createLocalMemoryServer(await createRegistry(loadVaultsConfig().config)); diff --git a/src/package-guard.test.ts b/src/package-guard.test.ts index e04a52c..e7ddc5c 100644 --- a/src/package-guard.test.ts +++ b/src/package-guard.test.ts @@ -38,10 +38,13 @@ describe('package guard (R6)', () => { dependencies: Record; bin: Record; }; - // @agentage/memory-core is the one local engine at M2-C (decision V7/V11-C); it replaces - // the retired FTS5/SQLite stack and the direct zod/yaml deps. Still minimal: no daemon. + // @agentage/memory-core is the one local engine at M2-C (decision V7/V11-C). M3 adds the MCP + // contract layer: @agentage/server-memory (the frozen 6-tool builder, wrapped verbatim) and + // @modelcontextprotocol/sdk (stdio + Streamable HTTP transports). Still minimal: no daemon. expect(Object.keys(pkg.dependencies).sort()).toEqual([ '@agentage/memory-core', + '@agentage/server-memory', + '@modelcontextprotocol/sdk', 'chalk', 'commander', 'open', From 5ac2c449f70fae16049d84dcfa0d36c6f456995e Mon Sep 17 00:00:00 2001 From: Volodymyr Vreshch Date: Mon, 6 Jul 2026 09:23:44 +0200 Subject: [PATCH 2/2] test(e2e): guard the daemon teardown SIGKILL against the ESRCH race --- e2e/mcp-daemon.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e2e/mcp-daemon.test.ts b/e2e/mcp-daemon.test.ts index 0eedab6..bcd7dcf 100644 --- a/e2e/mcp-daemon.test.ts +++ b/e2e/mcp-daemon.test.ts @@ -116,7 +116,12 @@ test.describe('daemon /mcp exposes the frozen tools @p0', () => { const stop = await m.exec(['daemon', 'stop']); expect(stop.code, stop.stderr).toBe(0); } finally { - if (daemonPid !== null && alive(daemonPid)) process.kill(daemonPid, 'SIGKILL'); + try { + // the daemon may exit between the alive() check and the kill (ESRCH race) + if (daemonPid !== null && alive(daemonPid)) process.kill(daemonPid, 'SIGKILL'); + } catch { + // already gone - the SIGKILL is only a leak guard + } m.cleanup(); } });