@threadplane/chat 0.0.55 → 0.0.57

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
@@ -28,7 +28,7 @@ Part of [Threadplane](https://github.com/cacheplane/angular-agent-framework).
28
28
  ## Install
29
29
 
30
30
  ```bash
31
- npm install @threadplane/chat @threadplane/langgraph marked
31
+ npm install @threadplane/chat @threadplane/langgraph @langchain/core @langchain/langgraph-sdk marked
32
32
  ```
33
33
 
34
34
  **Peer dependencies:**
@@ -149,6 +149,9 @@ interface Citation {
149
149
  title?: string;
150
150
  url?: string;
151
151
  snippet?: string;
152
+ sourceType?: string; // 'web' | 'file' | 'app' | 'memory' | custom
153
+ iconUrl?: string; // provider-supplied favicon/logo URL or data URI
154
+ publishedAt?: string | number | Date;
152
155
  extra?: unknown; // adapter-specific fields
153
156
  }
154
157
  ```
@@ -167,6 +170,7 @@ Use `<chat-citations>` to render a collapsible sources panel under assistant mes
167
170
  Inline citation markers are rendered automatically by `MarkdownCitationReferenceComponent` inside streaming markdown output — superscript indices link to the corresponding card in the sources panel.
168
171
 
169
172
  `CitationsResolverService` resolves raw `Citation` references into `ResolvedCitation` objects with full source metadata.
173
+ Citation display helpers derive the visible source type badge from `sourceType` and fall back to `web` when a URL is present.
170
174
 
171
175
  **Adapter integration:**
172
176
  - **LangGraph** — reads from `message.additional_kwargs.citations` (preferred) or `.sources` (fallback).
@@ -227,6 +231,41 @@ Without `katex` installed, or without the stylesheet, math degrades gracefully
227
231
 
228
232
  ### Theming
229
233
 
234
+ Chat compositions and primitives expose a `--tplane-chat-*` CSS variable API for colors, typography, spacing, radii, and z-index layers. Override those variables on `:root`, on the `<chat>` host, or on any ancestor:
235
+
236
+ ```css
237
+ :root {
238
+ --tplane-chat-primary: #2563eb;
239
+ --tplane-chat-on-primary: #ffffff;
240
+ --tplane-chat-radius-bubble: 12px;
241
+ }
242
+ ```
243
+
244
+ If your app already has design-system tokens, keep them as the source of truth and bridge them into the chat API:
245
+
246
+ ```css
247
+ :root {
248
+ --ds-canvas: #ffffff;
249
+ --ds-surface: #f8fafc;
250
+ --ds-border: #e2e8f0;
251
+ --ds-text-primary: #0f172a;
252
+ --ds-text-muted: #64748b;
253
+ --ds-accent: #2563eb;
254
+ --ds-font-sans: Inter, system-ui, sans-serif;
255
+
256
+ --tplane-chat-bg: var(--ds-canvas);
257
+ --tplane-chat-surface: var(--ds-surface);
258
+ --tplane-chat-surface-alt: var(--ds-surface);
259
+ --tplane-chat-separator: var(--ds-border);
260
+ --tplane-chat-text: var(--ds-text-primary);
261
+ --tplane-chat-text-muted: var(--ds-text-muted);
262
+ --tplane-chat-primary: var(--ds-accent);
263
+ --tplane-chat-font-family: var(--ds-font-sans);
264
+ }
265
+ ```
266
+
267
+ Use app tokens for app layout and `--tplane-chat-*` tokens at chat boundaries or custom chat-adjacent views. That keeps chat's public theming surface stable even if your app design-system token names change.
268
+
230
269
  `<a2ui-surface>` declares ~50 `--a2ui-*` CSS custom properties at `:host` with dark-theme defaults covering color, spacing, typography, shape radius, focus ring, motion, and elevation. Catalog components consume them via `var(--a2ui-*)`.
231
270
 
232
271
  **Built-in presets** — import one in your global stylesheet: