encoding-aware-fs 0.1.4 → 0.1.6
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 +74 -0
- package/RESEARCH.md +502 -0
- package/dist/index.js +3371 -205
- package/dist/server.js +3176 -69
- package/package.json +16 -7
- package/skills/claude-code/SKILL.md +7 -4
- package/skills/opencode/SKILL.md +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "encoding-aware-fs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Encoding-aware file operations MCP Server for AI tools working with GB18030 projects",
|
|
5
5
|
"main": "dist/server.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,19 +13,28 @@
|
|
|
13
13
|
"test:watch": "vitest",
|
|
14
14
|
"typecheck": "tsc --noEmit"
|
|
15
15
|
},
|
|
16
|
-
"keywords": [
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"encoding",
|
|
19
|
+
"gb18030",
|
|
20
|
+
"utf-8",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"opencode"
|
|
23
|
+
],
|
|
17
24
|
"license": "MIT",
|
|
18
25
|
"dependencies": {
|
|
26
|
+
"@clack/prompts": "^1.2.0",
|
|
19
27
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
20
|
-
"zod": "^3.25.0",
|
|
21
|
-
"iconv-lite": "^0.6.3",
|
|
22
28
|
"diff": "^8.0.3",
|
|
23
|
-
"
|
|
29
|
+
"iconv-lite": "^0.6.3",
|
|
30
|
+
"micromatch": "^4.0.8",
|
|
31
|
+
"zod": "^3.25.0"
|
|
24
32
|
},
|
|
25
33
|
"devDependencies": {
|
|
34
|
+
"@types/micromatch": "^4.0.10",
|
|
35
|
+
"@types/node": "^22.0.0",
|
|
26
36
|
"esbuild": "^0.20.0",
|
|
27
37
|
"typescript": "^5.5.0",
|
|
28
|
-
"vitest": "^3.0.0"
|
|
29
|
-
"@types/node": "^22.0.0"
|
|
38
|
+
"vitest": "^3.0.0"
|
|
30
39
|
}
|
|
31
40
|
}
|
|
@@ -123,11 +123,14 @@ The file `.encoding-converter.json` in the project root controls encoding behavi
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
|
125
125
|
"sourceEncoding": "GB18030",
|
|
126
|
-
"
|
|
127
|
-
"
|
|
126
|
+
"confidenceThreshold": 0.8,
|
|
127
|
+
"overrides": [
|
|
128
|
+
{ "pattern": "openspec/**", "sourceEncoding": "UTF-8" },
|
|
129
|
+
{ "pattern": "legacy/**", "sourceEncoding": "GBK" }
|
|
130
|
+
]
|
|
128
131
|
}
|
|
129
132
|
```
|
|
130
133
|
|
|
131
|
-
- `sourceEncoding`: Default encoding for files when auto-detection is uncertain
|
|
132
|
-
- `targetEncoding`: Always UTF-8 (the encoding you see and produce)
|
|
134
|
+
- `sourceEncoding`: Default encoding for files when auto-detection is uncertain; also used for new files
|
|
133
135
|
- `confidenceThreshold`: Minimum confidence (0-1) to trust auto-detected encoding
|
|
136
|
+
- `overrides`: Optional array of directory-level rules. Each rule has a `pattern` (glob, relative to project root) and `sourceEncoding`. When a file path matches multiple rules, the most specific pattern wins.
|
package/skills/opencode/SKILL.md
CHANGED
|
@@ -123,11 +123,14 @@ The file `.encoding-converter.json` in the project root controls encoding behavi
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
|
125
125
|
"sourceEncoding": "GB18030",
|
|
126
|
-
"
|
|
127
|
-
"
|
|
126
|
+
"confidenceThreshold": 0.8,
|
|
127
|
+
"overrides": [
|
|
128
|
+
{ "pattern": "openspec/**", "sourceEncoding": "UTF-8" },
|
|
129
|
+
{ "pattern": "legacy/**", "sourceEncoding": "GBK" }
|
|
130
|
+
]
|
|
128
131
|
}
|
|
129
132
|
```
|
|
130
133
|
|
|
131
|
-
- `sourceEncoding`: Default encoding for files when auto-detection is uncertain
|
|
132
|
-
- `targetEncoding`: Always UTF-8 (the encoding you see and produce)
|
|
134
|
+
- `sourceEncoding`: Default encoding for files when auto-detection is uncertain; also used for new files
|
|
133
135
|
- `confidenceThreshold`: Minimum confidence (0-1) to trust auto-detected encoding
|
|
136
|
+
- `overrides`: Optional array of directory-level rules. Each rule has a `pattern` (glob, relative to project root) and `sourceEncoding`. When a file path matches multiple rules, the most specific pattern wins.
|