Files
Ofer Shaal da900c2689 fix: resolve real-time visualization connection and timestamp issues (#96)
* fix: update WebSocket connection port and improve MindMap data filtering

- Changed WebSocket connection port from 3001 to 8080 for compatibility.
- Enhanced MindMap component to handle undefined currentGraphData, ensuring nodes and edges are filtered correctly.

This update improves the stability of the WebSocket connection and ensures the MindMap component functions correctly with varying data inputs.

* feat: enhance LifecycleTimeline and WebSocket handling

- Updated LifecycleTimeline component to include additional event types and improve icon and color handling.
- Modified WebSocketContext to handle both direct and nested message formats for initial state, ensuring compatibility with frontend expectations.
- Introduced a new script for emitting agent events to the EventStore, facilitating better visualization and tracking of agent lifecycle events.
- Adjusted API base URL for consistency and improved CORS settings for local development.

This update enhances the overall functionality and robustness of the event handling and visualization components.

* fix: update edge source ID in DataTransformer

- Changed the source ID for edges in the DataTransformer class to directly use the agent ID without a prefix. This aligns the edge representation with the agent node ID format, improving consistency in data visualization.

This update enhances the accuracy of the data transformation process.

* feat: add visualization dashboard and event emission scripts

- Introduced a new visualization dashboard for real-time agent activity tracking.
- Added scripts for emitting agent events (spawn, start, complete, error) to the EventStore.
- Implemented hooks for automatic event emission during task execution.
- Enhanced the settings configuration to include commands for visualization event emission.

This update significantly improves the monitoring and debugging capabilities of agent activities.

* feat: improve timestamp handling in DrillDownPanel and LifecycleTimeline

- Added a utility function `toTimestampMs` to safely convert timestamps from both ISO strings and numeric formats to milliseconds.
- Updated sorting and formatting of event timestamps in both the DrillDownPanel and LifecycleTimeline components to utilize the new timestamp conversion function.
- Enhanced the display of event logs and metadata to ensure consistent timestamp representation across the application.

This update improves the accuracy and reliability of timestamp handling in event visualizations.

---------

Co-authored-by: Dragan Spiridonov <spiridonovdragan@gmail.com>
2025-12-02 08:53:15 +01:00

28 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Hook: Pre-Task - Emit agent spawn event to visualization
# Receives JSON via stdin from Claude Code hook system
# Read input from stdin
INPUT=$(cat)
# Extract task description and agent type from hook input
DESC=$(echo "$INPUT" | jq -r '.tool_input.description // .tool_input.prompt // "task-agent"' 2>/dev/null | head -c 50)
AGENT_TYPE=$(echo "$INPUT" | jq -r '.tool_input.subagent_type // .tool_input.agent // "coder"' 2>/dev/null)
# Generate agent ID from description
AGENT_ID=$(echo "$DESC" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g' | head -c 30)
AGENT_ID="${AGENT_ID:-task-agent}-$(date +%s)"
# Store agent ID in temp file for completion hook
mkdir -p /tmp/aqe-viz
echo "$AGENT_ID" > "/tmp/aqe-viz/current-agent-$$"
echo "$AGENT_ID" >> "/tmp/aqe-viz/agent-registry"
# Emit spawn and start events (non-blocking, background)
(
npx tsx scripts/emit-agent-event.ts spawn "$AGENT_ID" "$AGENT_TYPE" 2>/dev/null
npx tsx scripts/emit-agent-event.ts start "$AGENT_ID" 2>/dev/null
) &
exit 0