| 196 | } |
| 197 | |
| 198 | function versionUnsupported(requested: unknown, callerContext: unknown): AdaptedResponse { |
| 199 | const errorObj: Record<string, unknown> = { |
| 200 | code: 'VERSION_UNSUPPORTED', |
| 201 | message: `AdCP major version ${String(requested)} is not supported`, |
| 202 | details: { supported_major_versions: SUPPORTED_MAJOR_VERSIONS }, |
| 203 | field: 'adcp_major_version', |
| 204 | }; |
| 205 | const body = wrapEnvelope({ adcp_error: errorObj }, { context: callerContext }); |
| 206 | return { |
| 207 | isError: true, |
| 208 | content: [{ type: 'text', text: JSON.stringify(body) }], |
| 209 | structuredContent: body, |
| 210 | }; |
| 211 | } |
| 212 | |
| 213 | // ── Handler adapter ────────────────────────────────────────────── |
| 214 | |