@jacobbd/relay-ai 0.12.1 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ import {
10
10
  supportsManualModels,
11
11
  translateRequest,
12
12
  validateCustomEndpointUrl
13
- } from "./chunk-7ASGPECN.js";
13
+ } from "./chunk-C7TTIGMR.js";
14
14
 
15
15
  // src/registry/validate-manual-model.ts
16
16
  import { randomUUID } from "crypto";
@@ -149,4 +149,4 @@ export {
149
149
  addManualModel,
150
150
  removeManualModel
151
151
  };
152
- //# sourceMappingURL=chunk-UQKYSNDM.js.map
152
+ //# sourceMappingURL=chunk-3K2DFBNP.js.map
@@ -7,7 +7,7 @@ import { join } from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@jacobbd/relay-ai",
10
- version: "0.12.1",
10
+ version: "0.12.3",
11
11
  publishConfig: {
12
12
  access: "public"
13
13
  },
@@ -4044,18 +4044,21 @@ function safeUpstreamErrorFields(err, includeCause) {
4044
4044
  function formatUpstreamErrorTrace(err) {
4045
4045
  return JSON.stringify(safeUpstreamErrorFields(err, true));
4046
4046
  }
4047
+ function joinProviderMessage(message) {
4048
+ return message.split("\n").map((line) => line.trim()).filter(Boolean).join(" ");
4049
+ }
4047
4050
  function formatUpstreamError(err) {
4048
4051
  if (!err || typeof err !== "object") return "Upstream model request failed.";
4049
4052
  const rec = err;
4050
4053
  if (rec.data?.error?.message) {
4051
- const short = sanitizeMessage(rec.data.error.message);
4054
+ const short = joinProviderMessage(rec.data.error.message);
4052
4055
  return rec.statusCode ? `${short} (HTTP ${rec.statusCode})` : short;
4053
4056
  }
4054
4057
  if (rec.responseBody) {
4055
4058
  try {
4056
4059
  const parsed = JSON.parse(rec.responseBody);
4057
4060
  if (parsed.error?.message) {
4058
- const short = sanitizeMessage(parsed.error.message);
4061
+ const short = joinProviderMessage(parsed.error.message);
4059
4062
  return rec.statusCode ? `${short} (HTTP ${rec.statusCode})` : short;
4060
4063
  }
4061
4064
  } catch {
@@ -4788,4 +4791,4 @@ export {
4788
4791
  streamAnthropicResponse,
4789
4792
  generateAnthropicResponse
4790
4793
  };
4791
- //# sourceMappingURL=chunk-7ASGPECN.js.map
4794
+ //# sourceMappingURL=chunk-C7TTIGMR.js.map