@dataclouder/ngx-agent-cards 0.2.12 → 0.2.14

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.12",
3
+ "version": "0.2.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
@@ -5,7 +5,7 @@ import { ChatUserSettings, EModelQuality, IAuditable, IAIModel, IManageable, ILe
5
5
  import * as _angular_forms from '@angular/forms';
6
6
  import { FormGroup, FormControl, FormArray } from '@angular/forms';
7
7
  import * as _angular_core from '@angular/core';
8
- import { InjectionToken, Type, Provider, WritableSignal, Injector, Signal, OnDestroy, ElementRef, OnInit, TemplateRef, EventEmitter } from '@angular/core';
8
+ import { InjectionToken, Type, Provider, WritableSignal, Injector, Signal, OnDestroy, ElementRef, OnInit, AfterViewInit, TemplateRef, EventEmitter } from '@angular/core';
9
9
  import { UserService } from '@dataclouder/ngx-users';
10
10
  import * as rxjs from 'rxjs';
11
11
  import { MicSettings } from '@dataclouder/ngx-mic';
@@ -291,6 +291,8 @@ interface IConversationSettings {
291
291
  tts?: ITTS;
292
292
  mainVoice?: VoiceTTS;
293
293
  secondaryVoice?: VoiceTTS;
294
+ chatMode?: 'regular' | 'immersive';
295
+ avatarDisplayMode?: 'card' | 'transparent' | 'fullscreen';
294
296
  }
295
297
  type IConversationSettingsDTO = Partial<IConversationSettings> & {
296
298
  returnJson?: boolean;
@@ -471,6 +473,8 @@ interface IAgentCard {
471
473
  voiceCloning?: VoiceCloning;
472
474
  agenticConfig?: IAgenticConfig;
473
475
  metaApp?: IAgentMetadata;
476
+ live2d?: any;
477
+ avatarType?: 'image' | 'video' | 'live2d' | 'vroid';
474
478
  }
475
479
  interface IAgentCardMeta extends IAgentCard {
476
480
  taken: any;
@@ -679,6 +683,7 @@ declare class DefaultAgentCardsService extends EntityCommunicationService<IAgent
679
683
  private whisperService;
680
684
  private fbAuthService;
681
685
  constructor();
686
+ findOne(id: string, projection?: any): Promise<IAgentCard>;
682
687
  partialUpdateAgentCard(agentCard: IAgentCard): Promise<IAgentCard>;
683
688
  generateMainImage(idCard: string): Promise<any>;
684
689
  completeAgentCard(idCard: string): Promise<any>;
@@ -986,6 +991,15 @@ interface IBackgroundService {
986
991
  declare const VIDEO_PLAYER_SERVICE_TOKEN: InjectionToken<IVideoPlayerService>;
987
992
  declare const BACKGROUND_SERVICE_TOKEN: InjectionToken<IBackgroundService>;
988
993
  declare const CHAT_OBSERVER_CONFIG: InjectionToken<IObserverConfig>;
994
+ interface Live2DConfig {
995
+ PIXI: () => Promise<any>;
996
+ Live2DModel: () => Promise<any>;
997
+ }
998
+ declare const LIVE2D_CONFIG: InjectionToken<Live2DConfig>;
999
+ declare function provideLive2D(config: Live2DConfig): {
1000
+ provide: InjectionToken<Live2DConfig>;
1001
+ useValue: Live2DConfig;
1002
+ };
989
1003
 
990
1004
  declare class VideoPlayerService implements OnDestroy {
991
1005
  private conversationFlowStateService;
@@ -1356,6 +1370,10 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1356
1370
  label: string;
1357
1371
  }[];
1358
1372
  agentTypeOptions: (string | EAgentType.None)[];
1373
+ avatarTypeOptions: {
1374
+ label: string;
1375
+ value: string;
1376
+ }[];
1359
1377
  agenticEngineOptions: AgenticEngine[];
1360
1378
  agenticPatternOptions: AgenticPattern[];
1361
1379
  allowedToolsOptions: {
@@ -1364,6 +1382,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1364
1382
  }[];
1365
1383
  readonly onSave: _angular_core.OutputEmitterRef<any>;
1366
1384
  readonly inputSettings: _angular_core.InputSignal<DCAgentFormSettings>;
1385
+ readonly onSelectLive2d: _angular_core.OutputEmitterRef<void>;
1367
1386
  isToolAllowed(toolValue: string): boolean;
1368
1387
  toggleTool(toolValue: string, checked: boolean): void;
1369
1388
  form: _angular_forms.FormGroup<{
@@ -1390,6 +1409,8 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1390
1409
  id: _angular_forms.FormControl<string>;
1391
1410
  }>;
1392
1411
  rules: FormArray<_angular_forms.FormControl<unknown>>;
1412
+ chatMode: _angular_forms.FormControl<string>;
1413
+ avatarDisplayMode: _angular_forms.FormControl<string>;
1393
1414
  }>;
1394
1415
  accounts: FormArray<_angular_forms.FormControl<unknown>>;
1395
1416
  conversationFlow: _angular_forms.FormGroup<{
@@ -1435,6 +1456,8 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1435
1456
  id: _angular_forms.FormControl<string>;
1436
1457
  }>;
1437
1458
  }>;
1459
+ live2d: _angular_forms.FormControl<any>;
1460
+ avatarType: _angular_forms.FormControl<any>;
1438
1461
  }>;
1439
1462
  protected patchForm(agentCard: IAgentCard): void;
1440
1463
  save(): Promise<IAgentCard | undefined>;
@@ -1459,7 +1482,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
1459
1482
  cloneVoice(): Promise<void>;
1460
1483
  deleteCard(): Promise<void>;
1461
1484
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DCAgentCardFormComponent, never>;
1462
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DCAgentCardFormComponent, "dc-agent-form", never, { "inputSettings": { "alias": "inputSettings"; "required": false; "isSignal": true; }; }, { "onSave": "onSave"; }, never, never, true, never>;
1485
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DCAgentCardFormComponent, "dc-agent-form", never, { "inputSettings": { "alias": "inputSettings"; "required": false; "isSignal": true; }; }, { "onSave": "onSave"; "onSelectLive2d": "onSelectLive2d"; }, never, never, true, never>;
1463
1486
  }
1464
1487
 
1465
1488
  declare class AgentCardListComponent extends EntityBaseListV2Component<IAgentCard> implements OnInit {
@@ -1482,6 +1505,84 @@ declare class AgentCardListComponent extends EntityBaseListV2Component<IAgentCar
1482
1505
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AgentCardListComponent, "dc-agent-card-lists", never, { "extraFilters": { "alias": "extraFilters"; "required": false; }; "persistenceKey": { "alias": "persistenceKey"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; "isSignal": true; }; "gridLayout": { "alias": "gridLayout"; "required": false; "isSignal": true; }; "customGetButtons": { "alias": "customGetButtons"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1483
1506
  }
1484
1507
 
1508
+ interface ModelParameters {
1509
+ count: number;
1510
+ ids: string[];
1511
+ minimumValues: number[];
1512
+ maximumValues: number[];
1513
+ defaultValues: number[];
1514
+ currentValues: number[];
1515
+ }
1516
+ interface ModelParts {
1517
+ count: number;
1518
+ ids: string[];
1519
+ opacities: number[];
1520
+ parentIndices: number[];
1521
+ }
1522
+
1523
+ declare class Live2dModelComponent implements AfterViewInit {
1524
+ canvasRef: ElementRef<HTMLCanvasElement>;
1525
+ modelPath: _angular_core.InputSignal<string>;
1526
+ scale: _angular_core.InputSignal<number>;
1527
+ zoom: _angular_core.InputSignal<number>;
1528
+ x: _angular_core.InputSignal<number>;
1529
+ y: _angular_core.InputSignal<number>;
1530
+ modelLoaded: _angular_core.OutputEmitterRef<{
1531
+ parameters: ModelParameters | null;
1532
+ parts: ModelParts | null;
1533
+ motions: string[];
1534
+ expressions: string[];
1535
+ }>;
1536
+ viewStateChanged: _angular_core.OutputEmitterRef<{
1537
+ zoom: number;
1538
+ x: number;
1539
+ y: number;
1540
+ }>;
1541
+ app: any;
1542
+ model: any;
1543
+ private live2dConfig;
1544
+ private modelParameters;
1545
+ private modelParts;
1546
+ private motionGroups;
1547
+ private expressions;
1548
+ private isViewInitialized;
1549
+ effectiveZoom: _angular_core.Signal<number>;
1550
+ private isDragging;
1551
+ private dragStart;
1552
+ private dragStartModel;
1553
+ constructor();
1554
+ ngAfterViewInit(): Promise<void>;
1555
+ initializeCanvas(): Promise<void>;
1556
+ loadModel(modelPath: string): Promise<void>;
1557
+ private updateModelTransform;
1558
+ private extractModelInfo;
1559
+ playAnimation(groupName: string): void;
1560
+ playRandomAnimation(): void;
1561
+ speak(audioUrl: string, options?: {
1562
+ volume?: number;
1563
+ crossOrigin?: string;
1564
+ focus?: boolean;
1565
+ }): void;
1566
+ stopSpeaking(): void;
1567
+ updateModelParameter(event: {
1568
+ id: string;
1569
+ value: number;
1570
+ index: number;
1571
+ }): void;
1572
+ setExpression(expressionName: string): void;
1573
+ onPointerDown(event: PointerEvent): void;
1574
+ onPointerMove(event: PointerEvent): void;
1575
+ onPointerUp(event: PointerEvent): void;
1576
+ private onWheel;
1577
+ getFaceTransform(): {
1578
+ zoom: number;
1579
+ x: number;
1580
+ y: number;
1581
+ } | null;
1582
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Live2dModelComponent, never>;
1583
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Live2dModelComponent, "app-live2d-model", never, { "modelPath": { "alias": "modelPath"; "required": true; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "x": { "alias": "x"; "required": false; "isSignal": true; }; "y": { "alias": "y"; "required": false; "isSignal": true; }; }, { "modelLoaded": "modelLoaded"; "viewStateChanged": "viewStateChanged"; }, never, never, true, never>;
1584
+ }
1585
+
1485
1586
  declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1486
1587
  private agentCardService;
1487
1588
  private route;
@@ -1492,16 +1593,28 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1492
1593
  videoPlayerService: VideoPlayerNativeService;
1493
1594
  agentCardId: string;
1494
1595
  useNativePlayer: boolean;
1596
+ activeAudioMessage: MessageContent | null;
1495
1597
  private _isConversationActive;
1496
1598
  set isConversationActive(val: boolean);
1497
1599
  get isConversationActive(): boolean;
1498
1600
  readonly onStartConversation: _angular_core.OutputEmitterRef<IAgentCard>;
1499
1601
  videoPlayerA: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1500
1602
  videoPlayerB: _angular_core.Signal<ElementRef<HTMLVideoElement>>;
1603
+ live2dModel: _angular_core.Signal<Live2dModelComponent>;
1501
1604
  agentCard: _angular_core.WritableSignal<IAgentCard>;
1502
1605
  showInfoLayer: _angular_core.WritableSignal<boolean>;
1503
- isTransparent: _angular_core.Signal<boolean>;
1504
1606
  isChatActive: _angular_core.Signal<boolean>;
1607
+ live2dZoomState: _angular_core.WritableSignal<number>;
1608
+ live2dXState: _angular_core.WritableSignal<number>;
1609
+ live2dYState: _angular_core.WritableSignal<number>;
1610
+ avatarDisplay: _angular_core.Signal<"transparent" | "card" | "fullscreen">;
1611
+ avatarType: _angular_core.Signal<"image" | "video" | "live2d" | "vroid">;
1612
+ model3JsonUrl: _angular_core.Signal<any>;
1613
+ onViewStateChanged(event: {
1614
+ zoom: number;
1615
+ x: number;
1616
+ y: number;
1617
+ }): void;
1505
1618
  constructor();
1506
1619
  ngOnDestroy(): void;
1507
1620
  ngOnInit(): Promise<void>;
@@ -1510,7 +1623,7 @@ declare class DcAgentCardConverseComponent implements OnInit, OnDestroy {
1510
1623
  startConversation(): void;
1511
1624
  toggleInfoLayer(): void;
1512
1625
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DcAgentCardConverseComponent, never>;
1513
- 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>;
1626
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DcAgentCardConverseComponent, "dc-agent-card-converse", never, { "agentCardId": { "alias": "agentCardId"; "required": false; }; "useNativePlayer": { "alias": "useNativePlayer"; "required": false; }; "activeAudioMessage": { "alias": "activeAudioMessage"; "required": false; }; "isConversationActive": { "alias": "isConversationActive"; "required": false; }; }, { "onStartConversation": "onStartConversation"; }, never, never, true, never>;
1514
1627
  }
1515
1628
 
1516
1629
  declare class DcAgentCardDetailComponent extends EntityBaseDetailComponent<IAgentCard> {
@@ -1894,5 +2007,5 @@ declare class ChatEngineTestComponent {
1894
2007
 
1895
2008
  declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
1896
2009
 
1897
- 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 };
1898
- 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 };
2010
+ 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, LIVE2D_CONFIG, Live2dModelComponent, 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, provideLive2D, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
2011
+ 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, Live2DConfig, ModelFormGroup, ModelName, ModelParameters, ModelParts, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };