deepfish-ai 1.0.29 → 2.0.3

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.
Files changed (65) hide show
  1. package/README.md +195 -344
  2. package/dist/generate-skill.md +104 -0
  3. package/dist/generate-tool.md +88 -0
  4. package/dist/index.js +26831 -0
  5. package/dist/serve/client/assets/index-DUHYC91l.js +1 -0
  6. package/dist/serve/client/assets/index-zcrdNLZs.css +1 -0
  7. package/dist/serve/client/index.html +14 -0
  8. package/dist/serve/pm2-server.js +24405 -0
  9. package/dist/serve/server/entry-server.mjs +224 -0
  10. package/dist/view-learn-cache.md +65 -0
  11. package/package.json +77 -83
  12. package/LICENSE +0 -21
  13. package/README_CN.md +0 -460
  14. package/src/AgentRobot/AgentRobotFactory/MainAgentRobot.js +0 -88
  15. package/src/AgentRobot/AgentRobotFactory/SubAgentRobot.js +0 -45
  16. package/src/AgentRobot/AgentRobotFactory/SubSkillAgentRobot.js +0 -45
  17. package/src/AgentRobot/AgentRobotFactory/index.js +0 -48
  18. package/src/AgentRobot/BaseAgentRobot/Brain.js +0 -210
  19. package/src/AgentRobot/BaseAgentRobot/BrainEvent.js +0 -17
  20. package/src/AgentRobot/BaseAgentRobot/Hand.js +0 -119
  21. package/src/AgentRobot/BaseAgentRobot/Heart.js +0 -0
  22. package/src/AgentRobot/BaseAgentRobot/Logger.js +0 -114
  23. package/src/AgentRobot/BaseAgentRobot/ScreenPrinter.js +0 -49
  24. package/src/AgentRobot/BaseAgentRobot/index.js +0 -266
  25. package/src/AgentRobot/BaseAgentRobot/lazy-tools/AliBailian.js +0 -997
  26. package/src/AgentRobot/BaseAgentRobot/lazy-tools/doc-transform.js +0 -204
  27. package/src/AgentRobot/BaseAgentRobot/lazy-tools/docx.js +0 -1286
  28. package/src/AgentRobot/BaseAgentRobot/lazy-tools/img.js +0 -765
  29. package/src/AgentRobot/BaseAgentRobot/lazy-tools/pdf.js +0 -736
  30. package/src/AgentRobot/BaseAgentRobot/lazy-tools/pptx.js +0 -567
  31. package/src/AgentRobot/BaseAgentRobot/lazy-tools/video.js +0 -36
  32. package/src/AgentRobot/BaseAgentRobot/lazy-tools/xlsx.js +0 -611
  33. package/src/AgentRobot/BaseAgentRobot/tools/BaseTools.js +0 -13
  34. package/src/AgentRobot/BaseAgentRobot/tools/CreateAgentTools.js +0 -158
  35. package/src/AgentRobot/BaseAgentRobot/tools/FileTools.js +0 -768
  36. package/src/AgentRobot/BaseAgentRobot/tools/GenerateTools.js +0 -441
  37. package/src/AgentRobot/BaseAgentRobot/tools/InquirerTools.js +0 -244
  38. package/src/AgentRobot/BaseAgentRobot/tools/SystemTools.js +0 -424
  39. package/src/AgentRobot/BaseAgentRobot/tools/TaskTools.js +0 -211
  40. package/src/AgentRobot/BaseAgentRobot/tools/TestTools.js +0 -100
  41. package/src/AgentRobot/BaseAgentRobot/tools/UserTool.js +0 -87
  42. package/src/AgentRobot/BaseAgentRobot/tools/WebTools.js +0 -257
  43. package/src/AgentRobot/BaseAgentRobot/utils/AIRequest.js +0 -297
  44. package/src/AgentRobot/BaseAgentRobot/utils/AIToolManager.js +0 -131
  45. package/src/AgentRobot/BaseAgentRobot/utils/AgentTree.js +0 -66
  46. package/src/AgentRobot/BaseAgentRobot/utils/AttachmentToolScanner.js +0 -235
  47. package/src/AgentRobot/BaseAgentRobot/utils/MessageCompresser.js +0 -236
  48. package/src/AgentRobot/BaseAgentRobot/utils/aiConsole.js +0 -74
  49. package/src/AgentRobot/BaseAgentRobot/utils/aiInquirer.js +0 -78
  50. package/src/AgentRobot/BaseAgentRobot/utils/analyzeReturn.test.js +0 -104
  51. package/src/AgentRobot/BaseAgentRobot/utils/copilot.js +0 -117
  52. package/src/AgentRobot/BaseAgentRobot/utils/node-root.js +0 -138
  53. package/src/AgentRobot/BaseAgentRobot/utils/normal.js +0 -399
  54. package/src/cli/ConfigManager.js +0 -283
  55. package/src/cli/DefaultConfig.js +0 -98
  56. package/src/cli/GlobalVariable.js +0 -8
  57. package/src/cli/MemoryManager.js +0 -53
  58. package/src/cli/SkillConfigManager.js +0 -354
  59. package/src/cli/SkillParser.js +0 -58
  60. package/src/cli/ai-auth.js +0 -231
  61. package/src/cli/ai-config.js +0 -225
  62. package/src/cli/ai-memory.js +0 -22
  63. package/src/cli/ai-skill.js +0 -65
  64. package/src/cli/index.js +0 -77
  65. 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