@pmate/chat-sdk 0.12.0-next.77 → 0.12.0-next.78

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.
@@ -339,7 +339,12 @@ export class ChatSession {
339
339
  if (running)
340
340
  return running;
341
341
  const task = (async () => {
342
- const recent = await this.getMessages(threadId);
342
+ const cached = this.messages.getSnapshot(threadId), known = this.historyEdges.get(threadId);
343
+ // The earlier-page path validates its own durable scope and coverage.
344
+ // A known boundary does not require rereading/reconfirming the newest
345
+ // message bodies before loading older messages.
346
+ const recent = cached?.complete && known?.hasEarlier && known.version === cached.resetVersion
347
+ ? cached : await this.getMessages(threadId);
343
348
  if (!recent.complete)
344
349
  throw new Error("MESSAGE_WINDOW_INCOMPLETE");
345
350
  const edge = this.historyEdges.get(threadId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/chat-sdk",
3
- "version": "0.12.0-next.77",
3
+ "version": "0.12.0-next.78",
4
4
  "description": "Local-first chat SDK, message subscriptions, reading state, and shared chat UI primitives",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",