@crouton-kit/capture 1.4.23 → 1.4.24

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/bin/capture CHANGED
@@ -10944,7 +10944,7 @@ function validateHarAppendBatch(value, source) {
10944
10944
  return { entries, incompleteLifecycles };
10945
10945
  }
10946
10946
  function captureVersion() {
10947
- const version = "1.4.23";
10947
+ const version = "1.4.24";
10948
10948
  return typeof version === "string" && version.length > 0 ? version : "development";
10949
10949
  }
10950
10950
  function token() {
@@ -13046,7 +13046,7 @@ function wallTime(value) {
13046
13046
  }
13047
13047
  }
13048
13048
  function captureVersion2() {
13049
- const version = "1.4.23";
13049
+ const version = "1.4.24";
13050
13050
  return typeof version === "string" && version.length > 0 ? version : "development";
13051
13051
  }
13052
13052
  function deepFreeze(value) {
@@ -240317,7 +240317,8 @@ function checkSnapshot(ref, requested) {
240317
240317
  if (!e) continue;
240318
240318
  const point = sample.points?.find((p) => {
240319
240319
  const receiver = p.result?.topReceiver;
240320
- const receiverElement = receiver && elements.find((x) => receiver.backendNodeId != null && x.backendNodeId === receiver.backendNodeId);
240320
+ if (!receiver) return false;
240321
+ const receiverElement = elements.find((x) => receiver.backendNodeId != null && x.backendNodeId === receiver.backendNodeId);
240321
240322
  return receiverElement !== void 0 && !isSelfOrDescendant(e, receiverElement);
240322
240323
  })?.result;
240323
240324
  if (!point?.topReceiver) continue;
@@ -240495,11 +240496,12 @@ async function cmdMeasureCheck(parsed, _args) {
240495
240496
  } catch (err) {
240496
240497
  const resolution = err;
240497
240498
  const detail = err instanceof Error ? err.message : "unknown artifact read failure";
240499
+ const unresolved = resolution.name === "ArtifactResolutionError";
240498
240500
  emitResult({
240499
240501
  tag: "error",
240500
- attrs: { command: "measure check", status: resolution.name === "ArtifactResolutionError" ? "artifact_unavailable" : "check_failed" },
240501
- summary: fact`Measure check could not read the requested artifact: ${detail}`,
240502
- followUp: text`Create a settled snapshot with capture measure snap <url>, then pass its id or absolute path.`
240502
+ attrs: { command: "measure check", status: unresolved ? "artifact_unavailable" : "check_failed" },
240503
+ summary: unresolved ? fact`Measure check could not read the requested artifact: ${detail}` : fact`Measure check failed while measuring the snapshot: ${detail}`,
240504
+ followUp: unresolved ? text`Create a settled snapshot with capture measure snap <url>, then pass its id or absolute path.` : text`The snapshot resolved; this is an internal capture check error, not a missing snapshot. Narrow --for to the checks you need, and report the error with the snapshot path.`
240503
240505
  }, { json: parsed.json });
240504
240506
  process.exitCode = 1;
240505
240507
  }
@@ -267516,7 +267518,7 @@ I/O contract: flags and positionals on input; one rendered prose block on stdout
267516
267518
  A CDP-enabled browser must be running; \`capture tab list\` is the probe, and \`capture tab launch\` starts one capture owns and reaps when nothing is (never hand-roll a detached browser \u2014 nothing reaps that). Capture never signals a browser it did not start, so attaching to your own with --port is unchanged. CDP_PORT / CDP_TARGET pin the browser + tab for target-selecting commands \u2014 precedence: explicit flag > active session > env. \`session start\` adopts only an explicit --target. When CRTR_NODE_ID is set (a crtr agent node), a browser command with no --port, no --target and no active session of that node is refused instead of falling back to CDP_PORT, CDP_TARGET or localhost discovery, because the browser found could belong to another node: run \`capture session start --url <url>\`, or pass --port or --target. \`capture tab list\` and commands that only read a recorded artifact are not refused.`;
267517
267519
  }
267518
267520
  function printVersion() {
267519
- const declared = "1.4.23";
267521
+ const declared = "1.4.24";
267520
267522
  if (declared) {
267521
267523
  console.log(declared);
267522
267524
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crouton-kit/capture",
3
- "version": "1.4.23",
3
+ "version": "1.4.24",
4
4
  "description": "Browser automation and UI validation via CDP — session-based screenshots, HAR, a11y, click/type, and JS exec",
5
5
  "bin": {
6
6
  "capture": "./bin/capture"
@@ -152,11 +152,16 @@ export async function cmdMeasureCheck(parsed: ParsedArgs, _args: string[]): Prom
152
152
  } catch (err) {
153
153
  const resolution = err as Partial<ArtifactResolutionError>;
154
154
  const detail = err instanceof Error ? err.message : 'unknown artifact read failure';
155
+ const unresolved = resolution.name === 'ArtifactResolutionError';
155
156
  emitResult({
156
157
  tag: 'error',
157
- attrs: { command: 'measure check', status: resolution.name === 'ArtifactResolutionError' ? 'artifact_unavailable' : 'check_failed' },
158
- summary: fact`Measure check could not read the requested artifact: ${detail}`,
159
- followUp: text`Create a settled snapshot with capture measure snap <url>, then pass its id or absolute path.`,
158
+ attrs: { command: 'measure check', status: unresolved ? 'artifact_unavailable' : 'check_failed' },
159
+ summary: unresolved
160
+ ? fact`Measure check could not read the requested artifact: ${detail}`
161
+ : fact`Measure check failed while measuring the snapshot: ${detail}`,
162
+ followUp: unresolved
163
+ ? text`Create a settled snapshot with capture measure snap <url>, then pass its id or absolute path.`
164
+ : text`The snapshot resolved; this is an internal capture check error, not a missing snapshot. Narrow --for to the checks you need, and report the error with the snapshot path.`,
160
165
  }, { json: parsed.json });
161
166
  process.exitCode = 1;
162
167
  }
@@ -448,7 +448,9 @@ export function checkSnapshot(ref: SnapRef, requested: readonly CheckName[]): {
448
448
  if (!e) continue;
449
449
  const point = sample.points?.find((p) => {
450
450
  const receiver = p.result?.topReceiver;
451
- const receiverElement = receiver && elements.find((x) => receiver.backendNodeId != null && x.backendNodeId === receiver.backendNodeId);
451
+ // The collector records `topReceiver: null` for a point with an empty hit stack (e.g. a sample outside the viewport); no receiver means nothing occludes it.
452
+ if (!receiver) return false;
453
+ const receiverElement = elements.find((x) => receiver.backendNodeId != null && x.backendNodeId === receiver.backendNodeId);
452
454
  return receiverElement !== undefined && !isSelfOrDescendant(e, receiverElement);
453
455
  })?.result;
454
456
  if (!point?.topReceiver) continue;