@brizz/sdk 0.1.12 → 0.1.13
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 +1 -57
- 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 +1 -57
- package/dist/index.js.map +1 -1
- package/dist/preload.cjs +3 -59
- package/dist/preload.cjs.map +1 -1
- package/dist/preload.js +1 -57
- package/dist/preload.js.map +1 -1
- package/package.json +1 -1
package/dist/preload.cjs
CHANGED
|
@@ -359,52 +359,6 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
|
|
|
359
359
|
}
|
|
360
360
|
};
|
|
361
361
|
|
|
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
362
|
// src/internal/log/logging.ts
|
|
409
363
|
var import_api_logs = require("@opentelemetry/api-logs");
|
|
410
364
|
var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
@@ -413,7 +367,7 @@ var import_sdk_logs2 = require("@opentelemetry/sdk-logs");
|
|
|
413
367
|
|
|
414
368
|
// src/internal/version.ts
|
|
415
369
|
function getSDKVersion() {
|
|
416
|
-
return "0.1.
|
|
370
|
+
return "0.1.13";
|
|
417
371
|
}
|
|
418
372
|
|
|
419
373
|
// src/internal/log/processors/log-processor.ts
|
|
@@ -1670,7 +1624,6 @@ var _Brizz = class __Brizz {
|
|
|
1670
1624
|
const resolvedConfig = resolveConfig(options);
|
|
1671
1625
|
this.initializeModules(resolvedConfig);
|
|
1672
1626
|
this.setupInstrumentation(options);
|
|
1673
|
-
this.initLangChainInstrumentation();
|
|
1674
1627
|
this.createAndStartNodeSDK(options, resolvedConfig);
|
|
1675
1628
|
this._initialized = true;
|
|
1676
1629
|
logger.info("Brizz SDK initialization completed successfully", {
|
|
@@ -1681,15 +1634,6 @@ var _Brizz = class __Brizz {
|
|
|
1681
1634
|
throw new Error(`Failed to initialize SDK: ${String(error)}`, { cause: error });
|
|
1682
1635
|
}
|
|
1683
1636
|
}
|
|
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
1637
|
/**
|
|
1694
1638
|
* Set up instrumentation registry and configure manual modules.
|
|
1695
1639
|
* @private
|
|
@@ -1836,7 +1780,7 @@ var _Brizz = class __Brizz {
|
|
|
1836
1780
|
var Brizz = new _Brizz();
|
|
1837
1781
|
|
|
1838
1782
|
// src/node/loader.ts
|
|
1839
|
-
var
|
|
1783
|
+
var import_node_module = __toESM(require("module"), 1);
|
|
1840
1784
|
var import_import_in_the_middle = require("import-in-the-middle");
|
|
1841
1785
|
var import_meta = {};
|
|
1842
1786
|
var loaderDebug = (() => {
|
|
@@ -1900,7 +1844,7 @@ function maybeRegisterESMLoader() {
|
|
|
1900
1844
|
loaderDebug.log("Creating MessageChannel for import-in-the-middle...");
|
|
1901
1845
|
const { addHookMessagePort } = (0, import_import_in_the_middle.createAddHookMessageChannel)();
|
|
1902
1846
|
loaderDebug.log("Registering import-in-the-middle/hook.mjs...");
|
|
1903
|
-
|
|
1847
|
+
import_node_module.default.register("import-in-the-middle/hook.mjs", import_meta.url, {
|
|
1904
1848
|
data: { addHookMessagePort },
|
|
1905
1849
|
transferList: [addHookMessagePort]
|
|
1906
1850
|
});
|