deepfish-ai 1.0.26 → 1.0.28
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/AgentRobot/AgentRobotFactory/MainAgentRobot.js +1 -0
- package/src/AgentRobot/BaseAgentRobot/Logger.js +9 -3
- package/src/AgentRobot/BaseAgentRobot/index.js +1 -0
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/AliBailian.js +997 -0
- package/src/AgentRobot/BaseAgentRobot/tools/GenerateTools.js +100 -5
- package/src/AgentRobot/BaseAgentRobot/tools/InquirerTools.js +8 -0
- package/src/AgentRobot/BaseAgentRobot/tools/SystemTools.js +8 -8
- package/src/AgentRobot/BaseAgentRobot/utils/AIRequest.js +59 -10
- package/src/AgentRobot/BaseAgentRobot/utils/AIToolManager.js +1 -0
- package/src/AgentRobot/BaseAgentRobot/utils/AttachmentToolScanner.js +6 -4
- package/src/AgentRobot/BaseAgentRobot/utils/analyzeReturn.test.js +104 -0
- package/src/AgentRobot/BaseAgentRobot/utils/copilot.js +117 -0
- package/src/AgentRobot/BaseAgentRobot/utils/normal.js +288 -0
- package/src/cli/ConfigManager.js +25 -1
- package/src/cli/DefaultConfig.js +22 -6
- package/src/cli/SkillConfigManager.js +3 -2
- package/src/cli/ai-auth.js +231 -0
- package/src/cli/ai-config.js +21 -3
- package/src/cli/index.js +4 -2
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/embedding.js +0 -459
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepfish-ai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "This is an AI-driven command-line tool built on Node.js, equipped with AI agent and workflow capabilities. It is compatible with a wide range of AI models, can convert natural language into cross-system terminal and file operation commands, and features high extensibility. It supports complex tasks such as translation, content creation, and format conversion, while allowing custom extensions to be automatically generated via AI.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -16,6 +16,7 @@ class MainAgentRobot extends BaseAgentRobot {
|
|
|
16
16
|
|
|
17
17
|
// 初始化文件
|
|
18
18
|
_initFiles(opt) {
|
|
19
|
+
this.logId = Date.now()
|
|
19
20
|
this.workspace = opt.workspace || process.cwd() // 工作空间,目录
|
|
20
21
|
this.basespace = opt.basespace || path.join(os.homedir(), '.deepfish-ai') // 记忆空间,目录
|
|
21
22
|
this.userspace = path.join(this.basespace, 'user-info') // 用户空间,目录
|
|
@@ -9,6 +9,7 @@ class Logger {
|
|
|
9
9
|
this.maxLogExpireTime = agentRobot.config.maxLogExpireTime
|
|
10
10
|
this.memorySpace = agentRobot.memorySpace
|
|
11
11
|
this.logTimeMap = new Map()
|
|
12
|
+
this.logId = agentRobot.logId || agentRobot.root.logId
|
|
12
13
|
}
|
|
13
14
|
clearAllLogs() {
|
|
14
15
|
const fileNames = fs.readdirSync(this.memorySpace)
|
|
@@ -55,11 +56,16 @@ class Logger {
|
|
|
55
56
|
}
|
|
56
57
|
const logFile = path.join(
|
|
57
58
|
this.logDirPath,
|
|
58
|
-
`log-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
59
|
+
`log-${this.logId}-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
60
|
+
)
|
|
61
|
+
const logFile2 = path.join(
|
|
62
|
+
this.logDirPath,
|
|
63
|
+
`log-messeage-${this.logId}.txt`,
|
|
59
64
|
)
|
|
60
65
|
try {
|
|
61
66
|
let logEntry = `[${new Date().toISOString()}][${message.role}] ${message.content}\n`
|
|
62
67
|
fs.appendFileSync(logFile, logEntry)
|
|
68
|
+
fs.appendFileSync(logFile2, logEntry)
|
|
63
69
|
return true
|
|
64
70
|
} catch (error) {
|
|
65
71
|
console.error('Failed to log message:', error.message)
|
|
@@ -72,7 +78,7 @@ class Logger {
|
|
|
72
78
|
}
|
|
73
79
|
const logFile = path.join(
|
|
74
80
|
this.logDirPath,
|
|
75
|
-
`log-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
81
|
+
`log-${this.logId}-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
76
82
|
)
|
|
77
83
|
try {
|
|
78
84
|
let logEntry = `[${new Date().toISOString()}][***COMPRESS START***]
|
|
@@ -92,7 +98,7 @@ class Logger {
|
|
|
92
98
|
}
|
|
93
99
|
const logFile = path.join(
|
|
94
100
|
this.logDirPath,
|
|
95
|
-
`log-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
101
|
+
`log-${this.logId}-${dayjs().format('YYYY-MM-DD HH')}.txt`,
|
|
96
102
|
)
|
|
97
103
|
try {
|
|
98
104
|
let logEntry = `[${new Date().toISOString()}][###############] ${message}\n`
|