yuangs 5.57.0 → 5.59.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/dist/agent/AgentRuntime.js +126 -9
- package/dist/agent/AgentRuntime.js.map +1 -1
- package/dist/agent/errorTracker.d.ts +110 -0
- package/dist/agent/errorTracker.js +243 -0
- package/dist/agent/errorTracker.js.map +1 -0
- package/dist/agent/executor.d.ts +89 -1
- package/dist/agent/executor.js +704 -11
- package/dist/agent/executor.js.map +1 -1
- package/dist/agent/protocolV2_2.js +74 -28
- package/dist/agent/protocolV2_2.js.map +1 -1
- package/dist/agent/state.d.ts +2 -0
- package/dist/agent/toolCapability.d.ts +81 -0
- package/dist/agent/toolCapability.js +504 -0
- package/dist/agent/toolCapability.js.map +1 -0
- package/package.json +1 -1
package/dist/agent/executor.d.ts
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
import { ProposedAction, ToolExecutionResult } from './state';
|
|
2
|
+
import { CapabilityLevel } from '../core/capability/CapabilityLevel';
|
|
3
|
+
/**
|
|
4
|
+
* 增强的工具执行器
|
|
5
|
+
* 支持丰富的原子工具操作
|
|
6
|
+
* 集成能力感知的工具调用
|
|
7
|
+
*/
|
|
2
8
|
export declare class ToolExecutor {
|
|
3
9
|
private static readonly MAX_OUTPUT_LENGTH;
|
|
10
|
+
private static readonly READ_POSITIONS;
|
|
11
|
+
private static currentCapabilityLevel;
|
|
4
12
|
/**
|
|
5
|
-
*
|
|
13
|
+
* 设置当前能力等级
|
|
14
|
+
*/
|
|
15
|
+
static setCapabilityLevel(level: CapabilityLevel): void;
|
|
16
|
+
/**
|
|
17
|
+
* 获取当前能力等级
|
|
18
|
+
*/
|
|
19
|
+
static getCapabilityLevel(): CapabilityLevel;
|
|
20
|
+
/**
|
|
21
|
+
* 检查工具是否可以被当前能力等级执行
|
|
22
|
+
*/
|
|
23
|
+
static checkToolCapability(toolName: string): {
|
|
24
|
+
allowed: boolean;
|
|
25
|
+
required?: CapabilityLevel;
|
|
26
|
+
current?: CapabilityLevel;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 获取指定能力等级下可用的工具列表
|
|
30
|
+
*/
|
|
31
|
+
static getAvailableTools(): string[];
|
|
32
|
+
/**
|
|
33
|
+
* 获取能力等级的可读名称
|
|
34
|
+
*/
|
|
35
|
+
private static getCapabilityName;
|
|
36
|
+
/**
|
|
37
|
+
* 智能截断输出
|
|
38
|
+
* 当输出过长时,返回特殊标记和继续读取的提示
|
|
6
39
|
*/
|
|
7
40
|
private static maybeTruncate;
|
|
8
41
|
static execute(action: ProposedAction): Promise<ToolExecutionResult>;
|
|
@@ -14,4 +47,59 @@ export declare class ToolExecutor {
|
|
|
14
47
|
private static getFiles;
|
|
15
48
|
private static executeShell;
|
|
16
49
|
private static executeDiff;
|
|
50
|
+
/**
|
|
51
|
+
* 读取文件的指定行范围
|
|
52
|
+
*/
|
|
53
|
+
private static toolReadFileLines;
|
|
54
|
+
/**
|
|
55
|
+
* 从文件末尾读取指定行数(倒数行)
|
|
56
|
+
* 例如:count=5 表示读取最后5行,count=5, start_offset=2 表示读取倒数第2到5行
|
|
57
|
+
*/
|
|
58
|
+
private static toolReadFileLinesFromEnd;
|
|
59
|
+
/**
|
|
60
|
+
* 向文件末尾追加内容
|
|
61
|
+
*/
|
|
62
|
+
private static toolAppendFile;
|
|
63
|
+
/**
|
|
64
|
+
* 生成目录结构的树形展示
|
|
65
|
+
*/
|
|
66
|
+
private static toolListDirectoryTree;
|
|
67
|
+
private static buildDirectoryTree;
|
|
68
|
+
/**
|
|
69
|
+
* 在文件中搜索指定内容(类似 grep)
|
|
70
|
+
*/
|
|
71
|
+
private static toolSearchInFiles;
|
|
72
|
+
/**
|
|
73
|
+
* 搜索代码符号(函数、类、变量等)
|
|
74
|
+
* 使用 grep 进行简化搜索
|
|
75
|
+
*/
|
|
76
|
+
private static toolSearchSymbol;
|
|
77
|
+
/**
|
|
78
|
+
* 分析文件的依赖关系(import/require)
|
|
79
|
+
*/
|
|
80
|
+
private static toolAnalyzeDependencies;
|
|
81
|
+
/**
|
|
82
|
+
* Git 状态
|
|
83
|
+
*/
|
|
84
|
+
private static toolGitStatus;
|
|
85
|
+
/**
|
|
86
|
+
* Git 差异
|
|
87
|
+
*/
|
|
88
|
+
private static toolGitDiff;
|
|
89
|
+
/**
|
|
90
|
+
* Git 日志
|
|
91
|
+
*/
|
|
92
|
+
private static toolGitLog;
|
|
93
|
+
/**
|
|
94
|
+
* 继续读取之前被截断的文件内容
|
|
95
|
+
*/
|
|
96
|
+
private static toolContinueReading;
|
|
97
|
+
/**
|
|
98
|
+
* 获取文件元信息
|
|
99
|
+
*/
|
|
100
|
+
private static toolFileInfo;
|
|
101
|
+
/**
|
|
102
|
+
* 格式化字节数
|
|
103
|
+
*/
|
|
104
|
+
private static formatBytes;
|
|
17
105
|
}
|