@dataclouder/ngx-agent-cards 0.2.13 → 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.13",
3
+ "version": "0.2.15",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -13,7 +13,6 @@ import * as _dataclouder_ngx_agent_cards from '@dataclouder/ngx-agent-cards';
13
13
  import { SafeHtml } from '@angular/platform-browser';
14
14
  import * as dist_dataclouder_ngx_knowledge_types_dataclouder_ngx_knowledge from 'dist/dataclouder/ngx-knowledge/types/dataclouder-ngx-knowledge';
15
15
  import { MenuItem } from 'primeng/api';
16
- import { Application } from 'pixi.js';
17
16
  import * as dist_dataclouder_ngx_core_types_dataclouder_ngx_core from 'dist/dataclouder/ngx-core/types/dataclouder-ngx-core';
18
17
  import * as _angular_router from '@angular/router';
19
18
  import { MasterStateService } from '@dataclouder/ngx-knowledge';
@@ -434,6 +433,14 @@ interface VoiceCloning {
434
433
  transcription: string;
435
434
  main: VoiceTTS;
436
435
  }
436
+ interface IAgentVoiceSettings {
437
+ main?: VoiceTTS;
438
+ secondary?: VoiceTTS;
439
+ cloning?: {
440
+ sample?: AudioStorage;
441
+ transcription?: string;
442
+ };
443
+ }
437
444
  declare enum AgenticEngine {
438
445
  SERVER_SDK = "server_sdk",// Loop ReAct local del backend (Vercel AI SDK)
439
446
  OS_HERMES = "os_hermes"
@@ -472,6 +479,7 @@ interface IAgentCard {
472
479
  learnable?: ILearnable;
473
480
  auditable?: IAuditable;
474
481
  voiceCloning?: VoiceCloning;
482
+ voice?: IAgentVoiceSettings;
475
483
  agenticConfig?: IAgenticConfig;
476
484
  metaApp?: IAgentMetadata;
477
485
  live2d?: any;
@@ -613,7 +621,8 @@ declare enum ConversationEvents {
613
621
  declare enum ChatEventType {
614
622
  WordClicked = "wordClicked",
615
623
  MoodDetected = "moodDetected",
616
- AudioStarted = "audioStarted"
624
+ AudioStarted = "audioStarted",
625
+ AudioStopped = "audioStopped"
617
626
  }
618
627
  interface ChatEvent<T = any> {
619
628
  type: ChatEventType;
@@ -924,17 +933,23 @@ declare class ContextEngineService {
924
933
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ContextEngineService>;
925
934
  }
926
935
 
936
+ interface AudioStatusUpdate {
937
+ message: MessageContent;
938
+ status: AudioStatus;
939
+ }
927
940
  declare class ChatMonitorService {
928
941
  constructor();
929
- private readonly messageAudioWillPlay;
930
- readonly messageAudioWillPlay$: _angular_core.Signal<MessageContent>;
931
- currentMood: _angular_core.WritableSignal<string[]>;
942
+ readonly activeAudioMessage: _angular_core.WritableSignal<MessageContent>;
943
+ currentMood: _angular_core.WritableSignal<string>;
932
944
  isConversationActive: _angular_core.WritableSignal<boolean>;
933
- logMessageAudioWillPlay(message: MessageContent): void;
934
- logCurrentMood(mood: string[]): void;
945
+ logCurrentMood(mood: string | null): void;
935
946
  cleanMonitorVars(): void;
936
947
  readonly backgroundUrl: _angular_core.WritableSignal<string>;
937
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;
938
953
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatMonitorService, never>;
939
954
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ChatMonitorService>;
940
955
  }
@@ -992,9 +1007,17 @@ interface IBackgroundService {
992
1007
  declare const VIDEO_PLAYER_SERVICE_TOKEN: InjectionToken<IVideoPlayerService>;
993
1008
  declare const BACKGROUND_SERVICE_TOKEN: InjectionToken<IBackgroundService>;
994
1009
  declare const CHAT_OBSERVER_CONFIG: InjectionToken<IObserverConfig>;
1010
+ interface Live2DConfig {
1011
+ PIXI: () => Promise<any>;
1012
+ Live2DModel: () => Promise<any>;
1013
+ }
1014
+ declare const LIVE2D_CONFIG: InjectionToken<Live2DConfig>;
1015
+ declare function provideLive2D(config: Live2DConfig): {
1016
+ provide: InjectionToken<Live2DConfig>;
1017
+ useValue: Live2DConfig;
1018
+ };
995
1019
 
996
1020
  declare class VideoPlayerService implements OnDestroy {
997
- private conversationFlowStateService;
998
1021
  private player;
999
1022
  private videoElement;
1000
1023
  private useNativePlayer;
@@ -1003,7 +1026,6 @@ declare class VideoPlayerService implements OnDestroy {
1003
1026
  private videoQueue;
1004
1027
  private defaultVideoUrl;
1005
1028
  private playAndRewindedSubscription;
1006
- private moodSubscription;
1007
1029
  private playAndRewindedSource;
1008
1030
  playAndRewinded$: rxjs.Observable<void>;
1009
1031
  agentCard: _angular_core.WritableSignal<IAgentCard>;
@@ -1028,14 +1050,12 @@ declare class VideoPlayerService implements OnDestroy {
1028
1050
  }
1029
1051
 
1030
1052
  declare class VideoPlayerNativeService implements OnDestroy {
1031
- private conversationFlowStateService;
1032
1053
  private videoA;
1033
1054
  private videoB;
1034
1055
  private activeVideo;
1035
1056
  private inactiveVideo;
1036
1057
  private videoQueue;
1037
1058
  private defaultVideoUrl;
1038
- private moodSubscription;
1039
1059
  private onVideoEndedBound;
1040
1060
  private pendingPlayingHandler;
1041
1061
  private pendingPlayingTarget;
@@ -1072,6 +1092,7 @@ declare class VideoPlayerNativeService implements OnDestroy {
1072
1092
  * `IConversationFlow` configuration that defines the rules of the flow.
1073
1093
  */
1074
1094
  declare class ConversationFlowStateService {
1095
+ private chatMonitorService;
1075
1096
  private readonly initialState;
1076
1097
  /**
1077
1098
  * @description
@@ -1252,7 +1273,6 @@ declare class EvaluationService {
1252
1273
  }
1253
1274
 
1254
1275
  declare class DCChatComponent implements OnInit, OnDestroy {
1255
- private moodSubscription;
1256
1276
  private injector;
1257
1277
  private userService;
1258
1278
  private dialogService;
@@ -1273,7 +1293,9 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1273
1293
  readonly parseDict: _angular_core.InputSignal<{
1274
1294
  [key: string]: string;
1275
1295
  }>;
1296
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1276
1297
  readonly chatEvent: _angular_core.OutputEmitterRef<ChatEvent<any>>;
1298
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1277
1299
  readonly goalCompleted: _angular_core.OutputEmitterRef<void>;
1278
1300
  viewMode: _angular_core.WritableSignal<"chat" | "immersive">;
1279
1301
  micSettings: MicSettings;
@@ -1392,8 +1414,6 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1392
1414
  userMustStart: _angular_forms.FormControl<boolean>;
1393
1415
  streamResponses: _angular_forms.FormControl<boolean>;
1394
1416
  displayMode: _angular_forms.FormControl<string>;
1395
- mainVoice: _angular_forms.FormGroup<any>;
1396
- secondaryVoice: _angular_forms.FormGroup<any>;
1397
1417
  model: _angular_forms.FormGroup<{
1398
1418
  quality: _angular_forms.FormControl<_dataclouder_ngx_core.EModelQuality>;
1399
1419
  modelName: _angular_forms.FormControl<string>;
@@ -1426,7 +1446,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1426
1446
  takenCount: _angular_forms.FormControl<number | null>;
1427
1447
  tags: FormArray<_angular_forms.FormControl<string | null>>;
1428
1448
  }>;
1429
- voiceCloning: _angular_forms.FormGroup<any>;
1449
+ voice: _angular_forms.FormGroup<any>;
1430
1450
  agenticConfig: _angular_forms.FormGroup<{
1431
1451
  enabled: _angular_forms.FormControl<boolean>;
1432
1452
  engine: _angular_forms.FormControl<AgenticEngine>;
@@ -1530,8 +1550,9 @@ declare class Live2dModelComponent implements AfterViewInit {
1530
1550
  x: number;
1531
1551
  y: number;
1532
1552
  }>;
1533
- app: Application;
1553
+ app: any;
1534
1554
  model: any;
1555
+ private live2dConfig;
1535
1556
  private modelParameters;
1536
1557
  private modelParts;
1537
1558
  private motionGroups;
@@ -1553,7 +1574,7 @@ declare class Live2dModelComponent implements AfterViewInit {
1553
1574
  volume?: number;
1554
1575
  crossOrigin?: string;
1555
1576
  focus?: boolean;
1556
- }): void;
1577
+ }): Promise<void>;
1557
1578
  stopSpeaking(): void;
1558
1579
  updateModelParameter(event: {
1559
1580
  id: string;
@@ -1574,7 +1595,7 @@ declare class Live2dModelComponent implements AfterViewInit {
1574
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>;
1575
1596
  }
1576
1597
 
1577
- declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1598
+ declare class DcAgentCardAvatarComponent implements OnInit, OnDestroy {
1578
1599
  private agentCardService;
1579
1600
  private route;
1580
1601
  private toastService;
@@ -1584,10 +1605,10 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1584
1605
  videoPlayerService: VideoPlayerNativeService;
1585
1606
  agentCardId: string;
1586
1607
  useNativePlayer: boolean;
1587
- activeAudioMessage: MessageContent | null;
1588
1608
  private _isConversationActive;
1589
1609
  set isConversationActive(val: boolean);
1590
1610
  get isConversationActive(): boolean;
1611
+ /** @deprecated Use ChatMonitorService instead — el canal oficial es el servicio compartido. */
1591
1612
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
1592
1613
  videoPlayerA: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1593
1614
  videoPlayerB: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
@@ -1613,8 +1634,8 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1613
1634
  private _transformVoice;
1614
1635
  startConversation(): void;
1615
1636
  toggleInfoLayer(): void;
1616
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardConverseComponent, never>;
1617
- 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>;
1618
1639
  }
1619
1640
 
1620
1641
  declare class DcAgentCardDetailComponent extends EntityBaseDetailComponent<IAgentCard> {
@@ -1790,8 +1811,12 @@ declare function buildObjectTTSRequest(message: MessageContent, settings?: ChatU
1790
1811
  * This component orchestrates the display and audio playback of chat messages.
1791
1812
  * It uses the `MessageOrchestrationService` to manage the message queue and audio playback.
1792
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
+ *
1793
1818
  * @see MessageOrchestrationService
1794
- * @see MessageContentDisplayer
1819
+ * @see MessageContentReactive
1795
1820
  */
1796
1821
  declare class ChatMessageOrchestratorComponent {
1797
1822
  private orchestrationService;
@@ -1809,31 +1834,6 @@ declare class ChatMessageOrchestratorComponent {
1809
1834
  audioCompleted: _angular_core.OutputEmitterRef<MessageContent>;
1810
1835
  messagesSignal: _angular_core.Signal<MessageContent[]>;
1811
1836
  constructor();
1812
- /**
1813
- * @description
1814
- * Handles the `audioCompleted` event from the `MessageContentDisplayer`.
1815
- *
1816
- * @param message - The `MessageContent` object whose audio has finished playing.
1817
- */
1818
- onAudioCompleted(message: MessageContent): void;
1819
- /**
1820
- * @description
1821
- * Handles the `audioStatusChanged` event from the `MessageContentDisplayer`.
1822
- *
1823
- * @param event - The event object containing the `MessageContent` and its new `AudioStatus`.
1824
- * @param index - The index of the message in the array.
1825
- */
1826
- onAudioStatusChanged(event: {
1827
- message: MessageContent;
1828
- status: AudioStatus;
1829
- }, index: number): void;
1830
- /**
1831
- * @description
1832
- * Handles the `wordClicked` event from the `MessageContentDisplayer`.
1833
- *
1834
- * @param wordData - The `WordData` object containing information about the clicked word.
1835
- */
1836
- onWordClicked(wordData: WordData): void;
1837
1837
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatMessageOrchestratorComponent, never>;
1838
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>;
1839
1839
  }
@@ -1998,5 +1998,5 @@ declare class ChatEngineTestComponent {
1998
1998
 
1999
1999
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
2000
2000
 
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, DcAgentCardConverseComponent, DcAgentCardDetailComponent, DcObserverInterventionComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, 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, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
2002
- 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, 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 };