* Extracts the reasoning text if `part` is a ReasoningContentBlock, or `undefined` * otherwise. Providers like DeepSeek / Z.ai emit a `"reasoning"` content block that isn't part of * Anthropic's `ContentBlockParam` union, so `part` is treated as `unknown` and its shape is * validated at r
(part: unknown)
| 272 | * overlap with any variant of `ContentBlockParam`, so the narrowed type collapses to `never`. |
| 273 | */ |
| 274 | function getReasoningBlockText(part: unknown): string | undefined { |
| 275 | if (!part || typeof part !== "object") { |
| 276 | return undefined |
| 277 | } |
| 278 | const block = part as { type?: unknown; text?: unknown } |
| 279 | return block.type === "reasoning" && typeof block.text === "string" ? block.text : undefined |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Non-standard fields Zoo Code attaches to Anthropic message params to |
no outgoing calls
no test coverage detected