@afterxleep/doc-bot 1.7.2 → 1.7.4
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 +19 -5
- package/bin/doc-bot.js +19 -25
- package/package.json +1 -1
- package/src/index.js +4 -4
- package/src/services/DocumentationService.js +2 -2
package/README.md
CHANGED
|
@@ -79,12 +79,14 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
79
79
|
- AI doesn't know what documentation exists
|
|
80
80
|
- Users must know to ask specific questions
|
|
81
81
|
- No exploration or discovery capabilities
|
|
82
|
+
- AI agents rely on basic grep searches through codebases to infer project patterns
|
|
82
83
|
|
|
83
84
|
**MCP with doc-bot:**
|
|
84
85
|
- AI can list all available documentation
|
|
85
86
|
- Discovers relevant docs automatically
|
|
86
87
|
- Suggests documentation based on context
|
|
87
|
-
- Searchable knowledge base
|
|
88
|
+
- Searchable knowledge base with intelligent ranking
|
|
89
|
+
- No need for AI to grep through your codebase - dedicated search engine
|
|
88
90
|
|
|
89
91
|
## Installation
|
|
90
92
|
|
|
@@ -95,7 +97,7 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
95
97
|
```json
|
|
96
98
|
{
|
|
97
99
|
"mcpServers": {
|
|
98
|
-
"
|
|
100
|
+
"doc-bot": {
|
|
99
101
|
"command": "npx",
|
|
100
102
|
"args": ["@afterxleep/doc-bot"]
|
|
101
103
|
}
|
|
@@ -103,11 +105,11 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
103
105
|
}
|
|
104
106
|
```
|
|
105
107
|
|
|
106
|
-
**
|
|
108
|
+
**Custom docs folder:**
|
|
107
109
|
```json
|
|
108
110
|
{
|
|
109
111
|
"mcpServers": {
|
|
110
|
-
"
|
|
112
|
+
"doc-bot": {
|
|
111
113
|
"command": "npx",
|
|
112
114
|
"args": ["@afterxleep/doc-bot", "--docs", "./my-custom-docs"]
|
|
113
115
|
}
|
|
@@ -115,6 +117,18 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
115
117
|
}
|
|
116
118
|
```
|
|
117
119
|
|
|
120
|
+
**With verbose logging (for debugging):**
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"doc-bot": {
|
|
125
|
+
"command": "npx",
|
|
126
|
+
"args": ["@afterxleep/doc-bot", "--verbose"]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
118
132
|
3. **Restart your AI tool**
|
|
119
133
|
|
|
120
134
|
## How to organize your documentation
|
|
@@ -310,7 +324,7 @@ doc-bot --config ./manifest.json
|
|
|
310
324
|
"mcpServers": {
|
|
311
325
|
"doc-bot": {
|
|
312
326
|
"command": "node",
|
|
313
|
-
"args": ["/path/to/doc-bot/bin/doc-bot.js", "--watch"]
|
|
327
|
+
"args": ["/path/to/doc-bot/bin/doc-bot.js", "--verbose", "--watch"]
|
|
314
328
|
}
|
|
315
329
|
}
|
|
316
330
|
}
|
package/bin/doc-bot.js
CHANGED
|
@@ -41,7 +41,9 @@ async function main() {
|
|
|
41
41
|
|
|
42
42
|
// Manifest is now optional - only create if explicitly requested
|
|
43
43
|
if (options.config && !await fs.pathExists(configPath)) {
|
|
44
|
-
|
|
44
|
+
if (options.verbose) {
|
|
45
|
+
console.error('📝 Creating default manifest.json...');
|
|
46
|
+
}
|
|
45
47
|
const defaultManifest = {
|
|
46
48
|
name: 'Project Documentation',
|
|
47
49
|
version: '1.0.0',
|
|
@@ -58,33 +60,25 @@ async function main() {
|
|
|
58
60
|
watch: options.watch
|
|
59
61
|
});
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
if (options.verbose) {
|
|
64
|
+
console.error('🚀 Starting doc-bot...');
|
|
65
|
+
console.error(`📁 Documentation: ${docsPath}`);
|
|
66
|
+
if (await fs.pathExists(configPath)) {
|
|
67
|
+
console.error(`⚙️ Configuration: ${configPath}`);
|
|
68
|
+
} else {
|
|
69
|
+
console.error(`⚙️ Configuration: Auto-generated from frontmatter`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (options.watch) {
|
|
73
|
+
console.error('👀 Watching for file changes...');
|
|
74
|
+
}
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
await server.start();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
console.log('{');
|
|
79
|
-
console.log(' "mcpServers": {');
|
|
80
|
-
console.log(' "docs": {');
|
|
81
|
-
console.log(` "command": "npx",`);
|
|
82
|
-
console.log(` "args": ["doc-bot", "--docs", "${docsPath}"]`);
|
|
83
|
-
console.log(' }');
|
|
84
|
-
console.log(' }');
|
|
85
|
-
console.log('}');
|
|
86
|
-
console.log('');
|
|
87
|
-
console.log('🔄 Then restart Claude Code');
|
|
78
|
+
|
|
79
|
+
if (options.verbose) {
|
|
80
|
+
console.error('✅ Server started successfully!');
|
|
81
|
+
}
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
main().catch(error => {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -319,7 +319,7 @@ class DocsServer {
|
|
|
319
319
|
|
|
320
320
|
watcher.on('change', async (filePath) => {
|
|
321
321
|
if (this.options.verbose) {
|
|
322
|
-
console.
|
|
322
|
+
console.error(`📄 Documentation updated: ${path.relative(process.cwd(), filePath)}`);
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
// Reload manifest if config changed
|
|
@@ -757,11 +757,11 @@ class DocsServer {
|
|
|
757
757
|
await this.server.connect(transport);
|
|
758
758
|
|
|
759
759
|
if (this.options.verbose) {
|
|
760
|
-
console.
|
|
760
|
+
console.error('🔧 Server initialized with MCP transport');
|
|
761
761
|
if (this.manifestLoader) {
|
|
762
|
-
console.
|
|
762
|
+
console.error('📄 Using manifest.json for additional configuration');
|
|
763
763
|
} else {
|
|
764
|
-
console.
|
|
764
|
+
console.error('🚀 Using frontmatter-based configuration (no manifest needed)');
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
}
|
|
@@ -24,7 +24,7 @@ class DocumentationService {
|
|
|
24
24
|
async loadDocuments() {
|
|
25
25
|
try {
|
|
26
26
|
if (!await fs.pathExists(this.docsPath)) {
|
|
27
|
-
|
|
27
|
+
// Silently return if path doesn't exist - this is normal for MCP servers
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -75,7 +75,7 @@ class DocumentationService {
|
|
|
75
75
|
content: match[2]
|
|
76
76
|
};
|
|
77
77
|
} catch (error) {
|
|
78
|
-
|
|
78
|
+
// Silently skip files with invalid frontmatter
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|