@ai-setting/roy-agent-core 1.5.54 → 1.5.55
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/env/agent/index.js +1 -1
- package/dist/env/index.js +4 -4
- package/dist/env/llm/index.js +1 -1
- package/dist/env/workflow/engine/index.js +2 -2
- package/dist/env/workflow/index.js +3 -3
- package/dist/index.js +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-hv713d36.js → roy-agent-core-cpf38des.js} +11 -2
- package/dist/shared/@ai-setting/{roy-agent-core-0frwccap.js → roy-agent-core-de0y1a5s.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0vt0trev.js → roy-agent-core-dpc9tz73.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-g7qhnsz3.js → roy-agent-core-egsx6js7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-jkhhsa3t.js → roy-agent-core-t5kc8f7p.js} +29 -10
- package/dist/shared/@ai-setting/{roy-agent-core-awmae5ax.js → roy-agent-core-t6zhkk09.js} +14 -0
- package/package.json +1 -1
package/dist/env/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponent,
|
|
3
3
|
AgentComponentConfigSchema
|
|
4
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "../../shared/@ai-setting/roy-agent-core-egsx6js7.js";
|
|
5
5
|
import"../../shared/@ai-setting/roy-agent-core-4ch3ghj6.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-emk3q2nt.js";
|
package/dist/env/index.js
CHANGED
|
@@ -21,10 +21,10 @@ import"../shared/@ai-setting/roy-agent-core-f336bk4g.js";
|
|
|
21
21
|
import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowComponent
|
|
24
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
} from "../shared/@ai-setting/roy-agent-core-dpc9tz73.js";
|
|
25
25
|
import"../shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
|
|
26
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
27
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
26
|
+
import"../shared/@ai-setting/roy-agent-core-t5kc8f7p.js";
|
|
27
|
+
import"../shared/@ai-setting/roy-agent-core-t6zhkk09.js";
|
|
28
28
|
import"../shared/@ai-setting/roy-agent-core-29867p67.js";
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
30
30
|
import"../shared/@ai-setting/roy-agent-core-v002ynpa.js";
|
|
@@ -38,7 +38,7 @@ import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
38
38
|
import {
|
|
39
39
|
AgentComponent,
|
|
40
40
|
AgentComponentConfigSchema
|
|
41
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
41
|
+
} from "../shared/@ai-setting/roy-agent-core-egsx6js7.js";
|
|
42
42
|
import"../shared/@ai-setting/roy-agent-core-4ch3ghj6.js";
|
|
43
43
|
import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
44
44
|
import {
|
package/dist/env/llm/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
Scheduler,
|
|
7
7
|
WorkflowEngine,
|
|
8
8
|
init_engine
|
|
9
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
9
|
+
} from "../../../shared/@ai-setting/roy-agent-core-t5kc8f7p.js";
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-t6zhkk09.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-29867p67.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-v002ynpa.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-dpc9tz73.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-t5kc8f7p.js";
|
|
6
|
+
import"../../shared/@ai-setting/roy-agent-core-t6zhkk09.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-29867p67.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-v002ynpa.js";
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ModelLimitsSchema,
|
|
12
12
|
ProviderCapabilitiesSchema,
|
|
13
13
|
ProviderConfigSchema
|
|
14
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "./shared/@ai-setting/roy-agent-core-cpf38des.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigComponent
|
|
17
17
|
} from "./shared/@ai-setting/roy-agent-core-e68xspar.js";
|
|
@@ -88,13 +88,13 @@ import {
|
|
|
88
88
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
89
89
|
import {
|
|
90
90
|
WorkflowComponent
|
|
91
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
91
|
+
} from "./shared/@ai-setting/roy-agent-core-dpc9tz73.js";
|
|
92
92
|
import {
|
|
93
93
|
init_node_registry_helper,
|
|
94
94
|
registerDecoratorNodeType
|
|
95
95
|
} from "./shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
|
|
96
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
97
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
96
|
+
import"./shared/@ai-setting/roy-agent-core-t5kc8f7p.js";
|
|
97
|
+
import"./shared/@ai-setting/roy-agent-core-t6zhkk09.js";
|
|
98
98
|
import"./shared/@ai-setting/roy-agent-core-29867p67.js";
|
|
99
99
|
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
100
100
|
import"./shared/@ai-setting/roy-agent-core-v002ynpa.js";
|
|
@@ -114,7 +114,7 @@ import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
114
114
|
import {
|
|
115
115
|
AgentComponent,
|
|
116
116
|
AgentComponentConfigSchema
|
|
117
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
117
|
+
} from "./shared/@ai-setting/roy-agent-core-egsx6js7.js";
|
|
118
118
|
import {
|
|
119
119
|
createInvokeConfig,
|
|
120
120
|
invoke,
|
|
@@ -608,8 +608,17 @@ class LLMComponent extends BaseComponent {
|
|
|
608
608
|
const defaultTemperature = this.getLLMConfig("llm.temperature", 0.7);
|
|
609
609
|
const defaultMaxTokens = this.getLLMConfig("llm.maxTokens", 4096);
|
|
610
610
|
const defaultTopP = this.getLLMConfig("llm.topP", 1);
|
|
611
|
-
const
|
|
612
|
-
|
|
611
|
+
const rawModel = request.model || defaultModel;
|
|
612
|
+
let model;
|
|
613
|
+
let providerId;
|
|
614
|
+
const slashIndex = rawModel.indexOf("/");
|
|
615
|
+
if (slashIndex >= 0) {
|
|
616
|
+
providerId = rawModel.substring(0, slashIndex);
|
|
617
|
+
model = rawModel.substring(slashIndex + 1);
|
|
618
|
+
} else {
|
|
619
|
+
providerId = request.providerId || defaultProvider;
|
|
620
|
+
model = rawModel;
|
|
621
|
+
}
|
|
613
622
|
const apiKey = this.getApiKey(providerId);
|
|
614
623
|
if (!apiKey) {
|
|
615
624
|
throw new Error(`API key not found for provider ${providerId}. Set providers.${providerId}.apiKey in config, or use \${env://...} protocol in config file.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponentAdapter,
|
|
3
3
|
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-t6zhkk09.js";
|
|
5
5
|
import"./roy-agent-core-29867p67.js";
|
|
6
6
|
import"./roy-agent-core-nhfy3p8q.js";
|
|
7
7
|
import"./roy-agent-core-e25xkv53.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
exports_engine,
|
|
8
8
|
init_engine
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-t5kc8f7p.js";
|
|
10
10
|
import {
|
|
11
11
|
WorkflowService
|
|
12
12
|
} from "./roy-agent-core-4t40mkpv.js";
|
|
@@ -136,7 +136,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
136
136
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
137
137
|
const llmComponent = this._workflowEnv.getComponent("llm");
|
|
138
138
|
if (agentComponent) {
|
|
139
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
139
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-de0y1a5s.js");
|
|
140
140
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent, llmComponent);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -539,7 +539,7 @@ class AgentComponent extends BaseComponent {
|
|
|
539
539
|
const effectiveContext = {
|
|
540
540
|
...context,
|
|
541
541
|
agentType: agent.config.type,
|
|
542
|
-
model: agent.config.model,
|
|
542
|
+
model: context?.model ?? agent.config.model,
|
|
543
543
|
abort: abortController.signal
|
|
544
544
|
};
|
|
545
545
|
const result = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponentAdapter,
|
|
3
3
|
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-t6zhkk09.js";
|
|
5
5
|
import {
|
|
6
6
|
buildWorkflowNodeMetadata,
|
|
7
7
|
getWorkflowNodeIdFromMetadata,
|
|
@@ -1356,6 +1356,7 @@ var init_agent_node = __esm(() => {
|
|
|
1356
1356
|
try {
|
|
1357
1357
|
const config = context.resolvedConfig ?? this.definition.config ?? {};
|
|
1358
1358
|
const agentType = config.agent_type || "general";
|
|
1359
|
+
const agentName = config.agent_name || undefined;
|
|
1359
1360
|
const options = config.options || {};
|
|
1360
1361
|
const outputConfig = parseAgentOutputConfig(config);
|
|
1361
1362
|
let resolvedPrompt;
|
|
@@ -1365,12 +1366,27 @@ var init_agent_node = __esm(() => {
|
|
|
1365
1366
|
const promptTemplate = config.prompt || "";
|
|
1366
1367
|
resolvedPrompt = context.templateResolver?.resolveValue(promptTemplate) ?? promptTemplate;
|
|
1367
1368
|
}
|
|
1369
|
+
let resolvedAgentType = agentType;
|
|
1370
|
+
let inheritedModel;
|
|
1371
|
+
let inheritedAllowedTools;
|
|
1372
|
+
let inheritedDeniedTools;
|
|
1373
|
+
if (agentName && this.agentRunner.hasAgent && this.agentRunner.getAgentConfig) {
|
|
1374
|
+
if (this.agentRunner.hasAgent(agentName)) {
|
|
1375
|
+
const agentConfig2 = this.agentRunner.getAgentConfig(agentName);
|
|
1376
|
+
if (agentConfig2) {
|
|
1377
|
+
resolvedAgentType = agentName;
|
|
1378
|
+
inheritedModel = agentConfig2.model;
|
|
1379
|
+
inheritedAllowedTools = agentConfig2.allowedTools;
|
|
1380
|
+
inheritedDeniedTools = agentConfig2.deniedTools;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1368
1384
|
if (this.agentRunner.registerAgent && this.agentRunner.hasAgent) {
|
|
1369
|
-
if (!this.agentRunner.hasAgent(
|
|
1370
|
-
this.agentRunner.registerAgent(
|
|
1371
|
-
type:
|
|
1372
|
-
systemPrompt: config.system_prompt || `You are a ${
|
|
1373
|
-
model: options.model
|
|
1385
|
+
if (!this.agentRunner.hasAgent(resolvedAgentType)) {
|
|
1386
|
+
this.agentRunner.registerAgent(resolvedAgentType, {
|
|
1387
|
+
type: resolvedAgentType,
|
|
1388
|
+
systemPrompt: config.system_prompt || `You are a ${resolvedAgentType} agent.`,
|
|
1389
|
+
model: options.model || inheritedModel
|
|
1374
1390
|
});
|
|
1375
1391
|
}
|
|
1376
1392
|
}
|
|
@@ -1389,14 +1405,17 @@ var init_agent_node = __esm(() => {
|
|
|
1389
1405
|
await context.attachAgentSessionToLastStart(this.definition.id, agentSessionId);
|
|
1390
1406
|
}
|
|
1391
1407
|
}
|
|
1392
|
-
const
|
|
1408
|
+
const effectiveModel = options.model || inheritedModel;
|
|
1409
|
+
const effectiveAllowedTools = options.allowedTools?.length ? options.allowedTools : inheritedAllowedTools?.length ? inheritedAllowedTools : ["ask_user"];
|
|
1410
|
+
const effectiveDeniedTools = options.deniedTools?.length ? options.deniedTools : inheritedDeniedTools;
|
|
1393
1411
|
const agentConfig = {
|
|
1394
|
-
type:
|
|
1412
|
+
type: resolvedAgentType,
|
|
1395
1413
|
prompt: resolvedPrompt,
|
|
1396
1414
|
options: {
|
|
1397
1415
|
timeout: options.timeout,
|
|
1398
|
-
model:
|
|
1399
|
-
allowedTools,
|
|
1416
|
+
model: effectiveModel,
|
|
1417
|
+
allowedTools: effectiveAllowedTools,
|
|
1418
|
+
deniedTools: effectiveDeniedTools,
|
|
1400
1419
|
outputSchema: outputConfig.schema
|
|
1401
1420
|
},
|
|
1402
1421
|
workflowHistory: context.workflowHistory,
|
|
@@ -117,6 +117,7 @@ var init_agent_component_adapter = __esm(() => {
|
|
|
117
117
|
try {
|
|
118
118
|
const outputSchema = config.options?.outputSchema;
|
|
119
119
|
const context = {};
|
|
120
|
+
context.model = config.options?.model;
|
|
120
121
|
if (config.options?.timeout) {
|
|
121
122
|
context.abort = new AbortController;
|
|
122
123
|
}
|
|
@@ -220,6 +221,19 @@ var init_agent_component_adapter = __esm(() => {
|
|
|
220
221
|
hasAgent(name) {
|
|
221
222
|
return this.agentComponent.getAgent(name) !== undefined;
|
|
222
223
|
}
|
|
224
|
+
getAgentConfig(name) {
|
|
225
|
+
const agent = this.agentComponent.getAgent(name);
|
|
226
|
+
if (!agent)
|
|
227
|
+
return;
|
|
228
|
+
return {
|
|
229
|
+
type: agent.config.type,
|
|
230
|
+
model: agent.config.model,
|
|
231
|
+
systemPrompt: agent.config.systemPrompt,
|
|
232
|
+
maxIterations: agent.config.maxIterations,
|
|
233
|
+
allowedTools: agent.config.allowedTools,
|
|
234
|
+
deniedTools: agent.config.deniedTools
|
|
235
|
+
};
|
|
236
|
+
}
|
|
223
237
|
listAgents() {
|
|
224
238
|
return this.agentComponent.listAgents().map((a) => a.name);
|
|
225
239
|
}
|