fix: preserve native UI failure reasons and dedupe version literals (#854)
Keep adapter/OS helper failures in diagnostics instead of replacing them with a canned remediation sentence. Share browserVersionSchema, Node support prose, and JADX heap/remediation constants so release pins stay authoritative. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
@@ -5,7 +5,8 @@ import { webTextArtifactSchema } from "./webContentArtifact.js";
|
||||
import { jsonShapeSchema } from "./jsonShape.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
|
||||
const browserVersionSchema = z.object({
|
||||
/** Shared CDP/browser version identity carried on observation Evidence. */
|
||||
export const browserVersionSchema = z.object({
|
||||
product: z.string(),
|
||||
protocol_version: z.string(),
|
||||
revision: z.string(),
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
browserEndpointSchema,
|
||||
} from "./browserObservation.js";
|
||||
import { browserCompletenessSchema } from "./browserCompleteness.js";
|
||||
import { browserVersionSchema } from "./browserObservationSchemas.js";
|
||||
|
||||
/** Input for a navigation-aware browser observation window. */
|
||||
export const observeWebSessionInputSchema = z.strictObject({
|
||||
@@ -42,13 +43,7 @@ const timelineEventSchema = z.object({
|
||||
|
||||
/** Navigation-aware session result for external user actions. */
|
||||
export const webObservationSessionSchema = z.object({
|
||||
browser: z.object({
|
||||
product: z.string(),
|
||||
protocol_version: z.string(),
|
||||
revision: z.string(),
|
||||
user_agent: z.string(),
|
||||
js_version: z.string(),
|
||||
}),
|
||||
browser: browserVersionSchema,
|
||||
target: z.object({
|
||||
target_id: z.string(),
|
||||
initial_url: z.string(),
|
||||
|
||||
@@ -2,6 +2,7 @@ import { z } from "zod";
|
||||
|
||||
import { browserCompletenessSchema } from "./browserCompleteness.js";
|
||||
import { browserEndpointSchema } from "./browserObservation.js";
|
||||
import { browserVersionSchema } from "./browserObservationSchemas.js";
|
||||
import { webTextArtifactSchema } from "./webContentArtifact.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
|
||||
@@ -37,13 +38,6 @@ export type InspectElectronPageInput = z.infer<
|
||||
typeof inspectElectronPageInputSchema
|
||||
>;
|
||||
|
||||
const browserVersionSchema = z.object({
|
||||
product: z.string(),
|
||||
protocol_version: z.string(),
|
||||
revision: z.string(),
|
||||
user_agent: z.string(),
|
||||
js_version: z.string(),
|
||||
});
|
||||
const electronTargetSchema = z.object({
|
||||
target_id: z.string(),
|
||||
type: z.string(),
|
||||
|
||||
@@ -3,6 +3,10 @@ import { satisfies } from "semver";
|
||||
/** Supported runtime range, kept in sync with the published package engines. */
|
||||
export const SUPPORTED_NODE_VERSION_RANGE = "^22.19.0 || ^24.11.0 || >=26.0.0";
|
||||
|
||||
/** Human-readable form of {@link SUPPORTED_NODE_VERSION_RANGE} for remediation. */
|
||||
export const SUPPORTED_NODE_VERSION_PROSE =
|
||||
"Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+";
|
||||
|
||||
/** Return whether a Node.js version satisfies REA's tested runtime families. */
|
||||
export const supportsNodeVersion = (version: string): boolean =>
|
||||
satisfies(version, SUPPORTED_NODE_VERSION_RANGE);
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
browserAllowedOriginsSchema,
|
||||
browserEndpointSchema,
|
||||
} from "./browserObservation.js";
|
||||
import { browserVersionSchema } from "./browserObservationSchemas.js";
|
||||
import { jsonShapeSchema } from "./jsonShape.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
|
||||
@@ -19,14 +20,6 @@ export type DiscoverWebMcpToolsInput = z.infer<
|
||||
typeof discoverWebMcpToolsInputSchema
|
||||
>;
|
||||
|
||||
const browserVersionSchema = z.object({
|
||||
product: z.string(),
|
||||
protocol_version: z.string(),
|
||||
revision: z.string(),
|
||||
user_agent: z.string(),
|
||||
js_version: z.string(),
|
||||
});
|
||||
|
||||
const webMcpToolSchema = z.object({
|
||||
tool_key: prefixedDigestSchema("webmcp"),
|
||||
name: z.string(),
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
browserAllowedOriginsSchema,
|
||||
browserEndpointSchema,
|
||||
} from "./browserObservation.js";
|
||||
import { browserVersionSchema } from "./browserObservationSchemas.js";
|
||||
|
||||
/** Self-verifying inline PNG artifact for CLI/MCP parity. */
|
||||
export const webScreenshotArtifactSchema = z
|
||||
@@ -41,14 +42,6 @@ export type CaptureWebScreenshotInput = z.infer<
|
||||
typeof captureWebScreenshotInputSchema
|
||||
>;
|
||||
|
||||
const browserVersionSchema = z.object({
|
||||
product: z.string(),
|
||||
protocol_version: z.string(),
|
||||
revision: z.string(),
|
||||
user_agent: z.string(),
|
||||
js_version: z.string(),
|
||||
});
|
||||
|
||||
/** Screenshot observation with embedded immutable artifact bytes. */
|
||||
export const webScreenshotSchema = z.object({
|
||||
browser: browserVersionSchema,
|
||||
|
||||
Reference in New Issue
Block a user