@m6d/cortex-angular 0.14.0 → 0.15.0
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 +12 -7
- package/fesm2022/m6d-cortex-angular.mjs +4691 -4497
- package/package.json +2 -9
- package/types/m6d-cortex-angular.d.ts +346 -214
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ export class MyComponent {
|
|
|
25
25
|
The widget attaches its own stylesheet; add `@m6d/cortex-angular/theme.css` to
|
|
26
26
|
your styles to override its tokens in one place (see Theming).
|
|
27
27
|
|
|
28
|
-
`baseUrl` is the agent's URL: the engine's public origin (`ENGINE_PUBLIC_URL`) plus `/agents/<agent slug>`. Add the page's origin to `ENGINE_CORS_ORIGINS`, or proxy the engine under your own origin as the samples do. The WebSocket URL is `baseUrl` plus `/ws`; set `wsUrl` only to override it, and point it at that same agent-scoped path. The bearer is the end user's token, which Cortex verifies the way the agent's auth says: a JWKS, a shared secret, the agent's server,
|
|
28
|
+
`baseUrl` is the agent's URL: the engine's public origin (`ENGINE_PUBLIC_URL`) plus `/agents/<agent slug>`. Add the page's origin to `ENGINE_CORS_ORIGINS`, or proxy the engine under your own origin as the samples do. The WebSocket URL is `baseUrl` plus `/ws`; set `wsUrl` only to override it, and point it at that same agent-scoped path. The bearer is the end user's token, which Cortex verifies the way the agent's auth says: a JWKS, a shared secret, or the agent's server. For an anonymous agent, leave `getHeaders` out: the widget signs in as a visitor, and Cortex gives the browser an ID it keeps in local storage. When the agent checks visitors with reCAPTCHA Enterprise, the widget loads Google's script with the agent's site key and runs the check invisibly. The widget hides the badge Google draws for the agent's site key, and Google's terms then ask your page to show its reCAPTCHA attribution. A badge your page draws for its own key stays.
|
|
29
29
|
|
|
30
30
|
No root-level providers are needed. Each widget is self-contained, so one page can render several widgets with different configs.
|
|
31
31
|
|
|
@@ -35,9 +35,9 @@ No root-level providers are needed. Each widget is self-contained, so one page c
|
|
|
35
35
|
|
|
36
36
|
| Property | Type | Description |
|
|
37
37
|
| -------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
38
|
-
| `locale` | `'en' \| 'ar'` | Active locale (default: `'en'`)
|
|
38
|
+
| `locale` | `'en' \| 'ar'` | Active locale; the widget lays out in its direction (default: `'en'`) |
|
|
39
39
|
| `transport.baseUrl` | `string \| () => string` | The agent's URL, `<engine origin>/agents/<slug>` |
|
|
40
|
-
| `transport.getHeaders
|
|
40
|
+
| `transport.getHeaders?` | `() => Headers \| Promise<Headers>` | Request headers provider; `Headers` is `Record<string, string>` |
|
|
41
41
|
| `wsUrl` | `string \| false` | WebSocket URL override; `false` disables the socket (optional) |
|
|
42
42
|
| `viewMode` | `'helper' \| 'full'` | Compact panel or full layout with a sidebar (default: `'helper'`) |
|
|
43
43
|
| `theme` | `'light' \| 'dark' \| 'system'` | Color scheme (default: `'light'`) |
|
|
@@ -206,7 +206,10 @@ That is how a tool of type `client` ("Answered by your app" in the console)
|
|
|
206
206
|
works: return its output from `hooks.onToolCall` for that tool name, or draw it
|
|
207
207
|
with a tool component. A `hooks.onToolCall` must return `undefined` for tool
|
|
208
208
|
names it does not own, since answering an unknown pending call would settle an
|
|
209
|
-
embedded flow before the user completes it.
|
|
209
|
+
embedded flow before the user completes it. A tool component draws a pending
|
|
210
|
+
call only once Cortex confirms the caller may send; until then, and always for
|
|
211
|
+
an operator inspecting a thread, the call shows as the widget's own line, and
|
|
212
|
+
the component draws it once it settles.
|
|
210
213
|
|
|
211
214
|
## Media blocks
|
|
212
215
|
|
|
@@ -240,8 +243,10 @@ well:
|
|
|
240
243
|
```
|
|
241
244
|
|
|
242
245
|
`mediaRenderers` swaps a renderer or adds a fence tag of your own. A renderer
|
|
243
|
-
draws a closed fence's source into the host element and
|
|
244
|
-
its context carries the widget's
|
|
246
|
+
(`MediaRenderer`) draws a closed fence's source into the host element and
|
|
247
|
+
returns its teardown; its context (`MediaRenderContext`) carries the widget's
|
|
248
|
+
color `scheme` and `locale`. The field's map of tags to renderers is
|
|
249
|
+
`MediaRenderers`. The package exports all three types:
|
|
245
250
|
|
|
246
251
|
```ts
|
|
247
252
|
mediaRenderers: {
|
|
@@ -257,4 +262,4 @@ mediaRenderers: {
|
|
|
257
262
|
## Requirements
|
|
258
263
|
|
|
259
264
|
- Angular 21.2 or 22
|
|
260
|
-
- Peer dependencies: `@tanstack/ai`, `@tanstack/ai-
|
|
265
|
+
- Peer dependencies: `@tanstack/ai`, `@tanstack/ai-client`, `marked`, `dompurify`, `highlight.js`, plus the lazily loaded `mermaid`, `vega`, `vega-lite`, `vega-embed`, `leaflet`
|