# ovotech/genesys-web-messaging-tester architecture

> Architecture diagram of the GitHub repository ovotech/genesys-web-messaging-tester, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ovotech/genesys-web-messaging-tester
- Repository: https://github.com/ovotech/genesys-web-messaging-tester

## Overview

The repository provides a CLI for testing Genesys Cloud chatbot deployments through scripted dialogues and AI-generated customer conversations, plus a library that manages the Web Messenger guest session and conversation behavior. The main workflow loads and validates a scenario, connects to Genesys, performs dialogue steps, and reports results. The README also documents OpenAI and Google Vertex AI options. Several AI and validation modules are present in the tree but were not excerpted, so their internal wiring is not asserted.

Main entry points: [`packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts) (Scripted runner), [`packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts`](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts) (Guest session), [`packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts`](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts) (AI test command), [`packages/genesys-web-messaging-tester-cli/src/createCli.ts`](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/createCli.ts) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI testing"]
  node_cli["CLI commands<br/>[createCli.ts]"]
  node_scripted["Scripted runner"]
  node_yaml["YAML reader<br/>[yamlFileReader.ts]"]
  node_script["Script parsing<br/>[parseTestScript.ts]"]
  node_validation["Scenario validation"]
  node_results["Results and UI<br/>[ScenarioResult.ts]"]
end

subgraph group_ai["AI testing"]
  node_ai["AI test command"]
  node_prompts["Prompt handling"]
  node_provider["Completion interface"]
  node_openai["OpenAI client"]
  node_vertex["Vertex client"]
  node_output["AI output<br/>[saveOutputJson.ts]"]
end

subgraph group_messaging["Messaging runtime"]
  node_conversation["Conversation logic<br/>[Conversation.ts]"]
  node_session["Guest session"]
  node_delayer["Message reordering"]
  node_schema["Message types"]
  node_transcriber["Transcription<br/>[Transcriber.ts]"]
end

subgraph group_integration["External services"]
  node_genesys{{"Genesys Web Messenger"}}
  node_openai_service{{"OpenAI API"}}
  node_vertex_service{{"Vertex AI API"}}
end

node_user(("CLI user"))

node_user -->|"runs command"| node_cli
node_cli -->|"registers command"| node_scripted
node_cli -->|"registers command"| node_ai
node_scripted -->|"reads script"| node_yaml
node_scripted -->|"extracts scenarios"| node_script
node_scripted -->|"validates input"| node_validation
node_script -->|"generates steps"| node_conversation
node_scripted -->|"runs dialogue"| node_conversation
node_scripted -->|"creates session"| node_session
node_scripted -->|"records outcomes"| node_results
node_conversation -->|"uses session"| node_session
node_session -->|"buffers messages"| node_delayer
node_delayer -->|"orders messages"| node_schema
node_session -->|"processes messages"| node_schema
node_session -->|"connects and exchanges"| node_genesys
node_scripted -->|"transcribes messages"| node_transcriber
node_ai -.->|"uses prompts"| node_prompts
node_ai -.->|"requests completions"| node_provider
node_provider -->|"implemented by"| node_openai
node_provider -->|"implemented by"| node_vertex
node_openai -->|"calls API"| node_openai_service
node_vertex -->|"calls API"| node_vertex_service
node_ai -.->|"saves results"| node_output

click node_cli "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/createCli.ts"
click node_scripted "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts"
click node_yaml "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/fileSystem/yamlFileReader.ts"
click node_script "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts"
click node_validation "https://github.com/ovotech/genesys-web-messaging-tester/tree/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript"
click node_results "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/ScenarioResult.ts"
click node_ai "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts"
click node_prompts "https://github.com/ovotech/genesys-web-messaging-tester/tree/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/prompt"
click node_provider "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts"
click node_openai "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts"
click node_vertex "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/googleVertexAi/createChatCompletionClient.ts"
click node_output "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/output/saveOutputJson.ts"
click node_conversation "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/Conversation.ts"
click node_session "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts"
click node_delayer "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts"
click node_schema "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/StructuredMessage.ts"
click node_transcriber "https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/transcribe/Transcriber.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_scripted,node_yaml,node_script,node_validation,node_results,node_user toneBlue
class node_ai,node_prompts,node_provider,node_openai,node_vertex,node_output toneAmber
class node_conversation,node_session,node_delayer,node_schema,node_transcriber toneMint
class node_genesys,node_openai_service,node_vertex_service toneRose
```

## Components

### CLI testing

- [CLI commands](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/createCli.ts): `packages/genesys-web-messaging-tester-cli/src/createCli.ts`
- [Scripted runner](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts): `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`
- [YAML reader](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/fileSystem/yamlFileReader.ts): `packages/genesys-web-messaging-tester-cli/src/fileSystem/yamlFileReader.ts`
- [Script parsing](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts): `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts`
- [Scenario validation](https://github.com/ovotech/genesys-web-messaging-tester/tree/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript): `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript`
- [Results and UI](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/ScenarioResult.ts): `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/ScenarioResult.ts`

### AI testing

- [AI test command](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts`
- [Prompt handling](https://github.com/ovotech/genesys-web-messaging-tester/tree/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/prompt): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/prompt`
- [Completion interface](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatCompletionClient.ts`
- [OpenAI client](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`
- [Vertex client](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/googleVertexAi/createChatCompletionClient.ts): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/googleVertexAi/createChatCompletionClient.ts`
- [AI output](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester-cli/src/commands/aiTest/output/saveOutputJson.ts): `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/output/saveOutputJson.ts`

### Messaging runtime

- [Conversation logic](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/Conversation.ts): `packages/genesys-web-messaging-tester/src/Conversation.ts`
- [Guest session](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts): `packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts`
- [Message reordering](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts): `packages/genesys-web-messaging-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts`
- [Message types](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/genesys/StructuredMessage.ts): `packages/genesys-web-messaging-tester/src/genesys/StructuredMessage.ts`
- [Transcription](https://github.com/ovotech/genesys-web-messaging-tester/blob/main/packages/genesys-web-messaging-tester/src/transcribe/Transcriber.ts): `packages/genesys-web-messaging-tester/src/transcribe/Transcriber.ts`

### External services

- **Genesys Web Messenger**
- **OpenAI API**
- **Vertex AI API**

### Other components

- **CLI user**

## Connections

- CLI user → CLI commands: runs command
- CLI commands → Scripted runner: registers command (evidence: `packages/genesys-web-messaging-tester-cli/src/createCli.ts`)
- CLI commands → AI test command: registers command (evidence: `packages/genesys-web-messaging-tester-cli/src/createCli.ts`)
- Scripted runner → YAML reader: reads script (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted runner → Script parsing: extracts scenarios (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted runner → Scenario validation: validates input (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Script parsing → Conversation logic: generates steps (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/testScript/parseTestScript.ts`)
- Scripted runner → Conversation logic: runs dialogue (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted runner → Guest session: creates session (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Scripted runner → Results and UI: records outcomes (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- Conversation logic → Guest session: uses session (evidence: `packages/genesys-web-messaging-tester/src/Conversation.ts`)
- Guest session → Message reordering: buffers messages (evidence: `packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts`)
- Message reordering → Message types: orders messages (evidence: `packages/genesys-web-messaging-tester/src/genesys/message-delayer/ReorderedMessageDelayer.ts`)
- Guest session → Message types: processes messages (evidence: `packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts`)
- Guest session → Genesys Web Messenger: connects and exchanges (evidence: `packages/genesys-web-messaging-tester/src/genesys/WebMessengerGuestSession.ts`)
- Scripted runner → Transcription: transcribes messages (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/scriptedTest/createScriptedTestCommand.ts`)
- AI test command → Prompt handling: uses prompts (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- AI test command → Completion interface: requests completions (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
- Completion interface → OpenAI client: implemented by (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`)
- Completion interface → Vertex client: implemented by (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/googleVertexAi/createChatCompletionClient.ts`)
- OpenAI client → OpenAI API: calls API (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/chatGpt/createChatCompletionClient.ts`)
- Vertex client → Vertex AI API: calls API (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/chatCompletionClients/googleVertexAi/createChatCompletionClient.ts`)
- AI test command → AI output: saves results (evidence: `packages/genesys-web-messaging-tester-cli/src/commands/aiTest/createAiTestCommand.ts`)
