@hashgraphonline/standards-agent-kit 0.2.1 → 0.2.102

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 (193) hide show
  1. package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +4 -0
  2. package/dist/cjs/builders/hcs2/hcs2-builder.d.ts +50 -0
  3. package/dist/cjs/builders/hcs2/index.d.ts +1 -0
  4. package/dist/cjs/builders/index.d.ts +2 -0
  5. package/dist/cjs/builders/inscriber/index.d.ts +1 -0
  6. package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +46 -0
  7. package/dist/cjs/index.d.ts +1 -1
  8. package/dist/cjs/standards-agent-kit.cjs +1 -1
  9. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  10. package/dist/cjs/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
  11. package/dist/cjs/tools/hcs10/RegisterAgentTool.d.ts +24 -8
  12. package/dist/cjs/tools/hcs10/index.d.ts +1 -0
  13. package/dist/cjs/tools/hcs10/natural-language-mapper.d.ts +19 -0
  14. package/dist/cjs/tools/hcs2/CreateRegistryTool.d.ts +48 -0
  15. package/dist/cjs/tools/hcs2/DeleteEntryTool.d.ts +41 -0
  16. package/dist/cjs/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
  17. package/dist/cjs/tools/hcs2/QueryRegistryTool.d.ts +47 -0
  18. package/dist/cjs/tools/hcs2/RegisterEntryTool.d.ts +47 -0
  19. package/dist/cjs/tools/hcs2/UpdateEntryTool.d.ts +53 -0
  20. package/dist/cjs/tools/hcs2/base-hcs2-tools.d.ts +28 -0
  21. package/dist/cjs/tools/hcs2/hcs2-tool-params.d.ts +18 -0
  22. package/dist/cjs/tools/hcs2/index.d.ts +8 -0
  23. package/dist/cjs/tools/index.d.ts +2 -0
  24. package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
  25. package/dist/cjs/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
  26. package/dist/cjs/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
  27. package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
  28. package/dist/cjs/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
  29. package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +28 -0
  30. package/dist/cjs/tools/inscriber/index.d.ts +7 -0
  31. package/dist/cjs/tools/inscriber/inscriber-tool-params.d.ts +18 -0
  32. package/dist/es/builders/hcs10/hcs10-builder.d.ts +4 -0
  33. package/dist/es/builders/hcs2/hcs2-builder.d.ts +50 -0
  34. package/dist/es/builders/hcs2/index.d.ts +1 -0
  35. package/dist/es/builders/index.d.ts +2 -0
  36. package/dist/es/builders/inscriber/index.d.ts +1 -0
  37. package/dist/es/builders/inscriber/inscriber-builder.d.ts +46 -0
  38. package/dist/es/index.d.ts +1 -1
  39. package/dist/es/standards-agent-kit.es.js +50 -16
  40. package/dist/es/standards-agent-kit.es.js.map +1 -1
  41. package/dist/es/standards-agent-kit.es10.js +17 -23
  42. package/dist/es/standards-agent-kit.es10.js.map +1 -1
  43. package/dist/es/standards-agent-kit.es11.js +36 -58
  44. package/dist/es/standards-agent-kit.es11.js.map +1 -1
  45. package/dist/es/standards-agent-kit.es12.js +43 -18
  46. package/dist/es/standards-agent-kit.es12.js.map +1 -1
  47. package/dist/es/standards-agent-kit.es13.js +53 -16
  48. package/dist/es/standards-agent-kit.es13.js.map +1 -1
  49. package/dist/es/standards-agent-kit.es14.js +18 -28
  50. package/dist/es/standards-agent-kit.es14.js.map +1 -1
  51. package/dist/es/standards-agent-kit.es15.js +26 -12
  52. package/dist/es/standards-agent-kit.es15.js.map +1 -1
  53. package/dist/es/standards-agent-kit.es16.js +37 -241
  54. package/dist/es/standards-agent-kit.es16.js.map +1 -1
  55. package/dist/es/standards-agent-kit.es17.js +16 -136
  56. package/dist/es/standards-agent-kit.es17.js.map +1 -1
  57. package/dist/es/standards-agent-kit.es18.js +154 -27
  58. package/dist/es/standards-agent-kit.es18.js.map +1 -1
  59. package/dist/es/standards-agent-kit.es19.js +26 -22
  60. package/dist/es/standards-agent-kit.es19.js.map +1 -1
  61. package/dist/es/standards-agent-kit.es2.js +27 -13
  62. package/dist/es/standards-agent-kit.es2.js.map +1 -1
  63. package/dist/es/standards-agent-kit.es20.js +42 -3
  64. package/dist/es/standards-agent-kit.es20.js.map +1 -1
  65. package/dist/es/standards-agent-kit.es21.js +48 -0
  66. package/dist/es/standards-agent-kit.es21.js.map +1 -0
  67. package/dist/es/standards-agent-kit.es22.js +51 -0
  68. package/dist/es/standards-agent-kit.es22.js.map +1 -0
  69. package/dist/es/standards-agent-kit.es23.js +45 -0
  70. package/dist/es/standards-agent-kit.es23.js.map +1 -0
  71. package/dist/es/standards-agent-kit.es24.js +48 -0
  72. package/dist/es/standards-agent-kit.es24.js.map +1 -0
  73. package/dist/es/standards-agent-kit.es25.js +45 -0
  74. package/dist/es/standards-agent-kit.es25.js.map +1 -0
  75. package/dist/es/standards-agent-kit.es26.js +32 -0
  76. package/dist/es/standards-agent-kit.es26.js.map +1 -0
  77. package/dist/es/standards-agent-kit.es27.js +71 -0
  78. package/dist/es/standards-agent-kit.es27.js.map +1 -0
  79. package/dist/es/standards-agent-kit.es28.js +71 -0
  80. package/dist/es/standards-agent-kit.es28.js.map +1 -0
  81. package/dist/es/standards-agent-kit.es29.js +79 -0
  82. package/dist/es/standards-agent-kit.es29.js.map +1 -0
  83. package/dist/es/standards-agent-kit.es3.js +59 -296
  84. package/dist/es/standards-agent-kit.es3.js.map +1 -1
  85. package/dist/es/standards-agent-kit.es30.js +90 -0
  86. package/dist/es/standards-agent-kit.es30.js.map +1 -0
  87. package/dist/es/standards-agent-kit.es31.js +45 -0
  88. package/dist/es/standards-agent-kit.es31.js.map +1 -0
  89. package/dist/es/standards-agent-kit.es32.js +249 -0
  90. package/dist/es/standards-agent-kit.es32.js.map +1 -0
  91. package/dist/es/standards-agent-kit.es33.js +141 -0
  92. package/dist/es/standards-agent-kit.es33.js.map +1 -0
  93. package/dist/es/standards-agent-kit.es34.js +33 -0
  94. package/dist/es/standards-agent-kit.es34.js.map +1 -0
  95. package/dist/es/standards-agent-kit.es35.js +28 -0
  96. package/dist/es/standards-agent-kit.es35.js.map +1 -0
  97. package/dist/es/standards-agent-kit.es36.js +7 -0
  98. package/dist/es/standards-agent-kit.es36.js.map +1 -0
  99. package/dist/es/standards-agent-kit.es4.js +44 -20
  100. package/dist/es/standards-agent-kit.es4.js.map +1 -1
  101. package/dist/es/standards-agent-kit.es5.js +312 -121
  102. package/dist/es/standards-agent-kit.es5.js.map +1 -1
  103. package/dist/es/standards-agent-kit.es6.js +24 -23
  104. package/dist/es/standards-agent-kit.es6.js.map +1 -1
  105. package/dist/es/standards-agent-kit.es7.js +220 -20
  106. package/dist/es/standards-agent-kit.es7.js.map +1 -1
  107. package/dist/es/standards-agent-kit.es8.js +20 -29
  108. package/dist/es/standards-agent-kit.es8.js.map +1 -1
  109. package/dist/es/standards-agent-kit.es9.js +26 -36
  110. package/dist/es/standards-agent-kit.es9.js.map +1 -1
  111. package/dist/es/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
  112. package/dist/es/tools/hcs10/RegisterAgentTool.d.ts +24 -8
  113. package/dist/es/tools/hcs10/index.d.ts +1 -0
  114. package/dist/es/tools/hcs10/natural-language-mapper.d.ts +19 -0
  115. package/dist/es/tools/hcs2/CreateRegistryTool.d.ts +48 -0
  116. package/dist/es/tools/hcs2/DeleteEntryTool.d.ts +41 -0
  117. package/dist/es/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
  118. package/dist/es/tools/hcs2/QueryRegistryTool.d.ts +47 -0
  119. package/dist/es/tools/hcs2/RegisterEntryTool.d.ts +47 -0
  120. package/dist/es/tools/hcs2/UpdateEntryTool.d.ts +53 -0
  121. package/dist/es/tools/hcs2/base-hcs2-tools.d.ts +28 -0
  122. package/dist/es/tools/hcs2/hcs2-tool-params.d.ts +18 -0
  123. package/dist/es/tools/hcs2/index.d.ts +8 -0
  124. package/dist/es/tools/index.d.ts +2 -0
  125. package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
  126. package/dist/es/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
  127. package/dist/es/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
  128. package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
  129. package/dist/es/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
  130. package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +28 -0
  131. package/dist/es/tools/inscriber/index.d.ts +7 -0
  132. package/dist/es/tools/inscriber/inscriber-tool-params.d.ts +18 -0
  133. package/dist/umd/builders/hcs10/hcs10-builder.d.ts +4 -0
  134. package/dist/umd/builders/hcs2/hcs2-builder.d.ts +50 -0
  135. package/dist/umd/builders/hcs2/index.d.ts +1 -0
  136. package/dist/umd/builders/index.d.ts +2 -0
  137. package/dist/umd/builders/inscriber/index.d.ts +1 -0
  138. package/dist/umd/builders/inscriber/inscriber-builder.d.ts +46 -0
  139. package/dist/umd/index.d.ts +1 -1
  140. package/dist/umd/standards-agent-kit.umd.js +1 -1
  141. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  142. package/dist/umd/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
  143. package/dist/umd/tools/hcs10/RegisterAgentTool.d.ts +24 -8
  144. package/dist/umd/tools/hcs10/index.d.ts +1 -0
  145. package/dist/umd/tools/hcs10/natural-language-mapper.d.ts +19 -0
  146. package/dist/umd/tools/hcs2/CreateRegistryTool.d.ts +48 -0
  147. package/dist/umd/tools/hcs2/DeleteEntryTool.d.ts +41 -0
  148. package/dist/umd/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
  149. package/dist/umd/tools/hcs2/QueryRegistryTool.d.ts +47 -0
  150. package/dist/umd/tools/hcs2/RegisterEntryTool.d.ts +47 -0
  151. package/dist/umd/tools/hcs2/UpdateEntryTool.d.ts +53 -0
  152. package/dist/umd/tools/hcs2/base-hcs2-tools.d.ts +28 -0
  153. package/dist/umd/tools/hcs2/hcs2-tool-params.d.ts +18 -0
  154. package/dist/umd/tools/hcs2/index.d.ts +8 -0
  155. package/dist/umd/tools/index.d.ts +2 -0
  156. package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
  157. package/dist/umd/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
  158. package/dist/umd/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
  159. package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
  160. package/dist/umd/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
  161. package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +28 -0
  162. package/dist/umd/tools/inscriber/index.d.ts +7 -0
  163. package/dist/umd/tools/inscriber/inscriber-tool-params.d.ts +18 -0
  164. package/package.json +32 -30
  165. package/src/builders/hcs10/hcs10-builder.ts +37 -16
  166. package/src/builders/hcs2/hcs2-builder.ts +148 -0
  167. package/src/builders/hcs2/index.ts +1 -0
  168. package/src/builders/index.ts +3 -1
  169. package/src/builders/inscriber/index.ts +1 -0
  170. package/src/builders/inscriber/inscriber-builder.ts +112 -0
  171. package/src/index.ts +1 -1
  172. package/src/tools/hcs10/FindRegistrationsTool.ts +19 -4
  173. package/src/tools/hcs10/RegisterAgentTool.ts +147 -9
  174. package/src/tools/hcs10/index.ts +2 -1
  175. package/src/tools/hcs10/natural-language-mapper.ts +194 -0
  176. package/src/tools/hcs2/CreateRegistryTool.ts +63 -0
  177. package/src/tools/hcs2/DeleteEntryTool.ts +58 -0
  178. package/src/tools/hcs2/MigrateRegistryTool.ts +64 -0
  179. package/src/tools/hcs2/QueryRegistryTool.ts +70 -0
  180. package/src/tools/hcs2/RegisterEntryTool.ts +63 -0
  181. package/src/tools/hcs2/UpdateEntryTool.ts +68 -0
  182. package/src/tools/hcs2/base-hcs2-tools.ts +65 -0
  183. package/src/tools/hcs2/hcs2-tool-params.ts +21 -0
  184. package/src/tools/hcs2/index.ts +8 -0
  185. package/src/tools/index.ts +3 -2
  186. package/src/tools/inscriber/InscribeFromBufferTool.ts +105 -0
  187. package/src/tools/inscriber/InscribeFromFileTool.ts +93 -0
  188. package/src/tools/inscriber/InscribeFromUrlTool.ts +93 -0
  189. package/src/tools/inscriber/InscribeHashinalTool.ts +117 -0
  190. package/src/tools/inscriber/RetrieveInscriptionTool.ts +59 -0
  191. package/src/tools/inscriber/base-inscriber-tools.ts +65 -0
  192. package/src/tools/inscriber/index.ts +7 -0
  193. package/src/tools/inscriber/inscriber-tool-params.ts +21 -0
@@ -1,40 +1,240 @@
1
+ import { AIAgentCapability } from "@hashgraphonline/standards-sdk";
1
2
  import { z } from "zod";
2
- import { BaseHCS10TransactionTool } from "./standards-agent-kit.es4.js";
3
- const InitiateConnectionZodSchema = z.object({
4
- targetAccountId: z.string().describe(
5
- "The Hedera account ID (e.g., 0.0.12345) of the agent you want to connect with."
3
+ import { BaseHCS10TransactionTool } from "./standards-agent-kit.es6.js";
4
+ import { NaturalLanguageMapper } from "./standards-agent-kit.es18.js";
5
+ const RegisterAgentZodSchema = z.object({
6
+ name: z.string().min(1).max(50).describe("A unique name for the agent (1-50 characters)"),
7
+ description: z.string().max(500).optional().describe("Optional bio description for the agent (max 500 characters)"),
8
+ alias: z.string().optional().transform((val) => {
9
+ if (!val || val.toLowerCase().includes("random")) {
10
+ const timestamp = Date.now().toString(36);
11
+ const randomChars = Math.random().toString(36);
12
+ return `bot${timestamp}${randomChars}`;
13
+ }
14
+ return val;
15
+ }).describe(
16
+ 'Optional custom username/alias for the agent. Use "random" to generate a unique alias'
17
+ ),
18
+ type: z.enum(["autonomous", "manual"]).optional().describe("Agent type (default: autonomous)"),
19
+ model: z.string().optional().describe("AI model identifier (default: agent-model-2024)"),
20
+ capabilities: z.union([
21
+ z.array(z.nativeEnum(AIAgentCapability)),
22
+ z.array(z.string()),
23
+ z.string()
24
+ ]).optional().transform((val) => {
25
+ if (!val) return void 0;
26
+ if (typeof val === "string") {
27
+ return NaturalLanguageMapper.parseCapabilities(val);
28
+ }
29
+ if (Array.isArray(val) && val.length > 0 && typeof val[0] === "string") {
30
+ return NaturalLanguageMapper.parseTagsOrCapabilities(val);
31
+ }
32
+ return val;
33
+ }).describe('Agent capabilities - can be capability names (e.g. "ai", "data processing"), capability enum values, or array of either. Common values: "ai"/"text" (TEXT_GENERATION), "data" (DATA_INTEGRATION), "analytics" (TRANSACTION_ANALYTICS)'),
34
+ tags: z.union([
35
+ z.array(z.string()),
36
+ z.string()
37
+ ]).optional().transform((val) => {
38
+ if (!val) return void 0;
39
+ if (typeof val === "string") {
40
+ return NaturalLanguageMapper.parseCapabilities(val);
41
+ }
42
+ return NaturalLanguageMapper.parseTagsOrCapabilities(val);
43
+ }).describe('Tags for the agent (alternative to capabilities) - e.g. "ai", "data", "analytics". Will be converted to appropriate capabilities.'),
44
+ creator: z.string().optional().describe("Creator attribution for the agent"),
45
+ socials: z.record(
46
+ z.enum([
47
+ "twitter",
48
+ "github",
49
+ "discord",
50
+ "telegram",
51
+ "linkedin",
52
+ "youtube",
53
+ "website",
54
+ "x"
55
+ ]),
56
+ z.string()
57
+ ).optional().describe(
58
+ 'Social media links (e.g., {"twitter": "@handle", "discord": "username"})'
59
+ ),
60
+ properties: z.record(z.unknown()).optional().describe("Custom metadata properties for the agent"),
61
+ profilePicture: z.union([
62
+ z.string().describe("URL or local file path to profile picture"),
63
+ z.object({
64
+ url: z.string().optional(),
65
+ path: z.string().optional(),
66
+ filename: z.string().optional()
67
+ })
68
+ ]).optional().describe(
69
+ "Optional profile picture as URL, file path, or object with url/path/filename"
70
+ ),
71
+ existingProfilePictureTopicId: z.string().optional().describe(
72
+ "Topic ID of an existing profile picture to reuse (e.g., 0.0.12345)"
6
73
  ),
7
- disableMonitor: z.boolean().optional().describe(
8
- "If true, does not wait for connection confirmation. Returns immediately after sending the request."
74
+ initialBalance: z.number().positive().optional().describe(
75
+ "Optional initial HBAR balance for the new agent account (will create new account if provided)"
9
76
  ),
10
- memo: z.string().optional().describe(
11
- 'Optional memo to include with the connection request (e.g., "Hello from Alice"). If not provided, defaults to "true" or "false" based on monitoring preference.'
12
- )
77
+ userAccountId: z.string().optional().describe(
78
+ "Optional account ID (e.g., 0.0.12345) to use as the agent account instead of creating a new one"
79
+ ),
80
+ hbarFee: z.number().positive().optional().describe(
81
+ "Optional HBAR fee amount to charge per message on the inbound topic"
82
+ ),
83
+ tokenFees: z.array(
84
+ z.object({
85
+ amount: z.number().positive(),
86
+ tokenId: z.string()
87
+ })
88
+ ).optional().describe("Optional token fees to charge per message"),
89
+ exemptAccountIds: z.array(z.string()).optional().describe("Optional account IDs to exempt from fees"),
90
+ setAsCurrent: z.boolean().optional().describe("Whether to set as current agent (default: true)"),
91
+ persistence: z.object({
92
+ prefix: z.string().optional()
93
+ }).optional().describe("Optional persistence configuration")
13
94
  });
14
- class InitiateConnectionTool extends BaseHCS10TransactionTool {
95
+ class RegisterAgentTool extends BaseHCS10TransactionTool {
15
96
  constructor(params) {
16
97
  super(params);
17
- this.name = "initiate_connection";
18
- this.description = "Actively STARTS a NEW HCS-10 connection TO a specific target agent identified by their account ID. Requires the targetAccountId parameter. Use this ONLY to INITIATE an OUTGOING connection request.";
19
- this.specificInputSchema = InitiateConnectionZodSchema;
98
+ this.name = "register_agent";
99
+ this.description = 'Creates and registers the AI agent on the Hedera network. Returns JSON string with agent details (accountId, privateKey, topics) on success. Supports natural language for capabilities/tags like "ai", "data processing", "analytics". Note: This tool requires multiple transactions and cannot be used in returnBytes mode. If alias is set to "random" or contains "random", a unique alias will be generated.';
100
+ this.specificInputSchema = RegisterAgentZodSchema;
20
101
  this.neverScheduleThisTool = true;
21
102
  this.requiresMultipleTransactions = true;
22
103
  }
23
104
  async callBuilderMethod(builder, specificArgs) {
24
105
  const hcs10Builder = builder;
106
+ this.specificArgs = specificArgs;
25
107
  const params = {
26
- targetAccountId: specificArgs.targetAccountId
108
+ name: specificArgs.name
27
109
  };
28
- if (specificArgs.disableMonitor !== void 0) {
29
- params.disableMonitor = specificArgs.disableMonitor;
110
+ if (specificArgs.description !== void 0) {
111
+ params.bio = specificArgs.description;
112
+ }
113
+ if (specificArgs.alias !== void 0) {
114
+ params.alias = specificArgs.alias;
115
+ } else {
116
+ const randomSuffix = Date.now().toString(36);
117
+ params.alias = `${specificArgs.name}${randomSuffix}`;
118
+ }
119
+ if (specificArgs.type !== void 0) {
120
+ params.type = specificArgs.type;
121
+ }
122
+ if (specificArgs.model !== void 0) {
123
+ params.model = specificArgs.model;
124
+ }
125
+ if (specificArgs.tags !== void 0) {
126
+ params.capabilities = specificArgs.tags;
127
+ } else if (specificArgs.capabilities !== void 0) {
128
+ params.capabilities = specificArgs.capabilities;
129
+ }
130
+ if (specificArgs.creator !== void 0) {
131
+ params.creator = specificArgs.creator;
132
+ }
133
+ if (specificArgs.socials !== void 0) {
134
+ params.socials = specificArgs.socials;
135
+ }
136
+ if (specificArgs.properties !== void 0) {
137
+ params.properties = specificArgs.properties;
138
+ }
139
+ if (specificArgs.profilePicture !== void 0) {
140
+ if (typeof specificArgs.profilePicture === "string") {
141
+ params.profilePicture = specificArgs.profilePicture;
142
+ } else {
143
+ const profilePicObj = {};
144
+ if (specificArgs.profilePicture.url !== void 0) {
145
+ profilePicObj.url = specificArgs.profilePicture.url;
146
+ }
147
+ if (specificArgs.profilePicture.path !== void 0) {
148
+ profilePicObj.path = specificArgs.profilePicture.path;
149
+ }
150
+ if (specificArgs.profilePicture.filename !== void 0) {
151
+ profilePicObj.filename = specificArgs.profilePicture.filename;
152
+ }
153
+ params.profilePicture = profilePicObj;
154
+ }
155
+ }
156
+ if (specificArgs.existingProfilePictureTopicId !== void 0) {
157
+ params.existingProfilePictureTopicId = specificArgs.existingProfilePictureTopicId;
158
+ }
159
+ if (specificArgs.userAccountId !== void 0) {
160
+ params.userAccountId = specificArgs.userAccountId;
161
+ }
162
+ if (specificArgs.hbarFee !== void 0) {
163
+ params.hbarFee = specificArgs.hbarFee;
164
+ }
165
+ if (specificArgs.tokenFees !== void 0) {
166
+ params.tokenFees = specificArgs.tokenFees;
167
+ }
168
+ if (specificArgs.exemptAccountIds !== void 0) {
169
+ params.exemptAccountIds = specificArgs.exemptAccountIds;
170
+ }
171
+ if (specificArgs.initialBalance !== void 0) {
172
+ params.initialBalance = specificArgs.initialBalance;
173
+ }
174
+ await hcs10Builder.registerAgent(params);
175
+ }
176
+ /**
177
+ * Override _call to intercept the result and save agent to state if needed
178
+ */
179
+ async _call(args, runManager) {
180
+ const result = await super._call(args, runManager);
181
+ const shouldSetAsCurrent = this.specificArgs?.setAsCurrent !== false;
182
+ if (this.specificArgs && shouldSetAsCurrent) {
183
+ try {
184
+ const parsed = JSON.parse(result);
185
+ if (parsed.rawResult) {
186
+ this._handleRegistrationResult(parsed.rawResult);
187
+ } else if (parsed.state || parsed.accountId || parsed.metadata) {
188
+ this._handleRegistrationResult(parsed);
189
+ }
190
+ } catch (e) {
191
+ }
192
+ }
193
+ return result;
194
+ }
195
+ /**
196
+ * Extract agent data from registration result and save to state
197
+ */
198
+ _handleRegistrationResult(rawResult) {
199
+ let accountId = rawResult.accountId || rawResult.metadata?.accountId;
200
+ if (!accountId && rawResult.state?.createdResources) {
201
+ const accountResource = rawResult.state.createdResources.find(
202
+ (r) => r.startsWith("account:")
203
+ );
204
+ if (accountResource) {
205
+ accountId = accountResource.split(":")[1];
206
+ }
30
207
  }
31
- if (specificArgs.memo !== void 0) {
32
- params.memo = specificArgs.memo;
208
+ const inboundTopicId = rawResult.inboundTopicId || rawResult.metadata?.inboundTopicId || rawResult.state?.inboundTopicId;
209
+ const outboundTopicId = rawResult.outboundTopicId || rawResult.metadata?.outboundTopicId || rawResult.state?.outboundTopicId;
210
+ const profileTopicId = rawResult.profileTopicId || rawResult.metadata?.profileTopicId || rawResult.state?.profileTopicId;
211
+ const privateKey = rawResult.privateKey || rawResult.metadata?.privateKey;
212
+ if (accountId && inboundTopicId && outboundTopicId && this.specificArgs) {
213
+ const registeredAgent = {
214
+ name: this.specificArgs.name,
215
+ accountId,
216
+ inboundTopicId,
217
+ outboundTopicId,
218
+ profileTopicId,
219
+ privateKey
220
+ };
221
+ const hcs10Builder = this.getServiceBuilder();
222
+ const stateManager = hcs10Builder.getStateManager();
223
+ if (stateManager) {
224
+ stateManager.setCurrentAgent(registeredAgent);
225
+ if (stateManager.persistAgentData) {
226
+ const prefix = this.specificArgs.persistence?.prefix || this.specificArgs.name.toUpperCase().replace(/[^A-Z0-9]/g, "_");
227
+ stateManager.persistAgentData(registeredAgent, {
228
+ type: "env-file",
229
+ prefix
230
+ }).catch(() => {
231
+ });
232
+ }
233
+ }
33
234
  }
34
- await hcs10Builder.initiateConnection(params);
35
235
  }
36
236
  }
37
237
  export {
38
- InitiateConnectionTool
238
+ RegisterAgentTool
39
239
  };
40
240
  //# sourceMappingURL=standards-agent-kit.es7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es7.js","sources":["../../src/tools/hcs10/InitiateConnectionTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10TransactionTool } from './base-hcs10-tools';\nimport { HCS10Builder } from '../../builders/hcs10/hcs10-builder';\nimport { HCS10TransactionToolParams } from './hcs10-tool-params';\nimport { BaseServiceBuilder } from 'hedera-agent-kit';\n\nconst InitiateConnectionZodSchema = z.object({\n targetAccountId: z\n .string()\n .describe(\n 'The Hedera account ID (e.g., 0.0.12345) of the agent you want to connect with.'\n ),\n disableMonitor: z\n .boolean()\n .optional()\n .describe(\n 'If true, does not wait for connection confirmation. Returns immediately after sending the request.'\n ),\n memo: z\n .string()\n .optional()\n .describe(\n 'Optional memo to include with the connection request (e.g., \"Hello from Alice\"). If not provided, defaults to \"true\" or \"false\" based on monitoring preference.'\n ),\n});\n\n/**\n * A tool to actively START a NEW HCS-10 connection TO a target agent.\n * Requires the target agent's account ID.\n * It retrieves their profile, sends a connection request, and optionally waits for confirmation.\n * Use this tool ONLY to actively INITIATE an OUTGOING connection.\n */\nexport class InitiateConnectionTool extends BaseHCS10TransactionTool<\n typeof InitiateConnectionZodSchema\n> {\n name = 'initiate_connection';\n description =\n 'Actively STARTS a NEW HCS-10 connection TO a specific target agent identified by their account ID. Requires the targetAccountId parameter. Use this ONLY to INITIATE an OUTGOING connection request.';\n specificInputSchema = InitiateConnectionZodSchema;\n constructor(params: HCS10TransactionToolParams) {\n super(params);\n this.neverScheduleThisTool = true;\n this.requiresMultipleTransactions = true;\n }\n\n protected async callBuilderMethod(\n builder: BaseServiceBuilder,\n specificArgs: z.infer<typeof InitiateConnectionZodSchema>\n ): Promise<void> {\n const hcs10Builder = builder as HCS10Builder;\n const params: {\n targetAccountId: string;\n disableMonitor?: boolean;\n memo?: string;\n } = {\n targetAccountId: specificArgs.targetAccountId,\n };\n if (specificArgs.disableMonitor !== undefined) {\n params.disableMonitor = specificArgs.disableMonitor;\n }\n if (specificArgs.memo !== undefined) {\n params.memo = specificArgs.memo;\n }\n await hcs10Builder.initiateConnection(params);\n }\n}"],"names":[],"mappings":";;AAMA,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,iBAAiB,EACd,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,gBAAgB,EACb,UACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,MAAM,EACH,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAQM,MAAM,+BAA+B,yBAE1C;AAAA,EAKA,YAAY,QAAoC;AAC9C,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAGpB,SAAK,wBAAwB;AAC7B,SAAK,+BAA+B;AAAA,EACtC;AAAA,EAEA,MAAgB,kBACd,SACA,cACe;AACf,UAAM,eAAe;AACrB,UAAM,SAIF;AAAA,MACF,iBAAiB,aAAa;AAAA,IAAA;AAEhC,QAAI,aAAa,mBAAmB,QAAW;AAC7C,aAAO,iBAAiB,aAAa;AAAA,IACvC;AACA,QAAI,aAAa,SAAS,QAAW;AACnC,aAAO,OAAO,aAAa;AAAA,IAC7B;AACA,UAAM,aAAa,mBAAmB,MAAM;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"standards-agent-kit.es7.js","sources":["../../src/tools/hcs10/RegisterAgentTool.ts"],"sourcesContent":["import { AIAgentCapability } from '@hashgraphonline/standards-sdk';\nimport { z } from 'zod';\nimport { BaseServiceBuilder } from 'hedera-agent-kit';\nimport { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';\nimport {\n HCS10Builder,\n RegisterAgentParams,\n} from '../../builders/hcs10/hcs10-builder';\nimport { BaseHCS10TransactionTool } from './base-hcs10-tools';\nimport { HCS10TransactionToolParams } from './hcs10-tool-params';\nimport { RegisteredAgent } from '../../state/state-types';\nimport { NaturalLanguageMapper } from './natural-language-mapper';\n\nconst RegisterAgentZodSchema = z.object({\n name: z\n .string()\n .min(1)\n .max(50)\n .describe('A unique name for the agent (1-50 characters)'),\n description: z\n .string()\n .max(500)\n .optional()\n .describe('Optional bio description for the agent (max 500 characters)'),\n alias: z\n .string()\n .optional()\n .transform((val) => {\n if (!val || val.toLowerCase().includes('random')) {\n const timestamp = Date.now().toString(36);\n const randomChars = Math.random().toString(36);\n return `bot${timestamp}${randomChars}`;\n }\n return val;\n })\n .describe(\n 'Optional custom username/alias for the agent. Use \"random\" to generate a unique alias'\n ),\n type: z\n .enum(['autonomous', 'manual'])\n .optional()\n .describe('Agent type (default: autonomous)'),\n model: z\n .string()\n .optional()\n .describe('AI model identifier (default: agent-model-2024)'),\n capabilities: z\n .union([\n z.array(z.nativeEnum(AIAgentCapability)),\n z.array(z.string()),\n z.string(),\n ])\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n if (typeof val === 'string') {\n return NaturalLanguageMapper.parseCapabilities(val);\n }\n if (Array.isArray(val) && val.length > 0 && typeof val[0] === 'string') {\n return NaturalLanguageMapper.parseTagsOrCapabilities(val);\n }\n return val as AIAgentCapability[];\n })\n .describe('Agent capabilities - can be capability names (e.g. \"ai\", \"data processing\"), capability enum values, or array of either. Common values: \"ai\"/\"text\" (TEXT_GENERATION), \"data\" (DATA_INTEGRATION), \"analytics\" (TRANSACTION_ANALYTICS)'),\n tags: z\n .union([\n z.array(z.string()),\n z.string(),\n ])\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n if (typeof val === 'string') {\n return NaturalLanguageMapper.parseCapabilities(val);\n }\n return NaturalLanguageMapper.parseTagsOrCapabilities(val);\n })\n .describe('Tags for the agent (alternative to capabilities) - e.g. \"ai\", \"data\", \"analytics\". Will be converted to appropriate capabilities.'),\n creator: z.string().optional().describe('Creator attribution for the agent'),\n socials: z\n .record(\n z.enum([\n 'twitter',\n 'github',\n 'discord',\n 'telegram',\n 'linkedin',\n 'youtube',\n 'website',\n 'x',\n ] as const),\n z.string()\n )\n .optional()\n .describe(\n 'Social media links (e.g., {\"twitter\": \"@handle\", \"discord\": \"username\"})'\n ),\n properties: z\n .record(z.unknown())\n .optional()\n .describe('Custom metadata properties for the agent'),\n profilePicture: z\n .union([\n z.string().describe('URL or local file path to profile picture'),\n z.object({\n url: z.string().optional(),\n path: z.string().optional(),\n filename: z.string().optional(),\n }),\n ])\n .optional()\n .describe(\n 'Optional profile picture as URL, file path, or object with url/path/filename'\n ),\n existingProfilePictureTopicId: z\n .string()\n .optional()\n .describe(\n 'Topic ID of an existing profile picture to reuse (e.g., 0.0.12345)'\n ),\n initialBalance: z\n .number()\n .positive()\n .optional()\n .describe(\n 'Optional initial HBAR balance for the new agent account (will create new account if provided)'\n ),\n userAccountId: z\n .string()\n .optional()\n .describe(\n 'Optional account ID (e.g., 0.0.12345) to use as the agent account instead of creating a new one'\n ),\n hbarFee: z\n .number()\n .positive()\n .optional()\n .describe(\n 'Optional HBAR fee amount to charge per message on the inbound topic'\n ),\n tokenFees: z\n .array(\n z.object({\n amount: z.number().positive(),\n tokenId: z.string(),\n })\n )\n .optional()\n .describe('Optional token fees to charge per message'),\n exemptAccountIds: z\n .array(z.string())\n .optional()\n .describe('Optional account IDs to exempt from fees'),\n setAsCurrent: z\n .boolean()\n .optional()\n .describe('Whether to set as current agent (default: true)'),\n persistence: z\n .object({\n prefix: z.string().optional(),\n })\n .optional()\n .describe('Optional persistence configuration'),\n});\n\nexport class RegisterAgentTool extends BaseHCS10TransactionTool<\n typeof RegisterAgentZodSchema\n> {\n name = 'register_agent';\n description =\n 'Creates and registers the AI agent on the Hedera network. Returns JSON string with agent details (accountId, privateKey, topics) on success. Supports natural language for capabilities/tags like \"ai\", \"data processing\", \"analytics\". Note: This tool requires multiple transactions and cannot be used in returnBytes mode. If alias is set to \"random\" or contains \"random\", a unique alias will be generated.';\n specificInputSchema = RegisterAgentZodSchema;\n private specificArgs: z.infer<typeof RegisterAgentZodSchema> | undefined;\n\n constructor(params: HCS10TransactionToolParams) {\n super(params);\n this.neverScheduleThisTool = true;\n this.requiresMultipleTransactions = true;\n }\n\n protected async callBuilderMethod(\n builder: BaseServiceBuilder,\n specificArgs: z.infer<typeof RegisterAgentZodSchema>\n ): Promise<void> {\n const hcs10Builder = builder as HCS10Builder;\n this.specificArgs = specificArgs;\n const params: RegisterAgentParams = {\n name: specificArgs.name,\n };\n\n if (specificArgs.description !== undefined) {\n params.bio = specificArgs.description;\n }\n if (specificArgs.alias !== undefined) {\n params.alias = specificArgs.alias;\n } else {\n const randomSuffix = Date.now().toString(36);\n params.alias = `${specificArgs.name}${randomSuffix}`;\n }\n if (specificArgs.type !== undefined) {\n params.type = specificArgs.type;\n }\n if (specificArgs.model !== undefined) {\n params.model = specificArgs.model;\n }\n // Handle both capabilities and tags (tags takes precedence if both provided)\n if (specificArgs.tags !== undefined) {\n params.capabilities = specificArgs.tags as AIAgentCapability[];\n } else if (specificArgs.capabilities !== undefined) {\n params.capabilities = specificArgs.capabilities as AIAgentCapability[];\n }\n if (specificArgs.creator !== undefined) {\n params.creator = specificArgs.creator;\n }\n if (specificArgs.socials !== undefined) {\n params.socials = specificArgs.socials;\n }\n if (specificArgs.properties !== undefined) {\n params.properties = specificArgs.properties;\n }\n if (specificArgs.profilePicture !== undefined) {\n if (typeof specificArgs.profilePicture === 'string') {\n params.profilePicture = specificArgs.profilePicture;\n } else {\n const profilePicObj: {\n url?: string;\n path?: string;\n filename?: string;\n } = {};\n if (specificArgs.profilePicture.url !== undefined) {\n profilePicObj.url = specificArgs.profilePicture.url;\n }\n if (specificArgs.profilePicture.path !== undefined) {\n profilePicObj.path = specificArgs.profilePicture.path;\n }\n if (specificArgs.profilePicture.filename !== undefined) {\n profilePicObj.filename = specificArgs.profilePicture.filename;\n }\n params.profilePicture = profilePicObj;\n }\n }\n if (specificArgs.existingProfilePictureTopicId !== undefined) {\n params.existingProfilePictureTopicId =\n specificArgs.existingProfilePictureTopicId;\n }\n if (specificArgs.userAccountId !== undefined) {\n params.userAccountId = specificArgs.userAccountId;\n }\n if (specificArgs.hbarFee !== undefined) {\n params.hbarFee = specificArgs.hbarFee;\n }\n if (specificArgs.tokenFees !== undefined) {\n params.tokenFees = specificArgs.tokenFees;\n }\n if (specificArgs.exemptAccountIds !== undefined) {\n params.exemptAccountIds = specificArgs.exemptAccountIds;\n }\n if (specificArgs.initialBalance !== undefined) {\n params.initialBalance = specificArgs.initialBalance;\n }\n\n await hcs10Builder.registerAgent(params);\n }\n\n /**\n * Override _call to intercept the result and save agent to state if needed\n */\n protected override async _call(\n args: z.infer<ReturnType<this['schema']>>,\n runManager?: CallbackManagerForToolRun\n ): Promise<string> {\n const result = await super._call(args, runManager);\n\n const shouldSetAsCurrent = this.specificArgs?.setAsCurrent !== false;\n\n if (this.specificArgs && shouldSetAsCurrent) {\n try {\n const parsed = JSON.parse(result);\n if (parsed.rawResult) {\n this._handleRegistrationResult(parsed.rawResult);\n } else if (parsed.state || parsed.accountId || parsed.metadata) {\n this._handleRegistrationResult(parsed);\n }\n } catch (e) {}\n }\n\n return result;\n }\n\n /**\n * Extract agent data from registration result and save to state\n */\n private _handleRegistrationResult(rawResult: any): void {\n let accountId = rawResult.accountId || rawResult.metadata?.accountId;\n\n if (!accountId && rawResult.state?.createdResources) {\n const accountResource = rawResult.state.createdResources.find(\n (r: string) => r.startsWith('account:')\n );\n if (accountResource) {\n accountId = accountResource.split(':')[1];\n }\n }\n\n const inboundTopicId =\n rawResult.inboundTopicId ||\n rawResult.metadata?.inboundTopicId ||\n rawResult.state?.inboundTopicId;\n\n const outboundTopicId =\n rawResult.outboundTopicId ||\n rawResult.metadata?.outboundTopicId ||\n rawResult.state?.outboundTopicId;\n\n const profileTopicId =\n rawResult.profileTopicId ||\n rawResult.metadata?.profileTopicId ||\n rawResult.state?.profileTopicId;\n\n const privateKey = rawResult.privateKey || rawResult.metadata?.privateKey;\n\n if (accountId && inboundTopicId && outboundTopicId && this.specificArgs) {\n const registeredAgent: RegisteredAgent = {\n name: this.specificArgs.name,\n accountId,\n inboundTopicId,\n outboundTopicId,\n profileTopicId,\n privateKey,\n };\n\n const hcs10Builder = this.getServiceBuilder() as HCS10Builder;\n const stateManager = hcs10Builder.getStateManager();\n if (stateManager) {\n stateManager.setCurrentAgent(registeredAgent);\n\n if (stateManager.persistAgentData) {\n const prefix =\n this.specificArgs.persistence?.prefix ||\n this.specificArgs.name.toUpperCase().replace(/[^A-Z0-9]/g, '_');\n stateManager\n .persistAgentData(registeredAgent, {\n type: 'env-file',\n prefix: prefix,\n })\n .catch(() => {});\n }\n }\n }\n }\n}\n"],"names":[],"mappings":";;;;AAaA,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,MAAM,EACH,OAAA,EACA,IAAI,CAAC,EACL,IAAI,EAAE,EACN,SAAS,+CAA+C;AAAA,EAC3D,aAAa,EACV,OAAA,EACA,IAAI,GAAG,EACP,SAAA,EACA,SAAS,6DAA6D;AAAA,EACzE,OAAO,EACJ,OAAA,EACA,WACA,UAAU,CAAC,QAAQ;AAClB,QAAI,CAAC,OAAO,IAAI,cAAc,SAAS,QAAQ,GAAG;AAChD,YAAM,YAAY,KAAK,IAAA,EAAM,SAAS,EAAE;A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AC,aAAa,UAAU,OAAO,kBAAkB;AACnD,YAAM,kBAAkB,UAAU,MAAM,iBAAiB;AAAA,QACvD,CAAC,MAAc,EAAE,WAAW,UAAU;AAAA,MAAA;AAExC,UAAI,iBAAiB;AACnB,oBAAY,gBAAgB,MAAM,GAAG,EAAE,CAAC;AAAA,MAC1C;AAAA,IACF;AAEA,UAAM,iBACJ,UAAU,kBACV,UAAU,UAAU,kBACpB,UAAU,OAAO;AAEnB,UAAM,kBACJ,UAAU,mBACV,UAAU,UAAU,mBACpB,UAAU,OAAO;AAEnB,UAAM,iBACJ,UAAU,kBACV,UAAU,UAAU,kBACpB,UAAU,OAAO;AAEnB,UAAM,aAAa,UAAU,cAAc,UAAU,UAAU;AAE/D,QAAI,aAAa,kBAAkB,mBAAmB,KAAK,cAAc;AACvE,YAAM,kBAAmC;AAAA,QACvC,MAAM,KAAK,aAAa;AAAA,QACxB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAGF,YAAM,eAAe,KAAK,kBAAA;AAC1B,YAAM,eAAe,aAAa,gBAAA;AAClC,UAAI,cAAc;AAChB,qBAAa,gBAAgB,eAAe;AAE5C,YAAI,aAAa,kBAAkB;AACjC,gBAAM,SACJ,KAAK,aAAa,aAAa,UAC/B,KAAK,aAAa,KAAK,YAAA,EAAc,QAAQ,cAAc,GAAG;AAChE,uBACG,iBAAiB,iBAAiB;AAAA,YACjC,MAAM;AAAA,YACN;AAAA,UAAA,CACD,EACA,MAAM,MAAM;AAAA,UAAC,CAAC;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;"}
@@ -1,40 +1,31 @@
1
1
  import { z } from "zod";
2
- import { BaseHCS10QueryTool } from "./standards-agent-kit.es4.js";
3
- const ListConnectionsZodSchema = z.object({
4
- includeDetails: z.boolean().optional().describe(
5
- "Whether to include detailed information about each connection"
2
+ import { BaseHCS10TransactionTool } from "./standards-agent-kit.es6.js";
3
+ const SendMessageToConnectionZodSchema = z.object({
4
+ targetIdentifier: z.string().describe(
5
+ "The request key (e.g., 'req-1:0.0.6155171@0.0.6154875'), account ID (e.g., 0.0.12345) of the target agent, OR the connection number (e.g., '1', '2') from the 'list_connections' tool. Request key is most deterministic."
6
6
  ),
7
- showPending: z.boolean().optional().describe("Whether to include pending connection requests")
7
+ message: z.string().describe("The text message content to send."),
8
+ disableMonitoring: z.boolean().optional().default(false)
8
9
  });
9
- class ListConnectionsTool extends BaseHCS10QueryTool {
10
+ class SendMessageToConnectionTool extends BaseHCS10TransactionTool {
10
11
  constructor(params) {
11
12
  super(params);
12
- this.name = "list_connections";
13
- this.description = "Lists the currently active HCS-10 connections with detailed information. Shows connection status, agent details, and recent activity. Use this to get a comprehensive view of all active connections.";
14
- this.specificInputSchema = ListConnectionsZodSchema;
13
+ this.name = "send_message_to_connection";
14
+ this.description = "Sends a text message to another agent using an existing active connection. Identify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'. Return back the reply from the target agent if possible";
15
+ this.specificInputSchema = SendMessageToConnectionZodSchema;
16
+ this.requiresMultipleTransactions = true;
17
+ this.neverScheduleThisTool = true;
15
18
  }
16
- async executeQuery(args) {
17
- const hcs10Builder = this.hcs10Builder;
18
- const params = {};
19
- if (args.includeDetails !== void 0) {
20
- params.includeDetails = args.includeDetails;
21
- }
22
- if (args.showPending !== void 0) {
23
- params.showPending = args.showPending;
24
- }
25
- await hcs10Builder.listConnections(params);
26
- const result = await hcs10Builder.execute();
27
- if (result.success && "rawResult" in result && result.rawResult) {
28
- const raw = result.rawResult;
29
- return {
30
- success: true,
31
- data: raw.formattedOutput || raw.message || "Connections listed"
32
- };
33
- }
34
- return result;
19
+ async callBuilderMethod(builder, specificArgs) {
20
+ const hcs10Builder = builder;
21
+ await hcs10Builder.sendMessageToConnection({
22
+ targetIdentifier: specificArgs.targetIdentifier,
23
+ message: specificArgs.message,
24
+ disableMonitoring: specificArgs.disableMonitoring
25
+ });
35
26
  }
36
27
  }
37
28
  export {
38
- ListConnectionsTool
29
+ SendMessageToConnectionTool
39
30
  };
40
31
  //# sourceMappingURL=standards-agent-kit.es8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es8.js","sources":["../../src/tools/hcs10/ListConnectionsTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\n\n/**\n * A tool to list currently active HCS-10 connections stored in the state manager.\n * Enhanced to show more details similar to moonscape's implementation.\n */\nconst ListConnectionsZodSchema = z.object({\n includeDetails: z\n .boolean()\n .optional()\n .describe(\n 'Whether to include detailed information about each connection'\n ),\n showPending: z\n .boolean()\n .optional()\n .describe('Whether to include pending connection requests'),\n});\n\nexport class ListConnectionsTool extends BaseHCS10QueryTool<\n typeof ListConnectionsZodSchema\n> {\n name = 'list_connections';\n description =\n 'Lists the currently active HCS-10 connections with detailed information. Shows connection status, agent details, and recent activity. Use this to get a comprehensive view of all active connections.';\n specificInputSchema = ListConnectionsZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery(\n args: z.infer<typeof ListConnectionsZodSchema>\n ): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n const params: { includeDetails?: boolean; showPending?: boolean } = {};\n if (args.includeDetails !== undefined) {\n params.includeDetails = args.includeDetails;\n }\n if (args.showPending !== undefined) {\n params.showPending = args.showPending;\n }\n await hcs10Builder.listConnections(params);\n\n const result = await hcs10Builder.execute();\n\n if (result.success && 'rawResult' in result && result.rawResult) {\n const raw = result.rawResult as { formattedOutput?: string; message?: string };\n return {\n success: true,\n data: raw.formattedOutput || raw.message || 'Connections listed'\n };\n }\n\n return result;\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,gBAAgB,EACb,UACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,aAAa,EACV,QAAA,EACA,SAAA,EACA,SAAS,gDAAgD;AAC9D,CAAC;AAEM,MAAM,4BAA4B,mBAEvC;AAAA,EAKA,YAAY,QAA8B;AACxC,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aACd,MACkB;AAClB,UAAM,eAAe,KAAK;AAC1B,UAAM,SAA8D,CAAA;AACpE,QAAI,KAAK,mBAAmB,QAAW;AACrC,aAAO,iBAAiB,KAAK;AAAA,IAC/B;AACA,QAAI,KAAK,gBAAgB,QAAW;AAClC,aAAO,cAAc,KAAK;AAAA,IAC5B;AACA,UAAM,aAAa,gBAAgB,MAAM;AAEzC,UAAM,SAAS,MAAM,aAAa,QAAA;AAElC,QAAI,OAAO,WAAW,eAAe,UAAU,OAAO,WAAW;AAC/D,YAAM,MAAM,OAAO;AACnB,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM,IAAI,mBAAmB,IAAI,WAAW;AAAA,MAAA;AAAA,IAEhD;AAEA,WAAO;AAAA,EACT;AACF;"}
1
+ {"version":3,"file":"standards-agent-kit.es8.js","sources":["../../src/tools/hcs10/SendMessageToConnectionTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10TransactionTool } from './base-hcs10-tools';\nimport { HCS10Builder } from '../../builders/hcs10/hcs10-builder';\nimport { HCS10TransactionToolParams } from './hcs10-tool-params';\nimport { BaseServiceBuilder } from 'hedera-agent-kit';\n\nconst SendMessageToConnectionZodSchema = z.object({\n targetIdentifier: z\n .string()\n .describe(\n \"The request key (e.g., 'req-1:0.0.6155171@0.0.6154875'), account ID (e.g., 0.0.12345) of the target agent, OR the connection number (e.g., '1', '2') from the 'list_connections' tool. Request key is most deterministic.\"\n ),\n message: z.string().describe('The text message content to send.'),\n disableMonitoring: z.boolean().optional().default(false),\n});\n\n/**\n * A tool to send a message to an agent over an established HCS-10 connection.\n */\nexport class SendMessageToConnectionTool extends BaseHCS10TransactionTool<\n typeof SendMessageToConnectionZodSchema\n> {\n name = 'send_message_to_connection';\n description =\n \"Sends a text message to another agent using an existing active connection. Identify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'. Return back the reply from the target agent if possible\";\n specificInputSchema = SendMessageToConnectionZodSchema;\n constructor(params: HCS10TransactionToolParams) {\n super(params);\n this.requiresMultipleTransactions = true;\n this.neverScheduleThisTool = true;\n }\n\n protected async callBuilderMethod(\n builder: BaseServiceBuilder,\n specificArgs: z.infer<typeof SendMessageToConnectionZodSchema>\n ): Promise<void> {\n const hcs10Builder = builder as HCS10Builder;\n\n await hcs10Builder.sendMessageToConnection({\n targetIdentifier: specificArgs.targetIdentifier,\n message: specificArgs.message,\n disableMonitoring: specificArgs.disableMonitoring,\n });\n }\n}"],"names":[],"mappings":";;AAMA,MAAM,mCAAmC,EAAE,OAAO;AAAA,EAChD,kBAAkB,EACf,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,SAAS,EAAE,SAAS,SAAS,mCAAmC;AAAA,EAChE,mBAAmB,EAAE,QAAA,EAAU,SAAA,EAAW,QAAQ,KAAK;AACzD,CAAC;AAKM,MAAM,oCAAoC,yBAE/C;AAAA,EAKA,YAAY,QAAoC;AAC9C,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAGpB,SAAK,+BAA+B;AACpC,SAAK,wBAAwB;AAAA,EAC/B;AAAA,EAEA,MAAgB,kBACd,SACA,cACe;AACf,UAAM,eAAe;AAErB,UAAM,aAAa,wBAAwB;AAAA,MACzC,kBAAkB,aAAa;AAAA,MAC/B,SAAS,aAAa;AAAA,MACtB,mBAAmB,aAAa;AAAA,IAAA,CACjC;AAAA,EACH;AACF;"}
@@ -1,50 +1,40 @@
1
1
  import { z } from "zod";
2
- import { BaseHCS10QueryTool } from "./standards-agent-kit.es4.js";
3
- const CheckMessagesZodSchema = z.object({
4
- targetIdentifier: z.string().describe(
5
- "The account ID (e.g., 0.0.12345) of the target agent OR the connection number (e.g., '1', '2') from the 'list_connections' tool to check messages for."
2
+ import { BaseHCS10TransactionTool } from "./standards-agent-kit.es6.js";
3
+ const InitiateConnectionZodSchema = z.object({
4
+ targetAccountId: z.string().describe(
5
+ "The Hedera account ID (e.g., 0.0.12345) of the agent you want to connect with."
6
6
  ),
7
- fetchLatest: z.boolean().optional().default(false).describe(
8
- "Set to true to fetch the latest messages even if they have been seen before, ignoring the last checked timestamp. Defaults to false (fetching only new messages)."
7
+ disableMonitor: z.boolean().optional().describe(
8
+ "If true, does not wait for connection confirmation. Returns immediately after sending the request."
9
9
  ),
10
- lastMessagesCount: z.number().int().positive().optional().describe(
11
- "When fetchLatest is true, specifies how many of the most recent messages to retrieve. Defaults to 1."
10
+ memo: z.string().optional().describe(
11
+ 'Optional memo to include with the connection request (e.g., "Hello from Alice"). If not provided, defaults to "true" or "false" based on monitoring preference.'
12
12
  )
13
13
  });
14
- class CheckMessagesTool extends BaseHCS10QueryTool {
14
+ class InitiateConnectionTool extends BaseHCS10TransactionTool {
15
15
  constructor(params) {
16
16
  super(params);
17
- this.name = "check_messages";
18
- this.description = `Checks for and retrieves messages from an active connection.
19
- Identify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'.
20
- By default, it only retrieves messages newer than the last check.
21
- Use 'fetchLatest: true' to get the most recent messages regardless of when they arrived.
22
- Use 'lastMessagesCount' to specify how many latest messages to retrieve (default 1 when fetchLatest is true).`;
23
- this.specificInputSchema = CheckMessagesZodSchema;
17
+ this.name = "initiate_connection";
18
+ this.description = "Actively STARTS a NEW HCS-10 connection TO a specific target agent identified by their account ID. Requires the targetAccountId parameter. Use this ONLY to INITIATE an OUTGOING connection request.";
19
+ this.specificInputSchema = InitiateConnectionZodSchema;
20
+ this.neverScheduleThisTool = true;
21
+ this.requiresMultipleTransactions = true;
24
22
  }
25
- async executeQuery({
26
- targetIdentifier,
27
- fetchLatest,
28
- lastMessagesCount
29
- }) {
30
- const hcs10Builder = this.hcs10Builder;
31
- await hcs10Builder.checkMessages({
32
- targetIdentifier,
33
- fetchLatest,
34
- lastMessagesCount: lastMessagesCount || 1
35
- });
36
- const result = await hcs10Builder.execute();
37
- if (result.success && "rawResult" in result && result.rawResult) {
38
- const raw = result.rawResult;
39
- return {
40
- success: true,
41
- data: raw.formattedOutput || raw.message || "Messages checked"
42
- };
23
+ async callBuilderMethod(builder, specificArgs) {
24
+ const hcs10Builder = builder;
25
+ const params = {
26
+ targetAccountId: specificArgs.targetAccountId
27
+ };
28
+ if (specificArgs.disableMonitor !== void 0) {
29
+ params.disableMonitor = specificArgs.disableMonitor;
43
30
  }
44
- return result;
31
+ if (specificArgs.memo !== void 0) {
32
+ params.memo = specificArgs.memo;
33
+ }
34
+ await hcs10Builder.initiateConnection(params);
45
35
  }
46
36
  }
47
37
  export {
48
- CheckMessagesTool
38
+ InitiateConnectionTool
49
39
  };
50
40
  //# sourceMappingURL=standards-agent-kit.es9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es9.js","sources":["../../src/tools/hcs10/CheckMessagesTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\n\n/**\n * A tool to check for new messages on an active HCS-10 connection topic,\n * or optionally fetch the latest messages regardless of timestamp.\n */\nconst CheckMessagesZodSchema = z.object({\n targetIdentifier: z\n .string()\n .describe(\n \"The account ID (e.g., 0.0.12345) of the target agent OR the connection number (e.g., '1', '2') from the 'list_connections' tool to check messages for.\"\n ),\n fetchLatest: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n 'Set to true to fetch the latest messages even if they have been seen before, ignoring the last checked timestamp. Defaults to false (fetching only new messages).'\n ),\n lastMessagesCount: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'When fetchLatest is true, specifies how many of the most recent messages to retrieve. Defaults to 1.'\n ),\n});\n\nexport class CheckMessagesTool extends BaseHCS10QueryTool<\n typeof CheckMessagesZodSchema\n> {\n name = 'check_messages';\n description = `Checks for and retrieves messages from an active connection.\nIdentify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'.\nBy default, it only retrieves messages newer than the last check.\nUse 'fetchLatest: true' to get the most recent messages regardless of when they arrived.\nUse 'lastMessagesCount' to specify how many latest messages to retrieve (default 1 when fetchLatest is true).`;\n specificInputSchema = CheckMessagesZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery({\n targetIdentifier,\n fetchLatest,\n lastMessagesCount,\n }: z.infer<typeof CheckMessagesZodSchema>): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n await hcs10Builder.checkMessages({\n targetIdentifier,\n fetchLatest,\n lastMessagesCount: lastMessagesCount || 1,\n });\n\n const result = await hcs10Builder.execute();\n\n if (result.success && 'rawResult' in result && result.rawResult) {\n const raw = result.rawResult as {\n formattedOutput?: string;\n message?: string;\n };\n return {\n success: true,\n data: raw.formattedOutput || raw.message || 'Messages checked',\n };\n }\n\n return result;\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,kBAAkB,EACf,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,aAAa,EACV,QAAA,EACA,WACA,QAAQ,KAAK,EACb;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,mBAAmB,EAChB,SACA,MACA,SAAA,EACA,SAAA,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAEM,MAAM,0BAA0B,mBAErC;AAAA,EAQA,YAAY,QAA8B;AACxC,UAAM,MAAM;AARd,SAAA,OAAO;AACP,SAAA,cAAc;AAAA;AAAA;AAAA;AAAA;AAKd,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAC2D;AAC3D,UAAM,eAAe,KAAK;AAC1B,UAAM,aAAa,cAAc;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,mBAAmB,qBAAqB;AAAA,IAAA,CACzC;AAED,UAAM,SAAS,MAAM,aAAa,QAAA;AAElC,QAAI,OAAO,WAAW,eAAe,UAAU,OAAO,WAAW;AAC/D,YAAM,MAAM,OAAO;AAInB,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM,IAAI,mBAAmB,IAAI,WAAW;AAAA,MAAA;AAAA,IAEhD;AAEA,WAAO;AAAA,EACT;AACF;"}
1
+ {"version":3,"file":"standards-agent-kit.es9.js","sources":["../../src/tools/hcs10/InitiateConnectionTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10TransactionTool } from './base-hcs10-tools';\nimport { HCS10Builder } from '../../builders/hcs10/hcs10-builder';\nimport { HCS10TransactionToolParams } from './hcs10-tool-params';\nimport { BaseServiceBuilder } from 'hedera-agent-kit';\n\nconst InitiateConnectionZodSchema = z.object({\n targetAccountId: z\n .string()\n .describe(\n 'The Hedera account ID (e.g., 0.0.12345) of the agent you want to connect with.'\n ),\n disableMonitor: z\n .boolean()\n .optional()\n .describe(\n 'If true, does not wait for connection confirmation. Returns immediately after sending the request.'\n ),\n memo: z\n .string()\n .optional()\n .describe(\n 'Optional memo to include with the connection request (e.g., \"Hello from Alice\"). If not provided, defaults to \"true\" or \"false\" based on monitoring preference.'\n ),\n});\n\n/**\n * A tool to actively START a NEW HCS-10 connection TO a target agent.\n * Requires the target agent's account ID.\n * It retrieves their profile, sends a connection request, and optionally waits for confirmation.\n * Use this tool ONLY to actively INITIATE an OUTGOING connection.\n */\nexport class InitiateConnectionTool extends BaseHCS10TransactionTool<\n typeof InitiateConnectionZodSchema\n> {\n name = 'initiate_connection';\n description =\n 'Actively STARTS a NEW HCS-10 connection TO a specific target agent identified by their account ID. Requires the targetAccountId parameter. Use this ONLY to INITIATE an OUTGOING connection request.';\n specificInputSchema = InitiateConnectionZodSchema;\n constructor(params: HCS10TransactionToolParams) {\n super(params);\n this.neverScheduleThisTool = true;\n this.requiresMultipleTransactions = true;\n }\n\n protected async callBuilderMethod(\n builder: BaseServiceBuilder,\n specificArgs: z.infer<typeof InitiateConnectionZodSchema>\n ): Promise<void> {\n const hcs10Builder = builder as HCS10Builder;\n const params: {\n targetAccountId: string;\n disableMonitor?: boolean;\n memo?: string;\n } = {\n targetAccountId: specificArgs.targetAccountId,\n };\n if (specificArgs.disableMonitor !== undefined) {\n params.disableMonitor = specificArgs.disableMonitor;\n }\n if (specificArgs.memo !== undefined) {\n params.memo = specificArgs.memo;\n }\n await hcs10Builder.initiateConnection(params);\n }\n}"],"names":[],"mappings":";;AAMA,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,iBAAiB,EACd,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,gBAAgB,EACb,UACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,MAAM,EACH,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAQM,MAAM,+BAA+B,yBAE1C;AAAA,EAKA,YAAY,QAAoC;AAC9C,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAGpB,SAAK,wBAAwB;AAC7B,SAAK,+BAA+B;AAAA,EACtC;AAAA,EAEA,MAAgB,kBACd,SACA,cACe;AACf,UAAM,eAAe;AACrB,UAAM,SAIF;AAAA,MACF,iBAAiB,aAAa;AAAA,IAAA;AAEhC,QAAI,aAAa,mBAAmB,QAAW;AAC7C,aAAO,iBAAiB,aAAa;AAAA,IACvC;AACA,QAAI,aAAa,SAAS,QAAW;AACnC,aAAO,OAAO,aAAa;AAAA,IAC7B;AACA,UAAM,aAAa,mBAAmB,MAAM;AAAA,EAC9C;AACF;"}
@@ -7,26 +7,26 @@ import { HCS10QueryToolParams } from './hcs10-tool-params';
7
7
  */
8
8
  declare const FindRegistrationsZodSchema: z.ZodObject<{
9
9
  accountId: z.ZodOptional<z.ZodString>;
10
- tags: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">>;
10
+ tags: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">, z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | AIAgentCapability[] | undefined>;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  accountId?: string | undefined;
13
13
  tags?: AIAgentCapability[] | undefined;
14
14
  }, {
15
15
  accountId?: string | undefined;
16
- tags?: AIAgentCapability[] | undefined;
16
+ tags?: string | string[] | AIAgentCapability[] | undefined;
17
17
  }>;
18
18
  export declare class FindRegistrationsTool extends BaseHCS10QueryTool<typeof FindRegistrationsZodSchema> {
19
19
  name: string;
20
20
  description: string;
21
21
  specificInputSchema: z.ZodObject<{
22
22
  accountId: z.ZodOptional<z.ZodString>;
23
- tags: z.ZodOptional<z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">>;
23
+ tags: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">, z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | AIAgentCapability[] | undefined>;
24
24
  }, "strip", z.ZodTypeAny, {
25
25
  accountId?: string | undefined;
26
26
  tags?: AIAgentCapability[] | undefined;
27
27
  }, {
28
28
  accountId?: string | undefined;
29
- tags?: AIAgentCapability[] | undefined;
29
+ tags?: string | string[] | AIAgentCapability[] | undefined;
30
30
  }>;
31
31
  constructor(params: HCS10QueryToolParams);
32
32
  protected executeQuery({ accountId, tags, }: z.infer<typeof FindRegistrationsZodSchema>): Promise<unknown>;