From ec16ab4b65682cc8e63612b98fe4ff370dc225e4 Mon Sep 17 00:00:00 2001 From: Brent Rager Date: Sat, 23 May 2026 11:55:48 -0400 Subject: [PATCH] fix(node): re-export GenAI helpers from node entry The node entry was missing re-exports for setGenAIAttributes, recordGenAIMessage, and the GenAI types (GenAIAttributes, GenAIOperationName, GenAISystem). Since '@smooai/observability' resolves to ./dist/node.mjs in Node via the 'node' conditional export, consumers importing these helpers from the bare package name failed to build with 'No matching export in node.mjs for import setGenAIAttributes'. Mirrors the exports already present in src/index.ts. --- .changeset/fix-node-genai-exports.md | 5 +++++ packages/core/src/node/index.ts | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/fix-node-genai-exports.md diff --git a/.changeset/fix-node-genai-exports.md b/.changeset/fix-node-genai-exports.md new file mode 100644 index 0000000..0aee682 --- /dev/null +++ b/.changeset/fix-node-genai-exports.md @@ -0,0 +1,5 @@ +--- +'@smooai/observability': patch +--- + +fix(node): re-export `setGenAIAttributes` / `recordGenAIMessage` / GenAI types from node entry — were missing in 0.10.0, broke backend builds importing the helpers from the bare package name diff --git a/packages/core/src/node/index.ts b/packages/core/src/node/index.ts index 5262003..2d35d40 100644 --- a/packages/core/src/node/index.ts +++ b/packages/core/src/node/index.ts @@ -34,6 +34,13 @@ export { registerOtelCapture, _resetOtelCaptureForTests } from './otel-capture'; export { observabilityMiddleware } from './middleware'; export type { ObservabilityMiddlewareOptions } from './middleware'; export { makeNodeTransport } from './transport'; +export { + setGenAIAttributes, + recordGenAIMessage, + type GenAIAttributes, + type GenAIOperationName, + type GenAISystem, +} from '../gen-ai-attributes'; // Auto-wire on init — Node is OTel-first. Set `autoInstrumentation: false` // to opt out of process error handlers; the OTel capture path is always