@agentforge/cli 0.12.2 → 0.12.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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/api/eslint.config.js +18 -0
- package/templates/api/package.json +4 -2
- package/templates/api/tsup.config.ts +15 -0
- package/templates/cli/eslint.config.js +18 -0
- package/templates/cli/package.json +4 -2
- package/templates/cli/tsup.config.ts +15 -0
- package/templates/full/eslint.config.js +18 -0
- package/templates/full/package.json +4 -2
- package/templates/full/src/index.ts +2 -1
- package/templates/full/src/tools/example.ts +1 -1
- package/templates/full/tests/example.test.ts +3 -3
- package/templates/full/tsup.config.ts +15 -0
- package/templates/minimal/eslint.config.js +18 -0
- package/templates/minimal/package.json +4 -2
- package/templates/minimal/tsup.config.ts +15 -0
- package/templates/tool-multi/__tests__/index.test.ts +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
ignores: ['dist/**', 'node_modules/**', '*.config.ts', '*.config.js'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
13
|
+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
14
|
+
'no-console': 'off',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"format": "prettier --write ."
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@agentforge/core": "^0.12.
|
|
21
|
-
"@agentforge/patterns": "^0.12.
|
|
20
|
+
"@agentforge/core": "^0.12.4",
|
|
21
|
+
"@agentforge/patterns": "^0.12.4",
|
|
22
22
|
"@langchain/core": "^1.1.17",
|
|
23
23
|
"@langchain/langgraph": "^1.1.2",
|
|
24
24
|
"@langchain/openai": "^1.2.3",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"cors": "^2.8.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@eslint/js": "^9.17.0",
|
|
32
33
|
"@types/node": "^22.10.2",
|
|
33
34
|
"@types/express": "^5.0.0",
|
|
34
35
|
"@types/cors": "^2.8.17",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"tsup": "^8.3.5",
|
|
38
39
|
"tsx": "^4.21.0",
|
|
39
40
|
"typescript": "^5.7.2",
|
|
41
|
+
"typescript-eslint": "^8.19.1",
|
|
40
42
|
"vitest": "^2.1.8"
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/server.ts'],
|
|
5
|
+
format: ['esm'],
|
|
6
|
+
dts: true,
|
|
7
|
+
splitting: false,
|
|
8
|
+
sourcemap: true,
|
|
9
|
+
clean: true,
|
|
10
|
+
treeshake: true,
|
|
11
|
+
minify: false,
|
|
12
|
+
target: 'node18',
|
|
13
|
+
outDir: 'dist',
|
|
14
|
+
});
|
|
15
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
ignores: ['dist/**', 'node_modules/**', '*.config.ts', '*.config.js'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
13
|
+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
14
|
+
'no-console': 'off',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"format": "prettier --write ."
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agentforge/core": "^0.12.
|
|
24
|
-
"@agentforge/patterns": "^0.12.
|
|
23
|
+
"@agentforge/core": "^0.12.4",
|
|
24
|
+
"@agentforge/patterns": "^0.12.4",
|
|
25
25
|
"@langchain/core": "^1.1.17",
|
|
26
26
|
"@langchain/langgraph": "^1.1.2",
|
|
27
27
|
"@langchain/openai": "^1.2.3",
|
|
@@ -34,12 +34,14 @@
|
|
|
34
34
|
"inquirer": "^12.3.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
+
"@eslint/js": "^9.17.0",
|
|
37
38
|
"@types/node": "^22.10.2",
|
|
38
39
|
"eslint": "^9.17.0",
|
|
39
40
|
"prettier": "^3.4.2",
|
|
40
41
|
"tsup": "^8.3.5",
|
|
41
42
|
"tsx": "^4.21.0",
|
|
42
43
|
"typescript": "^5.7.2",
|
|
44
|
+
"typescript-eslint": "^8.19.1",
|
|
43
45
|
"vitest": "^2.1.8"
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/cli.ts'],
|
|
5
|
+
format: ['esm'],
|
|
6
|
+
dts: true,
|
|
7
|
+
splitting: false,
|
|
8
|
+
sourcemap: true,
|
|
9
|
+
clean: true,
|
|
10
|
+
treeshake: true,
|
|
11
|
+
minify: false,
|
|
12
|
+
target: 'node18',
|
|
13
|
+
outDir: 'dist',
|
|
14
|
+
});
|
|
15
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
ignores: ['dist/**', 'node_modules/**', '*.config.ts', '*.config.js'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
13
|
+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
14
|
+
'no-console': 'off',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"clean": "rm -rf dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@agentforge/core": "^0.12.
|
|
23
|
-
"@agentforge/patterns": "^0.12.
|
|
22
|
+
"@agentforge/core": "^0.12.4",
|
|
23
|
+
"@agentforge/patterns": "^0.12.4",
|
|
24
24
|
"@langchain/core": "^1.1.17",
|
|
25
25
|
"@langchain/langgraph": "^1.1.2",
|
|
26
26
|
"@langchain/openai": "^1.2.3",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"dotenv": "^16.4.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@eslint/js": "^9.17.0",
|
|
32
33
|
"@types/node": "^22.10.2",
|
|
33
34
|
"@vitest/ui": "^2.1.8",
|
|
34
35
|
"eslint": "^9.17.0",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"tsup": "^8.3.5",
|
|
37
38
|
"tsx": "^4.21.0",
|
|
38
39
|
"typescript": "^5.7.2",
|
|
40
|
+
"typescript-eslint": "^8.19.1",
|
|
39
41
|
"vitest": "^2.1.8"
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -67,7 +67,8 @@ async function main() {
|
|
|
67
67
|
|
|
68
68
|
logger.info('✅ Agent completed');
|
|
69
69
|
console.log('\nFinal response:');
|
|
70
|
-
const
|
|
70
|
+
const messages = result.messages as Array<{ content: string }>;
|
|
71
|
+
const lastMessage = messages[messages.length - 1];
|
|
71
72
|
console.log(lastMessage?.content || 'No response');
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -5,7 +5,7 @@ import { toolBuilder, ToolCategory } from '@agentforge/core';
|
|
|
5
5
|
* Example tool that demonstrates the tool creation API
|
|
6
6
|
*/
|
|
7
7
|
export const exampleTool = toolBuilder()
|
|
8
|
-
.name('
|
|
8
|
+
.name('example-tool')
|
|
9
9
|
.description('An example tool that greets a user by name')
|
|
10
10
|
.category(ToolCategory.UTILITY)
|
|
11
11
|
.schema(
|
|
@@ -9,9 +9,9 @@ describe('Example Tool', () => {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('should have correct metadata', () => {
|
|
12
|
-
expect(exampleTool.name).toBe('
|
|
13
|
-
expect(exampleTool.description).toBeDefined();
|
|
14
|
-
expect(exampleTool.category).toBe('utility');
|
|
12
|
+
expect(exampleTool.metadata.name).toBe('example-tool');
|
|
13
|
+
expect(exampleTool.metadata.description).toBeDefined();
|
|
14
|
+
expect(exampleTool.metadata.category).toBe('utility');
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/index.ts'],
|
|
5
|
+
format: ['esm'],
|
|
6
|
+
dts: true,
|
|
7
|
+
splitting: false,
|
|
8
|
+
sourcemap: true,
|
|
9
|
+
clean: true,
|
|
10
|
+
treeshake: true,
|
|
11
|
+
minify: false,
|
|
12
|
+
target: 'node18',
|
|
13
|
+
outDir: 'dist',
|
|
14
|
+
});
|
|
15
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
ignores: ['dist/**', 'node_modules/**', '*.config.ts', '*.config.js'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
13
|
+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
|
14
|
+
'no-console': 'off',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"format": "prettier --write ."
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@agentforge/core": "^0.12.
|
|
20
|
-
"@agentforge/patterns": "^0.12.
|
|
19
|
+
"@agentforge/core": "^0.12.4",
|
|
20
|
+
"@agentforge/patterns": "^0.12.4",
|
|
21
21
|
"@langchain/core": "^1.1.17",
|
|
22
22
|
"@langchain/langgraph": "^1.1.2",
|
|
23
23
|
"@langchain/openai": "^1.2.3",
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
"zod": "^3.24.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@eslint/js": "^9.17.0",
|
|
29
30
|
"@types/node": "^22.10.2",
|
|
30
31
|
"eslint": "^9.17.0",
|
|
31
32
|
"prettier": "^3.4.2",
|
|
32
33
|
"tsup": "^8.3.5",
|
|
33
34
|
"tsx": "^4.21.0",
|
|
34
35
|
"typescript": "^5.7.2",
|
|
36
|
+
"typescript-eslint": "^8.19.1",
|
|
35
37
|
"vitest": "^2.1.8"
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/index.ts'],
|
|
5
|
+
format: ['esm'],
|
|
6
|
+
dts: true,
|
|
7
|
+
splitting: false,
|
|
8
|
+
sourcemap: true,
|
|
9
|
+
clean: true,
|
|
10
|
+
treeshake: true,
|
|
11
|
+
minify: false,
|
|
12
|
+
target: 'node18',
|
|
13
|
+
outDir: 'dist',
|
|
14
|
+
});
|
|
15
|
+
|
|
@@ -3,9 +3,9 @@ import { {{TOOL_NAME_CAMEL}}Tool } from '../index.js';
|
|
|
3
3
|
|
|
4
4
|
describe('{{TOOL_NAME_PASCAL}} Tool', () => {
|
|
5
5
|
it('should have correct metadata', () => {
|
|
6
|
-
expect({{TOOL_NAME_CAMEL}}Tool.name).toBe('{{TOOL_NAME}}');
|
|
7
|
-
expect({{TOOL_NAME_CAMEL}}Tool.description).toBe('{{TOOL_DESCRIPTION}}');
|
|
8
|
-
expect({{TOOL_NAME_CAMEL}}Tool.category).toBe('{{TOOL_CATEGORY}}');
|
|
6
|
+
expect({{TOOL_NAME_CAMEL}}Tool.metadata.name).toBe('{{TOOL_NAME}}');
|
|
7
|
+
expect({{TOOL_NAME_CAMEL}}Tool.metadata.description).toBe('{{TOOL_DESCRIPTION}}');
|
|
8
|
+
expect({{TOOL_NAME_CAMEL}}Tool.metadata.category).toBe('{{TOOL_CATEGORY}}');
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('should validate input schema', async () => {
|