@ddlqhd/agent-sdk 0.1.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/README.md +53 -0
- package/dist/chunk-5QMA2YBY.cjs +2880 -0
- package/dist/chunk-5QMA2YBY.cjs.map +1 -0
- package/dist/chunk-5Y56A64C.cjs +5 -0
- package/dist/chunk-5Y56A64C.cjs.map +1 -0
- package/dist/chunk-A3S3AGE3.js +3 -0
- package/dist/chunk-A3S3AGE3.js.map +1 -0
- package/dist/chunk-CNSGZVRN.cjs +152 -0
- package/dist/chunk-CNSGZVRN.cjs.map +1 -0
- package/dist/chunk-JF5AJQMU.cjs +2788 -0
- package/dist/chunk-JF5AJQMU.cjs.map +1 -0
- package/dist/chunk-NDSL7NPN.js +807 -0
- package/dist/chunk-NDSL7NPN.js.map +1 -0
- package/dist/chunk-OHXW2YM6.js +2708 -0
- package/dist/chunk-OHXW2YM6.js.map +1 -0
- package/dist/chunk-Q3SOMX26.js +2854 -0
- package/dist/chunk-Q3SOMX26.js.map +1 -0
- package/dist/chunk-WH3APNQ5.js +147 -0
- package/dist/chunk-WH3APNQ5.js.map +1 -0
- package/dist/chunk-X35MHWXE.cjs +817 -0
- package/dist/chunk-X35MHWXE.cjs.map +1 -0
- package/dist/cli/index.cjs +926 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +24 -0
- package/dist/cli/index.d.ts +24 -0
- package/dist/cli/index.js +916 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index-DPsZ1zat.d.ts +447 -0
- package/dist/index-RTPmFjMp.d.cts +447 -0
- package/dist/index.cjs +508 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +664 -0
- package/dist/index.d.ts +664 -0
- package/dist/index.js +204 -0
- package/dist/index.js.map +1 -0
- package/dist/models/index.cjs +62 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +165 -0
- package/dist/models/index.d.ts +165 -0
- package/dist/models/index.js +5 -0
- package/dist/models/index.js.map +1 -0
- package/dist/tools/index.cjs +207 -0
- package/dist/tools/index.cjs.map +1 -0
- package/dist/tools/index.d.cts +108 -0
- package/dist/tools/index.d.ts +108 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types-C0aX_Qdp.d.cts +917 -0
- package/dist/types-C0aX_Qdp.d.ts +917 -0
- package/package.json +80 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
require('../chunk-5Y56A64C.cjs');
|
|
5
|
+
var chunkJF5AJQMU_cjs = require('../chunk-JF5AJQMU.cjs');
|
|
6
|
+
require('../chunk-CNSGZVRN.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "DEFAULT_GREP_HEAD_LIMIT", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkJF5AJQMU_cjs.DEFAULT_GREP_HEAD_LIMIT; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "FileStorageStrategy", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkJF5AJQMU_cjs.FileStorageStrategy; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "HookManager", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkJF5AJQMU_cjs.HookManager; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "MAX_LINE_LENGTH", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkJF5AJQMU_cjs.MAX_LINE_LENGTH; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "OUTPUT_CONFIG", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkJF5AJQMU_cjs.OUTPUT_CONFIG; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "OutputHandler", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkJF5AJQMU_cjs.OutputHandler; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "PaginationHintStrategy", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkJF5AJQMU_cjs.PaginationHintStrategy; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "SmartTruncateStrategy", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return chunkJF5AJQMU_cjs.SmartTruncateStrategy; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "ToolRegistry", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkJF5AJQMU_cjs.ToolRegistry; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "agentTool", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkJF5AJQMU_cjs.agentTool; }
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "bashTool", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return chunkJF5AJQMU_cjs.bashTool; }
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "buildHookEnv", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () { return chunkJF5AJQMU_cjs.buildHookEnv; }
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "createAgentTool", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return chunkJF5AJQMU_cjs.createAgentTool; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "createAskUserQuestionTool", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return chunkJF5AJQMU_cjs.createAskUserQuestionTool; }
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "createFunctionHook", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () { return chunkJF5AJQMU_cjs.createFunctionHook; }
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "createOutputHandler", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () { return chunkJF5AJQMU_cjs.createOutputHandler; }
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "createSkillTool", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () { return chunkJF5AJQMU_cjs.createSkillTool; }
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "createTool", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () { return chunkJF5AJQMU_cjs.createTool; }
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "editTool", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () { return chunkJF5AJQMU_cjs.editTool; }
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "formatAnswerSummary", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () { return chunkJF5AJQMU_cjs.formatAnswerSummary; }
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "formatAskUserQuestionPrompt", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () { return chunkJF5AJQMU_cjs.formatAskUserQuestionPrompt; }
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "getAllBuiltinTools", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () { return chunkJF5AJQMU_cjs.getAllBuiltinTools; }
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "getFileSystemTools", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () { return chunkJF5AJQMU_cjs.getFileSystemTools; }
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "getGlobalRegistry", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () { return chunkJF5AJQMU_cjs.getGlobalRegistry; }
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "getGrepTools", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return chunkJF5AJQMU_cjs.getGrepTools; }
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "getInteractionTools", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () { return chunkJF5AJQMU_cjs.getInteractionTools; }
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "getSafeBuiltinTools", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () { return chunkJF5AJQMU_cjs.getSafeBuiltinTools; }
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "getShellTools", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return chunkJF5AJQMU_cjs.getShellTools; }
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "getSkillTools", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () { return chunkJF5AJQMU_cjs.getSkillTools; }
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "getSubagentTools", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () { return chunkJF5AJQMU_cjs.getSubagentTools; }
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "getTaskTools", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () { return chunkJF5AJQMU_cjs.getTaskTools; }
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "getWebTools", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function () { return chunkJF5AJQMU_cjs.getWebTools; }
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "globTool", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () { return chunkJF5AJQMU_cjs.globTool; }
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "grepTool", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () { return chunkJF5AJQMU_cjs.grepTool; }
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "loadHooksSettingsFromProject", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function () { return chunkJF5AJQMU_cjs.loadHooksSettingsFromProject; }
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "loadHooksSettingsFromUser", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () { return chunkJF5AJQMU_cjs.loadHooksSettingsFromUser; }
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "matchTool", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () { return chunkJF5AJQMU_cjs.matchTool; }
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "mergeCommandHookLayers", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function () { return chunkJF5AJQMU_cjs.mergeCommandHookLayers; }
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "parseHooksSettingsFile", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () { return chunkJF5AJQMU_cjs.parseHooksSettingsFile; }
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "questionTool", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () { return chunkJF5AJQMU_cjs.questionTool; }
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "readFileTool", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function () { return chunkJF5AJQMU_cjs.readFileTool; }
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "subagentRequestSchema", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () { return chunkJF5AJQMU_cjs.subagentRequestSchema; }
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "taskCreateTool", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () { return chunkJF5AJQMU_cjs.taskCreateTool; }
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, "taskListTool", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function () { return chunkJF5AJQMU_cjs.taskListTool; }
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "taskUpdateTool", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () { return chunkJF5AJQMU_cjs.taskUpdateTool; }
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "truncateMatchLineForDisplay", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function () { return chunkJF5AJQMU_cjs.truncateMatchLineForDisplay; }
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(exports, "webFetchTool", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function () { return chunkJF5AJQMU_cjs.webFetchTool; }
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "webSearchTool", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () { return chunkJF5AJQMU_cjs.webSearchTool; }
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "writeFileTool", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function () { return chunkJF5AJQMU_cjs.writeFileTool; }
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=index.cjs.map
|
|
207
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, c as SubagentRequest, d as SubagentRunner, e as ToolExecuteOptions, T as ToolRegistry, f as ToolRegistryConfig, g as agentTool, h as bashTool, i as createAgentTool, l as createSkillTool, m as createTool, n as editTool, o as getAllBuiltinTools, p as getFileSystemTools, q as getGlobalRegistry, r as getGrepTools, s as getSafeBuiltinTools, t as getShellTools, u as getSkillTools, v as getSubagentTools, w as getTaskTools, x as getWebTools, y as globTool, z as grepTool, A as loadHooksSettingsFromProject, B as loadHooksSettingsFromUser, E as parseHooksSettingsFile, F as readFileTool, G as subagentRequestSchema, H as taskCreateTool, I as taskListTool, J as taskUpdateTool, K as truncateMatchLineForDisplay, L as webFetchTool, N as webSearchTool, O as writeFileTool } from '../index-RTPmFjMp.cjs';
|
|
2
|
+
import { T as ToolResult } from '../types-C0aX_Qdp.cjs';
|
|
3
|
+
export { m as AskUserQuestionAnswer, n as AskUserQuestionItem, o as AskUserQuestionResolver, s as CommandHookConfig, w as CreateAskUserQuestionToolOptions, F as FlatCommandHookEntry, x as FunctionHook, H as HookContext, y as HookEventType, z as HookGroupConfig, B as HookManager, D as HookResult, E as HooksSettings, G as HooksSettingsFile, c as ToolDefinition, ab as ToolResultMetadata, ac as ToolSchema, ae as buildHookEnv, af as createAskUserQuestionTool, ag as createFunctionHook, ah as formatAnswerSummary, ai as formatAskUserQuestionPrompt, aj as getInteractionTools, ak as matchTool, al as mergeCommandHookLayers, am as questionTool } from '../types-C0aX_Qdp.cjs';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 输出处理配置
|
|
8
|
+
*/
|
|
9
|
+
declare const OUTPUT_CONFIG: {
|
|
10
|
+
/** 直接返回的最大字符数 (~12k tokens) */
|
|
11
|
+
maxDirectOutput: number;
|
|
12
|
+
/** 保存到文件的最大大小 */
|
|
13
|
+
maxStorageSize: number;
|
|
14
|
+
/** 摘要显示的行数 */
|
|
15
|
+
summaryHeadLines: number;
|
|
16
|
+
summaryTailLines: number;
|
|
17
|
+
/** 智能截断保留的行数 */
|
|
18
|
+
truncateHeadLines: number;
|
|
19
|
+
truncateTailLines: number;
|
|
20
|
+
/** 存储目录 */
|
|
21
|
+
storageDir: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 输出策略接口
|
|
25
|
+
*/
|
|
26
|
+
interface OutputStrategy {
|
|
27
|
+
/**
|
|
28
|
+
* 处理超长输出
|
|
29
|
+
* @param content 原始内容
|
|
30
|
+
* @param toolName 工具名称
|
|
31
|
+
* @param context 上下文信息
|
|
32
|
+
*/
|
|
33
|
+
handle(content: string, toolName: string, context?: {
|
|
34
|
+
args?: unknown;
|
|
35
|
+
cwd?: string;
|
|
36
|
+
userBasePath?: string;
|
|
37
|
+
}): Promise<ToolResult>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 文件存储策略 (shell / MCP / web)
|
|
41
|
+
* 保存完整内容到文件,返回摘要 + 文件路径;可用 Read 的 offset/limit 分页查看
|
|
42
|
+
*/
|
|
43
|
+
declare class FileStorageStrategy implements OutputStrategy {
|
|
44
|
+
private userBasePath;
|
|
45
|
+
constructor(userBasePath?: string);
|
|
46
|
+
handle(content: string, toolName: string, context?: {
|
|
47
|
+
args?: unknown;
|
|
48
|
+
cwd?: string;
|
|
49
|
+
userBasePath?: string;
|
|
50
|
+
}): Promise<ToolResult>;
|
|
51
|
+
private generateSummary;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 分页提示策略 (filesystem)
|
|
55
|
+
* 提示用户使用分页参数,显示预览
|
|
56
|
+
*/
|
|
57
|
+
declare class PaginationHintStrategy implements OutputStrategy {
|
|
58
|
+
handle(content: string, _toolName: string, context?: {
|
|
59
|
+
args?: unknown;
|
|
60
|
+
cwd?: string;
|
|
61
|
+
}): Promise<ToolResult>;
|
|
62
|
+
private extractFilePath;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 智能截断策略 (search/默认)
|
|
66
|
+
* 保留首尾内容,显示省略统计
|
|
67
|
+
*/
|
|
68
|
+
declare class SmartTruncateStrategy implements OutputStrategy {
|
|
69
|
+
handle(content: string, _toolName: string, _context?: {
|
|
70
|
+
args?: unknown;
|
|
71
|
+
cwd?: string;
|
|
72
|
+
}): Promise<ToolResult>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 输出处理器
|
|
76
|
+
* 根据工具类别选择合适的处理策略
|
|
77
|
+
*/
|
|
78
|
+
declare class OutputHandler {
|
|
79
|
+
private strategies;
|
|
80
|
+
private defaultStrategy;
|
|
81
|
+
constructor(userBasePath?: string);
|
|
82
|
+
/**
|
|
83
|
+
* 处理工具输出
|
|
84
|
+
* @param content 工具输出内容
|
|
85
|
+
* @param toolName 工具名称
|
|
86
|
+
* @param category 工具类别
|
|
87
|
+
* @param context 上下文信息
|
|
88
|
+
*/
|
|
89
|
+
handle(content: string, toolName: string, category?: string, context?: {
|
|
90
|
+
args?: unknown;
|
|
91
|
+
cwd?: string;
|
|
92
|
+
userBasePath?: string;
|
|
93
|
+
}): Promise<ToolResult>;
|
|
94
|
+
/**
|
|
95
|
+
* 注册自定义策略
|
|
96
|
+
*/
|
|
97
|
+
registerStrategy(category: string, strategy: OutputStrategy): void;
|
|
98
|
+
/**
|
|
99
|
+
* 检查内容是否需要处理
|
|
100
|
+
*/
|
|
101
|
+
needsHandling(content: string): boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 创建输出处理器
|
|
105
|
+
*/
|
|
106
|
+
declare function createOutputHandler(userBasePath?: string): OutputHandler;
|
|
107
|
+
|
|
108
|
+
export { FileStorageStrategy, OUTPUT_CONFIG, OutputHandler, type OutputStrategy, PaginationHintStrategy, SmartTruncateStrategy, ToolResult, createOutputHandler };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, c as SubagentRequest, d as SubagentRunner, e as ToolExecuteOptions, T as ToolRegistry, f as ToolRegistryConfig, g as agentTool, h as bashTool, i as createAgentTool, l as createSkillTool, m as createTool, n as editTool, o as getAllBuiltinTools, p as getFileSystemTools, q as getGlobalRegistry, r as getGrepTools, s as getSafeBuiltinTools, t as getShellTools, u as getSkillTools, v as getSubagentTools, w as getTaskTools, x as getWebTools, y as globTool, z as grepTool, A as loadHooksSettingsFromProject, B as loadHooksSettingsFromUser, E as parseHooksSettingsFile, F as readFileTool, G as subagentRequestSchema, H as taskCreateTool, I as taskListTool, J as taskUpdateTool, K as truncateMatchLineForDisplay, L as webFetchTool, N as webSearchTool, O as writeFileTool } from '../index-DPsZ1zat.js';
|
|
2
|
+
import { T as ToolResult } from '../types-C0aX_Qdp.js';
|
|
3
|
+
export { m as AskUserQuestionAnswer, n as AskUserQuestionItem, o as AskUserQuestionResolver, s as CommandHookConfig, w as CreateAskUserQuestionToolOptions, F as FlatCommandHookEntry, x as FunctionHook, H as HookContext, y as HookEventType, z as HookGroupConfig, B as HookManager, D as HookResult, E as HooksSettings, G as HooksSettingsFile, c as ToolDefinition, ab as ToolResultMetadata, ac as ToolSchema, ae as buildHookEnv, af as createAskUserQuestionTool, ag as createFunctionHook, ah as formatAnswerSummary, ai as formatAskUserQuestionPrompt, aj as getInteractionTools, ak as matchTool, al as mergeCommandHookLayers, am as questionTool } from '../types-C0aX_Qdp.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 输出处理配置
|
|
8
|
+
*/
|
|
9
|
+
declare const OUTPUT_CONFIG: {
|
|
10
|
+
/** 直接返回的最大字符数 (~12k tokens) */
|
|
11
|
+
maxDirectOutput: number;
|
|
12
|
+
/** 保存到文件的最大大小 */
|
|
13
|
+
maxStorageSize: number;
|
|
14
|
+
/** 摘要显示的行数 */
|
|
15
|
+
summaryHeadLines: number;
|
|
16
|
+
summaryTailLines: number;
|
|
17
|
+
/** 智能截断保留的行数 */
|
|
18
|
+
truncateHeadLines: number;
|
|
19
|
+
truncateTailLines: number;
|
|
20
|
+
/** 存储目录 */
|
|
21
|
+
storageDir: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 输出策略接口
|
|
25
|
+
*/
|
|
26
|
+
interface OutputStrategy {
|
|
27
|
+
/**
|
|
28
|
+
* 处理超长输出
|
|
29
|
+
* @param content 原始内容
|
|
30
|
+
* @param toolName 工具名称
|
|
31
|
+
* @param context 上下文信息
|
|
32
|
+
*/
|
|
33
|
+
handle(content: string, toolName: string, context?: {
|
|
34
|
+
args?: unknown;
|
|
35
|
+
cwd?: string;
|
|
36
|
+
userBasePath?: string;
|
|
37
|
+
}): Promise<ToolResult>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 文件存储策略 (shell / MCP / web)
|
|
41
|
+
* 保存完整内容到文件,返回摘要 + 文件路径;可用 Read 的 offset/limit 分页查看
|
|
42
|
+
*/
|
|
43
|
+
declare class FileStorageStrategy implements OutputStrategy {
|
|
44
|
+
private userBasePath;
|
|
45
|
+
constructor(userBasePath?: string);
|
|
46
|
+
handle(content: string, toolName: string, context?: {
|
|
47
|
+
args?: unknown;
|
|
48
|
+
cwd?: string;
|
|
49
|
+
userBasePath?: string;
|
|
50
|
+
}): Promise<ToolResult>;
|
|
51
|
+
private generateSummary;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 分页提示策略 (filesystem)
|
|
55
|
+
* 提示用户使用分页参数,显示预览
|
|
56
|
+
*/
|
|
57
|
+
declare class PaginationHintStrategy implements OutputStrategy {
|
|
58
|
+
handle(content: string, _toolName: string, context?: {
|
|
59
|
+
args?: unknown;
|
|
60
|
+
cwd?: string;
|
|
61
|
+
}): Promise<ToolResult>;
|
|
62
|
+
private extractFilePath;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 智能截断策略 (search/默认)
|
|
66
|
+
* 保留首尾内容,显示省略统计
|
|
67
|
+
*/
|
|
68
|
+
declare class SmartTruncateStrategy implements OutputStrategy {
|
|
69
|
+
handle(content: string, _toolName: string, _context?: {
|
|
70
|
+
args?: unknown;
|
|
71
|
+
cwd?: string;
|
|
72
|
+
}): Promise<ToolResult>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 输出处理器
|
|
76
|
+
* 根据工具类别选择合适的处理策略
|
|
77
|
+
*/
|
|
78
|
+
declare class OutputHandler {
|
|
79
|
+
private strategies;
|
|
80
|
+
private defaultStrategy;
|
|
81
|
+
constructor(userBasePath?: string);
|
|
82
|
+
/**
|
|
83
|
+
* 处理工具输出
|
|
84
|
+
* @param content 工具输出内容
|
|
85
|
+
* @param toolName 工具名称
|
|
86
|
+
* @param category 工具类别
|
|
87
|
+
* @param context 上下文信息
|
|
88
|
+
*/
|
|
89
|
+
handle(content: string, toolName: string, category?: string, context?: {
|
|
90
|
+
args?: unknown;
|
|
91
|
+
cwd?: string;
|
|
92
|
+
userBasePath?: string;
|
|
93
|
+
}): Promise<ToolResult>;
|
|
94
|
+
/**
|
|
95
|
+
* 注册自定义策略
|
|
96
|
+
*/
|
|
97
|
+
registerStrategy(category: string, strategy: OutputStrategy): void;
|
|
98
|
+
/**
|
|
99
|
+
* 检查内容是否需要处理
|
|
100
|
+
*/
|
|
101
|
+
needsHandling(content: string): boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 创建输出处理器
|
|
105
|
+
*/
|
|
106
|
+
declare function createOutputHandler(userBasePath?: string): OutputHandler;
|
|
107
|
+
|
|
108
|
+
export { FileStorageStrategy, OUTPUT_CONFIG, OutputHandler, type OutputStrategy, PaginationHintStrategy, SmartTruncateStrategy, ToolResult, createOutputHandler };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '../chunk-A3S3AGE3.js';
|
|
3
|
+
export { DEFAULT_GREP_HEAD_LIMIT, FileStorageStrategy, HookManager, MAX_LINE_LENGTH, OUTPUT_CONFIG, OutputHandler, PaginationHintStrategy, SmartTruncateStrategy, ToolRegistry, agentTool, bashTool, buildHookEnv, createAgentTool, createAskUserQuestionTool, createFunctionHook, createOutputHandler, createSkillTool, createTool, editTool, formatAnswerSummary, formatAskUserQuestionPrompt, getAllBuiltinTools, getFileSystemTools, getGlobalRegistry, getGrepTools, getInteractionTools, getSafeBuiltinTools, getShellTools, getSkillTools, getSubagentTools, getTaskTools, getWebTools, globTool, grepTool, loadHooksSettingsFromProject, loadHooksSettingsFromUser, matchTool, mergeCommandHookLayers, parseHooksSettingsFile, questionTool, readFileTool, subagentRequestSchema, taskCreateTool, taskListTool, taskUpdateTool, truncateMatchLineForDisplay, webFetchTool, webSearchTool, writeFileTool } from '../chunk-OHXW2YM6.js';
|
|
4
|
+
import '../chunk-WH3APNQ5.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|