screencast-axi 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.
- package/LICENSE +21 -0
- package/README.md +555 -0
- package/dist/bin/screencast-axi.d.ts +2 -0
- package/dist/bin/screencast-axi.js +16 -0
- package/dist/bin/screencast-axi.js.map +1 -0
- package/dist/src/auth/strategies.d.ts +54 -0
- package/dist/src/auth/strategies.js +137 -0
- package/dist/src/auth/strategies.js.map +1 -0
- package/dist/src/auth/types.d.ts +65 -0
- package/dist/src/auth/types.js +2 -0
- package/dist/src/auth/types.js.map +1 -0
- package/dist/src/browser.d.ts +100 -0
- package/dist/src/browser.js +168 -0
- package/dist/src/browser.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +160 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/auth.d.ts +4 -0
- package/dist/src/commands/auth.js +207 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/check.d.ts +12 -0
- package/dist/src/commands/check.js +103 -0
- package/dist/src/commands/check.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +15 -0
- package/dist/src/commands/doctor.js +131 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/guide.d.ts +6 -0
- package/dist/src/commands/guide.js +257 -0
- package/dist/src/commands/guide.js.map +1 -0
- package/dist/src/commands/home.d.ts +12 -0
- package/dist/src/commands/home.js +78 -0
- package/dist/src/commands/home.js.map +1 -0
- package/dist/src/commands/list.d.ts +6 -0
- package/dist/src/commands/list.js +128 -0
- package/dist/src/commands/list.js.map +1 -0
- package/dist/src/commands/record.d.ts +7 -0
- package/dist/src/commands/record.js +266 -0
- package/dist/src/commands/record.js.map +1 -0
- package/dist/src/commands/scaffold.d.ts +4 -0
- package/dist/src/commands/scaffold.js +122 -0
- package/dist/src/commands/scaffold.js.map +1 -0
- package/dist/src/commands/setup.d.ts +14 -0
- package/dist/src/commands/setup.js +137 -0
- package/dist/src/commands/setup.js.map +1 -0
- package/dist/src/config.d.ts +126 -0
- package/dist/src/config.js +275 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/director.d.ts +217 -0
- package/dist/src/director.js +415 -0
- package/dist/src/director.js.map +1 -0
- package/dist/src/duration.d.ts +33 -0
- package/dist/src/duration.js +68 -0
- package/dist/src/duration.js.map +1 -0
- package/dist/src/encode.d.ts +67 -0
- package/dist/src/encode.js +225 -0
- package/dist/src/encode.js.map +1 -0
- package/dist/src/errors.d.ts +19 -0
- package/dist/src/errors.js +27 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/flags.d.ts +39 -0
- package/dist/src/flags.js +130 -0
- package/dist/src/flags.js.map +1 -0
- package/dist/src/forensics.d.ts +51 -0
- package/dist/src/forensics.js +107 -0
- package/dist/src/forensics.js.map +1 -0
- package/dist/src/hooks.d.ts +9 -0
- package/dist/src/hooks.js +20 -0
- package/dist/src/hooks.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +18 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/inventory.d.ts +45 -0
- package/dist/src/inventory.js +89 -0
- package/dist/src/inventory.js.map +1 -0
- package/dist/src/manifest.d.ts +89 -0
- package/dist/src/manifest.js +137 -0
- package/dist/src/manifest.js.map +1 -0
- package/dist/src/output.d.ts +8 -0
- package/dist/src/output.js +2 -0
- package/dist/src/output.js.map +1 -0
- package/dist/src/overlay.d.ts +105 -0
- package/dist/src/overlay.js +302 -0
- package/dist/src/overlay.js.map +1 -0
- package/dist/src/reference.d.ts +1 -0
- package/dist/src/reference.js +108 -0
- package/dist/src/reference.js.map +1 -0
- package/dist/src/run.d.ts +82 -0
- package/dist/src/run.js +321 -0
- package/dist/src/run.js.map +1 -0
- package/dist/src/skill.d.ts +12 -0
- package/dist/src/skill.js +69 -0
- package/dist/src/skill.js.map +1 -0
- package/dist/src/toolchain.d.ts +62 -0
- package/dist/src/toolchain.js +127 -0
- package/dist/src/toolchain.js.map +1 -0
- package/dist/src/types.d.ts +88 -0
- package/dist/src/types.js +18 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/version.d.ts +10 -0
- package/dist/src/version.js +11 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +93 -0
- package/skills/screencast-axi/SKILL.md +49 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Locator, Page } from "playwright";
|
|
2
|
+
import type { Director } from "./director.js";
|
|
3
|
+
import type { DeepPartial, OverlayTheme } from "./overlay.js";
|
|
4
|
+
/** Anything a Director action can aim at. */
|
|
5
|
+
export type Target = string | Locator | {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export interface Viewport {
|
|
10
|
+
readonly width: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ScenarioContext {
|
|
14
|
+
/** Base URL the scenario navigates against, e.g. http://localhost:4000 */
|
|
15
|
+
readonly baseUrl: string;
|
|
16
|
+
/** Directory the deliverables are written to. */
|
|
17
|
+
readonly outDir: string;
|
|
18
|
+
/** Scratch directory for raw captures, logs and failure artifacts. */
|
|
19
|
+
readonly rawDir: string;
|
|
20
|
+
/** Whoever the auth strategy signed in as, when one ran. */
|
|
21
|
+
readonly identity?: {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
};
|
|
25
|
+
/** Progress line. Goes to stderr and the run log, never to stdout. */
|
|
26
|
+
log(message: string): void;
|
|
27
|
+
}
|
|
28
|
+
export interface Scenario {
|
|
29
|
+
/** Output file stem: `task-create` -> task-create.mp4 / .webm / .webp */
|
|
30
|
+
readonly id: string;
|
|
31
|
+
/** Human title. Shown in the CLI and written to the manifest. */
|
|
32
|
+
readonly title: string;
|
|
33
|
+
/** One line describing what the clip demonstrates. Written to the manifest. */
|
|
34
|
+
readonly description: string;
|
|
35
|
+
/** Default base URL, overridable with --base-url. */
|
|
36
|
+
readonly baseUrl?: string;
|
|
37
|
+
/** Recording viewport, or a Playwright device preset name. */
|
|
38
|
+
readonly viewport?: Viewport;
|
|
39
|
+
readonly device?: string;
|
|
40
|
+
readonly orientation?: "portrait" | "landscape";
|
|
41
|
+
/** Playback speed multiplier. Lower is faster. */
|
|
42
|
+
readonly pace?: number;
|
|
43
|
+
/** Ask the recorder to solve for `pace` so the clip lands near this length. */
|
|
44
|
+
readonly targetDurationMs?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The clip's narration, in the order it appears on screen. `run()` puts each
|
|
47
|
+
* line up with `director.step(i)` rather than typing it inline, so this array
|
|
48
|
+
* is simultaneously the burnt-in captions and the plain text of the workflow:
|
|
49
|
+
* the recorder writes it to the manifest, and a site can render it beside the
|
|
50
|
+
* clip so the workflow is readable without watching.
|
|
51
|
+
*
|
|
52
|
+
* A take that does not show every line, in order, exactly once is rejected,
|
|
53
|
+
* so the written workflow cannot quietly stop matching the recorded one.
|
|
54
|
+
*/
|
|
55
|
+
readonly steps?: readonly string[];
|
|
56
|
+
/** Named auth strategy, or false for a signed-out recording. */
|
|
57
|
+
readonly auth?: string | false;
|
|
58
|
+
/**
|
|
59
|
+
* Overlay overrides for this take, merged over the config's.
|
|
60
|
+
*
|
|
61
|
+
* A clip destined for a 300px slot in a README needs a larger caption than
|
|
62
|
+
* one shown full width, and a take on a dark page needs a different caption
|
|
63
|
+
* background - both are properties of the clip, not of the project.
|
|
64
|
+
*/
|
|
65
|
+
readonly overlay?: DeepPartial<OverlayTheme>;
|
|
66
|
+
/** Free-form labels for filtering in `list`. */
|
|
67
|
+
readonly tags?: readonly string[];
|
|
68
|
+
/** Runs before the clip starts: navigation, data setup, state reset. */
|
|
69
|
+
setup?(page: Page, ctx: ScenarioContext): Promise<void>;
|
|
70
|
+
/** The clip itself. Everything here is recorded. */
|
|
71
|
+
run(director: Director, ctx: ScenarioContext): Promise<void>;
|
|
72
|
+
/** Runs after the take, successful or not. */
|
|
73
|
+
teardown?(page: Page, ctx: ScenarioContext): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/** Marks an object as a scenario, so discovery can find it in any export. */
|
|
76
|
+
export declare const SCENARIO_MARKER: unique symbol;
|
|
77
|
+
export type DefinedScenario = Scenario & {
|
|
78
|
+
readonly [SCENARIO_MARKER]: true;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Identity function that stamps a scenario so discovery can recognise it.
|
|
82
|
+
*
|
|
83
|
+
* A module may export it as `default`, as a named export, or as one of
|
|
84
|
+
* several - the stamp is what makes it findable, rather than a naming
|
|
85
|
+
* convention the author has to remember.
|
|
86
|
+
*/
|
|
87
|
+
export declare function defineScenario(scenario: Scenario): DefinedScenario;
|
|
88
|
+
export declare function isScenario(value: unknown): value is DefinedScenario;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Marks an object as a scenario, so discovery can find it in any export. */
|
|
2
|
+
export const SCENARIO_MARKER = Symbol.for("screencast-axi.scenario");
|
|
3
|
+
/**
|
|
4
|
+
* Identity function that stamps a scenario so discovery can recognise it.
|
|
5
|
+
*
|
|
6
|
+
* A module may export it as `default`, as a named export, or as one of
|
|
7
|
+
* several - the stamp is what makes it findable, rather than a naming
|
|
8
|
+
* convention the author has to remember.
|
|
9
|
+
*/
|
|
10
|
+
export function defineScenario(scenario) {
|
|
11
|
+
return { ...scenario, [SCENARIO_MARKER]: true };
|
|
12
|
+
}
|
|
13
|
+
export function isScenario(value) {
|
|
14
|
+
return (typeof value === "object" &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
value[SCENARIO_MARKER] === true);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAyEA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAIrE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAAiC,CAAC,eAAe,CAAC,KAAK,IAAI,CAC7D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaf module: imports nothing, not even node builtins.
|
|
3
|
+
*
|
|
4
|
+
* `bin/screencast-axi.ts` answers `--version` from here before the command
|
|
5
|
+
* graph is dynamically imported, so a version check never pays for the CLI.
|
|
6
|
+
* Bumped by release-please via the annotation below, and kept in step with
|
|
7
|
+
* package.json by a test - so a drift fails CI rather than shipping a CLI
|
|
8
|
+
* that misreports its own version.
|
|
9
|
+
*/
|
|
10
|
+
export declare const VERSION = "0.1.0";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaf module: imports nothing, not even node builtins.
|
|
3
|
+
*
|
|
4
|
+
* `bin/screencast-axi.ts` answers `--version` from here before the command
|
|
5
|
+
* graph is dynamically imported, so a version check never pays for the CLI.
|
|
6
|
+
* Bumped by release-please via the annotation below, and kept in step with
|
|
7
|
+
* package.json by a test - so a drift fails CI rather than shipping a CLI
|
|
8
|
+
* that misreports its own version.
|
|
9
|
+
*/
|
|
10
|
+
export const VERSION = "0.1.0"; // x-release-please-version
|
|
11
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "screencast-axi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AXI-compliant screencast recorder - script a web workflow, record it with a synthetic cursor and captions, encode to mp4/webm/poster. Requires ffmpeg.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Valzon/screencast-axi.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/Valzon/screencast-axi#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Valzon/screencast-axi/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"screencast",
|
|
16
|
+
"video",
|
|
17
|
+
"playwright",
|
|
18
|
+
"demo",
|
|
19
|
+
"gif",
|
|
20
|
+
"cli",
|
|
21
|
+
"agent",
|
|
22
|
+
"axi",
|
|
23
|
+
"toon"
|
|
24
|
+
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"screencast-axi": "dist/bin/screencast-axi.js"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/src/index.d.ts",
|
|
31
|
+
"default": "./dist/src/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./config": {
|
|
34
|
+
"types": "./dist/src/config.d.ts",
|
|
35
|
+
"default": "./dist/src/config.js"
|
|
36
|
+
},
|
|
37
|
+
"./manifest": {
|
|
38
|
+
"types": "./dist/src/manifest.d.ts",
|
|
39
|
+
"default": "./dist/src/manifest.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"skills/screencast-axi",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=20"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@toon-format/toon": "^2.1.0",
|
|
58
|
+
"axi-sdk-js": "^0.1.11"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"playwright": ">=1.44.0",
|
|
62
|
+
"tsx": "^4"
|
|
63
|
+
},
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"playwright": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"tsx": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/node": "^26.4.0",
|
|
74
|
+
"playwright": "^1.62.1",
|
|
75
|
+
"prettier": "^3.9.6",
|
|
76
|
+
"tsx": "^4.23.13",
|
|
77
|
+
"typescript": "^7.0.2",
|
|
78
|
+
"vitest": "^4.1.11"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"build": "tsc && chmod +x dist/bin/screencast-axi.js",
|
|
82
|
+
"build:skill": "tsx scripts/build-skill.ts",
|
|
83
|
+
"dev": "tsx bin/screencast-axi.ts",
|
|
84
|
+
"test": "vitest run",
|
|
85
|
+
"test:watch": "vitest",
|
|
86
|
+
"typecheck": "tsc -p tsconfig.check.json",
|
|
87
|
+
"format": "prettier --write .",
|
|
88
|
+
"format:check": "prettier --check .",
|
|
89
|
+
"demo": "node dist/bin/screencast-axi.js record demo --gif --webp --config demo/screencast.config.ts",
|
|
90
|
+
"demo:usecases": "node dist/bin/screencast-axi.js record usecase-anysite --gif --webp --loop-width 480 --loop-fps 10 --config demo/screencast.config.ts && node dist/bin/screencast-axi.js record usecase-login --gif --webp --loop-width 460 --loop-fps 10 --config demo/screencast.config.ts && node dist/bin/screencast-axi.js record usecase-mobile --gif --webp --loop-width 260 --loop-fps 11 --config demo/screencast.config.ts",
|
|
91
|
+
"build:reference": "tsx scripts/build-reference.ts"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: screencast-axi
|
|
3
|
+
description: "Record product screencasts and demo clips of any website through the screencast-axi CLI - script a workflow as a Playwright scenario, rehearse its selectors, then encode it to mp4, webm and a poster with a synthetic cursor and captions. Use whenever a task needs a recorded walkthrough of a UI: a landing-page demo, a release-note clip, a feature tour, a bug reproduction, or a how-to."
|
|
4
|
+
user-invocable: false
|
|
5
|
+
author: Valentyn Morenko
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
hermes:
|
|
9
|
+
tags: [screencast, video, playwright, demo, landing-page]
|
|
10
|
+
category: automation
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# screencast-axi
|
|
14
|
+
|
|
15
|
+
Records a scripted browser workflow as a watchable clip. Prefer this over
|
|
16
|
+
hand-rolled Playwright video capture or a screen recorder.
|
|
17
|
+
|
|
18
|
+
Use it whenever a task needs a recorded walkthrough of a UI: a landing-page
|
|
19
|
+
demo, a feature tour, a release-note clip, a bug reproduction. Skip it when a
|
|
20
|
+
still screenshot says the same thing - a clip costs far more to produce and to
|
|
21
|
+
watch.
|
|
22
|
+
|
|
23
|
+
## Current guidance lives in the CLI
|
|
24
|
+
|
|
25
|
+
Do not follow command, flag, or workflow instructions from this file -
|
|
26
|
+
installed copies go stale. Get the current source of truth from the CLI:
|
|
27
|
+
|
|
28
|
+
- `npx -y screencast-axi` for the state of the clip library
|
|
29
|
+
- `npx -y screencast-axi --help` for the command index
|
|
30
|
+
- `npx -y screencast-axi <command> --help` for per-command usage
|
|
31
|
+
- `npx -y screencast-axi guide` for topic-sized guidance, pulled one topic at
|
|
32
|
+
a time rather than read as a manual
|
|
33
|
+
|
|
34
|
+
Three things worth knowing before the first run:
|
|
35
|
+
|
|
36
|
+
1. Iterate with `rehearse`, not `record`: no encoding, so a stale selector
|
|
37
|
+
surfaces in seconds, and it prints every action the scenario took.
|
|
38
|
+
2. `--headed` shows it happening in a real window. Offer it when someone
|
|
39
|
+
wants to see what a script does to their signed-in account before it runs.
|
|
40
|
+
3. When a selector needs discovering, drive the page live with a browser tool
|
|
41
|
+
such as `chrome-devtools-axi`, then write the scenario.
|
|
42
|
+
|
|
43
|
+
ffmpeg must be installed. Signing in is a one-time human step
|
|
44
|
+
(`auth login --interactive`), and the CLI refuses rather than prompting when
|
|
45
|
+
no person is present.
|
|
46
|
+
|
|
47
|
+
You do not need screencast-axi installed globally - invoke it with
|
|
48
|
+
`npx -y screencast-axi <command>`. If its output suggests a follow-up command
|
|
49
|
+
starting with `screencast-axi`, run that as `npx -y screencast-axi ...`.
|