@securecoms/agent-runtime 0.9.4 → 0.9.5
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/bin.js +7 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -4531,7 +4531,8 @@ ${recalledText}` } : null;
|
|
|
4531
4531
|
const history = memory.getHistory();
|
|
4532
4532
|
const user = { role: "user", content: text };
|
|
4533
4533
|
const toolsStart = clock();
|
|
4534
|
-
const
|
|
4534
|
+
const eligibleTools = deps.tools();
|
|
4535
|
+
const tools = eligibleTools.filter((tool) => toolIsOffered(m.authorization, tool.function.name));
|
|
4535
4536
|
const offeredNames = new Set(tools.map((tool) => tool.function.name));
|
|
4536
4537
|
const toolsBytes = tools.length > 0 ? jsonBytes(tools) + 1 : 0;
|
|
4537
4538
|
const budgetBytes = requestMaxBytes - REQUEST_ENVELOPE_RESERVE_BYTES - toolsBytes;
|
|
@@ -4621,6 +4622,11 @@ ${recalledText}` } : null;
|
|
|
4621
4622
|
history_dropped: historyStart,
|
|
4622
4623
|
recalled: keepRecalled,
|
|
4623
4624
|
tools_offered: tools.length,
|
|
4625
|
+
// Counts only: the tools this runtime loaded, and the grants the bridge
|
|
4626
|
+
// sent. tools_offered=0 with grants=0 points at the bridge decision;
|
|
4627
|
+
// with grants>0 it points at the runtime intersection.
|
|
4628
|
+
tools_eligible: eligibleTools.length,
|
|
4629
|
+
grants: m.authorization.tool_grants.length,
|
|
4624
4630
|
prompt_bytes: promptBytes()
|
|
4625
4631
|
});
|
|
4626
4632
|
let toolResultBytes = 0;
|