agentgui 1.0.640 → 1.0.641
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/lib/claude-runner.js +3 -3
- package/lib/ws-handlers-util.js +44 -61
- package/package.json +1 -1
- package/static/index.html +0 -3
package/lib/claude-runner.js
CHANGED
|
@@ -10,8 +10,8 @@ function getSpawnOptions(cwd, additionalOptions = {}) {
|
|
|
10
10
|
if (!options.env) {
|
|
11
11
|
options.env = { ...process.env };
|
|
12
12
|
}
|
|
13
|
-
//
|
|
14
|
-
delete
|
|
13
|
+
// Keep CLAUDECODE for plugin support (gm plugin requires this)
|
|
14
|
+
// Don't delete it as it prevents plugins from loading
|
|
15
15
|
return options;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -613,7 +613,7 @@ registry.register({
|
|
|
613
613
|
closeStdin: true, // must close stdin or claude 2.1.72 hangs waiting for input in --print mode
|
|
614
614
|
useJsonRpcStdin: false,
|
|
615
615
|
supportedFeatures: ['streaming', 'resume', 'system-prompt', 'permissions-skip'],
|
|
616
|
-
spawnEnv: { MAX_THINKING_TOKENS: '0'
|
|
616
|
+
spawnEnv: { MAX_THINKING_TOKENS: '0' },
|
|
617
617
|
|
|
618
618
|
buildArgs(prompt, config) {
|
|
619
619
|
const {
|
package/lib/ws-handlers-util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import { execSync, spawn } from 'child_process';
|
|
4
|
+
import { execSync, spawn, spawnSync } from 'child_process';
|
|
5
5
|
|
|
6
6
|
function err(code, message) { const e = new Error(message); e.code = code; throw e; }
|
|
7
7
|
|
|
@@ -268,65 +268,48 @@ export function register(router, deps) {
|
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
-
router.handle('agent.subagents', async (p) => {
|
|
272
|
-
const { id } = p;
|
|
273
|
-
if (!id) err(400, 'Missing agent id');
|
|
274
|
-
|
|
275
|
-
//
|
|
276
|
-
if (id === 'cli-claude') {
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
'cli-opencode': [{ id: 'gm-oc', name: 'GM OpenCode' }],
|
|
315
|
-
'cli-gemini': [{ id: 'gm-gc', name: 'GM Gemini' }],
|
|
316
|
-
'cli-kilo': [{ id: 'gm-kilo', name: 'GM Kilo' }],
|
|
317
|
-
'cli-codex': []
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
const subAgents = subAgentMap[id] || [];
|
|
321
|
-
|
|
322
|
-
// Filter to only installed sub-agents
|
|
323
|
-
try {
|
|
324
|
-
const tools = await toolManager.getAllToolsAsync();
|
|
325
|
-
const installedPlugins = new Set(tools.filter(t => t.category === 'plugin' && t.installed).map(t => t.id));
|
|
326
|
-
const availableSubAgents = subAgents.filter(sa => installedPlugins.has(sa.id));
|
|
327
|
-
return { subAgents: availableSubAgents };
|
|
328
|
-
} catch (e) {
|
|
329
|
-
return { subAgents };
|
|
330
|
-
}
|
|
271
|
+
router.handle('agent.subagents', async (p) => {
|
|
272
|
+
const { id } = p;
|
|
273
|
+
if (!id) err(400, 'Missing agent id');
|
|
274
|
+
|
|
275
|
+
// Claude Code: run 'claude agents list' and parse output
|
|
276
|
+
if (id === 'claude-code' || id === 'cli-claude') {
|
|
277
|
+
const spawnEnv = { ...process.env };
|
|
278
|
+
delete spawnEnv.CLAUDECODE;
|
|
279
|
+
const result = spawnSync('claude', ['agents', 'list'], {
|
|
280
|
+
encoding: 'utf-8', timeout: 10000, stdio: ['pipe', 'pipe', 'pipe'],
|
|
281
|
+
env: spawnEnv
|
|
282
|
+
});
|
|
283
|
+
if (result.status !== 0 || !result.stdout) return { subAgents: [] };
|
|
284
|
+
const output = result.stdout.trim();
|
|
285
|
+
// Output format: ' agentId · model' lines under section headers
|
|
286
|
+
const agents = [];
|
|
287
|
+
for (const line of output.split('
|
|
288
|
+
')) {
|
|
289
|
+
const match = line.match(/^s{2}(S+)s+·/);
|
|
290
|
+
if (match) {
|
|
291
|
+
const id = match[1];
|
|
292
|
+
agents.push({ id, name: id });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
console.log('[agent.subagents] claude agents list found:', agents.map(a => a.id).join(', '));
|
|
296
|
+
return { subAgents: agents };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ACP agents: hardcoded map filtered by installed tools
|
|
300
|
+
const subAgentMap = {
|
|
301
|
+
'opencode': [{ id: 'gm-oc', name: 'GM OpenCode' }],
|
|
302
|
+
'cli-opencode': [{ id: 'gm-oc', name: 'GM OpenCode' }],
|
|
303
|
+
'gemini': [{ id: 'gm-gc', name: 'GM Gemini' }],
|
|
304
|
+
'cli-gemini': [{ id: 'gm-gc', name: 'GM Gemini' }],
|
|
305
|
+
'kilo': [{ id: 'gm-kilo', name: 'GM Kilo' }],
|
|
306
|
+
'cli-kilo': [{ id: 'gm-kilo', name: 'GM Kilo' }],
|
|
307
|
+
'codex': [],
|
|
308
|
+
'cli-codex': []
|
|
309
|
+
};
|
|
310
|
+
const subAgents = subAgentMap[id] || [];
|
|
311
|
+
const tools = await toolManager.getAllToolsAsync();
|
|
312
|
+
const installed = new Set(tools.filter(t => t.category === 'plugin' && t.installed).map(t => t.id));
|
|
313
|
+
return { subAgents: subAgents.filter(sa => installed.has(sa.id)) };
|
|
331
314
|
});
|
|
332
315
|
}
|
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -1120,9 +1120,6 @@
|
|
|
1120
1120
|
.message { max-width: 95%; }
|
|
1121
1121
|
.messages-wrapper { padding: 0.375rem 0.5rem; }
|
|
1122
1122
|
.input-section { padding: 0.5rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
|
|
1123
|
-
.cli-selector { display: none !important; }
|
|
1124
|
-
.sub-agent-selector { display: none !important; }
|
|
1125
|
-
.model-selector { display: none !important; }
|
|
1126
1123
|
}
|
|
1127
1124
|
|
|
1128
1125
|
/* ===== SCROLLBAR STYLING ===== */
|