@ai-setting/roy-agent-core 1.4.12 → 1.4.13

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 (57) hide show
  1. package/dist/index.d.ts +7825 -0
  2. package/dist/index.js +13073 -19300
  3. package/dist/shared/chunk-0q6s9wm6.js +249 -0
  4. package/dist/shared/chunk-1aakcfp1.js +15 -0
  5. package/dist/shared/chunk-1d4rwms4.js +25 -0
  6. package/dist/shared/chunk-1pf5mfgd.js +82 -0
  7. package/dist/shared/chunk-1qwabsm0.js +154 -0
  8. package/dist/shared/chunk-25x2pdtp.js +107 -0
  9. package/dist/shared/chunk-2b5kbhx3.js +366 -0
  10. package/dist/shared/chunk-91bas8w5.js +20 -0
  11. package/dist/shared/chunk-9qzt1v1p.js +10 -0
  12. package/dist/shared/chunk-a9qmy3sc.js +296 -0
  13. package/dist/shared/chunk-g6j5n3gv.js +549 -0
  14. package/dist/shared/chunk-hs7tbmje.js +24 -0
  15. package/dist/shared/chunk-mf5xqbdh.js +14 -0
  16. package/dist/shared/chunk-q9j99fsm.js +368 -0
  17. package/dist/{env/workflow/engine/index.js → shared/chunk-rncy3rtd.js} +330 -1581
  18. package/dist/shared/chunk-t1rh6jtm.js +205 -0
  19. package/dist/{env/task/hooks/index.js → shared/chunk-wbkh7wat.js} +3 -18
  20. package/dist/shared/chunk-yqmx37vm.js +10 -0
  21. package/dist/shared/chunk-ze20rksg.js +102 -0
  22. package/package.json +7 -7
  23. package/dist/config/index.js +0 -1670
  24. package/dist/env/agent/index.js +0 -3035
  25. package/dist/env/commands/index.js +0 -1685
  26. package/dist/env/debug/formatters/index.js +0 -639
  27. package/dist/env/debug/index.js +0 -2300
  28. package/dist/env/hook/index.js +0 -273
  29. package/dist/env/index.js +0 -12591
  30. package/dist/env/llm/index.js +0 -2736
  31. package/dist/env/log-trace/index.js +0 -1779
  32. package/dist/env/mcp/index.js +0 -2173
  33. package/dist/env/mcp/tool/index.js +0 -1149
  34. package/dist/env/memory/built-in/index.js +0 -225
  35. package/dist/env/memory/index.js +0 -2171
  36. package/dist/env/memory/plugin/index.js +0 -1263
  37. package/dist/env/prompt/index.js +0 -2107
  38. package/dist/env/session/index.js +0 -3594
  39. package/dist/env/session/storage/index.js +0 -2049
  40. package/dist/env/skill/index.js +0 -1635
  41. package/dist/env/skill/tool/index.js +0 -114
  42. package/dist/env/task/delegate/index.js +0 -1844
  43. package/dist/env/task/index.js +0 -3578
  44. package/dist/env/task/plugins/index.js +0 -1626
  45. package/dist/env/task/storage/index.js +0 -1464
  46. package/dist/env/task/tools/index.js +0 -344
  47. package/dist/env/task/tools/operation/index.js +0 -270
  48. package/dist/env/tool/built-in/index.js +0 -1151
  49. package/dist/env/tool/index.js +0 -2284
  50. package/dist/env/workflow/decorators/index.js +0 -449
  51. package/dist/env/workflow/index.js +0 -6214
  52. package/dist/env/workflow/nodes/index.js +0 -650
  53. package/dist/env/workflow/service/index.js +0 -262
  54. package/dist/env/workflow/storage/index.js +0 -1236
  55. package/dist/env/workflow/tools/index.js +0 -1081
  56. package/dist/env/workflow/types/index.js +0 -479
  57. package/dist/env/workflow/utils/index.js +0 -1631
@@ -1,225 +0,0 @@
1
- // @bun
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- function __accessProp(key) {
7
- return this[key];
8
- }
9
- var __toCommonJS = (from) => {
10
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
- if (entry)
12
- return entry;
13
- entry = __defProp({}, "__esModule", { value: true });
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (var key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(entry, key))
17
- __defProp(entry, key, {
18
- get: __accessProp.bind(from, key),
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- __moduleCache.set(from, entry);
23
- return entry;
24
- };
25
- var __moduleCache;
26
- var __returnValue = (v) => v;
27
- function __exportSetter(name, newValue) {
28
- this[name] = __returnValue.bind(null, newValue);
29
- }
30
- var __export = (target, all) => {
31
- for (var name in all)
32
- __defProp(target, name, {
33
- get: all[name],
34
- enumerable: true,
35
- configurable: true,
36
- set: __exportSetter.bind(all, name)
37
- });
38
- };
39
- var __legacyDecorateClassTS = function(decorators, target, key, desc) {
40
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
41
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
42
- r = Reflect.decorate(decorators, target, key, desc);
43
- else
44
- for (var i = decorators.length - 1;i >= 0; i--)
45
- if (d = decorators[i])
46
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
47
- return c > 3 && r && Object.defineProperty(target, key, r), r;
48
- };
49
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
50
- var __require = import.meta.require;
51
-
52
- // packages/core/src/env/memory/built-in/record-memory.ts
53
- import { z } from "zod";
54
- var RecordMemorySchema = z.object({
55
- scope: z.enum(["project", "global"]).describe("\u4F5C\u7528\u57DF: project/global"),
56
- mode: z.enum(["append", "prepend", "overwrite", "delete"]).describe("\u6A21\u5F0F: append(\u8FFD\u52A0)/prepend(\u63D2\u5165)/overwrite(\u8986\u76D6)/delete(\u5220\u9664)"),
57
- content: z.string().optional().describe("\u8BB0\u5FC6\u5185\u5BB9"),
58
- title: z.string().optional().describe("\u7AE0\u8282\u6807\u9898")
59
- });
60
- function createRecordMemoryTool(recordMemory, getMemoryPaths, getMemoryFile) {
61
- return {
62
- name: "record_memory",
63
- description: buildDescription(getMemoryPaths, getMemoryFile),
64
- parameters: RecordMemorySchema,
65
- execute: async (args, _ctx) => {
66
- const params = RecordMemorySchema.parse(args);
67
- const startTime = Date.now();
68
- try {
69
- const result = await recordMemory({
70
- scope: params.scope,
71
- mode: params.mode,
72
- content: params.content,
73
- title: params.title
74
- });
75
- if (!result) {
76
- return {
77
- success: false,
78
- output: "",
79
- error: "\u672A\u914D\u7F6E memory \u8DEF\u5F84\uFF0C\u65E0\u6CD5\u8BB0\u5F55\u8BB0\u5FC6",
80
- metadata: { execution_time_ms: Date.now() - startTime }
81
- };
82
- }
83
- const actionMessages = {
84
- created: "\u5DF2\u521B\u5EFA\u8BB0\u5FC6\u6587\u4EF6",
85
- overwrite: "\u5DF2\u8986\u76D6\u8BB0\u5FC6\u6587\u4EF6",
86
- append: "\u5DF2\u8FFD\u52A0\u5185\u5BB9\u5230\u8BB0\u5FC6\u6587\u4EF6",
87
- prepend: "\u5DF2\u63D2\u5165\u5185\u5BB9\u5230\u8BB0\u5FC6\u6587\u4EF6\u5F00\u5934",
88
- delete: "\u5DF2\u5220\u9664\u8BB0\u5FC6\u6587\u4EF6"
89
- };
90
- return {
91
- success: true,
92
- output: `${actionMessages[result.action]}: ${result.path}`,
93
- metadata: {
94
- execution_time_ms: Date.now() - startTime,
95
- path: result.path,
96
- action: result.action
97
- }
98
- };
99
- } catch (error) {
100
- return {
101
- success: false,
102
- output: "",
103
- error: error instanceof Error ? error.message : String(error),
104
- metadata: { execution_time_ms: Date.now() - startTime }
105
- };
106
- }
107
- }
108
- };
109
- }
110
- function buildDescription(getMemoryPaths, getMemoryFile) {
111
- const paths = getMemoryPaths();
112
- const memoryFile = getMemoryFile();
113
- const lines = [
114
- `# Record Memory Tool`,
115
- "",
116
- `Record memory to file. Writes to the memory.md file in the specified scope.`,
117
- "",
118
- `## Modes`,
119
- "",
120
- "| Mode | Description |",
121
- "|------|-------------|",
122
- "| **append** | \u8FFD\u52A0\u5185\u5BB9\u5230 ${memoryFile} \u5C3E\u90E8 |",
123
- "| **prepend** | \u63D2\u5165\u5185\u5BB9\u5230 ${memoryFile} \u5F00\u5934 |",
124
- "| **overwrite** | \u8986\u76D6 ${memoryFile} |",
125
- "| **delete** | \u5220\u9664 ${memoryFile} |",
126
- "",
127
- `## Parameters`,
128
- "",
129
- "- **scope** (required): \u4F5C\u7528\u57DF - project \u6216 global",
130
- "- **mode** (required): \u64CD\u4F5C\u6A21\u5F0F",
131
- "- **content** (optional): \u8BB0\u5FC6\u5185\u5BB9",
132
- "- **title** (optional): \u7AE0\u8282\u6807\u9898",
133
- "",
134
- `## Memory Paths`,
135
- ""
136
- ];
137
- if (paths.length === 0) {
138
- lines.push("No memory paths configured.");
139
- } else {
140
- lines.push("Files will be written to:");
141
- for (const p of paths) {
142
- lines.push(`- **[${p.type}]** ${p.path}/${memoryFile}`);
143
- }
144
- }
145
- return lines.join(`
146
- `);
147
- }
148
-
149
- // packages/core/src/env/memory/built-in/recall-memory.ts
150
- import { z as z2 } from "zod";
151
- var RecallMemorySchema = z2.object({
152
- scope: z2.enum(["project", "global"]).optional().describe("\u4F5C\u7528\u57DF\uFF08\u53EF\u9009\uFF0C\u4E0D\u4F20\u5219\u8BFB\u53D6\u6240\u6709\uFF09")
153
- });
154
- function createRecallMemoryTool(recallMemory, getMemoryPaths, getMemoryFile) {
155
- return {
156
- name: "recall_memory",
157
- description: buildDescription2(getMemoryPaths, getMemoryFile),
158
- parameters: RecallMemorySchema,
159
- execute: async (args, _ctx) => {
160
- const params = RecallMemorySchema.parse(args);
161
- const startTime = Date.now();
162
- try {
163
- const content = await recallMemory(params.scope);
164
- if (!content) {
165
- return {
166
- success: true,
167
- output: "(No memory files found)",
168
- metadata: { execution_time_ms: Date.now() - startTime }
169
- };
170
- }
171
- return {
172
- success: true,
173
- output: content,
174
- metadata: { execution_time_ms: Date.now() - startTime }
175
- };
176
- } catch (error) {
177
- return {
178
- success: false,
179
- output: "",
180
- error: error instanceof Error ? error.message : String(error),
181
- metadata: { execution_time_ms: Date.now() - startTime }
182
- };
183
- }
184
- }
185
- };
186
- }
187
- function buildDescription2(getMemoryPaths, getMemoryFile) {
188
- const paths = getMemoryPaths();
189
- const memoryFile = getMemoryFile();
190
- const lines = [
191
- `# Recall Memory Tool`,
192
- "",
193
- `Recall memory from memory files. Reads from the memory.md file in the specified scope.`,
194
- "",
195
- `## Parameters`,
196
- "",
197
- "- **scope** (optional): \u4F5C\u7528\u57DF - project \u6216 global\uFF08\u4E0D\u4F20\u5219\u8BFB\u53D6\u6240\u6709\uFF09",
198
- "",
199
- `## Memory Files`,
200
- ""
201
- ];
202
- if (paths.length === 0) {
203
- lines.push("No memory paths configured.");
204
- } else {
205
- lines.push("Files will be read from:");
206
- for (const p of paths) {
207
- lines.push(`- **[${p.type}]** ${p.path}/${memoryFile}`);
208
- }
209
- }
210
- return lines.join(`
211
- `);
212
- }
213
-
214
- // packages/core/src/env/memory/built-in/index.ts
215
- function createMemoryTools(recordMemory, recallMemory, config) {
216
- return [
217
- createRecordMemoryTool(recordMemory, config.getMemoryPaths, config.getMemoryFile),
218
- createRecallMemoryTool(recallMemory, config.getMemoryPaths, config.getMemoryFile)
219
- ];
220
- }
221
- export {
222
- createMemoryTools,
223
- RecordMemorySchema,
224
- RecallMemorySchema
225
- };