ZoomLynx / agent /protocol.json
Skywalker0410's picture
Publish reviewed release files
0cac2f9 verified
Raw History Blame Contribute Delete
5.91 kB
{
"protocol_id": "zoomlynx",
"protocol_version": "zoomlynx",
"tool": {
"function": {
"description": "Crop a selected region from any currently visible image and, when useful under the frozen environment policy, return a super-resolved view. Raw crop evidence is always returned; model-visible arguments are limited to image_idx and bbox_2d.",
"name": "zoom_and_super_resolve",
"parameters": {
"additionalProperties": false,
"properties": {
"bbox_2d": {
"description": "Normalized xyxy coordinates [x1,y1,x2,y2] relative to image_idx; x1<x2 and y1<y2.",
"items": {
"maximum": 1000,
"minimum": 0,
"type": "integer"
},
"maxItems": 4,
"minItems": 4,
"type": "array"
},
"image_idx": {
"description": "Index of a currently visible image. The original image is always index 0.",
"minimum": 0,
"type": "integer"
}
},
"required": [
"image_idx",
"bbox_2d"
],
"type": "object"
}
},
"type": "function"
},
"executor": {
"automatic_scale_policy": [
{
"condition": "raw_crop_short_side < 112 and raw_crop_long_side * 4 <= 2048",
"scale": 4
},
{
"condition": "raw_crop_short_side < 224 and raw_crop_long_side * 2 <= 2048",
"scale": 2
},
{
"condition": "otherwise",
"scale": 1
}
],
"budget_charge_policy": "Every invocation attempt made while remaining_zoom_calls is positive consumes one call, including invalid arguments and SR service failures. A rejected call after the budget reaches zero consumes nothing.",
"image_index_policy": "Successful raw crops and SR crops are appended to the visible image registry in placeholder order. Nested calls may reference either output. Every image record keeps its parent image and mapped bbox in the original image.",
"implementation": "inference/zoom_sr_executor.py",
"max_zoom_calls": 3,
"maximum_sr_output_side_pixels": 2048,
"minimum_crop_side_pixels": 8,
"raw_crop_policy": "The raw crop is the exact clamped pixel crop after EXIF transpose and RGB conversion. It is saved losslessly as PNG and is never replaced by a GT crop or learned enhancement.",
"request_timeout_seconds": 600,
"sr_endpoint": "http://127.0.0.1:9049/v1/sr/upscale",
"sr_method": "realesrgan",
"sr_out_format": "PNG"
},
"observation_contract": {
"error_codes": [
"INVALID_ARGUMENTS",
"IMAGE_INDEX_OUT_OF_RANGE",
"INVALID_BBOX",
"CROP_TOO_SMALL",
"BUDGET_EXHAUSTED",
"SR_SERVICE_ERROR",
"INTERNAL_ERROR"
],
"image_placeholder_order": [
"raw_crop.image",
"super_resolved_crop.image when sr.applied is true"
],
"partial_success_policy": "If the raw crop succeeds but SR fails, return partial_success with the raw image, SR_SERVICE_ERROR metadata, and the remaining budget. Never fabricate or silently substitute an SR image.",
"status_values": [
"success",
"partial_success",
"error"
],
"success_required_fields": [
"status",
"protocol_version",
"parent_image_idx",
"bbox_2d",
"bbox_pixel",
"bbox_in_original_pixel",
"bbox_in_original_2d",
"raw_crop",
"super_resolved_crop",
"sr",
"remaining_zoom_calls"
]
},
"terminal_contract": {
"answer": {
"additionalProperties": false,
"properties": {
"action": {
"const": "answer"
},
"answer": {
"pattern": "^<reasoning>[\\s\\S]*</reasoning><answer>[\\s\\S]+</answer>$",
"type": "string"
}
},
"required": [
"action",
"answer"
],
"type": "object"
},
"serialization": "The final assistant content is one compact JSON object. The answer field contains exactly one <reasoning>...</reasoning> followed by exactly one <answer>...</answer>. Evaluation extracts only the answer tag content.",
"stop": {
"additionalProperties": false,
"properties": {
"action": {
"const": "stop"
},
"answer": {
"pattern": "^<reasoning>[\\s\\S]*</reasoning><answer>[\\s\\S]+</answer>$",
"type": "string"
},
"reason": {
"enum": [
"ambiguous_query",
"budget_exhausted",
"external_knowledge_required",
"insufficient_visual_evidence",
"missing_required_evidence",
"target_not_found",
"tool_error_unrecoverable"
]
}
},
"required": [
"action",
"reason",
"answer"
],
"type": "object"
}
},
"agent_interaction_contract": {
"causal_observation_order": "An assistant turn may reason only from the original image and tool observations returned before that turn. It must never describe, assume, or cite the result of a pending tool call.",
"first_tool_turn_visible_evidence": [
"original_image"
],
"parameter_placement": "Exact image_idx, bbox_2d, pixel coordinates, and complete function arguments appear only in the tool call, never in assistant prose.",
"pre_tool_assistant_content": {
"forbidden_content": [
"unreturned_tool_observation",
"image_idx",
"bbox_2d",
"pixel_coordinates",
"complete_function_arguments"
],
"required": true,
"required_semantics": [
"currently_visible_evidence",
"evidence_gap",
"natural_language_target_region"
]
},
"tool_result_analysis_turn": "A Raw/SR observation may first be analyzed by the assistant turn after the matching tool response."
}
}