agentgui 1.0.120 → 1.0.121
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 -2
- package/package.json +1 -1
- package/server.js +4 -6
- package/static/js/client.js +1 -1
package/lib/claude-runner.js
CHANGED
|
@@ -3,7 +3,6 @@ import { spawn } from 'child_process';
|
|
|
3
3
|
export async function runClaudeWithStreaming(prompt, cwd, agentId = 'claude-code', config = {}) {
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
5
5
|
const {
|
|
6
|
-
skipPermissions = false,
|
|
7
6
|
verbose = true,
|
|
8
7
|
outputFormat = 'stream-json',
|
|
9
8
|
timeout = 300000,
|
|
@@ -17,7 +16,7 @@ export async function runClaudeWithStreaming(prompt, cwd, agentId = 'claude-code
|
|
|
17
16
|
if (print) flags.push('--print');
|
|
18
17
|
if (verbose) flags.push('--verbose');
|
|
19
18
|
flags.push(`--output-format=${outputFormat}`);
|
|
20
|
-
|
|
19
|
+
flags.push('--dangerously-skip-permissions');
|
|
21
20
|
if (resumeSessionId) flags.push('--resume', resumeSessionId);
|
|
22
21
|
if (systemPrompt) flags.push('--append-system-prompt', systemPrompt);
|
|
23
22
|
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -243,7 +243,6 @@ const server = http.createServer(async (req, res) => {
|
|
|
243
243
|
|
|
244
244
|
const prompt = body.content || '';
|
|
245
245
|
const agentId = body.agentId || 'claude-code';
|
|
246
|
-
const skipPermissions = body.skipPermissions || false;
|
|
247
246
|
|
|
248
247
|
const userMessage = queries.createMessage(conversationId, 'user', prompt);
|
|
249
248
|
queries.createEvent('message.created', { role: 'user', messageId: userMessage.id }, conversationId);
|
|
@@ -253,7 +252,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
253
252
|
if (activeExecutions.has(conversationId)) {
|
|
254
253
|
debugLog(`[stream] Conversation ${conversationId} is busy, queuing message`);
|
|
255
254
|
if (!messageQueues.has(conversationId)) messageQueues.set(conversationId, []);
|
|
256
|
-
messageQueues.get(conversationId).push({ content: prompt, agentId,
|
|
255
|
+
messageQueues.get(conversationId).push({ content: prompt, agentId, messageId: userMessage.id });
|
|
257
256
|
|
|
258
257
|
const queueLength = messageQueues.get(conversationId).length;
|
|
259
258
|
broadcastSync({ type: 'queue_status', conversationId, queueLength, messageId: userMessage.id, timestamp: Date.now() });
|
|
@@ -278,7 +277,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
278
277
|
timestamp: Date.now()
|
|
279
278
|
});
|
|
280
279
|
|
|
281
|
-
processMessageWithStreaming(conversationId, userMessage.id, session.id, prompt, agentId
|
|
280
|
+
processMessageWithStreaming(conversationId, userMessage.id, session.id, prompt, agentId)
|
|
282
281
|
.catch(err => debugLog(`[stream] Uncaught error: ${err.message}`));
|
|
283
282
|
return;
|
|
284
283
|
}
|
|
@@ -533,7 +532,7 @@ function persistChunkWithRetry(sessionId, conversationId, sequence, blockType, b
|
|
|
533
532
|
return null;
|
|
534
533
|
}
|
|
535
534
|
|
|
536
|
-
async function processMessageWithStreaming(conversationId, messageId, sessionId, content, agentId
|
|
535
|
+
async function processMessageWithStreaming(conversationId, messageId, sessionId, content, agentId) {
|
|
537
536
|
const startTime = Date.now();
|
|
538
537
|
activeExecutions.set(conversationId, true);
|
|
539
538
|
queries.setIsStreaming(conversationId, true);
|
|
@@ -644,7 +643,6 @@ async function processMessageWithStreaming(conversationId, messageId, sessionId,
|
|
|
644
643
|
};
|
|
645
644
|
|
|
646
645
|
const config = {
|
|
647
|
-
skipPermissions,
|
|
648
646
|
verbose: true,
|
|
649
647
|
outputFormat: 'stream-json',
|
|
650
648
|
timeout: 1800000,
|
|
@@ -726,7 +724,7 @@ function drainMessageQueue(conversationId) {
|
|
|
726
724
|
timestamp: Date.now()
|
|
727
725
|
});
|
|
728
726
|
|
|
729
|
-
processMessageWithStreaming(conversationId, next.messageId, session.id, next.content, next.agentId
|
|
727
|
+
processMessageWithStreaming(conversationId, next.messageId, session.id, next.content, next.agentId)
|
|
730
728
|
.catch(err => debugLog(`[queue] Error processing queued message: ${err.message}`));
|
|
731
729
|
}
|
|
732
730
|
|
package/static/js/client.js
CHANGED
|
@@ -780,7 +780,7 @@ class AgentGUIClient {
|
|
|
780
780
|
const response = await fetch(`${window.__BASE_URL}/api/conversations/${conversationId}/stream`, {
|
|
781
781
|
method: 'POST',
|
|
782
782
|
headers: { 'Content-Type': 'application/json' },
|
|
783
|
-
body: JSON.stringify({ content: prompt, agentId
|
|
783
|
+
body: JSON.stringify({ content: prompt, agentId })
|
|
784
784
|
});
|
|
785
785
|
|
|
786
786
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|