@m6d/cortex-client 1.0.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 ADDED
@@ -0,0 +1,42 @@
1
+ # @m6d/cortex-client
2
+
3
+ Angular AI chat UI library. Provides a self-contained chat widget with streaming messages, tool call visualization, file capture, syntax highlighting, and i18n support.
4
+
5
+ ## Usage
6
+
7
+ ```ts
8
+ import { CortexChatWidgetComponent, CortexClientConfig } from '@m6d/cortex-client';
9
+
10
+ @Component({
11
+ imports: [CortexChatWidgetComponent],
12
+ template: `<cortex-chat-widget [config]="config" />`,
13
+ })
14
+ export class MyComponent {
15
+ protected readonly config: CortexClientConfig = {
16
+ locale: signal('en'),
17
+ transport: {
18
+ baseUrl: '/api/agents/assistant',
19
+ getAuthHeaders: () => ({ Authorization: `Bearer ${token}` }),
20
+ },
21
+ wsUrl: 'ws://localhost:3000/api/ws',
22
+ };
23
+ }
24
+ ```
25
+
26
+ No root-level providers needed — each widget instance is fully self-contained. You can render multiple widgets with different configs on the same page.
27
+
28
+ ### Configuration
29
+
30
+ | Property | Type | Description |
31
+ | -------------------------- | ------------------------------- | ------------------------------------------------------- |
32
+ | `locale` | `Signal<string>` | Active locale (`"en"`, `"ar"`) |
33
+ | `transport.baseUrl` | `string \| Signal<string>` | Agent API base URL |
34
+ | `transport.getAuthHeaders` | `() => Record<string, string>` | Auth header provider |
35
+ | `wsUrl` | `string` | WebSocket URL for real-time events (optional) |
36
+ | `theme` | `CortexClientTheme` | Custom colors and styling (optional) |
37
+ | `toolComponents` | `Record<string, Type<unknown>>` | Custom Angular components for tool rendering (optional) |
38
+ | `onToolCall` | `(toolCall) => unknown` | Client-side tool call handler (optional) |
39
+
40
+ ## Requirements
41
+
42
+ - Angular >= 21.2.0