agentgui 1.0.486 → 1.0.487

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.486",
3
+ "version": "1.0.487",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -115,16 +115,29 @@
115
115
  }
116
116
  }
117
117
 
118
- // Check if terminal view is initially active
119
- if (document.getElementById('terminalContainer') &&
120
- window.getComputedStyle(document.getElementById('terminalContainer')).display !== 'none') {
121
- console.log('Terminal: Terminal view initially visible, starting');
122
- startTerminal();
118
+ function initTerminalEarly() {
119
+ console.log('Terminal: Initializing terminal early (not yet active)');
120
+ if (!ensureTerm()) {
121
+ console.log('Terminal: Waiting for xterm.js to load');
122
+ setTimeout(initTerminalEarly, 200);
123
+ return;
124
+ }
125
+ console.log('Terminal: Terminal UI initialized and ready for interaction');
126
+ }
127
+
128
+ if (document.readyState === 'loading') {
129
+ document.addEventListener('DOMContentLoaded', initTerminalEarly);
130
+ } else {
131
+ initTerminalEarly();
123
132
  }
124
133
 
125
134
  window.addEventListener('view-switched', function(e) {
126
135
  if (e.detail.view === 'terminal') {
127
- startTerminal();
136
+ if (!termActive) {
137
+ termActive = true;
138
+ connectAndStart();
139
+ setTimeout(function() { if (fitAddon) try { fitAddon.fit(); } catch(_) {} }, 100);
140
+ }
128
141
  } else if (termActive) {
129
142
  stopTerminal();
130
143
  }