1- // Response interface for the intent agent's operations
1+ /**
2+ * Core Type Definitions for the Atoma AI Agent System
3+ * This file contains all the essential interfaces and types used throughout the agent.
4+ *
5+ * The type system is designed to ensure:
6+ * 1. Type Safety - Strong typing for all agent operations
7+ * 2. Consistency - Standardized interfaces across the system
8+ * 3. Extensibility - Easy addition of new tools and features
9+ *
10+ * @module Types
11+ */
12+
13+ /**
14+ * Response interface for the intent agent's operations.
15+ * Represents the structured output from tool selection and execution.
16+ *
17+ * @interface IntentAgentResponse
18+ */
219export interface IntentAgentResponse {
320 success : boolean ; // Indicates if the operation was successful
421 selected_tools : null | string [ ] ; // Name of the tool that was selected for the operation
@@ -8,9 +25,20 @@ export interface IntentAgentResponse {
825 tool_arguments : ( string | number | boolean | bigint ) [ ] ; // Arguments passed to the tool
926}
1027
28+ /**
29+ * Basic type for tool arguments.
30+ * Supports common primitive types used in tool execution.
31+ *
32+ * @typedef ToolArgument
33+ */
1134export type ToolArgument = string | number | boolean | bigint ;
1235
13- // Response interface for tool operations (similar to IntentAgentResponse)
36+ /**
37+ * Response interface for tool operations.
38+ * Similar structure to IntentAgentResponse for consistency.
39+ *
40+ * @interface toolResponse
41+ */
1442export interface toolResponse {
1543 success : boolean ;
1644 selected_tools : null | string ;
@@ -20,15 +48,25 @@ export interface toolResponse {
2048 tool_arguments : ( string | number | boolean | bigint ) [ ] ;
2149}
2250
23- // Defines the structure for tool parameters
51+ /**
52+ * Defines the structure for tool parameters.
53+ * Used in tool registration and validation.
54+ *
55+ * @interface ToolParameter
56+ */
2457export interface ToolParameter {
2558 name : string ; // Name of the parameter
2659 type : string ; // Data type of the parameter
2760 description : string ; // Description of what the parameter does
2861 required : boolean ; // Whether the parameter is mandatory
2962}
3063
31- // Defines the structure for tools that can be used by the agent
64+ /**
65+ * Defines the structure for tools that can be used by the agent.
66+ * Core interface for all tool implementations.
67+ *
68+ * @interface Tool
69+ */
3270export interface Tool {
3371 name : string ; // Name of the tool
3472 description : string ; // Description of what the tool does
@@ -38,8 +76,21 @@ export interface Tool {
3876 ) => Promise < string > | string ; // Function to execute the tool
3977}
4078
41- // Mapping of different coin names/variants to their standardized symbol
42- // This helps in recognizing different ways users might refer to the same coin
79+ /**
80+ * Mapping of different coin names/variants to their standardized symbol.
81+ * Helps in recognizing different ways users might refer to the same coin.
82+ *
83+ * Key Features:
84+ * - Case-insensitive matching
85+ * - Multiple variants per coin
86+ * - Standardized output symbols
87+ *
88+ * TODO:
89+ * - Add support for more coin variants
90+ * - Add support for token metadata
91+ *
92+ * @const COIN_SYNONYMS
93+ */
4394export const COIN_SYNONYMS : Record < string , string > = {
4495 // SUI and variants
4596 SUI : 'SUI' ,
@@ -124,8 +175,16 @@ export const COIN_SYNONYMS: Record<string, string> = {
124175 WSBCOIN : 'WSB' ,
125176} as const ;
126177
127- // Mapping of coin symbols to their respective addresses on the Sui network
128- // These addresses are used to interact with the coins on the blockchain
178+ /**
179+ * Mapping of coin symbols to their respective addresses on the Sui network.
180+ * Used for blockchain interactions and token operations.
181+ *
182+ * Features:
183+ * - Mainnet addresses
184+ * - Type information
185+ * - Standardized format
186+ * @const COIN_ADDRESSES
187+ */
129188export const COIN_ADDRESSES = {
130189 SUI : '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI' ,
131190 USDC : '0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT' ,
@@ -164,27 +223,46 @@ export const COIN_ADDRESSES = {
164223 WSB : '0x4db126eac4fa99207e98db61d968477021fdeae153de3b244bcfbdc468ef0722::wsb::WSB' ,
165224} as const ;
166225
167- // Structure for token balance information
226+ /**
227+ * Structure for token balance information.
228+ * Used for representing token holdings and balances.
229+ *
230+ * @interface TokenBalance
231+ */
168232export interface TokenBalance {
169233 token : string ; // Token address or identifier
170234 amount : bigint ; // Token amount
171235 symbol ?: string ; // Token symbol (optional)
172236 decimals ?: number ; // Number of decimal places for the token (optional)
173237}
174238
175- // Configuration for a specific network (mainnet or testnet)
239+ /**
240+ * Configuration for a specific network (mainnet or testnet).
241+ * Contains network-specific endpoints and settings.
242+ *
243+ * @interface NetworkConfig
244+ */
176245export interface NetworkConfig {
177246 fullnode : string ; // URL for the network's fullnode
178247 faucet ?: string ; // URL for the network's faucet (optional)
179248}
180249
181- // Configuration for all supported networks
250+ /**
251+ * Configuration for all supported networks.
252+ * Manages configurations for different network environments.
253+ *
254+ * @interface NetworkConfigs
255+ */
182256export interface NetworkConfigs {
183257 MAINNET : NetworkConfig ; // Mainnet configuration
184258 TESTNET : NetworkConfig ; // Testnet configuration
185259}
186260
187- // Network configuration constants
261+ /**
262+ * Network configuration constants.
263+ * Defines the default network endpoints and settings.
264+ * @const NETWORK_CONFIG
265+ */
188266export const NETWORK_CONFIG : NetworkConfigs = {
189267 MAINNET : {
190268 fullnode : 'https://fullnode.mainnet.sui.io' ,
0 commit comments