conversation-replay 0.1.8 → 0.1.10

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.
Files changed (3) hide show
  1. package/README.md +21 -32
  2. package/dist/cli.js +88 -7
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,35 +1,20 @@
1
1
  # Conversation Replay
2
2
 
3
- Create animated replays of text conversations.
3
+ Create annotated replays of text conversations.
4
4
 
5
5
  After parsing the annotated conversation data you supply in a YAML file, this tool will generate a self-contained embeddable HTML file. The published conversation can help with security awareness training and other communications that involve presenting an annotated text conversation.
6
6
 
7
- - [Conversation Replay](#conversation-replay)
8
- - [How This Is Useful](#how-this-is-useful)
9
- - [Installation](#installation)
10
- - [Run Without Installing (Recommended)](#run-without-installing-recommended)
11
- - [Global Install](#global-install)
12
- - [Install from GitHub](#install-from-github)
13
- - [Quick Start](#quick-start)
14
- - [YAML Schema](#yaml-schema)
15
- - [Basic Structure](#basic-structure)
16
- - [Step Types](#step-types)
17
- - [Message Options](#message-options)
18
- - [Meta Options](#meta-options)
19
- - [Output Features](#output-features)
20
- - [Embedding in Websites](#embedding-in-websites)
21
- - [Automatic "Seamless" Mode](#automatic-seamless-mode)
22
- - [Basic Iframe Code](#basic-iframe-code)
23
- - [Dark Mode Sync](#dark-mode-sync)
24
- - [Multi-Scenario Demos](#multi-scenario-demos)
25
- - [Development](#development)
26
- - [Repository Structure](#repository-structure)
27
- - [Commands](#commands)
28
- - [AI Agent Quick Reference](#ai-agent-quick-reference)
29
- - [Key Files](#key-files)
30
- - [Architecture](#architecture)
31
- - [Threat Modeling](#threat-modeling)
32
- - [Author](#author)
7
+ - [How This Is Useful](#how-this-is-useful)
8
+ - [Installation](#installation)
9
+ - [Quick Start](#quick-start)
10
+ - [YAML Schema](#yaml-schema)
11
+ - [Output Features](#output-features)
12
+ - [Embedding in Websites](#embedding-in-websites)
13
+ - [Multi-Scenario Demos](#multi-scenario-demos)
14
+ - [Development](#development)
15
+ - [AI Agent Quick Reference](#ai-agent-quick-reference)
16
+ - [Threat Modeling](#threat-modeling)
17
+ - [Author](#author)
33
18
 
34
19
 
35
20
  ## How This Is Useful
@@ -43,13 +28,17 @@ Conversation Replay lets you:
43
28
  - **Slick Design:** Modern UI, nice typography, clean colors, and smooth animations
44
29
  - **Embed Anywhere:** Seamlessly integrates into blogs and LMS platforms
45
30
 
46
- Want to see it in action? Open the pre-generated demo replays [examples/london-scam.html](examples/london-scam.html) or [examples/ir-report.html](examples/ir-report.html) in your browser.
31
+ To see it in action, see the replays embedded in the following articles as well as the corresponding files in the [examples folder](examples/).
32
+
33
+ * [Write Good Incident Response Reports Using Your AI Tool](https://zeltser.com/good-ir-reports-with-ai)
34
+ * [When Bots Chat With Social Network Participants
35
+ ](https://zeltser.com/bots-chatting-on-social-networks)
47
36
 
48
37
  ## Installation
49
38
 
50
39
  ### Run Without Installing (Recommended)
51
40
 
52
- The easiest way to use Conversation Replay—no installation required—after you create the annotated conversation file demo.yaml:
41
+ The easiest way to use Conversation Replay (no installation required) after you create the annotated conversation file demo.yaml:
53
42
 
54
43
  ```bash
55
44
  # Using npx (comes with Node.js)
@@ -189,16 +178,16 @@ meta:
189
178
  ```
190
179
 
191
180
  Custom colors (New Slate/Indigo Default Palette):
192
- You can override any color, but the defaults are designed for a premium look:
181
+ You can override any color:
193
182
  ```yaml
194
183
  meta:
195
184
  colors:
196
185
  accent: "#4f46e5" # Indigo 600 (Buttons, links)
197
186
  pageBg: "#f8fafc" # Slate 50 (Page background standalone)
198
187
  canvasBg: "#ffffff" # Chat container background
199
- leftBg: "#eef2ff" # Indigo 50 (Left/User bubble)
188
+ leftBg: "#eef2ff" # Indigo 50 (Left bubble)
200
189
  leftBorder: "transparent" # Border for left bubble
201
- rightBg: "#f1f5f9" # Slate 100 (Right/AI bubble)
190
+ rightBg: "#f1f5f9" # Slate 100 (Right bubble)
202
191
  rightBorder: "transparent" # Border for right bubble
203
192
  tabInactiveColor: "#94a3b8" # Slate 400
204
193
  annotationText: "#475569" # Slate 600 (Annotation text color)
package/dist/cli.js CHANGED
@@ -7267,7 +7267,56 @@ async function loadDemo(filePath) {
7267
7267
 
7268
7268
  // src/generator.ts
7269
7269
  import { writeFile } from "node:fs/promises";
7270
- var VERSION = "0.1.0";
7270
+ // package.json
7271
+ var package_default = {
7272
+ name: "conversation-replay",
7273
+ version: "0.1.10",
7274
+ description: "Create annotated replays of text conversations",
7275
+ main: "dist/cli.js",
7276
+ type: "module",
7277
+ bin: {
7278
+ "conversation-replay": "dist/cli.js"
7279
+ },
7280
+ files: [
7281
+ "dist",
7282
+ "README.md"
7283
+ ],
7284
+ scripts: {
7285
+ build: "bun run src/cli.ts build",
7286
+ validate: "bun run src/cli.ts validate",
7287
+ example: "bun run src/cli.ts build examples/london-scam.yaml -o examples/london-scam.html",
7288
+ "build:dist": "bun build src/cli.ts --target=node --outfile=dist/cli.js --packages=bundle",
7289
+ prepare: "bun run build:dist",
7290
+ prepublishOnly: "bun run build:dist"
7291
+ },
7292
+ keywords: [
7293
+ "conversation",
7294
+ "demo",
7295
+ "animation",
7296
+ "security-awareness",
7297
+ "training",
7298
+ "chat",
7299
+ "replay"
7300
+ ],
7301
+ author: "Lenny Zeltser",
7302
+ license: "MIT",
7303
+ repository: {
7304
+ type: "git",
7305
+ url: "https://github.com/lennyzeltser/conversation-replay"
7306
+ },
7307
+ devDependencies: {
7308
+ "@types/bun": "latest"
7309
+ },
7310
+ peerDependencies: {
7311
+ typescript: "^5"
7312
+ },
7313
+ dependencies: {
7314
+ yaml: "^2.8.2"
7315
+ }
7316
+ };
7317
+
7318
+ // src/generator.ts
7319
+ var VERSION = package_default.version;
7271
7320
  function escapeHtml(text) {
7272
7321
  return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
7273
7322
  }
@@ -7428,14 +7477,41 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
7428
7477
  }
7429
7478
 
7430
7479
  @media (max-width: 600px) {
7480
+ .tabs {
7481
+ flex-wrap: nowrap;
7482
+ overflow-x: auto;
7483
+ -webkit-overflow-scrolling: touch;
7484
+ padding-bottom: 0;
7485
+ /* Hide scrollbars */
7486
+ scrollbar-width: none;
7487
+ -ms-overflow-style: none;
7488
+ }
7489
+
7490
+ .tabs::-webkit-scrollbar {
7491
+ display: none;
7492
+ }
7493
+
7431
7494
  .tab {
7432
7495
  padding: 10px 14px;
7433
7496
  font-size: 12px;
7434
- flex: 1;
7497
+ flex: 0 0 auto; /* Don't shrink, let them scroll */
7435
7498
  text-align: center;
7436
7499
  min-width: 0;
7500
+ white-space: nowrap;
7437
7501
  }
7438
7502
  }
7503
+
7504
+ /* In iframe, ensure non-active tabs are visible against potentially dark/complex backgrounds */
7505
+ body.in-iframe .tab:not(.active) {
7506
+ background: rgba(255, 255, 255, 0.5);
7507
+ backdrop-filter: blur(4px);
7508
+ -webkit-backdrop-filter: blur(4px);
7509
+ }
7510
+
7511
+ :root[data-theme="dark"] body.in-iframe .tab:not(.active) {
7512
+ background: rgba(30, 41, 59, 0.5);
7513
+ color: rgba(248, 250, 252, 0.7);
7514
+ }
7439
7515
  ` : "";
7440
7516
  return `
7441
7517
  *, *::before, *::after {
@@ -7683,7 +7759,7 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
7683
7759
  display: none; /* Chrome Safari */
7684
7760
  }
7685
7761
 
7686
- .chat-container.fading {
7762
+ .chat-container.fading .chat-scroll-area {
7687
7763
  opacity: 0;
7688
7764
  }
7689
7765
 
@@ -7741,7 +7817,7 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
7741
7817
  min-height: 0;
7742
7818
  max-height: none !important; /* Remove height constraint in iframe */
7743
7819
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important; /* Subtle shadow in iframe */
7744
- /* Keep border and background for visual definition */
7820
+ background: var(--bg-chat) !important; /* Ensure opaque background in iframe */
7745
7821
  margin-bottom: clamp(70px, 15vh, 120px); /* Responsive space for fixed controls */
7746
7822
  }
7747
7823
 
@@ -7790,6 +7866,9 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
7790
7866
  .play-overlay-icon {
7791
7867
  width: 64px; /* Slightly smaller for elegance */
7792
7868
  height: 64px;
7869
+ flex-shrink: 0; /* Prevent squishing on small screens */
7870
+ min-width: 64px;
7871
+ min-height: 64px;
7793
7872
  background: white;
7794
7873
  border-radius: 50%;
7795
7874
  display: flex;
@@ -8308,6 +8387,8 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
8308
8387
  .play-overlay-icon {
8309
8388
  width: 70px;
8310
8389
  height: 70px;
8390
+ min-width: 70px;
8391
+ min-height: 70px;
8311
8392
  }
8312
8393
 
8313
8394
  .play-overlay-icon svg {
@@ -8327,13 +8408,13 @@ function generateCss(theme, hasMultipleScenarios, colors, cornerStyle, initialBl
8327
8408
  padding: 8px;
8328
8409
  }
8329
8410
 
8411
+ /* Very small phones - keep scrolling tabs instead of stacking */
8330
8412
  .tabs {
8331
- flex-direction: column;
8332
8413
  gap: 4px;
8333
8414
  }
8334
8415
 
8335
8416
  .tab {
8336
- width: 100%;
8417
+ /* width: 100%; Removed to prevent full stacking */
8337
8418
  text-align: center;
8338
8419
  }
8339
8420
 
@@ -9314,7 +9395,7 @@ async function buildDemo(demo, outputPath, options = {}) {
9314
9395
 
9315
9396
  // src/cli.ts
9316
9397
  var HELP = `
9317
- conversation-replay - Create animated conversation demos from YAML
9398
+ conversation-replay - Create annotated replays of text conversations from YAML
9318
9399
 
9319
9400
  Usage:
9320
9401
  conversation-replay build <scenario.yaml> -o <output.html> [options]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "conversation-replay",
3
- "version": "0.1.8",
4
- "description": "Create animated text conversation replays",
3
+ "version": "0.1.10",
4
+ "description": "Create annotated replays of text conversations",
5
5
  "main": "dist/cli.js",
6
6
  "type": "module",
7
7
  "bin": {