agentgui 1.0.683 → 1.0.685
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/static/index.html +10 -4
- package/static/js/codec.js +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;
|
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -3233,13 +3233,19 @@
|
|
|
3233
3233
|
</button>
|
|
3234
3234
|
</div>
|
|
3235
3235
|
<button class="inject-btn" id="injectBtn" title="Steer or inject into running agent" aria-label="Steer/Inject">
|
|
3236
|
-
<svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
|
|
3237
|
-
<
|
|
3236
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18">
|
|
3237
|
+
<polyline points="23 4 23 10 17 10"></polyline>
|
|
3238
|
+
<path d="M20.49 15a9 9 0 1 1 .12-14.85"></path>
|
|
3238
3239
|
</svg>
|
|
3239
3240
|
</button>
|
|
3240
3241
|
<button class="queue-btn" id="queueBtn" title="Queue message for running agent" aria-label="Queue message">
|
|
3241
|
-
<svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
|
|
3242
|
-
<
|
|
3242
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18">
|
|
3243
|
+
<line x1="8" y1="6" x2="21" y2="6"></line>
|
|
3244
|
+
<line x1="8" y1="12" x2="21" y2="12"></line>
|
|
3245
|
+
<line x1="8" y1="18" x2="21" y2="18"></line>
|
|
3246
|
+
<line x1="3" y1="6" x2="3.01" y2="6"></line>
|
|
3247
|
+
<line x1="3" y1="12" x2="3.01" y2="12"></line>
|
|
3248
|
+
<line x1="3" y1="18" x2="3.01" y2="18"></line>
|
|
3243
3249
|
</svg>
|
|
3244
3250
|
</button>
|
|
3245
3251
|
<button class="stop-btn" id="stopBtn" title="Stop running agent (emergency)" aria-label="Stop agent">
|
package/static/js/codec.js
CHANGED
|
@@ -43,5 +43,5 @@ function decodeObj(obj) {
|
|
|
43
43
|
return out;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function encode(obj) { return msgpackr.pack(
|
|
46
|
+
export function encode(obj) { return msgpackr.pack(obj); }
|
|
47
47
|
export function decode(buf) { return decodeObj(msgpackr.unpack(new Uint8Array(buf instanceof ArrayBuffer ? buf : buf))); }
|