@hashgraphonline/standards-agent-kit 0.0.37 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +262 -0
- package/dist/cjs/builders/index.d.ts +2 -0
- package/dist/cjs/builders/types.d.ts +10 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/init/init.d.ts +21 -22
- package/dist/cjs/plugins/PluginInterface.d.ts +4 -80
- package/dist/cjs/plugins/PluginRegistry.d.ts +1 -47
- package/dist/cjs/plugins/defi/index.d.ts +7 -4
- package/dist/cjs/plugins/hedera/HbarPricePlugin.d.ts +7 -35
- package/dist/cjs/plugins/index.d.ts +0 -5
- package/dist/cjs/plugins/weather/index.d.ts +6 -5
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/state/state-types.d.ts +8 -8
- package/dist/cjs/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
- package/dist/cjs/tools/hcs10/CheckMessagesTool.d.ts +40 -0
- package/dist/cjs/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
- package/dist/cjs/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
- package/dist/cjs/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
- package/dist/cjs/tools/hcs10/ListConnectionsTool.d.ts +34 -0
- package/dist/cjs/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
- package/dist/cjs/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
- package/dist/cjs/tools/hcs10/RegisterAgentTool.d.ts +218 -0
- package/dist/cjs/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
- package/dist/cjs/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
- package/dist/cjs/tools/hcs10/base-hcs10-tools.d.ts +28 -0
- package/dist/cjs/tools/hcs10/hcs10-tool-params.d.ts +18 -0
- package/dist/cjs/tools/hcs10/index.d.ts +13 -0
- package/dist/cjs/tools/index.d.ts +1 -13
- package/dist/es/builders/hcs10/hcs10-builder.d.ts +262 -0
- package/dist/es/builders/index.d.ts +2 -0
- package/dist/es/builders/types.d.ts +10 -0
- package/dist/es/index.d.ts +3 -1
- package/dist/es/init/init.d.ts +21 -22
- package/dist/es/plugins/PluginInterface.d.ts +4 -80
- package/dist/es/plugins/PluginRegistry.d.ts +1 -47
- package/dist/es/plugins/defi/index.d.ts +7 -4
- package/dist/es/plugins/hedera/HbarPricePlugin.d.ts +7 -35
- package/dist/es/plugins/index.d.ts +0 -5
- package/dist/es/plugins/weather/index.d.ts +6 -5
- package/dist/es/standards-agent-kit.es.js +10 -18
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +29 -76
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +61 -384
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +22 -190
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +26 -138
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +35 -59
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +11 -117
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +1 -1
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +63 -46
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +25 -74
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +22 -13
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es2.js +1381 -188
- package/dist/es/standards-agent-kit.es2.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +3 -67
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es3.js +285 -347
- package/dist/es/standards-agent-kit.es3.js.map +1 -1
- package/dist/es/standards-agent-kit.es4.js +22 -74
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es5.js +127 -154
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +21 -88
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +28 -86
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +27 -100
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +35 -117
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/state/state-types.d.ts +8 -8
- package/dist/es/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
- package/dist/es/tools/hcs10/CheckMessagesTool.d.ts +40 -0
- package/dist/es/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
- package/dist/es/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
- package/dist/es/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
- package/dist/es/tools/hcs10/ListConnectionsTool.d.ts +34 -0
- package/dist/es/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
- package/dist/es/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
- package/dist/es/tools/hcs10/RegisterAgentTool.d.ts +218 -0
- package/dist/es/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
- package/dist/es/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
- package/dist/es/tools/hcs10/base-hcs10-tools.d.ts +28 -0
- package/dist/es/tools/hcs10/hcs10-tool-params.d.ts +18 -0
- package/dist/es/tools/hcs10/index.d.ts +13 -0
- package/dist/es/tools/index.d.ts +1 -13
- package/dist/umd/builders/hcs10/hcs10-builder.d.ts +262 -0
- package/dist/umd/builders/index.d.ts +2 -0
- package/dist/umd/builders/types.d.ts +10 -0
- package/dist/umd/index.d.ts +3 -1
- package/dist/umd/init/init.d.ts +21 -22
- package/dist/umd/plugins/PluginInterface.d.ts +4 -80
- package/dist/umd/plugins/PluginRegistry.d.ts +1 -47
- package/dist/umd/plugins/defi/index.d.ts +7 -4
- package/dist/umd/plugins/hedera/HbarPricePlugin.d.ts +7 -35
- package/dist/umd/plugins/index.d.ts +0 -5
- package/dist/umd/plugins/weather/index.d.ts +6 -5
- package/dist/umd/standards-agent-kit.umd.js +1 -164
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/state/state-types.d.ts +8 -8
- package/dist/umd/tools/hcs10/AcceptConnectionRequestTool.d.ts +40 -0
- package/dist/umd/tools/hcs10/CheckMessagesTool.d.ts +40 -0
- package/dist/umd/tools/hcs10/ConnectionMonitorTool.d.ts +134 -0
- package/dist/umd/tools/hcs10/FindRegistrationsTool.d.ts +34 -0
- package/dist/umd/tools/hcs10/InitiateConnectionTool.d.ts +43 -0
- package/dist/umd/tools/hcs10/ListConnectionsTool.d.ts +34 -0
- package/dist/umd/tools/hcs10/ListUnapprovedConnectionRequestsTool.d.ts +15 -0
- package/dist/umd/tools/hcs10/ManageConnectionRequestsTool.d.ts +34 -0
- package/dist/umd/tools/hcs10/RegisterAgentTool.d.ts +218 -0
- package/dist/umd/tools/hcs10/RetrieveProfileTool.d.ts +33 -0
- package/dist/umd/tools/hcs10/SendMessageToConnectionTool.d.ts +40 -0
- package/dist/umd/tools/hcs10/base-hcs10-tools.d.ts +28 -0
- package/dist/umd/tools/hcs10/hcs10-tool-params.d.ts +18 -0
- package/dist/umd/tools/hcs10/index.d.ts +13 -0
- package/dist/umd/tools/index.d.ts +1 -13
- package/package.json +41 -41
- package/src/builders/hcs10/hcs10-builder.ts +2108 -0
- package/src/builders/index.ts +2 -0
- package/src/builders/types.ts +11 -0
- package/src/hcs10/HCS10Client.ts +3 -2
- package/src/index.ts +4 -2
- package/src/init/init.ts +85 -63
- package/src/plugins/PluginInterface.ts +15 -94
- package/src/plugins/PluginRegistry.ts +2 -98
- package/src/plugins/defi/index.ts +31 -118
- package/src/plugins/hedera/HbarPricePlugin.ts +19 -100
- package/src/plugins/index.ts +0 -5
- package/src/plugins/weather/index.ts +56 -40
- package/src/state/state-types.ts +9 -11
- package/src/tools/hcs10/AcceptConnectionRequestTool.ts +56 -0
- package/src/tools/hcs10/CheckMessagesTool.ts +73 -0
- package/src/tools/hcs10/ConnectionMonitorTool.ts +111 -0
- package/src/tools/hcs10/FindRegistrationsTool.ts +64 -0
- package/src/tools/hcs10/InitiateConnectionTool.ts +66 -0
- package/src/tools/hcs10/ListConnectionsTool.ts +58 -0
- package/src/tools/hcs10/ListUnapprovedConnectionRequestsTool.ts +26 -0
- package/src/tools/hcs10/ManageConnectionRequestsTool.ts +48 -0
- package/src/tools/hcs10/RegisterAgentTool.ts +213 -0
- package/src/tools/hcs10/RetrieveProfileTool.ts +61 -0
- package/src/tools/hcs10/SendMessageToConnectionTool.ts +45 -0
- package/src/tools/hcs10/base-hcs10-tools.ts +65 -0
- package/src/tools/hcs10/hcs10-tool-params.ts +21 -0
- package/src/tools/hcs10/index.ts +13 -0
- package/src/tools/index.ts +2 -13
- package/src/utils/HederaClient.ts +2 -2
- package/src/utils/ensure-agent-has-hbar.ts +3 -4
- package/dist/cjs/agents/index.d.ts +0 -0
- package/dist/cjs/plugins/BasePlugin.d.ts +0 -28
- package/dist/cjs/plugins/GenericPlugin.d.ts +0 -17
- package/dist/cjs/plugins/HCS10Plugin.d.ts +0 -13
- package/dist/cjs/plugins/PluginLoader.d.ts +0 -38
- package/dist/cjs/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
- package/dist/cjs/plugins/openconvai/index.d.ts +0 -1
- package/dist/cjs/tools/AcceptConnectionRequestTool.d.ts +0 -33
- package/dist/cjs/tools/CheckMessagesTool.d.ts +0 -34
- package/dist/cjs/tools/ConnectionMonitorTool.d.ts +0 -100
- package/dist/cjs/tools/ConnectionTool.d.ts +0 -40
- package/dist/cjs/tools/FindRegistrationsTool.d.ts +0 -28
- package/dist/cjs/tools/InitiateConnectionTool.d.ts +0 -30
- package/dist/cjs/tools/ListConnectionsTool.d.ts +0 -33
- package/dist/cjs/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
- package/dist/cjs/tools/ManageConnectionRequestsTool.d.ts +0 -38
- package/dist/cjs/tools/RegisterAgentTool.d.ts +0 -188
- package/dist/cjs/tools/RetrieveProfileTool.d.ts +0 -34
- package/dist/cjs/tools/SendMessageToConnectionTool.d.ts +0 -34
- package/dist/cjs/tools/SendMessageTool.d.ts +0 -40
- package/dist/es/agents/index.d.ts +0 -0
- package/dist/es/plugins/BasePlugin.d.ts +0 -28
- package/dist/es/plugins/GenericPlugin.d.ts +0 -17
- package/dist/es/plugins/HCS10Plugin.d.ts +0 -13
- package/dist/es/plugins/PluginLoader.d.ts +0 -38
- package/dist/es/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
- package/dist/es/plugins/openconvai/index.d.ts +0 -1
- package/dist/es/standards-agent-kit.es21.js +0 -92
- package/dist/es/standards-agent-kit.es21.js.map +0 -1
- package/dist/es/standards-agent-kit.es22.js +0 -7
- package/dist/es/standards-agent-kit.es22.js.map +0 -1
- package/dist/es/standards-agent-kit.es23.js +0 -106
- package/dist/es/standards-agent-kit.es23.js.map +0 -1
- package/dist/es/standards-agent-kit.es24.js +0 -7
- package/dist/es/standards-agent-kit.es24.js.map +0 -1
- package/dist/es/standards-agent-kit.es25.js +0 -7
- package/dist/es/standards-agent-kit.es25.js.map +0 -1
- package/dist/es/standards-agent-kit.es26.js +0 -85
- package/dist/es/standards-agent-kit.es26.js.map +0 -1
- package/dist/es/standards-agent-kit.es27.js +0 -28
- package/dist/es/standards-agent-kit.es27.js.map +0 -1
- package/dist/es/tools/AcceptConnectionRequestTool.d.ts +0 -33
- package/dist/es/tools/CheckMessagesTool.d.ts +0 -34
- package/dist/es/tools/ConnectionMonitorTool.d.ts +0 -100
- package/dist/es/tools/ConnectionTool.d.ts +0 -40
- package/dist/es/tools/FindRegistrationsTool.d.ts +0 -28
- package/dist/es/tools/InitiateConnectionTool.d.ts +0 -30
- package/dist/es/tools/ListConnectionsTool.d.ts +0 -33
- package/dist/es/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
- package/dist/es/tools/ManageConnectionRequestsTool.d.ts +0 -38
- package/dist/es/tools/RegisterAgentTool.d.ts +0 -188
- package/dist/es/tools/RetrieveProfileTool.d.ts +0 -34
- package/dist/es/tools/SendMessageToConnectionTool.d.ts +0 -34
- package/dist/es/tools/SendMessageTool.d.ts +0 -40
- package/dist/umd/agents/index.d.ts +0 -0
- package/dist/umd/plugins/BasePlugin.d.ts +0 -28
- package/dist/umd/plugins/GenericPlugin.d.ts +0 -17
- package/dist/umd/plugins/HCS10Plugin.d.ts +0 -13
- package/dist/umd/plugins/PluginLoader.d.ts +0 -38
- package/dist/umd/plugins/openconvai/OpenConvAIPlugin.d.ts +0 -23
- package/dist/umd/plugins/openconvai/index.d.ts +0 -1
- package/dist/umd/tools/AcceptConnectionRequestTool.d.ts +0 -33
- package/dist/umd/tools/CheckMessagesTool.d.ts +0 -34
- package/dist/umd/tools/ConnectionMonitorTool.d.ts +0 -100
- package/dist/umd/tools/ConnectionTool.d.ts +0 -40
- package/dist/umd/tools/FindRegistrationsTool.d.ts +0 -28
- package/dist/umd/tools/InitiateConnectionTool.d.ts +0 -30
- package/dist/umd/tools/ListConnectionsTool.d.ts +0 -33
- package/dist/umd/tools/ListUnapprovedConnectionRequestsTool.d.ts +0 -41
- package/dist/umd/tools/ManageConnectionRequestsTool.d.ts +0 -38
- package/dist/umd/tools/RegisterAgentTool.d.ts +0 -188
- package/dist/umd/tools/RetrieveProfileTool.d.ts +0 -34
- package/dist/umd/tools/SendMessageToConnectionTool.d.ts +0 -34
- package/dist/umd/tools/SendMessageTool.d.ts +0 -40
- package/src/agents/index.ts +0 -1
- package/src/plugins/BasePlugin.ts +0 -37
- package/src/plugins/GenericPlugin.ts +0 -19
- package/src/plugins/HCS10Plugin.ts +0 -14
- package/src/plugins/PluginLoader.ts +0 -121
- package/src/plugins/README.md +0 -113
- package/src/plugins/openconvai/OpenConvAIPlugin.ts +0 -124
- package/src/plugins/openconvai/index.ts +0 -1
- package/src/tools/AcceptConnectionRequestTool.ts +0 -196
- package/src/tools/CheckMessagesTool.ts +0 -194
- package/src/tools/ConnectionMonitorTool.ts +0 -550
- package/src/tools/ConnectionTool.ts +0 -231
- package/src/tools/FindRegistrationsTool.ts +0 -114
- package/src/tools/InitiateConnectionTool.ts +0 -137
- package/src/tools/ListConnectionsTool.ts +0 -158
- package/src/tools/ListUnapprovedConnectionRequestsTool.ts +0 -173
- package/src/tools/ManageConnectionRequestsTool.ts +0 -275
- package/src/tools/RegisterAgentTool.ts +0 -590
- package/src/tools/RetrieveProfileTool.ts +0 -94
- package/src/tools/SendMessageToConnectionTool.ts +0 -142
- package/src/tools/SendMessageTool.ts +0 -116
|
@@ -1,95 +1,28 @@
|
|
|
1
|
-
import { StructuredTool } from "@langchain/core/tools";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { BaseHCS10TransactionTool } from "./standards-agent-kit.es4.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
|
+
),
|
|
7
|
+
message: z.string().describe("The text message content to send."),
|
|
8
|
+
disableMonitoring: z.boolean().optional().default(false)
|
|
9
|
+
});
|
|
10
|
+
class SendMessageToConnectionTool extends BaseHCS10TransactionTool {
|
|
11
|
+
constructor(params) {
|
|
12
|
+
super(params);
|
|
11
13
|
this.name = "send_message_to_connection";
|
|
12
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";
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
),
|
|
17
|
-
message: z.string().describe("The text message content to send."),
|
|
18
|
-
disableMonitoring: z.boolean().optional().default(false)
|
|
19
|
-
});
|
|
20
|
-
this.hcsClient = hcsClient;
|
|
21
|
-
this.stateManager = stateManager;
|
|
22
|
-
this.logger = Logger.getInstance({ module: "SendMessageToConnectionTool" });
|
|
23
|
-
}
|
|
24
|
-
async _call({
|
|
25
|
-
targetIdentifier,
|
|
26
|
-
message,
|
|
27
|
-
disableMonitoring
|
|
28
|
-
}) {
|
|
29
|
-
const currentAgent = this.stateManager.getCurrentAgent();
|
|
30
|
-
if (!currentAgent) {
|
|
31
|
-
return "Error: Cannot send message. No agent is currently active. Please register or select an agent first.";
|
|
32
|
-
}
|
|
33
|
-
const connection = this.stateManager.getConnectionByIdentifier(targetIdentifier);
|
|
34
|
-
if (!connection) {
|
|
35
|
-
return `Error: Could not find an active connection matching identifier "${targetIdentifier}". Use 'list_connections' to see active connections.`;
|
|
36
|
-
}
|
|
37
|
-
const connectionTopicId = connection.connectionTopicId;
|
|
38
|
-
const targetAgentName = connection.targetAgentName;
|
|
39
|
-
const operatorId = `${currentAgent.inboundTopicId}@${currentAgent.accountId}`;
|
|
40
|
-
this.logger.info(
|
|
41
|
-
`Sending message from ${operatorId} to ${targetAgentName} (${connection.targetAccountId}) via connection topic ${connectionTopicId}`
|
|
42
|
-
);
|
|
43
|
-
try {
|
|
44
|
-
const sequenceNumber = await this.hcsClient.sendMessage(
|
|
45
|
-
connectionTopicId,
|
|
46
|
-
message,
|
|
47
|
-
// Message content as 'data'
|
|
48
|
-
`Agent message from ${currentAgent.name}`
|
|
49
|
-
// Optional memo
|
|
50
|
-
);
|
|
51
|
-
if (!sequenceNumber) {
|
|
52
|
-
throw new Error("Failed to send message");
|
|
53
|
-
}
|
|
54
|
-
if (!disableMonitoring) {
|
|
55
|
-
return `Message sent to ${targetAgentName} (${connection.targetAccountId}) via connection ${connectionTopicId}. Sequence Number: ${sequenceNumber}`;
|
|
56
|
-
}
|
|
57
|
-
const replyBack = await this.monitorResponses(
|
|
58
|
-
connectionTopicId,
|
|
59
|
-
operatorId,
|
|
60
|
-
sequenceNumber
|
|
61
|
-
);
|
|
62
|
-
if (replyBack) {
|
|
63
|
-
this.logger.info(`Got reply from ${targetAgentName}`, replyBack);
|
|
64
|
-
return `Received reply from ${targetAgentName}: ${replyBack}`;
|
|
65
|
-
}
|
|
66
|
-
return `Message sent to ${targetAgentName} (${connection.targetAccountId}) via connection ${connectionTopicId}. Sequence Number: ${sequenceNumber}`;
|
|
67
|
-
} catch (error) {
|
|
68
|
-
this.logger.error(
|
|
69
|
-
`Failed to send message via connection ${connectionTopicId}: ${error}`
|
|
70
|
-
);
|
|
71
|
-
return `Error sending message to ${targetAgentName}: ${error instanceof Error ? error.message : String(error)}`;
|
|
72
|
-
}
|
|
15
|
+
this.specificInputSchema = SendMessageToConnectionZodSchema;
|
|
16
|
+
this.requiresMultipleTransactions = true;
|
|
17
|
+
this.neverScheduleThisTool = true;
|
|
73
18
|
}
|
|
74
|
-
async
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (message.sequence_number < sequenceNumber || message.operator_id === operatorId) {
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const content = await this.hcsClient.getMessageContent(message.data || "");
|
|
85
|
-
return content;
|
|
86
|
-
}
|
|
87
|
-
} catch (error) {
|
|
88
|
-
this.logger.error(`Error monitoring responses: ${error}`);
|
|
89
|
-
}
|
|
90
|
-
await new Promise((resolve) => setTimeout(resolve, 4e3));
|
|
91
|
-
}
|
|
92
|
-
return null;
|
|
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
|
+
});
|
|
93
26
|
}
|
|
94
27
|
}
|
|
95
28
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es6.js","sources":["../../src/tools/SendMessageToConnectionTool.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es6.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,95 +1,37 @@
|
|
|
1
|
-
import { StructuredTool } from "@langchain/core/tools";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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."
|
|
6
|
+
),
|
|
7
|
+
disableMonitor: z.boolean().optional().describe(
|
|
8
|
+
"If true, does not wait for connection confirmation. Returns immediately after sending the request."
|
|
9
|
+
),
|
|
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
|
+
)
|
|
13
|
+
});
|
|
14
|
+
class InitiateConnectionTool extends BaseHCS10TransactionTool {
|
|
15
|
+
constructor(params) {
|
|
16
|
+
super(params);
|
|
11
17
|
this.name = "initiate_connection";
|
|
12
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.";
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
});
|
|
18
|
-
this.hcsClient = hcsClient;
|
|
19
|
-
this.stateManager = stateManager;
|
|
20
|
-
this.logger = Logger.getInstance({ module: "InitiateConnectionTool" });
|
|
19
|
+
this.specificInputSchema = InitiateConnectionZodSchema;
|
|
20
|
+
this.neverScheduleThisTool = true;
|
|
21
|
+
this.requiresMultipleTransactions = true;
|
|
21
22
|
}
|
|
22
|
-
async
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
28
30
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
);
|
|
32
|
-
try {
|
|
33
|
-
this.logger.debug(`Retrieving profile for ${targetAccountId}...`);
|
|
34
|
-
const targetProfile = await this.hcsClient.getAgentProfile(
|
|
35
|
-
targetAccountId
|
|
36
|
-
);
|
|
37
|
-
if (!targetProfile?.topicInfo?.inboundTopic) {
|
|
38
|
-
return `Error: Could not retrieve profile or find inbound topic ID for target agent ${targetAccountId}. They might not be registered or have a public profile.`;
|
|
39
|
-
}
|
|
40
|
-
const targetInboundTopicId = targetProfile.topicInfo.inboundTopic;
|
|
41
|
-
const targetAgentName = targetProfile.profile.name || `Agent ${targetAccountId}`;
|
|
42
|
-
const requestResult = await this.hcsClient.submitConnectionRequest(
|
|
43
|
-
targetInboundTopicId,
|
|
44
|
-
currentAgent.name
|
|
45
|
-
);
|
|
46
|
-
const sequenceNumberLong = requestResult?.topicSequenceNumber;
|
|
47
|
-
if (!sequenceNumberLong) {
|
|
48
|
-
throw new Error("Connection request sequence number not found.");
|
|
49
|
-
}
|
|
50
|
-
let connectionRequestId;
|
|
51
|
-
try {
|
|
52
|
-
connectionRequestId = sequenceNumberLong.toNumber();
|
|
53
|
-
if (isNaN(connectionRequestId)) {
|
|
54
|
-
throw new Error("Converted sequence number is NaN.");
|
|
55
|
-
}
|
|
56
|
-
} catch (conversionError) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
`Failed to convert connection request sequence number: ${conversionError}`
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
const confirmationTimeoutMs = 6e4;
|
|
62
|
-
const delayMs = 2e3;
|
|
63
|
-
const maxAttempts = Math.ceil(confirmationTimeoutMs / delayMs);
|
|
64
|
-
const confirmationResult = await this.hcsClient.waitForConnectionConfirmation(
|
|
65
|
-
targetInboundTopicId,
|
|
66
|
-
connectionRequestId,
|
|
67
|
-
maxAttempts,
|
|
68
|
-
delayMs
|
|
69
|
-
);
|
|
70
|
-
if (!confirmationResult?.connectionTopicId) {
|
|
71
|
-
return `Error: Connection confirmation not received from ${targetAccountId} (for request ${connectionRequestId}) within ${confirmationTimeoutMs / 1e3} seconds.`;
|
|
72
|
-
}
|
|
73
|
-
const connectionTopicId = confirmationResult.connectionTopicId;
|
|
74
|
-
this.logger.info(`Connection confirmed! Topic ID: ${connectionTopicId}`);
|
|
75
|
-
const newConnection = {
|
|
76
|
-
targetAccountId,
|
|
77
|
-
targetAgentName,
|
|
78
|
-
targetInboundTopicId,
|
|
79
|
-
connectionTopicId
|
|
80
|
-
};
|
|
81
|
-
this.stateManager.addActiveConnection(newConnection);
|
|
82
|
-
const connections = this.stateManager.listConnections();
|
|
83
|
-
const addedEntry = connections.find(
|
|
84
|
-
(c) => c.connectionTopicId === connectionTopicId
|
|
85
|
-
);
|
|
86
|
-
const localConnectionId = addedEntry ? connections.indexOf(addedEntry) + 1 : null;
|
|
87
|
-
const idString = localConnectionId ? `#${localConnectionId}` : "";
|
|
88
|
-
return `Successfully established connection ${idString} with ${targetAgentName} (${targetAccountId}). Connection Topic: ${connectionTopicId}. You can now send messages using this connection.`;
|
|
89
|
-
} catch (error) {
|
|
90
|
-
this.logger.error(`Connection initiation failed: ${error}`);
|
|
91
|
-
return `Error initiating connection with ${targetAccountId}: ${error instanceof Error ? error.message : String(error)}`;
|
|
31
|
+
if (specificArgs.memo !== void 0) {
|
|
32
|
+
params.memo = specificArgs.memo;
|
|
92
33
|
}
|
|
34
|
+
await hcs10Builder.initiateConnection(params);
|
|
93
35
|
}
|
|
94
36
|
}
|
|
95
37
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es7.js","sources":["../../src/tools/InitiateConnectionTool.ts"],"sourcesContent":["import {
|
|
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,110 +1,37 @@
|
|
|
1
|
-
import { StructuredTool } from "@langchain/core/tools";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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"
|
|
6
|
+
),
|
|
7
|
+
showPending: z.boolean().optional().describe("Whether to include pending connection requests")
|
|
8
|
+
});
|
|
9
|
+
class ListConnectionsTool extends BaseHCS10QueryTool {
|
|
10
|
+
constructor(params) {
|
|
11
|
+
super(params);
|
|
7
12
|
this.name = "list_connections";
|
|
8
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.";
|
|
9
|
-
this.
|
|
10
|
-
includeDetails: z.boolean().optional().describe(
|
|
11
|
-
"Whether to include detailed information about each connection"
|
|
12
|
-
),
|
|
13
|
-
showPending: z.boolean().optional().describe("Whether to include pending connection requests")
|
|
14
|
-
});
|
|
15
|
-
this.stateManager = stateManager;
|
|
16
|
-
this.hcsClient = hcsClient;
|
|
17
|
-
this.logger = new Logger({ module: "ListConnectionsTool" });
|
|
14
|
+
this.specificInputSchema = ListConnectionsZodSchema;
|
|
18
15
|
}
|
|
19
|
-
async
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return "There are currently no active connections.";
|
|
16
|
+
async executeQuery(args) {
|
|
17
|
+
const hcs10Builder = this.hcs10Builder;
|
|
18
|
+
const params = {};
|
|
19
|
+
if (args.includeDetails !== void 0) {
|
|
20
|
+
params.includeDetails = args.includeDetails;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
29
|
-
const pendingConnections = connections.filter((c) => c.isPending);
|
|
30
|
-
const needsConfirmation = connections.filter((c) => c.needsConfirmation);
|
|
31
|
-
let output = "";
|
|
32
|
-
if (activeConnections.length > 0) {
|
|
33
|
-
output += `🟢 Active Connections (${activeConnections.length}):
|
|
34
|
-
`;
|
|
35
|
-
activeConnections.forEach((conn, index) => {
|
|
36
|
-
output += this.formatConnection(conn, index, includeDetails);
|
|
37
|
-
});
|
|
38
|
-
output += "\n";
|
|
22
|
+
if (args.showPending !== void 0) {
|
|
23
|
+
params.showPending = args.showPending;
|
|
39
24
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (showPending && pendingConnections.length > 0) {
|
|
49
|
-
output += `⚪ Pending Connection Requests (${pendingConnections.length}):
|
|
50
|
-
`;
|
|
51
|
-
pendingConnections.forEach((conn, index) => {
|
|
52
|
-
output += this.formatConnection(conn, index, includeDetails);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return output.trim();
|
|
56
|
-
}
|
|
57
|
-
formatConnection(conn, index, includeDetails) {
|
|
58
|
-
let output = `${index + 1}. ${conn.profileInfo?.display_name || conn.targetAgentName || "Unknown Agent"} (${conn.targetAccountId})
|
|
59
|
-
`;
|
|
60
|
-
const displayTopicId = conn.isPending ? "(Pending Request)" : conn.connectionTopicId;
|
|
61
|
-
output += ` Topic: ${displayTopicId}
|
|
62
|
-
`;
|
|
63
|
-
const statusText = conn.status || "unknown";
|
|
64
|
-
output += ` Status: ${statusText}
|
|
65
|
-
`;
|
|
66
|
-
if (includeDetails) {
|
|
67
|
-
if (conn.profileInfo?.bio) {
|
|
68
|
-
output += ` Bio: ${conn.profileInfo.bio.substring(0, 100)}${conn.profileInfo.bio.length > 100 ? "..." : ""}
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
if (conn.created) {
|
|
72
|
-
const createdLabel = conn.isPending ? "Request sent" : "Connection established";
|
|
73
|
-
output += ` ${createdLabel}: ${conn.created.toLocaleString()}
|
|
74
|
-
`;
|
|
75
|
-
}
|
|
76
|
-
if (conn.lastActivity) {
|
|
77
|
-
output += ` Last activity: ${conn.lastActivity.toLocaleString()}
|
|
78
|
-
`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return output;
|
|
82
|
-
}
|
|
83
|
-
async getEnhancedConnections() {
|
|
84
|
-
if (!this.hcsClient) {
|
|
85
|
-
return this.stateManager.listConnections();
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
const { accountId } = this.hcsClient.getAccountAndSigner();
|
|
89
|
-
if (!accountId) {
|
|
90
|
-
return this.stateManager.listConnections();
|
|
91
|
-
}
|
|
92
|
-
const connectionManager = this.stateManager.getConnectionsManager();
|
|
93
|
-
if (!connectionManager) {
|
|
94
|
-
this.logger.error("ConnectionsManager not initialized");
|
|
95
|
-
return this.stateManager.listConnections();
|
|
96
|
-
}
|
|
97
|
-
const connections = await connectionManager.fetchConnectionData(
|
|
98
|
-
accountId
|
|
99
|
-
);
|
|
100
|
-
for (const connection of connections) {
|
|
101
|
-
this.stateManager.updateOrAddConnection(connection);
|
|
102
|
-
}
|
|
103
|
-
return connections;
|
|
104
|
-
} catch (error) {
|
|
105
|
-
console.error("Error fetching connection data:", error);
|
|
106
|
-
return this.stateManager.listConnections();
|
|
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
|
+
};
|
|
107
33
|
}
|
|
34
|
+
return result;
|
|
108
35
|
}
|
|
109
36
|
}
|
|
110
37
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es8.js","sources":["../../src/tools/ListConnectionsTool.ts"],"sourcesContent":["import {
|
|
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;"}
|