@vosjs/cli 0.41.1 → 0.43.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/dist/cli.js CHANGED
@@ -511,7 +511,7 @@ async function cmdCheck(argv) {
511
511
  return result.ok ? EXIT_OK : EXIT_ERROR;
512
512
  }
513
513
  async function delegate(argv, viaAlias = false) {
514
- const { run } = await import("./run-ZIOIU3SD.js");
514
+ const { run } = await import("./run-ZYROWQ3T.js");
515
515
  if (viaAlias && argv[0]) {
516
516
  process.stderr.write(
517
517
  `note: "vos voila ${argv[0]}" is now "vos ${argv[0]}".
@@ -551,7 +551,7 @@ async function main() {
551
551
  const engine = HELP_ENGINE.split("\n").filter(
552
552
  (l) => l.startsWith(` vos ${cmd} `)
553
553
  );
554
- const { verbHelp } = await import("./run-ZIOIU3SD.js");
554
+ const { verbHelp } = await import("./run-ZYROWQ3T.js");
555
555
  const take = verbHelp(cmd);
556
556
  process.stdout.write(
557
557
  `${engine.join("\n")}
@@ -583,7 +583,7 @@ ${take.includes("no such verb") ? "" : take}`
583
583
  main().then(async (code) => {
584
584
  if (code === EXIT_OK) {
585
585
  const verb = process.argv[2] ?? "";
586
- const { HELP } = await import("./run-ZIOIU3SD.js");
586
+ const { HELP } = await import("./run-ZYROWQ3T.js");
587
587
  const documented = [
588
588
  ...helpFlagsFor(HELP_ENGINE, verb),
589
589
  ...helpFlagsFor(HELP, verb)
package/dist/index.d.ts CHANGED
@@ -110,6 +110,79 @@ interface PaceReport {
110
110
  }[];
111
111
  }
112
112
 
113
+ /**
114
+ * What a signed-in take SHOWS. Getting past the login is half the problem;
115
+ * the other half is that the account's own data is now in the frame: an
116
+ * email address in the header, a key on a settings page, a card number.
117
+ * Asking nicely does not hold this line (a person asked to sign in with a
118
+ * demo account signs in as themselves, because it is the account they have),
119
+ * so the recorder looks.
120
+ *
121
+ * Two pieces, both run IN the page:
122
+ *
123
+ * - the EXPOSURE scan reads the text that is visible in the viewport after
124
+ * each step and reports the KIND of thing it saw and where. Never the
125
+ * string itself: a report that quotes the secret is a second leak.
126
+ * - a MASK hides a selector before the first frame is captured and keeps it
127
+ * hidden across navigations and re-renders, so the real value is never in
128
+ * a frame, never in the recording, never pushed. `as: 'text'` swaps the
129
+ * words (a product reads better than a redaction); `as: 'blur'` blurs.
130
+ *
131
+ * The matchers are ONE plain-JavaScript source string, evaluated in the page
132
+ * and, by the tests, in Node: a function serialized out of a bundle picks up
133
+ * the bundler's `__name` helper and dies in the page, and two copies of a
134
+ * regex drift.
135
+ */
136
+
137
+ interface MaskRule {
138
+ selector: string;
139
+ /** `blur` (default) blurs the element; `text` swaps its words for `text`. */
140
+ as?: 'blur' | 'text';
141
+ text?: string;
142
+ }
143
+
144
+ /**
145
+ * `setup`: the steps that run BEFORE the camera rolls. A sign-in form, a
146
+ * cookie banner, the "choose your editor" modal, an onboarding tour: things
147
+ * a take must get past and must not show. They run after the first
148
+ * navigation and before `Page.startScreencast`, with no cursor synthesis,
149
+ * no pace accounting and nothing written to `meta.steps`. Then the recorder
150
+ * navigates to `url` again and the take begins where the setup left it.
151
+ *
152
+ * A `type` step's `text` may be `{ "env": "DEMO_PASSWORD" }`: resolved at run
153
+ * time, never logged, never stored. The guarantee is narrow and real: the
154
+ * secret is never in a file that travels (`actions.json` is committed and
155
+ * pushed with the take; `meta.json` is read by the digest) and never in the
156
+ * footage. An agent with a shell can still read the variable; that is the
157
+ * maker's decision to make, not this file's to hide.
158
+ */
159
+
160
+ type SetupText = string | {
161
+ env: string;
162
+ };
163
+ type SetupStep = ({
164
+ do: 'wait';
165
+ ms: number;
166
+ } | {
167
+ do: 'click';
168
+ selector: string;
169
+ ms?: number;
170
+ } | {
171
+ do: 'type';
172
+ selector: string;
173
+ text: SetupText;
174
+ ms?: number;
175
+ } | {
176
+ do: 'press';
177
+ key: string;
178
+ ms?: number;
179
+ } | {
180
+ do: 'goto';
181
+ url: string;
182
+ }) & {
183
+ id?: string;
184
+ };
185
+
113
186
  /**
114
187
  * The action script — the declarative recipe an agent (or human) writes to
115
188
  * drive a take. Small on purpose: selectors + a handful of verbs. The recorder
@@ -124,6 +197,23 @@ interface ActionsFile {
124
197
  width: number;
125
198
  height: number;
126
199
  };
200
+ /**
201
+ * Hidden BEFORE the first frame is captured and kept hidden across
202
+ * navigations: what a signed-in account shows that must not ship. `blur`
203
+ * (default) blurs the element; `text` swaps its words for `text`, which is
204
+ * for IDENTIFIERS (an email, a name, an account id), never for product
205
+ * copy or numbers: the video must stay true to the product.
206
+ */
207
+ mask?: MaskRule[];
208
+ /**
209
+ * Run BEFORE the camera rolls, after the first navigation: a sign-in form,
210
+ * a cookie banner, an onboarding tour. Plain actions with no cursor, no
211
+ * frames, no pace and nothing in `meta.steps`; then the recorder opens
212
+ * `url` again and the take begins where the setup left it. A `type`
213
+ * step's text may be `{ env: 'NAME' }`, read at run time and never logged
214
+ * or stored.
215
+ */
216
+ setup?: SetupStep[];
127
217
  steps: ActionStep[];
128
218
  }
129
219
  type ActionStep = ({
@@ -293,6 +383,10 @@ interface RecordResult {
293
383
  navTimeout: boolean;
294
384
  /** A wall the caller let through; null when the recorder landed where it was asked. */
295
385
  wall: WallVerdict | null;
386
+ /** Sensitive-looking text seen in the frame (kind + place, never the string). */
387
+ exposures: NonNullable<RecordingMeta['exposures']>;
388
+ /** The script's masks with how many elements each reached; hits 0 hid nothing. */
389
+ masks: NonNullable<RecordingMeta['masks']>;
296
390
  /**
297
391
  * Smoothness telemetry: stretches ≥400ms with no visual change. Frozen
298
392
  * footage is the #1 enemy of a smooth product video — either the flow should
@@ -332,6 +426,8 @@ interface RecordOpts {
332
426
  * re-record would have replaced. A throw closes the context and propagates.
333
427
  */
334
428
  onArrival?: (arrival: Arrival) => Promise<WallVerdict | null | void> | WallVerdict | null | void;
429
+ /** Extra request headers on every request (`--header name=value`). */
430
+ headers?: Record<string, string>;
335
431
  }
336
432
  declare function recordTake(browser: Browser, url: string, actions: ActionsFile, paths: TakePaths, log: (msg: string) => void, opts?: RecordOpts): Promise<RecordResult>;
337
433
 
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  validateActions,
31
31
  waitForPageDone,
32
32
  writeSyncState
33
- } from "./chunk-4QVEV3HX.js";
33
+ } from "./chunk-6PJPGBKH.js";
34
34
  import {
35
35
  BrowserUnavailableError,
36
36
  configDuration,
@@ -5,7 +5,7 @@ import {
5
5
  run,
6
6
  takeBrowserArgs,
7
7
  verbHelp
8
- } from "./chunk-4QVEV3HX.js";
8
+ } from "./chunk-6PJPGBKH.js";
9
9
  import "./chunk-FACYY7VV.js";
10
10
  export {
11
11
  HELP,
@@ -14,4 +14,4 @@ export {
14
14
  takeBrowserArgs,
15
15
  verbHelp
16
16
  };
17
- //# sourceMappingURL=run-ZIOIU3SD.js.map
17
+ //# sourceMappingURL=run-ZYROWQ3T.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vosjs/cli",
3
- "version": "0.41.1",
3
+ "version": "0.43.0",
4
4
  "description": "The vos CLI: record the real product from a scripted browser flow, auto-zoom from the cursor track, cut as data in doc.json, render deterministic video and stills, deliver a release's media per destination spec, and sync with vos.so. One binary, every verb, MIT.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,14 +48,14 @@
48
48
  "dependencies": {
49
49
  "mediabunny": "^1.55.7",
50
50
  "playwright": "^1.49.0",
51
+ "@vosjs/core": "^0.25.0",
51
52
  "@vosjs/editor": "^1.3.1",
52
53
  "@vosjs/elements": "^0.8.1",
53
- "@vosjs/core": "^0.25.0",
54
- "@vosjs/shared": "^0.4.1",
55
54
  "@vosjs/render-core": "^0.2.8",
55
+ "@vosjs/shared": "^0.4.1",
56
+ "@vosjs/studio-core": "^0.29.0",
56
57
  "@vosjs/timeline": "^0.4.1",
57
- "@vosjs/tween": "^0.8.2",
58
- "@vosjs/studio-core": "^0.28.0"
58
+ "@vosjs/tween": "^0.8.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/node": "^22",
@@ -29,6 +29,73 @@
29
29
  }
30
30
  }
31
31
  },
32
+ "setup": {
33
+ "type": "array",
34
+ "description": "Run BEFORE the camera rolls, after the first navigation: a sign-in form, a cookie banner, an onboarding tour. Plain actions with no cursor, no frames, no pace and nothing in meta.steps; then the recorder opens `url` again and the take begins where the setup left it. A selector that never appears fails the take before anything is recorded (exit 2). A `type` step's text may be { \"env\": \"NAME\" }, read at run time and never logged or stored; a literal typed into a password field is refused, because actions.json is committed and pushed.",
35
+ "items": {
36
+ "type": "object",
37
+ "required": ["do"],
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "do": {
41
+ "type": "string",
42
+ "enum": ["wait", "click", "type", "press", "goto"]
43
+ },
44
+ "id": { "type": "string" },
45
+ "selector": { "type": "string" },
46
+ "text": {
47
+ "oneOf": [
48
+ { "type": "string" },
49
+ {
50
+ "type": "object",
51
+ "required": ["env"],
52
+ "additionalProperties": false,
53
+ "properties": {
54
+ "env": {
55
+ "type": "string",
56
+ "description": "the environment variable holding the value"
57
+ }
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ "key": {
63
+ "type": "string",
64
+ "description": "press: a Playwright key name (Enter, Tab, Escape)"
65
+ },
66
+ "url": {
67
+ "type": "string",
68
+ "description": "goto: a page to open, for a sign-in that lives elsewhere"
69
+ },
70
+ "ms": {
71
+ "type": "number",
72
+ "description": "wait: the pause; other verbs: the settle after (default 150)"
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "mask": {
78
+ "type": "array",
79
+ "description": "Hidden BEFORE the first frame is captured and kept hidden across navigations and re-renders: what a signed-in account shows that must not ship. The real value is never in a frame, never in the recording, never pushed. `vos record` reports what it still sees afterwards (meta.exposures), and a mask whose selector reached nothing fails --strict.",
80
+ "items": {
81
+ "type": "object",
82
+ "required": ["selector"],
83
+ "additionalProperties": false,
84
+ "properties": {
85
+ "selector": { "type": "string" },
86
+ "as": {
87
+ "type": "string",
88
+ "enum": ["blur", "text"],
89
+ "default": "blur",
90
+ "description": "blur the element, or swap its words for `text`. A form control is always blurred: writing into an input would change what the app submits. `text` is for IDENTIFIERS (an email, a name, an account id), never for product copy or numbers."
91
+ },
92
+ "text": {
93
+ "type": "string",
94
+ "description": "shown instead, with as: \"text\""
95
+ }
96
+ }
97
+ }
98
+ },
32
99
  "steps": {
33
100
  "type": "array",
34
101
  "minItems": 1,
@@ -46,6 +46,28 @@
46
46
  "description": "false = browser-recorder take: moments are head/tail/scenes only"
47
47
  },
48
48
  "windowFocusedFrac": { "type": ["number", "null"] },
49
+ "exposures": {
50
+ "type": "array",
51
+ "description": "sensitive-looking text the recorder saw IN the frame: the KIND and the place, never the string. Listed once each, at the first step it was visible (step -1 = as the page opened). `rect` is viewport CSS px. Look at those frames before the take goes anywhere; the fix is a demo account or a `mask` in actions.json and a re-record",
52
+ "items": {
53
+ "type": "object",
54
+ "properties": {
55
+ "step": { "type": "integer" },
56
+ "kind": {
57
+ "type": "string",
58
+ "enum": ["email", "key", "card", "card-tail"]
59
+ },
60
+ "selector": { "type": "string" },
61
+ "rect": { "type": "object" },
62
+ "seen": { "type": "integer" }
63
+ }
64
+ }
65
+ },
66
+ "masks": {
67
+ "type": "array",
68
+ "description": "what the script hid before the camera rolled, with how many elements each selector reached; hits 0 hid nothing",
69
+ "items": { "type": "object" }
70
+ },
49
71
  "wall": {
50
72
  "type": ["object", "null"],
51
73
  "description": "the recorder did not land where it was asked (a sign-in, an identity provider, a 401/403, a redirect elsewhere) and the take was recorded anyway: the footage may be the wrong page. `asked`/`landed` are origin + path. null = it landed where it was asked, or the recorder does not check",