@memberjunction/ng-conversations 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +20 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +125 -0
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -0
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts +48 -0
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -0
- package/dist/lib/components/agent/active-agent-indicator.component.js +199 -0
- package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -0
- package/dist/lib/components/agent/agent-process-panel.component.d.ts +30 -0
- package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -0
- package/dist/lib/components/agent/agent-process-panel.component.js +333 -0
- package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-panel.component.d.ts +22 -0
- package/dist/lib/components/artifact/artifact-panel.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-panel.component.js +237 -0
- package/dist/lib/components/artifact/artifact-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.d.ts +39 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.js +384 -0
- package/dist/lib/components/artifact/artifact-upload-modal.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-version-history.component.d.ts +28 -0
- package/dist/lib/components/artifact/artifact-version-history.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-version-history.component.js +280 -0
- package/dist/lib/components/artifact/artifact-version-history.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts +22 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.js +182 -0
- package/dist/lib/components/artifact/artifact-viewer-panel.component.js.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer.component.d.ts +27 -0
- package/dist/lib/components/artifact/artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/artifact-viewer.component.js +266 -0
- package/dist/lib/components/artifact/artifact-viewer.component.js.map +1 -0
- package/dist/lib/components/artifact/inline-artifact.component.d.ts +46 -0
- package/dist/lib/components/artifact/inline-artifact.component.d.ts.map +1 -0
- package/dist/lib/components/artifact/inline-artifact.component.js +447 -0
- package/dist/lib/components/artifact/inline-artifact.component.js.map +1 -0
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +18 -0
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-artifact-card.component.js +147 -0
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -0
- package/dist/lib/components/collection/collection-form-modal.component.d.ts +33 -0
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-form-modal.component.js +245 -0
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -0
- package/dist/lib/components/collection/collection-tree.component.d.ts +42 -0
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-tree.component.js +482 -0
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -0
- package/dist/lib/components/collection/collection-view.component.d.ts +31 -0
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collection-view.component.js +254 -0
- package/dist/lib/components/collection/collection-view.component.js.map +1 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts +55 -0
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -0
- package/dist/lib/components/collection/collections-full-view.component.js +578 -0
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +160 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.js +891 -0
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -0
- package/dist/lib/components/conversation/conversation-list.component.d.ts +29 -0
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -0
- package/dist/lib/components/conversation/conversation-list.component.js +255 -0
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -0
- package/dist/lib/components/dialogs/input-dialog.component.d.ts +17 -0
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/dialogs/input-dialog.component.js +122 -0
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -0
- package/dist/lib/components/export/export-modal.component.d.ts +37 -0
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -0
- package/dist/lib/components/export/export-modal.component.js +414 -0
- package/dist/lib/components/export/export-modal.component.js.map +1 -0
- package/dist/lib/components/library/library-full-view.component.d.ts +36 -0
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -0
- package/dist/lib/components/library/library-full-view.component.js +270 -0
- package/dist/lib/components/library/library-full-view.component.js.map +1 -0
- package/dist/lib/components/members/members-modal.component.d.ts +42 -0
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -0
- package/dist/lib/components/members/members-modal.component.js +352 -0
- package/dist/lib/components/members/members-modal.component.js.map +1 -0
- package/dist/lib/components/mention/mention-dropdown.component.d.ts +44 -0
- package/dist/lib/components/mention/mention-dropdown.component.d.ts.map +1 -0
- package/dist/lib/components/mention/mention-dropdown.component.js +194 -0
- package/dist/lib/components/mention/mention-dropdown.component.js.map +1 -0
- package/dist/lib/components/message/message-input.component.d.ts +137 -0
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-input.component.js +1159 -0
- package/dist/lib/components/message/message-input.component.js.map +1 -0
- package/dist/lib/components/message/message-item.component.d.ts +140 -0
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-item.component.js +817 -0
- package/dist/lib/components/message/message-item.component.js.map +1 -0
- package/dist/lib/components/message/message-list.component.d.ts +77 -0
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -0
- package/dist/lib/components/message/message-list.component.js +316 -0
- package/dist/lib/components/message/message-list.component.js.map +1 -0
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +13 -0
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -0
- package/dist/lib/components/navigation/conversation-navigation.component.js +88 -0
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -0
- package/dist/lib/components/notification/activity-indicator.component.d.ts +11 -0
- package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -0
- package/dist/lib/components/notification/activity-indicator.component.js +56 -0
- package/dist/lib/components/notification/activity-indicator.component.js.map +1 -0
- package/dist/lib/components/notification/notification-badge.component.d.ts +27 -0
- package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -0
- package/dist/lib/components/notification/notification-badge.component.js +160 -0
- package/dist/lib/components/notification/notification-badge.component.js.map +1 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts +34 -0
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/project/project-form-modal.component.js +357 -0
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -0
- package/dist/lib/components/project/project-selector.component.d.ts +36 -0
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -0
- package/dist/lib/components/project/project-selector.component.js +317 -0
- package/dist/lib/components/project/project-selector.component.js.map +1 -0
- package/dist/lib/components/search/search-panel.component.d.ts +120 -0
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -0
- package/dist/lib/components/search/search-panel.component.js +714 -0
- package/dist/lib/components/search/search-panel.component.js.map +1 -0
- package/dist/lib/components/share/share-modal.component.d.ts +46 -0
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -0
- package/dist/lib/components/share/share-modal.component.js +431 -0
- package/dist/lib/components/share/share-modal.component.js.map +1 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +18 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +81 -0
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -0
- package/dist/lib/components/task/task-form-modal.component.d.ts +42 -0
- package/dist/lib/components/task/task-form-modal.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-form-modal.component.js +329 -0
- package/dist/lib/components/task/task-form-modal.component.js.map +1 -0
- package/dist/lib/components/task/task-item.component.d.ts +22 -0
- package/dist/lib/components/task/task-item.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-item.component.js +234 -0
- package/dist/lib/components/task/task-item.component.js.map +1 -0
- package/dist/lib/components/task/task-list.component.d.ts +32 -0
- package/dist/lib/components/task/task-list.component.d.ts.map +1 -0
- package/dist/lib/components/task/task-list.component.js +290 -0
- package/dist/lib/components/task/task-list.component.js.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +27 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.js +254 -0
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -0
- package/dist/lib/components/thread/thread-panel.component.d.ts +65 -0
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -0
- package/dist/lib/components/thread/thread-panel.component.js +325 -0
- package/dist/lib/components/thread/thread-panel.component.js.map +1 -0
- package/dist/lib/components/toast/toast.component.d.ts +26 -0
- package/dist/lib/components/toast/toast.component.d.ts.map +1 -0
- package/dist/lib/components/toast/toast.component.js +108 -0
- package/dist/lib/components/toast/toast.component.js.map +1 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +75 -0
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -0
- package/dist/lib/components/workspace/conversation-workspace.component.js +299 -0
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -0
- package/dist/lib/conversations.module.d.ts +62 -0
- package/dist/lib/conversations.module.d.ts.map +1 -0
- package/dist/lib/conversations.module.js +248 -0
- package/dist/lib/conversations.module.js.map +1 -0
- package/dist/lib/directives/search-shortcut.directive.d.ts +17 -0
- package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -0
- package/dist/lib/directives/search-shortcut.directive.js +39 -0
- package/dist/lib/directives/search-shortcut.directive.js.map +1 -0
- package/dist/lib/models/conversation-state.model.d.ts +72 -0
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -0
- package/dist/lib/models/conversation-state.model.js +2 -0
- package/dist/lib/models/conversation-state.model.js.map +1 -0
- package/dist/lib/models/notification.model.d.ts +89 -0
- package/dist/lib/models/notification.model.d.ts.map +1 -0
- package/dist/lib/models/notification.model.js +11 -0
- package/dist/lib/models/notification.model.js.map +1 -0
- package/dist/lib/services/active-tasks.service.d.ts +65 -0
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -0
- package/dist/lib/services/active-tasks.service.js +95 -0
- package/dist/lib/services/active-tasks.service.js.map +1 -0
- package/dist/lib/services/agent-state.service.d.ts +78 -0
- package/dist/lib/services/agent-state.service.d.ts.map +1 -0
- package/dist/lib/services/agent-state.service.js +213 -0
- package/dist/lib/services/agent-state.service.js.map +1 -0
- package/dist/lib/services/artifact-state.service.d.ts +114 -0
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -0
- package/dist/lib/services/artifact-state.service.js +288 -0
- package/dist/lib/services/artifact-state.service.js.map +1 -0
- package/dist/lib/services/conversation-agent.service.d.ts +79 -0
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-agent.service.js +259 -0
- package/dist/lib/services/conversation-agent.service.js.map +1 -0
- package/dist/lib/services/conversation-state.service.d.ts +122 -0
- package/dist/lib/services/conversation-state.service.d.ts.map +1 -0
- package/dist/lib/services/conversation-state.service.js +255 -0
- package/dist/lib/services/conversation-state.service.js.map +1 -0
- package/dist/lib/services/dialog.service.d.ts +54 -0
- package/dist/lib/services/dialog.service.d.ts.map +1 -0
- package/dist/lib/services/dialog.service.js +157 -0
- package/dist/lib/services/dialog.service.js.map +1 -0
- package/dist/lib/services/export.service.d.ts +25 -0
- package/dist/lib/services/export.service.d.ts.map +1 -0
- package/dist/lib/services/export.service.js +237 -0
- package/dist/lib/services/export.service.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +59 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.js +160 -0
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -0
- package/dist/lib/services/mention-parser.service.d.ts +46 -0
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -0
- package/dist/lib/services/mention-parser.service.js +156 -0
- package/dist/lib/services/mention-parser.service.js.map +1 -0
- package/dist/lib/services/notification.service.d.ts +108 -0
- package/dist/lib/services/notification.service.d.ts.map +1 -0
- package/dist/lib/services/notification.service.js +431 -0
- package/dist/lib/services/notification.service.js.map +1 -0
- package/dist/lib/services/search.service.d.ts +144 -0
- package/dist/lib/services/search.service.d.ts.map +1 -0
- package/dist/lib/services/search.service.js +370 -0
- package/dist/lib/services/search.service.js.map +1 -0
- package/dist/lib/services/toast.service.d.ts +46 -0
- package/dist/lib/services/toast.service.d.ts.map +1 -0
- package/dist/lib/services/toast.service.js +76 -0
- package/dist/lib/services/toast.service.js.map +1 -0
- package/dist/public-api.d.ts +42 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +49 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service for parsing @mentions from message text
|
|
5
|
+
*/
|
|
6
|
+
export class MentionParserService {
|
|
7
|
+
// Regex to match @mentions - supports names with spaces if quoted: @"Agent Name" or @AgentName
|
|
8
|
+
MENTION_REGEX = /@"([^"]+)"|@(\S+)/g;
|
|
9
|
+
constructor() { }
|
|
10
|
+
/**
|
|
11
|
+
* Parse mentions from message text
|
|
12
|
+
* @param text The message text to parse
|
|
13
|
+
* @param availableAgents List of available agents for matching
|
|
14
|
+
* @param availableUsers List of available users for matching (optional)
|
|
15
|
+
* @returns Parsed mentions with agent and user separation
|
|
16
|
+
*/
|
|
17
|
+
parseMentions(text, availableAgents, availableUsers) {
|
|
18
|
+
const mentions = [];
|
|
19
|
+
const matches = Array.from(text.matchAll(this.MENTION_REGEX));
|
|
20
|
+
for (const match of matches) {
|
|
21
|
+
// Extract the mention name (either quoted or unquoted)
|
|
22
|
+
const mentionName = match[1] || match[2];
|
|
23
|
+
if (!mentionName)
|
|
24
|
+
continue;
|
|
25
|
+
// Try to match against agents first
|
|
26
|
+
const agent = this.findAgent(mentionName, availableAgents);
|
|
27
|
+
if (agent) {
|
|
28
|
+
mentions.push({
|
|
29
|
+
type: 'agent',
|
|
30
|
+
id: agent.ID,
|
|
31
|
+
name: agent.Name || 'Unknown'
|
|
32
|
+
});
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// Try to match against users
|
|
36
|
+
if (availableUsers) {
|
|
37
|
+
const user = this.findUser(mentionName, availableUsers);
|
|
38
|
+
if (user) {
|
|
39
|
+
mentions.push({
|
|
40
|
+
type: 'user',
|
|
41
|
+
id: user.ID,
|
|
42
|
+
name: user.Name
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Extract first agent mention and all user mentions
|
|
48
|
+
const agentMention = mentions.find(m => m.type === 'agent') || null;
|
|
49
|
+
const userMentions = mentions.filter(m => m.type === 'user');
|
|
50
|
+
return {
|
|
51
|
+
mentions,
|
|
52
|
+
agentMention,
|
|
53
|
+
userMentions
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Find an agent by name (case-insensitive)
|
|
58
|
+
* Uses exact match or starts-with match (no contains match to avoid ambiguity)
|
|
59
|
+
*/
|
|
60
|
+
findAgent(name, agents) {
|
|
61
|
+
// Remove trailing punctuation and trim
|
|
62
|
+
const cleanName = name.replace(/[.,;!?]+$/, '').trim();
|
|
63
|
+
const lowerName = cleanName.toLowerCase();
|
|
64
|
+
console.log('[MentionParser] Finding agent for:', name, '-> cleaned:', cleanName);
|
|
65
|
+
console.log('[MentionParser] Available agents:', agents.map(a => a.Name));
|
|
66
|
+
// Try exact match first
|
|
67
|
+
let agent = agents.find(a => (a.Name?.toLowerCase() || '') === lowerName);
|
|
68
|
+
if (agent) {
|
|
69
|
+
console.log('[MentionParser] Found exact match:', agent.Name);
|
|
70
|
+
return agent;
|
|
71
|
+
}
|
|
72
|
+
// Try starts with match
|
|
73
|
+
agent = agents.find(a => (a.Name?.toLowerCase() || '').startsWith(lowerName));
|
|
74
|
+
if (agent) {
|
|
75
|
+
console.log('[MentionParser] Found starts-with match:', agent.Name);
|
|
76
|
+
return agent;
|
|
77
|
+
}
|
|
78
|
+
console.log('[MentionParser] No agent found for:', cleanName);
|
|
79
|
+
return null;
|
|
80
|
+
// Note: Removed "contains" match to avoid ambiguous matches
|
|
81
|
+
// e.g., "@Agent" would match multiple agents like "Marketing Agent", "Data Agent"
|
|
82
|
+
// Future: Could add LLM-based disambiguation as fallback
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Find a user by name (case-insensitive)
|
|
86
|
+
* Uses exact match, email match, or starts-with match (no contains match to avoid ambiguity)
|
|
87
|
+
*/
|
|
88
|
+
findUser(name, users) {
|
|
89
|
+
const lowerName = name.toLowerCase().trim();
|
|
90
|
+
// Try exact match first
|
|
91
|
+
let user = users.find(u => u.Name.toLowerCase() === lowerName);
|
|
92
|
+
if (user)
|
|
93
|
+
return user;
|
|
94
|
+
// Try email match
|
|
95
|
+
user = users.find(u => u.Email?.toLowerCase() === lowerName);
|
|
96
|
+
if (user)
|
|
97
|
+
return user;
|
|
98
|
+
// Try starts with match
|
|
99
|
+
user = users.find(u => u.Name.toLowerCase().startsWith(lowerName));
|
|
100
|
+
return user || null;
|
|
101
|
+
// Note: Removed "contains" match for consistency with agent matching
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Validate mentions - check if all mentions are valid
|
|
105
|
+
* Returns array of invalid mention names
|
|
106
|
+
*/
|
|
107
|
+
validateMentions(text, availableAgents, availableUsers) {
|
|
108
|
+
const invalidMentions = [];
|
|
109
|
+
const matches = Array.from(text.matchAll(this.MENTION_REGEX));
|
|
110
|
+
for (const match of matches) {
|
|
111
|
+
const mentionName = match[1] || match[2];
|
|
112
|
+
if (!mentionName)
|
|
113
|
+
continue;
|
|
114
|
+
const isAgent = this.findAgent(mentionName, availableAgents) !== null;
|
|
115
|
+
const isUser = availableUsers ? this.findUser(mentionName, availableUsers) !== null : false;
|
|
116
|
+
if (!isAgent && !isUser) {
|
|
117
|
+
invalidMentions.push(mentionName);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return invalidMentions;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Extract all mention names from text (raw strings)
|
|
124
|
+
*/
|
|
125
|
+
extractMentionNames(text) {
|
|
126
|
+
const matches = Array.from(text.matchAll(this.MENTION_REGEX));
|
|
127
|
+
return matches.map(match => match[1] || match[2]).filter(Boolean);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Replace mentions in text with formatted versions
|
|
131
|
+
* Example: "@agent" -> "@Agent Name" (with proper casing)
|
|
132
|
+
*/
|
|
133
|
+
formatMentions(text, mentions) {
|
|
134
|
+
let formattedText = text;
|
|
135
|
+
for (const mention of mentions) {
|
|
136
|
+
// Find the mention in the text and replace with proper name
|
|
137
|
+
const patterns = [
|
|
138
|
+
new RegExp(`@"${mention.name}"`, 'gi'),
|
|
139
|
+
new RegExp(`@${mention.name.replace(/\s+/g, '\\s*')}`, 'gi')
|
|
140
|
+
];
|
|
141
|
+
for (const pattern of patterns) {
|
|
142
|
+
formattedText = formattedText.replace(pattern, `@${mention.name}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return formattedText;
|
|
146
|
+
}
|
|
147
|
+
static ɵfac = function MentionParserService_Factory(t) { return new (t || MentionParserService)(); };
|
|
148
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MentionParserService, factory: MentionParserService.ɵfac, providedIn: 'root' });
|
|
149
|
+
}
|
|
150
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MentionParserService, [{
|
|
151
|
+
type: Injectable,
|
|
152
|
+
args: [{
|
|
153
|
+
providedIn: 'root'
|
|
154
|
+
}]
|
|
155
|
+
}], () => [], null); })();
|
|
156
|
+
//# sourceMappingURL=mention-parser.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mention-parser.service.js","sourceRoot":"","sources":["../../../src/lib/services/mention-parser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAK3C;;GAEG;AAIH,MAAM,OAAO,oBAAoB;IAC/B,+FAA+F;IAC9E,aAAa,GAAG,oBAAoB,CAAC;IAEtD,gBAAe,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,CACX,IAAY,EACZ,eAAwC,EACxC,cAA2B;QAE3B,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAE9D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,uDAAuD;YACvD,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;YACzC,IAAI,CAAC,WAAW;gBAAE,SAAS;YAE3B,oCAAoC;YACpC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AC,IAAY;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACH,cAAc,CACZ,IAAY,EACZ,QAAmB;QAEnB,IAAI,aAAa,GAAG,IAAI,CAAC;QAEzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,4DAA4D;YAC5D,MAAM,QAAQ,GAAG;gBACf,IAAI,MAAM,CAAC,KAAK,OAAO,CAAC,IAAI,GAAG,EAAE,IAAI,CAAC;gBACtC,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC;aAC7D,CAAC;YAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;8EA/KU,oBAAoB;gEAApB,oBAAoB,WAApB,oBAAoB,mBAFnB,MAAM;;iFAEP,oBAAoB;cAHhC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ConversationNotification, NotificationItem, NotificationPreferences, NotificationPriority, NotificationChangeEvent, BadgeConfig } from '../models/notification.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Service for managing notifications across conversations
|
|
7
|
+
* Provides real-time notification tracking, persistence, and cross-tab synchronization
|
|
8
|
+
*/
|
|
9
|
+
export declare class NotificationService {
|
|
10
|
+
private ngZone;
|
|
11
|
+
private readonly STORAGE_KEY;
|
|
12
|
+
private readonly STORAGE_EVENT_KEY;
|
|
13
|
+
private _notifications$;
|
|
14
|
+
private _preferences$;
|
|
15
|
+
private _notificationItems$;
|
|
16
|
+
private _changeEvents$;
|
|
17
|
+
readonly notifications$: Observable<Record<string, ConversationNotification>>;
|
|
18
|
+
readonly preferences$: Observable<NotificationPreferences>;
|
|
19
|
+
readonly notificationItems$: Observable<NotificationItem[]>;
|
|
20
|
+
readonly changeEvents$: Observable<NotificationChangeEvent>;
|
|
21
|
+
readonly totalUnreadCount$: Observable<number>;
|
|
22
|
+
readonly hasAnyNotifications$: Observable<boolean>;
|
|
23
|
+
constructor(ngZone: NgZone);
|
|
24
|
+
/**
|
|
25
|
+
* Gets notification state for a specific conversation
|
|
26
|
+
*/
|
|
27
|
+
getConversationNotification(conversationId: string): ConversationNotification | null;
|
|
28
|
+
/**
|
|
29
|
+
* Gets notification observable for a specific conversation
|
|
30
|
+
*/
|
|
31
|
+
getConversationNotification$(conversationId: string): Observable<ConversationNotification | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets badge configuration for a conversation
|
|
34
|
+
*/
|
|
35
|
+
getBadgeConfig(conversationId: string): BadgeConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Gets badge configuration observable for a conversation
|
|
38
|
+
*/
|
|
39
|
+
getBadgeConfig$(conversationId: string): Observable<BadgeConfig>;
|
|
40
|
+
/**
|
|
41
|
+
* Tracks a new message in a conversation
|
|
42
|
+
*/
|
|
43
|
+
trackNewMessage(conversationId: string, messageTimestamp: Date, priority?: NotificationPriority): void;
|
|
44
|
+
/**
|
|
45
|
+
* Tracks multiple new messages at once (batch operation)
|
|
46
|
+
*/
|
|
47
|
+
trackNewMessages(conversationId: string, count: number, latestTimestamp: Date, priority?: NotificationPriority): void;
|
|
48
|
+
/**
|
|
49
|
+
* Tracks a new artifact notification
|
|
50
|
+
*/
|
|
51
|
+
trackNewArtifact(conversationId: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Tracks an active agent process
|
|
54
|
+
*/
|
|
55
|
+
trackAgentProcess(conversationId: string, isActive: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Marks a conversation as read (clears unread message count)
|
|
58
|
+
*/
|
|
59
|
+
markConversationAsRead(conversationId: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Clears artifact notifications for a conversation
|
|
62
|
+
*/
|
|
63
|
+
clearArtifactNotifications(conversationId: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Clears all notifications for a conversation
|
|
66
|
+
*/
|
|
67
|
+
clearAllNotifications(conversationId: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Clears all notifications across all conversations
|
|
70
|
+
*/
|
|
71
|
+
clearAllNotificationsGlobal(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Updates notification preferences
|
|
74
|
+
*/
|
|
75
|
+
updatePreferences(preferences: Partial<NotificationPreferences>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Mutes a conversation
|
|
78
|
+
*/
|
|
79
|
+
muteConversation(conversationId: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* Unmutes a conversation
|
|
82
|
+
*/
|
|
83
|
+
unmuteConversation(conversationId: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if a conversation is muted
|
|
86
|
+
*/
|
|
87
|
+
isConversationMuted(conversationId: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Requests desktop notification permission
|
|
90
|
+
*/
|
|
91
|
+
requestDesktopPermission(): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* Shows a desktop notification
|
|
94
|
+
*/
|
|
95
|
+
showDesktopNotification(title: string, body: string, conversationId: string): void;
|
|
96
|
+
private createNewNotification;
|
|
97
|
+
private updateNotifications;
|
|
98
|
+
private emitChangeEvent;
|
|
99
|
+
private getHigherPriority;
|
|
100
|
+
private playNotificationSound;
|
|
101
|
+
private loadFromStorage;
|
|
102
|
+
private saveToStorage;
|
|
103
|
+
private broadcastChange;
|
|
104
|
+
private setupStorageListener;
|
|
105
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
106
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=notification.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/notification.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAmB,UAAU,EAAsB,MAAM,MAAM,CAAC;AAEvE,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EAGvB,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,EAEZ,MAAM,8BAA8B,CAAC;;AAEtC;;;GAGG;AACH,qBAGa,mBAAmB;IAgClB,OAAO,CAAC,MAAM;IA/B1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmC;IAC/D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA4B;IAG9D,OAAO,CAAC,eAAe,CAAqE;IAC5F,OAAO,CAAC,aAAa,CAAkF;IACvG,OAAO,CAAC,mBAAmB,CAA+C;IAC1E,OAAO,CAAC,cAAc,CAA0C;IAGhE,SAAgB,cAAc,uDAAuC;IACrE,SAAgB,YAAY,sCAAqC;IACjE,SAAgB,kBAAkB,iCAA2C;IAC7E,SAAgB,aAAa,sCAAsC;IAGnE,SAAgB,iBAAiB,EAAE,UAAU,CAAC,MAAM,CAAC,CAQnD;IAEF,SAAgB,oBAAoB,EAAE,UAAU,CAAC,OAAO,CAAC,CAGvD;gBAEkB,MAAM,EAAE,MAAM;IAKlC;;OAEG;IACH,2BAA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