agentgui 1.0.683 → 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 +1 -0
- package/lib/ws-handlers-conv.js +7 -3
- package/package.json +1 -1
package/lib/claude-runner.js
CHANGED
|
@@ -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) {
|
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;
|