agentgui 1.0.682 → 1.0.684
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/lib/claude-runner.js
CHANGED
|
@@ -130,7 +130,7 @@ class AgentRunner {
|
|
|
130
130
|
|
|
131
131
|
// Write prompt to stdin only for agents that use stdin protocol (not positional args)
|
|
132
132
|
if (this.supportsStdin && this.stdinPrompt) {
|
|
133
|
-
proc.stdin.write(prompt);
|
|
133
|
+
proc.stdin.write(typeof prompt === 'string' ? prompt : String(prompt));
|
|
134
134
|
// Don't call stdin.end() - agents need open stdin for steering
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -646,7 +646,7 @@ registry.register({
|
|
|
646
646
|
if (resumeSessionId) flags.push('--resume', resumeSessionId);
|
|
647
647
|
if (systemPrompt) flags.push('--append-system-prompt', systemPrompt);
|
|
648
648
|
flags.push('--dangerously-skip-permissions');
|
|
649
|
-
flags.push(prompt); // positional arg - stdin stays open separately for steering
|
|
649
|
+
flags.push(typeof prompt === 'string' ? prompt : String(prompt)); // positional arg - stdin stays open separately for steering
|
|
650
650
|
|
|
651
651
|
return flags;
|
|
652
652
|
},
|
|
@@ -1202,6 +1202,7 @@ registry.register({
|
|
|
1202
1202
|
* Main export function - runs any registered agent
|
|
1203
1203
|
*/
|
|
1204
1204
|
export async function runClaudeWithStreaming(prompt, cwd, agentId = 'claude-code', config = {}) {
|
|
1205
|
+
prompt = typeof prompt === 'string' ? prompt : (prompt ? JSON.stringify(prompt) : '');
|
|
1205
1206
|
const agent = registry.get(agentId);
|
|
1206
1207
|
|
|
1207
1208
|
if (!agent) {
|
|
@@ -1215,27 +1216,10 @@ export async function runClaudeWithStreaming(prompt, cwd, agentId = 'claude-code
|
|
|
1215
1216
|
|
|
1216
1217
|
// Append communication guidelines for all agents
|
|
1217
1218
|
const communicationGuidelines = `
|
|
1218
|
-
|
|
1219
|
-
- Critical errors that block work
|
|
1220
|
-
- User needs to know info (e.g., "port in use", "authentication failed", "file not found")
|
|
1221
|
-
- Action required from user
|
|
1222
|
-
- Important decisions that affect their work
|
|
1223
|
-
|
|
1224
|
-
DO NOT output:
|
|
1225
|
-
- Progress updates ("doing X now", "completed Y", "searching for...")
|
|
1226
|
-
- Verbose summaries of what was done
|
|
1227
|
-
- Status checks or verification messages
|
|
1228
|
-
- Detailed explanations unless asked
|
|
1229
|
-
- "Working on...", "Looking for...", step-by-step progress
|
|
1230
|
-
|
|
1231
|
-
INSTEAD:
|
|
1232
|
-
- Run tools silently
|
|
1233
|
-
- Show results only when relevant
|
|
1234
|
-
- Be conversational and direct
|
|
1235
|
-
- Let code/output speak for itself
|
|
1219
|
+
RESPONSE FORMAT: Respond in short, plain text sentences only. No markdown. No bullet points. No bold or italic text. No headers. No numbered lists. No code blocks in prose responses. Write as if speaking aloud. Keep responses concise and conversational. Only share what the user needs to know: errors, required actions, or direct answers. Do not narrate progress or summarize completed steps.
|
|
1236
1220
|
`;
|
|
1237
1221
|
|
|
1238
|
-
if (!enhancedConfig.systemPrompt.includes('
|
|
1222
|
+
if (!enhancedConfig.systemPrompt.includes('RESPONSE FORMAT')) {
|
|
1239
1223
|
enhancedConfig.systemPrompt = communicationGuidelines + enhancedConfig.systemPrompt;
|
|
1240
1224
|
}
|
|
1241
1225
|
|
package/lib/ws-handlers-conv.js
CHANGED
|
@@ -152,10 +152,11 @@ export function register(router, deps) {
|
|
|
152
152
|
const agentId = conv.agentType || conv.agentId || 'claude-code';
|
|
153
153
|
const model = conv.model || null;
|
|
154
154
|
const subAgent = conv.subAgent || null;
|
|
155
|
-
const
|
|
155
|
+
const steerContent = typeof p.content === 'string' ? p.content : (p.content ? JSON.stringify(p.content) : '');
|
|
156
|
+
const message = queries.createMessage(p.id, 'user', steerContent);
|
|
156
157
|
queries.createEvent('message.created', { role: 'user', messageId: message.id }, p.id);
|
|
157
158
|
broadcastSync({ type: 'message_created', conversationId: p.id, message, timestamp: Date.now() });
|
|
158
|
-
startExecution(p.id, message, agentId, model,
|
|
159
|
+
startExecution(p.id, message, agentId, model, steerContent, subAgent);
|
|
159
160
|
|
|
160
161
|
return { ok: true, steered: true, conversationId: p.id, messageId: message.id };
|
|
161
162
|
});
|
|
@@ -197,6 +198,8 @@ export function register(router, deps) {
|
|
|
197
198
|
const model = p.model || conv.model || null;
|
|
198
199
|
const subAgent = p.subAgent || conv.subAgent || null;
|
|
199
200
|
const idempotencyKey = p.idempotencyKey || null;
|
|
201
|
+
const rawContent = p.content;
|
|
202
|
+
p.content = typeof rawContent === 'string' ? rawContent : (rawContent ? JSON.stringify(rawContent) : '');
|
|
200
203
|
const message = queries.createMessage(p.id, 'user', p.content, idempotencyKey);
|
|
201
204
|
queries.createEvent('message.created', { role: 'user', messageId: message.id }, p.id);
|
|
202
205
|
|
|
@@ -221,7 +224,8 @@ export function register(router, deps) {
|
|
|
221
224
|
router.handle('msg.stream', (p) => {
|
|
222
225
|
const conv = queries.getConversation(p.id);
|
|
223
226
|
if (!conv) notFound('Conversation not found');
|
|
224
|
-
const
|
|
227
|
+
const rawContent = p.content || p.message;
|
|
228
|
+
const prompt = typeof rawContent === 'string' ? rawContent : (rawContent ? JSON.stringify(rawContent) : '');
|
|
225
229
|
const agentId = p.agentId || conv.agentType || conv.agentId || 'claude-code';
|
|
226
230
|
const model = p.model || conv.model || null;
|
|
227
231
|
const subAgent = p.subAgent || conv.subAgent || null;
|