agentgui 1.0.641 → 1.0.642

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.
@@ -284,9 +284,8 @@ export function register(router, deps) {
284
284
  const output = result.stdout.trim();
285
285
  // Output format: ' agentId · model' lines under section headers
286
286
  const agents = [];
287
- for (const line of output.split('
288
- ')) {
289
- const match = line.match(/^s{2}(S+)s+·/);
287
+ for (const line of output.split('\n').filter(l => l.trim())) {
288
+ const match = line.match(/^ (\S+)\s+·/);
290
289
  if (match) {
291
290
  const id = match[1];
292
291
  agents.push({ id, name: id });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.641",
3
+ "version": "1.0.642",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -534,9 +534,12 @@ function discoverAgents() {
534
534
  console.log(`[discoverAgents] Skipping CLI wrapper ${wrapper.id} (ACP agent ${wrapper.acpId} not found)`);
535
535
  }
536
536
  }
537
- console.log('[discoverAgents] Final agent count:', agents.length, 'Agent IDs:', agents.map(a => a.id).join(', '));
537
+ // Remove raw ACP agents that have a cli-wrapper (avoid duplicates in UI)
538
+ const wrappedAcpIds = new Set(cliWrappers.filter(w => agents.some(a => a.id === w.acpId)).map(w => w.acpId));
539
+ const filtered = agents.filter(a => !wrappedAcpIds.has(a.id));
540
+ console.log('[discoverAgents] Final agent count:', filtered.length, 'Agent IDs:', filtered.map(a => a.id).join(', '));
538
541
 
539
- return agents;
542
+ return filtered;
540
543
  }
541
544
 
542
545
  // Function to discover agents from external ACP servers
@@ -442,10 +442,10 @@ class AgentGUIClient {
442
442
 
443
443
  if (this.ui.agentSelector) {
444
444
  this.ui.agentSelector.addEventListener('change', () => {
445
- // Load models for the selected sub-agent
446
- const selectedSubAgentId = this.ui.agentSelector.value;
447
- if (selectedSubAgentId) {
448
- this.loadModelsForAgent(selectedSubAgentId);
445
+ // Load models for parent CLI agent when sub-agent changes
446
+ const parentAgentId = this.ui.cliSelector?.value;
447
+ if (parentAgentId) {
448
+ this.loadModelsForAgent(parentAgentId);
449
449
  }
450
450
  if (!this._agentLocked) {
451
451
  this.saveAgentAndModelToConversation();
@@ -2076,7 +2076,7 @@ class AgentGUIClient {
2076
2076
  // Auto-select first sub-agent and load its models
2077
2077
  const firstSubAgentId = subAgents[0].id;
2078
2078
  this.ui.agentSelector.value = firstSubAgentId;
2079
- this.loadModelsForAgent(firstSubAgentId);
2079
+ this.loadModelsForAgent(cliAgentId); // models keyed to parent agent
2080
2080
  } else {
2081
2081
  console.log(`[Agent Selector] No sub-agents found for ${cliAgentId}`);
2082
2082
  // Load models for the CLI agent itself (fallback for agents without sub-agents)