@m6d/cortex-angular 1.6.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m6d/cortex-angular",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Reusable AI agent chat UI library for Angular",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -76,6 +76,8 @@ export type LlmRequest = {
76
76
  output: string | null;
77
77
  tokenUsage: TokenUsage | null;
78
78
  };
79
+ /** One value for every locale, or a map keyed by locale ('en', 'ar', …). */
80
+ export type Localized<T> = T | Partial<Record<string, T>>;
79
81
  export type CortexViewMode = "helper" | "full";
80
82
  export type CortexTheme = "light" | "dark" | "system";
81
83
  export type CortexToolCallContext = {
@@ -111,7 +113,23 @@ export type CortexConfig = {
111
113
  viewMode?: CortexViewMode;
112
114
  /** Color scheme; `'system'` follows the OS preference. Defaults to `'light'`. */
113
115
  theme?: CortexTheme;
116
+ /**
117
+ * Chat header title while no thread is selected; defaults to a localized
118
+ * "New Chat". Like the other copy props, either one value for every locale
119
+ * or a map keyed by locale (`{ en: 'Support', ar: 'الدعم' }`).
120
+ */
121
+ agentName?: Localized<string>;
122
+ /** Headline of the blank-chat landing; defaults to a localized greeting. */
123
+ greeting?: Localized<string>;
124
+ /** Prompt chips on the blank-chat landing; clicking one sends it as the first message. */
125
+ suggestions?: Localized<string[]>;
114
126
  showDebugButton?: boolean;
127
+ /**
128
+ * Embedder override for the file-upload controls (attach button, drop,
129
+ * paste). The widget already hides them when the server's capability
130
+ * handshake says the agent refuses uploads; `false` hides them regardless.
131
+ */
132
+ attachments?: boolean;
115
133
  /**
116
134
  * Render embedded tool pages served from this page's own origin with their
117
135
  * full identity — which, same-origin, means no effective sandbox at all: such
@@ -202,6 +220,13 @@ declare class CortexChatService {
202
220
  * the stream, and are merged back in by message id at render time.
203
221
  */
204
222
  readonly messageMetadata: _angular_core.WritableSignal<ReadonlyMap<string, MessageMetadata>>;
223
+ /**
224
+ * Server capability AND the embedder's `config.attachments` override.
225
+ * Optimistically true until the handshake answers; most agents accept files
226
+ * and a briefly hidden button would flicker for them.
227
+ */
228
+ readonly attachmentsEnabled: _angular_core.Signal<boolean>;
229
+ private readonly serverAcceptsAttachments;
205
230
  private readonly events;
206
231
  private readonly selectedThreadSnapshot;
207
232
  private readonly config;
@@ -301,6 +326,7 @@ export declare class CortexChatWidgetComponent implements OnInit {
301
326
  protected readonly screen: _angular_core.WritableSignal<"threads" | "chat">;
302
327
  protected readonly sidebarOpen: _angular_core.WritableSignal<boolean>;
303
328
  protected readonly viewMode: _angular_core.Signal<CortexViewMode>;
329
+ protected readonly agentName: _angular_core.Signal<string | undefined>;
304
330
  private readonly composer;
305
331
  protected chatService: CortexChatService;
306
332
  protected queue: AttachmentQueueService;
@@ -312,7 +338,8 @@ export declare class CortexChatWidgetComponent implements OnInit {
312
338
  protected closeSidebar(): void;
313
339
  protected toggleDebugMode(): void;
314
340
  protected selectThread(thread: ThreadSummary): void;
315
- protected goBack(): void;
341
+ protected openHistory(): void;
342
+ protected closeHistory(): void;
316
343
  protected onWidgetDragOver(event: DragEvent): void;
317
344
  protected onWidgetDrop(event: DragEvent): void;
318
345
  protected newChat(): void;