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,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page overlay injected into every document of a recording session.
|
|
3
|
+
*
|
|
4
|
+
* Playwright videos do not contain the mouse pointer, which makes any clip of a
|
|
5
|
+
* drag or a click unreadable. This draws a synthetic pointer that follows the
|
|
6
|
+
* real one (Playwright's `mouse.move` dispatches genuine `mousemove` events, so
|
|
7
|
+
* the overlay stays in sync for free), plus a click ripple, a drag ghost and a
|
|
8
|
+
* caption bar.
|
|
9
|
+
*
|
|
10
|
+
* Everything lives in a shadow root so no page CSS can reach it, and the host
|
|
11
|
+
* is `pointer-events: none` so it never intercepts a click.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_OVERLAY_THEME = {
|
|
14
|
+
accent: "#4f46e5",
|
|
15
|
+
hideNativeCursor: true,
|
|
16
|
+
hideSelectors: [],
|
|
17
|
+
pointer: { size: 26, fill: "#111116", stroke: "#ffffff", strokeWidth: 1.6 },
|
|
18
|
+
ripple: { enabled: true, scale: 2.6, durationMs: 500 },
|
|
19
|
+
dragGhost: { enabled: true, width: 46, height: 30, radius: 6 },
|
|
20
|
+
caption: {
|
|
21
|
+
position: "bottom",
|
|
22
|
+
offset: 40,
|
|
23
|
+
maxWidth: "min(760px, 78vw)",
|
|
24
|
+
background: "rgba(17, 17, 22, .88)",
|
|
25
|
+
color: "#ffffff",
|
|
26
|
+
fontSize: 17,
|
|
27
|
+
fontFamily: 'ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif',
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
radius: 12,
|
|
30
|
+
padding: "12px 20px",
|
|
31
|
+
fadeMs: 220,
|
|
32
|
+
shadow: "0 12px 40px rgba(0,0,0,.34)",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
function rgba(color, alpha) {
|
|
36
|
+
const hex = color.trim().replace(/^#/, "");
|
|
37
|
+
const full = hex.length === 3
|
|
38
|
+
? hex
|
|
39
|
+
.split("")
|
|
40
|
+
.map((c) => c + c)
|
|
41
|
+
.join("")
|
|
42
|
+
: hex;
|
|
43
|
+
if (!/^[0-9a-fA-F]{6}$/.test(full)) {
|
|
44
|
+
// Not a hex colour - use it as given and let the browser decide. A named
|
|
45
|
+
// colour or an rgb() string still renders; it just cannot be made
|
|
46
|
+
// translucent here.
|
|
47
|
+
return color;
|
|
48
|
+
}
|
|
49
|
+
const r = parseInt(full.slice(0, 2), 16);
|
|
50
|
+
const g = parseInt(full.slice(2, 4), 16);
|
|
51
|
+
const b = parseInt(full.slice(4, 6), 16);
|
|
52
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
53
|
+
}
|
|
54
|
+
export function resolveOverlayTheme(overrides) {
|
|
55
|
+
const t = mergeTheme(DEFAULT_OVERLAY_THEME, overrides);
|
|
56
|
+
return {
|
|
57
|
+
...t,
|
|
58
|
+
accentSoft: rgba(t.accent, 0.16),
|
|
59
|
+
accentEdge: rgba(t.accent, 0.55),
|
|
60
|
+
accentRipple: rgba(t.accent, 0.28),
|
|
61
|
+
accentRippleEdge: rgba(t.accent, 0.6),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function mergeThemes(base, over) {
|
|
65
|
+
if (!base)
|
|
66
|
+
return over ?? {};
|
|
67
|
+
if (!over)
|
|
68
|
+
return base;
|
|
69
|
+
return {
|
|
70
|
+
...base,
|
|
71
|
+
...over,
|
|
72
|
+
pointer: { ...base.pointer, ...over.pointer },
|
|
73
|
+
ripple: { ...base.ripple, ...over.ripple },
|
|
74
|
+
dragGhost: { ...base.dragGhost, ...over.dragGhost },
|
|
75
|
+
caption: { ...base.caption, ...over.caption },
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function mergeTheme(base, overrides) {
|
|
79
|
+
if (!overrides)
|
|
80
|
+
return base;
|
|
81
|
+
return {
|
|
82
|
+
...base,
|
|
83
|
+
...overrides,
|
|
84
|
+
pointer: { ...base.pointer, ...overrides.pointer },
|
|
85
|
+
ripple: { ...base.ripple, ...overrides.ripple },
|
|
86
|
+
dragGhost: { ...base.dragGhost, ...overrides.dragGhost },
|
|
87
|
+
caption: { ...base.caption, ...overrides.caption },
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Serialised form of {@link installOverlay}, ready for `addInitScript`.
|
|
92
|
+
*
|
|
93
|
+
* The function is stringified rather than passed directly because this file is
|
|
94
|
+
* compiled by esbuild under `keepNames` in some toolchains, which rewrites
|
|
95
|
+
* every inner function as `__name(fn, "fn")`. That helper only exists in the
|
|
96
|
+
* Node module scope, so the function throws `__name is not defined` the moment
|
|
97
|
+
* Playwright evaluates it in the page - silently, unless a `pageerror`
|
|
98
|
+
* listener is attached. Re-declaring `__name` as identity in the wrapper is
|
|
99
|
+
* enough, and costs nothing if a future toolchain stops emitting it.
|
|
100
|
+
*
|
|
101
|
+
* The theme travels as JSON in the same wrapper, so theming does not
|
|
102
|
+
* reintroduce a function reference that would have to survive the same trip.
|
|
103
|
+
*/
|
|
104
|
+
export function overlayInitScript(theme) {
|
|
105
|
+
return `(() => { const __name = (fn) => fn; (${installOverlay.toString()})(${JSON.stringify(theme)}); })();`;
|
|
106
|
+
}
|
|
107
|
+
/** Runs inside the page via `addInitScript`. Must be fully self-contained. */
|
|
108
|
+
export function installOverlay(theme) {
|
|
109
|
+
const HOST_ID = "__screencast_overlay";
|
|
110
|
+
const STYLE_ID = "__screencast_hide";
|
|
111
|
+
// Already installed in this realm. An init script runs once per document
|
|
112
|
+
// creation, so this only fires if something injected it twice.
|
|
113
|
+
if (window.__screencast)
|
|
114
|
+
return;
|
|
115
|
+
let refs = null;
|
|
116
|
+
/** Last caption text, so a re-mount can restore what was on screen. */
|
|
117
|
+
let captionText = null;
|
|
118
|
+
const cap = theme.caption;
|
|
119
|
+
const edge = cap.position === "top" ? `top: ${cap.offset}px` : `bottom: ${cap.offset}px`;
|
|
120
|
+
const rise = cap.position === "top" ? -8 : 8;
|
|
121
|
+
const build = () => {
|
|
122
|
+
if (!document.body || !document.documentElement)
|
|
123
|
+
return null;
|
|
124
|
+
const host = document.createElement("div");
|
|
125
|
+
host.id = HOST_ID;
|
|
126
|
+
host.style.cssText = "position:fixed;inset:0;z-index:2147483647;pointer-events:none;";
|
|
127
|
+
const root = host.attachShadow({ mode: "open" });
|
|
128
|
+
root.innerHTML = `
|
|
129
|
+
<style>
|
|
130
|
+
:host { all: initial; }
|
|
131
|
+
.pointer {
|
|
132
|
+
position: fixed; top: 0; left: 0;
|
|
133
|
+
width: ${theme.pointer.size}px; height: ${theme.pointer.size}px;
|
|
134
|
+
transform: translate3d(-100px, -100px, 0);
|
|
135
|
+
will-change: transform; opacity: 0; transition: opacity 120ms linear;
|
|
136
|
+
}
|
|
137
|
+
.pointer.on { opacity: 1; }
|
|
138
|
+
.carry {
|
|
139
|
+
position: fixed; top: 0; left: 0;
|
|
140
|
+
transform: translate3d(-100px, -100px, 0);
|
|
141
|
+
opacity: 0; transition: opacity 140ms linear;
|
|
142
|
+
}
|
|
143
|
+
.carry.on { opacity: 1; }
|
|
144
|
+
.carry > i {
|
|
145
|
+
display: block;
|
|
146
|
+
width: ${theme.dragGhost.width}px; height: ${theme.dragGhost.height}px;
|
|
147
|
+
margin: 10px 0 0 10px;
|
|
148
|
+
border-radius: ${theme.dragGhost.radius}px;
|
|
149
|
+
background: ${theme.accentSoft};
|
|
150
|
+
border: 1px solid ${theme.accentEdge};
|
|
151
|
+
box-shadow: 0 6px 18px rgba(17, 17, 22, .18);
|
|
152
|
+
}
|
|
153
|
+
.ripple { position: fixed; top: 0; left: 0; transform: translate3d(-100px, -100px, 0); }
|
|
154
|
+
.ripple > i {
|
|
155
|
+
display: block; width: 18px; height: 18px; margin: -9px 0 0 -9px;
|
|
156
|
+
border-radius: 50%; background: ${theme.accentRipple};
|
|
157
|
+
box-shadow: 0 0 0 2px ${theme.accentRippleEdge};
|
|
158
|
+
transform: scale(.3); opacity: 0;
|
|
159
|
+
}
|
|
160
|
+
.ripple.go > i {
|
|
161
|
+
animation: pop ${theme.ripple.durationMs}ms cubic-bezier(.2,.8,.3,1) forwards;
|
|
162
|
+
}
|
|
163
|
+
@keyframes pop {
|
|
164
|
+
0% { transform: scale(.3); opacity: .95; }
|
|
165
|
+
100% { transform: scale(${theme.ripple.scale}); opacity: 0; }
|
|
166
|
+
}
|
|
167
|
+
.caption {
|
|
168
|
+
position: fixed; left: 50%; ${edge};
|
|
169
|
+
transform: translateX(-50%) translateY(${rise}px);
|
|
170
|
+
max-width: ${cap.maxWidth}; padding: ${cap.padding};
|
|
171
|
+
border-radius: ${cap.radius}px;
|
|
172
|
+
background: ${cap.background}; color: ${cap.color};
|
|
173
|
+
font: ${cap.fontWeight} ${cap.fontSize}px/1.45 ${cap.fontFamily};
|
|
174
|
+
letter-spacing: .01em; text-align: center;
|
|
175
|
+
box-shadow: ${cap.shadow};
|
|
176
|
+
opacity: 0;
|
|
177
|
+
transition: opacity ${cap.fadeMs}ms ease, transform ${cap.fadeMs}ms ease;
|
|
178
|
+
}
|
|
179
|
+
.caption.on { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
180
|
+
</style>
|
|
181
|
+
<div class="ripple"><i></i></div>
|
|
182
|
+
<div class="carry"><i></i></div>
|
|
183
|
+
<svg class="pointer" viewBox="0 0 26 26" aria-hidden="true">
|
|
184
|
+
<path d="M5 2.5 L5 20.5 L9.6 16.2 L12.6 22.6 L16 21 L13 14.8 L19.4 14.4 Z"
|
|
185
|
+
fill="${theme.pointer.fill}" stroke="${theme.pointer.stroke}"
|
|
186
|
+
stroke-width="${theme.pointer.strokeWidth}" stroke-linejoin="round"/>
|
|
187
|
+
</svg>
|
|
188
|
+
<div class="caption"></div>
|
|
189
|
+
`;
|
|
190
|
+
document.documentElement.appendChild(host);
|
|
191
|
+
// A single fixed arrow reads better than the browser swapping between
|
|
192
|
+
// arrow / text / grab cursors mid-clip, so hide the real one. Anything in
|
|
193
|
+
// `hideSelectors` is page chrome the recording should not show.
|
|
194
|
+
if (document.head && !document.getElementById(STYLE_ID)) {
|
|
195
|
+
const rules = [];
|
|
196
|
+
if (theme.hideNativeCursor)
|
|
197
|
+
rules.push("*, *::before, *::after { cursor: none !important; }");
|
|
198
|
+
for (const selector of theme.hideSelectors) {
|
|
199
|
+
rules.push(`${selector} { display: none !important; }`);
|
|
200
|
+
}
|
|
201
|
+
if (rules.length > 0) {
|
|
202
|
+
const hide = document.createElement("style");
|
|
203
|
+
hide.id = STYLE_ID;
|
|
204
|
+
hide.textContent = rules.join(" ");
|
|
205
|
+
document.head.appendChild(hide);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const next = {
|
|
209
|
+
host,
|
|
210
|
+
pointer: root.querySelector(".pointer"),
|
|
211
|
+
ripple: root.querySelector(".ripple"),
|
|
212
|
+
carry: root.querySelector(".carry"),
|
|
213
|
+
caption: root.querySelector(".caption"),
|
|
214
|
+
};
|
|
215
|
+
// A re-mount must not lose the line that was on screen: a page that
|
|
216
|
+
// rewrites its document mid-take would otherwise drop the caption and the
|
|
217
|
+
// clip would keep recording as if nothing were wrong.
|
|
218
|
+
if (captionText !== null) {
|
|
219
|
+
next.caption.textContent = captionText;
|
|
220
|
+
next.caption.classList.add("on");
|
|
221
|
+
}
|
|
222
|
+
return next;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* The overlay, rebuilt if the page threw it away.
|
|
226
|
+
*
|
|
227
|
+
* A document replacement - `document.write`, Playwright's `setContent`, some
|
|
228
|
+
* SPA bootstraps - detaches the host while this realm, and therefore
|
|
229
|
+
* `window.__screencast`, survives. Without this the API would keep answering
|
|
230
|
+
* on a detached node: captions would stop appearing and the recording would
|
|
231
|
+
* carry on silently, which is the worst way for this to fail.
|
|
232
|
+
*/
|
|
233
|
+
const ensure = () => {
|
|
234
|
+
if (refs && refs.host.isConnected)
|
|
235
|
+
return refs;
|
|
236
|
+
refs = build();
|
|
237
|
+
return refs;
|
|
238
|
+
};
|
|
239
|
+
const move = (x, y) => {
|
|
240
|
+
const r = ensure();
|
|
241
|
+
if (!r)
|
|
242
|
+
return;
|
|
243
|
+
r.pointer.style.transform = `translate3d(${x}px, ${y}px, 0)`;
|
|
244
|
+
r.carry.style.transform = `translate3d(${x}px, ${y}px, 0)`;
|
|
245
|
+
r.pointer.classList.add("on");
|
|
246
|
+
};
|
|
247
|
+
addEventListener("mousemove", (e) => move(e.clientX, e.clientY), {
|
|
248
|
+
capture: true,
|
|
249
|
+
passive: true,
|
|
250
|
+
});
|
|
251
|
+
if (theme.ripple.enabled) {
|
|
252
|
+
addEventListener("mousedown", (e) => {
|
|
253
|
+
const r = ensure();
|
|
254
|
+
if (!r)
|
|
255
|
+
return;
|
|
256
|
+
r.ripple.style.transform = `translate3d(${e.clientX}px, ${e.clientY}px, 0)`;
|
|
257
|
+
r.ripple.classList.remove("go");
|
|
258
|
+
void r.ripple.offsetWidth; // restart the animation
|
|
259
|
+
r.ripple.classList.add("go");
|
|
260
|
+
}, { capture: true, passive: true });
|
|
261
|
+
}
|
|
262
|
+
window.__screencast = {
|
|
263
|
+
caption(text) {
|
|
264
|
+
captionText = text;
|
|
265
|
+
const r = ensure();
|
|
266
|
+
if (!r)
|
|
267
|
+
return;
|
|
268
|
+
if (text) {
|
|
269
|
+
r.caption.textContent = text;
|
|
270
|
+
r.caption.classList.add("on");
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
r.caption.classList.remove("on");
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
setPointerVisible(visible) {
|
|
277
|
+
ensure()?.pointer.classList.toggle("on", visible);
|
|
278
|
+
},
|
|
279
|
+
// An HTML5 drag never presses the mouse button (see Director.dragHtml5),
|
|
280
|
+
// so there is no ripple and nothing else on screen says "this pointer is
|
|
281
|
+
// carrying something". This ghost chip does.
|
|
282
|
+
setDragging(dragging) {
|
|
283
|
+
if (!theme.dragGhost.enabled)
|
|
284
|
+
return;
|
|
285
|
+
ensure()?.carry.classList.toggle("on", dragging);
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
// Listeners go on `window`, not `document`: `document.open()` - which is how
|
|
289
|
+
// a page replaces itself - drops every listener registered on the document,
|
|
290
|
+
// while window-level ones survive.
|
|
291
|
+
//
|
|
292
|
+
// These cover the ordinary path, where the document is still parsing when
|
|
293
|
+
// the init script runs. They do *not* cover a document replacement: measured
|
|
294
|
+
// in Chromium, a replaced document fires neither DOMContentLoaded nor load
|
|
295
|
+
// on window, even though the listeners are still attached. That case is
|
|
296
|
+
// handled lazily by `ensure()`, which every API call and every pointer move
|
|
297
|
+
// goes through - so the overlay is back before the next thing a take does.
|
|
298
|
+
addEventListener("DOMContentLoaded", () => ensure());
|
|
299
|
+
addEventListener("load", () => ensure());
|
|
300
|
+
ensure();
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../src/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6DH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,IAAI;IACtB,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE;IAC3E,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE;IACtD,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,MAA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AAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function COMMAND_REFERENCE(): string;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { AUTH_FLAGS } from "./commands/auth.js";
|
|
2
|
+
import { CHECK_FLAGS } from "./commands/check.js";
|
|
3
|
+
import { DOCTOR_FLAGS } from "./commands/doctor.js";
|
|
4
|
+
import { GUIDE_FLAGS } from "./commands/guide.js";
|
|
5
|
+
import { LIST_FLAGS, SHOW_FLAGS } from "./commands/list.js";
|
|
6
|
+
import { RECORD_FLAGS, REHEARSE_FLAGS } from "./commands/record.js";
|
|
7
|
+
import { SCAFFOLD_FLAGS } from "./commands/scaffold.js";
|
|
8
|
+
import { INIT_FLAGS, SETUP_FLAGS } from "./commands/setup.js";
|
|
9
|
+
const COMMANDS = [
|
|
10
|
+
{
|
|
11
|
+
command: "init",
|
|
12
|
+
summary: "Write a config, a scenarios directory and a gitignore entry",
|
|
13
|
+
usage: "screencast-axi init",
|
|
14
|
+
flags: INIT_FLAGS,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
command: "scaffold",
|
|
18
|
+
summary: "Write a scenario skeleton so the boilerplate is never what goes wrong",
|
|
19
|
+
usage: "screencast-axi scaffold <id>",
|
|
20
|
+
flags: SCAFFOLD_FLAGS,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
command: "rehearse",
|
|
24
|
+
summary: "Run a scenario without recording, and print every action it took",
|
|
25
|
+
usage: "screencast-axi rehearse <id|path...>",
|
|
26
|
+
flags: REHEARSE_FLAGS,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
command: "record",
|
|
30
|
+
summary: "Run a scenario for real and encode the clip",
|
|
31
|
+
usage: "screencast-axi record <id|path...>",
|
|
32
|
+
flags: RECORD_FLAGS,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
command: "list",
|
|
36
|
+
summary: "Every scenario, with what needs re-shooting",
|
|
37
|
+
usage: "screencast-axi list",
|
|
38
|
+
flags: LIST_FLAGS,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
command: "show",
|
|
42
|
+
summary: "One clip in full: files, sizes, narration, when it was shot",
|
|
43
|
+
usage: "screencast-axi show <id>",
|
|
44
|
+
flags: SHOW_FLAGS,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
command: "check",
|
|
48
|
+
summary: "Cross-reference the manifest, the scenarios and the files on disk",
|
|
49
|
+
usage: "screencast-axi check",
|
|
50
|
+
flags: CHECK_FLAGS,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
command: "doctor",
|
|
54
|
+
summary: "Check everything a recording needs, in one pass",
|
|
55
|
+
usage: "screencast-axi doctor",
|
|
56
|
+
flags: DOCTOR_FLAGS,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
command: "setup",
|
|
60
|
+
summary: "Install the browser; name anything you must install yourself",
|
|
61
|
+
usage: "screencast-axi setup",
|
|
62
|
+
flags: SETUP_FLAGS,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
command: "auth",
|
|
66
|
+
summary: "Sign in by hand once, or check the saved session still works",
|
|
67
|
+
usage: "screencast-axi auth login|check [name]",
|
|
68
|
+
flags: AUTH_FLAGS,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
command: "guide",
|
|
72
|
+
summary: "Topic-sized guidance, pulled one topic at a time",
|
|
73
|
+
usage: "screencast-axi guide [topic]",
|
|
74
|
+
flags: GUIDE_FLAGS,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
function renderFlags(flags) {
|
|
78
|
+
const entries = Object.entries(flags);
|
|
79
|
+
if (entries.length === 0)
|
|
80
|
+
return "_No flags._\n";
|
|
81
|
+
const rows = entries.map(([name, spec]) => {
|
|
82
|
+
const left = spec.kind === "boolean" ? `--${name}` : `--${name} <${spec.placeholder ?? "value"}>`;
|
|
83
|
+
const repeat = spec.repeat ? " Repeatable." : "";
|
|
84
|
+
return `| \`${left}\` | ${spec.description}.${repeat} |`;
|
|
85
|
+
});
|
|
86
|
+
return ["| Flag | What it does |", "| --- | --- |", ...rows].join("\n") + "\n";
|
|
87
|
+
}
|
|
88
|
+
export function COMMAND_REFERENCE() {
|
|
89
|
+
const parts = [
|
|
90
|
+
"Every command takes `--help`. Flags always come after the command:",
|
|
91
|
+
"`screencast-axi <command> [args] [flags]`. An unknown flag is a usage error rather than",
|
|
92
|
+
"something quietly ignored.",
|
|
93
|
+
"",
|
|
94
|
+
];
|
|
95
|
+
for (const entry of COMMANDS) {
|
|
96
|
+
parts.push(`#### \`${entry.command}\``);
|
|
97
|
+
parts.push("");
|
|
98
|
+
parts.push(`${entry.summary}.`);
|
|
99
|
+
parts.push("");
|
|
100
|
+
parts.push("```sh");
|
|
101
|
+
parts.push(entry.usage);
|
|
102
|
+
parts.push("```");
|
|
103
|
+
parts.push("");
|
|
104
|
+
parts.push(renderFlags(entry.flags));
|
|
105
|
+
}
|
|
106
|
+
return parts.join("\n").trimEnd();
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../src/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,M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AAG,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type ResolvedViewport } from "./browser.js";
|
|
2
|
+
import { type ResolvedConfig } from "./config.js";
|
|
3
|
+
import type { AuthIdentity } from "./auth/types.js";
|
|
4
|
+
import { type DirectorAction } from "./director.js";
|
|
5
|
+
import { type EncodeResult, type EncodeSettings } from "./encode.js";
|
|
6
|
+
import { ScreencastError } from "./errors.js";
|
|
7
|
+
import { type Forensics } from "./forensics.js";
|
|
8
|
+
import { type ManifestEntry } from "./manifest.js";
|
|
9
|
+
import { type Toolchain } from "./toolchain.js";
|
|
10
|
+
import type { DefinedScenario, Viewport } from "./types.js";
|
|
11
|
+
export type RunMode = "record" | "rehearse";
|
|
12
|
+
export interface RunOptions {
|
|
13
|
+
readonly scenario: DefinedScenario;
|
|
14
|
+
readonly config: ResolvedConfig;
|
|
15
|
+
readonly mode: RunMode;
|
|
16
|
+
/** Source of the scenario module, hashed so staleness is answerable later. */
|
|
17
|
+
readonly sourceText?: string;
|
|
18
|
+
readonly baseUrl?: string;
|
|
19
|
+
readonly outDir?: string;
|
|
20
|
+
readonly pace?: number;
|
|
21
|
+
readonly headed?: boolean;
|
|
22
|
+
readonly device?: string;
|
|
23
|
+
readonly viewport?: Viewport;
|
|
24
|
+
readonly orientation?: "portrait" | "landscape";
|
|
25
|
+
readonly keepRaw?: boolean;
|
|
26
|
+
/** Per-run overrides on the encode settings, e.g. the looping formats. */
|
|
27
|
+
readonly deliverables?: Partial<EncodeSettings>;
|
|
28
|
+
/** Named strategy, or false to record signed out. */
|
|
29
|
+
readonly auth?: string | false;
|
|
30
|
+
readonly toolchain?: Toolchain;
|
|
31
|
+
/** Progress, to stderr. stdout stays reserved for the final payload. */
|
|
32
|
+
log?(message: string): void;
|
|
33
|
+
}
|
|
34
|
+
export interface RunResult {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly mode: RunMode;
|
|
37
|
+
readonly durationMs: number;
|
|
38
|
+
/** Of that, how much was pace-scaled pause rather than the app's own waits. */
|
|
39
|
+
readonly scaledPauseMs: number;
|
|
40
|
+
readonly pace: number;
|
|
41
|
+
readonly viewport: ResolvedViewport;
|
|
42
|
+
readonly steps: readonly string[];
|
|
43
|
+
/** Everything the scenario did, in order. */
|
|
44
|
+
readonly performed: readonly DirectorAction[];
|
|
45
|
+
/** Hosts the take actually visited - the safety-relevant summary. */
|
|
46
|
+
readonly hosts: readonly string[];
|
|
47
|
+
readonly identity?: AuthIdentity;
|
|
48
|
+
/** Present only for a recording. */
|
|
49
|
+
readonly encoded?: EncodeResult;
|
|
50
|
+
readonly manifestPath?: string;
|
|
51
|
+
readonly entry?: ManifestEntry;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A take failed. Carries what was on screen when it did.
|
|
55
|
+
*
|
|
56
|
+
* The forensics are the point: without them a stale selector is a bare
|
|
57
|
+
* timeout, and fixing it means another forty-second run to see anything.
|
|
58
|
+
*/
|
|
59
|
+
export declare class ScenarioFailure extends ScreencastError {
|
|
60
|
+
readonly scenarioId: string;
|
|
61
|
+
readonly phase: "setup" | "run" | "encode";
|
|
62
|
+
readonly forensics: Forensics;
|
|
63
|
+
readonly lastStep: number | null;
|
|
64
|
+
constructor(init: {
|
|
65
|
+
scenarioId: string;
|
|
66
|
+
phase: "setup" | "run" | "encode";
|
|
67
|
+
message: string;
|
|
68
|
+
forensics: Forensics;
|
|
69
|
+
lastStep: number | null;
|
|
70
|
+
suggestions: string[];
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Every declared narration line must appear once, in order.
|
|
75
|
+
*
|
|
76
|
+
* This is what stops the written workflow drifting from the recorded one: the
|
|
77
|
+
* same array becomes the burnt-in caption, the manifest's step list and the
|
|
78
|
+
* text a site renders beside the clip, so a line that never went on screen
|
|
79
|
+
* would be a caption promising something the video does not show.
|
|
80
|
+
*/
|
|
81
|
+
export declare function assertScriptComplete(steps: readonly string[] | undefined, shown: readonly number[]): void;
|
|
82
|
+
export declare function runScenario(options: RunOptions): Promise<RunResult>;
|