@securecoms/agent-runtime 0.9.5 → 0.9.6
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 +9 -7
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -4095,7 +4095,10 @@ async function runToolCalls(toolCalls, skills, context) {
|
|
|
4095
4095
|
}
|
|
4096
4096
|
|
|
4097
4097
|
// src/turn-loop.ts
|
|
4098
|
-
var VOICE_TURN_PREFIX = "This message was spoken on a live voice call and your reply will be read aloud: plain spoken sentences, no markdown, lists, links or code. Use your tools as usual when the question needs them. ";
|
|
4098
|
+
var VOICE_TURN_PREFIX = "This message was spoken on a live voice call and your final reply will be read aloud: plain spoken sentences, no markdown, lists, links or code. Use your tools as usual when the question needs them; the reply guidance that follows applies to your final reply after any tool calls, never as a reason to answer without a tool. ";
|
|
4099
|
+
function toolAvailabilityLine(names) {
|
|
4100
|
+
return `You can use: ${names.join(", ")}. Use them whenever the question needs live data; earlier messages saying you could not are outdated.`;
|
|
4101
|
+
}
|
|
4099
4102
|
var DEFAULT_SYSTEM_PROMPT = "You are a SecureComs agent working inside a private, end-to-end encrypted messaging enclave for one business; the people you talk to are its staff, partners and customers. Answer questions in the chat, and keep replies to the length the question needs.";
|
|
4100
4103
|
var DEFAULT_MAX_ITERATIONS = 5;
|
|
4101
4104
|
var DEFAULT_MAX_CONCURRENT_TURNS = 4;
|
|
@@ -4517,12 +4520,7 @@ function buildHandler(deps) {
|
|
|
4517
4520
|
const memory = memoryFor(m.channelId);
|
|
4518
4521
|
memory.replace(m.memory);
|
|
4519
4522
|
const promptStart = clock();
|
|
4520
|
-
const
|
|
4521
|
-
role: "system",
|
|
4522
|
-
content: m.voiceGuidance ? `${deps.systemPromptFor()}
|
|
4523
|
-
|
|
4524
|
-
${VOICE_TURN_PREFIX}${m.voiceGuidance}` : deps.systemPromptFor()
|
|
4525
|
-
};
|
|
4523
|
+
const persona = deps.systemPromptFor();
|
|
4526
4524
|
const recallStart = clock();
|
|
4527
4525
|
const recalledText = await memory.recall(text);
|
|
4528
4526
|
live();
|
|
@@ -4534,6 +4532,10 @@ ${recalledText}` } : null;
|
|
|
4534
4532
|
const eligibleTools = deps.tools();
|
|
4535
4533
|
const tools = eligibleTools.filter((tool) => toolIsOffered(m.authorization, tool.function.name));
|
|
4536
4534
|
const offeredNames = new Set(tools.map((tool) => tool.function.name));
|
|
4535
|
+
const systemParts = [persona];
|
|
4536
|
+
if (m.voiceGuidance) systemParts.push(`${VOICE_TURN_PREFIX}${m.voiceGuidance}`);
|
|
4537
|
+
if (tools.length > 0) systemParts.push(toolAvailabilityLine([...offeredNames]));
|
|
4538
|
+
const system = { role: "system", content: systemParts.join("\n\n") };
|
|
4537
4539
|
const toolsBytes = tools.length > 0 ? jsonBytes(tools) + 1 : 0;
|
|
4538
4540
|
const budgetBytes = requestMaxBytes - REQUEST_ENVELOPE_RESERVE_BYTES - toolsBytes;
|
|
4539
4541
|
const historyBytes = history.map(messageBytes);
|