@m6d/cortex-angular 1.9.0 → 1.11.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.
@@ -2121,7 +2121,7 @@ class ChatLandingComponent {
2121
2121
  threadService = inject(CortexThreadService);
2122
2122
  translateService = inject(TranslateService);
2123
2123
  greeting = computed(() => localized(this.config().greeting, this.config().locale ?? "en"), ...ngDevMode ? [{ debugName: "greeting" }] : []);
2124
- suggestions = computed(() => localized(this.config().suggestions, this.config().locale ?? "en"), ...ngDevMode ? [{ debugName: "suggestions" }] : []);
2124
+ suggestions = computed(() => localized(this.chatService.capabilities()?.suggestions, this.config().locale ?? "en"), ...ngDevMode ? [{ debugName: "suggestions" }] : []);
2125
2125
  ready = computed(() => this.chatService.capabilities() !== undefined, ...ngDevMode ? [{ debugName: "ready" }] : []);
2126
2126
  headless = computed(() => this.chatService.capabilities()?.messages === false, ...ngDevMode ? [{ debugName: "headless" }] : []);
2127
2127
  sendSuggestion(suggestion) {
@@ -4462,7 +4462,7 @@ class MessageComponent {
4462
4462
  isAborted = computed(() => Boolean(this.metadata()?.isAborted), ...ngDevMode ? [{ debugName: "isAborted" }] : []);
4463
4463
  tokenUsage = computed(() => this.metadata()?.tokenUsage, ...ngDevMode ? [{ debugName: "tokenUsage" }] : []);
4464
4464
  modelId = computed(() => this.metadata()?.modelId, ...ngDevMode ? [{ debugName: "modelId" }] : []);
4465
- attachments = computed(() => this.message().role === "user" ? this.metadata()?.attachments ?? [] : [], ...ngDevMode ? [{ debugName: "attachments" }] : []);
4465
+ attachments = computed(() => this.metadata()?.attachments ?? [], ...ngDevMode ? [{ debugName: "attachments" }] : []);
4466
4466
  showsDebugZone = computed(() => {
4467
4467
  if (!this.debugMode() || this.isStreaming())
4468
4468
  return false;
@@ -4480,7 +4480,7 @@ class MessageComponent {
4480
4480
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.3", type: MessageComponent, isStandalone: true, selector: "cortex-message", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, debugMode: { classPropertyName: "debugMode", publicName: "debugMode", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cortex-message" }, ngImport: i0, template: `<!-- fallow-ignore-file complexity -- the message template branches once per envelope kind, trigger included -->
4481
4481
  @if (trigger(); as firing) {
4482
4482
  <cortex-trigger-block [firing]="firing" [debugMode]="debugMode()" />
4483
- } @else if (visibleParts().length) {
4483
+ } @else if (visibleParts().length || attachments().length) {
4484
4484
  <div class="cortex-message-parts">
4485
4485
  @for (part of visibleParts(); track $index) {
4486
4486
  <cortex-message-part
@@ -4527,7 +4527,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.3", ngImpor
4527
4527
  ], host: { class: "cortex-message" }, template: `<!-- fallow-ignore-file complexity -- the message template branches once per envelope kind, trigger included -->
4528
4528
  @if (trigger(); as firing) {
4529
4529
  <cortex-trigger-block [firing]="firing" [debugMode]="debugMode()" />
4530
- } @else if (visibleParts().length) {
4530
+ } @else if (visibleParts().length || attachments().length) {
4531
4531
  <div class="cortex-message-parts">
4532
4532
  @for (part of visibleParts(); track $index) {
4533
4533
  <cortex-message-part
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m6d/cortex-angular",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "Reusable AI agent chat UI library for Angular",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -12,13 +12,19 @@ declare const ATTACHMENT_STATUSES: readonly [
12
12
  "failed",
13
13
  "skipped"
14
14
  ];
15
+ declare const ATTACHMENT_ORIGINS: readonly [
16
+ "upload",
17
+ "tool"
18
+ ];
15
19
  export type AttachmentStatus = (typeof ATTACHMENT_STATUSES)[number];
20
+ export type AttachmentOrigin = (typeof ATTACHMENT_ORIGINS)[number];
16
21
  export type AttachmentSummary = {
17
22
  id: string;
18
23
  filename: string;
19
24
  contentType: string;
20
25
  sizeBytes: number;
21
26
  status: AttachmentStatus;
27
+ origin: AttachmentOrigin;
22
28
  description?: string;
23
29
  };
24
30
  export type ThreadSummary = {
@@ -55,6 +61,8 @@ export type ClientToolBinding = {
55
61
  toolId: string;
56
62
  surface: "inline" | "modal";
57
63
  embedOrigin: string;
64
+ /** Variables the initiate call's input reads. */
65
+ variables: string[];
58
66
  };
59
67
  /**
60
68
  * What the server offers this agent's clients, fetched once at widget startup.
@@ -64,6 +72,8 @@ export type AgentCapabilities = {
64
72
  attachments: boolean;
65
73
  /** False when the agent's `message` trigger is off: the widget hides its composer. */
66
74
  messages: boolean;
75
+ /** Prompt chips on the blank-chat landing per locale, the runtime contract's `suggestionsSchema` shape; clicking one sends it as the first message. */
76
+ suggestions: Record<"en" | "ar", string[]>;
67
77
  };
68
78
  export type MessageMetadata = {
69
79
  modelId?: string;
@@ -142,8 +152,6 @@ export type CortexConfig = {
142
152
  agentName?: Localized<string>;
143
153
  /** Headline of the blank-chat landing; defaults to a localized greeting. */
144
154
  greeting?: Localized<string>;
145
- /** Prompt chips on the blank-chat landing; clicking one sends it as the first message. */
146
- suggestions?: Localized<string[]>;
147
155
  showDebugButton?: boolean;
148
156
  /**
149
157
  * Render embedded tool pages served from this page's own origin with their
@@ -175,13 +183,19 @@ declare const ATTACHMENT_STATUSES$1: readonly [
175
183
  "failed",
176
184
  "skipped"
177
185
  ];
186
+ declare const ATTACHMENT_ORIGINS$1: readonly [
187
+ "upload",
188
+ "tool"
189
+ ];
178
190
  type AttachmentStatus$1 = (typeof ATTACHMENT_STATUSES$1)[number];
191
+ type AttachmentOrigin$1 = (typeof ATTACHMENT_ORIGINS$1)[number];
179
192
  type AttachmentSummary$1 = {
180
193
  id: string;
181
194
  filename: string;
182
195
  contentType: string;
183
196
  sizeBytes: number;
184
197
  status: AttachmentStatus$1;
198
+ origin: AttachmentOrigin$1;
185
199
  description?: string;
186
200
  };
187
201
  declare class AttachmentQueueService {