neatlogs 1.1.21 → 1.1.23

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/cli.mjs CHANGED
@@ -7096,7 +7096,7 @@ var TELEMETRY_CONFLICT_PRECEDENCE = Object.freeze(
7096
7096
  );
7097
7097
 
7098
7098
  // src/version.ts
7099
- var __version__ = "1.1.21";
7099
+ var __version__ = "1.1.23";
7100
7100
 
7101
7101
  // src/init.ts
7102
7102
  import * as path2 from "path";
@@ -8580,6 +8580,19 @@ var UnifiedAttributeProcessor = class {
8580
8580
  attrs["llm.output_messages.0.message.role"] = "assistant";
8581
8581
  attrs["llm.output_messages.0.message.content"] = typeof obj === "string" ? obj : JSON.stringify(obj);
8582
8582
  }
8583
+ const responseReasoning = attrs["ai.response.reasoning"];
8584
+ if (typeof responseReasoning === "string" && responseReasoning.length > 0 && !("neatlogs.llm.output_messages.0.thinking" in attrs)) {
8585
+ attrs["neatlogs.llm.output_messages.0.thinking"] = responseReasoning;
8586
+ }
8587
+ const thinking = attrs["neatlogs.llm.output_messages.0.thinking"];
8588
+ if (typeof thinking === "string" && thinking.length > 0) {
8589
+ if (!("neatlogs.llm.thinking" in attrs)) {
8590
+ attrs["neatlogs.llm.thinking"] = thinking;
8591
+ }
8592
+ if (!("neatlogs.llm.has_thinking" in attrs)) {
8593
+ attrs["neatlogs.llm.has_thinking"] = "true";
8594
+ }
8595
+ }
8583
8596
  if ("ai.response.finishReason" in attrs && !("llm.response.finish_reason" in attrs)) {
8584
8597
  attrs["llm.response.finish_reason"] = attrs["ai.response.finishReason"];
8585
8598
  }
@@ -10522,12 +10535,16 @@ var ObservableBatchLogRecordProcessor = class extends BatchLogRecordProcessor {
10522
10535
  // src/core/log.ts
10523
10536
  import { AsyncLocalStorage as AsyncLocalStorage5 } from "async_hooks";
10524
10537
  var logger13 = getLogger();
10525
- var _otelLogger = null;
10526
- var _debugMode = false;
10538
+ var LOG_RUNTIME_STATE_KEY = /* @__PURE__ */ Symbol.for("neatlogs.log_runtime_state");
10539
+ var neatlogsGlobal3 = globalThis;
10540
+ var logRuntimeState = neatlogsGlobal3[LOG_RUNTIME_STATE_KEY] ?? (neatlogsGlobal3[LOG_RUNTIME_STATE_KEY] = {
10541
+ otelLogger: null,
10542
+ debugMode: false
10543
+ });
10527
10544
  var stdoutCaptureContext = new AsyncLocalStorage5();
10528
10545
  function _setOtelLogger(otelLogger, debug) {
10529
- _otelLogger = otelLogger;
10530
- _debugMode = debug;
10546
+ logRuntimeState.otelLogger = otelLogger;
10547
+ logRuntimeState.debugMode = debug;
10531
10548
  }
10532
10549
 
10533
10550
  // src/prompt/client.ts
@@ -11356,7 +11373,7 @@ var _logProvider = null;
11356
11373
  var _spanProcessor = null;
11357
11374
  var _transportSpanProcessors = [];
11358
11375
  var _completionProcessor = null;
11359
- var _debugMode2 = false;
11376
+ var _debugMode = false;
11360
11377
  var _deliveryDiagnostics = new DeliveryDiagnostics();
11361
11378
  var _initIdentity = null;
11362
11379
  var _effectiveSampleRate = 1;
@@ -11648,7 +11665,7 @@ async function _performInit(options) {
11648
11665
  if (options.debug) {
11649
11666
  enableDebugLogging();
11650
11667
  }
11651
- _debugMode2 = options.debug ?? false;
11668
+ _debugMode = options.debug ?? false;
11652
11669
  const resolvedWorkflowName = _resolveWorkflowName(options.workflowName);
11653
11670
  const endpoint = resolveInitEndpoint(options.endpoint);
11654
11671
  const baseUrl = resolveIngestBaseUrl(endpoint);
@@ -11986,7 +12003,7 @@ async function _performShutdown(terminationReason, timeoutMs) {
11986
12003
  _spanProcessor = null;
11987
12004
  _transportSpanProcessors = [];
11988
12005
  _completionProcessor = null;
11989
- _debugMode2 = false;
12006
+ _debugMode = false;
11990
12007
  _effectiveSampleRate = 1;
11991
12008
  _exportEnabled = false;
11992
12009
  _queueMaxSize = 2048;