@cuylabs/agent-core 6.2.0 → 6.2.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.
@@ -732,6 +732,11 @@ function otelMiddleware(config = {}) {
732
732
 
733
733
  // src/middleware/telemetry/provider.ts
734
734
  import { GenAIOpenTelemetry } from "@ai-sdk/otel";
735
+ var MODEL_STEP_OPERATION_ID = "model_step";
736
+ var AI_SDK_TEXT_GENERATION_OPERATION_IDS = /* @__PURE__ */ new Set([
737
+ "ai.generateText",
738
+ "ai.streamText"
739
+ ]);
735
740
  var sharedProviderState;
736
741
  function createTelemetryConfig(config) {
737
742
  const recordInputs = config.recordInputs ?? true;
@@ -832,7 +837,7 @@ function createProviderSafeGenAIOpenTelemetry(providerReady) {
832
837
  }
833
838
  return {
834
839
  onStart(event) {
835
- return callDelegate("onStart", event);
840
+ return callDelegate("onStart", normalizeGenAiStartEvent(event));
836
841
  },
837
842
  onStepStart(event) {
838
843
  return callDelegate("onStepStart", event);
@@ -884,9 +889,25 @@ function createProviderSafeGenAIOpenTelemetry(providerReady) {
884
889
  }
885
890
  };
886
891
  }
892
+ function normalizeGenAiStartEvent(event) {
893
+ if (!isRecord(event)) {
894
+ return event;
895
+ }
896
+ const operationId = event.operationId;
897
+ if (typeof operationId !== "string" || !AI_SDK_TEXT_GENERATION_OPERATION_IDS.has(operationId)) {
898
+ return event;
899
+ }
900
+ return {
901
+ ...event,
902
+ operationId: MODEL_STEP_OPERATION_ID
903
+ };
904
+ }
887
905
  function isPromiseLike(value) {
888
906
  return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function";
889
907
  }
908
+ function isRecord(value) {
909
+ return typeof value === "object" && value !== null;
910
+ }
890
911
  function toTelemetryIntegrationArray(integrations) {
891
912
  if (!integrations) {
892
913
  return [];
package/dist/index.js CHANGED
@@ -84,7 +84,7 @@ import {
84
84
  isApprovalMiddleware,
85
85
  otelMiddleware,
86
86
  promptCacheMiddleware
87
- } from "./chunk-R3A2VU5O.js";
87
+ } from "./chunk-WYMQTNOT.js";
88
88
  import {
89
89
  LayeredSettings,
90
90
  NullSettings,
@@ -5,7 +5,7 @@ import {
5
5
  isApprovalMiddleware,
6
6
  otelMiddleware,
7
7
  promptCacheMiddleware
8
- } from "../chunk-R3A2VU5O.js";
8
+ } from "../chunk-WYMQTNOT.js";
9
9
  import {
10
10
  isBlockedModelCall
11
11
  } from "../chunk-W6LWIMIX.js";
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAiBzE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,GACtB,qBAAqB,CAyDvB"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/middleware/telemetry/provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAuBzE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,GACtB,qBAAqB,CAyDvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuylabs/agent-core",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "Embeddable AI agent infrastructure — execution, sessions, tools, skills, dispatch, tracing",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",