@ai-setting/roy-agent-core 1.5.13-test → 1.5.15-test

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/package.json +1 -1
  2. package/dist/config/index.d.ts +0 -1250
  3. package/dist/config/index.js +0 -32
  4. package/dist/env/agent/index.d.ts +0 -2279
  5. package/dist/env/agent/index.js +0 -24
  6. package/dist/env/commands/index.d.ts +0 -1131
  7. package/dist/env/commands/index.js +0 -14
  8. package/dist/env/debug/formatters/index.d.ts +0 -236
  9. package/dist/env/debug/formatters/index.js +0 -11
  10. package/dist/env/debug/index.d.ts +0 -1652
  11. package/dist/env/debug/index.js +0 -26
  12. package/dist/env/hook/index.d.ts +0 -279
  13. package/dist/env/hook/index.js +0 -29
  14. package/dist/env/index.d.ts +0 -3481
  15. package/dist/env/index.js +0 -82
  16. package/dist/env/llm/index.d.ts +0 -1760
  17. package/dist/env/llm/index.js +0 -40
  18. package/dist/env/log-trace/index.d.ts +0 -1574
  19. package/dist/env/log-trace/index.js +0 -83
  20. package/dist/env/mcp/index.d.ts +0 -1331
  21. package/dist/env/mcp/index.js +0 -39
  22. package/dist/env/mcp/tool/index.d.ts +0 -183
  23. package/dist/env/mcp/tool/index.js +0 -14
  24. package/dist/env/memory/built-in/index.d.ts +0 -232
  25. package/dist/env/memory/built-in/index.js +0 -11
  26. package/dist/env/memory/index.d.ts +0 -1799
  27. package/dist/env/memory/index.js +0 -56
  28. package/dist/env/memory/plugin/index.d.ts +0 -747
  29. package/dist/env/memory/plugin/index.js +0 -36
  30. package/dist/env/prompt/index.d.ts +0 -1164
  31. package/dist/env/prompt/index.js +0 -20
  32. package/dist/env/session/index.d.ts +0 -1908
  33. package/dist/env/session/index.js +0 -25
  34. package/dist/env/session/storage/index.d.ts +0 -564
  35. package/dist/env/session/storage/index.js +0 -18
  36. package/dist/env/skill/index.d.ts +0 -1266
  37. package/dist/env/skill/index.js +0 -34
  38. package/dist/env/skill/tool/index.d.ts +0 -193
  39. package/dist/env/skill/tool/index.js +0 -9
  40. package/dist/env/task/delegate/index.d.ts +0 -1612
  41. package/dist/env/task/delegate/index.js +0 -18
  42. package/dist/env/task/events/index.d.ts +0 -171
  43. package/dist/env/task/events/index.js +0 -7
  44. package/dist/env/task/hooks/index.d.ts +0 -624
  45. package/dist/env/task/hooks/index.js +0 -7
  46. package/dist/env/task/index.d.ts +0 -1553
  47. package/dist/env/task/index.js +0 -34
  48. package/dist/env/task/plugins/index.d.ts +0 -466
  49. package/dist/env/task/plugins/index.js +0 -23
  50. package/dist/env/task/storage/index.d.ts +0 -241
  51. package/dist/env/task/storage/index.js +0 -14
  52. package/dist/env/task/tools/index.d.ts +0 -1485
  53. package/dist/env/task/tools/index.js +0 -17
  54. package/dist/env/task/tools/operation/index.d.ts +0 -1484
  55. package/dist/env/task/tools/operation/index.js +0 -15
  56. package/dist/env/tool/built-in/index.d.ts +0 -218
  57. package/dist/env/tool/built-in/index.js +0 -25
  58. package/dist/env/tool/index.d.ts +0 -1396
  59. package/dist/env/tool/index.js +0 -39
  60. package/dist/env/workflow/decorators/index.d.ts +0 -2161
  61. package/dist/env/workflow/decorators/index.js +0 -27
  62. package/dist/env/workflow/engine/index.d.ts +0 -3453
  63. package/dist/env/workflow/engine/index.js +0 -28
  64. package/dist/env/workflow/index.d.ts +0 -3546
  65. package/dist/env/workflow/index.js +0 -136
  66. package/dist/env/workflow/nodes/index.d.ts +0 -2092
  67. package/dist/env/workflow/nodes/index.js +0 -19
  68. package/dist/env/workflow/service/index.d.ts +0 -227
  69. package/dist/env/workflow/service/index.js +0 -13
  70. package/dist/env/workflow/storage/index.d.ts +0 -165
  71. package/dist/env/workflow/storage/index.js +0 -27
  72. package/dist/env/workflow/tools/index.d.ts +0 -416
  73. package/dist/env/workflow/tools/index.js +0 -159
  74. package/dist/env/workflow/types/index.d.ts +0 -2255
  75. package/dist/env/workflow/types/index.js +0 -98
  76. package/dist/env/workflow/utils/index.d.ts +0 -2031
  77. package/dist/env/workflow/utils/index.js +0 -637
  78. package/dist/index.d.ts +0 -7858
  79. package/dist/index.js +0 -399
  80. package/dist/shared/@ai-setting/roy-agent-core-0rtxwr28.js +0 -258
  81. package/dist/shared/@ai-setting/roy-agent-core-0vbdz0x7.js +0 -36
  82. package/dist/shared/@ai-setting/roy-agent-core-1akcqxj9.js +0 -349
  83. package/dist/shared/@ai-setting/roy-agent-core-1ce3fqrk.js +0 -117
  84. package/dist/shared/@ai-setting/roy-agent-core-2dhd60aw.js +0 -11
  85. package/dist/shared/@ai-setting/roy-agent-core-3jywqmdd.js +0 -393
  86. package/dist/shared/@ai-setting/roy-agent-core-3rr5k71j.js +0 -200
  87. package/dist/shared/@ai-setting/roy-agent-core-44hnfb02.js +0 -299
  88. package/dist/shared/@ai-setting/roy-agent-core-4t40mkpv.js +0 -206
  89. package/dist/shared/@ai-setting/roy-agent-core-4txzpsbt.js +0 -393
  90. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
  91. package/dist/shared/@ai-setting/roy-agent-core-69jskqjg.js +0 -180
  92. package/dist/shared/@ai-setting/roy-agent-core-6kvtahqv.js +0 -408
  93. package/dist/shared/@ai-setting/roy-agent-core-7fgf85wc.js +0 -284
  94. package/dist/shared/@ai-setting/roy-agent-core-81w1963m.js +0 -762
  95. package/dist/shared/@ai-setting/roy-agent-core-8gxth0eh.js +0 -10
  96. package/dist/shared/@ai-setting/roy-agent-core-92z6t4he.js +0 -14
  97. package/dist/shared/@ai-setting/roy-agent-core-93zfb3r1.js +0 -922
  98. package/dist/shared/@ai-setting/roy-agent-core-9yxb3ty9.js +0 -15
  99. package/dist/shared/@ai-setting/roy-agent-core-b0x5dda6.js +0 -1130
  100. package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +0 -14
  101. package/dist/shared/@ai-setting/roy-agent-core-bvr1761x.js +0 -653
  102. package/dist/shared/@ai-setting/roy-agent-core-ctdhjv68.js +0 -93
  103. package/dist/shared/@ai-setting/roy-agent-core-d7cyjkf7.js +0 -872
  104. package/dist/shared/@ai-setting/roy-agent-core-dh9d7a3m.js +0 -11
  105. package/dist/shared/@ai-setting/roy-agent-core-e25xkv53.js +0 -64
  106. package/dist/shared/@ai-setting/roy-agent-core-eajcvp4e.js +0 -378
  107. package/dist/shared/@ai-setting/roy-agent-core-f7q2x5z6.js +0 -492
  108. package/dist/shared/@ai-setting/roy-agent-core-fs0mn2jk.js +0 -52
  109. package/dist/shared/@ai-setting/roy-agent-core-g1s2h0e5.js +0 -171
  110. package/dist/shared/@ai-setting/roy-agent-core-g99pxzn5.js +0 -862
  111. package/dist/shared/@ai-setting/roy-agent-core-gbqcyegm.js +0 -1387
  112. package/dist/shared/@ai-setting/roy-agent-core-gjq1yk68.js +0 -208
  113. package/dist/shared/@ai-setting/roy-agent-core-gq20wsgv.js +0 -139
  114. package/dist/shared/@ai-setting/roy-agent-core-gwc4h96n.js +0 -534
  115. package/dist/shared/@ai-setting/roy-agent-core-jfh9q2qh.js +0 -204
  116. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
  117. package/dist/shared/@ai-setting/roy-agent-core-kkbwepqb.js +0 -97
  118. package/dist/shared/@ai-setting/roy-agent-core-pjr12nnd.js +0 -587
  119. package/dist/shared/@ai-setting/roy-agent-core-psv4v63c.js +0 -176
  120. package/dist/shared/@ai-setting/roy-agent-core-psvxt4c9.js +0 -60
  121. package/dist/shared/@ai-setting/roy-agent-core-qqceba6k.js +0 -442
  122. package/dist/shared/@ai-setting/roy-agent-core-qxhq8ven.js +0 -57
  123. package/dist/shared/@ai-setting/roy-agent-core-qxnbvgwe.js +0 -66
  124. package/dist/shared/@ai-setting/roy-agent-core-r9ezzemr.js +0 -10
  125. package/dist/shared/@ai-setting/roy-agent-core-rhmtwnw1.js +0 -267
  126. package/dist/shared/@ai-setting/roy-agent-core-rvv6ydff.js +0 -584
  127. package/dist/shared/@ai-setting/roy-agent-core-rvxg1wps.js +0 -102
  128. package/dist/shared/@ai-setting/roy-agent-core-satmq6sh.js +0 -549
  129. package/dist/shared/@ai-setting/roy-agent-core-sx7wsvnn.js +0 -15
  130. package/dist/shared/@ai-setting/roy-agent-core-t94ktchq.js +0 -213
  131. package/dist/shared/@ai-setting/roy-agent-core-vf215qfv.js +0 -812
  132. package/dist/shared/@ai-setting/roy-agent-core-vkz81f7v.js +0 -1316
  133. package/dist/shared/@ai-setting/roy-agent-core-vn2bc59q.js +0 -1205
  134. package/dist/shared/@ai-setting/roy-agent-core-wa1kzqky.js +0 -328
  135. package/dist/shared/@ai-setting/roy-agent-core-wft9ra24.js +0 -20
  136. package/dist/shared/@ai-setting/roy-agent-core-wrcy0h6z.js +0 -2098
  137. package/dist/shared/@ai-setting/roy-agent-core-xq8hhqb8.js +0 -419
  138. package/dist/shared/@ai-setting/roy-agent-core-xs5rsgat.js +0 -368
  139. package/dist/shared/@ai-setting/roy-agent-core-zbkpc41z.js +0 -377
  140. package/dist/shared/@ai-setting/roy-agent-core-zgypchmt.js +0 -172
  141. package/dist/shared/@ai-setting/roy-agent-core-zpn0bqa8.js +0 -103
@@ -1,26 +0,0 @@
1
- import {
2
- DebugComponent,
3
- LogReader,
4
- RegexParser,
5
- SpanBuilder,
6
- SpanDbReader
7
- } from "../../shared/@ai-setting/roy-agent-core-g99pxzn5.js";
8
- import {
9
- ReplFormatter,
10
- TraceFormatter,
11
- TreeFormatter
12
- } from "../../shared/@ai-setting/roy-agent-core-rvv6ydff.js";
13
- import"../../shared/@ai-setting/roy-agent-core-kkbwepqb.js";
14
- import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
15
- import"../../shared/@ai-setting/roy-agent-core-gjq1yk68.js";
16
- import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
17
- export {
18
- TreeFormatter,
19
- TraceFormatter,
20
- SpanDbReader,
21
- SpanBuilder,
22
- ReplFormatter,
23
- RegexParser,
24
- LogReader,
25
- DebugComponent
26
- };
@@ -1,279 +0,0 @@
1
- /**
2
- * @fileoverview Hook 系统统一类型定义
3
- *
4
- * 提供所有 Component 使用的统一 Hook 接口
5
- */
6
- /**
7
- * Hook 执行阶段
8
- */
9
- type HookPhase = "before" | "after" | "error";
10
- /**
11
- * Hook 元信息
12
- */
13
- interface HookMeta {
14
- /** Hook 唯一名称 */
15
- name: string;
16
- /** 执行优先级,默认 0,数值越小越先执行 */
17
- priority?: number;
18
- /** 描述 */
19
- description?: string;
20
- }
21
- /**
22
- * 统一 Hook 上下文
23
- *
24
- * 泛型参数 T 表示该 Component 的上下文数据类型
25
- */
26
- interface HookContext<T = unknown> {
27
- /** 当前组件信息 */
28
- component: {
29
- /** 组件名称 */
30
- name: string;
31
- /** 组件版本 */
32
- version: string;
33
- };
34
- /** 上下文数据(Component 特定) */
35
- data: T;
36
- /** 元数据(可用于传递额外信息) */
37
- metadata: Record<string, unknown>;
38
- /** 执行阶段 */
39
- phase: HookPhase;
40
- /** 关联的 hook 点名称 */
41
- hookPoint: string;
42
- }
43
- /**
44
- * 统一 Hook 接口
45
- *
46
- * 所有 Component 的 Hook 都应实现此接口
47
- */
48
- interface Hook<T = unknown> extends HookMeta {
49
- /** 执行 Hook
50
- * @param ctx 上下文
51
- */
52
- execute(ctx: HookContext<T>): void | Promise<void>;
53
- }
54
- /**
55
- * Hook 函数类型(便捷别名)
56
- */
57
- type HookFn<T = unknown> = (ctx: HookContext<T>) => void | Promise<void>;
58
- /**
59
- * Hook 干预动作类型
60
- */
61
- type HookActionType = "stop" | "retry" | "compress" | "extract_memory" | "inject_message" | "skip_tool" | "custom";
62
- /**
63
- * Hook 干预动作
64
- */
65
- interface HookAction {
66
- /** 动作类型 */
67
- type: HookActionType;
68
- /** 动作参数 */
69
- params?: Record<string, unknown>;
70
- /** 动作描述 */
71
- description?: string;
72
- }
73
- /**
74
- * Hook 执行结果
75
- */
76
- interface HookResult {
77
- /** 是否被停止 */
78
- stopped?: boolean;
79
- /** 干预动作(如果有) */
80
- action?: HookAction;
81
- /** 执行结果数据 */
82
- results?: unknown[];
83
- }
84
- /**
85
- * 创建 Hook 的工厂函数
86
- *
87
- * @param meta Hook 元信息
88
- * @param fn 执行函数
89
- * @returns Hook 实例
90
- *
91
- * @example
92
- * ```typescript
93
- * const hook = createHook(
94
- * { name: "my-hook", priority: 10 },
95
- * async (ctx) => { console.log(ctx.data); }
96
- * );
97
- * ```
98
- */
99
- declare function createHook<T = unknown>(meta: HookMeta, fn: HookFn<T>): Hook<T>;
100
- /**
101
- * 创建带优先级的 Hook 的便捷函数
102
- */
103
- declare function createPriorityHook<T = unknown>(name: string, fn: HookFn<T>, priority: number): Hook<T>;
104
- /**
105
- * HookManager 配置
106
- */
107
- interface HookManagerOptions {
108
- /** 组件名称(用于上下文) */
109
- componentName?: string;
110
- /** 组件版本(用于上下文) */
111
- componentVersion?: string;
112
- /** 默认优先级 */
113
- defaultPriority?: number;
114
- }
115
- /**
116
- * HookManager
117
- *
118
- * 统一管理 Component 的 Hook
119
- *
120
- * @example
121
- * ```typescript
122
- * const manager = new HookManager<MyContext>();
123
- *
124
- * // 注册 Hook
125
- * manager.register("before-action", {
126
- * name: "my-hook",
127
- * priority: 10,
128
- * execute: async (ctx) => { /* ... *\/ }
129
- * });
130
- *
131
- * // 执行 Hooks
132
- * await manager.execute("before-action", data);
133
- * ```
134
- */
135
- declare class HookManager<T = unknown> {
136
- private _hooks;
137
- private componentName;
138
- private componentVersion;
139
- private defaultPriority;
140
- constructor(options?: HookManagerOptions);
141
- /**
142
- * 注册 Hook 到指定 hook 点
143
- */
144
- register(hookPoint: string, hook: Hook<T>): void;
145
- /**
146
- * 注册多个 Hook
147
- */
148
- registerMany(hookPoint: string, hooks: Hook<T>[]): void;
149
- /**
150
- * 按名称取消注册 Hook
151
- * @returns 是否成功取消注册
152
- */
153
- unregister(hookPoint: string, name: string): boolean;
154
- /**
155
- * 取消注册所有指定 hook 点的 Hook
156
- */
157
- unregisterAll(hookPoint: string): void;
158
- /**
159
- * 执行指定 hook 点的所有 Hook
160
- */
161
- execute(hookPoint: string, data: T, metadata?: Record<string, unknown>): Promise<void>;
162
- /**
163
- * 执行指定 hook 点的所有 Hook 并收集返回值
164
- */
165
- executeAndCollect<R>(hookPoint: string, data: T, metadata?: Record<string, unknown>): Promise<R[]>;
166
- /**
167
- * 获取指定 hook 点的 Hook 数量
168
- */
169
- count(hookPoint: string): number;
170
- /**
171
- * 清空所有 Hook
172
- */
173
- clear(): void;
174
- /**
175
- * 获取所有已注册的 hook 点
176
- */
177
- getHookPoints(): string[];
178
- /**
179
- * 检查 hook 点是否有任何 Hook
180
- */
181
- hasHooks(hookPoint: string): boolean;
182
- /**
183
- * 设置组件信息
184
- */
185
- setComponentInfo(name: string, version: string): void;
186
- /**
187
- * 获取所有注册的 hooks(只读副本)
188
- */
189
- get hooks(): ReadonlyMap<string, Hook<T>[]>;
190
- /**
191
- * 执行 Hook 并支持干预机制
192
- *
193
- * 如果任何一个 Hook 返回 { stop: true },执行会停止
194
- * Hook 可以通过返回 HookResult 来执行干预动作
195
- *
196
- * @param hookPoint Hook 点
197
- * @param data 数据
198
- * @param metadata 元数据
199
- * @returns 执行结果
200
- */
201
- executeWithIntervention(hookPoint: string, data: T, metadata?: Record<string, unknown>): Promise<HookResult>;
202
- /**
203
- * 获取或创建 hook 列表
204
- */
205
- private getOrCreateHooks;
206
- /**
207
- * 按优先级排序 Hook
208
- *
209
- * 优先级相同时保持原顺序(稳定排序)
210
- */
211
- private sortHooks;
212
- /**
213
- * 创建 Hook 上下文
214
- */
215
- private createContext;
216
- /**
217
- * 安全执行 Hook(错误隔离)
218
- */
219
- private safeExecute;
220
- /**
221
- * 安全执行 Hook 并返回结果
222
- */
223
- private safeExecuteAndReturn;
224
- }
225
- /**
226
- * 全局 HookManager 实例
227
- *
228
- * 所有 Agent/LLM/Tool hooks 都注册到这个实例
229
- */
230
- declare const globalHookManager: unknown;
231
- /**
232
- * Agent Hook 点(新版统一命名)
233
- */
234
- declare const AgentHookPoints: {
235
- readonly BEFORE_START: "agent:before.start";
236
- readonly BEFORE_LLM: "agent:before.llm";
237
- readonly AFTER_LLM: "agent:after.llm";
238
- readonly BEFORE_TOOL: "agent:before.tool";
239
- readonly AFTER_TOOL: "agent:after.tool";
240
- readonly ON_ITERATION: "agent:on.iteration";
241
- readonly ON_THRESHOLD: "agent:on.threshold";
242
- readonly AFTER_COMPLETE: "agent:after.complete";
243
- readonly ON_ERROR: "agent:on.error";
244
- };
245
- /**
246
- * LLM Hook 点
247
- */
248
- declare const LLMHookPoints: {
249
- readonly BEFORE_INVOKE: "llm:before.invoke";
250
- readonly AFTER_INVOKE: "llm:after.invoke";
251
- readonly ON_STREAM: "llm:on.stream";
252
- };
253
- /**
254
- * Tool Hook 点
255
- */
256
- declare const ToolHookPoints: {
257
- readonly BEFORE_EXECUTE: "tool:before.execute";
258
- readonly AFTER_EXECUTE: "tool:after.execute";
259
- readonly BEFORE_REGISTER: "tool:before.register";
260
- readonly AFTER_REGISTER: "tool:after.register";
261
- readonly ON_ERROR: "tool:on.error";
262
- };
263
- /**
264
- * 执行 Agent Hook(不带干预)
265
- */
266
- declare function executeAgentHook(hookPoint: string, data: unknown, metadata?: Record<string, unknown>): Promise<void>;
267
- /**
268
- * 执行 Agent Hook(带干预检查)
269
- */
270
- declare function executeAgentHookWithIntervention(hookPoint: string, data: unknown, metadata?: Record<string, unknown>): Promise<HookResult>;
271
- /**
272
- * 执行 LLM Hook(不带干预)
273
- */
274
- declare function executeLLMHook(hookPoint: string, data: unknown, metadata?: Record<string, unknown>): Promise<void>;
275
- /**
276
- * 执行 Tool Hook(不带干预)
277
- */
278
- declare function executeToolHook(hookPoint: string, data: unknown, metadata?: Record<string, unknown>): Promise<void>;
279
- export { globalHookManager, executeToolHook, executeLLMHook, executeAgentHookWithIntervention, executeAgentHook, createPriorityHook, createHook, ToolHookPoints, LLMHookPoints, HookResult, HookPhase, HookMeta, HookManagerOptions, HookManager, HookFn, HookContext, HookActionType, HookAction, Hook, HookFn as BaseHookFn, HookContext as BaseHookContext, Hook as BaseHook, AgentHookPoints };
@@ -1,29 +0,0 @@
1
- import {
2
- createHook,
3
- createPriorityHook
4
- } from "../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
5
- import {
6
- AgentHookPoints,
7
- HookManager,
8
- LLMHookPoints,
9
- ToolHookPoints,
10
- executeAgentHook,
11
- executeAgentHookWithIntervention,
12
- executeLLMHook,
13
- executeToolHook,
14
- globalHookManager
15
- } from "../../shared/@ai-setting/roy-agent-core-gjq1yk68.js";
16
- import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
17
- export {
18
- globalHookManager,
19
- executeToolHook,
20
- executeLLMHook,
21
- executeAgentHookWithIntervention,
22
- executeAgentHook,
23
- createPriorityHook,
24
- createHook,
25
- ToolHookPoints,
26
- LLMHookPoints,
27
- HookManager,
28
- AgentHookPoints
29
- };