agent-screenplay 0.1.1 → 0.1.3

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 (60) hide show
  1. package/README.md +28 -6
  2. package/assets/editor/index.html +25 -7
  3. package/dist/cli.js +2 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/core.js +2 -14
  6. package/dist/core.js.map +1 -1
  7. package/dist/direct/plan.d.ts +2 -0
  8. package/dist/direct/plan.js +8 -0
  9. package/dist/direct/plan.js.map +1 -1
  10. package/dist/drivers/browser.d.ts +14 -0
  11. package/dist/drivers/browser.js +39 -1
  12. package/dist/drivers/browser.js.map +1 -1
  13. package/dist/drivers/web.d.ts +5 -0
  14. package/dist/drivers/web.js +68 -6
  15. package/dist/drivers/web.js.map +1 -1
  16. package/dist/editor/server.d.ts +18 -3
  17. package/dist/editor/server.js +27 -4
  18. package/dist/editor/server.js.map +1 -1
  19. package/dist/login.d.ts +9 -1
  20. package/dist/login.js +62 -29
  21. package/dist/login.js.map +1 -1
  22. package/dist/mcp/server.js +13 -3
  23. package/dist/mcp/server.js.map +1 -1
  24. package/dist/render/compose.d.ts +6 -2
  25. package/dist/render/compose.js +126 -18
  26. package/dist/render/compose.js.map +1 -1
  27. package/dist/render/presets.d.ts +20 -3
  28. package/dist/render/presets.js +30 -3
  29. package/dist/render/presets.js.map +1 -1
  30. package/dist/render/render.d.ts +5 -0
  31. package/dist/render/render.js +22 -4
  32. package/dist/render/render.js.map +1 -1
  33. package/dist/render/style.d.ts +12 -2
  34. package/dist/render/style.js +80 -3
  35. package/dist/render/style.js.map +1 -1
  36. package/dist/scenario/config.d.ts +9 -0
  37. package/dist/scenario/fingerprint.js +2 -2
  38. package/dist/scenario/fingerprint.js.map +1 -1
  39. package/dist/scenario/schema.d.ts +59 -3
  40. package/dist/scenario/schema.js +33 -9
  41. package/dist/scenario/schema.js.map +1 -1
  42. package/dist/scenario/target.js +2 -1
  43. package/dist/scenario/target.js.map +1 -1
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/dist/voice/audio.d.ts +6 -0
  47. package/dist/voice/audio.js +36 -0
  48. package/dist/voice/audio.js.map +1 -0
  49. package/dist/voice/cartesia.d.ts +5 -0
  50. package/dist/voice/cartesia.js +17 -6
  51. package/dist/voice/cartesia.js.map +1 -1
  52. package/dist/voice/elevenlabs.d.ts +8 -0
  53. package/dist/voice/elevenlabs.js +29 -0
  54. package/dist/voice/elevenlabs.js.map +1 -0
  55. package/dist/voice/narration.d.ts +16 -0
  56. package/dist/voice/narration.js +83 -0
  57. package/dist/voice/narration.js.map +1 -0
  58. package/package.json +1 -1
  59. package/schema/scenario.schema.json +90 -6
  60. package/skills/screenplay/SKILL.md +20 -11
@@ -12,12 +12,13 @@ Tools: the MCP tools `screenplay_check`, `screenplay_record`, `screenplay_render
12
12
  ## The loop
13
13
 
14
14
  1. **Understand what to show.** One video shows one idea: a feature, a flow, a fix. 15 to 60 seconds. Decide the story first: the starting point, the 3 to 8 actions that matter, the result.
15
+ **Ask about the voice-over before writing**, in one question, unless the request already says: no voice (captions only, the default), or a voice-over, in which language. If they want one, see *Voice-over* below for how to get the voice.
15
16
  2. **Explore the app** (with your browser tools, or by reading its code) to find the real path: which page, which buttons, what text they carry, what data is on screen. Prefer a demo account with realistic data: an empty dashboard or "test123" ruins the video.
16
17
  3. **Write the scenario** next to where the video should go (for example `demos/handoff.json`).
17
18
  4. **Run `check`.** It plays the scenario fast, without filming, and tells you which step fails and which targets are visible instead. Fix and check again until it plays to the end.
18
19
  5. **Run `record`.** It films and edits, and writes `<name>.mp4` and `<name>.storyboard.png`.
19
20
  6. **Look at the storyboard** (one image per step). Check: is each zoom framed on the right element, is a bubble hiding something, does a step show an error, is the data credible? Fix the scenario. If you only changed text, narration, style or zoom, run `render` (no new filming); if you changed actions, `record` again.
20
- 7. Hand over the MP4 path (and the GIF if asked).
21
+ 7. Hand over the MP4 path (and the GIF if asked), then **offer to adjust the look**: the person can set the background, padding, corners, shadow and the intro/outro cards by eye with `npx agent-screenplay style <scenario.json>`, which opens an editor in their browser and re-renders without filming. If they accept and the computer has a screen, run it for them in the background (it keeps running until stopped) and say a browser tab opened; otherwise give them the command.
21
22
 
22
23
  ## Scenario
23
24
 
@@ -26,16 +27,14 @@ Tools: the MCP tools `screenplay_check`, `screenplay_record`, `screenplay_render
26
27
  "$schema": "https://raw.githubusercontent.com/gmpetrov/agent-screenplay/main/schema/scenario.schema.json",
27
28
  "url": "https://app.example.com/inbox",
28
29
  "auth": { "storageState": ".screenplay/auth.json" },
29
- "style": { "background": "aurora" },
30
+ "style": { "background": "dawn" },
30
31
  "steps": [
31
- { "title": "Human handoff, in one click", "subtitle": "New in 2.4" },
32
32
  { "click": "text=Camille Laurent", "say": "When the AI agent gets stuck, the conversation lands in your inbox." },
33
33
  { "callout": "role=button[name='Take over']", "text": "Take over from the AI agent" },
34
34
  { "click": "role=button[name='Take over']" },
35
35
  { "type": "Hi Camille, I'm on it.", "into": "placeholder=Write a reply…" },
36
36
  { "click": "role=button[name='Send']" },
37
- { "highlight": "text=Assigned to you", "text": "Your teammates see it's yours" },
38
- { "end": "Available today on every plan" }
37
+ { "highlight": "text=Assigned to you", "text": "Your teammates see it's yours" }
39
38
  ]
40
39
  }
41
40
  ```
@@ -95,31 +94,41 @@ On any step: `say` (narration: a caption, and speech when voice is on), `zoom` (
95
94
  ### Style, voice, output
96
95
 
97
96
  ```json
98
- "style": { "background": "aurora", "padding": 72, "radius": 14, "cursor": "macos", "maxZoom": 1.9, "frame": "browser", "accent": "#3b82f6", "captions": true },
97
+ "style": { "background": "dawn", "padding": 72, "radius": 14, "cursor": "arrow", "click": "ripple", "maxZoom": 1.9, "frame": "browser", "accent": "#3b82f6", "captions": true },
99
98
  "voice": { "enabled": true, "language": "fr" },
100
99
  "output": { "width": 1920, "height": 1080, "fps": 30, "gif": false }
101
100
  ```
102
101
 
103
- Backgrounds: `aurora` (default), `sky`, `dusk`, `ember`, `graphite` (dark), `lagoon`, `lilac`, `peach`, `linen` (light), a color (`#0f172a`), an image path, or a gradient `{ "gradient": ["#0ea5e9", "#6366f1"], "angle": 135 }`. `frame: "browser"` adds a minimal browser bar with the URL.
102
+ Backgrounds: `dawn` (default), `iris`, `citrus`, `apricot`, `coral`, `blaze`, `cloud`, `glacier`, `tide`, `meadow`, a color (`#0f172a`), an image path, or a gradient `{ "gradient": ["#0ea5e9", "#6366f1"], "angle": 135 }`. `frame: "browser"` adds a minimal browser bar with the URL.
104
103
 
105
104
  A `screenplay.config.json` in the scenario's folder or a parent sets the style of every video below it (`{ "style": { … } }`); a scenario's own `style` wins, setting by setting. Keep a project's look there rather than repeating it in each scenario, and leave it alone unless asked. When a person wants to choose the look themselves, tell them to run `npx agent-screenplay style <scenario.json>`: it opens a visual editor in their browser (it needs a screen, so do not run it yourself in a headless environment).
106
105
 
107
- Voice-over is **off by default**. With `voice.enabled`, each `say` is spoken (Cartesia, needs `CARTESIA_API_KEY`) and the video waits for each sentence to finish. Without voice, `say` still shows as a caption.
106
+ Title and end cards are **off by default**: `title` and `end` steps are left out of the video unless `"style": { "cards": true }`. Add them, and turn cards on, only when the person asks for an intro or an outro.
107
+
108
+ ### Voice-over
109
+
110
+ Off by default. With `"voice": { "enabled": true, "language": "fr" }`, each `say` is spoken and the video waits for each sentence to finish. Without voice, `say` still shows as a caption. Getting the voice:
111
+
112
+ 1. If `CARTESIA_API_KEY` or `ELEVENLABS_API_KEY` is set in the environment, it is used (Cartesia first; `"provider": "elevenlabs"` to choose).
113
+ 2. If neither is set, offer the person the choice:
114
+ - give a key (set `CARTESIA_API_KEY` from https://play.cartesia.ai/keys or `ELEVENLABS_API_KEY` from https://elevenlabs.io/app/settings/api-keys, then restart the agent); or
115
+ - make the voice themselves: write the narration as a ready-to-paste script, one numbered line per spoken step, with the language and the tone, and ask them to generate it in ElevenLabs' or Cartesia's web app and save one file per line as `voice/01.mp3`, `voice/02.mp3`… next to the scenario. Then give each spoken step its `"audio": "voice/NN.mp3"` and run `render` (no new filming).
116
+ - or go without voice: captions only.
108
117
 
109
118
  ## Direction that makes a good video
110
119
 
111
- - **Start on a title card** that names the feature, and **end on a card** with the result or call to action.
112
120
  - **One action per step**, and a `say` on the steps that matter, not on every one. Narration: short spoken sentences, present tense, what the viewer gains ("One click, and the conversation is yours"), not what the cursor does ("Now I click the button").
113
121
  - **Show before you act** when the control is hard to spot: a `callout` on the button, then the `click`.
114
122
  - **End on the proof**: a `highlight` or `hold` on the result (the saved item, the green status, the sent message).
115
123
  - **Let zooms work**: they follow clicks and typing automatically. Use `"zoom": false` on a step whose result appears far from the click (a toast, a side panel), or `zoomTo` to frame the result.
116
124
  - **Realistic data and typing**: real-looking names and messages, 3 to 10 words typed, not paragraphs.
117
125
  - **Keep it short**: under a minute; cut steps that don't move the story.
118
- - **Logins**: run `screenplay login <url>` once (a person signs in, the session is saved to `.screenplay/auth.json`) and set `auth.storageState`; or log in with steps using `${EMAIL}` / `${PASSWORD}` and `secret: true`.
126
+ - **Logins**: run `npx agent-screenplay login <url>` once (a person signs in in the window that opens, then closes it; the session is saved to `.screenplay/auth.json`) and set `auth.storageState`; or log in with steps using `${EMAIL}` / `${PASSWORD}` and `secret: true`.
119
127
 
120
128
  ## When something goes wrong
121
129
 
122
- - `check` fails on a target → use one from the listed visible targets, or add a `wait` for it.
130
+ - `check` fails on a target → use one from the listed visible targets, or add a `wait` for it. A listed `css=… (shows "…")` is a button whose text is drawn by CSS (some cookie walls): copy it as is.
131
+ - "shows a bot check that needs a person" (Cloudflare) → run `npx agent-screenplay login <url>` (in the background: it waits), and tell the person: pass the check in the browser window that opened, accept the cookies if asked, then **close the window**. Closing saves the session; do not ask them to press Enter in a terminal. Then set `"auth": { "storageState": ".screenplay/auth.json" }` and check again.
123
132
  - "covered by …" → something (a toast, a cookie banner, a modal) sits on the element: close it first with a step.
124
133
  - "the typed text did not appear" → the field was not focused: use `into` to click it.
125
134
  - A wait is long (page loads, AI answers) → keep it: long waits are sped up in the video automatically.