@dataclouder/ngx-agent-cards 0.2.6 → 0.2.9

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.6",
3
+ "version": "0.2.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -10,6 +10,7 @@ import { UserService } from '@dataclouder/ngx-users';
10
10
  import * as rxjs from 'rxjs';
11
11
  import { MicSettings } from '@dataclouder/ngx-mic';
12
12
  import * as _dataclouder_ngx_agent_cards from '@dataclouder/ngx-agent-cards';
13
+ import { SafeHtml } from '@angular/platform-browser';
13
14
  import * as dist_dataclouder_ngx_knowledge_types_dataclouder_ngx_knowledge from 'dist/dataclouder/ngx-knowledge/types/dataclouder-ngx-knowledge';
14
15
  import { MenuItem } from 'primeng/api';
15
16
  import * as dist_dataclouder_ngx_core_types_dataclouder_ngx_core from 'dist/dataclouder/ngx-core/types/dataclouder-ngx-core';
@@ -293,6 +294,7 @@ interface IConversationSettings {
293
294
  type IConversationSettingsDTO = Partial<IConversationSettings> & {
294
295
  returnJson?: boolean;
295
296
  type?: string;
297
+ agentCardId?: string;
296
298
  };
297
299
  interface IAgentResponseDTO {
298
300
  role: ChatRole;
@@ -389,11 +391,25 @@ interface IMoodStateRuntime {
389
391
  intensity: number;
390
392
  observation?: string;
391
393
  }
394
+ interface IObserverConfig {
395
+ name: string;
396
+ mascotId: string;
397
+ avatarSvgRaw?: string;
398
+ avatarUrl?: string;
399
+ themeColorClass?: string;
400
+ sounds?: {
401
+ intervention?: string;
402
+ };
403
+ }
404
+ interface IInterventionState {
405
+ severity: 'grave' | 'warning' | 'info' | 'none';
406
+ message?: string;
407
+ suggestedCorrection?: string;
408
+ }
392
409
  interface IConversationFlowState {
393
410
  goal: {
394
411
  value: any;
395
412
  deltaPoints?: number;
396
- feedback?: string;
397
413
  };
398
414
  challenges: {
399
415
  name: string;
@@ -402,6 +418,7 @@ interface IConversationFlowState {
402
418
  moodState: {
403
419
  value: any;
404
420
  };
421
+ intervention?: IInterventionState;
405
422
  }
406
423
  declare enum EAgentType {
407
424
  None,
@@ -966,6 +983,7 @@ interface IBackgroundService {
966
983
  }
967
984
  declare const VIDEO_PLAYER_SERVICE_TOKEN: InjectionToken<IVideoPlayerService>;
968
985
  declare const BACKGROUND_SERVICE_TOKEN: InjectionToken<IBackgroundService>;
986
+ declare const CHAT_OBSERVER_CONFIG: InjectionToken<IObserverConfig>;
969
987
 
970
988
  declare class VideoPlayerService implements OnDestroy {
971
989
  private conversationFlowStateService;
@@ -1054,12 +1072,31 @@ declare class ConversationFlowStateService {
1054
1072
  */
1055
1073
  flowState: _angular_core.WritableSignal<IConversationFlowState>;
1056
1074
  currentMood: _angular_core.Signal<any>;
1075
+ /**
1076
+ * @description
1077
+ * UI-only flag (no viene del LLM): el usuario abrió manualmente la intervención
1078
+ * pasiva (no-grave) haciendo click en la pluma. Se resetea en cada turno.
1079
+ */
1080
+ private passiveOpened;
1081
+ /**
1082
+ * @description
1083
+ * Modo de presentación de la intervención del turno actual:
1084
+ * - 'grave' => overlay automático y bloqueante
1085
+ * - 'passive' => hay corrección suave; la pluma es clickeable, el usuario decide
1086
+ * - 'none' => nada que mostrar
1087
+ */
1088
+ interventionMode: _angular_core.Signal<"grave" | "none" | "passive">;
1089
+ /** El overlay (mismo para grave y pasivo) se ve si es grave o si el usuario lo abrió. */
1090
+ showIntervention: _angular_core.Signal<boolean>;
1091
+ /** Pausa los controles solo mientras el overlay está visible. */
1092
+ isPaused: _angular_core.Signal<boolean>;
1093
+ /** True cuando hay una corrección pasiva disponible: hace la pluma clickeable. */
1094
+ hasPassiveHint: _angular_core.Signal<boolean>;
1057
1095
  private moodUpdated;
1058
1096
  moodUpdated$: rxjs.Observable<string>;
1059
1097
  private goalEvaluationUpdated;
1060
1098
  goalEvaluationUpdated$: rxjs.Observable<{
1061
1099
  deltaPoints: number;
1062
- feedback?: string;
1063
1100
  }>;
1064
1101
  constructor();
1065
1102
  /**
@@ -1074,6 +1111,12 @@ declare class ConversationFlowStateService {
1074
1111
  * @param newState A partial `IConversationFlowState` object containing the new values.
1075
1112
  */
1076
1113
  updateState(newState: Partial<IConversationFlowState>): void;
1114
+ /**
1115
+ * @description
1116
+ * El usuario decide abrir la intervención pasiva (no-grave) — típicamente al hacer
1117
+ * click en la pluma mientras cae/flota. Muestra el mismo overlay que el grave.
1118
+ */
1119
+ openPassiveIntervention(): void;
1077
1120
  /**
1078
1121
  * @description
1079
1122
  * Updates the goal state, typically to reflect progress.
@@ -1103,6 +1146,12 @@ declare class ConversationFlowStateService {
1103
1146
  name: string;
1104
1147
  value: any;
1105
1148
  }>): void;
1149
+ /**
1150
+ * @description
1151
+ * Resets the active intervention state back to inactive.
1152
+ * This is called by the UI when the user acknowledges the intervention.
1153
+ */
1154
+ clearIntervention(): void;
1106
1155
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConversationFlowStateService, never>;
1107
1156
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ConversationFlowStateService>;
1108
1157
  }
@@ -1212,6 +1261,7 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1212
1261
  conversationSettings: IConversationSettings;
1213
1262
  conversationFlow: IConversationFlow | null;
1214
1263
  agentCard: IAgentCard;
1264
+ observerConfig?: IObserverConfig;
1215
1265
  readonly parseDict: _angular_core.InputSignal<{
1216
1266
  [key: string]: string;
1217
1267
  }>;
@@ -1238,7 +1288,7 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1238
1288
  restartConversation(conversation?: IAgentCard | null): Promise<void>;
1239
1289
  complete(): void;
1240
1290
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DCChatComponent, never>;
1241
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "conversationFlow": { "alias": "conversationFlow"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "chatEvent": "chatEvent"; "goalCompleted": "goalCompleted"; }, never, never, true, never>;
1291
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "conversationFlow": { "alias": "conversationFlow"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "observerConfig": { "alias": "observerConfig"; "required": false; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "chatEvent": "chatEvent"; "goalCompleted": "goalCompleted"; }, never, never, true, never>;
1242
1292
  }
1243
1293
 
1244
1294
  declare class PolitoNotificationComponent implements OnInit, OnDestroy {
@@ -1246,14 +1296,19 @@ declare class PolitoNotificationComponent implements OnInit, OnDestroy {
1246
1296
  private agentCardStateService;
1247
1297
  notification: _angular_core.WritableSignal<{
1248
1298
  points: number;
1249
- feedback: string;
1250
1299
  }>;
1251
1300
  isHiding: _angular_core.WritableSignal<boolean>;
1301
+ isClickable: _angular_core.Signal<boolean>;
1252
1302
  private subscription;
1253
1303
  private hideTimeout;
1254
1304
  private animTimeout;
1255
1305
  ngOnInit(): void;
1256
1306
  ngOnDestroy(): void;
1307
+ /**
1308
+ * El usuario hace click en la pluma (cayendo o flotando) para abrir la intervención
1309
+ * pasiva. Solo tiene efecto si hay una corrección suave disponible este turno.
1310
+ */
1311
+ onPlumaClick(): void;
1257
1312
  private showNotification;
1258
1313
  private clearTimeouts;
1259
1314
  getPointsText(points: number): string;
@@ -1262,6 +1317,20 @@ declare class PolitoNotificationComponent implements OnInit, OnDestroy {
1262
1317
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PolitoNotificationComponent, "dc-polito-notification", never, {}, {}, never, never, true, never>;
1263
1318
  }
1264
1319
 
1320
+ declare class DcObserverInterventionComponent {
1321
+ private flowStateService;
1322
+ private sanitizer;
1323
+ customConfig?: IObserverConfig;
1324
+ private diConfig;
1325
+ intervention: _angular_core.Signal<_dataclouder_ngx_agent_cards.IInterventionState>;
1326
+ isActive: _angular_core.Signal<boolean>;
1327
+ config: _angular_core.Signal<IObserverConfig>;
1328
+ safeSvg: _angular_core.Signal<SafeHtml>;
1329
+ handleAcknowledge(): void;
1330
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcObserverInterventionComponent, never>;
1331
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcObserverInterventionComponent, "dc-observer-intervention", never, { "customConfig": { "alias": "customConfig"; "required": false; }; }, {}, never, never, true, never>;
1332
+ }
1333
+
1265
1334
  interface DCAgentFormSettings {
1266
1335
  converseRoute?: any[] | ((entityId: string) => any[]);
1267
1336
  }
@@ -1421,12 +1490,16 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1421
1490
  videoPlayerService: VideoPlayerNativeService;
1422
1491
  agentCardId: string;
1423
1492
  useNativePlayer: boolean;
1493
+ private _isConversationActive;
1494
+ set isConversationActive(val: boolean);
1495
+ get isConversationActive(): boolean;
1424
1496
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
1425
1497
  videoPlayerA: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1426
1498
  videoPlayerB: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1427
1499
  agentCard: _angular_core.WritableSignal<IAgentCard>;
1428
1500
  showInfoLayer: _angular_core.WritableSignal<boolean>;
1429
1501
  isTransparent: _angular_core.Signal<boolean>;
1502
+ isChatActive: _angular_core.Signal<boolean>;
1430
1503
  constructor();
1431
1504
  ngOnDestroy(): void;
1432
1505
  ngOnInit(): Promise<void>;
@@ -1435,7 +1508,7 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1435
1508
  startConversation(): void;
1436
1509
  toggleInfoLayer(): void;
1437
1510
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardConverseComponent, never>;
1438
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardConverseComponent, "dc-agent-card-converse", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; "useNativePlayer": { "alias": "useNativePlayer"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
1511
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardConverseComponent, "dc-agent-card-converse", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; "useNativePlayer": { "alias": "useNativePlayer"; "required": false; }; "isConversationActive": { "alias": "isConversationActive"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
1439
1512
  }
1440
1513
 
1441
1514
  declare class DcAgentCardDetailComponent extends EntityBaseDetailComponent<IAgentCard> {
@@ -1819,5 +1892,5 @@ declare class ChatEngineTestComponent {
1819
1892
 
1820
1893
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
1821
1894
 
1822
- export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AgenticEngine, AgenticPattern, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, 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, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, 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 };
1823
- 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, IMoodState, IMoodStateRuntime, IRule, ISimpleAgent, ITTS, IVideoPlayerService, IWordMetadata, ModelFormGroup, ModelName, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
1895
+ 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, 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 };
1896
+ 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, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };