@m6d/cortex-angular 0.15.2 → 0.17.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 +4 -6
- package/fesm2022/m6d-cortex-angular.mjs +529 -28
- package/package.json +3 -3
- package/types/m6d-cortex-angular.d.ts +38 -19
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
|
|
28
|
+
`baseUrl` is the agent's URL: the engine's public origin (`ENGINE_PUBLIC_URL`) plus `/agents/<agent name>`. Add the page's origin to `ENGINE_CORS_ORIGINS`, or proxy the engine under your own origin as the samples do. Connecting an end user's account to an MCP server (the widget's connect card) posts from the page to the engine itself, so list the page's origin there even behind a proxy, and give the page a `Referrer-Policy` other than `no-referrer`, which sends no origin. 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
|
|
|
@@ -36,12 +36,11 @@ No root-level providers are needed. Each widget is self-contained, so one page c
|
|
|
36
36
|
| Property | Type | Description |
|
|
37
37
|
| -------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
38
38
|
| `locale` | `'en' \| 'ar'` | Active locale; the widget lays out in its direction (default: `'en'`) |
|
|
39
|
-
| `transport.baseUrl` | `string \| () => string` | The agent's URL, `<engine origin>/agents/<
|
|
39
|
+
| `transport.baseUrl` | `string \| () => string` | The agent's URL, `<engine origin>/agents/<name>` |
|
|
40
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'`) |
|
|
44
|
-
| `agentName` | `string \| { en, ar }` | Header title while no thread is selected (optional) |
|
|
45
44
|
| `thread` | `string` | A thread id to open on mount (optional) |
|
|
46
45
|
| `mediaRenderers` | `Record<string, MediaRenderer>` | Replace or add the media fences the assistant can draw (optional) |
|
|
47
46
|
| `trustSameOriginEmbeds` | `boolean` | Allow embedded tool pages served from this page's own origin (default: `false`) |
|
|
@@ -76,7 +75,7 @@ import { CortexChatWidgetComponent, CortexSlotDirective } from '@m6d/cortex-angu
|
|
|
76
75
|
<button class="cortex-widget__header-btn" (click)="chat.openHistory()">☰</button>
|
|
77
76
|
}
|
|
78
77
|
<div class="cortex-widget__chat-title-wrap">
|
|
79
|
-
<p class="cortex-widget__chat-title">{{ chat.title
|
|
78
|
+
<p class="cortex-widget__chat-title">{{ chat.title }}</p>
|
|
80
79
|
</div>
|
|
81
80
|
<button class="cortex-widget__header-btn" (click)="chat.newChat()">+</button>
|
|
82
81
|
</div>
|
|
@@ -123,8 +122,7 @@ One header serves both screens; `screen` says which is showing.
|
|
|
123
122
|
| -------------- | --------------------- | -------------------------------------------------------------------- |
|
|
124
123
|
| `screen` | `'chat' \| 'threads'` | Which screen the header is on |
|
|
125
124
|
| `viewMode` | `'helper' \| 'full'` | The configured view mode |
|
|
126
|
-
| `title` | `string
|
|
127
|
-
| `agentName` | `string \| undefined` | `agentName` in the widget's locale |
|
|
125
|
+
| `title` | `string` | The open thread's title, else the agent's display name or "New Chat" |
|
|
128
126
|
| `threadCount` | `number \| undefined` | How many conversations the history lists; undefined while it loads |
|
|
129
127
|
| `isWorking` | `boolean` | The agent is answering |
|
|
130
128
|
| `debug` | `{ shown, on }` | Whether Cortex offers the debug view, and whether it is on |
|