@brizz/sdk 0.1.12 → 0.1.14
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.cjs +14 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +14 -66
- package/dist/index.js.map +1 -1
- package/dist/preload.cjs +16 -68
- package/dist/preload.cjs.map +1 -1
- package/dist/preload.js +14 -66
- package/dist/preload.js.map +1 -1
- package/package.json +24 -22
package/dist/preload.cjs
CHANGED
|
@@ -246,7 +246,6 @@ var BRIZZ_SDK_LANGUAGE = "brizz.sdk.language";
|
|
|
246
246
|
var SDK_LANGUAGE = "typescript";
|
|
247
247
|
|
|
248
248
|
// src/internal/instrumentation/registry.ts
|
|
249
|
-
var import_openinference_instrumentation_langchain = require("@arizeai/openinference-instrumentation-langchain");
|
|
250
249
|
var import_instrumentation_anthropic = require("@traceloop/instrumentation-anthropic");
|
|
251
250
|
var import_instrumentation_bedrock = require("@traceloop/instrumentation-bedrock");
|
|
252
251
|
var import_instrumentation_chromadb = require("@traceloop/instrumentation-chromadb");
|
|
@@ -347,64 +346,23 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
|
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
348
|
if (this.manualModules?.langchain?.callbackManagerModule) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
349
|
+
const callbackManagerModule = this.manualModules.langchain.callbackManagerModule;
|
|
350
|
+
void (async () => {
|
|
351
|
+
try {
|
|
352
|
+
const { LangChainInstrumentation } = await import("@arizeai/openinference-instrumentation-langchain");
|
|
353
|
+
const lcInst = new LangChainInstrumentation();
|
|
354
|
+
lcInst.manuallyInstrument(callbackManagerModule);
|
|
355
|
+
logger.debug("Manual instrumentation enabled for LangChain");
|
|
356
|
+
} catch (error) {
|
|
357
|
+
logger.error(
|
|
358
|
+
`Failed to load LangChain instrumentation. Ensure @langchain/core is installed: ${String(error)}`
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
})();
|
|
358
362
|
}
|
|
359
363
|
}
|
|
360
364
|
};
|
|
361
365
|
|
|
362
|
-
// src/internal/instrumentation/langchain-instrumentation.ts
|
|
363
|
-
var import_node_module = require("module");
|
|
364
|
-
var import_node_url = require("url");
|
|
365
|
-
var import_openinference_instrumentation_langchain2 = require("@arizeai/openinference-instrumentation-langchain");
|
|
366
|
-
var initialized = false;
|
|
367
|
-
async function importCallbackManager() {
|
|
368
|
-
try {
|
|
369
|
-
return await import("@langchain/core/callbacks/manager");
|
|
370
|
-
} catch {
|
|
371
|
-
}
|
|
372
|
-
const resolvers = [
|
|
373
|
-
() => (0, import_node_module.createRequire)((0, import_node_url.pathToFileURL)(process.cwd() + "/package.json").href),
|
|
374
|
-
() => {
|
|
375
|
-
const main = process.argv[1];
|
|
376
|
-
if (!main) {
|
|
377
|
-
throw new Error("no main");
|
|
378
|
-
}
|
|
379
|
-
return (0, import_node_module.createRequire)((0, import_node_url.pathToFileURL)(main).href);
|
|
380
|
-
}
|
|
381
|
-
];
|
|
382
|
-
for (const getRequire of resolvers) {
|
|
383
|
-
try {
|
|
384
|
-
const req = getRequire();
|
|
385
|
-
const cjsPath = req.resolve("@langchain/core/callbacks/manager");
|
|
386
|
-
const esmPath = cjsPath.replace(/\.cjs$/, ".js");
|
|
387
|
-
return await import((0, import_node_url.pathToFileURL)(esmPath).href);
|
|
388
|
-
} catch {
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
return null;
|
|
392
|
-
}
|
|
393
|
-
async function setupLangChainInstrumentation() {
|
|
394
|
-
if (initialized) {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
const callbackManagerModule = await importCallbackManager();
|
|
398
|
-
if (!callbackManagerModule) {
|
|
399
|
-
logger.debug("@langchain/core not found \u2014 skipping LangChain instrumentation");
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
const instrumentation = new import_openinference_instrumentation_langchain2.LangChainInstrumentation();
|
|
403
|
-
instrumentation.manuallyInstrument(callbackManagerModule);
|
|
404
|
-
initialized = true;
|
|
405
|
-
logger.info("LangChain instrumentation enabled (OpenInference)");
|
|
406
|
-
}
|
|
407
|
-
|
|
408
366
|
// src/internal/log/logging.ts
|
|
409
367
|
var import_api_logs = require("@opentelemetry/api-logs");
|
|
410
368
|
var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
@@ -413,7 +371,7 @@ var import_sdk_logs2 = require("@opentelemetry/sdk-logs");
|
|
|
413
371
|
|
|
414
372
|
// src/internal/version.ts
|
|
415
373
|
function getSDKVersion() {
|
|
416
|
-
return "0.1.
|
|
374
|
+
return "0.1.14";
|
|
417
375
|
}
|
|
418
376
|
|
|
419
377
|
// src/internal/log/processors/log-processor.ts
|
|
@@ -1670,7 +1628,6 @@ var _Brizz = class __Brizz {
|
|
|
1670
1628
|
const resolvedConfig = resolveConfig(options);
|
|
1671
1629
|
this.initializeModules(resolvedConfig);
|
|
1672
1630
|
this.setupInstrumentation(options);
|
|
1673
|
-
this.initLangChainInstrumentation();
|
|
1674
1631
|
this.createAndStartNodeSDK(options, resolvedConfig);
|
|
1675
1632
|
this._initialized = true;
|
|
1676
1633
|
logger.info("Brizz SDK initialization completed successfully", {
|
|
@@ -1681,15 +1638,6 @@ var _Brizz = class __Brizz {
|
|
|
1681
1638
|
throw new Error(`Failed to initialize SDK: ${String(error)}`, { cause: error });
|
|
1682
1639
|
}
|
|
1683
1640
|
}
|
|
1684
|
-
/**
|
|
1685
|
-
* Async LangChain instrumentation setup (fire-and-forget).
|
|
1686
|
-
* @private
|
|
1687
|
-
*/
|
|
1688
|
-
initLangChainInstrumentation() {
|
|
1689
|
-
setupLangChainInstrumentation().catch((error) => {
|
|
1690
|
-
logger.debug(`LangChain instrumentation skipped: ${String(error)}`);
|
|
1691
|
-
});
|
|
1692
|
-
}
|
|
1693
1641
|
/**
|
|
1694
1642
|
* Set up instrumentation registry and configure manual modules.
|
|
1695
1643
|
* @private
|
|
@@ -1836,7 +1784,7 @@ var _Brizz = class __Brizz {
|
|
|
1836
1784
|
var Brizz = new _Brizz();
|
|
1837
1785
|
|
|
1838
1786
|
// src/node/loader.ts
|
|
1839
|
-
var
|
|
1787
|
+
var import_node_module = __toESM(require("module"), 1);
|
|
1840
1788
|
var import_import_in_the_middle = require("import-in-the-middle");
|
|
1841
1789
|
var import_meta = {};
|
|
1842
1790
|
var loaderDebug = (() => {
|
|
@@ -1900,7 +1848,7 @@ function maybeRegisterESMLoader() {
|
|
|
1900
1848
|
loaderDebug.log("Creating MessageChannel for import-in-the-middle...");
|
|
1901
1849
|
const { addHookMessagePort } = (0, import_import_in_the_middle.createAddHookMessageChannel)();
|
|
1902
1850
|
loaderDebug.log("Registering import-in-the-middle/hook.mjs...");
|
|
1903
|
-
|
|
1851
|
+
import_node_module.default.register("import-in-the-middle/hook.mjs", import_meta.url, {
|
|
1904
1852
|
data: { addHookMessagePort },
|
|
1905
1853
|
transferList: [addHookMessagePort]
|
|
1906
1854
|
});
|