@dataclouder/ngx-agent-cards 0.1.44 → 0.1.46

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.
@@ -2334,7 +2334,7 @@ class DynamicFlowTaskService {
2334
2334
  this.userService = inject(UserService);
2335
2335
  }
2336
2336
  async evaluateAssistantTaskTrigger(message) {
2337
- const userChatSettings = this.userService.user().settings.conversation?.assistantMessageTask;
2337
+ const userChatSettings = this.userService.user()?.settings?.conversation?.assistantMessageTask;
2338
2338
  if (!userChatSettings) {
2339
2339
  return;
2340
2340
  }
@@ -2363,7 +2363,7 @@ class DynamicFlowTaskService {
2363
2363
  // TODO probably i need a different method for the goal.
2364
2364
  this.evaluationService.evaluateGoal(goal);
2365
2365
  // 2) Run User Trigger Evaluation only if user allows it
2366
- const chatUserSettings = this.userService.user().settings.conversation;
2366
+ const chatUserSettings = this.userService.user()?.settings?.conversation;
2367
2367
  if (chatUserSettings?.userMessageTask) {
2368
2368
  const userTriggerTask = conversationFlow.triggerTasks.onUserMessage;
2369
2369
  // TODO: Siento MUY Forzado el utilizar evaluateConversation, ese es del goal, pero lo quize hacer general!
@@ -2442,7 +2442,7 @@ class ConversationService {
2442
2442
  this.isDestroyedSignal.set(value);
2443
2443
  }
2444
2444
  overrideSettingsByUserSettings(conversationSettings) {
2445
- const userSettings = this.userService.user().settings.conversation;
2445
+ const userSettings = this.userService.user()?.settings?.conversation;
2446
2446
  if (userSettings?.model?.provider) {
2447
2447
  conversationSettings.model = userSettings.model;
2448
2448
  }
@@ -2633,7 +2633,7 @@ class ConversationService {
2633
2633
  this.messagesStateService.clearMessages();
2634
2634
  }
2635
2635
  async getTTSFile(message) {
2636
- const userChatSettings = await this.userService.user().settings.conversation;
2636
+ const userChatSettings = await this.userService.user()?.settings?.conversation;
2637
2637
  const ttsRequest = buildObjectTTSRequest(message, userChatSettings);
2638
2638
  return this.ttsService.getTextAudioFile(ttsRequest);
2639
2639
  }
@@ -3297,8 +3297,8 @@ class MessageOrchestrationService {
3297
3297
  this.messages.set([...messages]);
3298
3298
  this.messageRole.set(role);
3299
3299
  if (role === ChatRole.Assistant) {
3300
- const chatSettings = this.userService.user().settings.conversation;
3301
- if (chatSettings.synthVoice) {
3300
+ const chatSettings = this.userService.user()?.settings?.conversation;
3301
+ if (chatSettings?.synthVoice) {
3302
3302
  this.initializeAudioQueue();
3303
3303
  this.processNextInQueue();
3304
3304
  }
@@ -3855,7 +3855,7 @@ class DCChatComponent {
3855
3855
  this.chatMonitorService = inject(ChatMonitorService);
3856
3856
  this.userService = inject(UserService);
3857
3857
  // 📥 Inputs
3858
- this.chatUserSettings = this.userService.user().settings.conversation; // Default to user data exchange
3858
+ this.chatUserSettings = this.userService.user()?.settings?.conversation; // Default to user data exchange
3859
3859
  this.conversationFlow = null;
3860
3860
  // 📤 Input Signals
3861
3861
  this.parseDict = input({}, ...(ngDevMode ? [{ debugName: "parseDict" }] : []));
@@ -5345,14 +5345,15 @@ class AgentCardUI {
5345
5345
  this.showOptions = input(true, ...(ngDevMode ? [{ debugName: "showOptions" }] : []));
5346
5346
  this.onAction = output();
5347
5347
  this.agentCardsMasterStateService = inject(AGENT_CARDS_STATE_SERVICE);
5348
+ effect(() => {
5349
+ this.getTaken();
5350
+ });
5348
5351
  }
5349
5352
  ngOnInit() {
5350
5353
  const description = this.card()?.characterCard?.data?.description;
5351
5354
  if (description) {
5352
5355
  // this.card()?.characterCard?.data?.description = description?.replace(/{{char}}/g, name);
5353
5356
  }
5354
- this.userService.isAdmin();
5355
- this.getTaken();
5356
5357
  }
5357
5358
  eventCard(eventType) {
5358
5359
  this.onAction.emit({ action: eventType, item: this.card() });
@@ -5371,7 +5372,7 @@ class AgentCardUI {
5371
5372
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AgentCardUI, decorators: [{
5372
5373
  type: Component,
5373
5374
  args: [{ selector: 'dc-agent-card-ui', imports: [PopoverModule, TruncatePipe, ButtonModule, SpeedDialModule, CardModule, TagModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-card class=\"card-image\">\n @if(showOptions()) {\n <div style=\"position: absolute; top: 5px; right: 5px; z-index: 1000\">\n <p-speeddial\n [model]=\"speedDialModel\"\n [radius]=\"70\"\n type=\"quarter-circle\"\n direction=\"down-left\"\n [tooltipOptions]=\"{ tooltipPosition: 'top' }\"\n [buttonProps]=\"{ severity: 'primary', rounded: true, outlined: true, raised: true }\" />\n </div>\n }\n\n <img [src]=\"card()?.assets?.image?.url || 'assets/defaults/images/default_conversation_card.webp'\" alt=\"\" />\n\n <div (click)=\"eventCard(eventType.Select)\" class=\"content\">\n <p class=\"text-xl font-bold text-shadow-lg/30\">{{ card()?.name || card()?.title }}</p>\n\n <p style=\"margin-top: 40px\">\n <span class=\"title text-shadow-lg/30\" [innerHTML]=\"card().description || card().characterCard?.data?.creator_notes | truncate : 200\"></span>\n </p>\n\n <div style=\"position: absolute; bottom: 10px; left: 10px\">\n @if(isTaken()){\n <p-tag icon=\"pi pi-check-circle\" severity=\"success\" value=\"Tomada\" [rounded]=\"true\" />\n } @if(userService.isAdmin()){\n\n <p-tag icon=\"pi pi-eye\" severity=\"secondary\" [value]=\"card()?.manageable?.status || 'Sin estado'\" [rounded]=\"true\" />\n }\n </div>\n\n <p-button\n (click)=\"eventCard(eventType.Select); $event.stopPropagation()\"\n [style]=\"{ position: 'absolute', bottom: '10px', right: '10px' }\"\n icon=\"pi pi-comment\"\n [rounded]=\"true\"\n severity=\"info\"\n [outlined]=\"true\"\n [raised]=\"true\" />\n </div>\n</p-card>\n", styles: [":host{display:block}:host ::ng-deep .p-card{height:100%}:host ::ng-deep .p-card-body{height:100%;padding:0!important}.card-image{width:280px;height:380px;position:relative;align-items:center;display:block;padding:-10px}.card-image img{position:absolute;z-index:3;width:100%;height:100%;opacity:.75;object-fit:cover;transition:opacity .5s}.content{position:absolute;inset:0;z-index:4;padding:1rem;color:#fff;background:linear-gradient(to bottom,#0003,#0000001a);height:100%;display:flex;flex-direction:column;justify-content:space-between}.content:hover{background:linear-gradient(to bottom,color-mix(in srgb,var(--p-primary-color) 20%,transparent),color-mix(in srgb,black 10%,transparent));cursor:pointer}\n"] }]
5374
- }] });
5375
+ }], ctorParameters: () => [] });
5375
5376
 
5376
5377
  // This component contains a really avanced strategy to dinamically render Conversation Cards Details so every app can implement it with their own Style and Behavior
5377
5378
  // The trick is use NGFOR with ngComponentOutlet and pass input, problem is, is not possible to get Outpus events, Option one is use injector with ngComponentOutlet and pass context function to handle , but somehow it inject html and due to sanity im not able to see popups
@@ -5397,6 +5398,7 @@ class AgentCardListComponent extends EntityBaseListComponent {
5397
5398
  this.customFilters = [];
5398
5399
  this.filterConfig.returnProps = {
5399
5400
  _id: 1,
5401
+ name: 1,
5400
5402
  title: 1,
5401
5403
  assets: 1,
5402
5404
  description: 1,