@agentforge/tools 0.8.1 → 0.9.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 +80 -7
- package/dist/index.cjs +387 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +296 -2
- package/dist/index.d.ts +296 -2
- package/dist/index.js +382 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _agentforge_core from '@agentforge/core';
|
|
2
|
-
import { HumanRequestPriority } from '@agentforge/core';
|
|
2
|
+
import { LogLevel, Tool, HumanRequestPriority } from '@agentforge/core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -466,6 +466,300 @@ declare const webSearch: _agentforge_core.Tool<{
|
|
|
466
466
|
preferSerper?: boolean | undefined;
|
|
467
467
|
}, WebSearchOutput>;
|
|
468
468
|
|
|
469
|
+
/**
|
|
470
|
+
* Slack Integration Tools
|
|
471
|
+
*
|
|
472
|
+
* Tools for interacting with Slack workspaces - send messages, notifications,
|
|
473
|
+
* list channels, and read message history.
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```ts
|
|
477
|
+
* // Using default tools (reads from env vars)
|
|
478
|
+
* import { sendSlackMessage } from '@agentforge/tools';
|
|
479
|
+
*
|
|
480
|
+
* const result = await sendSlackMessage.execute({
|
|
481
|
+
* channel: 'general',
|
|
482
|
+
* message: 'Hello from AgentForge!'
|
|
483
|
+
* });
|
|
484
|
+
*
|
|
485
|
+
* // Using factory function with custom config
|
|
486
|
+
* import { createSlackTools } from '@agentforge/tools';
|
|
487
|
+
*
|
|
488
|
+
* const slackTools = createSlackTools({
|
|
489
|
+
* token: 'xoxb-your-bot-token',
|
|
490
|
+
* botName: 'My Custom Bot'
|
|
491
|
+
* });
|
|
492
|
+
*
|
|
493
|
+
* const result = await slackTools.sendMessage.execute({
|
|
494
|
+
* channel: 'general',
|
|
495
|
+
* message: 'Hello!'
|
|
496
|
+
* });
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Configuration options for Slack tools
|
|
502
|
+
*/
|
|
503
|
+
interface SlackToolsConfig {
|
|
504
|
+
/**
|
|
505
|
+
* Slack API token (bot or user token)
|
|
506
|
+
* If not provided, will fall back to SLACK_USER_TOKEN or SLACK_BOT_TOKEN env vars
|
|
507
|
+
*/
|
|
508
|
+
token?: string;
|
|
509
|
+
/**
|
|
510
|
+
* Custom bot name to display in Slack
|
|
511
|
+
* @default 'AgentForge Bot'
|
|
512
|
+
*/
|
|
513
|
+
botName?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Custom bot icon emoji
|
|
516
|
+
* @default ':robot_face:'
|
|
517
|
+
*/
|
|
518
|
+
botIcon?: string;
|
|
519
|
+
/**
|
|
520
|
+
* Log level for Slack tools
|
|
521
|
+
* @default LogLevel.INFO
|
|
522
|
+
*/
|
|
523
|
+
logLevel?: LogLevel;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Send a message to a Slack channel
|
|
527
|
+
*/
|
|
528
|
+
declare const sendSlackMessage: Tool<{
|
|
529
|
+
message: string;
|
|
530
|
+
channel: string;
|
|
531
|
+
}, {
|
|
532
|
+
success: boolean;
|
|
533
|
+
data?: {
|
|
534
|
+
channel: string | undefined;
|
|
535
|
+
message: string;
|
|
536
|
+
timestamp: string | undefined;
|
|
537
|
+
message_id: string | undefined;
|
|
538
|
+
} | undefined;
|
|
539
|
+
error?: string;
|
|
540
|
+
}>;
|
|
541
|
+
/**
|
|
542
|
+
* Send a notification to a Slack channel (with @mention support)
|
|
543
|
+
*/
|
|
544
|
+
declare const notifySlack: Tool<{
|
|
545
|
+
message: string;
|
|
546
|
+
channel: string;
|
|
547
|
+
mentions?: string[] | undefined;
|
|
548
|
+
}, {
|
|
549
|
+
success: boolean;
|
|
550
|
+
data?: {
|
|
551
|
+
channel: string | undefined;
|
|
552
|
+
message: string;
|
|
553
|
+
mentions: string[];
|
|
554
|
+
timestamp: string | undefined;
|
|
555
|
+
notification_id: string | undefined;
|
|
556
|
+
} | undefined;
|
|
557
|
+
error?: string;
|
|
558
|
+
}>;
|
|
559
|
+
/**
|
|
560
|
+
* Get list of available Slack channels
|
|
561
|
+
*/
|
|
562
|
+
declare const getSlackChannels: Tool<{
|
|
563
|
+
include_private?: boolean | undefined;
|
|
564
|
+
}, {
|
|
565
|
+
success: boolean;
|
|
566
|
+
data?: {
|
|
567
|
+
count: number;
|
|
568
|
+
channels: {
|
|
569
|
+
id: string | undefined;
|
|
570
|
+
name: string | undefined;
|
|
571
|
+
is_private: boolean;
|
|
572
|
+
num_members: number;
|
|
573
|
+
}[];
|
|
574
|
+
} | undefined;
|
|
575
|
+
error?: string;
|
|
576
|
+
}>;
|
|
577
|
+
/**
|
|
578
|
+
* Get message history from a Slack channel
|
|
579
|
+
*/
|
|
580
|
+
declare const getSlackMessages: Tool<{
|
|
581
|
+
channel: string;
|
|
582
|
+
limit?: number | undefined;
|
|
583
|
+
}, {
|
|
584
|
+
success: boolean;
|
|
585
|
+
data?: {
|
|
586
|
+
channel: string;
|
|
587
|
+
count: number;
|
|
588
|
+
messages: {
|
|
589
|
+
user: string;
|
|
590
|
+
text: string;
|
|
591
|
+
timestamp: string | undefined;
|
|
592
|
+
thread_ts: string | undefined;
|
|
593
|
+
type: string | undefined;
|
|
594
|
+
subtype: string | undefined;
|
|
595
|
+
}[];
|
|
596
|
+
} | undefined;
|
|
597
|
+
error?: string;
|
|
598
|
+
}>;
|
|
599
|
+
/**
|
|
600
|
+
* Create Slack tools with custom configuration
|
|
601
|
+
*
|
|
602
|
+
* This factory function allows you to create Slack tools with custom configuration,
|
|
603
|
+
* such as providing a token programmatically instead of using environment variables.
|
|
604
|
+
*
|
|
605
|
+
* @param config - Configuration options for Slack tools
|
|
606
|
+
* @returns Object containing all 4 Slack tools configured with the provided options
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* ```ts
|
|
610
|
+
* // Create tools with custom token
|
|
611
|
+
* const slackTools = createSlackTools({
|
|
612
|
+
* token: 'xoxb-your-bot-token',
|
|
613
|
+
* botName: 'My Custom Bot',
|
|
614
|
+
* botIcon: ':rocket:'
|
|
615
|
+
* });
|
|
616
|
+
*
|
|
617
|
+
* // Use the tools
|
|
618
|
+
* await slackTools.sendMessage.execute({
|
|
619
|
+
* channel: 'general',
|
|
620
|
+
* message: 'Hello!'
|
|
621
|
+
* });
|
|
622
|
+
*
|
|
623
|
+
* // Or use with an agent
|
|
624
|
+
* const agent = createReActAgent({
|
|
625
|
+
* llm,
|
|
626
|
+
* tools: [
|
|
627
|
+
* slackTools.sendMessage,
|
|
628
|
+
* slackTools.notify,
|
|
629
|
+
* slackTools.getChannels,
|
|
630
|
+
* slackTools.getMessages
|
|
631
|
+
* ]
|
|
632
|
+
* });
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
declare function createSlackTools(config?: SlackToolsConfig): {
|
|
636
|
+
sendMessage: Tool<{
|
|
637
|
+
message: string;
|
|
638
|
+
channel: string;
|
|
639
|
+
}, {
|
|
640
|
+
success: boolean;
|
|
641
|
+
data?: {
|
|
642
|
+
channel: string | undefined;
|
|
643
|
+
message: string;
|
|
644
|
+
timestamp: string | undefined;
|
|
645
|
+
message_id: string | undefined;
|
|
646
|
+
} | undefined;
|
|
647
|
+
error?: string;
|
|
648
|
+
}>;
|
|
649
|
+
notify: Tool<{
|
|
650
|
+
message: string;
|
|
651
|
+
channel: string;
|
|
652
|
+
mentions?: string[] | undefined;
|
|
653
|
+
}, {
|
|
654
|
+
success: boolean;
|
|
655
|
+
data?: {
|
|
656
|
+
channel: string | undefined;
|
|
657
|
+
message: string;
|
|
658
|
+
mentions: string[];
|
|
659
|
+
timestamp: string | undefined;
|
|
660
|
+
notification_id: string | undefined;
|
|
661
|
+
} | undefined;
|
|
662
|
+
error?: string;
|
|
663
|
+
}>;
|
|
664
|
+
getChannels: Tool<{
|
|
665
|
+
include_private?: boolean | undefined;
|
|
666
|
+
}, {
|
|
667
|
+
success: boolean;
|
|
668
|
+
data?: {
|
|
669
|
+
count: number;
|
|
670
|
+
channels: {
|
|
671
|
+
id: string | undefined;
|
|
672
|
+
name: string | undefined;
|
|
673
|
+
is_private: boolean;
|
|
674
|
+
num_members: number;
|
|
675
|
+
}[];
|
|
676
|
+
} | undefined;
|
|
677
|
+
error?: string;
|
|
678
|
+
}>;
|
|
679
|
+
getMessages: Tool<{
|
|
680
|
+
channel: string;
|
|
681
|
+
limit?: number | undefined;
|
|
682
|
+
}, {
|
|
683
|
+
success: boolean;
|
|
684
|
+
data?: {
|
|
685
|
+
channel: string;
|
|
686
|
+
count: number;
|
|
687
|
+
messages: {
|
|
688
|
+
user: string;
|
|
689
|
+
text: string;
|
|
690
|
+
timestamp: string | undefined;
|
|
691
|
+
thread_ts: string | undefined;
|
|
692
|
+
type: string | undefined;
|
|
693
|
+
subtype: string | undefined;
|
|
694
|
+
}[];
|
|
695
|
+
} | undefined;
|
|
696
|
+
error?: string;
|
|
697
|
+
}>;
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* Export all Slack tools as an array for convenience
|
|
701
|
+
* These use environment variables for configuration (SLACK_USER_TOKEN or SLACK_BOT_TOKEN)
|
|
702
|
+
*/
|
|
703
|
+
declare const slackTools: (Tool<{
|
|
704
|
+
message: string;
|
|
705
|
+
channel: string;
|
|
706
|
+
}, {
|
|
707
|
+
success: boolean;
|
|
708
|
+
data?: {
|
|
709
|
+
channel: string | undefined;
|
|
710
|
+
message: string;
|
|
711
|
+
timestamp: string | undefined;
|
|
712
|
+
message_id: string | undefined;
|
|
713
|
+
} | undefined;
|
|
714
|
+
error?: string;
|
|
715
|
+
}> | Tool<{
|
|
716
|
+
message: string;
|
|
717
|
+
channel: string;
|
|
718
|
+
mentions?: string[] | undefined;
|
|
719
|
+
}, {
|
|
720
|
+
success: boolean;
|
|
721
|
+
data?: {
|
|
722
|
+
channel: string | undefined;
|
|
723
|
+
message: string;
|
|
724
|
+
mentions: string[];
|
|
725
|
+
timestamp: string | undefined;
|
|
726
|
+
notification_id: string | undefined;
|
|
727
|
+
} | undefined;
|
|
728
|
+
error?: string;
|
|
729
|
+
}> | Tool<{
|
|
730
|
+
include_private?: boolean | undefined;
|
|
731
|
+
}, {
|
|
732
|
+
success: boolean;
|
|
733
|
+
data?: {
|
|
734
|
+
count: number;
|
|
735
|
+
channels: {
|
|
736
|
+
id: string | undefined;
|
|
737
|
+
name: string | undefined;
|
|
738
|
+
is_private: boolean;
|
|
739
|
+
num_members: number;
|
|
740
|
+
}[];
|
|
741
|
+
} | undefined;
|
|
742
|
+
error?: string;
|
|
743
|
+
}> | Tool<{
|
|
744
|
+
channel: string;
|
|
745
|
+
limit?: number | undefined;
|
|
746
|
+
}, {
|
|
747
|
+
success: boolean;
|
|
748
|
+
data?: {
|
|
749
|
+
channel: string;
|
|
750
|
+
count: number;
|
|
751
|
+
messages: {
|
|
752
|
+
user: string;
|
|
753
|
+
text: string;
|
|
754
|
+
timestamp: string | undefined;
|
|
755
|
+
thread_ts: string | undefined;
|
|
756
|
+
type: string | undefined;
|
|
757
|
+
subtype: string | undefined;
|
|
758
|
+
}[];
|
|
759
|
+
} | undefined;
|
|
760
|
+
error?: string;
|
|
761
|
+
}>)[];
|
|
762
|
+
|
|
469
763
|
/**
|
|
470
764
|
* JSON Processor Tool
|
|
471
765
|
*
|
|
@@ -1494,4 +1788,4 @@ declare const askHumanTool: _agentforge_core.Tool<{
|
|
|
1494
1788
|
suggestions?: string[] | undefined;
|
|
1495
1789
|
}, AskHumanOutput>;
|
|
1496
1790
|
|
|
1497
|
-
export { type AskHumanInput, AskHumanInputSchema, type AskHumanOutput, DuckDuckGoProvider, type HttpResponse, type RetryConfig, type ScraperResult, type SearchProvider, type SearchResult, SerperProvider, type UrlValidationResult, type WebSearchInput, type WebSearchOutput, arrayFilter, arrayGroupBy, arrayMap, arraySort, askHumanTool, calculator, createAskHumanTool, createDuckDuckGoProvider, createSerperProvider, creditCardValidator, csvGenerator, csvParser, csvToJson, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, directoryCreate, directoryDelete, directoryList, emailValidator, extractImages, extractLinks, fileAppend, fileDelete, fileExists, fileReader, fileSearch, fileWriter, htmlParser, httpClient, httpGet, httpPost, ipValidator, jsonMerge, jsonParser, jsonQuery, jsonStringify, jsonToCsv, jsonToXml, jsonValidator, mathFunctions, objectOmit, objectPick, pathBasename, pathDirname, pathExtension, pathJoin, pathNormalize, pathParse, pathRelative, pathResolve, phoneValidator, randomNumber, searchResultSchema, statistics, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, urlBuilder, urlQueryParser, urlValidator, urlValidatorSimple, uuidValidator, webScraper, webSearch, webSearchOutputSchema, webSearchSchema, xmlGenerator, xmlParser, xmlToJson };
|
|
1791
|
+
export { type AskHumanInput, AskHumanInputSchema, type AskHumanOutput, DuckDuckGoProvider, type HttpResponse, type RetryConfig, type ScraperResult, type SearchProvider, type SearchResult, SerperProvider, type SlackToolsConfig, type UrlValidationResult, type WebSearchInput, type WebSearchOutput, arrayFilter, arrayGroupBy, arrayMap, arraySort, askHumanTool, calculator, createAskHumanTool, createDuckDuckGoProvider, createSerperProvider, createSlackTools, creditCardValidator, csvGenerator, csvParser, csvToJson, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, directoryCreate, directoryDelete, directoryList, emailValidator, extractImages, extractLinks, fileAppend, fileDelete, fileExists, fileReader, fileSearch, fileWriter, getSlackChannels, getSlackMessages, htmlParser, httpClient, httpGet, httpPost, ipValidator, jsonMerge, jsonParser, jsonQuery, jsonStringify, jsonToCsv, jsonToXml, jsonValidator, mathFunctions, notifySlack, objectOmit, objectPick, pathBasename, pathDirname, pathExtension, pathJoin, pathNormalize, pathParse, pathRelative, pathResolve, phoneValidator, randomNumber, searchResultSchema, sendSlackMessage, slackTools, statistics, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, urlBuilder, urlQueryParser, urlValidator, urlValidatorSimple, uuidValidator, webScraper, webSearch, webSearchOutputSchema, webSearchSchema, xmlGenerator, xmlParser, xmlToJson };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _agentforge_core from '@agentforge/core';
|
|
2
|
-
import { HumanRequestPriority } from '@agentforge/core';
|
|
2
|
+
import { LogLevel, Tool, HumanRequestPriority } from '@agentforge/core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -466,6 +466,300 @@ declare const webSearch: _agentforge_core.Tool<{
|
|
|
466
466
|
preferSerper?: boolean | undefined;
|
|
467
467
|
}, WebSearchOutput>;
|
|
468
468
|
|
|
469
|
+
/**
|
|
470
|
+
* Slack Integration Tools
|
|
471
|
+
*
|
|
472
|
+
* Tools for interacting with Slack workspaces - send messages, notifications,
|
|
473
|
+
* list channels, and read message history.
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```ts
|
|
477
|
+
* // Using default tools (reads from env vars)
|
|
478
|
+
* import { sendSlackMessage } from '@agentforge/tools';
|
|
479
|
+
*
|
|
480
|
+
* const result = await sendSlackMessage.execute({
|
|
481
|
+
* channel: 'general',
|
|
482
|
+
* message: 'Hello from AgentForge!'
|
|
483
|
+
* });
|
|
484
|
+
*
|
|
485
|
+
* // Using factory function with custom config
|
|
486
|
+
* import { createSlackTools } from '@agentforge/tools';
|
|
487
|
+
*
|
|
488
|
+
* const slackTools = createSlackTools({
|
|
489
|
+
* token: 'xoxb-your-bot-token',
|
|
490
|
+
* botName: 'My Custom Bot'
|
|
491
|
+
* });
|
|
492
|
+
*
|
|
493
|
+
* const result = await slackTools.sendMessage.execute({
|
|
494
|
+
* channel: 'general',
|
|
495
|
+
* message: 'Hello!'
|
|
496
|
+
* });
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Configuration options for Slack tools
|
|
502
|
+
*/
|
|
503
|
+
interface SlackToolsConfig {
|
|
504
|
+
/**
|
|
505
|
+
* Slack API token (bot or user token)
|
|
506
|
+
* If not provided, will fall back to SLACK_USER_TOKEN or SLACK_BOT_TOKEN env vars
|
|
507
|
+
*/
|
|
508
|
+
token?: string;
|
|
509
|
+
/**
|
|
510
|
+
* Custom bot name to display in Slack
|
|
511
|
+
* @default 'AgentForge Bot'
|
|
512
|
+
*/
|
|
513
|
+
botName?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Custom bot icon emoji
|
|
516
|
+
* @default ':robot_face:'
|
|
517
|
+
*/
|
|
518
|
+
botIcon?: string;
|
|
519
|
+
/**
|
|
520
|
+
* Log level for Slack tools
|
|
521
|
+
* @default LogLevel.INFO
|
|
522
|
+
*/
|
|
523
|
+
logLevel?: LogLevel;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Send a message to a Slack channel
|
|
527
|
+
*/
|
|
528
|
+
declare const sendSlackMessage: Tool<{
|
|
529
|
+
message: string;
|
|
530
|
+
channel: string;
|
|
531
|
+
}, {
|
|
532
|
+
success: boolean;
|
|
533
|
+
data?: {
|
|
534
|
+
channel: string | undefined;
|
|
535
|
+
message: string;
|
|
536
|
+
timestamp: string | undefined;
|
|
537
|
+
message_id: string | undefined;
|
|
538
|
+
} | undefined;
|
|
539
|
+
error?: string;
|
|
540
|
+
}>;
|
|
541
|
+
/**
|
|
542
|
+
* Send a notification to a Slack channel (with @mention support)
|
|
543
|
+
*/
|
|
544
|
+
declare const notifySlack: Tool<{
|
|
545
|
+
message: string;
|
|
546
|
+
channel: string;
|
|
547
|
+
mentions?: string[] | undefined;
|
|
548
|
+
}, {
|
|
549
|
+
success: boolean;
|
|
550
|
+
data?: {
|
|
551
|
+
channel: string | undefined;
|
|
552
|
+
message: string;
|
|
553
|
+
mentions: string[];
|
|
554
|
+
timestamp: string | undefined;
|
|
555
|
+
notification_id: string | undefined;
|
|
556
|
+
} | undefined;
|
|
557
|
+
error?: string;
|
|
558
|
+
}>;
|
|
559
|
+
/**
|
|
560
|
+
* Get list of available Slack channels
|
|
561
|
+
*/
|
|
562
|
+
declare const getSlackChannels: Tool<{
|
|
563
|
+
include_private?: boolean | undefined;
|
|
564
|
+
}, {
|
|
565
|
+
success: boolean;
|
|
566
|
+
data?: {
|
|
567
|
+
count: number;
|
|
568
|
+
channels: {
|
|
569
|
+
id: string | undefined;
|
|
570
|
+
name: string | undefined;
|
|
571
|
+
is_private: boolean;
|
|
572
|
+
num_members: number;
|
|
573
|
+
}[];
|
|
574
|
+
} | undefined;
|
|
575
|
+
error?: string;
|
|
576
|
+
}>;
|
|
577
|
+
/**
|
|
578
|
+
* Get message history from a Slack channel
|
|
579
|
+
*/
|
|
580
|
+
declare const getSlackMessages: Tool<{
|
|
581
|
+
channel: string;
|
|
582
|
+
limit?: number | undefined;
|
|
583
|
+
}, {
|
|
584
|
+
success: boolean;
|
|
585
|
+
data?: {
|
|
586
|
+
channel: string;
|
|
587
|
+
count: number;
|
|
588
|
+
messages: {
|
|
589
|
+
user: string;
|
|
590
|
+
text: string;
|
|
591
|
+
timestamp: string | undefined;
|
|
592
|
+
thread_ts: string | undefined;
|
|
593
|
+
type: string | undefined;
|
|
594
|
+
subtype: string | undefined;
|
|
595
|
+
}[];
|
|
596
|
+
} | undefined;
|
|
597
|
+
error?: string;
|
|
598
|
+
}>;
|
|
599
|
+
/**
|
|
600
|
+
* Create Slack tools with custom configuration
|
|
601
|
+
*
|
|
602
|
+
* This factory function allows you to create Slack tools with custom configuration,
|
|
603
|
+
* such as providing a token programmatically instead of using environment variables.
|
|
604
|
+
*
|
|
605
|
+
* @param config - Configuration options for Slack tools
|
|
606
|
+
* @returns Object containing all 4 Slack tools configured with the provided options
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* ```ts
|
|
610
|
+
* // Create tools with custom token
|
|
611
|
+
* const slackTools = createSlackTools({
|
|
612
|
+
* token: 'xoxb-your-bot-token',
|
|
613
|
+
* botName: 'My Custom Bot',
|
|
614
|
+
* botIcon: ':rocket:'
|
|
615
|
+
* });
|
|
616
|
+
*
|
|
617
|
+
* // Use the tools
|
|
618
|
+
* await slackTools.sendMessage.execute({
|
|
619
|
+
* channel: 'general',
|
|
620
|
+
* message: 'Hello!'
|
|
621
|
+
* });
|
|
622
|
+
*
|
|
623
|
+
* // Or use with an agent
|
|
624
|
+
* const agent = createReActAgent({
|
|
625
|
+
* llm,
|
|
626
|
+
* tools: [
|
|
627
|
+
* slackTools.sendMessage,
|
|
628
|
+
* slackTools.notify,
|
|
629
|
+
* slackTools.getChannels,
|
|
630
|
+
* slackTools.getMessages
|
|
631
|
+
* ]
|
|
632
|
+
* });
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
declare function createSlackTools(config?: SlackToolsConfig): {
|
|
636
|
+
sendMessage: Tool<{
|
|
637
|
+
message: string;
|
|
638
|
+
channel: string;
|
|
639
|
+
}, {
|
|
640
|
+
success: boolean;
|
|
641
|
+
data?: {
|
|
642
|
+
channel: string | undefined;
|
|
643
|
+
message: string;
|
|
644
|
+
timestamp: string | undefined;
|
|
645
|
+
message_id: string | undefined;
|
|
646
|
+
} | undefined;
|
|
647
|
+
error?: string;
|
|
648
|
+
}>;
|
|
649
|
+
notify: Tool<{
|
|
650
|
+
message: string;
|
|
651
|
+
channel: string;
|
|
652
|
+
mentions?: string[] | undefined;
|
|
653
|
+
}, {
|
|
654
|
+
success: boolean;
|
|
655
|
+
data?: {
|
|
656
|
+
channel: string | undefined;
|
|
657
|
+
message: string;
|
|
658
|
+
mentions: string[];
|
|
659
|
+
timestamp: string | undefined;
|
|
660
|
+
notification_id: string | undefined;
|
|
661
|
+
} | undefined;
|
|
662
|
+
error?: string;
|
|
663
|
+
}>;
|
|
664
|
+
getChannels: Tool<{
|
|
665
|
+
include_private?: boolean | undefined;
|
|
666
|
+
}, {
|
|
667
|
+
success: boolean;
|
|
668
|
+
data?: {
|
|
669
|
+
count: number;
|
|
670
|
+
channels: {
|
|
671
|
+
id: string | undefined;
|
|
672
|
+
name: string | undefined;
|
|
673
|
+
is_private: boolean;
|
|
674
|
+
num_members: number;
|
|
675
|
+
}[];
|
|
676
|
+
} | undefined;
|
|
677
|
+
error?: string;
|
|
678
|
+
}>;
|
|
679
|
+
getMessages: Tool<{
|
|
680
|
+
channel: string;
|
|
681
|
+
limit?: number | undefined;
|
|
682
|
+
}, {
|
|
683
|
+
success: boolean;
|
|
684
|
+
data?: {
|
|
685
|
+
channel: string;
|
|
686
|
+
count: number;
|
|
687
|
+
messages: {
|
|
688
|
+
user: string;
|
|
689
|
+
text: string;
|
|
690
|
+
timestamp: string | undefined;
|
|
691
|
+
thread_ts: string | undefined;
|
|
692
|
+
type: string | undefined;
|
|
693
|
+
subtype: string | undefined;
|
|
694
|
+
}[];
|
|
695
|
+
} | undefined;
|
|
696
|
+
error?: string;
|
|
697
|
+
}>;
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* Export all Slack tools as an array for convenience
|
|
701
|
+
* These use environment variables for configuration (SLACK_USER_TOKEN or SLACK_BOT_TOKEN)
|
|
702
|
+
*/
|
|
703
|
+
declare const slackTools: (Tool<{
|
|
704
|
+
message: string;
|
|
705
|
+
channel: string;
|
|
706
|
+
}, {
|
|
707
|
+
success: boolean;
|
|
708
|
+
data?: {
|
|
709
|
+
channel: string | undefined;
|
|
710
|
+
message: string;
|
|
711
|
+
timestamp: string | undefined;
|
|
712
|
+
message_id: string | undefined;
|
|
713
|
+
} | undefined;
|
|
714
|
+
error?: string;
|
|
715
|
+
}> | Tool<{
|
|
716
|
+
message: string;
|
|
717
|
+
channel: string;
|
|
718
|
+
mentions?: string[] | undefined;
|
|
719
|
+
}, {
|
|
720
|
+
success: boolean;
|
|
721
|
+
data?: {
|
|
722
|
+
channel: string | undefined;
|
|
723
|
+
message: string;
|
|
724
|
+
mentions: string[];
|
|
725
|
+
timestamp: string | undefined;
|
|
726
|
+
notification_id: string | undefined;
|
|
727
|
+
} | undefined;
|
|
728
|
+
error?: string;
|
|
729
|
+
}> | Tool<{
|
|
730
|
+
include_private?: boolean | undefined;
|
|
731
|
+
}, {
|
|
732
|
+
success: boolean;
|
|
733
|
+
data?: {
|
|
734
|
+
count: number;
|
|
735
|
+
channels: {
|
|
736
|
+
id: string | undefined;
|
|
737
|
+
name: string | undefined;
|
|
738
|
+
is_private: boolean;
|
|
739
|
+
num_members: number;
|
|
740
|
+
}[];
|
|
741
|
+
} | undefined;
|
|
742
|
+
error?: string;
|
|
743
|
+
}> | Tool<{
|
|
744
|
+
channel: string;
|
|
745
|
+
limit?: number | undefined;
|
|
746
|
+
}, {
|
|
747
|
+
success: boolean;
|
|
748
|
+
data?: {
|
|
749
|
+
channel: string;
|
|
750
|
+
count: number;
|
|
751
|
+
messages: {
|
|
752
|
+
user: string;
|
|
753
|
+
text: string;
|
|
754
|
+
timestamp: string | undefined;
|
|
755
|
+
thread_ts: string | undefined;
|
|
756
|
+
type: string | undefined;
|
|
757
|
+
subtype: string | undefined;
|
|
758
|
+
}[];
|
|
759
|
+
} | undefined;
|
|
760
|
+
error?: string;
|
|
761
|
+
}>)[];
|
|
762
|
+
|
|
469
763
|
/**
|
|
470
764
|
* JSON Processor Tool
|
|
471
765
|
*
|
|
@@ -1494,4 +1788,4 @@ declare const askHumanTool: _agentforge_core.Tool<{
|
|
|
1494
1788
|
suggestions?: string[] | undefined;
|
|
1495
1789
|
}, AskHumanOutput>;
|
|
1496
1790
|
|
|
1497
|
-
export { type AskHumanInput, AskHumanInputSchema, type AskHumanOutput, DuckDuckGoProvider, type HttpResponse, type RetryConfig, type ScraperResult, type SearchProvider, type SearchResult, SerperProvider, type UrlValidationResult, type WebSearchInput, type WebSearchOutput, arrayFilter, arrayGroupBy, arrayMap, arraySort, askHumanTool, calculator, createAskHumanTool, createDuckDuckGoProvider, createSerperProvider, creditCardValidator, csvGenerator, csvParser, csvToJson, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, directoryCreate, directoryDelete, directoryList, emailValidator, extractImages, extractLinks, fileAppend, fileDelete, fileExists, fileReader, fileSearch, fileWriter, htmlParser, httpClient, httpGet, httpPost, ipValidator, jsonMerge, jsonParser, jsonQuery, jsonStringify, jsonToCsv, jsonToXml, jsonValidator, mathFunctions, objectOmit, objectPick, pathBasename, pathDirname, pathExtension, pathJoin, pathNormalize, pathParse, pathRelative, pathResolve, phoneValidator, randomNumber, searchResultSchema, statistics, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, urlBuilder, urlQueryParser, urlValidator, urlValidatorSimple, uuidValidator, webScraper, webSearch, webSearchOutputSchema, webSearchSchema, xmlGenerator, xmlParser, xmlToJson };
|
|
1791
|
+
export { type AskHumanInput, AskHumanInputSchema, type AskHumanOutput, DuckDuckGoProvider, type HttpResponse, type RetryConfig, type ScraperResult, type SearchProvider, type SearchResult, SerperProvider, type SlackToolsConfig, type UrlValidationResult, type WebSearchInput, type WebSearchOutput, arrayFilter, arrayGroupBy, arrayMap, arraySort, askHumanTool, calculator, createAskHumanTool, createDuckDuckGoProvider, createSerperProvider, createSlackTools, creditCardValidator, csvGenerator, csvParser, csvToJson, currentDateTime, dateArithmetic, dateComparison, dateDifference, dateFormatter, directoryCreate, directoryDelete, directoryList, emailValidator, extractImages, extractLinks, fileAppend, fileDelete, fileExists, fileReader, fileSearch, fileWriter, getSlackChannels, getSlackMessages, htmlParser, httpClient, httpGet, httpPost, ipValidator, jsonMerge, jsonParser, jsonQuery, jsonStringify, jsonToCsv, jsonToXml, jsonValidator, mathFunctions, notifySlack, objectOmit, objectPick, pathBasename, pathDirname, pathExtension, pathJoin, pathNormalize, pathParse, pathRelative, pathResolve, phoneValidator, randomNumber, searchResultSchema, sendSlackMessage, slackTools, statistics, stringCaseConverter, stringJoin, stringLength, stringReplace, stringSplit, stringSubstring, stringTrim, urlBuilder, urlQueryParser, urlValidator, urlValidatorSimple, uuidValidator, webScraper, webSearch, webSearchOutputSchema, webSearchSchema, xmlGenerator, xmlParser, xmlToJson };
|