@nicnocquee/dataqueue 1.33.0 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/build-docs-content.ts +96 -0
- package/ai/build-llms-full.ts +42 -0
- package/ai/docs-content.json +278 -0
- package/ai/rules/advanced.md +94 -0
- package/ai/rules/basic.md +90 -0
- package/ai/rules/react-dashboard.md +83 -0
- package/ai/skills/dataqueue-advanced/SKILL.md +211 -0
- package/ai/skills/dataqueue-core/SKILL.md +131 -0
- package/ai/skills/dataqueue-react/SKILL.md +189 -0
- package/dist/cli.cjs +577 -32
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +52 -2
- package/dist/cli.d.ts +52 -2
- package/dist/cli.js +575 -32
- package/dist/cli.js.map +1 -1
- package/dist/mcp-server.cjs +186 -0
- package/dist/mcp-server.cjs.map +1 -0
- package/dist/mcp-server.d.cts +32 -0
- package/dist/mcp-server.d.ts +32 -0
- package/dist/mcp-server.js +175 -0
- package/dist/mcp-server.js.map +1 -0
- package/package.json +10 -4
- package/src/cli.test.ts +65 -0
- package/src/cli.ts +56 -19
- package/src/install-mcp-command.test.ts +216 -0
- package/src/install-mcp-command.ts +185 -0
- package/src/install-rules-command.test.ts +218 -0
- package/src/install-rules-command.ts +233 -0
- package/src/install-skills-command.test.ts +176 -0
- package/src/install-skills-command.ts +124 -0
- package/src/mcp-server.test.ts +162 -0
- package/src/mcp-server.ts +231 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build script that reads all MDX documentation files, strips MDX-specific
|
|
3
|
+
* components, and outputs a JSON file for the MCP server to search.
|
|
4
|
+
*
|
|
5
|
+
* Usage: npx tsx ai/build-docs-content.ts
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
|
|
15
|
+
interface DocPage {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const DOCS_DIR = path.resolve(__dirname, '../../../apps/docs/content/docs');
|
|
23
|
+
const OUTPUT_FILE = path.resolve(__dirname, 'docs-content.json');
|
|
24
|
+
|
|
25
|
+
function extractFrontmatter(raw: string): {
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
body: string;
|
|
29
|
+
} {
|
|
30
|
+
const match = raw.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
31
|
+
if (!match) return { title: '', description: '', body: raw };
|
|
32
|
+
|
|
33
|
+
const fm = match[1];
|
|
34
|
+
const body = match[2];
|
|
35
|
+
|
|
36
|
+
const titleMatch = fm.match(/^title:\s*(.+)$/m);
|
|
37
|
+
const descMatch = fm.match(/^description:\s*(.+)$/m);
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
title: titleMatch ? titleMatch[1].trim() : '',
|
|
41
|
+
description: descMatch ? descMatch[1].trim() : '',
|
|
42
|
+
body,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function stripMdxComponents(content: string): string {
|
|
47
|
+
return (
|
|
48
|
+
content
|
|
49
|
+
.replace(/<Callout[^>]*>\s*/g, '> **Note:** ')
|
|
50
|
+
.replace(/<\/Callout>\s*/g, '\n')
|
|
51
|
+
.replace(/<Steps>|<\/Steps>/g, '')
|
|
52
|
+
.replace(/<Step[^>]*>/g, '')
|
|
53
|
+
.replace(/<\/Step>/g, '')
|
|
54
|
+
.replace(/!\[.*?\]\(\/[^)]+\)/g, '')
|
|
55
|
+
// Strip code annotations like [!code highlight] and [!code highlight:N]
|
|
56
|
+
.replace(/\s*\/\/\s*\[!code\s+highlight(?::\d+)?\]\s*/g, '')
|
|
57
|
+
.replace(/```package-install\n/g, '```bash\n')
|
|
58
|
+
.trim()
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function collectMdxFiles(dir: string, prefix = ''): DocPage[] {
|
|
63
|
+
const pages: DocPage[] = [];
|
|
64
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
65
|
+
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
if (entry.isDirectory()) {
|
|
68
|
+
pages.push(
|
|
69
|
+
...collectMdxFiles(
|
|
70
|
+
path.join(dir, entry.name),
|
|
71
|
+
`${prefix}${entry.name}/`,
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
} else if (entry.name.endsWith('.mdx')) {
|
|
75
|
+
const raw = fs.readFileSync(path.join(dir, entry.name), 'utf-8');
|
|
76
|
+
const { title, description, body } = extractFrontmatter(raw);
|
|
77
|
+
const slug =
|
|
78
|
+
entry.name === 'index.mdx'
|
|
79
|
+
? prefix.replace(/\/$/, '') || 'index'
|
|
80
|
+
: `${prefix}${entry.name.replace(/\.mdx$/, '')}`;
|
|
81
|
+
|
|
82
|
+
pages.push({
|
|
83
|
+
slug,
|
|
84
|
+
title,
|
|
85
|
+
description,
|
|
86
|
+
content: stripMdxComponents(body),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return pages;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const pages = collectMdxFiles(DOCS_DIR);
|
|
95
|
+
fs.writeFileSync(OUTPUT_FILE, JSON.stringify(pages, null, 2));
|
|
96
|
+
console.log(`Built ${pages.length} doc pages to ${OUTPUT_FILE}`);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates llms-full.txt from docs-content.json — a single concatenated file
|
|
3
|
+
* of all documentation, suitable for feeding into an LLM context window.
|
|
4
|
+
*
|
|
5
|
+
* Usage: npx tsx ai/build-llms-full.ts
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
|
|
15
|
+
interface DocPage {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const INPUT = path.resolve(__dirname, 'docs-content.json');
|
|
23
|
+
const OUTPUT = path.resolve(
|
|
24
|
+
__dirname,
|
|
25
|
+
'../../../apps/docs/public/llms-full.txt',
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const pages: DocPage[] = JSON.parse(fs.readFileSync(INPUT, 'utf-8'));
|
|
29
|
+
|
|
30
|
+
const sections = pages.map((page) => {
|
|
31
|
+
const header = page.description
|
|
32
|
+
? `# ${page.title}\n\n> ${page.description}`
|
|
33
|
+
: `# ${page.title}`;
|
|
34
|
+
return `${header}\n\nSlug: ${page.slug}\n\n${page.content}`;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const output = `# DataQueue — Full Documentation\n\n${sections.join('\n\n---\n\n')}\n`;
|
|
38
|
+
|
|
39
|
+
fs.writeFileSync(OUTPUT, output);
|
|
40
|
+
console.log(
|
|
41
|
+
`Built llms-full.txt (${pages.length} pages, ${output.length} chars)`,
|
|
42
|
+
);
|