mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
RecordedTrace validation now follows classify_value — numeric version selects v3, otherwise v2 — so mixed pages/states and v2 envelopes with a version field fail Schema checks before Recall import. Keep standalone trace_step as a v2|v3 union for tools that validate a single step.
369 lines
7.7 KiB
JSON
369 lines
7.7 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "StepV2",
|
|
"description": "One recorded user action — discriminated union by `op` (v2).",
|
|
"oneOf": [
|
|
{
|
|
"description": "Fields shared by every v2 step variant (flattened in JSON).",
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"op",
|
|
"page",
|
|
"to"
|
|
],
|
|
"properties": {
|
|
"effect": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/StepEffectV2"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"op": {
|
|
"type": "string",
|
|
"enum": [
|
|
"navigate"
|
|
]
|
|
},
|
|
"page": {
|
|
"description": "Reference into `pages[]`.",
|
|
"type": "string"
|
|
},
|
|
"to": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"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": [
|
|
"click"
|
|
]
|
|
},
|
|
"page": {
|
|
"description": "Reference into `pages[]`.",
|
|
"type": "string"
|
|
},
|
|
"target": {
|
|
"$ref": "#/definitions/TargetDescriptorV2"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"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",
|
|
"required": [
|
|
"id",
|
|
"op",
|
|
"page",
|
|
"target",
|
|
"value"
|
|
],
|
|
"properties": {
|
|
"effect": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/StepEffectV2"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"op": {
|
|
"type": "string",
|
|
"enum": [
|
|
"fill"
|
|
]
|
|
},
|
|
"page": {
|
|
"description": "Reference into `pages[]`.",
|
|
"type": "string"
|
|
},
|
|
"redacted": {
|
|
"type": [
|
|
"boolean",
|
|
"null"
|
|
]
|
|
},
|
|
"target": {
|
|
"$ref": "#/definitions/TargetDescriptorV2"
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Fields shared by every v2 step variant (flattened in JSON).",
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"op",
|
|
"page",
|
|
"selection",
|
|
"target"
|
|
],
|
|
"properties": {
|
|
"effect": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/StepEffectV2"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"op": {
|
|
"type": "string",
|
|
"enum": [
|
|
"select"
|
|
]
|
|
},
|
|
"page": {
|
|
"description": "Reference into `pages[]`.",
|
|
"type": "string"
|
|
},
|
|
"selection": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/SelectedOptionV2"
|
|
}
|
|
},
|
|
"target": {
|
|
"$ref": "#/definitions/TargetDescriptorV2"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"description": "Fields shared by every v2 step variant (flattened in JSON).",
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"key",
|
|
"op",
|
|
"page"
|
|
],
|
|
"properties": {
|
|
"effect": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/StepEffectV2"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "uint32",
|
|
"minimum": 0.0
|
|
},
|
|
"key": {
|
|
"type": "string"
|
|
},
|
|
"modifiers": {
|
|
"type": [
|
|
"array",
|
|
"null"
|
|
],
|
|
"items": {
|
|
"$ref": "#/definitions/KeyModifier"
|
|
}
|
|
},
|
|
"op": {
|
|
"type": "string",
|
|
"enum": [
|
|
"press"
|
|
]
|
|
},
|
|
"page": {
|
|
"description": "Reference into `pages[]`.",
|
|
"type": "string"
|
|
},
|
|
"target": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/TargetDescriptorV2"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"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`).",
|
|
"type": "string",
|
|
"enum": [
|
|
"alt",
|
|
"ctrl",
|
|
"meta",
|
|
"shift"
|
|
]
|
|
},
|
|
"SelectedOptionV2": {
|
|
"description": "One selected option (`select` op).",
|
|
"type": "object",
|
|
"required": [
|
|
"value"
|
|
],
|
|
"properties": {
|
|
"label": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"value": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"StepEffectV2": {
|
|
"description": "Observed navigation after a step (objective fact only).",
|
|
"type": "object",
|
|
"required": [
|
|
"navigated_to"
|
|
],
|
|
"properties": {
|
|
"navigated_to": {
|
|
"description": "Reference into `pages[]` for the destination page.",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"TargetDescriptorV2": {
|
|
"description": "Stable semantic handle for an interacted element (v2).\n\n`name` and `nearby_label` are **untrusted page text**.",
|
|
"type": "object",
|
|
"required": [
|
|
"tag"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"name_attr": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"nearby_label": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"placeholder": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"role": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"tag": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|