agentgui 1.0.955 → 1.0.957

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.
@@ -0,0 +1,95 @@
1
+ export const meta = {
2
+ name: 'gui-cohesion',
3
+ description: 'Drive a maximum-effort cohesion sweep of the agentgui GUI toward a single, polished claude.ai/code / cowork / Claude-Desktop-class chat-agent product: per-lens designer agents benchmark each surface against the real reference products, an adversarial verifier confirms each cohesion gap against the live source (kept-typography guard), a synthesizer orders them into a dependency-aware kit-vs-app build plan',
4
+ whenToUse: 'Run after the Claude-Desktop redesign AND the predictability-polish sweep have landed (WorkspaceShell + ConversationList + Files + Live dashboard + ContextPane + sort/filter/jump/message-actions all exist). Distinct from the three prior workflows: gui-audit hunts JANK, gui-overhaul DESIGNS new surfaces, gui-predictability-polish polishes the SHIPPED shell. This one hunts the COHESION / product-feel gap - whether all the surfaces read as ONE polished chat-agent product rather than a kit of parts, measured against claude.ai/code, cowork, and Claude Desktop as explicit benchmarks. It treats the three user-named must-haves as first-class lenses: (1) the chat thread feels like a chat agent, (2) folder browsing is an fsbrowse-grade file view, (3) all live sessions are viewable and manageable simultaneously. All visual/component work lands in c:\\dev\\anentrypoint-design; the app keeps wiring; no new index.html !important overrides.',
5
+ phases: [
6
+ { title: 'Benchmark', detail: 'one designer per cohesion lens benchmarks the surface against the real reference products + names concrete gaps' },
7
+ { title: 'Verify', detail: 'adversarially confirm each cohesion gap is real against the live source (kept-typography guard)' },
8
+ { title: 'Plan', detail: 'synthesize confirmed gaps into a dependency-ordered kit-vs-app build plan' },
9
+ ],
10
+ };
11
+
12
+ // Shared grounding: every lens reads the REAL post-redesign + post-polish source.
13
+ // The shell, rail, files, live dashboard, chat, and context pane all EXIST and
14
+ // are already polished once - this sweep hunts the COHESION gap, not from-scratch
15
+ // redesign and not the primitive edges the polish sweep already closed.
16
+ const GROUND =
17
+ ' GROUND IN REAL SOURCE (read, do not guess - the redesign AND the predictability-polish sweep HAVE shipped): agentgui front-end c:\\dev\\agentgui\\site\\app\\js\\app.js (view/sessionsColumn/workspaceRail/filesMain/liveMain/chatMain/historyMain/settingsMain/sendChat/sessionGroups) + backend.js + index.html. The kit c:\\dev\\anentrypoint-design\\src\\components\\{shell.js (WorkspaceShell/WorkspaceRail),sessions.js (ConversationList/SessionDashboard/SessionCard),agent-chat.js,chat.js,files.js,files-modals.js,context-pane.js,content.js} + root css {app-shell.css,chat.css,colors_and_type.css}. Server c:\\dev\\agentgui\\lib\\http-handler.js. Reference products to benchmark AGAINST (describe from product knowledge - these are the bar): claude.ai/code, cowork, Claude Desktop. The fsbrowse reference file manager lives at c:\\dev\\fsbrowse (server.js + public/ + index.js) - read it for the file-view bar.' +
18
+ ' POLICY: the components ALREADY EXIST and are polished once - find the COHESION gap (does the whole thing read as ONE product), the remaining feel gap vs the reference products, and any surface that still reads as primitive/kit-of-parts. ALL visual/component work lands in the KIT as correct defaults/props; the app keeps state + callback wiring; NEVER new index.html !important overrides (convert any to a kit default); use kit color/type tokens not hardcoded hex; NO decorative glyphs (arrows/box-drawing/bullets/checks/status-dot chars/emoji) - ASCII words + the CSS .status-dot-disc, but KEEP the typographic product set (middot, ellipsis, em/en-dash); every surface needs a11y (roles/aria/focus/44x44/keyboard), responsive (<640 + 420px), and explicit empty/loading/error states.';
19
+
20
+ // Each lens is a cohesion dimension, not a single surface - it asks whether the
21
+ // product as a whole clears the reference-product bar on that dimension.
22
+ const LENSES = [
23
+ { key: 'chat-agent-feel', prompt: 'COHESION LENS - does the CHAT THREAD feel like a real chat agent (claude.ai/code / Claude Desktop)? Benchmark the whole conversation experience, not one widget: message rhythm + vertical spacing + readable measure (max-width), clear assistant-vs-user distinction (role label / subtle background / avatar-or-mark), code blocks with language label + copy button + syntax highlight, inline tool cards that read as a coherent run log (not raw JSON), markdown typography matching the reference, a stream caret + smooth non-janky streaming, per-message actions (copy/retry/edit-resend) that feel native, a composer that auto-grows with Enter=send / Shift+Enter=newline and an inline agent+model+cwd affordance, an inviting empty state, and contextual follow-up suggestions. Name every place the thread still reads as primitive vs the bar.' + GROUND },
24
+ { key: 'fsbrowse-file-view', prompt: 'COHESION LENS - is FOLDER BROWSING an fsbrowse-grade file view? READ c:\\dev\\fsbrowse (server.js + public/ + index.js) for the bar, then compare agentgui Files. Benchmark: breadcrumb nav + roots picker, dir-first sort by name/size/modified, type-distinguishing icons (ASCII/CSS not glyphs), a real preview (text/code with syntax highlight + image) ideally as a persistent side pane not a modal, keyboard nav (arrows/Enter/Backspace/Home/End), loading skeleton, empty-dir + error + permission-denied states, large-dir handling (virtualize/paginate), and a discoverable use-as-chat-cwd flow that ties the file view back into the chat agent. Name every gap vs fsbrowse + vs a Claude-Desktop file pane.' + GROUND },
25
+ { key: 'simultaneous-live-sessions', prompt: 'COHESION LENS - can a user VIEW ALL LIVE SESSIONS and MANAGE THEM SIMULTANEOUSLY (claude.ai/code parallel-agents feel)? Benchmark the Live dashboard + the conversation rail as one oversight surface: per-session live metrics (events/tokens/elapsed/current-tool/status with words+disc, busy-vs-stuck-vs-idle distinguishable at a glance), real-time updates with no flicker, per-session stop/open/resume, bulk select + stop-all, sort/filter sessions, running sessions pinned, a clear empty vs offline distinction, and the ability to jump between active sessions without losing place. Does it actually let you run and oversee several agents at once, or only show one? Name every gap.' + GROUND },
26
+ { key: 'shell-navigation-cohesion', prompt: 'COHESION LENS - does the WorkspaceShell + rail + ContextPane read as ONE app (Claude Desktop three-pane feel)? Benchmark: rail/sessions/main/pane proportions + collapse persistence + responsive reflow with NO dead column at any breakpoint, collapsed icon-rail keeps accessible names + announced keyboard collapse toggle, mobile (<900px) drawers with focus-trap + Esc + backdrop dismiss + auto-close-on-select, the ContextPane is informative (usage/last-turn tokens-cost-turns-duration, session metadata, recent files) not a dead static panel, the crumb/header/status vocab is identical across tabs, and navigation between Chat/History/Files/Live/Settings preserves state + feels instant. Name every place it reads as a kit of separate pages rather than one shell.' + GROUND },
27
+ { key: 'visual-system-cohesion', prompt: 'COHESION LENS - is there ONE visual system across every surface (the thing that makes a product feel designed)? Benchmark: consistent type scale + spacing rhythm + radius + elevation/shadow + color tokens (no hardcoded hex, no per-surface drift), uniform status vocab (connected/connecting/offline) + rail tone semantics (green=ok/selected, purple=subagent, flame=error) + relative-time format + empty-state copy across Files/Live/ContextPane/ConversationList/chat/history/settings, identical button/row/card primitives reused (not re-styled per surface), and ZERO decorative glyphs (KEEP only middot/ellipsis/em-en-dash; one sighting -> codebase-wide list). Also enumerate every index.html !important / local override of a kit rule and the KIT default that eliminates it. List each divergence + the unifying kit fix.' + GROUND },
28
+ { key: 'crosscut-perf-a11y-responsive-security', prompt: 'CROSS-CUTTING - performance + a11y + responsive + security across ALL surfaces (a product that janks or 403-leaks does not feel polished). Perf: audit scheduleRender/scheduleStreamRender coalescing, render purity (no fetch/loadDir in render), the 3s chat.active poll re-rendering ConversationList + SessionDashboard every tick, EventList/FileGrid building full bodies for hundreds of rows - find per-frame O(n) waste + a fix (change-diff / virtualize / pagination). A11y: each surface needs roles (listbox/tablist/dialog), aria, focus management + focus-visible, skip-link reach, modal focus-trap, WCAG colour-not-only status, 44x44 tap targets, prefers-reduced-motion - list gaps. Responsive: every surface at 420px + 1440px - no h-scroll, columns reflow. Security: re-audit /api/list + /api/image + /api/file allowlist confinement (normalize + fs.realpathSync resolved-prefix, 403 outside roots, symlink-escape fails closed), CORS gating under PASSWORD, markdown XSS (safeUrl + DOMPurify in the inline renderer that bypasses DOMPurify), WS token threading - confirm each holds or name the hole with file:line.' + GROUND },
29
+ ];
30
+
31
+ const GAP_SCHEMA = {
32
+ type: 'object',
33
+ required: ['lens', 'gaps'],
34
+ properties: {
35
+ lens: { type: 'string' },
36
+ gaps: {
37
+ type: 'array',
38
+ items: {
39
+ type: 'object',
40
+ required: ['title', 'where', 'fixLocation', 'fix', 'severity'],
41
+ properties: {
42
+ title: { type: 'string', description: 'the cohesion / feel gap vs the reference product bar' },
43
+ where: { type: 'string', description: 'file:line or component the gap lives in' },
44
+ fixLocation: { type: 'string', enum: ['kit', 'app', 'server', 'kit+app'], description: 'where the fix lands' },
45
+ fix: { type: 'string', description: 'the concrete change: component/prop/css/wiring' },
46
+ benchmark: { type: 'string', description: 'which reference product (claude.ai/code, cowork, Claude Desktop, fsbrowse) sets the bar this gap fails' },
47
+ severity: { type: 'string', enum: ['high', 'medium', 'low'] },
48
+ keptTypography: { type: 'boolean', description: 'true if this touches the middot/ellipsis/dash set - which must NOT be flagged as a glyph violation' },
49
+ },
50
+ },
51
+ },
52
+ },
53
+ };
54
+
55
+ const VERDICT_SCHEMA = {
56
+ type: 'object',
57
+ required: ['title', 'real', 'reason'],
58
+ properties: {
59
+ title: { type: 'string' },
60
+ real: { type: 'boolean', description: 'true if the gap is real and the fix is sound against the live source' },
61
+ reason: { type: 'string', description: 'why - cite the source you read' },
62
+ },
63
+ };
64
+
65
+ phase('Benchmark');
66
+ // Pipeline: each lens is benchmarked, then every gap it found is adversarially
67
+ // verified the moment that lens returns - no barrier between phases.
68
+ const verified = await pipeline(
69
+ LENSES,
70
+ (l) => agent(l.prompt, { label: 'benchmark:' + l.key, phase: 'Benchmark', schema: GAP_SCHEMA }),
71
+ (report, l) => parallel((report?.gaps || []).map((g) => () =>
72
+ agent(
73
+ 'Adversarially verify this GUI cohesion gap against the REAL source (read the cited file - do not trust the claim). '
74
+ + 'KEPT-TYPOGRAPHY GUARD: the middot, ellipsis, and em/en-dash are intentional product typography - if the "gap" is merely flagging one of those as a decorative glyph, it is NOT real (real=false). '
75
+ + 'A gap is real only if it genuinely exists in the shipped source AND clearing it measurably moves the product toward the cited reference-product bar AND the proposed fix is sound and lands in the right place (kit vs app vs server). '
76
+ + 'Reject vague "make it nicer" gaps with no concrete source-grounded fix. '
77
+ + 'Gap: ' + JSON.stringify(g),
78
+ { label: 'verify:' + (g.title || '').slice(0, 32), phase: 'Verify', schema: VERDICT_SCHEMA }
79
+ ).then((v) => ({ ...g, lens: report.lens, verdict: v }))
80
+ ))
81
+ );
82
+
83
+ const confirmed = verified.flat().filter(Boolean).filter((g) => g.verdict && g.verdict.real);
84
+ log('confirmed ' + confirmed.length + ' real cohesion gaps across ' + LENSES.length + ' lenses');
85
+
86
+ phase('Plan');
87
+ const plan = await agent(
88
+ 'Synthesize these adversarially-confirmed GUI cohesion gaps into a dependency-ordered, kit-vs-app build plan for agentgui + the anentrypoint-design kit, aimed at making the whole product read as ONE polished claude.ai/code / cowork / Claude-Desktop-class chat agent. '
89
+ + 'Group by fixLocation (kit first - they unblock app wiring), order so shared kit components (ConversationList, SessionDashboard, SessionCard, AgentChat, ChatMessage, FileGrid, WorkspaceShell, ContextPane) are each edited ONCE with all their changes batched, then app wiring, then server changes, then the single build->vendor->witness step. '
90
+ + 'Call out which gaps share a component (batch them), which are independent (parallelizable), which conflict, and the highest-leverage few that most move the product toward the reference bar. '
91
+ + 'Confirmed gaps: ' + JSON.stringify(confirmed),
92
+ { label: 'synthesize-plan', phase: 'Plan' }
93
+ );
94
+
95
+ return { confirmed, plan, lensCount: LENSES.length, confirmedCount: confirmed.length };
package/AGENTS.md CHANGED
@@ -14,19 +14,9 @@ A polish sweep on top of the shipped Claude-Desktop redesign (workflow `wf_98034
14
14
 
15
15
  ## Claude-Desktop redesign + embedding fix (2026-06-05) — fourth maximum-effort run
16
16
 
17
- A full GUI overhaul toward a claude.ai/code / Claude Desktop / cowork feel, plus a no-compromises fix to the gm-plugkit WASM embedding wedge.
17
+ Shipped the three-column **WorkspaceShell** + **WorkspaceRail** (kit `shell.js`, `.ws-*` in `app-shell.css`, collapse persisted `localStorage ds.ws.{rail,pane}`), the shared **ConversationList** rail (`sessions.js`), the **Files** view (server `/api/list` allowlist-confined + `backend.js listDir()` + `app.js filesMain()` with kit `BreadcrumbPath`/`FileGrid`, mirrors `c:\dev\fsbrowse`), and the **Live dashboard** (`SessionDashboard`/`SessionCard`). Also a no-compromises gm-plugkit WASM embedding fix (incremental re-embed, `rs-plugkit ab09ed0`). The 5th run (above) polished all of these. Full detail in rs-learn (recall "agentgui Claude-Desktop redesign").
18
18
 
19
- **Shell.** The app moved from Topbar-tabs to a **three-column WorkspaceShell** (new kit component in `shell.js`: `WorkspaceShell({rail, sessions, main, pane, crumb, status, narrow})` + `WorkspaceRail({brand, action, items, footer})`, CSS `.ws-*` in `app-shell.css`, grid layout, collapse persisted to `localStorage ds.ws.{rail,pane}`, mobile <900px = fixed rail + overlay drawers). `app.js view()` composes it; a left rail nav drives `chat/history/files/live/settings` (keyboard `g+c/h/f/l/s`).
20
-
21
- **New surfaces.** (1) **Conversation rail** — kit `ConversationList` (`sessions.js`, `.ds-session*`): the chat+history tabs share a session list (title/project/time/running dot/rail tone, inline search, New chat). `app.js sessionsColumn()` feeds it; chat-tab select -> `resumeInChat`, history-tab -> `loadSession`. Sessions load on chat-tab entry + boot (not just History). (2) **Files view** — server `/api/list` (`lib/http-handler.js`, allowlist-confined like `/api/image`: STARTUP_CWD/CLAUDE_PROJECTS_DIR/FS_ROOTS, normalize+resolved-prefix, 403 outside) + `backend.js listDir()` + `app.js filesMain()` rendering kit `BreadcrumbPath`+`FileGrid`; "use as chat cwd" sets the working dir by browsing. Mirrors the existing `c:\dev\fsbrowse` (same kit) but is a thin in-process endpoint, not the fsbrowse server. (3) **Live dashboard** — kit `SessionDashboard`/`SessionCard` (`sessions.js`, `.ds-dash*`): `app.js liveMain()` maps `state.active` (the existing 3s `chat.active` poll) to cards with per-session Stop/Open/Resume/events acting on each sid independently; empty + offline states.
22
-
23
- **webjsx keying class-bug (load-bearing).** Mixing keyed VElements with `null`/strings in any children array crashes `applyDiff` ("reading 'key'"). Fixed in `ConversationList` (stable keyed body wrapper so loading/empty/populated diff children not container; `[...].filter(Boolean)` on conditional row children) AND `app.js runningPanel` (all three row children keyed). Also `refreshHistory` `render()` moved OUT of the try so a render exception no longer masquerades as a history fetch error. See the existing webjsx note below.
24
-
25
- **Embedding fix (no-compromises, user-demanded).** The gm-plugkit WASM (`c:\dev\rs-plugkit`, the SINGLE owner of `code_index.rs`+`embed.rs`; built `cargo build --release --target wasm32-wasip1 --no-default-features --features wasm --lib` via wasi-sdk 24, deployed to `~/.gm-tools/plugkit.wasm`) froze its heartbeat 5+ min on every git-digest change because `code_index::index()` cleared all embeddings and re-embedded every chunk synchronously. Fixed with **incremental re-embed**: per-file `crc32` content hash in a new `codeinsight-manifest` namespace; unchanged files reuse persisted chunk embeddings, only changed/new files re-embed, deleted files reaped; removed the pre-emptive `clear_codeinsight()` on digest-mismatch (kept it for explicit `rebuild:true`). One-time manifest-seeding pass on first index after deploy, then incremental. **Witnessed**: after seeding, a 2nd digest change rebuilt in ~4s with 134ms max heartbeat gap (was 5+ min), real cosine hits. Commit `rs-plugkit` `ab09ed0` (push pending network). The `host_vec_embed` delegate contract in `embed.rs` is preserved for a future host-side fast path.
26
-
27
- **Workflow deliverable.** `.claude/workflows/gui-overhaul.js` — a redesign-driver (8 per-surface designers -> feasibility+policy review with override/glyph/token guards -> dependency-ordered build plan), distinct from the jank-hunting `gui-audit.js`.
28
-
29
- **Witness.** All surfaces browser-witnessed at `http://localhost:3000/gm/`: WorkspaceShell renders, rail nav [Chat,History,Files,Live,Settings], sessions rows, files 60 rows + breadcrumb, live dashboard, rail collapse persists, 0 console errors, `decorativeGlyphs=[]` (kept middot intact), a11y roles/aria/skip-link, responsive 420px no h-scroll. Kit `lint-glyphs`+`lint-tokens` pass on every build. Detail in rs-learn (recall "agentgui Claude-Desktop redesign"). Update/publish flow unchanged: edit kit -> `node scripts/build.mjs` -> copy `dist/247420.{js,css}` into `site/app/vendor/anentrypoint-design/` -> browser-witness -> push kit.
19
+ **webjsx keying class-bug (load-bearing, still true).** Mixing keyed VElements with `null`/strings in any children array crashes `applyDiff` ("reading 'key'"). `ConversationList` uses a stable keyed body wrapper (loading/empty/populated diff children not container) + `[...].filter(Boolean)` on conditional row children; `app.js runningPanel` keys all three row children. `refreshHistory` keeps `render()` OUT of the try so a render exception doesn't masquerade as a history fetch error. See the webjsx note below.
30
20
 
31
21
  ## GUI-predictability sweep closure (2026-06-05) — third maximum-effort run
32
22