fix(protocol): align Trace v2/v3 classification and hover steps

Require Trace v3 version const 3, reject mixed pages/states payloads, and
align TypeScript selection optionality with the generated schema. Trace v2
on main already records hover steps, so the frozen v2 schema must accept
them instead of dropping them during reduction.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
“haonan”
2026-08-23 21:26:39 +08:00
committed by GitHub
co-authored by Cursor
parent f98198949a
commit 524516cb56
9 changed files with 234 additions and 31 deletions
@@ -512,6 +512,46 @@
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",
"required": [
"id",
"op",
"page",
"target"
],
"properties": {
"effect": {
"anyOf": [
{
"$ref": "#/definitions/StepEffectV2"
},
{
"type": "null"
}
]
},
"id": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"op": {
"type": "string",
"enum": [
"hover"
]
},
"page": {
"description": "Reference into `pages[]`.",
"type": "string"
},
"target": {
"$ref": "#/definitions/TargetDescriptorV2"
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",
@@ -803,10 +843,10 @@
},
"version": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"const": 3
}
}
},
"additionalProperties": false
},
"TraceEntry": {
"description": "Recording entry point — first URL the flow starts from.",
@@ -900,7 +940,8 @@
"$ref": "#/definitions/StepV2"
}
}
}
},
"additionalProperties": false
}
}
}
@@ -512,6 +512,46 @@
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",
"required": [
"id",
"op",
"page",
"target"
],
"properties": {
"effect": {
"anyOf": [
{
"$ref": "#/definitions/StepEffectV2"
},
{
"type": "null"
}
]
},
"id": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"op": {
"type": "string",
"enum": [
"hover"
]
},
"page": {
"description": "Reference into `pages[]`.",
"type": "string"
},
"target": {
"$ref": "#/definitions/TargetDescriptorV2"
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",
@@ -803,10 +843,10 @@
},
"version": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"const": 3
}
}
},
"additionalProperties": false
},
"TraceEntry": {
"description": "Recording entry point — first URL the flow starts from.",
@@ -900,7 +940,8 @@
"$ref": "#/definitions/StepV2"
}
}
}
},
"additionalProperties": false
}
}
}
+2 -2
View File
@@ -51,10 +51,10 @@
},
"version": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
"const": 3
}
},
"additionalProperties": false,
"definitions": {
"FillCommit": {
"type": "string",
+41
View File
@@ -42,6 +42,7 @@
}
}
},
"additionalProperties": false,
"definitions": {
"KeyModifier": {
"description": "Keyboard modifier flags. Multiple flags may be combined; the extension folds them into CDP's bitfield (`alt=1, ctrl=2, meta=4, shift=8`).",
@@ -189,6 +190,46 @@
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",
"required": [
"id",
"op",
"page",
"target"
],
"properties": {
"effect": {
"anyOf": [
{
"$ref": "#/definitions/StepEffectV2"
},
{
"type": "null"
}
]
},
"id": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"op": {
"type": "string",
"enum": [
"hover"
]
},
"page": {
"description": "Reference into `pages[]`.",
"type": "string"
},
"target": {
"$ref": "#/definitions/TargetDescriptorV2"
}
}
},
{
"description": "Fields shared by every v2 step variant (flattened in JSON).",
"type": "object",