conversation-replay 0.1.13 → 0.1.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/README.md +43 -19
- package/dist/cli.js +721 -65
- package/package.json +2 -1
- package/schema.json +292 -0
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ After parsing the annotated conversation data you supply in a YAML file, this to
|
|
|
7
7
|
- [How This Is Useful](#how-this-is-useful)
|
|
8
8
|
- [Installation](#installation)
|
|
9
9
|
- [Quick Start](#quick-start)
|
|
10
|
+
- [CLI Reference](#cli-reference)
|
|
10
11
|
- [YAML Schema](#yaml-schema)
|
|
11
12
|
- [Output Features](#output-features)
|
|
12
13
|
- [Embedding in Websites](#embedding-in-websites)
|
|
@@ -75,31 +76,52 @@ Note: This requires [Bun](https://bun.sh) to be installed (for the build step).
|
|
|
75
76
|
|
|
76
77
|
## Quick Start
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
Generate a starter template, customize it, then build:
|
|
79
80
|
|
|
80
81
|
```bash
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
# Create a documented template
|
|
83
|
+
conversation-replay init demo.yaml
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Loading examples/london-scam.yaml...
|
|
87
|
-
Building demo.html...
|
|
88
|
-
Done! Generated demo.html
|
|
89
|
-
Title: London Scam - Social Engineering Demo
|
|
90
|
-
Scenarios: 1
|
|
91
|
-
- London Scam: 17 steps (Matt (compromised account), Rakesh)
|
|
92
|
-
```
|
|
85
|
+
# Edit demo.yaml to define your conversation, then build
|
|
86
|
+
conversation-replay build demo.yaml -o demo.html
|
|
93
87
|
|
|
94
|
-
```bash
|
|
95
88
|
# Open in browser
|
|
96
89
|
open demo.html
|
|
97
90
|
```
|
|
98
91
|
|
|
99
92
|
The generated replay is responsive, supports dark mode automatically, and looks nice across various browsers and devices.
|
|
100
93
|
|
|
94
|
+
To explore an existing example instead:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
conversation-replay build examples/london-scam.yaml -o demo.html
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## CLI Reference
|
|
101
|
+
|
|
102
|
+
| Command | Description |
|
|
103
|
+
|---------|-------------|
|
|
104
|
+
| `build <file.yaml> -o <output.html>` | Generate HTML from a YAML file |
|
|
105
|
+
| `validate <file.yaml>` | Check a YAML file for errors |
|
|
106
|
+
| `init <file.yaml>` | Create a starter template with inline documentation |
|
|
107
|
+
| `schema [section]` | Show schema reference (sections: `meta`, `colors`, `speed`, `steps`) |
|
|
108
|
+
| `info` | Show tool name, version, and author |
|
|
109
|
+
| `--version` | Show version number |
|
|
110
|
+
| `--help` | Show help |
|
|
111
|
+
|
|
112
|
+
Options for `build`:
|
|
113
|
+
- `--theme <theme>` — Override theme (`chat`, `email`, `slack`, `terminal`, `generic`)
|
|
114
|
+
- `--no-header` — Exclude the header with title and description
|
|
115
|
+
|
|
116
|
+
For IDE autocompletion, add this to the top of your YAML file:
|
|
117
|
+
```yaml
|
|
118
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/lennyzeltser/conversation-replay/master/schema.json
|
|
119
|
+
```
|
|
120
|
+
|
|
101
121
|
## YAML Schema
|
|
102
122
|
|
|
123
|
+
Run `conversation-replay schema` for a quick reference, or see below for details.
|
|
124
|
+
|
|
103
125
|
### Basic Structure
|
|
104
126
|
|
|
105
127
|
```yaml
|
|
@@ -258,6 +280,7 @@ scenarios:
|
|
|
258
280
|
```
|
|
259
281
|
|
|
260
282
|
- **Tabs appear automatically** at the top of the player.
|
|
283
|
+
- **Horizontal scrolling**: When tabs exceed the available width, arrow buttons appear for navigation. Works on desktop and mobile.
|
|
261
284
|
- **Auto-Advance**: If `autoAdvance: true` is set, the player smoothly transitions to the next tab when a scenario finishes.
|
|
262
285
|
|
|
263
286
|
## Development
|
|
@@ -270,8 +293,10 @@ conversation-replay/
|
|
|
270
293
|
│ ├── cli.ts # CLI entry point
|
|
271
294
|
│ ├── parser.ts # YAML parsing & validation
|
|
272
295
|
│ ├── generator.ts # HTML generation (CSS/JS injection)
|
|
296
|
+
│ ├── schema.ts # Template generation & schema utilities
|
|
273
297
|
│ └── types.ts # TypeScript definitions
|
|
274
298
|
├── examples/ # Demo YAML files
|
|
299
|
+
├── schema.json # JSON Schema for IDE autocompletion
|
|
275
300
|
└── package.json
|
|
276
301
|
```
|
|
277
302
|
|
|
@@ -281,14 +306,11 @@ conversation-replay/
|
|
|
281
306
|
# Install dependencies
|
|
282
307
|
bun install
|
|
283
308
|
|
|
284
|
-
#
|
|
309
|
+
# Run CLI during development
|
|
285
310
|
bun run src/cli.ts build examples/london-scam.yaml -o demo.html
|
|
286
|
-
|
|
287
|
-
# Validate without building
|
|
288
311
|
bun run src/cli.ts validate examples/london-scam.yaml
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
bun run src/cli.ts build examples/london-scam.yaml -o demo.html --theme email --no-header
|
|
312
|
+
bun run src/cli.ts init my-demo.yaml
|
|
313
|
+
bun run src/cli.ts schema
|
|
292
314
|
```
|
|
293
315
|
|
|
294
316
|
---
|
|
@@ -302,6 +324,8 @@ bun run src/cli.ts build examples/london-scam.yaml -o demo.html --theme email --
|
|
|
302
324
|
| `src/types.ts` | Schema definitions. Edit this to add new YAML properties. |
|
|
303
325
|
| `src/generator.ts` | The core engine. Generates the HTML, CSS, and runtime JavaScript. |
|
|
304
326
|
| `src/parser.ts` | Input validation logic. |
|
|
327
|
+
| `src/schema.ts` | Template generation, JSON schema, and CLI schema reference. |
|
|
328
|
+
| `schema.json` | JSON Schema for IDE autocompletion. Regenerate with `schema --json`. |
|
|
305
329
|
|
|
306
330
|
### Architecture
|
|
307
331
|
|