@ai-setting/roy-agent-core 1.5.76 → 1.5.77
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 +2 -2
- package/dist/env/workflow/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-w6j4zyps.js → roy-agent-core-4s4en7c6.js} +18 -0
- package/dist/shared/@ai-setting/{roy-agent-core-c4hhd1f2.js → roy-agent-core-vqkzn45t.js} +1 -1
- 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-4s4en7c6.js";
|
|
5
5
|
import"../../shared/@ai-setting/roy-agent-core-r0m0at3x.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-zf62vkc4.js";
|
package/dist/env/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import"../shared/@ai-setting/roy-agent-core-r12a2qfv.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-vqkzn45t.js";
|
|
25
25
|
import"../shared/@ai-setting/roy-agent-core-fjexv5nm.js";
|
|
26
26
|
import"../shared/@ai-setting/roy-agent-core-4hh4s0w1.js";
|
|
27
27
|
import"../shared/@ai-setting/roy-agent-core-9adgwts7.js";
|
|
@@ -39,7 +39,7 @@ import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
39
39
|
import {
|
|
40
40
|
AgentComponent,
|
|
41
41
|
AgentComponentConfigSchema
|
|
42
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
42
|
+
} from "../shared/@ai-setting/roy-agent-core-4s4en7c6.js";
|
|
43
43
|
import"../shared/@ai-setting/roy-agent-core-r0m0at3x.js";
|
|
44
44
|
import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
45
45
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-vqkzn45t.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-fjexv5nm.js";
|
|
5
5
|
import"../../shared/@ai-setting/roy-agent-core-4hh4s0w1.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-9adgwts7.js";
|
package/dist/index.js
CHANGED
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
90
90
|
import {
|
|
91
91
|
WorkflowComponent
|
|
92
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
92
|
+
} from "./shared/@ai-setting/roy-agent-core-vqkzn45t.js";
|
|
93
93
|
import {
|
|
94
94
|
init_node_registry_helper,
|
|
95
95
|
registerDecoratorNodeType
|
|
@@ -116,7 +116,7 @@ import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
116
116
|
import {
|
|
117
117
|
AgentComponent,
|
|
118
118
|
AgentComponentConfigSchema
|
|
119
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
119
|
+
} from "./shared/@ai-setting/roy-agent-core-4s4en7c6.js";
|
|
120
120
|
import {
|
|
121
121
|
createInvokeConfig,
|
|
122
122
|
invoke,
|
|
@@ -147,6 +147,7 @@ var DEFAULT_AGENT_CONFIG = {
|
|
|
147
147
|
maxIterations: 200,
|
|
148
148
|
maxErrorRetries: 3,
|
|
149
149
|
doomLoopThreshold: 5,
|
|
150
|
+
timeout: 300000,
|
|
150
151
|
toolTimeout: 60000,
|
|
151
152
|
toolRetries: 3,
|
|
152
153
|
filterHistory: false
|
|
@@ -161,6 +162,7 @@ var AgentInstanceSchema = z.object({
|
|
|
161
162
|
doomLoopThreshold: z.number().default(5),
|
|
162
163
|
allowedTools: z.array(z.string()).optional(),
|
|
163
164
|
deniedTools: z.array(z.string()).optional(),
|
|
165
|
+
timeout: z.number().default(300000),
|
|
164
166
|
toolTimeout: z.number().default(60000),
|
|
165
167
|
toolRetries: z.number().default(3),
|
|
166
168
|
filterHistory: z.boolean().default(false)
|
|
@@ -254,6 +256,7 @@ class AgentComponent extends BaseComponent {
|
|
|
254
256
|
maxIterations: constructorDefaultAgent?.maxIterations ?? configComponent.get("agent.defaultAgent.maxIterations") ?? 200,
|
|
255
257
|
maxErrorRetries: constructorDefaultAgent?.maxErrorRetries ?? configComponent.get("agent.defaultAgent.maxErrorRetries") ?? 3,
|
|
256
258
|
doomLoopThreshold: constructorDefaultAgent?.doomLoopThreshold ?? configComponent.get("agent.defaultAgent.doomLoopThreshold") ?? 5,
|
|
259
|
+
timeout: constructorDefaultAgent?.timeout ?? configComponent.get("agent.defaultAgent.timeout") ?? 300000,
|
|
257
260
|
toolTimeout: constructorDefaultAgent?.toolTimeout ?? configComponent.get("agent.defaultAgent.toolTimeout") ?? 60000,
|
|
258
261
|
toolRetries: constructorDefaultAgent?.toolRetries ?? configComponent.get("agent.defaultAgent.toolRetries") ?? 3,
|
|
259
262
|
filterHistory: constructorDefaultAgent?.filterHistory ?? configComponent.get("agent.defaultAgent.filterHistory") ?? false,
|
|
@@ -434,6 +437,7 @@ class AgentComponent extends BaseComponent {
|
|
|
434
437
|
maxIterations: config.maxIterations ?? this.config.defaultAgent.maxIterations,
|
|
435
438
|
maxErrorRetries: config.maxErrorRetries ?? this.config.defaultAgent.maxErrorRetries,
|
|
436
439
|
doomLoopThreshold: config.doomLoopThreshold ?? this.config.defaultAgent.doomLoopThreshold,
|
|
440
|
+
timeout: config.timeout ?? this.config.defaultAgent.timeout,
|
|
437
441
|
toolTimeout: config.toolTimeout ?? this.config.defaultAgent.toolTimeout,
|
|
438
442
|
toolRetries: config.toolRetries ?? this.config.defaultAgent.toolRetries,
|
|
439
443
|
systemPrompt: config.systemPrompt ?? (config.systemPromptRef ? undefined : this.config.defaultAgent.systemPrompt),
|
|
@@ -536,6 +540,16 @@ class AgentComponent extends BaseComponent {
|
|
|
536
540
|
this.aborted.set(runId, false);
|
|
537
541
|
const abortController = new AbortController;
|
|
538
542
|
this.abortControllers.set(runId, abortController);
|
|
543
|
+
let timeoutId;
|
|
544
|
+
if (agent.config.timeout && agent.config.timeout > 0) {
|
|
545
|
+
timeoutId = setTimeout(() => {
|
|
546
|
+
if (!this.aborted.get(runId)) {
|
|
547
|
+
logger.warn(`[runAgent] Agent "${agentName}" timed out after ${agent.config.timeout}ms (runId=${runId})`);
|
|
548
|
+
this.aborted.set(runId, true);
|
|
549
|
+
abortController.abort();
|
|
550
|
+
}
|
|
551
|
+
}, agent.config.timeout);
|
|
552
|
+
}
|
|
539
553
|
if (!this.doomLoopCaches.has(runId)) {
|
|
540
554
|
this.doomLoopCaches.set(runId, new Map);
|
|
541
555
|
}
|
|
@@ -922,6 +936,10 @@ class AgentComponent extends BaseComponent {
|
|
|
922
936
|
}
|
|
923
937
|
this.aborted.delete(runId);
|
|
924
938
|
this.abortControllers.delete(runId);
|
|
939
|
+
if (timeoutId !== undefined) {
|
|
940
|
+
clearTimeout(timeoutId);
|
|
941
|
+
timeoutId = undefined;
|
|
942
|
+
}
|
|
925
943
|
if (result.error) {
|
|
926
944
|
this.pushEnvEvent({
|
|
927
945
|
type: "agent.error",
|
|
@@ -148,7 +148,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
148
148
|
llmComponent: this._workflowEnv?.getComponent("llm")
|
|
149
149
|
});
|
|
150
150
|
registerDecoratorNodeType2(registry);
|
|
151
|
-
const engine = new WorkflowEngine(registry);
|
|
151
|
+
const engine = new WorkflowEngine(registry, this.sessionComponent);
|
|
152
152
|
return engine.runWorkflow(definition, { ...options, input });
|
|
153
153
|
}
|
|
154
154
|
async onStop() {
|