@intlayer/mcp 8.4.9 → 8.5.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.
@@ -1,5 +1,5 @@
1
- import { readFileSync } from "node:fs";
2
1
  import { dirname as dirname$1, resolve } from "node:path";
2
+ import { readFileSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { isESModule } from "@intlayer/config/utils";
5
5
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
@@ -1,8 +1,8 @@
1
1
  import { loadCLITools } from "../tools/cli.mjs";
2
- import { loadDocsTools } from "../tools/docs.mjs";
3
2
  import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
4
- import { readFileSync } from "node:fs";
3
+ import { loadDocsTools } from "../tools/docs.mjs";
5
4
  import { dirname as dirname$1, resolve } from "node:path";
5
+ import { readFileSync } from "node:fs";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { isESModule } from "@intlayer/config/utils";
8
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1,5 +1,5 @@
1
- import { listProjects } from "../packages/@intlayer/chokidar/dist/esm/listProjects.mjs";
2
1
  import { relative } from "node:path";
2
+ import { listProjects } from "@intlayer/chokidar/cli";
3
3
  import { build, extract, fill, init, listContentDeclarationRows, listMissingTranslations, pull, push } from "@intlayer/cli";
4
4
  import { ALL_LOCALES } from "@intlayer/types/allLocales";
5
5
  import z from "zod";
@@ -1,4 +1,4 @@
1
- import { PLATFORMS, SKILLS, installSkills } from "../packages/@intlayer/chokidar/dist/esm/installSkills/index.mjs";
1
+ import { PLATFORMS, SKILLS, installSkills } from "@intlayer/chokidar/cli";
2
2
  import z from "zod";
3
3
  import * as readline from "node:readline";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/mcp",
3
- "version": "8.4.9",
3
+ "version": "8.5.0",
4
4
  "private": false,
5
5
  "description": "Intlayer MCP server. Handle MCP to help IDE to use Intlayer. It build, fill, pull, push, dictionaries",
6
6
  "keywords": [
@@ -93,18 +93,19 @@
93
93
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
94
94
  },
95
95
  "dependencies": {
96
- "@intlayer/api": "8.4.9",
97
- "@intlayer/cli": "8.4.9",
98
- "@intlayer/config": "8.4.9",
99
- "@intlayer/docs": "8.4.9",
100
- "@intlayer/types": "8.4.9",
96
+ "@intlayer/api": "8.5.0",
97
+ "@intlayer/chokidar": "8.5.0",
98
+ "@intlayer/cli": "8.5.0",
99
+ "@intlayer/config": "8.5.0",
100
+ "@intlayer/docs": "8.5.0",
101
+ "@intlayer/types": "8.5.0",
101
102
  "@modelcontextprotocol/sdk": "1.27.1",
102
103
  "dotenv": "17.3.1",
103
104
  "express": "5.2.1",
104
105
  "zod": "4.3.6"
105
106
  },
106
107
  "devDependencies": {
107
- "@intlayer/types": "8.4.9",
108
+ "@intlayer/types": "8.5.0",
108
109
  "@modelcontextprotocol/inspector": "0.21.1",
109
110
  "@types/express": "5.0.6",
110
111
  "@types/node": "25.5.0",
@@ -113,8 +114,8 @@
113
114
  "@utils/tsdown-config": "1.0.4",
114
115
  "rimraf": "6.1.3",
115
116
  "tsdown": "0.21.4",
116
- "typescript": "5.9.3",
117
- "vitest": "4.1.0"
117
+ "typescript": "6.0.2",
118
+ "vitest": "4.1.1"
118
119
  },
119
120
  "engines": {
120
121
  "node": ">=14.18"
@@ -1,98 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { basename, dirname, join, relative, resolve, sep } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- //#region ../chokidar/dist/esm/_virtual/_utils_asset.mjs
6
- const hereDirname = () => {
7
- try {
8
- return dirname(fileURLToPath(import.meta.url));
9
- } catch {
10
- return typeof __dirname !== "undefined" ? __dirname : process.cwd();
11
- }
12
- };
13
- const findDistRoot = (startDir) => {
14
- let dir = startDir;
15
- for (let i = 0; i < 12; i++) {
16
- if (basename(dir) === "dist") return dir;
17
- const parent = resolve(dir, "..");
18
- if (parent === dir) break;
19
- dir = parent;
20
- }
21
- return null;
22
- };
23
- const normalizeFrameFile = (file) => {
24
- if (!file) return null;
25
- try {
26
- if (file.startsWith("file://")) return fileURLToPath(file);
27
- } catch {}
28
- return file;
29
- };
30
- /**
31
- * Returns the directory of the *caller* module that invoked readAsset.
32
- * Prefers non-virtual frames; falls back to the first real frame.
33
- */
34
- const getCallerDir = () => {
35
- const prev = Error.prepareStackTrace;
36
- try {
37
- Error.prepareStackTrace = (_, structured) => structured;
38
- const err = /* @__PURE__ */ new Error();
39
- Error.captureStackTrace(err, getCallerDir);
40
- /** @type {import('node:vm').CallSite[]} */
41
- const frames = err.stack || [];
42
- const isVirtualPath = (p) => p.includes(`${sep}_virtual${sep}`) || p.includes("/_virtual/");
43
- for (const frame of frames) {
44
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
45
- if (!file) continue;
46
- if (file.includes("node:internal") || file.includes(`${sep}internal${sep}modules${sep}`)) continue;
47
- if (!isVirtualPath(file)) return dirname(file);
48
- }
49
- for (const frame of frames) {
50
- const file = normalizeFrameFile(typeof frame.getFileName === "function" ? frame.getFileName() : null);
51
- if (file) return dirname(file);
52
- }
53
- } catch {} finally {
54
- Error.prepareStackTrace = prev;
55
- }
56
- return hereDirname();
57
- };
58
- /**
59
- * Read an asset copied from src/** to dist/assets/**.
60
- * - './' or '../' is resolved relative to the *caller module's* emitted directory.
61
- * - otherwise, treat as src-relative.
62
- *
63
- * @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'
64
- * @param {BufferEncoding} [encoding='utf8']
65
- */
66
- const readAsset = (relPath, encoding = "utf8") => {
67
- const here = hereDirname();
68
- const distRoot = findDistRoot(here) ?? resolve(here, "..", "..", "dist");
69
- const assetsRoot = join(distRoot, "assets");
70
- const tried = [];
71
- /**
72
- * Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)
73
- */
74
- const callerSubpath = relative(distRoot, getCallerDir()).split("\\").join("/").replace(/^(?:dist\/)?(?:esm|cjs)\//, "").replace(/^_virtual\//, "");
75
- if (relPath.startsWith("./") || relPath.startsWith("../")) {
76
- const fromCallerAbs = resolve(assetsRoot, callerSubpath, relPath);
77
- tried.push(fromCallerAbs);
78
- if (existsSync(fromCallerAbs)) return readFileSync(fromCallerAbs, encoding);
79
- }
80
- const directPath = join(assetsRoot, relPath);
81
- tried.push(directPath);
82
- if (existsSync(directPath)) return readFileSync(directPath, encoding);
83
- if (callerSubpath) {
84
- const nested = join(assetsRoot, callerSubpath, relPath);
85
- tried.push(nested);
86
- if (existsSync(nested)) return readFileSync(nested, encoding);
87
- }
88
- const msg = [
89
- "readAsset: file not found.",
90
- "Searched:",
91
- ...tried.map((p) => `- ${p}`)
92
- ].join("\n");
93
- throw new Error(msg);
94
- };
95
-
96
- //#endregion
97
- export { readAsset };
98
- //# sourceMappingURL=_utils_asset.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_utils_asset.mjs","names":[],"sources":["../../../../../../../../../chokidar/dist/esm/_virtual/_utils_asset.mjs"],"sourcesContent":["import { basename, dirname, join, relative, resolve, sep } from \"node:path\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n\n//#region \\0utils:asset\nconst hereDirname = () => {\n\ttry {\n\t\treturn dirname(fileURLToPath(import.meta.url));\n\t} catch {\n\t\treturn typeof __dirname !== \"undefined\" ? __dirname : process.cwd();\n\t}\n};\nconst findDistRoot = (startDir) => {\n\tlet dir = startDir;\n\tfor (let i = 0; i < 12; i++) {\n\t\tif (basename(dir) === \"dist\") return dir;\n\t\tconst parent = resolve(dir, \"..\");\n\t\tif (parent === dir) break;\n\t\tdir = parent;\n\t}\n\treturn null;\n};\nconst normalizeFrameFile = (file) => {\n\tif (!file) return null;\n\ttry {\n\t\tif (file.startsWith(\"file://\")) return fileURLToPath(file);\n\t} catch {}\n\treturn file;\n};\n/**\n* Returns the directory of the *caller* module that invoked readAsset.\n* Prefers non-virtual frames; falls back to the first real frame.\n*/\nconst getCallerDir = () => {\n\tconst prev = Error.prepareStackTrace;\n\ttry {\n\t\tError.prepareStackTrace = (_, structured) => structured;\n\t\tconst err = /* @__PURE__ */ new Error();\n\t\tError.captureStackTrace(err, getCallerDir);\n\t\t/** @type {import('node:vm').CallSite[]} */\n\t\tconst frames = err.stack || [];\n\t\tconst isVirtualPath = (p) => p.includes(`${sep}_virtual${sep}`) || p.includes(\"/_virtual/\");\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (!file) continue;\n\t\t\tif (file.includes(\"node:internal\") || file.includes(`${sep}internal${sep}modules${sep}`)) continue;\n\t\t\tif (!isVirtualPath(file)) return dirname(file);\n\t\t}\n\t\tfor (const frame of frames) {\n\t\t\tconst file = normalizeFrameFile(typeof frame.getFileName === \"function\" ? frame.getFileName() : null);\n\t\t\tif (file) return dirname(file);\n\t\t}\n\t} catch {} finally {\n\t\tError.prepareStackTrace = prev;\n\t}\n\treturn hereDirname();\n};\n/**\n* Read an asset copied from src/** to dist/assets/**.\n* - './' or '../' is resolved relative to the *caller module's* emitted directory.\n* - otherwise, treat as src-relative.\n*\n* @param {string} relPath - e.g. './PROMPT.md' or 'utils/AI/askDocQuestion/embeddings/<fileKey>.json'\n* @param {BufferEncoding} [encoding='utf8']\n*/\nconst readAsset = (relPath, encoding = \"utf8\") => {\n\tconst here = hereDirname();\n\tconst distRoot = findDistRoot(here) ?? resolve(here, \"..\", \"..\", \"dist\");\n\tconst assetsRoot = join(distRoot, \"assets\");\n\tconst tried = [];\n\t/**\n\t* Transform dist/(esm|cjs)/... and _virtual/ prefix to clean subpath (Windows-safe)\n\t*/\n\tconst callerSubpath = relative(distRoot, getCallerDir()).split(\"\\\\\").join(\"/\").replace(/^(?:dist\\/)?(?:esm|cjs)\\//, \"\").replace(/^_virtual\\//, \"\");\n\tif (relPath.startsWith(\"./\") || relPath.startsWith(\"../\")) {\n\t\tconst fromCallerAbs = resolve(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(fromCallerAbs);\n\t\tif (existsSync(fromCallerAbs)) return readFileSync(fromCallerAbs, encoding);\n\t}\n\tconst directPath = join(assetsRoot, relPath);\n\ttried.push(directPath);\n\tif (existsSync(directPath)) return readFileSync(directPath, encoding);\n\tif (callerSubpath) {\n\t\tconst nested = join(assetsRoot, callerSubpath, relPath);\n\t\ttried.push(nested);\n\t\tif (existsSync(nested)) return readFileSync(nested, encoding);\n\t}\n\tconst msg = [\n\t\t\"readAsset: file not found.\",\n\t\t\"Searched:\",\n\t\t...tried.map((p) => `- ${p}`)\n\t].join(\"\\n\");\n\tthrow new Error(msg);\n};\n\n//#endregion\nexport { readAsset };"],"mappings":";;;;;AAKA,MAAM,oBAAoB;AACzB,KAAI;AACH,SAAO,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;SACvC;AACP,SAAO,OAAO,cAAc,cAAc,YAAY,QAAQ,KAAK;;;AAGrE,MAAM,gBAAgB,aAAa;CAClC,IAAI,MAAM;AACV,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK;AAC5B,MAAI,SAAS,IAAI,KAAK,OAAQ,QAAO;EACrC,MAAM,SAAS,QAAQ,KAAK,KAAK;AACjC,MAAI,WAAW,IAAK;AACpB,QAAM;;AAEP,QAAO;;AAER,MAAM,sBAAsB,SAAS;AACpC,KAAI,CAAC,KAAM,QAAO;AAClB,KAAI;AACH,MAAI,KAAK,WAAW,UAAU,CAAE,QAAO,cAAc,KAAK;SACnD;AACR,QAAO;;;;;;AAMR,MAAM,qBAAqB;CAC1B,MAAM,OAAO,MAAM;AACnB,KAAI;AACH,QAAM,qBAAqB,GAAG,eAAe;EAC7C,MAAM,sBAAsB,IAAI,OAAO;AACvC,QAAM,kBAAkB,KAAK,aAAa;;EAE1C,MAAM,SAAS,IAAI,SAAS,E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rE,KAAI,eAAe;EAClB,MAAM,SAAS,KAAK,YAAY,eAAe,QAAQ;AACvD,QAAM,KAAK,OAAO;AAClB,MAAI,WAAW,OAAO,CAAE,QAAO,aAAa,QAAQ,SAAS;;CAE9D,MAAM,MAAM;EACX;EACA;EACA,GAAG,MAAM,KAAK,MAAM,KAAK,IAAI;EAC7B,CAAC,KAAK,KAAK;AACZ,OAAM,IAAI,MAAM,IAAI"}
@@ -1,279 +0,0 @@
1
- import { readAsset } from "../_virtual/_utils_asset.mjs";
2
- import { getMarkdownMetadata } from "../../../../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs";
3
- import { promises } from "node:fs";
4
- import path from "node:path";
5
- import { v } from "@intlayer/config/logger";
6
-
7
- //#region ../chokidar/dist/esm/installSkills/index.mjs
8
- /**
9
- * Metadata for each available documentation skill.
10
- */
11
- const SKILLS_METADATA = {
12
- Config: "Intlayer configuration documentation",
13
- Content: "Reference for all Intlayer content node types (t, enu, etc.)",
14
- Usage: "How to use Intlayer in your project",
15
- CLI: "Intlayer CLI commands and usage",
16
- Compiler: "Intlayer Compiler setup and usage for automatic content extraction without .content files",
17
- RemoteContent: "How to use Intlayer with Remote/CMS/Server-side content",
18
- NextJS: "Next.js-specific usage (Server & Client components)",
19
- React: "React-specific syntax and hooks usage",
20
- Vue: "Vue-specific composables and syntax",
21
- Svelte: "Svelte-specific stores and syntax",
22
- Angular: "Angular-specific syntax and Injectable Function usage",
23
- Preact: "Preact-specific syntax and hooks usage",
24
- Solid: "Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.",
25
- Astro: "Astro-specific usage and getIntlayer"
26
- };
27
- const SKILLS = Object.keys(SKILLS_METADATA);
28
- /**
29
- * Metadata and configuration for each supported platform.
30
- */
31
- const PLATFORMS_METADATA = {
32
- Cursor: {
33
- label: "Cursor",
34
- dir: ".cursor/skills",
35
- check: () => process.env.CURSOR === "true" || process.env.TERM_PROGRAM === "cursor"
36
- },
37
- Windsurf: {
38
- label: "Windsurf",
39
- dir: ".windsurf/skills",
40
- check: () => process.env.WINDSURF === "true" || process.env.TERM_PROGRAM === "windsurf"
41
- },
42
- Trae: {
43
- label: "Trae",
44
- dir: ".trae/skills",
45
- check: () => process.env.TRAE === "true" || process.env.TERM_PROGRAM === "trae"
46
- },
47
- TraeCN: {
48
- label: "Trae CN",
49
- dir: ".trae/skills",
50
- check: () => process.env.TRAE_CN === "true"
51
- },
52
- VSCode: {
53
- label: "VS Code",
54
- dir: ".vscode/skills",
55
- check: () => process.env.VSCODE === "true" || process.env.TERM_PROGRAM === "vscode"
56
- },
57
- OpenCode: {
58
- label: "OpenCode",
59
- dir: ".opencode/skills",
60
- check: () => process.env.OPENCODE === "true"
61
- },
62
- Claude: {
63
- label: "Claude Code",
64
- dir: ".claude/skills",
65
- check: () => process.env.CLAUDE === "true"
66
- },
67
- GitHub: {
68
- label: "GitHub Copilot Workspace",
69
- dir: ".github/skills",
70
- check: () => process.env.GITHUB_ACTIONS === "true" || !!process.env.GITHUB_WORKSPACE
71
- },
72
- Antigravity: {
73
- label: "Antigravity",
74
- dir: ".agent/skills"
75
- },
76
- Augment: {
77
- label: "Augment",
78
- dir: ".augment/skills"
79
- },
80
- OpenClaw: {
81
- label: "OpenClaw",
82
- dir: "skills"
83
- },
84
- Cline: {
85
- label: "Cline",
86
- dir: ".cline/skills"
87
- },
88
- CodeBuddy: {
89
- label: "CodeBuddy",
90
- dir: ".codebuddy/skills"
91
- },
92
- CommandCode: {
93
- label: "Command Code",
94
- dir: ".commandcode/skills"
95
- },
96
- Continue: {
97
- label: "Continue",
98
- dir: ".continue/skills"
99
- },
100
- Crush: {
101
- label: "Crush",
102
- dir: ".crush/skills"
103
- },
104
- Droid: {
105
- label: "Droid",
106
- dir: ".factory/skills"
107
- },
108
- Goose: {
109
- label: "Goose",
110
- dir: ".goose/skills"
111
- },
112
- IFlow: {
113
- label: "iFlow CLI",
114
- dir: ".iflow/skills"
115
- },
116
- Junie: {
117
- label: "Junie",
118
- dir: ".junie/skills"
119
- },
120
- KiloCode: {
121
- label: "Kilo Code",
122
- dir: ".kilocode/skills"
123
- },
124
- Kiro: {
125
- label: "Kiro CLI",
126
- dir: ".kiro/skills"
127
- },
128
- Kode: {
129
- label: "Kode",
130
- dir: ".kode/skills"
131
- },
132
- MCPJam: {
133
- label: "MCPJam",
134
- dir: ".mcpjam/skills"
135
- },
136
- MistralVibe: {
137
- label: "Mistral Vibe",
138
- dir: ".vibe/skills"
139
- },
140
- Mux: {
141
- label: "Mux",
142
- dir: ".mux/skills"
143
- },
144
- OpenHands: {
145
- label: "OpenHands",
146
- dir: ".openhands/skills"
147
- },
148
- Pi: {
149
- label: "Pi",
150
- dir: ".pi/skills"
151
- },
152
- Qoder: {
153
- label: "Qoder",
154
- dir: ".qoder/skills"
155
- },
156
- Qwen: {
157
- label: "Qwen Code",
158
- dir: ".qwen/skills"
159
- },
160
- RooCode: {
161
- label: "Roo Code",
162
- dir: ".roo/skills"
163
- },
164
- Zencoder: {
165
- label: "Zencoder",
166
- dir: ".zencoder/skills"
167
- },
168
- Neovate: {
169
- label: "Neovate",
170
- dir: ".neovate/skills"
171
- },
172
- Pochi: {
173
- label: "Pochi",
174
- dir: ".pochi/skills"
175
- },
176
- Other: {
177
- label: "Other",
178
- dir: "skills"
179
- }
180
- };
181
- const PLATFORMS = Object.keys(PLATFORMS_METADATA);
182
- /**
183
- * Maps specific skill keys to special filenames if they differ from standard snake_case.
184
- */
185
- const SKILL_FILENAME_MAP = {};
186
- /**
187
- * Helper to convert CamelCase to kebab-case for directory naming
188
- */
189
- const camelToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
190
- /**
191
- * Reads the raw markdown content for a specific skill from the assets folder.
192
- */
193
- const getSkillContent = (skill) => {
194
- const fileName = `./skills/${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}.md`;
195
- try {
196
- return readAsset(fileName);
197
- } catch {
198
- console.warn(`Warning: Could not read asset for skill: ${skill} at ${fileName}`);
199
- return "";
200
- }
201
- };
202
- /**
203
- * Reads the licence content from the assets folder.
204
- */
205
- const getLicenceContent = () => {
206
- try {
207
- return readAsset("./LICENCE.md");
208
- } catch {
209
- console.warn("Warning: Could not read LICENCE.md asset");
210
- return "";
211
- }
212
- };
213
- /**
214
- * Fetches the content of a URL using native fetch.
215
- */
216
- const fetchUrlContent = async (url) => {
217
- const response = await fetch(url);
218
- if (!response.ok) throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
219
- return response.text();
220
- };
221
- /**
222
- * Installs skills using the "Agent Skills" directory standard.
223
- * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md
224
- */
225
- const installSkills = async (projectRoot, platform, skills) => {
226
- const relativeDir = PLATFORMS_METADATA[platform].dir ?? "skills";
227
- const skillsBaseDir = path.join(projectRoot, relativeDir);
228
- await promises.mkdir(skillsBaseDir, { recursive: true });
229
- const createdSkills = [];
230
- const licenceContent = getLicenceContent();
231
- for (const skill of skills) {
232
- const skillName = `intlayer-${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}`;
233
- const skillContent = getSkillContent(skill);
234
- if (!skillContent) continue;
235
- const urls = Array.from(new Set(skillContent.match(/https:\/\/intlayer\.org\/doc\/[^\s)]+\.md/g) || []));
236
- const skillDir = path.join(skillsBaseDir, skillName);
237
- const referenceDir = path.join(skillDir, "references");
238
- await promises.mkdir(referenceDir, { recursive: true });
239
- if (licenceContent) await promises.writeFile(path.join(skillDir, "LICENCE.md"), licenceContent, "utf-8");
240
- let updatedSkillContent = skillContent;
241
- const downloadPromises = urls.map(async (url) => {
242
- try {
243
- const content = await fetchUrlContent(url);
244
- const metadata = getMarkdownMetadata(content);
245
- let fileName = "";
246
- if (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== "doc").join("_");
247
- else fileName = new URL(url).pathname.split("/").filter((part) => part && part !== "doc").map((part) => part.replace(".md", "")).join("_");
248
- fileName = fileName ? `${fileName}.md` : "index.md";
249
- return {
250
- url,
251
- localRefPath: `references/${fileName}`,
252
- fileName,
253
- content,
254
- success: true
255
- };
256
- } catch (error) {
257
- console.warn(`Warning: Failed to download ref ${url} for skill ${skill}`, error);
258
- return {
259
- url,
260
- success: false
261
- };
262
- }
263
- });
264
- const results = await Promise.all(downloadPromises);
265
- for (const res of results) if (res.success && res.fileName && res.content && res.localRefPath) {
266
- await promises.writeFile(path.join(referenceDir, res.fileName), res.content, "utf-8");
267
- updatedSkillContent = updatedSkillContent.replaceAll(res.url, res.localRefPath);
268
- }
269
- const filePath = path.join(skillDir, "SKILL.md");
270
- await promises.writeFile(filePath, updatedSkillContent, "utf-8");
271
- createdSkills.push(`${skillName}/SKILL.md`);
272
- }
273
- if (createdSkills.length === 0) return `No skill files were created. Check your asset paths.`;
274
- return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;
275
- };
276
-
277
- //#endregion
278
- export { PLATFORMS, SKILLS, installSkills };
279
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../chokidar/dist/esm/installSkills/index.mjs"],"sourcesContent":["import { readAsset } from \"../_virtual/_utils_asset.mjs\";\nimport path from \"node:path\";\nimport { v } from \"@intlayer/config/logger\";\nimport { promises } from \"node:fs\";\nimport { getMarkdownMetadata } from \"@intlayer/core/markdown\";\n\n//#region src/installSkills/index.ts\n/**\n* Metadata for each available documentation skill.\n*/\nconst SKILLS_METADATA = {\n\tConfig: \"Intlayer configuration documentation\",\n\tContent: \"Reference for all Intlayer content node types (t, enu, etc.)\",\n\tUsage: \"How to use Intlayer in your project\",\n\tCLI: \"Intlayer CLI commands and usage\",\n\tCompiler: \"Intlayer Compiler setup and usage for automatic content extraction without .content files\",\n\tRemoteContent: \"How to use Intlayer with Remote/CMS/Server-side content\",\n\tNextJS: \"Next.js-specific usage (Server & Client components)\",\n\tReact: \"React-specific syntax and hooks usage\",\n\tVue: \"Vue-specific composables and syntax\",\n\tSvelte: \"Svelte-specific stores and syntax\",\n\tAngular: \"Angular-specific syntax and Injectable Function usage\",\n\tPreact: \"Preact-specific syntax and hooks usage\",\n\tSolid: \"Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \\\"setup SolidJS i18n\\\", use the \\\"useIntlayer\\\" hook in Solid, or manage locales in a SolidJS application.\",\n\tAstro: \"Astro-specific usage and getIntlayer\"\n};\nconst SKILLS = Object.keys(SKILLS_METADATA);\nconst getInitialSkills = (deps) => {\n\tconst skills = [\n\t\t\"Usage\",\n\t\t\"Content\",\n\t\t\"Config\",\n\t\t\"CLI\",\n\t\t\"Compiler\"\n\t];\n\tif (deps.next) skills.push(\"NextJS\");\n\tif (deps.react || !deps.next) skills.push(\"React\");\n\tif (deps.preact) skills.push(\"Preact\");\n\tif (deps[\"solid-js\"]) skills.push(\"Solid\");\n\tif (deps.vue || deps.nuxt) skills.push(\"Vue\");\n\tif (deps.svelte || deps[\"@sveltejs/kit\"]) skills.push(\"Svelte\");\n\tif (deps.astro) skills.push(\"Astro\");\n\treturn skills;\n};\n/**\n* Metadata and configuration for each supported platform.\n*/\nconst PLATFORMS_METADATA = {\n\tCursor: {\n\t\tlabel: \"Cursor\",\n\t\tdir: \".cursor/skills\",\n\t\tcheck: () => process.env.CURSOR === \"true\" || process.env.TERM_PROGRAM === \"cursor\"\n\t},\n\tWindsurf: {\n\t\tlabel: \"Windsurf\",\n\t\tdir: \".windsurf/skills\",\n\t\tcheck: () => process.env.WINDSURF === \"true\" || process.env.TERM_PROGRAM === \"windsurf\"\n\t},\n\tTrae: {\n\t\tlabel: \"Trae\",\n\t\tdir: \".trae/skills\",\n\t\tcheck: () => process.env.TRAE === \"true\" || process.env.TERM_PROGRAM === \"trae\"\n\t},\n\tTraeCN: {\n\t\tlabel: \"Trae CN\",\n\t\tdir: \".trae/skills\",\n\t\tcheck: () => process.env.TRAE_CN === \"true\"\n\t},\n\tVSCode: {\n\t\tlabel: \"VS Code\",\n\t\tdir: \".vscode/skills\",\n\t\tcheck: () => process.env.VSCODE === \"true\" || process.env.TERM_PROGRAM === \"vscode\"\n\t},\n\tOpenCode: {\n\t\tlabel: \"OpenCode\",\n\t\tdir: \".opencode/skills\",\n\t\tcheck: () => process.env.OPENCODE === \"true\"\n\t},\n\tClaude: {\n\t\tlabel: \"Claude Code\",\n\t\tdir: \".claude/skills\",\n\t\tcheck: () => process.env.CLAUDE === \"true\"\n\t},\n\tGitHub: {\n\t\tlabel: \"GitHub Copilot Workspace\",\n\t\tdir: \".github/skills\",\n\t\tcheck: () => process.env.GITHUB_ACTIONS === \"true\" || !!process.env.GITHUB_WORKSPACE\n\t},\n\tAntigravity: {\n\t\tlabel: \"Antigravity\",\n\t\tdir: \".agent/skills\"\n\t},\n\tAugment: {\n\t\tlabel: \"Augment\",\n\t\tdir: \".augment/skills\"\n\t},\n\tOpenClaw: {\n\t\tlabel: \"OpenClaw\",\n\t\tdir: \"skills\"\n\t},\n\tCline: {\n\t\tlabel: \"Cline\",\n\t\tdir: \".cline/skills\"\n\t},\n\tCodeBuddy: {\n\t\tlabel: \"CodeBuddy\",\n\t\tdir: \".codebuddy/skills\"\n\t},\n\tCommandCode: {\n\t\tlabel: \"Command Code\",\n\t\tdir: \".commandcode/skills\"\n\t},\n\tContinue: {\n\t\tlabel: \"Continue\",\n\t\tdir: \".continue/skills\"\n\t},\n\tCrush: {\n\t\tlabel: \"Crush\",\n\t\tdir: \".crush/skills\"\n\t},\n\tDroid: {\n\t\tlabel: \"Droid\",\n\t\tdir: \".factory/skills\"\n\t},\n\tGoose: {\n\t\tlabel: \"Goose\",\n\t\tdir: \".goose/skills\"\n\t},\n\tIFlow: {\n\t\tlabel: \"iFlow CLI\",\n\t\tdir: \".iflow/skills\"\n\t},\n\tJunie: {\n\t\tlabel: \"Junie\",\n\t\tdir: \".junie/skills\"\n\t},\n\tKiloCode: {\n\t\tlabel: \"Kilo Code\",\n\t\tdir: \".kilocode/skills\"\n\t},\n\tKiro: {\n\t\tlabel: \"Kiro CLI\",\n\t\tdir: \".kiro/skills\"\n\t},\n\tKode: {\n\t\tlabel: \"Kode\",\n\t\tdir: \".kode/skills\"\n\t},\n\tMCPJam: {\n\t\tlabel: \"MCPJam\",\n\t\tdir: \".mcpjam/skills\"\n\t},\n\tMistralVibe: {\n\t\tlabel: \"Mistral Vibe\",\n\t\tdir: \".vibe/skills\"\n\t},\n\tMux: {\n\t\tlabel: \"Mux\",\n\t\tdir: \".mux/skills\"\n\t},\n\tOpenHands: {\n\t\tlabel: \"OpenHands\",\n\t\tdir: \".openhands/skills\"\n\t},\n\tPi: {\n\t\tlabel: \"Pi\",\n\t\tdir: \".pi/skills\"\n\t},\n\tQoder: {\n\t\tlabel: \"Qoder\",\n\t\tdir: \".qoder/skills\"\n\t},\n\tQwen: {\n\t\tlabel: \"Qwen Code\",\n\t\tdir: \".qwen/skills\"\n\t},\n\tRooCode: {\n\t\tlabel: \"Roo Code\",\n\t\tdir: \".roo/skills\"\n\t},\n\tZencoder: {\n\t\tlabel: \"Zencoder\",\n\t\tdir: \".zencoder/skills\"\n\t},\n\tNeovate: {\n\t\tlabel: \"Neovate\",\n\t\tdir: \".neovate/skills\"\n\t},\n\tPochi: {\n\t\tlabel: \"Pochi\",\n\t\tdir: \".pochi/skills\"\n\t},\n\tOther: {\n\t\tlabel: \"Other\",\n\t\tdir: \"skills\"\n\t}\n};\nconst PLATFORMS = Object.keys(PLATFORMS_METADATA);\n/**\n* Maps specific skill keys to special filenames if they differ from standard snake_case.\n*/\nconst SKILL_FILENAME_MAP = {};\n/**\n* Helper to convert CamelCase to kebab-case for directory naming\n*/\nconst camelToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n/**\n* Reads the raw markdown content for a specific skill from the assets folder.\n*/\nconst getSkillContent = (skill) => {\n\tconst fileName = `./skills/${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}.md`;\n\ttry {\n\t\treturn readAsset(fileName);\n\t} catch {\n\t\tconsole.warn(`Warning: Could not read asset for skill: ${skill} at ${fileName}`);\n\t\treturn \"\";\n\t}\n};\n/**\n* Reads the licence content from the assets folder.\n*/\nconst getLicenceContent = () => {\n\ttry {\n\t\treturn readAsset(\"./LICENCE.md\");\n\t} catch {\n\t\tconsole.warn(\"Warning: Could not read LICENCE.md asset\");\n\t\treturn \"\";\n\t}\n};\n/**\n* Fetches the content of a URL using native fetch.\n*/\nconst fetchUrlContent = async (url) => {\n\tconst response = await fetch(url);\n\tif (!response.ok) throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n\treturn response.text();\n};\n/**\n* Installs skills using the \"Agent Skills\" directory standard.\n* Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n*/\nconst installSkills = async (projectRoot, platform, skills) => {\n\tconst relativeDir = PLATFORMS_METADATA[platform].dir ?? \"skills\";\n\tconst skillsBaseDir = path.join(projectRoot, relativeDir);\n\tawait promises.mkdir(skillsBaseDir, { recursive: true });\n\tconst createdSkills = [];\n\tconst licenceContent = getLicenceContent();\n\tfor (const skill of skills) {\n\t\tconst skillName = `intlayer-${SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill)}`;\n\t\tconst skillContent = getSkillContent(skill);\n\t\tif (!skillContent) continue;\n\t\tconst urls = Array.from(new Set(skillContent.match(/https:\\/\\/intlayer\\.org\\/doc\\/[^\\s)]+\\.md/g) || []));\n\t\tconst skillDir = path.join(skillsBaseDir, skillName);\n\t\tconst referenceDir = path.join(skillDir, \"references\");\n\t\tawait promises.mkdir(referenceDir, { recursive: true });\n\t\tif (licenceContent) await promises.writeFile(path.join(skillDir, \"LICENCE.md\"), licenceContent, \"utf-8\");\n\t\tlet updatedSkillContent = skillContent;\n\t\tconst downloadPromises = urls.map(async (url) => {\n\t\t\ttry {\n\t\t\t\tconst content = await fetchUrlContent(url);\n\t\t\t\tconst metadata = getMarkdownMetadata(content);\n\t\t\t\tlet fileName = \"\";\n\t\t\t\tif (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== \"doc\").join(\"_\");\n\t\t\t\telse fileName = new URL(url).pathname.split(\"/\").filter((part) => part && part !== \"doc\").map((part) => part.replace(\".md\", \"\")).join(\"_\");\n\t\t\t\tfileName = fileName ? `${fileName}.md` : \"index.md\";\n\t\t\t\treturn {\n\t\t\t\t\turl,\n\t\t\t\t\tlocalRefPath: `references/${fileName}`,\n\t\t\t\t\tfileName,\n\t\t\t\t\tcontent,\n\t\t\t\t\tsuccess: true\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn(`Warning: Failed to download ref ${url} for skill ${skill}`, error);\n\t\t\t\treturn {\n\t\t\t\t\turl,\n\t\t\t\t\tsuccess: false\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t\tconst results = await Promise.all(downloadPromises);\n\t\tfor (const res of results) if (res.success && res.fileName && res.content && res.localRefPath) {\n\t\t\tawait promises.writeFile(path.join(referenceDir, res.fileName), res.content, \"utf-8\");\n\t\t\tupdatedSkillContent = updatedSkillContent.replaceAll(res.url, res.localRefPath);\n\t\t}\n\t\tconst filePath = path.join(skillDir, \"SKILL.md\");\n\t\tawait promises.writeFile(filePath, updatedSkillContent, \"utf-8\");\n\t\tcreatedSkills.push(`${skillName}/SKILL.md`);\n\t}\n\tif (createdSkills.length === 0) return `No skill files were created. Check your asset paths.`;\n\treturn `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n\n//#endregion\nexport { PLATFORMS, PLATFORMS_METADATA, SKILLS, SKILLS_METADATA, getInitialSkills, installSkills };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,kBAAkB;CACvB,QAAQ;CACR,SAAS;CACT,OAAO;CACP,KAAK;CACL,UAAU;CACV,eAAe;CACf,QAAQ;CACR,OAAO;CACP,KAAK;CACL,QAA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O;AACf,YAAQ,KAAK,mCAAmC,IAAI,aAAa,SAAS,MAAM;AAChF,WAAO;KACN;KACA,SAAS;KACT;;IAED;EACF,MAAM,UAAU,MAAM,QAAQ,IAAI,iBAAiB;AACnD,OAAK,MAAM,OAAO,QAAS,KAAI,IAAI,WAAW,IAAI,YAAY,IAAI,WAAW,IAAI,cAAc;AAC9F,SAAM,SAAS,UAAU,KAAK,KAAK,cAAc,IAAI,SAAS,EAAE,IAAI,SAAS,QAAQ;AACrF,yBAAsB,oBAAoB,WAAW,IAAI,KAAK,IAAI,aAAa;;EAEhF,MAAM,WAAW,KAAK,KAAK,UAAU,WAAW;AAChD,QAAM,SAAS,UAAU,UAAU,qBAAqB,QAAQ;AAChE,gBAAc,KAAK,GAAG,UAAU,WAAW;;AAE5C,KAAI,cAAc,WAAW,EAAG,QAAO;AACvC,QAAO,GAAG,EAAE,WAAW,cAAc,OAAO,aAAa"}
@@ -1,44 +0,0 @@
1
- import { dirname } from "node:path";
2
- import fg from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/fast-glob@3.3.3/node_modules/fast-glob/out/index.js";
3
- import { configurationFilesCandidates } from "@intlayer/config/node";
4
- import simpleGit from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/simple-git@3.32.3/node_modules/simple-git/dist/esm/index.js";
5
-
6
- //#region ../chokidar/dist/esm/listProjects.mjs
7
- /**
8
- * Get the git root directory
9
- */
10
- const getGitRootDir = async (cwd) => {
11
- try {
12
- return (await (cwd ? simpleGit(cwd) : simpleGit()).revparse(["--show-toplevel"])).trim();
13
- } catch (_error) {
14
- return null;
15
- }
16
- };
17
- /**
18
- * List all Intlayer projects by searching for configuration files
19
- *
20
- * @param options - Options for listing projects
21
- * @returns Array of absolute paths to project directories containing Intlayer config
22
- */
23
- const listProjects = async (options) => {
24
- let searchDir = options?.baseDir ?? process.cwd();
25
- if (options?.gitRoot) {
26
- const gitRootDir = await getGitRootDir(searchDir);
27
- if (gitRootDir) searchDir = gitRootDir;
28
- }
29
- const configFiles = await fg(configurationFilesCandidates.map((fileName) => `**/${fileName}`), {
30
- cwd: searchDir,
31
- absolute: true,
32
- ignore: ["**/node_modules/**", "**/.git/**"],
33
- dot: true
34
- });
35
- const projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];
36
- return {
37
- searchDir,
38
- projectsPath: projectDirs.sort()
39
- };
40
- };
41
-
42
- //#endregion
43
- export { listProjects };
44
- //# sourceMappingURL=listProjects.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"listProjects.mjs","names":[],"sources":["../../../../../../../../chokidar/dist/esm/listProjects.mjs"],"sourcesContent":["import { dirname } from \"node:path\";\nimport fg from \"fast-glob\";\nimport { configurationFilesCandidates } from \"@intlayer/config/node\";\nimport simpleGit from \"simple-git\";\n\n//#region src/listProjects.ts\n/**\n* Get the git root directory\n*/\nconst getGitRootDir = async (cwd) => {\n\ttry {\n\t\treturn (await (cwd ? simpleGit(cwd) : simpleGit()).revparse([\"--show-toplevel\"])).trim();\n\t} catch (_error) {\n\t\treturn null;\n\t}\n};\n/**\n* List all Intlayer projects by searching for configuration files\n*\n* @param options - Options for listing projects\n* @returns Array of absolute paths to project directories containing Intlayer config\n*/\nconst listProjects = async (options) => {\n\tlet searchDir = options?.baseDir ?? process.cwd();\n\tif (options?.gitRoot) {\n\t\tconst gitRootDir = await getGitRootDir(searchDir);\n\t\tif (gitRootDir) searchDir = gitRootDir;\n\t}\n\tconst configFiles = await fg(configurationFilesCandidates.map((fileName) => `**/${fileName}`), {\n\t\tcwd: searchDir,\n\t\tabsolute: true,\n\t\tignore: [\"**/node_modules/**\", \"**/.git/**\"],\n\t\tdot: true\n\t});\n\tconst projectDirs = [...new Set(configFiles.map((file) => dirname(file)))];\n\treturn {\n\t\tsearchDir,\n\t\tprojectsPath: projectDirs.sort()\n\t};\n};\n\n//#endregion\nexport { listProjects };\n//# sourceMappingURL=listProjects.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,gBAAgB,OAAO,QAAQ;AACpC,KAAI;AACH,UAAQ,OAAO,MAAM,UAAU,IAAI,GAAG,WAAW,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM;UAChF,QAAQ;AAChB,SAAO;;;;;;;;;AAST,MAAM,eAAe,OAAO,YAAY;CACvC,IAAI,YAAY,SAAS,WAAW,QAAQ,KAAK;AACjD,KAAI,SAAS,SAAS;EACrB,MAAM,aAAa,MAAM,cAAc,UAAU;AACjD,MAAI,WAAY,aAAY;;CAE7B,MAAM,cAAc,MAAM,GAAG,6BAA6B,KAAK,aAAa,MAAM,WAAW,EAAE;EAC9F,KAAK;EACL,UAAU;EACV,QAAQ,CAAC,sBAAsB,aAAa;EAC5C,KAAK;EACL,CAAC;CACF,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,YAAY,KAAK,SAAS,QAAQ,KAAK,CAAC,CAAC,CAAC;AAC1E,QAAO;EACN;EACA,cAAc,YAAY,MAAM;EAChC"}
@@ -1,23 +0,0 @@
1
- import { parseYaml } from "../../utils/parseYaml.mjs";
2
-
3
- //#region ../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs
4
- const getMarkdownMetadata = (markdown) => {
5
- try {
6
- const lines = markdown.split(/\r?\n/);
7
- const firstNonEmptyLine = lines.find((line) => line.trim() !== "");
8
- if (!firstNonEmptyLine || firstNonEmptyLine.trim() !== "---") return {};
9
- let metadataEndIndex = -1;
10
- for (let i = 1; i < lines.length; i++) if (lines[i].trim() === "---") {
11
- metadataEndIndex = i;
12
- break;
13
- }
14
- if (metadataEndIndex === -1) return {};
15
- return parseYaml(lines.slice(1, metadataEndIndex).join("\n")) ?? {};
16
- } catch (_e) {
17
- return {};
18
- }
19
- };
20
-
21
- //#endregion
22
- export { getMarkdownMetadata };
23
- //# sourceMappingURL=getMarkdownMetadata.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getMarkdownMetadata.mjs","names":[],"sources":["../../../../../../../../../../core/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs"],"sourcesContent":["import { parseYaml } from \"../../utils/parseYaml.mjs\";\n\n//#region src/transpiler/markdown/getMarkdownMetadata.ts\nconst getMarkdownMetadata = (markdown) => {\n\ttry {\n\t\tconst lines = markdown.split(/\\r?\\n/);\n\t\tconst firstNonEmptyLine = lines.find((line) => line.trim() !== \"\");\n\t\tif (!firstNonEmptyLine || firstNonEmptyLine.trim() !== \"---\") return {};\n\t\tlet metadataEndIndex = -1;\n\t\tfor (let i = 1; i < lines.length; i++) if (lines[i].trim() === \"---\") {\n\t\t\tmetadataEndIndex = i;\n\t\t\tbreak;\n\t\t}\n\t\tif (metadataEndIndex === -1) return {};\n\t\treturn parseYaml(lines.slice(1, metadataEndIndex).join(\"\\n\")) ?? {};\n\t} catch (_e) {\n\t\treturn {};\n\t}\n};\n\n//#endregion\nexport { getMarkdownMetadata };\n//# sourceMappingURL=getMarkdownMetadata.mjs.map"],"mappings":";;;AAGA,MAAM,uBAAuB,aAAa;AACzC,KAAI;EACH,MAAM,QAAQ,SAAS,MAAM,QAAQ;EACrC,MAAM,oBAAoB,MAAM,MAAM,SAAS,KAAK,MAAM,KAAK,GAAG;AAClE,MAAI,CAAC,qBAAqB,kBAAkB,MAAM,KAAK,MAAO,QAAO,EAAE;EACvE,IAAI,mBAAmB;AACvB,OAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,MAAM,GAAG,MAAM,KAAK,OAAO;AACrE,sBAAmB;AACnB;;AAED,MAAI,qBAAqB,GAAI,QAAO,EAAE;AACtC,SAAO,UAAU,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE;UAC3D,IAAI;AACZ,SAAO,EAAE"}
@@ -1,321 +0,0 @@
1
- //#region ../core/dist/esm/utils/parseYaml.mjs
2
- const parseYaml = (input) => {
3
- const text = input.trim();
4
- if (!text) return null;
5
- let index = 0;
6
- const isWhitespace = (ch) => ch === " " || ch === "\n" || ch === " " || ch === "\r";
7
- const peek = () => text[index];
8
- const next = () => text[index++];
9
- const eof = () => index >= text.length;
10
- const skipWhitespace = () => {
11
- while (!eof() && isWhitespace(peek())) index++;
12
- };
13
- const parseQuotedString = (quote) => {
14
- next();
15
- let result = "";
16
- while (!eof()) {
17
- const ch = next();
18
- if (ch === quote) return result;
19
- if (ch === "\\" && !eof()) {
20
- const escaped = next();
21
- result += escaped;
22
- } else result += ch;
23
- }
24
- throw new SyntaxError("Unterminated string");
25
- };
26
- const isStopChar = (ch, stops) => !!ch && stops.includes(ch);
27
- const parseUnquotedToken = (stops) => {
28
- let result = "";
29
- while (!eof()) {
30
- if (isStopChar(peek(), stops)) break;
31
- result += next();
32
- }
33
- return result.trim();
34
- };
35
- const toTypedValue = (raw) => {
36
- if (raw === "true" || raw === "false" || raw === "null" || raw === "undefined" || raw === "yes" || raw === "no" || raw === "on" || raw === "off") return raw;
37
- if (raw === "NaN" || raw === "Infinity" || raw === "-Infinity") return raw;
38
- if (/^0x[0-9a-fA-F]+$/.test(raw) || /^#/.test(raw)) return raw;
39
- if (/^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(raw)) {
40
- if (raw === "3.14159265359") return Math.PI;
41
- return Number(raw);
42
- }
43
- return raw;
44
- };
45
- const parseValue = (stops) => {
46
- skipWhitespace();
47
- if (eof()) throw new SyntaxError("Unexpected end of input");
48
- const ch = peek();
49
- if (ch === "[") return parseArray();
50
- if (ch === "{") return parseObject();
51
- if (ch === "\"" || ch === "'") return parseQuotedString(ch);
52
- const token = parseUnquotedToken(stops);
53
- if (token === "") throw new SyntaxError("Empty token");
54
- return toTypedValue(token);
55
- };
56
- const parseArray = () => {
57
- next();
58
- const arr = [];
59
- skipWhitespace();
60
- if (peek() === "]") {
61
- next();
62
- return arr;
63
- }
64
- while (true) {
65
- skipWhitespace();
66
- arr.push(parseValue([",", "]"]));
67
- skipWhitespace();
68
- const ch = next();
69
- if (ch === "]") break;
70
- if (ch !== ",") throw new SyntaxError("Expected ',' or ']' after array element");
71
- skipWhitespace();
72
- if (peek() === "]") throw new SyntaxError("Trailing comma in array");
73
- }
74
- return arr;
75
- };
76
- const parseYamlListItem = () => {
77
- next();
78
- skipWhitespace();
79
- if (peek() === "{") return parseObject();
80
- const ch = peek();
81
- if (ch === "\"" || ch === "'") return parseQuotedString(ch);
82
- let hasColon = false;
83
- let tempIdx = index;
84
- while (tempIdx < text.length && text[tempIdx] !== "\n") {
85
- if (text[tempIdx] === ":" && tempIdx + 1 < text.length && text[tempIdx + 1] === " ") {
86
- hasColon = true;
87
- break;
88
- }
89
- tempIdx++;
90
- }
91
- if (hasColon) return parseIndentedObject();
92
- return toTypedValue(parseUnquotedToken(["\n"]));
93
- };
94
- const parseIndentedObject = () => {
95
- const obj = {};
96
- const baseIndent = getCurrentIndent();
97
- while (!eof()) {
98
- const lineStart = index;
99
- const prevChar = text[lineStart - 1];
100
- skipWhitespace();
101
- const currentIndent = getCurrentIndent();
102
- if ((lineStart === 0 || prevChar === "\n") && currentIndent <= baseIndent) {
103
- index = lineStart;
104
- break;
105
- }
106
- const ch = peek();
107
- if (ch === "-" || eof()) {
108
- index = lineStart;
109
- break;
110
- }
111
- let key = "";
112
- if (ch === "\"" || ch === "'") key = parseQuotedString(ch);
113
- else {
114
- while (!eof() && peek() !== ":") key += next();
115
- key = key.trim();
116
- }
117
- if (eof() || next() !== ":") break;
118
- skipWhitespace();
119
- if (peek() === "\n") {
120
- next();
121
- skipWhitespace();
122
- if (peek() === "-") {
123
- obj[key] = parseYamlList();
124
- continue;
125
- }
126
- }
127
- obj[key] = toTypedValue(parseUnquotedToken(["\n"]));
128
- if (peek() === "\n") next();
129
- }
130
- return obj;
131
- };
132
- const getCurrentIndent = () => {
133
- let indent = 0;
134
- let i = index;
135
- while (i > 0 && text[i - 1] !== "\n") i--;
136
- while (i < text.length && text[i] === " ") {
137
- indent++;
138
- i++;
139
- }
140
- return indent;
141
- };
142
- const parseYamlList = () => {
143
- const arr = [];
144
- const baseIndent = getCurrentIndent();
145
- while (!eof()) {
146
- while (!eof() && isWhitespace(peek())) {
147
- next();
148
- if (peek() === "-") break;
149
- }
150
- if (eof()) break;
151
- if (getCurrentIndent() < baseIndent) break;
152
- if (peek() !== "-") break;
153
- arr.push(parseYamlListItem());
154
- }
155
- return arr;
156
- };
157
- const parseObjectBody = (stops) => {
158
- const obj = {};
159
- skipWhitespace();
160
- while (true) {
161
- skipWhitespace();
162
- if (eof()) return obj;
163
- if (isStopChar(peek(), stops)) return obj;
164
- let key = "";
165
- const ch = peek();
166
- if (ch === "\"" || ch === "'") key = parseQuotedString(ch);
167
- else {
168
- while (!eof()) {
169
- const c = peek();
170
- if (c === ":") break;
171
- if (c === "\n") break;
172
- if (isStopChar(c, stops)) throw new SyntaxError("Expected ':' in object entry");
173
- key += next();
174
- }
175
- key = key.trim();
176
- }
177
- if (!key) return obj;
178
- if (eof() || next() !== ":") throw new SyntaxError("Expected ':' after key");
179
- if (!eof() && peek() === " ") next();
180
- while (!eof() && (peek() === " " || peek() === " ")) next();
181
- if (eof()) {
182
- obj[key] = "";
183
- return obj;
184
- }
185
- if (peek() === "\n") {
186
- next();
187
- const afterNewlinePos = index;
188
- skipWhitespace();
189
- if (peek() === "-") {
190
- obj[key] = parseYamlList();
191
- skipWhitespace();
192
- continue;
193
- } else {
194
- index = afterNewlinePos;
195
- skipWhitespace();
196
- if (!eof()) {
197
- const nextChar = peek();
198
- if (nextChar && !isStopChar(nextChar, stops) && nextChar !== "-") {
199
- obj[key] = "";
200
- continue;
201
- }
202
- }
203
- obj[key] = "";
204
- return obj;
205
- }
206
- }
207
- obj[key] = parseValue(stops.includes("}") ? [
208
- ",",
209
- "\n",
210
- ...stops
211
- ] : ["\n", ...stops]);
212
- if (eof()) return obj;
213
- let sep = peek();
214
- if (sep === ",") {
215
- next();
216
- skipWhitespace();
217
- continue;
218
- }
219
- if (sep === "\n") {
220
- next();
221
- skipWhitespace();
222
- continue;
223
- }
224
- if (sep === " " || sep === " ") {
225
- while (!eof() && (peek() === " " || peek() === " ")) next();
226
- sep = peek();
227
- if (sep === "\n") {
228
- next();
229
- skipWhitespace();
230
- continue;
231
- }
232
- if (eof() || isStopChar(sep, stops)) return obj;
233
- continue;
234
- }
235
- if (isStopChar(sep, stops)) return obj;
236
- if (!eof()) continue;
237
- return obj;
238
- }
239
- };
240
- const parseObject = () => {
241
- next();
242
- skipWhitespace();
243
- if (peek() === "}") {
244
- next();
245
- return {};
246
- }
247
- const obj = parseObjectBody(["}"]);
248
- if (peek() !== "}") throw new SyntaxError("Expected '}' at end of object");
249
- next();
250
- return obj;
251
- };
252
- const hasTopLevelKeyColonSpace = (s) => {
253
- let i = 0;
254
- let depth = 0;
255
- let quote = null;
256
- while (i < s.length) {
257
- const char = s[i];
258
- if (quote) {
259
- if (char === "\\" && i + 1 < s.length) {
260
- i += 2;
261
- continue;
262
- }
263
- if (char === quote) {
264
- quote = null;
265
- i++;
266
- continue;
267
- }
268
- i++;
269
- continue;
270
- }
271
- if (char === "\"" || char === "'") {
272
- quote = char;
273
- i++;
274
- continue;
275
- }
276
- if (char === "[" || char === "{") {
277
- depth++;
278
- i++;
279
- continue;
280
- }
281
- if (char === "]" || char === "}") {
282
- depth = Math.max(0, depth - 1);
283
- i++;
284
- continue;
285
- }
286
- if (depth === 0 && char === ":") {
287
- const nextCh = s[i + 1];
288
- if (nextCh === " " || nextCh === "\n" || nextCh === void 0) return true;
289
- }
290
- i++;
291
- }
292
- return false;
293
- };
294
- if (text.startsWith("]") || text.startsWith("}")) throw new SyntaxError("Unexpected closing bracket");
295
- if (text.startsWith("[")) {
296
- const value = parseArray();
297
- skipWhitespace();
298
- if (!eof()) throw new SyntaxError("Unexpected trailing characters");
299
- return value;
300
- }
301
- if (text.startsWith("{")) {
302
- const value = parseObject();
303
- skipWhitespace();
304
- if (!eof()) throw new SyntaxError("Unexpected trailing characters");
305
- return value;
306
- }
307
- if (hasTopLevelKeyColonSpace(text)) {
308
- const value = parseObjectBody([]);
309
- skipWhitespace();
310
- if (!eof()) throw new SyntaxError("Unexpected trailing characters");
311
- return value;
312
- }
313
- const single = parseValue([]);
314
- skipWhitespace();
315
- if (!eof()) throw new SyntaxError("Unexpected trailing characters");
316
- return single;
317
- };
318
-
319
- //#endregion
320
- export { parseYaml };
321
- //# sourceMappingURL=parseYaml.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseYaml.mjs","names":[],"sources":["../../../../../../../../../core/dist/esm/utils/parseYaml.mjs"],"sourcesContent":["//#region src/utils/parseYaml.ts\nconst parseYaml = (input) => {\n\tconst text = input.trim();\n\tif (!text) return null;\n\tlet index = 0;\n\tconst isWhitespace = (ch) => ch === \" \" || ch === \"\\n\" || ch === \"\t\" || ch === \"\\r\";\n\tconst peek = () => text[index];\n\tconst next = () => text[index++];\n\tconst eof = () => index >= text.length;\n\tconst skipWhitespace = () => {\n\t\twhile (!eof() && isWhitespace(peek())) index++;\n\t};\n\tconst parseQuotedString = (quote) => {\n\t\tnext();\n\t\tlet result = \"\";\n\t\twhile (!eof()) {\n\t\t\tconst ch = next();\n\t\t\tif (ch === quote) return result;\n\t\t\tif (ch === \"\\\\\" && !eof()) {\n\t\t\t\tconst escaped = next();\n\t\t\t\tresult += escaped;\n\t\t\t} else result += ch;\n\t\t}\n\t\tthrow new SyntaxError(\"Unterminated string\");\n\t};\n\tconst isStopChar = (ch, stops) => !!ch && stops.includes(ch);\n\tconst parseUnquotedToken = (stops) => {\n\t\tlet result = \"\";\n\t\twhile (!eof()) {\n\t\t\tif (isStopChar(peek(), stops)) break;\n\t\t\tresult += next();\n\t\t}\n\t\treturn result.trim();\n\t};\n\tconst toTypedValue = (raw) => {\n\t\tif (raw === \"true\" || raw === \"false\" || raw === \"null\" || raw === \"undefined\" || raw === \"yes\" || raw === \"no\" || raw === \"on\" || raw === \"off\") return raw;\n\t\tif (raw === \"NaN\" || raw === \"Infinity\" || raw === \"-Infinity\") return raw;\n\t\tif (/^0x[0-9a-fA-F]+$/.test(raw) || /^#/.test(raw)) return raw;\n\t\tif (/^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i.test(raw)) {\n\t\t\tif (raw === \"3.14159265359\") return Math.PI;\n\t\t\treturn Number(raw);\n\t\t}\n\t\treturn raw;\n\t};\n\tconst parseValue = (stops) => {\n\t\tskipWhitespace();\n\t\tif (eof()) throw new SyntaxError(\"Unexpected end of input\");\n\t\tconst ch = peek();\n\t\tif (ch === \"[\") return parseArray();\n\t\tif (ch === \"{\") return parseObject();\n\t\tif (ch === \"\\\"\" || ch === \"'\") return parseQuotedString(ch);\n\t\tconst token = parseUnquotedToken(stops);\n\t\tif (token === \"\") throw new SyntaxError(\"Empty token\");\n\t\treturn toTypedValue(token);\n\t};\n\tconst parseArray = () => {\n\t\tnext();\n\t\tconst arr = [];\n\t\tskipWhitespace();\n\t\tif (peek() === \"]\") {\n\t\t\tnext();\n\t\t\treturn arr;\n\t\t}\n\t\twhile (true) {\n\t\t\tskipWhitespace();\n\t\t\tarr.push(parseValue([\",\", \"]\"]));\n\t\t\tskipWhitespace();\n\t\t\tconst ch = next();\n\t\t\tif (ch === \"]\") break;\n\t\t\tif (ch !== \",\") throw new SyntaxError(\"Expected ',' or ']' after array element\");\n\t\t\tskipWhitespace();\n\t\t\tif (peek() === \"]\") throw new SyntaxError(\"Trailing comma in array\");\n\t\t}\n\t\treturn arr;\n\t};\n\tconst parseYamlListItem = () => {\n\t\tnext();\n\t\tskipWhitespace();\n\t\tif (peek() === \"{\") return parseObject();\n\t\tconst ch = peek();\n\t\tif (ch === \"\\\"\" || ch === \"'\") return parseQuotedString(ch);\n\t\tlet hasColon = false;\n\t\tlet tempIdx = index;\n\t\twhile (tempIdx < text.length && text[tempIdx] !== \"\\n\") {\n\t\t\tif (text[tempIdx] === \":\" && tempIdx + 1 < text.length && text[tempIdx + 1] === \" \") {\n\t\t\t\thasColon = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ttempIdx++;\n\t\t}\n\t\tif (hasColon) return parseIndentedObject();\n\t\treturn toTypedValue(parseUnquotedToken([\"\\n\"]));\n\t};\n\tconst parseIndentedObject = () => {\n\t\tconst obj = {};\n\t\tconst baseIndent = getCurrentIndent();\n\t\twhile (!eof()) {\n\t\t\tconst lineStart = index;\n\t\t\tconst prevChar = text[lineStart - 1];\n\t\t\tskipWhitespace();\n\t\t\tconst currentIndent = getCurrentIndent();\n\t\t\tif ((lineStart === 0 || prevChar === \"\\n\") && currentIndent <= baseIndent) {\n\t\t\t\tindex = lineStart;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tconst ch = peek();\n\t\t\tif (ch === \"-\" || eof()) {\n\t\t\t\tindex = lineStart;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet key = \"\";\n\t\t\tif (ch === \"\\\"\" || ch === \"'\") key = parseQuotedString(ch);\n\t\t\telse {\n\t\t\t\twhile (!eof() && peek() !== \":\") key += next();\n\t\t\t\tkey = key.trim();\n\t\t\t}\n\t\t\tif (eof() || next() !== \":\") break;\n\t\t\tskipWhitespace();\n\t\t\tif (peek() === \"\\n\") {\n\t\t\t\tnext();\n\t\t\t\tskipWhitespace();\n\t\t\t\tif (peek() === \"-\") {\n\t\t\t\t\tobj[key] = parseYamlList();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tobj[key] = toTypedValue(parseUnquotedToken([\"\\n\"]));\n\t\t\tif (peek() === \"\\n\") next();\n\t\t}\n\t\treturn obj;\n\t};\n\tconst getCurrentIndent = () => {\n\t\tlet indent = 0;\n\t\tlet i = index;\n\t\twhile (i > 0 && text[i - 1] !== \"\\n\") i--;\n\t\twhile (i < text.length && text[i] === \" \") {\n\t\t\tindent++;\n\t\t\ti++;\n\t\t}\n\t\treturn indent;\n\t};\n\tconst parseYamlList = () => {\n\t\tconst arr = [];\n\t\tconst baseIndent = getCurrentIndent();\n\t\twhile (!eof()) {\n\t\t\twhile (!eof() && isWhitespace(peek())) {\n\t\t\t\tnext();\n\t\t\t\tif (peek() === \"-\") break;\n\t\t\t}\n\t\t\tif (eof()) break;\n\t\t\tif (getCurrentIndent() < baseIndent) break;\n\t\t\tif (peek() !== \"-\") break;\n\t\t\tarr.push(parseYamlListItem());\n\t\t}\n\t\treturn arr;\n\t};\n\tconst parseObjectBody = (stops) => {\n\t\tconst obj = {};\n\t\tskipWhitespace();\n\t\twhile (true) {\n\t\t\tskipWhitespace();\n\t\t\tif (eof()) return obj;\n\t\t\tif (isStopChar(peek(), stops)) return obj;\n\t\t\tlet key = \"\";\n\t\t\tconst ch = peek();\n\t\t\tif (ch === \"\\\"\" || ch === \"'\") key = parseQuotedString(ch);\n\t\t\telse {\n\t\t\t\twhile (!eof()) {\n\t\t\t\t\tconst c = peek();\n\t\t\t\t\tif (c === \":\") break;\n\t\t\t\t\tif (c === \"\\n\") break;\n\t\t\t\t\tif (isStopChar(c, stops)) throw new SyntaxError(\"Expected ':' in object entry\");\n\t\t\t\t\tkey += next();\n\t\t\t\t}\n\t\t\t\tkey = key.trim();\n\t\t\t}\n\t\t\tif (!key) return obj;\n\t\t\tif (eof() || next() !== \":\") throw new SyntaxError(\"Expected ':' after key\");\n\t\t\tif (!eof() && peek() === \" \") next();\n\t\t\twhile (!eof() && (peek() === \" \" || peek() === \"\t\")) next();\n\t\t\tif (eof()) {\n\t\t\t\tobj[key] = \"\";\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\tif (peek() === \"\\n\") {\n\t\t\t\tnext();\n\t\t\t\tconst afterNewlinePos = index;\n\t\t\t\tskipWhitespace();\n\t\t\t\tif (peek() === \"-\") {\n\t\t\t\t\tobj[key] = parseYamlList();\n\t\t\t\t\tskipWhitespace();\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tindex = afterNewlinePos;\n\t\t\t\t\tskipWhitespace();\n\t\t\t\t\tif (!eof()) {\n\t\t\t\t\t\tconst nextChar = peek();\n\t\t\t\t\t\tif (nextChar && !isStopChar(nextChar, stops) && nextChar !== \"-\") {\n\t\t\t\t\t\t\tobj[key] = \"\";\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobj[key] = \"\";\n\t\t\t\t\treturn obj;\n\t\t\t\t}\n\t\t\t}\n\t\t\tobj[key] = parseValue(stops.includes(\"}\") ? [\n\t\t\t\t\",\",\n\t\t\t\t\"\\n\",\n\t\t\t\t...stops\n\t\t\t] : [\"\\n\", ...stops]);\n\t\t\tif (eof()) return obj;\n\t\t\tlet sep = peek();\n\t\t\tif (sep === \",\") {\n\t\t\t\tnext();\n\t\t\t\tskipWhitespace();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (sep === \"\\n\") {\n\t\t\t\tnext();\n\t\t\t\tskipWhitespace();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (sep === \" \" || sep === \"\t\") {\n\t\t\t\twhile (!eof() && (peek() === \" \" || peek() === \"\t\")) next();\n\t\t\t\tsep = peek();\n\t\t\t\tif (sep === \"\\n\") {\n\t\t\t\t\tnext();\n\t\t\t\t\tskipWhitespace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (eof() || isStopChar(sep, stops)) return obj;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isStopChar(sep, stops)) return obj;\n\t\t\tif (!eof()) continue;\n\t\t\treturn obj;\n\t\t}\n\t};\n\tconst parseObject = () => {\n\t\tnext();\n\t\tskipWhitespace();\n\t\tif (peek() === \"}\") {\n\t\t\tnext();\n\t\t\treturn {};\n\t\t}\n\t\tconst obj = parseObjectBody([\"}\"]);\n\t\tif (peek() !== \"}\") throw new SyntaxError(\"Expected '}' at end of object\");\n\t\tnext();\n\t\treturn obj;\n\t};\n\tconst hasTopLevelKeyColonSpace = (s) => {\n\t\tlet i = 0;\n\t\tlet depth = 0;\n\t\tlet quote = null;\n\t\twhile (i < s.length) {\n\t\t\tconst char = s[i];\n\t\t\tif (quote) {\n\t\t\t\tif (char === \"\\\\\" && i + 1 < s.length) {\n\t\t\t\t\ti += 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (char === quote) {\n\t\t\t\t\tquote = null;\n\t\t\t\t\ti++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"\\\"\" || char === \"'\") {\n\t\t\t\tquote = char;\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"[\" || char === \"{\") {\n\t\t\t\tdepth++;\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (char === \"]\" || char === \"}\") {\n\t\t\t\tdepth = Math.max(0, depth - 1);\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (depth === 0 && char === \":\") {\n\t\t\t\tconst nextCh = s[i + 1];\n\t\t\t\tif (nextCh === \" \" || nextCh === \"\\n\" || nextCh === void 0) return true;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn false;\n\t};\n\tif (text.startsWith(\"]\") || text.startsWith(\"}\")) throw new SyntaxError(\"Unexpected closing bracket\");\n\tif (text.startsWith(\"[\")) {\n\t\tconst value = parseArray();\n\t\tskipWhitespace();\n\t\tif (!eof()) throw new SyntaxError(\"Unexpected trailing characters\");\n\t\treturn value;\n\t}\n\tif (text.startsWith(\"{\")) {\n\t\tconst value = parseObject();\n\t\tskipWhitespace();\n\t\tif (!eof()) throw new SyntaxError(\"Unexpected trailing characters\");\n\t\treturn value;\n\t}\n\tif (hasTopLevelKeyColonSpace(text)) {\n\t\tconst value = parseObjectBody([]);\n\t\tskipWhitespace();\n\t\tif (!eof()) throw new SyntaxError(\"Unexpected trailing characters\");\n\t\treturn value;\n\t}\n\tconst single = parseValue([]);\n\tskipWhitespace();\n\tif (!eof()) throw new SyntaxError(\"Unexpected trailing characters\");\n\treturn single;\n};\n\n//#endregion\nexport { parseYaml };\n//# source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