@ai-setting/roy-agent-core 1.5.15-test → 1.5.17-beta.1

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 (141) hide show
  1. package/dist/config/index.d.ts +1250 -0
  2. package/dist/config/index.js +32 -0
  3. package/dist/env/agent/index.d.ts +2279 -0
  4. package/dist/env/agent/index.js +24 -0
  5. package/dist/env/commands/index.d.ts +1131 -0
  6. package/dist/env/commands/index.js +14 -0
  7. package/dist/env/debug/formatters/index.d.ts +236 -0
  8. package/dist/env/debug/formatters/index.js +11 -0
  9. package/dist/env/debug/index.d.ts +1652 -0
  10. package/dist/env/debug/index.js +26 -0
  11. package/dist/env/hook/index.d.ts +279 -0
  12. package/dist/env/hook/index.js +29 -0
  13. package/dist/env/index.d.ts +3481 -0
  14. package/dist/env/index.js +82 -0
  15. package/dist/env/llm/index.d.ts +1760 -0
  16. package/dist/env/llm/index.js +40 -0
  17. package/dist/env/log-trace/index.d.ts +1574 -0
  18. package/dist/env/log-trace/index.js +83 -0
  19. package/dist/env/mcp/index.d.ts +1331 -0
  20. package/dist/env/mcp/index.js +39 -0
  21. package/dist/env/mcp/tool/index.d.ts +183 -0
  22. package/dist/env/mcp/tool/index.js +14 -0
  23. package/dist/env/memory/built-in/index.d.ts +232 -0
  24. package/dist/env/memory/built-in/index.js +11 -0
  25. package/dist/env/memory/index.d.ts +1799 -0
  26. package/dist/env/memory/index.js +56 -0
  27. package/dist/env/memory/plugin/index.d.ts +747 -0
  28. package/dist/env/memory/plugin/index.js +36 -0
  29. package/dist/env/prompt/index.d.ts +1164 -0
  30. package/dist/env/prompt/index.js +20 -0
  31. package/dist/env/session/index.d.ts +1908 -0
  32. package/dist/env/session/index.js +25 -0
  33. package/dist/env/session/storage/index.d.ts +564 -0
  34. package/dist/env/session/storage/index.js +18 -0
  35. package/dist/env/skill/index.d.ts +1266 -0
  36. package/dist/env/skill/index.js +34 -0
  37. package/dist/env/skill/tool/index.d.ts +193 -0
  38. package/dist/env/skill/tool/index.js +9 -0
  39. package/dist/env/task/delegate/index.d.ts +1612 -0
  40. package/dist/env/task/delegate/index.js +18 -0
  41. package/dist/env/task/events/index.d.ts +171 -0
  42. package/dist/env/task/events/index.js +7 -0
  43. package/dist/env/task/hooks/index.d.ts +624 -0
  44. package/dist/env/task/hooks/index.js +7 -0
  45. package/dist/env/task/index.d.ts +1553 -0
  46. package/dist/env/task/index.js +34 -0
  47. package/dist/env/task/plugins/index.d.ts +466 -0
  48. package/dist/env/task/plugins/index.js +23 -0
  49. package/dist/env/task/storage/index.d.ts +241 -0
  50. package/dist/env/task/storage/index.js +14 -0
  51. package/dist/env/task/tools/index.d.ts +1485 -0
  52. package/dist/env/task/tools/index.js +17 -0
  53. package/dist/env/task/tools/operation/index.d.ts +1484 -0
  54. package/dist/env/task/tools/operation/index.js +15 -0
  55. package/dist/env/tool/built-in/index.d.ts +218 -0
  56. package/dist/env/tool/built-in/index.js +25 -0
  57. package/dist/env/tool/index.d.ts +1396 -0
  58. package/dist/env/tool/index.js +39 -0
  59. package/dist/env/workflow/decorators/index.d.ts +2161 -0
  60. package/dist/env/workflow/decorators/index.js +27 -0
  61. package/dist/env/workflow/engine/index.d.ts +3453 -0
  62. package/dist/env/workflow/engine/index.js +28 -0
  63. package/dist/env/workflow/index.d.ts +3546 -0
  64. package/dist/env/workflow/index.js +136 -0
  65. package/dist/env/workflow/nodes/index.d.ts +2092 -0
  66. package/dist/env/workflow/nodes/index.js +19 -0
  67. package/dist/env/workflow/service/index.d.ts +227 -0
  68. package/dist/env/workflow/service/index.js +13 -0
  69. package/dist/env/workflow/storage/index.d.ts +165 -0
  70. package/dist/env/workflow/storage/index.js +27 -0
  71. package/dist/env/workflow/tools/index.d.ts +416 -0
  72. package/dist/env/workflow/tools/index.js +159 -0
  73. package/dist/env/workflow/types/index.d.ts +2255 -0
  74. package/dist/env/workflow/types/index.js +98 -0
  75. package/dist/env/workflow/utils/index.d.ts +2031 -0
  76. package/dist/env/workflow/utils/index.js +637 -0
  77. package/dist/index.d.ts +7858 -0
  78. package/dist/index.js +399 -0
  79. package/dist/shared/@ai-setting/roy-agent-core-0rtxwr28.js +258 -0
  80. package/dist/shared/@ai-setting/roy-agent-core-0vbdz0x7.js +36 -0
  81. package/dist/shared/@ai-setting/roy-agent-core-1akcqxj9.js +349 -0
  82. package/dist/shared/@ai-setting/roy-agent-core-1ce3fqrk.js +117 -0
  83. package/dist/shared/@ai-setting/roy-agent-core-2dhd60aw.js +11 -0
  84. package/dist/shared/@ai-setting/roy-agent-core-3jywqmdd.js +393 -0
  85. package/dist/shared/@ai-setting/roy-agent-core-3rr5k71j.js +200 -0
  86. package/dist/shared/@ai-setting/roy-agent-core-44hnfb02.js +299 -0
  87. package/dist/shared/@ai-setting/roy-agent-core-4t40mkpv.js +206 -0
  88. package/dist/shared/@ai-setting/roy-agent-core-4txzpsbt.js +393 -0
  89. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +350 -0
  90. package/dist/shared/@ai-setting/roy-agent-core-69jskqjg.js +180 -0
  91. package/dist/shared/@ai-setting/roy-agent-core-6kvtahqv.js +408 -0
  92. package/dist/shared/@ai-setting/roy-agent-core-7fgf85wc.js +284 -0
  93. package/dist/shared/@ai-setting/roy-agent-core-81w1963m.js +762 -0
  94. package/dist/shared/@ai-setting/roy-agent-core-8gxth0eh.js +10 -0
  95. package/dist/shared/@ai-setting/roy-agent-core-92z6t4he.js +14 -0
  96. package/dist/shared/@ai-setting/roy-agent-core-93zfb3r1.js +922 -0
  97. package/dist/shared/@ai-setting/roy-agent-core-9yxb3ty9.js +15 -0
  98. package/dist/shared/@ai-setting/roy-agent-core-b0x5dda6.js +1130 -0
  99. package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +14 -0
  100. package/dist/shared/@ai-setting/roy-agent-core-bvr1761x.js +653 -0
  101. package/dist/shared/@ai-setting/roy-agent-core-ctdhjv68.js +93 -0
  102. package/dist/shared/@ai-setting/roy-agent-core-d7cyjkf7.js +872 -0
  103. package/dist/shared/@ai-setting/roy-agent-core-dh9d7a3m.js +11 -0
  104. package/dist/shared/@ai-setting/roy-agent-core-e25xkv53.js +64 -0
  105. package/dist/shared/@ai-setting/roy-agent-core-eajcvp4e.js +378 -0
  106. package/dist/shared/@ai-setting/roy-agent-core-f7q2x5z6.js +492 -0
  107. package/dist/shared/@ai-setting/roy-agent-core-fs0mn2jk.js +52 -0
  108. package/dist/shared/@ai-setting/roy-agent-core-g1s2h0e5.js +171 -0
  109. package/dist/shared/@ai-setting/roy-agent-core-g99pxzn5.js +862 -0
  110. package/dist/shared/@ai-setting/roy-agent-core-gbqcyegm.js +1387 -0
  111. package/dist/shared/@ai-setting/roy-agent-core-gjq1yk68.js +208 -0
  112. package/dist/shared/@ai-setting/roy-agent-core-gq20wsgv.js +139 -0
  113. package/dist/shared/@ai-setting/roy-agent-core-gwc4h96n.js +534 -0
  114. package/dist/shared/@ai-setting/roy-agent-core-jfh9q2qh.js +204 -0
  115. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +603 -0
  116. package/dist/shared/@ai-setting/roy-agent-core-kkbwepqb.js +97 -0
  117. package/dist/shared/@ai-setting/roy-agent-core-pjr12nnd.js +587 -0
  118. package/dist/shared/@ai-setting/roy-agent-core-psv4v63c.js +176 -0
  119. package/dist/shared/@ai-setting/roy-agent-core-psvxt4c9.js +60 -0
  120. package/dist/shared/@ai-setting/roy-agent-core-qqceba6k.js +442 -0
  121. package/dist/shared/@ai-setting/roy-agent-core-qxhq8ven.js +57 -0
  122. package/dist/shared/@ai-setting/roy-agent-core-qxnbvgwe.js +66 -0
  123. package/dist/shared/@ai-setting/roy-agent-core-r9ezzemr.js +10 -0
  124. package/dist/shared/@ai-setting/roy-agent-core-rhmtwnw1.js +267 -0
  125. package/dist/shared/@ai-setting/roy-agent-core-rvv6ydff.js +584 -0
  126. package/dist/shared/@ai-setting/roy-agent-core-rvxg1wps.js +102 -0
  127. package/dist/shared/@ai-setting/roy-agent-core-satmq6sh.js +549 -0
  128. package/dist/shared/@ai-setting/roy-agent-core-sx7wsvnn.js +15 -0
  129. package/dist/shared/@ai-setting/roy-agent-core-t94ktchq.js +213 -0
  130. package/dist/shared/@ai-setting/roy-agent-core-vf215qfv.js +812 -0
  131. package/dist/shared/@ai-setting/roy-agent-core-vkz81f7v.js +1316 -0
  132. package/dist/shared/@ai-setting/roy-agent-core-vn2bc59q.js +1205 -0
  133. package/dist/shared/@ai-setting/roy-agent-core-wa1kzqky.js +328 -0
  134. package/dist/shared/@ai-setting/roy-agent-core-wft9ra24.js +20 -0
  135. package/dist/shared/@ai-setting/roy-agent-core-wrcy0h6z.js +2098 -0
  136. package/dist/shared/@ai-setting/roy-agent-core-xq8hhqb8.js +419 -0
  137. package/dist/shared/@ai-setting/roy-agent-core-xs5rsgat.js +368 -0
  138. package/dist/shared/@ai-setting/roy-agent-core-zbkpc41z.js +377 -0
  139. package/dist/shared/@ai-setting/roy-agent-core-zgypchmt.js +172 -0
  140. package/dist/shared/@ai-setting/roy-agent-core-zpn0bqa8.js +103 -0
  141. package/package.json +29 -8
@@ -0,0 +1,34 @@
1
+ import {
2
+ DEFAULT_SKILL_CONFIG,
3
+ SOURCE_PRIORITY,
4
+ SkillComponent,
5
+ SkillScanner,
6
+ getSourcePriority,
7
+ parseFrontmatter,
8
+ parseSkillFile
9
+ } from "../../shared/@ai-setting/roy-agent-core-zbkpc41z.js";
10
+ import {
11
+ SkillToolSchema,
12
+ buildSkillDescription,
13
+ createSkillTool
14
+ } from "../../shared/@ai-setting/roy-agent-core-psvxt4c9.js";
15
+ import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
16
+ import"../../shared/@ai-setting/roy-agent-core-kkbwepqb.js";
17
+ import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
18
+ import"../../shared/@ai-setting/roy-agent-core-gjq1yk68.js";
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
+ import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
23
+ export {
24
+ parseSkillFile,
25
+ parseFrontmatter,
26
+ getSourcePriority,
27
+ createSkillTool,
28
+ buildSkillDescription,
29
+ SkillToolSchema,
30
+ SkillScanner,
31
+ SkillComponent,
32
+ SOURCE_PRIORITY,
33
+ DEFAULT_SKILL_CONFIG
34
+ };
@@ -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 };
@@ -0,0 +1,9 @@
1
+ import {
2
+ buildSkillDescription,
3
+ createSkillTool
4
+ } from "../../../shared/@ai-setting/roy-agent-core-psvxt4c9.js";
5
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
6
+ export {
7
+ createSkillTool,
8
+ buildSkillDescription
9
+ };