@dataclouder/ngx-agent-cards 0.2.8 → 0.2.10

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.8",
3
+ "version": "0.2.10",
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';
@@ -180,6 +181,7 @@ interface IConversationRule {
180
181
  name?: string;
181
182
  description?: string;
182
183
  rule?: string;
184
+ type?: string | null;
183
185
  auditable?: IAuditable;
184
186
  }
185
187
 
@@ -390,11 +392,25 @@ interface IMoodStateRuntime {
390
392
  intensity: number;
391
393
  observation?: string;
392
394
  }
395
+ interface IObserverConfig {
396
+ name: string;
397
+ mascotId: string;
398
+ avatarSvgRaw?: string;
399
+ avatarUrl?: string;
400
+ themeColorClass?: string;
401
+ sounds?: {
402
+ intervention?: string;
403
+ };
404
+ }
405
+ interface IInterventionState {
406
+ severity: 'grave' | 'warning' | 'info' | 'none';
407
+ message?: string;
408
+ suggestedCorrection?: string;
409
+ }
393
410
  interface IConversationFlowState {
394
411
  goal: {
395
412
  value: any;
396
413
  deltaPoints?: number;
397
- feedback?: string;
398
414
  };
399
415
  challenges: {
400
416
  name: string;
@@ -403,6 +419,7 @@ interface IConversationFlowState {
403
419
  moodState: {
404
420
  value: any;
405
421
  };
422
+ intervention?: IInterventionState;
406
423
  }
407
424
  declare enum EAgentType {
408
425
  None,
@@ -967,6 +984,7 @@ interface IBackgroundService {
967
984
  }
968
985
  declare const VIDEO_PLAYER_SERVICE_TOKEN: InjectionToken<IVideoPlayerService>;
969
986
  declare const BACKGROUND_SERVICE_TOKEN: InjectionToken<IBackgroundService>;
987
+ declare const CHAT_OBSERVER_CONFIG: InjectionToken<IObserverConfig>;
970
988
 
971
989
  declare class VideoPlayerService implements OnDestroy {
972
990
  private conversationFlowStateService;
@@ -1055,12 +1073,31 @@ declare class ConversationFlowStateService {
1055
1073
  */
1056
1074
  flowState: _angular_core.WritableSignal<IConversationFlowState>;
1057
1075
  currentMood: _angular_core.Signal<any>;
1076
+ /**
1077
+ * @description
1078
+ * UI-only flag (no viene del LLM): el usuario abrió manualmente la intervención
1079
+ * pasiva (no-grave) haciendo click en la pluma. Se resetea en cada turno.
1080
+ */
1081
+ private passiveOpened;
1082
+ /**
1083
+ * @description
1084
+ * Modo de presentación de la intervención del turno actual:
1085
+ * - 'grave' => overlay automático y bloqueante
1086
+ * - 'passive' => hay corrección suave; la pluma es clickeable, el usuario decide
1087
+ * - 'none' => nada que mostrar
1088
+ */
1089
+ interventionMode: _angular_core.Signal<"grave" | "none" | "passive">;
1090
+ /** El overlay (mismo para grave y pasivo) se ve si es grave o si el usuario lo abrió. */
1091
+ showIntervention: _angular_core.Signal<boolean>;
1092
+ /** Pausa los controles solo mientras el overlay está visible. */
1093
+ isPaused: _angular_core.Signal<boolean>;
1094
+ /** True cuando hay una corrección pasiva disponible: hace la pluma clickeable. */
1095
+ hasPassiveHint: _angular_core.Signal<boolean>;
1058
1096
  private moodUpdated;
1059
1097
  moodUpdated$: rxjs.Observable<string>;
1060
1098
  private goalEvaluationUpdated;
1061
1099
  goalEvaluationUpdated$: rxjs.Observable<{
1062
1100
  deltaPoints: number;
1063
- feedback?: string;
1064
1101
  }>;
1065
1102
  constructor();
1066
1103
  /**
@@ -1075,6 +1112,12 @@ declare class ConversationFlowStateService {
1075
1112
  * @param newState A partial `IConversationFlowState` object containing the new values.
1076
1113
  */
1077
1114
  updateState(newState: Partial<IConversationFlowState>): void;
1115
+ /**
1116
+ * @description
1117
+ * El usuario decide abrir la intervención pasiva (no-grave) — típicamente al hacer
1118
+ * click en la pluma mientras cae/flota. Muestra el mismo overlay que el grave.
1119
+ */
1120
+ openPassiveIntervention(): void;
1078
1121
  /**
1079
1122
  * @description
1080
1123
  * Updates the goal state, typically to reflect progress.
@@ -1104,6 +1147,12 @@ declare class ConversationFlowStateService {
1104
1147
  name: string;
1105
1148
  value: any;
1106
1149
  }>): void;
1150
+ /**
1151
+ * @description
1152
+ * Resets the active intervention state back to inactive.
1153
+ * This is called by the UI when the user acknowledges the intervention.
1154
+ */
1155
+ clearIntervention(): void;
1107
1156
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConversationFlowStateService, never>;
1108
1157
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ConversationFlowStateService>;
1109
1158
  }
@@ -1213,6 +1262,7 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1213
1262
  conversationSettings: IConversationSettings;
1214
1263
  conversationFlow: IConversationFlow | null;
1215
1264
  agentCard: IAgentCard;
1265
+ observerConfig?: IObserverConfig;
1216
1266
  readonly parseDict: _angular_core.InputSignal<{
1217
1267
  [key: string]: string;
1218
1268
  }>;
@@ -1239,7 +1289,7 @@ declare class DCChatComponent implements OnInit, OnDestroy {
1239
1289
  restartConversation(conversation?: IAgentCard | null): Promise<void>;
1240
1290
  complete(): void;
1241
1291
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DCChatComponent, never>;
1242
- 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>;
1292
+ 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>;
1243
1293
  }
1244
1294
 
1245
1295
  declare class PolitoNotificationComponent implements OnInit, OnDestroy {
@@ -1247,14 +1297,19 @@ declare class PolitoNotificationComponent implements OnInit, OnDestroy {
1247
1297
  private agentCardStateService;
1248
1298
  notification: _angular_core.WritableSignal<{
1249
1299
  points: number;
1250
- feedback: string;
1251
1300
  }>;
1252
1301
  isHiding: _angular_core.WritableSignal<boolean>;
1302
+ isClickable: _angular_core.Signal<boolean>;
1253
1303
  private subscription;
1254
1304
  private hideTimeout;
1255
1305
  private animTimeout;
1256
1306
  ngOnInit(): void;
1257
1307
  ngOnDestroy(): void;
1308
+ /**
1309
+ * El usuario hace click en la pluma (cayendo o flotando) para abrir la intervención
1310
+ * pasiva. Solo tiene efecto si hay una corrección suave disponible este turno.
1311
+ */
1312
+ onPlumaClick(): void;
1258
1313
  private showNotification;
1259
1314
  private clearTimeouts;
1260
1315
  getPointsText(points: number): string;
@@ -1263,6 +1318,20 @@ declare class PolitoNotificationComponent implements OnInit, OnDestroy {
1263
1318
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PolitoNotificationComponent, "dc-polito-notification", never, {}, {}, never, never, true, never>;
1264
1319
  }
1265
1320
 
1321
+ declare class DcObserverInterventionComponent {
1322
+ private flowStateService;
1323
+ private sanitizer;
1324
+ customConfig?: IObserverConfig;
1325
+ private diConfig;
1326
+ intervention: _angular_core.Signal<_dataclouder_ngx_agent_cards.IInterventionState>;
1327
+ isActive: _angular_core.Signal<boolean>;
1328
+ config: _angular_core.Signal<IObserverConfig>;
1329
+ safeSvg: _angular_core.Signal<SafeHtml>;
1330
+ handleAcknowledge(): void;
1331
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcObserverInterventionComponent, never>;
1332
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcObserverInterventionComponent, "dc-observer-intervention", never, { "customConfig": { "alias": "customConfig"; "required": false; }; }, {}, never, never, true, never>;
1333
+ }
1334
+
1266
1335
  interface DCAgentFormSettings {
1267
1336
  converseRoute?: any[] | ((entityId: string) => any[]);
1268
1337
  }
@@ -1422,12 +1491,16 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1422
1491
  videoPlayerService: VideoPlayerNativeService;
1423
1492
  agentCardId: string;
1424
1493
  useNativePlayer: boolean;
1494
+ private _isConversationActive;
1495
+ set isConversationActive(val: boolean);
1496
+ get isConversationActive(): boolean;
1425
1497
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
1426
1498
  videoPlayerA: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1427
1499
  videoPlayerB: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1428
1500
  agentCard: _angular_core.WritableSignal<IAgentCard>;
1429
1501
  showInfoLayer: _angular_core.WritableSignal<boolean>;
1430
1502
  isTransparent: _angular_core.Signal<boolean>;
1503
+ isChatActive: _angular_core.Signal<boolean>;
1431
1504
  constructor();
1432
1505
  ngOnDestroy(): void;
1433
1506
  ngOnInit(): Promise<void>;
@@ -1436,7 +1509,7 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1436
1509
  startConversation(): void;
1437
1510
  toggleInfoLayer(): void;
1438
1511
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardConverseComponent, never>;
1439
- 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>;
1512
+ 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>;
1440
1513
  }
1441
1514
 
1442
1515
  declare class DcAgentCardDetailComponent extends EntityBaseDetailComponent<IAgentCard> {
@@ -1820,5 +1893,5 @@ declare class ChatEngineTestComponent {
1820
1893
 
1821
1894
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
1822
1895
 
1823
- 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 };
1824
- 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 };
1896
+ 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 };
1897
+ 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 };