agentgui 1.0.117 → 1.0.118
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/static/app.js +22 -7
package/package.json
CHANGED
package/static/app.js
CHANGED
|
@@ -203,9 +203,14 @@ class GMGUIApp {
|
|
|
203
203
|
throw new Error('Not a claude_execution message');
|
|
204
204
|
}
|
|
205
205
|
} catch (e) {
|
|
206
|
-
// Fallback: render as plain text
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
// Fallback: try to parse and beautify, or render as plain text
|
|
207
|
+
try {
|
|
208
|
+
const parsed = typeof message.content === 'string' ? JSON.parse(message.content) : message.content;
|
|
209
|
+
contentHtml = `<div class="message-content">${this.renderParameters(parsed)}</div>`;
|
|
210
|
+
} catch (parseErr) {
|
|
211
|
+
const text = typeof message.content === 'string' ? message.content : JSON.stringify(message.content);
|
|
212
|
+
contentHtml = `<div class="message-content"><pre>${this.escapeHtml(text)}</pre></div>`;
|
|
213
|
+
}
|
|
209
214
|
}
|
|
210
215
|
|
|
211
216
|
msgEl.innerHTML = contentHtml;
|
|
@@ -241,7 +246,12 @@ class GMGUIApp {
|
|
|
241
246
|
html += `<strong>Result:</strong>`;
|
|
242
247
|
let resultHtml;
|
|
243
248
|
if (typeof block.result === 'string') {
|
|
244
|
-
|
|
249
|
+
try {
|
|
250
|
+
const parsed = JSON.parse(block.result);
|
|
251
|
+
resultHtml = this.renderParameters(parsed);
|
|
252
|
+
} catch (e) {
|
|
253
|
+
resultHtml = `<pre>${this.escapeHtml(block.result)}</pre>`;
|
|
254
|
+
}
|
|
245
255
|
} else {
|
|
246
256
|
resultHtml = this.renderParameters(block.result);
|
|
247
257
|
}
|
|
@@ -358,9 +368,14 @@ class GMGUIApp {
|
|
|
358
368
|
throw new Error('Not a claude_execution message');
|
|
359
369
|
}
|
|
360
370
|
} catch (e) {
|
|
361
|
-
// Fallback: render as plain text
|
|
362
|
-
|
|
363
|
-
|
|
371
|
+
// Fallback: try to parse and beautify, or render as plain text
|
|
372
|
+
try {
|
|
373
|
+
const parsed = typeof msg.content === 'string' ? JSON.parse(msg.content) : msg.content;
|
|
374
|
+
contentHtml = `<div class="message-content">${this.renderParameters(parsed)}</div>`;
|
|
375
|
+
} catch (parseErr) {
|
|
376
|
+
const text = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
|
|
377
|
+
contentHtml = `<div class="message-content"><pre>${this.escapeHtml(text)}</pre></div>`;
|
|
378
|
+
}
|
|
364
379
|
}
|
|
365
380
|
|
|
366
381
|
msgEl.innerHTML = contentHtml;
|