@rasputin-ai/browser 0.6.1 → 0.7.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"browser-ingest-event.d.ts","sourceRoot":"","sources":["../src/browser-ingest-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AA6BpF,eAAO,MAAM,wBAAwB,GAAI,OAAO;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC,KAAG,kBA2BH,CAAC"}
1
+ {"version":3,"file":"browser-ingest-event.d.ts","sourceRoot":"","sources":["../src/browser-ingest-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AA8DpF,eAAO,MAAM,wBAAwB,GAAI,OAAO;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,yBAAyB,CAAC;CACzC,KAAG,kBA2BH,CAAC"}
package/dist/index.js CHANGED
@@ -624,6 +624,18 @@ var framesFromError = (error) => {
624
624
  var MAX_MESSAGE_BYTES2 = 8 * 1024;
625
625
  var MAX_STACK_FRAMES2 = 50;
626
626
  var utf8 = new TextEncoder();
627
+ var messageFromObject = (error) => {
628
+ if ("message" in error && typeof error.message === "string" && error.message) {
629
+ return error.message;
630
+ }
631
+ if ("error" in error && error.error !== null && typeof error.error === "object" && "message" in error.error && typeof error.error.message === "string") {
632
+ return error.error.message;
633
+ }
634
+ if ("body" in error && error.body !== null && typeof error.body === "object" && "message" in error.body && typeof error.body.message === "string") {
635
+ return error.body.message;
636
+ }
637
+ return "";
638
+ };
627
639
  var truncateMessage = (value) => {
628
640
  if (utf8.encode(value).byteLength <= MAX_MESSAGE_BYTES2) return value;
629
641
  let end = Math.min(value.length, MAX_MESSAGE_BYTES2);
@@ -640,6 +652,13 @@ var errorFields = (error) => {
640
652
  };
641
653
  }
642
654
  if (typeof error === "string") return { type: "string", message: error };
655
+ if (error !== null && typeof error === "object") {
656
+ const message = messageFromObject(error);
657
+ if (message) {
658
+ const type = "name" in error && typeof error.name === "string" && error.name ? error.name : "Error";
659
+ return { type, message };
660
+ }
661
+ }
643
662
  return { type: "Error", message: String(error) };
644
663
  };
645
664
  var createBrowserIngestEvent = (input) => {
@@ -3425,7 +3444,7 @@ var mapBrowserRuntimeState = (snapshot, buildId) => {
3425
3444
 
3426
3445
  // src/sdk-meta.ts
3427
3446
  var SDK_NAME = "@rasputin-ai/browser";
3428
- var SDK_VERSION = "0.6.1";
3447
+ var SDK_VERSION = "0.7.0";
3429
3448
 
3430
3449
  // src/rasputin-init.ts
3431
3450
  var DEFAULT_API_URL = "https://api.rasputinai.dev";
@@ -1,4 +1,4 @@
1
1
  /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/browser";
3
- export declare const SDK_VERSION = "0.6.1";
3
+ export declare const SDK_VERSION = "0.7.0";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map