@plaintake/scenario 1.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PlainLab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # @plaintake/scenario
2
+
3
+ The authoring SDK for [PlainTake](https://github.com/plaintake/plaintake) demo scenarios:
4
+ `defineDemo` and the scenario DSL types used to write `*.demo.ts` files that the PlainTake
5
+ CLI records into a video.
6
+
7
+ ## Do you need to install this?
8
+
9
+ No, strictly speaking. The PlainTake binary already ships a runtime fallback for
10
+ `@plaintake/scenario`, so a scenario file's `import { defineDemo } from '@plaintake/scenario'`
11
+ resolves and runs with nothing installed at all.
12
+
13
+ What this package buys you is editor autocomplete and typechecking while you *write* a
14
+ scenario: real types for `defineDemo`'s input, `DemoContext`, `DemoStep`, and the rest of the
15
+ DSL, instead of an untyped `any`.
16
+
17
+ If you do install it, your copy is what actually gets used — module resolution tries your
18
+ project's own `node_modules` first, and only falls back to the binary's built-in copy when
19
+ that lookup fails. Nothing is overridden or shadowed; it is simply resolved before the
20
+ fallback is ever consulted.
21
+
22
+ ## Install
23
+
24
+ ```sh
25
+ npm install --save-dev @plaintake/scenario
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```ts
31
+ // login.demo.ts
32
+ import { defineDemo } from '@plaintake/scenario';
33
+
34
+ export default defineDemo({
35
+ schema: 'agent-demo.scenario/v1',
36
+ id: 'sign-in',
37
+ title: 'Sign in to the dashboard',
38
+ viewport: { width: 1920, height: 1080, deviceScaleFactor: 1 },
39
+ locale: 'en-US',
40
+ timezoneId: 'UTC',
41
+ colorScheme: 'light',
42
+ reducedMotion: 'reduce',
43
+ async run({ page, demo, baseURL }) {
44
+ await page.goto(baseURL);
45
+ await demo.step({
46
+ id: 'submit',
47
+ title: 'Submit the sign-in form',
48
+ target: page.getByRole('button', { name: 'Sign in' }),
49
+ action: 'click',
50
+ run: () => page.getByRole('button', { name: 'Sign in' }).click(),
51
+ });
52
+ },
53
+ });
54
+ ```
55
+
56
+ The PlainTake CLI discovers and records files matching `*.demo.ts`. See the
57
+ [scenario guide](https://github.com/plaintake/plaintake#readme) for the full DSL — chapters,
58
+ assertions, masks, waits, and handoffs to a person for steps PlainTake cannot perform itself
59
+ (entering a one-time code, for example).
60
+
61
+ ## Licence
62
+
63
+ This package (`@plaintake/scenario`) is MIT licensed — see [LICENSE](./LICENSE).
64
+
65
+ That covers only the authoring SDK. PlainTake itself — the CLI/binary that records and
66
+ renders the video — is separate, proprietary software; installing this package does not
67
+ grant any rights to it. See the [PlainTake licence](https://github.com/plaintake/plaintake/blob/main/LICENSE)
68
+ for those terms.
@@ -0,0 +1,2 @@
1
+ import type { DemoDefinition, DemoDefinitionInput } from './types.js';
2
+ export declare function defineDemo(input: DemoDefinitionInput): DemoDefinition;
@@ -0,0 +1,2 @@
1
+ export * from './define.js';
2
+ export * from './types.js';