@agentforge/tools 0.9.1 → 0.10.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @agentforge/tools
2
2
 
3
- > Production-ready tools collection for AgentForge - 74 tools for web, data, file, utility, and agent operations
3
+ > Production-ready tools collection for AgentForge - 81 tools for web, data, file, utility, and agent operations
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/)
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## 🎉 Status: Production Ready & Published
10
10
 
11
- **74 production-ready tools** | **Full TypeScript support** | **Comprehensive documentation** | **LangChain compatible**
11
+ **81 production-ready tools** | **Full TypeScript support** | **Comprehensive documentation** | **LangChain compatible**
12
12
 
13
13
  ## 📦 Installation
14
14
 
@@ -22,9 +22,9 @@ yarn add @agentforge/tools
22
22
 
23
23
  ## 🎯 Overview
24
24
 
25
- This package provides **74 ready-to-use tools** organized into 5 categories:
25
+ This package provides **81 ready-to-use tools** organized into 5 categories:
26
26
 
27
- - **🌐 Web Tools** (15 tools) - HTTP requests, web search, web scraping, HTML parsing, URL manipulation, Slack integration
27
+ - **🌐 Web Tools** (22 tools) - HTTP requests, web search, web scraping, HTML parsing, URL manipulation, Slack integration, Confluence integration
28
28
  - **📊 Data Tools** (18 tools) - JSON, CSV, XML processing and data transformation
29
29
  - **📁 File Tools** (18 tools) - File operations, directory management, path utilities
30
30
  - **🔧 Utility Tools** (22 tools) - Date/time, strings, math, validation
@@ -69,9 +69,9 @@ const result = await calculator.execute({
69
69
 
70
70
  ## 📚 Tool Categories
71
71
 
72
- ### 🌐 Web Tools (11 tools)
72
+ ### 🌐 Web Tools (22 tools)
73
73
 
74
- Tools for web interactions and HTTP operations.
74
+ Tools for web interactions, HTTP operations, and integrations.
75
75
 
76
76
  #### Web Search
77
77
  - **`webSearch`** - Search the web using DuckDuckGo (free) or Serper API (optional premium)
@@ -103,6 +103,16 @@ Tools for web interactions and HTTP operations.
103
103
  - **`getSlackMessages`** - Read message history from channels
104
104
  - **`createSlackTools()`** - Factory function for custom Slack configuration
105
105
 
106
+ #### Confluence Tools
107
+ - **`searchConfluence`** - Search Confluence using CQL (Confluence Query Language)
108
+ - **`getConfluencePage`** - Get full page content by ID
109
+ - **`listConfluenceSpaces`** - List all available Confluence spaces
110
+ - **`getSpacePages`** - Get all pages from a specific space
111
+ - **`createConfluencePage`** - Create new Confluence pages
112
+ - **`updateConfluencePage`** - Update existing Confluence pages
113
+ - **`archiveConfluencePage`** - Archive pages (move to trash)
114
+ - **`createConfluenceTools()`** - Factory function for custom Confluence configuration
115
+
106
116
  ### 📊 Data Tools (18 tools)
107
117
 
108
118
  Tools for data processing and transformation.
@@ -359,6 +369,99 @@ SLACK_BOT_TOKEN=xoxb-your-bot-token
359
369
  4. Install app to workspace
360
370
  5. Copy the token (starts with `xoxb-` for bot or `xoxp-` for user)
361
371
 
372
+ ### Confluence Integration Example
373
+
374
+ ```typescript
375
+ import {
376
+ searchConfluence,
377
+ getConfluencePage,
378
+ listConfluenceSpaces,
379
+ getSpacePages,
380
+ createConfluencePage,
381
+ updateConfluencePage,
382
+ archiveConfluencePage,
383
+ createConfluenceTools
384
+ } from '@agentforge/tools';
385
+
386
+ // Search for pages
387
+ const searchResults = await searchConfluence.execute({
388
+ cql: 'type=page AND space=DOCS',
389
+ limit: 10
390
+ });
391
+ console.log(`Found ${searchResults.results.length} pages`);
392
+
393
+ // Get a specific page
394
+ const page = await getConfluencePage.execute({
395
+ page_id: '123456'
396
+ });
397
+ console.log(`Page title: ${page.page.title}`);
398
+ console.log(`Content: ${page.page.content}`);
399
+
400
+ // List all spaces
401
+ const spaces = await listConfluenceSpaces.execute({
402
+ limit: 50
403
+ });
404
+ console.log(`Found ${spaces.spaces.length} spaces`);
405
+
406
+ // Get pages from a space
407
+ const spacePages = await getSpacePages.execute({
408
+ space_key: 'DOCS',
409
+ limit: 25
410
+ });
411
+ console.log(`Found ${spacePages.pages.length} pages in DOCS space`);
412
+
413
+ // Create a new page
414
+ const newPage = await createConfluencePage.execute({
415
+ space_key: 'DOCS',
416
+ title: 'My New Page',
417
+ content: '<p>This is the page content in HTML format</p>',
418
+ parent_page_id: '789012' // Optional parent page
419
+ });
420
+ console.log(`Created page with ID: ${newPage.page.id}`);
421
+
422
+ // Update an existing page
423
+ const updated = await updateConfluencePage.execute({
424
+ page_id: newPage.page.id,
425
+ title: 'Updated Page Title',
426
+ content: '<p>Updated content</p>'
427
+ });
428
+ console.log(`Updated to version ${updated.page.version}`);
429
+
430
+ // Archive a page
431
+ const archived = await archiveConfluencePage.execute({
432
+ page_id: newPage.page.id,
433
+ reason: 'No longer needed'
434
+ });
435
+ console.log(archived.archived.note);
436
+
437
+ // Custom configuration (for multiple Confluence instances)
438
+ const customTools = createConfluenceTools({
439
+ apiKey: 'your-api-key',
440
+ email: 'your-email@example.com',
441
+ siteUrl: 'https://your-domain.atlassian.net'
442
+ });
443
+
444
+ await customTools.searchConfluence.execute({
445
+ cql: 'type=page',
446
+ limit: 5
447
+ });
448
+ ```
449
+
450
+ **Environment Setup:**
451
+ ```bash
452
+ # Add to your .env file
453
+ ATLASSIAN_API_KEY=your-api-key-here
454
+ ATLASSIAN_EMAIL=your-email@example.com
455
+ ATLASSIAN_SITE_URL=https://your-domain.atlassian.net
456
+ ```
457
+
458
+ **Getting a Confluence API Key:**
459
+ 1. Go to [Atlassian Account Settings](https://id.atlassian.com/manage-profile/security/api-tokens)
460
+ 2. Click "Create API token"
461
+ 3. Give it a label (e.g., "AgentForge")
462
+ 4. Copy the generated token
463
+ 5. Use your Atlassian email and the API token for authentication
464
+
362
465
  ### Data Processing Example
363
466
 
364
467
  ```typescript
@@ -594,13 +697,13 @@ pnpm lint
594
697
 
595
698
  ## 📊 Tool Statistics
596
699
 
597
- - **Total Tools**: 74
598
- - **Web Tools**: 15 (includes 4 Slack tools)
700
+ - **Total Tools**: 81
701
+ - **Web Tools**: 22 (includes 4 Slack tools + 7 Confluence tools)
599
702
  - **Data Tools**: 18
600
703
  - **File Tools**: 18
601
704
  - **Utility Tools**: 22
602
705
  - **Agent Tools**: 1
603
- - **Lines of Code**: ~3,200
706
+ - **Lines of Code**: ~4,000
604
707
  - **Full TypeScript Support**: ✅
605
708
  - **Zod Validation**: ✅
606
709
  - **LangChain Compatible**: ✅