@alwith/module-chat 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -21,6 +21,16 @@ Run bun install at the workspace root, then bun run --cwd packages/chat typechec
21
21
 
22
22
  ACP session folding stays in @alwith/api. This package owns chat presentation and interaction, not Agent processes or a second session database.
23
23
 
24
+ `update-scheduler` exports the optional, framework-independent `ChatUpdateScheduler<Snapshot>`.
25
+ The host folds every protocol update immediately, then calls `enqueue(sessionId, snapshot)`
26
+ with the complete immutable snapshot. One 16ms window publishes the latest snapshot for each
27
+ pending session in a single callback; incoming chunks never reset the deadline. Call `flush()`
28
+ after enqueueing a lifecycle/configuration change or finishing history replay, `remove(sessionId)`
29
+ when dropping a session, and `cancel()` on disconnect/disposal. The callback should publish the
30
+ batch to the UI store once. This schedules store notifications, not protocol processing or
31
+ Markdown parsing. It retains only pending snapshot references, has no React/DOM/ACP dependency,
32
+ and does not change existing components or enable batching unless the host opts in.
33
+
24
34
  `search` provides Desktop's complete find bar, DOM matching, highlights and navigation. The host supplies its viewport, labels and native-menu subscription; virtualized callers also supply source matches and an async turn-reveal callback. Key the component by session identity to discard the previous search on a session switch. Highlight ownership is per mounted search, and cancelled navigation cannot repaint after close. Source projection stays with the application's message model; the search component never reads a private store.
25
35
 
26
36
  `search-source` shares Unicode-aware literal matching and original UTF-16 offsets with DOM matching. This does **not** make raw tool fields, Markdown source or folded content equivalent to rendered text: the current per-turn occurrence index still requires a complete source-to-rendered mapping. Do not treat the current search counter as proof that every indexed match can be revealed. Automatic expansion of folded matches has not been agreed.