@m6d/cortex-angular 0.14.0 → 0.14.1

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.
@@ -2,14 +2,20 @@
2
2
 
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injector, OnInit, Signal, TemplateRef, Type } from '@angular/core';
5
- import { ToolCallPart, UIMessage } from '@tanstack/ai';
6
- import { Observable } from 'rxjs';
5
+ import { MessagePart, ToolCallPart, UIMessage } from '@tanstack/ai';
7
6
 
8
7
  declare const LOCALES: readonly [
9
8
  "en",
10
9
  "ar"
11
10
  ];
12
11
  export type Locale = (typeof LOCALES)[number];
12
+ declare const MESSAGE_ROLES: readonly [
13
+ "system",
14
+ "user",
15
+ "assistant",
16
+ "trigger"
17
+ ];
18
+ export type MessageRole = (typeof MESSAGE_ROLES)[number];
13
19
  declare const ATTACHMENT_STATUSES: readonly [
14
20
  "pending",
15
21
  "described",
@@ -55,6 +61,20 @@ export type ThreadSummary = {
55
61
  export type CreateThreadRequest = {
56
62
  variables?: Record<string, string | number | boolean>;
57
63
  };
64
+ export type TokenUsage = {
65
+ input: {
66
+ noCache: number;
67
+ cacheRead: number;
68
+ cacheWrite: number;
69
+ total: number;
70
+ };
71
+ output: {
72
+ reasoning: number;
73
+ text: number;
74
+ total: number;
75
+ };
76
+ total: number;
77
+ };
58
78
  /**
59
79
  * What Cortex offers this agent's clients, fetched once at widget startup.
60
80
  * The widget hides UI for anything absent; Cortex enforces each.
@@ -79,6 +99,17 @@ export type AgentCapabilities = {
79
99
  */
80
100
  debug: boolean;
81
101
  };
102
+ export type MessageMetadata = {
103
+ /** ISO time Cortex stored the message; stamped from the row when a transcript is served. */
104
+ createdAt?: string;
105
+ modelId?: string;
106
+ providerMetadata?: unknown;
107
+ isAborted?: boolean;
108
+ tokenUsage?: TokenUsage;
109
+ attachments?: AttachmentSummary[];
110
+ /** Set on `trigger` messages: the firing that wrote them. */
111
+ trigger?: TriggerFiringSummary;
112
+ };
82
113
  /**
83
114
  * One landing-page chip: the widget shows `title` and sends `prompt` as the
84
115
  * first message when clicked. The two may be the same text.
@@ -90,6 +121,52 @@ export type Suggestion = {
90
121
  /** The manifest's suggestion and greeting schemas are built from these. */
91
122
  export type Suggestions = Record<Locale, Suggestion[]>;
92
123
  export type Greeting = Record<Locale, string>;
124
+ export type TriggerFiringSummary = {
125
+ name: string;
126
+ firingId: string;
127
+ firedAt: string;
128
+ payload: unknown;
129
+ };
130
+ /**
131
+ * A stored message as it is persisted and served: the SDK's parts plus the
132
+ * envelope Cortex derives for the UIs, carried in the SDK message's own
133
+ * `metadata` bag so it travels with the message over the stream and the
134
+ * transcript alike.
135
+ *
136
+ * `TPart` stays generic so this file keeps its zero dependencies — both
137
+ * sides substitute the SDK's `MessagePart`.
138
+ */
139
+ export type CortexMessage<TPart = unknown> = {
140
+ id: string;
141
+ /** `trigger` rows carry a firing's instructions; the UIs render them as an event, not a bubble. */
142
+ role: MessageRole;
143
+ parts: TPart[];
144
+ metadata?: MessageMetadata;
145
+ };
146
+ declare const TRIGGER_DROP_REASONS: readonly [
147
+ "busy",
148
+ "approval_pending",
149
+ "budget",
150
+ "rate_limited"
151
+ ];
152
+ export type TriggerDropReason = (typeof TRIGGER_DROP_REASONS)[number];
153
+ /**
154
+ * Body of a `POST /chat` the thread did not take: 409 while a run holds the
155
+ * thread or a call on it waits for a decision, or when the answers it
156
+ * carried fit no open call, were already applied, or answer a call whose
157
+ * origin is out of reach (`no_turn`); 429 once the agent's request bucket is
158
+ * spent, with `Retry-After`.
159
+ */
160
+ export type ChatDropped = {
161
+ outcome: "dropped";
162
+ reason: Exclude<TriggerDropReason, "budget"> | "no_turn";
163
+ };
164
+ /**
165
+ * The drop a widget tells its user about by name: a call on the thread waits
166
+ * for approval, so the message goes back to the composer. Any other drop
167
+ * shows as a failed turn.
168
+ */
169
+ export type SendRefusal = Extract<ChatDropped["reason"], "approval_pending">;
93
170
  export type CortexHeaders = Record<string, string>;
94
171
  /**
95
172
  * How the widget reaches Cortex. `baseUrl` may be a thunk so a consumer with
@@ -262,8 +339,11 @@ export type CortexSlotContexts<View> = {
262
339
  landing: LandingContext<View>;
263
340
  threadList: CortexThreadListContext;
264
341
  };
265
- /** Why Cortex dropped a message instead of running it: a call on the thread waits for approval. */
266
- export type SendRefusal = "approval_pending";
342
+ /**
343
+ * Why Cortex left a read unanswered: it could not be reached (or failed),
344
+ * it refused the caller's sign-in (401), or it serves no such agent (404).
345
+ */
346
+ export type Unanswered = "unreachable" | "refused" | "missing";
267
347
  /** Why the composer refused a file before uploading it: the attachment policy's reason, or one file too many. */
268
348
  export type AttachmentRefusal = Exclude<ReturnType<typeof checkAttachmentPolicy>, "ok"> | "count";
269
349
  export type QueuedAttachment = {
@@ -276,21 +356,86 @@ export type QueuedAttachment = {
276
356
  attachmentId?: string;
277
357
  summary?: AttachmentSummary;
278
358
  };
279
- /**
280
- * Why Cortex left a read unanswered: it could not be reached (or failed),
281
- * it refused the caller's sign-in (401), or it serves no such agent (404).
282
- */
283
- export type Unanswered = "unreachable" | "refused" | "missing";
284
359
  /**
285
360
  * A turn shown as failed, with Cortex's reason when it gave one (a message
286
361
  * that never got out has none). The reason may name the model provider's
287
- * answer, so a widget shows it only where its debug view is offered. A
288
- * message Cortex refused names why instead.
362
+ * answer, so the widget's state keeps it only where Cortex sends the debug
363
+ * view. A message Cortex refused names why instead.
289
364
  */
290
365
  export type TurnFailure = {
291
366
  reason: string | undefined;
292
367
  refusal?: SendRefusal;
293
368
  };
369
+ /** The open conversation, as a widget draws it. */
370
+ export type ChatSessionState = {
371
+ /** Each carries Cortex's envelope (usage, model id, attachments, time) in its `metadata`. */
372
+ messages: UIMessage[];
373
+ isAgentWorking: boolean;
374
+ isLoadingMessages: boolean;
375
+ /**
376
+ * A call is owed an answer. Only while no stream is open: mid-turn an open
377
+ * call is a tool Cortex is running. Read off the transcript, so the composer
378
+ * comes back the moment an answer settles its call, long before the
379
+ * continuation it sends ends.
380
+ */
381
+ hasPendingToolCalls: boolean;
382
+ /** A call waits for the user to approve or deny it: no message may go out until it is decided. */
383
+ awaitsApproval: boolean;
384
+ /** The last turn failed: Cortex said its run failed, or the message never got out. */
385
+ turnFailure: TurnFailure | undefined;
386
+ };
387
+ /** Everything a widget draws, the same for every framework. */
388
+ export type CortexWidgetState = {
389
+ /** Newest first; undefined until the first list read lands or Cortex refuses it. */
390
+ threads: ThreadSummary[] | undefined;
391
+ /** The open thread, as the list has it now; undefined on a blank chat. */
392
+ selected: ThreadSummary | undefined;
393
+ /**
394
+ * The open thread's conversation; blank while none is open. A failed
395
+ * turn's reason may name the model provider's answer, so it is here only
396
+ * where Cortex sends this caller the debug view.
397
+ */
398
+ session: ChatSessionState;
399
+ /** What Cortex offers this agent's clients; undefined until the handshake answers. */
400
+ capabilities: AgentCapabilities | undefined;
401
+ /** Why the handshake has not answered yet, once a try has failed. */
402
+ unanswered: Unanswered | undefined;
403
+ /** The files held for the next message. */
404
+ attachments: QueuedAttachment[];
405
+ /** A thread is being created for the message on its way out; the composer waits for it. */
406
+ creating: boolean;
407
+ screen: "chat" | "threads";
408
+ /** Full mode's history sidebar, slid in on a narrow viewport. */
409
+ sidebarOpen: boolean;
410
+ /** The reader's debug toggle; on only while the handshake offers the debug view. */
411
+ debugMode: boolean;
412
+ /**
413
+ * What the header, landing and history are drawn from: one object until
414
+ * one of its fields changes, which a streamed chunk does only as the turn
415
+ * starts and stops working, so a framework redraws them only then.
416
+ */
417
+ parts: Pick<CortexWidgetState, "threads" | "selected" | "capabilities" | "debugMode"> & {
418
+ isWorking: boolean;
419
+ };
420
+ };
421
+ export type CortexAngularConfig = CortexConfig & {
422
+ toolComponents?: Record<string, Type<CortexToolComponentInputs>>;
423
+ injector?: Injector;
424
+ };
425
+ /** The landing's context, its composer a template to place with `ngTemplateOutlet`. */
426
+ export type CortexLandingContext = LandingContext<TemplateRef<unknown>>;
427
+ /** Each part of the widget a consumer can draw itself, with the context it receives. */
428
+ export type CortexAngularSlotContexts = CortexSlotContexts<TemplateRef<unknown>>;
429
+ declare const LOCALES$1: readonly [
430
+ "en",
431
+ "ar"
432
+ ];
433
+ type Locale$1 = (typeof LOCALES$1)[number];
434
+ declare const TOOL_SURFACES: readonly [
435
+ "inline",
436
+ "modal"
437
+ ];
438
+ export type ToolSurface = (typeof TOOL_SURFACES)[number];
294
439
  declare const ATTACHMENT_STATUSES$1: readonly [
295
440
  "pending",
296
441
  "described",
@@ -312,234 +457,211 @@ export type AttachmentSummary$1 = {
312
457
  origin: AttachmentOrigin$1;
313
458
  description: string | null;
314
459
  };
315
- export type CortexAngularConfig = CortexConfig & {
316
- toolComponents?: Record<string, Type<CortexToolComponentInputs>>;
317
- injector?: Injector;
460
+ /**
461
+ * Response of `POST /chat/:threadId/abort`. `aborted: false` means there was no
462
+ * live run to abort — the turn had already committed — so the caller must not
463
+ * present the turn as aborted and should read the settled state back instead.
464
+ */
465
+ export type AbortRunResult$1 = {
466
+ aborted: boolean;
318
467
  };
319
- /** The landing's context, its composer a template to place with `ngTemplateOutlet`. */
320
- export type CortexLandingContext = LandingContext<TemplateRef<unknown>>;
321
- /** Each part of the widget a consumer can draw itself, with the context it receives. */
322
- export type CortexAngularSlotContexts = CortexSlotContexts<TemplateRef<unknown>>;
323
- declare class AttachmentQueueService {
324
- readonly items: import("@angular/core").WritableSignal<QueuedAttachment[]>;
325
- private readonly flags;
326
- readonly uploading: import("@angular/core").Signal<boolean>;
327
- readonly busy: import("@angular/core").Signal<boolean>;
328
- readonly hasReady: import("@angular/core").Signal<boolean>;
329
- private readonly chatService;
330
- readonly store: {
331
- getState: () => QueuedAttachment[];
332
- subscribe: (listener: () => void) => () => void;
333
- accept: (files: File[]) => void;
334
- remove: (localId: string) => void;
335
- clear: (threadId: string | undefined) => void;
336
- consumeReady: () => {
337
- status: "ready";
338
- summary: AttachmentSummary$1;
339
- localId: string;
340
- filename: string;
341
- refusal?: "type" | "size" | "name" | "count";
342
- threadId?: string;
343
- attachmentId?: string;
344
- }[];
345
- restoreConsumed: (threadId: string | undefined) => void;
346
- discardConsumed: () => void;
468
+ type TokenUsage$1 = {
469
+ input: {
470
+ noCache: number;
471
+ cacheRead: number;
472
+ cacheWrite: number;
473
+ total: number;
347
474
  };
348
- constructor();
349
- static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentQueueService, never>;
350
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
351
- }
352
- declare class CortexChatService {
475
+ output: {
476
+ reasoning: number;
477
+ text: number;
478
+ total: number;
479
+ };
480
+ total: number;
481
+ };
482
+ /**
483
+ * What Cortex offers this agent's clients, fetched once at widget startup.
484
+ * The widget hides UI for anything absent; Cortex enforces each.
485
+ */
486
+ export type AgentCapabilities$1 = {
487
+ attachments: boolean;
353
488
  /**
354
- * Selection is the Thread handed to `selectThread`, resolved against the live
355
- * list: the row there receives the title and isRunning updates Cortex
356
- * pushes, so the selection follows them without hand-syncing. The snapshot
357
- * only answers for a thread the list has not caught up with yet.
489
+ * False when this caller may not send to the chat: the agent's `message`
490
+ * trigger is off, or the caller only reads (`readOnly`). The widget hides
491
+ * its composer and answers no tool call.
358
492
  */
359
- readonly selectedThread: import("@angular/core").Signal<ThreadSummary | undefined>;
360
- private readonly chat;
361
- /** The open conversation's transcript; empty while nothing is selected. */
362
- readonly messages: import("@angular/core").Signal<import("@tanstack/ai-client").UIMessage<readonly import("@tanstack/ai").AnyClientTool[], any>[]>;
363
- readonly isLoadingMessages: import("@angular/core").WritableSignal<boolean>;
364
- readonly isAgentWorking: import("@angular/core").Signal<boolean>;
493
+ messages: boolean;
494
+ /** True when the caller only reads, as an operator inspecting a user's thread does. */
495
+ readOnly: boolean;
496
+ /** Prompt chips on the blank-chat landing per locale; clicking one sends its `prompt` as the first message. */
497
+ suggestions: Suggestions$1;
498
+ /** Headline of the blank-chat landing per locale; "" falls back to the widget's built-in copy. */
499
+ greeting: Greeting$1;
365
500
  /**
366
- * Derived, never hand-synced: a call only counts as owed while the stream is
367
- * idle — mid-turn an unsettled call is just a tool Cortex is executing. Reading
368
- * straight from the SDK's signals is what brings the composer back the
369
- * instant `addToolResult` settles the call part — the SDK's delivery promise
370
- * only resolves once the continuation turn ends, far too late to gate UI on.
501
+ * Whether this caller gets the debug view: tool inputs and outputs, reasoning,
502
+ * model calls. Cortex sends anyone else only what the widget's normal UI draws.
371
503
  */
372
- readonly hasPendingToolCalls: import("@angular/core").Signal<boolean>;
373
- /** A call waits for the user to approve or deny it: no message may go out until it is decided. */
374
- readonly awaitsApproval: import("@angular/core").Signal<boolean>;
375
- /** The last turn failed: Cortex said its run failed, or the message never got out. */
376
- readonly turnFailure: import("@angular/core").WritableSignal<TurnFailure | undefined>;
377
- /** The text of a message Cortex refused, handed back to the composer until a message goes out. */
378
- readonly returnedDraft: import("@angular/core").WritableSignal<string | undefined>;
379
- /** What Cortex offers this agent's clients; undefined until the handshake answers. */
380
- readonly capabilities: import("@angular/core").WritableSignal<AgentCapabilities | undefined>;
381
- /** Why the handshake has not answered yet, once a try has failed. */
382
- readonly unanswered: import("@angular/core").WritableSignal<Unanswered | undefined>;
383
- private readonly events;
384
- private readonly selectedThreadSnapshot;
385
- private readonly config;
386
- private readonly api;
387
- private readonly threadService;
388
- private readonly wsService;
389
- private readonly destroyRef;
390
- private readonly environmentInjector;
391
- /** Owns the current thread's chat client; destroying it stops and disposes it. */
392
- private chatInjector;
393
- /** The turn in flight on the current chat client; replaced with it on every mount. */
394
- private lifecycle;
395
- private pendingThreadCreation;
396
- private refreshing;
397
- private stopCapabilities;
504
+ debug: boolean;
505
+ };
506
+ type Suggestion$1 = {
507
+ title: string;
508
+ prompt: string;
509
+ };
510
+ type Suggestions$1 = Record<Locale$1, Suggestion$1[]>;
511
+ type Greeting$1 = Record<Locale$1, string>;
512
+ /**
513
+ * Response of `POST /chat/:threadId/tools/:toolCallId/initiate` for a pending
514
+ * call stamped with an embed. The payload is for the widget only; it never
515
+ * reaches the LLM.
516
+ */
517
+ export type ClientToolInitiateResult$1 = {
518
+ embedUrl: string;
519
+ surface: ToolSurface;
520
+ embedOrigin: string;
521
+ };
522
+ /**
523
+ * One model call of the turn that wrote a message, raw, in the order the
524
+ * turn ran them: `GET /threads/:threadId/messages/:messageId/llm-requests`
525
+ * answers a list, for the request inspector.
526
+ */
527
+ export type LlmRequest$1 = {
528
+ id: string;
529
+ prompt: string;
530
+ output: string | null;
531
+ tokenUsage: TokenUsage$1 | null;
532
+ };
533
+ /** A message as Cortex serves it: SDK parts plus Cortex's metadata envelope. */
534
+ export type CortexChatMessage = CortexMessage<MessagePart>;
535
+ declare class CortexChatService {
536
+ readonly widget: {
537
+ api: {
538
+ getCapabilities(): Promise<AgentCapabilities$1>;
539
+ listThreads(): Promise<ThreadSummary[]>;
540
+ createThread(): Promise<ThreadSummary>;
541
+ deleteThread(threadId: string): Promise<void>;
542
+ listMessages(threadId: string): Promise<CortexChatMessage[]>;
543
+ listLlmRequests(threadId: string, messageId: string): Promise<LlmRequest$1[]>;
544
+ abortStream(threadId: string): Promise<AbortRunResult$1>;
545
+ initiateToolCall(threadId: string, toolCallId: string): Promise<ClientToolInitiateResult$1>;
546
+ uploadAttachment(threadId: string, file: File): Promise<AttachmentSummary$1>;
547
+ deleteAttachment(id: string): Promise<void>;
548
+ downloadAttachment(id: string): Promise<{
549
+ blob: Blob;
550
+ name: string;
551
+ }>;
552
+ resolveHeaders: () => Promise<{
553
+ [x: string]: string;
554
+ }>;
555
+ resolveUrl: (path: string) => string;
556
+ };
557
+ getState: () => CortexWidgetState;
558
+ getDraft: () => string;
559
+ subscribe: (listener: () => void) => () => void;
560
+ start: () => void;
561
+ stop: () => void;
562
+ setDraft: (text: string) => void;
563
+ submit: (text: string) => Promise<{
564
+ readonly sent: false;
565
+ readonly text: string;
566
+ } | {
567
+ readonly sent: true;
568
+ }>;
569
+ sendDraft: (launch: (text: string) => void) => void;
570
+ abort: () => Promise<void>;
571
+ addToolResult: (toolCallId: string, toolName: string, output: unknown) => Promise<void>;
572
+ respondToApproval: (call: import("@tanstack/ai").ToolCallPart, approved: boolean) => Promise<void>;
573
+ openThread: (thread: ThreadSummary) => void;
574
+ newChat: () => void;
575
+ deleteThread: (threadId: string) => Promise<void>;
576
+ attachFiles: (files: File[]) => void;
577
+ removeAttachment: (localId: string) => void;
578
+ openHistory: () => void;
579
+ closeHistory: () => void;
580
+ toggleDebug: () => void;
581
+ };
582
+ private readonly snapshot;
583
+ private readonly text;
584
+ readonly state: import("@angular/core").Signal<CortexWidgetState>;
585
+ readonly draft: import("@angular/core").Signal<string>;
586
+ readonly selectedThread: import("@angular/core").Signal<ThreadSummary | undefined>;
587
+ readonly messages: import("@angular/core").Signal<import("@tanstack/ai").UIMessage<unknown>[]>;
588
+ readonly isAgentWorking: import("@angular/core").Signal<boolean>;
589
+ readonly debugMode: import("@angular/core").Signal<boolean>;
590
+ readonly turnFailure: import("@angular/core").Signal<TurnFailure | undefined>;
591
+ /** What the header, landing and history are drawn from: a streamed chunk leaves it as it was. */
592
+ readonly parts: import("@angular/core").Signal<Pick<CortexWidgetState, "threads" | "capabilities" | "debugMode" | "selected"> & {
593
+ isWorking: boolean;
594
+ }>;
398
595
  constructor();
399
- /**
400
- * Kicked off by the widget once its `config` input is bound. This cannot happen in
401
- * the constructor: the widget builds its children during its creation pass, which
402
- * Angular runs before it binds inputs, so the transport is not knowable yet.
403
- */
404
- start(): void;
405
- /**
406
- * Capability-gated controls stay hidden until the handshake answers, so it
407
- * is asked until it does, and afresh after every reconnect: the old answer
408
- * may be stale (a trigger toggled while the socket was down), so it is
409
- * forgotten first. Why it has not answered is shown until an answer arrives.
410
- */
411
- private loadCapabilities;
412
- get events$(): Observable<"onError" | "onFinish" | "onThreadSelected" | "onSend">;
413
- selectThread(thread: ThreadSummary, options?: {
414
- skipLoadingMessages?: boolean;
415
- }): Observable<ThreadSummary>;
416
- deselectThread(): void;
417
- /**
418
- * The id of the thread the next message belongs to, creating it when the widget is
419
- * still on a blank chat.
420
- */
421
- ensureThread(): Observable<string>;
422
- send(prompt: string, attachments?: AttachmentSummary[]): Observable<void>;
423
- /** Answers a tool call on behalf of a tool component or the client tool
424
- * embed. Returns the delivery, which fails when the answer did not reach
425
- * Cortex, so the caller can ask for it again instead of stranding the call. */
426
- addToolResult(toolCallId: string, toolName: string, output: unknown): Promise<void>;
427
- /** The user's decision on a call the run parked on; the run resumes once delivered. */
428
- respondToApproval(approvalId: string, approved: boolean): Promise<void>;
429
- abort(): Promise<void>;
430
- deleteThread(threadId: string): Observable<void>;
431
- /**
432
- * Points the widget at a thread with a chat client of its own. Cortex owns
433
- * the transcript: on mount the client asks it for the transcript and for
434
- * whatever run is still generating, so selecting a thread, reloading the page
435
- * and a second tab all re-attach through one path.
436
- */
437
- private mountChat;
438
- /**
439
- * Re-mounts the current thread's chat so its hydration re-reads the transcript
440
- * and re-attaches to whatever run is live now. This is how a run another tab
441
- * started, and a websocket that dropped and came back, land in this widget.
442
- * A caller passes the thread when it holds fresher state than the list.
443
- */
444
- private reattach;
445
- private createConnection;
446
- private refreshMessages;
447
- private readBackMessages;
448
- private subscribeToWsEvents;
449
- /**
450
- * Only what these events mean for the open conversation — their list-shaped
451
- * side is CortexThreadService's, which absorbs them on its own subscription.
452
- */
453
- private onWsEvent;
454
- private subscribeToWsConnections;
455
596
  static ɵfac: i0.ɵɵFactoryDeclaration<CortexChatService, never>;
456
597
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
457
598
  }
458
599
  /** The chat widget: the thread list, the open conversation and its composer, for the agent `config` points at. */
459
600
  export declare class CortexChatWidgetComponent implements OnInit {
460
601
  readonly config: import("@angular/core").InputSignal<CortexAngularConfig>;
461
- protected readonly debugMode: import("@angular/core").WritableSignal<boolean>;
462
- /**
463
- * Whether this caller may start and delete conversations: only once the
464
- * handshake says so, like every capability-gated control, and never for a
465
- * caller that only reads, as an operator inspecting a thread does.
466
- */
467
- private readonly writes;
468
- protected readonly screen: import("@angular/core").WritableSignal<"chat" | "threads">;
469
- protected readonly sidebarOpen: import("@angular/core").WritableSignal<boolean>;
470
- protected readonly viewMode: import("@angular/core").Signal<CortexViewMode>;
471
- private readonly composer;
602
+ protected readonly direction: import("@angular/core").Signal<"ltr" | "rtl">;
472
603
  private readonly landingComposer;
473
604
  /** The consumer's own parts by slot; each replaces the widget's default and gets the same context. */
474
605
  private readonly slotDirectives;
475
606
  protected readonly slots: import("@angular/core").Signal<Map<keyof CortexAngularSlotContexts, TemplateRef<{
476
607
  $implicit: CortexHeaderContext | CortexThreadListContext | LandingContext<TemplateRef<unknown>>;
477
608
  }>>>;
478
- /** Why the handshake has not answered, worded for the composer's place. */
479
- protected readonly unansweredNotice: import("@angular/core").Signal<"translate_access_refused" | "translate_agent_unreachable" | "translate_agent_missing" | undefined>;
480
- protected readonly chatHeader: import("@angular/core").Signal<{
481
- openHistory: () => void;
482
- closeHistory: () => void;
483
- toggleDebug: () => void;
484
- newChat?: (() => void) | undefined;
485
- screen: "chat" | "threads";
486
- viewMode: CortexViewMode;
487
- title: string | null;
488
- agentName: string | undefined;
489
- threadCount: number | undefined;
490
- isWorking: boolean;
491
- debug: {
492
- shown: boolean;
493
- on: boolean;
609
+ protected chat: CortexChatService;
610
+ protected readonly parts: import("@angular/core").Signal<{
611
+ chatHeader: {
612
+ screen: "chat" | "threads";
613
+ viewMode: CortexViewMode;
614
+ title: string | null;
615
+ agentName: string | undefined;
616
+ threadCount: number | undefined;
617
+ isWorking: boolean;
618
+ debug: {
619
+ shown: boolean;
620
+ on: boolean;
621
+ };
622
+ newChat: (() => void) | undefined;
623
+ openHistory: () => void;
624
+ closeHistory: () => void;
625
+ toggleDebug: () => void;
494
626
  };
495
- }>;
496
- protected readonly threadsHeader: import("@angular/core").Signal<{
497
- openHistory: () => void;
498
- closeHistory: () => void;
499
- toggleDebug: () => void;
500
- newChat?: (() => void) | undefined;
501
- screen: "chat" | "threads";
502
- viewMode: CortexViewMode;
503
- title: string | null;
504
- agentName: string | undefined;
505
- threadCount: number | undefined;
506
- isWorking: boolean;
507
- debug: {
508
- shown: boolean;
509
- on: boolean;
627
+ threadsHeader: {
628
+ screen: "chat" | "threads";
629
+ viewMode: CortexViewMode;
630
+ title: string | null;
631
+ agentName: string | undefined;
632
+ threadCount: number | undefined;
633
+ isWorking: boolean;
634
+ debug: {
635
+ shown: boolean;
636
+ on: boolean;
637
+ };
638
+ newChat: (() => void) | undefined;
639
+ openHistory: () => void;
640
+ closeHistory: () => void;
641
+ toggleDebug: () => void;
642
+ };
643
+ landing: {
644
+ threads: ThreadSummary[] | undefined;
645
+ composer: TemplateRef<unknown>;
646
+ openThread: (thread: ThreadSummary) => void;
647
+ openHistory: () => void;
648
+ greeting: string;
649
+ suggestions: Suggestion[];
650
+ send: (prompt: string) => void;
651
+ };
652
+ threadList: {
653
+ newChat?: (() => void) | undefined;
654
+ deleteThread?: ((threadId: string) => undefined) | undefined;
655
+ threads: ThreadSummary[] | undefined;
656
+ selectedThreadId: string | undefined;
657
+ openThread: (thread: ThreadSummary) => void;
510
658
  };
511
659
  }>;
512
- protected readonly landing: import("@angular/core").Signal<{
513
- threads: ThreadSummary[] | undefined;
514
- composer: TemplateRef<unknown>;
515
- openThread: (thread: ThreadSummary) => void;
516
- openHistory: () => void;
517
- greeting: string;
518
- suggestions: Suggestion[];
519
- send: (prompt: string) => void;
520
- }>;
521
- protected readonly threadList: import("@angular/core").Signal<{
522
- deleteThread?: ((threadId: string) => import("rxjs").Subscription) | undefined;
523
- newChat?: (() => void) | undefined;
524
- threads: ThreadSummary[] | undefined;
525
- selectedThreadId: string | undefined;
526
- openThread: (thread: ThreadSummary) => void;
527
- }>;
528
- protected chatService: CortexChatService;
529
- protected queue: AttachmentQueueService;
530
- private threadService;
660
+ protected readonly composerSlot: import("@angular/core").Signal<"translate_access_refused" | "translate_agent_unreachable" | "translate_agent_missing" | "composer" | "translate_read_only" | "translate_messages_disabled" | undefined>;
531
661
  private readonly injector;
532
- private readonly destroyRef;
533
662
  ngOnInit(): void;
534
- private headerContext;
535
- protected closeSidebar(): void;
536
- private toggleDebugMode;
537
- private selectThread;
538
- private openHistory;
539
- private closeHistory;
540
663
  protected onWidgetDragOver(event: DragEvent): void;
541
664
  protected onWidgetDrop(event: DragEvent): void;
542
- private newChat;
543
665
  static ɵfac: i0.ɵɵFactoryDeclaration<CortexChatWidgetComponent, never>;
544
666
  static ɵcmp: i0.ɵɵComponentDeclaration<CortexChatWidgetComponent, "cortex-chat-widget", never, {
545
667
  "config": {