agentgui 1.0.978 → 1.0.980

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.
@@ -90,9 +90,17 @@ export function register(router, deps) {
90
90
  // Bypasses the gutted db-queries layer entirely; calls runClaudeWithStreaming
91
91
  // directly and broadcasts streaming_* events scoped to an ephemeral sessionId.
92
92
  router.handle('chat.sendMessage', async (p, ws) => {
93
- const content = (p?.content || '').toString();
93
+ let content = (p?.content || '').toString();
94
94
  if (!content) err(400, 'content required');
95
95
  const agentId = p?.agentId || 'claude-code';
96
+ // For non-resume agents (not claude-code which uses --resume), prepend prior
97
+ // conversation turns so the agent has context. claude-code handles multi-turn
98
+ // natively via resumeSessionId; direct runners (agy, etc.) get a preamble.
99
+ const priorMessages = Array.isArray(p?.messages) ? p.messages.filter(m => m?.role && m?.content) : [];
100
+ if (agentId !== 'claude-code' && !p?.resumeSid && !p?.resumeSessionId && priorMessages.length > 0) {
101
+ const preamble = priorMessages.map(m => (m.role === 'user' ? 'User: ' : 'Assistant: ') + (m.content || '').trim()).join('\n\n');
102
+ content = '[Prior conversation]\n' + preamble + '\n\n[Current message]\n' + content;
103
+ }
96
104
  const model = p?.model || undefined;
97
105
  const subAgent = p?.subAgent || undefined;
98
106
  const cwd = p?.cwd || STARTUP_CWD;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.978",
3
+ "version": "1.0.980",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
@@ -2275,7 +2275,7 @@ async function sendChat(textArg) {
2275
2275
  agentId: state.selectedAgent,
2276
2276
  model: state.selectedModel || undefined,
2277
2277
  cwd: state.chatCwd || undefined,
2278
- messages: state.chat.messages.slice(0, -1).map(m => ({ role: m.role, content: m.content })),
2278
+ messages: state.chat.messages.slice(0, -1).map(m => ({ role: m.role, content: m.content || messageToText(m) })),
2279
2279
  signal: ctrl.signal,
2280
2280
  // Only claude-code consumes a resume sid; never forward a stale one to
2281
2281
  // another agent (it makes agy spuriously run --continue).
@@ -2558,6 +2558,7 @@ function historyMain() {
2558
2558
  const errMark = e.isError ? ' · error' : '';
2559
2559
  const raw = e.text || '';
2560
2560
  const text = raw.replace(/\s+/g, ' ').trim();
2561
+ const typePrefix = e.type === 'tool_result' ? '(result) ' : (e.type === 'tool_use' ? '(tool call) ' : '');
2561
2562
  const expanded = state.expandedEvents.has(key);
2562
2563
  // Only build the expanded body (JSON.stringify tool input) when the row is
2563
2564
  // expanded - doing it for all ~300 rows every frame wastes work mid-stream.
@@ -2569,7 +2570,7 @@ function historyMain() {
2569
2570
  // When the session was opened from a search hit, window the collapsed
2570
2571
  // title AROUND the first query match (a match at char 5000 would
2571
2572
  // otherwise be invisible behind the 0-220 slice).
2572
- let collapsedTitle = text.slice(0, 220);
2573
+ let collapsedTitle = typePrefix + text.slice(0, 220);
2573
2574
  const q = state.sessionSearchQ;
2574
2575
  if (q && !expanded) {
2575
2576
  const qi = text.toLowerCase().indexOf(q.toLowerCase());
@@ -2585,7 +2586,7 @@ function historyMain() {
2585
2586
  label: 'copy', title: 'copy event',
2586
2587
  onClick: () => copyText(full || raw || ('(' + type + ')'), 'event copied'),
2587
2588
  }] : undefined,
2588
- title: expanded ? (text || '(' + type + ')') : (collapsedTitle || '(' + type + ')'),
2589
+ title: expanded ? (typePrefix + (text || '(' + type + ')')) : (collapsedTitle || typePrefix + '(' + type + ')'),
2589
2590
  detail: expanded && e.toolInput ? JSON.stringify(e.toolInput, null, 2) : undefined,
2590
2591
  // Guard ts: a missing/zero timestamp renders "Invalid Date" otherwise.
2591
2592
  // Every row is click-to-expand, so always show the affordance word
@@ -3128,6 +3128,12 @@
3128
3128
  Accessibility Enhancements
3129
3129
  -------------------------------------------------------------- */
3130
3130
 
3131
+ /* Base focus-visible: 2px ring + 2px offset clears dark bg-3 surfaces (WCAG 1.4.11) */
3132
+ .ds-247420 :focus-visible {
3133
+ outline: 2px solid var(--accent);
3134
+ outline-offset: 2px;
3135
+ }
3136
+
3131
3137
  /* Enhanced focus-visible for all interactive elements */
3132
3138
  .ds-247420[role="button"]:focus-visible,
3133
3139
  .ds-247420[role="link"]:focus-visible,
@@ -5729,6 +5735,14 @@
5729
5735
  .ds-247420 .agentchat-cwd-text { max-width: 42vw; }
5730
5736
  .ds-247420 .agentchat-controls { gap: .4em; }
5731
5737
  }
5738
+ /* 360px: buttons fill full width so they remain tappable at the narrowest phones */
5739
+ @media (max-width: 400px) {
5740
+ .ds-247420 .agentchat-controls .btn, .ds-247420 .agentchat-controls .btn-primary, .ds-247420 .agentchat-controls button { flex: 1 1 100%; }
5741
+ }
5742
+ /* Coarse-pointer (touch): raise cwd button to 44px minimum tap target */
5743
+ @media (pointer: coarse) {
5744
+ .ds-247420 .agentchat-cwd-btn { min-height: 44px; }
5745
+ }
5732
5746
 
5733
5747
  /* ----------------------------------------------------------------------------
5734
5748
  Global status disc — a CSS-drawn status indicator (no text glyph) usable