agentgui 1.0.502 → 1.0.503
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/CLAUDE.md +29 -0
- package/package.json +1 -1
- package/static/js/client.js +2 -2
package/CLAUDE.md
CHANGED
|
@@ -84,6 +84,12 @@ All routes are prefixed with `BASE_URL` (default `/gm`).
|
|
|
84
84
|
- `GET /api/speech-status` - Speech model loading status
|
|
85
85
|
- `POST /api/folders` - Create folder
|
|
86
86
|
- `GET /api/tools` - List detected tools with installation status (via WebSocket tools.list handler)
|
|
87
|
+
- `GET /api/tools/:id/status` - Get tool installation status (version, installed_at, error_message)
|
|
88
|
+
- `POST /api/tools/:id/install` - Start tool installation (returns `{ success: true }` with background async install)
|
|
89
|
+
- `POST /api/tools/:id/update` - Start tool update (body: targetVersion)
|
|
90
|
+
- `GET /api/tools/:id/history` - Get tool install/update history (query: limit, offset)
|
|
91
|
+
- `POST /api/tools/update` - Batch update all tools with available updates
|
|
92
|
+
- `POST /api/tools/refresh-all` - Refresh all tool statuses from package manager
|
|
87
93
|
|
|
88
94
|
## Tool Detection System
|
|
89
95
|
|
|
@@ -95,6 +101,29 @@ The system auto-detects installed AI coding tools via `bunx` package resolution:
|
|
|
95
101
|
|
|
96
102
|
Tool package names are configured in `lib/tool-manager.js` TOOLS array (lines 6-11). Detection happens by spawning `bunx <package> --version` to check if tools are installed. Response from `/api/tools` includes: id, name, pkg, installed, status (one of: installed|needs_update|not_installed), isUpToDate, upgradeNeeded, hasUpdate. Frontend displays tools in UI and updates based on installation status.
|
|
97
103
|
|
|
104
|
+
### Tool Installation and Update UI Flow
|
|
105
|
+
|
|
106
|
+
When user clicks Install/Update button on a tool:
|
|
107
|
+
|
|
108
|
+
1. **Frontend** (`static/js/tools-manager.js`):
|
|
109
|
+
- Immediately updates tool status to 'installing'/'updating' and re-renders UI
|
|
110
|
+
- Sends POST request to `/api/tools/{id}/install` or `/api/tools/{id}/update`
|
|
111
|
+
- Adds toolId to `operationInProgress` to prevent duplicate requests
|
|
112
|
+
- Button becomes disabled showing progress indicator while install runs
|
|
113
|
+
|
|
114
|
+
2. **Backend** (`server.js` lines 1819-1851):
|
|
115
|
+
- Receives POST request, updates database status to 'installing'/'updating'
|
|
116
|
+
- Sends immediate response `{ success: true }`
|
|
117
|
+
- Asynchronously calls `toolManager.install/update()` in background
|
|
118
|
+
- Upon completion, broadcasts WebSocket event `tool_install_complete` or `tool_install_failed`
|
|
119
|
+
|
|
120
|
+
3. **Frontend WebSocket Handler** (`static/js/tools-manager.js` lines 138-151):
|
|
121
|
+
- Listens for `tool_install_complete` or `tool_install_failed` events
|
|
122
|
+
- Updates tool status and re-renders final state
|
|
123
|
+
- Removes toolId from `operationInProgress`, enabling button again
|
|
124
|
+
|
|
125
|
+
The UI shows progress in three phases: immediate "Installing" status, progress bar animation during install, and final "Installed"/"Failed" status when complete.
|
|
126
|
+
|
|
98
127
|
## WebSocket Protocol
|
|
99
128
|
|
|
100
129
|
Endpoint: `BASE_URL + /sync`
|
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -1890,7 +1890,7 @@ class AgentGUIClient {
|
|
|
1890
1890
|
if (this.ui.cliSelector) {
|
|
1891
1891
|
if (displayAgents.length > 0) {
|
|
1892
1892
|
this.ui.cliSelector.innerHTML = displayAgents
|
|
1893
|
-
.map(a => `<option value="${a.id}">${a.name}</option>`)
|
|
1893
|
+
.map(a => `<option value="${a.id}">${a.name.split(/[\s\-]+/)[0]}</option>`)
|
|
1894
1894
|
.join('');
|
|
1895
1895
|
this.ui.cliSelector.style.display = 'inline-block';
|
|
1896
1896
|
} else {
|
|
@@ -1923,7 +1923,7 @@ class AgentGUIClient {
|
|
|
1923
1923
|
const { subAgents } = await window.wsClient.rpc('agent.subagents', { id: cliAgentId });
|
|
1924
1924
|
if (subAgents && subAgents.length > 0 && this.ui.agentSelector) {
|
|
1925
1925
|
this.ui.agentSelector.innerHTML = subAgents
|
|
1926
|
-
.map(a => `<option value="${a.id}">${a.name}</option>`)
|
|
1926
|
+
.map(a => `<option value="${a.id}">${a.name.split(/[\s\-]+/)[0]}</option>`)
|
|
1927
1927
|
.join('');
|
|
1928
1928
|
this.ui.agentSelector.style.display = 'inline-block';
|
|
1929
1929
|
this.loadModelsForAgent(cliAgentId);
|