@sinequa/assistant 3.9.8 → 3.10.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.
Files changed (111) hide show
  1. package/chat/chat-message/chat-message.component.d.ts +2 -4
  2. package/chat/chat.component.d.ts +4 -3
  3. package/chat/chat.service.d.ts +16 -1
  4. package/chat/custom-elements/components/code-block.component.d.ts +11 -0
  5. package/chat/custom-elements/components/document-reference.component.d.ts +13 -0
  6. package/chat/custom-elements/components/i18n/de.json +5 -0
  7. package/chat/custom-elements/components/i18n/en.json +5 -0
  8. package/chat/custom-elements/components/i18n/fr.json +5 -0
  9. package/chat/custom-elements/components/image-reference.component.d.ts +14 -0
  10. package/chat/custom-elements/components/page-reference.component.d.ts +14 -0
  11. package/chat/custom-elements/components/table-tools.component.d.ts +11 -0
  12. package/chat/custom-elements/custom-elements.config.d.ts +2 -0
  13. package/chat/{services → custom-elements}/custom-elements.service.d.ts +1 -0
  14. package/chat/documents-upload/documents-upload.service.d.ts +2 -2
  15. package/chat/fetch-patcher/app-injector.d.ts +9 -0
  16. package/chat/fetch-patcher/fetch-patcher.d.ts +31 -0
  17. package/chat/fetch-patcher/global-error-handler.service.d.ts +36 -0
  18. package/chat/fetch-patcher/handle-unauthorized-logic.d.ts +13 -0
  19. package/chat/markdown-it/markdown-it.config.d.ts +4 -0
  20. package/chat/markdown-it/plugins/document-reference.plugin.d.ts +8 -0
  21. package/chat/markdown-it/plugins/image-reference.plugin.d.ts +9 -0
  22. package/chat/markdown-it/plugins/page-reference.plugin.d.ts +9 -0
  23. package/chat/markdown-it/plugins/table-tools.plugin.d.ts +2 -0
  24. package/chat/public-api.d.ts +21 -2
  25. package/chat/{chat-reference → references/chat-reference}/chat-reference.component.d.ts +1 -1
  26. package/chat/references/chat-reference-image/chat-reference-image.component.d.ts +20 -0
  27. package/chat/references/chat-reference-page/chat-reference-page.component.d.ts +20 -0
  28. package/chat/references/i18n/de.json +4 -4
  29. package/chat/references/i18n/en.json +1 -1
  30. package/chat/references/i18n/fr.json +1 -1
  31. package/chat/saved-chats/i18n/de.json +2 -1
  32. package/chat/saved-chats/i18n/en.json +2 -1
  33. package/chat/saved-chats/i18n/fr.json +2 -1
  34. package/chat/saved-chats/saved-chats.component.d.ts +4 -0
  35. package/chat/saved-chats/saved-chats.service.d.ts +2 -2
  36. package/chat/services/assistant-metadata.service.d.ts +5 -1
  37. package/chat/services/signalR.web.service.d.ts +0 -11
  38. package/chat/smart-renderer/smart-renderer.d.ts +2 -0
  39. package/chat/token-progress-bar/i18n/en.json +1 -1
  40. package/chat/types/message-reference.types.d.ts +3 -0
  41. package/chat/types.d.ts +55 -35
  42. package/chat/version.d.ts +1 -0
  43. package/esm2022/chat/chat-message/chat-message.component.mjs +15 -12
  44. package/esm2022/chat/chat-settings-v3/chat-settings-v3.component.mjs +22 -19
  45. package/esm2022/chat/chat.component.mjs +39 -26
  46. package/esm2022/chat/chat.service.mjs +39 -6
  47. package/esm2022/chat/custom-elements/components/code-block.component.mjs +97 -0
  48. package/esm2022/chat/custom-elements/components/document-reference.component.mjs +85 -0
  49. package/esm2022/chat/custom-elements/components/image-reference.component.mjs +79 -0
  50. package/esm2022/chat/custom-elements/components/page-reference.component.mjs +79 -0
  51. package/esm2022/chat/custom-elements/components/table-tools.component.mjs +111 -0
  52. package/esm2022/chat/custom-elements/custom-elements.config.mjs +6 -0
  53. package/esm2022/chat/custom-elements/custom-elements.service.mjs +35 -0
  54. package/esm2022/chat/debug-message/debug-message.service.mjs +3 -3
  55. package/esm2022/chat/documents-upload/document-list/document-list.component.mjs +3 -3
  56. package/esm2022/chat/documents-upload/document-overview/document-overview.component.mjs +5 -5
  57. package/esm2022/chat/documents-upload/documents-upload.service.mjs +11 -9
  58. package/esm2022/chat/fetch-patcher/app-injector.mjs +19 -0
  59. package/esm2022/chat/fetch-patcher/fetch-patcher.mjs +62 -0
  60. package/esm2022/chat/fetch-patcher/global-error-handler.service.mjs +92 -0
  61. package/esm2022/chat/fetch-patcher/handle-unauthorized-logic.mjs +19 -0
  62. package/esm2022/chat/markdown-it/markdown-it.config.mjs +6 -0
  63. package/esm2022/chat/markdown-it/plugins/code-block.plugin.mjs +14 -0
  64. package/esm2022/chat/markdown-it/plugins/document-reference.plugin.mjs +66 -0
  65. package/esm2022/chat/markdown-it/plugins/image-reference.plugin.mjs +67 -0
  66. package/esm2022/chat/markdown-it/plugins/link.plugin.mjs +15 -0
  67. package/esm2022/chat/markdown-it/plugins/page-reference.plugin.mjs +67 -0
  68. package/esm2022/chat/markdown-it/plugins/table-tools.plugin.mjs +12 -0
  69. package/esm2022/chat/public-api.mjs +23 -3
  70. package/esm2022/chat/references/chat-reference/chat-reference.component.mjs +72 -0
  71. package/esm2022/chat/references/chat-reference-image/chat-reference-image.component.mjs +42 -0
  72. package/esm2022/chat/references/chat-reference-page/chat-reference-page.component.mjs +42 -0
  73. package/esm2022/chat/saved-chats/saved-chats.component.mjs +26 -6
  74. package/esm2022/chat/saved-chats/saved-chats.service.mjs +14 -10
  75. package/esm2022/chat/services/app.service.mjs +7 -2
  76. package/esm2022/chat/services/assistant-metadata.service.mjs +40 -9
  77. package/esm2022/chat/services/assistant-ws-frames.service.mjs +7 -4
  78. package/esm2022/chat/services/signalR-connection.service.mjs +3 -6
  79. package/esm2022/chat/services/signalR.web.service.mjs +3 -13
  80. package/esm2022/chat/services/user-settings.service.mjs +6 -3
  81. package/esm2022/chat/smart-renderer/smart-renderer.mjs +19 -18
  82. package/esm2022/chat/types/message-reference.types.mjs +1 -1
  83. package/esm2022/chat/types.mjs +10 -8
  84. package/esm2022/chat/utils/utils.service.mjs +11 -11
  85. package/esm2022/chat/version.mjs +3 -0
  86. package/fesm2022/sinequa-assistant-chat.mjs +1662 -1382
  87. package/fesm2022/sinequa-assistant-chat.mjs.map +1 -1
  88. package/package.json +6 -6
  89. package/chat/chat-reference/i18n/de.json +0 -4
  90. package/chat/chat-reference/i18n/en.json +0 -4
  91. package/chat/chat-reference/i18n/fr.json +0 -4
  92. package/chat/directives/copy-to-clipboard.directive.d.ts +0 -8
  93. package/chat/markdown-it-plugins/image-reference.plugin.d.ts +0 -3
  94. package/chat/markdown-it-plugins/page-reference.plugin.d.ts +0 -3
  95. package/chat/markdown-it-plugins/reference.plugin.d.ts +0 -7
  96. package/chat/references/inline-image-reference.d.ts +0 -21
  97. package/chat/references/inline-page-reference.d.ts +0 -21
  98. package/chat/references/references.component.d.ts +0 -43
  99. package/esm2022/chat/chat-reference/chat-reference.component.mjs +0 -74
  100. package/esm2022/chat/directives/copy-to-clipboard.directive.mjs +0 -68
  101. package/esm2022/chat/markdown-it-plugins/code-block.plugin.mjs +0 -14
  102. package/esm2022/chat/markdown-it-plugins/image-reference.plugin.mjs +0 -58
  103. package/esm2022/chat/markdown-it-plugins/link.plugin.mjs +0 -15
  104. package/esm2022/chat/markdown-it-plugins/page-reference.plugin.mjs +0 -60
  105. package/esm2022/chat/markdown-it-plugins/reference.plugin.mjs +0 -68
  106. package/esm2022/chat/references/inline-image-reference.mjs +0 -110
  107. package/esm2022/chat/references/inline-page-reference.mjs +0 -110
  108. package/esm2022/chat/references/references.component.mjs +0 -290
  109. package/esm2022/chat/services/custom-elements.service.mjs +0 -43
  110. /package/chat/{markdown-it-plugins → markdown-it/plugins}/code-block.plugin.d.ts +0 -0
  111. /package/chat/{markdown-it-plugins → markdown-it/plugins}/link.plugin.d.ts +0 -0
@@ -27,11 +27,9 @@ export declare class ChatMessageComponent implements OnChanges {
27
27
  collapseReferences: boolean;
28
28
  openDocument: EventEmitter<{
29
29
  reference: ChatContextAttachment;
30
- partId?: number;
31
30
  }>;
32
31
  openPreview: EventEmitter<{
33
32
  reference: ChatContextAttachment;
34
- partId?: number;
35
33
  }>;
36
34
  suggestAction: EventEmitter<SuggestedAction>;
37
35
  edit: EventEmitter<ChatMessage>;
@@ -69,8 +67,8 @@ export declare class ChatMessageComponent implements OnChanges {
69
67
  processReferences(ref: string): void;
70
68
  private _copyToClipboard;
71
69
  copyMessage(message: ChatMessage): void;
72
- openAttachmentPreview(attachment: ChatContextAttachment, partId?: number): void;
73
- openOriginalAttachment(attachment: ChatContextAttachment, partId?: number): void;
70
+ openAttachmentPreview(attachment: ChatContextAttachment): void;
71
+ openOriginalAttachment(attachment: ChatContextAttachment): void;
74
72
  hideTooltip(): void;
75
73
  static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
76
74
  static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageComponent, "sq-chat-message", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; }; "conversation": { "alias": "conversation"; "required": false; }; "suggestedActions": { "alias": "suggestedActions"; "required": false; }; "assistantMessageIcon": { "alias": "assistantMessageIcon"; "required": false; }; "userMessageIcon": { "alias": "userMessageIcon"; "required": false; }; "connectionErrorMessageIcon": { "alias": "connectionErrorMessageIcon"; "required": false; }; "searchWarningMessageIcon": { "alias": "searchWarningMessageIcon"; "required": false; }; "streaming": { "alias": "streaming"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; "canRegenerate": { "alias": "canRegenerate"; "required": false; }; "canCopy": { "alias": "canCopy"; "required": false; }; "canDebug": { "alias": "canDebug"; "required": false; }; "canLike": { "alias": "canLike"; "required": false; }; "canDislike": { "alias": "canDislike"; "required": false; }; "collapseReferences": { "alias": "collapseReferences"; "required": false; }; }, { "openDocument": "openDocument"; "openPreview": "openPreview"; "suggestAction": "suggestAction"; "edit": "edit"; "copy": "copy"; "regenerate": "regenerate"; "like": "like"; "dislike": "dislike"; "debug": "debug"; }, never, never, true, never>;
@@ -18,6 +18,7 @@ export declare class ChatComponent implements OnInit, OnChanges, OnDestroy {
18
18
  notificationsService: NotificationsService;
19
19
  private readonly transloco;
20
20
  private readonly assistantUtils;
21
+ private destroyRef;
21
22
  /** Define the key based on it, the chat service instance will be stored */
22
23
  instanceId: string;
23
24
  /** Define the query to use to fetch answers */
@@ -46,6 +47,8 @@ export declare class ChatComponent implements OnInit, OnChanges, OnDestroy {
46
47
  /** Icon to use for the search warning messages */
47
48
  searchWarningMessageIcon: string;
48
49
  additionalWorkflowProperties: Record<string, any>;
50
+ /** Used by assistant web component to pass properly init the global config */
51
+ appConfig: AppGlobalConfig;
49
52
  /** Event emitter triggered once the signalR connection is established */
50
53
  connection: EventEmitter<HubConnection>;
51
54
  /** Event emitter triggered each time the assistant updates the current chat */
@@ -61,19 +64,16 @@ export declare class ChatComponent implements OnInit, OnChanges, OnDestroy {
61
64
  /** Event emitter triggered when the user clicks on a suggested action */
62
65
  suggestAction: EventEmitter<SuggestedAction>;
63
66
  /** ViewChild decorators to access the template elements */
64
- messageList?: ElementRef<HTMLUListElement>;
65
67
  questionInput?: ElementRef<HTMLTextAreaElement>;
66
68
  /** ContentChild decorators allowing the override of the default templates from the parent component */
67
69
  loadingTpl?: TemplateRef<any>;
68
70
  reportTpl?: TemplateRef<any>;
69
71
  tokenConsumptionTpl?: TemplateRef<any>;
70
72
  debugMessagesTpl?: TemplateRef<any>;
71
- appConfig: AppGlobalConfig;
72
73
  config: ChatConfig;
73
74
  messages$: BehaviorSubject<ChatMessage[] | undefined>;
74
75
  isAdminOrDeletedAdmin: boolean;
75
76
  question: string;
76
- private _sub;
77
77
  private _dataSubscription;
78
78
  /** Variables that depend on the type of model in use */
79
79
  modelDescription?: GllmModelDescription;
@@ -100,6 +100,7 @@ export declare class ChatComponent implements OnInit, OnChanges, OnDestroy {
100
100
  showDebugMessages: boolean;
101
101
  private _previousQuery;
102
102
  private _reloadSubscription;
103
+ constructor();
103
104
  ngOnInit(): void;
104
105
  ngOnChanges(changes: SimpleChanges): void;
105
106
  ngOnDestroy(): void;
@@ -6,7 +6,7 @@ import { AppService } from "./services/app.service";
6
6
  import { NotificationsService } from "./services/notification.service";
7
7
  import { PrincipalService } from "./services/principal.service";
8
8
  import { UserSettingsWebService } from "./services/user-settings.service";
9
- import { ChatConfig, ChatMessage, ChatResponse, ChatUsageMetrics, DebugMessage, DeleteSavedChatResponse, GllmFunction, GllmModelDescription, KvObject, ListObject, MessageHandler, Quota, SavedChat, SavedChatHistory, SavedChatResponse, TokenConsumption, UserTokenConsumption } from "./types";
9
+ import { ChatConfig, ChatMessage, ChatResponse, ChatUsageMetrics, DebugMessage, DeleteSavedChatResponse, GllmFunction, GllmModelDescription, KvObject, ListObject, MessageHandler, PluginVersion, Quota, SavedChat, SavedChatHistory, SavedChatResponse, TokenConsumption, UserTokenConsumption } from "./types";
10
10
  import { ConnectionOptions } from "./services/signalR.web.service";
11
11
  import { AssistantUtils } from "./utils/utils.service";
12
12
  import * as i0 from "@angular/core";
@@ -88,6 +88,21 @@ export declare class ChatService {
88
88
  * It can be overridden by the app config
89
89
  */
90
90
  getRESTRequestsUrl(): void;
91
+ /**
92
+ * Retrieves the plugin version information.
93
+ * @returns An Observable of PluginVersion or undefined.
94
+ */
95
+ getPluginVersion(): Observable<PluginVersion | undefined>;
96
+ /**
97
+ * Retrieves the Sinequa Enterprise Search version.
98
+ * @returns The Sinequa Enterprise Search version as a string, or undefined if not available.
99
+ */
100
+ getSinequaESVersion(): Observable<string | undefined>;
101
+ /**
102
+ * Checks and logs the version alignment between the Angular library, plugin, and Sinequa ES.
103
+ * It fetches the plugin and Sinequa ES versions in parallel and logs the information to the console.
104
+ */
105
+ checkVersionAlignment(): Observable<any>;
91
106
  /**
92
107
  * Initializes the SavedChatsService with the necessary configuration.
93
108
  *
@@ -0,0 +1,11 @@
1
+ import { ElementRef } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class CodeBlockComponent {
4
+ langname: string;
5
+ el: ElementRef<any>;
6
+ copying: import("@angular/core").WritableSignal<boolean>;
7
+ handleClick(event: Event): void;
8
+ copyCodeToClipboard(code: string): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<CodeBlockComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<CodeBlockComponent, "code-block", never, { "langname": { "alias": "langname"; "required": false; }; }, {}, never, ["*"], true, never>;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { OnChanges } from "@angular/core";
2
+ import { ChatContextAttachment } from "../../types";
3
+ import * as i0 from "@angular/core";
4
+ export declare class DocumentReferenceComponent implements OnChanges {
5
+ id: any;
6
+ attachment: any;
7
+ ref: ChatContextAttachment;
8
+ ngOnChanges(): void;
9
+ onOpenPreview(attachment: ChatContextAttachment): void;
10
+ onOpenDocument(attachment: ChatContextAttachment): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentReferenceComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentReferenceComponent, "document-reference", never, { "id": { "alias": "id"; "required": false; }; "attachment": { "alias": "attachment"; "required": false; }; }, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "copied": "Kopiert",
3
+ "copyAsCSV": "Als CSV kopieren",
4
+ "downloadAsCSV": "Als CSV herunterladen"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "copied": "Copied",
3
+ "copyAsCSV": "Copy as CSV",
4
+ "downloadAsCSV": "Download as CSV"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "copied": "Copié",
3
+ "copyAsCSV": "Copier en CSV",
4
+ "downloadAsCSV": "Télécharger en CSV"
5
+ }
@@ -0,0 +1,14 @@
1
+ import { OnChanges } from "@angular/core";
2
+ import { ChatContextAttachment } from "../../types";
3
+ import type { MessageImageReference } from "../../types/message-reference.types";
4
+ import * as i0 from "@angular/core";
5
+ export declare class ImageReferenceComponent implements OnChanges {
6
+ id: any;
7
+ attachment: any;
8
+ ref: MessageImageReference;
9
+ ngOnChanges(): void;
10
+ onOpenPreview(attachment: ChatContextAttachment): void;
11
+ onOpenDocument(attachment: ChatContextAttachment): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ImageReferenceComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<ImageReferenceComponent, "image-reference", never, { "id": { "alias": "id"; "required": false; }; "attachment": { "alias": "attachment"; "required": false; }; }, {}, never, never, true, never>;
14
+ }
@@ -0,0 +1,14 @@
1
+ import { OnChanges } from "@angular/core";
2
+ import { ChatContextAttachment } from "../../types";
3
+ import type { MessageImageReference } from "../../types/message-reference.types";
4
+ import * as i0 from "@angular/core";
5
+ export declare class PageReferenceComponent implements OnChanges {
6
+ id: any;
7
+ attachment: any;
8
+ ref: MessageImageReference;
9
+ ngOnChanges(): void;
10
+ onOpenPreview(attachment: ChatContextAttachment): void;
11
+ onOpenDocument(attachment: ChatContextAttachment): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<PageReferenceComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<PageReferenceComponent, "page-reference", never, { "id": { "alias": "id"; "required": false; }; "attachment": { "alias": "attachment"; "required": false; }; }, {}, never, never, true, never>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TableToolsComponent {
3
+ private readonly host;
4
+ copied: import("@angular/core").WritableSignal<boolean>;
5
+ get table(): HTMLTableElement | null;
6
+ copyAsCSV(): void;
7
+ downloadAsCSV(): void;
8
+ private extractCSV;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableToolsComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableToolsComponent, "table-tools", never, {}, {}, never, ["*"], true, never>;
11
+ }
@@ -0,0 +1,2 @@
1
+ import { InjectionToken, Type } from '@angular/core';
2
+ export declare const ASSISTANT_CUSTOM_ELEMENTS: InjectionToken<Record<string, Type<unknown>>>;
@@ -6,6 +6,7 @@ import * as i0 from "@angular/core";
6
6
  */
7
7
  export declare class CustomElementsService {
8
8
  private _injector;
9
+ private readonly _customElements;
9
10
  setupCustomElements(): void;
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomElementsService, never>;
11
12
  static ɵprov: i0.ɵɵInjectableDeclaration<CustomElementsService>;
@@ -1,7 +1,7 @@
1
- import { BehaviorSubject, Observable } from 'rxjs';
2
- import { deleteDocumentsResponse, IndexingInfos, UploadConfig, UploadedDocument, UploadedDocuments, UploadEvent } from './documents-upload.model';
3
1
  import { HttpClient } from '@angular/common/http';
2
+ import { BehaviorSubject, Observable } from 'rxjs';
4
3
  import { AppService } from '../services/app.service';
4
+ import { deleteDocumentsResponse, IndexingInfos, UploadConfig, UploadedDocument, UploadedDocuments, UploadEvent } from './documents-upload.model';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class DocumentsUploadService {
7
7
  readonly REQUEST_URL = "api/v1/plugin/SinequaAssistantREST";
@@ -0,0 +1,9 @@
1
+ import { Injector } from '@angular/core';
2
+ /**
3
+ * Function to set the global Injector reference.
4
+ */
5
+ export declare function setAppInjector(injector: Injector): void;
6
+ /**
7
+ * Function to retrieve the global Injector reference.
8
+ */
9
+ export declare function getAppInjector(): Injector;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Initializes a global fetch interceptor that patches the native window.fetch function.
3
+ *
4
+ * This function replaces the browser's native fetch with a custom implementation that:
5
+ * - Preserves all original fetch functionality and behavior
6
+ * - Intercepts HTTP responses that are not successful (!response.ok)
7
+ * - Automatically handles errors through the GlobalErrorHandlerService when available
8
+ * - Logs network errors to the console for debugging purposes
9
+ *
10
+ * The interceptor uses Angular's dependency injection system to retrieve the
11
+ * GlobalErrorHandlerService and delegate error handling to it. If the injector
12
+ * is not available, the function gracefully continues without error handling.
13
+ *
14
+ * @remarks
15
+ * - This function should be called once during application initialization
16
+ * - The original fetch function is preserved and all requests are forwarded to it
17
+ * - Non-ok responses are still returned to the caller after error handling
18
+ * - Network errors (connection failures, etc.) are logged and re-thrown
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // Call during app initialization
23
+ * initializeFetchInterceptor();
24
+ *
25
+ * // All subsequent fetch calls will be automatically intercepted
26
+ * fetch('/api/data').then(response => {
27
+ * // Error handling already occurred if response was not ok
28
+ * });
29
+ * ```
30
+ */
31
+ export declare function initializeFetchInterceptor(): void;
@@ -0,0 +1,36 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Injection Token for the specific function to execute on a 401 Unauthorized error.
5
+ */
6
+ export declare const ASSISTANT_UNAUTHORIZED_ACTION_TOKEN: InjectionToken<() => void>;
7
+ export declare class GlobalErrorHandlerService {
8
+ private unauthorizedAction;
9
+ /** Prevents infinite unauthorized attempts */
10
+ private _authAttempted;
11
+ /** Tracks if a re-authentication process is currently in progress */
12
+ private _reauthInProgress;
13
+ private authEventListener;
14
+ constructor();
15
+ /**
16
+ * Sets up a global listener for the `authenticated` event.
17
+ * When re-authentication succeeds (authenticated === true),
18
+ * reset the auth lock so another 401 can trigger again later.
19
+ */
20
+ private setupAuthEventListener;
21
+ /**
22
+ * Main entry point to handle fetch or HTTP errors globally.
23
+ */
24
+ handleFetchError(url: string, status: number, statusText: string): void;
25
+ /**
26
+ * Handles 401 errors by triggering re-authentication only once
27
+ * until authentication is restored (via the DOM event).
28
+ */
29
+ private handleUnauthorized;
30
+ /**
31
+ * Clean up global event listener when Angular destroys this service.
32
+ */
33
+ ngOnDestroy(): void;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<GlobalErrorHandlerService, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<GlobalErrorHandlerService>;
36
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Handles unauthorized HTTP responses (401) by clearing session data and reloading the page.
3
+ *
4
+ * This function is triggered when a 401 Unauthorized response is detected during API calls.
5
+ * It performs cleanup operations by removing stored credentials from session storage
6
+ * and forces a page reload to redirect the user to the login flow.
7
+ *
8
+ * @remarks
9
+ * This function directly manipulates the browser's session storage and window location,
10
+ * making it suitable for client-side applications only.
11
+ *
12
+ */
13
+ export declare const handleUnauthorizedLogic: () => void;
@@ -0,0 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type MarkdownIt from 'markdown-it';
3
+ export type MarkdownItPlugin = (md: MarkdownIt, ...params: any[]) => void;
4
+ export declare const ASSISTANT_MARKDOWN_IT_PLUGINS: InjectionToken<MarkdownItPlugin[]>;
@@ -0,0 +1,8 @@
1
+ import type MarkdownIt from "markdown-it";
2
+ /**
3
+ * A markdown-it plugin to convert [n] where n is a number into a <document-reference id="n">n</document-reference> HTML tag.
4
+ *
5
+ * For example, when attachment 123 is found in the referencesMap, [123] will be converted to <document-reference id="123">123</document-reference>.
6
+ * If the attachment is not found, it will remain as plain text [123] in a span tag : <span>[123]</span>
7
+ */
8
+ export declare function markdownItDocumentReferencePlugin(md: MarkdownIt): void;
@@ -0,0 +1,9 @@
1
+ import type MarkdownIt from "markdown-it";
2
+ /**
3
+ * A markdown-it plugin to convert [Img-x.y.z], where x, y and z are numbers, into a <image-reference id="x.y.z">Img-x.y.z</image-reference> HTML tag.
4
+ *
5
+ * For example, when attachment x is found in the referencesMap and which contains the image z of the part y, [Img-x.y.z] will be converted to <image-reference id="x.y.z">Img-x.y.z</image-reference>.
6
+ * If the attachment x, the part y or the image z is not found, it will remain as plain text [Img-x.y.z] in a span tag : <span>[Img-x.y.z]</span>
7
+ */
8
+ export declare const EMBEDDED_IMAGE_NAME = "embedded-image-reference";
9
+ export declare function markdownItImageReferencePlugin(md: MarkdownIt): void;
@@ -0,0 +1,9 @@
1
+ import type MarkdownIt from "markdown-it";
2
+ /**
3
+ * A markdown-it plugin to convert [Page-x.n], where x and n are numbers, into a <page-reference id="x.n">Page-x.n</page-reference> HTML tag.
4
+ *
5
+ * For example, when attachment x is found in the referencesMap and which contains the page n, [Page-x.n] will be converted to <page-reference id="x.n">Page-x.n</page-reference>.
6
+ * If the attachment x or the page n is not found, it will remain as plain text [Page-x.n] in a span tag : <span>[Page-x.n]</span>
7
+ */
8
+ export declare const EMBEDDED_PAGE_NAME = "embedded-page-reference";
9
+ export declare function markdownItPageReferencePlugin(md: MarkdownIt): void;
@@ -0,0 +1,2 @@
1
+ import type MarkdownIt from "markdown-it";
2
+ export declare function markdownItTableToolsPlugin(md: MarkdownIt): void;
@@ -12,5 +12,24 @@ export * from './documents-upload/documents-upload.service';
12
12
  export * from './documents-upload/documents-upload.model';
13
13
  export * from './documents-upload/document-overview/document-overview.component';
14
14
  export * from './services/notification.service';
15
- export * from './services/custom-elements.service';
16
- export * from './references/references.component';
15
+ export * from './references/chat-reference/chat-reference.component';
16
+ export * from './references/chat-reference-image/chat-reference-image.component';
17
+ export * from './references/chat-reference-page/chat-reference-page.component';
18
+ export * from './custom-elements/custom-elements.service';
19
+ export * from './custom-elements/custom-elements.config';
20
+ export * from './custom-elements/components/document-reference.component';
21
+ export * from './custom-elements/components/page-reference.component';
22
+ export * from './custom-elements/components/image-reference.component';
23
+ export * from './custom-elements/components/code-block.component';
24
+ export * from './custom-elements/components/table-tools.component';
25
+ export * from './markdown-it/plugins/code-block.plugin';
26
+ export * from './markdown-it/plugins/image-reference.plugin';
27
+ export * from './markdown-it/plugins/link.plugin';
28
+ export * from './markdown-it/plugins/page-reference.plugin';
29
+ export * from './markdown-it/plugins/document-reference.plugin';
30
+ export * from './markdown-it/plugins/table-tools.plugin';
31
+ export * from './markdown-it/markdown-it.config';
32
+ export * from './fetch-patcher/fetch-patcher';
33
+ export * from './fetch-patcher/app-injector';
34
+ export * from './fetch-patcher/global-error-handler.service';
35
+ export * from './fetch-patcher/handle-unauthorized-logic';
@@ -1,5 +1,5 @@
1
1
  import { ElementRef } from "@angular/core";
2
- import { ChatContextAttachment, DocumentPart } from "../types";
2
+ import { ChatContextAttachment, DocumentPart } from "../../types";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ChatReferenceComponent {
5
5
  readonly reference: import("@angular/core").InputSignal<string>;
@@ -0,0 +1,20 @@
1
+ import { ElementRef } from "@angular/core";
2
+ import { DocumentPart, RawAttachment } from "../../types";
3
+ import { MessageImageReference } from "../../types/message-reference.types";
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChatReferenceImageComponent {
6
+ readonly id: import("@angular/core").InputSignal<string>;
7
+ readonly ref: import("@angular/core").InputSignal<MessageImageReference>;
8
+ readonly openPreview: import("@angular/core").OutputEmitterRef<Omit<RawAttachment, "type"> & {
9
+ $partId: number;
10
+ parts: DocumentPart[];
11
+ }>;
12
+ readonly openDocument: import("@angular/core").OutputEmitterRef<Omit<RawAttachment, "type">>;
13
+ readonly openModal: import("@angular/core").OutputEmitterRef<void>;
14
+ readonly modalTpl: import("@angular/core").Signal<ElementRef<HTMLDialogElement> | undefined>;
15
+ previewClicked(): void;
16
+ documentClicked(): void;
17
+ modalClicked(): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatReferenceImageComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatReferenceImageComponent, "ChatReferenceImage", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "ref": { "alias": "ref"; "required": true; "isSignal": true; }; }, { "openPreview": "openPreview"; "openDocument": "openDocument"; "openModal": "openModal"; }, never, never, true, never>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { ElementRef } from "@angular/core";
2
+ import { DocumentPart, RawAttachment } from "../../types";
3
+ import { MessageImageReference } from "../../types/message-reference.types";
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChatReferencePageComponent {
6
+ readonly id: import("@angular/core").InputSignal<string>;
7
+ readonly ref: import("@angular/core").InputSignal<MessageImageReference>;
8
+ readonly openPreview: import("@angular/core").OutputEmitterRef<Omit<RawAttachment, "type"> & {
9
+ $partId: number;
10
+ parts: DocumentPart[];
11
+ }>;
12
+ readonly openDocument: import("@angular/core").OutputEmitterRef<Omit<RawAttachment, "type">>;
13
+ readonly openModal: import("@angular/core").OutputEmitterRef<void>;
14
+ readonly modalTpl: import("@angular/core").Signal<ElementRef<HTMLDialogElement> | undefined>;
15
+ previewClicked(): void;
16
+ documentClicked(): void;
17
+ modalClicked(): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatReferencePageComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatReferencePageComponent, "ChatReferencePage", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "ref": { "alias": "ref"; "required": true; "isSignal": true; }; }, { "openPreview": "openPreview"; "openDocument": "openDocument"; "openModal": "openModal"; }, never, never, true, never>;
20
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "untitledImage": "Unbenanntes Bild",
3
- "openDocumentPreview": "Dokumentvorschau öffnen",
4
- "openDocument": "Dokument öffnen",
5
- "untitledPAge": "Unbenannte Seite"
6
- }
3
+ "untitledPAge": "Unbenannte Seite",
4
+ "previewDocument": "Dokument in Vorschau anzeigen",
5
+ "openDocument": "Dokument öffnen"
6
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "untitledImage": "Untitled image",
3
- "openDocumentPreview": "Open document preview",
3
+ "previewDocument": "Open document preview",
4
4
  "openDocument": "Open document",
5
5
  "untitledPAge": "Untitled page"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "untitledImage": "Image sans titre",
3
- "openDocumentPreview": "Aperçu du document",
3
+ "previewDocument": "Aperçu du document",
4
4
  "openDocument": "Ouvrir le document",
5
5
  "untitledPAge": "Page sans titre"
6
6
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "rename": "Umbenennen",
3
3
  "delete": "Löschen",
4
- "listError": "Hoppla! Wir haben derzeit Probleme beim Laden Ihrer vergangenen Chats. Bitte versuchen Sie es später erneut. Wenn das Problem weiterhin besteht, wenden Sie sich bitte an den Support."
4
+ "listError": "Hoppla! Wir haben derzeit Probleme beim Laden Ihrer vergangenen Chats. Bitte versuchen Sie es später erneut. Wenn das Problem weiterhin besteht, wenden Sie sich bitte an den Support.",
5
+ "searchPlaceholder": "Suche..."
5
6
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "rename": "Rename",
3
3
  "delete": "Delete",
4
- "listError": "Oops! We're having trouble loading your past chats right now. Please try again later. If the problem persists, contact support for assistance."
4
+ "listError": "Oops! We're having trouble loading your past chats right now. Please try again later. If the problem persists, contact support for assistance.",
5
+ "searchPlaceholder": "Search..."
5
6
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "rename": "Renommer",
3
3
  "delete": "Supprimer",
4
- "listError": "Oups ! Nous avons un problème pour charger vos anciennes conversations. Veuillez réessayer plus tard. Si le problème persiste, contactez le support pour assistance."
4
+ "listError": "Oups ! Nous avons un problème pour charger vos anciennes conversations. Veuillez réessayer plus tard. Si le problème persiste, contactez le support pour assistance.",
5
+ "searchPlaceholder": "Rechercher..."
5
6
  }
@@ -16,12 +16,16 @@ export declare class SavedChatsComponent implements OnInit, OnDestroy {
16
16
  key: string;
17
17
  value: SavedChat[];
18
18
  }[]>;
19
+ queryWebserviceForSearch?: string;
20
+ private searchQuery;
21
+ private searchText$;
19
22
  instanceManagerService: InstanceManagerService;
20
23
  notificationsService: NotificationsService;
21
24
  private readonly transloco;
22
25
  private readonly assistantUtils;
23
26
  ngOnInit(): void;
24
27
  ngOnDestroy(): void;
28
+ onSearch(event: Event): void;
25
29
  instantiateChatService(): void;
26
30
  onListSavedChat(): void;
27
31
  onLoad(savedChat: SavedChat): void;
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ChatMessage, SavedChat, SavedChatHistory, SavedChatResponse, DeleteSavedChatResponse } from '../types';
2
+ import { ChatMessage, DeleteSavedChatResponse, SavedChat, SavedChatHistory, SavedChatResponse } from '../types';
3
3
  import * as i0 from "@angular/core";
4
4
  export interface SavedChatsOperationConfig {
5
5
  getAppName: () => string;
@@ -16,7 +16,7 @@ export declare class SavedChatsService {
16
16
  constructor();
17
17
  init(config: SavedChatsOperationConfig): void;
18
18
  private ensureInitialized;
19
- listChats(): void;
19
+ listChats(): Promise<void>;
20
20
  getChatById(id: string): Observable<SavedChatHistory | undefined>;
21
21
  addChat(id: string, messages: ChatMessage[]): Observable<SavedChatResponse>;
22
22
  updateChat(id: string, name?: string, messages?: ChatMessage[]): Observable<SavedChatResponse>;
@@ -1,5 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ChatConfig, GllmModelDescription, GllmFunction } from '../types';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { ChatConfig, GllmFunction, GllmModelDescription, PluginVersion } from '../types';
3
4
  import * as i0 from "@angular/core";
4
5
  export interface AssistantMetadataOperationContext {
5
6
  getRestUrl: () => string;
@@ -9,10 +10,13 @@ export interface AssistantMetadataOperationContext {
9
10
  }
10
11
  export declare class AssistantMetadataService {
11
12
  private context;
13
+ http: HttpClient;
12
14
  init(context: AssistantMetadataOperationContext): void;
13
15
  private ensureInitialized;
14
16
  listModels(): Observable<GllmModelDescription[] | undefined>;
15
17
  listFunctions(): Observable<GllmFunction[] | undefined>;
18
+ getPluginVersion(): Observable<PluginVersion | undefined>;
19
+ getSinequaESVersion(): Observable<string | undefined>;
16
20
  static ɵfac: i0.ɵɵFactoryDeclaration<AssistantMetadataService, never>;
17
21
  static ɵprov: i0.ɵɵInjectableDeclaration<AssistantMetadataService>;
18
22
  }
@@ -1,4 +1,3 @@
1
- import { InjectionToken } from "@angular/core";
2
1
  import { LogLevel, HubConnection, MessageHeaders, HttpTransportType, ITransport } from '@microsoft/signalr';
3
2
  import * as i0 from "@angular/core";
4
3
  export interface ConnectionOptions {
@@ -8,16 +7,6 @@ export interface ConnectionOptions {
8
7
  skipNegotiation?: boolean;
9
8
  accessTokenFactory?: () => string | Promise<string>;
10
9
  }
11
- /** A token that is used to inject the transports allowed to use by hub connection.
12
- *
13
- * Expects a {@link HttpTransportType} value.
14
- */
15
- export declare const SIGNAL_R_TRANSPORTS: InjectionToken<HttpTransportType>;
16
- /** A token that is used to inject the log level for the hub connection.
17
- *
18
- * Expects a {@link LogLevel} value.
19
- */
20
- export declare const SIGNAL_R_LOG_LEVEL: InjectionToken<LogLevel>;
21
10
  /**
22
11
  * A service to connect the Sinequa server to the client via SignalR
23
12
  */
@@ -16,7 +16,9 @@ export declare class SmartRendererComponent {
16
16
  readonly processing: import("@angular/core").WritableSignal<string>;
17
17
  private lastSliceIndex;
18
18
  private localSliceIndex;
19
+ private readonly _markdownItPlugins;
19
20
  constructor();
21
+ private createMarkdownItInstance;
20
22
  messageUpdated(): void;
21
23
  static ɵfac: i0.ɵɵFactoryDeclaration<SmartRendererComponent, never>;
22
24
  static ɵcmp: i0.ɵɵComponentDeclaration<SmartRendererComponent, "SmartRenderer", never, { "message": { "alias": "message"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "userConsumptionTitle": "Max generation allowed: {{percentage}}% consumed. Resets at {{time}}.",
3
- "chatConsumptionTitle": "Max length of conversation:{ {percentage}}% reached."
3
+ "chatConsumptionTitle": "Max length of conversation: {{percentage}}% reached."
4
4
  }
@@ -1,4 +1,5 @@
1
1
  import { Article } from "@sinequa/atomic";
2
+ import { DocumentPart } from "../types";
2
3
  /** Type of a context image reference */
3
4
  export type MessageImageReference = {
4
5
  name?: string;
@@ -8,4 +9,6 @@ export type MessageImageReference = {
8
9
  mimeType?: string;
9
10
  article?: Article;
10
11
  articleId?: string;
12
+ $partId?: number;
13
+ parts?: DocumentPart[];
11
14
  };