agentgui 1.0.605 → 1.0.607

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.605",
3
+ "version": "1.0.607",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -24,14 +24,14 @@ echo "Saving to $DOCS_DIR"
24
24
 
25
25
  ab open "$BASE_URL"
26
26
  ab wait --load networkidle
27
- ab wait ".conversation-item"
27
+ sleep 1
28
28
 
29
29
  ab screenshot --full "$DOCS_DIR/screenshot-main.png"
30
30
  echo "Saved screenshot-main.png"
31
31
 
32
- ab eval 'document.querySelector(".conversation-item").click()'
32
+ ab eval 'document.querySelector(".conversation-item")?.click()'
33
+ sleep 2
33
34
  ab wait --load networkidle
34
- ab wait ".message, .event-block, .streaming-event, #chatView, .chat-messages"
35
35
 
36
36
  ab screenshot --full "$DOCS_DIR/screenshot-chat.png"
37
37
  echo "Saved screenshot-chat.png"
@@ -39,20 +39,24 @@ echo "Saved screenshot-chat.png"
39
39
  ab screenshot --full "$DOCS_DIR/screenshot-conversation.png"
40
40
  echo "Saved screenshot-conversation.png"
41
41
 
42
- ab eval 'document.getElementById("toolsManagerBtn")?.click()'
43
- ab wait "#toolsPopup.open, .tools-popup.open"
42
+ ab eval 'var b=document.getElementById("toolsManagerBtn"); if(b){b.style.display="";b.click();}'
43
+ sleep 1
44
44
 
45
45
  ab screenshot --full "$DOCS_DIR/screenshot-tools-popup.png"
46
46
  echo "Saved screenshot-tools-popup.png"
47
47
 
48
- ab eval 'document.querySelector("[data-view=files]")?.click()'
49
- ab wait "[data-view=files].active, .files-view, #filesView"
48
+ ab eval 'var p=document.getElementById("toolsPopup"); if(p)p.classList.remove("open");'
49
+ sleep 0.5
50
+
51
+ ab eval 'document.querySelector(".view-toggle-btn[data-view=\"files\"]")?.click()'
52
+ sleep 2
53
+ ab wait --load networkidle
50
54
 
51
55
  ab screenshot --full "$DOCS_DIR/screenshot-files.png"
52
56
  echo "Saved screenshot-files.png"
53
57
 
54
- ab eval 'document.querySelector("[data-view=terminal]")?.click()'
55
- ab wait "#terminalContainer:not([style*=\"display:none\"]), .terminal-container:not([style*=\"display:none\"])"
58
+ ab eval 'document.querySelector(".view-toggle-btn[data-view=\"terminal\"]")?.click()'
59
+ sleep 1
56
60
 
57
61
  ab screenshot --full "$DOCS_DIR/screenshot-terminal.png"
58
62
  echo "Saved screenshot-terminal.png"
package/server.js CHANGED
@@ -4340,7 +4340,7 @@ wsRouter.onLegacy((data, ws) => {
4340
4340
  ws.terminalProc = proc;
4341
4341
  ws.terminalPty = true;
4342
4342
  proc.on('data', (chunk) => {
4343
- if (ws.readyState === 1) ws.send(JSON.stringify({ type: 'terminal_output', data: chunk.toString('base64'), encoding: 'base64' }));
4343
+ if (ws.readyState === 1) ws.send(JSON.stringify({ type: 'terminal_output', data: Buffer.from(chunk).toString('base64'), encoding: 'base64' }));
4344
4344
  });
4345
4345
  proc.on('exit', (code) => {
4346
4346
  if (ws.readyState === 1) ws.send(JSON.stringify({ type: 'terminal_exit', code }));
@@ -10,6 +10,20 @@
10
10
  return proto + '//' + location.host + BASE + '/sync';
11
11
  }
12
12
 
13
+ function getCwd() {
14
+ try {
15
+ if (window.conversationManager) {
16
+ var mgr = window.conversationManager;
17
+ var id = mgr.activeId;
18
+ if (id && mgr.conversations) {
19
+ var conv = mgr.conversations.find(function(c) { return c.id === id; });
20
+ if (conv && conv.workingDirectory) return conv.workingDirectory;
21
+ }
22
+ }
23
+ } catch (_) {}
24
+ return undefined;
25
+ }
26
+
13
27
  function ensureTerm() {
14
28
  var output = document.getElementById('terminalOutput');
15
29
  if (!output) return false;
@@ -69,24 +83,21 @@
69
83
  }
70
84
 
71
85
  function connectAndStart() {
72
- console.log('Terminal: Connecting to WebSocket');
86
+ var cwd = getCwd();
73
87
  if (ws && ws.readyState === WebSocket.OPEN) {
74
- console.log('Terminal: Sending terminal_start command');
75
88
  var dims = term ? { cols: term.cols, rows: term.rows } : { cols: 80, rows: 24 };
76
- ws.send(JSON.stringify({ type: 'terminal_start', cwd: window.__STARTUP_CWD || undefined, cols: dims.cols, rows: dims.rows }));
89
+ ws.send(JSON.stringify({ type: 'terminal_start', cwd: cwd, cols: dims.cols, rows: dims.rows }));
77
90
  setTimeout(function() { if (term && term.focus) term.focus(); }, 100);
78
91
  return;
79
92
  }
80
93
  if (ws && ws.readyState === WebSocket.CONNECTING) {
81
- console.log('Terminal: WebSocket already connecting');
82
94
  return;
83
95
  }
84
96
 
85
97
  ws = new WebSocket(getWsUrl());
86
98
  ws.onopen = function() {
87
- console.log('Terminal: WebSocket connected, starting terminal');
88
99
  var dims = term ? { cols: term.cols, rows: term.rows } : { cols: 80, rows: 24 };
89
- ws.send(JSON.stringify({ type: 'terminal_start', cwd: window.__STARTUP_CWD || undefined, cols: dims.cols, rows: dims.rows }));
100
+ ws.send(JSON.stringify({ type: 'terminal_start', cwd: cwd, cols: dims.cols, rows: dims.rows }));
90
101
  setTimeout(function() { if (term && term.focus) term.focus(); }, 100);
91
102
  };
92
103
  ws.onmessage = function(e) {
@@ -100,25 +111,18 @@
100
111
  } else if (msg.type === 'terminal_exit' && term) {
101
112
  term.write('\r\n[Process exited with code ' + msg.code + ']\r\n');
102
113
  if (termActive) setTimeout(connectAndStart, 2000);
103
- } else if (msg.type === 'terminal_started') {
104
- console.log('Terminal: Started successfully');
105
114
  }
106
115
  } catch(_) {}
107
116
  };
108
117
  ws.onclose = function() {
109
- console.log('Terminal: WebSocket closed');
110
118
  ws = null;
111
119
  if (termActive) setTimeout(connectAndStart, 2000);
112
120
  };
113
- ws.onerror = function(error) {
114
- console.error('Terminal: WebSocket error:', error);
115
- };
121
+ ws.onerror = function() {};
116
122
  }
117
123
 
118
124
  function startTerminal() {
119
- console.log('Terminal: Starting terminal module');
120
125
  if (!ensureTerm()) {
121
- console.log('Terminal: Terminal not ready, retrying');
122
126
  setTimeout(startTerminal, 200);
123
127
  return;
124
128
  }
@@ -128,7 +132,6 @@
128
132
  }
129
133
 
130
134
  function stopTerminal() {
131
- console.log('Terminal: Stopping terminal module');
132
135
  termActive = false;
133
136
  if (ws && ws.readyState === WebSocket.OPEN) {
134
137
  ws.send(JSON.stringify({ type: 'terminal_stop' }));
@@ -140,13 +143,10 @@
140
143
  }
141
144
 
142
145
  function initTerminalEarly() {
143
- console.log('Terminal: Initializing terminal early (not yet active)');
144
146
  if (!ensureTerm()) {
145
- console.log('Terminal: Waiting for xterm.js to load');
146
147
  setTimeout(initTerminalEarly, 200);
147
148
  return;
148
149
  }
149
- console.log('Terminal: Terminal UI initialized and ready for interaction');
150
150
  }
151
151
 
152
152
  if (document.readyState === 'loading') {
@@ -167,8 +167,8 @@
167
167
  }
168
168
  });
169
169
 
170
- window.terminalModule = {
171
- start: startTerminal,
170
+ window.terminalModule = {
171
+ start: startTerminal,
172
172
  stop: stopTerminal,
173
173
  getTerminal: function() { return term; },
174
174
  isActive: function() { return termActive; }