@rowan-agent/agent 0.20.1 → 0.20.2
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/index.js +2 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1378,46 +1378,11 @@ var LoopGuard = {
|
|
|
1378
1378
|
// src/loop/stream-collector.ts
|
|
1379
1379
|
var MAX_STREAMED_OUTPUT_CHARACTERS = 1024 * 1024;
|
|
1380
1380
|
async function invokeModel(input) {
|
|
1381
|
-
const baseContext = input.callContext ?? {
|
|
1382
|
-
signal: input.config.signal ?? new AbortController().signal,
|
|
1383
|
-
run: {
|
|
1384
|
-
id: input.config.execution.runId,
|
|
1385
|
-
agentId: input.config.execution.agentId,
|
|
1386
|
-
scope: input.config.execution.scope ?? [],
|
|
1387
|
-
cwd: input.config.execution.cwd ?? input.config.context.cwd ?? ""
|
|
1388
|
-
},
|
|
1389
|
-
interact: async (request) => {
|
|
1390
|
-
const handler = input.config.runtime?.interact ?? input.config.interact;
|
|
1391
|
-
if (!handler) {
|
|
1392
|
-
throw new Error("Run interactions are not supported in this runtime.");
|
|
1393
|
-
}
|
|
1394
|
-
return handler(request);
|
|
1395
|
-
},
|
|
1396
|
-
tools: {
|
|
1397
|
-
list: () => {
|
|
1398
|
-
return input.config.context.tools.map((t) => ({
|
|
1399
|
-
name: t.name,
|
|
1400
|
-
description: t.description,
|
|
1401
|
-
parameters: t.parameters,
|
|
1402
|
-
...t._meta !== void 0 ? { _meta: t._meta } : {}
|
|
1403
|
-
}));
|
|
1404
|
-
},
|
|
1405
|
-
call: async (_name, _args, _options) => {
|
|
1406
|
-
throw new Error("Tool calling is not available in standalone stream collector without callContext.");
|
|
1407
|
-
},
|
|
1408
|
-
report: (update) => {
|
|
1409
|
-
input.config.onToolReport?.({
|
|
1410
|
-
runId: input.config.execution.runId,
|
|
1411
|
-
update
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
1381
|
const position = { contentIndex: 0 };
|
|
1417
1382
|
const callContext = {
|
|
1418
|
-
...
|
|
1383
|
+
...input.callContext,
|
|
1419
1384
|
tools: {
|
|
1420
|
-
...
|
|
1385
|
+
...input.callContext.tools,
|
|
1421
1386
|
report: (update) => {
|
|
1422
1387
|
input.config.onToolReport?.({
|
|
1423
1388
|
runId: input.config.execution.runId,
|
|
@@ -3796,12 +3761,6 @@ function createPhaseExecution(config, state, phase, messageManager, toolExecutio
|
|
|
3796
3761
|
};
|
|
3797
3762
|
const res = await executePhaseTool(phaseContext, toolCall, options2, true);
|
|
3798
3763
|
return res.ok ? { ok: true, content: res.content } : { ok: false, error: res.error ?? "Tool execution failed", ...res.content !== void 0 ? { content: res.content } : {} };
|
|
3799
|
-
},
|
|
3800
|
-
report: (update) => {
|
|
3801
|
-
config.onToolReport?.({
|
|
3802
|
-
runId: config.execution.runId,
|
|
3803
|
-
update
|
|
3804
|
-
});
|
|
3805
3764
|
}
|
|
3806
3765
|
}
|
|
3807
3766
|
};
|