@afterxleep/doc-bot 1.7.2 → 1.7.3
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 +16 -4
- 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
|
@@ -95,7 +95,7 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
95
95
|
```json
|
|
96
96
|
{
|
|
97
97
|
"mcpServers": {
|
|
98
|
-
"
|
|
98
|
+
"doc-bot": {
|
|
99
99
|
"command": "npx",
|
|
100
100
|
"args": ["@afterxleep/doc-bot"]
|
|
101
101
|
}
|
|
@@ -103,11 +103,11 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
103
103
|
}
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
**
|
|
106
|
+
**Custom docs folder:**
|
|
107
107
|
```json
|
|
108
108
|
{
|
|
109
109
|
"mcpServers": {
|
|
110
|
-
"
|
|
110
|
+
"doc-bot": {
|
|
111
111
|
"command": "npx",
|
|
112
112
|
"args": ["@afterxleep/doc-bot", "--docs", "./my-custom-docs"]
|
|
113
113
|
}
|
|
@@ -115,6 +115,18 @@ Traditional AI assistants use static rule files (like Cursor Rules or Copilot's
|
|
|
115
115
|
}
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
**With verbose logging (for debugging):**
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"doc-bot": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["@afterxleep/doc-bot", "--verbose"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
118
130
|
3. **Restart your AI tool**
|
|
119
131
|
|
|
120
132
|
## How to organize your documentation
|
|
@@ -310,7 +322,7 @@ doc-bot --config ./manifest.json
|
|
|
310
322
|
"mcpServers": {
|
|
311
323
|
"doc-bot": {
|
|
312
324
|
"command": "node",
|
|
313
|
-
"args": ["/path/to/doc-bot/bin/doc-bot.js", "--watch"]
|
|
325
|
+
"args": ["/path/to/doc-bot/bin/doc-bot.js", "--verbose", "--watch"]
|
|
314
326
|
}
|
|
315
327
|
}
|
|
316
328
|
}
|
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
|
|