mesauth-angular 1.21.0 → 1.23.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": "mesauth-angular",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "Angular helper library to connect to a backend API and SignalR hub to surface the current logged-in user and incoming notifications with dark/light theme support",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InjectionToken, EnvironmentProviders, AfterViewInit, OnDestroy, ElementRef, PipeTransform } from '@angular/core';
2
+ import { InjectionToken, EnvironmentProviders, AfterViewInit, OnDestroy, ElementRef, OnInit, PipeTransform } from '@angular/core';
3
3
  import { HttpClient, HttpInterceptorFn, HttpResponse, HttpParams } from '@angular/common/http';
4
4
  import { Observable, OperatorFunction } from 'rxjs';
5
5
  import { Router } from '@angular/router';
@@ -303,6 +303,7 @@ declare class UserProfileComponent {
303
303
  readonly pendingApprovalCount: _angular_core.WritableSignal<number>;
304
304
  readonly dropdownOpen: _angular_core.WritableSignal<boolean>;
305
305
  readonly avatarRefresh: _angular_core.WritableSignal<number>;
306
+ readonly lessonsOpen: _angular_core.WritableSignal<boolean>;
306
307
  readonly navAvatarSize: _angular_core.Signal<AvatarSize>;
307
308
  readonly dropAvatarSize: _angular_core.Signal<AvatarSize>;
308
309
  readonly avatarShape: _angular_core.Signal<"circle" | "rounded" | "rectangle" | "portrait">;
@@ -330,6 +331,8 @@ declare class UserProfileComponent {
330
331
  private openInNewTabIfSameOrigin;
331
332
  onLogout(): void;
332
333
  onNotificationClick(): void;
334
+ openLessons(): void;
335
+ closeLessons(): void;
333
336
  onSigErr(_ev: Event): void;
334
337
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserProfileComponent, never>;
335
338
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserProfileComponent, "ma-user-profile", never, { "inputAvatarShape": { "alias": "inputAvatarShape"; "required": false; "isSignal": true; }; "showBell": { "alias": "showBell"; "required": false; "isSignal": true; }; "showApproval": { "alias": "showApproval"; "required": false; "isSignal": true; }; "showName": { "alias": "showName"; "required": false; "isSignal": true; }; "showAi": { "alias": "showAi"; "required": false; "isSignal": true; }; "showSignature": { "alias": "showSignature"; "required": false; "isSignal": true; }; "signatureHeight": { "alias": "signatureHeight"; "required": false; "isSignal": true; }; }, { "notificationClick": "notificationClick"; "approvalClick": "approvalClick"; "aiClick": "aiClick"; }, never, ["*"], true, never>;
@@ -545,6 +548,7 @@ declare class MaApprovalPanelComponent {
545
548
  private readonly mesAuth;
546
549
  private readonly http;
547
550
  private readonly router;
551
+ private readonly host;
548
552
  private approvalSvc;
549
553
  constructor();
550
554
  open(): void;
@@ -611,6 +615,51 @@ interface ChatToolEvent {
611
615
  args?: any;
612
616
  readOnly?: boolean;
613
617
  }
618
+ /** Summary row in the user's conversation history list. */
619
+ interface AiConversationSummary {
620
+ id: string;
621
+ title: string | null;
622
+ appName: string | null;
623
+ originRoute: string | null;
624
+ createdAt: string;
625
+ updatedAt: string;
626
+ messageCount: number;
627
+ }
628
+ /** One stored message from a past conversation (resume payload). */
629
+ interface AiStoredMessage {
630
+ sequence: number;
631
+ role: 'user' | 'assistant' | 'tool' | string;
632
+ content: string | null;
633
+ toolCalls?: AiStoredToolCall[] | null;
634
+ toolCallId?: string | null;
635
+ toolIsError: boolean;
636
+ createdAt: string;
637
+ }
638
+ interface AiStoredToolCall {
639
+ id: string;
640
+ name: string;
641
+ args: any;
642
+ side: 'server' | 'client' | string;
643
+ }
644
+ /** Full transcript returned by GET /ai/conversations/{id}. */
645
+ interface AiConversationDetail {
646
+ id: string;
647
+ title: string | null;
648
+ appName: string | null;
649
+ originRoute: string | null;
650
+ createdAt: string;
651
+ updatedAt: string;
652
+ messages: AiStoredMessage[];
653
+ }
654
+ /** Per-user "lesson" injected into the system prompt every turn. */
655
+ interface AiUserLesson {
656
+ id: string;
657
+ text: string;
658
+ enabled: boolean;
659
+ source: 'user' | 'llm' | string;
660
+ createdAt: string;
661
+ updatedAt: string;
662
+ }
614
663
  /** Stream event types matching MesAuth.Api's AiStreamEvent JSON. */
615
664
  type AiSseEvent = {
616
665
  type: 'session';
@@ -696,6 +745,29 @@ declare class MaAiService {
696
745
  private verbOf;
697
746
  private summarize;
698
747
  private uid;
748
+ /** GET /ai/conversations — list this user's past conversations (most recent first). */
749
+ listConversations(take?: number): Promise<AiConversationSummary[]>;
750
+ /** GET /ai/conversations/{id} — fetch and hydrate a past conversation into the panel. */
751
+ resumeConversation(id: string): Promise<boolean>;
752
+ /** DELETE /ai/conversations/{id} */
753
+ deleteConversation(id: string): Promise<boolean>;
754
+ listLessons(): Promise<AiUserLesson[]>;
755
+ createLesson(text: string): Promise<AiUserLesson | null>;
756
+ updateLesson(id: string, patch: {
757
+ text?: string;
758
+ enabled?: boolean;
759
+ }): Promise<AiUserLesson | null>;
760
+ deleteLesson(id: string): Promise<boolean>;
761
+ private baseUrl;
762
+ private apiGet;
763
+ private apiSend;
764
+ /**
765
+ * Rebuild ChatBubble[] from a stored transcript. Tool messages don't appear as their
766
+ * own bubbles — they were emitted as chips on the preceding assistant bubble — but we
767
+ * reconstruct that linkage best-effort so the resumed view roughly matches what the
768
+ * user originally saw.
769
+ */
770
+ private hydrateBubbles;
699
771
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaAiService, never>;
700
772
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaAiService>;
701
773
  }
@@ -705,14 +777,17 @@ declare class MaAiService {
705
777
  * Uses panel-shared.css for the header/empty-state styling so it looks like the approval
706
778
  * and notification panels.
707
779
  */
708
- declare class MaAiChatPanelComponent implements AfterViewInit {
780
+ declare class MaAiChatPanelComponent implements AfterViewInit, OnDestroy {
709
781
  readonly isOpen: _angular_core.WritableSignal<boolean>;
710
782
  readonly width: _angular_core.WritableSignal<number>;
711
783
  readonly draft: _angular_core.WritableSignal<string>;
784
+ readonly historyOpen: _angular_core.WritableSignal<boolean>;
712
785
  readonly ai: MaAiService;
713
786
  private readonly router;
714
787
  private readonly themeService;
715
788
  private readonly uiConfig;
789
+ private readonly aiConfig;
790
+ private readonly panelMode;
716
791
  /** Suggested prompts shown in the empty state — manifest overridable. */
717
792
  readonly quickPrompts: _angular_core.Signal<string[]>;
718
793
  private readonly scrollContainer;
@@ -728,10 +803,14 @@ declare class MaAiChatPanelComponent implements AfterViewInit {
728
803
  private dragStartWidth;
729
804
  constructor();
730
805
  ngAfterViewInit(): void;
806
+ ngOnDestroy(): void;
807
+ private setLayoutVar;
731
808
  open(): void;
732
809
  close(): void;
733
810
  toggle(): void;
734
811
  newConversation(): void;
812
+ toggleHistory(): void;
813
+ onHistoryResumed(_id: string): void;
735
814
  send(): void;
736
815
  cancel(): void;
737
816
  onTextareaKey(ev: KeyboardEvent): void;
@@ -866,6 +945,7 @@ declare class NotificationPanelComponent {
866
945
  private readonly authService;
867
946
  private readonly toastService;
868
947
  private readonly themeService;
948
+ private readonly host;
869
949
  constructor();
870
950
  ngOnDestroy(): void;
871
951
  private loadNotifications;
@@ -1051,7 +1131,7 @@ interface MaUiManifest {
1051
1131
  quickPrompts?: string[];
1052
1132
  }
1053
1133
  /** Current installed package version — keep in sync with package.json. */
1054
- declare const PACKAGE_VERSION = "1.21.0";
1134
+ declare const PACKAGE_VERSION = "1.23.0";
1055
1135
  /**
1056
1136
  * Provides server-driven UI configuration loaded from the hosted manifest.
1057
1137
  * Components read `labels()` and `features()` signals instead of hardcoded strings.
@@ -1182,6 +1262,7 @@ declare function runSsoCheckHandshake(authService: MesAuthService): Promise<void
1182
1262
  */
1183
1263
  declare function runReturnViaPostMessageIfRequested(authService: MesAuthService): Promise<boolean>;
1184
1264
 
1265
+ type MaAiPanelMode = 'static' | 'floating';
1185
1266
  interface MesAuthAiConfig {
1186
1267
  /** Master switch — when false the Ask-AI button hides and the panel never opens. */
1187
1268
  enabled?: boolean;
@@ -1200,6 +1281,18 @@ interface MesAuthAiConfig {
1200
1281
  * Optional friendly name of the host app; sent to the backend each turn.
1201
1282
  */
1202
1283
  appName?: string;
1284
+ /**
1285
+ * How the panel coexists with the host app layout.
1286
+ *
1287
+ * - `'static'` (default): the panel still renders as a fixed-position drawer, but the
1288
+ * library injects a global stylesheet that sets `padding-inline-end: var(--ma-ai-panel-width)`
1289
+ * on `<body>`. When the panel opens the host's `<body>` shrinks to make room, so wide
1290
+ * content reflows instead of being hidden under the drawer. Zero-config for the host —
1291
+ * no template or CSS changes required.
1292
+ * - `'floating'`: legacy v1.21 behaviour. The panel overlays the host content at z-index 1040
1293
+ * without resizing the layout. Use this for hosts whose layout can't reflow safely.
1294
+ */
1295
+ panelMode?: MaAiPanelMode;
1203
1296
  }
1204
1297
  declare const MES_AUTH_AI_CONFIG: InjectionToken<MesAuthAiConfig>;
1205
1298
  /** Default configuration when the consumer doesn't call provideMesAuthAi(). */
@@ -1263,6 +1356,56 @@ declare class MaAiButtonComponent {
1263
1356
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaAiButtonComponent, "ma-ai-button", never, {}, { "clicked": "clicked"; }, never, never, true, never>;
1264
1357
  }
1265
1358
 
1359
+ /**
1360
+ * Drop-down list of the signed-in user's recent AI conversations.
1361
+ * Lives inside the chat panel header (toggled by the History button).
1362
+ */
1363
+ declare class MaAiHistoryListComponent implements OnInit {
1364
+ private readonly ai;
1365
+ readonly conversations: _angular_core.WritableSignal<AiConversationSummary[]>;
1366
+ readonly loading: _angular_core.WritableSignal<boolean>;
1367
+ /** Emitted after the user picks a row and the panel finishes hydrating. */
1368
+ readonly resumed: _angular_core.OutputEmitterRef<string>;
1369
+ ngOnInit(): void;
1370
+ refresh(): Promise<void>;
1371
+ pick(c: AiConversationSummary): Promise<void>;
1372
+ remove(c: AiConversationSummary): Promise<void>;
1373
+ relative(iso: string): string;
1374
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaAiHistoryListComponent, never>;
1375
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaAiHistoryListComponent, "ma-ai-history-list", never, {}, { "resumed": "resumed"; }, never, never, true, never>;
1376
+ }
1377
+
1378
+ /**
1379
+ * Modal editor for the signed-in user's AI "lessons" — long-lived instructions
1380
+ * injected into the LLM system prompt every turn. Opened from the user profile
1381
+ * dropdown via a dedicated button.
1382
+ *
1383
+ * Library-only styling (no @angular/forms — we use [value] + (input) per
1384
+ * mesauth-angular conventions).
1385
+ */
1386
+ declare class MaAiLessonsEditorComponent implements OnInit {
1387
+ private readonly ai;
1388
+ private readonly themeService;
1389
+ readonly lessons: _angular_core.WritableSignal<AiUserLesson[]>;
1390
+ readonly loading: _angular_core.WritableSignal<boolean>;
1391
+ readonly saving: _angular_core.WritableSignal<boolean>;
1392
+ readonly draft: _angular_core.WritableSignal<string>;
1393
+ readonly error: _angular_core.WritableSignal<string>;
1394
+ readonly cancel: _angular_core.OutputEmitterRef<void>;
1395
+ private pendingText;
1396
+ get themeClass(): string;
1397
+ ngOnInit(): Promise<void>;
1398
+ onBackdropClick(ev: MouseEvent): void;
1399
+ onDraftInput(ev: Event): void;
1400
+ add(): Promise<void>;
1401
+ onTextInput(lesson: AiUserLesson, ev: Event): void;
1402
+ commitText(lesson: AiUserLesson): Promise<void>;
1403
+ toggle(lesson: AiUserLesson, ev: Event): Promise<void>;
1404
+ remove(lesson: AiUserLesson): Promise<void>;
1405
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaAiLessonsEditorComponent, never>;
1406
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaAiLessonsEditorComponent, "ma-ai-lessons-editor", never, {}, { "cancel": "cancel"; }, never, never, true, never>;
1407
+ }
1408
+
1266
1409
  /**
1267
1410
  * Tiny hand-rolled GitHub-flavoured Markdown renderer for AI chat bubbles.
1268
1411
  *
@@ -1285,5 +1428,5 @@ declare class MaAiMarkdownPipe implements PipeTransform {
1285
1428
  }
1286
1429
  declare function renderMarkdown(src: string): string;
1287
1430
 
1288
- export { ALL_ACTIONS, AVATAR_FRAMES, ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, DEFAULT_AI_CONFIG, MES_AUTH_AI_CONFIG, MES_AUTH_CONFIG, MaAiButtonComponent, MaAiChatPanelComponent, MaAiMarkdownPipe, MaAiService, MaAiToolsRegistry, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaAvatarComponent, MaIconComponent, MaThemeDirective, MaUiConfigService, MaUserComponent, MaUserMenuColor, MaUserMenuComponent, MaUserXComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, PACKAGE_VERSION, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, extractXMaPerm, mesAuthInterceptor, provideMesAuth, provideMesAuthAi, renderMarkdown, runReturnViaPostMessageIfRequested, runSsoCheckHandshake, withXMaPerm, xMaResource };
1289
- export type { AiSseEvent, ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, AvatarFrameDef, AvatarShape, AvatarSize, ChatBubble, ChatToolEvent, ClientTool, ClientToolSchema, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MaUiManifest, MesAuthAiConfig, MesAuthConfig, NotificationDto, PagedList, PendingApproval, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };
1431
+ export { ALL_ACTIONS, AVATAR_FRAMES, ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, DEFAULT_AI_CONFIG, MES_AUTH_AI_CONFIG, MES_AUTH_CONFIG, MaAiButtonComponent, MaAiChatPanelComponent, MaAiHistoryListComponent, MaAiLessonsEditorComponent, MaAiMarkdownPipe, MaAiService, MaAiToolsRegistry, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaAvatarComponent, MaIconComponent, MaThemeDirective, MaUiConfigService, MaUserComponent, MaUserMenuColor, MaUserMenuComponent, MaUserXComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, PACKAGE_VERSION, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, extractXMaPerm, mesAuthInterceptor, provideMesAuth, provideMesAuthAi, renderMarkdown, runReturnViaPostMessageIfRequested, runSsoCheckHandshake, withXMaPerm, xMaResource };
1432
+ export type { AiConversationDetail, AiConversationSummary, AiSseEvent, AiStoredMessage, AiStoredToolCall, AiUserLesson, ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, AvatarFrameDef, AvatarShape, AvatarSize, ChatBubble, ChatToolEvent, ClientTool, ClientToolSchema, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MaAiPanelMode, MaUiManifest, MesAuthAiConfig, MesAuthConfig, NotificationDto, PagedList, PendingApproval, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };