@ai-setting/roy-agent-core 1.5.4 → 1.5.6
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/config/index.d.ts +1250 -0
- package/dist/env/agent/index.d.ts +2279 -0
- package/dist/env/agent/index.js +7 -7
- package/dist/env/commands/index.d.ts +1131 -0
- package/dist/env/commands/index.js +4 -4
- package/dist/env/debug/formatters/index.d.ts +236 -0
- package/dist/env/debug/index.d.ts +1652 -0
- package/dist/env/debug/index.js +1 -1
- package/dist/env/hook/index.d.ts +279 -0
- package/dist/env/index.d.ts +3460 -0
- package/dist/env/index.js +18 -18
- package/dist/env/llm/index.d.ts +1760 -0
- package/dist/env/llm/index.js +5 -5
- package/dist/env/log-trace/index.d.ts +1574 -0
- package/dist/env/log-trace/index.js +5 -5
- package/dist/env/mcp/index.d.ts +1331 -0
- package/dist/env/mcp/index.js +5 -5
- package/dist/env/mcp/tool/index.d.ts +183 -0
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/built-in/index.d.ts +232 -0
- package/dist/env/memory/index.d.ts +1799 -0
- package/dist/env/memory/index.js +5 -5
- package/dist/env/memory/plugin/index.d.ts +747 -0
- package/dist/env/memory/plugin/index.js +4 -4
- package/dist/env/prompt/index.d.ts +1164 -0
- package/dist/env/prompt/index.js +4 -4
- package/dist/env/session/index.d.ts +1908 -0
- package/dist/env/session/index.js +8 -8
- package/dist/env/session/storage/index.d.ts +564 -0
- package/dist/env/session/storage/index.js +6 -6
- package/dist/env/skill/index.d.ts +1266 -0
- package/dist/env/skill/index.js +4 -4
- package/dist/env/skill/tool/index.d.ts +193 -0
- package/dist/env/task/delegate/index.d.ts +1622 -0
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/hooks/index.d.ts +607 -0
- package/dist/env/task/index.d.ts +1415 -0
- package/dist/env/task/index.js +6 -6
- package/dist/env/task/plugins/index.d.ts +462 -0
- package/dist/env/task/plugins/index.js +4 -4
- package/dist/env/task/storage/index.d.ts +224 -0
- package/dist/env/task/storage/index.js +4 -4
- package/dist/env/task/tools/index.d.ts +1464 -0
- package/dist/env/task/tools/operation/index.d.ts +1463 -0
- package/dist/env/tool/built-in/index.d.ts +218 -0
- package/dist/env/tool/built-in/index.js +3 -3
- package/dist/env/tool/index.d.ts +1396 -0
- package/dist/env/tool/index.js +5 -5
- package/dist/env/workflow/decorators/index.d.ts +2161 -0
- package/dist/env/workflow/engine/index.d.ts +3453 -0
- package/dist/env/workflow/engine/index.js +8 -8
- package/dist/env/workflow/index.d.ts +3546 -0
- package/dist/env/workflow/index.js +13 -9
- package/dist/env/workflow/nodes/index.d.ts +2092 -0
- package/dist/env/workflow/nodes/index.js +1 -1
- package/dist/env/workflow/service/index.d.ts +227 -0
- package/dist/env/workflow/storage/index.d.ts +165 -0
- package/dist/env/workflow/storage/index.js +5 -5
- package/dist/env/workflow/tools/index.d.ts +416 -0
- package/dist/env/workflow/tools/index.js +3 -3
- package/dist/env/workflow/types/index.d.ts +2255 -0
- package/dist/env/workflow/types/index.js +5 -1
- package/dist/env/workflow/utils/index.d.ts +2031 -0
- package/dist/env/workflow/utils/index.js +4 -4
- package/dist/index.d.ts +7837 -0
- package/dist/index.js +31 -31
- package/dist/shared/@ai-setting/{roy-agent-core-6a72jfdy.js → roy-agent-core-1akcqxj9.js} +50 -4
- package/dist/shared/@ai-setting/{roy-agent-core-12zkpda2.js → roy-agent-core-3jywqmdd.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7n436rb4.js → roy-agent-core-3rr5k71j.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zfbxb999.js → roy-agent-core-3xwneva0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j3wc4465.js → roy-agent-core-44hnfb02.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-cv890rg5.js → roy-agent-core-4txzpsbt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rzp9kxne.js → roy-agent-core-5x94xmt6.js} +14 -5
- package/dist/shared/@ai-setting/{roy-agent-core-pc9g3962.js → roy-agent-core-69jskqjg.js} +41 -66
- package/dist/shared/@ai-setting/{roy-agent-core-qya7seh6.js → roy-agent-core-6kvtahqv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kv5nkf8j.js → roy-agent-core-81w1963m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-zqjdy75r.js → roy-agent-core-93zfb3r1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fsvb6bwe.js → roy-agent-core-b0x5dda6.js} +5 -5
- package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +14 -0
- package/dist/shared/@ai-setting/{roy-agent-core-2x0m2p66.js → roy-agent-core-d7cyjkf7.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-r973kbm7.js → roy-agent-core-dc497hmk.js} +9 -8
- package/dist/shared/@ai-setting/{roy-agent-core-z2t8hse8.js → roy-agent-core-dh9d7a3m.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j3bbr2n0.js → roy-agent-core-eajcvp4e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-m61m1vqf.js → roy-agent-core-f7q2x5z6.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8a96qnjv.js → roy-agent-core-g99pxzn5.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-5v9bh6wz.js → roy-agent-core-gbqcyegm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qw0ebh1d.js → roy-agent-core-gq20wsgv.js} +49 -17
- package/dist/shared/@ai-setting/{roy-agent-core-2kg2wma8.js → roy-agent-core-htwpckw9.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-e62e2a5a.js → roy-agent-core-jfh9q2qh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3agad0d9.js → roy-agent-core-jvatggbb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j8q93v21.js → roy-agent-core-n2cvdgd6.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-nga1gqft.js → roy-agent-core-pjr12nnd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-bncgx3gb.js → roy-agent-core-psv4v63c.js} +24 -2
- package/dist/shared/@ai-setting/{roy-agent-core-p4xv133t.js → roy-agent-core-qqceba6k.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e5jcp24a.js → roy-agent-core-r9ezzemr.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ewrj1c4k.js → roy-agent-core-satmq6sh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7f303ffd.js → roy-agent-core-sx7wsvnn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-q779wnwm.js → roy-agent-core-wft9ra24.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fdb6m4e4.js → roy-agent-core-wrcy0h6z.js} +134 -182
- package/dist/shared/@ai-setting/{roy-agent-core-8y8tw6ns.js → roy-agent-core-xq8hhqb8.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fv32jaa8.js → roy-agent-core-xs5rsgat.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t2nc5acr.js → roy-agent-core-z62zee1e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-72zpazpc.js → roy-agent-core-zbkpc41z.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-35x0wrtt.js → roy-agent-core-zgypchmt.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-37e4tep3.js → roy-agent-core-zpn0bqa8.js} +24 -3
- package/package.json +5 -2
- package/dist/shared/@ai-setting/roy-agent-core-rft3fmp0.js +0 -14
package/dist/env/skill/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getSourcePriority,
|
|
7
7
|
parseFrontmatter,
|
|
8
8
|
parseSkillFile
|
|
9
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
9
|
+
} from "../../shared/@ai-setting/roy-agent-core-zbkpc41z.js";
|
|
10
10
|
import {
|
|
11
11
|
SkillToolSchema,
|
|
12
12
|
buildSkillDescription,
|
|
@@ -16,9 +16,9 @@ import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
|
16
16
|
import"../../shared/@ai-setting/roy-agent-core-kkbwepqb.js";
|
|
17
17
|
import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
|
|
18
18
|
import"../../shared/@ai-setting/roy-agent-core-gjq1yk68.js";
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
20
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-44hnfb02.js";
|
|
20
|
+
import"../../shared/@ai-setting/roy-agent-core-xs5rsgat.js";
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-psv4v63c.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
23
23
|
export {
|
|
24
24
|
parseSkillFile,
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { z, ZodType, ZodError } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* 沙箱配置
|
|
4
|
+
*/
|
|
5
|
+
interface SandboxConfig {
|
|
6
|
+
/** 是否启用沙箱 */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/** 沙箱类型 */
|
|
9
|
+
type: "native" | "docker";
|
|
10
|
+
/** 动作过滤 */
|
|
11
|
+
actionFilter?: {
|
|
12
|
+
/** 包含的动作 */
|
|
13
|
+
include?: string[];
|
|
14
|
+
/** 排除的动作 */
|
|
15
|
+
exclude?: string[];
|
|
16
|
+
};
|
|
17
|
+
/** 文件系统限制 */
|
|
18
|
+
filesystem?: {
|
|
19
|
+
/** 允许读取 */
|
|
20
|
+
allowRead?: string[];
|
|
21
|
+
/** 禁止读取 */
|
|
22
|
+
denyRead?: string[];
|
|
23
|
+
/** 允许写入 */
|
|
24
|
+
allowWrite?: string[];
|
|
25
|
+
/** 禁止写入 */
|
|
26
|
+
denyWrite?: string[];
|
|
27
|
+
};
|
|
28
|
+
/** 网络限制 */
|
|
29
|
+
network?: {
|
|
30
|
+
/** 允许的域名 */
|
|
31
|
+
allowedDomains?: string[];
|
|
32
|
+
/** 禁止的域名 */
|
|
33
|
+
deniedDomains?: string[];
|
|
34
|
+
};
|
|
35
|
+
/** Docker 配置 */
|
|
36
|
+
docker?: {
|
|
37
|
+
/** 镜像 */
|
|
38
|
+
image?: string;
|
|
39
|
+
/** 网络模式 */
|
|
40
|
+
networkMode?: "bridge" | "host" | "none";
|
|
41
|
+
/** 卷挂载 */
|
|
42
|
+
volumes?: Record<string, string>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 工具执行上下文
|
|
47
|
+
*/
|
|
48
|
+
interface ToolContext {
|
|
49
|
+
/** 工作目录 */
|
|
50
|
+
workdir?: string;
|
|
51
|
+
/** 用户 ID */
|
|
52
|
+
user_id?: string;
|
|
53
|
+
/** 会话 ID */
|
|
54
|
+
session_id?: string;
|
|
55
|
+
/** 消息 ID */
|
|
56
|
+
message_id?: string;
|
|
57
|
+
/** 中断信号 */
|
|
58
|
+
abort?: AbortSignal;
|
|
59
|
+
/** 额外元数据 */
|
|
60
|
+
metadata?: Record<string, unknown>;
|
|
61
|
+
/** 沙箱配置 */
|
|
62
|
+
sandbox?: SandboxConfig;
|
|
63
|
+
/** 沙箱 Provider */
|
|
64
|
+
sandboxProvider?: unknown | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 工具结果元数据
|
|
68
|
+
*/
|
|
69
|
+
interface ToolResultMetadata {
|
|
70
|
+
/** 执行时间(毫秒) */
|
|
71
|
+
execution_time_ms: number;
|
|
72
|
+
/** 输出大小(字节) */
|
|
73
|
+
output_size?: number;
|
|
74
|
+
/** 标准输出 */
|
|
75
|
+
stdout?: string;
|
|
76
|
+
/** 标准错误 */
|
|
77
|
+
stderr?: string;
|
|
78
|
+
/** 退出码 */
|
|
79
|
+
exit_code?: number;
|
|
80
|
+
/** Token 使用量 */
|
|
81
|
+
usage?: {
|
|
82
|
+
inputTokens: number;
|
|
83
|
+
outputTokens: number;
|
|
84
|
+
totalTokens?: number;
|
|
85
|
+
};
|
|
86
|
+
/** 额外元数据 */
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 工具执行结果
|
|
91
|
+
*/
|
|
92
|
+
interface ToolResult {
|
|
93
|
+
/** 是否成功 */
|
|
94
|
+
success: boolean;
|
|
95
|
+
/** 输出内容 */
|
|
96
|
+
output: string | Record<string, unknown>;
|
|
97
|
+
/** 错误信息 */
|
|
98
|
+
error?: string;
|
|
99
|
+
/** 结果元数据 */
|
|
100
|
+
metadata?: ToolResultMetadata;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 工具元数据
|
|
104
|
+
*/
|
|
105
|
+
interface ToolMetadata {
|
|
106
|
+
/** 分类 */
|
|
107
|
+
category?: string;
|
|
108
|
+
/** 标签 */
|
|
109
|
+
tags?: string[];
|
|
110
|
+
/** 版本 */
|
|
111
|
+
version?: string;
|
|
112
|
+
/** 作者 */
|
|
113
|
+
author?: string;
|
|
114
|
+
/** 是否实验性 */
|
|
115
|
+
experimental?: boolean;
|
|
116
|
+
/** MCP 工具信息(MCP adapter 使用) */
|
|
117
|
+
mcpTool?: {
|
|
118
|
+
originalName: string;
|
|
119
|
+
originalDescription: string;
|
|
120
|
+
inputSchema?: unknown;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 工具沙箱配置
|
|
125
|
+
*/
|
|
126
|
+
interface ToolSandboxConfig {
|
|
127
|
+
/** 是否启用沙箱 */
|
|
128
|
+
enabled: boolean;
|
|
129
|
+
/** 沙箱配置 */
|
|
130
|
+
config?: Partial<SandboxConfig>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 工具权限配置
|
|
134
|
+
*/
|
|
135
|
+
interface ToolPermissionConfig {
|
|
136
|
+
/** 是否需要用户确认 */
|
|
137
|
+
requireConfirmation?: boolean;
|
|
138
|
+
/** 权限级别 */
|
|
139
|
+
level?: "safe" | "dangerous" | "critical";
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 工具信息
|
|
143
|
+
*/
|
|
144
|
+
interface ToolInfo<Parameters extends ZodType = ZodType> {
|
|
145
|
+
/** 工具名称 */
|
|
146
|
+
name: string;
|
|
147
|
+
/** 工具描述 */
|
|
148
|
+
description: string;
|
|
149
|
+
/** 参数 Schema */
|
|
150
|
+
parameters: Parameters;
|
|
151
|
+
/** 初始化函数(可选) */
|
|
152
|
+
init?: (ctx?: ToolContext) => Promise<void>;
|
|
153
|
+
/** 执行函数 */
|
|
154
|
+
execute: (args: z.infer<Parameters>, ctx: ToolContext) => Promise<ToolResult>;
|
|
155
|
+
/** 参数验证错误格式化(可选) */
|
|
156
|
+
formatValidationError?: (error: ZodError) => string;
|
|
157
|
+
/** 沙箱配置 */
|
|
158
|
+
sandbox?: ToolSandboxConfig;
|
|
159
|
+
/** 权限配置 */
|
|
160
|
+
permission?: ToolPermissionConfig;
|
|
161
|
+
/** 工具元数据 */
|
|
162
|
+
metadata?: ToolMetadata;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* 工具类型别名
|
|
166
|
+
*/
|
|
167
|
+
type Tool = ToolInfo;
|
|
168
|
+
/**
|
|
169
|
+
* Skill 来源类型
|
|
170
|
+
*/
|
|
171
|
+
type SkillSource = "built-in" | "user" | "project";
|
|
172
|
+
/**
|
|
173
|
+
* Skill 列表项(用于 list 和 description)
|
|
174
|
+
*/
|
|
175
|
+
interface SkillListItem {
|
|
176
|
+
name: string;
|
|
177
|
+
description: string;
|
|
178
|
+
source: SkillSource;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 构建 SkillTool 的 description
|
|
182
|
+
*/
|
|
183
|
+
declare function buildSkillDescription(items: SkillListItem[]): string;
|
|
184
|
+
/**
|
|
185
|
+
* 创建 SkillTool
|
|
186
|
+
*
|
|
187
|
+
* @param getSkillList - 获取 skill 列表的回调
|
|
188
|
+
* @param getSkill - 获取单个 skill 的回调
|
|
189
|
+
*/
|
|
190
|
+
declare function createSkillTool(getSkillList: () => SkillListItem[], getSkill: (name: string) => {
|
|
191
|
+
content: string;
|
|
192
|
+
} | undefined): Tool;
|
|
193
|
+
export { createSkillTool, buildSkillDescription };
|