@agentforge/core 0.4.0 → 0.4.1

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 CHANGED
@@ -416,11 +416,13 @@ function createTool(metadata, schema, execute) {
416
416
  ${errors}`);
417
417
  }
418
418
  validateSchemaDescriptions(schema);
419
- return {
419
+ const tool = {
420
420
  metadata: metadataResult.data,
421
421
  schema,
422
422
  execute
423
423
  };
424
+ tool.invoke = execute;
425
+ return tool;
424
426
  }
425
427
  function createToolUnsafe(metadata, schema, execute) {
426
428
  const metadataResult = validateToolMetadata(metadata);
@@ -429,11 +431,13 @@ function createToolUnsafe(metadata, schema, execute) {
429
431
  throw new Error(`Invalid tool metadata:
430
432
  ${errors}`);
431
433
  }
432
- return {
434
+ const tool = {
433
435
  metadata: metadataResult.data,
434
436
  schema,
435
437
  execute
436
438
  };
439
+ tool.invoke = execute;
440
+ return tool;
437
441
  }
438
442
  function validateTool(tool) {
439
443
  const errors = [];
package/dist/index.d.cts CHANGED
@@ -319,6 +319,20 @@ interface Tool<TInput = unknown, TOutput = unknown> {
319
319
  * before this function is called.
320
320
  */
321
321
  execute: (input: TInput) => Promise<TOutput>;
322
+ /**
323
+ * LangChain-compatible alias for execute
324
+ *
325
+ * This allows developers familiar with LangChain to use .invoke()
326
+ * instead of .execute(). Both methods do exactly the same thing.
327
+ *
328
+ * @example
329
+ * ```ts
330
+ * // Both of these work:
331
+ * const result1 = await tool.execute({ input: 'hello' });
332
+ * const result2 = await tool.invoke({ input: 'hello' });
333
+ * ```
334
+ */
335
+ invoke?: (input: TInput) => Promise<TOutput>;
322
336
  }
323
337
 
324
338
  /**
package/dist/index.d.ts CHANGED
@@ -319,6 +319,20 @@ interface Tool<TInput = unknown, TOutput = unknown> {
319
319
  * before this function is called.
320
320
  */
321
321
  execute: (input: TInput) => Promise<TOutput>;
322
+ /**
323
+ * LangChain-compatible alias for execute
324
+ *
325
+ * This allows developers familiar with LangChain to use .invoke()
326
+ * instead of .execute(). Both methods do exactly the same thing.
327
+ *
328
+ * @example
329
+ * ```ts
330
+ * // Both of these work:
331
+ * const result1 = await tool.execute({ input: 'hello' });
332
+ * const result2 = await tool.invoke({ input: 'hello' });
333
+ * ```
334
+ */
335
+ invoke?: (input: TInput) => Promise<TOutput>;
322
336
  }
323
337
 
324
338
  /**
package/dist/index.js CHANGED
@@ -273,11 +273,13 @@ function createTool(metadata, schema, execute) {
273
273
  ${errors}`);
274
274
  }
275
275
  validateSchemaDescriptions(schema);
276
- return {
276
+ const tool = {
277
277
  metadata: metadataResult.data,
278
278
  schema,
279
279
  execute
280
280
  };
281
+ tool.invoke = execute;
282
+ return tool;
281
283
  }
282
284
  function createToolUnsafe(metadata, schema, execute) {
283
285
  const metadataResult = validateToolMetadata(metadata);
@@ -286,11 +288,13 @@ function createToolUnsafe(metadata, schema, execute) {
286
288
  throw new Error(`Invalid tool metadata:
287
289
  ${errors}`);
288
290
  }
289
- return {
291
+ const tool = {
290
292
  metadata: metadataResult.data,
291
293
  schema,
292
294
  execute
293
295
  };
296
+ tool.invoke = execute;
297
+ return tool;
294
298
  }
295
299
  function validateTool(tool) {
296
300
  const errors = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Core abstractions for AgentForge - production-ready deep agents framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -16,6 +16,17 @@
16
16
  "files": [
17
17
  "dist"
18
18
  ],
19
+ "scripts": {
20
+ "build": "tsup src/index.ts --format esm,cjs --dts --clean",
21
+ "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
22
+ "test": "vitest",
23
+ "test:coverage": "vitest --coverage",
24
+ "typecheck": "tsc --noEmit",
25
+ "lint": "eslint src",
26
+ "lint:fix": "eslint src --fix",
27
+ "format": "prettier --write \"src/**/*.ts\"",
28
+ "clean": "rm -rf dist *.tsbuildinfo"
29
+ },
19
30
  "keywords": [
20
31
  "agents",
21
32
  "ai",
@@ -53,16 +64,5 @@
53
64
  },
54
65
  "dependencies": {
55
66
  "zod-to-json-schema": "^3.25.0"
56
- },
57
- "scripts": {
58
- "build": "tsup src/index.ts --format esm,cjs --dts --clean",
59
- "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
60
- "test": "vitest",
61
- "test:coverage": "vitest --coverage",
62
- "typecheck": "tsc --noEmit",
63
- "lint": "eslint src",
64
- "lint:fix": "eslint src --fix",
65
- "format": "prettier --write \"src/**/*.ts\"",
66
- "clean": "rm -rf dist *.tsbuildinfo"
67
67
  }
68
- }
68
+ }
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Tom Van Schoor
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-