agentgui 1.0.939 → 1.0.940
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/AGENTS.md +10 -0
- package/lib/claude-runner-agents.js +25 -0
- package/lib/ws-handlers-util.js +27 -1
- package/package.json +1 -1
- package/site/app/js/app.js +291 -67
- package/site/app/js/backend.js +24 -22
- package/site/app/vendor/anentrypoint-design/247420.css +1 -1
- package/site/app/vendor/anentrypoint-design/247420.js +4 -4
- package/site/app/vendor/cdn/dompurify.js +9 -0
- package/site/app/vendor/cdn/fonts/1291de6d401a.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/1ba89a87e0b8.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/3644d51c507b.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/4b91d2650dc2.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/530d036ba64a.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/570a2bdd8f8b.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/5dd6d880fee9.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/62de9143afe3.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/64884efa2f11.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/68cd7063be2e.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/6c252abcf99b.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/71e69e06516a.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/9ea68c62083f.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/c010f9b7d6b2.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/d69723fc74be.woff2 +0 -0
- package/site/app/vendor/cdn/fonts/fonts.css +459 -0
- package/site/app/vendor/cdn/marked.js +8 -0
- package/site/app/vendor/cdn/prismjs/components/prism-bash.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-clike.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-core.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-css.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-diff.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-go.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-javascript.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-json.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-jsx.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-markdown.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-markup.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-python.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-rust.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-sql.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-toml.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-tsx.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-typescript.min.js +1 -0
- package/site/app/vendor/cdn/prismjs/components/prism-yaml.min.js +1 -0
package/AGENTS.md
CHANGED
|
@@ -139,3 +139,13 @@ Throttle renders via `requestAnimationFrame` to avoid event storm during burst l
|
|
|
139
139
|
**First request to `/v1/history/*` triggers loadOnce() that walks all JSONL files under ~/.claude/projects** (env default; override with `CLAUDE_PROJECTS_DIR`). In our test env: 299 files, 80MB, 69k events → 30-90s startup latency. Health check timeouts during this window are normal and expected. Subsequent requests are fast (cached index).
|
|
140
140
|
|
|
141
141
|
The endpoints are served by ccsniff's Express router mounted in-process from `server.js`. No external proxy.
|
|
142
|
+
|
|
143
|
+
## Zero-runtime-CDN: vendored DS deps (2026-05-28)
|
|
144
|
+
|
|
145
|
+
The GUI runs fully offline. `site/app/vendor/cdn/` holds marked, dompurify, prismjs components, and JetBrains+Space Grotesk woff2. The DS bundle (`anentrypoint-design/247420.js`) had its CDN string constants rewritten to local paths, AND its gzip+base64-embedded CSS blob (`Ha`) regenerated to point at local fonts. Full mechanism is in rs-learn (recall "DS bundle gzip Ha vendoring"). Witness offline by browser route-abort of non-origin hosts.
|
|
146
|
+
|
|
147
|
+
## Agent/model/session management (2026-05-28)
|
|
148
|
+
|
|
149
|
+
- `agents.list` (WS) returns `available` + `npxInstallable` per agent; `agents.models` returns model choices (claude-code → sonnet/opus/haiku). The chat picker is **agent-then-model**, not a flat model list. Unavailable agents are disabled/gated.
|
|
150
|
+
- `chat.sendMessage` accepts `cwd` (defaults to STARTUP_CWD) and `model`/`agentId` separately. `chat.active` (WS) lists in-flight chats with agentId/model/cwd/startedAt/pid; the history tab polls it (3s) and shows a running panel with per-session stop.
|
|
151
|
+
- Client (`app.js`): chat transcript persists to `localStorage[agentgui.chat]` and restores on load; tool_use/result events render as chat parts; keyboard shortcuts (g+c/h/s, n, /, ?); settings has an agents-status panel from `health.acp[]`.
|
|
@@ -25,6 +25,31 @@ export class AgentRegistry {
|
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
isAvailable(agentId) {
|
|
29
|
+
if (!this._availCache) this._availCache = new Map();
|
|
30
|
+
if (this._availCache.has(agentId)) return this._availCache.get(agentId);
|
|
31
|
+
const a = this.agents.get(agentId);
|
|
32
|
+
if (!a) return false;
|
|
33
|
+
let ok = false;
|
|
34
|
+
try {
|
|
35
|
+
const whichCmd = isWindows ? 'where' : 'which';
|
|
36
|
+
const which = spawnSync(whichCmd, [a.command], { encoding: 'utf-8', timeout: 3000 });
|
|
37
|
+
if (which.status === 0 && (which.stdout || '').trim()) ok = true;
|
|
38
|
+
if (!ok && a.npxPackage) {
|
|
39
|
+
ok = ['bun', 'npx'].some(r => {
|
|
40
|
+
const c = spawnSync(whichCmd, [r], { encoding: 'utf-8', timeout: 3000 });
|
|
41
|
+
return c.status === 0 && (c.stdout || '').trim();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} catch { ok = false; }
|
|
45
|
+
this._availCache.set(agentId, ok);
|
|
46
|
+
return ok;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
listWithAvailability() {
|
|
50
|
+
return this.list().map(a => ({ ...a, available: this.isAvailable(a.id), npxInstallable: !!a.npxPackage }));
|
|
51
|
+
}
|
|
52
|
+
|
|
28
53
|
listACPAvailable() {
|
|
29
54
|
return this.list().filter(agent => {
|
|
30
55
|
try {
|
package/lib/ws-handlers-util.js
CHANGED
|
@@ -26,10 +26,27 @@ export function register(router, deps) {
|
|
|
26
26
|
protocol: a.protocol,
|
|
27
27
|
supportsStdin: !!a.supportsStdin,
|
|
28
28
|
features: a.supportedFeatures || [],
|
|
29
|
+
available: registry.isAvailable(a.id),
|
|
30
|
+
npxInstallable: !!a.npxPackage,
|
|
29
31
|
}));
|
|
30
32
|
return { agents };
|
|
31
33
|
});
|
|
32
34
|
|
|
35
|
+
// --- agents.models: model choices for a given agent ---
|
|
36
|
+
router.handle('agents.models', (p) => {
|
|
37
|
+
const id = p?.id || p?.agentId;
|
|
38
|
+
if (!id) err(400, 'agent id required');
|
|
39
|
+
if (id === 'claude-code') {
|
|
40
|
+
return { models: [
|
|
41
|
+
{ id: 'sonnet', name: 'Claude Sonnet (latest)' },
|
|
42
|
+
{ id: 'opus', name: 'Claude Opus (latest)' },
|
|
43
|
+
{ id: 'haiku', name: 'Claude Haiku (latest)' },
|
|
44
|
+
] };
|
|
45
|
+
}
|
|
46
|
+
// Other agents pick their model via their own config/login; none surfaced here.
|
|
47
|
+
return { models: [] };
|
|
48
|
+
});
|
|
49
|
+
|
|
33
50
|
// --- conversation.subscribe: register this ws for sessionId broadcasts ---
|
|
34
51
|
router.handle('conversation.subscribe', (p, ws) => {
|
|
35
52
|
const sid = p?.sessionId;
|
|
@@ -61,7 +78,7 @@ export function register(router, deps) {
|
|
|
61
78
|
ws.subscriptions = ws.subscriptions || new Set();
|
|
62
79
|
ws.subscriptions.add(sessionId);
|
|
63
80
|
|
|
64
|
-
const ctrl = { aborted: false, proc: null };
|
|
81
|
+
const ctrl = { aborted: false, proc: null, agentId, model, cwd, startedAt: Date.now() };
|
|
65
82
|
activeChats.set(sessionId, ctrl);
|
|
66
83
|
|
|
67
84
|
// Fire-and-forget. Errors broadcast as streaming_error.
|
|
@@ -104,6 +121,15 @@ export function register(router, deps) {
|
|
|
104
121
|
return { sessionId, started: true };
|
|
105
122
|
});
|
|
106
123
|
|
|
124
|
+
// --- chat.active: list in-flight chats started via this server ---
|
|
125
|
+
router.handle('chat.active', () => {
|
|
126
|
+
const sessions = [];
|
|
127
|
+
for (const [sid, c] of activeChats) {
|
|
128
|
+
sessions.push({ sessionId: sid, agentId: c.agentId || null, model: c.model || null, cwd: c.cwd || null, startedAt: c.startedAt || null, pid: c.proc?.pid || null });
|
|
129
|
+
}
|
|
130
|
+
return { sessions };
|
|
131
|
+
});
|
|
132
|
+
|
|
107
133
|
// --- chat.cancel: abort an in-flight chat ---
|
|
108
134
|
router.handle('chat.cancel', (p) => {
|
|
109
135
|
const sid = p?.sessionId;
|