@dataclouder/ngx-agent-cards 0.1.29 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/fesm2022/dataclouder-ngx-agent-cards.mjs +1205 -679
  2. package/fesm2022/dataclouder-ngx-agent-cards.mjs.map +1 -1
  3. package/lib/components/chat-container/chat-container.component.d.ts +3 -4
  4. package/lib/components/chat-container/chat-header/chat-header.component.d.ts +2 -0
  5. package/lib/components/{text-highlighter/text-highlighter.d.ts → chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-content-displayer/message-content-displayer.d.ts} +7 -16
  6. package/lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-orchestrator.component.d.ts +16 -0
  7. package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts +1 -2
  8. package/lib/components/chat-container/chat-messages-list/chat-messages-list.component.d.ts +1 -3
  9. package/lib/components/conversation-info/conversation-inspector.d.ts +23 -0
  10. package/lib/components/dc-agent-card-details/dc-agent-card-details.component.d.ts +5 -4
  11. package/lib/components/dc-agent-form/agent-task-form/agent-task-form.component.d.ts +1 -3
  12. package/lib/components/dc-agent-form/dc-agent-card-form.component.d.ts +30 -4
  13. package/lib/components/dc-agent-form/dc-conversation-flow-form/dc-conversation-flow-form.component.d.ts +4 -3
  14. package/lib/components/dc-agent-form/dc-do-action-form/dc-do-action-form.component.d.ts +4 -0
  15. package/lib/components/dc-agent-form/dc-dynamic-criteria-form/dc-dynamic-criteria-form.component.d.ts +19 -0
  16. package/lib/components/dc-agent-form/form-group.service.d.ts +32 -2
  17. package/lib/components/dc-agent-form/form-group.utils.d.ts +26 -4
  18. package/lib/components/feedback-evaluation/feedback-evaluation.component.d.ts +15 -0
  19. package/lib/components/translate-dialog/translate-dialog.component.d.ts +2 -2
  20. package/lib/models/agent.models.d.ts +29 -33
  21. package/lib/models/conversation-enums.d.ts +0 -7
  22. package/lib/pipes/format-key.pipe.d.ts +7 -0
  23. package/lib/prompts/dynamic-criteria.prompts.d.ts +2 -0
  24. package/lib/prompts/evaluation-performance-prompt.d.ts +38 -0
  25. package/lib/services/chat-monitor.service.d.ts +9 -0
  26. package/lib/services/context-engine.service.d.ts +16 -0
  27. package/lib/services/conversation-info.service.d.ts +12 -0
  28. package/lib/services/conversation.service.d.ts +5 -11
  29. package/lib/services/dc-conversation-builder.service.d.ts +3 -3
  30. package/lib/services/dynamic-criteria.service.d.ts +13 -0
  31. package/lib/services/dynamic-flow-task.service.d.ts +16 -0
  32. package/lib/services/dynamic-flow.service.d.ts +1 -0
  33. package/lib/services/evaluation.service.d.ts +12 -6
  34. package/lib/services/global-tools.service.d.ts +7 -0
  35. package/lib/services/message-orchestration.service.d.ts +29 -0
  36. package/package.json +4 -1
  37. package/public-api.d.ts +5 -3
  38. package/lib/components/chat-container/chat-messages-list/message-orchestrator/message-orchestrator.component.d.ts +0 -29
  39. package/lib/services/agent-user-progress.service.d.ts +0 -17
  40. package/lib/services/content-extractor.tool.d.ts +0 -2
  41. /package/lib/components/{text-highlighter → chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-content-displayer}/extract-tags.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ export type EvaluationLevel = 1 | 2 | 3 | 4 | 5;
2
+ export type CommunicationLevel = 'Beginner' | 'Intermediate' | 'Advanced' | 'Native-like';
3
+ export type DominantRegister = 'formal' | 'informal' | 'mixed';
4
+ export type ConversationType = 'casual' | 'academic' | 'professional' | 'social';
5
+ export interface OverallScore {
6
+ rating: number;
7
+ level: EvaluationLevel;
8
+ }
9
+ export interface Assessment {
10
+ score: number;
11
+ level: EvaluationLevel | CommunicationLevel;
12
+ feedback: string;
13
+ suggestions: string[];
14
+ }
15
+ export interface Assessments {
16
+ grammar: Assessment;
17
+ vocabulary: Assessment;
18
+ communication_effectiveness: Assessment;
19
+ pragmatic_competence: Assessment;
20
+ }
21
+ export interface ConversationAnalysis {
22
+ dominant_register: DominantRegister;
23
+ conversation_type: ConversationType;
24
+ key_observations: string[];
25
+ notable_patterns: string[];
26
+ }
27
+ export interface ActionableFeedback {
28
+ immediate_focus_areas: string[];
29
+ practice_recommendations: string[];
30
+ next_steps: string[];
31
+ }
32
+ export interface PerformanceEvaluation {
33
+ overall_score: OverallScore;
34
+ assessments: Assessments;
35
+ conversation_analysis: ConversationAnalysis;
36
+ actionable_feedback: ActionableFeedback;
37
+ }
38
+ export declare const performanceAnalysisPromptTemplate: (language: string) => string;
@@ -0,0 +1,9 @@
1
+ import { MessageContent } from '../models/agent.models';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ChatMonitorService {
4
+ private readonly messageAudioWillPlay;
5
+ readonly messageAudioWillPlay$: import("@angular/core").Signal<MessageContent>;
6
+ logMessageAudioWillPlay(message: MessageContent): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatMonitorService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatMonitorService>;
9
+ }
@@ -0,0 +1,16 @@
1
+ import { ContextType, ChatMessage } from '../models/agent.models';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ContextEngineService {
4
+ private messagesStateSvc;
5
+ private userService;
6
+ getUserData(): string;
7
+ getEntityContext<T extends {
8
+ id: string;
9
+ name: string;
10
+ description?: string;
11
+ }>(entity: T): any;
12
+ getConversationContext(contextType: ContextType): string;
13
+ getContextMessages(contextType: ContextType): ChatMessage[];
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContextEngineService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<ContextEngineService>;
16
+ }
@@ -0,0 +1,12 @@
1
+ import { IAgentCard } from '../models/agent.models';
2
+ import { ChatUserSettings } from '@dataclouder/ngx-core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ConversationInfoService {
5
+ private dialogService;
6
+ openConversationInfo(data: {
7
+ agentCard: IAgentCard;
8
+ chatUserSettings: ChatUserSettings;
9
+ }): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConversationInfoService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConversationInfoService>;
12
+ }
@@ -2,20 +2,16 @@ import { Signal } from '@angular/core';
2
2
  import { WordData } from '../services/popup.service';
3
3
  import { AudioGenerated, ChatMessage, IAgentCard, IConversationFlow, IConversationSettings, MessageContent } from '../models/agent.models';
4
4
  import * as i0 from "@angular/core";
5
- export declare const EvaluationStructureString = "\n{\n \"text\": \"\",\n \"score\": 0,\n}\n";
6
- export type EvaluationJson = {
7
- text: string;
8
- score: number;
9
- };
10
5
  export declare class ConversationService {
11
6
  private defaultAgentCardService;
12
7
  private toastAlerts;
13
8
  private messageProcessingService;
14
9
  private conversationBuilder;
15
10
  private userDataExchange;
16
- private evaluationService;
17
11
  private messagesStateService;
18
12
  private dynamicFlowService;
13
+ private dynamicCriteriaService;
14
+ private dynamicFlowTaskService;
19
15
  private isThinkingSignal;
20
16
  private conversationSettingsState;
21
17
  private isDestroyedSignal;
@@ -42,12 +38,12 @@ export declare class ConversationService {
42
38
  private overrideSettingsByUserSettings;
43
39
  setupConversationWithAgentCard(agentCard: IAgentCard, parseDict?: {
44
40
  [key: string]: string;
45
- }, conversationFlowApp?: IConversationFlow): void;
41
+ }, appConversationFlow?: IConversationFlow): void;
46
42
  initConversationWithSettings(conversationSettings: IConversationSettings, conversationFlow: IConversationFlow): Promise<void>;
47
43
  private initConversation;
48
44
  initConversationWithAgentCard(agentCard: IAgentCard, parseDict?: {
49
45
  [key: string]: string;
50
- }, conversationFlow?: IConversationFlow): Promise<void>;
46
+ }, appConversationFlow?: IConversationFlow): Promise<void>;
51
47
  /**
52
48
  * Sends a user message, processes it, adds it to the conversation,
53
49
  * and triggers the AI response flow.
@@ -60,11 +56,9 @@ export declare class ConversationService {
60
56
  userMessageId: string;
61
57
  assistantMessageId: string | null;
62
58
  } | null>;
63
- sendCurrentConversation(): Promise<string | null>;
59
+ requestAssistantConversationResponse(): Promise<string | null>;
64
60
  resetConversation(agentCard?: IAgentCard): Promise<void>;
65
61
  getTTSFile(message: MessageContent): Promise<AudioGenerated>;
66
- private runAssistantTrigger;
67
- private runUserFlowEvaluations;
68
62
  static ɵfac: i0.ɵɵFactoryDeclaration<ConversationService, never>;
69
63
  static ɵprov: i0.ɵɵInjectableDeclaration<ConversationService>;
70
64
  }
@@ -1,6 +1,6 @@
1
1
  import { ChatMessage, IConversationSettings, IAgentCard } from '../models/agent.models';
2
2
  import * as i0 from "@angular/core";
3
- export declare class DCConversationPromptBuilderService {
3
+ export declare class ConversationPromptBuilderService {
4
4
  private userDataExchange;
5
5
  buildConversationSettings(agentCard: IAgentCard, parseDict?: {
6
6
  [key: string]: string;
@@ -24,6 +24,6 @@ export declare class DCConversationPromptBuilderService {
24
24
  [key: string]: string;
25
25
  }): string;
26
26
  getConversationSettings(agent: IAgentCard, chatMessages: ChatMessage[], jailBrakePrompt: string): IConversationSettings;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DCConversationPromptBuilderService, never>;
28
- static ɵprov: i0.ɵɵInjectableDeclaration<DCConversationPromptBuilderService>;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConversationPromptBuilderService, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConversationPromptBuilderService>;
29
29
  }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DynamicCriteriaService {
3
+ private dynamicFlowService;
4
+ private contextEngineService;
5
+ private defaultAgentCardService;
6
+ private globalToolsService;
7
+ private messageState;
8
+ evaluateUsingTools(): Promise<void>;
9
+ getMoodEmoji(mood: string): string | undefined;
10
+ evaluateMoodState(): Promise<string[]>;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicCriteriaService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<DynamicCriteriaService>;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { ChatMessage } from '../models/agent.models';
2
+ import * as i0 from "@angular/core";
3
+ export type EvaluationJson = {
4
+ text: string;
5
+ score: number;
6
+ };
7
+ export declare class DynamicFlowTaskService {
8
+ private dynamicFlowService;
9
+ private evaluationService;
10
+ private messagesStateService;
11
+ private userDataExchange;
12
+ evaluateAssistantTaskTrigger(message: ChatMessage): Promise<void>;
13
+ evaluateUserTaskTrigger(message: ChatMessage): Promise<void>;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFlowTaskService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<DynamicFlowTaskService>;
16
+ }
@@ -6,6 +6,7 @@ export declare class DynamicFlowService {
6
6
  setConversationFlow(conversationFlow: IConversationFlow): void;
7
7
  changePrompt(): void;
8
8
  applyConditionChange(condition: IDynamicCondition): void;
9
+ changeDynamicFlowTask(action: DoAction): void;
9
10
  doActionPrompt(action: DoAction): void;
10
11
  removeSystemPrompts(): void;
11
12
  checkDynamicConditions(previousScore: number, currentScore: number): void;
@@ -1,5 +1,6 @@
1
- import { AITask, ChatMessage, SimpleAgentTask } from '../models/agent.models';
1
+ import { IDynamicFlowTask, SimpleAgentTask } from '../models/agent.models';
2
2
  import { ContextType } from '../models/agent.models';
3
+ import { PerformanceEvaluation } from '../prompts/evaluation-performance-prompt';
3
4
  import * as i0 from "@angular/core";
4
5
  export interface IEvaluationResponse {
5
6
  text: string;
@@ -9,11 +10,13 @@ export declare class EvaluationService {
9
10
  private defaultAgentCardService;
10
11
  private toastService;
11
12
  private dynamicFlowService;
13
+ private contextEngineService;
14
+ private dialogService;
15
+ private loadingBarService;
12
16
  scoreSignal: import("@angular/core").WritableSignal<number>;
13
17
  private evaluationResultSignal;
14
- evaluateGoal(goalTask: SimpleAgentTask, messages: ChatMessage[]): Promise<any>;
15
- evaluateConversation(messages: ChatMessage[], task: SimpleAgentTask, context?: ContextType): Promise<IEvaluationResponse>;
16
- private getConversationString;
18
+ evaluateGoal(goalTask: IDynamicFlowTask): Promise<any>;
19
+ evaluateConversation(task: SimpleAgentTask, contextType?: ContextType): Promise<IEvaluationResponse>;
17
20
  /**
18
21
  * Diference with evaluateConversation is task is already processed here.
19
22
  * Evaluates a conversation context based on a specific task and attaches the result to a designated message.
@@ -22,9 +25,12 @@ export declare class EvaluationService {
22
25
  * @param contextType Determines which part of the conversation history to send as context (default: AllConversation).
23
26
  * @returns The JSON result of the evaluation.
24
27
  */
25
- evaluateWithTask(agentTask: AITask): Promise<any>;
26
- private updateScore;
28
+ evaluateWithTask(agentTask: IDynamicFlowTask): Promise<any>;
29
+ updateScore(additionalScore: number): void;
30
+ setScore(newScore: number): void;
27
31
  resetScore(): void;
32
+ analylizePerformance(): Promise<any>;
33
+ openFeedbackEvaluation(data?: PerformanceEvaluation): void;
28
34
  static ɵfac: i0.ɵɵFactoryDeclaration<EvaluationService, never>;
29
35
  static ɵprov: i0.ɵɵInjectableDeclaration<EvaluationService>;
30
36
  }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class GlobalToolsService {
3
+ useTool(tool: string, ...args: any[]): Promise<any>;
4
+ getAvailibleTools(): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<GlobalToolsService, never>;
6
+ static ɵprov: i0.ɵɵInjectableDeclaration<GlobalToolsService>;
7
+ }
@@ -0,0 +1,29 @@
1
+ import { ChatRole, MessageContent } from '../models/agent.models';
2
+ import { WordData } from './popup.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class MessageOrchestrationService {
5
+ private conversationService;
6
+ private userDataExchange;
7
+ private chatMonitorService;
8
+ private messages;
9
+ private messageRole;
10
+ private messageToPlay;
11
+ messagesSignal: import("@angular/core").Signal<MessageContent[]>;
12
+ messageToPlay$: import("@angular/core").Signal<MessageContent>;
13
+ private audioQueue;
14
+ private isGenerating;
15
+ private currentPlayingIndex;
16
+ private preGenerationInProgress;
17
+ constructor();
18
+ startOrchestration(messages: MessageContent[], role: ChatRole): void;
19
+ audioCompleted(message: MessageContent): void;
20
+ wordClicked(wordData: WordData): void;
21
+ private initializeAudioQueue;
22
+ private processNextInQueue;
23
+ private preGenerateNextIfNeeded;
24
+ private generateAudioForIndex;
25
+ private changeStates;
26
+ private generateAudio;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<MessageOrchestrationService, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<MessageOrchestrationService>;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-agent-cards",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -25,6 +25,9 @@
25
25
  },
26
26
  "@dataclouder/ngx-mic": {
27
27
  "optional": true
28
+ },
29
+ "@dataclouder/ngx-users": {
30
+ "optional": true
28
31
  }
29
32
  },
30
33
  "sideEffects": false,
package/public-api.d.ts CHANGED
@@ -3,13 +3,15 @@ export * from './lib/models/agent-card-abstract.model';
3
3
  export * from './lib/models/conversation-enums';
4
4
  export * from './lib/models/agent-card-abstract.model';
5
5
  export * from './lib/models/agent.utils';
6
+ export * from './lib/prompts/dynamic-criteria.prompts';
6
7
  export * from './lib/components/dc-agent-form/form-group.utils';
7
8
  export * from './lib/services/audio.service';
8
9
  export * from './lib/services/dc-conversation-builder.service';
9
10
  export * from './lib/services/default-agent-service';
10
11
  export * from './lib/services/popup.service';
11
- export * from './lib/services/agent-user-progress.service';
12
12
  export * from './lib/services/dynamic-flow.service';
13
+ export * from './lib/services/global-tools.service';
14
+ export * from './lib/services/context-engine.service';
13
15
  export * from './lib/components/chat-container/chat-container.component';
14
16
  export * from './lib/components/dc-agent-form/dc-agent-card-form.component';
15
17
  export * from './lib/components/dc-agent-card-lists/dc-agent-card-lists.component';
@@ -20,8 +22,8 @@ export * from './lib/components/dc-agent-card-lists/dc-agent-card-lists.componen
20
22
  export * from './lib/components/provider-selector/provider-selector.component';
21
23
  export * from './lib/models/agent.utils';
22
24
  export * from './lib/components/chat-container/chat-container.component';
23
- export * from './lib/components/text-highlighter/text-highlighter';
25
+ export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-content-displayer/message-content-displayer';
24
26
  export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils';
25
- export * from './lib/components/chat-container/chat-messages-list/message-orchestrator/message-orchestrator.component';
27
+ export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-orchestrator.component';
26
28
  export * from './lib/utils/icons/extraction.regex';
27
29
  export * from './lib/components/chat-container/chat-settings/dc-conversation-userchat-settings.component';
@@ -1,29 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { ChatRole, MessageContent } from '../../../../models/agent.models';
3
- import { WordData } from '../../../../services/popup.service';
4
- import * as i0 from "@angular/core";
5
- export declare class MessageOrchestratorComponent implements OnInit {
6
- private conversationService;
7
- private userDataExchange;
8
- messages: import("@angular/core").InputSignal<MessageContent[]>;
9
- messageRole: import("@angular/core").InputSignal<ChatRole>;
10
- playAudio: import("@angular/core").OutputEmitterRef<MessageContent>;
11
- audioCompleted: import("@angular/core").OutputEmitterRef<MessageContent>;
12
- messagesSignal: import("@angular/core").WritableSignal<MessageContent[]>;
13
- private messagesEffect;
14
- private audioQueue;
15
- private isGenerating;
16
- private currentPlayingIndex;
17
- private preGenerationInProgress;
18
- ngOnInit(): void;
19
- private initializeAudioQueue;
20
- private processNextInQueue;
21
- private preGenerateNextIfNeeded;
22
- private generateAudioForIndex;
23
- onAudioCompleted(message: MessageContent): void;
24
- changeStates(index: number, messageAudio: MessageContent): void;
25
- generateAudio(message: MessageContent, overwriteText?: string | null): Promise<MessageContent>;
26
- onWordClicked(wordData: WordData): void;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageOrchestratorComponent, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageOrchestratorComponent, "dc-message-orchestrator", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "messageRole": { "alias": "messageRole"; "required": true; "isSignal": true; }; }, { "playAudio": "playAudio"; "audioCompleted": "audioCompleted"; }, never, never, true, never>;
29
- }
@@ -1,17 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare enum AgentCardProgressStatus {
3
- NotStarted = "not_started",
4
- Started = "started",
5
- Completed = "completed"
6
- }
7
- export interface AgentCardUserProgress {
8
- agentCardId: string;
9
- status: AgentCardProgressStatus;
10
- }
11
- export declare class AgentUserProgressService {
12
- private httpService;
13
- getProgress(): Promise<any>;
14
- saveProgress(progress: AgentCardUserProgress): Promise<any>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<AgentUserProgressService, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<AgentUserProgressService>;
17
- }
@@ -1,2 +0,0 @@
1
- import { ContextType, ChatMessage } from '../models/agent.models';
2
- export declare function getContextMessages(messages: ChatMessage[], contextType: ContextType): ChatMessage[];