feat: centralized PTY-scoped session state, sync engine debug panel, lifecycle states, WS monitor
- Refactor session state to use ptySessionId as primary key across all components - Add SessionStateManager with PTY-scoped hook processing, approval tracking, notifications - Add sync-engine debug panel (AgentStatesSection, HookTimelineSection, TerminalRegistrySection, WsMonitorSection) - Add useLifecycleStates composable for continuous state chips (session, responding, tool, subagent, compacting) - Add WS monitor endpoint and composable for real-time connection health - Enhance SessionLifecycleStatus with animated state chips and badge counts - Enhance SystemMessage with expanded content and better formatting - Update hooks (approval-permission, approval-plan, notify) with pty_session injection - Update approval system to derive pending lists from PTY-scoped state - Update ChatContainer with PTY-derived agent status and lifecycle events - Update AgentBadge with PTY-scoped status colors - Improve PiP window, approval window, and loading window handling
This commit is contained in:
@@ -35,8 +35,22 @@
|
||||
<div class="badge" id="b"></div>
|
||||
</div>
|
||||
<script>
|
||||
var badge = document.getElementById('b');
|
||||
function updateBadge(n) {
|
||||
if (n > 1) { badge.textContent = n; badge.className = 'badge show'; }
|
||||
else { badge.className = 'badge'; }
|
||||
}
|
||||
|
||||
// Initial count from query param
|
||||
var c = new URLSearchParams(location.search).get('n');
|
||||
if (c && parseInt(c) > 1) { var b = document.getElementById('b'); b.textContent = c; b.className = 'badge show'; }
|
||||
if (c) updateBadge(parseInt(c));
|
||||
|
||||
// Live updates via Tauri event (no module imports needed)
|
||||
var T = window.__TAURI_INTERNALS__;
|
||||
if (T) {
|
||||
var handler = T.transformCallback(function(ev) { updateBadge(ev.payload); });
|
||||
T.invoke('plugin:event|listen', { event: 'loading:count', target: { kind: 'Any' }, handler: handler });
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user