@agentforge/tools 0.17.2 → 0.18.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@agentforge/tools)](https://www.npmjs.com/package/@agentforge/tools)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
7
- [![License](https://img.shields.io/badge/license-MIT-green)](../../LICENSE)
7
+ [![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/TVScoundrel/agentforge/blob/main/LICENSE)
8
8
 
9
9
  ## Status: Production Ready & Published
10
10
 
@@ -170,12 +170,56 @@ Tools for data processing and transformation.
170
170
  - **`neo4jCreateNodeWithEmbedding`** - Create nodes with automatic embeddings
171
171
 
172
172
  #### Relational Database Tools
173
- - **`relationalQuery`** - Execute raw SQL with vendor-aware connections
174
- - **`relationalSelect`** - Build and execute SELECT queries
175
- - **`relationalInsert`** - Insert rows into relational tables
176
- - **`relationalUpdate`** - Update rows in relational tables
177
- - **`relationalDelete`** - Delete rows from relational tables
178
- - **`relationalGetSchema`** - Inspect relational database schema metadata
173
+ - **`createRelationalToolSet()`** - Configure six credential-free Tools around one owned database session or pool
174
+ - **`relationalQuery`** - Deprecated credential-bearing Query compatibility Tool
175
+ - **`relationalSelect`** - Deprecated credential-bearing Select compatibility Tool
176
+ - **`relationalInsert`** - Deprecated credential-bearing Insert compatibility Tool
177
+ - **`relationalUpdate`** - Deprecated credential-bearing Update compatibility Tool
178
+ - **`relationalDelete`** - Deprecated credential-bearing Delete compatibility Tool
179
+ - **`relationalGetSchema`** - Deprecated credential-bearing Get Schema compatibility Tool
180
+
181
+ Configure a Relational Tool Set once and dispose it explicitly when its Agent or
182
+ application lifecycle ends:
183
+
184
+ ```typescript
185
+ import { ToolRegistry } from '@agentforge/core';
186
+ import { createReActAgent } from '@agentforge/patterns';
187
+ import { createRelationalToolSet } from '@agentforge/tools';
188
+
189
+ const relational = createRelationalToolSet(
190
+ { vendor: 'postgresql', connection: process.env.DATABASE_URL! },
191
+ { prefix: 'app', schemaCacheTtlMs: 30_000 }
192
+ );
193
+
194
+ const registry = new ToolRegistry();
195
+ registry.registerMany(relational);
196
+ const agent = createReActAgent({ model, tools: [...relational] });
197
+
198
+ try {
199
+ await agent.invoke({ messages });
200
+ await relational.transaction(
201
+ async (tools) => tools.update.invoke({
202
+ table: 'jobs',
203
+ data: { status: 'complete' },
204
+ where: [{ column: 'id', operator: 'eq', value: 42 }],
205
+ }),
206
+ { timeoutMs: 15_000 }
207
+ );
208
+ relational.refreshSchema();
209
+ await relational.getSchema.invoke({ refreshCache: true });
210
+ } finally {
211
+ await relational.dispose();
212
+ }
213
+ ```
214
+
215
+ Use an explicit transaction timeout whenever Agent reasoning occurs inside the
216
+ callback, because the transaction retains its database connection and can hold
217
+ locks. PostgreSQL and MySQL transactions use a dedicated pooled connection; SQLite
218
+ transactions use the Tool Set's shared handle.
219
+ See the [Relational Tool Set migration guide](https://github.com/TVScoundrel/agentforge/blob/main/packages/tools/src/data/relational/docs/migrating-to-relational-tool-sets.md)
220
+ for migration mappings, prefixes, cache controls, transaction behavior, and the
221
+ compatibility timeline. The deprecated Tools remain available throughout the
222
+ current major release and become eligible for removal only in the next major release.
179
223
 
180
224
  ### File Tools (17 tools)
181
225