@raolin2025/claude-code-node 1.2.0 → 2.0.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 +1 -1
- package/src/channel/index.js +81 -146
- package/src/channel/notify-daemon.js +451 -350
- package/src/core/cli.js +195 -114
- package/src/core/compact.js +171 -0
- package/src/core/config.js +1 -2
- package/src/core/cost-tracker.js +171 -0
- package/src/core/paths.js +12 -0
- package/src/core/query-engine.js +192 -89
- package/src/core/session.js +24 -9
- package/src/mcp/client.js +99 -1
- package/src/mcp/registry.js +1 -2
- package/src/security/bash-guard.js +174 -141
- package/src/security/enhanced-permission.js +72 -34
- package/src/security/path-guard.js +32 -29
- package/src/security/ssrf-guard.js +153 -50
- package/src/tools/glob.js +1 -1
- package/src/types/index.js +2 -1
- package/src/utils/file-ops.js +2 -3
package/src/tools/glob.js
CHANGED
package/src/types/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto'
|
|
1
2
|
// ====== 消息类型 ======
|
|
2
3
|
|
|
3
4
|
/** 消息角色 */
|
|
@@ -18,7 +19,7 @@ export class Message {
|
|
|
18
19
|
this.role = role
|
|
19
20
|
this.content = content
|
|
20
21
|
this.timestamp = Date.now()
|
|
21
|
-
this.id =
|
|
22
|
+
this.id = randomUUID()
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
package/src/utils/file-ops.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* 文件操作工具
|
|
3
3
|
* 对应原版: src/utils/file.ts + src/utils/fsOperations.ts
|
|
4
4
|
*/
|
|
5
|
-
import { readFile, writeFile, stat, mkdir, rm
|
|
6
|
-
import { resolve, dirname,
|
|
7
|
-
import { existsSync } from 'fs'
|
|
5
|
+
import { readFile, writeFile, stat, mkdir, rm } from 'fs/promises'
|
|
6
|
+
import { resolve, dirname, isAbsolute } from 'path'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* 安全读取文件(带大小限制)
|