@memberjunction/ng-conversations 5.44.0 → 5.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +3 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +16 -12
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +16 -12
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +10 -7
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +3 -1
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +10 -8
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +103 -0
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -0
- package/dist/lib/components/composer/ai-composer.component.js +263 -0
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +3 -4
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +36 -36
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +5 -6
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +35 -20
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +2 -3
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +17 -17
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +11 -3
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +34 -10
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts +73 -0
- package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -0
- package/dist/lib/components/sidebar/routines-section.component.js +211 -0
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +12 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +37 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +11 -5
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +35 -26
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/composer-plugins/agent-mention.provider.d.ts +16 -0
- package/dist/lib/composer-plugins/agent-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/agent-mention.provider.js +28 -0
- package/dist/lib/composer-plugins/agent-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +20 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js +32 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/load-composer-plugins.d.ts +9 -0
- package/dist/lib/composer-plugins/load-composer-plugins.d.ts.map +1 -0
- package/dist/lib/composer-plugins/load-composer-plugins.js +17 -0
- package/dist/lib/composer-plugins/load-composer-plugins.js.map +1 -0
- package/dist/lib/composer-plugins/record-mention.provider.d.ts +14 -0
- package/dist/lib/composer-plugins/record-mention.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/record-mention.provider.js +26 -0
- package/dist/lib/composer-plugins/record-mention.provider.js.map +1 -0
- package/dist/lib/composer-plugins/skill-command.provider.d.ts +15 -0
- package/dist/lib/composer-plugins/skill-command.provider.d.ts.map +1 -0
- package/dist/lib/composer-plugins/skill-command.provider.js +27 -0
- package/dist/lib/composer-plugins/skill-command.provider.js.map +1 -0
- package/dist/lib/conversations.module.d.ts +74 -73
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +33 -13
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
- package/dist/lib/services/active-tasks.service.js +4 -1
- package/dist/lib/services/active-tasks.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +7 -0
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +20 -0
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.d.ts +27 -20
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +55 -16
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/public-api.d.ts +23 -3
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +38 -3
- package/dist/public-api.js.map +1 -1
- package/package.json +29 -27
- package/dist/lib/components/mention/mention-dropdown.component.d.ts +0 -53
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +0 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +0 -297
- package/dist/lib/components/mention/mention-dropdown.component.js.map +0 -1
- package/dist/lib/components/mention/mention-editor.component.d.ts +0 -256
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +0 -1
- package/dist/lib/components/mention/mention-editor.component.js +0 -1247
- package/dist/lib/components/mention/mention-editor.component.js.map +0 -1
- package/dist/lib/components/message/message-input-box.component.d.ts +0 -132
- package/dist/lib/components/message/message-input-box.component.d.ts.map +0 -1
- package/dist/lib/components/message/message-input-box.component.js +0 -327
- package/dist/lib/components/message/message-input-box.component.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-view.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAkE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;IAoC3D,iCAA+B;IAAA,YAAkB;IAAA,iBAAS;;;IAAlD,uCAAsB;IAAC,cAAkB;IAAlB,qCAAkB;;;;IAKnD,kCAAuE;IAA/C,4LAAS,sBAAe,KAAC;IAC/C,wBAA2B;IAAC,qBAC9B;IAAA,iBAAS;;;;IAOX,0CAK+B;IAA7B,sMAAU,sBAAe,KAAC;IAL5B,iBAK+B;;;IAF7B,iEAA4C;;;;IAM9C,uDAMqC;IAAnC,AAD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AAC;YAChD,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;iHAlOU,uBAAuB;6DAAvB,uBAAuB;YAtG5B,AADF,AADF,8BAA6B,aACF,SACnB;YAAA,YAAqC;YAAA,iBAAK;YAG1C,AADF,AADF,8BAA4B,aACI,gBAKR;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAC7B,iBAAS;YACT,iCAIoB;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAE/B,AADE,iBAAS,EACL;YAEN,kCAIwB;YAHtB,+MAAoB;YACpB,qHAAiB,kBAAc,IAAC;YAGhC,+FAEC;YACH,iBAAS;YAET,+FAAe;YAMnB,AADE,iBAAM,EACF;YAEN,gCAA0G;YACxG,uGAAqC;YASrC,qHASC;YAEL,AADE,iBAAM,EACF;YAGN,4FAAgD;;YA7DxC,eAAqC;YAArC,yDAAqC;YAKnC,eAAoC;YAApC,iDAAoC;YAOpC,eAAoC;YAApC,iDAAoC;YAQtC,eAAoB;YAApB,0CAAoB;YAIpB,cAEC;YAFD,8BAEC;YAGH,eAIC;YAJD,uCAIC;YAIqB,cAAuC;YAAC,AAAxC,oDAAuC,sCAAwC;YACvG,cAOC;YAPD,6DAOC;YAED,cASC;YATD,mCASC;YAKL,eAcC;YAdD,4EAcC;;;iFA2BQ,uBAAuB;cA5GnC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EP;;kBA2BF,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kFAJK,uBAAuB","sourcesContent":["import { Component, Input, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity, MJArtifactEntity, MJArtifactVersionEntity, MJCollectionArtifactEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n\ntype ViewMode = 'grid' | 'list';\ntype SortBy = 'name' | 'date' | 'type';\n\n@Component({\n standalone: false,\n selector: 'mj-collection-view',\n template: `\n <div class=\"collection-view\">\n <div class=\"view-header\">\n <h2>{{ collection.Name || 'Collection' }}</h2>\n <div class=\"header-actions\">\n <div class=\"view-mode-toggle\">\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'grid'\"\n (click)=\"viewMode = 'grid'\"\n title=\"Grid View\">\n <i class=\"fas fa-grid\"></i>\n </button>\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\"\n title=\"List View\">\n <i class=\"fas fa-list\"></i>\n </button>\n </div>\n \n <select\n [(ngModel)]=\"sortBy\"\n (ngModelChange)=\"onSortChange()\"\n class=\"mj-select\"\n style=\"width: 150px;\">\n @for (option of sortOptions; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n \n @if (canEdit) {\n <button class=\"btn-add\" (click)=\"onAddArtifact()\" title=\"Add Artifact\">\n <i class=\"fas fa-plus\"></i> Add\n </button>\n }\n </div>\n </div>\n \n <div class=\"view-content\" [class.grid-mode]=\"viewMode === 'grid'\" [class.list-mode]=\"viewMode === 'list'\">\n @if (artifactVersions.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-folder-open\"\n Title=\"This collection is empty\"\n [ActionText]=\"canEdit ? 'Add Artifact' : ''\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"onAddArtifact()\" />\n }\n \n @for (item of artifactVersions; track item.version.ID) {\n <mj-collection-artifact-card\n [artifact]=\"item.artifact\"\n [version]=\"item.version\"\n (selected)=\"onArtifactSelected(item)\"\n (viewed)=\"onViewArtifact(item)\"\n (edited)=\"onEditArtifact(item)\"\n (removed)=\"onRemoveArtifact(item)\">\n </mj-collection-artifact-card>\n }\n </div>\n </div>\n \n <!-- Artifact Viewer Panel -->\n @if (showArtifactViewer && selectedArtifactId) {\n <div class=\"artifact-viewer-overlay\" (click)=\"onCloseArtifactViewer()\">\n <div class=\"artifact-viewer-container\" (click)=\"$event.stopPropagation()\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [versionNumber]=\"selectedVersionNumber\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [viewContext]=\"'collection'\"\n [contextCollectionId]=\"collection.ID\"\n (closed)=\"onCloseArtifactViewer()\">\n </mj-artifact-viewer-panel>\n </div>\n </div>\n }\n `,\n styles: [`\n .collection-view { display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface); }\n\n .view-header { padding: 20px 24px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .view-header h2 { margin: 0; font-size: 20px; flex: 1; }\n\n .header-actions { display: flex; align-items: center; gap: 12px; }\n\n .view-mode-toggle { display: flex; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden; }\n .mode-btn { padding: 8px 12px; background: var(--mj-bg-surface); border: none; border-right: 1px solid var(--mj-border-default); cursor: pointer; color: var(--mj-text-muted); transition: all 150ms ease; }\n .mode-btn:last-child { border-right: none; }\n .mode-btn:hover { background: var(--mj-bg-surface-sunken); }\n .mode-btn.active { background: var(--mj-brand-primary); color: var(--mj-text-inverse); }\n\n .btn-add { padding: 8px 16px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }\n .btn-add:hover { background: var(--mj-brand-primary-hover); }\n\n .view-content { flex: 1; overflow-y: auto; padding: 24px; }\n .view-content.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }\n .view-content.list-mode { display: flex; flex-direction: column; gap: 12px; }\n\n .artifact-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--mj-bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 10000; }\n .artifact-viewer-container { width: 90%; max-width: 1200px; height: 90vh; background: var(--mj-bg-surface); border-radius: 12px; overflow: hidden; box-shadow: var(--mj-shadow-lg); }\n `]\n})\nexport class CollectionViewComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {\n @Input() collection!: MJCollectionEntity;\n @Input() currentUser!: UserInfo;\n @Input() environmentId!: string;\n @Input() canEdit: boolean = true;\n\n // Store versions with parent artifact info for display\n public artifactVersions: Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }> = [];\n public viewMode: ViewMode = 'grid';\n public sortBy: SortBy = 'date';\n public selectedArtifactId: string | null = null;\n public selectedVersionNumber: number | undefined = undefined;\n public showArtifactViewer = false;\n\n public sortOptions = [\n { label: 'Name', value: 'name' },\n { label: 'Date Modified', value: 'date' },\n { label: 'Type', value: 'type' }\n ];\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit() {\n this.loadArtifacts();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['collection'] && !changes['collection'].firstChange) {\n this.loadArtifacts();\n }\n }\n\n ngOnDestroy() {\n // Close artifact viewer when navigating away from collection\n if (this.showArtifactViewer) {\n this.onCloseArtifactViewer();\n }\n }\n\n private async loadArtifacts(): Promise<void> {\n if (!this.collection) return;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n // Load ALL VERSIONS in this collection (no DISTINCT - each version is separate)\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (\n SELECT ca.ArtifactVersionID\n FROM [__mj].[vwCollectionArtifacts] ca\n WHERE ca.CollectionID='${this.collection.ID}'\n )`,\n OrderBy: this.getVersionOrderBy(),\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (versionResult.Success && versionResult.Results) {\n // Get unique artifact IDs\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n\n // Load parent artifact info (just for display metadata - no visibility filtering)\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => artifactMap.set(a.ID, a));\n }\n }\n\n // Combine version + artifact info\n this.artifactVersions = versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null); // Filter out any without parent artifact\n } else {\n this.artifactVersions = [];\n }\n } catch (error) {\n console.error('Failed to load collection artifacts:', error);\n this.artifactVersions = [];\n }\n }\n\n private getVersionOrderBy(): string {\n switch (this.sortBy) {\n case 'name':\n return 'Name ASC, VersionNumber DESC';\n case 'type':\n // Will sort by parent artifact type (handled in template)\n return 'ArtifactID ASC, VersionNumber DESC';\n case 'date':\n default:\n return '__mj_UpdatedAt DESC';\n }\n }\n\n onSortChange(): void {\n this.loadArtifacts();\n }\n\n onArtifactSelected(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Emit event or navigate to artifact detail view\n }\n\n onViewArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n this.selectedArtifactId = item.artifact.ID;\n this.selectedVersionNumber = item.version.VersionNumber;\n // Force change detection to ensure Input bindings propagate before component creation\n this.cdr.detectChanges();\n this.showArtifactViewer = true;\n }\n\n onCloseArtifactViewer(): void {\n this.showArtifactViewer = false;\n this.selectedArtifactId = null;\n this.selectedVersionNumber = undefined;\n }\n\n onEditArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Open artifact editor\n }\n\n async onRemoveArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): Promise<void> {\n const versionLabel = `\"${item.artifact.Name}\" v${item.version.VersionNumber}`;\n if (!confirm(`Remove ${versionLabel} from this collection?`)) return;\n\n try {\n // Delete THIS SPECIFIC VERSION from the collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${this.collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Delete all version associations atomically\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n for (const joinRecord of result.Results) {\n joinRecord.TransactionGroup = tg;\n await joinRecord.Delete();\n }\n const success = await tg.Submit();\n if (!success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to remove ${versionLabel} from collection`,\n 'error'\n );\n return;\n }\n await this.loadArtifacts();\n this.cdr.detectChanges();\n MJNotificationService.Instance.CreateSimpleNotification(\n `Removed ${versionLabel} from collection`,\n 'success',\n 3000\n );\n }\n } catch (error) {\n console.error('Failed to remove artifact version from collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to remove artifact version from collection',\n 'error'\n );\n }\n }\n\n async onAddArtifact(): Promise<void> {\n // TODO: Open artifact picker dialog\n // For now, just show a simple prompt\n const name = prompt('Enter artifact name:');\n if (!name) return;\n\n try {\n // Create new artifact\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', this.currentUser);\n\n artifact.Name = name;\n // Type is read-only, set via TypeID instead\n // For now, skip setting type - it has a default\n\n const saved = await artifact.Save();\n if (saved) {\n // Get the latest version of this artifact to add to collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const versionResult = await rv.RunView({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n alert('Failed to get artifact version');\n return;\n }\n\n // Add to collection via join table using version ID\n const joinRecord = await md.GetEntityObject<MJCollectionArtifactEntity>('MJ: Collection Artifacts', this.currentUser);\n joinRecord.CollectionID = this.collection.ID;\n joinRecord.ArtifactVersionID = versionResult.Results[0].ID;\n\n await joinRecord.Save();\n await this.loadArtifacts();\n }\n } catch (error) {\n console.error('Failed to add artifact:', error);\n alert('Failed to add artifact');\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"collection-view.component.js","sourceRoot":"","sources":["../../../../src/lib/components/collection/collection-view.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAkE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAY,OAAO,EAAY,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;IAqC3D,iCAA+B;IAAA,YAAkB;IAAA,iBAAS;;;IAAlD,uCAAsB;IAAC,cAAkB;IAAlB,qCAAkB;;;;IAKnD,kCAAuE;IAA/C,4LAAS,sBAAe,KAAC;IAC/C,wBAA2B;IAAC,qBAC9B;IAAA,iBAAS;;;;IAOX,0CAK+B;IAA7B,sMAAU,sBAAe,KAAC;IAL5B,iBAK+B;;;IAF7B,iEAA4C;;;;IAM9C,uDAMqC;IAAnC,AADA,AADA,AADA,yOAAY,kCAAwB,KAAC,wNAC3B,8BAAoB,KAAC,wNACrB,8BAAoB,KAAC,0NACpB,gCAAsB,KAAC;IACpC,iBAA8B;;;IAL5B,AADA,2CAA0B,4BACF;;;;IAY9B,+BAAuE;IAAlC,yLAAS,8BAAuB,KAAC;IACpE,+BAA0E;IAAnC,4JAAS,wBAAwB,KAAC;IACvE,oDAOqC;IAAnC,gNAAU,8BAAuB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B;YAtG5B,AADF,AADF,8BAA6B,aACF,SACnB;YAAA,YAAqC;YAAA,iBAAK;YAG1C,AADF,AADF,8BAA4B,aACI,gBAKR;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAC7B,iBAAS;YACT,iCAIoB;YADlB,mHAAoB,MAAM,IAAC;YAE3B,uBAA2B;YAE/B,AADE,iBAAS,EACL;YAEN,kCAIwB;YAHtB,+MAAoB;YACpB,qHAAiB,kBAAc,IAAC;YAGhC,+FAEC;YACH,iBAAS;YAET,+FAAe;YAMnB,AADE,iBAAM,EACF;YAEN,gCAA0G;YACxG,uGAAqC;YASrC,qHASC;YAEL,AADE,iBAAM,EACF;YAGN,4FAAgD;;YA7DxC,eAAqC;YAArC,yDAAqC;YAKnC,eAAoC;YAApC,iDAAoC;YAOpC,eAAoC;YAApC,iDAAoC;YAQtC,eAAoB;YAApB,0CAAoB;YAIpB,cAEC;YAFD,8BAEC;YAGH,eAIC;YAJD,uCAIC;YAIqB,cAAuC;YAAC,AAAxC,oDAAuC,sCAAwC;YACvG,cAOC;YAPD,6DAOC;YAED,cASC;YATD,mCASC;YAKL,eAcC;YAdD,4EAcC;;;iFA2BQ,uBAAuB;cA5GnC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EP;;kBA2BF,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kFAJK,uBAAuB","sourcesContent":["import { Component, Input, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCollectionEntity, MJArtifactEntity, MJArtifactVersionEntity, MJCollectionArtifactEntity } from '@memberjunction/core-entities';\nimport { UserInfo, RunView, Metadata } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\n\ntype ViewMode = 'grid' | 'list';\ntype SortBy = 'name' | 'date' | 'type';\n\n@Component({\n standalone: false,\n selector: 'mj-collection-view',\n template: `\n <div class=\"collection-view\">\n <div class=\"view-header\">\n <h2>{{ collection.Name || 'Collection' }}</h2>\n <div class=\"header-actions\">\n <div class=\"view-mode-toggle\">\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'grid'\"\n (click)=\"viewMode = 'grid'\"\n title=\"Grid View\">\n <i class=\"fas fa-grid\"></i>\n </button>\n <button\n class=\"mode-btn\"\n [class.active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\"\n title=\"List View\">\n <i class=\"fas fa-list\"></i>\n </button>\n </div>\n \n <select\n [(ngModel)]=\"sortBy\"\n (ngModelChange)=\"onSortChange()\"\n class=\"mj-select\"\n style=\"width: 150px;\">\n @for (option of sortOptions; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n \n @if (canEdit) {\n <button class=\"btn-add\" (click)=\"onAddArtifact()\" title=\"Add Artifact\">\n <i class=\"fas fa-plus\"></i> Add\n </button>\n }\n </div>\n </div>\n \n <div class=\"view-content\" [class.grid-mode]=\"viewMode === 'grid'\" [class.list-mode]=\"viewMode === 'list'\">\n @if (artifactVersions.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-folder-open\"\n Title=\"This collection is empty\"\n [ActionText]=\"canEdit ? 'Add Artifact' : ''\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"onAddArtifact()\" />\n }\n \n @for (item of artifactVersions; track item.version.ID) {\n <mj-collection-artifact-card\n [artifact]=\"item.artifact\"\n [version]=\"item.version\"\n (selected)=\"onArtifactSelected(item)\"\n (viewed)=\"onViewArtifact(item)\"\n (edited)=\"onEditArtifact(item)\"\n (removed)=\"onRemoveArtifact(item)\">\n </mj-collection-artifact-card>\n }\n </div>\n </div>\n \n <!-- Artifact Viewer Panel -->\n @if (showArtifactViewer && selectedArtifactId) {\n <div class=\"artifact-viewer-overlay\" (click)=\"onCloseArtifactViewer()\">\n <div class=\"artifact-viewer-container\" (click)=\"$event.stopPropagation()\">\n <mj-artifact-viewer-panel\n [artifactId]=\"selectedArtifactId\"\n [versionNumber]=\"selectedVersionNumber\"\n [currentUser]=\"currentUser\"\n [environmentId]=\"environmentId\"\n [viewContext]=\"'collection'\"\n [contextCollectionId]=\"collection.ID\"\n (closed)=\"onCloseArtifactViewer()\">\n </mj-artifact-viewer-panel>\n </div>\n </div>\n }\n `,\n styles: [`\n .collection-view { display: flex; flex-direction: column; height: 100%; background: var(--mj-bg-surface); }\n\n .view-header { padding: 20px 24px; border-bottom: 1px solid var(--mj-border-default); display: flex; justify-content: space-between; align-items: center; }\n .view-header h2 { margin: 0; font-size: 20px; flex: 1; }\n\n .header-actions { display: flex; align-items: center; gap: 12px; }\n\n .view-mode-toggle { display: flex; border: 1px solid var(--mj-border-default); border-radius: 4px; overflow: hidden; }\n .mode-btn { padding: 8px 12px; background: var(--mj-bg-surface); border: none; border-right: 1px solid var(--mj-border-default); cursor: pointer; color: var(--mj-text-muted); transition: all 150ms ease; }\n .mode-btn:last-child { border-right: none; }\n .mode-btn:hover { background: var(--mj-bg-surface-sunken); }\n .mode-btn.active { background: var(--mj-brand-primary); color: var(--mj-text-inverse); }\n\n .btn-add { padding: 8px 16px; background: var(--mj-brand-primary); color: var(--mj-text-inverse); border: none; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }\n .btn-add:hover { background: var(--mj-brand-primary-hover); }\n\n .view-content { flex: 1; overflow-y: auto; padding: 24px; }\n .view-content.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }\n .view-content.list-mode { display: flex; flex-direction: column; gap: 12px; }\n\n .artifact-viewer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--mj-bg-overlay); display: flex; align-items: center; justify-content: center; z-index: 10000; }\n .artifact-viewer-container { width: 90%; max-width: 1200px; height: 90vh; background: var(--mj-bg-surface); border-radius: 12px; overflow: hidden; box-shadow: var(--mj-shadow-lg); }\n `]\n})\nexport class CollectionViewComponent extends BaseAngularComponent implements OnInit, OnChanges, OnDestroy {\n @Input() collection!: MJCollectionEntity;\n @Input() currentUser!: UserInfo;\n @Input() environmentId!: string;\n @Input() canEdit: boolean = true;\n\n // Store versions with parent artifact info for display\n public artifactVersions: Array<{\n version: MJArtifactVersionEntity;\n artifact: MJArtifactEntity;\n }> = [];\n public viewMode: ViewMode = 'grid';\n public sortBy: SortBy = 'date';\n public selectedArtifactId: string | null = null;\n public selectedVersionNumber: number | undefined = undefined;\n public showArtifactViewer = false;\n\n public sortOptions = [\n { label: 'Name', value: 'name' },\n { label: 'Date Modified', value: 'date' },\n { label: 'Type', value: 'type' }\n ];\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) {\n super();}\n\n ngOnInit() {\n this.loadArtifacts();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['collection'] && !changes['collection'].firstChange) {\n this.loadArtifacts();\n }\n }\n\n ngOnDestroy() {\n // Close artifact viewer when navigating away from collection\n if (this.showArtifactViewer) {\n this.onCloseArtifactViewer();\n }\n }\n\n private async loadArtifacts(): Promise<void> {\n if (!this.collection) return;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const md = this.ProviderToUse;\n\n // Load ALL VERSIONS in this collection (no DISTINCT - each version is separate)\n const versionResult = await rv.RunView<MJArtifactVersionEntity>({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ID IN (\n SELECT ca.ArtifactVersionID\n FROM [__mj].[vwCollectionArtifacts] ca\n WHERE ca.CollectionID='${this.collection.ID}'\n )`,\n OrderBy: this.getVersionOrderBy(),\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (versionResult.Success && versionResult.Results) {\n // Get unique artifact IDs\n const artifactIds = [...new Set(versionResult.Results.map(v => v.ArtifactID))];\n\n // Load parent artifact info (just for display metadata - no visibility filtering)\n const artifactMap = new Map<string, MJArtifactEntity>();\n if (artifactIds.length > 0) {\n const artifactFilter = artifactIds.map(id => `ID='${id}'`).join(' OR ');\n const artifactResult = await rv.RunView<MJArtifactEntity>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: artifactFilter,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (artifactResult.Success && artifactResult.Results) {\n artifactResult.Results.forEach(a => artifactMap.set(a.ID, a));\n }\n }\n\n // Combine version + artifact info\n this.artifactVersions = versionResult.Results\n .map(version => ({\n version,\n artifact: artifactMap.get(version.ArtifactID)!\n }))\n .filter(item => item.artifact != null); // Filter out any without parent artifact\n } else {\n this.artifactVersions = [];\n }\n } catch (error) {\n console.error('Failed to load collection artifacts:', error);\n this.artifactVersions = [];\n }\n }\n\n private getVersionOrderBy(): string {\n switch (this.sortBy) {\n case 'name':\n return 'Name ASC, VersionNumber DESC';\n case 'type':\n // Will sort by parent artifact type (handled in template)\n return 'ArtifactID ASC, VersionNumber DESC';\n case 'date':\n default:\n return '__mj_UpdatedAt DESC';\n }\n }\n\n onSortChange(): void {\n this.loadArtifacts();\n }\n\n onArtifactSelected(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Emit event or navigate to artifact detail view\n }\n\n onViewArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n this.selectedArtifactId = item.artifact.ID;\n this.selectedVersionNumber = item.version.VersionNumber;\n // Force change detection to ensure Input bindings propagate before component creation\n this.cdr.detectChanges();\n this.showArtifactViewer = true;\n }\n\n onCloseArtifactViewer(): void {\n this.showArtifactViewer = false;\n this.selectedArtifactId = null;\n this.selectedVersionNumber = undefined;\n }\n\n onEditArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): void {\n // TODO: Open artifact editor\n }\n\n async onRemoveArtifact(item: { version: MJArtifactVersionEntity; artifact: MJArtifactEntity }): Promise<void> {\n const versionLabel = `\"${item.artifact.Name}\" v${item.version.VersionNumber}`;\n if (!(await this.confirmService.ConfirmDelete({ title: 'Remove from Collection', message: `Remove ${versionLabel} from this collection?`, confirmText: 'Remove' }))) return;\n\n try {\n // Delete THIS SPECIFIC VERSION from the collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView({\n EntityName: 'MJ: Collection Artifacts',\n ExtraFilter: `CollectionID='${this.collection.ID}' AND ArtifactVersionID='${item.version.ID}'`,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n // Delete all version associations atomically\n const md = this.ProviderToUse;\n const tg = await md.CreateTransactionGroup();\n for (const joinRecord of result.Results) {\n joinRecord.TransactionGroup = tg;\n await joinRecord.Delete();\n }\n const success = await tg.Submit();\n if (!success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to remove ${versionLabel} from collection`,\n 'error'\n );\n return;\n }\n await this.loadArtifacts();\n this.cdr.detectChanges();\n MJNotificationService.Instance.CreateSimpleNotification(\n `Removed ${versionLabel} from collection`,\n 'success',\n 3000\n );\n }\n } catch (error) {\n console.error('Failed to remove artifact version from collection:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to remove artifact version from collection',\n 'error'\n );\n }\n }\n\n async onAddArtifact(): Promise<void> {\n // TODO: Open artifact picker dialog\n // For now, just show a simple prompt\n const name = prompt('Enter artifact name:');\n if (!name) return;\n\n try {\n // Create new artifact\n const md = this.ProviderToUse;\n const artifact = await md.GetEntityObject<MJArtifactEntity>('MJ: Artifacts', this.currentUser);\n\n artifact.Name = name;\n // Type is read-only, set via TypeID instead\n // For now, skip setting type - it has a default\n\n const saved = await artifact.Save();\n if (saved) {\n // Get the latest version of this artifact to add to collection\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const versionResult = await rv.RunView({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID='${artifact.ID}'`,\n OrderBy: 'VersionNumber DESC',\n MaxRows: 1,\n ResultType: 'entity_object'\n }, this.currentUser);\n\n if (!versionResult.Success || !versionResult.Results || versionResult.Results.length === 0) {\n alert('Failed to get artifact version');\n return;\n }\n\n // Add to collection via join table using version ID\n const joinRecord = await md.GetEntityObject<MJCollectionArtifactEntity>('MJ: Collection Artifacts', this.currentUser);\n joinRecord.CollectionID = this.collection.ID;\n joinRecord.ArtifactVersionID = versionResult.Results[0].ID;\n\n await joinRecord.Save();\n await this.loadArtifacts();\n }\n } catch (error) {\n console.error('Failed to add artifact:', error);\n alert('Failed to add artifact');\n }\n }\n}"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
3
|
+
import { ComposerTriggerProvider, MentionEditorComponent, MessageInputBoxComponent, PendingAttachment } from '@memberjunction/ng-composer';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* AI-aware composer: wraps the generic `<mj-message-input-box>` (from
|
|
7
|
+
* `@memberjunction/ng-composer`, which ships zero AI knowledge) and builds the AI
|
|
8
|
+
* trigger plugins in — '@' agent/user mentions, '#' entity/query record mentions, and
|
|
9
|
+
* '/' skill commands — while proxying the input box's full surface (inputs, outputs,
|
|
10
|
+
* and public methods).
|
|
11
|
+
*
|
|
12
|
+
* The familiar granular flags live HERE now:
|
|
13
|
+
* - `EnableAgentMentions` (default true) — the '@' trigger
|
|
14
|
+
* - `EnableEntityMentions` (default true) — the '#' trigger
|
|
15
|
+
* - `EnableSkillCommands` (default true) — the '/' trigger
|
|
16
|
+
* plus the pass-through `enableMentions` master switch.
|
|
17
|
+
*
|
|
18
|
+
* The wrapper always runs the inner editor in EXPLICIT provider-list mode (it owns the
|
|
19
|
+
* list; it deliberately does not proxy `TriggerProviders` / `ExcludedTriggerKeys` — use
|
|
20
|
+
* the raw `<mj-message-input-box>` when you need custom providers or discovery mode).
|
|
21
|
+
*/
|
|
22
|
+
export declare class AiComposerComponent {
|
|
23
|
+
inputBox?: MessageInputBoxComponent;
|
|
24
|
+
private _enableAgentMentions;
|
|
25
|
+
private _enableEntityMentions;
|
|
26
|
+
private _enableSkillCommands;
|
|
27
|
+
private _activeTriggerProviders;
|
|
28
|
+
private readonly agentMentionProvider;
|
|
29
|
+
private readonly recordMentionProvider;
|
|
30
|
+
private readonly skillCommandProvider;
|
|
31
|
+
constructor();
|
|
32
|
+
/** Enables the '@' trigger (agent + user mentions). */
|
|
33
|
+
set EnableAgentMentions(value: boolean);
|
|
34
|
+
get EnableAgentMentions(): boolean;
|
|
35
|
+
/** Enables the '#' trigger (entity + query record mentions). */
|
|
36
|
+
set EnableEntityMentions(value: boolean);
|
|
37
|
+
get EnableEntityMentions(): boolean;
|
|
38
|
+
/** Enables the '/' trigger (skill commands). */
|
|
39
|
+
set EnableSkillCommands(value: boolean);
|
|
40
|
+
get EnableSkillCommands(): boolean;
|
|
41
|
+
/** The explicit provider list bound to the inner editor (stable reference; rebuilt only when a flag flips). */
|
|
42
|
+
get ActiveTriggerProviders(): ComposerTriggerProvider[];
|
|
43
|
+
private rebuildTriggerProviders;
|
|
44
|
+
placeholder: string;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
value: string;
|
|
47
|
+
showCharacterCount: boolean;
|
|
48
|
+
/** Master switch for all mention/command triggers (pass-through). */
|
|
49
|
+
enableMentions: boolean;
|
|
50
|
+
/** Optional metadata provider scoping this composer (pass-through to the trigger plugins). */
|
|
51
|
+
Provider: IMetadataProvider | null;
|
|
52
|
+
currentUser?: UserInfo;
|
|
53
|
+
rows: number;
|
|
54
|
+
enableAttachments: boolean;
|
|
55
|
+
maxAttachments: number;
|
|
56
|
+
maxAttachmentSizeBytes: number;
|
|
57
|
+
acceptedFileTypes: string;
|
|
58
|
+
enableRealtime: boolean;
|
|
59
|
+
voiceActive: boolean;
|
|
60
|
+
canStartRealtime: boolean;
|
|
61
|
+
enablePlanMode: boolean;
|
|
62
|
+
planModeActive: boolean;
|
|
63
|
+
textSubmitted: EventEmitter<string>;
|
|
64
|
+
valueChange: EventEmitter<string>;
|
|
65
|
+
attachmentsChanged: EventEmitter<PendingAttachment[]>;
|
|
66
|
+
attachmentError: EventEmitter<string>;
|
|
67
|
+
attachmentClicked: EventEmitter<PendingAttachment>;
|
|
68
|
+
voiceRequested: EventEmitter<void>;
|
|
69
|
+
voiceOptionsRequested: EventEmitter<void>;
|
|
70
|
+
planModeToggle: EventEmitter<void>;
|
|
71
|
+
onInnerValueChange(newValue: string): void;
|
|
72
|
+
/** The inner mention editor — kept reachable for hosts that drive it directly (e.g. clear-after-programmatic-send). */
|
|
73
|
+
get mentionEditor(): MentionEditorComponent | undefined;
|
|
74
|
+
/** Focus the composer input. */
|
|
75
|
+
focus(): void;
|
|
76
|
+
/** Clear the editor content and pending attachments. */
|
|
77
|
+
clear(): void;
|
|
78
|
+
/** Mention chip data (id/type/name + preset info) currently in the editor. */
|
|
79
|
+
getMentionChipsData(): Array<{
|
|
80
|
+
id: string;
|
|
81
|
+
type: string;
|
|
82
|
+
name: string;
|
|
83
|
+
presetId?: string;
|
|
84
|
+
presetName?: string;
|
|
85
|
+
}>;
|
|
86
|
+
/** Plain text with mentions encoded as JSON (`@{"type":...}`) — the persistence format. */
|
|
87
|
+
getPlainTextWithJsonMentions(): string;
|
|
88
|
+
/** Pending (not yet uploaded) attachments. */
|
|
89
|
+
getPendingAttachments(): PendingAttachment[];
|
|
90
|
+
/** Open the attachment file picker programmatically. */
|
|
91
|
+
openFilePicker(): void;
|
|
92
|
+
/** Attach an artifact as a pending attachment (artifact picker flow). */
|
|
93
|
+
AddArtifactAttachment(artifact: {
|
|
94
|
+
fileID: string;
|
|
95
|
+
fileName: string;
|
|
96
|
+
mimeType: string;
|
|
97
|
+
sizeBytes: number;
|
|
98
|
+
artifactVersionId?: string;
|
|
99
|
+
}): PendingAttachment | undefined;
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiComposerComponent, never>;
|
|
101
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiComposerComponent, "mj-ai-composer", never, { "EnableAgentMentions": { "alias": "EnableAgentMentions"; "required": false; }; "EnableEntityMentions": { "alias": "EnableEntityMentions"; "required": false; }; "EnableSkillCommands": { "alias": "EnableSkillCommands"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showCharacterCount": { "alias": "showCharacterCount"; "required": false; }; "enableMentions": { "alias": "enableMentions"; "required": false; }; "Provider": { "alias": "Provider"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "enableAttachments": { "alias": "enableAttachments"; "required": false; }; "maxAttachments": { "alias": "maxAttachments"; "required": false; }; "maxAttachmentSizeBytes": { "alias": "maxAttachmentSizeBytes"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "enableRealtime": { "alias": "enableRealtime"; "required": false; }; "voiceActive": { "alias": "voiceActive"; "required": false; }; "canStartRealtime": { "alias": "canStartRealtime"; "required": false; }; "enablePlanMode": { "alias": "enablePlanMode"; "required": false; }; "planModeActive": { "alias": "planModeActive"; "required": false; }; }, { "textSubmitted": "textSubmitted"; "valueChange": "valueChange"; "attachmentsChanged": "attachmentsChanged"; "attachmentError": "attachmentError"; "attachmentClicked": "attachmentClicked"; "voiceRequested": "voiceRequested"; "voiceOptionsRequested": "voiceOptionsRequested"; "planModeToggle": "planModeToggle"; }, never, never, false, never>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=ai-composer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-composer.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/composer/ai-composer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAA4B,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE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mBAAmB;2CAAnB,mBAAmB;CAoJ/B"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
|
+
import { AgentMentionProvider } from '../../composer-plugins/agent-mention.provider';
|
|
3
|
+
import { RecordMentionProvider } from '../../composer-plugins/record-mention.provider';
|
|
4
|
+
import { SkillCommandProvider } from '../../composer-plugins/skill-command.provider';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@memberjunction/ng-composer";
|
|
7
|
+
const _c0 = ["inputBox"];
|
|
8
|
+
/**
|
|
9
|
+
* AI-aware composer: wraps the generic `<mj-message-input-box>` (from
|
|
10
|
+
* `@memberjunction/ng-composer`, which ships zero AI knowledge) and builds the AI
|
|
11
|
+
* trigger plugins in — '@' agent/user mentions, '#' entity/query record mentions, and
|
|
12
|
+
* '/' skill commands — while proxying the input box's full surface (inputs, outputs,
|
|
13
|
+
* and public methods).
|
|
14
|
+
*
|
|
15
|
+
* The familiar granular flags live HERE now:
|
|
16
|
+
* - `EnableAgentMentions` (default true) — the '@' trigger
|
|
17
|
+
* - `EnableEntityMentions` (default true) — the '#' trigger
|
|
18
|
+
* - `EnableSkillCommands` (default true) — the '/' trigger
|
|
19
|
+
* plus the pass-through `enableMentions` master switch.
|
|
20
|
+
*
|
|
21
|
+
* The wrapper always runs the inner editor in EXPLICIT provider-list mode (it owns the
|
|
22
|
+
* list; it deliberately does not proxy `TriggerProviders` / `ExcludedTriggerKeys` — use
|
|
23
|
+
* the raw `<mj-message-input-box>` when you need custom providers or discovery mode).
|
|
24
|
+
*/
|
|
25
|
+
export class AiComposerComponent {
|
|
26
|
+
inputBox;
|
|
27
|
+
// ── AI convenience flags (the wrapper's reason to exist) ─────────────────────────
|
|
28
|
+
_enableAgentMentions = true;
|
|
29
|
+
_enableEntityMentions = true;
|
|
30
|
+
_enableSkillCommands = true;
|
|
31
|
+
_activeTriggerProviders = [];
|
|
32
|
+
// One instance per plugin per composer — all instances share the singleton
|
|
33
|
+
// MentionAutocompleteService engine, so there is no duplicate cache warm-up.
|
|
34
|
+
agentMentionProvider = new AgentMentionProvider();
|
|
35
|
+
recordMentionProvider = new RecordMentionProvider();
|
|
36
|
+
skillCommandProvider = new SkillCommandProvider();
|
|
37
|
+
constructor() {
|
|
38
|
+
this.rebuildTriggerProviders();
|
|
39
|
+
}
|
|
40
|
+
/** Enables the '@' trigger (agent + user mentions). */
|
|
41
|
+
set EnableAgentMentions(value) {
|
|
42
|
+
if (value !== this._enableAgentMentions) {
|
|
43
|
+
this._enableAgentMentions = value;
|
|
44
|
+
this.rebuildTriggerProviders();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
get EnableAgentMentions() {
|
|
48
|
+
return this._enableAgentMentions;
|
|
49
|
+
}
|
|
50
|
+
/** Enables the '#' trigger (entity + query record mentions). */
|
|
51
|
+
set EnableEntityMentions(value) {
|
|
52
|
+
if (value !== this._enableEntityMentions) {
|
|
53
|
+
this._enableEntityMentions = value;
|
|
54
|
+
this.rebuildTriggerProviders();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
get EnableEntityMentions() {
|
|
58
|
+
return this._enableEntityMentions;
|
|
59
|
+
}
|
|
60
|
+
/** Enables the '/' trigger (skill commands). */
|
|
61
|
+
set EnableSkillCommands(value) {
|
|
62
|
+
if (value !== this._enableSkillCommands) {
|
|
63
|
+
this._enableSkillCommands = value;
|
|
64
|
+
this.rebuildTriggerProviders();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
get EnableSkillCommands() {
|
|
68
|
+
return this._enableSkillCommands;
|
|
69
|
+
}
|
|
70
|
+
/** The explicit provider list bound to the inner editor (stable reference; rebuilt only when a flag flips). */
|
|
71
|
+
get ActiveTriggerProviders() {
|
|
72
|
+
return this._activeTriggerProviders;
|
|
73
|
+
}
|
|
74
|
+
rebuildTriggerProviders() {
|
|
75
|
+
const providers = [];
|
|
76
|
+
if (this._enableAgentMentions)
|
|
77
|
+
providers.push(this.agentMentionProvider);
|
|
78
|
+
if (this._enableEntityMentions)
|
|
79
|
+
providers.push(this.recordMentionProvider);
|
|
80
|
+
if (this._enableSkillCommands)
|
|
81
|
+
providers.push(this.skillCommandProvider);
|
|
82
|
+
this._activeTriggerProviders = providers;
|
|
83
|
+
}
|
|
84
|
+
// ── Proxied inputs (identical names/defaults to MessageInputBoxComponent) ────────
|
|
85
|
+
placeholder = 'Type your message to start a new conversation...';
|
|
86
|
+
disabled = false;
|
|
87
|
+
value = '';
|
|
88
|
+
showCharacterCount = false;
|
|
89
|
+
/** Master switch for all mention/command triggers (pass-through). */
|
|
90
|
+
enableMentions = true;
|
|
91
|
+
/** Optional metadata provider scoping this composer (pass-through to the trigger plugins). */
|
|
92
|
+
Provider = null;
|
|
93
|
+
currentUser;
|
|
94
|
+
rows = 3;
|
|
95
|
+
enableAttachments = true;
|
|
96
|
+
maxAttachments = 10;
|
|
97
|
+
maxAttachmentSizeBytes = 20 * 1024 * 1024; // 20MB
|
|
98
|
+
acceptedFileTypes = 'image/*';
|
|
99
|
+
enableRealtime = false;
|
|
100
|
+
voiceActive = false;
|
|
101
|
+
canStartRealtime = true;
|
|
102
|
+
enablePlanMode = false;
|
|
103
|
+
planModeActive = false;
|
|
104
|
+
// ── Proxied outputs ───────────────────────────────────────────────────────────────
|
|
105
|
+
textSubmitted = new EventEmitter();
|
|
106
|
+
valueChange = new EventEmitter();
|
|
107
|
+
attachmentsChanged = new EventEmitter();
|
|
108
|
+
attachmentError = new EventEmitter();
|
|
109
|
+
attachmentClicked = new EventEmitter();
|
|
110
|
+
voiceRequested = new EventEmitter();
|
|
111
|
+
voiceOptionsRequested = new EventEmitter();
|
|
112
|
+
planModeToggle = new EventEmitter();
|
|
113
|
+
onInnerValueChange(newValue) {
|
|
114
|
+
this.value = newValue;
|
|
115
|
+
this.valueChange.emit(newValue);
|
|
116
|
+
}
|
|
117
|
+
// ── Proxied public methods (ViewChild delegation) ─────────────────────────────────
|
|
118
|
+
/** The inner mention editor — kept reachable for hosts that drive it directly (e.g. clear-after-programmatic-send). */
|
|
119
|
+
get mentionEditor() {
|
|
120
|
+
return this.inputBox?.mentionEditor;
|
|
121
|
+
}
|
|
122
|
+
/** Focus the composer input. */
|
|
123
|
+
focus() {
|
|
124
|
+
this.inputBox?.focus();
|
|
125
|
+
}
|
|
126
|
+
/** Clear the editor content and pending attachments. */
|
|
127
|
+
clear() {
|
|
128
|
+
this.inputBox?.mentionEditor?.clear();
|
|
129
|
+
}
|
|
130
|
+
/** Mention chip data (id/type/name + preset info) currently in the editor. */
|
|
131
|
+
getMentionChipsData() {
|
|
132
|
+
return this.inputBox?.getMentionChipsData() || [];
|
|
133
|
+
}
|
|
134
|
+
/** Plain text with mentions encoded as JSON (`@{"type":...}`) — the persistence format. */
|
|
135
|
+
getPlainTextWithJsonMentions() {
|
|
136
|
+
return this.inputBox?.mentionEditor?.getPlainTextWithJsonMentions() || '';
|
|
137
|
+
}
|
|
138
|
+
/** Pending (not yet uploaded) attachments. */
|
|
139
|
+
getPendingAttachments() {
|
|
140
|
+
return this.inputBox?.getPendingAttachments() || [];
|
|
141
|
+
}
|
|
142
|
+
/** Open the attachment file picker programmatically. */
|
|
143
|
+
openFilePicker() {
|
|
144
|
+
this.inputBox?.openFilePicker();
|
|
145
|
+
}
|
|
146
|
+
/** Attach an artifact as a pending attachment (artifact picker flow). */
|
|
147
|
+
AddArtifactAttachment(artifact) {
|
|
148
|
+
return this.inputBox?.AddArtifactAttachment(artifact);
|
|
149
|
+
}
|
|
150
|
+
static ɵfac = function AiComposerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AiComposerComponent)(); };
|
|
151
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AiComposerComponent, selectors: [["mj-ai-composer"]], viewQuery: function AiComposerComponent_Query(rf, ctx) { if (rf & 1) {
|
|
152
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
153
|
+
} if (rf & 2) {
|
|
154
|
+
let _t;
|
|
155
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputBox = _t.first);
|
|
156
|
+
} }, inputs: { EnableAgentMentions: "EnableAgentMentions", EnableEntityMentions: "EnableEntityMentions", EnableSkillCommands: "EnableSkillCommands", placeholder: "placeholder", disabled: "disabled", value: "value", showCharacterCount: "showCharacterCount", enableMentions: "enableMentions", Provider: "Provider", currentUser: "currentUser", rows: "rows", enableAttachments: "enableAttachments", maxAttachments: "maxAttachments", maxAttachmentSizeBytes: "maxAttachmentSizeBytes", acceptedFileTypes: "acceptedFileTypes", enableRealtime: "enableRealtime", voiceActive: "voiceActive", canStartRealtime: "canStartRealtime", enablePlanMode: "enablePlanMode", planModeActive: "planModeActive" }, outputs: { textSubmitted: "textSubmitted", valueChange: "valueChange", attachmentsChanged: "attachmentsChanged", attachmentError: "attachmentError", attachmentClicked: "attachmentClicked", voiceRequested: "voiceRequested", voiceOptionsRequested: "voiceOptionsRequested", planModeToggle: "planModeToggle" }, standalone: false, decls: 2, vars: 18, consts: [["inputBox", ""], [3, "textSubmitted", "valueChange", "attachmentsChanged", "attachmentError", "attachmentClicked", "voiceRequested", "voiceOptionsRequested", "planModeToggle", "placeholder", "disabled", "value", "showCharacterCount", "enableMentions", "TriggerProviders", "Provider", "currentUser", "rows", "enableAttachments", "maxAttachments", "maxAttachmentSizeBytes", "acceptedFileTypes", "enableRealtime", "voiceActive", "canStartRealtime", "enablePlanMode", "planModeActive"]], template: function AiComposerComponent_Template(rf, ctx) { if (rf & 1) {
|
|
157
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
158
|
+
i0.ɵɵelementStart(0, "mj-message-input-box", 1, 0);
|
|
159
|
+
i0.ɵɵlistener("textSubmitted", function AiComposerComponent_Template_mj_message_input_box_textSubmitted_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.textSubmitted.emit($event)); })("valueChange", function AiComposerComponent_Template_mj_message_input_box_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onInnerValueChange($event)); })("attachmentsChanged", function AiComposerComponent_Template_mj_message_input_box_attachmentsChanged_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.attachmentsChanged.emit($event)); })("attachmentError", function AiComposerComponent_Template_mj_message_input_box_attachmentError_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.attachmentError.emit($event)); })("attachmentClicked", function AiComposerComponent_Template_mj_message_input_box_attachmentClicked_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.attachmentClicked.emit($event)); })("voiceRequested", function AiComposerComponent_Template_mj_message_input_box_voiceRequested_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.voiceRequested.emit()); })("voiceOptionsRequested", function AiComposerComponent_Template_mj_message_input_box_voiceOptionsRequested_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.voiceOptionsRequested.emit()); })("planModeToggle", function AiComposerComponent_Template_mj_message_input_box_planModeToggle_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.planModeToggle.emit()); });
|
|
160
|
+
i0.ɵɵelementEnd();
|
|
161
|
+
} if (rf & 2) {
|
|
162
|
+
i0.ɵɵproperty("placeholder", ctx.placeholder)("disabled", ctx.disabled)("value", ctx.value)("showCharacterCount", ctx.showCharacterCount)("enableMentions", ctx.enableMentions)("TriggerProviders", ctx.ActiveTriggerProviders)("Provider", ctx.Provider)("currentUser", ctx.currentUser)("rows", ctx.rows)("enableAttachments", ctx.enableAttachments)("maxAttachments", ctx.maxAttachments)("maxAttachmentSizeBytes", ctx.maxAttachmentSizeBytes)("acceptedFileTypes", ctx.acceptedFileTypes)("enableRealtime", ctx.enableRealtime)("voiceActive", ctx.voiceActive)("canStartRealtime", ctx.canStartRealtime)("enablePlanMode", ctx.enablePlanMode)("planModeActive", ctx.planModeActive);
|
|
163
|
+
} }, dependencies: [i1.MessageInputBoxComponent], encapsulation: 2 });
|
|
164
|
+
}
|
|
165
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AiComposerComponent, [{
|
|
166
|
+
type: Component,
|
|
167
|
+
args: [{
|
|
168
|
+
standalone: false,
|
|
169
|
+
selector: 'mj-ai-composer',
|
|
170
|
+
template: `
|
|
171
|
+
<mj-message-input-box
|
|
172
|
+
#inputBox
|
|
173
|
+
[placeholder]="placeholder"
|
|
174
|
+
[disabled]="disabled"
|
|
175
|
+
[value]="value"
|
|
176
|
+
[showCharacterCount]="showCharacterCount"
|
|
177
|
+
[enableMentions]="enableMentions"
|
|
178
|
+
[TriggerProviders]="ActiveTriggerProviders"
|
|
179
|
+
[Provider]="Provider"
|
|
180
|
+
[currentUser]="currentUser"
|
|
181
|
+
[rows]="rows"
|
|
182
|
+
[enableAttachments]="enableAttachments"
|
|
183
|
+
[maxAttachments]="maxAttachments"
|
|
184
|
+
[maxAttachmentSizeBytes]="maxAttachmentSizeBytes"
|
|
185
|
+
[acceptedFileTypes]="acceptedFileTypes"
|
|
186
|
+
[enableRealtime]="enableRealtime"
|
|
187
|
+
[voiceActive]="voiceActive"
|
|
188
|
+
[canStartRealtime]="canStartRealtime"
|
|
189
|
+
[enablePlanMode]="enablePlanMode"
|
|
190
|
+
[planModeActive]="planModeActive"
|
|
191
|
+
(textSubmitted)="textSubmitted.emit($event)"
|
|
192
|
+
(valueChange)="onInnerValueChange($event)"
|
|
193
|
+
(attachmentsChanged)="attachmentsChanged.emit($event)"
|
|
194
|
+
(attachmentError)="attachmentError.emit($event)"
|
|
195
|
+
(attachmentClicked)="attachmentClicked.emit($event)"
|
|
196
|
+
(voiceRequested)="voiceRequested.emit()"
|
|
197
|
+
(voiceOptionsRequested)="voiceOptionsRequested.emit()"
|
|
198
|
+
(planModeToggle)="planModeToggle.emit()">
|
|
199
|
+
</mj-message-input-box>
|
|
200
|
+
`
|
|
201
|
+
}]
|
|
202
|
+
}], () => [], { inputBox: [{
|
|
203
|
+
type: ViewChild,
|
|
204
|
+
args: ['inputBox']
|
|
205
|
+
}], EnableAgentMentions: [{
|
|
206
|
+
type: Input
|
|
207
|
+
}], EnableEntityMentions: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], EnableSkillCommands: [{
|
|
210
|
+
type: Input
|
|
211
|
+
}], placeholder: [{
|
|
212
|
+
type: Input
|
|
213
|
+
}], disabled: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], value: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], showCharacterCount: [{
|
|
218
|
+
type: Input
|
|
219
|
+
}], enableMentions: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], Provider: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}], currentUser: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], rows: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], enableAttachments: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], maxAttachments: [{
|
|
230
|
+
type: Input
|
|
231
|
+
}], maxAttachmentSizeBytes: [{
|
|
232
|
+
type: Input
|
|
233
|
+
}], acceptedFileTypes: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}], enableRealtime: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], voiceActive: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], canStartRealtime: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], enablePlanMode: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], planModeActive: [{
|
|
244
|
+
type: Input
|
|
245
|
+
}], textSubmitted: [{
|
|
246
|
+
type: Output
|
|
247
|
+
}], valueChange: [{
|
|
248
|
+
type: Output
|
|
249
|
+
}], attachmentsChanged: [{
|
|
250
|
+
type: Output
|
|
251
|
+
}], attachmentError: [{
|
|
252
|
+
type: Output
|
|
253
|
+
}], attachmentClicked: [{
|
|
254
|
+
type: Output
|
|
255
|
+
}], voiceRequested: [{
|
|
256
|
+
type: Output
|
|
257
|
+
}], voiceOptionsRequested: [{
|
|
258
|
+
type: Output
|
|
259
|
+
}], planModeToggle: [{
|
|
260
|
+
type: Output
|
|
261
|
+
}] }); })();
|
|
262
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AiComposerComponent, { className: "AiComposerComponent", filePath: "src/lib/components/composer/ai-composer.component.ts", lineNumber: 65 }); })();
|
|
263
|
+
//# sourceMappingURL=ai-composer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-composer.component.js","sourceRoot":"","sources":["../../../../src/lib/components/composer/ai-composer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;;;;AAErF;;;;;;;;;;;;;;;;GAgBG;AAoCH,MAAM,OAAO,mBAAmB;IACP,QAAQ,CAA4B;IAE3D,oFAAoF;IAC5E,oBAAoB,GAAY,IAAI,CAAC;IACrC,qBAAqB,GAAY,IAAI,CAAC;IACtC,oBAAoB,GAAY,IAAI,CAAC;IACrC,uBAAuB,GAA8B,EAAE,CAAC;IAEhE,2EAA2E;IAC3E,6EAA6E;IAC5D,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAClD,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAC;IACpD,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAEnE;QACE,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED,uDAAuD;IACvD,IACI,mBAAmB,CAAC,KAAc;QACpC,IAAI,KAAK,KAAK,IAAI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J,sCACA;;;iFAY1B,mBAAmB;cAnC/B,SAAS;eAAC;gBACT,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,gBAAgB;gBAC1B,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BT;aACF;;kBAEE,SAAS;mBAAC,UAAU;;kBAmBpB,KAAK;;kBAYL,KAAK;;kBAYL,KAAK;;kBAyBL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAjGI,mBAAmB","sourcesContent":["import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\nimport { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport {\n ComposerTriggerProvider,\n MentionEditorComponent,\n MessageInputBoxComponent,\n PendingAttachment\n} from '@memberjunction/ng-composer';\nimport { AgentMentionProvider } from '../../composer-plugins/agent-mention.provider';\nimport { RecordMentionProvider } from '../../composer-plugins/record-mention.provider';\nimport { SkillCommandProvider } from '../../composer-plugins/skill-command.provider';\n\n/**\n * AI-aware composer: wraps the generic `<mj-message-input-box>` (from\n * `@memberjunction/ng-composer`, which ships zero AI knowledge) and builds the AI\n * trigger plugins in — '@' agent/user mentions, '#' entity/query record mentions, and\n * '/' skill commands — while proxying the input box's full surface (inputs, outputs,\n * and public methods).\n *\n * The familiar granular flags live HERE now:\n * - `EnableAgentMentions` (default true) — the '@' trigger\n * - `EnableEntityMentions` (default true) — the '#' trigger\n * - `EnableSkillCommands` (default true) — the '/' trigger\n * plus the pass-through `enableMentions` master switch.\n *\n * The wrapper always runs the inner editor in EXPLICIT provider-list mode (it owns the\n * list; it deliberately does not proxy `TriggerProviders` / `ExcludedTriggerKeys` — use\n * the raw `<mj-message-input-box>` when you need custom providers or discovery mode).\n */\n@Component({\n standalone: false,\n selector: 'mj-ai-composer',\n template: `\n <mj-message-input-box\n #inputBox\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [value]=\"value\"\n [showCharacterCount]=\"showCharacterCount\"\n [enableMentions]=\"enableMentions\"\n [TriggerProviders]=\"ActiveTriggerProviders\"\n [Provider]=\"Provider\"\n [currentUser]=\"currentUser\"\n [rows]=\"rows\"\n [enableAttachments]=\"enableAttachments\"\n [maxAttachments]=\"maxAttachments\"\n [maxAttachmentSizeBytes]=\"maxAttachmentSizeBytes\"\n [acceptedFileTypes]=\"acceptedFileTypes\"\n [enableRealtime]=\"enableRealtime\"\n [voiceActive]=\"voiceActive\"\n [canStartRealtime]=\"canStartRealtime\"\n [enablePlanMode]=\"enablePlanMode\"\n [planModeActive]=\"planModeActive\"\n (textSubmitted)=\"textSubmitted.emit($event)\"\n (valueChange)=\"onInnerValueChange($event)\"\n (attachmentsChanged)=\"attachmentsChanged.emit($event)\"\n (attachmentError)=\"attachmentError.emit($event)\"\n (attachmentClicked)=\"attachmentClicked.emit($event)\"\n (voiceRequested)=\"voiceRequested.emit()\"\n (voiceOptionsRequested)=\"voiceOptionsRequested.emit()\"\n (planModeToggle)=\"planModeToggle.emit()\">\n </mj-message-input-box>\n `\n})\nexport class AiComposerComponent {\n @ViewChild('inputBox') inputBox?: MessageInputBoxComponent;\n\n // ── AI convenience flags (the wrapper's reason to exist) ─────────────────────────\n private _enableAgentMentions: boolean = true;\n private _enableEntityMentions: boolean = true;\n private _enableSkillCommands: boolean = true;\n private _activeTriggerProviders: ComposerTriggerProvider[] = [];\n\n // One instance per plugin per composer — all instances share the singleton\n // MentionAutocompleteService engine, so there is no duplicate cache warm-up.\n private readonly agentMentionProvider = new AgentMentionProvider();\n private readonly recordMentionProvider = new RecordMentionProvider();\n private readonly skillCommandProvider = new SkillCommandProvider();\n\n constructor() {\n this.rebuildTriggerProviders();\n }\n\n /** Enables the '@' trigger (agent + user mentions). */\n @Input()\n set EnableAgentMentions(value: boolean) {\n if (value !== this._enableAgentMentions) {\n this._enableAgentMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableAgentMentions(): boolean {\n return this._enableAgentMentions;\n }\n\n /** Enables the '#' trigger (entity + query record mentions). */\n @Input()\n set EnableEntityMentions(value: boolean) {\n if (value !== this._enableEntityMentions) {\n this._enableEntityMentions = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableEntityMentions(): boolean {\n return this._enableEntityMentions;\n }\n\n /** Enables the '/' trigger (skill commands). */\n @Input()\n set EnableSkillCommands(value: boolean) {\n if (value !== this._enableSkillCommands) {\n this._enableSkillCommands = value;\n this.rebuildTriggerProviders();\n }\n }\n get EnableSkillCommands(): boolean {\n return this._enableSkillCommands;\n }\n\n /** The explicit provider list bound to the inner editor (stable reference; rebuilt only when a flag flips). */\n public get ActiveTriggerProviders(): ComposerTriggerProvider[] {\n return this._activeTriggerProviders;\n }\n\n private rebuildTriggerProviders(): void {\n const providers: ComposerTriggerProvider[] = [];\n if (this._enableAgentMentions) providers.push(this.agentMentionProvider);\n if (this._enableEntityMentions) providers.push(this.recordMentionProvider);\n if (this._enableSkillCommands) providers.push(this.skillCommandProvider);\n this._activeTriggerProviders = providers;\n }\n\n // ── Proxied inputs (identical names/defaults to MessageInputBoxComponent) ────────\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 /** Master switch for all mention/command triggers (pass-through). */\n @Input() enableMentions: boolean = true;\n /** Optional metadata provider scoping this composer (pass-through to the trigger plugins). */\n @Input() Provider: IMetadataProvider | null = null;\n @Input() currentUser?: UserInfo;\n @Input() rows: number = 3;\n @Input() enableAttachments: boolean = true;\n @Input() maxAttachments: number = 10;\n @Input() maxAttachmentSizeBytes: number = 20 * 1024 * 1024; // 20MB\n @Input() acceptedFileTypes: string = 'image/*';\n @Input() enableRealtime: boolean = false;\n @Input() voiceActive: boolean = false;\n @Input() canStartRealtime: boolean = true;\n @Input() enablePlanMode: boolean = false;\n @Input() planModeActive: boolean = false;\n\n // ── Proxied outputs ───────────────────────────────────────────────────────────────\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() voiceRequested = new EventEmitter<void>();\n @Output() voiceOptionsRequested = new EventEmitter<void>();\n @Output() planModeToggle = new EventEmitter<void>();\n\n onInnerValueChange(newValue: string): void {\n this.value = newValue;\n this.valueChange.emit(newValue);\n }\n\n // ── Proxied public methods (ViewChild delegation) ─────────────────────────────────\n\n /** The inner mention editor — kept reachable for hosts that drive it directly (e.g. clear-after-programmatic-send). */\n public get mentionEditor(): MentionEditorComponent | undefined {\n return this.inputBox?.mentionEditor;\n }\n\n /** Focus the composer input. */\n public focus(): void {\n this.inputBox?.focus();\n }\n\n /** Clear the editor content and pending attachments. */\n public clear(): void {\n this.inputBox?.mentionEditor?.clear();\n }\n\n /** Mention chip data (id/type/name + preset info) currently in the editor. */\n public getMentionChipsData(): Array<{ id: string; type: string; name: string; presetId?: string; presetName?: string }> {\n return this.inputBox?.getMentionChipsData() || [];\n }\n\n /** Plain text with mentions encoded as JSON (`@{\"type\":...}`) — the persistence format. */\n public getPlainTextWithJsonMentions(): string {\n return this.inputBox?.mentionEditor?.getPlainTextWithJsonMentions() || '';\n }\n\n /** Pending (not yet uploaded) attachments. */\n public getPendingAttachments(): PendingAttachment[] {\n return this.inputBox?.getPendingAttachments() || [];\n }\n\n /** Open the attachment file picker programmatically. */\n public openFilePicker(): void {\n this.inputBox?.openFilePicker();\n }\n\n /** Attach an artifact as a pending attachment (artifact picker flow). */\n public AddArtifactAttachment(artifact: {\n fileID: string; fileName: string; mimeType: string;\n sizeBytes: number; artifactVersionId?: string;\n }): PendingAttachment | undefined {\n return this.inputBox?.AddArtifactAttachment(artifact);\n }\n}\n"]}
|
|
@@ -7,13 +7,12 @@ import { UICommandHandlerService } from '../../services/ui-command-handler.servi
|
|
|
7
7
|
import { AgentStateService } from '../../services/agent-state.service';
|
|
8
8
|
import { ConversationAgentService } from '../../services/conversation-agent.service';
|
|
9
9
|
import { ActiveTasksService } from '../../services/active-tasks.service';
|
|
10
|
-
import {
|
|
10
|
+
import { PendingAttachment } from '@memberjunction/ng-composer';
|
|
11
11
|
import { ArtifactPermissionService } from '../../services/artifact-permission.service';
|
|
12
12
|
import { ConversationAttachmentService } from '../../services/conversation-attachment.service';
|
|
13
13
|
import { MJResourcePermissionShareAdapter, ResourceShareContext } from '@memberjunction/ng-resource-permissions';
|
|
14
14
|
import { MessageAttachment } from '../message/message-item.component';
|
|
15
15
|
import { LazyArtifactInfo } from '../../models/lazy-artifact-info';
|
|
16
|
-
import { PendingAttachment } from '../mention/mention-editor.component';
|
|
17
16
|
import { NavigationRequest, AnalyzeArtifactService, InteractiveFormApplyService } from '@memberjunction/ng-artifacts';
|
|
18
17
|
import { TestFeedbackDialogData, TestFeedbackDialogResult } from '@memberjunction/ng-testing';
|
|
19
18
|
import { DialogService as ConversationsDialogService } from '../../services/dialog.service';
|
|
@@ -59,7 +58,6 @@ export declare class ConversationChatAreaComponent extends BaseAngularComponent
|
|
|
59
58
|
private conversationAgentService;
|
|
60
59
|
private activeTasks;
|
|
61
60
|
private cdr;
|
|
62
|
-
private mentionAutocompleteService;
|
|
63
61
|
private artifactPermissionService;
|
|
64
62
|
private attachmentService;
|
|
65
63
|
private streamingService;
|
|
@@ -484,7 +482,8 @@ export declare class ConversationChatAreaComponent extends BaseAngularComponent
|
|
|
484
482
|
realtimeSessionMetaMap: Map<string, RealtimeSessionTimelineMeta>;
|
|
485
483
|
/** Agent name the overlay banner shows: the reviewed session's agent while reviewing, else the live call's. */
|
|
486
484
|
get realtimeOverlayAgentName(): string;
|
|
487
|
-
|
|
485
|
+
private mentionAutocompleteService;
|
|
486
|
+
constructor(agentStateService: AgentStateService, conversationAgentService: ConversationAgentService, activeTasks: ActiveTasksService, cdr: ChangeDetectorRef, artifactPermissionService: ArtifactPermissionService, attachmentService: ConversationAttachmentService, streamingService: ConversationStreamingService, confirmDialog: ConversationsDialogService, bridge: ConversationBridgeService, analyzeArtifactService: AnalyzeArtifactService, uiCommandHandler: UICommandHandlerService, interactiveFormApplyService: InteractiveFormApplyService, agentClientService: AgentClientService);
|
|
488
487
|
/**
|
|
489
488
|
* Apply a form-role artifact's spec as an EntityFormOverride for the
|
|
490
489
|
* current user. The service handles the Create-vs-Modify decision (based
|