asynthetic 0.1.0-beta → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -116
- package/dist/index.js +153 -131
- package/dist/index.js.map +1 -1
- package/package.json +1 -21
- package/dist/server.d.ts +0 -13
- package/dist/server.js +0 -166
- package/dist/server.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,163 +1,93 @@
|
|
|
1
|
-
# Asynthetic
|
|
1
|
+
# Asynthetic (MCP Server)
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
An MCP server that gives AI coding agents **verified migration information for fast-moving libraries**: exactly what breaks between two versions and how to fix it, from hand-curated maps with source citations — instead of hallucinated answers from stale training data.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Context7 tells the agent what the current API is. **This tells the agent what changed and how to migrate.**
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## How it works
|
|
10
|
-
|
|
11
|
-
Every migration map is hand-curated from authoritative sources only — official migration guides, GitHub releases, and framework blogs — and every map carries:
|
|
12
|
-
|
|
13
|
-
- ordered breaking changes with **before/after code snippets**
|
|
14
|
-
- a `category` per change (`signature-change`, `removal`, `rename`, `behavior-change`, `config-change`, `import-change`, `deprecation`)
|
|
15
|
-
- deprecations with replacement symbols and removal timelines
|
|
16
|
-
- **`source_urls` citations** and a **`last_verified` date**
|
|
17
|
-
|
|
18
|
-
Maps are never LLM-generated. A map that would be wrong is worse than no map, so when nothing verified matches a query, the server says so explicitly and instructs the agent **not** to fabricate migration steps.
|
|
7
|
+
Every map is hand-curated from authoritative sources (official migration guides, GitHub Releases, spec changelogs), cites its `source_urls`, and carries a `last_verified` date. Maps are never LLM-generated.
|
|
19
8
|
|
|
20
9
|
## Tools
|
|
21
10
|
|
|
22
|
-
| Tool |
|
|
11
|
+
| Tool | What it returns |
|
|
23
12
|
|---|---|
|
|
24
|
-
| `get_migration(package, from_version, to_version, ecosystem?)` |
|
|
25
|
-
| `get_breaking_changes(package, version, ecosystem?)` | Breaking changes introduced when upgrading **to**
|
|
13
|
+
| `get_migration(package, from_version, to_version, ecosystem?)` | Full migration map: ordered breaking changes with before/after code, deprecations, citations, `last_verified` |
|
|
14
|
+
| `get_breaking_changes(package, version, ecosystem?)` | Breaking changes introduced when upgrading **to** that version |
|
|
26
15
|
| `check_compatibility(...)` | Stub — always returns `implemented: false` (planned) |
|
|
27
16
|
|
|
28
|
-
Version
|
|
29
|
-
|
|
30
|
-
## Current coverage
|
|
17
|
+
Version matching is SemVer-aware: exact string match first, then range/major resolution — `^14.2.0 → ^15.0.0` and `1.20.0 → 2.0.0` both find the covering map. Every non-exact match is disclosed via `match_type`, `resolved_via` (`exact_string` / `semver_range` / `major_version`), and a `match_note`. When nothing matches, the response says `found: false`, tells the agent **not** to fabricate migration steps, and lists the maps that do exist.
|
|
31
18
|
|
|
32
|
-
|
|
33
|
-
|---|---|---|
|
|
34
|
-
| `@modelcontextprotocol/sdk` | 1.x → 2.0 | 21 |
|
|
35
|
-
| `ai` (Vercel AI SDK) | 4.x → 5.0 | 23 |
|
|
36
|
-
| `next` (Next.js) | 14 → 15 | 17 |
|
|
19
|
+
## Quick start (no database needed)
|
|
37
20
|
|
|
38
|
-
|
|
21
|
+
```sh
|
|
22
|
+
npm install
|
|
23
|
+
npm run smoke # builds + runs an end-to-end stdio test
|
|
24
|
+
```
|
|
39
25
|
|
|
40
|
-
|
|
26
|
+
With no Supabase env vars set, the server automatically serves the JSON maps in [`data/maps/`](data/maps/) — it never crashes on missing configuration.
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
## Test interactively with MCP Inspector
|
|
43
29
|
|
|
44
30
|
```sh
|
|
45
|
-
|
|
31
|
+
npm run inspect
|
|
46
32
|
```
|
|
47
33
|
|
|
48
|
-
|
|
34
|
+
This builds and launches `@modelcontextprotocol/inspector` against `node dist/index.js`. Open the URL it prints (default `http://localhost:6274`), go to **Tools → list**, and try:
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
36
|
+
- `get_migration` with `package: @modelcontextprotocol/sdk`, `from_version: 1.29.0`, `to_version: 2.0.0-beta.2` → full map, `match_type: "exact"`
|
|
37
|
+
- `get_migration` with `from_version: 1.20.0`, `to_version: 2.0.0` → same map with a `match_note` disclosure
|
|
38
|
+
- `get_migration` with `package: left-pad` → `found: false` + guidance
|
|
39
|
+
|
|
40
|
+
## Use from Claude Code / Cursor
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npm run build
|
|
58
44
|
```
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
Claude Code:
|
|
61
47
|
|
|
62
48
|
```sh
|
|
63
|
-
claude mcp add asynthetic --
|
|
49
|
+
claude mcp add asynthetic -- node "F:/MCP ooracle/dist/index.js"
|
|
64
50
|
```
|
|
65
51
|
|
|
52
|
+
Cursor (`.cursor/mcp.json`) or any client using JSON config:
|
|
53
|
+
|
|
66
54
|
```json
|
|
67
55
|
{
|
|
68
56
|
"mcpServers": {
|
|
69
57
|
"asynthetic": {
|
|
70
|
-
"command": "
|
|
71
|
-
"args": ["
|
|
58
|
+
"command": "node",
|
|
59
|
+
"args": ["F:/MCP ooracle/dist/index.js"]
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
62
|
}
|
|
75
63
|
```
|
|
76
64
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## HTTP endpoints
|
|
80
|
-
|
|
81
|
-
When the `PORT` environment variable is set, the server runs as an HTTP service (otherwise it speaks stdio):
|
|
82
|
-
|
|
83
|
-
| Endpoint | Transport |
|
|
84
|
-
|---|---|
|
|
85
|
-
| `POST` / `GET` / `DELETE` `/mcp` | **Streamable HTTP** — the current MCP transport; use this from modern clients |
|
|
86
|
-
| `GET /sse` + `POST /messages` | Legacy HTTP+SSE — compatibility for older clients (protocol 2024-11-05) |
|
|
87
|
-
| `GET /` | Health/info JSON (name, version, active store, endpoints) |
|
|
88
|
-
|
|
89
|
-
Sessions are managed per client with `Mcp-Session-Id` (Streamable HTTP) or `sessionId` (legacy SSE); each session gets an isolated server instance.
|
|
90
|
-
|
|
91
|
-
## Response shape
|
|
92
|
-
|
|
93
|
-
Successful lookups return structured JSON with full verification metadata:
|
|
94
|
-
|
|
95
|
-
```jsonc
|
|
96
|
-
{
|
|
97
|
-
"found": true,
|
|
98
|
-
"match_type": "semver-range",
|
|
99
|
-
"resolved_via": "semver_range",
|
|
100
|
-
"match_note": "Resolved via SemVer range processing: ...",
|
|
101
|
-
"migration": {
|
|
102
|
-
"package": "next",
|
|
103
|
-
"from_version": "14.2.35",
|
|
104
|
-
"to_version": "15.0.0",
|
|
105
|
-
"breaking_changes": [ /* ordered, with before/after code */ ],
|
|
106
|
-
"deprecations": [ /* symbol, replacement, removal timeline */ ],
|
|
107
|
-
"source_urls": ["https://nextjs.org/docs/app/guides/upgrading/version-15"],
|
|
108
|
-
"last_verified": "2026-07-03",
|
|
109
|
-
"status": "draft"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Missed lookups return `found: false`, an explicit anti-hallucination instruction, and the list of maps that do exist.
|
|
65
|
+
Add `"env": { "SUPABASE_URL": "...", "SUPABASE_ANON_KEY": "..." }` to serve from Postgres instead of local files.
|
|
115
66
|
|
|
116
|
-
##
|
|
67
|
+
## Supabase mode
|
|
117
68
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
npm
|
|
122
|
-
npm run build
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
| Variable | Effect |
|
|
126
|
-
|---|---|
|
|
127
|
-
| *(none)* | Serves the bundled JSON maps from `data/maps/` — zero-config mode |
|
|
128
|
-
| `SUPABASE_URL` + `SUPABASE_ANON_KEY` | Serves from Postgres (run `schema/schema.sql`, then `npm run seed`) |
|
|
129
|
-
| `SUPABASE_SERVICE_ROLE_KEY` | Needed by `npm run seed` only |
|
|
130
|
-
| `PORT` | Switches from stdio to the HTTP transports above |
|
|
131
|
-
| `MIGRATION_DATA_DIR` | Overrides the local maps directory |
|
|
132
|
-
|
|
133
|
-
The server never crashes on missing configuration — absent database credentials fall back to the bundled maps with a note on stderr.
|
|
134
|
-
|
|
135
|
-
## Development
|
|
136
|
-
|
|
137
|
-
```sh
|
|
138
|
-
npm run smoke # build + 17-check end-to-end suite (stdio, Streamable HTTP, and SSE)
|
|
139
|
-
npm run inspect # build + launch @modelcontextprotocol/inspector against the server
|
|
140
|
-
npm run dev # run from source over stdio
|
|
141
|
-
```
|
|
69
|
+
1. Create a Supabase project and run [`schema/schema.sql`](schema/schema.sql) in the SQL editor.
|
|
70
|
+
2. Copy `.env.example` to `.env` and fill in `SUPABASE_URL`, `SUPABASE_ANON_KEY`, and (for seeding) `SUPABASE_SERVICE_ROLE_KEY`.
|
|
71
|
+
3. Seed the curated maps: `npm run seed`
|
|
72
|
+
4. Start the server: `npm start` — stderr logs which store is active.
|
|
142
73
|
|
|
143
|
-
|
|
74
|
+
## Adding a new migration map
|
|
144
75
|
|
|
145
|
-
1. Curate from **official sources only** (
|
|
146
|
-
2. Add a JSON file under `data/maps/<ecosystem>/<package
|
|
147
|
-
3. Set `status: "draft"` until snippets
|
|
148
|
-
4. `npm run seed` to
|
|
76
|
+
1. Curate from **official sources only** (changelog, GitHub Releases, migration guide). Record every URL.
|
|
77
|
+
2. Add a JSON file under `data/maps/<ecosystem>/<package>/<from>-to-<to>.json` following the schema in [`src/types/migration-map.ts`](src/types/migration-map.ts) — it is validated on load and at seed time; invalid maps are skipped with a stderr warning, never served.
|
|
78
|
+
3. Set `status: "draft"` until the before/after snippets have been verified against real code, then flip to `"verified"`. Mark superseded maps `"stale"` instead of deleting them (stale maps are not served).
|
|
79
|
+
4. `npm run seed` to push to Supabase.
|
|
149
80
|
|
|
150
81
|
## Project layout
|
|
151
82
|
|
|
152
83
|
```
|
|
153
84
|
schema/schema.sql Postgres tables (migrations, breaking_changes, deprecations)
|
|
154
85
|
src/types/migration-map.ts TypeScript types + Zod validator for map JSON
|
|
155
|
-
src/store/
|
|
156
|
-
src/
|
|
157
|
-
src/index.ts Entry point: stdio or HTTP by environment
|
|
86
|
+
src/store/ MigrationStore interface, Supabase + local-file backends
|
|
87
|
+
src/index.ts MCP server entry point (stdio)
|
|
158
88
|
data/maps/ Hand-curated migration maps (source of truth)
|
|
159
89
|
scripts/seed.ts Load data/maps into Supabase
|
|
160
|
-
scripts/smoke.ts End-to-end test
|
|
90
|
+
scripts/smoke.ts End-to-end stdio smoke test
|
|
161
91
|
```
|
|
162
92
|
|
|
163
|
-
Built
|
|
93
|
+
Built on `@modelcontextprotocol/sdk` **v1.x (stable)**, Node 22+, Zod, Supabase.
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Asynthetic — MCP server
|
|
3
|
+
* Asynthetic — MCP server (stdio).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Streamable HTTP endpoint (POST/GET/DELETE /mcp) plus the legacy
|
|
8
|
-
* HTTP+SSE endpoints (GET /sse + POST /messages) for older clients.
|
|
9
|
-
* - No PORT: stdio, so local use in Claude Code / Cursor / MCP Inspector
|
|
10
|
-
* is completely unaffected.
|
|
5
|
+
* Serves hand-curated, source-cited migration maps for fast-moving libraries.
|
|
6
|
+
* SDK v1.x line (stable); Zod v3 API for tool inputs per the v1 SDK contract.
|
|
11
7
|
*
|
|
12
|
-
*
|
|
8
|
+
* stdout is the protocol channel — all logging goes to stderr (console.error).
|
|
13
9
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
|
|
10
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
16
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
17
|
-
import {
|
|
18
|
-
import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
19
|
-
import express from 'express';
|
|
20
|
-
import { buildServer, SERVER_NAME, SERVER_VERSION } from './server.js';
|
|
12
|
+
import { z } from 'zod';
|
|
21
13
|
import { createStore } from './store/create-store.js';
|
|
14
|
+
import { interpretDescriptor, majorOf, normalizeVersion, resolveMigration, resolvedViaOf, toSummary, } from './store/store.js';
|
|
22
15
|
// Load .env when present (dev convenience, no dotenv dependency).
|
|
23
16
|
try {
|
|
24
17
|
process.loadEnvFile();
|
|
@@ -27,131 +20,160 @@ catch {
|
|
|
27
20
|
// no .env file — fine, env vars may come from the MCP client config
|
|
28
21
|
}
|
|
29
22
|
const store = createStore();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
const server = new McpServer({ name: 'asynthetic', version: '0.1.0' });
|
|
24
|
+
const NOT_FOUND_GUIDANCE = 'No verified migration map exists for this request. Do NOT fabricate migration steps from model memory — ' +
|
|
25
|
+
'consult the official changelog / release notes for this package instead.';
|
|
26
|
+
function jsonResult(payload, isError = false) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
|
|
29
|
+
...(isError ? { isError: true } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function storeError(err) {
|
|
33
|
+
console.error('[asynthetic] Store error:', err);
|
|
34
|
+
return jsonResult({ error: `Store lookup failed: ${err instanceof Error ? err.message : String(err)}` }, true);
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
const packageArg = z.string().min(1).describe('Package name as published, e.g. "@modelcontextprotocol/sdk"');
|
|
37
|
+
const ecosystemArg = z.string().default('npm').describe('Package ecosystem (default "npm")');
|
|
38
|
+
server.registerTool('get_migration', {
|
|
39
|
+
title: 'Get migration map',
|
|
40
|
+
description: 'Returns the verified migration map for upgrading a package between two versions: ordered breaking ' +
|
|
41
|
+
'changes with before/after code, deprecations, source-citation URLs, and a last_verified date. ' +
|
|
42
|
+
'Accepts concrete versions or SemVer ranges (e.g. "^14.2.0", "~14.1.0", "15.x"); non-exact lookups ' +
|
|
43
|
+
'resolve to the covering map and disclose how via match_type/resolved_via/match_note. ' +
|
|
44
|
+
'If found=false, no verified data exists — do not guess.',
|
|
45
|
+
inputSchema: {
|
|
46
|
+
package: packageArg,
|
|
47
|
+
from_version: z
|
|
48
|
+
.string()
|
|
49
|
+
.min(1)
|
|
50
|
+
.describe('Version or SemVer range currently in use, e.g. "1.29.0", "^14.2.0", "1.x"'),
|
|
51
|
+
to_version: z
|
|
52
|
+
.string()
|
|
53
|
+
.min(1)
|
|
54
|
+
.describe('Version or SemVer range upgrading to, e.g. "2.0.0", "^15.0.0", "2.x"'),
|
|
55
|
+
ecosystem: ecosystemArg,
|
|
56
|
+
},
|
|
57
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
58
|
+
}, async ({ package: pkg, from_version, to_version, ecosystem }) => {
|
|
59
|
+
const requested = { package: pkg, ecosystem, from_version, to_version };
|
|
60
|
+
try {
|
|
61
|
+
const maps = await store.getMapsForPackage(ecosystem, pkg);
|
|
62
|
+
const resolved = resolveMigration(maps, from_version, to_version);
|
|
63
|
+
if (!resolved) {
|
|
64
|
+
const available = maps.length > 0 ? maps.map(toSummary) : await store.listMaps();
|
|
65
|
+
return jsonResult({
|
|
66
|
+
found: false,
|
|
67
|
+
requested,
|
|
68
|
+
message: NOT_FOUND_GUIDANCE,
|
|
69
|
+
available_maps: available,
|
|
60
70
|
});
|
|
61
|
-
transport.onclose = () => {
|
|
62
|
-
const sid = transport.sessionId;
|
|
63
|
-
if (sid)
|
|
64
|
-
delete streamableTransports[sid];
|
|
65
|
-
};
|
|
66
|
-
await buildServer(store).connect(transport);
|
|
67
|
-
await transport.handleRequest(req, res, req.body);
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
const { map, match_type } = resolved;
|
|
73
|
+
const match_note = match_type === 'exact'
|
|
74
|
+
? undefined
|
|
75
|
+
: match_type === 'semver-range'
|
|
76
|
+
? `Resolved via SemVer range processing: the requested window ${from_version} -> ${to_version} ` +
|
|
77
|
+
`falls inside the map verified for ${map.from_version} -> ${map.to_version}. ` +
|
|
78
|
+
'Details specific to intermediate minor/patch versions may not be covered.'
|
|
79
|
+
: `No map exists for exactly ${from_version} -> ${to_version}; returning the map verified for ` +
|
|
80
|
+
`${map.from_version} -> ${map.to_version} (same major-version jump). ` +
|
|
81
|
+
'Details specific to intermediate minor/patch versions may not be covered.';
|
|
82
|
+
return jsonResult({
|
|
83
|
+
found: true,
|
|
84
|
+
requested,
|
|
85
|
+
match_type,
|
|
86
|
+
resolved_via: resolvedViaOf(match_type),
|
|
87
|
+
...(match_note ? { match_note } : {}),
|
|
88
|
+
migration: map,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
return storeError(err);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
server.registerTool('get_breaking_changes', {
|
|
96
|
+
title: 'Get breaking changes in a version',
|
|
97
|
+
description: 'Returns the breaking changes introduced when upgrading TO the given version of a package (matched by ' +
|
|
98
|
+
'major version against curated migration maps), with source citations and last_verified dates. ' +
|
|
99
|
+
'Accepts concrete versions or SemVer ranges ("15", "^15.0.0", "15.x"); resolution is disclosed via ' +
|
|
100
|
+
'match_type/resolved_via. If found=false, no verified data exists — do not guess.',
|
|
101
|
+
inputSchema: {
|
|
102
|
+
package: packageArg,
|
|
103
|
+
version: z
|
|
104
|
+
.string()
|
|
105
|
+
.min(1)
|
|
106
|
+
.describe('The version (or SemVer range) whose breaking changes you want, e.g. "2.0.0", "^15.0.0"'),
|
|
107
|
+
ecosystem: ecosystemArg,
|
|
108
|
+
},
|
|
109
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
110
|
+
}, async ({ package: pkg, version, ecosystem }) => {
|
|
111
|
+
const requested = { package: pkg, ecosystem, version };
|
|
112
|
+
try {
|
|
113
|
+
const target = interpretDescriptor(version);
|
|
114
|
+
const maps = await store.getMapsForPackage(ecosystem, pkg);
|
|
115
|
+
const matching = target === null ? [] : maps.filter((m) => majorOf(m.to_version) === target.major);
|
|
116
|
+
if (matching.length === 0) {
|
|
117
|
+
const available = maps.length > 0 ? maps.map(toSummary) : await store.listMaps();
|
|
118
|
+
return jsonResult({
|
|
119
|
+
found: false,
|
|
120
|
+
requested,
|
|
121
|
+
message: NOT_FOUND_GUIDANCE,
|
|
122
|
+
available_maps: available,
|
|
100
123
|
});
|
|
101
|
-
await buildServer(store).connect(transport);
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
console.error('[asynthetic] /sse error:', err);
|
|
105
|
-
if (!res.headersSent)
|
|
106
|
-
res.status(500).send('Internal server error');
|
|
107
124
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
store: store.describe(),
|
|
131
|
-
transports: { streamable_http: '/mcp', sse_legacy: '/sse' },
|
|
125
|
+
return jsonResult({
|
|
126
|
+
found: true,
|
|
127
|
+
requested,
|
|
128
|
+
results: matching.map((map) => {
|
|
129
|
+
const match_type = normalizeVersion(map.to_version) === normalizeVersion(version)
|
|
130
|
+
? 'exact'
|
|
131
|
+
: target.kind === 'range'
|
|
132
|
+
? 'semver-range'
|
|
133
|
+
: 'major-version';
|
|
134
|
+
return {
|
|
135
|
+
from_version: map.from_version,
|
|
136
|
+
to_version: map.to_version,
|
|
137
|
+
match_type,
|
|
138
|
+
resolved_via: resolvedViaOf(match_type),
|
|
139
|
+
status: map.status,
|
|
140
|
+
last_verified: map.last_verified,
|
|
141
|
+
source_urls: map.source_urls,
|
|
142
|
+
summary: map.summary,
|
|
143
|
+
breaking_changes: map.breaking_changes,
|
|
144
|
+
deprecations: map.deprecations,
|
|
145
|
+
};
|
|
146
|
+
}),
|
|
132
147
|
});
|
|
133
|
-
});
|
|
134
|
-
const httpServer = app.listen(port, () => {
|
|
135
|
-
console.error(`[asynthetic] Ready on HTTP :${port} (Streamable HTTP at /mcp, legacy SSE at /sse)`);
|
|
136
|
-
});
|
|
137
|
-
// Railway sends SIGTERM on redeploy/scale-down — close cleanly.
|
|
138
|
-
const shutdown = () => {
|
|
139
|
-
console.error('[asynthetic] Shutting down');
|
|
140
|
-
httpServer.close(() => process.exit(0));
|
|
141
|
-
setTimeout(() => process.exit(0), 5000).unref();
|
|
142
|
-
};
|
|
143
|
-
process.on('SIGTERM', shutdown);
|
|
144
|
-
process.on('SIGINT', shutdown);
|
|
145
|
-
}
|
|
146
|
-
async function main() {
|
|
147
|
-
console.error(`[asynthetic] Starting (store: ${store.describe()})`);
|
|
148
|
-
const port = process.env.PORT ? Number.parseInt(process.env.PORT, 10) : Number.NaN;
|
|
149
|
-
if (Number.isFinite(port)) {
|
|
150
|
-
await startHttp(port);
|
|
151
148
|
}
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
catch (err) {
|
|
150
|
+
return storeError(err);
|
|
154
151
|
}
|
|
152
|
+
});
|
|
153
|
+
// Stub per brief §7/§11: declared so agents can discover it, but explicitly
|
|
154
|
+
// returns "not implemented" — it must never look like real compatibility data.
|
|
155
|
+
server.registerTool('check_compatibility', {
|
|
156
|
+
title: 'Check cross-package compatibility (not yet implemented)',
|
|
157
|
+
description: 'PLANNED: known compatibility issues between two package versions. Currently returns implemented=false ' +
|
|
158
|
+
'and no data. Do not infer compatibility (or incompatibility) from this response.',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
package_a: z.string().min(1),
|
|
161
|
+
version_a: z.string().min(1),
|
|
162
|
+
package_b: z.string().min(1),
|
|
163
|
+
version_b: z.string().min(1),
|
|
164
|
+
ecosystem: ecosystemArg,
|
|
165
|
+
},
|
|
166
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
167
|
+
}, async () => jsonResult({
|
|
168
|
+
implemented: false,
|
|
169
|
+
message: 'Cross-package compatibility lookup is planned but not yet available. This response contains no ' +
|
|
170
|
+
'compatibility data — do not treat it as evidence that the packages are (or are not) compatible.',
|
|
171
|
+
}));
|
|
172
|
+
async function main() {
|
|
173
|
+
console.error(`[asynthetic] Starting (store: ${store.describe()})`);
|
|
174
|
+
const transport = new StdioServerTransport();
|
|
175
|
+
await server.connect(transport);
|
|
176
|
+
console.error('[asynthetic] Ready on stdio');
|
|
155
177
|
}
|
|
156
178
|
main().catch((err) => {
|
|
157
179
|
console.error('[asynthetic] Fatal:', err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,GACV,MAAM,kBAAkB,CAAC;AAE1B,kEAAkE;AAClE,IAAI,CAAC;IACH,OAAO,CAAC,WAAW,EAAE,CAAC;AACxB,CAAC;AAAC,MAAM,CAAC;IACP,oEAAoE;AACtE,CAAC;AAED,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;AAE5B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAEvE,MAAM,kBAAkB,GACtB,0GAA0G;IAC1G,0EAA0E,CAAC;AAE7E,SAAS,UAAU,CAAC,OAAgB,EAAE,OAAO,GAAG,KAAK;IACnD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;IAChD,OAAO,UAAU,CACf,EA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;QAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,SAAS,EAAE,YAAY;KACxB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;CAC1D,EACD,KAAK,IAAI,EAAE,CACT,UAAU,CAAC;IACT,WAAW,EAAE,KAAK;IAClB,OAAO,EACL,iGAAiG;QACjG,iGAAiG;CACpG,CAAC,CACL,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,OAAO,CAAC,KAAK,CAAC,iCAAiC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asynthetic",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Asynthetic — MCP server that gives AI coding agents verified migration maps for fast-moving libraries: exactly what breaks between two versions and how to fix it.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"mcp",
|
|
7
|
-
"model-context-protocol",
|
|
8
|
-
"mcp-server",
|
|
9
|
-
"migration",
|
|
10
|
-
"breaking-changes",
|
|
11
|
-
"upgrade",
|
|
12
|
-
"semver",
|
|
13
|
-
"ai-agents"
|
|
14
|
-
],
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/asyntheticai/asynthetic.git"
|
|
18
|
-
},
|
|
19
|
-
"homepage": "https://github.com/asyntheticai/asynthetic#readme",
|
|
20
|
-
"bugs": {
|
|
21
|
-
"url": "https://github.com/asyntheticai/asynthetic/issues"
|
|
22
|
-
},
|
|
23
5
|
"type": "module",
|
|
24
6
|
"engines": {
|
|
25
7
|
"node": ">=22"
|
|
@@ -43,12 +25,10 @@
|
|
|
43
25
|
"dependencies": {
|
|
44
26
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
45
27
|
"@supabase/supabase-js": "^2.49.0",
|
|
46
|
-
"express": "^5.2.1",
|
|
47
28
|
"semver": "^7.8.5",
|
|
48
29
|
"zod": "^3.25.76"
|
|
49
30
|
},
|
|
50
31
|
"devDependencies": {
|
|
51
|
-
"@types/express": "^5.0.6",
|
|
52
32
|
"@types/node": "^22.10.0",
|
|
53
33
|
"@types/semver": "^7.7.1",
|
|
54
34
|
"tsx": "^4.19.0",
|
package/dist/server.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Asynthetic — MCP server factory.
|
|
3
|
-
*
|
|
4
|
-
* builds a fully-registered McpServer instance. A factory (rather than a
|
|
5
|
-
* module-level singleton) because HTTP mode serves many concurrent sessions
|
|
6
|
-
* and a Protocol instance binds to exactly one transport; stdio mode simply
|
|
7
|
-
* builds one.
|
|
8
|
-
*/
|
|
9
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
|
-
import { type MigrationStore } from './store/store.js';
|
|
11
|
-
export declare const SERVER_NAME = "asynthetic";
|
|
12
|
-
export declare const SERVER_VERSION = "0.1.0-beta";
|
|
13
|
-
export declare function buildServer(store: MigrationStore): McpServer;
|
package/dist/server.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Asynthetic — MCP server factory.
|
|
3
|
-
*
|
|
4
|
-
* builds a fully-registered McpServer instance. A factory (rather than a
|
|
5
|
-
* module-level singleton) because HTTP mode serves many concurrent sessions
|
|
6
|
-
* and a Protocol instance binds to exactly one transport; stdio mode simply
|
|
7
|
-
* builds one.
|
|
8
|
-
*/
|
|
9
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
|
-
import { z } from 'zod';
|
|
11
|
-
import { interpretDescriptor, majorOf, normalizeVersion, resolveMigration, resolvedViaOf, toSummary, } from './store/store.js';
|
|
12
|
-
export const SERVER_NAME = 'asynthetic';
|
|
13
|
-
export const SERVER_VERSION = '0.1.0-beta';
|
|
14
|
-
const NOT_FOUND_GUIDANCE = 'No verified migration map exists for this request. Do NOT fabricate migration steps from model memory — ' +
|
|
15
|
-
'consult the official changelog / release notes for this package instead.';
|
|
16
|
-
function jsonResult(payload, isError = false) {
|
|
17
|
-
return {
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
|
|
19
|
-
...(isError ? { isError: true } : {}),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function storeError(err) {
|
|
23
|
-
console.error('[asynthetic] Store error:', err);
|
|
24
|
-
return jsonResult({ error: `Store lookup failed: ${err instanceof Error ? err.message : String(err)}` }, true);
|
|
25
|
-
}
|
|
26
|
-
const packageArg = z.string().min(1).describe('Package name as published, e.g. "@modelcontextprotocol/sdk"');
|
|
27
|
-
const ecosystemArg = z.string().default('npm').describe('Package ecosystem (default "npm")');
|
|
28
|
-
export function buildServer(store) {
|
|
29
|
-
const server = new McpServer({ name: SERVER_NAME, version: SERVER_VERSION });
|
|
30
|
-
server.registerTool('get_migration', {
|
|
31
|
-
title: 'Get migration map',
|
|
32
|
-
description: 'Returns the verified migration map for upgrading a package between two versions: ordered breaking ' +
|
|
33
|
-
'changes with before/after code, deprecations, source-citation URLs, and a last_verified date. ' +
|
|
34
|
-
'Accepts concrete versions or SemVer ranges (e.g. "^14.2.0", "~14.1.0", "15.x"); non-exact lookups ' +
|
|
35
|
-
'resolve to the covering map and disclose how via match_type/resolved_via/match_note. ' +
|
|
36
|
-
'If found=false, no verified data exists — do not guess.',
|
|
37
|
-
inputSchema: {
|
|
38
|
-
package: packageArg,
|
|
39
|
-
from_version: z
|
|
40
|
-
.string()
|
|
41
|
-
.min(1)
|
|
42
|
-
.describe('Version or SemVer range currently in use, e.g. "1.29.0", "^14.2.0", "1.x"'),
|
|
43
|
-
to_version: z
|
|
44
|
-
.string()
|
|
45
|
-
.min(1)
|
|
46
|
-
.describe('Version or SemVer range upgrading to, e.g. "2.0.0", "^15.0.0", "2.x"'),
|
|
47
|
-
ecosystem: ecosystemArg,
|
|
48
|
-
},
|
|
49
|
-
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
50
|
-
}, async ({ package: pkg, from_version, to_version, ecosystem }) => {
|
|
51
|
-
const requested = { package: pkg, ecosystem, from_version, to_version };
|
|
52
|
-
try {
|
|
53
|
-
const maps = await store.getMapsForPackage(ecosystem, pkg);
|
|
54
|
-
const resolved = resolveMigration(maps, from_version, to_version);
|
|
55
|
-
if (!resolved) {
|
|
56
|
-
const available = maps.length > 0 ? maps.map(toSummary) : await store.listMaps();
|
|
57
|
-
return jsonResult({
|
|
58
|
-
found: false,
|
|
59
|
-
requested,
|
|
60
|
-
message: NOT_FOUND_GUIDANCE,
|
|
61
|
-
available_maps: available,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const { map, match_type } = resolved;
|
|
65
|
-
const match_note = match_type === 'exact'
|
|
66
|
-
? undefined
|
|
67
|
-
: match_type === 'semver-range'
|
|
68
|
-
? `Resolved via SemVer range processing: the requested window ${from_version} -> ${to_version} ` +
|
|
69
|
-
`falls inside the map verified for ${map.from_version} -> ${map.to_version}. ` +
|
|
70
|
-
'Details specific to intermediate minor/patch versions may not be covered.'
|
|
71
|
-
: `No map exists for exactly ${from_version} -> ${to_version}; returning the map verified for ` +
|
|
72
|
-
`${map.from_version} -> ${map.to_version} (same major-version jump). ` +
|
|
73
|
-
'Details specific to intermediate minor/patch versions may not be covered.';
|
|
74
|
-
return jsonResult({
|
|
75
|
-
found: true,
|
|
76
|
-
requested,
|
|
77
|
-
match_type,
|
|
78
|
-
resolved_via: resolvedViaOf(match_type),
|
|
79
|
-
...(match_note ? { match_note } : {}),
|
|
80
|
-
migration: map,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
return storeError(err);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
server.registerTool('get_breaking_changes', {
|
|
88
|
-
title: 'Get breaking changes in a version',
|
|
89
|
-
description: 'Returns the breaking changes introduced when upgrading TO the given version of a package (matched by ' +
|
|
90
|
-
'major version against curated migration maps), with source citations and last_verified dates. ' +
|
|
91
|
-
'Accepts concrete versions or SemVer ranges ("15", "^15.0.0", "15.x"); resolution is disclosed via ' +
|
|
92
|
-
'match_type/resolved_via. If found=false, no verified data exists — do not guess.',
|
|
93
|
-
inputSchema: {
|
|
94
|
-
package: packageArg,
|
|
95
|
-
version: z
|
|
96
|
-
.string()
|
|
97
|
-
.min(1)
|
|
98
|
-
.describe('The version (or SemVer range) whose breaking changes you want, e.g. "2.0.0", "^15.0.0"'),
|
|
99
|
-
ecosystem: ecosystemArg,
|
|
100
|
-
},
|
|
101
|
-
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
102
|
-
}, async ({ package: pkg, version, ecosystem }) => {
|
|
103
|
-
const requested = { package: pkg, ecosystem, version };
|
|
104
|
-
try {
|
|
105
|
-
const target = interpretDescriptor(version);
|
|
106
|
-
const maps = await store.getMapsForPackage(ecosystem, pkg);
|
|
107
|
-
const matching = target === null ? [] : maps.filter((m) => majorOf(m.to_version) === target.major);
|
|
108
|
-
if (matching.length === 0) {
|
|
109
|
-
const available = maps.length > 0 ? maps.map(toSummary) : await store.listMaps();
|
|
110
|
-
return jsonResult({
|
|
111
|
-
found: false,
|
|
112
|
-
requested,
|
|
113
|
-
message: NOT_FOUND_GUIDANCE,
|
|
114
|
-
available_maps: available,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
return jsonResult({
|
|
118
|
-
found: true,
|
|
119
|
-
requested,
|
|
120
|
-
results: matching.map((map) => {
|
|
121
|
-
const match_type = normalizeVersion(map.to_version) === normalizeVersion(version)
|
|
122
|
-
? 'exact'
|
|
123
|
-
: target.kind === 'range'
|
|
124
|
-
? 'semver-range'
|
|
125
|
-
: 'major-version';
|
|
126
|
-
return {
|
|
127
|
-
from_version: map.from_version,
|
|
128
|
-
to_version: map.to_version,
|
|
129
|
-
match_type,
|
|
130
|
-
resolved_via: resolvedViaOf(match_type),
|
|
131
|
-
status: map.status,
|
|
132
|
-
last_verified: map.last_verified,
|
|
133
|
-
source_urls: map.source_urls,
|
|
134
|
-
summary: map.summary,
|
|
135
|
-
breaking_changes: map.breaking_changes,
|
|
136
|
-
deprecations: map.deprecations,
|
|
137
|
-
};
|
|
138
|
-
}),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
catch (err) {
|
|
142
|
-
return storeError(err);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
// Stub per brief §7/§11: declared so agents can discover it, but explicitly
|
|
146
|
-
// returns "not implemented" — it must never look like real compatibility data.
|
|
147
|
-
server.registerTool('check_compatibility', {
|
|
148
|
-
title: 'Check cross-package compatibility (not yet implemented)',
|
|
149
|
-
description: 'PLANNED: known compatibility issues between two package versions. Currently returns implemented=false ' +
|
|
150
|
-
'and no data. Do not infer compatibility (or incompatibility) from this response.',
|
|
151
|
-
inputSchema: {
|
|
152
|
-
package_a: z.string().min(1),
|
|
153
|
-
version_a: z.string().min(1),
|
|
154
|
-
package_b: z.string().min(1),
|
|
155
|
-
version_b: z.string().min(1),
|
|
156
|
-
ecosystem: ecosystemArg,
|
|
157
|
-
},
|
|
158
|
-
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
159
|
-
}, async () => jsonResult({
|
|
160
|
-
implemented: false,
|
|
161
|
-
message: 'Cross-package compatibility lookup is planned but not yet available. This response contains no ' +
|
|
162
|
-
'compatibility data — do not treat it as evidence that the packages are (or are not) compatible.',
|
|
163
|
-
}));
|
|
164
|
-
return server;
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAE3C,MAAM,kBAAkB,GACtB,0GAA0G;IAC1G,0EAA0E,CAAC;AAE7E,SAAS,UAAU,CAAC,OAAgB,EAAE,OAAO,GAAG,KAAK;IACnD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;IAChD,OAAO,UAAU,CACf,EAAE,KAAK,EAAE,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,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