(value: unknown)
| 81 | const decodeUpstreamDescriptionBody = Schema.decodeUnknownOption(UpstreamDescriptionBody); |
| 82 | |
| 83 | const clampedStringify = (value: unknown): string => { |
| 84 | let s: string; |
| 85 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: JSON.stringify may throw on cycles; fall back to String() so the upstream body can still be surfaced as ToolError.details fallback text |
| 86 | try { |
| 87 | s = JSON.stringify(value); |
| 88 | } catch { |
| 89 | s = String(value); |
| 90 | } |
| 91 | return s.length > STRINGIFIED_BODY_CAP ? `${s.slice(0, STRINGIFIED_BODY_CAP)}…` : s; |
| 92 | }; |
| 93 | |
| 94 | const firstNonEmpty = (...values: readonly (string | undefined)[]): string | undefined => |
| 95 | values.find((value) => value !== undefined && value.length > 0); |
no outgoing calls
no test coverage detected