@agentforge/cli 0.12.3 → 0.12.5
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/api/package.json +6 -6
- package/templates/api/src/routes/agent.ts +3 -2
- package/templates/api/src/routes/health.ts +1 -1
- package/templates/cli/package.json +6 -6
- package/templates/cli/src/commands/analyze.ts +2 -1
- package/templates/cli/src/commands/chat.ts +2 -1
- package/templates/full/package.json +2 -2
- package/templates/full/tests/example.test.ts +3 -3
- package/templates/minimal/package.json +4 -4
- package/templates/minimal/src/index.ts +2 -1
- package/templates/tool-multi/__tests__/index.test.ts +3 -3
package/package.json
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"description": "{{PROJECT_DESCRIPTION}}",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"types": "dist/
|
|
6
|
+
"main": "dist/server.js",
|
|
7
|
+
"types": "dist/server.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "tsx watch src/server.ts",
|
|
10
10
|
"build": "tsup",
|
|
11
11
|
"start": "node dist/server.js",
|
|
12
|
-
"test": "vitest",
|
|
13
|
-
"test:watch": "vitest --watch",
|
|
12
|
+
"test": "vitest run --passWithNoTests",
|
|
13
|
+
"test:watch": "vitest --watch --passWithNoTests",
|
|
14
14
|
"typecheck": "tsc --noEmit",
|
|
15
15
|
"lint": "eslint .",
|
|
16
16
|
"lint:fix": "eslint . --fix",
|
|
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.5",
|
|
21
|
+
"@agentforge/patterns": "^0.12.5",
|
|
22
22
|
"@langchain/core": "^1.1.17",
|
|
23
23
|
"@langchain/langgraph": "^1.1.2",
|
|
24
24
|
"@langchain/openai": "^1.2.3",
|
|
@@ -3,7 +3,7 @@ import { ChatOpenAI } from '@langchain/openai';
|
|
|
3
3
|
import { createReActAgent } from '@agentforge/patterns';
|
|
4
4
|
import { createLogger } from '@agentforge/core';
|
|
5
5
|
|
|
6
|
-
const router = Router();
|
|
6
|
+
const router: Router = Router();
|
|
7
7
|
const logger = createLogger('agent-router');
|
|
8
8
|
|
|
9
9
|
// Initialize the agent
|
|
@@ -33,7 +33,8 @@ router.post('/chat', async (req, res) => {
|
|
|
33
33
|
messages: [{ role: 'user', content: message }],
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const messages = result.messages as Array<{ content: string }>;
|
|
37
|
+
const lastMessage = messages[messages.length - 1];
|
|
37
38
|
const response = lastMessage?.content || 'No response';
|
|
38
39
|
|
|
39
40
|
res.json({
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"description": "{{PROJECT_DESCRIPTION}}",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/
|
|
7
|
-
"types": "dist/
|
|
6
|
+
"main": "dist/cli.js",
|
|
7
|
+
"types": "dist/cli.d.ts",
|
|
8
8
|
"bin": {
|
|
9
9
|
"{{PROJECT_NAME}}": "./dist/cli.js"
|
|
10
10
|
},
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"dev": "tsx watch src/cli.ts",
|
|
13
13
|
"build": "tsup",
|
|
14
14
|
"start": "node dist/cli.js",
|
|
15
|
-
"test": "vitest",
|
|
16
|
-
"test:watch": "vitest --watch",
|
|
15
|
+
"test": "vitest run --passWithNoTests",
|
|
16
|
+
"test:watch": "vitest --watch --passWithNoTests",
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"lint": "eslint .",
|
|
19
19
|
"lint:fix": "eslint . --fix",
|
|
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.5",
|
|
24
|
+
"@agentforge/patterns": "^0.12.5",
|
|
25
25
|
"@langchain/core": "^1.1.17",
|
|
26
26
|
"@langchain/langgraph": "^1.1.2",
|
|
27
27
|
"@langchain/openai": "^1.2.3",
|
|
@@ -40,7 +40,8 @@ export async function analyzeCommand(file: string, options: AnalyzeOptions) {
|
|
|
40
40
|
],
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const messages = result.messages as Array<{ content: string }>;
|
|
44
|
+
const lastMessage = messages[messages.length - 1];
|
|
44
45
|
const analysis = lastMessage?.content || 'No analysis available';
|
|
45
46
|
|
|
46
47
|
spinner.succeed('Analysis complete');
|
|
@@ -49,7 +49,8 @@ export async function chatCommand(options: ChatOptions) {
|
|
|
49
49
|
messages.push({ role: 'user', content: message });
|
|
50
50
|
|
|
51
51
|
const result = await agent.invoke({ messages });
|
|
52
|
-
const
|
|
52
|
+
const resultMessages = result.messages as Array<{ content: string }>;
|
|
53
|
+
const lastMessage = resultMessages[resultMessages.length - 1];
|
|
53
54
|
const response = lastMessage?.content || 'No response';
|
|
54
55
|
|
|
55
56
|
messages.push({ role: 'assistant', content: response });
|
|
@@ -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.5",
|
|
23
|
+
"@agentforge/patterns": "^0.12.5",
|
|
24
24
|
"@langchain/core": "^1.1.17",
|
|
25
25
|
"@langchain/langgraph": "^1.1.2",
|
|
26
26
|
"@langchain/openai": "^1.2.3",
|
|
@@ -9,9 +9,9 @@ describe('Example Tool', () => {
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
it('should have correct metadata', () => {
|
|
12
|
-
expect(exampleTool.name).toBe('example-tool');
|
|
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
|
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "tsx watch src/index.ts",
|
|
10
10
|
"build": "tsup",
|
|
11
|
-
"test": "vitest",
|
|
12
|
-
"test:watch": "vitest --watch",
|
|
11
|
+
"test": "vitest run --passWithNoTests",
|
|
12
|
+
"test:watch": "vitest --watch --passWithNoTests",
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
14
|
"lint": "eslint .",
|
|
15
15
|
"lint:fix": "eslint . --fix",
|
|
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.5",
|
|
20
|
+
"@agentforge/patterns": "^0.12.5",
|
|
21
21
|
"@langchain/core": "^1.1.17",
|
|
22
22
|
"@langchain/langgraph": "^1.1.2",
|
|
23
23
|
"@langchain/openai": "^1.2.3",
|
|
@@ -55,7 +55,8 @@ async function main() {
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
console.log('\n✅ Agent response:');
|
|
58
|
-
const
|
|
58
|
+
const messages = result.messages as Array<{ content: string }>;
|
|
59
|
+
const lastMessage = messages[messages.length - 1];
|
|
59
60
|
console.log(lastMessage?.content || 'No response');
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -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 () => {
|