@iqai/adk 0.1.16 → 0.1.18
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 +12 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/index.mjs +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @iqai/adk
|
|
2
2
|
|
|
3
|
+
## 0.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a73eee4: Update create tool to always get tool context
|
|
8
|
+
|
|
9
|
+
## 0.1.17
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 12b0f37: Resolved a critical performance issue in `createTool` that could cause the TypeScript Language Server to crash. This change is non-breaking.
|
|
14
|
+
|
|
3
15
|
## 0.1.16
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -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
|
|
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
|
@@ -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
|
|
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) {
|