@primo-ai/tools 0.1.0

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/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @primo-ai/tools
2
+
3
+ Built-in tool implementations for AgentForge.
4
+
5
+ ## Overview
6
+
7
+ Provides ready-to-use tools that can be passed to any AgentForge agent. Tools follow the `Tool<TInput, TOutput>` interface from `@primo-ai/sdk`.
8
+
9
+ ## Available Tools
10
+
11
+ ### echo
12
+
13
+ Returns the input message unchanged. Useful for testing and debugging.
14
+
15
+ ```typescript
16
+ import { echoTool } from '@primo-ai/tools';
17
+ import { Agent } from '@primo-ai/core';
18
+
19
+ const agent = new Agent({
20
+ model: 'deepseek/deepseek-v4-flash',
21
+ tools: [echoTool],
22
+ });
23
+ ```
24
+
25
+ **Schema:** `{ message: string }`
26
+ **Output:** `string` (the input message)
27
+
28
+ ## Writing a Custom Tool
29
+
30
+ Tools use Zod schemas for input validation:
31
+
32
+ ```typescript
33
+ import { z } from 'zod';
34
+ import type { Tool } from '@primo-ai/sdk';
35
+
36
+ const myTool: Tool<{ query: string }, string> = {
37
+ name: 'search',
38
+ description: 'Search for information',
39
+ inputSchema: z.object({ query: z.string().describe('Search query') }),
40
+ execute: async ({ query }) => {
41
+ return `Results for: ${query}`;
42
+ },
43
+ };
44
+ ```
45
+
46
+ ## Dependencies
47
+
48
+ - `@primo-ai/sdk` -- `Tool` interface and type definitions
49
+ - `zod` -- Schema validation
package/dist/echo.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { Tool } from '@primo-ai/sdk';
2
+ export declare const echoTool: Tool<{
3
+ message: string;
4
+ }, string>;
5
+ //# sourceMappingURL=echo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.d.ts","sourceRoot":"","sources":["../src/echo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,IAAI,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAKtD,CAAC"}
package/dist/echo.js ADDED
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export const echoTool = {
3
+ name: 'echo',
4
+ description: 'Returns the input message unchanged. Useful for testing.',
5
+ inputSchema: z.object({ message: z.string() }),
6
+ execute: async ({ message }) => message,
7
+ };
8
+ //# sourceMappingURL=echo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.js","sourceRoot":"","sources":["../src/echo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,QAAQ,GAAsC;IACzD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,0DAA0D;IACvE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAC9C,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO;CACxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { echoTool } from './echo.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // @primo-ai/tools — Built-in tools
2
+ export { echoTool } from './echo.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@primo-ai/tools",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": ["dist"],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.build.json",
16
+ "test": "vitest run --passWithNoTests",
17
+ "check-types": "tsc --noEmit",
18
+ "lint": "eslint src __tests__"
19
+ },
20
+ "devDependencies": {
21
+ "@primo-ai/sdk": "workspace:*",
22
+ "typescript": "^5.7.3",
23
+ "vitest": "^3.0.5"
24
+ },
25
+ "dependencies": {
26
+ "zod": "^4.4.3"
27
+ }
28
+ }