@ai-setting/roy-agent-core 1.6.23 → 1.6.24
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
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
AgentComponent,
|
|
3
3
|
AgentComponentConfigSchema,
|
|
4
4
|
SummaryAgent
|
|
5
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../shared/@ai-setting/roy-agent-core-czjrn8wy.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-c1stgqnw.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-h28gcd77.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-br7dmedr.js";
|
package/dist/env/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
41
41
|
import {
|
|
42
42
|
AgentComponent,
|
|
43
43
|
AgentComponentConfigSchema
|
|
44
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
44
|
+
} from "../shared/@ai-setting/roy-agent-core-czjrn8wy.js";
|
|
45
45
|
import"../shared/@ai-setting/roy-agent-core-c1stgqnw.js";
|
|
46
46
|
import"../shared/@ai-setting/roy-agent-core-h28gcd77.js";
|
|
47
47
|
import"../shared/@ai-setting/roy-agent-core-br7dmedr.js";
|
package/dist/index.js
CHANGED
|
@@ -131,7 +131,7 @@ import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
131
131
|
import {
|
|
132
132
|
AgentComponent,
|
|
133
133
|
AgentComponentConfigSchema
|
|
134
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
134
|
+
} from "./shared/@ai-setting/roy-agent-core-czjrn8wy.js";
|
|
135
135
|
import {
|
|
136
136
|
createInvokeConfig,
|
|
137
137
|
invoke,
|
|
@@ -1060,6 +1060,13 @@ class AgentComponent extends BaseComponent {
|
|
|
1060
1060
|
const toolResult = await this.executeTool(hookCtx);
|
|
1061
1061
|
hookCtx.toolResult = toolResult;
|
|
1062
1062
|
await this.executePluginHooks(agent, "agent:after.tool", hookCtx);
|
|
1063
|
+
{
|
|
1064
|
+
const captured = this.consumeMetaProtocolUserMessage(hookCtx);
|
|
1065
|
+
if (captured) {
|
|
1066
|
+
pendingFakeUserMessage = captured;
|
|
1067
|
+
logger2.debug(`[ReAct] Meta-protocol: captured user message (tool=${toolResult.name}, iter=${iteration}); will flush after loop`);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1063
1070
|
if (hookCtx._stopped) {
|
|
1064
1071
|
this.addRemainingToolResults(hookCtx, iterAllToolCalls, iterProcessedCount + 1, "Execution aborted by plugin hook");
|
|
1065
1072
|
break;
|
|
@@ -1076,13 +1083,6 @@ class AgentComponent extends BaseComponent {
|
|
|
1076
1083
|
output: toolOutput
|
|
1077
1084
|
}]
|
|
1078
1085
|
});
|
|
1079
|
-
{
|
|
1080
|
-
const captured = this.consumeMetaProtocolUserMessage(hookCtx);
|
|
1081
|
-
if (captured) {
|
|
1082
|
-
pendingFakeUserMessage = captured;
|
|
1083
|
-
logger2.debug(`[ReAct] Meta-protocol: captured user message (tool=${toolResult.name}, iter=${iteration}); will flush after loop`);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
1086
|
result.toolCalls.push(hookCtx.currentToolCall);
|
|
1087
1087
|
iterProcessedCount++;
|
|
1088
1088
|
}
|
|
@@ -1328,17 +1328,6 @@ class AgentComponent extends BaseComponent {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
logger2.info(`All agents aborted (${this.abortControllers.size} runs)`);
|
|
1330
1330
|
}
|
|
1331
|
-
async _buildAdditionInfo(ctx) {
|
|
1332
|
-
let additionInfo = ctx.context?.additionInfo || "";
|
|
1333
|
-
const currentTaskId = getCurrentTaskId();
|
|
1334
|
-
if (currentTaskId !== undefined) {
|
|
1335
|
-
const taskInfo = `[当前 Task #${currentTaskId}] 提醒:当前正在处理 Task #${currentTaskId},可通过 task_get #${currentTaskId} 查看任务详情,通过 task_operation_list 查看操作记录。`;
|
|
1336
|
-
additionInfo = additionInfo ? `${additionInfo}
|
|
1337
|
-
|
|
1338
|
-
${taskInfo}` : taskInfo;
|
|
1339
|
-
}
|
|
1340
|
-
return additionInfo;
|
|
1341
|
-
}
|
|
1342
1331
|
async buildMessages(ctx) {
|
|
1343
1332
|
const messages = [];
|
|
1344
1333
|
if (ctx.systemPrompt) {
|
|
@@ -1347,14 +1336,6 @@ ${taskInfo}` : taskInfo;
|
|
|
1347
1336
|
content: ctx.systemPrompt
|
|
1348
1337
|
});
|
|
1349
1338
|
}
|
|
1350
|
-
const additionInfo = await this._buildAdditionInfo(ctx);
|
|
1351
|
-
if (additionInfo) {
|
|
1352
|
-
messages.push({
|
|
1353
|
-
role: "user",
|
|
1354
|
-
content: `额外信息:
|
|
1355
|
-
${additionInfo}`
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
1339
|
messages.push(...ctx.messages);
|
|
1359
1340
|
return messages;
|
|
1360
1341
|
}
|
|
@@ -1696,9 +1677,6 @@ __legacyDecorateClassTS([
|
|
|
1696
1677
|
__legacyDecorateClassTS([
|
|
1697
1678
|
TracedAs("agent.component.run", { recordParams: true, recordResult: true, log: true })
|
|
1698
1679
|
], AgentComponent.prototype, "_run", null);
|
|
1699
|
-
__legacyDecorateClassTS([
|
|
1700
|
-
TracedAs("agent.component.buildAdditionInfo", { recordParams: true, recordResult: true, log: true })
|
|
1701
|
-
], AgentComponent.prototype, "_buildAdditionInfo", null);
|
|
1702
1680
|
__legacyDecorateClassTS([
|
|
1703
1681
|
TracedAs("agent.component.invokeLLM", { recordParams: true, recordResult: true, log: true })
|
|
1704
1682
|
], AgentComponent.prototype, "invokeLLM", null);
|