@afterxleep/doc-bot 1.17.0 → 1.18.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/package.json +7 -4
- package/src/__tests__/temp-docs-1756129972061/test.md +5 -0
- package/src/__tests__/temp-docs-1756129972071/test.md +5 -0
- package/src/__tests__/temp-docs-1756129972075/test.md +5 -0
- package/src/__tests__/temp-docs-1756129972077/test.md +5 -0
- package/src/__tests__/temp-docs-1756129972079/test.md +5 -0
- package/src/__tests__/temp-docs-1756130189361/test.md +5 -0
- package/src/__tests__/temp-docs-1756130189372/test.md +5 -0
- package/src/__tests__/temp-docs-1756130189375/test.md +5 -0
- package/src/__tests__/temp-docs-1756130189378/test.md +5 -0
- package/src/__tests__/temp-docs-1756130189379/test.md +5 -0
- package/src/__tests__/temp-docs-1756130271128/test.md +5 -0
- package/src/__tests__/temp-docs-1756130271139/test.md +5 -0
- package/src/__tests__/temp-docs-1756130271142/test.md +5 -0
- package/src/__tests__/temp-docs-1756130271145/test.md +5 -0
- package/src/__tests__/temp-docs-1756130271146/test.md +5 -0
- package/src/__tests__/temp-docs-1756130687030/test.md +5 -0
- package/src/__tests__/temp-docs-1756130687044/test.md +5 -0
- package/src/__tests__/temp-docs-1756130687048/test.md +5 -0
- package/src/__tests__/temp-docs-1756130687051/test.md +5 -0
- package/src/__tests__/temp-docs-1756130687053/test.md +5 -0
- package/src/__tests__/temp-docs-1756131694925/test.md +5 -0
- package/src/__tests__/temp-docs-1756131694937/test.md +5 -0
- package/src/__tests__/temp-docs-1756131694941/test.md +5 -0
- package/src/__tests__/temp-docs-1756131694944/test.md +5 -0
- package/src/__tests__/temp-docs-1756131694946/test.md +5 -0
- package/src/__tests__/temp-docs-1756133998710/test.md +5 -0
- package/src/__tests__/temp-docs-1756133998721/test.md +5 -0
- package/src/__tests__/temp-docs-1756133998724/test.md +5 -0
- package/src/__tests__/temp-docs-1756133998727/test.md +5 -0
- package/src/__tests__/temp-docs-1756133998729/test.md +5 -0
- package/src/__tests__/temp-docs-1756134345935/test.md +5 -0
- package/src/__tests__/temp-docs-1756134345948/test.md +5 -0
- package/src/__tests__/temp-docs-1756134345952/test.md +5 -0
- package/src/__tests__/temp-docs-1756134345954/test.md +5 -0
- package/src/__tests__/temp-docs-1756134345957/test.md +5 -0
- package/src/__tests__/temp-docsets-1756129972079/2e443167/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756129972079/2e443167/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756129972079/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756129972079/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756129972079/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756130189379/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130189379/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130189379/a4934c14/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130189379/a4934c14/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130189379/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756130271146/3f8acbb2/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130271146/3f8acbb2/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130271146/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130271146/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130271146/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756130687053/6810e6bd/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130687053/6810e6bd/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130687053/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756130687053/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756130687053/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756131694946/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756131694946/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756131694946/dd703046/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756131694946/dd703046/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756131694946/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756133998729/9e061136/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756133998729/9e061136/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756133998729/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756133998729/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756133998729/docsets.json +10 -0
- package/src/__tests__/temp-docsets-1756134345957/03e730af/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756134345957/03e730af/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756134345957/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1756134345957/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1756134345957/docsets.json +10 -0
- package/src/index.js +4 -6
- package/src/services/DocumentationService.js +26 -1
- package/prompts/file-docs.md +0 -69
- package/prompts/global-rules.md +0 -142
- package/prompts/mandatory-rules.md +0 -90
- package/prompts/search-results.md +0 -59
- package/prompts/system-prompt.md +0 -270
- package/src/__tests__/docset-integration.test.js +0 -146
- package/src/services/__tests__/DocumentationService.test.js +0 -318
- package/src/services/__tests__/UnifiedSearchService.test.js +0 -302
- package/src/services/docset/__tests__/EnhancedDocsetDatabase.test.js +0 -324
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afterxleep/doc-bot",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "Generic MCP server for intelligent documentation access in any project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -12,9 +12,12 @@
|
|
|
12
12
|
"start:watch": "node bin/doc-bot.js --verbose --watch",
|
|
13
13
|
"start:examples": "node bin/doc-bot.js --docs ./samples --verbose",
|
|
14
14
|
"dev": "node bin/doc-bot.js --verbose --watch",
|
|
15
|
-
"test": "jest",
|
|
16
|
-
"test:watch": "jest --watch",
|
|
17
|
-
"test:coverage": "jest --coverage",
|
|
15
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
16
|
+
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
|
|
17
|
+
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
|
18
|
+
"test:e2e": "node test/fixtures/create-test-docs.js && NODE_OPTIONS=--experimental-vm-modules jest test/e2e.test.js",
|
|
19
|
+
"test:unit": "NODE_OPTIONS=--experimental-vm-modules jest src/services/__tests__",
|
|
20
|
+
"test:setup": "node test/fixtures/create-test-docs.js",
|
|
18
21
|
"lint": "eslint src/ bin/ --ext .js",
|
|
19
22
|
"lint:fix": "eslint src/ bin/ --ext .js --fix"
|
|
20
23
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "2e443167",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756129972079/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756129972079/2e443167/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T13:52:52.088Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "a4934c14",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130189379/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130189379/a4934c14/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T13:56:29.388Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "3f8acbb2",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130271146/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130271146/3f8acbb2/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T13:57:51.155Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "6810e6bd",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130687053/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756130687053/6810e6bd/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T14:04:47.063Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "dd703046",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756131694946/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756131694946/dd703046/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T14:21:34.958Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "9e061136",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756133998729/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756133998729/9e061136/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T14:59:58.738Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleName</key>
|
|
6
|
+
<string>Mock Documentation</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>mock.documentation</string>
|
|
9
|
+
</dict>
|
|
10
|
+
</plist>
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "03e730af",
|
|
4
|
+
"name": "Mock Documentation",
|
|
5
|
+
"source": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756134345957/Mock.docset",
|
|
6
|
+
"path": "/Users/afterxleep/Developer/doc-bot/src/__tests__/temp-docsets-1756134345957/03e730af/Mock.docset",
|
|
7
|
+
"downloadedAt": "2025-08-25T15:05:45.967Z",
|
|
8
|
+
"size": 8513
|
|
9
|
+
}
|
|
10
|
+
]
|
package/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { UnifiedSearchService } from './services/UnifiedSearchService.js';
|
|
|
9
9
|
import chokidar from 'chokidar';
|
|
10
10
|
import path from 'path';
|
|
11
11
|
import { promises as fs } from 'fs';
|
|
12
|
+
import fsExtra from 'fs-extra';
|
|
12
13
|
import { fileURLToPath } from 'url';
|
|
13
14
|
import os from 'os';
|
|
14
15
|
|
|
@@ -1233,12 +1234,9 @@ Try:
|
|
|
1233
1234
|
}
|
|
1234
1235
|
|
|
1235
1236
|
async createOrUpdateRule({ fileName, title, description, keywords, alwaysApply, content }) {
|
|
1236
|
-
const fs = require('fs-extra');
|
|
1237
|
-
const path = require('path');
|
|
1238
|
-
|
|
1239
1237
|
try {
|
|
1240
1238
|
// Ensure the docs directory exists
|
|
1241
|
-
await
|
|
1239
|
+
await fsExtra.ensureDir(this.options.docsPath);
|
|
1242
1240
|
|
|
1243
1241
|
// Create the full file path
|
|
1244
1242
|
const filePath = path.join(this.options.docsPath, fileName);
|
|
@@ -1259,11 +1257,11 @@ Try:
|
|
|
1259
1257
|
const fullContent = frontmatter + content;
|
|
1260
1258
|
|
|
1261
1259
|
// Check if file exists to determine if this is create or update
|
|
1262
|
-
const fileExists = await
|
|
1260
|
+
const fileExists = await fsExtra.pathExists(filePath);
|
|
1263
1261
|
const action = fileExists ? 'updated' : 'created';
|
|
1264
1262
|
|
|
1265
1263
|
// Write the file
|
|
1266
|
-
await
|
|
1264
|
+
await fsExtra.writeFile(filePath, fullContent, 'utf8');
|
|
1267
1265
|
|
|
1268
1266
|
// Reload the documentation service to pick up the new/updated file
|
|
1269
1267
|
await this.docService.reload();
|