@ai-setting/roy-agent-core 1.7.3 → 1.7.4
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.js +5 -5
- package/dist/env/agent/index.js +6 -6
- package/dist/env/event-source/index.js +6 -6
- package/dist/env/index.js +42 -42
- package/dist/env/llm/index.js +4 -3
- package/dist/env/mcp/index.js +9 -9
- package/dist/env/memory/index.js +4 -4
- package/dist/env/session/index.js +2 -2
- package/dist/env/task/delegate/index.js +2 -2
- package/dist/env/task/index.js +5 -5
- package/dist/env/task/plugins/index.js +4 -4
- package/dist/env/tool/built-in/index.js +3 -2
- package/dist/env/tool/index.js +6 -5
- package/dist/env/workflow/engine/index.js +3 -3
- package/dist/env/workflow/index.js +26 -26
- package/dist/env/workflow/tools/index.js +6 -6
- package/dist/env/workflow/utils/index.js +3 -3
- package/dist/index.js +100 -98
- package/dist/shared/@ai-setting/{roy-agent-core-qatz3q31.js → roy-agent-core-29ph0e2k.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-watkmj7d.js → roy-agent-core-32226m35.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-y9q3jdcx.js → roy-agent-core-4m4awz0m.js} +15 -15
- package/dist/shared/@ai-setting/{roy-agent-core-pdnp5kj0.js → roy-agent-core-62mvbqmj.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-y3g3ar7a.js → roy-agent-core-adg9ghbt.js} +109 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xmacq00w.js → roy-agent-core-c9kbf0ce.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-yak43g6m.js → roy-agent-core-d11714ee.js} +56 -9
- package/dist/shared/@ai-setting/{roy-agent-core-g7nmwg63.js → roy-agent-core-hncxk9d1.js} +5 -111
- package/dist/shared/@ai-setting/{roy-agent-core-cy8azvpb.js → roy-agent-core-krapd8x2.js} +2 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kv7frw13.js → roy-agent-core-mgp3284f.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3dwcwgn5.js → roy-agent-core-q6mq7gmc.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-wr1pgw0x.js → roy-agent-core-w4dy6zzf.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-xwm8zavb.js +89 -0
- package/dist/shared/@ai-setting/{roy-agent-core-t7rw68q8.js → roy-agent-core-zjdzk1gg.js} +34 -84
- package/package.json +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-50jdqb7r.js → roy-agent-core-2yt4jmzv.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-h28gcd77.js → roy-agent-core-71wde8ce.js} +0 -0
- package/dist/shared/@ai-setting/{roy-agent-core-3e0w0ekw.js → roy-agent-core-7xek618f.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-xvag5pd0.js → roy-agent-core-v13dq3nc.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-s4r8f6se.js → roy-agent-core-ya1tr7xq.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-gns3wa97.js → roy-agent-core-zhv8efqh.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-s07nere5.js → roy-agent-core-zqeq8m9z.js} +7 -7
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigComponent
|
|
3
|
+
} from "./shared/@ai-setting/roy-agent-core-hncxk9d1.js";
|
|
1
4
|
import {
|
|
2
5
|
PromptComponent,
|
|
3
6
|
PromptStore
|
|
@@ -9,14 +12,8 @@ import {
|
|
|
9
12
|
ModelLimitsSchema,
|
|
10
13
|
ProviderCapabilitiesSchema,
|
|
11
14
|
ProviderConfigSchema
|
|
12
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
13
|
-
import
|
|
14
|
-
ConfigComponent
|
|
15
|
-
} from "./shared/@ai-setting/roy-agent-core-g7nmwg63.js";
|
|
16
|
-
import"./shared/@ai-setting/roy-agent-core-y3g3ar7a.js";
|
|
17
|
-
import {
|
|
18
|
-
CommandsComponent
|
|
19
|
-
} from "./shared/@ai-setting/roy-agent-core-6re7eg4w.js";
|
|
15
|
+
} from "./shared/@ai-setting/roy-agent-core-d11714ee.js";
|
|
16
|
+
import"./shared/@ai-setting/roy-agent-core-adg9ghbt.js";
|
|
20
17
|
import"./shared/@ai-setting/roy-agent-core-wjmwwc4a.js";
|
|
21
18
|
import {
|
|
22
19
|
bashTool,
|
|
@@ -27,43 +24,62 @@ import {
|
|
|
27
24
|
grepTool,
|
|
28
25
|
readFileTool,
|
|
29
26
|
writeFileTool
|
|
30
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "./shared/@ai-setting/roy-agent-core-mgp3284f.js";
|
|
31
28
|
import {
|
|
32
|
-
ATTACH_FILE_MAX_BYTES,
|
|
33
29
|
getUnderstandImageLLMProvider,
|
|
34
|
-
isMediaType,
|
|
35
|
-
parseImageInput,
|
|
36
30
|
resetUnderstandImageLLMProvider,
|
|
37
31
|
setUnderstandImageLLMProvider,
|
|
38
|
-
sniffMimeType,
|
|
39
32
|
understandImageTool
|
|
40
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
33
|
+
} from "./shared/@ai-setting/roy-agent-core-xwm8zavb.js";
|
|
41
34
|
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
ATTACH_FILE_MAX_BYTES,
|
|
36
|
+
isMediaType,
|
|
37
|
+
parseImageInput,
|
|
38
|
+
sniffMimeType
|
|
39
|
+
} from "./shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
40
|
+
import {
|
|
41
|
+
DebugComponent
|
|
42
|
+
} from "./shared/@ai-setting/roy-agent-core-rs5tp44j.js";
|
|
43
|
+
import {
|
|
44
|
+
ReplFormatter,
|
|
45
|
+
TraceFormatter,
|
|
46
|
+
TreeFormatter
|
|
47
|
+
} from "./shared/@ai-setting/roy-agent-core-rvv6ydff.js";
|
|
46
48
|
import {
|
|
47
49
|
MemoryComponent
|
|
48
50
|
} from "./shared/@ai-setting/roy-agent-core-qpt5fa8h.js";
|
|
49
|
-
import"./shared/@ai-setting/roy-agent-core-g1s2h0e5.js";
|
|
50
51
|
import {
|
|
51
52
|
MemoryPlugin,
|
|
52
53
|
createMemoryPlugin
|
|
53
54
|
} from "./shared/@ai-setting/roy-agent-core-qe3m3hec.js";
|
|
55
|
+
import"./shared/@ai-setting/roy-agent-core-g1s2h0e5.js";
|
|
54
56
|
import {
|
|
55
|
-
|
|
56
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
57
|
+
SkillComponent
|
|
58
|
+
} from "./shared/@ai-setting/roy-agent-core-b64s2vk9.js";
|
|
59
|
+
import"./shared/@ai-setting/roy-agent-core-psvxt4c9.js";
|
|
60
|
+
import"./shared/@ai-setting/roy-agent-core-k5hxvaf0.js";
|
|
57
61
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} from "./shared/@ai-setting/roy-agent-core-rvv6ydff.js";
|
|
62
|
+
closeDatabase
|
|
63
|
+
} from "./shared/@ai-setting/roy-agent-core-sfwt66pv.js";
|
|
64
|
+
import"./shared/@ai-setting/roy-agent-core-6m2gh57e.js";
|
|
62
65
|
import {
|
|
63
66
|
BaseEnvironment,
|
|
64
67
|
generateDescendingId,
|
|
65
68
|
generateId
|
|
66
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
69
|
+
} from "./shared/@ai-setting/roy-agent-core-32226m35.js";
|
|
70
|
+
import {
|
|
71
|
+
TaskComponent
|
|
72
|
+
} from "./shared/@ai-setting/roy-agent-core-4m4awz0m.js";
|
|
73
|
+
import"./shared/@ai-setting/roy-agent-core-k4byknt1.js";
|
|
74
|
+
import"./shared/@ai-setting/roy-agent-core-rn57psp0.js";
|
|
75
|
+
import"./shared/@ai-setting/roy-agent-core-amkqnyzy.js";
|
|
76
|
+
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
77
|
+
import"./shared/@ai-setting/roy-agent-core-2yt4jmzv.js";
|
|
78
|
+
import"./shared/@ai-setting/roy-agent-core-mvs5sen6.js";
|
|
79
|
+
import {
|
|
80
|
+
SQLiteTaskStore,
|
|
81
|
+
getDefaultTaskDbPath
|
|
82
|
+
} from "./shared/@ai-setting/roy-agent-core-3ep1dxf1.js";
|
|
67
83
|
import {
|
|
68
84
|
BountyIMInstance,
|
|
69
85
|
EventSourceComponent,
|
|
@@ -76,7 +92,11 @@ import {
|
|
|
76
92
|
larkCliHandler,
|
|
77
93
|
resolveBountyIMSystemPrompt,
|
|
78
94
|
timerHandler
|
|
79
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
95
|
+
} from "./shared/@ai-setting/roy-agent-core-w4dy6zzf.js";
|
|
96
|
+
import {
|
|
97
|
+
LogTraceComponent,
|
|
98
|
+
LogTraceConfigSchema
|
|
99
|
+
} from "./shared/@ai-setting/roy-agent-core-pz2n121t.js";
|
|
80
100
|
import {
|
|
81
101
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
82
102
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -86,40 +106,24 @@ import {
|
|
|
86
106
|
isValidEventSourceType,
|
|
87
107
|
validateEventSourceConfig
|
|
88
108
|
} from "./shared/@ai-setting/roy-agent-core-ds5f75pg.js";
|
|
89
|
-
import {
|
|
90
|
-
LogTraceComponent,
|
|
91
|
-
LogTraceConfigSchema
|
|
92
|
-
} from "./shared/@ai-setting/roy-agent-core-pz2n121t.js";
|
|
93
|
-
import {
|
|
94
|
-
PluginComponent
|
|
95
|
-
} from "./shared/@ai-setting/roy-agent-core-3x3k7gfs.js";
|
|
96
109
|
import {
|
|
97
110
|
TaskTagPlugin,
|
|
98
111
|
createAutoTaskPlugin
|
|
99
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
112
|
+
} from "./shared/@ai-setting/roy-agent-core-zhv8efqh.js";
|
|
100
113
|
import {
|
|
101
|
-
|
|
102
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
114
|
+
TaskHookPoints
|
|
115
|
+
} from "./shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
116
|
+
import {
|
|
117
|
+
getBuiltInPrompt,
|
|
118
|
+
getBuiltInPromptNames
|
|
119
|
+
} from "./shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
103
120
|
import {
|
|
104
121
|
WorkflowComponent
|
|
105
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
122
|
+
} from "./shared/@ai-setting/roy-agent-core-c9kbf0ce.js";
|
|
106
123
|
import {
|
|
107
124
|
init_node_registry_helper,
|
|
108
125
|
registerDecoratorNodeType
|
|
109
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
110
|
-
import"./shared/@ai-setting/roy-agent-core-s4r8f6se.js";
|
|
111
|
-
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
112
|
-
import"./shared/@ai-setting/roy-agent-core-ec4djnzd.js";
|
|
113
|
-
import"./shared/@ai-setting/roy-agent-core-h1cb2jzh.js";
|
|
114
|
-
import"./shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
115
|
-
import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
116
|
-
import"./shared/@ai-setting/roy-agent-core-0qjw25e8.js";
|
|
117
|
-
import"./shared/@ai-setting/roy-agent-core-qatz3q31.js";
|
|
118
|
-
import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
119
|
-
import"./shared/@ai-setting/roy-agent-core-j9ybhwnq.js";
|
|
120
|
-
import"./shared/@ai-setting/roy-agent-core-w8rv08d3.js";
|
|
121
|
-
import"./shared/@ai-setting/roy-agent-core-0v74marc.js";
|
|
122
|
-
import"./shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
126
|
+
} from "./shared/@ai-setting/roy-agent-core-7xek618f.js";
|
|
123
127
|
import {
|
|
124
128
|
Edge,
|
|
125
129
|
NodeAs,
|
|
@@ -128,36 +132,39 @@ import {
|
|
|
128
132
|
createWorkflowFromClass
|
|
129
133
|
} from "./shared/@ai-setting/roy-agent-core-h0x19xgn.js";
|
|
130
134
|
import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
135
|
+
import"./shared/@ai-setting/roy-agent-core-29ph0e2k.js";
|
|
136
|
+
import {
|
|
137
|
+
SessionComponent
|
|
138
|
+
} from "./shared/@ai-setting/roy-agent-core-v13dq3nc.js";
|
|
139
|
+
import {
|
|
140
|
+
MemorySessionStore
|
|
141
|
+
} from "./shared/@ai-setting/roy-agent-core-wgp3q62x.js";
|
|
142
|
+
import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
143
|
+
import"./shared/@ai-setting/roy-agent-core-j9ybhwnq.js";
|
|
144
|
+
import"./shared/@ai-setting/roy-agent-core-ya1tr7xq.js";
|
|
145
|
+
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
146
|
+
import"./shared/@ai-setting/roy-agent-core-ec4djnzd.js";
|
|
147
|
+
import"./shared/@ai-setting/roy-agent-core-0qjw25e8.js";
|
|
148
|
+
import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
149
|
+
import"./shared/@ai-setting/roy-agent-core-w8rv08d3.js";
|
|
150
|
+
import"./shared/@ai-setting/roy-agent-core-h1cb2jzh.js";
|
|
151
|
+
import"./shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
152
|
+
import"./shared/@ai-setting/roy-agent-core-0v74marc.js";
|
|
153
|
+
import"./shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
154
|
+
import"./shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
155
|
+
import {
|
|
156
|
+
CommandsComponent
|
|
157
|
+
} from "./shared/@ai-setting/roy-agent-core-6re7eg4w.js";
|
|
131
158
|
import {
|
|
132
159
|
AgentComponent,
|
|
133
160
|
AgentComponentConfigSchema
|
|
134
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
161
|
+
} from "./shared/@ai-setting/roy-agent-core-q6mq7gmc.js";
|
|
135
162
|
import {
|
|
136
163
|
ToolComponent,
|
|
137
164
|
ToolRegistry,
|
|
138
165
|
ToolValidator
|
|
139
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
166
|
+
} from "./shared/@ai-setting/roy-agent-core-71wde8ce.js";
|
|
140
167
|
import"./shared/@ai-setting/roy-agent-core-br7dmedr.js";
|
|
141
|
-
import"./shared/@ai-setting/roy-agent-core-t3yqzgse.js";
|
|
142
|
-
import {
|
|
143
|
-
AskUserError,
|
|
144
|
-
init_workflow_hil
|
|
145
|
-
} from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
146
|
-
import {
|
|
147
|
-
TaskComponent
|
|
148
|
-
} from "./shared/@ai-setting/roy-agent-core-y9q3jdcx.js";
|
|
149
|
-
import"./shared/@ai-setting/roy-agent-core-amkqnyzy.js";
|
|
150
|
-
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
151
|
-
import"./shared/@ai-setting/roy-agent-core-50jdqb7r.js";
|
|
152
|
-
import"./shared/@ai-setting/roy-agent-core-mvs5sen6.js";
|
|
153
|
-
import {
|
|
154
|
-
SQLiteTaskStore,
|
|
155
|
-
getDefaultTaskDbPath
|
|
156
|
-
} from "./shared/@ai-setting/roy-agent-core-3ep1dxf1.js";
|
|
157
|
-
import {
|
|
158
|
-
getBuiltInPrompt,
|
|
159
|
-
getBuiltInPromptNames
|
|
160
|
-
} from "./shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
161
168
|
import {
|
|
162
169
|
AgentRegistry
|
|
163
170
|
} from "./shared/@ai-setting/roy-agent-core-x0yztmm6.js";
|
|
@@ -166,19 +173,29 @@ import {
|
|
|
166
173
|
getXDGPath,
|
|
167
174
|
getXDGPaths
|
|
168
175
|
} from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
176
|
+
import"./shared/@ai-setting/roy-agent-core-t3yqzgse.js";
|
|
177
|
+
import"./shared/@ai-setting/roy-agent-core-zcx8nf4a.js";
|
|
178
|
+
import {
|
|
179
|
+
createInvokeConfig,
|
|
180
|
+
invoke,
|
|
181
|
+
invokeNonStream,
|
|
182
|
+
parseModelString
|
|
183
|
+
} from "./shared/@ai-setting/roy-agent-core-2xb3f3ye.js";
|
|
169
184
|
import"./shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
170
|
-
import"./shared/@ai-setting/roy-agent-core-k4byknt1.js";
|
|
171
|
-
import"./shared/@ai-setting/roy-agent-core-rn57psp0.js";
|
|
172
185
|
import {
|
|
173
|
-
|
|
174
|
-
|
|
186
|
+
AskUserError,
|
|
187
|
+
init_workflow_hil
|
|
188
|
+
} from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
175
189
|
import {
|
|
176
|
-
|
|
177
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
178
|
-
import
|
|
190
|
+
PluginComponent
|
|
191
|
+
} from "./shared/@ai-setting/roy-agent-core-3x3k7gfs.js";
|
|
192
|
+
import {
|
|
193
|
+
BasePlugin
|
|
194
|
+
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
179
195
|
import {
|
|
180
196
|
McpComponent
|
|
181
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
197
|
+
} from "./shared/@ai-setting/roy-agent-core-zqeq8m9z.js";
|
|
198
|
+
import"./shared/@ai-setting/roy-agent-core-dxfd6p1c.js";
|
|
182
199
|
import {
|
|
183
200
|
AgentError,
|
|
184
201
|
ComponentError,
|
|
@@ -190,22 +207,6 @@ import {
|
|
|
190
207
|
getErrorCode,
|
|
191
208
|
isRoyError
|
|
192
209
|
} from "./shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
193
|
-
import"./shared/@ai-setting/roy-agent-core-fnv3ev18.js";
|
|
194
|
-
import"./shared/@ai-setting/roy-agent-core-dxfd6p1c.js";
|
|
195
|
-
import {
|
|
196
|
-
SessionComponent
|
|
197
|
-
} from "./shared/@ai-setting/roy-agent-core-xvag5pd0.js";
|
|
198
|
-
import"./shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
199
|
-
import {
|
|
200
|
-
MemorySessionStore
|
|
201
|
-
} from "./shared/@ai-setting/roy-agent-core-wgp3q62x.js";
|
|
202
|
-
import"./shared/@ai-setting/roy-agent-core-zcx8nf4a.js";
|
|
203
|
-
import {
|
|
204
|
-
createInvokeConfig,
|
|
205
|
-
invoke,
|
|
206
|
-
invokeNonStream,
|
|
207
|
-
parseModelString
|
|
208
|
-
} from "./shared/@ai-setting/roy-agent-core-2xb3f3ye.js";
|
|
209
210
|
import"./shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
210
211
|
import {
|
|
211
212
|
BaseComponent
|
|
@@ -249,6 +250,7 @@ import {
|
|
|
249
250
|
import {
|
|
250
251
|
SQLiteSpanStorage
|
|
251
252
|
} from "./shared/@ai-setting/roy-agent-core-4an1p9a1.js";
|
|
253
|
+
import"./shared/@ai-setting/roy-agent-core-fnv3ev18.js";
|
|
252
254
|
import"./shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
253
255
|
// src/env/session-tree-stopper.ts
|
|
254
256
|
init_decorator();
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isValidSessionId
|
|
3
|
+
} from "./roy-agent-core-v13dq3nc.js";
|
|
1
4
|
import {
|
|
2
5
|
TAG_MAX_COUNT,
|
|
3
6
|
TAG_MIN_COUNT
|
|
@@ -5,16 +8,13 @@ import {
|
|
|
5
8
|
import {
|
|
6
9
|
validateWorkflowDefinition
|
|
7
10
|
} from "./roy-agent-core-w8rv08d3.js";
|
|
8
|
-
import {
|
|
9
|
-
AskUserError,
|
|
10
|
-
init_workflow_hil
|
|
11
|
-
} from "./roy-agent-core-e25xkv53.js";
|
|
12
11
|
import {
|
|
13
12
|
getCurrentBgTaskId
|
|
14
13
|
} from "./roy-agent-core-c1v263jn.js";
|
|
15
14
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
AskUserError,
|
|
16
|
+
init_workflow_hil
|
|
17
|
+
} from "./roy-agent-core-e25xkv53.js";
|
|
18
18
|
import {
|
|
19
19
|
TracedAs,
|
|
20
20
|
init_decorator
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createQueryBackgroundProcessTool
|
|
3
|
-
} from "./roy-agent-core-amkqnyzy.js";
|
|
4
|
-
import {
|
|
5
|
-
TaskEntityEventTypes
|
|
6
|
-
} from "./roy-agent-core-8gxth0eh.js";
|
|
7
|
-
import {
|
|
8
|
-
BackgroundTaskManager,
|
|
9
|
-
createDelegateTool,
|
|
10
|
-
createStopTool
|
|
11
|
-
} from "./roy-agent-core-50jdqb7r.js";
|
|
12
|
-
import {
|
|
13
|
-
SQLiteTaskStore,
|
|
14
|
-
getDefaultTaskDbPath
|
|
15
|
-
} from "./roy-agent-core-3ep1dxf1.js";
|
|
16
1
|
import {
|
|
17
2
|
batchArchiveTaskTool,
|
|
18
3
|
batchDeleteTaskTool,
|
|
@@ -32,6 +17,21 @@ import {
|
|
|
32
17
|
listOperationsTool,
|
|
33
18
|
updateOperationTool
|
|
34
19
|
} from "./roy-agent-core-rn57psp0.js";
|
|
20
|
+
import {
|
|
21
|
+
createQueryBackgroundProcessTool
|
|
22
|
+
} from "./roy-agent-core-amkqnyzy.js";
|
|
23
|
+
import {
|
|
24
|
+
TaskEntityEventTypes
|
|
25
|
+
} from "./roy-agent-core-8gxth0eh.js";
|
|
26
|
+
import {
|
|
27
|
+
BackgroundTaskManager,
|
|
28
|
+
createDelegateTool,
|
|
29
|
+
createStopTool
|
|
30
|
+
} from "./roy-agent-core-2yt4jmzv.js";
|
|
31
|
+
import {
|
|
32
|
+
SQLiteTaskStore,
|
|
33
|
+
getDefaultTaskDbPath
|
|
34
|
+
} from "./roy-agent-core-3ep1dxf1.js";
|
|
35
35
|
import {
|
|
36
36
|
TaskHookPoints
|
|
37
37
|
} from "./roy-agent-core-1pg0fepg.js";
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
hasDecoratorNodes,
|
|
4
4
|
init_node_registry_helper,
|
|
5
5
|
registerDecoratorNodeType
|
|
6
|
-
} from "./roy-agent-core-
|
|
7
|
-
import"./roy-agent-core-ddwa0n6h.js";
|
|
6
|
+
} from "./roy-agent-core-7xek618f.js";
|
|
8
7
|
import"./roy-agent-core-1ce3fqrk.js";
|
|
8
|
+
import"./roy-agent-core-ddwa0n6h.js";
|
|
9
9
|
import"./roy-agent-core-gb7pm9c0.js";
|
|
10
10
|
import"./roy-agent-core-kaq037np.js";
|
|
11
11
|
import"./roy-agent-core-1khp1m0r.js";
|
|
@@ -4,6 +4,114 @@ import {
|
|
|
4
4
|
toEnvKey
|
|
5
5
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
6
6
|
|
|
7
|
+
// src/config/config-parser.ts
|
|
8
|
+
import { parse as parseJSONCInternal, ParseErrorCode } from "jsonc-parser";
|
|
9
|
+
function parseJSONC(content) {
|
|
10
|
+
const errors = [];
|
|
11
|
+
const result = parseJSONCInternal(content, errors, {
|
|
12
|
+
allowTrailingComma: true,
|
|
13
|
+
disallowComments: false
|
|
14
|
+
});
|
|
15
|
+
if (errors.length > 0) {
|
|
16
|
+
const hasOnlyValueExpected = result === undefined && errors.length === 1 && errors[0].error === ParseErrorCode.ValueExpected;
|
|
17
|
+
if (!hasOnlyValueExpected) {
|
|
18
|
+
const error = errors[0];
|
|
19
|
+
const offset = error.offset;
|
|
20
|
+
const lines = content.substring(0, offset).split(`
|
|
21
|
+
`);
|
|
22
|
+
const line = lines.length;
|
|
23
|
+
const col = lines[lines.length - 1].length + 1;
|
|
24
|
+
const errorMessages = {
|
|
25
|
+
[ParseErrorCode.UnexpectedEndOfString]: "Unexpected end of string",
|
|
26
|
+
[ParseErrorCode.InvalidCharacter]: "Invalid character",
|
|
27
|
+
[ParseErrorCode.PropertyNameExpected]: "Property name expected",
|
|
28
|
+
[ParseErrorCode.ValueExpected]: "Value expected",
|
|
29
|
+
[ParseErrorCode.ColonExpected]: "Colon expected",
|
|
30
|
+
[ParseErrorCode.CommaExpected]: "Comma expected",
|
|
31
|
+
[ParseErrorCode.CloseBraceExpected]: "Close brace expected",
|
|
32
|
+
[ParseErrorCode.CloseBracketExpected]: "Close bracket expected",
|
|
33
|
+
[ParseErrorCode.EndOfFileExpected]: "Unexpected end of input",
|
|
34
|
+
[ParseErrorCode.InvalidSymbol]: "Invalid symbol"
|
|
35
|
+
};
|
|
36
|
+
throw new Error(`JSONC parse error at line ${line}, col ${col}: ${errorMessages[error.error] || "Unknown error"}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (result === undefined || result === null) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
function substituteEnvVars(value) {
|
|
45
|
+
if (typeof value === "string") {
|
|
46
|
+
return value.replace(/\$\{([^}]+)\}/g, (match, varExpr) => {
|
|
47
|
+
const [varName, defaultValue] = varExpr.split(":-");
|
|
48
|
+
const envValue = process.env[varName.trim()];
|
|
49
|
+
if (envValue !== undefined) {
|
|
50
|
+
return envValue;
|
|
51
|
+
}
|
|
52
|
+
if (defaultValue !== undefined) {
|
|
53
|
+
return defaultValue;
|
|
54
|
+
}
|
|
55
|
+
return "";
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(value)) {
|
|
59
|
+
return value.map((item) => substituteEnvVars(item));
|
|
60
|
+
}
|
|
61
|
+
if (value !== null && typeof value === "object") {
|
|
62
|
+
const result = {};
|
|
63
|
+
for (const [key, val] of Object.entries(value)) {
|
|
64
|
+
result[key] = substituteEnvVars(val);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
function parseJSONCWithEnv(content) {
|
|
71
|
+
const parsed = parseJSONC(content);
|
|
72
|
+
return substituteEnvVars(parsed);
|
|
73
|
+
}
|
|
74
|
+
var PROTOCOL_REF_PATTERN = /^\$\{([^:]+):\/\/[^}]+\}$/;
|
|
75
|
+
var PROTOCOL_REF_WITH_DEFAULT_PATTERN = /^\$\{([^:]+):\/\/([^:#]+)(?:#([^:-]+))?(?::-(.*))?\}$/;
|
|
76
|
+
function isProtocolRefString(value) {
|
|
77
|
+
return PROTOCOL_REF_PATTERN.test(value);
|
|
78
|
+
}
|
|
79
|
+
function extractDefaultValue(ref) {
|
|
80
|
+
const match = ref.match(PROTOCOL_REF_WITH_DEFAULT_PATTERN);
|
|
81
|
+
return match ? match[4] : undefined;
|
|
82
|
+
}
|
|
83
|
+
function substituteProtocolRefs(value, resolver) {
|
|
84
|
+
if (typeof value === "string") {
|
|
85
|
+
if (isProtocolRefString(value)) {
|
|
86
|
+
const result = resolver.resolve(value);
|
|
87
|
+
if (result !== null) {
|
|
88
|
+
return result.value;
|
|
89
|
+
}
|
|
90
|
+
const defaultValue = extractDefaultValue(value);
|
|
91
|
+
if (defaultValue !== undefined) {
|
|
92
|
+
return defaultValue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
if (Array.isArray(value)) {
|
|
98
|
+
return value.map((item) => substituteProtocolRefs(item, resolver));
|
|
99
|
+
}
|
|
100
|
+
if (value !== null && typeof value === "object") {
|
|
101
|
+
const result = {};
|
|
102
|
+
for (const [key, val] of Object.entries(value)) {
|
|
103
|
+
result[key] = substituteProtocolRefs(val, resolver);
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
return value;
|
|
108
|
+
}
|
|
109
|
+
function parseJSONCWithProtocols(content, resolver) {
|
|
110
|
+
const parsed = parseJSONC(content);
|
|
111
|
+
const withProtocols = substituteProtocolRefs(parsed, resolver);
|
|
112
|
+
return substituteEnvVars(withProtocols);
|
|
113
|
+
}
|
|
114
|
+
|
|
7
115
|
// src/config/env-source.ts
|
|
8
116
|
class EnvSource {
|
|
9
117
|
name = "env";
|
|
@@ -226,4 +334,4 @@ class EnvSource {
|
|
|
226
334
|
}
|
|
227
335
|
}
|
|
228
336
|
|
|
229
|
-
export { EnvSource };
|
|
337
|
+
export { parseJSONC, substituteEnvVars, parseJSONCWithEnv, substituteProtocolRefs, parseJSONCWithProtocols, EnvSource };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
5
|
-
import {
|
|
6
|
-
WorkflowEngine,
|
|
7
|
-
exports_engine,
|
|
8
|
-
init_engine
|
|
9
|
-
} from "./roy-agent-core-s4r8f6se.js";
|
|
4
|
+
} from "./roy-agent-core-7xek618f.js";
|
|
10
5
|
import {
|
|
11
6
|
askUserTool,
|
|
12
7
|
createRunWorkflowTool,
|
|
@@ -18,10 +13,15 @@ import {
|
|
|
18
13
|
createWorkflowSearchTool,
|
|
19
14
|
createWorkflowTagListTool,
|
|
20
15
|
createWorkflowValidateTool
|
|
21
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-29ph0e2k.js";
|
|
22
17
|
import {
|
|
23
18
|
WorkflowService
|
|
24
19
|
} from "./roy-agent-core-j9ybhwnq.js";
|
|
20
|
+
import {
|
|
21
|
+
WorkflowEngine,
|
|
22
|
+
exports_engine,
|
|
23
|
+
init_engine
|
|
24
|
+
} from "./roy-agent-core-ya1tr7xq.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
27
|
} from "./roy-agent-core-pde8hkq4.js";
|
|
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
104
104
|
return;
|
|
105
105
|
try {
|
|
106
106
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
107
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
107
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-62mvbqmj.js");
|
|
108
108
|
this.nodeRegistry = new NodeRegistry;
|
|
109
109
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
110
110
|
this.decoratorsRegistered = true;
|
|
@@ -134,7 +134,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
}
|
|
135
135
|
async runWorkflow(definition, input, options) {
|
|
136
136
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
137
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
137
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-62mvbqmj.js");
|
|
138
138
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
139
139
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
140
140
|
let agentRunner = this.agentRunner;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
-
EnvSource
|
|
3
|
-
|
|
2
|
+
EnvSource,
|
|
3
|
+
parseJSONC
|
|
4
|
+
} from "./roy-agent-core-adg9ghbt.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./roy-agent-core-ctdhjv68.js";
|
|
6
|
+
sniffImageMime
|
|
7
|
+
} from "./roy-agent-core-zjdzk1gg.js";
|
|
8
8
|
import {
|
|
9
9
|
invoke,
|
|
10
10
|
invokeNonStream
|
|
11
11
|
} from "./roy-agent-core-2xb3f3ye.js";
|
|
12
|
+
import {
|
|
13
|
+
ContextError,
|
|
14
|
+
ErrorCodes
|
|
15
|
+
} from "./roy-agent-core-ctdhjv68.js";
|
|
12
16
|
import {
|
|
13
17
|
envKeyToConfigKey,
|
|
14
18
|
toEnvKey
|
|
@@ -107,7 +111,7 @@ function toPiMessages(messages) {
|
|
|
107
111
|
if (c.type === "text")
|
|
108
112
|
return [{ type: "text", text: c.text }];
|
|
109
113
|
if (c.type === "image")
|
|
110
|
-
return [{ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType:
|
|
114
|
+
return [{ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType: sniffImageMime(c.image, c.mediaType) }];
|
|
111
115
|
return [{ type: "text", text: `[file:${c.mediaType}] ${typeof c.file === "string" ? c.file : Buffer.from(c.file).toString("base64")}` }];
|
|
112
116
|
}), timestamp: ts });
|
|
113
117
|
}
|
|
@@ -125,7 +129,7 @@ function toPiMessages(messages) {
|
|
|
125
129
|
if (c.type === "text")
|
|
126
130
|
content.push({ type: "text", text: c.text });
|
|
127
131
|
else if (c.type === "image")
|
|
128
|
-
content.push({ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType:
|
|
132
|
+
content.push({ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType: sniffImageMime(c.image, c.mediaType) });
|
|
129
133
|
else
|
|
130
134
|
content.push({ type: "text", text: `[file:${c.mediaType}] ${typeof c.file === "string" ? c.file : Buffer.from(c.file).toString("base64")}` });
|
|
131
135
|
}
|
|
@@ -903,7 +907,38 @@ class LLMHooks {
|
|
|
903
907
|
init_logger();
|
|
904
908
|
init_decorator();
|
|
905
909
|
import { randomUUID } from "crypto";
|
|
910
|
+
import * as fs from "node:fs/promises";
|
|
911
|
+
import * as os from "node:os";
|
|
912
|
+
import * as path from "node:path";
|
|
906
913
|
var logger2 = createLogger("llm");
|
|
914
|
+
async function resolveFallbackProviderConfig(providerId) {
|
|
915
|
+
const home = os.homedir();
|
|
916
|
+
const authPath = path.join(home, ".roy-agent", "auth.json");
|
|
917
|
+
const configPath = path.join(home, ".roy-agent", "config.jsonc");
|
|
918
|
+
let authText;
|
|
919
|
+
let configText;
|
|
920
|
+
try {
|
|
921
|
+
[authText, configText] = await Promise.all([
|
|
922
|
+
fs.readFile(authPath, "utf-8"),
|
|
923
|
+
fs.readFile(configPath, "utf-8")
|
|
924
|
+
]);
|
|
925
|
+
} catch (err) {
|
|
926
|
+
throw new Error(`resolveFallbackProviderConfig: cannot read ${authPath} or ${configPath}: ` + err.message);
|
|
927
|
+
}
|
|
928
|
+
const auth = JSON.parse(authText);
|
|
929
|
+
const authEntry = auth.providers?.[providerId];
|
|
930
|
+
if (!authEntry?.apiKey || !authEntry?.baseURL) {
|
|
931
|
+
throw new Error(`resolveFallbackProviderConfig: no config found for provider "${providerId}" ` + `in ${authPath}. Add it under "providers.${providerId}".`);
|
|
932
|
+
}
|
|
933
|
+
const config = parseJSONC(configText);
|
|
934
|
+
const configEntry = config.llm?.providers?.[providerId];
|
|
935
|
+
const providerType = configEntry?.provider ?? "openai-compatible";
|
|
936
|
+
return {
|
|
937
|
+
baseURL: authEntry.baseURL,
|
|
938
|
+
apiKey: authEntry.apiKey,
|
|
939
|
+
providerType
|
|
940
|
+
};
|
|
941
|
+
}
|
|
907
942
|
|
|
908
943
|
class LLMComponent extends BaseComponent {
|
|
909
944
|
name = "llm";
|
|
@@ -1193,9 +1228,21 @@ class LLMComponent extends BaseComponent {
|
|
|
1193
1228
|
}
|
|
1194
1229
|
} catch (adapterErr) {
|
|
1195
1230
|
logger2.warn(`[LLMComponent.invoke] adapter(${adapter.name}) failed, falling back to AI SDK invoke: ${adapterErr.message}`);
|
|
1196
|
-
|
|
1231
|
+
let fallbackInvokeConfig = ctx.invokeConfig;
|
|
1232
|
+
try {
|
|
1233
|
+
const fallback = await resolveFallbackProviderConfig(ctx.providerId);
|
|
1234
|
+
fallbackInvokeConfig = {
|
|
1235
|
+
...ctx.invokeConfig,
|
|
1236
|
+
apiKey: fallback.apiKey,
|
|
1237
|
+
baseURL: fallback.baseURL
|
|
1238
|
+
};
|
|
1239
|
+
logger2.warn(`[LLMComponent.invoke] fallback re-resolved baseURL from auth.json: ${fallback.baseURL}`);
|
|
1240
|
+
} catch (configErr) {
|
|
1241
|
+
logger2.warn(`[LLMComponent.invoke] resolveFallbackProviderConfig failed, using ctx.invokeConfig as-is: ${configErr.message}`);
|
|
1242
|
+
}
|
|
1243
|
+
const result = await invoke(fallbackInvokeConfig, {
|
|
1197
1244
|
messages: ctx.messages,
|
|
1198
|
-
model:
|
|
1245
|
+
model: fallbackInvokeConfig.model,
|
|
1199
1246
|
temperature: ctx.temperature,
|
|
1200
1247
|
maxTokens: ctx.maxTokens,
|
|
1201
1248
|
tools: request.tools,
|