@dataclouder/ngx-agent-cards 0.1.50 → 0.1.52

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, inject, signal, computed, RendererFactory2, ApplicationRef, Injector, EnvironmentInjector, createComponent, ChangeDetectionStrategy, Component, output, Input, input, effect, ViewChild, DestroyRef, ElementRef, Pipe, ChangeDetectorRef, EventEmitter, Output } from '@angular/core';
3
3
  import * as i1 from '@dataclouder/ngx-core';
4
- import { MoodStateOptions, formatCamelCaseString, LANGUAGES, EntityCommunicationService, TOAST_ALERTS_TOKEN, AudioSpeed as AudioSpeed$1, LoadingBarService, EModelQuality, getLangDesc, AudioSpeedReverse, getSupportedLanguageOptions, FormUtilsService, EntityBaseFormComponent, DcManageableFormComponent, DcLearnableFormComponent, EntityBaseListComponent, DCFilterBarComponent, QuickTableComponent, EmptyStateComponent } from '@dataclouder/ngx-core';
4
+ import { MoodStateOptions, formatCamelCaseString, LANGUAGES, EntityCommunicationService, TOAST_ALERTS_TOKEN, AudioSpeed as AudioSpeed$1, LoadingBarService, EModelQuality, getLangDesc, AudioSpeedReverse, getSupportedLanguageOptions, FormUtilsService, EntityBaseFormComponent, DcManageableFormComponent, DcLearnableFormComponent, EntityBaseListComponent, DCFilterBarComponent, QuickTableComponent, EmptyStateComponent, SUPPORTED_LANGUAGES } from '@dataclouder/ngx-core';
5
5
  import { UserService } from '@dataclouder/ngx-users';
6
6
  import * as i2$1 from '@angular/common';
7
7
  import { DOCUMENT, CommonModule, DecimalPipe } from '@angular/common';
@@ -16,7 +16,7 @@ import * as i1$1 from 'primeng/table';
16
16
  import { TableModule } from 'primeng/table';
17
17
  import * as i2$2 from 'primeng/api';
18
18
  import * as i1$2 from '@angular/forms';
19
- import { FormControl, ReactiveFormsModule, FormBuilder, FormsModule, FormArray, FormGroup } from '@angular/forms';
19
+ import { FormControl, ReactiveFormsModule, FormBuilder, FormsModule, FormArray, FormGroup, Validators } from '@angular/forms';
20
20
  import { DCMicComponent, MicVadComponent } from '@dataclouder/ngx-mic';
21
21
  import * as i4 from 'primeng/textarea';
22
22
  import { TextareaModule } from 'primeng/textarea';
@@ -46,6 +46,7 @@ import { OverlayModule } from '@angular/cdk/overlay';
46
46
  import { PortalModule } from '@angular/cdk/portal';
47
47
  import * as i3$2 from 'primeng/inputtext';
48
48
  import { InputTextModule } from 'primeng/inputtext';
49
+ import * as i5$2 from 'primeng/message';
49
50
  import { MessageModule } from 'primeng/message';
50
51
  import * as i5$1 from 'primeng/dialog';
51
52
  import { DialogModule } from 'primeng/dialog';
@@ -1274,7 +1275,6 @@ class DefaultAgentCardsService extends EntityCommunicationService {
1274
1275
  await this.httpService.delete(`${Endpoints$1.AgentCard}/${id}`, 'primary');
1275
1276
  }
1276
1277
  async getConversationUserChatSettings() {
1277
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1278
1278
  const settings = this.userService.user()?.settings?.conversation;
1279
1279
  return settings;
1280
1280
  }
@@ -1300,11 +1300,8 @@ class DefaultAgentCardsService extends EntityCommunicationService {
1300
1300
  return this.httpService.post(`${Endpoints$1.AgentChat}`, conversationDto, 'primary');
1301
1301
  }
1302
1302
  async saveConversationUserChatSettings(newSettings) {
1303
- // TODO: deberia tener un metodo updateUserSettings() pero mientras tengo que pasar todo el objeto settings en vez de solo conversation
1304
1303
  const settings = { ...this.userService.user()?.settings };
1305
1304
  const conversation = newSettings;
1306
- // conversation.speed = AudioSpeedRating[conversation.speed ?? 3];
1307
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1308
1305
  settings.conversation = conversation;
1309
1306
  await this.userService.updatePartialUserServer({ id: this.userService.user()?.id, settings });
1310
1307
  this.toastService.success({ title: 'Listo', subtitle: 'Se actualizaron las configuraciones' });
@@ -1801,6 +1798,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
1801
1798
  function matchTranscription(originalText, transcription) {
1802
1799
  const result = [];
1803
1800
  const transcriptionMap = new Map();
1801
+ const finalPhrase = transcription.map((word) => word.word).join('');
1802
+ console.log(`finalPhrase -> : ${finalPhrase}, originalText: ${originalText}`);
1803
+ if (finalPhrase === originalText) {
1804
+ console.log('Iluminado perfector');
1805
+ }
1804
1806
  // Create a map of lowercase words to an array of their corresponding objects in transcription
1805
1807
  for (const obj of transcription) {
1806
1808
  const lowercaseWord = obj.word.trim().toLowerCase();
@@ -2186,11 +2188,15 @@ class EvaluationService {
2186
2188
  return;
2187
2189
  }
2188
2190
  if (!goalTask.task) {
2189
- goalTask.task = 'Evaluate this conversation the goal is keep the conversation on topic consistency.';
2191
+ // DEFAULT GOAL TASK if not provided... but should be provided.
2192
+ goalTask.task =
2193
+ 'Evaluate this conversation the goal is to keep the conversation on topic consistency. give me from 0 to 25 points, 0 is bad user message and 25 is very good user message.';
2190
2194
  }
2191
2195
  const evaluator = {
2192
2196
  task: goalTask.task,
2193
- expectedResponseType: 'Response should be in next JSON format: {"score": number, "text": string}, score is a number between 0 and 3, text is concrete feedback in less than 25 words.',
2197
+ expectedResponseType: `Response should be in next JSON format: {"score": number, "text": string},
2198
+ **score**: is a number it may be from 0 and 100, depending on user performance and instructions.
2199
+ **text**: is concrete feedback in less than 25 words.`,
2194
2200
  model: goalTask.model || { quality: EModelQuality.FAST },
2195
2201
  };
2196
2202
  const evaluationResult = await this.evaluateConversation(evaluator, ContextType.LastMessage, 'goal-evaluation');
@@ -2212,22 +2218,26 @@ class EvaluationService {
2212
2218
  const userDataString = this.contextEngineService.getUserData();
2213
2219
  // Create evaluation prompt
2214
2220
  let instructions = `
2215
- Please replay to this task:
2216
- ${task.task}
2221
+ User is having a conversation with an AI Assistant:
2222
+
2223
+ ## User Data:
2217
2224
  <UserData>
2218
- ${userDataString}
2225
+ ${userDataString}
2219
2226
  </UserData>
2220
- This is the conversation history:
2227
+
2228
+ ## Conversation history:
2221
2229
  <Context>
2222
- ${conversationMessagesString}
2230
+ ${conversationMessagesString}
2223
2231
  </Context>
2224
2232
 
2233
+ ## Your Task:
2234
+ ${task.task}
2225
2235
  `;
2226
2236
  if (task.expectedResponseType) {
2227
- instructions += `\nExpected response type: ${task.expectedResponseType}`;
2237
+ instructions += `\nAnalize conversation and respose score and feedback in the following format: ${task.expectedResponseType}`;
2228
2238
  }
2229
2239
  else {
2230
- instructions += `\nExpected response type: {"score": number, "text": string}`;
2240
+ instructions += `\nAnalize conversation and respose the following format: {"score": number, "text": string}`;
2231
2241
  }
2232
2242
  // Send evaluation request
2233
2243
  const evaluationMessages = [{ content: instructions, role: ChatRole.User }];
@@ -2240,7 +2250,7 @@ This is the conversation history:
2240
2250
  });
2241
2251
  // Extract JSON from response
2242
2252
  const jsonData = response.content;
2243
- jsonData.score = jsonData.score * 10;
2253
+ jsonData.score = jsonData.score;
2244
2254
  this.evaluationResultSignal.set(jsonData);
2245
2255
  return jsonData;
2246
2256
  }
@@ -2470,9 +2480,24 @@ class ConversationService {
2470
2480
  this.conversationSettingsState.set(conversationSettings);
2471
2481
  // 🙄 Puede que no me sirva esta estrategía, mezcla agentCard.conversationFlow con appConversationFlow, pero le da prioridad a agent card, si no existe toma el default
2472
2482
  // La otra estretegía es: tomar solo agentCard o appConversationFlow, pero no ambos
2473
- const mergedConversationFlow = { ...appConversationFlow, ...agentCard.conversationFlow };
2483
+ const agentCardConversationFlow = agentCard.conversationFlow;
2484
+ // Delete properties if not exists so my merge contains only properties set
2485
+ if (!agentCardConversationFlow?.goal?.task) {
2486
+ delete agentCardConversationFlow.goal;
2487
+ }
2488
+ if (!agentCardConversationFlow?.triggerTasks?.onUserMessage?.task) {
2489
+ delete agentCardConversationFlow.triggerTasks.onUserMessage;
2490
+ }
2491
+ if (!agentCardConversationFlow?.triggerTasks?.onAssistantMessage?.task) {
2492
+ delete agentCardConversationFlow.triggerTasks.onAssistantMessage;
2493
+ }
2494
+ const mergedConversationFlow = { ...appConversationFlow, ...agentCardConversationFlow };
2474
2495
  // Only if exits agentCard.conversationFlow, that will override the defaults
2475
2496
  // NOTE: ill comment for now, but check if a need manual verification later.
2497
+ // if (!agentCard.conversationFlow.goal.task && appConversationFlow.goal.task) {
2498
+ // // Monstly of the time
2499
+ // mergedConversationFlow.goal = appConversationFlow.goal;
2500
+ // }
2476
2501
  // if (appConversationFlow) {
2477
2502
  // // Just replace the default if agent card has a value
2478
2503
  // if (agentCard.conversationFlow) {
@@ -2697,24 +2722,23 @@ class AgentCardsGenerationService {
2697
2722
  constructor(httpService) {
2698
2723
  this.httpService = httpService;
2699
2724
  }
2700
- generateConversationCard(idea, targetLang) {
2701
- const payload = { idea };
2702
- return this.httpService.post(`${Endpoints.GenerateConversationCard}?target=${targetLang}`, payload, 'primary');
2725
+ generateConversationCard(options) {
2726
+ return this.httpService.postHttp({ service: `${Endpoints.GenerateConversationCard}`, data: options, host: 'primary' });
2703
2727
  }
2704
2728
  generateIdeasConversationCards(options) {
2705
- return this.httpService.post(`${Endpoints.GenerateIdeas}?target=${options.language}`, options, 'primary');
2729
+ return this.httpService.postHttp({ service: `${Endpoints.GenerateIdeas}`, data: options, host: 'primary' });
2706
2730
  }
2707
2731
  completePendingCards() {
2708
- return this.httpService.get(Endpoints.CompletePendingCards, 'primary');
2732
+ return this.httpService.getHttp({ service: Endpoints.CompletePendingCards, host: 'primary' });
2709
2733
  }
2710
2734
  generateImagePendingConversationCards() {
2711
- return this.httpService.get(DCEndpoint.GeneratePendingImages, 'primary');
2735
+ return this.httpService.getHttp({ service: DCEndpoint.GeneratePendingImages, host: 'primary' });
2712
2736
  }
2713
2737
  generateImageForCard(id) {
2714
- return this.httpService.get(`${Endpoints.GenerateImage}/${id}`, 'primary');
2738
+ return this.httpService.getHttp({ service: `${Endpoints.GenerateImage}/${id}`, host: 'primary' });
2715
2739
  }
2716
2740
  generateMissingDataConversationCards(id) {
2717
- return this.httpService.get(`${Endpoints.GenerateMissingData}/${id}`, 'primary');
2741
+ return this.httpService.getHttp({ service: `${Endpoints.GenerateMissingData}/${id}`, host: 'primary' });
2718
2742
  }
2719
2743
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AgentCardsGenerationService, deps: [{ token: i1.HttpCoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2720
2744
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AgentCardsGenerationService, providedIn: 'root' }); }
@@ -5408,6 +5432,7 @@ class AgentCardListComponent extends EntityBaseListComponent {
5408
5432
  this.entityCommunicationService = inject(CONVERSATION_AI_TOKEN, { optional: true }) ?? inject(DefaultAgentCardsService);
5409
5433
  this.columns = DefaultColumns;
5410
5434
  this.customFilters = [];
5435
+ this.filterConfig.sort = { randomValue: 1 };
5411
5436
  this.filterConfig.returnProps = {
5412
5437
  _id: 1,
5413
5438
  name: 1,
@@ -5595,22 +5620,34 @@ var GenerationType;
5595
5620
  class CardsCreatorComponent {
5596
5621
  constructor() {
5597
5622
  this.agentCardsGenerationService = inject(AgentCardsGenerationService);
5598
- this.idea = signal('', ...(ngDevMode ? [{ debugName: "idea" }] : []));
5599
- this.targetLang = signal('', ...(ngDevMode ? [{ debugName: "targetLang" }] : []));
5600
- this.language = signal('', ...(ngDevMode ? [{ debugName: "language" }] : []));
5623
+ this.formBuilder = inject(FormBuilder);
5624
+ this.userService = inject(UserService);
5625
+ this.languageOptions = SUPPORTED_LANGUAGES.map((lang) => ({ label: getLangDesc(lang, 'en'), value: lang }));
5601
5626
  this.cardId = signal('', ...(ngDevMode ? [{ debugName: "cardId" }] : []));
5602
- this.numCards = signal(1, ...(ngDevMode ? [{ debugName: "numCards" }] : []));
5603
5627
  this.result = signal(null, ...(ngDevMode ? [{ debugName: "result" }] : []));
5604
5628
  this.loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
5629
+ this.cardsForm = this.formBuilder.group({
5630
+ idea: ['', Validators.required],
5631
+ langCode: ['', Validators.required],
5632
+ numCards: [1, [Validators.required, Validators.min(1)]],
5633
+ autosave: [false],
5634
+ doNotRepeat: [false],
5635
+ });
5636
+ }
5637
+ ngOnInit() {
5638
+ // throw new Error('Method not implemented.');
5639
+ const langCode = this.userService.user().settings?.targetLanguage || this.userService.user().settings?.baseLanguage || 'en';
5640
+ this.cardsForm.get('langCode')?.setValue(langCode);
5605
5641
  }
5606
5642
  async generate(options) {
5607
5643
  this.loading.set(true);
5608
5644
  this.result.set(null);
5609
5645
  try {
5610
5646
  let response;
5647
+ debugger;
5611
5648
  switch (options.type) {
5612
5649
  case GenerationType.GenerateConversationCard:
5613
- response = await this.agentCardsGenerationService.generateConversationCard(options.idea, options.targetLang);
5650
+ // response = await this.agentCardsGenerationService.generateConversationCard(options);
5614
5651
  break;
5615
5652
  case GenerationType.GenerateIdeas:
5616
5653
  response = await this.agentCardsGenerationService.generateIdeasConversationCards(options.options);
@@ -5639,22 +5676,15 @@ class CardsCreatorComponent {
5639
5676
  this.loading.set(false);
5640
5677
  }
5641
5678
  }
5642
- generateConversationCard() {
5643
- this.generate({
5644
- type: GenerationType.GenerateConversationCard,
5645
- idea: this.idea(),
5646
- targetLang: this.targetLang(),
5647
- });
5679
+ async generateConversationCard() {
5680
+ const options = this.cardsForm.value;
5681
+ const response = await this.agentCardsGenerationService.generateConversationCard(options);
5682
+ this.result.set(response);
5648
5683
  }
5649
- generateIdeas() {
5650
- this.generate({
5651
- type: GenerationType.GenerateIdeas,
5652
- options: {
5653
- idea: this.idea(),
5654
- language: this.language(),
5655
- numCards: this.numCards(),
5656
- },
5657
- });
5684
+ async generateIdeas() {
5685
+ const options = this.cardsForm.value;
5686
+ const response = await this.agentCardsGenerationService.generateIdeasConversationCards(options.options);
5687
+ this.result.set(response);
5658
5688
  }
5659
5689
  completePendingCards() {
5660
5690
  this.generate({
@@ -5678,13 +5708,24 @@ class CardsCreatorComponent {
5678
5708
  id: this.cardId(),
5679
5709
  });
5680
5710
  }
5711
+ generateCards() {
5712
+ if (this.cardsForm.invalid) {
5713
+ return;
5714
+ }
5715
+ if (this.cardsForm.value.numCards > 1) {
5716
+ this.generateIdeas();
5717
+ }
5718
+ else {
5719
+ this.generateConversationCard();
5720
+ }
5721
+ }
5681
5722
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: CardsCreatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5682
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: CardsCreatorComponent, isStandalone: true, selector: "app-cards-creator", ngImport: i0, template: "<div>\n <h2 class=\"text-2xl font-bold mb-4\">Card Generation</h2>\n\n <p> Paso 1: Genearar una o varias tarjetas vacias con solo la idea, estas tiene estatus de pending. no lo cambies ser\u00E1 necesario en el paso 2. </p>\n\n <div class=\"grid\">\n <!-- Generate Ideas Section -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Ideas</h3>\n <div class=\"field\">\n <label for=\"idea-ideas\">Idea</label>\n <input id=\"idea-ideas\" type=\"text\" pInputText [(ngModel)]=\"idea\" placeholder=\"e.g., 'A trip to the moon'\" class=\"w-full\" />\n </div>\n <div class=\"field\">\n <label for=\"language-ideas\">Language</label>\n <input id=\"language-ideas\" type=\"text\" pInputText [(ngModel)]=\"language\" placeholder=\"e.g., 'en'\" class=\"w-full\" />\n </div>\n\n <div class=\"field\">\n <label for=\"language-ideas\">Number of Cards</label>\n <input id=\"language-ideas\" type=\"text\" pInputText [(ngModel)]=\"numCards\" placeholder=\"e.g., '10'\" class=\"w-full\" />\n </div>\n <div class=\"mt-4\">\n <p-button label=\"Generate Ideas\" icon=\"pi pi-sparkles\" (onClick)=\"generateIdeas()\" [loading]=\"loading()\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Generate Conversation Card Section -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Conversation Card</h3>\n <div class=\"field\">\n <label for=\"idea-conversation\">Idea</label>\n <input id=\"idea-conversation\" type=\"text\" pInputText [(ngModel)]=\"idea\" placeholder=\"e.g., 'Ordering food at a restaurant'\" class=\"w-full\" />\n </div>\n <div class=\"field\">\n <label for=\"targetLang-conversation\">Target Language</label>\n <input id=\"targetLang-conversation\" type=\"text\" pInputText [(ngModel)]=\"targetLang\" placeholder=\"e.g., 'es'\" class=\"w-full\" />\n </div>\n <div class=\"mt-4\">\n <p-button label=\"Generate Card\" icon=\"pi pi-bolt\" (onClick)=\"generateConversationCard()\" [loading]=\"loading()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <p-divider align=\"center\" styleClass=\"my-5\">\n <span class=\"p-tag\">Maintenance</span>\n </p-divider>\n\n <!-- Maintenance Section -->\n <div class=\"grid\">\n <!-- Card Specific Maintenance -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Card Specific Maintenance</h3>\n <div class=\"field\">\n <label for=\"cardId\">Card ID</label>\n <input id=\"cardId\" type=\"text\" pInputText [(ngModel)]=\"cardId\" placeholder=\"Enter Card ID\" class=\"w-full\" />\n </div>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Generate Image\" icon=\"pi pi-image\" (onClick)=\"generateImageForCard()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Missing Data\"\n icon=\"pi pi-database\"\n (onClick)=\"generateMissingData()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Batch Operations -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Batch Operations</h3>\n <p>Run maintenance tasks on all pending cards.</p>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Complete Pending Cards\" icon=\"pi pi-check-square\" (onClick)=\"completePendingCards()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Pending Images\"\n icon=\"pi pi-images\"\n (onClick)=\"generatePendingImages()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Result Section -->\n @if (result()) {\n <div class=\"col-12 mt-4\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Result</h3>\n <pre>{{ result() | json }}</pre>\n </div>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3$2.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DividerModule }, { kind: "component", type: i4$2.Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "pipe", type: i2$1.JsonPipe, name: "json" }] }); }
5723
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: CardsCreatorComponent, isStandalone: true, selector: "app-cards-creator", ngImport: i0, template: "<div>\n <h2 class=\"text-2xl font-bold mb-4\">Card Generation</h2>\n <p-message severity=\"secondary\"\n >Paso 1: Genearar una o varias tarjetas vacias con solo la idea, estas tiene estatus de pending. no lo cambies ser\u00E1 necesario en el paso 2.\n </p-message>\n\n <div class=\"grid\">\n <div class=\"col-12\">\n <form [formGroup]=\"cardsForm\" (ngSubmit)=\"generateCards()\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Cards</h3>\n <p-message severity=\"info\">Generate one or more cards with an idea. Cards will be created with a 'pending' status.</p-message>\n\n <div class=\"field mt-4\">\n <label for=\"idea\">Idea</label>\n <input id=\"idea\" type=\"text\" pInputText formControlName=\"idea\" placeholder=\"e.g., 'Ordering food at a restaurant'\" class=\"w-full\" />\n </div>\n\n <div class=\"form-field mt-4\">\n <label for=\"lang\">Language <span pTooltip=\"Select the primary language for the conversation\">\u2139\uFE0F</span></label>\n <p-select\n id=\"lang\"\n [options]=\"languageOptions\"\n [filter]=\"true\"\n formControlName=\"langCode\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"'Select Language'\"\n styleClass=\"w-full\"></p-select>\n </div>\n\n <div class=\"field mt-4\">\n <label for=\"num-cards\">Number of Cards</label>\n <input id=\"num-cards\" type=\"number\" pInputText formControlName=\"numCards\" placeholder=\"e.g., '10'\" class=\"w-full\" />\n </div>\n\n <div class=\"flex flex-wrap gap-4 mt-4\">\n <div class=\"flex align-items-center\">\n <p-toggleSwitch formControlName=\"autosave\" inputId=\"autosave-switch\"></p-toggleSwitch>\n <label for=\"autosave-switch\" class=\"ml-2\"> Auto-save?</label>\n </div>\n <div class=\"flex align-items-center\">\n <p-toggleSwitch formControlName=\"doNotRepeat\" inputId=\"repeat-switch\"></p-toggleSwitch>\n <label for=\"repeat-switch\" class=\"ml-2\"> Do not repeat topics?</label>\n </div>\n </div>\n\n <div class=\"mt-4\">\n <p-button label=\"Generate Cards\" icon=\"pi pi-bolt\" type=\"submit\" [loading]=\"loading()\" [disabled]=\"cardsForm.invalid\"></p-button>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <p-divider align=\"center\" styleClass=\"my-5\">\n <span class=\"p-tag\">Maintenance</span>\n </p-divider>\n\n <!-- Maintenance Section -->\n <div class=\"grid\">\n <!-- Card Specific Maintenance -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Card Specific Maintenance</h3>\n <div class=\"field\">\n <label for=\"cardId\">Card ID</label>\n <input\n id=\"cardId\"\n type=\"text\"\n pInputText\n [value]=\"cardId()\"\n (input)=\"cardId.set($any($event.target).value)\"\n placeholder=\"Enter Card ID\"\n class=\"w-full\" />\n </div>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Generate Image\" icon=\"pi pi-image\" (onClick)=\"generateImageForCard()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Missing Data\"\n icon=\"pi pi-database\"\n (onClick)=\"generateMissingData()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Batch Operations -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Batch Operations</h3>\n <p>Run maintenance tasks on all pending cards.</p>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Complete Pending Cards\" icon=\"pi pi-check-square\" (onClick)=\"completePendingCards()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Pending Images\"\n icon=\"pi pi-images\"\n (onClick)=\"generatePendingImages()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Result Section -->\n @if (result()) {\n <div class=\"col-12 mt-4\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Result</h3>\n <pre>{{ result() | json }}</pre>\n </div>\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3$2.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DividerModule }, { kind: "component", type: i4$2.Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i5$2.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i3.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: ToggleSwitchModule }, { kind: "component", type: i3$3.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "pipe", type: i2$1.JsonPipe, name: "json" }] }); }
5683
5724
  }
5684
5725
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: CardsCreatorComponent, decorators: [{
5685
5726
  type: Component,
5686
- args: [{ selector: 'app-cards-creator', standalone: true, imports: [FormsModule, CommonModule, ButtonModule, InputTextModule, DividerModule], template: "<div>\n <h2 class=\"text-2xl font-bold mb-4\">Card Generation</h2>\n\n <p> Paso 1: Genearar una o varias tarjetas vacias con solo la idea, estas tiene estatus de pending. no lo cambies ser\u00E1 necesario en el paso 2. </p>\n\n <div class=\"grid\">\n <!-- Generate Ideas Section -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Ideas</h3>\n <div class=\"field\">\n <label for=\"idea-ideas\">Idea</label>\n <input id=\"idea-ideas\" type=\"text\" pInputText [(ngModel)]=\"idea\" placeholder=\"e.g., 'A trip to the moon'\" class=\"w-full\" />\n </div>\n <div class=\"field\">\n <label for=\"language-ideas\">Language</label>\n <input id=\"language-ideas\" type=\"text\" pInputText [(ngModel)]=\"language\" placeholder=\"e.g., 'en'\" class=\"w-full\" />\n </div>\n\n <div class=\"field\">\n <label for=\"language-ideas\">Number of Cards</label>\n <input id=\"language-ideas\" type=\"text\" pInputText [(ngModel)]=\"numCards\" placeholder=\"e.g., '10'\" class=\"w-full\" />\n </div>\n <div class=\"mt-4\">\n <p-button label=\"Generate Ideas\" icon=\"pi pi-sparkles\" (onClick)=\"generateIdeas()\" [loading]=\"loading()\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Generate Conversation Card Section -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Conversation Card</h3>\n <div class=\"field\">\n <label for=\"idea-conversation\">Idea</label>\n <input id=\"idea-conversation\" type=\"text\" pInputText [(ngModel)]=\"idea\" placeholder=\"e.g., 'Ordering food at a restaurant'\" class=\"w-full\" />\n </div>\n <div class=\"field\">\n <label for=\"targetLang-conversation\">Target Language</label>\n <input id=\"targetLang-conversation\" type=\"text\" pInputText [(ngModel)]=\"targetLang\" placeholder=\"e.g., 'es'\" class=\"w-full\" />\n </div>\n <div class=\"mt-4\">\n <p-button label=\"Generate Card\" icon=\"pi pi-bolt\" (onClick)=\"generateConversationCard()\" [loading]=\"loading()\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <p-divider align=\"center\" styleClass=\"my-5\">\n <span class=\"p-tag\">Maintenance</span>\n </p-divider>\n\n <!-- Maintenance Section -->\n <div class=\"grid\">\n <!-- Card Specific Maintenance -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Card Specific Maintenance</h3>\n <div class=\"field\">\n <label for=\"cardId\">Card ID</label>\n <input id=\"cardId\" type=\"text\" pInputText [(ngModel)]=\"cardId\" placeholder=\"Enter Card ID\" class=\"w-full\" />\n </div>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Generate Image\" icon=\"pi pi-image\" (onClick)=\"generateImageForCard()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Missing Data\"\n icon=\"pi pi-database\"\n (onClick)=\"generateMissingData()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Batch Operations -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Batch Operations</h3>\n <p>Run maintenance tasks on all pending cards.</p>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Complete Pending Cards\" icon=\"pi pi-check-square\" (onClick)=\"completePendingCards()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Pending Images\"\n icon=\"pi pi-images\"\n (onClick)=\"generatePendingImages()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Result Section -->\n @if (result()) {\n <div class=\"col-12 mt-4\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Result</h3>\n <pre>{{ result() | json }}</pre>\n </div>\n </div>\n }\n</div>\n" }]
5687
- }] });
5727
+ args: [{ selector: 'app-cards-creator', standalone: true, imports: [ReactiveFormsModule, CommonModule, ButtonModule, InputTextModule, DividerModule, MessageModule, SelectModule, ToggleSwitchModule], template: "<div>\n <h2 class=\"text-2xl font-bold mb-4\">Card Generation</h2>\n <p-message severity=\"secondary\"\n >Paso 1: Genearar una o varias tarjetas vacias con solo la idea, estas tiene estatus de pending. no lo cambies ser\u00E1 necesario en el paso 2.\n </p-message>\n\n <div class=\"grid\">\n <div class=\"col-12\">\n <form [formGroup]=\"cardsForm\" (ngSubmit)=\"generateCards()\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Generate Cards</h3>\n <p-message severity=\"info\">Generate one or more cards with an idea. Cards will be created with a 'pending' status.</p-message>\n\n <div class=\"field mt-4\">\n <label for=\"idea\">Idea</label>\n <input id=\"idea\" type=\"text\" pInputText formControlName=\"idea\" placeholder=\"e.g., 'Ordering food at a restaurant'\" class=\"w-full\" />\n </div>\n\n <div class=\"form-field mt-4\">\n <label for=\"lang\">Language <span pTooltip=\"Select the primary language for the conversation\">\u2139\uFE0F</span></label>\n <p-select\n id=\"lang\"\n [options]=\"languageOptions\"\n [filter]=\"true\"\n formControlName=\"langCode\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"'Select Language'\"\n styleClass=\"w-full\"></p-select>\n </div>\n\n <div class=\"field mt-4\">\n <label for=\"num-cards\">Number of Cards</label>\n <input id=\"num-cards\" type=\"number\" pInputText formControlName=\"numCards\" placeholder=\"e.g., '10'\" class=\"w-full\" />\n </div>\n\n <div class=\"flex flex-wrap gap-4 mt-4\">\n <div class=\"flex align-items-center\">\n <p-toggleSwitch formControlName=\"autosave\" inputId=\"autosave-switch\"></p-toggleSwitch>\n <label for=\"autosave-switch\" class=\"ml-2\"> Auto-save?</label>\n </div>\n <div class=\"flex align-items-center\">\n <p-toggleSwitch formControlName=\"doNotRepeat\" inputId=\"repeat-switch\"></p-toggleSwitch>\n <label for=\"repeat-switch\" class=\"ml-2\"> Do not repeat topics?</label>\n </div>\n </div>\n\n <div class=\"mt-4\">\n <p-button label=\"Generate Cards\" icon=\"pi pi-bolt\" type=\"submit\" [loading]=\"loading()\" [disabled]=\"cardsForm.invalid\"></p-button>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <p-divider align=\"center\" styleClass=\"my-5\">\n <span class=\"p-tag\">Maintenance</span>\n </p-divider>\n\n <!-- Maintenance Section -->\n <div class=\"grid\">\n <!-- Card Specific Maintenance -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Card Specific Maintenance</h3>\n <div class=\"field\">\n <label for=\"cardId\">Card ID</label>\n <input\n id=\"cardId\"\n type=\"text\"\n pInputText\n [value]=\"cardId()\"\n (input)=\"cardId.set($any($event.target).value)\"\n placeholder=\"Enter Card ID\"\n class=\"w-full\" />\n </div>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Generate Image\" icon=\"pi pi-image\" (onClick)=\"generateImageForCard()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Missing Data\"\n icon=\"pi pi-database\"\n (onClick)=\"generateMissingData()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n\n <!-- Batch Operations -->\n <div class=\"col-12 md:col-6\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Batch Operations</h3>\n <p>Run maintenance tasks on all pending cards.</p>\n <div class=\"mt-4 flex gap-2\">\n <p-button label=\"Complete Pending Cards\" icon=\"pi pi-check-square\" (onClick)=\"completePendingCards()\" [loading]=\"loading()\"></p-button>\n <p-button\n label=\"Generate Pending Images\"\n icon=\"pi pi-images\"\n (onClick)=\"generatePendingImages()\"\n [loading]=\"loading()\"\n styleClass=\"p-button-secondary\"></p-button>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Result Section -->\n @if (result()) {\n <div class=\"col-12 mt-4\">\n <div class=\"p-panel p-4\">\n <h3 class=\"text-xl font-semibold mb-3\">Result</h3>\n <pre>{{ result() | json }}</pre>\n </div>\n </div>\n }\n</div>\n" }]
5728
+ }], ctorParameters: () => [] });
5688
5729
 
5689
5730
  /*
5690
5731
  * Public API Surface of ngx-agent-cards