claude-simple 0.2.30 → 0.2.31

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/dist/index.html CHANGED
@@ -4,13 +4,13 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
6
6
  <title>Claude Code</title>
7
- <link rel="stylesheet" href="/style.0.2.30.min.css">
7
+ <link rel="stylesheet" href="/style.0.2.31.min.css">
8
8
  <link rel="stylesheet" href="/highlight.min.css">
9
9
  <script src="/marked.min.js"></script>
10
10
  <script src="/highlight.min.js"></script>
11
11
  </head>
12
12
  <body class="h-dvh overflow-hidden flex flex-col bg-base-100 text-base-content">
13
13
  <div id="root" class="flex flex-col flex-1 overflow-hidden"></div>
14
- <script type="module" src="/app.0.2.30.min.js"></script>
14
+ <script type="module" src="/app.0.2.31.min.js"></script>
15
15
  </body>
16
16
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-simple",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude-simple": "server.js",
package/public/chat.js CHANGED
@@ -457,6 +457,9 @@ function markTurnDone() {
457
457
  flushPendingUserText();
458
458
  }
459
459
 
460
+ let chatOutputRevision = 0;
461
+ export function getChatOutputRevision() { return chatOutputRevision; }
462
+
460
463
  function handleWsMessage(msg) {
461
464
  // The socket can still receive a final frame from the previously viewed
462
465
  // session while its subscription is changing. Do not let that frame alter
@@ -494,6 +497,7 @@ function handleWsMessage(msg) {
494
497
  for (const item of msg.items) handleWsMessage(item);
495
498
  return;
496
499
  }
500
+ if (['assistant', 'assistant_stream_start', 'assistant_delta', 'thought_delta', 'tool_use'].includes(msg.type)) chatOutputRevision++;
497
501
  if (msg.type === 'session-created') {
498
502
  const selectedModel = currentModel.peek();
499
503
  ctx.sessionId = msg.sessionId;
@@ -9,7 +9,7 @@ import { api } from '../api.js';
9
9
  import { getCachedTranscript, setCachedTranscript, recentTranscript } from '../cache.js';
10
10
  import { getLastSessionContext, setLastSessionContext } from './session-context.js';
11
11
  import {
12
- connectWS, clearMessages, beginHistoryRender, endHistoryRender, appendMsg, appendSystemMsg, renderToolUse,
12
+ connectWS, clearMessages, beginHistoryRender, endHistoryRender, getChatOutputRevision, appendMsg, appendSystemMsg, renderToolUse,
13
13
  appendHistoryTokenBar, appendContextBar, flushToolBatch, coerceTs,
14
14
  stashComposerDraft, restoreComposerDraft, discardComposerAttachments, parkQueuedMessages, detachProcessingForSessionSwitch, setExternalSessionReadOnly,
15
15
  } from '../chat.js';
@@ -351,6 +351,7 @@ export async function resumeSession(sid, cwd, configDir, agent, machineId, opts
351
351
  });
352
352
  };
353
353
 
354
+ const outputRevision = getChatOutputRevision();
354
355
  let data = await fetchMsgs(resolvedAgent);
355
356
  if (request !== requestEpoch || ctx.sessionId !== sid) return;
356
357
  let msgs = Array.isArray(data) ? data : (data?.messages || []);
@@ -380,7 +381,7 @@ export async function resumeSession(sid, cwd, configDir, agent, machineId, opts
380
381
  // A reconnect can receive new stream frames while this verification read
381
382
  // is in flight. Keep those live frames authoritative; the fresh response
382
383
  // is still retained for the next open.
383
- if (isProcessing.peek() || $('messages')?.querySelector('.live-stream')) return;
384
+ if (outputRevision !== getChatOutputRevision() || $('messages')?.querySelector('.live-stream')) return;
384
385
  paintMessages(msgs, context, meta);
385
386
  } catch (e) {
386
387
  if (ctx.sessionId !== sid || request !== requestEpoch) return;