|
| 1 | +{ |
| 2 | + "$id": "https://commandlayer.org/schemas/v1.0.0/commons/translate/requests/translate.request.schema.json", |
| 3 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 4 | + "title": "translate.request", |
| 5 | + "description": "Request to translate content from a source language to a target language with explicit limits, A2A-style channel metadata, optional auth, delegation, and context for multi-agent flows.", |
| 6 | + "type": "object", |
| 7 | + "additionalProperties": false, |
| 8 | + |
| 9 | + "properties": { |
| 10 | + "x402": { |
| 11 | + "description": "x402 envelope describing the verb, version, and optional routing metadata.", |
| 12 | + "allOf": [ |
| 13 | + { |
| 14 | + "$ref": "https://commandlayer.org/schemas/v1.0.0/_shared/x402.schema.json" |
| 15 | + }, |
| 16 | + { |
| 17 | + "type": "object", |
| 18 | + "additionalProperties": false, |
| 19 | + "properties": { |
| 20 | + "verb": { "const": "translate" }, |
| 21 | + "version": { "const": "1.0.0" } |
| 22 | + }, |
| 23 | + "required": ["verb", "version"] |
| 24 | + } |
| 25 | + ] |
| 26 | + }, |
| 27 | + |
| 28 | + "actor": { |
| 29 | + "description": "Logical caller (wallet, ENS name, application, or agent identifier).", |
| 30 | + "type": "string", |
| 31 | + "minLength": 1, |
| 32 | + "maxLength": 256 |
| 33 | + }, |
| 34 | + |
| 35 | + "limits": { |
| 36 | + "description": "Guardrails for output size and latency.", |
| 37 | + "type": "object", |
| 38 | + "additionalProperties": false, |
| 39 | + "properties": { |
| 40 | + "max_output_tokens": { |
| 41 | + "description": "Maximum tokens in the translated output.", |
| 42 | + "type": "integer", |
| 43 | + "minimum": 1, |
| 44 | + "maximum": 32768 |
| 45 | + }, |
| 46 | + "max_chars": { |
| 47 | + "description": "Maximum characters in the translated output.", |
| 48 | + "type": "integer", |
| 49 | + "minimum": 1, |
| 50 | + "maximum": 500000 |
| 51 | + }, |
| 52 | + "max_latency_ms": { |
| 53 | + "description": "Optional upper bound on end-to-end latency in milliseconds.", |
| 54 | + "type": "integer", |
| 55 | + "minimum": 1, |
| 56 | + "maximum": 600000 |
| 57 | + } |
| 58 | + }, |
| 59 | + "required": ["max_output_tokens"] |
| 60 | + }, |
| 61 | + |
| 62 | + "input": { |
| 63 | + "description": "Content to translate and language details.", |
| 64 | + "type": "object", |
| 65 | + "additionalProperties": false, |
| 66 | + "properties": { |
| 67 | + "content": { |
| 68 | + "description": "Raw text or markup to translate.", |
| 69 | + "type": "string", |
| 70 | + "minLength": 1, |
| 71 | + "maxLength": 250000 |
| 72 | + }, |
| 73 | + "source_locale": { |
| 74 | + "description": "IETF BCP 47 language tag for the source content (e.g., en-US). If omitted, the agent MAY auto-detect.", |
| 75 | + "type": "string", |
| 76 | + "minLength": 2, |
| 77 | + "maxLength": 32 |
| 78 | + }, |
| 79 | + "target_locale": { |
| 80 | + "description": "IETF BCP 47 language tag for the desired output language (e.g., es-ES).", |
| 81 | + "type": "string", |
| 82 | + "minLength": 2, |
| 83 | + "maxLength": 32 |
| 84 | + }, |
| 85 | + "domain": { |
| 86 | + "description": "Domain or subject area (e.g., legal, medical, technical, marketing).", |
| 87 | + "type": "string", |
| 88 | + "maxLength": 64 |
| 89 | + }, |
| 90 | + "formality": { |
| 91 | + "description": "Formality preference for the translation.", |
| 92 | + "type": "string", |
| 93 | + "enum": ["default", "formal", "informal"] |
| 94 | + }, |
| 95 | + "preserve_formatting": { |
| 96 | + "description": "Whether the agent should preserve formatting (line breaks, markdown, HTML tags) as much as possible.", |
| 97 | + "type": "boolean" |
| 98 | + }, |
| 99 | + "glossary": { |
| 100 | + "description": "Optional glossary of term-level mappings that SHOULD be honored.", |
| 101 | + "type": "array", |
| 102 | + "items": { |
| 103 | + "type": "object", |
| 104 | + "additionalProperties": false, |
| 105 | + "properties": { |
| 106 | + "source_term": { |
| 107 | + "description": "Term in the source language.", |
| 108 | + "type": "string", |
| 109 | + "minLength": 1, |
| 110 | + "maxLength": 256 |
| 111 | + }, |
| 112 | + "target_term": { |
| 113 | + "description": "Desired translation for this term in the target language.", |
| 114 | + "type": "string", |
| 115 | + "minLength": 1, |
| 116 | + "maxLength": 256 |
| 117 | + } |
| 118 | + }, |
| 119 | + "required": ["source_term", "target_term"] |
| 120 | + } |
| 121 | + }, |
| 122 | + "tone": { |
| 123 | + "description": "Tone hint such as 'neutral', 'friendly', 'serious', 'marketing'.", |
| 124 | + "type": "string", |
| 125 | + "maxLength": 64 |
| 126 | + } |
| 127 | + }, |
| 128 | + "required": ["content", "target_locale"] |
| 129 | + }, |
| 130 | + |
| 131 | + "channel": { |
| 132 | + "description": "A2A-style channel configuration describing how this request is transported.", |
| 133 | + "type": "object", |
| 134 | + "additionalProperties": false, |
| 135 | + "properties": { |
| 136 | + "protocol": { |
| 137 | + "description": "Underlying transport protocol.", |
| 138 | + "type": "string", |
| 139 | + "enum": ["https", "http", "websocket", "sse", "json-rpc", "queue"] |
| 140 | + }, |
| 141 | + "input_modalities": { |
| 142 | + "description": "Modalities used for the request payload.", |
| 143 | + "type": "array", |
| 144 | + "items": { |
| 145 | + "type": "string", |
| 146 | + "enum": ["text", "markdown", "html", "json"] |
| 147 | + }, |
| 148 | + "minItems": 1 |
| 149 | + }, |
| 150 | + "output_modalities": { |
| 151 | + "description": "Modalities expected in the response.", |
| 152 | + "type": "array", |
| 153 | + "items": { |
| 154 | + "type": "string", |
| 155 | + "enum": ["text", "markdown", "html", "json"] |
| 156 | + }, |
| 157 | + "minItems": 1 |
| 158 | + }, |
| 159 | + "endpoint": { |
| 160 | + "description": "Concrete endpoint URI for this invocation (e.g., HTTPS URL, JSON-RPC endpoint).", |
| 161 | + "type": "string", |
| 162 | + "minLength": 1, |
| 163 | + "maxLength": 2048 |
| 164 | + } |
| 165 | + }, |
| 166 | + "required": ["protocol", "input_modalities", "output_modalities"] |
| 167 | + }, |
| 168 | + |
| 169 | + "auth": { |
| 170 | + "description": "Authentication metadata. Concrete credentials are implementation-specific and MUST NOT be logged in full.", |
| 171 | + "type": "object", |
| 172 | + "additionalProperties": false, |
| 173 | + "properties": { |
| 174 | + "scheme": { |
| 175 | + "description": "Auth scheme (e.g., none, api_key, oauth2, signed_message).", |
| 176 | + "type": "string", |
| 177 | + "enum": ["none", "api_key", "oauth2", "signed_message"] |
| 178 | + }, |
| 179 | + "api_key_id": { |
| 180 | + "description": "Optional opaque identifier for the API key used.", |
| 181 | + "type": "string", |
| 182 | + "maxLength": 256 |
| 183 | + }, |
| 184 | + "oauth2_client_id": { |
| 185 | + "description": "Optional OAuth2 client identifier.", |
| 186 | + "type": "string", |
| 187 | + "maxLength": 256 |
| 188 | + }, |
| 189 | + "actor_wallet": { |
| 190 | + "description": "Optional EVM wallet address associated with this request.", |
| 191 | + "type": "string", |
| 192 | + "pattern": "^0x[a-fA-F0-9]{40}$" |
| 193 | + }, |
| 194 | + "signature": { |
| 195 | + "description": "Optional detached signature (e.g., EIP-191) proving possession or intent.", |
| 196 | + "type": "string", |
| 197 | + "maxLength": 4096 |
| 198 | + } |
| 199 | + } |
| 200 | + }, |
| 201 | + |
| 202 | + "delegation": { |
| 203 | + "description": "Swarm-style delegation policy for multi-agent flows (e.g., handoff to domain-specific translators or reviewers).", |
| 204 | + "type": "object", |
| 205 | + "additionalProperties": false, |
| 206 | + "properties": { |
| 207 | + "allowed": { |
| 208 | + "description": "Whether the agent is allowed to hand off or delegate this request.", |
| 209 | + "type": "boolean" |
| 210 | + }, |
| 211 | + "targets": { |
| 212 | + "description": "Preferred downstream agents (e.g., ENS names or canonical identifiers).", |
| 213 | + "type": "array", |
| 214 | + "items": { |
| 215 | + "type": "string", |
| 216 | + "minLength": 1, |
| 217 | + "maxLength": 256 |
| 218 | + } |
| 219 | + }, |
| 220 | + "policy": { |
| 221 | + "description": "Delegation policy.", |
| 222 | + "type": "string", |
| 223 | + "enum": ["auto", "manual", "none"] |
| 224 | + }, |
| 225 | + "reason": { |
| 226 | + "description": "Human-readable reason or intent for allowing delegation.", |
| 227 | + "type": "string", |
| 228 | + "maxLength": 1024 |
| 229 | + } |
| 230 | + } |
| 231 | + }, |
| 232 | + |
| 233 | + "context": { |
| 234 | + "description": "Optional conversation or workflow context for multi-step or multi-agent interactions.", |
| 235 | + "type": "object", |
| 236 | + "additionalProperties": false, |
| 237 | + "properties": { |
| 238 | + "conversation_id": { |
| 239 | + "description": "Logical conversation identifier.", |
| 240 | + "type": "string", |
| 241 | + "maxLength": 256 |
| 242 | + }, |
| 243 | + "parent_task_id": { |
| 244 | + "description": "Identifier of the parent task, if this request is part of a larger workflow.", |
| 245 | + "type": "string", |
| 246 | + "maxLength": 256 |
| 247 | + }, |
| 248 | + "thread": { |
| 249 | + "description": "Minimal structured history; format is intentionally implementation-defined.", |
| 250 | + "type": "array", |
| 251 | + "items": { |
| 252 | + "type": "object" |
| 253 | + } |
| 254 | + } |
| 255 | + } |
| 256 | + }, |
| 257 | + |
| 258 | + "metadata": { |
| 259 | + "description": "Non-normative metadata for routing, billing, or analytics. MUST NOT change the core semantics of the request.", |
| 260 | + "type": "object", |
| 261 | + "additionalProperties": true |
| 262 | + } |
| 263 | + }, |
| 264 | + |
| 265 | + "required": ["x402", "actor", "limits", "input", "channel"] |
| 266 | +} |
0 commit comments