agentgui 1.0.703 → 1.0.704
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/index.html +21 -0
- package/static/js/streaming-renderer.js +30 -3
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -2356,6 +2356,27 @@
|
|
|
2356
2356
|
color: #4ade80;
|
|
2357
2357
|
}
|
|
2358
2358
|
|
|
2359
|
+
/* --- Tool Result Inlined into Tool Use --- */
|
|
2360
|
+
.folded-tool-status {
|
|
2361
|
+
display: flex;
|
|
2362
|
+
align-items: center;
|
|
2363
|
+
flex-shrink: 0;
|
|
2364
|
+
margin-left: auto;
|
|
2365
|
+
width: 1rem;
|
|
2366
|
+
height: 1rem;
|
|
2367
|
+
}
|
|
2368
|
+
.folded-tool-status svg { width: 1rem; height: 1rem; }
|
|
2369
|
+
.block-tool-use.tool-result-success .folded-tool-status { color: #16a34a; }
|
|
2370
|
+
html.dark .block-tool-use.tool-result-success .folded-tool-status { color: #4ade80; }
|
|
2371
|
+
.block-tool-use.tool-result-error .folded-tool-status { color: #ef4444; }
|
|
2372
|
+
html.dark .block-tool-use.tool-result-error .folded-tool-status { color: #f87171; }
|
|
2373
|
+
.folded-tool-result-content {
|
|
2374
|
+
border-top: 1px solid #e5e7eb;
|
|
2375
|
+
padding-top: 0.5rem;
|
|
2376
|
+
margin-top: 0.5rem;
|
|
2377
|
+
}
|
|
2378
|
+
html.dark .folded-tool-result-content { border-top-color: #374151; }
|
|
2379
|
+
|
|
2359
2380
|
/* --- Consecutive Block Joining --- */
|
|
2360
2381
|
.streaming-blocks > * + *,
|
|
2361
2382
|
.message-blocks > * + * {
|
|
@@ -1239,7 +1239,6 @@ class StreamingRenderer {
|
|
|
1239
1239
|
* Render tool result as inline content to be merged into preceding tool_use block
|
|
1240
1240
|
*/
|
|
1241
1241
|
renderBlockToolResult(block, context) {
|
|
1242
|
-
const isError = block.is_error || false;
|
|
1243
1242
|
const content = block.content || '';
|
|
1244
1243
|
const toolName = block.tool_name || block.name || '';
|
|
1245
1244
|
|
|
@@ -1248,6 +1247,7 @@ class StreamingRenderer {
|
|
|
1248
1247
|
}
|
|
1249
1248
|
|
|
1250
1249
|
const contentStr = typeof content === 'string' ? content : JSON.stringify(content, null, 2);
|
|
1250
|
+
const isError = (block.is_error || false) && !contentStr.trimStart().startsWith('exec ran successfully.');
|
|
1251
1251
|
|
|
1252
1252
|
const details = document.createElement('details');
|
|
1253
1253
|
details.className = 'folded-tool' + (isError ? ' folded-tool-error' : ' folded-tool-success');
|
|
@@ -2088,8 +2088,35 @@ class StreamingRenderer {
|
|
|
2088
2088
|
const toolUseBlock = Array.from(toolUseBlocks).find(b => b.dataset.toolUseId === toolUseId);
|
|
2089
2089
|
|
|
2090
2090
|
if (toolUseBlock && toolUseBlock.parentElement === resultBlock.parentElement) {
|
|
2091
|
-
|
|
2092
|
-
toolUseBlock.
|
|
2091
|
+
const isError = resultBlock.classList.contains('folded-tool-error');
|
|
2092
|
+
const toolUseSummary = toolUseBlock.querySelector(':scope > summary');
|
|
2093
|
+
|
|
2094
|
+
if (toolUseSummary && !toolUseSummary.querySelector('.folded-tool-status')) {
|
|
2095
|
+
const statusSvg = isError
|
|
2096
|
+
? '<svg viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>'
|
|
2097
|
+
: '<svg viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>';
|
|
2098
|
+
const statusSpan = document.createElement('span');
|
|
2099
|
+
statusSpan.className = 'folded-tool-status';
|
|
2100
|
+
statusSpan.innerHTML = statusSvg;
|
|
2101
|
+
toolUseSummary.appendChild(statusSpan);
|
|
2102
|
+
toolUseBlock.classList.add(isError ? 'tool-result-error' : 'tool-result-success');
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
const resultBody = resultBlock.querySelector('.folded-tool-body');
|
|
2106
|
+
if (resultBody && resultBody.innerHTML.trim()) {
|
|
2107
|
+
let toolUseBody = toolUseBlock.querySelector(':scope > .folded-tool-body');
|
|
2108
|
+
if (!toolUseBody) {
|
|
2109
|
+
toolUseBody = document.createElement('div');
|
|
2110
|
+
toolUseBody.className = 'folded-tool-body';
|
|
2111
|
+
toolUseBlock.appendChild(toolUseBody);
|
|
2112
|
+
}
|
|
2113
|
+
const resultContent = document.createElement('div');
|
|
2114
|
+
resultContent.className = 'folded-tool-result-content';
|
|
2115
|
+
resultContent.innerHTML = resultBody.innerHTML;
|
|
2116
|
+
toolUseBody.appendChild(resultContent);
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
resultBlock.remove();
|
|
2093
2120
|
}
|
|
2094
2121
|
});
|
|
2095
2122
|
}
|