(value: unknown)
| 141 | } |
| 142 | |
| 143 | function readResponseLevel(value: unknown): ResponseLevel | undefined { |
| 144 | if (value === undefined) return undefined; |
| 145 | if (typeof value !== 'string' || !(RESPONSE_LEVELS as readonly string[]).includes(value)) { |
| 146 | throw new Error("Expected responseLevel to be one of 'digest', 'default', or 'full'."); |
| 147 | } |
| 148 | return value as ResponseLevel; |
| 149 | } |
| 150 | |
| 151 | function readMcpOutputFormat(outputFormat: unknown): McpOutputFormat { |
| 152 | if (outputFormat === undefined) return 'optimized'; |