deepfish-ai 2.0.14 → 2.0.15
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/dist/index.js +27 -14
- package/dist/skills/planning-do.md +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8704,6 +8704,7 @@ function getGlobalNodeModulesPath() {
|
|
|
8704
8704
|
var node_root_default = getGlobalNodeModulesPath;
|
|
8705
8705
|
|
|
8706
8706
|
// src/cli/cli-utils/getGlobalPath.ts
|
|
8707
|
+
var import_os2 = __toESM(require("os"));
|
|
8707
8708
|
var getDirname = () => __dirname;
|
|
8708
8709
|
function getHomePath() {
|
|
8709
8710
|
return HOME_DIR;
|
|
@@ -8772,6 +8773,11 @@ function getScanDirPaths() {
|
|
|
8772
8773
|
}
|
|
8773
8774
|
return Array.from(paths);
|
|
8774
8775
|
}
|
|
8776
|
+
function getScanSkillDirPaths() {
|
|
8777
|
+
const workspacePath = getWorkspacePath();
|
|
8778
|
+
const paths = getScanDirPaths();
|
|
8779
|
+
return [...paths, import_path2.default.join(import_os2.default.homedir(), ".agents"), import_path2.default.join(workspacePath, ".agents")];
|
|
8780
|
+
}
|
|
8775
8781
|
function getMCPFilePath() {
|
|
8776
8782
|
const mcpPath = import_path2.default.join(HOME_DIR, "mcp.json");
|
|
8777
8783
|
if (!import_fs_extra.default.pathExistsSync(mcpPath)) {
|
|
@@ -24511,7 +24517,7 @@ ${params.systemPrompt + basePrompt}
|
|
|
24511
24517
|
// src/agent/tools/executeCommand.ts
|
|
24512
24518
|
var import_child_process2 = require("child_process");
|
|
24513
24519
|
var import_chardet = __toESM(require_lib());
|
|
24514
|
-
var
|
|
24520
|
+
var import_os3 = __toESM(require("os"));
|
|
24515
24521
|
var import_iconv_lite = __toESM(require("iconv-lite"));
|
|
24516
24522
|
var import_langchain3 = require("langchain");
|
|
24517
24523
|
|
|
@@ -24936,7 +24942,7 @@ Command executed successfully`);
|
|
|
24936
24942
|
}
|
|
24937
24943
|
function detectEncoding(buffer) {
|
|
24938
24944
|
if (!buffer) {
|
|
24939
|
-
return
|
|
24945
|
+
return import_os3.default.platform() === "win32" ? "gbk" : "utf-8";
|
|
24940
24946
|
}
|
|
24941
24947
|
const detected = import_chardet.default.detect(buffer);
|
|
24942
24948
|
const encoding = detected?.toLowerCase();
|
|
@@ -24946,11 +24952,11 @@ function detectEncoding(buffer) {
|
|
|
24946
24952
|
if (encoding && ["gbk", "gb2312", "gb18030"].includes(encoding)) {
|
|
24947
24953
|
return "gbk";
|
|
24948
24954
|
}
|
|
24949
|
-
return
|
|
24955
|
+
return import_os3.default.platform() === "win32" ? "gbk" : "utf-8";
|
|
24950
24956
|
}
|
|
24951
24957
|
var executeCommandTool = (0, import_langchain3.tool)(({ command, timeout }) => safeTool(() => executeCommand(command, timeout)), {
|
|
24952
24958
|
name: "execute_command",
|
|
24953
|
-
description: `\u5728\u672C\u5730\u7CFB\u7EDF(${
|
|
24959
|
+
description: `\u5728\u672C\u5730\u7CFB\u7EDF(${import_os3.default.platform()})\u4E0A\u6267\u884C\u4E00\u6761 shell \u547D\u4EE4\u5E76\u8FD4\u56DE\u8F93\u51FA\u7ED3\u679C\u3002\u9002\u7528\u4E8Erunning\u811A\u672C\u3001\u64CD\u4F5C\u6587\u4EF6\u7CFB\u7EDF\u3001\u542F\u52A8\u8FDB\u7A0B\u7B49\u573A\u666F\u3002\u5FC5\u987B\u6CE8\u610F\u64CD\u4F5C\u7CFB\u7EDF\u7684\u517C\u5BB9\u6027\uFF0C\u5F53\u524D\u64CD\u4F5C\u7CFB\u7EDF\u4E3A ${import_os3.default.platform()}\u3002`,
|
|
24954
24960
|
schema: external_exports.object({
|
|
24955
24961
|
command: external_exports.string().describe("\u8981\u6267\u884C\u7684 shell \u547D\u4EE4"),
|
|
24956
24962
|
timeout: external_exports.number().default(-1).describe("\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\uFF0C-1 \u8868\u793A\u4E0D\u9650\u5236")
|
|
@@ -25874,13 +25880,13 @@ function getSkills() {
|
|
|
25874
25880
|
}
|
|
25875
25881
|
|
|
25876
25882
|
// src/agent/AIAgent/index.ts
|
|
25877
|
-
var
|
|
25883
|
+
var import_os5 = __toESM(require("os"));
|
|
25878
25884
|
|
|
25879
25885
|
// src/agent/AIAgent/SubAgents/SubAIAgent.ts
|
|
25880
25886
|
var import_langchain18 = require("langchain");
|
|
25881
25887
|
var import_deepagents = require("deepagents");
|
|
25882
25888
|
var import_eventemitter_super = require("eventemitter-super");
|
|
25883
|
-
var
|
|
25889
|
+
var import_os4 = __toESM(require("os"));
|
|
25884
25890
|
var import_crypto4 = require("crypto");
|
|
25885
25891
|
var import_lodash = require("lodash");
|
|
25886
25892
|
var SubAIAgent = class _SubAIAgent extends import_eventemitter_super.EventEmitterSuper {
|
|
@@ -25944,7 +25950,7 @@ var SubAIAgent = class _SubAIAgent extends import_eventemitter_super.EventEmitte
|
|
|
25944
25950
|
const systemPrompt = this.subLevel > 2 ? getSystemPrompt({
|
|
25945
25951
|
systemPrompt: this.systemPrompt,
|
|
25946
25952
|
workspace: this.workspace,
|
|
25947
|
-
osType:
|
|
25953
|
+
osType: import_os4.default.platform(),
|
|
25948
25954
|
skills: this.skills,
|
|
25949
25955
|
memoryFilePath: this.memoryFilePath,
|
|
25950
25956
|
agentRulesPath: this.agentRulesPath,
|
|
@@ -25952,7 +25958,7 @@ var SubAIAgent = class _SubAIAgent extends import_eventemitter_super.EventEmitte
|
|
|
25952
25958
|
}) : subSystemPrompt({
|
|
25953
25959
|
systemPrompt: this.systemPrompt,
|
|
25954
25960
|
workspace: this.workspace,
|
|
25955
|
-
osType:
|
|
25961
|
+
osType: import_os4.default.platform(),
|
|
25956
25962
|
skills: this.skills,
|
|
25957
25963
|
excludeSkills: this.excludeSkills
|
|
25958
25964
|
});
|
|
@@ -26152,7 +26158,7 @@ var AIAgent = class extends import_eventemitter_super2.EventEmitterSuper {
|
|
|
26152
26158
|
systemPrompt: getSystemPrompt({
|
|
26153
26159
|
systemPrompt: this.systemPrompt,
|
|
26154
26160
|
workspace: this.workspace,
|
|
26155
|
-
osType:
|
|
26161
|
+
osType: import_os5.default.platform(),
|
|
26156
26162
|
skills: this.skills,
|
|
26157
26163
|
memoryFilePath: this.memoryFilePath,
|
|
26158
26164
|
agentRulesPath: this.agentRulesPath,
|
|
@@ -26929,7 +26935,7 @@ function _updateRegister(skillsDir) {
|
|
|
26929
26935
|
import_fs_extra20.default.writeJSONSync(registerPath, register, { spaces: 2 });
|
|
26930
26936
|
}
|
|
26931
26937
|
function getRegisteredSkills() {
|
|
26932
|
-
const scanPaths =
|
|
26938
|
+
const scanPaths = getScanSkillDirPaths();
|
|
26933
26939
|
const skills = [];
|
|
26934
26940
|
scanPaths.forEach((scanPath) => {
|
|
26935
26941
|
const scanDir = import_path20.default.join(scanPath, "skills");
|
|
@@ -26957,7 +26963,7 @@ function _getSkillList(skillsDir) {
|
|
|
26957
26963
|
return allSkills;
|
|
26958
26964
|
}
|
|
26959
26965
|
function _getAllSkills() {
|
|
26960
|
-
const scanPaths =
|
|
26966
|
+
const scanPaths = getScanSkillDirPaths();
|
|
26961
26967
|
let allSkills = [];
|
|
26962
26968
|
scanPaths.forEach((scanPath) => {
|
|
26963
26969
|
const scanDir = import_path20.default.join(scanPath, "skills");
|
|
@@ -26973,10 +26979,17 @@ function _getAllSkills() {
|
|
|
26973
26979
|
function _getRegisterPath(skillsDir) {
|
|
26974
26980
|
const normalizedDir = import_path20.default.normalize(skillsDir);
|
|
26975
26981
|
const baseName = import_path20.default.basename(normalizedDir).toLowerCase();
|
|
26982
|
+
let resultPath = "";
|
|
26976
26983
|
if (baseName === "@deepfish-ai" || baseName === "skills") {
|
|
26977
|
-
|
|
26984
|
+
resultPath = import_path20.default.join(normalizedDir, "register.json");
|
|
26985
|
+
} else {
|
|
26986
|
+
resultPath = import_path20.default.join(normalizedDir, "skills", "register.json");
|
|
26987
|
+
}
|
|
26988
|
+
if (import_fs_extra20.default.existsSync(normalizedDir) && !import_fs_extra20.default.existsSync(resultPath)) {
|
|
26989
|
+
import_fs_extra20.default.ensureDirSync(import_path20.default.dirname(resultPath));
|
|
26990
|
+
import_fs_extra20.default.writeJSONSync(resultPath, [], { spaces: 2 });
|
|
26978
26991
|
}
|
|
26979
|
-
return
|
|
26992
|
+
return resultPath;
|
|
26980
26993
|
}
|
|
26981
26994
|
|
|
26982
26995
|
// src/cli/cli-skills.ts
|
|
@@ -27446,7 +27459,7 @@ async function handlePlan(args) {
|
|
|
27446
27459
|
}
|
|
27447
27460
|
async function handlePlanContinue() {
|
|
27448
27461
|
const skillPrompt = `
|
|
27449
|
-
\u76EE\u524D\u4EFB\u52A1\u6267\u884C\u4E86\u4E00\u90E8\u5206\uFF0C\u9700\u8981\u7EE7\u7EED\u6267\u884C\u3002\u4F60\u8D1F\u8D23\u6309\u987A\u5E8F\u8C03\u5EA6\u6267\u884C tmp_tasklist.json \u4E2D\u7684\u5B50\u4EFB\u52A1\uFF0C\u5B8C\u6210 tmp_task_goal.md \u63CF\u8FF0\u7684\u6574\u4F53\u76EE\u6807\u3002
|
|
27462
|
+
\u76EE\u524D\u4EFB\u52A1\u6267\u884C\u4E86\u4E00\u90E8\u5206\uFF0C\u9700\u8981\u7EE7\u7EED\u6267\u884C\u3002\u4F60\u8D1F\u8D23\u6309\u987A\u5E8F\u8C03\u5EA6\u6267\u884C\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\u6587\u4EF6 tmp_tasklist.json \u4E2D\u7684\u5B50\u4EFB\u52A1\uFF0C\u5B8C\u6210\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\u6587\u4EF6 tmp_task_goal.md \u63CF\u8FF0\u7684\u6574\u4F53\u76EE\u6807\u3002
|
|
27450
27463
|
|
|
27451
27464
|
\u6267\u884C\u89C4\u5219\uFF1A
|
|
27452
27465
|
1. \u5148\u8BFB\u53D6 tmp_task_goal.md \u4E86\u89E3\u6574\u4F53\u76EE\u6807\uFF1B
|
|
@@ -29,8 +29,8 @@ homepage: ''
|
|
|
29
29
|
- 一次最多问8个问题,避免一次性问太多
|
|
30
30
|
- 持续交互直到需求足够清晰,能够拆解为具体的子任务
|
|
31
31
|
3. 将收敛后的完整需求作为用户的原始任务描述;
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
32
|
+
4. 在当前工作目录创建文件 tmp_task_goal.md,记录收敛后的完整需求描述;
|
|
33
|
+
5. 在当前工作目录创建文件 tmp_tasklist.json,包含拆解后的子任务列表。
|
|
34
34
|
|
|
35
35
|
tmp_tasklist.json 格式要求:
|
|
36
36
|
- 必须是合法的 JSON 数组
|
|
@@ -60,7 +60,7 @@ tmp_tasklist.json 格式要求:
|
|
|
60
60
|
**调度管理器子Agent提示词:**
|
|
61
61
|
|
|
62
62
|
```
|
|
63
|
-
|
|
63
|
+
你负责按顺序调度执行当前工作目录文件 tmp_tasklist.json 中的子任务,完成当前工作目录文件 tmp_task_goal.md 描述的整体目标。
|
|
64
64
|
|
|
65
65
|
执行规则:
|
|
66
66
|
1. 先读取 tmp_task_goal.md 了解整体目标;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deepfish-ai",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "An efficient AI-driven command-line tool designed to bridge the gap between natural language and operating system commands, file operations, and more. It enables non-developers to quickly generate executable instructions through simple natural language descriptions, significantly improving terminal operation efficiency.",
|
|
6
6
|
"repository": {
|