forked from agent0ai/agent-zero
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Pr/UI fresh #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Pr/UI fresh #15
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
c0faaaf
Integrate Embedded Process Groups with Expand/Collapse Support
0ce48c8
fix
72439d5
Add timestamps and per-step execution time
37af2c6
Refactor A1/A2… as Internal Tools Within A0
85cc64d
user message starts a new group (each user message should be separate)
keyboardstaff 8181a82
remove bg-colors from messages; logItem updates
3clyp50 e275cab
status icons and formatting
3clyp50 ced8f87
agent no. from backend
3clyp50 8d94e67
revert token counting logic
3clyp50 b0d83a4
process groups and steps css polish
3clyp50 5844e58
fix: take durationms from backend
3clyp50 3705096
showThoughts hide/show GEN steps
3clyp50 3e31dcb
tool specific step badges
3clyp50 74595c6
streamline status badges; polish chat-history css
3clyp50 6ed9f06
fix: backend not setting agent no; agent no in responses
3clyp50 98b0ae8
user, warning msg css
3clyp50 9295cd3
subordinates agents nesting in process groups
3clyp50 6530a08
fix user-message position
3clyp50 9dea6ef
rm showThoughts and showJSON
3clyp50 ea078af
fix: browser screenshot flashing
3clyp50 7dcfd6a
timestamp log fix
3clyp50 6a21f34
restore heading logic for rate limit, error msgs
3clyp50 372d2bf
autoexpand groups on warnings
3clyp50 a96c035
chore: cleanup comments
3clyp50 6d41d19
restore log guid
3clyp50 e042f5e
fix: browser holding timestamp
3clyp50 98cae36
skip native reasoning
3clyp50 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 181 additions & 0 deletions
181
webui/components/messages/process-group/process-group-store.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| import { createStore } from "/js/AlpineStore.js"; | ||
|
|
||
| // Process Group Store - manages collapsible process groups in chat | ||
|
|
||
| // Unified mapping for both Tool Names and Step Types | ||
| // Specific tool names (keys) take precedence over generic types | ||
| const DISPLAY_CODES = { | ||
| // --- Specific Tools --- | ||
| 'call_subordinate': 'SUB', | ||
| 'search_engine': 'WEB', | ||
| 'a2a_chat': 'A2A', | ||
| 'behaviour_adjustment': 'ADJ', | ||
| 'document_query': 'DOC', | ||
| 'vision_load': 'EYE', | ||
| 'notify_user': 'NTF', | ||
| 'scheduler': 'SCH', | ||
| 'unknown': 'UNK', | ||
| // Memory operations group | ||
| 'memory_save': 'MEM', | ||
| 'memory_load': 'MEM', | ||
| 'memory_forget': 'MEM', | ||
| 'memory_delete': 'MEM', | ||
|
|
||
| // --- Step Types --- | ||
| 'agent': 'GEN', | ||
| 'response': 'END', | ||
| 'tool': 'USE', // Generic fallback for tools | ||
| 'code_exe': 'EXE', | ||
| 'browser': 'BRW', | ||
| 'progress': 'HLD', | ||
| 'subagent': 'SUB', // Type fallback if tool name missing | ||
| 'mcp': 'MCP', | ||
| 'info': 'INF', | ||
| 'hint': 'HNT', | ||
| 'warning': 'WRN', | ||
| 'error': 'ERR', | ||
| 'util': 'UTL', | ||
| 'done': 'END' | ||
| }; | ||
|
|
||
| const model = { | ||
| // Track which process groups are expanded (by group ID) | ||
| expandedGroups: {}, | ||
|
|
||
| // Track which individual steps are expanded within a group | ||
| expandedSteps: {}, | ||
|
|
||
| // Default collapsed state for new process groups | ||
| defaultCollapsed: true, | ||
|
|
||
| init() { | ||
| try { | ||
| // Load persisted state | ||
| const stored = localStorage.getItem("processGroupState"); | ||
| if (stored) { | ||
| const parsed = JSON.parse(stored); | ||
| this.expandedGroups = parsed.expandedGroups || {}; | ||
| this.expandedSteps = parsed.expandedSteps || {}; | ||
| this.defaultCollapsed = parsed.defaultCollapsed ?? true; | ||
| } | ||
| } catch (e) { | ||
| console.error("Failed to load process group state", e); | ||
| } | ||
| }, | ||
|
|
||
| _persist() { | ||
| try { | ||
| localStorage.setItem("processGroupState", JSON.stringify({ | ||
| expandedGroups: this.expandedGroups, | ||
| expandedSteps: this.expandedSteps, | ||
| defaultCollapsed: this.defaultCollapsed | ||
| })); | ||
| } catch (e) { | ||
| console.error("Failed to persist process group state", e); | ||
| } | ||
| }, | ||
|
|
||
| // Check if a process group is expanded | ||
| isGroupExpanded(groupId) { | ||
| if (groupId in this.expandedGroups) { | ||
| return this.expandedGroups[groupId]; | ||
| } | ||
| return !this.defaultCollapsed; | ||
| }, | ||
|
|
||
| // Toggle process group expansion | ||
| toggleGroup(groupId) { | ||
| const current = this.isGroupExpanded(groupId); | ||
| this.expandedGroups[groupId] = !current; | ||
| this._persist(); | ||
| }, | ||
|
|
||
| // Expand a specific group | ||
| expandGroup(groupId) { | ||
| this.expandedGroups[groupId] = true; | ||
| this._persist(); | ||
| }, | ||
|
|
||
| // Collapse a specific group | ||
| collapseGroup(groupId) { | ||
| this.expandedGroups[groupId] = false; | ||
| this._persist(); | ||
| }, | ||
|
|
||
| // Check if a step within a group is expanded | ||
| isStepExpanded(groupId, stepId) { | ||
| const key = `${groupId}:${stepId}`; | ||
| return this.expandedSteps[key] || false; | ||
| }, | ||
|
|
||
| // Toggle step expansion | ||
| toggleStep(groupId, stepId) { | ||
| const key = `${groupId}:${stepId}`; | ||
| const currentState = this.expandedSteps[key] || false; | ||
| this.expandedSteps[key] = !currentState; | ||
| this._persist(); | ||
| }, | ||
|
|
||
| // Status code (3-4 letter) for backend log types | ||
| // Looks up tool name first (specific), then falls back to type (generic) | ||
| getStepCode(type, toolName = null) { | ||
| // Specific tool codes only apply to generic 'tool' steps | ||
| if (type === 'tool' && toolName && DISPLAY_CODES[toolName]) { | ||
| return DISPLAY_CODES[toolName]; | ||
| } | ||
|
|
||
| return DISPLAY_CODES[type] || | ||
| type?.toUpperCase()?.slice(0, 4) || | ||
| 'GEN'; | ||
| }, | ||
|
|
||
| // CSS color class for backend log types | ||
| // Looks up tool name first (specific), then falls back to type (generic) | ||
| getStatusColorClass(type, toolName = null) { | ||
| // Specific tool name mappings for 'tool' steps | ||
| if (type === 'tool' && toolName) { | ||
| // call_subordinate gets teal (SUB color) | ||
| if (toolName === 'call_subordinate') { | ||
| return 'status-sub'; | ||
| } | ||
| // Add other specific tool mappings here if needed in the future | ||
| } | ||
|
|
||
| const colors = { | ||
| 'agent': 'status-gen', | ||
| 'response': 'status-end', | ||
| 'tool': 'status-tool', | ||
| 'mcp': 'status-mcp', | ||
| 'subagent': 'status-sub', | ||
| 'code_exe': 'status-exe', | ||
| 'browser': 'status-brw', | ||
| 'progress': 'status-wait', | ||
| 'info': 'status-inf', | ||
| 'hint': 'status-hnt', | ||
| 'warning': 'status-wrn', | ||
| 'error': 'status-err', | ||
| 'util': 'status-utl', | ||
| 'done': 'status-end' | ||
| }; | ||
| return colors[type] || 'status-gen'; | ||
| }, | ||
|
|
||
| // Clear state for a specific context (when chat is reset) | ||
| clearContext(contextPrefix) { | ||
| // Clear groups matching the context | ||
| for (const key of Object.keys(this.expandedGroups)) { | ||
| if (key.startsWith(contextPrefix)) { | ||
| delete this.expandedGroups[key]; | ||
| } | ||
| } | ||
| // Clear steps matching the context | ||
| for (const key of Object.keys(this.expandedSteps)) { | ||
| if (key.startsWith(contextPrefix)) { | ||
| delete this.expandedSteps[key]; | ||
| } | ||
| } | ||
| this._persist(); | ||
| } | ||
3clyp50 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| export const store = createStore("processGroup", model); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.