@dataclouder/ngx-agent-cards 0.2.14 → 0.2.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-agent-cards",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -433,6 +433,14 @@ interface VoiceCloning {
433
433
  transcription: string;
434
434
  main: VoiceTTS;
435
435
  }
436
+ interface IAgentVoiceSettings {
437
+ main?: VoiceTTS;
438
+ secondary?: VoiceTTS;
439
+ cloning?: {
440
+ sample?: AudioStorage;
441
+ transcription?: string;
442
+ };
443
+ }
436
444
  declare enum AgenticEngine {
437
445
  SERVER_SDK = "server_sdk",// Loop ReAct local del backend (Vercel AI SDK)
438
446
  OS_HERMES = "os_hermes"
@@ -471,6 +479,7 @@ interface IAgentCard {
471
479
  learnable?: ILearnable;
472
480
  auditable?: IAuditable;
473
481
  voiceCloning?: VoiceCloning;
482
+ voice?: IAgentVoiceSettings;
474
483
  agenticConfig?: IAgenticConfig;
475
484
  metaApp?: IAgentMetadata;
476
485
  live2d?: any;
@@ -612,7 +621,8 @@ declare enum ConversationEvents {
612
621
  declare enum ChatEventType {
613
622
  WordClicked = "wordClicked",
614
623
  MoodDetected = "moodDetected",
615
- AudioStarted = "audioStarted"
624
+ AudioStarted = "audioStarted",
625
+ AudioStopped = "audioStopped"
616
626
  }
617
627
  interface ChatEvent<T = any> {
618
628
  type: ChatEventType;
@@ -923,17 +933,23 @@ declare class ContextEngineService {
923
933
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ContextEngineService>;
924
934
  }
925
935
 
936
+ interface AudioStatusUpdate {
937
+ message: MessageContent;
938
+ status: AudioStatus;
939
+ }
926
940
  declare class ChatMonitorService {
927
941
  constructor();
928
- private readonly messageAudioWillPlay;
929
- readonly messageAudioWillPlay$: _angular_core.Signal<MessageContent>;
930
- currentMood: _angular_core.WritableSignal<string[]>;
942
+ readonly activeAudioMessage: _angular_core.WritableSignal<MessageContent>;
943
+ currentMood: _angular_core.WritableSignal<string>;
931
944
  isConversationActive: _angular_core.WritableSignal<boolean>;
932
- logMessageAudioWillPlay(message: MessageContent): void;
933
- logCurrentMood(mood: string[]): void;
945
+ logCurrentMood(mood: string | null): void;
934
946
  cleanMonitorVars(): void;
935
947
  readonly backgroundUrl: _angular_core.WritableSignal<string>;
936
948
  setBackground(imageUrl: string | undefined): void;
949
+ readonly messageAudioWillPlay$: _angular_core.WritableSignal<MessageContent>;
950
+ readonly messageAudioStatus$: _angular_core.WritableSignal<AudioStatusUpdate>;
951
+ logMessageAudioWillPlay(message: MessageContent): void;
952
+ logMessageAudioStatus(message: MessageContent, status: AudioStatus): void;
937
953
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatMonitorService, never>;
938
954
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ChatMonitorService>;
939
955
  }
@@ -1002,7 +1018,6 @@ declare function provideLive2D(config: Live2DConfig): {
1002
1018
  };
1003
1019
 
1004
1020
  declare class VideoPlayerService implements OnDestroy {
1005
- private conversationFlowStateService;
1006
1021
  private player;
1007
1022
  private videoElement;
1008
1023
  private useNativePlayer;
@@ -1011,7 +1026,6 @@ declare class VideoPlayerService implements OnDestroy {
1011
1026
  private videoQueue;
1012
1027
  private defaultVideoUrl;
1013
1028
  private playAndRewindedSubscription;
1014
- private moodSubscription;
1015
1029
  private playAndRewindedSource;
1016
1030
  playAndRewinded$: rxjs.Observable<void>;
1017
1031
  agentCard: _angular_core.WritableSignal<IAgentCard>;
@@ -1036,14 +1050,12 @@ declare class VideoPlayerService implements OnDestroy {
1036
1050
  }
1037
1051
 
1038
1052
  declare class VideoPlayerNativeService implements OnDestroy {
1039
- private conversationFlowStateService;
1040
1053
  private videoA;
1041
1054
  private videoB;
1042
1055
  private activeVideo;
1043
1056
  private inactiveVideo;
1044
1057
  private videoQueue;
1045
1058
  private defaultVideoUrl;
1046
- private moodSubscription;
1047
1059
  private onVideoEndedBound;
1048
1060
  private pendingPlayingHandler;
1049
1061
  private pendingPlayingTarget;
@@ -1080,6 +1092,7 @@ declare class VideoPlayerNativeService implements OnDestroy {
1080
1092
  * `IConversationFlow` configuration that defines the rules of the flow.
1081
1093
  */
1082
1094
  declare class ConversationFlowStateService {
1095
+ private chatMonitorService;
1083
1096
  private readonly initialState;
1084
1097
  /**
1085
1098
  * @description
@@ -1260,7 +1273,6 @@ declare class EvaluationService {
1260
1273
  }
1261
1274
 
1262
1275
  declare class DCChatComponent implements OnInit, OnDestroy {
1263
- private moodSubscription;
1264
1276
  private injector;
1265
1277
  private userService;
1266
1278
  private dialogService;
@@ -1281,7 +1293,9 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1281
1293
  readonly parseDict: _angular_core.InputSignal<{
1282
1294
  [key: string]: string;
1283
1295
  }>;
1296
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1284
1297
  readonly chatEvent: _angular_core.OutputEmitterRef<ChatEvent<any>>;
1298
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1285
1299
  readonly goalCompleted: _angular_core.OutputEmitterRef<void>;
1286
1300
  viewMode: _angular_core.WritableSignal<"chat" | "immersive">;
1287
1301
  micSettings: MicSettings;
@@ -1400,8 +1414,6 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1400
1414
  userMustStart: _angular_forms.FormControl<boolean>;
1401
1415
  streamResponses: _angular_forms.FormControl<boolean>;
1402
1416
  displayMode: _angular_forms.FormControl<string>;
1403
- mainVoice: _angular_forms.FormGroup<any>;
1404
- secondaryVoice: _angular_forms.FormGroup<any>;
1405
1417
  model: _angular_forms.FormGroup<{
1406
1418
  quality: _angular_forms.FormControl<_dataclouder_ngx_core.EModelQuality>;
1407
1419
  modelName: _angular_forms.FormControl<string>;
@@ -1434,7 +1446,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1434
1446
  takenCount: _angular_forms.FormControl<number | null>;
1435
1447
  tags: FormArray<_angular_forms.FormControl<string | null>>;
1436
1448
  }>;
1437
- voiceCloning: _angular_forms.FormGroup<any>;
1449
+ voice: _angular_forms.FormGroup<any>;
1438
1450
  agenticConfig: _angular_forms.FormGroup<{
1439
1451
  enabled: _angular_forms.FormControl<boolean>;
1440
1452
  engine: _angular_forms.FormControl<AgenticEngine>;
@@ -1562,7 +1574,7 @@ declare class Live2dModelComponent implements AfterViewInit {
1562
1574
  volume?: number;
1563
1575
  crossOrigin?: string;
1564
1576
  focus?: boolean;
1565
- }): void;
1577
+ }): Promise<void>;
1566
1578
  stopSpeaking(): void;
1567
1579
  updateModelParameter(event: {
1568
1580
  id: string;
@@ -1583,7 +1595,7 @@ declare class Live2dModelComponent implements AfterViewInit {
1583
1595
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<Live2dModelComponent, "app-live2d-model", never, { "modelPath": { "alias": "modelPath"; "required": true; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "x": { "alias": "x"; "required": false; "isSignal": true; }; "y": { "alias": "y"; "required": false; "isSignal": true; }; }, { "modelLoaded": "modelLoaded"; "viewStateChanged": "viewStateChanged"; }, never, never, true, never>;
1584
1596
  }
1585
1597
 
1586
- declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1598
+ declare class DcAgentCardAvatarComponent implements OnInit, OnDestroy {
1587
1599
  private agentCardService;
1588
1600
  private route;
1589
1601
  private toastService;
@@ -1593,10 +1605,10 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1593
1605
  videoPlayerService: VideoPlayerNativeService;
1594
1606
  agentCardId: string;
1595
1607
  useNativePlayer: boolean;
1596
- activeAudioMessage: MessageContent | null;
1597
1608
  private _isConversationActive;
1598
1609
  set isConversationActive(val: boolean);
1599
1610
  get isConversationActive(): boolean;
1611
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1600
1612
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
1601
1613
  videoPlayerA: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1602
1614
  videoPlayerB: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
@@ -1622,8 +1634,8 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1622
1634
  private _transformVoice;
1623
1635
  startConversation(): void;
1624
1636
  toggleInfoLayer(): void;
1625
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardConverseComponent, never>;
1626
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardConverseComponent, "dc-agent-card-converse", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; "useNativePlayer": { "alias": "useNativePlayer"; "required": false; }; "activeAudioMessage": { "alias": "activeAudioMessage"; "required": false; }; "isConversationActive": { "alias": "isConversationActive"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
1637
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardAvatarComponent, never>;
1638
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardAvatarComponent, "dc-agent-card-avatar", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; "useNativePlayer": { "alias": "useNativePlayer"; "required": false; }; "isConversationActive": { "alias": "isConversationActive"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
1627
1639
  }
1628
1640
 
1629
1641
  declare class DcAgentCardDetailComponent extends EntityBaseDetailComponent<IAgentCard> {
@@ -1799,8 +1811,12 @@ declare function buildObjectTTSRequest(message: MessageContent, settings?: ChatU
1799
1811
  * This component orchestrates the display and audio playback of chat messages.
1800
1812
  * It uses the `MessageOrchestrationService` to manage the message queue and audio playback.
1801
1813
  *
1814
+ * Children (`MessageContentReactive`) inject the same `MessageOrchestrationService`
1815
+ * instance directly and report their state to it, so this component no longer needs
1816
+ * to relay per-segment audio events via `@Output()`.
1817
+ *
1802
1818
  * @see MessageOrchestrationService
1803
- * @see MessageContentDisplayer
1819
+ * @see MessageContentReactive
1804
1820
  */
1805
1821
  declare class ChatMessageOrchestratorComponent {
1806
1822
  private orchestrationService;
@@ -1818,31 +1834,6 @@ declare class ChatMessageOrchestratorComponent {
1818
1834
  audioCompleted: _angular_core.OutputEmitterRef<MessageContent>;
1819
1835
  messagesSignal: _angular_core.Signal<MessageContent[]>;
1820
1836
  constructor();
1821
- /**
1822
- * @description
1823
- * Handles the `audioCompleted` event from the `MessageContentDisplayer`.
1824
- *
1825
- * @param message - The `MessageContent` object whose audio has finished playing.
1826
- */
1827
- onAudioCompleted(message: MessageContent): void;
1828
- /**
1829
- * @description
1830
- * Handles the `audioStatusChanged` event from the `MessageContentDisplayer`.
1831
- *
1832
- * @param event - The event object containing the `MessageContent` and its new `AudioStatus`.
1833
- * @param index - The index of the message in the array.
1834
- */
1835
- onAudioStatusChanged(event: {
1836
- message: MessageContent;
1837
- status: AudioStatus;
1838
- }, index: number): void;
1839
- /**
1840
- * @description
1841
- * Handles the `wordClicked` event from the `MessageContentDisplayer`.
1842
- *
1843
- * @param wordData - The `WordData` object containing information about the clicked word.
1844
- */
1845
- onWordClicked(wordData: WordData): void;
1846
1837
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatMessageOrchestratorComponent, never>;
1847
1838
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatMessageOrchestratorComponent, "dc-message-orchestrator", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "messageRole": { "alias": "messageRole"; "required": true; "isSignal": true; }; }, { "audioCompleted": "audioCompleted"; }, never, never, true, never>;
1848
1839
  }
@@ -2007,5 +1998,5 @@ declare class ChatEngineTestComponent {
2007
1998
 
2008
1999
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
2009
2000
 
2010
- export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AgenticEngine, AgenticPattern, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CHAT_OBSERVER_CONFIG, CONVERSATION_AI_TOKEN, CardRouteService, CardRoutesComponent, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationStatus, ConversationType$1 as ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardConverseComponent, DcAgentCardDetailComponent, DcObserverInterventionComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, LIVE2D_CONFIG, Live2dModelComponent, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PolitoNotificationComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerNativeService, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, XKillsAgentCardsService, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, provideLive2D, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
2011
- export type { Appearance, AudioGenerated, AudioStatus, BackgroundTask, CardTranslation, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DCAgentFormSettings, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, IAgenticConfig, IBackgroundService, ICardRoute, ICardRouteStep, IChallengeState, ICharacterCardDC, IConversationFlow, IConversationFlowState, IConversationSession, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, IGoalState, IInterventionState, IMoodState, IMoodStateRuntime, IObserverConfig, IRule, ISimpleAgent, ITTS, IVideoPlayerService, IWordMetadata, Live2DConfig, ModelFormGroup, ModelName, ModelParameters, ModelParts, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
2001
+ export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AgenticEngine, AgenticPattern, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CHAT_OBSERVER_CONFIG, CONVERSATION_AI_TOKEN, CardRouteService, CardRoutesComponent, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationStatus, ConversationType$1 as ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardAvatarComponent, DcAgentCardDetailComponent, DcObserverInterventionComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, LIVE2D_CONFIG, Live2dModelComponent, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PolitoNotificationComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerNativeService, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, XKillsAgentCardsService, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, provideLive2D, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
2002
+ export type { Appearance, AudioGenerated, AudioStatus, AudioStatusUpdate, BackgroundTask, CardTranslation, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DCAgentFormSettings, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, IAgentVoiceSettings, IAgenticConfig, IBackgroundService, ICardRoute, ICardRouteStep, IChallengeState, ICharacterCardDC, IConversationFlow, IConversationFlowState, IConversationSession, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, IGoalState, IInterventionState, IMoodState, IMoodStateRuntime, IObserverConfig, IRule, ISimpleAgent, ITTS, IVideoPlayerService, IWordMetadata, Live2DConfig, ModelFormGroup, ModelName, ModelParameters, ModelParts, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };