agentgui 1.0.375 → 1.0.377
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 +54 -0
- package/static/js/client.js +26 -31
- package/static/js/streaming-renderer.js +11 -7
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -2033,6 +2033,60 @@
|
|
|
2033
2033
|
.tool-color-default > .folded-tool-body { border-top-color: #a5f3fc; }
|
|
2034
2034
|
html.dark .tool-color-default > .folded-tool-body { border-top-color: #164e63; }
|
|
2035
2035
|
|
|
2036
|
+
/* Execute - Purple */
|
|
2037
|
+
.tool-color-execute.folded-tool > .folded-tool-bar { background: #f3e8ff; }
|
|
2038
|
+
html.dark .tool-color-execute.folded-tool > .folded-tool-bar { background: #2d1b4e; }
|
|
2039
|
+
.tool-color-execute.folded-tool > .folded-tool-bar:hover { background: #e9d5ff; }
|
|
2040
|
+
html.dark .tool-color-execute.folded-tool > .folded-tool-bar:hover { background: #4c1d95; }
|
|
2041
|
+
.tool-color-execute.folded-tool > .folded-tool-bar::before { color: #a855f7; }
|
|
2042
|
+
html.dark .tool-color-execute.folded-tool > .folded-tool-bar::before { color: #d8b4fe; }
|
|
2043
|
+
.tool-color-execute .folded-tool-icon { color: #a855f7; }
|
|
2044
|
+
html.dark .tool-color-execute .folded-tool-icon { color: #d8b4fe; }
|
|
2045
|
+
.tool-color-execute .folded-tool-name { color: #6b21a8; }
|
|
2046
|
+
html.dark .tool-color-execute .folded-tool-name { color: #e879f9; }
|
|
2047
|
+
.tool-color-execute .folded-tool-desc { color: #7e22ce; }
|
|
2048
|
+
html.dark .tool-color-execute .folded-tool-desc { color: #d8b4fe; }
|
|
2049
|
+
.tool-color-execute { background: #faf5ff; }
|
|
2050
|
+
html.dark .tool-color-execute { background: #1a0d2e; }
|
|
2051
|
+
.tool-color-execute > .folded-tool-body { border-top-color: #e9d5ff; }
|
|
2052
|
+
html.dark .tool-color-execute > .folded-tool-body { border-top-color: #4c1d95; }
|
|
2053
|
+
|
|
2054
|
+
/* Sleep - Orange */
|
|
2055
|
+
.tool-color-sleep.folded-tool > .folded-tool-bar { background: #fed7aa; }
|
|
2056
|
+
html.dark .tool-color-sleep.folded-tool > .folded-tool-bar { background: #5a2e0f; }
|
|
2057
|
+
.tool-color-sleep.folded-tool > .folded-tool-bar:hover { background: #fdba74; }
|
|
2058
|
+
html.dark .tool-color-sleep.folded-tool > .folded-tool-bar:hover { background: #7c2d12; }
|
|
2059
|
+
.tool-color-sleep.folded-tool > .folded-tool-bar::before { color: #f97316; }
|
|
2060
|
+
html.dark .tool-color-sleep.folded-tool > .folded-tool-bar::before { color: #fb923c; }
|
|
2061
|
+
.tool-color-sleep .folded-tool-icon { color: #f97316; }
|
|
2062
|
+
html.dark .tool-color-sleep .folded-tool-icon { color: #fb923c; }
|
|
2063
|
+
.tool-color-sleep .folded-tool-name { color: #7c2d12; }
|
|
2064
|
+
html.dark .tool-color-sleep .folded-tool-name { color: #fed7aa; }
|
|
2065
|
+
.tool-color-sleep .folded-tool-desc { color: #b45309; }
|
|
2066
|
+
html.dark .tool-color-sleep .folded-tool-desc { color: #fb923c; }
|
|
2067
|
+
.tool-color-sleep { background: #fff7ed; }
|
|
2068
|
+
html.dark .tool-color-sleep { background: #1f1409; }
|
|
2069
|
+
.tool-color-sleep > .folded-tool-body { border-top-color: #fdba74; }
|
|
2070
|
+
html.dark .tool-color-sleep > .folded-tool-body { border-top-color: #7c2d12; }
|
|
2071
|
+
|
|
2072
|
+
/* Search - Green */
|
|
2073
|
+
.tool-color-search.folded-tool > .folded-tool-bar { background: #dcfce7; }
|
|
2074
|
+
html.dark .tool-color-search.folded-tool > .folded-tool-bar { background: #142e1a; }
|
|
2075
|
+
.tool-color-search.folded-tool > .folded-tool-bar:hover { background: #bbf7d0; }
|
|
2076
|
+
html.dark .tool-color-search.folded-tool > .folded-tool-bar:hover { background: #16a34a; }
|
|
2077
|
+
.tool-color-search.folded-tool > .folded-tool-bar::before { color: #16a34a; }
|
|
2078
|
+
html.dark .tool-color-search.folded-tool > .folded-tool-bar::before { color: #86efac; }
|
|
2079
|
+
.tool-color-search .folded-tool-icon { color: #16a34a; }
|
|
2080
|
+
html.dark .tool-color-search .folded-tool-icon { color: #86efac; }
|
|
2081
|
+
.tool-color-search .folded-tool-name { color: #15803d; }
|
|
2082
|
+
html.dark .tool-color-search .folded-tool-name { color: #bbf7d0; }
|
|
2083
|
+
.tool-color-search .folded-tool-desc { color: #166534; }
|
|
2084
|
+
html.dark .tool-color-search .folded-tool-desc { color: #86efac; }
|
|
2085
|
+
.tool-color-search { background: #f0fdf4; }
|
|
2086
|
+
html.dark .tool-color-search { background: #0a1c0e; }
|
|
2087
|
+
.tool-color-search > .folded-tool-body { border-top-color: #bbf7d0; }
|
|
2088
|
+
html.dark .tool-color-search > .folded-tool-body { border-top-color: #16a34a; }
|
|
2089
|
+
|
|
2036
2090
|
.block-type-tool_result { background: #f3f4f6; }
|
|
2037
2091
|
html.dark .block-type-tool_result { background: #1f2937; }
|
|
2038
2092
|
.block-type-tool_result .tool-result-status { background: #e5e7eb; }
|
package/static/js/client.js
CHANGED
|
@@ -1944,9 +1944,8 @@ class AgentGUIClient {
|
|
|
1944
1944
|
this.ui.agentSelector.disabled = true;
|
|
1945
1945
|
}
|
|
1946
1946
|
this.loadModelsForAgent(agentId).then(() => {
|
|
1947
|
-
if (this.ui.modelSelector) {
|
|
1948
|
-
|
|
1949
|
-
this.ui.modelSelector.disabled = true;
|
|
1947
|
+
if (this.ui.modelSelector && model) {
|
|
1948
|
+
this.ui.modelSelector.value = model;
|
|
1950
1949
|
}
|
|
1951
1950
|
});
|
|
1952
1951
|
}
|
|
@@ -1956,8 +1955,28 @@ class AgentGUIClient {
|
|
|
1956
1955
|
if (this.ui.agentSelector) {
|
|
1957
1956
|
this.ui.agentSelector.disabled = false;
|
|
1958
1957
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* Apply agent and model selection based on conversation state
|
|
1962
|
+
* Consolidates duplicate logic for cached and fresh conversation loads
|
|
1963
|
+
*/
|
|
1964
|
+
applyAgentAndModelSelection(conversation, hasActivity) {
|
|
1965
|
+
const agentId = conversation.agentType || 'claude-code';
|
|
1966
|
+
const model = conversation.model || null;
|
|
1967
|
+
|
|
1968
|
+
if (hasActivity) {
|
|
1969
|
+
this.lockAgentAndModel(agentId, model);
|
|
1970
|
+
} else {
|
|
1971
|
+
this.unlockAgentAndModel();
|
|
1972
|
+
if (this.ui.agentSelector) {
|
|
1973
|
+
this.ui.agentSelector.value = agentId;
|
|
1974
|
+
}
|
|
1975
|
+
this.loadModelsForAgent(agentId).then(() => {
|
|
1976
|
+
if (model && this.ui.modelSelector) {
|
|
1977
|
+
this.ui.modelSelector.value = model;
|
|
1978
|
+
}
|
|
1979
|
+
});
|
|
1961
1980
|
}
|
|
1962
1981
|
}
|
|
1963
1982
|
|
|
@@ -2247,19 +2266,7 @@ class AgentGUIClient {
|
|
|
2247
2266
|
}
|
|
2248
2267
|
this.state.currentConversation = cached.conversation;
|
|
2249
2268
|
const cachedHasActivity = cached.conversation.messageCount > 0 || this.state.streamingConversations.has(conversationId);
|
|
2250
|
-
|
|
2251
|
-
this.lockAgentAndModel(cached.conversation.agentType || 'claude-code', cached.conversation.model || null);
|
|
2252
|
-
} else {
|
|
2253
|
-
this.unlockAgentAndModel();
|
|
2254
|
-
if (this.ui.agentSelector && cached.conversation.agentType) this.ui.agentSelector.value = cached.conversation.agentType;
|
|
2255
|
-
if (cached.conversation.agentType) {
|
|
2256
|
-
this.loadModelsForAgent(cached.conversation.agentType).then(() => {
|
|
2257
|
-
if (cached.conversation.model && this.ui.modelSelector) {
|
|
2258
|
-
this.ui.modelSelector.value = cached.conversation.model;
|
|
2259
|
-
}
|
|
2260
|
-
});
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2269
|
+
this.applyAgentAndModelSelection(cached.conversation, cachedHasActivity);
|
|
2263
2270
|
this.conversationCache.delete(conversationId);
|
|
2264
2271
|
this.restoreScrollPosition(conversationId);
|
|
2265
2272
|
this.enableControls();
|
|
@@ -2288,19 +2295,7 @@ class AgentGUIClient {
|
|
|
2288
2295
|
|
|
2289
2296
|
this.state.currentConversation = conversation;
|
|
2290
2297
|
const hasActivity = (allMessages && allMessages.length > 0) || isActivelyStreaming || latestSession || this.state.streamingConversations.has(conversationId);
|
|
2291
|
-
|
|
2292
|
-
this.lockAgentAndModel(conversation.agentType || 'claude-code', conversation.model || null);
|
|
2293
|
-
} else {
|
|
2294
|
-
this.unlockAgentAndModel();
|
|
2295
|
-
if (this.ui.agentSelector && conversation.agentType) this.ui.agentSelector.value = conversation.agentType;
|
|
2296
|
-
if (conversation.agentType) {
|
|
2297
|
-
this.loadModelsForAgent(conversation.agentType).then(() => {
|
|
2298
|
-
if (conversation.model && this.ui.modelSelector) {
|
|
2299
|
-
this.ui.modelSelector.value = conversation.model;
|
|
2300
|
-
}
|
|
2301
|
-
});
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2298
|
+
this.applyAgentAndModelSelection(conversation, hasActivity);
|
|
2304
2299
|
|
|
2305
2300
|
const chunks = (rawChunks || []).map(chunk => ({
|
|
2306
2301
|
...chunk,
|
|
@@ -423,8 +423,12 @@ class StreamingRenderer {
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
_getToolColorClass(toolName) {
|
|
426
|
-
const n = (toolName || '').replace(/^mcp__
|
|
427
|
-
const map = {
|
|
426
|
+
const n = (toolName || '').replace(/^mcp__.*?__/, '').toLowerCase();
|
|
427
|
+
const map = {
|
|
428
|
+
read: 'read', write: 'write', edit: 'edit', bash: 'bash', glob: 'glob', grep: 'grep',
|
|
429
|
+
webfetch: 'web', websearch: 'web', todowrite: 'todo', task: 'task', notebookedit: 'edit',
|
|
430
|
+
execute: 'execute', sleep: 'sleep', search: 'search'
|
|
431
|
+
};
|
|
428
432
|
return `tool-color-${map[n] || 'default'}`;
|
|
429
433
|
}
|
|
430
434
|
|
|
@@ -568,7 +572,7 @@ class StreamingRenderer {
|
|
|
568
572
|
renderSmartParams(toolName, input) {
|
|
569
573
|
if (!input || Object.keys(input).length === 0) return '';
|
|
570
574
|
|
|
571
|
-
const normalizedName = toolName.replace(/^mcp__
|
|
575
|
+
const normalizedName = toolName.replace(/^mcp__.*?__/, '');
|
|
572
576
|
|
|
573
577
|
switch (normalizedName) {
|
|
574
578
|
case 'Read':
|
|
@@ -691,7 +695,7 @@ class StreamingRenderer {
|
|
|
691
695
|
* Render tool use block with smart parameter display
|
|
692
696
|
*/
|
|
693
697
|
getToolUseTitle(toolName, input) {
|
|
694
|
-
const normalizedName = toolName.replace(/^mcp__
|
|
698
|
+
const normalizedName = toolName.replace(/^mcp__.*?__/, '');
|
|
695
699
|
if (normalizedName === 'Edit' && input.file_path) {
|
|
696
700
|
const parts = pathSplit(input.file_path);
|
|
697
701
|
const fileName = parts.pop();
|
|
@@ -725,7 +729,7 @@ class StreamingRenderer {
|
|
|
725
729
|
}
|
|
726
730
|
|
|
727
731
|
getToolUseDisplayName(toolName) {
|
|
728
|
-
const normalized = toolName.replace(/^mcp__
|
|
732
|
+
const normalized = toolName.replace(/^mcp__.*?__/, '');
|
|
729
733
|
const knownTools = ['Read','Write','Edit','Bash','Glob','Grep','WebFetch','WebSearch','TodoWrite','Task','NotebookEdit'];
|
|
730
734
|
if (knownTools.includes(normalized)) return normalized;
|
|
731
735
|
if (toolName.startsWith('mcp__')) {
|
|
@@ -1131,7 +1135,7 @@ class StreamingRenderer {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
|
|
1133
1137
|
static getToolDisplayName(toolName) {
|
|
1134
|
-
const normalized = toolName.replace(/^mcp__
|
|
1138
|
+
const normalized = toolName.replace(/^mcp__.*?__/, '');
|
|
1135
1139
|
const knownTools = ['Read','Write','Edit','Bash','Glob','Grep','WebFetch','WebSearch','TodoWrite','Task','NotebookEdit'];
|
|
1136
1140
|
if (knownTools.includes(normalized)) return normalized;
|
|
1137
1141
|
if (toolName.startsWith('mcp__')) {
|
|
@@ -1142,7 +1146,7 @@ class StreamingRenderer {
|
|
|
1142
1146
|
}
|
|
1143
1147
|
|
|
1144
1148
|
static getToolTitle(toolName, input) {
|
|
1145
|
-
const n = toolName.replace(/^mcp__
|
|
1149
|
+
const n = toolName.replace(/^mcp__.*?__/, '');
|
|
1146
1150
|
if (n === 'Edit' && input.file_path) { const p = pathSplit(input.file_path); const f = p.pop(); const d = p.slice(-2).join('/'); return d ? d+'/'+f : f; }
|
|
1147
1151
|
if (n === 'Read' && input.file_path) return pathBasename(input.file_path);
|
|
1148
1152
|
if (n === 'Write' && input.file_path) return pathBasename(input.file_path);
|