bitfab 0.13.0 → 0.13.1

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.
package/dist/index.d.cts CHANGED
@@ -875,7 +875,7 @@ declare class BitfabFunction {
875
875
  /**
876
876
  * SDK version from package.json (injected at build time)
877
877
  */
878
- declare const __version__ = "0.13.0";
878
+ declare const __version__ = "0.13.1";
879
879
 
880
880
  /**
881
881
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -875,7 +875,7 @@ declare class BitfabFunction {
875
875
  /**
876
876
  * SDK version from package.json (injected at build time)
877
877
  */
878
- declare const __version__ = "0.13.0";
878
+ declare const __version__ = "0.13.1";
879
879
 
880
880
  /**
881
881
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -6,13 +6,13 @@ import {
6
6
  BitfabOpenAITracingProcessor,
7
7
  getCurrentSpan,
8
8
  getCurrentTrace
9
- } from "./chunk-62NGOY7Q.js";
9
+ } from "./chunk-HIDM5UYA.js";
10
10
  import {
11
11
  BitfabError,
12
12
  DEFAULT_SERVICE_URL,
13
13
  __version__,
14
14
  flushTraces
15
- } from "./chunk-QLVXAFGP.js";
15
+ } from "./chunk-3JCQD7E5.js";
16
16
  export {
17
17
  Bitfab,
18
18
  BitfabClaudeAgentHandler,
package/dist/node.cjs CHANGED
@@ -81,7 +81,7 @@ var __version__;
81
81
  var init_version_generated = __esm({
82
82
  "src/version.generated.ts"() {
83
83
  "use strict";
84
- __version__ = "0.13.0";
84
+ __version__ = "0.13.1";
85
85
  }
86
86
  });
87
87
 
@@ -428,15 +428,43 @@ var init_replayContext = __esm({
428
428
  });
429
429
 
430
430
  // src/serialize.ts
431
+ function describeValue(value) {
432
+ try {
433
+ const ctorName = value?.constructor?.name;
434
+ if (ctorName && ctorName !== "Object") {
435
+ return ctorName;
436
+ }
437
+ } catch {
438
+ }
439
+ return typeof value;
440
+ }
441
+ function unserializableStub(value, reason) {
442
+ let summary;
443
+ try {
444
+ summary = `<unserializable: ${describeValue(value)} (${reason})>`;
445
+ } catch {
446
+ summary = `<unserializable (${reason})>`;
447
+ }
448
+ return { json: summary };
449
+ }
431
450
  function serializeValue(value) {
432
451
  try {
433
452
  const { json, meta } = import_superjson.default.serialize(value);
453
+ let size;
454
+ try {
455
+ size = JSON.stringify(json).length;
456
+ } catch {
457
+ return unserializableStub(value, "stringify_failed_after_superjson");
458
+ }
459
+ if (size > MAX_SERIALIZED_BYTES) {
460
+ return unserializableStub(value, `too_large_${size}_bytes`);
461
+ }
434
462
  return meta ? { json, meta } : { json };
435
463
  } catch {
436
464
  try {
437
465
  return { json: JSON.parse(JSON.stringify(value)) };
438
466
  } catch {
439
- return { json: String(value) };
467
+ return unserializableStub(value, "json_stringify_failed");
440
468
  }
441
469
  }
442
470
  }
@@ -449,11 +477,12 @@ function deserializeValue(serialized) {
449
477
  meta: serialized.meta
450
478
  });
451
479
  }
452
- var import_superjson;
480
+ var import_superjson, MAX_SERIALIZED_BYTES;
453
481
  var init_serialize = __esm({
454
482
  "src/serialize.ts"() {
455
483
  "use strict";
456
484
  import_superjson = __toESM(require("superjson"), 1);
485
+ MAX_SERIALIZED_BYTES = 512e3;
457
486
  }
458
487
  });
459
488