@filigran/chatbot 3.10.0 → 3.11.1

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
@@ -88,6 +88,10 @@ import { ChatPanel } from '@filigran/chatbot';
88
88
  | `contextUsageEnabled` | `boolean` | `true` | Show how full the model's context window is for the current conversation (ring + percentage in the composer toolbar). Data-driven, so it stays absent until the backend reports occupancy — see [Context usage](#context-usage). |
89
89
  | `composerToolbar` | `React.ReactNode` | — | Extra controls appended to the composer toolbar. The escape hatch for host-specific affordances (XTM One's session-tool picker) — the package never learns what they are. Pass nothing and the toolbar simply has none. |
90
90
 
91
+ Plain-data props (`requestHeaders`, `apiEndpoints`, `pageContext`, `promptSuggestions`) are compared by content and callback props are called
92
+ through a stable wrapper, so building them inline is fine. `t` and `logoIcon` are used as given: keep them stable (`useCallback` / `useMemo`),
93
+ or every render of the host re-renders every message in the thread.
94
+
91
95
  #### Resizable Sidebar Example
92
96
 
93
97
  ```tsx
@@ -667,6 +671,7 @@ Every key the package can ask for, grouped by where it appears:
667
671
  - `'Enter to send now · Esc to stop'`
668
672
  - `'Files uploading...'`
669
673
  - `'Insert prompt template'`
674
+ - `'Listening...'`
670
675
  - `'No prompt matches'`
671
676
  - `'Search prompts...'`
672
677
  - `'Send now'`
@@ -832,10 +837,14 @@ the suggestions route is unavailable the host's `promptSuggestions` prop is used
832
837
  instead, so the section is never empty.
833
838
 
834
839
  Dictation needs no configuration at all: it uses the browser's own Web Speech
835
- API, so the mic button appears wherever the API exists and is simply absent
836
- elsewhere. Finalised phrases are appended to the composer (never replacing a
837
- draft), interim words preview beside the button, and sending stops the mic so
838
- the next words cannot land in a composer the user just emptied.
840
+ API, so the mic button appears inside the text field, next to Send, wherever
841
+ the API exists and is simply absent elsewhere. It is not a toolbar item, so it
842
+ never adds the toolbar row on its own. While it listens the field turns red and
843
+ reads `Listening...`, finalised phrases are appended to the composer (never
844
+ replacing a draft), interim words preview in the line under it, and every send
845
+ (Enter, Send, Send now) stops the mic and drops the phrase still being
846
+ recognised, so no words can land in a composer the user just emptied. Stopping
847
+ the mic by hand keeps that last phrase.
839
848
 
840
849
  ### Context usage
841
850
 
@@ -947,6 +956,11 @@ returned byte-identical.
947
956
  - `remark-breaks` >= 4
948
957
  - `remark-gfm` >= 4
949
958
 
959
+ ## Dependencies
960
+
961
+ - `unified` ^11 and `remark-parse` ^11 — the ranges react-markdown 10 depends on, so a host resolves them to the copies it already has. The panel
962
+ uses them to find the top-level blocks of a streaming answer, and re-renders only the blocks that can still change.
963
+
950
964
  ---
951
965
 
952
966
  ## Development
@@ -964,6 +978,12 @@ To build:
964
978
  yarn build
965
979
  ```
966
980
 
981
+ To run the unit tests (Node's built-in test runner, which runs TypeScript natively from Node 22.18 / 23.6):
982
+
983
+ ```bash
984
+ yarn test
985
+ ```
986
+
967
987
  To publish:
968
988
 
969
989
  ```bash