@vielzeug/codex 1.0.2
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 +142 -0
- package/data/.cache.json +33 -0
- package/data/llms-full.txt +43590 -0
- package/data/llms.txt +117 -0
- package/data/vielzeug-data.json +14554 -0
- package/dist/__tests__/server.test.js +346 -0
- package/dist/__tests__/server.test.js.map +1 -0
- package/dist/__tests__/unit.test.js +502 -0
- package/dist/__tests__/unit.test.js.map +1 -0
- package/dist/_log.js +5 -0
- package/dist/_log.js.map +1 -0
- package/dist/cli.js +94 -0
- package/dist/cli.js.map +1 -0
- package/dist/data.js +91 -0
- package/dist/data.js.map +1 -0
- package/dist/errors.js +26 -0
- package/dist/errors.js.map +1 -0
- package/dist/frontmatter.js +72 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/generator.js +176 -0
- package/dist/generator.js.map +1 -0
- package/dist/http.js +108 -0
- package/dist/http.js.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/llms.js +162 -0
- package/dist/llms.js.map +1 -0
- package/dist/port.js +12 -0
- package/dist/port.js.map +1 -0
- package/dist/resources.js +4 -0
- package/dist/resources.js.map +1 -0
- package/dist/search.js +125 -0
- package/dist/search.js.map +1 -0
- package/dist/server.js +13 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/index.js +62 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/packages.js +196 -0
- package/dist/tools/packages.js.map +1 -0
- package/dist/tools/refine.js +329 -0
- package/dist/tools/refine.js.map +1 -0
- package/dist/tools/schema.js +37 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/tools/shared.js +27 -0
- package/dist/tools/shared.js.map +1 -0
- package/dist/tools.js +1040 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +47 -0
package/dist/llms.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Markup stripping
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export function stripDocMarkup(md) {
|
|
5
|
+
return md
|
|
6
|
+
.replace(/^---\n[\s\S]*?\n---\n?/, '') // frontmatter
|
|
7
|
+
.replace(/<!--[\s\S]*?-->/g, '') // HTML comments
|
|
8
|
+
.replace(/<[^>]+>/g, '') // HTML tags
|
|
9
|
+
.replace(/^\[\[toc]]\s*$/gm, '') // VitePress TOC directive
|
|
10
|
+
.replace(/^:::[\s\S]*?:::\s*$/gm, (m) => m.replace(/^:::[^\n]*\n?|^:::\s*$/gm, '')) // containers
|
|
11
|
+
.replace(/\n{3,}/g, '\n\n') // normalise consecutive blank lines
|
|
12
|
+
.trim();
|
|
13
|
+
}
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Category ordering
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
const CATEGORY_ORDER = [
|
|
18
|
+
'state',
|
|
19
|
+
'ui',
|
|
20
|
+
'ui-components',
|
|
21
|
+
'ui-primitives',
|
|
22
|
+
'ui-interaction',
|
|
23
|
+
'ui-performance',
|
|
24
|
+
'forms',
|
|
25
|
+
'data',
|
|
26
|
+
'http',
|
|
27
|
+
'websockets',
|
|
28
|
+
'events',
|
|
29
|
+
'workers',
|
|
30
|
+
'storage',
|
|
31
|
+
'auth',
|
|
32
|
+
'routing',
|
|
33
|
+
'i18n',
|
|
34
|
+
'di',
|
|
35
|
+
'validation',
|
|
36
|
+
'utilities',
|
|
37
|
+
'time',
|
|
38
|
+
'logging',
|
|
39
|
+
'ai-tooling',
|
|
40
|
+
];
|
|
41
|
+
function groupByCategory(packages) {
|
|
42
|
+
const map = new Map();
|
|
43
|
+
for (const pkg of packages) {
|
|
44
|
+
const cat = pkg.category || 'general';
|
|
45
|
+
if (!map.has(cat))
|
|
46
|
+
map.set(cat, []);
|
|
47
|
+
map.get(cat).push(pkg);
|
|
48
|
+
}
|
|
49
|
+
return map;
|
|
50
|
+
}
|
|
51
|
+
function sortedCategories(grouped) {
|
|
52
|
+
return [...grouped.keys()].sort((a, b) => {
|
|
53
|
+
const ai = CATEGORY_ORDER.indexOf(a);
|
|
54
|
+
const bi = CATEGORY_ORDER.indexOf(b);
|
|
55
|
+
if (ai !== -1 && bi !== -1)
|
|
56
|
+
return ai - bi;
|
|
57
|
+
if (ai !== -1)
|
|
58
|
+
return -1;
|
|
59
|
+
if (bi !== -1)
|
|
60
|
+
return 1;
|
|
61
|
+
return a.localeCompare(b);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// llms.txt — summary file
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
function buildLlmsTxt(packages, version) {
|
|
68
|
+
const grouped = groupByCategory(packages);
|
|
69
|
+
const categories = sortedCategories(grouped);
|
|
70
|
+
const lines = [
|
|
71
|
+
'# Vielzeug',
|
|
72
|
+
'',
|
|
73
|
+
`> ${packages.length} focused TypeScript packages for state, UI, data, storage, routing, utilities, and AI tooling. Version: ${version}`,
|
|
74
|
+
'',
|
|
75
|
+
'Vielzeug is a monorepo of focused TypeScript packages — from low-level utilities to UI primitives,',
|
|
76
|
+
'routing, storage, validation, workers, and an MCP server for AI assistants. Packages are designed',
|
|
77
|
+
'to be independently consumable, ship ESM + CJS output, and target ES2022.',
|
|
78
|
+
'',
|
|
79
|
+
'Install any package independently: `pnpm add @vielzeug/<name>`',
|
|
80
|
+
'',
|
|
81
|
+
'**MCP (AI agents):** `npx -y @vielzeug/codex` runs the Vielzeug MCP server in standalone stdio mode',
|
|
82
|
+
'with bundled data — no monorepo checkout required. Use `npx -y @vielzeug/codex --port 3100`',
|
|
83
|
+
'for Streamable HTTP with package discovery, docs lookup, source inspection, and Sigil component metadata.',
|
|
84
|
+
'',
|
|
85
|
+
'## Packages',
|
|
86
|
+
'',
|
|
87
|
+
];
|
|
88
|
+
for (const cat of categories) {
|
|
89
|
+
const pkgs = grouped.get(cat);
|
|
90
|
+
lines.push(`### ${cat}`);
|
|
91
|
+
lines.push('');
|
|
92
|
+
for (const pkg of pkgs) {
|
|
93
|
+
const pageLinks = pkg.availableDocPages
|
|
94
|
+
.filter((p) => p !== 'index')
|
|
95
|
+
.map((p) => `[${p}](/${pkg.slug}/${p})`)
|
|
96
|
+
.join(' · ');
|
|
97
|
+
let line = `- [${pkg.name}](/${pkg.slug}/): ${pkg.description}`;
|
|
98
|
+
if (pageLinks)
|
|
99
|
+
line += ` → ${pageLinks}`;
|
|
100
|
+
lines.push(line);
|
|
101
|
+
}
|
|
102
|
+
lines.push('');
|
|
103
|
+
}
|
|
104
|
+
return lines.join('\n').trimEnd() + '\n';
|
|
105
|
+
}
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// llms-full.txt — complete documentation
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
const PAGE_LABELS = {
|
|
110
|
+
api: 'API Reference',
|
|
111
|
+
examples: 'Examples',
|
|
112
|
+
index: 'Overview',
|
|
113
|
+
usage: 'Usage Guide',
|
|
114
|
+
};
|
|
115
|
+
const PAGE_ORDER = ['index', 'api', 'usage', 'examples'];
|
|
116
|
+
function buildLlmsFullTxt(packages, version) {
|
|
117
|
+
const lines = [
|
|
118
|
+
'# Vielzeug — Full Documentation',
|
|
119
|
+
'',
|
|
120
|
+
`> Complete documentation for all ${packages.length} Vielzeug packages. Version: ${version}`,
|
|
121
|
+
];
|
|
122
|
+
for (const pkg of packages) {
|
|
123
|
+
lines.push('');
|
|
124
|
+
lines.push('---');
|
|
125
|
+
lines.push('');
|
|
126
|
+
lines.push(`## ${pkg.name}`);
|
|
127
|
+
lines.push('');
|
|
128
|
+
lines.push(`**Category:** ${pkg.category || 'general'}`);
|
|
129
|
+
if (pkg.keywords.length > 0) {
|
|
130
|
+
lines.push(`**Keywords:** ${pkg.keywords.join(', ')}`);
|
|
131
|
+
}
|
|
132
|
+
if (pkg.exports.length > 0) {
|
|
133
|
+
const shown = pkg.exports.slice(0, 12);
|
|
134
|
+
const overflow = pkg.exports.length > 12 ? ` (+${pkg.exports.length - 12} more)` : '';
|
|
135
|
+
lines.push(`**Key exports:** ${shown.join(', ')}${overflow}`);
|
|
136
|
+
}
|
|
137
|
+
if (pkg.related.length > 0) {
|
|
138
|
+
lines.push(`**Related:** ${pkg.related.join(', ')}`);
|
|
139
|
+
}
|
|
140
|
+
lines.push('');
|
|
141
|
+
for (const page of PAGE_ORDER) {
|
|
142
|
+
const content = pkg.docs[page];
|
|
143
|
+
if (!content)
|
|
144
|
+
continue;
|
|
145
|
+
const stripped = stripDocMarkup(content);
|
|
146
|
+
if (!stripped)
|
|
147
|
+
continue;
|
|
148
|
+
lines.push(`### ${PAGE_LABELS[page]}`);
|
|
149
|
+
lines.push('');
|
|
150
|
+
lines.push(stripped);
|
|
151
|
+
lines.push('');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return lines.join('\n').trimEnd() + '\n';
|
|
155
|
+
}
|
|
156
|
+
export function generateLlmsTxt(data) {
|
|
157
|
+
return {
|
|
158
|
+
llmsFullTxt: buildLlmsFullTxt(data.packages, data.version),
|
|
159
|
+
llmsTxt: buildLlmsTxt(data.packages, data.version),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=llms.js.map
|
package/dist/llms.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llms.js","sourceRoot":"","sources":["../src/llms.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,EAAE;SACN,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC,cAAc;SACpD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,gBAAgB;SAChD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,YAAY;SACpC,O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Ac,CAAC,OAAO,CAAC,CAAC;YAEzC,IAAI,CAAC,QAAQ;gBAAE,SAAS;YAExB,KAAK,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;AAC3C,CAAC;AAWD,MAAM,UAAU,eAAe,CAAC,IAAiB;IAC/C,OAAO;QACL,WAAW,EAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC;QAC1D,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
package/dist/port.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodexError } from './errors.js';
|
|
2
|
+
/** Parses and validates a --port CLI argument. Returns the port number or null if omitted. */
|
|
3
|
+
export function resolvePort(raw) {
|
|
4
|
+
if (raw === undefined)
|
|
5
|
+
return null;
|
|
6
|
+
const n = Number.parseInt(raw, 10);
|
|
7
|
+
if (!Number.isFinite(n) || n < 1 || n > 65535 || n !== Number(raw)) {
|
|
8
|
+
throw new CodexError(`Invalid --port value: "${raw}". Expected an integer between 1 and 65535.`);
|
|
9
|
+
}
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=port.js.map
|
package/dist/port.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port.js","sourceRoot":"","sources":["../src/port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,8FAA8F;AAC9F,MAAM,UAAU,WAAW,CAAC,GAAuB;IACjD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,UAAU,CAAC,0BAA0B,GAAG,6CAA6C,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,wFAAwF"}
|
package/dist/search.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Normalisation
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
function normalise(s) {
|
|
5
|
+
return s.toLowerCase().replace(/-/g, ' ');
|
|
6
|
+
}
|
|
7
|
+
export function normalisePackage(pkg) {
|
|
8
|
+
const docs = {};
|
|
9
|
+
for (const page of pkg.availableDocPages) {
|
|
10
|
+
const content = pkg.docs[page];
|
|
11
|
+
if (typeof content === 'string')
|
|
12
|
+
docs[page] = normalise(content);
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
availableDocPages: pkg.availableDocPages,
|
|
16
|
+
category: normalise(pkg.category),
|
|
17
|
+
description: normalise(pkg.description),
|
|
18
|
+
docs,
|
|
19
|
+
examples: pkg.examples.map((e) => ({ id: e.id, text: normalise(`${e.name} ${e.code}`) })),
|
|
20
|
+
exports: pkg.exports.map(normalise).join(' '),
|
|
21
|
+
keywords: pkg.keywords.map(normalise).join(' '),
|
|
22
|
+
name: pkg.name,
|
|
23
|
+
related: pkg.related.map(normalise).join(' '),
|
|
24
|
+
slug: pkg.slug,
|
|
25
|
+
source: pkg.apiSource ? normalise(pkg.apiSource) : null,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Scoring
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
/** Returns true if every term appears in the already-normalised haystack. */
|
|
32
|
+
function allTermsMatch(haystack, terms) {
|
|
33
|
+
return terms.every((t) => haystack.includes(t));
|
|
34
|
+
}
|
|
35
|
+
/** Weighted scores — higher = stronger signal within tier. */
|
|
36
|
+
const W = {
|
|
37
|
+
category: 3.5,
|
|
38
|
+
description: 3.1,
|
|
39
|
+
docs: 1.0,
|
|
40
|
+
examples: 0.95,
|
|
41
|
+
exports: 2.2,
|
|
42
|
+
keywords: 2.5,
|
|
43
|
+
name: 3.9,
|
|
44
|
+
related: 2.0,
|
|
45
|
+
source: 0.9,
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Ordered highest-to-lowest for `describeScoreTiers()`. Single source of truth for the
|
|
49
|
+
* search-packages tool description's "score: name(3.9) > category(3.5) > ..." prose — the
|
|
50
|
+
* numbers used to be hand-typed into that description separately from `W`, so retuning a
|
|
51
|
+
* weight silently made the description lie about the actual scoring.
|
|
52
|
+
*/
|
|
53
|
+
const SCORE_TIERS = [
|
|
54
|
+
['name', W.name],
|
|
55
|
+
['category', W.category],
|
|
56
|
+
['description', W.description],
|
|
57
|
+
['keywords', W.keywords],
|
|
58
|
+
['exports', W.exports],
|
|
59
|
+
['related', W.related],
|
|
60
|
+
['docs', W.docs],
|
|
61
|
+
['examples', W.examples],
|
|
62
|
+
['source', W.source],
|
|
63
|
+
];
|
|
64
|
+
export function describeScoreTiers() {
|
|
65
|
+
return SCORE_TIERS.map(([label, weight]) => `${label}(${weight})`).join(' > ');
|
|
66
|
+
}
|
|
67
|
+
/** Fields matched by simple substring inclusion, where the matchedIn category name equals the field name. */
|
|
68
|
+
const SIMPLE_FIELDS = ['keywords', 'exports', 'related', 'source'];
|
|
69
|
+
/** Score a pre-normalised package against a query. The query is normalised here; fields are pre-normalised. */
|
|
70
|
+
export function scorePackage(pkg, query) {
|
|
71
|
+
const terms = normalise(query)
|
|
72
|
+
.split(/\s+/)
|
|
73
|
+
.filter((t) => t.length > 0);
|
|
74
|
+
if (terms.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
let score = 0;
|
|
77
|
+
const matched = new Set();
|
|
78
|
+
const matchedPages = [];
|
|
79
|
+
const matchedExamples = [];
|
|
80
|
+
if (allTermsMatch(normalise(pkg.name), terms)) {
|
|
81
|
+
score = Math.max(score, W.name);
|
|
82
|
+
matched.add('metadata');
|
|
83
|
+
}
|
|
84
|
+
if (allTermsMatch(pkg.category, terms)) {
|
|
85
|
+
score = Math.max(score, W.category);
|
|
86
|
+
matched.add('metadata');
|
|
87
|
+
}
|
|
88
|
+
if (allTermsMatch(pkg.description, terms)) {
|
|
89
|
+
score = Math.max(score, W.description);
|
|
90
|
+
matched.add('metadata');
|
|
91
|
+
}
|
|
92
|
+
for (const field of SIMPLE_FIELDS) {
|
|
93
|
+
const value = pkg[field];
|
|
94
|
+
if (value && allTermsMatch(value, terms)) {
|
|
95
|
+
score = Math.max(score, W[field]);
|
|
96
|
+
matched.add(field);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
for (const page of pkg.availableDocPages) {
|
|
100
|
+
const content = pkg.docs[page];
|
|
101
|
+
if (typeof content === 'string' && allTermsMatch(content, terms)) {
|
|
102
|
+
score = Math.max(score, W.docs);
|
|
103
|
+
matched.add('docs');
|
|
104
|
+
matchedPages.push(page);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const example of pkg.examples) {
|
|
108
|
+
if (allTermsMatch(example.text, terms)) {
|
|
109
|
+
score = Math.max(score, W.examples);
|
|
110
|
+
matched.add('examples');
|
|
111
|
+
matchedExamples.push(example.id);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (score === 0)
|
|
115
|
+
return null;
|
|
116
|
+
return {
|
|
117
|
+
...(matchedExamples.length > 0 && { matchedExamples }),
|
|
118
|
+
matchedIn: [...matched],
|
|
119
|
+
...(matchedPages.length > 0 && { matchedPages }),
|
|
120
|
+
name: pkg.name,
|
|
121
|
+
score,
|
|
122
|
+
slug: pkg.slug,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAiDA,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAmB;IAClD,MAAM,IAAI,GAAqC,EAAE,CAAC;IAElD,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,OAAO,OAAO,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;QACxC,QAAQ,EAAE,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;QACjC,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC;QACvC,IAAI;QACJ,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,E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C,MAAM,CAAC,CAAC;YACpB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QACnC,IAAI,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;YACvC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE7B,OAAO;QACL,GAAG,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC;QACtD,SAAS,EAAE,CAAC,GAAG,OAAO,CAA2B;QACjD,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC;QAChD,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,KAAK;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAC;AACJ,CAAC"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { loadData } from './data.js';
|
|
3
|
+
import { buildToolContext, registerTools } from './tools/index.js';
|
|
4
|
+
export function createServer(data) {
|
|
5
|
+
const server = new Server({ name: 'vielzeug', version: data.version }, { capabilities: { tools: {} } });
|
|
6
|
+
registerTools(server, buildToolContext(data));
|
|
7
|
+
return server;
|
|
8
|
+
}
|
|
9
|
+
/** Convenience factory: loads bundled data from disk and creates the MCP server in one call. */
|
|
10
|
+
export function createServerFromDisk() {
|
|
11
|
+
return createServer(loadData());
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAInE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC5C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAExG,aAAa,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { log } from '../_log.js';
|
|
3
|
+
import { ToolError } from '../errors.js';
|
|
4
|
+
import { packageTools } from './packages.js';
|
|
5
|
+
import { refineTools } from './refine.js';
|
|
6
|
+
export { buildToolContext } from './shared.js';
|
|
7
|
+
// One flat list: generic package tools first, then refine's structured-metadata tools.
|
|
8
|
+
// Deliberately no sandbox/ore/spell-specific tools — those used to hand-duplicate (and,
|
|
9
|
+
// for sandbox, actively misrepresent) API surface already covered accurately by the
|
|
10
|
+
// generic get-docs/get-source/get-type-signature tools above. See docs/sandbox/api.md,
|
|
11
|
+
// docs/ore/api.md, docs/spell/api.md for that reference material instead.
|
|
12
|
+
//
|
|
13
|
+
// Exported (not just a local const) so scripts/generate-tool-docs.ts can render the
|
|
14
|
+
// README tables straight from this registry instead of a hand-maintained copy.
|
|
15
|
+
export const ALL_TOOLS = [...packageTools, ...refineTools];
|
|
16
|
+
const TOOL_MAP = new Map(ALL_TOOLS.map((t) => [t.name, t]));
|
|
17
|
+
const DEBUG = process.env['CODEX_DEBUG'] === '1';
|
|
18
|
+
function debugArgs(args) {
|
|
19
|
+
const entries = Object.entries(args)
|
|
20
|
+
.map(([k, v]) => `${k}=${typeof v === 'string' ? JSON.stringify(v.length > 40 ? `${v.slice(0, 40)}…` : v) : String(v)}`)
|
|
21
|
+
.join(', ');
|
|
22
|
+
return entries ? `(${entries})` : '()';
|
|
23
|
+
}
|
|
24
|
+
export function registerTools(server, context) {
|
|
25
|
+
server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
26
|
+
tools: ALL_TOOLS.map((tool) => ({ description: tool.description, inputSchema: tool.inputSchema, name: tool.name })),
|
|
27
|
+
}));
|
|
28
|
+
server.setRequestHandler(CallToolRequestSchema, (request) => {
|
|
29
|
+
const tool = TOOL_MAP.get(request.params.name);
|
|
30
|
+
if (!tool) {
|
|
31
|
+
if (DEBUG)
|
|
32
|
+
log(`[codex] tool not found: ${request.params.name}`);
|
|
33
|
+
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
|
|
34
|
+
}
|
|
35
|
+
const args = request.params.arguments ?? {};
|
|
36
|
+
if (DEBUG)
|
|
37
|
+
log(`[codex] → ${tool.name}${debugArgs(args)}`);
|
|
38
|
+
const t0 = DEBUG ? Date.now() : 0;
|
|
39
|
+
try {
|
|
40
|
+
const result = tool.run(args, context);
|
|
41
|
+
if (DEBUG)
|
|
42
|
+
log(`[codex] ✓ ${tool.name} (${Date.now() - t0}ms)`);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
// Every expected failure (bad arg, unknown slug/tag, missing bundled data) is a
|
|
47
|
+
// ToolError; anything else is a real bug and is left to propagate as a protocol error.
|
|
48
|
+
if (err instanceof ToolError) {
|
|
49
|
+
if (DEBUG)
|
|
50
|
+
log(`[codex] ✗ ${tool.name} ${err.code}: ${err.message}`);
|
|
51
|
+
return {
|
|
52
|
+
content: [{ text: JSON.stringify({ code: err.code, message: err.message }), type: 'text' }],
|
|
53
|
+
isError: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (DEBUG)
|
|
57
|
+
log(`[codex] ✗ ${tool.name} threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
58
|
+
throw err;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAIxH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AAEjE,uFAAuF;AACvF,wFAAwF;AACxF,oFAAoF;AACpF,uFAAuF;AACvF,0EAA0E;AAC1E,EAAE;AACF,oFAAoF;AACpF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,SAAS,GAAqB,CAAC,GAAG,YAAY,EAAE,GAAG,WAAW,CAAC,CAAC;AAE7E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAA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;YAED,IAAI,KAAK;gBAAE,GAAG,CAAC,aAAa,IAAI,CAAC,IAAI,WAAW,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpG,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { packageMeta } from '../data.js';
|
|
2
|
+
import { ToolError } from '../errors.js';
|
|
3
|
+
import { describeScoreTiers, scorePackage } from '../search.js';
|
|
4
|
+
import { DOC_PAGES } from '../types.js';
|
|
5
|
+
import { PACKAGE_SLUG_PROPERTY, parseArgs } from './schema.js';
|
|
6
|
+
import { requirePackage, text } from './shared.js';
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// list-packages
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
const listPackagesSchema = { properties: {}, type: 'object' };
|
|
11
|
+
export const listPackagesTool = {
|
|
12
|
+
description: 'List all vielzeug packages with metadata (version, description, category, keywords, exports, availableDocPages, exampleIds, hasSource). Returns a JSON array of PackageMeta objects sorted by slug. Use this tool first to discover available packages, then call get-package for a single package, get-docs for docs, get-source for source, or get-example for a REPL example.',
|
|
13
|
+
inputSchema: listPackagesSchema,
|
|
14
|
+
name: 'list-packages',
|
|
15
|
+
run(_args, context) {
|
|
16
|
+
return text(JSON.stringify([...context.bySlug.values()].map(packageMeta), null, 2));
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// get-package
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
const getPackageSchema = {
|
|
23
|
+
properties: { packageSlug: PACKAGE_SLUG_PROPERTY },
|
|
24
|
+
required: ['packageSlug'],
|
|
25
|
+
type: 'object',
|
|
26
|
+
};
|
|
27
|
+
export const getPackageTool = {
|
|
28
|
+
description: 'Get metadata for a single vielzeug package by slug. Returns a PackageMeta object with version, description, category, keywords, exports, availableDocPages, exampleIds, and hasSource. Use list-packages first to discover available slugs.',
|
|
29
|
+
inputSchema: getPackageSchema,
|
|
30
|
+
name: 'get-package',
|
|
31
|
+
run(args, context) {
|
|
32
|
+
const { packageSlug } = parseArgs(getPackageSchema, args);
|
|
33
|
+
const pkg = requirePackage(context, packageSlug);
|
|
34
|
+
return text(JSON.stringify(packageMeta(pkg), null, 2));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// get-docs
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
const getDocsSchema = {
|
|
41
|
+
properties: {
|
|
42
|
+
packageSlug: PACKAGE_SLUG_PROPERTY,
|
|
43
|
+
page: { default: 'index', description: 'Doc page to read (defaults to "index")', enum: DOC_PAGES, type: 'string' },
|
|
44
|
+
},
|
|
45
|
+
required: ['packageSlug'],
|
|
46
|
+
type: 'object',
|
|
47
|
+
};
|
|
48
|
+
export const getDocsTool = {
|
|
49
|
+
description: 'Read a documentation page for a vielzeug package. Returns Markdown text. page defaults to "index" (overview + quick start). Use "api" for full API reference, "usage" for how-to guide, "examples" for recipe index. Check availableDocPages from list-packages before requesting a specific page.',
|
|
50
|
+
inputSchema: getDocsSchema,
|
|
51
|
+
name: 'get-docs',
|
|
52
|
+
run(args, context) {
|
|
53
|
+
const { packageSlug, page } = parseArgs(getDocsSchema, args);
|
|
54
|
+
const pkg = requirePackage(context, packageSlug);
|
|
55
|
+
const content = pkg.docs[page];
|
|
56
|
+
if (!content) {
|
|
57
|
+
throw new ToolError('NOT_FOUND', `No "${page}" page for "${packageSlug}". Available: ${pkg.availableDocPages.join(', ') || 'none'}.`);
|
|
58
|
+
}
|
|
59
|
+
return text(content);
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// get-source
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
const getSourceSchema = {
|
|
66
|
+
properties: { packageSlug: PACKAGE_SLUG_PROPERTY },
|
|
67
|
+
required: ['packageSlug'],
|
|
68
|
+
type: 'object',
|
|
69
|
+
};
|
|
70
|
+
export const getSourceTool = {
|
|
71
|
+
description: 'Read the full src/index.ts source of a vielzeug package. Returns TypeScript text with all exported function signatures, types, and JSDoc. Use this when you need exact type signatures or implementation details not covered by docs. Check hasSource from list-packages first — returns isError if no source is bundled.',
|
|
72
|
+
inputSchema: getSourceSchema,
|
|
73
|
+
name: 'get-source',
|
|
74
|
+
run(args, context) {
|
|
75
|
+
const { packageSlug } = parseArgs(getSourceSchema, args);
|
|
76
|
+
const pkg = requirePackage(context, packageSlug);
|
|
77
|
+
if (!pkg.apiSource)
|
|
78
|
+
throw new ToolError('UNAVAILABLE', `Package "${packageSlug}" has no src/index.ts source in bundled data.`);
|
|
79
|
+
return text(pkg.apiSource);
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
// list-examples
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
const listExamplesSchema = {
|
|
86
|
+
properties: { packageSlug: PACKAGE_SLUG_PROPERTY },
|
|
87
|
+
required: ['packageSlug'],
|
|
88
|
+
type: 'object',
|
|
89
|
+
};
|
|
90
|
+
export const listExamplesTool = {
|
|
91
|
+
description: 'List runnable REPL code examples for a vielzeug package. Returns a JSON array of { id, name } (no code — use get-example for that). These are the same examples users can run interactively at vielzeug.dev/repl. Returns an empty array (not an error) for packages with no REPL examples (e.g. DOM-output packages like refine, prism, ore).',
|
|
92
|
+
inputSchema: listExamplesSchema,
|
|
93
|
+
name: 'list-examples',
|
|
94
|
+
run(args, context) {
|
|
95
|
+
const { packageSlug } = parseArgs(listExamplesSchema, args);
|
|
96
|
+
const pkg = requirePackage(context, packageSlug);
|
|
97
|
+
return text(JSON.stringify(pkg.examples.map(({ id, name }) => ({ id, name })), null, 2));
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// get-example
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
const getExampleSchema = {
|
|
104
|
+
properties: {
|
|
105
|
+
exampleId: { description: 'Example id, e.g. "function-debounce"', maxLength: 100, minLength: 1, type: 'string' },
|
|
106
|
+
packageSlug: PACKAGE_SLUG_PROPERTY,
|
|
107
|
+
},
|
|
108
|
+
required: ['packageSlug', 'exampleId'],
|
|
109
|
+
type: 'object',
|
|
110
|
+
};
|
|
111
|
+
export const getExampleTool = {
|
|
112
|
+
description: 'Read the full runnable source code of a single REPL example for a vielzeug package. Returns TypeScript text. Use list-examples first to discover valid exampleId values for a package.',
|
|
113
|
+
inputSchema: getExampleSchema,
|
|
114
|
+
name: 'get-example',
|
|
115
|
+
run(args, context) {
|
|
116
|
+
const { exampleId, packageSlug } = parseArgs(getExampleSchema, args);
|
|
117
|
+
const pkg = requirePackage(context, packageSlug);
|
|
118
|
+
const example = pkg.examples.find((e) => e.id === exampleId);
|
|
119
|
+
if (!example) {
|
|
120
|
+
const available = pkg.examples.map((e) => e.id).join(', ') || 'none';
|
|
121
|
+
throw new ToolError('NOT_FOUND', `No example "${exampleId}" for "${packageSlug}". Available: ${available}.`);
|
|
122
|
+
}
|
|
123
|
+
return text(example.code);
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// search-packages
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
const searchPackagesSchema = {
|
|
130
|
+
properties: { query: { description: 'Non-empty search term', maxLength: 500, minLength: 1, type: 'string' } },
|
|
131
|
+
required: ['query'],
|
|
132
|
+
type: 'object',
|
|
133
|
+
};
|
|
134
|
+
export const searchPackagesTool = {
|
|
135
|
+
description: `Search vielzeug packages by keyword across name, description, category, keywords, exports, related, docs, REPL examples, and source. Supports multi-word queries (all words must match). Returns a JSON array of SearchHit objects sorted by score descending. score: ${describeScoreTiers()}. Returns empty array (not an error) when nothing matches. Prefer this over list-packages when you know what you are looking for.`,
|
|
136
|
+
inputSchema: searchPackagesSchema,
|
|
137
|
+
name: 'search-packages',
|
|
138
|
+
run(args, context) {
|
|
139
|
+
const { query } = parseArgs(searchPackagesSchema, args);
|
|
140
|
+
const results = context.normalisedPackages
|
|
141
|
+
.map((pkg) => scorePackage(pkg, query))
|
|
142
|
+
.filter((hit) => hit !== null)
|
|
143
|
+
.sort((a, b) => b.score - a.score || a.slug.localeCompare(b.slug));
|
|
144
|
+
return text(JSON.stringify(results, null, 2));
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// get-type-signature
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
const getTypeSignatureSchema = {
|
|
151
|
+
properties: {
|
|
152
|
+
slug: PACKAGE_SLUG_PROPERTY,
|
|
153
|
+
symbol: {
|
|
154
|
+
description: 'Exported name to look up, e.g. "debounce" or "SearchOptions"',
|
|
155
|
+
maxLength: 200,
|
|
156
|
+
minLength: 1,
|
|
157
|
+
type: 'string',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
required: ['slug', 'symbol'],
|
|
161
|
+
type: 'object',
|
|
162
|
+
};
|
|
163
|
+
export const getTypeSignatureTool = {
|
|
164
|
+
description: "Look up the exported TypeScript declaration for a named symbol from a @vielzeug package's bundled src/index.ts (extracted and indexed at build time, not parsed per-request). Returns the raw declaration text — useful for verifying the exact signature of a function, type alias, interface, or constant without loading the full source. Returns isError when the package has no bundled source or the symbol is not found.",
|
|
165
|
+
inputSchema: getTypeSignatureSchema,
|
|
166
|
+
name: 'get-type-signature',
|
|
167
|
+
run(args, context) {
|
|
168
|
+
const { slug, symbol } = parseArgs(getTypeSignatureSchema, args);
|
|
169
|
+
const pkg = requirePackage(context, slug);
|
|
170
|
+
if (!pkg.apiSource)
|
|
171
|
+
throw new ToolError('UNAVAILABLE', `Package "${slug}" has no bundled source.`);
|
|
172
|
+
// `Object.hasOwn` guard (not just `pkg.typeSignatures[symbol]` + truthiness): `symbol` is
|
|
173
|
+
// arbitrary user input with no charset/enum restriction. Without this check, a symbol like
|
|
174
|
+
// "__proto__", "constructor", or "toString" would resolve through the prototype chain to a
|
|
175
|
+
// real (but never bundled) `Object.prototype` member — a truthy non-string value — bypassing
|
|
176
|
+
// the not-found check below and returning a malformed result instead of a clean NOT_FOUND.
|
|
177
|
+
if (!Object.hasOwn(pkg.typeSignatures, symbol)) {
|
|
178
|
+
throw new ToolError('NOT_FOUND', `"${symbol}" not found in ${slug}/src/index.ts.`);
|
|
179
|
+
}
|
|
180
|
+
const declaration = pkg.typeSignatures[symbol];
|
|
181
|
+
if (!declaration)
|
|
182
|
+
throw new ToolError('NOT_FOUND', `"${symbol}" not found in ${slug}/src/index.ts.`);
|
|
183
|
+
return text(declaration);
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
export const packageTools = [
|
|
187
|
+
listPackagesTool,
|
|
188
|
+
getPackageTool,
|
|
189
|
+
getDocsTool,
|
|
190
|
+
getSourceTool,
|
|
191
|
+
listExamplesTool,
|
|
192
|
+
getExampleTool,
|
|
193
|
+
searchPackagesTool,
|
|
194
|
+
getTypeSignatureTool,
|
|
195
|
+
];
|
|
196
|
+
//# sourceMappingURL=packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../src/tools/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE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