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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +555 -0
  3. package/dist/bin/screencast-axi.d.ts +2 -0
  4. package/dist/bin/screencast-axi.js +16 -0
  5. package/dist/bin/screencast-axi.js.map +1 -0
  6. package/dist/src/auth/strategies.d.ts +54 -0
  7. package/dist/src/auth/strategies.js +137 -0
  8. package/dist/src/auth/strategies.js.map +1 -0
  9. package/dist/src/auth/types.d.ts +65 -0
  10. package/dist/src/auth/types.js +2 -0
  11. package/dist/src/auth/types.js.map +1 -0
  12. package/dist/src/browser.d.ts +100 -0
  13. package/dist/src/browser.js +168 -0
  14. package/dist/src/browser.js.map +1 -0
  15. package/dist/src/cli.d.ts +2 -0
  16. package/dist/src/cli.js +160 -0
  17. package/dist/src/cli.js.map +1 -0
  18. package/dist/src/commands/auth.d.ts +4 -0
  19. package/dist/src/commands/auth.js +207 -0
  20. package/dist/src/commands/auth.js.map +1 -0
  21. package/dist/src/commands/check.d.ts +12 -0
  22. package/dist/src/commands/check.js +103 -0
  23. package/dist/src/commands/check.js.map +1 -0
  24. package/dist/src/commands/doctor.d.ts +15 -0
  25. package/dist/src/commands/doctor.js +131 -0
  26. package/dist/src/commands/doctor.js.map +1 -0
  27. package/dist/src/commands/guide.d.ts +6 -0
  28. package/dist/src/commands/guide.js +257 -0
  29. package/dist/src/commands/guide.js.map +1 -0
  30. package/dist/src/commands/home.d.ts +12 -0
  31. package/dist/src/commands/home.js +78 -0
  32. package/dist/src/commands/home.js.map +1 -0
  33. package/dist/src/commands/list.d.ts +6 -0
  34. package/dist/src/commands/list.js +128 -0
  35. package/dist/src/commands/list.js.map +1 -0
  36. package/dist/src/commands/record.d.ts +7 -0
  37. package/dist/src/commands/record.js +266 -0
  38. package/dist/src/commands/record.js.map +1 -0
  39. package/dist/src/commands/scaffold.d.ts +4 -0
  40. package/dist/src/commands/scaffold.js +122 -0
  41. package/dist/src/commands/scaffold.js.map +1 -0
  42. package/dist/src/commands/setup.d.ts +14 -0
  43. package/dist/src/commands/setup.js +137 -0
  44. package/dist/src/commands/setup.js.map +1 -0
  45. package/dist/src/config.d.ts +126 -0
  46. package/dist/src/config.js +275 -0
  47. package/dist/src/config.js.map +1 -0
  48. package/dist/src/director.d.ts +217 -0
  49. package/dist/src/director.js +415 -0
  50. package/dist/src/director.js.map +1 -0
  51. package/dist/src/duration.d.ts +33 -0
  52. package/dist/src/duration.js +68 -0
  53. package/dist/src/duration.js.map +1 -0
  54. package/dist/src/encode.d.ts +67 -0
  55. package/dist/src/encode.js +225 -0
  56. package/dist/src/encode.js.map +1 -0
  57. package/dist/src/errors.d.ts +19 -0
  58. package/dist/src/errors.js +27 -0
  59. package/dist/src/errors.js.map +1 -0
  60. package/dist/src/flags.d.ts +39 -0
  61. package/dist/src/flags.js +130 -0
  62. package/dist/src/flags.js.map +1 -0
  63. package/dist/src/forensics.d.ts +51 -0
  64. package/dist/src/forensics.js +107 -0
  65. package/dist/src/forensics.js.map +1 -0
  66. package/dist/src/hooks.d.ts +9 -0
  67. package/dist/src/hooks.js +20 -0
  68. package/dist/src/hooks.js.map +1 -0
  69. package/dist/src/index.d.ts +18 -0
  70. package/dist/src/index.js +18 -0
  71. package/dist/src/index.js.map +1 -0
  72. package/dist/src/inventory.d.ts +45 -0
  73. package/dist/src/inventory.js +89 -0
  74. package/dist/src/inventory.js.map +1 -0
  75. package/dist/src/manifest.d.ts +89 -0
  76. package/dist/src/manifest.js +137 -0
  77. package/dist/src/manifest.js.map +1 -0
  78. package/dist/src/output.d.ts +8 -0
  79. package/dist/src/output.js +2 -0
  80. package/dist/src/output.js.map +1 -0
  81. package/dist/src/overlay.d.ts +105 -0
  82. package/dist/src/overlay.js +302 -0
  83. package/dist/src/overlay.js.map +1 -0
  84. package/dist/src/reference.d.ts +1 -0
  85. package/dist/src/reference.js +108 -0
  86. package/dist/src/reference.js.map +1 -0
  87. package/dist/src/run.d.ts +82 -0
  88. package/dist/src/run.js +321 -0
  89. package/dist/src/run.js.map +1 -0
  90. package/dist/src/skill.d.ts +12 -0
  91. package/dist/src/skill.js +69 -0
  92. package/dist/src/skill.js.map +1 -0
  93. package/dist/src/toolchain.d.ts +62 -0
  94. package/dist/src/toolchain.js +127 -0
  95. package/dist/src/toolchain.js.map +1 -0
  96. package/dist/src/types.d.ts +88 -0
  97. package/dist/src/types.js +18 -0
  98. package/dist/src/types.js.map +1 -0
  99. package/dist/src/version.d.ts +10 -0
  100. package/dist/src/version.js +11 -0
  101. package/dist/src/version.js.map +1 -0
  102. package/package.json +93 -0
  103. 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 ...`.