@iqai/adk 0.1.17 → 0.1.19

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,17 @@
1
1
  # @iqai/adk
2
2
 
3
+ ## 0.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - a3956ec: Updates create tool type to make context required in callback param
8
+
9
+ ## 0.1.18
10
+
11
+ ### Patch Changes
12
+
13
+ - a73eee4: Update create tool to always get tool context
14
+
3
15
  ## 0.1.17
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -870,7 +870,7 @@ interface CreateToolConfig<T extends Record<string, any> = Record<string, never>
870
870
  /** Zod schema for validating tool arguments (optional) */
871
871
  schema?: z.ZodSchema<T>;
872
872
  /** The function to execute (can be sync or async) */
873
- fn: (args: T, context?: ToolContext) => any;
873
+ fn: (args: T, context: ToolContext) => any;
874
874
  /** Whether the tool is a long running operation */
875
875
  isLongRunning?: boolean;
876
876
  /** Whether the tool execution should be retried on failure */
@@ -889,7 +889,7 @@ interface CreateToolConfigWithSchema<T extends Record<string, any>> {
889
889
  /** Zod schema for validating tool arguments */
890
890
  schema: z.ZodSchema<T>;
891
891
  /** The function to execute (can be sync or async) */
892
- fn: (args: T, context?: ToolContext) => any;
892
+ fn: (args: T, context: ToolContext) => any;
893
893
  /** Whether the tool is a long running operation */
894
894
  isLongRunning?: boolean;
895
895
  /** Whether the tool execution should be retried on failure */
@@ -906,7 +906,7 @@ interface CreateToolConfigWithoutSchema {
906
906
  /** A description of what the tool does */
907
907
  description: string;
908
908
  /** The function to execute (can be sync or async) */
909
- fn: (args: Record<string, never>, context?: ToolContext) => any;
909
+ fn: (args: Record<string, never>, context: ToolContext) => any;
910
910
  /** Whether the tool is a long running operation */
911
911
  isLongRunning?: boolean;
912
912
  /** Whether the tool execution should be retried on failure */
package/dist/index.d.ts CHANGED
@@ -870,7 +870,7 @@ interface CreateToolConfig<T extends Record<string, any> = Record<string, never>
870
870
  /** Zod schema for validating tool arguments (optional) */
871
871
  schema?: z.ZodSchema<T>;
872
872
  /** The function to execute (can be sync or async) */
873
- fn: (args: T, context?: ToolContext) => any;
873
+ fn: (args: T, context: ToolContext) => any;
874
874
  /** Whether the tool is a long running operation */
875
875
  isLongRunning?: boolean;
876
876
  /** Whether the tool execution should be retried on failure */
@@ -889,7 +889,7 @@ interface CreateToolConfigWithSchema<T extends Record<string, any>> {
889
889
  /** Zod schema for validating tool arguments */
890
890
  schema: z.ZodSchema<T>;
891
891
  /** The function to execute (can be sync or async) */
892
- fn: (args: T, context?: ToolContext) => any;
892
+ fn: (args: T, context: ToolContext) => any;
893
893
  /** Whether the tool is a long running operation */
894
894
  isLongRunning?: boolean;
895
895
  /** Whether the tool execution should be retried on failure */
@@ -906,7 +906,7 @@ interface CreateToolConfigWithoutSchema {
906
906
  /** A description of what the tool does */
907
907
  description: string;
908
908
  /** The function to execute (can be sync or async) */
909
- fn: (args: Record<string, never>, context?: ToolContext) => any;
909
+ fn: (args: Record<string, never>, context: ToolContext) => any;
910
910
  /** Whether the tool is a long running operation */
911
911
  isLongRunning?: boolean;
912
912
  /** Whether the tool execution should be retried on failure */
package/dist/index.js CHANGED
@@ -3879,9 +3879,7 @@ var CreatedTool = class extends BaseTool {
3879
3879
  async runAsync(args, context) {
3880
3880
  try {
3881
3881
  const validatedArgs = this.schema.parse(args);
3882
- const result = await Promise.resolve(
3883
- this.func.length > 1 ? this.func(validatedArgs, context) : this.func(validatedArgs)
3884
- );
3882
+ const result = await Promise.resolve(this.func(validatedArgs, context));
3885
3883
  return _nullishCoalesce(result, () => ( {}));
3886
3884
  } catch (error) {
3887
3885
  if (error instanceof z.ZodError) {
package/dist/index.mjs CHANGED
@@ -3879,9 +3879,7 @@ var CreatedTool = class extends BaseTool {
3879
3879
  async runAsync(args, context) {
3880
3880
  try {
3881
3881
  const validatedArgs = this.schema.parse(args);
3882
- const result = await Promise.resolve(
3883
- this.func.length > 1 ? this.func(validatedArgs, context) : this.func(validatedArgs)
3884
- );
3882
+ const result = await Promise.resolve(this.func(validatedArgs, context));
3885
3883
  return result ?? {};
3886
3884
  } catch (error) {
3887
3885
  if (error instanceof z.ZodError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqai/adk",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
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",