@memberjunction/ng-conversations 5.36.0 → 5.38.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 (79) hide show
  1. package/README.md +2 -2
  2. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +47 -0
  3. package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -0
  4. package/dist/lib/components/conversation/conversation-agent-picker.component.js +253 -0
  5. package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -0
  6. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +201 -4
  7. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  8. package/dist/lib/components/conversation/conversation-chat-area.component.js +776 -263
  9. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  10. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +2 -1
  11. package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
  12. package/dist/lib/components/conversation/conversation-empty-state.component.js +6 -3
  13. package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
  14. package/dist/lib/components/conversation/conversation-mode-picker.component.d.ts +57 -0
  15. package/dist/lib/components/conversation/conversation-mode-picker.component.d.ts.map +1 -0
  16. package/dist/lib/components/conversation/conversation-mode-picker.component.js +252 -0
  17. package/dist/lib/components/conversation/conversation-mode-picker.component.js.map +1 -0
  18. package/dist/lib/components/dialogs/rating-dialog.component.d.ts +31 -0
  19. package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -0
  20. package/dist/lib/components/dialogs/rating-dialog.component.js +290 -0
  21. package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -0
  22. package/dist/lib/components/mention/mention-editor.component.d.ts +1 -1
  23. package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
  24. package/dist/lib/components/mention/mention-editor.component.js +1 -0
  25. package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
  26. package/dist/lib/components/message/conversation-message-rating.component.d.ts +43 -18
  27. package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
  28. package/dist/lib/components/message/conversation-message-rating.component.js +235 -193
  29. package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
  30. package/dist/lib/components/message/message-input-box.component.d.ts +1 -1
  31. package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
  32. package/dist/lib/components/message/message-input-box.component.js +1 -1
  33. package/dist/lib/components/message/message-input-box.component.js.map +1 -1
  34. package/dist/lib/components/message/message-input.component.d.ts +58 -4
  35. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  36. package/dist/lib/components/message/message-input.component.js +135 -21
  37. package/dist/lib/components/message/message-input.component.js.map +1 -1
  38. package/dist/lib/components/message/message-item.component.d.ts +0 -13
  39. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  40. package/dist/lib/components/message/message-item.component.js +126 -152
  41. package/dist/lib/components/message/message-item.component.js.map +1 -1
  42. package/dist/lib/components/overlay/chat-overlay.component.d.ts +88 -5
  43. package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
  44. package/dist/lib/components/overlay/chat-overlay.component.js +296 -54
  45. package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
  46. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +11 -0
  47. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  48. package/dist/lib/components/workspace/conversation-workspace.component.js +13 -3
  49. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  50. package/dist/lib/conversations.module.d.ts +59 -57
  51. package/dist/lib/conversations.module.d.ts.map +1 -1
  52. package/dist/lib/conversations.module.js +12 -4
  53. package/dist/lib/conversations.module.js.map +1 -1
  54. package/dist/lib/models/conversation-state.model.d.ts +0 -27
  55. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  56. package/dist/lib/models/conversation-state.model.js.map +1 -1
  57. package/dist/lib/services/conversation-agent.service.d.ts +1 -9
  58. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  59. package/dist/lib/services/conversation-agent.service.js +22 -121
  60. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  61. package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
  62. package/dist/lib/services/conversation-attachment.service.js +5 -26
  63. package/dist/lib/services/conversation-attachment.service.js.map +1 -1
  64. package/dist/lib/services/conversation-bridge.service.d.ts +13 -0
  65. package/dist/lib/services/conversation-bridge.service.d.ts.map +1 -1
  66. package/dist/lib/services/conversation-bridge.service.js +15 -0
  67. package/dist/lib/services/conversation-bridge.service.js.map +1 -1
  68. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  69. package/dist/lib/services/data-cache.service.js +0 -1
  70. package/dist/lib/services/data-cache.service.js.map +1 -1
  71. package/dist/lib/services/dialog.service.d.ts +24 -0
  72. package/dist/lib/services/dialog.service.d.ts.map +1 -1
  73. package/dist/lib/services/dialog.service.js +45 -0
  74. package/dist/lib/services/dialog.service.js.map +1 -1
  75. package/package.json +23 -22
  76. package/dist/lib/components/message/suggested-responses.component.d.ts +0 -55
  77. package/dist/lib/components/message/suggested-responses.component.d.ts.map +0 -1
  78. package/dist/lib/components/message/suggested-responses.component.js +0 -207
  79. package/dist/lib/components/message/suggested-responses.component.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;;;;;ICwB1E,AADF,8BAA4B,gBAMvB;IAFD,4KAAS,uBAAgB,wBAAE,wBAAwB,KAAC;IAGpD,uBAAqC;IACvC,iBAAS;IAqBT,iCAKG;IAFD,4KAAS,2BAAoB,wBAAE,wBAAwB,KAAC;IAGxD,wBAAgC;IAEpC,AADE,iBAAS,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G;IACH,qBAAqB,CAAC,QAGrB;QACC,IAAI,CAAC,aAAa,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;kHApLU,wBAAwB;6DAAxB,wBAAwB;;;;;;;YC1BrC,8BAA4E;YAAnC,8IAAS,4BAAwB,KAAC;YAEvE,AADF,8BAA2B,8BAiB2B;YANlD,+PAAmB;YAMnB,AADA,AADA,AADA,AADA,AADA,wKAAe,yBAAqB,KAAC,6JACrB,0BAAsB,KAAC,mKACpB,6BAAyB,KAAC,yKACvB,gCAA4B,KAAC,mKAChC,6BAAyB,KAAC,uKACxB,+BAA2B,KAAC;YACnD,iBAAoB;YAGpB,0FAAyB;YA0CzB,iCAKG;YAFD,2IAAS,iBAAa,KAAC;YAGvB,uBAAuC;YAG7C,AADE,AADE,iBAAS,EACL,EACF;;YArEA,eAA2B;YAO3B,AADA,AADA,AADA,AADA,AADA,AADA,AADA,6CAA2B,0BACN,gCACM,sCACM,4CACM,sCACN,sDACgB,4CACV;YACvC,yCAAmB;YAUrB,eAuCC;YAvCD,gDAuCC;YAKC,cAAqB;YAArB,uCAAqB;;;iFDxCd,wBAAwB;cANpC,SAAS;6BACI,KAAK,YACP,sBAAsB;;kBAK/B,SAAS;mBAAC,eAAe;;kBAEzB,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAtBI,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { UserInfo } from '@memberjunction/core';\nimport { MentionSuggestion } from '../../services/mention-autocomplete.service';\nimport { MentionEditorComponent, PendingAttachment } from '../mention/mention-editor.component';\n\n/**\n * Reusable message input box component (presentational)\n * Now uses MentionEditorComponent for rich @mention functionality with chips\n *\n * Handles:\n * - Text input with keyboard shortcuts via MentionEditorComponent\n * - @mention autocomplete with visual chips (contentEditable)\n * - Send button\n *\n * Does NOT handle:\n * - Saving messages to database\n * - Agent invocation\n * - Artifact creation\n * - Conversation management\n */\n@Component({\n standalone: false,\n selector: 'mj-message-input-box',\n templateUrl: './message-input-box.component.html',\n styleUrls: ['./message-input-box.component.css']\n})\nexport class MessageInputBoxComponent {\n @ViewChild('mentionEditor') mentionEditor?: MentionEditorComponent;\n\n @Input() placeholder: string = 'Type your message to start a new conversation...';\n @Input() disabled: boolean = false;\n @Input() value: string = '';\n @Input() showCharacterCount: boolean = false;\n @Input() enableMentions: boolean = true;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n\n @Output() textSubmitted = new EventEmitter<string>();\n @Output() valueChange = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n @Output() artifactPickerRequested = new EventEmitter<void>();\n\n get canSend(): boolean {\n const hasText = this.value.trim().length > 0;\n const hasAttachments = this.mentionEditor?.hasAttachments() || false;\n return !this.disabled && (hasText || hasAttachments);\n }\n\n /**\n * Handle value changes from MentionEditorComponent\n */\n onValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(this.value);\n }\n\n /**\n * Handle attachment changes from MentionEditorComponent\n */\n onAttachmentsChanged(attachments: PendingAttachment[]): void {\n this.attachmentsChanged.emit(attachments);\n }\n\n /**\n * Handle attachment errors from MentionEditorComponent\n */\n onAttachmentError(error: string): void {\n this.attachmentError.emit(error);\n }\n\n /**\n * Handle attachment click from MentionEditorComponent\n */\n onAttachmentClicked(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Handle Enter key from MentionEditorComponent\n * Extracts plain text with JSON-encoded mentions for message submission\n */\n onEnterPressed(_text: string): void {\n this.onSendClick();\n }\n\n /**\n * Handle mention selection from MentionEditorComponent\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n // MentionEditorComponent already inserts the mention chip\n // This is just for additional tracking/analytics if needed\n }\n\n /**\n * Send the message\n * Extracts plain text with JSON-encoded mentions for proper persistence\n */\n onSendClick(): void {\n if (this.canSend) {\n // Get plain text with JSON-encoded mentions (preserves configuration info)\n const textToSend = this.mentionEditor?.getPlainTextWithJsonMentions() || this.value.trim();\n this.textSubmitted.emit(textToSend);\n this.value = ''; // Clear input after sending\n\n // Clear the editor content\n if (this.mentionEditor) {\n this.mentionEditor.clear();\n }\n\n this.valueChange.emit(this.value);\n }\n }\n\n /**\n * Handle clicks on the container - focus the mention editor\n * Only moves cursor to end if clicking outside the contentEditable area\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // Don't handle clicks on the send button\n if (target.closest('.send-button-icon')) {\n return;\n }\n\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (!editor) return;\n\n // If clicking directly on the editor or its children, let the browser handle cursor placement\n if (target === editor || editor.contains(target)) {\n return;\n }\n\n // Only if clicking on the container (empty space), focus and move cursor to end\n editor.focus();\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /**\n * Public method to focus the input programmatically\n */\n focus(): void {\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (editor) {\n editor.focus();\n }\n }\n\n /**\n * Get mention chip data including configuration presets\n */\n getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.mentionEditor?.getMentionChipsData() || [];\n }\n\n /**\n * Get pending attachments from the editor\n */\n getPendingAttachments(): PendingAttachment[] {\n return this.mentionEditor?.getPendingAttachments() || [];\n }\n\n /**\n * Open file picker programmatically\n */\n openFilePicker(): void {\n this.mentionEditor?.openFilePicker();\n }\n\n /**\n * Open artifact picker - emits event for parent to handle.\n *\n * TODO (2026-04-15): no consumer currently handles `artifactPickerRequested`.\n * The prior handler was removed by commit 0a4612abf1 and the orphaned\n * template was cleaned up in 7a063fc12a. The template button is disabled\n * to signal the gap. See message-input-box.component.html for the TODO\n * describing the suggested picker implementation.\n */\n openArtifactPicker(): void {\n this.artifactPickerRequested.emit();\n }\n\n /**\n * Add an artifact as a pending attachment (called by parent after artifact selection)\n */\n AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): void {\n this.mentionEditor?.AddArtifactAttachment(artifact);\n }\n}\n","<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\">\n </mj-mention-editor>\n\n <!-- Attach Buttons - Positioned over editor -->\n @if (enableAttachments) {\n <div class=\"attach-buttons\">\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n <!--\n TODO: \"Attach artifact from library\" button is not yet wired.\n\n Current state (2026-04-15): emits `artifactPickerRequested` but no\n consumer handles the event (handler was removed by commit 0a4612abf1,\n orphaned template cleaned up in 7a063fc12a). Button is intentionally\n visible but disabled so it's obvious what's missing.\n\n To finish: build a picker modal (suggested approach: wrap the\n `<mj-tree-dropdown>` used in dashboard-viewer's artifact-config-panel)\n and on selection, attach the artifact version as a Direction='Input'\n MJConversationDetailArtifact junction on the outgoing message.\n The infrastructure for agents reading input artifacts is already in\n place via AgentRunner.gatherConversationArtifacts().\n\n See also: packages/Angular/Generic/artifacts/src/lib/services/analyze-artifact.service.ts\n which does the similar end-to-end flow for standalone Analyze — the\n attach-to-draft path is a strict subset (no artifact creation, no\n conversation creation, just the junction).\n -->\n <button\n class=\"attach-button-icon attach-artifact-button\"\n [disabled]=\"true\"\n (click)=\"openArtifactPicker(); $event.stopPropagation()\"\n title=\"Attach artifact from library — not yet wired (see message-input-box.component.html TODO)\"\n >\n <i class=\"fa-solid fa-cube\"></i>\n </button>\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"message-input-box.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input-box.component.ts","../../../../src/lib/components/message/message-input-box.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;;;;;ICwB1E,AADF,8BAA4B,gBAMvB;IAFD,4KAAS,uBAAgB,wBAAE,wBAAwB,KAAC;IAGpD,uBAAqC;IACvC,iBAAS;IAqBT,iCAKG;IAFD,4KAAS,2BAAoB,wBAAE,wBAAwB,KAAC;IAGxD,wBAAgC;IAEpC,AADE,iBAAS,EACL;;;IAlCF,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,CAAC,QAGrB;QACC,OAAO,IAAI,CAAC,aAAa,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;kHApLU,wBAAwB;6DAAxB,wBAAwB;;;;;;;YC1BrC,8BAA4E;YAAnC,8IAAS,4BAAwB,KAAC;YAEvE,AADF,8BAA2B,8BAiB2B;YANlD,+PAAmB;YAMnB,AADA,AADA,AADA,AADA,AADA,wKAAe,yBAAqB,KAAC,6JACrB,0BAAsB,KAAC,mKACpB,6BAAyB,KAAC,yKACvB,gCAA4B,KAAC,mKAChC,6BAAyB,KAAC,uKACxB,+BAA2B,KAAC;YACnD,iBAAoB;YAGpB,0FAAyB;YA0CzB,iCAKG;YAFD,2IAAS,iBAAa,KAAC;YAGvB,uBAAuC;YAG7C,AADE,AADE,iBAAS,EACL,EACF;;YArEA,eAA2B;YAO3B,AADA,AADA,AADA,AADA,AADA,AADA,AADA,6CAA2B,0BACN,gCACM,sCACM,4CACM,sCACN,sDACgB,4CACV;YACvC,yCAAmB;YAUrB,eAuCC;YAvCD,gDAuCC;YAKC,cAAqB;YAArB,uCAAqB;;;iFDxCd,wBAAwB;cANpC,SAAS;6BACI,KAAK,YACP,sBAAsB;;kBAK/B,SAAS;mBAAC,eAAe;;kBAEzB,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAtBI,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';\nimport { UserInfo } from '@memberjunction/core';\nimport { MentionSuggestion } from '../../services/mention-autocomplete.service';\nimport { MentionEditorComponent, PendingAttachment } from '../mention/mention-editor.component';\n\n/**\n * Reusable message input box component (presentational)\n * Now uses MentionEditorComponent for rich @mention functionality with chips\n *\n * Handles:\n * - Text input with keyboard shortcuts via MentionEditorComponent\n * - @mention autocomplete with visual chips (contentEditable)\n * - Send button\n *\n * Does NOT handle:\n * - Saving messages to database\n * - Agent invocation\n * - Artifact creation\n * - Conversation management\n */\n@Component({\n standalone: false,\n selector: 'mj-message-input-box',\n templateUrl: './message-input-box.component.html',\n styleUrls: ['./message-input-box.component.css']\n})\nexport class MessageInputBoxComponent {\n @ViewChild('mentionEditor') mentionEditor?: MentionEditorComponent;\n\n @Input() placeholder: string = 'Type your message to start a new conversation...';\n @Input() disabled: boolean = false;\n @Input() value: string = '';\n @Input() showCharacterCount: boolean = false;\n @Input() enableMentions: boolean = true;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n\n // Attachment settings\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n\n @Output() textSubmitted = new EventEmitter<string>();\n @Output() valueChange = new EventEmitter<string>();\n @Output() attachmentsChanged = new EventEmitter<PendingAttachment[]>();\n @Output() attachmentError = new EventEmitter<string>();\n @Output() attachmentClicked = new EventEmitter<PendingAttachment>();\n @Output() artifactPickerRequested = new EventEmitter<void>();\n\n get canSend(): boolean {\n const hasText = this.value.trim().length > 0;\n const hasAttachments = this.mentionEditor?.hasAttachments() || false;\n return !this.disabled && (hasText || hasAttachments);\n }\n\n /**\n * Handle value changes from MentionEditorComponent\n */\n onValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(this.value);\n }\n\n /**\n * Handle attachment changes from MentionEditorComponent\n */\n onAttachmentsChanged(attachments: PendingAttachment[]): void {\n this.attachmentsChanged.emit(attachments);\n }\n\n /**\n * Handle attachment errors from MentionEditorComponent\n */\n onAttachmentError(error: string): void {\n this.attachmentError.emit(error);\n }\n\n /**\n * Handle attachment click from MentionEditorComponent\n */\n onAttachmentClicked(attachment: PendingAttachment): void {\n this.attachmentClicked.emit(attachment);\n }\n\n /**\n * Handle Enter key from MentionEditorComponent\n * Extracts plain text with JSON-encoded mentions for message submission\n */\n onEnterPressed(_text: string): void {\n this.onSendClick();\n }\n\n /**\n * Handle mention selection from MentionEditorComponent\n */\n onMentionSelected(suggestion: MentionSuggestion): void {\n // MentionEditorComponent already inserts the mention chip\n // This is just for additional tracking/analytics if needed\n }\n\n /**\n * Send the message\n * Extracts plain text with JSON-encoded mentions for proper persistence\n */\n onSendClick(): void {\n if (this.canSend) {\n // Get plain text with JSON-encoded mentions (preserves configuration info)\n const textToSend = this.mentionEditor?.getPlainTextWithJsonMentions() || this.value.trim();\n this.textSubmitted.emit(textToSend);\n this.value = ''; // Clear input after sending\n\n // Clear the editor content\n if (this.mentionEditor) {\n this.mentionEditor.clear();\n }\n\n this.valueChange.emit(this.value);\n }\n }\n\n /**\n * Handle clicks on the container - focus the mention editor\n * Only moves cursor to end if clicking outside the contentEditable area\n */\n onContainerClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // Don't handle clicks on the send button\n if (target.closest('.send-button-icon')) {\n return;\n }\n\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (!editor) return;\n\n // If clicking directly on the editor or its children, let the browser handle cursor placement\n if (target === editor || editor.contains(target)) {\n return;\n }\n\n // Only if clicking on the container (empty space), focus and move cursor to end\n editor.focus();\n const selection = window.getSelection();\n const range = document.createRange();\n\n if (selection) {\n range.selectNodeContents(editor);\n range.collapse(false); // Collapse to end\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n\n /**\n * Public method to focus the input programmatically\n */\n focus(): void {\n const editor = this.mentionEditor?.editorRef?.nativeElement;\n if (editor) {\n editor.focus();\n }\n }\n\n /**\n * Get mention chip data including configuration presets\n */\n getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.mentionEditor?.getMentionChipsData() || [];\n }\n\n /**\n * Get pending attachments from the editor\n */\n getPendingAttachments(): PendingAttachment[] {\n return this.mentionEditor?.getPendingAttachments() || [];\n }\n\n /**\n * Open file picker programmatically\n */\n openFilePicker(): void {\n this.mentionEditor?.openFilePicker();\n }\n\n /**\n * Open artifact picker - emits event for parent to handle.\n *\n * TODO (2026-04-15): no consumer currently handles `artifactPickerRequested`.\n * The prior handler was removed by commit 0a4612abf1 and the orphaned\n * template was cleaned up in 7a063fc12a. The template button is disabled\n * to signal the gap. See message-input-box.component.html for the TODO\n * describing the suggested picker implementation.\n */\n openArtifactPicker(): void {\n this.artifactPickerRequested.emit();\n }\n\n /**\n * Add an artifact as a pending attachment (called by parent after artifact selection)\n */\n AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.mentionEditor?.AddArtifactAttachment(artifact);\n }\n}\n","<div class=\"message-input-box-container\" (click)=\"onContainerClick($event)\">\n <div class=\"input-wrapper\">\n <mj-mention-editor\n #mentionEditor\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [currentUser]=\"currentUser\"\n [enableMentions]=\"enableMentions\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [(ngModel)]=\"value\"\n (valueChange)=\"onValueChange($event)\"\n (enterPressed)=\"onEnterPressed($event)\"\n (mentionSelected)=\"onMentionSelected($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (attachmentClicked)=\"onAttachmentClicked($event)\">\n </mj-mention-editor>\n\n <!-- Attach Buttons - Positioned over editor -->\n @if (enableAttachments) {\n <div class=\"attach-buttons\">\n <button\n class=\"attach-button-icon\"\n [disabled]=\"disabled\"\n (click)=\"openFilePicker(); $event.stopPropagation()\"\n title=\"Attach file\"\n >\n <i class=\"fa-solid fa-paperclip\"></i>\n </button>\n <!--\n TODO: \"Attach artifact from library\" button is not yet wired.\n\n Current state (2026-04-15): emits `artifactPickerRequested` but no\n consumer handles the event (handler was removed by commit 0a4612abf1,\n orphaned template cleaned up in 7a063fc12a). Button is intentionally\n visible but disabled so it's obvious what's missing.\n\n To finish: build a picker modal (suggested approach: wrap the\n `<mj-tree-dropdown>` used in dashboard-viewer's artifact-config-panel)\n and on selection, attach the artifact version as a Direction='Input'\n MJConversationDetailArtifact junction on the outgoing message.\n The infrastructure for agents reading input artifacts is already in\n place via AgentRunner.gatherConversationArtifacts().\n\n See also: packages/Angular/Generic/artifacts/src/lib/services/analyze-artifact.service.ts\n which does the similar end-to-end flow for standalone Analyze — the\n attach-to-draft path is a strict subset (no artifact creation, no\n conversation creation, just the junction).\n -->\n <button\n class=\"attach-button-icon attach-artifact-button\"\n [disabled]=\"true\"\n (click)=\"openArtifactPicker(); $event.stopPropagation()\"\n title=\"Attach artifact from library — not yet wired (see message-input-box.component.html TODO)\"\n >\n <i class=\"fa-solid fa-cube\"></i>\n </button>\n </div>\n }\n\n <!-- Send Button (Icon Only) - Positioned over editor -->\n <button\n class=\"send-button-icon\"\n [disabled]=\"!canSend\"\n (click)=\"onSendClick()\"\n title=\"Send message (Enter)\"\n >\n <i class=\"fa-solid fa-paper-plane\"></i>\n </button>\n </div>\n</div>\n"]}
@@ -37,6 +37,7 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
37
37
  placeholder: string;
38
38
  parentMessageId?: string;
39
39
  enableAttachments: boolean;
40
+ enableMentions: boolean;
40
41
  maxAttachments: number;
41
42
  maxAttachmentSizeBytes: number;
42
43
  acceptedFileTypes: string;
@@ -45,6 +46,52 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
45
46
  agentRunsByDetailId?: Map<string, MJAIAgentRunEntityExtended>;
46
47
  emptyStateMode: boolean;
47
48
  appContext: Record<string, unknown> | null;
49
+ /**
50
+ * Optional default agent ID for the conversation. When set, the FIRST
51
+ * message routes directly to this agent — skipping Sage's default
52
+ * delegation — provided the user did not @mention a different agent
53
+ * and there is no prior agent in the conversation history. After the
54
+ * first message, the existing "last non-Sage agent" continuity rule
55
+ * keeps subsequent messages on the same agent.
56
+ *
57
+ * Used by embedded chat surfaces (Form Builder cockpit, future
58
+ * domain-specific chats) that have an obvious specialist agent for the
59
+ * context and don't need Sage to route. Leave unset to preserve the
60
+ * standard Sage-fronted UX of the main Chat app.
61
+ */
62
+ defaultAgentId: string | null;
63
+ /**
64
+ * Per-conversation pinned default agent — sourced from the loaded
65
+ * `MJConversationEntity.DefaultAgentID`. When set, this agent is used in
66
+ * preference to the embedder-supplied {@link defaultAgentId} so a user
67
+ * who pins a conversation to e.g. Research Agent gets that routing even
68
+ * inside an embedded surface whose embedder defaults to a different
69
+ * specialist. Routing precedence:
70
+ * 1. @mention
71
+ * 2. continuity (last responder)
72
+ * 3. **conversationDefaultAgentId** (this input — user's per-conversation pin)
73
+ * 4. defaultAgentId (embedder-supplied)
74
+ * 5. Sage fallback
75
+ */
76
+ conversationDefaultAgentId: string | null;
77
+ /**
78
+ * The `MJ: AI Agent Configurations.ID` selected via the chat header's
79
+ * mode picker (Draft / Standard / High). Applied to **non-mention**
80
+ * routes — when the user types without `@mention`, this preset rides
81
+ * along on the next `invokeSubAgent` call so the server resolves the
82
+ * agent's Fast / Standard / High Power AI configuration accordingly.
83
+ *
84
+ * Mentioned-route turns still use the preset embedded in the mention
85
+ * (e.g. `@Form Builder /high`) because that's a per-message intent
86
+ * the user just expressed. Continuity-route turns (last responder
87
+ * agent) also honor this input as the fallback when the prior
88
+ * message itself doesn't carry an explicit configuration preset.
89
+ *
90
+ * Picker writes are forward-only: changing the mode does NOT re-route
91
+ * messages already in flight or already in history. Affects "what
92
+ * happens next."
93
+ */
94
+ agentConfigurationPresetId: string | null;
48
95
  private _initialMessage;
49
96
  private _initialAttachments;
50
97
  private _isComponentReady;
@@ -166,8 +213,14 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
166
213
  * Send a message with custom text WITHOUT modifying the visible messageText input
167
214
  * Used for suggested responses and initial messages from empty state.
168
215
  * Also saves any pending attachments.
216
+ *
217
+ * `extraAttachments` is an escape hatch for callers that programmatically
218
+ * attached something via `AddArtifactAttachment` and want to send in the same
219
+ * tick — the `attachmentsChanged` event chain hasn't propagated yet, so
220
+ * `this.pendingAttachments` may not contain the attachment. Pass it in
221
+ * explicitly and we merge + dedupe (by `id`) before saving.
169
222
  */
170
- sendMessageWithText(text: string): Promise<void>;
223
+ sendMessageWithText(text: string, extraAttachments?: PendingAttachment[]): Promise<void>;
171
224
  /**
172
225
  * Creates and configures a new conversation detail message
173
226
  */
@@ -185,8 +238,9 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
185
238
  */
186
239
  private parseMentionsFromMessage;
187
240
  /**
188
- * Routes the message to the appropriate agent or Sage based on context
189
- * Priority: @mention > intent check > Sage
241
+ * Routes the message to the appropriate agent or Sage based on context.
242
+ * Priority: explicit @mention > prior-agent continuity > embedder-supplied
243
+ * default agent > Sage fallback.
190
244
  */
191
245
  private routeMessage;
192
246
  /**
@@ -326,6 +380,6 @@ export declare class MessageInputComponent extends BaseAngularComponent implemen
326
380
  */
327
381
  private cleanupCompletionTimestamp;
328
382
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
329
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "mj-message-input", never, { "conversationId": { "alias": "conversationId"; "required": false; }; "conversationName": { "alias": "conversationName"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "parentMessageId": { "alias": "parentMessageId"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "artifactsByDetailId": { "alias": "artifactsByDetailId"; "required": false; }; "systemArtifactsByDetailId": { "alias": "systemArtifactsByDetailId"; "required": false; }; "agentRunsByDetailId": { "alias": "agentRunsByDetailId"; "required": false; }; "emptyStateMode": { "alias": "emptyStateMode"; "required": false; }; "appContext": { "alias": "appContext"; "required": false; }; "initialMessage": { "alias": "initialMessage"; "required": false; }; "initialAttachments": { "alias": "initialAttachments"; "required": false; }; "conversationHistory": { "alias": "conversationHistory"; "required": false; }; "inProgressMessageIds": { "alias": "inProgressMessageIds"; "required": false; }; }, { "messageSent": "messageSent"; "agentResponse": "agentResponse"; "agentRunDetected": "agentRunDetected"; "agentRunUpdate": "agentRunUpdate"; "messageComplete": "messageComplete"; "artifactCreated": "artifactCreated"; "conversationRenamed": "conversationRenamed"; "intentCheckStarted": "intentCheckStarted"; "intentCheckCompleted": "intentCheckCompleted"; "emptyStateSubmit": "emptyStateSubmit"; "uploadStateChanged": "uploadStateChanged"; "artifactPickerRequested": "artifactPickerRequested"; }, never, never, false, never>;
383
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "mj-message-input", never, { "conversationId": { "alias": "conversationId"; "required": false; }; "conversationName": { "alias": "conversationName"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "parentMessageId": { "alias": "parentMessageId"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "artifactsByDetailId": { "alias": "artifactsByDetailId"; "required": false; }; "systemArtifactsByDetailId": { "alias": "systemArtifactsByDetailId"; "required": false; }; "agentRunsByDetailId": { "alias": "agentRunsByDetailId"; "required": false; }; "emptyStateMode": { "alias": "emptyStateMode"; "required": false; }; "appContext": { "alias": "appContext"; "required": false; }; "defaultAgentId": { "alias": "defaultAgentId"; "required": false; }; "conversationDefaultAgentId": { "alias": "conversationDefaultAgentId"; "required": false; }; "agentConfigurationPresetId": { "alias": "agentConfigurationPresetId"; "required": false; }; "initialMessage": { "alias": "initialMessage"; "required": false; }; "initialAttachments": { "alias": "initialAttachments"; "required": false; }; "conversationHistory": { "alias": "conversationHistory"; "required": false; }; "inProgressMessageIds": { "alias": "inProgressMessageIds"; "required": false; }; }, { "messageSent": "messageSent"; "agentResponse": "agentResponse"; "agentRunDetected": "agentRunDetected"; "agentRunUpdate": "agentRunUpdate"; "messageComplete": "messageComplete"; "artifactCreated": "artifactCreated"; "conversationRenamed": "conversationRenamed"; "intentCheckStarted": "intentCheckStarted"; "intentCheckCompleted": "intentCheckCompleted"; "emptyStateSubmit": "emptyStateSubmit"; "uploadStateChanged": "uploadStateChanged"; "artifactPickerRequested": "artifactPickerRequested"; }, never, never, false, never>;
330
384
  }
331
385
  //# sourceMappingURL=message-input.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAmD,MAAM,+BAA+B,CAAC;AAC5H,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EA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AAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8D5L;;;;;OAKG;YACW,2BAA2B;IAmDzC;;;OAGG;YACW,yBAAyB;IA+FvC;;;OAGG;YACW,wBAAwB;IA2JtC;;;OAGG;YACW,uBAAuB;IAwJrC;;;OAGG;YACW,mBAAmB;IAgIjC;;;;;OAKG;YACW,iBAAiB;IAmI/B;;;;;;;;;;;OAWG;YACW,wBAAwB;IAsGtC;;;;;OAKG;YACW,gBAAgB;IAmF9B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA8C3B;;OAEG;IACH,OAAO,CAAC,0BAA0B;yCArzEvB,qBAAqB;2CAArB,qBAAqB;CA2zEjC"}
1
+ {"version":3,"file":"message-input.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/message-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9I,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAmD,MAAM,+BAA+B,CAAC;AAC5H,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAkD,MAAM,+CAA+C,CAAC;AAG7I,OAAO,EAAE,kBAAkB,EAA+G,MAAM,8BAA8B,CAAC;AAC/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,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,UAAU,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8D5L;;;;;OAKG;YACW,2BAA2B;IAmDzC;;;OAGG;YACW,yBAAyB;IAiGvC;;;OAGG;YACW,wBAAwB;IA6JtC;;;OAGG;YACW,uBAAuB;IA0JrC;;;OAGG;YACW,mBAAmB;IAiIjC;;;;;OAKG;YACW,iBAAiB;IA6I/B;;;;;;;;;;;OAWG;YACW,wBAAwB;IA2GtC;;;;;OAKG;YACW,gBAAgB;IAmF9B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA8C3B;;OAEG;IACH,OAAO,CAAC,0BAA0B;yCAh7EvB,qBAAqB;2CAArB,qBAAqB;CAs7EjC"}
@@ -50,6 +50,7 @@ export class MessageInputComponent extends BaseAngularComponent {
50
50
  placeholder = 'Type a message... (Ctrl+Enter to send)';
51
51
  parentMessageId; // Optional: for replying in threads
52
52
  enableAttachments = true; // Whether to show attachment button (based on agent modality support)
53
+ enableMentions = true; // Whether to enable @-mention autocomplete (agents/users). Hosts addressing a single fixed agent (e.g. Form Builder cockpit) typically set false.
53
54
  maxAttachments = 10; // Maximum number of attachments per message
54
55
  maxAttachmentSizeBytes = 20 * 1024 * 1024; // Maximum size per attachment (20MB default)
55
56
  acceptedFileTypes = 'image/*'; // Accepted MIME types pattern
@@ -58,6 +59,52 @@ export class MessageInputComponent extends BaseAngularComponent {
58
59
  agentRunsByDetailId; // Pre-loaded agent run data for performance
59
60
  emptyStateMode = false; // When true, emits emptyStateSubmit instead of creating messages directly
60
61
  appContext = null; // Application context for AI agent awareness
62
+ /**
63
+ * Optional default agent ID for the conversation. When set, the FIRST
64
+ * message routes directly to this agent — skipping Sage's default
65
+ * delegation — provided the user did not @mention a different agent
66
+ * and there is no prior agent in the conversation history. After the
67
+ * first message, the existing "last non-Sage agent" continuity rule
68
+ * keeps subsequent messages on the same agent.
69
+ *
70
+ * Used by embedded chat surfaces (Form Builder cockpit, future
71
+ * domain-specific chats) that have an obvious specialist agent for the
72
+ * context and don't need Sage to route. Leave unset to preserve the
73
+ * standard Sage-fronted UX of the main Chat app.
74
+ */
75
+ defaultAgentId = null;
76
+ /**
77
+ * Per-conversation pinned default agent — sourced from the loaded
78
+ * `MJConversationEntity.DefaultAgentID`. When set, this agent is used in
79
+ * preference to the embedder-supplied {@link defaultAgentId} so a user
80
+ * who pins a conversation to e.g. Research Agent gets that routing even
81
+ * inside an embedded surface whose embedder defaults to a different
82
+ * specialist. Routing precedence:
83
+ * 1. @mention
84
+ * 2. continuity (last responder)
85
+ * 3. **conversationDefaultAgentId** (this input — user's per-conversation pin)
86
+ * 4. defaultAgentId (embedder-supplied)
87
+ * 5. Sage fallback
88
+ */
89
+ conversationDefaultAgentId = null;
90
+ /**
91
+ * The `MJ: AI Agent Configurations.ID` selected via the chat header's
92
+ * mode picker (Draft / Standard / High). Applied to **non-mention**
93
+ * routes — when the user types without `@mention`, this preset rides
94
+ * along on the next `invokeSubAgent` call so the server resolves the
95
+ * agent's Fast / Standard / High Power AI configuration accordingly.
96
+ *
97
+ * Mentioned-route turns still use the preset embedded in the mention
98
+ * (e.g. `@Form Builder /high`) because that's a per-message intent
99
+ * the user just expressed. Continuity-route turns (last responder
100
+ * agent) also honor this input as the fallback when the prior
101
+ * message itself doesn't carry an explicit configuration preset.
102
+ *
103
+ * Picker writes are forward-only: changing the mode does NOT re-route
104
+ * messages already in flight or already in history. Affects "what
105
+ * happens next."
106
+ */
107
+ agentConfigurationPresetId = null;
61
108
  // Initial message to send automatically - using getter/setter for precise control
62
109
  _initialMessage = null;
63
110
  _initialAttachments = null;
@@ -417,10 +464,30 @@ export class MessageInputComponent extends BaseAngularComponent {
417
464
  * Send a message with custom text WITHOUT modifying the visible messageText input
418
465
  * Used for suggested responses and initial messages from empty state.
419
466
  * Also saves any pending attachments.
467
+ *
468
+ * `extraAttachments` is an escape hatch for callers that programmatically
469
+ * attached something via `AddArtifactAttachment` and want to send in the same
470
+ * tick — the `attachmentsChanged` event chain hasn't propagated yet, so
471
+ * `this.pendingAttachments` may not contain the attachment. Pass it in
472
+ * explicitly and we merge + dedupe (by `id`) before saving.
420
473
  */
421
- async sendMessageWithText(text) {
474
+ async sendMessageWithText(text, extraAttachments) {
475
+ const merged = (() => {
476
+ if (!extraAttachments || extraAttachments.length === 0) {
477
+ return [...this.pendingAttachments];
478
+ }
479
+ const seen = new Set();
480
+ const out = [];
481
+ for (const a of [...this.pendingAttachments, ...extraAttachments]) {
482
+ if (seen.has(a.id))
483
+ continue;
484
+ seen.add(a.id);
485
+ out.push(a);
486
+ }
487
+ return out;
488
+ })();
422
489
  const hasText = text && text.trim().length > 0;
423
- const hasAttachments = this.pendingAttachments.length > 0;
490
+ const hasAttachments = merged.length > 0;
424
491
  if (!hasText && !hasAttachments) {
425
492
  return;
426
493
  }
@@ -428,7 +495,7 @@ export class MessageInputComponent extends BaseAngularComponent {
428
495
  return;
429
496
  }
430
497
  this.isSending = true;
431
- const attachmentsToSave = [...this.pendingAttachments];
498
+ const attachmentsToSave = merged;
432
499
  try {
433
500
  const detail = await this.dataCache.createConversationDetail(this.currentUser);
434
501
  detail.ConversationID = this.conversationId;
@@ -477,6 +544,11 @@ export class MessageInputComponent extends BaseAngularComponent {
477
544
  }
478
545
  // Clear pending attachments after successful send
479
546
  this.pendingAttachments = [];
547
+ // Also clear the mention editor's content + its own attachments list.
548
+ // The user-initiated send path (MessageInputBoxComponent.onSendClick)
549
+ // calls mentionEditor.clear() — we bypass that path here, so the chips
550
+ // would otherwise stay on screen after the message goes out.
551
+ this.inputBox?.mentionEditor?.clear();
480
552
  this.messageSent.emit(detail);
481
553
  const mentionResult = this.parseMentionsFromMessage(detail.Message);
482
554
  const isFirstMessage = this.conversationHistory.length === 0;
@@ -540,8 +612,9 @@ export class MessageInputComponent extends BaseAngularComponent {
540
612
  return mentionResult;
541
613
  }
542
614
  /**
543
- * Routes the message to the appropriate agent or Sage based on context
544
- * Priority: @mention > intent check > Sage
615
+ * Routes the message to the appropriate agent or Sage based on context.
616
+ * Priority: explicit @mention > prior-agent continuity > embedder-supplied
617
+ * default agent > Sage fallback.
545
618
  */
546
619
  async routeMessage(messageDetail, mentionResult, isFirstMessage) {
547
620
  // Priority 1: Direct @mention
@@ -555,7 +628,25 @@ export class MessageInputComponent extends BaseAngularComponent {
555
628
  await this.handleAgentContinuity(messageDetail, lastAgentId, mentionResult, isFirstMessage);
556
629
  return;
557
630
  }
558
- // Priority 3: Check if Sage was explicitly @mentioned with a config preset
631
+ // Priority 3: User's per-conversation pinned default agent sourced
632
+ // from MJConversationEntity.DefaultAgentID. Wins over the embedder's
633
+ // default because it represents an explicit user choice on this
634
+ // conversation (e.g. "always route to Research Agent for this thread").
635
+ if (this.conversationDefaultAgentId) {
636
+ await this.handleAgentContinuity(messageDetail, this.conversationDefaultAgentId, mentionResult, isFirstMessage);
637
+ return;
638
+ }
639
+ // Priority 4: Embedder-supplied default agent. Set by chat surfaces
640
+ // that have a specialist agent for the context (e.g. Form Builder
641
+ // cockpit). Only kicks in when nothing more explicit is present —
642
+ // @mention always wins, conversation continuity always wins. The
643
+ // intent is to skip Sage's default delegation when the embedder
644
+ // already knows what agent owns this conversation.
645
+ if (this.defaultAgentId) {
646
+ await this.handleAgentContinuity(messageDetail, this.defaultAgentId, mentionResult, isFirstMessage);
647
+ return;
648
+ }
649
+ // Priority 5: Check if Sage was explicitly @mentioned with a config preset
559
650
  // If so, treat it like agent continuity so the config preset is preserved
560
651
  if (this.converationManagerAgent?.ID) {
561
652
  const sageConfigPreset = this.agentService.findConfigurationPresetFromHistory(this.converationManagerAgent.ID, this.conversationHistory);
@@ -569,7 +660,7 @@ export class MessageInputComponent extends BaseAngularComponent {
569
660
  return;
570
661
  }
571
662
  }
572
- // Priority 4: No context - use Sage with default config
663
+ // Priority 6: No context - use Sage with default config
573
664
  await this.handleNoAgentContext(messageDetail, mentionResult, isFirstMessage);
574
665
  }
575
666
  /**
@@ -1229,7 +1320,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1229
1320
  : task.inputPayload;
1230
1321
  // Invoke agent with merged payload
1231
1322
  const agentResult = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, task.description || task.name, agentResponseMessage.ID, mergedPayload, // Pass merged payload for continuity
1232
- this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId);
1323
+ this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId, undefined, // configurationPresetId not used in this path
1324
+ this.appContext);
1233
1325
  // Task will be removed automatically in markMessageComplete() when status changes to Complete/Error
1234
1326
  // DO NOT remove here - allows UI to show task during entire execution
1235
1327
  if (agentResult && agentResult.success) {
@@ -1308,8 +1400,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1308
1400
  : undefined;
1309
1401
  // Invoke the sub-agent with progress callback
1310
1402
  const subResult = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, reasoning, agentResponseMessage.ID, previousPayload, // Pass previous payload for continuity
1311
- this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId, configurationPresetId // Pass configuration from previous @mention for continuity
1312
- );
1403
+ this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId, configurationPresetId, // Pass configuration from previous @mention for continuity
1404
+ this.appContext);
1313
1405
  // Task will be removed automatically in markMessageComplete() when status changes to Complete/Error
1314
1406
  // DO NOT remove here - allows UI to show task during entire execution
1315
1407
  if (subResult && subResult.success) {
@@ -1341,8 +1433,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1341
1433
  await this.updateConversationDetail(agentResponseMessage, "Retrying...", agentResponseMessage.Status);
1342
1434
  // Retry the sub-agent (reuse previously loaded payload and config from first attempt)
1343
1435
  const retryResult = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, reasoning, agentResponseMessage.ID, previousPayload, // Pass same payload as first attempt
1344
- this.createProgressCallback(agentResponseMessage, `${agentName} (retry)`), artifactInfo?.artifactId, artifactInfo?.versionId, configurationPresetId // Pass same config as first attempt
1345
- );
1436
+ this.createProgressCallback(agentResponseMessage, `${agentName} (retry)`), artifactInfo?.artifactId, artifactInfo?.versionId, configurationPresetId, // Pass same config as first attempt
1437
+ this.appContext);
1346
1438
  if (retryResult && retryResult.success) {
1347
1439
  // Retry succeeded - update the same message
1348
1440
  if (retryResult.agentRun.AgentID) {
@@ -1450,7 +1542,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1450
1542
  });
1451
1543
  try {
1452
1544
  // Invoke the agent with the previous payload
1453
- const continuityResult = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, 'Continuing previous work based on user feedback', statusMessage.ID, previousPayload, this.createProgressCallback(statusMessage, agentName), previousArtifactInfo?.artifactId, previousArtifactInfo?.versionId);
1545
+ const continuityResult = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, 'Continuing previous work based on user feedback', statusMessage.ID, previousPayload, this.createProgressCallback(statusMessage, agentName), previousArtifactInfo?.artifactId, previousArtifactInfo?.versionId, undefined, // configurationPresetId not used in this path
1546
+ this.appContext);
1454
1547
  // Remove from active tasks
1455
1548
  // Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
1456
1549
  if (continuityResult && continuityResult.success) {
@@ -1541,8 +1634,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1541
1634
  : { payload: null, artifactInfo: null };
1542
1635
  // Invoke the agent directly
1543
1636
  const result = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, `User mentioned agent directly with @${agentName}`, agentResponseMessage.ID, previousPayload, // Pass previous payload for continuity
1544
- this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId, agentMention.configurationId // Pass configuration preset ID
1545
- );
1637
+ this.createProgressCallback(agentResponseMessage, agentName), artifactInfo?.artifactId, artifactInfo?.versionId, agentMention.configurationId, // Pass configuration preset ID
1638
+ this.appContext);
1546
1639
  // Remove from active tasks
1547
1640
  // Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
1548
1641
  if (result && result.success) {
@@ -1672,6 +1765,15 @@ export class MessageInputComponent extends BaseAngularComponent {
1672
1765
  // Extract configuration preset from the User message that @mentioned this agent
1673
1766
  // Uses the shared helper method in the agent service
1674
1767
  previousConfigurationId = this.agentService.findConfigurationPresetFromHistory(agentId, this.conversationHistory);
1768
+ // Fall back to the chat header's mode-picker selection when nothing
1769
+ // in the message history pinned a preset. The picker reflects the
1770
+ // user's persistent per-agent mode preference (Draft / Standard /
1771
+ // High) and applies to all subsequent non-mention routes. A
1772
+ // history-derived preset still wins because it represents an
1773
+ // explicit per-message intent the user expressed earlier.
1774
+ if (!previousConfigurationId && this.agentConfigurationPresetId) {
1775
+ previousConfigurationId = this.agentConfigurationPresetId;
1776
+ }
1675
1777
  // Fall back to searching through all agent messages for an artifact
1676
1778
  // This ensures payload continuity even after clarifying exchanges without artifacts
1677
1779
  if (!previousPayload && agentMessages.length > 0) {
@@ -1753,10 +1855,14 @@ export class MessageInputComponent extends BaseAngularComponent {
1753
1855
  // Save the record to establish __mj_CreatedAt timestamp
1754
1856
  await agentResponseMessage.Save();
1755
1857
  this.messageSent.emit(agentResponseMessage);
1756
- // Invoke the agent directly (continuation) with previous payload if available
1858
+ // Invoke the agent directly (continuation) with previous payload if available.
1859
+ // `this.appContext` is forwarded so direct-routed sub-agents (e.g. Form
1860
+ // Builder via [defaultAgentId]) see the embedder's ActiveForm/Schema/
1861
+ // OverrideID block in their prompt — same flow Sage gets via
1862
+ // `processMessage`.
1757
1863
  const result = await this.agentService.invokeSubAgent(agentName, conversationId, userMessage, this.conversationHistory, 'Continuing previous conversation with user', agentResponseMessage.ID, previousPayload, // Pass previous OUTPUT artifact payload for continuity
1758
- this.createProgressCallback(agentResponseMessage, agentName), previousArtifactInfo?.artifactId, previousArtifactInfo?.versionId, configurationId // Pass configuration for continuity
1759
- );
1864
+ this.createProgressCallback(agentResponseMessage, agentName), previousArtifactInfo?.artifactId, previousArtifactInfo?.versionId, configurationId, // Pass configuration for continuity
1865
+ this.appContext);
1760
1866
  // Remove from active tasks
1761
1867
  // Task removed in markMessageComplete() - this.activeTasks.remove(taskId);
1762
1868
  if (result && result.success) {
@@ -1922,7 +2028,7 @@ export class MessageInputComponent extends BaseAngularComponent {
1922
2028
  } if (rf & 2) {
1923
2029
  let _t;
1924
2030
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputBox = _t.first);
1925
- } }, inputs: { conversationId: "conversationId", conversationName: "conversationName", currentUser: "currentUser", disabled: "disabled", placeholder: "placeholder", parentMessageId: "parentMessageId", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes", artifactsByDetailId: "artifactsByDetailId", systemArtifactsByDetailId: "systemArtifactsByDetailId", agentRunsByDetailId: "agentRunsByDetailId", emptyStateMode: "emptyStateMode", appContext: "appContext", initialMessage: "initialMessage", initialAttachments: "initialAttachments", conversationHistory: "conversationHistory", inProgressMessageIds: "inProgressMessageIds" }, outputs: { messageSent: "messageSent", agentResponse: "agentResponse", agentRunDetected: "agentRunDetected", agentRunUpdate: "agentRunUpdate", messageComplete: "messageComplete", artifactCreated: "artifactCreated", conversationRenamed: "conversationRenamed", intentCheckStarted: "intentCheckStarted", intentCheckCompleted: "intentCheckCompleted", emptyStateSubmit: "emptyStateSubmit", uploadStateChanged: "uploadStateChanged", artifactPickerRequested: "artifactPickerRequested" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 12, consts: [["inputBox", ""], [1, "message-input-wrapper"], [1, "processing-indicator"], [3, "valueChange", "textSubmitted", "attachmentsChanged", "attachmentError", "artifactPickerRequested", "placeholder", "disabled", "showCharacterCount", "enableMentions", "enableAttachments", "maxAttachments", "maxAttachmentSizeBytes", "acceptedFileTypes", "currentUser", "rows", "value"], [1, "fas", "fa-circle-notch", "fa-spin"]], template: function MessageInputComponent_Template(rf, ctx) { if (rf & 1) {
2031
+ } }, inputs: { conversationId: "conversationId", conversationName: "conversationName", currentUser: "currentUser", disabled: "disabled", placeholder: "placeholder", parentMessageId: "parentMessageId", enableAttachments: "enableAttachments", enableMentions: "enableMentions", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes", artifactsByDetailId: "artifactsByDetailId", systemArtifactsByDetailId: "systemArtifactsByDetailId", agentRunsByDetailId: "agentRunsByDetailId", emptyStateMode: "emptyStateMode", appContext: "appContext", defaultAgentId: "defaultAgentId", conversationDefaultAgentId: "conversationDefaultAgentId", agentConfigurationPresetId: "agentConfigurationPresetId", initialMessage: "initialMessage", initialAttachments: "initialAttachments", conversationHistory: "conversationHistory", inProgressMessageIds: "inProgressMessageIds" }, outputs: { messageSent: "messageSent", agentResponse: "agentResponse", agentRunDetected: "agentRunDetected", agentRunUpdate: "agentRunUpdate", messageComplete: "messageComplete", artifactCreated: "artifactCreated", conversationRenamed: "conversationRenamed", intentCheckStarted: "intentCheckStarted", intentCheckCompleted: "intentCheckCompleted", emptyStateSubmit: "emptyStateSubmit", uploadStateChanged: "uploadStateChanged", artifactPickerRequested: "artifactPickerRequested" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 12, consts: [["inputBox", ""], [1, "message-input-wrapper"], [1, "processing-indicator"], [3, "valueChange", "textSubmitted", "attachmentsChanged", "attachmentError", "artifactPickerRequested", "placeholder", "disabled", "showCharacterCount", "enableMentions", "enableAttachments", "maxAttachments", "maxAttachmentSizeBytes", "acceptedFileTypes", "currentUser", "rows", "value"], [1, "fas", "fa-circle-notch", "fa-spin"]], template: function MessageInputComponent_Template(rf, ctx) { if (rf & 1) {
1926
2032
  const _r1 = i0.ɵɵgetCurrentView();
1927
2033
  i0.ɵɵelementStart(0, "div", 1);
1928
2034
  i0.ɵɵconditionalCreate(1, MessageInputComponent_Conditional_1_Template, 4, 1, "div", 2);
@@ -1934,13 +2040,13 @@ export class MessageInputComponent extends BaseAngularComponent {
1934
2040
  i0.ɵɵadvance();
1935
2041
  i0.ɵɵconditional(ctx.isProcessing ? 1 : -1);
1936
2042
  i0.ɵɵadvance();
1937
- i0.ɵɵproperty("placeholder", ctx.placeholder)("disabled", ctx.disabled || ctx.isProcessing)("showCharacterCount", false)("enableMentions", true)("enableAttachments", ctx.enableAttachments)("maxAttachments", ctx.maxAttachments)("maxAttachmentSizeBytes", ctx.maxAttachmentSizeBytes)("acceptedFileTypes", ctx.acceptedFileTypes)("currentUser", ctx.currentUser)("rows", 3);
2043
+ i0.ɵɵproperty("placeholder", ctx.placeholder)("disabled", ctx.disabled || ctx.isProcessing)("showCharacterCount", false)("enableMentions", ctx.enableMentions)("enableAttachments", ctx.enableAttachments)("maxAttachments", ctx.maxAttachments)("maxAttachmentSizeBytes", ctx.maxAttachmentSizeBytes)("acceptedFileTypes", ctx.acceptedFileTypes)("currentUser", ctx.currentUser)("rows", 3);
1938
2044
  i0.ɵɵtwoWayProperty("value", ctx.messageText);
1939
2045
  } }, dependencies: [i11.MessageInputBoxComponent], styles: [".message-input-wrapper[_ngcontent-%COMP%] {\n position: relative;\n width: 100%;\n}\n\n.processing-indicator[_ngcontent-%COMP%] {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1.25rem;\n background: color-mix(in srgb, var(--mj-bg-surface-card) 95%, transparent);\n border-radius: 8px;\n box-shadow: var(--mj-shadow-sm);\n z-index: 10;\n pointer-events: none;\n}\n.processing-indicator[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n}\n.processing-indicator[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 0.9rem;\n color: var(--mj-text-primary);\n}"] });
1940
2046
  }
1941
2047
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageInputComponent, [{
1942
2048
  type: Component,
1943
- args: [{ standalone: false, selector: 'mj-message-input', template: "<div class=\"message-input-wrapper\">\n <!-- Processing Indicator Overlay -->\n @if (isProcessing) {\n <div class=\"processing-indicator\">\n <i class=\"fas fa-circle-notch fa-spin\"></i>\n <span>{{ processingMessage }}</span>\n </div>\n }\n\n <!-- Message Input Box -->\n <mj-message-input-box\n #inputBox\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isProcessing\"\n [showCharacterCount]=\"false\"\n [enableMentions]=\"true\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [currentUser]=\"currentUser\"\n [rows]=\"3\"\n [(value)]=\"messageText\"\n (textSubmitted)=\"onTextSubmitted($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (artifactPickerRequested)=\"onArtifactPickerRequested()\">\n </mj-message-input-box>\n</div>", styles: [".message-input-wrapper {\n position: relative;\n width: 100%;\n}\n\n.processing-indicator {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1.25rem;\n background: color-mix(in srgb, var(--mj-bg-surface-card) 95%, transparent);\n border-radius: 8px;\n box-shadow: var(--mj-shadow-sm);\n z-index: 10;\n pointer-events: none;\n}\n.processing-indicator i {\n color: var(--mj-brand-primary);\n}\n.processing-indicator span {\n font-size: 0.9rem;\n color: var(--mj-text-primary);\n}\n"] }]
2049
+ args: [{ standalone: false, selector: 'mj-message-input', template: "<div class=\"message-input-wrapper\">\n <!-- Processing Indicator Overlay -->\n @if (isProcessing) {\n <div class=\"processing-indicator\">\n <i class=\"fas fa-circle-notch fa-spin\"></i>\n <span>{{ processingMessage }}</span>\n </div>\n }\n\n <!-- Message Input Box -->\n <mj-message-input-box\n #inputBox\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled || isProcessing\"\n [showCharacterCount]=\"false\"\n [enableMentions]=\"enableMentions\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [currentUser]=\"currentUser\"\n [rows]=\"3\"\n [(value)]=\"messageText\"\n (textSubmitted)=\"onTextSubmitted($event)\"\n (attachmentsChanged)=\"onAttachmentsChanged($event)\"\n (attachmentError)=\"onAttachmentError($event)\"\n (artifactPickerRequested)=\"onArtifactPickerRequested()\">\n </mj-message-input-box>\n</div>", styles: [".message-input-wrapper {\n position: relative;\n width: 100%;\n}\n\n.processing-indicator {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.75rem 1.25rem;\n background: color-mix(in srgb, var(--mj-bg-surface-card) 95%, transparent);\n border-radius: 8px;\n box-shadow: var(--mj-shadow-sm);\n z-index: 10;\n pointer-events: none;\n}\n.processing-indicator i {\n color: var(--mj-brand-primary);\n}\n.processing-indicator span {\n font-size: 0.9rem;\n color: var(--mj-text-primary);\n}\n"] }]
1944
2050
  }], () => [{ type: i1.DialogService }, { type: i2.ToastService }, { type: i3.ConversationAgentService }, { type: i4.DataCacheService }, { type: i5.ActiveTasksService }, { type: i6.ConversationStreamingService }, { type: i7.MentionParserService }, { type: i8.MentionAutocompleteService }, { type: i9.ConversationAttachmentService }, { type: i10.ConversationBridgeService }], { conversationId: [{
1945
2051
  type: Input
1946
2052
  }], conversationName: [{
@@ -1955,6 +2061,8 @@ export class MessageInputComponent extends BaseAngularComponent {
1955
2061
  type: Input
1956
2062
  }], enableAttachments: [{
1957
2063
  type: Input
2064
+ }], enableMentions: [{
2065
+ type: Input
1958
2066
  }], maxAttachments: [{
1959
2067
  type: Input
1960
2068
  }], maxAttachmentSizeBytes: [{
@@ -1971,6 +2079,12 @@ export class MessageInputComponent extends BaseAngularComponent {
1971
2079
  type: Input
1972
2080
  }], appContext: [{
1973
2081
  type: Input
2082
+ }], defaultAgentId: [{
2083
+ type: Input
2084
+ }], conversationDefaultAgentId: [{
2085
+ type: Input
2086
+ }], agentConfigurationPresetId: [{
2087
+ type: Input
1974
2088
  }], initialMessage: [{
1975
2089
  type: Input
1976
2090
  }], initialAttachments: [{