deepfish-ai 1.0.29 → 2.0.2
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 +126 -368
- package/dist/index.js +23320 -0
- package/dist/serve/client/assets/index-DUHYC91l.js +1 -0
- package/dist/serve/client/assets/index-zcrdNLZs.css +1 -0
- package/dist/serve/client/index.html +14 -0
- package/dist/serve/pm2-server.js +21015 -0
- package/dist/serve/server/entry-server.mjs +224 -0
- package/package.json +61 -83
- package/LICENSE +0 -21
- package/README_CN.md +0 -460
- package/src/AgentRobot/AgentRobotFactory/MainAgentRobot.js +0 -88
- package/src/AgentRobot/AgentRobotFactory/SubAgentRobot.js +0 -45
- package/src/AgentRobot/AgentRobotFactory/SubSkillAgentRobot.js +0 -45
- package/src/AgentRobot/AgentRobotFactory/index.js +0 -48
- package/src/AgentRobot/BaseAgentRobot/Brain.js +0 -210
- package/src/AgentRobot/BaseAgentRobot/BrainEvent.js +0 -17
- package/src/AgentRobot/BaseAgentRobot/Hand.js +0 -119
- package/src/AgentRobot/BaseAgentRobot/Heart.js +0 -0
- package/src/AgentRobot/BaseAgentRobot/Logger.js +0 -114
- package/src/AgentRobot/BaseAgentRobot/ScreenPrinter.js +0 -49
- package/src/AgentRobot/BaseAgentRobot/index.js +0 -266
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/AliBailian.js +0 -997
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/doc-transform.js +0 -204
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/docx.js +0 -1286
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/img.js +0 -765
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/pdf.js +0 -736
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/pptx.js +0 -567
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/video.js +0 -36
- package/src/AgentRobot/BaseAgentRobot/lazy-tools/xlsx.js +0 -611
- package/src/AgentRobot/BaseAgentRobot/tools/BaseTools.js +0 -13
- package/src/AgentRobot/BaseAgentRobot/tools/CreateAgentTools.js +0 -158
- package/src/AgentRobot/BaseAgentRobot/tools/FileTools.js +0 -768
- package/src/AgentRobot/BaseAgentRobot/tools/GenerateTools.js +0 -441
- package/src/AgentRobot/BaseAgentRobot/tools/InquirerTools.js +0 -244
- package/src/AgentRobot/BaseAgentRobot/tools/SystemTools.js +0 -424
- package/src/AgentRobot/BaseAgentRobot/tools/TaskTools.js +0 -211
- package/src/AgentRobot/BaseAgentRobot/tools/TestTools.js +0 -100
- package/src/AgentRobot/BaseAgentRobot/tools/UserTool.js +0 -87
- package/src/AgentRobot/BaseAgentRobot/tools/WebTools.js +0 -257
- package/src/AgentRobot/BaseAgentRobot/utils/AIRequest.js +0 -297
- package/src/AgentRobot/BaseAgentRobot/utils/AIToolManager.js +0 -131
- package/src/AgentRobot/BaseAgentRobot/utils/AgentTree.js +0 -66
- package/src/AgentRobot/BaseAgentRobot/utils/AttachmentToolScanner.js +0 -235
- package/src/AgentRobot/BaseAgentRobot/utils/MessageCompresser.js +0 -236
- package/src/AgentRobot/BaseAgentRobot/utils/aiConsole.js +0 -74
- package/src/AgentRobot/BaseAgentRobot/utils/aiInquirer.js +0 -78
- package/src/AgentRobot/BaseAgentRobot/utils/analyzeReturn.test.js +0 -104
- package/src/AgentRobot/BaseAgentRobot/utils/copilot.js +0 -117
- package/src/AgentRobot/BaseAgentRobot/utils/node-root.js +0 -138
- package/src/AgentRobot/BaseAgentRobot/utils/normal.js +0 -399
- package/src/cli/ConfigManager.js +0 -283
- package/src/cli/DefaultConfig.js +0 -98
- package/src/cli/GlobalVariable.js +0 -8
- package/src/cli/MemoryManager.js +0 -53
- package/src/cli/SkillConfigManager.js +0 -354
- package/src/cli/SkillParser.js +0 -58
- package/src/cli/ai-auth.js +0 -231
- package/src/cli/ai-config.js +0 -225
- package/src/cli/ai-memory.js +0 -22
- package/src/cli/ai-skill.js +0 -65
- package/src/cli/index.js +0 -77
- package/src/index.js +0 -54
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
const { AttachmentToolType } = require("../utils/AttachmentToolScanner.js")
|
|
2
|
-
|
|
3
|
-
// 创建子 agent 并让其仅携带指定 skill 执行任务
|
|
4
|
-
async function createSubSkillAgent(skillName, skillType, workGoal) {
|
|
5
|
-
try {
|
|
6
|
-
const clawSkillCollection = this.agentRobot?.clawSkillCollection || []
|
|
7
|
-
const toolCollection = this.agentRobot?.toolCollection || []
|
|
8
|
-
let tool = null
|
|
9
|
-
if (skillType === AttachmentToolType.CLAW_SKILL) {
|
|
10
|
-
tool = clawSkillCollection.find((t) => t?.name === skillName)
|
|
11
|
-
} else if (skillType === AttachmentToolType.BASE_SKILL) {
|
|
12
|
-
tool = toolCollection.find((t) => t?.name === skillName)
|
|
13
|
-
}
|
|
14
|
-
if (!tool) {
|
|
15
|
-
return {
|
|
16
|
-
success: false,
|
|
17
|
-
error: `Skill not found: ${skillName}`,
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (!workGoal || typeof workGoal !== 'string') {
|
|
22
|
-
return {
|
|
23
|
-
success: false,
|
|
24
|
-
error: 'workGoal must be a non-empty string',
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const agentId = `${Date.now()}-${Math.floor(Math.random() * 10000)}`
|
|
29
|
-
const agent = this.agentRobot.createSubSkillAgent(agentId, [tool])
|
|
30
|
-
const result = await agent.executeTask(workGoal)
|
|
31
|
-
agent.destroy()
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
success: true,
|
|
35
|
-
agentId,
|
|
36
|
-
skillName,
|
|
37
|
-
result,
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error('Error in createSubSkillAgent:', error)
|
|
41
|
-
return {
|
|
42
|
-
success: false,
|
|
43
|
-
error: error?.message || String(error),
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// 创建携带所有技能说明的子agent
|
|
49
|
-
async function createSubAgent(workGoal) {
|
|
50
|
-
try {
|
|
51
|
-
const agentId = `${Date.now()}-${Math.floor(Math.random() * 10000)}`
|
|
52
|
-
const agent = this.agentRobot.createSubAgent(agentId)
|
|
53
|
-
const result = await agent.executeTask(workGoal)
|
|
54
|
-
agent.destroy()
|
|
55
|
-
return {
|
|
56
|
-
success: true,
|
|
57
|
-
agentId,
|
|
58
|
-
result,
|
|
59
|
-
}
|
|
60
|
-
} catch (error) {
|
|
61
|
-
return {
|
|
62
|
-
success: false,
|
|
63
|
-
error: error?.message || String(error),
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function loadAttachTool(toolName) {
|
|
69
|
-
try {
|
|
70
|
-
this.agentRobot.toolManager.addTool(toolName)
|
|
71
|
-
return `Tool ${toolName} loaded successfully`
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.error(error)
|
|
74
|
-
return `Failed to load tool ${toolName}: ${error.message}`
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const descriptions = [
|
|
79
|
-
{
|
|
80
|
-
type: 'function',
|
|
81
|
-
function: {
|
|
82
|
-
name: 'createSubSkillAgent',
|
|
83
|
-
description:
|
|
84
|
-
'根据技能名称创建一个加载了该技能包的子agent,并让其执行给定工作目标。返回执行结果与状态信息。',
|
|
85
|
-
parameters: {
|
|
86
|
-
type: 'object',
|
|
87
|
-
properties: {
|
|
88
|
-
skillName: {
|
|
89
|
-
type: 'string',
|
|
90
|
-
description:
|
|
91
|
-
'要加载到子agent中的技能名称(与技能对象name字段一致)。',
|
|
92
|
-
},
|
|
93
|
-
skillType: {
|
|
94
|
-
type: 'string',
|
|
95
|
-
description: '要加载到子agent中的技能类型(与技能对象type字段一致), 枚举类型"BaseSkill"、"ClawSkill"。',
|
|
96
|
-
},
|
|
97
|
-
workGoal: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
description: '子agent要完成的任务目标描述。',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
required: ['skillName', 'workGoal'],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
type: 'function',
|
|
108
|
-
function: {
|
|
109
|
-
name: 'createSubAgent',
|
|
110
|
-
description:
|
|
111
|
-
'创建一个子agent,并让其执行给定工作目标。可以进行复杂的任务分配,如知识库查询、多源搜索结果整合、多步骤任务处理等,返回执行结果与状态信息。',
|
|
112
|
-
parameters: {
|
|
113
|
-
type: 'object',
|
|
114
|
-
properties: {
|
|
115
|
-
workGoal: {
|
|
116
|
-
type: 'string',
|
|
117
|
-
description: '子agent要完成的任务目标描述。',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
required: ['workGoal'],
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
type: 'function',
|
|
126
|
-
function: {
|
|
127
|
-
name: 'loadAttachTool',
|
|
128
|
-
description:
|
|
129
|
-
'按名称加载一个附加工具(Attach Tool)到当前agent实例中,返回加载结果信息。',
|
|
130
|
-
parameters: {
|
|
131
|
-
type: 'object',
|
|
132
|
-
properties: {
|
|
133
|
-
toolName: {
|
|
134
|
-
type: 'string',
|
|
135
|
-
description: '要加载的附加工具名称(与可用工具名称一致)。',
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
required: ['toolName'],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
]
|
|
143
|
-
|
|
144
|
-
const functions = {
|
|
145
|
-
createSubSkillAgent,
|
|
146
|
-
createSubAgent,
|
|
147
|
-
loadAttachTool,
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const CreateAgentTool = {
|
|
151
|
-
name: 'CreateAgentTool',
|
|
152
|
-
description: '提供子agent创建与任务分发能力,可按技能选择子agent执行目标任务',
|
|
153
|
-
descriptions,
|
|
154
|
-
functions,
|
|
155
|
-
isSystem: true
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
module.exports = CreateAgentTool
|