@iqai/adk 0.6.3 → 0.6.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 3382057: Fix optional peer dependency issue with Langfuse.
8
+
9
+ Previously, importing `@iqai/adk` would fail if `langfuse` was missing, even when the Langfuse plugin was not used.
10
+
11
+ This change:
12
+ - Uses `import type` for Langfuse to preserve type safety without a runtime import.
13
+ - Dynamically requires `langfuse` inside `LangfusePlugin` constructor.
14
+ - Throws a clear error if the plugin is used without `langfuse` installed.
15
+
16
+ Now, users can import `@iqai/adk` without installing `langfuse` unless they use the Langfuse plugin.
17
+
3
18
  ## 0.6.3
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -17866,9 +17866,6 @@ var BasePlugin = class {
17866
17866
  };
17867
17867
 
17868
17868
  // src/plugins/langfuse-plugin.ts
17869
-
17870
-
17871
- var _langfuse = require('langfuse');
17872
17869
  var LangfusePlugin = (_class41 = class extends BasePlugin {
17873
17870
 
17874
17871
  __init81() {this.traces = /* @__PURE__ */ new Map()}
@@ -17881,7 +17878,15 @@ var LangfusePlugin = (_class41 = class extends BasePlugin {
17881
17878
  __init88() {this.modelsUsedKeysByInvocation = /* @__PURE__ */ new Map()}
17882
17879
  constructor(options) {
17883
17880
  super(_nullishCoalesce(options.name, () => ( "langfuse_plugin")));_class41.prototype.__init81.call(this);_class41.prototype.__init82.call(this);_class41.prototype.__init83.call(this);_class41.prototype.__init84.call(this);_class41.prototype.__init85.call(this);_class41.prototype.__init86.call(this);_class41.prototype.__init87.call(this);_class41.prototype.__init88.call(this);;
17884
- this.client = new (0, _langfuse.Langfuse)({
17881
+ let LangfuseClass;
17882
+ try {
17883
+ LangfuseClass = __require("langfuse").Langfuse;
17884
+ } catch (_error) {
17885
+ throw new Error(
17886
+ "Missing required peer dependency: langfuse. To use LangfusePlugin, install it with 'npm install langfuse' or 'pnpm add langfuse'."
17887
+ );
17888
+ }
17889
+ this.client = new LangfuseClass({
17885
17890
  publicKey: options.publicKey,
17886
17891
  secretKey: options.secretKey,
17887
17892
  baseUrl: _nullishCoalesce(options.baseUrl, () => ( "https://us.cloud.langfuse.com")),
package/dist/index.mjs CHANGED
@@ -17866,9 +17866,6 @@ var BasePlugin = class {
17866
17866
  };
17867
17867
 
17868
17868
  // src/plugins/langfuse-plugin.ts
17869
- import {
17870
- Langfuse
17871
- } from "langfuse";
17872
17869
  var LangfusePlugin = class extends BasePlugin {
17873
17870
  client;
17874
17871
  traces = /* @__PURE__ */ new Map();
@@ -17881,7 +17878,15 @@ var LangfusePlugin = class extends BasePlugin {
17881
17878
  modelsUsedKeysByInvocation = /* @__PURE__ */ new Map();
17882
17879
  constructor(options) {
17883
17880
  super(options.name ?? "langfuse_plugin");
17884
- this.client = new Langfuse({
17881
+ let LangfuseClass;
17882
+ try {
17883
+ LangfuseClass = __require("langfuse").Langfuse;
17884
+ } catch (_error) {
17885
+ throw new Error(
17886
+ "Missing required peer dependency: langfuse. To use LangfusePlugin, install it with 'npm install langfuse' or 'pnpm add langfuse'."
17887
+ );
17888
+ }
17889
+ this.client = new LangfuseClass({
17885
17890
  publicKey: options.publicKey,
17886
17891
  secretKey: options.secretKey,
17887
17892
  baseUrl: options.baseUrl ?? "https://us.cloud.langfuse.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Agent Development Kit for TypeScript with multi-provider LLM support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",