mesauth-angular 1.23.0 → 1.25.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.23.0",
3
+ "version": "1.25.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",
@@ -162,6 +162,11 @@ declare class MesAuthService {
162
162
  readonly notifications$: Observable<any>;
163
163
  private readonly _approvalEvents;
164
164
  readonly approvalEvents$: Observable<any>;
165
+ /** Fires when the notification list was modified externally (e.g. AI marked-all-read). */
166
+ private readonly _notificationsModified;
167
+ readonly notificationsModified$: Observable<void>;
168
+ /** Called by AI client tools after any notification-mutating action. */
169
+ signalNotificationsModified(): void;
165
170
  private apiBase;
166
171
  private config;
167
172
  private http;
@@ -245,9 +250,18 @@ declare class MesAuthService {
245
250
  }
246
251
 
247
252
  /**
248
- * Functional HTTP interceptor for handling 401/403 auth errors.
249
- * Redirects to login page on 401, and to 403 page on 403.
250
- * Includes loopback prevention to avoid infinite redirects.
253
+ * Functional HTTP interceptor.
254
+ *
255
+ * Responsibilities:
256
+ * 1. Attach `Authorization: Bearer` + `X-Refresh-Token` from localStorage to requests
257
+ * targeting the auth server / trusted hosts (so the server-side Authorizer middleware
258
+ * can perform silent refresh and emit X-Refreshed-* response headers).
259
+ * 2. On every successful response, if `X-Refreshed-Token` is present, write it to
260
+ * localStorage exactly once (dedup across parallel responses).
261
+ * 3. On 401, queue concurrent failures behind a single 1.5s wait so only ONE retry
262
+ * fires per refresh window. Retries strip the stale auth headers so the interceptor
263
+ * re-reads the freshly-stored tokens from localStorage.
264
+ * 4. On 403, redirect to /403.
251
265
  */
252
266
  declare const mesAuthInterceptor: HttpInterceptorFn;
253
267
 
@@ -660,6 +674,12 @@ interface AiUserLesson {
660
674
  createdAt: string;
661
675
  updatedAt: string;
662
676
  }
677
+ /** A question the AI is asking the user via the ask_user tool (pauses the orchestrator loop). */
678
+ interface PendingQuestion {
679
+ callId: string;
680
+ message: string;
681
+ options?: string[];
682
+ }
663
683
  /** Stream event types matching MesAuth.Api's AiStreamEvent JSON. */
664
684
  type AiSseEvent = {
665
685
  type: 'session';
@@ -699,6 +719,7 @@ interface PendingApproval {
699
719
  args: any;
700
720
  side: 'client';
701
721
  }
722
+
702
723
  /**
703
724
  * Drives the chat panel.
704
725
  *
@@ -713,6 +734,8 @@ declare class MaAiService {
713
734
  readonly streaming: _angular_core.WritableSignal<boolean>;
714
735
  /** When non-null, a write-class client tool is awaiting user confirmation. */
715
736
  readonly pendingApproval: _angular_core.WritableSignal<PendingApproval>;
737
+ /** When non-null, the AI called ask_user and is waiting for the user's answer. */
738
+ readonly pendingQuestion: _angular_core.WritableSignal<PendingQuestion>;
716
739
  readonly lastError: _angular_core.WritableSignal<string>;
717
740
  private sessionId;
718
741
  /** Verbs the user already chose "always approve" for in this session. */
@@ -725,6 +748,8 @@ declare class MaAiService {
725
748
  resetSession(): void;
726
749
  /** Cancel the in-flight stream (if any). The session id is preserved so the user can resume. */
727
750
  cancel(): void;
751
+ /** Send the user's answer to a pending ask_user question back to the orchestrator. */
752
+ resolveQuestion(answer: string): Promise<void>;
728
753
  /** User typed and submitted a message. */
729
754
  send(text: string, currentRoute?: string): Promise<void>;
730
755
  /**
@@ -796,8 +821,10 @@ declare class MaAiChatPanelComponent implements AfterViewInit, OnDestroy {
796
821
  readonly messages: _angular_core.WritableSignal<mesauth_angular.ChatBubble[]>;
797
822
  readonly streaming: _angular_core.WritableSignal<boolean>;
798
823
  readonly pendingApproval: _angular_core.WritableSignal<mesauth_angular.PendingApproval>;
824
+ readonly pendingQuestion: _angular_core.WritableSignal<mesauth_angular.PendingQuestion>;
799
825
  readonly lastError: _angular_core.WritableSignal<string>;
800
826
  readonly hasMessages: _angular_core.Signal<boolean>;
827
+ readonly questionInput: _angular_core.WritableSignal<string>;
801
828
  private isDragging;
802
829
  private dragStartX;
803
830
  private dragStartWidth;
@@ -818,6 +845,8 @@ declare class MaAiChatPanelComponent implements AfterViewInit, OnDestroy {
818
845
  approve(): void;
819
846
  alwaysApprove(): void;
820
847
  decline(): void;
848
+ answerQuestion(answer: string): void;
849
+ submitQuestionInput(): void;
821
850
  startResize(ev: PointerEvent): void;
822
851
  onResizeMove(ev: PointerEvent): void;
823
852
  endResize(ev: PointerEvent): void;
@@ -1131,7 +1160,7 @@ interface MaUiManifest {
1131
1160
  quickPrompts?: string[];
1132
1161
  }
1133
1162
  /** Current installed package version — keep in sync with package.json. */
1134
- declare const PACKAGE_VERSION = "1.23.0";
1163
+ declare const PACKAGE_VERSION = "1.25.0";
1135
1164
  /**
1136
1165
  * Provides server-driven UI configuration loaded from the hosted manifest.
1137
1166
  * Components read `labels()` and `features()` signals instead of hardcoded strings.
@@ -1429,4 +1458,4 @@ declare class MaAiMarkdownPipe implements PipeTransform {
1429
1458
  declare function renderMarkdown(src: string): string;
1430
1459
 
1431
1460
  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 };
1461
+ 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, PendingQuestion, PermissionHeader, RealTimeNotificationDto, RequestConfig, RolePreviewUserDto, StepRoleDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };