mesauth-angular 1.22.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.22.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>;
@@ -612,6 +615,51 @@ interface ChatToolEvent {
612
615
  args?: any;
613
616
  readOnly?: boolean;
614
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
+ }
615
663
  /** Stream event types matching MesAuth.Api's AiStreamEvent JSON. */
616
664
  type AiSseEvent = {
617
665
  type: 'session';
@@ -697,6 +745,29 @@ declare class MaAiService {
697
745
  private verbOf;
698
746
  private summarize;
699
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;
700
771
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MaAiService, never>;
701
772
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MaAiService>;
702
773
  }
@@ -710,6 +781,7 @@ declare class MaAiChatPanelComponent implements AfterViewInit, OnDestroy {
710
781
  readonly isOpen: _angular_core.WritableSignal<boolean>;
711
782
  readonly width: _angular_core.WritableSignal<number>;
712
783
  readonly draft: _angular_core.WritableSignal<string>;
784
+ readonly historyOpen: _angular_core.WritableSignal<boolean>;
713
785
  readonly ai: MaAiService;
714
786
  private readonly router;
715
787
  private readonly themeService;
@@ -737,6 +809,8 @@ declare class MaAiChatPanelComponent implements AfterViewInit, OnDestroy {
737
809
  close(): void;
738
810
  toggle(): void;
739
811
  newConversation(): void;
812
+ toggleHistory(): void;
813
+ onHistoryResumed(_id: string): void;
740
814
  send(): void;
741
815
  cancel(): void;
742
816
  onTextareaKey(ev: KeyboardEvent): void;
@@ -1057,7 +1131,7 @@ interface MaUiManifest {
1057
1131
  quickPrompts?: string[];
1058
1132
  }
1059
1133
  /** Current installed package version — keep in sync with package.json. */
1060
- declare const PACKAGE_VERSION = "1.21.0";
1134
+ declare const PACKAGE_VERSION = "1.23.0";
1061
1135
  /**
1062
1136
  * Provides server-driven UI configuration loaded from the hosted manifest.
1063
1137
  * Components read `labels()` and `features()` signals instead of hardcoded strings.
@@ -1282,6 +1356,56 @@ declare class MaAiButtonComponent {
1282
1356
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MaAiButtonComponent, "ma-ai-button", never, {}, { "clicked": "clicked"; }, never, never, true, never>;
1283
1357
  }
1284
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
+
1285
1409
  /**
1286
1410
  * Tiny hand-rolled GitHub-flavoured Markdown renderer for AI chat bubbles.
1287
1411
  *
@@ -1304,5 +1428,5 @@ declare class MaAiMarkdownPipe implements PipeTransform {
1304
1428
  }
1305
1429
  declare function renderMarkdown(src: string): string;
1306
1430
 
1307
- 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 };
1308
- 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, MaAiPanelMode, 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 };