agentgui 1.0.505 → 1.0.506
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/package.json +1 -1
- package/server.js +18 -2
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -268,7 +268,22 @@ function pushTTSAudio(cacheKey, wav, conversationId, sessionId, voiceId) {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
|
|
271
|
-
const
|
|
271
|
+
const VOICE_INSTRUCTIONS = `Plain text. Spoken aloud. Conversational. No markdown, formatting, bullets, or lists. Short sentences. Technical facts only.`;
|
|
272
|
+
|
|
273
|
+
function buildSystemPrompt(agentId, model, subAgent) {
|
|
274
|
+
const parts = [VOICE_INSTRUCTIONS];
|
|
275
|
+
if (agentId && agentId !== 'claude-code') {
|
|
276
|
+
const displayAgentId = agentId.split('-·-')[0];
|
|
277
|
+
parts.push(`Use ${displayAgentId} subagent for all tasks.`);
|
|
278
|
+
}
|
|
279
|
+
if (model) {
|
|
280
|
+
parts.push(`Model: ${model}.`);
|
|
281
|
+
}
|
|
282
|
+
if (subAgent) {
|
|
283
|
+
parts.push(`Subagent: ${subAgent}.`);
|
|
284
|
+
}
|
|
285
|
+
return parts.join(' ');
|
|
286
|
+
}
|
|
272
287
|
|
|
273
288
|
const activeExecutions = new Map();
|
|
274
289
|
const activeScripts = new Map();
|
|
@@ -3728,13 +3743,14 @@ async function processMessageWithStreaming(conversationId, messageId, sessionId,
|
|
|
3728
3743
|
|
|
3729
3744
|
const resolvedModel = model || conv?.model || null;
|
|
3730
3745
|
const resolvedSubAgent = subAgent || conv?.subAgent || null;
|
|
3746
|
+
const unifiedSystemPrompt = buildSystemPrompt(agentId, resolvedModel, resolvedSubAgent);
|
|
3731
3747
|
const config = {
|
|
3732
3748
|
verbose: true,
|
|
3733
3749
|
outputFormat: 'stream-json',
|
|
3734
3750
|
timeout: 1800000,
|
|
3735
3751
|
print: true,
|
|
3736
3752
|
resumeSessionId,
|
|
3737
|
-
systemPrompt:
|
|
3753
|
+
systemPrompt: unifiedSystemPrompt,
|
|
3738
3754
|
model: resolvedModel || undefined,
|
|
3739
3755
|
subAgent: resolvedSubAgent || undefined,
|
|
3740
3756
|
onEvent,
|