@hashgraphonline/standards-agent-kit 0.0.38 → 0.2.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.
Files changed (252) hide show
  1. package/README.md +137 -170
  2. package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +262 -0
  3. package/dist/cjs/builders/index.d.ts +2 -0
  4. package/dist/cjs/builders/types.d.ts +10 -0
  5. package/dist/cjs/index.d.ts +3 -1
  6. package/dist/cjs/init/init.d.ts +21 -22
  7. package/dist/cjs/plugins/PluginInterface.d.ts +4 -80
  8. package/dist/cjs/plugins/PluginRegistry.d.ts +1 -47
  9. package/dist/cjs/plugins/defi/index.d.ts +7 -4
  10. package/dist/cjs/plugins/hedera/HbarPricePlugin.d.ts +7 -35
  11. package/dist/cjs/plugins/index.d.ts +0 -5
  12. package/dist/cjs/plugins/weather/index.d.ts +6 -5
  13. package/dist/cjs/standards-agent-kit.cjs +1 -1
  14. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  15. package/dist/cjs/state/state-types.d.ts +8 -8
  16. package/dist/cjs/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
  17. package/dist/cjs/tools/hcs10/CheckMessagesTool.d.ts +40 -0
  18. package/dist/cjs/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
  19. package/dist/cjs/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
  20. package/dist/cjs/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
  21. package/dist/cjs/tools/hcs10/ListConnectionsTool.d.ts +34 -0
  22. package/dist/cjs/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
  23. package/dist/cjs/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
  24. package/dist/cjs/tools/hcs10/RegisterAgentTool.d.ts +218 -0
  25. package/dist/cjs/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
  26. package/dist/cjs/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
  27. package/dist/cjs/tools/hcs10/base-hcs10-tools.d.ts +28 -0
  28. package/dist/cjs/tools/hcs10/hcs10-tool-params.d.ts +18 -0
  29. package/dist/cjs/tools/hcs10/index.d.ts +13 -0
  30. package/dist/cjs/tools/index.d.ts +1 -13
  31. package/dist/es/builders/hcs10/hcs10-builder.d.ts +262 -0
  32. package/dist/es/builders/index.d.ts +2 -0
  33. package/dist/es/builders/types.d.ts +10 -0
  34. package/dist/es/index.d.ts +3 -1
  35. package/dist/es/init/init.d.ts +21 -22
  36. package/dist/es/plugins/PluginInterface.d.ts +4 -80
  37. package/dist/es/plugins/PluginRegistry.d.ts +1 -47
  38. package/dist/es/plugins/defi/index.d.ts +7 -4
  39. package/dist/es/plugins/hedera/HbarPricePlugin.d.ts +7 -35
  40. package/dist/es/plugins/index.d.ts +0 -5
  41. package/dist/es/plugins/weather/index.d.ts +6 -5
  42. package/dist/es/standards-agent-kit.es.js +10 -18
  43. package/dist/es/standards-agent-kit.es.js.map +1 -1
  44. package/dist/es/standards-agent-kit.es10.js +29 -76
  45. package/dist/es/standards-agent-kit.es10.js.map +1 -1
  46. package/dist/es/standards-agent-kit.es11.js +61 -384
  47. package/dist/es/standards-agent-kit.es11.js.map +1 -1
  48. package/dist/es/standards-agent-kit.es12.js +22 -190
  49. package/dist/es/standards-agent-kit.es12.js.map +1 -1
  50. package/dist/es/standards-agent-kit.es13.js +26 -138
  51. package/dist/es/standards-agent-kit.es13.js.map +1 -1
  52. package/dist/es/standards-agent-kit.es14.js +35 -59
  53. package/dist/es/standards-agent-kit.es14.js.map +1 -1
  54. package/dist/es/standards-agent-kit.es15.js +11 -117
  55. package/dist/es/standards-agent-kit.es15.js.map +1 -1
  56. package/dist/es/standards-agent-kit.es16.js +1 -1
  57. package/dist/es/standards-agent-kit.es16.js.map +1 -1
  58. package/dist/es/standards-agent-kit.es17.js +63 -46
  59. package/dist/es/standards-agent-kit.es17.js.map +1 -1
  60. package/dist/es/standards-agent-kit.es18.js +25 -74
  61. package/dist/es/standards-agent-kit.es18.js.map +1 -1
  62. package/dist/es/standards-agent-kit.es19.js +22 -13
  63. package/dist/es/standards-agent-kit.es19.js.map +1 -1
  64. package/dist/es/standards-agent-kit.es2.js +1381 -188
  65. package/dist/es/standards-agent-kit.es2.js.map +1 -1
  66. package/dist/es/standards-agent-kit.es20.js +3 -67
  67. package/dist/es/standards-agent-kit.es20.js.map +1 -1
  68. package/dist/es/standards-agent-kit.es3.js +285 -347
  69. package/dist/es/standards-agent-kit.es3.js.map +1 -1
  70. package/dist/es/standards-agent-kit.es4.js +22 -74
  71. package/dist/es/standards-agent-kit.es4.js.map +1 -1
  72. package/dist/es/standards-agent-kit.es5.js +127 -154
  73. package/dist/es/standards-agent-kit.es5.js.map +1 -1
  74. package/dist/es/standards-agent-kit.es6.js +21 -88
  75. package/dist/es/standards-agent-kit.es6.js.map +1 -1
  76. package/dist/es/standards-agent-kit.es7.js +28 -86
  77. package/dist/es/standards-agent-kit.es7.js.map +1 -1
  78. package/dist/es/standards-agent-kit.es8.js +27 -100
  79. package/dist/es/standards-agent-kit.es8.js.map +1 -1
  80. package/dist/es/standards-agent-kit.es9.js +35 -117
  81. package/dist/es/standards-agent-kit.es9.js.map +1 -1
  82. package/dist/es/state/state-types.d.ts +8 -8
  83. package/dist/es/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
  84. package/dist/es/tools/hcs10/CheckMessagesTool.d.ts +40 -0
  85. package/dist/es/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
  86. package/dist/es/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
  87. package/dist/es/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
  88. package/dist/es/tools/hcs10/ListConnectionsTool.d.ts +34 -0
  89. package/dist/es/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
  90. package/dist/es/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
  91. package/dist/es/tools/hcs10/RegisterAgentTool.d.ts +218 -0
  92. package/dist/es/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
  93. package/dist/es/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
  94. package/dist/es/tools/hcs10/base-hcs10-tools.d.ts +28 -0
  95. package/dist/es/tools/hcs10/hcs10-tool-params.d.ts +18 -0
  96. package/dist/es/tools/hcs10/index.d.ts +13 -0
  97. package/dist/es/tools/index.d.ts +1 -13
  98. package/dist/umd/builders/hcs10/hcs10-builder.d.ts +262 -0
  99. package/dist/umd/builders/index.d.ts +2 -0
  100. package/dist/umd/builders/types.d.ts +10 -0
  101. package/dist/umd/index.d.ts +3 -1
  102. package/dist/umd/init/init.d.ts +21 -22
  103. package/dist/umd/plugins/PluginInterface.d.ts +4 -80
  104. package/dist/umd/plugins/PluginRegistry.d.ts +1 -47
  105. package/dist/umd/plugins/defi/index.d.ts +7 -4
  106. package/dist/umd/plugins/hedera/HbarPricePlugin.d.ts +7 -35
  107. package/dist/umd/plugins/index.d.ts +0 -5
  108. package/dist/umd/plugins/weather/index.d.ts +6 -5
  109. package/dist/umd/standards-agent-kit.umd.js +1 -194
  110. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  111. package/dist/umd/state/state-types.d.ts +8 -8
  112. package/dist/umd/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
  113. package/dist/umd/tools/hcs10/CheckMessagesTool.d.ts +40 -0
  114. package/dist/umd/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
  115. package/dist/umd/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
  116. package/dist/umd/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
  117. package/dist/umd/tools/hcs10/ListConnectionsTool.d.ts +34 -0
  118. package/dist/umd/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
  119. package/dist/umd/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
  120. package/dist/umd/tools/hcs10/RegisterAgentTool.d.ts +218 -0
  121. package/dist/umd/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
  122. package/dist/umd/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
  123. package/dist/umd/tools/hcs10/base-hcs10-tools.d.ts +28 -0
  124. package/dist/umd/tools/hcs10/hcs10-tool-params.d.ts +18 -0
  125. package/dist/umd/tools/hcs10/index.d.ts +13 -0
  126. package/dist/umd/tools/index.d.ts +1 -13
  127. package/package.json +40 -37
  128. package/src/builders/hcs10/hcs10-builder.ts +2108 -0
  129. package/src/builders/index.ts +2 -0
  130. package/src/builders/types.ts +11 -0
  131. package/src/hcs10/HCS10Client.ts +3 -2
  132. package/src/index.ts +4 -2
  133. package/src/init/init.ts +85 -63
  134. package/src/plugins/PluginInterface.ts +15 -94
  135. package/src/plugins/PluginRegistry.ts +2 -98
  136. package/src/plugins/defi/index.ts +30 -117
  137. package/src/plugins/hedera/HbarPricePlugin.ts +19 -100
  138. package/src/plugins/index.ts +0 -5
  139. package/src/plugins/weather/index.ts +56 -40
  140. package/src/state/state-types.ts +9 -11
  141. package/src/tools/hcs10/AcceptConnectionRequestTool.ts +56 -0
  142. package/src/tools/hcs10/CheckMessagesTool.ts +73 -0
  143. package/src/tools/hcs10/ConnectionMonitorTool.ts +111 -0
  144. package/src/tools/hcs10/FindRegistrationsTool.ts +64 -0
  145. package/src/tools/hcs10/InitiateConnectionTool.ts +66 -0
  146. package/src/tools/hcs10/ListConnectionsTool.ts +58 -0
  147. package/src/tools/hcs10/ListUnapprovedConnectionRequestsTool.ts +26 -0
  148. package/src/tools/hcs10/ManageConnectionRequestsTool.ts +48 -0
  149. package/src/tools/hcs10/RegisterAgentTool.ts +213 -0
  150. package/src/tools/hcs10/RetrieveProfileTool.ts +61 -0
  151. package/src/tools/hcs10/SendMessageToConnectionTool.ts +45 -0
  152. package/src/tools/hcs10/base-hcs10-tools.ts +65 -0
  153. package/src/tools/hcs10/hcs10-tool-params.ts +21 -0
  154. package/src/tools/hcs10/index.ts +13 -0
  155. package/src/tools/index.ts +2 -13
  156. package/src/utils/HederaClient.ts +2 -2
  157. package/src/utils/ensure-agent-has-hbar.ts +3 -4
  158. package/dist/cjs/agents/index.d.ts +0 -0
  159. package/dist/cjs/plugins/BasePlugin.d.ts +0 -28
  160. package/dist/cjs/plugins/GenericPlugin.d.ts +0 -17
  161. package/dist/cjs/plugins/HCS10Plugin.d.ts +0 -13
  162. package/dist/cjs/plugins/PluginLoader.d.ts +0 -38
  163. package/dist/cjs/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
  164. package/dist/cjs/plugins/openconvai/index.d.ts +0 -1
  165. package/dist/cjs/tools/AcceptConnectionRequestTool.d.ts +0 -33
  166. package/dist/cjs/tools/CheckMessagesTool.d.ts +0 -34
  167. package/dist/cjs/tools/ConnectionMonitorTool.d.ts +0 -100
  168. package/dist/cjs/tools/ConnectionTool.d.ts +0 -40
  169. package/dist/cjs/tools/FindRegistrationsTool.d.ts +0 -28
  170. package/dist/cjs/tools/InitiateConnectionTool.d.ts +0 -30
  171. package/dist/cjs/tools/ListConnectionsTool.d.ts +0 -33
  172. package/dist/cjs/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
  173. package/dist/cjs/tools/ManageConnectionRequestsTool.d.ts +0 -38
  174. package/dist/cjs/tools/RegisterAgentTool.d.ts +0 -188
  175. package/dist/cjs/tools/RetrieveProfileTool.d.ts +0 -34
  176. package/dist/cjs/tools/SendMessageToConnectionTool.d.ts +0 -34
  177. package/dist/cjs/tools/SendMessageTool.d.ts +0 -40
  178. package/dist/es/agents/index.d.ts +0 -0
  179. package/dist/es/plugins/BasePlugin.d.ts +0 -28
  180. package/dist/es/plugins/GenericPlugin.d.ts +0 -17
  181. package/dist/es/plugins/HCS10Plugin.d.ts +0 -13
  182. package/dist/es/plugins/PluginLoader.d.ts +0 -38
  183. package/dist/es/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
  184. package/dist/es/plugins/openconvai/index.d.ts +0 -1
  185. package/dist/es/standards-agent-kit.es21.js +0 -92
  186. package/dist/es/standards-agent-kit.es21.js.map +0 -1
  187. package/dist/es/standards-agent-kit.es22.js +0 -7
  188. package/dist/es/standards-agent-kit.es22.js.map +0 -1
  189. package/dist/es/standards-agent-kit.es23.js +0 -106
  190. package/dist/es/standards-agent-kit.es23.js.map +0 -1
  191. package/dist/es/standards-agent-kit.es24.js +0 -7
  192. package/dist/es/standards-agent-kit.es24.js.map +0 -1
  193. package/dist/es/standards-agent-kit.es25.js +0 -7
  194. package/dist/es/standards-agent-kit.es25.js.map +0 -1
  195. package/dist/es/standards-agent-kit.es26.js +0 -85
  196. package/dist/es/standards-agent-kit.es26.js.map +0 -1
  197. package/dist/es/standards-agent-kit.es27.js +0 -28
  198. package/dist/es/standards-agent-kit.es27.js.map +0 -1
  199. package/dist/es/tools/AcceptConnectionRequestTool.d.ts +0 -33
  200. package/dist/es/tools/CheckMessagesTool.d.ts +0 -34
  201. package/dist/es/tools/ConnectionMonitorTool.d.ts +0 -100
  202. package/dist/es/tools/ConnectionTool.d.ts +0 -40
  203. package/dist/es/tools/FindRegistrationsTool.d.ts +0 -28
  204. package/dist/es/tools/InitiateConnectionTool.d.ts +0 -30
  205. package/dist/es/tools/ListConnectionsTool.d.ts +0 -33
  206. package/dist/es/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
  207. package/dist/es/tools/ManageConnectionRequestsTool.d.ts +0 -38
  208. package/dist/es/tools/RegisterAgentTool.d.ts +0 -188
  209. package/dist/es/tools/RetrieveProfileTool.d.ts +0 -34
  210. package/dist/es/tools/SendMessageToConnectionTool.d.ts +0 -34
  211. package/dist/es/tools/SendMessageTool.d.ts +0 -40
  212. package/dist/umd/agents/index.d.ts +0 -0
  213. package/dist/umd/plugins/BasePlugin.d.ts +0 -28
  214. package/dist/umd/plugins/GenericPlugin.d.ts +0 -17
  215. package/dist/umd/plugins/HCS10Plugin.d.ts +0 -13
  216. package/dist/umd/plugins/PluginLoader.d.ts +0 -38
  217. package/dist/umd/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
  218. package/dist/umd/plugins/openconvai/index.d.ts +0 -1
  219. package/dist/umd/tools/AcceptConnectionRequestTool.d.ts +0 -33
  220. package/dist/umd/tools/CheckMessagesTool.d.ts +0 -34
  221. package/dist/umd/tools/ConnectionMonitorTool.d.ts +0 -100
  222. package/dist/umd/tools/ConnectionTool.d.ts +0 -40
  223. package/dist/umd/tools/FindRegistrationsTool.d.ts +0 -28
  224. package/dist/umd/tools/InitiateConnectionTool.d.ts +0 -30
  225. package/dist/umd/tools/ListConnectionsTool.d.ts +0 -33
  226. package/dist/umd/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
  227. package/dist/umd/tools/ManageConnectionRequestsTool.d.ts +0 -38
  228. package/dist/umd/tools/RegisterAgentTool.d.ts +0 -188
  229. package/dist/umd/tools/RetrieveProfileTool.d.ts +0 -34
  230. package/dist/umd/tools/SendMessageToConnectionTool.d.ts +0 -34
  231. package/dist/umd/tools/SendMessageTool.d.ts +0 -40
  232. package/src/agents/index.ts +0 -1
  233. package/src/plugins/BasePlugin.ts +0 -37
  234. package/src/plugins/GenericPlugin.ts +0 -19
  235. package/src/plugins/HCS10Plugin.ts +0 -14
  236. package/src/plugins/PluginLoader.ts +0 -121
  237. package/src/plugins/README.md +0 -113
  238. package/src/plugins/openconvai/OpenConvAIPlugin.ts +0 -124
  239. package/src/plugins/openconvai/index.ts +0 -1
  240. package/src/tools/AcceptConnectionRequestTool.ts +0 -196
  241. package/src/tools/CheckMessagesTool.ts +0 -194
  242. package/src/tools/ConnectionMonitorTool.ts +0 -550
  243. package/src/tools/ConnectionTool.ts +0 -231
  244. package/src/tools/FindRegistrationsTool.ts +0 -114
  245. package/src/tools/InitiateConnectionTool.ts +0 -137
  246. package/src/tools/ListConnectionsTool.ts +0 -158
  247. package/src/tools/ListUnapprovedConnectionRequestsTool.ts +0 -173
  248. package/src/tools/ManageConnectionRequestsTool.ts +0 -275
  249. package/src/tools/RegisterAgentTool.ts +0 -590
  250. package/src/tools/RetrieveProfileTool.ts +0 -94
  251. package/src/tools/SendMessageToConnectionTool.ts +0 -142
  252. package/src/tools/SendMessageTool.ts +0 -116
package/README.md CHANGED
@@ -1,15 +1,22 @@
1
- # Hashgraph Online Standards AI Agent Kit
1
+ # Hashgraph Online Standards Agent Kit
2
2
 
3
- [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3
+ | ![](https://hashgraphonline.com/img/logo.png) | A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.<br><br>This SDK is built and maintained by [Hashgraph Online](https://hashgraphonline.com), a consortium of leading Hedera Organizations within the Hedera ecosystem.<br><br>[📚 Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)<br>[📖 HCS Standards Documentation](https://hcs-improvement-proposals.pages.dev/docs/standards) |
4
+ | :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
4
5
 
5
- # **_This SDK is currently in alpha, use at your own risk._**
6
+ ## Quick Start
6
7
 
7
- A toolkit built with TypeScript and LangChain for creating AI agents that communicate trustlessly on the Hedera network using the [HCS-10 AI Agent Communication Standard](https://hashgraphonline.com/docs/standards/hcs-10/).
8
+ ```bash
9
+ npm install @hashgraphonline/standards-agent-kit
10
+ ```
8
11
 
9
- ## Quick Start
12
+ ## Installation
10
13
 
11
14
  ```bash
15
+ # Install the core SDK
12
16
  npm install @hashgraphonline/standards-agent-kit
17
+
18
+ # Optional: Install the OpenConvAI plugin for additional functionality
19
+ npm install @hashgraphonline/standards-agent-plugin
13
20
  ```
14
21
 
15
22
  ## Documentation
@@ -17,216 +24,176 @@ npm install @hashgraphonline/standards-agent-kit
17
24
  For complete documentation, examples, and API references, visit:
18
25
 
19
26
  - [Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)
27
+ - [HCS-10 Standard Documentation](https://hcs-improvement-proposals.pages.dev/docs/standards/hcs-10)
20
28
 
21
29
  ## Features
22
30
 
23
- - **HCS-10 Compliance:** Built on top of the official `@hashgraphonline/standards-sdk` for standard compliance.
24
- - **Agent Lifecycle Management:** Create, register, and manage HCS-10 agents on Hedera.
25
- - **Trustless Communication:** Facilitates secure peer-to-peer communication setup between agents via Hedera Consensus Service (HCS).
26
- - **LangChain Integration:** Provides ready-to-use LangChain `StructuredTool`s for common agent actions.
27
- - **Message Handling:** Send and receive messages over HCS, including support for large messages via HCS-3 inscriptions.
28
- - **Connection Monitoring:** Automatically monitor inbound topics for connection requests and handle them.
29
- - **Configurable:** Set Hedera network, credentials, and registry via environment variables.
30
-
31
- ## Supported Tools
32
-
33
- - **RegisterAgentTool**: Create and register a new HCS-10 agent
34
- - **SendMessageTool**: Send messages to a topic with optional response monitoring
35
- - **ConnectionTool**: Monitor inbound topics for connection requests
36
- - **FindRegistrationsTool**: Search for agent registrations by criteria
37
- - **InitiateConnectionTool**: Start a connection with another agent
38
- - **ListConnectionsTool**: View existing agent connections
39
- - **ConnectionMonitorTool**: Monitor connection status changes
40
- - **ManageConnectionRequestsTool**: Handle incoming connection requests
41
- - **AcceptConnectionRequestTool**: Accept pending connection requests
42
- - **ListUnapprovedConnectionRequestsTool**: View pending requests
31
+ - **HCS-10 Agent Tools**: Complete toolkit for agent registration, discovery, and communication
32
+ - **Plugin System**: Extensible architecture for adding custom capabilities
33
+ - **LangChain Integration**: Seamless integration with LangChain for AI agent development
34
+ - **Built on Hedera Agent Kit**: Leverages the powerful Hedera Agent Kit for blockchain interactions
35
+ - **OpenConvAI Plugin Support**: Pre-built integration with the OpenConvAI standards plugin
36
+ - **TypeScript Support**: Full TypeScript support with comprehensive type definitions
37
+ - **State Management**: Built-in state management for agent operations
43
38
 
44
- ## Running Demos
39
+ ## Usage
45
40
 
46
- The Agent Kit includes demo implementations that showcase various features. Follow these steps to run them:
41
+ ### Basic Setup with LangChain
47
42
 
48
- 1. Clone the repository
43
+ ```typescript
44
+ import { HederaAgentKit } from 'hedera-agent-kit';
45
+ import {
46
+ RegisterAgentTool,
47
+ FindRegistrationsTool,
48
+ InitiateConnectionTool,
49
+ SendMessageToConnectionTool,
50
+ HCS10Builder,
51
+ OpenConvaiState
52
+ } from '@hashgraphonline/standards-agent-kit';
53
+
54
+ // Initialize HederaAgentKit
55
+ const hederaKit = new HederaAgentKit({
56
+ accountId: process.env.HEDERA_ACCOUNT_ID,
57
+ privateKey: process.env.HEDERA_PRIVATE_KEY,
58
+ network: 'testnet'
59
+ });
60
+
61
+ // Create state manager and builder
62
+ const stateManager = new OpenConvaiState();
63
+ const hcs10Builder = new HCS10Builder(hederaKit, stateManager);
64
+
65
+ // Create tools
66
+ const tools = [
67
+ new RegisterAgentTool({ hederaKit, hcs10Builder }),
68
+ new FindRegistrationsTool({ hederaKit, hcs10Builder }),
69
+ new InitiateConnectionTool({ hederaKit, hcs10Builder }),
70
+ new SendMessageToConnectionTool({ hederaKit, hcs10Builder })
71
+ ];
72
+
73
+ // Use tools with LangChain
74
+ import { ChatOpenAI } from '@langchain/openai';
75
+ import { createToolCallingAgent } from 'langchain/agents';
76
+
77
+ const llm = new ChatOpenAI({
78
+ modelName: 'gpt-4',
79
+ openAIApiKey: process.env.OPENAI_API_KEY
80
+ });
81
+
82
+ const agent = await createToolCallingAgent({
83
+ llm,
84
+ tools,
85
+ prompt: /* your prompt */
86
+ });
87
+ ```
88
+
89
+ ### Using with OpenConvAI Plugin
90
+
91
+ ```typescript
92
+ import { StandardsKit } from '@hashgraphonline/standards-agent-plugin';
93
+
94
+ // Initialize StandardsKit with OpenConvAI plugin pre-configured
95
+ const kit = new StandardsKit({
96
+ accountId: process.env.HEDERA_ACCOUNT_ID,
97
+ privateKey: process.env.HEDERA_PRIVATE_KEY,
98
+ network: 'testnet',
99
+ openAIApiKey: process.env.OPENAI_API_KEY
100
+ });
49
101
 
102
+ await kit.initialize();
103
+
104
+ // Use the conversational agent
105
+ const response = await kit.processMessage('Find all registered AI agents');
106
+ ```
107
+
108
+ ## Running Examples
109
+
110
+ 1. Clone the repository
50
111
  ```bash
51
- git clone https://github.com/hashgraph/standards-agent-kit.git
112
+ git clone https://github.com/hashgraph-online/standards-agent-kit.git
52
113
  cd standards-agent-kit
53
114
  ```
54
115
 
55
116
  2. Install dependencies
56
-
57
117
  ```bash
58
- npm install --legacy-peer-deps
118
+ pnpm install
59
119
  ```
60
120
 
61
121
  3. Set up environment variables
62
-
63
122
  ```bash
64
- cp .env.sample .env
123
+ cp .env.example .env
65
124
  ```
66
125
 
67
126
  4. Edit the `.env` file with your Hedera credentials:
68
-
69
127
  ```
70
- HEDERA_ACCOUNT_ID=0.0.xxxxxx
71
- HEDERA_PRIVATE_KEY=302e020100300506032b6570...
128
+ HEDERA_ACCOUNT_ID=0.0.12345
129
+ HEDERA_PRIVATE_KEY=your_private_key_here
72
130
  HEDERA_NETWORK=testnet
73
- REGISTRY_URL=https://moonscape.tech
74
- OPENAI_API_KEY=sk-xxxxxxxxxx # For LangChain demos
131
+ OPENAI_API_KEY=your_openai_key_here # Required for AI demos
75
132
  ```
76
133
 
77
- 5. Run the demos:
78
-
134
+ 5. Run the examples:
79
135
  ```bash
80
- # Run the CLI demo
81
- npm run cli-demo
82
-
83
- # Run the LangChain interactive demo
84
- npm run langchain-demo
85
-
86
- # Run the Standards Expert Agent
87
- npm run standards-expert
88
- ```
136
+ # Interactive CLI demo
137
+ npm run demo:cli
89
138
 
90
- ### Demo Descriptions
139
+ # LangChain integration demo
140
+ npm run demo:langchain
91
141
 
92
- #### CLI Demo
142
+ # Plugin system example
143
+ npm run demo:plugin
93
144
 
94
- The CLI demo provides an interactive menu to:
95
- - Register new agents
96
- - List managed agents
97
- - Initiate and monitor connections
98
- - Send and receive messages between agents
145
+ # OpenConvAI plugin example
146
+ npm run demo:plugin:openconvai
147
+ ```
99
148
 
100
- #### LangChain Interactive Demo
149
+ ## Available Tools
101
150
 
102
- The LangChain demo demonstrates how to:
103
- - Integrate Standards Agent Kit tools with LangChain
104
- - Create AI agents that communicate over Hedera
105
- - Process natural language requests into agent actions
106
- - Handle the full lifecycle of agent-to-agent communication
151
+ The SDK provides a comprehensive set of tools for HCS-10 agent operations:
107
152
 
108
- #### Standards Expert Agent
153
+ - **RegisterAgentTool**: Register new agents on the network
154
+ - **FindRegistrationsTool**: Search for registered agents
155
+ - **RetrieveProfileTool**: Get detailed agent profiles
156
+ - **InitiateConnectionTool**: Start connections between agents
157
+ - **ListConnectionsTool**: View active connections
158
+ - **SendMessageToConnectionTool**: Send messages to connected agents
159
+ - **CheckMessagesTool**: Retrieve messages from connections
160
+ - **ConnectionMonitorTool**: Monitor incoming connection requests
161
+ - **ManageConnectionRequestsTool**: Handle pending connections
162
+ - **AcceptConnectionRequestTool**: Accept incoming connections
163
+ - **ListUnapprovedConnectionRequestsTool**: View pending requests
109
164
 
110
- A specialized agent that runs on a small local LLM to provide expertise about Hedera Standards:
111
- - Uses Llama 3 8B or similar for inference
112
- - Answers questions about standards implementation
113
- - Provides guidance on Standards SDK and Agent Kit usage
114
- - See [Standards Expert README](examples/standards-expert/README.md) for details
165
+ ## Plugin Development
115
166
 
116
- ## Basic Usage
167
+ Create custom plugins by extending the base plugin interface:
117
168
 
118
169
  ```typescript
119
- import { initializeHCS10Client } from '@hashgraphonline/standards-agent-kit';
120
- import dotenv from 'dotenv';
121
-
122
- dotenv.config();
123
-
124
- async function setup() {
125
- const { hcs10Client, tools, stateManager } = await initializeHCS10Client({
126
- clientConfig: {
127
- operatorId: process.env.HEDERA_ACCOUNT_ID,
128
- operatorKey: process.env.HEDERA_PRIVATE_KEY,
129
- network: 'testnet',
130
- useEncryption: false
131
- },
132
- createAllTools: true,
133
- monitoringClient: true
134
- });
135
-
136
- // Access tools
137
- const { registerAgentTool, initiateConnectionTool, sendMessageTool } = tools;
170
+ import { BasePlugin } from '@hashgraphonline/standards-agent-kit';
171
+
172
+ export class MyCustomPlugin extends BasePlugin {
173
+ name = 'my-custom-plugin';
174
+
175
+ async initialize(context) {
176
+ // Initialize your plugin
177
+ }
138
178
 
139
- // Use tools as needed
140
- // ...
179
+ getTools() {
180
+ // Return your custom tools
181
+ }
141
182
  }
142
-
143
- setup();
144
183
  ```
145
184
 
146
- For detailed usage examples and API reference, please refer to the [official documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/).
185
+ ## Contributing
186
+
187
+ Please read our [Contributing Guide](CONTRIBUTING.md) before contributing to this project.
147
188
 
148
189
  ## Resources
149
190
 
150
- - [HCS Standards Documentation](https://hashgraphonline.com/docs/standards/)
191
+ - [Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)
192
+ - [HCS Standards Documentation](https://hcs-improvement-proposals.pages.dev/docs/standards)
151
193
  - [Hedera Documentation](https://docs.hedera.com)
152
- - [Standards SDK](https://hashgraphonline.com/docs/libraries/standards-sdk/)
153
-
154
- ## Contributing
155
-
156
- Contributions are welcome! Please open an issue or submit a pull request.
194
+ - [GitHub Repository](https://github.com/hashgraph-online/standards-agent-kit)
157
195
 
158
196
  ## License
159
197
 
160
198
  Apache-2.0
161
199
 
162
- ## Standards Expert Agent
163
-
164
- The Standards Expert Agent is a specialized AI agent that runs on a small local LLM and can answer questions about the Hedera Standards SDK. It uses the HCS-10 protocol to communicate with clients and provides information about how to use the Standards SDK and Standards Agent Kit.
165
-
166
- ### Features
167
-
168
- - Runs on a small local LLM (Llama 3 8B or similar)
169
- - Focused knowledge on Hedera Standards SDK
170
- - Answers questions about HCS-1, HCS-2, HCS-3, etc.
171
- - Provides implementation guidance for standards
172
- - Self-contained with minimal external dependencies
173
-
174
- ### Installation
175
-
176
- ```bash
177
- # Clone the repository
178
- git clone https://github.com/hashgraph/standards-agent-kit.git
179
- cd standards-agent-kit
180
-
181
- # Install dependencies
182
- npm install
183
-
184
- # Set up the environment
185
- npx ts-node src/agents/standards-expert/cli.ts setup
186
-
187
- # Download a Llama 3 model in GGUF format
188
- mkdir -p models
189
- # Download the model from https://huggingface.co/TheBloke/Llama-3-8B-Instruct-GGUF
190
- # and place it in the models directory
191
-
192
- # Process documentation (optional)
193
- npx ts-node src/agents/standards-expert/cli.ts process-docs -d /path/to/docs
194
-
195
- # Start the agent
196
- npx ts-node src/agents/standards-expert/cli.ts start
197
- ```
198
-
199
- ### Using with PM2
200
-
201
- For production deployment, you can use PM2 to keep the agent running:
202
-
203
- ```bash
204
- # Generate PM2 ecosystem file
205
- npx ts-node src/agents/standards-expert/cli.ts generate-pm2
206
-
207
- # Install PM2 globally
208
- npm install -g pm2
209
-
210
- # Start with PM2
211
- pm2 start ecosystem.config.js
212
- ```
213
-
214
- ### Environment Variables
215
-
216
- Create a `.env` file with the following variables:
217
-
218
- ```
219
- # Hedera Account Information
220
- HEDERA_ACCOUNT_ID=0.0.123456
221
- HEDERA_PRIVATE_KEY=302e...
222
-
223
- # Agent HCS Topics
224
- AGENT_INBOUND_TOPIC_ID=0.0.123456
225
- AGENT_OUTBOUND_TOPIC_ID=0.0.123457
226
-
227
- # Vector Store Configuration
228
- OPENAI_API_KEY=sk-...
229
-
230
- # Model Configuration
231
- LLAMA_MODEL_PATH=./models/llama-3-8b-instruct.Q4_K_M.gguf
232
- ```
@@ -0,0 +1,262 @@
1
+ import { BaseServiceBuilder, HederaAgentKit } from 'hedera-agent-kit';
2
+ import { PrivateKey, TransactionReceipt } from '@hashgraph/sdk';
3
+ import { IStateManager } from '../../state/state-types';
4
+ import { ExecuteResult } from '../types';
5
+ import { FeeConfigBuilderInterface, HCS10Client, ProfileResponse as SDKProfileResponse, HCSMessage, LogLevel, HandleConnectionRequestResponse } from '@hashgraphonline/standards-sdk';
6
+ /**
7
+ * Message response with timestamp
8
+ */
9
+ export interface HCSMessageWithTimestamp extends Omit<HCSMessage, 'op'> {
10
+ timestamp: number;
11
+ data?: string;
12
+ sequence_number: number;
13
+ op?: HCSMessage['op'] | string;
14
+ operator_id?: string;
15
+ created?: Date;
16
+ m?: string;
17
+ }
18
+ /**
19
+ * Network type for HCS-10
20
+ */
21
+ export type StandardNetworkType = 'mainnet' | 'testnet';
22
+ /**
23
+ * Parameters for agent registration
24
+ */
25
+ export interface RegisterAgentParams {
26
+ name: string;
27
+ bio?: string;
28
+ alias?: string;
29
+ type?: 'autonomous' | 'manual';
30
+ model?: string;
31
+ capabilities?: number[];
32
+ creator?: string;
33
+ socials?: Record<string, string>;
34
+ properties?: Record<string, unknown>;
35
+ profilePicture?: string | {
36
+ url?: string;
37
+ path?: string;
38
+ filename?: string;
39
+ };
40
+ existingProfilePictureTopicId?: string;
41
+ initialBalance?: number;
42
+ userAccountId?: string;
43
+ hbarFee?: number;
44
+ tokenFees?: Array<{
45
+ amount: number;
46
+ tokenId: string;
47
+ }>;
48
+ exemptAccountIds?: string[];
49
+ }
50
+ /**
51
+ * Parameters for initiating a connection
52
+ */
53
+ export interface InitiateConnectionParams {
54
+ targetAccountId: string;
55
+ disableMonitor?: boolean;
56
+ memo?: string;
57
+ }
58
+ /**
59
+ * Parameters for accepting a connection request
60
+ */
61
+ export interface AcceptConnectionParams {
62
+ requestKey: string;
63
+ hbarFee?: number | undefined;
64
+ exemptAccountIds?: string[] | undefined;
65
+ }
66
+ /**
67
+ * Parameters for sending a message
68
+ */
69
+ export interface SendMessageParams {
70
+ topicId: string;
71
+ message: string;
72
+ disableMonitoring?: boolean;
73
+ }
74
+ /**
75
+ * Parameters for sending a message to a connected account
76
+ */
77
+ export interface SendMessageToConnectionParams {
78
+ targetIdentifier: string;
79
+ message: string;
80
+ disableMonitoring?: boolean;
81
+ }
82
+ /**
83
+ * HCS10Builder facilitates HCS-10 protocol operations for agent communication
84
+ * This builder incorporates all HCS10Client functionality directly
85
+ */
86
+ export declare class HCS10Builder extends BaseServiceBuilder {
87
+ private standardClient;
88
+ private stateManager;
89
+ private executeResult?;
90
+ private useEncryption;
91
+ private guardedRegistryBaseUrl;
92
+ private network;
93
+ private sdkLogger;
94
+ constructor(hederaKit: HederaAgentKit, stateManager?: IStateManager, options?: {
95
+ useEncryption?: boolean;
96
+ registryUrl?: string;
97
+ logLevel?: LogLevel;
98
+ });
99
+ /**
100
+ * Get the operator account ID
101
+ */
102
+ getOperatorId(): string;
103
+ /**
104
+ * Get the network type
105
+ */
106
+ getNetwork(): StandardNetworkType;
107
+ /**
108
+ * Get account and signer information
109
+ */
110
+ getAccountAndSigner(): {
111
+ accountId: string;
112
+ signer: PrivateKey;
113
+ };
114
+ /**
115
+ * Get the inbound topic ID for the current operator
116
+ */
117
+ getInboundTopicId(): Promise<string>;
118
+ /**
119
+ * Get agent profile
120
+ */
121
+ getAgentProfile(accountId: string): Promise<SDKProfileResponse>;
122
+ /**
123
+ * Submit connection request
124
+ */
125
+ submitConnectionRequest(inboundTopicId: string, memo: string): Promise<TransactionReceipt>;
126
+ /**
127
+ * Handle connection request
128
+ */
129
+ handleConnectionRequest(inboundTopicId: string, requestingAccountId: string, connectionRequestId: number, feeConfig?: FeeConfigBuilderInterface): Promise<HandleConnectionRequestResponse>;
130
+ /**
131
+ * Send message to a topic
132
+ */
133
+ sendMessage(topicId: string, data: string, memo?: string): Promise<{
134
+ sequenceNumber: number | undefined;
135
+ receipt: TransactionReceipt;
136
+ transactionId: string | undefined;
137
+ }>;
138
+ /**
139
+ * Get messages from a topic
140
+ */
141
+ getMessages(topicId: string): Promise<{
142
+ messages: HCSMessageWithTimestamp[];
143
+ }>;
144
+ /**
145
+ * Get message stream from a topic
146
+ */
147
+ getMessageStream(topicId: string): Promise<{
148
+ messages: HCSMessage[];
149
+ }>;
150
+ /**
151
+ * Get message content
152
+ */
153
+ getMessageContent(inscriptionIdOrData: string): Promise<string>;
154
+ /**
155
+ * Get the standard client instance (for compatibility)
156
+ */
157
+ getStandardClient(): HCS10Client;
158
+ /**
159
+ * Load profile picture from URL or file path
160
+ */
161
+ private loadProfilePicture;
162
+ /**
163
+ * Create and register an agent
164
+ */
165
+ private createAndRegisterAgent;
166
+ /**
167
+ * Register a new HCS-10 agent
168
+ * Note: This performs multiple transactions and requires directExecution mode
169
+ */
170
+ registerAgent(params: RegisterAgentParams): Promise<this>;
171
+ /**
172
+ * Initiate a connection to another agent
173
+ */
174
+ initiateConnection(params: InitiateConnectionParams): Promise<this>;
175
+ /**
176
+ * Accept a connection request
177
+ * Note: This performs multiple transactions and requires directExecution mode
178
+ */
179
+ acceptConnection(params: AcceptConnectionParams): Promise<this>;
180
+ /**
181
+ * Send a message using HCS (for operations that need direct topic access)
182
+ */
183
+ sendHCS10Message(params: SendMessageParams): Promise<this>;
184
+ /**
185
+ * Send a message to a connected account with optional response monitoring
186
+ */
187
+ sendMessageToConnection(params: SendMessageToConnectionParams): Promise<this>;
188
+ /**
189
+ * Monitor responses on a topic after sending a message
190
+ */
191
+ private monitorResponses;
192
+ /**
193
+ * Start passive monitoring for incoming connection requests
194
+ * This method monitors continuously in the background
195
+ */
196
+ startPassiveConnectionMonitoring(): Promise<this>;
197
+ /**
198
+ * Monitor for incoming connection requests
199
+ */
200
+ monitorConnections(params: {
201
+ acceptAll?: boolean;
202
+ targetAccountId?: string;
203
+ monitorDurationSeconds?: number;
204
+ hbarFees?: Array<{
205
+ amount: number;
206
+ collectorAccount?: string;
207
+ }>;
208
+ tokenFees?: Array<{
209
+ amount: number;
210
+ tokenId: string;
211
+ collectorAccount?: string;
212
+ }>;
213
+ exemptAccountIds?: string[];
214
+ defaultCollectorAccount?: string;
215
+ }): Promise<this>;
216
+ /**
217
+ * Manage connection requests (list, view, or reject)
218
+ */
219
+ manageConnectionRequests(params: {
220
+ action: 'list' | 'view' | 'reject';
221
+ requestKey?: string;
222
+ }): Promise<this>;
223
+ /**
224
+ * List unapproved connection requests
225
+ */
226
+ listUnapprovedConnectionRequests(): Promise<this>;
227
+ /**
228
+ * List connections with enhanced details
229
+ */
230
+ listConnections(params?: {
231
+ includeDetails?: boolean;
232
+ showPending?: boolean;
233
+ }): Promise<this>;
234
+ private formatConnection;
235
+ private getEnhancedConnections;
236
+ /**
237
+ * Check messages on a connection
238
+ */
239
+ checkMessages(params: {
240
+ targetIdentifier: string;
241
+ fetchLatest?: boolean;
242
+ lastMessagesCount?: number;
243
+ }): Promise<this>;
244
+ /**
245
+ * Find registrations using the configured registry
246
+ */
247
+ findRegistrations(params: {
248
+ accountId?: string;
249
+ tags?: number[];
250
+ }): Promise<this>;
251
+ /**
252
+ * Retrieve detailed profile information for an agent
253
+ */
254
+ retrieveProfile(params: {
255
+ accountId: string;
256
+ disableCache?: boolean;
257
+ }): Promise<this>;
258
+ /**
259
+ * Override execute to return stored HCS10 operation results
260
+ */
261
+ execute(): Promise<ExecuteResult>;
262
+ }
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './hcs10/hcs10-builder';
@@ -0,0 +1,10 @@
1
+ import { TransactionReceipt } from '@hashgraph/sdk';
2
+ export interface ExecuteResult {
3
+ success: boolean;
4
+ receipt?: TransactionReceipt;
5
+ scheduleId?: string;
6
+ error?: string;
7
+ transactionId?: string | undefined;
8
+ rawResult?: unknown;
9
+ notes?: string[];
10
+ }
@@ -1,5 +1,7 @@
1
- export * from './hcs10';
2
1
  export * from './tools';
3
2
  export * from './state';
4
3
  export * from './init';
5
4
  export * from './plugins';
5
+ export { HCS10Builder } from './builders';
6
+ export type { ExecuteResult } from './builders';
7
+ export { HCS10Client } from './hcs10';