@chanl/scenarios-core 0.4.0
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/LICENSE +21 -0
- package/dist/__tests__/e2e/test-helpers.d.ts +79 -0
- package/dist/__tests__/e2e/test-helpers.d.ts.map +1 -0
- package/dist/__tests__/e2e/test-helpers.js +162 -0
- package/dist/__tests__/e2e/test-helpers.js.map +1 -0
- package/dist/adapters/adapter-registry.d.ts +14 -0
- package/dist/adapters/adapter-registry.d.ts.map +1 -0
- package/dist/adapters/adapter-registry.js +53 -0
- package/dist/adapters/adapter-registry.js.map +1 -0
- package/dist/adapters/agent-adapter.interface.d.ts +70 -0
- package/dist/adapters/agent-adapter.interface.d.ts.map +1 -0
- package/dist/adapters/agent-adapter.interface.js +3 -0
- package/dist/adapters/agent-adapter.interface.js.map +1 -0
- package/dist/adapters/anthropic.adapter.d.ts +17 -0
- package/dist/adapters/anthropic.adapter.d.ts.map +1 -0
- package/dist/adapters/anthropic.adapter.js +145 -0
- package/dist/adapters/anthropic.adapter.js.map +1 -0
- package/dist/adapters/http.adapter.d.ts +17 -0
- package/dist/adapters/http.adapter.d.ts.map +1 -0
- package/dist/adapters/http.adapter.js +95 -0
- package/dist/adapters/http.adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +22 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai.adapter.d.ts +17 -0
- package/dist/adapters/openai.adapter.d.ts.map +1 -0
- package/dist/adapters/openai.adapter.js +133 -0
- package/dist/adapters/openai.adapter.js.map +1 -0
- package/dist/dataset/convert.d.ts +28 -0
- package/dist/dataset/convert.d.ts.map +1 -0
- package/dist/dataset/convert.js +94 -0
- package/dist/dataset/convert.js.map +1 -0
- package/dist/dataset/formats/dpo.d.ts +41 -0
- package/dist/dataset/formats/dpo.d.ts.map +1 -0
- package/dist/dataset/formats/dpo.js +79 -0
- package/dist/dataset/formats/dpo.js.map +1 -0
- package/dist/dataset/formats/index.d.ts +4 -0
- package/dist/dataset/formats/index.d.ts.map +1 -0
- package/dist/dataset/formats/index.js +13 -0
- package/dist/dataset/formats/index.js.map +1 -0
- package/dist/dataset/formats/openai.d.ts +29 -0
- package/dist/dataset/formats/openai.d.ts.map +1 -0
- package/dist/dataset/formats/openai.js +98 -0
- package/dist/dataset/formats/openai.js.map +1 -0
- package/dist/dataset/formats/sharegpt.d.ts +31 -0
- package/dist/dataset/formats/sharegpt.d.ts.map +1 -0
- package/dist/dataset/formats/sharegpt.js +76 -0
- package/dist/dataset/formats/sharegpt.js.map +1 -0
- package/dist/dataset/index.d.ts +4 -0
- package/dist/dataset/index.d.ts.map +1 -0
- package/dist/dataset/index.js +20 -0
- package/dist/dataset/index.js.map +1 -0
- package/dist/dataset/types.d.ts +108 -0
- package/dist/dataset/types.d.ts.map +1 -0
- package/dist/dataset/types.js +7 -0
- package/dist/dataset/types.js.map +1 -0
- package/dist/execution/agent-config-resolver.d.ts +44 -0
- package/dist/execution/agent-config-resolver.d.ts.map +1 -0
- package/dist/execution/agent-config-resolver.js +76 -0
- package/dist/execution/agent-config-resolver.js.map +1 -0
- package/dist/execution/execution-processor.d.ts +75 -0
- package/dist/execution/execution-processor.d.ts.map +1 -0
- package/dist/execution/execution-processor.js +569 -0
- package/dist/execution/execution-processor.js.map +1 -0
- package/dist/execution/execution.module.d.ts +3 -0
- package/dist/execution/execution.module.d.ts.map +1 -0
- package/dist/execution/execution.module.js +56 -0
- package/dist/execution/execution.module.js.map +1 -0
- package/dist/execution/execution.service.d.ts +52 -0
- package/dist/execution/execution.service.d.ts.map +1 -0
- package/dist/execution/execution.service.js +182 -0
- package/dist/execution/execution.service.js.map +1 -0
- package/dist/execution/index.d.ts +11 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +30 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/interfaces/job-data.interface.d.ts +38 -0
- package/dist/execution/interfaces/job-data.interface.d.ts.map +1 -0
- package/dist/execution/interfaces/job-data.interface.js +3 -0
- package/dist/execution/interfaces/job-data.interface.js.map +1 -0
- package/dist/execution/judge-llm.d.ts +35 -0
- package/dist/execution/judge-llm.d.ts.map +1 -0
- package/dist/execution/judge-llm.js +129 -0
- package/dist/execution/judge-llm.js.map +1 -0
- package/dist/execution/llm-config-resolver.d.ts +26 -0
- package/dist/execution/llm-config-resolver.d.ts.map +1 -0
- package/dist/execution/llm-config-resolver.js +99 -0
- package/dist/execution/llm-config-resolver.js.map +1 -0
- package/dist/execution/persona-llm.d.ts +29 -0
- package/dist/execution/persona-llm.d.ts.map +1 -0
- package/dist/execution/persona-llm.js +98 -0
- package/dist/execution/persona-llm.js.map +1 -0
- package/dist/execution/persona-strategy-registry.d.ts +14 -0
- package/dist/execution/persona-strategy-registry.d.ts.map +1 -0
- package/dist/execution/persona-strategy-registry.js +51 -0
- package/dist/execution/persona-strategy-registry.js.map +1 -0
- package/dist/execution/persona-strategy.interface.d.ts +88 -0
- package/dist/execution/persona-strategy.interface.d.ts.map +1 -0
- package/dist/execution/persona-strategy.interface.js +3 -0
- package/dist/execution/persona-strategy.interface.js.map +1 -0
- package/dist/execution/queue-producer.service.d.ts +21 -0
- package/dist/execution/queue-producer.service.d.ts.map +1 -0
- package/dist/execution/queue-producer.service.js +60 -0
- package/dist/execution/queue-producer.service.js.map +1 -0
- package/dist/execution/queues.config.d.ts +39 -0
- package/dist/execution/queues.config.d.ts.map +1 -0
- package/dist/execution/queues.config.js +43 -0
- package/dist/execution/queues.config.js.map +1 -0
- package/dist/execution/strategies/default.strategy.d.ts +11 -0
- package/dist/execution/strategies/default.strategy.d.ts.map +1 -0
- package/dist/execution/strategies/default.strategy.js +31 -0
- package/dist/execution/strategies/default.strategy.js.map +1 -0
- package/dist/execution/strategies/reactive.strategy.d.ts +28 -0
- package/dist/execution/strategies/reactive.strategy.d.ts.map +1 -0
- package/dist/execution/strategies/reactive.strategy.js +220 -0
- package/dist/execution/strategies/reactive.strategy.js.map +1 -0
- package/dist/execution/template-renderer.d.ts +52 -0
- package/dist/execution/template-renderer.d.ts.map +1 -0
- package/dist/execution/template-renderer.js +90 -0
- package/dist/execution/template-renderer.js.map +1 -0
- package/dist/generation/index.d.ts +2 -0
- package/dist/generation/index.d.ts.map +1 -0
- package/dist/generation/index.js +6 -0
- package/dist/generation/index.js.map +1 -0
- package/dist/generation/scenario-generator.service.d.ts +77 -0
- package/dist/generation/scenario-generator.service.d.ts.map +1 -0
- package/dist/generation/scenario-generator.service.js +272 -0
- package/dist/generation/scenario-generator.service.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/personas/dto/create-persona.dto.d.ts +61 -0
- package/dist/personas/dto/create-persona.dto.d.ts.map +1 -0
- package/dist/personas/dto/create-persona.dto.js +146 -0
- package/dist/personas/dto/create-persona.dto.js.map +1 -0
- package/dist/personas/dto/index.d.ts +3 -0
- package/dist/personas/dto/index.d.ts.map +1 -0
- package/dist/personas/dto/index.js +19 -0
- package/dist/personas/dto/index.js.map +1 -0
- package/dist/personas/dto/update-persona.dto.d.ts +8 -0
- package/dist/personas/dto/update-persona.dto.d.ts.map +1 -0
- package/dist/personas/dto/update-persona.dto.js +29 -0
- package/dist/personas/dto/update-persona.dto.js.map +1 -0
- package/dist/personas/index.d.ts +6 -0
- package/dist/personas/index.d.ts.map +1 -0
- package/dist/personas/index.js +22 -0
- package/dist/personas/index.js.map +1 -0
- package/dist/personas/persona.controller.d.ts +69 -0
- package/dist/personas/persona.controller.d.ts.map +1 -0
- package/dist/personas/persona.controller.js +282 -0
- package/dist/personas/persona.controller.js.map +1 -0
- package/dist/personas/persona.module.d.ts +3 -0
- package/dist/personas/persona.module.d.ts.map +1 -0
- package/dist/personas/persona.module.js +28 -0
- package/dist/personas/persona.module.js.map +1 -0
- package/dist/personas/persona.service.d.ts +85 -0
- package/dist/personas/persona.service.d.ts.map +1 -0
- package/dist/personas/persona.service.js +382 -0
- package/dist/personas/persona.service.js.map +1 -0
- package/dist/personas/schemas/persona.schema.d.ts +90 -0
- package/dist/personas/schemas/persona.schema.d.ts.map +1 -0
- package/dist/personas/schemas/persona.schema.js +321 -0
- package/dist/personas/schemas/persona.schema.js.map +1 -0
- package/dist/scenarios/controllers/scenario-execution.controller.d.ts +48 -0
- package/dist/scenarios/controllers/scenario-execution.controller.d.ts.map +1 -0
- package/dist/scenarios/controllers/scenario-execution.controller.js +260 -0
- package/dist/scenarios/controllers/scenario-execution.controller.js.map +1 -0
- package/dist/scenarios/controllers/scenario.controller.d.ts +81 -0
- package/dist/scenarios/controllers/scenario.controller.d.ts.map +1 -0
- package/dist/scenarios/controllers/scenario.controller.js +345 -0
- package/dist/scenarios/controllers/scenario.controller.js.map +1 -0
- package/dist/scenarios/dto/create-scenario.dto.d.ts +31 -0
- package/dist/scenarios/dto/create-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/create-scenario.dto.js +102 -0
- package/dist/scenarios/dto/create-scenario.dto.js.map +1 -0
- package/dist/scenarios/dto/execute-scenario.dto.d.ts +34 -0
- package/dist/scenarios/dto/execute-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/execute-scenario.dto.js +150 -0
- package/dist/scenarios/dto/execute-scenario.dto.js.map +1 -0
- package/dist/scenarios/dto/index.d.ts +4 -0
- package/dist/scenarios/dto/index.d.ts.map +1 -0
- package/dist/scenarios/dto/index.js +20 -0
- package/dist/scenarios/dto/index.js.map +1 -0
- package/dist/scenarios/dto/update-scenario.dto.d.ts +6 -0
- package/dist/scenarios/dto/update-scenario.dto.d.ts.map +1 -0
- package/dist/scenarios/dto/update-scenario.dto.js +9 -0
- package/dist/scenarios/dto/update-scenario.dto.js.map +1 -0
- package/dist/scenarios/index.d.ts +9 -0
- package/dist/scenarios/index.d.ts.map +1 -0
- package/dist/scenarios/index.js +25 -0
- package/dist/scenarios/index.js.map +1 -0
- package/dist/scenarios/scenario.module.d.ts +3 -0
- package/dist/scenarios/scenario.module.d.ts.map +1 -0
- package/dist/scenarios/scenario.module.js +42 -0
- package/dist/scenarios/scenario.module.js.map +1 -0
- package/dist/scenarios/schemas/scenario-execution.schema.d.ts +133 -0
- package/dist/scenarios/schemas/scenario-execution.schema.d.ts.map +1 -0
- package/dist/scenarios/schemas/scenario-execution.schema.js +292 -0
- package/dist/scenarios/schemas/scenario-execution.schema.js.map +1 -0
- package/dist/scenarios/schemas/scenario.schema.d.ts +106 -0
- package/dist/scenarios/schemas/scenario.schema.d.ts.map +1 -0
- package/dist/scenarios/schemas/scenario.schema.js +205 -0
- package/dist/scenarios/schemas/scenario.schema.js.map +1 -0
- package/dist/scenarios/services/scenario-execution.service.d.ts +73 -0
- package/dist/scenarios/services/scenario-execution.service.d.ts.map +1 -0
- package/dist/scenarios/services/scenario-execution.service.js +505 -0
- package/dist/scenarios/services/scenario-execution.service.js.map +1 -0
- package/dist/scenarios/services/scenario.service.d.ts +110 -0
- package/dist/scenarios/services/scenario.service.d.ts.map +1 -0
- package/dist/scenarios/services/scenario.service.js +608 -0
- package/dist/scenarios/services/scenario.service.js.map +1 -0
- package/dist/simulator/index.d.ts +2 -0
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +18 -0
- package/dist/simulator/index.js.map +1 -0
- package/dist/simulator/persona-simulator.service.d.ts +81 -0
- package/dist/simulator/persona-simulator.service.d.ts.map +1 -0
- package/dist/simulator/persona-simulator.service.js +358 -0
- package/dist/simulator/persona-simulator.service.js.map +1 -0
- package/dist/templates/dto/create-template.dto.d.ts +16 -0
- package/dist/templates/dto/create-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/create-template.dto.js +75 -0
- package/dist/templates/dto/create-template.dto.js.map +1 -0
- package/dist/templates/dto/index.d.ts +4 -0
- package/dist/templates/dto/index.d.ts.map +1 -0
- package/dist/templates/dto/index.js +10 -0
- package/dist/templates/dto/index.js.map +1 -0
- package/dist/templates/dto/instantiate-template.dto.d.ts +7 -0
- package/dist/templates/dto/instantiate-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/instantiate-template.dto.js +38 -0
- package/dist/templates/dto/instantiate-template.dto.js.map +1 -0
- package/dist/templates/dto/update-template.dto.d.ts +6 -0
- package/dist/templates/dto/update-template.dto.d.ts.map +1 -0
- package/dist/templates/dto/update-template.dto.js +9 -0
- package/dist/templates/dto/update-template.dto.js.map +1 -0
- package/dist/templates/index.d.ts +6 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +22 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/scenario-template.controller.d.ts +42 -0
- package/dist/templates/scenario-template.controller.d.ts.map +1 -0
- package/dist/templates/scenario-template.controller.js +148 -0
- package/dist/templates/scenario-template.controller.js.map +1 -0
- package/dist/templates/scenario-template.module.d.ts +3 -0
- package/dist/templates/scenario-template.module.d.ts.map +1 -0
- package/dist/templates/scenario-template.module.js +30 -0
- package/dist/templates/scenario-template.module.js.map +1 -0
- package/dist/templates/scenario-template.service.d.ts +50 -0
- package/dist/templates/scenario-template.service.d.ts.map +1 -0
- package/dist/templates/scenario-template.service.js +497 -0
- package/dist/templates/scenario-template.service.js.map +1 -0
- package/dist/templates/schemas/scenario-template.schema.d.ts +59 -0
- package/dist/templates/schemas/scenario-template.schema.d.ts.map +1 -0
- package/dist/templates/schemas/scenario-template.schema.js +132 -0
- package/dist/templates/schemas/scenario-template.schema.js.map +1 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.d.ts +18 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.js +46 -0
- package/dist/tool-fixtures/dto/create-tool-fixture.dto.js.map +1 -0
- package/dist/tool-fixtures/dto/index.d.ts +4 -0
- package/dist/tool-fixtures/dto/index.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/index.js +20 -0
- package/dist/tool-fixtures/dto/index.js.map +1 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.d.ts +6 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.js +33 -0
- package/dist/tool-fixtures/dto/tool-fixture-filter.dto.js.map +1 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.d.ts +6 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.d.ts.map +1 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.js +9 -0
- package/dist/tool-fixtures/dto/update-tool-fixture.dto.js.map +1 -0
- package/dist/tool-fixtures/index.d.ts +7 -0
- package/dist/tool-fixtures/index.d.ts.map +1 -0
- package/dist/tool-fixtures/index.js +23 -0
- package/dist/tool-fixtures/index.js.map +1 -0
- package/dist/tool-fixtures/mock-resolver.service.d.ts +48 -0
- package/dist/tool-fixtures/mock-resolver.service.d.ts.map +1 -0
- package/dist/tool-fixtures/mock-resolver.service.js +99 -0
- package/dist/tool-fixtures/mock-resolver.service.js.map +1 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.d.ts +35 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.d.ts.map +1 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.js +87 -0
- package/dist/tool-fixtures/schemas/tool-fixture.schema.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.controller.d.ts +45 -0
- package/dist/tool-fixtures/tool-fixture.controller.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.controller.js +223 -0
- package/dist/tool-fixtures/tool-fixture.controller.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.module.d.ts +3 -0
- package/dist/tool-fixtures/tool-fixture.module.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.module.js +31 -0
- package/dist/tool-fixtures/tool-fixture.module.js.map +1 -0
- package/dist/tool-fixtures/tool-fixture.service.d.ts +59 -0
- package/dist/tool-fixtures/tool-fixture.service.d.ts.map +1 -0
- package/dist/tool-fixtures/tool-fixture.service.js +198 -0
- package/dist/tool-fixtures/tool-fixture.service.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface PersonaTraits {
|
|
2
|
+
name: string;
|
|
3
|
+
emotion: string;
|
|
4
|
+
speechStyle: string;
|
|
5
|
+
intentClarity: string;
|
|
6
|
+
backgroundNoise?: boolean;
|
|
7
|
+
description?: string;
|
|
8
|
+
backstory?: string;
|
|
9
|
+
gender?: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
accent?: string;
|
|
12
|
+
behavior?: {
|
|
13
|
+
personality?: string;
|
|
14
|
+
emotionalState?: string;
|
|
15
|
+
cooperationLevel?: string;
|
|
16
|
+
patience?: string;
|
|
17
|
+
communicationStyle?: string;
|
|
18
|
+
};
|
|
19
|
+
conversationTraits?: {
|
|
20
|
+
allowInterruptions?: boolean;
|
|
21
|
+
interruptionFrequency?: string;
|
|
22
|
+
asksClarifyingQuestions?: boolean;
|
|
23
|
+
repeatsInformation?: boolean;
|
|
24
|
+
goesOffTopic?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Custom key-value attributes from the persona editor */
|
|
27
|
+
variables?: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
export interface VoiceConfig {
|
|
30
|
+
voiceId: string;
|
|
31
|
+
provider: string;
|
|
32
|
+
speed: number;
|
|
33
|
+
emotion: string;
|
|
34
|
+
backgroundNoise: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare class PersonaSimulatorService {
|
|
37
|
+
/**
|
|
38
|
+
* Convert persona traits into an LLM system prompt.
|
|
39
|
+
*
|
|
40
|
+
* OSS version: covers basic trait mapping, cooperation levels, patience,
|
|
41
|
+
* conversation flow, and character building. Produces meaningfully different
|
|
42
|
+
* conversations between e.g. a hostile persona vs a cooperative one.
|
|
43
|
+
*
|
|
44
|
+
* chanl cloud extends this with: emotional arcs (escalation/de-escalation),
|
|
45
|
+
* reactive behaviors (jargon/apology detection), negotiation tactics,
|
|
46
|
+
* voice-native speech patterns, and Liquid template customization.
|
|
47
|
+
*/
|
|
48
|
+
toSystemPrompt(persona: PersonaTraits, scenarioPrompt: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Build a character paragraph from combined persona traits.
|
|
51
|
+
*/
|
|
52
|
+
private buildCharacterParagraph;
|
|
53
|
+
/**
|
|
54
|
+
* Get patience-based reactions to common agent behaviors.
|
|
55
|
+
*/
|
|
56
|
+
private getPatienceReactions;
|
|
57
|
+
/**
|
|
58
|
+
* Get negotiation style based on cooperation level.
|
|
59
|
+
*/
|
|
60
|
+
private getNegotiationStyle;
|
|
61
|
+
/**
|
|
62
|
+
* Build conversation habit list from traits.
|
|
63
|
+
*/
|
|
64
|
+
private getConversationHabits;
|
|
65
|
+
/**
|
|
66
|
+
* Get voice configuration for voice mode
|
|
67
|
+
*/
|
|
68
|
+
getVoiceConfig(persona: PersonaTraits): VoiceConfig;
|
|
69
|
+
/**
|
|
70
|
+
* Check if persona should interrupt based on frequency
|
|
71
|
+
*/
|
|
72
|
+
shouldInterrupt(persona: PersonaTraits): boolean;
|
|
73
|
+
private getEmotionPrompt;
|
|
74
|
+
private getCommunicationStylePrompt;
|
|
75
|
+
private getIntentClarityPrompt;
|
|
76
|
+
private getCooperationPrompt;
|
|
77
|
+
private getPatiencePrompt;
|
|
78
|
+
private getInterruptionPrompt;
|
|
79
|
+
private getVoiceSpeed;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=persona-simulator.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-simulator.service.d.ts","sourceRoot":"","sources":["../../src/simulator/persona-simulator.service.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IAC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;IACH,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW;IAgBnD;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAchD,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,2BAA2B;IAiCnC,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PersonaSimulatorService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let PersonaSimulatorService = class PersonaSimulatorService {
|
|
12
|
+
/**
|
|
13
|
+
* Convert persona traits into an LLM system prompt.
|
|
14
|
+
*
|
|
15
|
+
* OSS version: covers basic trait mapping, cooperation levels, patience,
|
|
16
|
+
* conversation flow, and character building. Produces meaningfully different
|
|
17
|
+
* conversations between e.g. a hostile persona vs a cooperative one.
|
|
18
|
+
*
|
|
19
|
+
* chanl cloud extends this with: emotional arcs (escalation/de-escalation),
|
|
20
|
+
* reactive behaviors (jargon/apology detection), negotiation tactics,
|
|
21
|
+
* voice-native speech patterns, and Liquid template customization.
|
|
22
|
+
*/
|
|
23
|
+
toSystemPrompt(persona, scenarioPrompt) {
|
|
24
|
+
const parts = [];
|
|
25
|
+
// Character identity
|
|
26
|
+
parts.push(`You are ${persona.name || 'a customer'}.`);
|
|
27
|
+
// Character paragraph — build from available traits
|
|
28
|
+
const characterParagraph = this.buildCharacterParagraph(persona);
|
|
29
|
+
if (characterParagraph) {
|
|
30
|
+
parts.push('');
|
|
31
|
+
parts.push('## Who you are');
|
|
32
|
+
parts.push(characterParagraph);
|
|
33
|
+
}
|
|
34
|
+
// Scenario context
|
|
35
|
+
parts.push('');
|
|
36
|
+
parts.push("## Why you're contacting support");
|
|
37
|
+
parts.push(scenarioPrompt);
|
|
38
|
+
// Emotional state
|
|
39
|
+
parts.push('');
|
|
40
|
+
parts.push('## Emotional State');
|
|
41
|
+
parts.push(this.getEmotionPrompt(persona.emotion));
|
|
42
|
+
// Communication style
|
|
43
|
+
parts.push('');
|
|
44
|
+
parts.push('## Communication Style');
|
|
45
|
+
parts.push(this.getCommunicationStylePrompt(persona));
|
|
46
|
+
// Intent clarity
|
|
47
|
+
parts.push('');
|
|
48
|
+
parts.push('## How to Express Your Needs');
|
|
49
|
+
parts.push(this.getIntentClarityPrompt(persona.intentClarity));
|
|
50
|
+
// Cooperation — what you'll accept and when you'll escalate
|
|
51
|
+
const cooperation = persona.behavior?.cooperationLevel;
|
|
52
|
+
if (cooperation) {
|
|
53
|
+
const negotiation = this.getNegotiationStyle(cooperation);
|
|
54
|
+
parts.push('');
|
|
55
|
+
parts.push('## What you want');
|
|
56
|
+
parts.push(`- Goal: Get your issue resolved`);
|
|
57
|
+
parts.push(`- You'll accept: ${negotiation.acceptable}`);
|
|
58
|
+
parts.push(`- You'll escalate if: ${negotiation.escalation}`);
|
|
59
|
+
parts.push("- You're satisfied when: the agent confirms a specific resolution, not vague promises");
|
|
60
|
+
parts.push('');
|
|
61
|
+
parts.push('## Cooperation Level');
|
|
62
|
+
parts.push(this.getCooperationPrompt(cooperation));
|
|
63
|
+
}
|
|
64
|
+
// Patience — how you react to delays, repeats, scripts
|
|
65
|
+
const patience = persona.behavior?.patience;
|
|
66
|
+
if (patience) {
|
|
67
|
+
const reactions = this.getPatienceReactions(patience);
|
|
68
|
+
parts.push('');
|
|
69
|
+
parts.push('## Patience & Reactions');
|
|
70
|
+
parts.push(this.getPatiencePrompt(patience));
|
|
71
|
+
parts.push(`- If agent makes you repeat yourself → ${reactions.repeat}`);
|
|
72
|
+
parts.push(`- If agent gives scripted response → ${reactions.scripted}`);
|
|
73
|
+
parts.push(`- If agent asks for verification → ${reactions.verification}`);
|
|
74
|
+
}
|
|
75
|
+
// Conversation flow guidance
|
|
76
|
+
parts.push('');
|
|
77
|
+
parts.push('## How the conversation flows');
|
|
78
|
+
parts.push("OPENING: State your reason in 1-2 sentences. Don't dump your whole story.");
|
|
79
|
+
parts.push("EXPLAINING: Give details when asked. Add info gradually. Don't repeat what you already said.");
|
|
80
|
+
const negotiation = this.getNegotiationStyle(cooperation || 'cooperative');
|
|
81
|
+
parts.push(`NEGOTIATING: ${negotiation.style}`);
|
|
82
|
+
parts.push('CLOSING: If satisfied, confirm details and wrap up. If not, express disappointment.');
|
|
83
|
+
// Interruption behavior
|
|
84
|
+
const interruptionFrequency = persona.conversationTraits?.interruptionFrequency;
|
|
85
|
+
if (interruptionFrequency && interruptionFrequency !== 'never') {
|
|
86
|
+
parts.push('');
|
|
87
|
+
parts.push('## Interruption Behavior');
|
|
88
|
+
parts.push(this.getInterruptionPrompt(interruptionFrequency));
|
|
89
|
+
}
|
|
90
|
+
// Conversation habits
|
|
91
|
+
if (persona.conversationTraits) {
|
|
92
|
+
const habits = this.getConversationHabits(persona.conversationTraits);
|
|
93
|
+
if (habits.length) {
|
|
94
|
+
parts.push('');
|
|
95
|
+
parts.push('## Your conversation habits');
|
|
96
|
+
habits.forEach((h) => parts.push(`- ${h}`));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Backstory
|
|
100
|
+
if (persona.backstory) {
|
|
101
|
+
parts.push('');
|
|
102
|
+
parts.push('## Your Background');
|
|
103
|
+
parts.push(persona.backstory);
|
|
104
|
+
}
|
|
105
|
+
// Custom variables — the persona's own details (order ID, email, etc.)
|
|
106
|
+
if (persona.variables && Object.keys(persona.variables).length > 0) {
|
|
107
|
+
parts.push('');
|
|
108
|
+
parts.push('## Your Details');
|
|
109
|
+
parts.push('These are YOUR details as a customer. Provide them when the agent asks or when relevant:');
|
|
110
|
+
for (const [key, value] of Object.entries(persona.variables)) {
|
|
111
|
+
const label = key
|
|
112
|
+
.replace(/_/g, ' ')
|
|
113
|
+
.replace(/\b\w/g, (c) => c.toUpperCase());
|
|
114
|
+
parts.push(`- ${label}: ${value}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Pacing guidance
|
|
118
|
+
parts.push('');
|
|
119
|
+
parts.push('## Pacing');
|
|
120
|
+
parts.push("- Don't repeat your issue after the agent acknowledges it");
|
|
121
|
+
parts.push("- Don't restate details you already provided — move the conversation forward");
|
|
122
|
+
parts.push("- If the agent resolved your issue, confirm and say goodbye — don't drag it out");
|
|
123
|
+
parts.push('- If nothing is progressing after several exchanges, mention you need to get going');
|
|
124
|
+
// Final instruction
|
|
125
|
+
parts.push('');
|
|
126
|
+
parts.push('Stay in character throughout the conversation. You are the CUSTOMER, not the agent. Never switch roles.');
|
|
127
|
+
return parts.join('\n');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Build a character paragraph from combined persona traits.
|
|
131
|
+
*/
|
|
132
|
+
buildCharacterParagraph(persona) {
|
|
133
|
+
const parts = [];
|
|
134
|
+
if (persona.description)
|
|
135
|
+
parts.push(persona.description);
|
|
136
|
+
if (persona.backstory)
|
|
137
|
+
parts.push(persona.backstory);
|
|
138
|
+
const traitFragments = [];
|
|
139
|
+
if (persona.emotion && persona.emotion !== 'neutral')
|
|
140
|
+
traitFragments.push(`feeling ${persona.emotion}`);
|
|
141
|
+
if (persona.behavior?.personality)
|
|
142
|
+
traitFragments.push(persona.behavior.personality);
|
|
143
|
+
if (persona.behavior?.patience)
|
|
144
|
+
traitFragments.push(`${persona.behavior.patience} patience`);
|
|
145
|
+
if (persona.behavior?.communicationStyle)
|
|
146
|
+
traitFragments.push(`${persona.behavior.communicationStyle} communicator`);
|
|
147
|
+
if (traitFragments.length) {
|
|
148
|
+
parts.push(`You're ${traitFragments.join(', ')}.`);
|
|
149
|
+
}
|
|
150
|
+
if (persona.speechStyle && persona.speechStyle !== 'normal') {
|
|
151
|
+
parts.push(`You tend to speak at a ${persona.speechStyle} pace.`);
|
|
152
|
+
}
|
|
153
|
+
return (parts.join(' ') ||
|
|
154
|
+
`A customer who is feeling ${persona.emotion || 'neutral'}.`);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get patience-based reactions to common agent behaviors.
|
|
158
|
+
*/
|
|
159
|
+
getPatienceReactions(patience) {
|
|
160
|
+
switch (patience) {
|
|
161
|
+
case 'very impatient':
|
|
162
|
+
return {
|
|
163
|
+
repeat: 'visibly annoyed, voice gets terse',
|
|
164
|
+
scripted: '"I need an actual answer, not a script."',
|
|
165
|
+
verification: 'sigh, give info quickly',
|
|
166
|
+
};
|
|
167
|
+
case 'impatient':
|
|
168
|
+
return {
|
|
169
|
+
repeat: 'more irritated each time',
|
|
170
|
+
scripted: 'push harder for a real answer',
|
|
171
|
+
verification: 'comply quickly, slight edge in voice',
|
|
172
|
+
};
|
|
173
|
+
case 'patient':
|
|
174
|
+
case 'very patient':
|
|
175
|
+
return {
|
|
176
|
+
repeat: 'comply but note you already mentioned it',
|
|
177
|
+
scripted: 'listen politely, then redirect to your situation',
|
|
178
|
+
verification: 'cooperate easily',
|
|
179
|
+
};
|
|
180
|
+
default:
|
|
181
|
+
// neutral
|
|
182
|
+
return {
|
|
183
|
+
repeat: 'mildly frustrated but comply',
|
|
184
|
+
scripted: '"I appreciate that, but my situation is different..."',
|
|
185
|
+
verification: 'cooperate normally',
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get negotiation style based on cooperation level.
|
|
191
|
+
*/
|
|
192
|
+
getNegotiationStyle(cooperation) {
|
|
193
|
+
switch (cooperation) {
|
|
194
|
+
case 'hostile':
|
|
195
|
+
case 'difficult':
|
|
196
|
+
return {
|
|
197
|
+
acceptable: 'only a full resolution — no half-measures',
|
|
198
|
+
escalation: 'agent stalls, deflects, or offers less than promised',
|
|
199
|
+
style: "Push hard. Don't accept the first offer. Demand specifics.",
|
|
200
|
+
};
|
|
201
|
+
case 'very cooperative':
|
|
202
|
+
return {
|
|
203
|
+
acceptable: 'a reasonable compromise with clear next steps',
|
|
204
|
+
escalation: 'agent is dismissive or refuses to help entirely',
|
|
205
|
+
style: 'Accept a good offer readily. Thank the agent for their help.',
|
|
206
|
+
};
|
|
207
|
+
default:
|
|
208
|
+
// cooperative, neutral
|
|
209
|
+
return {
|
|
210
|
+
acceptable: 'a fair resolution with a specific commitment',
|
|
211
|
+
escalation: 'agent refuses without checking or gives the runaround',
|
|
212
|
+
style: "Push once if the first offer isn't enough. Accept with good reason.",
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Build conversation habit list from traits.
|
|
218
|
+
*/
|
|
219
|
+
getConversationHabits(traits) {
|
|
220
|
+
if (!traits)
|
|
221
|
+
return [];
|
|
222
|
+
const habits = [];
|
|
223
|
+
if (traits.goesOffTopic)
|
|
224
|
+
habits.push('You occasionally go off-topic with a brief tangent before getting back on track.');
|
|
225
|
+
if (traits.repeatsInformation)
|
|
226
|
+
habits.push('You tend to repeat key details to make sure the agent heard you.');
|
|
227
|
+
if (traits.asksClarifyingQuestions)
|
|
228
|
+
habits.push("You ask clarifying questions when something isn't clear.");
|
|
229
|
+
if (traits.interruptionFrequency === 'often')
|
|
230
|
+
habits.push('You tend to interject before the agent finishes.');
|
|
231
|
+
return habits;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get voice configuration for voice mode
|
|
235
|
+
*/
|
|
236
|
+
getVoiceConfig(persona) {
|
|
237
|
+
const baseMapping = {
|
|
238
|
+
male: { voiceId: 'josh', provider: 'elevenlabs' },
|
|
239
|
+
female: { voiceId: 'rachel', provider: 'elevenlabs' },
|
|
240
|
+
};
|
|
241
|
+
const base = baseMapping[persona.gender || 'female'] || baseMapping.female;
|
|
242
|
+
return {
|
|
243
|
+
...base,
|
|
244
|
+
speed: this.getVoiceSpeed(persona.speechStyle),
|
|
245
|
+
emotion: persona.emotion,
|
|
246
|
+
backgroundNoise: persona.backgroundNoise || false,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Check if persona should interrupt based on frequency
|
|
251
|
+
*/
|
|
252
|
+
shouldInterrupt(persona) {
|
|
253
|
+
const freq = persona.conversationTraits?.interruptionFrequency;
|
|
254
|
+
if (!freq || freq === 'never')
|
|
255
|
+
return false;
|
|
256
|
+
const probabilities = {
|
|
257
|
+
rarely: 0.2,
|
|
258
|
+
sometimes: 0.5,
|
|
259
|
+
often: 0.8,
|
|
260
|
+
frequently: 0.8,
|
|
261
|
+
};
|
|
262
|
+
return Math.random() < (probabilities[freq] || 0);
|
|
263
|
+
}
|
|
264
|
+
getEmotionPrompt(emotion) {
|
|
265
|
+
const prompts = {
|
|
266
|
+
friendly: 'You are friendly and warm. Use polite language and show appreciation.',
|
|
267
|
+
polite: 'You are polite and courteous. Use formal language and express gratitude.',
|
|
268
|
+
neutral: 'You are calm and neutral. Express yourself matter-of-factly without strong emotion.',
|
|
269
|
+
calm: 'You are calm and composed. Speak steadily without rushing or showing anxiety.',
|
|
270
|
+
concerned: 'You are concerned and worried. Express your worry about the situation and ask for reassurance.',
|
|
271
|
+
stressed: 'You are stressed and overwhelmed. Speak quickly, express urgency, and may become flustered.',
|
|
272
|
+
annoyed: 'You are annoyed and short-tempered. Express mild displeasure and be somewhat curt.',
|
|
273
|
+
frustrated: 'You are frustrated and impatient. Express dissatisfaction with delays, unclear answers, or repeated questions.',
|
|
274
|
+
irritated: 'You are irritated and on edge. Be confrontational when provoked. Express your displeasure clearly.',
|
|
275
|
+
curious: 'You are curious and inquisitive. Ask many follow-up questions. Want to understand everything fully.',
|
|
276
|
+
distracted: 'You are distracted and not fully focused. Sometimes lose track of the conversation. Ask the agent to repeat things.',
|
|
277
|
+
};
|
|
278
|
+
return prompts[emotion] || prompts.neutral;
|
|
279
|
+
}
|
|
280
|
+
getCommunicationStylePrompt(persona) {
|
|
281
|
+
const parts = [];
|
|
282
|
+
const speechPrompts = {
|
|
283
|
+
fast: "Keep your responses short and to the point. Don't elaborate unless asked.",
|
|
284
|
+
slow: 'Take your time responding. Provide detailed explanations and think through your questions.',
|
|
285
|
+
normal: 'Respond at a normal pace with moderate detail.',
|
|
286
|
+
moderate: 'Respond at a measured pace. Neither too brief nor too verbose.',
|
|
287
|
+
};
|
|
288
|
+
parts.push(speechPrompts[persona.speechStyle] || speechPrompts.normal);
|
|
289
|
+
const commStyle = persona.behavior?.communicationStyle;
|
|
290
|
+
if (commStyle) {
|
|
291
|
+
const commPrompts = {
|
|
292
|
+
direct: "Be direct and to the point. Don't use unnecessary pleasantries.",
|
|
293
|
+
indirect: 'Express your needs indirectly. Hint at problems rather than stating them outright.',
|
|
294
|
+
verbose: 'Provide lots of detail. Explain your situation at length before getting to the point.',
|
|
295
|
+
concise: 'Be brief and efficient with words. Say only what is necessary.',
|
|
296
|
+
rambling: 'Provide lengthy, meandering responses. Go off on tangents. Include unnecessary details.',
|
|
297
|
+
};
|
|
298
|
+
const prompt = commPrompts[commStyle];
|
|
299
|
+
if (prompt)
|
|
300
|
+
parts.push(prompt);
|
|
301
|
+
}
|
|
302
|
+
return parts.join(' ');
|
|
303
|
+
}
|
|
304
|
+
getIntentClarityPrompt(intentClarity) {
|
|
305
|
+
const prompts = {
|
|
306
|
+
'very clear': 'State your needs clearly and specifically from the start. Provide all relevant details upfront.',
|
|
307
|
+
'slightly unclear': 'State your general need but leave out some details. Provide more information when asked.',
|
|
308
|
+
slurred: "Mumble and be unclear. Don't enunciate your words well. Make the agent ask for clarification.",
|
|
309
|
+
'slightly slurred': 'Speak somewhat unclearly. Occasionally be hard to understand.',
|
|
310
|
+
mumbled: "Be very unclear in how you express yourself. Don't state your actual need directly.",
|
|
311
|
+
unclear: 'Be vague about what you need. Make the agent work to understand your request. Reveal information slowly.',
|
|
312
|
+
};
|
|
313
|
+
return prompts[intentClarity] || prompts['slightly unclear'];
|
|
314
|
+
}
|
|
315
|
+
getCooperationPrompt(level) {
|
|
316
|
+
const prompts = {
|
|
317
|
+
'very cooperative': 'Be extremely cooperative. Answer all questions fully. Follow instructions immediately.',
|
|
318
|
+
cooperative: 'Be cooperative and helpful. Answer questions and follow reasonable instructions.',
|
|
319
|
+
neutral: 'Be neutral in your cooperation. Answer direct questions but do not volunteer extra information.',
|
|
320
|
+
difficult: "Be somewhat resistant and skeptical. Question the agent's suggestions. Provide your details when asked directly, but don't volunteer extra information. Make the agent earn your trust.",
|
|
321
|
+
hostile: 'Be hostile and confrontational. Push hard for what you want. When the agent asks for your details (name, order number, email), provide them grudgingly — you shouldn\'t have to repeat yourself. Challenge solutions the agent proposes. Demand better options or escalation.',
|
|
322
|
+
};
|
|
323
|
+
return prompts[level] || prompts.cooperative;
|
|
324
|
+
}
|
|
325
|
+
getPatiencePrompt(patience) {
|
|
326
|
+
const prompts = {
|
|
327
|
+
'very patient': 'Be extremely patient. Wait calmly for responses. Never express frustration about delays.',
|
|
328
|
+
patient: 'Be patient with the agent. Allow time for them to look things up or explain.',
|
|
329
|
+
neutral: 'Have normal patience. Tolerate reasonable wait times but note if things take too long.',
|
|
330
|
+
impatient: 'Be impatient. Express frustration with delays. Ask "how long will this take?" frequently.',
|
|
331
|
+
'very impatient': 'Be extremely impatient. Demand immediate answers. Threaten to escalate or leave if things take too long.',
|
|
332
|
+
};
|
|
333
|
+
return prompts[patience] || prompts.neutral;
|
|
334
|
+
}
|
|
335
|
+
getInterruptionPrompt(frequency) {
|
|
336
|
+
const prompts = {
|
|
337
|
+
rarely: 'Occasionally interrupt if the agent takes too long to respond.',
|
|
338
|
+
sometimes: "Interrupt the agent sometimes, especially if they're being too verbose.",
|
|
339
|
+
often: "Frequently interrupt the agent mid-response with follow-up questions or comments. Don't let them finish long explanations.",
|
|
340
|
+
frequently: "Frequently interrupt the agent mid-response with follow-up questions or comments. Don't let them finish long explanations.",
|
|
341
|
+
};
|
|
342
|
+
return prompts[frequency] || '';
|
|
343
|
+
}
|
|
344
|
+
getVoiceSpeed(speechStyle) {
|
|
345
|
+
const speeds = {
|
|
346
|
+
fast: 1.2,
|
|
347
|
+
slow: 0.8,
|
|
348
|
+
normal: 1.0,
|
|
349
|
+
moderate: 1.0,
|
|
350
|
+
};
|
|
351
|
+
return speeds[speechStyle] || 1.0;
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
exports.PersonaSimulatorService = PersonaSimulatorService;
|
|
355
|
+
exports.PersonaSimulatorService = PersonaSimulatorService = __decorate([
|
|
356
|
+
(0, common_1.Injectable)()
|
|
357
|
+
], PersonaSimulatorService);
|
|
358
|
+
//# sourceMappingURL=persona-simulator.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-simulator.service.js","sourceRoot":"","sources":["../../src/simulator/persona-simulator.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAwCrC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAsB,EAAE,cAAsB;QAC3D,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,qBAAqB;QACrB,KAAK,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,IAAI,IAAI,YAAY,GAAG,CAAC,CAAC;QAEvD,oDAAoD;QACpD,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,kBAAkB,EAAE,CAAC;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E,GAAG;SACd,CAAC;QACF,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC;IACpC,CAAC;CACF,CAAA;AA7cY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;GACA,uBAAuB,CA6cnC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TemplateVariable, TemplateStep } from '../schemas/scenario-template.schema';
|
|
2
|
+
export declare class CreateTemplateDto {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
category: string;
|
|
6
|
+
visibility?: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
difficulty?: string;
|
|
10
|
+
variables?: TemplateVariable[];
|
|
11
|
+
steps?: TemplateStep[];
|
|
12
|
+
defaultPersonaConfig?: Record<string, any>;
|
|
13
|
+
defaultScoringConfig?: Record<string, any>;
|
|
14
|
+
isFeatured?: boolean;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=create-template.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-template.dto.d.ts","sourceRoot":"","sources":["../../../src/templates/dto/create-template.dto.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAErF,qBAAa,iBAAiB;IAE5B,IAAI,EAAG,MAAM,CAAC;IAId,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,QAAQ,EAAG,MAAM,CAAC;IAIlB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAG,MAAM,CAAC;IAKhB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAIhB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAI/B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IAIvB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAI3C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAI3C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateTemplateDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateTemplateDto {
|
|
15
|
+
}
|
|
16
|
+
exports.CreateTemplateDto = CreateTemplateDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], CreateTemplateDto.prototype, "name", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsOptional)(),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CreateTemplateDto.prototype, "description", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsEnum)(['support', 'sales', 'onboarding', 'survey', 'healthcare', 'technical', 'custom']),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CreateTemplateDto.prototype, "category", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsOptional)(),
|
|
32
|
+
(0, class_validator_1.IsEnum)(['public', 'workspace', 'private']),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], CreateTemplateDto.prototype, "visibility", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CreateTemplateDto.prototype, "prompt", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsArray)(),
|
|
42
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], CreateTemplateDto.prototype, "tags", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsEnum)(['easy', 'medium', 'hard']),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], CreateTemplateDto.prototype, "difficulty", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsArray)(),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], CreateTemplateDto.prototype, "variables", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.IsArray)(),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], CreateTemplateDto.prototype, "steps", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.IsObject)(),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], CreateTemplateDto.prototype, "defaultPersonaConfig", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsOptional)(),
|
|
67
|
+
(0, class_validator_1.IsObject)(),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], CreateTemplateDto.prototype, "defaultScoringConfig", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsBoolean)(),
|
|
73
|
+
__metadata("design:type", Boolean)
|
|
74
|
+
], CreateTemplateDto.prototype, "isFeatured", void 0);
|
|
75
|
+
//# sourceMappingURL=create-template.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-template.dto.js","sourceRoot":"","sources":["../../../src/templates/dto/create-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AAIzB,MAAa,iBAAiB;CA8C7B;AA9CD,8CA8CC;AA5CC;IADC,IAAA,0BAAQ,GAAE;;+CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACU;AAGrB;IADC,IAAA,wBAAM,EAAC,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;;mDACxE;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;;qDACvB;AAGpB;IADC,IAAA,0BAAQ,GAAE;;iDACK;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;+CACT;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;;qDACf;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;oDACqB;AAI/B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;gDACa;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+DACgC;AAI3C;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+DACgC;AAI3C;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;qDACS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstantiateTemplateDto = exports.UpdateTemplateDto = exports.CreateTemplateDto = void 0;
|
|
4
|
+
var create_template_dto_1 = require("./create-template.dto");
|
|
5
|
+
Object.defineProperty(exports, "CreateTemplateDto", { enumerable: true, get: function () { return create_template_dto_1.CreateTemplateDto; } });
|
|
6
|
+
var update_template_dto_1 = require("./update-template.dto");
|
|
7
|
+
Object.defineProperty(exports, "UpdateTemplateDto", { enumerable: true, get: function () { return update_template_dto_1.UpdateTemplateDto; } });
|
|
8
|
+
var instantiate_template_dto_1 = require("./instantiate-template.dto");
|
|
9
|
+
Object.defineProperty(exports, "InstantiateTemplateDto", { enumerable: true, get: function () { return instantiate_template_dto_1.InstantiateTemplateDto; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/dto/index.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instantiate-template.dto.d.ts","sourceRoot":"","sources":["../../../src/templates/dto/instantiate-template.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,sBAAsB;IAGjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAKrC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAItB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InstantiateTemplateDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class InstantiateTemplateDto {
|
|
15
|
+
}
|
|
16
|
+
exports.InstantiateTemplateDto = InstantiateTemplateDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], InstantiateTemplateDto.prototype, "name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsObject)(),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], InstantiateTemplateDto.prototype, "variableValues", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, class_validator_1.IsArray)(),
|
|
30
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
31
|
+
__metadata("design:type", Array)
|
|
32
|
+
], InstantiateTemplateDto.prototype, "personaIds", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], InstantiateTemplateDto.prototype, "scorecardId", void 0);
|
|
38
|
+
//# sourceMappingURL=instantiate-template.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instantiate-template.dto.js","sourceRoot":"","sources":["../../../src/templates/dto/instantiate-template.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAE1E,MAAa,sBAAsB;CAiBlC;AAjBD,wDAiBC;AAdC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8DAC0B;AAKrC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0DACH;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACU"}
|