@dataclouder/ngx-agent-cards 0.1.52 → 0.1.53

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/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import * as _angular_forms from '@angular/forms';
5
5
  import { FormGroup, FormControl, FormArray } from '@angular/forms';
6
6
  import { AudioEffectType, TTSRequest } from '@dataclouder/ngx-vertex';
7
7
  import * as _angular_core from '@angular/core';
8
- import { InjectionToken, Type, Provider, WritableSignal, Injector, Signal, OnInit, OnDestroy, TemplateRef } from '@angular/core';
8
+ import { InjectionToken, Type, Provider, WritableSignal, Injector, Signal, OnInit, OnDestroy, ElementRef, TemplateRef, EventEmitter } from '@angular/core';
9
9
  import { UserService } from '@dataclouder/ngx-users';
10
10
  import { MicSettings } from '@dataclouder/ngx-mic';
11
11
  import * as _dataclouder_ngx_agent_cards from '@dataclouder/ngx-agent-cards';
@@ -93,7 +93,17 @@ declare enum SystemPromptType {
93
93
  CharacterDescription = "characterDescription",
94
94
  ScenarioDescription = "scenarioDescription",
95
95
  MessageExamples = "messageExamples",
96
- JailBreak = "jailBreak"
96
+ JailBreak = "jailBreak",
97
+ CharacterIdentity = "characterIdentity",
98
+ CharacterAppearance = "characterAppearance",
99
+ CharacterPersonality = "characterPersonality",
100
+ CharacterCommunication = "characterCommunication",
101
+ CharacterPsychology = "characterPsychology",
102
+ CharacterBackground = "characterBackground",
103
+ CharacterCapabilities = "characterCapabilities",
104
+ CharacterSocial = "characterSocial",
105
+ CharacterPreferences = "characterPreferences",
106
+ CharacterSituation = "characterSituation"
97
107
  }
98
108
  interface ChangePromptAction {
99
109
  actionType: EDoActionType;
@@ -139,7 +149,11 @@ type ConversationFlowFormGroup = FormGroup<{
139
149
  challenges: FormArray<DynamicCriteriaFormGroup>;
140
150
  tools: FormArray<DynamicCriteriaFormGroup>;
141
151
  dynamicConditions: FormArray<DynamicConditionFormGroup>;
142
- moodStateEnabled: FormControl<boolean>;
152
+ moodState: FormGroup<{
153
+ enabled: FormControl<boolean>;
154
+ useAssetStatesOnly: FormControl<boolean>;
155
+ detectableStates: FormArray<DynamicCriteriaFormGroup>;
156
+ }>;
143
157
  }>;
144
158
  type ConversationSettingsFormGroup = FormGroup<{
145
159
  textEngine: FormControl<TextEngines>;
@@ -160,6 +174,29 @@ interface Appearance {
160
174
  objects: string;
161
175
  quirks: string;
162
176
  }
177
+ interface CardTranslation {
178
+ greetings: string[];
179
+ hook: string;
180
+ mes_example: string;
181
+ }
182
+ interface MultiLanguage {
183
+ es: CardTranslation;
184
+ en: CardTranslation;
185
+ fr: CardTranslation;
186
+ de: CardTranslation;
187
+ }
188
+ interface Persona {
189
+ identity?: string;
190
+ physical?: string;
191
+ personality?: string;
192
+ communication: string;
193
+ psychology: string;
194
+ background: string;
195
+ capabilities: string;
196
+ social: string;
197
+ preferences: string;
198
+ situation: string;
199
+ }
163
200
  interface CharacterCardData {
164
201
  name: string;
165
202
  description: string;
@@ -167,16 +204,19 @@ interface CharacterCardData {
167
204
  first_mes?: string;
168
205
  creator_notes?: string;
169
206
  mes_example?: string;
170
- alternate_greetings?: string[];
207
+ appearance?: string;
208
+ persona?: Persona;
171
209
  tags?: string[];
172
210
  system_prompt?: string;
173
211
  post_history_instructions?: string;
174
212
  character_version?: string;
175
213
  extensions?: Record<string, any>;
176
- picture_description?: string;
177
- appearance?: Appearance;
214
+ greetings?: string[];
215
+ gender: string;
216
+ hook: string;
217
+ langTranslation?: MultiLanguage;
178
218
  }
179
- declare const characterCardStringDataDefinition = "\ninterface CharacterCardData {\n name: string; // Character's name\n description: string; // General character description\n scenario: string; // The setting or context where the character exists\n first_mes: string; // First message the character will say\n mes_example: string; // Example of character's typical message/dialogue\n alternate_greetings: string[]; // Array of alternative greeting messages\n tags: string[]; // Array of descriptive tags\n appearance: string; // Physical description including height, build, hair color/style, eye color, skin tone, distinctive marks, clothing style, current outfit\n}";
219
+ declare const characterCardStringDataDefinition = "\ninterface CharacterCardData {\n name: string; // Character's name\n gender: string; // male, female or other\n scenario: string; // 2-3 sentences: of the world, environment, time of day, weather, etc. where the character is.\n greetings: string[]; // 2-3 Character's opening message to start a conversation, less than 50 words. \n appearance: string; // current description for image generation less than 50 words.\n persona: {\n identity: string; // Name, Age, Gender, Species, Sexuality, Role, Appearance\n physical: string; // physical description including height, build, hairColor, hairStyle, eyeColor, skinTone, distinctiveMarks, clothing style, currentOutfit\n personality: string; // personality description surface traits, Temperament, Values, Beliefs, Observable traits\n communication: string; // (How They Express) Speech Pattern, Style Common Phrases, Language Habits\n psychology: string; // Motivations, Desires, Goals, Traumas, Conflicts, Weaknesses\n background: string; // Background, History, origin, formative, secrets.\n capabilities: string; // skills, knowledge, abilities, expertise, limitations, Tools, Strengths\n social: string; // Relationships, reputation, allies, enemies, social role.\n preferences: string; // likes, dislikes, hobbies, interests, hates\n situation: string; // Current context for the character, immediate goal or challenge and constraints.\n };\n tags: string[]; // Array of 6-8 descriptive tags\n hook: string; // 40 to 60 words for readable hook, why play this character, what makes them compelling, add some questions for challenges, make it engaging.\n}\n \nDescription format for PERSONA core data (compact, information-dense):\n\n## IDENTITY (Core Identification)\nName: [full name]\nAge: [age or age range]\nGender: [male, female, non-binary, other]\nSpecies: [human, elf, android, etc.]\nSexuality: [heterosexual, homosexual, bisexual, asexual, etc.]\nRole: [primary role/occupation] \u2022 [additional context about their position]\n\n## PHYSICAL - Observable Traits\nAppearance: [height, build, hair (color, length, style), eyes (color, shape), skin (tone, texture), distinctive features (scars, tattoos, markings), typical clothing/style]\nVoice: [tone (deep, high, raspy), pitch, accent, volume habits]\nMannerisms: [gestures, nervous habits, tics, body language, facial expressions, movement style]\nExpressions: [facial expressions, gestures, body language]\n\n## PERSONALITY - Internal Traits \nCore Traits: [4-6 main personality traits, comma-separated]\nTemperament: [overall emotional disposition - calm, volatile, melancholic, optimistic, etc.]\nValues: [what they believe in, moral principles, what matters most to them]\nFears: [what scares them, anxieties, phobias]\nQuirks: [unusual behaviors, idiosyncrasies, unique characteristics]\n\n## COMMUNICATION - How They Express\nSpeech Pattern: [formal/casual/slang, vocabulary level, sentence structure]\nSpeech Style: [verbose, terse, poetic, blunt, eloquent, rambling, etc.]\nCommon Phrases: [catchphrases, frequent expressions, signature words]\nLanguage Habits: [stutters, pauses, filler words, speaking speed, accent quirks]\n\n## PSYCHOLOGY - Deep Internal \nMotivations: [what drives them, internal forces pushing them forward]\nDesires: [what they want, both conscious and unconscious wants]\nGoals: [what they're actively trying to achieve, short and long-term]\nTraumas: [past wounds, painful experiences, unresolved hurt]\nConflicts: [internal struggles, competing desires, moral dilemmas]\nWeaknesses: [psychological vulnerabilities, emotional blind spots, mental limitations]\n\n## BACKGROUND - History\nHistory: [life story, major events that shaped them, timeline of important moments]\nOrigin: [where they're from, family background, cultural context]\nFormative Events: [specific experiences that defined who they became]\nSecrets: [hidden past elements, things they don't share, buried truths]\n\n## CAPABILITIES - What They Can Do\nSkills: [learned abilities, trained competencies]\nAbilities: [natural talents, supernatural powers, innate gifts]\nSpecialties: [areas of expertise, what they're known for]\nTools: [equipment, weapons, signature items they use]\nStrengths: [what they excel at, advantages, powerful traits]\n\n## SOCIAL - Connections\nRelationships: [key people in their life - family, friends, romantic interests with brief descriptions]\nReputation: [how others see them, what they're known for publicly]\nSocial Role: [position in society/group/organization]\nAllies: [friends, supporters, people who help them]\nEnemies: [opponents, rivals, antagonists]\n\n## PREFERENCES - Likes/Dislikes\nLikes: [things they enjoy, separated by |]\nDislikes: [things they avoid or hate, separated by |]\nHobbies: [activities they do for fun or relaxation]\nHabits: [routines, rituals, repeated behaviors]\n\n## SITUATION - Current Context\nScenario: [current setting, where they are now, what's happening around them]\nImmediate Goal: [what they want right now, current objective]\nCurrent State: [emotional state, physical condition, mental state]\nConstraints: [current limitations, obstacles, restrictions they're facing]\n\n";
180
220
  interface ICharacterCardDC {
181
221
  spec?: 'chara_card_v2';
182
222
  spec_version?: '2_v_dc';
@@ -287,13 +327,18 @@ interface IDynamicCriteria {
287
327
  description: string;
288
328
  emoji?: string;
289
329
  }
330
+ interface IMoodState {
331
+ enabled: boolean;
332
+ useAssetStatesOnly: boolean;
333
+ detectableStates: string[];
334
+ }
290
335
  interface IConversationFlow {
291
336
  goal: IDynamicFlowTask;
292
337
  tools?: IDynamicCriteria[];
293
338
  triggerTasks: Partial<Record<ConversationEvents, IDynamicFlowTask>>;
294
339
  challenges?: IDynamicCriteria[];
295
340
  dynamicConditions: IDynamicCondition[];
296
- moodStateEnabled: boolean;
341
+ moodState: IMoodState;
297
342
  }
298
343
  declare enum EAgentType {
299
344
  None,
@@ -439,7 +484,9 @@ declare enum ConversationEvents {
439
484
  OnEndConversation = "onEndConversation"
440
485
  }
441
486
  declare enum ChatEventType {
442
- WordClicked = "wordClicked"
487
+ WordClicked = "wordClicked",
488
+ MoodDetected = "moodDetected",
489
+ AudioStarted = "audioStarted"
443
490
  }
444
491
  interface ChatEvent<T = any> {
445
492
  type: ChatEventType;
@@ -489,10 +536,15 @@ declare function provideAgentCardService(serviceImplementation: Type<DefaultAgen
489
536
  declare function extractJsonFromResponse(content: string): any;
490
537
 
491
538
  declare const getMoodStateLabelsAsString: () => string;
492
- declare const MOOD_STATE_PROMPT: string;
539
+ declare const getMoodStatePrompt: (validMoodStates?: string) => string;
493
540
 
541
+ interface TextHTMLTag {
542
+ text: string;
543
+ tag: string;
544
+ content: string;
545
+ }
494
546
  declare function markdownToHtml(markdown: string): any;
495
- declare function convertToHTML(text: string): any;
547
+ declare function convertToHTML(text: string): Array<TextHTMLTag>;
496
548
  declare function removeEmojisAndSpecialCharacters(text: string): string;
497
549
  declare function removeEmojis(text: string): string;
498
550
  declare function removeSpecialCharacters(inputText: string): string;
@@ -533,10 +585,10 @@ declare class ConversationPromptBuilderService {
533
585
  [key: string]: string;
534
586
  }): ChatMessage[];
535
587
  private getDefaultParseDict;
588
+ estimateTokens(text: string): number;
536
589
  getDefaultCardParseDict(card: IAgentCard): {
537
590
  [key: string]: string;
538
591
  };
539
- convertConversationToHtml(messages: ChatMessage[], jailBrake?: string): string;
540
592
  private parseConversation;
541
593
  applyReplacements(text: string, replacements: {
542
594
  [key: string]: string;
@@ -632,7 +684,10 @@ declare class ChatMonitorService {
632
684
  constructor();
633
685
  private readonly messageAudioWillPlay;
634
686
  readonly messageAudioWillPlay$: _angular_core.Signal<MessageContent>;
687
+ currentMood: _angular_core.WritableSignal<string[]>;
688
+ isConversationActive: _angular_core.WritableSignal<boolean>;
635
689
  logMessageAudioWillPlay(message: MessageContent): void;
690
+ logCurrentMood(mood: string[]): void;
636
691
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatMonitorService, never>;
637
692
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ChatMonitorService>;
638
693
  }
@@ -795,7 +850,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
795
850
  protected entityCommunicationService: _dataclouder_ngx_agent_cards.DefaultAgentCardsService;
796
851
  private dialogService;
797
852
  private promptBuilder;
798
- private formGroupService;
853
+ private characterFormGroupService;
799
854
  conversationOptions: {
800
855
  value: ConversationType$1;
801
856
  label: string;
@@ -845,7 +900,11 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
845
900
  challenges: FormArray<_dataclouder_ngx_agent_cards.DynamicCriteriaFormGroup>;
846
901
  tools: FormArray<_dataclouder_ngx_agent_cards.DynamicCriteriaFormGroup>;
847
902
  dynamicConditions: FormArray<_dataclouder_ngx_agent_cards.DynamicConditionFormGroup>;
848
- moodStateEnabled: _angular_forms.FormControl<boolean>;
903
+ moodState: FormGroup<{
904
+ enabled: _angular_forms.FormControl<boolean>;
905
+ useAssetStatesOnly: _angular_forms.FormControl<boolean>;
906
+ detectableStates: FormArray<_dataclouder_ngx_agent_cards.DynamicCriteriaFormGroup>;
907
+ }>;
849
908
  }>;
850
909
  manageable: FormGroup<any>;
851
910
  learnable: FormGroup<{
@@ -857,6 +916,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
857
916
  }>;
858
917
  protected patchForm(agentCard: IAgentCard): void;
859
918
  save(): Promise<IAgentCard | undefined>;
919
+ inspect(): void;
860
920
  onImageSelected(file: File): Promise<void>;
861
921
  checkPrompt(): void;
862
922
  goToDetails(): void;
@@ -900,15 +960,24 @@ declare class DcAgentCardDetailsComponent implements OnInit {
900
960
  private agentCardService;
901
961
  private route;
902
962
  private toastService;
963
+ chatMonitorService: ChatMonitorService;
964
+ private userService;
903
965
  agentCardId: string;
904
966
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
967
+ videoPlayer: ElementRef<HTMLVideoElement> | undefined;
905
968
  agentCard: _angular_core.WritableSignal<IAgentCard>;
969
+ currentMotionUrl: _angular_core.WritableSignal<string>;
906
970
  showInfoLayer: _angular_core.WritableSignal<boolean>;
907
- mediaType: _angular_core.Signal<"image" | "video">;
908
- mediaUrl: _angular_core.Signal<string>;
971
+ isVideoReady: _angular_core.WritableSignal<boolean>;
972
+ isIntroPlaying: _angular_core.WritableSignal<boolean>;
973
+ constructor();
909
974
  ngOnInit(): Promise<void>;
975
+ private transformToLanguage;
976
+ private _transformVoice;
910
977
  startConversation(): void;
911
978
  toggleInfoLayer(): void;
979
+ onVideoReady(): void;
980
+ onIntroVideoEnd(): void;
912
981
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardDetailsComponent, never>;
913
982
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardDetailsComponent, "dc-agent-card-details", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
914
983
  }
@@ -925,6 +994,8 @@ declare class AgentCardUI implements OnInit {
925
994
  userService: UserService;
926
995
  speedDialModel: MenuItem[];
927
996
  constructor();
997
+ finalDescription: _angular_core.WritableSignal<string>;
998
+ name: _angular_core.WritableSignal<string>;
928
999
  ngOnInit(): void;
929
1000
  readonly card: _angular_core.InputSignal<IAgentCard>;
930
1001
  readonly showOptions: _angular_core.InputSignal<boolean>;
@@ -1152,7 +1223,23 @@ declare class CardsCreatorComponent implements OnInit {
1152
1223
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardsCreatorComponent, "app-cards-creator", never, {}, {}, never, never, true, never>;
1153
1224
  }
1154
1225
 
1226
+ declare class ACCDataGenerationComponent {
1227
+ protected agentCardService: _dataclouder_ngx_agent_cards.DefaultAgentCardsService;
1228
+ private audioNotificationService;
1229
+ agentCard: IAgentCard;
1230
+ cardImprovementsChange: EventEmitter<any>;
1231
+ cardImprovements: _angular_core.WritableSignal<any>;
1232
+ idea: string;
1233
+ prompt: _angular_core.WritableSignal<string>;
1234
+ loading: _angular_core.WritableSignal<boolean>;
1235
+ generationStep: _angular_core.WritableSignal<"prompt" | "idea" | "result">;
1236
+ generatePrompt(): void;
1237
+ generate(): Promise<void>;
1238
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ACCDataGenerationComponent, never>;
1239
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ACCDataGenerationComponent, "dc-acc-data-generation", never, { "agentCard": { "alias": "agentCard"; "required": false; }; }, { "cardImprovementsChange": "cardImprovementsChange"; }, never, never, true, never>;
1240
+ }
1241
+
1155
1242
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
1156
1243
 
1157
- export { AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationType$1 as ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MOOD_STATE_PROMPT, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, SystemPromptType, TextEngineOptions, TextEngines, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
1158
- export type { Appearance, AudioGenerated, AudioState, BackgroundTask, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, ICharacterCardDC, IConversationFlow, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, ISimpleAgent, ITTS, IWordMetadata, ModelFormGroup, ModelName, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
1244
+ export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationType$1 as ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, SystemPromptType, TextEngineOptions, TextEngines, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
1245
+ export type { Appearance, AudioGenerated, AudioState, BackgroundTask, CardTranslation, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, ICharacterCardDC, IConversationFlow, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, IMoodState, ISimpleAgent, ITTS, IWordMetadata, ModelFormGroup, ModelName, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-agent-cards",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",