agent-screenplay 0.0.0-stage → 0.1.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -2
  3. package/assets/editor/index.html +536 -0
  4. package/assets/fonts/Inter-Bold.ttf +0 -0
  5. package/assets/fonts/Inter-LICENSE.txt +92 -0
  6. package/assets/fonts/Inter-Medium.ttf +0 -0
  7. package/assets/fonts/Inter-Regular.ttf +0 -0
  8. package/assets/fonts/Inter-SemiBold.ttf +0 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +163 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/core.d.ts +16 -0
  13. package/dist/core.js +73 -0
  14. package/dist/core.js.map +1 -0
  15. package/dist/direct/plan.d.ts +100 -0
  16. package/dist/direct/plan.js +274 -0
  17. package/dist/direct/plan.js.map +1 -0
  18. package/dist/drivers/browser.d.ts +9 -0
  19. package/dist/drivers/browser.js +44 -0
  20. package/dist/drivers/browser.js.map +1 -0
  21. package/dist/drivers/desktop.d.ts +53 -0
  22. package/dist/drivers/desktop.js +650 -0
  23. package/dist/drivers/desktop.js.map +1 -0
  24. package/dist/drivers/pace.d.ts +11 -0
  25. package/dist/drivers/pace.js +44 -0
  26. package/dist/drivers/pace.js.map +1 -0
  27. package/dist/drivers/web.d.ts +37 -0
  28. package/dist/drivers/web.js +570 -0
  29. package/dist/drivers/web.js.map +1 -0
  30. package/dist/editor/server.d.ts +96 -0
  31. package/dist/editor/server.js +303 -0
  32. package/dist/editor/server.js.map +1 -0
  33. package/dist/ffmpeg.d.ts +5 -0
  34. package/dist/ffmpeg.js +44 -0
  35. package/dist/ffmpeg.js.map +1 -0
  36. package/dist/guide.d.ts +6 -0
  37. package/dist/guide.js +25 -0
  38. package/dist/guide.js.map +1 -0
  39. package/dist/init.d.ts +19 -0
  40. package/dist/init.js +147 -0
  41. package/dist/init.js.map +1 -0
  42. package/dist/login.d.ts +2 -0
  43. package/dist/login.js +50 -0
  44. package/dist/login.js.map +1 -0
  45. package/dist/mcp/server.d.ts +1 -0
  46. package/dist/mcp/server.js +132 -0
  47. package/dist/mcp/server.js.map +1 -0
  48. package/dist/render/compose.d.ts +68 -0
  49. package/dist/render/compose.js +361 -0
  50. package/dist/render/compose.js.map +1 -0
  51. package/dist/render/presets.d.ts +42 -0
  52. package/dist/render/presets.js +111 -0
  53. package/dist/render/presets.js.map +1 -0
  54. package/dist/render/render.d.ts +25 -0
  55. package/dist/render/render.js +257 -0
  56. package/dist/render/render.js.map +1 -0
  57. package/dist/render/sources.d.ts +15 -0
  58. package/dist/render/sources.js +146 -0
  59. package/dist/render/sources.js.map +1 -0
  60. package/dist/render/style.d.ts +37 -0
  61. package/dist/render/style.js +118 -0
  62. package/dist/render/style.js.map +1 -0
  63. package/dist/scenario/config.d.ts +43 -0
  64. package/dist/scenario/config.js +69 -0
  65. package/dist/scenario/config.js.map +1 -0
  66. package/dist/scenario/fingerprint.d.ts +10 -0
  67. package/dist/scenario/fingerprint.js +58 -0
  68. package/dist/scenario/fingerprint.js.map +1 -0
  69. package/dist/scenario/load.d.ts +36 -0
  70. package/dist/scenario/load.js +101 -0
  71. package/dist/scenario/load.js.map +1 -0
  72. package/dist/scenario/schema.d.ts +553 -0
  73. package/dist/scenario/schema.js +262 -0
  74. package/dist/scenario/schema.js.map +1 -0
  75. package/dist/scenario/target.d.ts +26 -0
  76. package/dist/scenario/target.js +40 -0
  77. package/dist/scenario/target.js.map +1 -0
  78. package/dist/take.d.ts +100 -0
  79. package/dist/take.js +15 -0
  80. package/dist/take.js.map +1 -0
  81. package/dist/version.d.ts +1 -0
  82. package/dist/version.js +2 -0
  83. package/dist/version.js.map +1 -0
  84. package/dist/voice/cartesia.d.ts +12 -0
  85. package/dist/voice/cartesia.js +103 -0
  86. package/dist/voice/cartesia.js.map +1 -0
  87. package/package.json +65 -4
  88. package/schema/scenario.schema.json +1098 -0
  89. package/skills/screenplay/SKILL.md +127 -0
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: screenplay
3
+ description: Make polished screen recordings of a website or desktop app (feature demos, walkthroughs, explainer videos with voice-over) with Screenplay. Use when asked to record, film, demo or show a feature in a video, or to make an explainer or walkthrough video of an app.
4
+ ---
5
+
6
+ # Making screen recordings with Screenplay
7
+
8
+ Screenplay turns a JSON **scenario** into a Screen Studio-style video: it plays the steps in a browser (or a desktop app), films them, then edits the video with a smooth cursor, automatic zooms, click effects, callouts, captions, title cards and an optional voice-over. You write the scenario; Screenplay does the filming and editing. It contains no AI.
9
+
10
+ Tools: the MCP tools `screenplay_check`, `screenplay_record`, `screenplay_render`, or the CLI `npx agent-screenplay check|record|render <file.json>`.
11
+
12
+ ## The loop
13
+
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
+ 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
+ 3. **Write the scenario** next to where the video should go (for example `demos/handoff.json`).
17
+ 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
+ 5. **Run `record`.** It films and edits, and writes `<name>.mp4` and `<name>.storyboard.png`.
19
+ 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
+
22
+ ## Scenario
23
+
24
+ ```json
25
+ {
26
+ "$schema": "https://raw.githubusercontent.com/gmpetrov/screenplay/main/schema/scenario.schema.json",
27
+ "url": "https://app.example.com/inbox",
28
+ "viewport": { "width": 1440, "height": 900 },
29
+ "auth": { "storageState": ".screenplay/auth.json" },
30
+ "style": { "background": "ocean" },
31
+ "steps": [
32
+ { "title": "Human handoff, in one click", "subtitle": "New in 2.4" },
33
+ { "click": "text=Camille Laurent", "say": "When the AI agent gets stuck, the conversation lands in your inbox." },
34
+ { "callout": "role=button[name='Take over']", "text": "Take over from the AI agent" },
35
+ { "click": "role=button[name='Take over']" },
36
+ { "type": "Hi Camille, I'm on it.", "into": "placeholder=Write a reply…" },
37
+ { "click": "role=button[name='Send']" },
38
+ { "highlight": "text=Assigned to you", "text": "Your teammates see it's yours" },
39
+ { "end": "Available today on every plan" }
40
+ ]
41
+ }
42
+ ```
43
+
44
+ `url` for a website (a relative path means a local HTML file). `app` instead of `url` for a desktop application (its name as the OS shows it).
45
+
46
+ ### The whole screen (desktop)
47
+
48
+ `"screen": true` films the whole main screen instead of one window: use it when the video goes from one app to another, or shows the menu bar. `app` is then optional (the app brought to the front first).
49
+
50
+ - `{ "open": "Dictionary" }` launches an app or brings it to the front; the next steps act in it.
51
+ - A step's `"app": "Finder"` acts in another app for that step (and the next ones).
52
+ - A step's `"surface": "menubar"` looks for the element in the app's menu bar; `"menu"` in an open menu; also `sheet`, `popover`, `alert`.
53
+
54
+ Everything on screen is filmed: notifications, other windows, desktop icons and widgets. Before recording, close what should not be seen, turn on Do Not Disturb, and set `"hideOthers": true` (macOS) to hide the other apps. Some windows (menu bar apps' panels) ignore Hide Others: close them. Prefer a window recording when the video stays in one app.
55
+
56
+ ```json
57
+ {
58
+ "screen": true,
59
+ "app": "Calculator",
60
+ "hideOthers": true,
61
+ "steps": [
62
+ { "click": "role=button[name='7']" },
63
+ { "open": "Dictionary" },
64
+ { "type": "screenplay", "into": "role=textfield" },
65
+ { "click": "role=menuitem[name='Edit']", "surface": "menubar" }
66
+ ]
67
+ }
68
+ ```
69
+
70
+ ### Targets
71
+
72
+ Name elements the way a user sees them, never with coordinates:
73
+
74
+ | Target | Finds |
75
+ |---|---|
76
+ | `text=Save` | visible text (exact first, then partial) |
77
+ | `role=button[name='Save']` | ARIA role + accessible name (best for buttons, links, tabs, checkboxes) |
78
+ | `label=Email` | a form field by its label |
79
+ | `placeholder=Search` | an input by its placeholder |
80
+ | `testid=save` | `data-testid` |
81
+ | `css=.toolbar button` | CSS (web only, last resort) |
82
+ | `at=640,320` | coordinates (desktop apps with no accessible elements only) |
83
+
84
+ When `check` cannot find a target, it lists the visible ones: copy one.
85
+
86
+ ### Steps
87
+
88
+ Actions: `goto`, `click` (`double`, `button: "right"`), `type` (+ `into`, `clear`, `submit`, `secret`), `press` (`Enter`, `Meta+K`), `hover`, `scroll` (`down`/`up`/`top`/`bottom` or a target), `select` (+ `option`), `wait` (a target or seconds), `pause`.
89
+
90
+ Direction: `title` and `end` (full-screen cards, `subtitle`), `callout` (bubble with `text` pointing at an element), `highlight` (dims everything else, optional `text`), `zoomTo` (frame an element without acting).
91
+
92
+ On any step: `say` (narration: a caption, and speech when voice is on), `zoom` (`false` to stay wide, or a level like `1.5`), `hold` (extra seconds on the result).
93
+
94
+ `${ENV_VAR}` in any string is replaced from the environment (use it for logins; mark password typing with `"secret": true`).
95
+
96
+ ### Style, voice, output
97
+
98
+ ```json
99
+ "style": { "background": "ocean", "padding": 72, "radius": 14, "cursor": "macos", "maxZoom": 1.9, "frame": "browser", "accent": "#3b82f6", "captions": true },
100
+ "voice": { "enabled": true, "language": "fr" },
101
+ "output": { "width": 1920, "height": 1080, "fps": 30, "gif": false }
102
+ ```
103
+
104
+ Backgrounds: `sunset`, `ocean`, `lavender`, `forest`, `midnight`, `mono`, `paper`, a color (`#0f172a`), an image path, or a gradient `{ "gradient": ["#0ea5e9", "#6366f1"], "angle": 135 }`. `frame: "browser"` adds a minimal browser bar with the URL.
105
+
106
+ 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).
107
+
108
+ 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.
109
+
110
+ ## Direction that makes a good video
111
+
112
+ - **Start on a title card** that names the feature, and **end on a card** with the result or call to action.
113
+ - **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").
114
+ - **Show before you act** when the control is hard to spot: a `callout` on the button, then the `click`.
115
+ - **End on the proof**: a `highlight` or `hold` on the result (the saved item, the green status, the sent message).
116
+ - **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.
117
+ - **Realistic data and typing**: real-looking names and messages, 3 to 10 words typed, not paragraphs.
118
+ - **Keep it short**: under a minute; cut steps that don't move the story.
119
+ - **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`.
120
+
121
+ ## When something goes wrong
122
+
123
+ - `check` fails on a target → use one from the listed visible targets, or add a `wait` for it.
124
+ - "covered by …" → something (a toast, a cookie banner, a modal) sits on the element: close it first with a step.
125
+ - "the typed text did not appear" → the field was not focused: use `into` to click it.
126
+ - A wait is long (page loads, AI answers) → keep it: long waits are sped up in the video automatically.
127
+ - The storyboard shows the wrong framing → `"zoom": false` on that step, or a `zoomTo` step, or lower `style.maxZoom`.