@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,188 +0,0 @@
|
|
|
1
|
-
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
2
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { IStateManager } from '../state/state-types';
|
|
5
|
-
/**
|
|
6
|
-
* RegisterAgentTool wraps the createAndRegisterAgent() function of HCS10Client.
|
|
7
|
-
* It creates and registers an agent on Hedera using the HCS-10 standard SDK flow.
|
|
8
|
-
* On success, returns a JSON string containing the new agent's details (including private key).
|
|
9
|
-
*/
|
|
10
|
-
export declare class RegisterAgentTool extends StructuredTool {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
private client;
|
|
14
|
-
private stateManager?;
|
|
15
|
-
schema: z.ZodObject<{
|
|
16
|
-
name: z.ZodString;
|
|
17
|
-
description: z.ZodOptional<z.ZodString>;
|
|
18
|
-
type: z.ZodOptional<z.ZodEnum<["autonomous", "manual"]>>;
|
|
19
|
-
model: z.ZodOptional<z.ZodString>;
|
|
20
|
-
capabilities: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
21
|
-
profilePicture: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
22
|
-
url: z.ZodString;
|
|
23
|
-
filename: z.ZodString;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
url?: string;
|
|
26
|
-
filename?: string;
|
|
27
|
-
}, {
|
|
28
|
-
url?: string;
|
|
29
|
-
filename?: string;
|
|
30
|
-
}>, z.ZodObject<{
|
|
31
|
-
path: z.ZodString;
|
|
32
|
-
filename: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
path?: string;
|
|
35
|
-
filename?: string;
|
|
36
|
-
}, {
|
|
37
|
-
path?: string;
|
|
38
|
-
filename?: string;
|
|
39
|
-
}>]>>;
|
|
40
|
-
feeCollectorAccountId: z.ZodOptional<z.ZodString>;
|
|
41
|
-
hbarFee: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
tokenFee: z.ZodOptional<z.ZodObject<{
|
|
43
|
-
amount: z.ZodNumber;
|
|
44
|
-
tokenId: z.ZodString;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
amount?: number;
|
|
47
|
-
tokenId?: string;
|
|
48
|
-
}, {
|
|
49
|
-
amount?: number;
|
|
50
|
-
tokenId?: string;
|
|
51
|
-
}>>;
|
|
52
|
-
hbarFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
|
-
amount: z.ZodNumber;
|
|
54
|
-
collectorAccount: z.ZodOptional<z.ZodString>;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
amount?: number;
|
|
57
|
-
collectorAccount?: string;
|
|
58
|
-
}, {
|
|
59
|
-
amount?: number;
|
|
60
|
-
collectorAccount?: string;
|
|
61
|
-
}>, "many">>;
|
|
62
|
-
tokenFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
-
amount: z.ZodNumber;
|
|
64
|
-
tokenId: z.ZodString;
|
|
65
|
-
collectorAccount: z.ZodOptional<z.ZodString>;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
amount?: number;
|
|
68
|
-
tokenId?: string;
|
|
69
|
-
collectorAccount?: string;
|
|
70
|
-
}, {
|
|
71
|
-
amount?: number;
|
|
72
|
-
tokenId?: string;
|
|
73
|
-
collectorAccount?: string;
|
|
74
|
-
}>, "many">>;
|
|
75
|
-
exemptAccountIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
|
-
setAsCurrent: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
-
persistence: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
79
|
-
}, "strip", z.ZodTypeAny, {
|
|
80
|
-
prefix?: string;
|
|
81
|
-
}, {
|
|
82
|
-
prefix?: string;
|
|
83
|
-
}>>;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
capabilities?: number[];
|
|
86
|
-
type?: "autonomous" | "manual";
|
|
87
|
-
name?: string;
|
|
88
|
-
description?: string;
|
|
89
|
-
model?: string;
|
|
90
|
-
profilePicture?: string | {
|
|
91
|
-
url?: string;
|
|
92
|
-
filename?: string;
|
|
93
|
-
} | {
|
|
94
|
-
path?: string;
|
|
95
|
-
filename?: string;
|
|
96
|
-
};
|
|
97
|
-
feeCollectorAccountId?: string;
|
|
98
|
-
hbarFee?: number;
|
|
99
|
-
tokenFee?: {
|
|
100
|
-
amount?: number;
|
|
101
|
-
tokenId?: string;
|
|
102
|
-
};
|
|
103
|
-
hbarFees?: {
|
|
104
|
-
amount?: number;
|
|
105
|
-
collectorAccount?: string;
|
|
106
|
-
}[];
|
|
107
|
-
tokenFees?: {
|
|
108
|
-
amount?: number;
|
|
109
|
-
tokenId?: string;
|
|
110
|
-
collectorAccount?: string;
|
|
111
|
-
}[];
|
|
112
|
-
exemptAccountIds?: string[];
|
|
113
|
-
setAsCurrent?: boolean;
|
|
114
|
-
persistence?: {
|
|
115
|
-
prefix?: string;
|
|
116
|
-
};
|
|
117
|
-
}, {
|
|
118
|
-
capabilities?: number[];
|
|
119
|
-
type?: "autonomous" | "manual";
|
|
120
|
-
name?: string;
|
|
121
|
-
description?: string;
|
|
122
|
-
model?: string;
|
|
123
|
-
profilePicture?: string | {
|
|
124
|
-
url?: string;
|
|
125
|
-
filename?: string;
|
|
126
|
-
} | {
|
|
127
|
-
path?: string;
|
|
128
|
-
filename?: string;
|
|
129
|
-
};
|
|
130
|
-
feeCollectorAccountId?: string;
|
|
131
|
-
hbarFee?: number;
|
|
132
|
-
tokenFee?: {
|
|
133
|
-
amount?: number;
|
|
134
|
-
tokenId?: string;
|
|
135
|
-
};
|
|
136
|
-
hbarFees?: {
|
|
137
|
-
amount?: number;
|
|
138
|
-
collectorAccount?: string;
|
|
139
|
-
}[];
|
|
140
|
-
tokenFees?: {
|
|
141
|
-
amount?: number;
|
|
142
|
-
tokenId?: string;
|
|
143
|
-
collectorAccount?: string;
|
|
144
|
-
}[];
|
|
145
|
-
exemptAccountIds?: string[];
|
|
146
|
-
setAsCurrent?: boolean;
|
|
147
|
-
persistence?: {
|
|
148
|
-
prefix?: string;
|
|
149
|
-
};
|
|
150
|
-
}>;
|
|
151
|
-
/**
|
|
152
|
-
* Creates a new RegisterAgentTool instance
|
|
153
|
-
* @param client - Instance of HCS10Client (already configured with operator/network)
|
|
154
|
-
* @param stateManager - Optional state manager to store agent details
|
|
155
|
-
*/
|
|
156
|
-
constructor(client: HCS10Client, stateManager?: IStateManager);
|
|
157
|
-
/**
|
|
158
|
-
* Loads a profile picture from a local file or URL and returns a buffer
|
|
159
|
-
* @param profilePicture - Local file path or URL
|
|
160
|
-
* @returns Object containing buffer and filename
|
|
161
|
-
*/
|
|
162
|
-
private loadProfilePicture;
|
|
163
|
-
/**
|
|
164
|
-
* Calls createAndRegisterAgent() with the provided metadata.
|
|
165
|
-
* Returns a JSON string with agent details on success, or an error string.
|
|
166
|
-
*/
|
|
167
|
-
_call(input: z.infer<typeof this.schema>): Promise<string>;
|
|
168
|
-
/**
|
|
169
|
-
* Checks if the token fee configuration is valid
|
|
170
|
-
*/
|
|
171
|
-
private hasValidTokenFee;
|
|
172
|
-
/**
|
|
173
|
-
* Processes the registration result and returns formatted output
|
|
174
|
-
*/
|
|
175
|
-
private processRegistrationResult;
|
|
176
|
-
/**
|
|
177
|
-
* Ensures the agent has enough HBAR for operations
|
|
178
|
-
*/
|
|
179
|
-
private ensureAgentHasFunds;
|
|
180
|
-
/**
|
|
181
|
-
* Validates that all required fields are present in the registration result
|
|
182
|
-
*/
|
|
183
|
-
private validateRegistrationResult;
|
|
184
|
-
/**
|
|
185
|
-
* Creates a description of the fees configured for the agent
|
|
186
|
-
*/
|
|
187
|
-
private createFeeDescription;
|
|
188
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
4
|
-
/**
|
|
5
|
-
* Tool for retrieving the HCS-11 profile associated with a Hedera account ID.
|
|
6
|
-
* Utilizes the HCS10Client's retrieveProfile method, which handles fetching.
|
|
7
|
-
*/
|
|
8
|
-
export declare class RetrieveProfileTool extends StructuredTool {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
private client;
|
|
12
|
-
private logger;
|
|
13
|
-
schema: z.ZodObject<{
|
|
14
|
-
accountId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
disableCache: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
accountId?: string;
|
|
18
|
-
disableCache?: boolean;
|
|
19
|
-
}, {
|
|
20
|
-
accountId?: string;
|
|
21
|
-
disableCache?: boolean;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new RetrieveProfileTool instance.
|
|
25
|
-
* @param client - An instance of HCS10Client.
|
|
26
|
-
*/
|
|
27
|
-
constructor(client: HCS10Client);
|
|
28
|
-
/**
|
|
29
|
-
* Executes the profile retrieval.
|
|
30
|
-
* @param input - The input object containing accountId and optional disableCache flag.
|
|
31
|
-
* @returns A JSON string of the profile on success, or an error message string.
|
|
32
|
-
*/
|
|
33
|
-
_call(input: z.infer<typeof this.schema>): Promise<string>;
|
|
34
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { StructuredTool, ToolParams } from '@langchain/core/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
4
|
-
import { IStateManager } from '../state/state-types';
|
|
5
|
-
export interface SendMessageToConnectionToolParams extends ToolParams {
|
|
6
|
-
hcsClient: HCS10Client;
|
|
7
|
-
stateManager: IStateManager;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A tool to send a message to an agent over an established HCS-10 connection.
|
|
11
|
-
*/
|
|
12
|
-
export declare class SendMessageToConnectionTool extends StructuredTool {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
schema: z.ZodObject<{
|
|
16
|
-
targetIdentifier: z.ZodString;
|
|
17
|
-
message: z.ZodString;
|
|
18
|
-
disableMonitoring: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
message?: string;
|
|
21
|
-
disableMonitoring?: boolean;
|
|
22
|
-
targetIdentifier?: string;
|
|
23
|
-
}, {
|
|
24
|
-
message?: string;
|
|
25
|
-
disableMonitoring?: boolean;
|
|
26
|
-
targetIdentifier?: string;
|
|
27
|
-
}>;
|
|
28
|
-
private hcsClient;
|
|
29
|
-
private stateManager;
|
|
30
|
-
private logger;
|
|
31
|
-
constructor({ hcsClient, stateManager, ...rest }: SendMessageToConnectionToolParams);
|
|
32
|
-
protected _call({ targetIdentifier, message, disableMonitoring, }: z.infer<this['schema']>): Promise<string>;
|
|
33
|
-
private monitorResponses;
|
|
34
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
2
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
/**
|
|
5
|
-
* SendMessageTool wraps the sendMessage() function of HCS10Client.
|
|
6
|
-
* It sends a message to a specified Hedera topic and monitors for responses.
|
|
7
|
-
*/
|
|
8
|
-
export declare class SendMessageTool extends StructuredTool {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
private client;
|
|
12
|
-
private lastProcessedTimestamp;
|
|
13
|
-
private logger;
|
|
14
|
-
schema: z.ZodObject<{
|
|
15
|
-
topicId: z.ZodString;
|
|
16
|
-
message: z.ZodString;
|
|
17
|
-
disableMonitoring: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
message?: string;
|
|
20
|
-
topicId?: string;
|
|
21
|
-
disableMonitoring?: boolean;
|
|
22
|
-
}, {
|
|
23
|
-
message?: string;
|
|
24
|
-
topicId?: string;
|
|
25
|
-
disableMonitoring?: boolean;
|
|
26
|
-
}>;
|
|
27
|
-
/**
|
|
28
|
-
* @param client - Instance of HCS10Client.
|
|
29
|
-
*/
|
|
30
|
-
constructor(client: HCS10Client);
|
|
31
|
-
/**
|
|
32
|
-
* Calls sendMessage() with the provided parameters.
|
|
33
|
-
*/
|
|
34
|
-
_call(input: {
|
|
35
|
-
topicId: string;
|
|
36
|
-
message: string;
|
|
37
|
-
disableMonitoring: boolean;
|
|
38
|
-
}): Promise<string>;
|
|
39
|
-
private monitorResponses;
|
|
40
|
-
}
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IPlugin, BasePluginContext } from './PluginInterface';
|
|
2
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
3
|
-
/**
|
|
4
|
-
* Base class for plugins to simplify implementation
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class BasePlugin<T extends BasePluginContext = BasePluginContext> implements IPlugin<T> {
|
|
7
|
-
abstract id: string;
|
|
8
|
-
abstract name: string;
|
|
9
|
-
abstract description: string;
|
|
10
|
-
abstract version: string;
|
|
11
|
-
abstract author: string;
|
|
12
|
-
protected context: T;
|
|
13
|
-
/**
|
|
14
|
-
* Initialize the plugin with the provided context
|
|
15
|
-
* @param context The context containing shared resources
|
|
16
|
-
*/
|
|
17
|
-
initialize(context: T): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Get the tools provided by this plugin
|
|
20
|
-
* @returns Array of tools provided by this plugin
|
|
21
|
-
*/
|
|
22
|
-
abstract getTools(): StructuredTool[];
|
|
23
|
-
/**
|
|
24
|
-
* Clean up resources when the plugin is unloaded
|
|
25
|
-
* Default implementation does nothing
|
|
26
|
-
*/
|
|
27
|
-
cleanup(): Promise<void>;
|
|
28
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BasePlugin } from './BasePlugin';
|
|
2
|
-
import { GenericPluginContext } from './PluginInterface';
|
|
3
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
4
|
-
/**
|
|
5
|
-
* Base class for platform-agnostic plugins that can be used across different implementations
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class GenericPlugin extends BasePlugin<GenericPluginContext> {
|
|
8
|
-
/**
|
|
9
|
-
* Namespace for the plugin, used for organizing and categorizing plugins
|
|
10
|
-
*/
|
|
11
|
-
abstract namespace: string;
|
|
12
|
-
/**
|
|
13
|
-
* Get the tools provided by this plugin
|
|
14
|
-
* @returns Array of tools provided by this plugin
|
|
15
|
-
*/
|
|
16
|
-
abstract getTools(): StructuredTool[];
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BasePlugin } from './BasePlugin';
|
|
2
|
-
import { PluginContext } from './PluginInterface';
|
|
3
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
4
|
-
/**
|
|
5
|
-
* Base class for plugins that require HCS10 specific functionality
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class HCS10Plugin extends BasePlugin<PluginContext> {
|
|
8
|
-
/**
|
|
9
|
-
* Get the tools provided by this plugin
|
|
10
|
-
* @returns Array of tools provided by this plugin
|
|
11
|
-
*/
|
|
12
|
-
abstract getTools(): StructuredTool[];
|
|
13
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { PluginContext, IPlugin } from './PluginInterface';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for loading a plugin
|
|
4
|
-
*/
|
|
5
|
-
export interface PluginLoadOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Whether to initialize the plugin after loading
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
initialize?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Utility for loading plugins from different sources
|
|
14
|
-
*/
|
|
15
|
-
export declare class PluginLoader {
|
|
16
|
-
/**
|
|
17
|
-
* Load a plugin from a directory
|
|
18
|
-
* @param directory Path to the directory containing the plugin
|
|
19
|
-
* @param context Context to provide to the plugin during initialization
|
|
20
|
-
* @param options Options for loading the plugin
|
|
21
|
-
* @returns The loaded plugin instance
|
|
22
|
-
*/
|
|
23
|
-
static loadFromDirectory(directory: string, context: PluginContext, options?: PluginLoadOptions): Promise<IPlugin>;
|
|
24
|
-
/**
|
|
25
|
-
* Load a plugin from an npm package
|
|
26
|
-
* @param packageName Name of the npm package containing the plugin
|
|
27
|
-
* @param context Context to provide to the plugin during initialization
|
|
28
|
-
* @param options Options for loading the plugin
|
|
29
|
-
* @returns The loaded plugin instance
|
|
30
|
-
*/
|
|
31
|
-
static loadFromPackage(packageName: string, context: PluginContext, options?: PluginLoadOptions): Promise<IPlugin>;
|
|
32
|
-
/**
|
|
33
|
-
* Check if an object implements the IPlugin interface
|
|
34
|
-
* @param obj Object to check
|
|
35
|
-
* @returns true if the object implements IPlugin, false otherwise
|
|
36
|
-
*/
|
|
37
|
-
private static isValidPlugin;
|
|
38
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { GenericPlugin } from '../GenericPlugin';
|
|
2
|
-
import { GenericPluginContext } from '../PluginInterface';
|
|
3
|
-
import { StructuredTool } from '@langchain/core/tools';
|
|
4
|
-
/**
|
|
5
|
-
* OpenConvAI Plugin that provides all the tools from standards-agent-kit
|
|
6
|
-
* This plugin enables full HCS-10 agent functionality including registration,
|
|
7
|
-
* connection management, and messaging capabilities.
|
|
8
|
-
*/
|
|
9
|
-
export declare class OpenConvAIPlugin extends GenericPlugin {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
version: string;
|
|
14
|
-
author: string;
|
|
15
|
-
namespace: string;
|
|
16
|
-
private hcs10Client?;
|
|
17
|
-
private stateManager?;
|
|
18
|
-
private tools;
|
|
19
|
-
initialize(context: GenericPluginContext): Promise<void>;
|
|
20
|
-
private initializeTools;
|
|
21
|
-
getTools(): StructuredTool[];
|
|
22
|
-
cleanup(): Promise<void>;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './OpenConvAIPlugin';
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { StructuredTool } from "@langchain/core/tools";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import axios from "axios";
|
|
4
|
-
const HEDERA_MIRROR_NODE_API = "https://mainnet.mirrornode.hedera.com/api/v1";
|
|
5
|
-
const ExchangeRateResponseSchema = z.object({
|
|
6
|
-
current_rate: z.object({
|
|
7
|
-
cent_equivalent: z.number(),
|
|
8
|
-
hbar_equivalent: z.number(),
|
|
9
|
-
expiration_time: z.number()
|
|
10
|
-
}),
|
|
11
|
-
next_rate: z.object({
|
|
12
|
-
cent_equivalent: z.number(),
|
|
13
|
-
hbar_equivalent: z.number(),
|
|
14
|
-
expiration_time: z.number()
|
|
15
|
-
}),
|
|
16
|
-
timestamp: z.string()
|
|
17
|
-
});
|
|
18
|
-
class GetHbarPriceTool extends StructuredTool {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.name = "getHbarPrice";
|
|
22
|
-
this.description = "Retrieves the current price of HBAR in USD from the Hedera Mirror Node.";
|
|
23
|
-
this.schema = z.object({});
|
|
24
|
-
}
|
|
25
|
-
// No input required for this tool
|
|
26
|
-
/**
|
|
27
|
-
* DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.
|
|
28
|
-
* USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.
|
|
29
|
-
* Retrieves the current price of HBAR in USD from the Hedera Mirror Node.
|
|
30
|
-
* @returns A promise that resolves to a string containing the current HBAR price in USD.
|
|
31
|
-
*/
|
|
32
|
-
async _call() {
|
|
33
|
-
try {
|
|
34
|
-
const response = await axios.get(`${HEDERA_MIRROR_NODE_API}/network/exchangerate`);
|
|
35
|
-
const data = response.data;
|
|
36
|
-
const parsedData = ExchangeRateResponseSchema.safeParse(data);
|
|
37
|
-
if (!parsedData.success) {
|
|
38
|
-
console.error("Failed to parse exchange rate response:", parsedData.error);
|
|
39
|
-
throw new Error("Invalid API response format");
|
|
40
|
-
}
|
|
41
|
-
const { current_rate } = parsedData.data;
|
|
42
|
-
const priceUsd = current_rate.cent_equivalent / current_rate.hbar_equivalent / 100;
|
|
43
|
-
return `The current price of HBAR is $${priceUsd.toFixed(6)} USD.`;
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error("Error fetching HBAR price:", error);
|
|
46
|
-
let errorMessage = "An unknown error occurred";
|
|
47
|
-
if (axios.isAxiosError(error)) {
|
|
48
|
-
errorMessage = error.message;
|
|
49
|
-
if (error.response) {
|
|
50
|
-
errorMessage += ` (Status: ${error.response.status})`;
|
|
51
|
-
}
|
|
52
|
-
} else if (error instanceof Error) {
|
|
53
|
-
errorMessage = error.message;
|
|
54
|
-
}
|
|
55
|
-
return `Failed to retrieve HBAR price: ${errorMessage}`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
class HbarPricePlugin {
|
|
60
|
-
constructor() {
|
|
61
|
-
this.id = "hedera-hbar-price";
|
|
62
|
-
this.name = "Hedera HBAR Price Plugin";
|
|
63
|
-
this.description = "Provides tools to interact with Hedera network data, specifically HBAR price.";
|
|
64
|
-
this.version = "1.0.0";
|
|
65
|
-
this.author = "Hedera Agent";
|
|
66
|
-
this.tools = [new GetHbarPriceTool()];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Initializes the plugin. Currently no specific initialization needed.
|
|
70
|
-
*/
|
|
71
|
-
async initialize() {
|
|
72
|
-
return Promise.resolve();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Returns the tools provided by this plugin.
|
|
76
|
-
* @returns An array containing the GetHbarPriceTool.
|
|
77
|
-
*/
|
|
78
|
-
getTools() {
|
|
79
|
-
return this.tools;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Cleans up resources. Currently no cleanup needed.
|
|
83
|
-
*/
|
|
84
|
-
async cleanup() {
|
|
85
|
-
return Promise.resolve();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
GetHbarPriceTool,
|
|
90
|
-
HbarPricePlugin
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=standards-agent-kit.es21.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es21.js","sources":["../../src/plugins/hedera/HbarPricePlugin.ts"],"sourcesContent":["import { StructuredTool } from '@langchain/core/tools';\nimport { z } from 'zod';\nimport { IPlugin /*, PluginContext */ } from '../PluginInterface';\nimport axios from 'axios'; // Use axios instead of node-fetch\n\nconst HEDERA_MIRROR_NODE_API = 'https://mainnet.mirrornode.hedera.com/api/v1';\n\n/**\n * Defines the schema for the HBAR price API response.\n */\nconst ExchangeRateResponseSchema = z.object({\n current_rate: z.object({\n cent_equivalent: z.number(),\n hbar_equivalent: z.number(),\n expiration_time: z.number(),\n }),\n next_rate: z.object({\n cent_equivalent: z.number(),\n hbar_equivalent: z.number(),\n expiration_time: z.number(),\n }),\n timestamp: z.string(),\n});\n\n/**\n * A Langchain tool to get the current HBAR price in USD.\n */\n// Export the class for testing purposes\nexport class GetHbarPriceTool extends StructuredTool {\n name = 'getHbarPrice';\n description = 'Retrieves the current price of HBAR in USD from the Hedera Mirror Node.';\n schema = z.object({}); // No input required for this tool\n\n /**\n * DISCLAIMER: THIS TOOL USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.\n * USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.\n * Retrieves the current price of HBAR in USD from the Hedera Mirror Node.\n * @returns A promise that resolves to a string containing the current HBAR price in USD.\n */\n protected async _call(): Promise<string> {\n try {\n // Use axios.get instead of fetch\n const response = await axios.get(`${HEDERA_MIRROR_NODE_API}/network/exchangerate`);\n\n // Axios puts data directly in response.data\n const data: unknown = response.data;\n\n // Validate the response structure\n const parsedData = ExchangeRateResponseSchema.safeParse(data);\n if (!parsedData.success) {\n console.error(\"Failed to parse exchange rate response:\", parsedData.error);\n throw new Error('Invalid API response format');\n }\n\n const { current_rate } = parsedData.data;\n const priceUsd = current_rate.cent_equivalent / current_rate.hbar_equivalent / 100;\n\n return `The current price of HBAR is $${priceUsd.toFixed(6)} USD.`;\n } catch (error) {\n console.error('Error fetching HBAR price:', error);\n // Handle axios errors specifically if needed, otherwise generic handling\n let errorMessage = 'An unknown error occurred';\n if (axios.isAxiosError(error)) {\n errorMessage = error.message;\n if (error.response) {\n errorMessage += ` (Status: ${error.response.status})`;\n }\n } else if (error instanceof Error) {\n errorMessage = error.message;\n }\n return `Failed to retrieve HBAR price: ${errorMessage}`;\n }\n }\n}\n\n\n/**\n * DISCLAIMER: THIS PLUGIN USES THE EXCHANGE RATE ENDPOINT FROM THE MIRROR NODE, AND IT IS NOT GUARANTEED TO BE ACCURATE.\n * USE AN ORACLE OR OTHER SOURCES FOR PRODUCTION USE WHERE PRICE IS IMPORTANT.\n * Plugin to provide tools related to Hedera network information, like HBAR price.\n */\nexport class HbarPricePlugin implements IPlugin {\n id = 'hedera-hbar-price';\n name = 'Hedera HBAR Price Plugin';\n description = 'Provides tools to interact with Hedera network data, specifically HBAR price.';\n version = '1.0.0';\n author = 'Hedera Agent'; // Replace with actual author/team name if desired\n\n private tools: StructuredTool[];\n\n constructor() {\n this.tools = [new GetHbarPriceTool()];\n }\n\n /**\n * Initializes the plugin. Currently no specific initialization needed.\n */\n async initialize(): Promise<void> {\n // No specific initialization required for this plugin yet\n return Promise.resolve();\n }\n\n /**\n * Returns the tools provided by this plugin.\n * @returns An array containing the GetHbarPriceTool.\n */\n getTools(): StructuredTool[] {\n return this.tools;\n }\n\n /**\n * Cleans up resources. Currently no cleanup needed.\n */\n async cleanup(): Promise<void> {\n // No cleanup necessary\n return Promise.resolve();\n }\n}"],"names":[],"mappings":";;;AAKA,MAAM,yBAAyB;AAK/B,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,cAAc,EAAE,OAAO;AAAA,IACrB,iBAAiB,EAAE,OAAO;AAAA,IAC1B,iBAAiB,EAAE,OAAO;AAAA,IAC1B,iBAAiB,EAAE,OAAO;AAAA,EAAA,CAC3B;AAAA,EACD,WAAW,EAAE,OAAO;AAAA,IAClB,iBAAiB,EAAE,OAAO;AAAA,IAC1B,iBAAiB,EAAE,OAAO;AAAA,IAC1B,iBAAiB,EAAE,OAAO;AAAA,EAAA,CAC3B;AAAA,EACD,WAAW,EAAE,OAAO;AACtB,CAAC;AAMM,MAAM,yBAAyB,eAAe;AAAA,EAA9C,cAAA;AAAA,UAAA,GAAA,SAAA;AACE,SAAA,OAAA;AACO,SAAA,cAAA;AACL,SAAA,SAAA,EAAE,OAAO,CAAA,CAAE;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpB,MAAgB,QAAyB;AACnC,QAAA;AAEF,YAAM,WAAW,MAAM,MAAM,IAAI,GAAG,sBAAsB,uBAAuB;AAGjF,YAAM,OAAgB,SAAS;AAGzB,YAAA,aAAa,2BAA2B,UAAU,IAAI;AACxD,UAAA,CAAC,WAAW,SAAS;AACd,gBAAA,MAAM,2CAA2C,WAAW,KAAK;AACnE,cAAA,IAAI,MAAM,6BAA6B;AAAA,MAAA;AAG1C,YAAA,EAAE,iBAAiB,WAAW;AACpC,YAAM,WAAW,aAAa,kBAAkB,aAAa,kBAAkB;AAE/E,aAAO,iCAAiC,SAAS,QAAQ,CAAC,CAAC;AAAA,aACpD,OAAO;AACN,cAAA,MAAM,8BAA8B,KAAK;AAEjD,UAAI,eAAe;AACf,UAAA,MAAM,aAAa,KAAK,GAAG;AAC7B,uBAAe,MAAM;AACrB,YAAI,MAAM,UAAU;AACF,0BAAA,aAAa,MAAM,SAAS,MAAM;AAAA,QAAA;AAAA,MACpD,WACS,iBAAiB,OAAO;AACjC,uBAAe,MAAM;AAAA,MAAA;AAEvB,aAAO,kCAAkC,YAAY;AAAA,IAAA;AAAA,EACvD;AAEJ;AAQO,MAAM,gBAAmC;AAAA,EAS9C,cAAc;AART,SAAA,KAAA;AACE,SAAA,OAAA;AACO,SAAA,cAAA;AACJ,SAAA,UAAA;AACD,SAAA,SAAA;AAKP,SAAK,QAAQ,CAAC,IAAI,kBAAkB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMtC,MAAM,aAA4B;AAEhC,WAAO,QAAQ,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOzB,WAA6B;AAC3B,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAMd,MAAM,UAAyB;AAE7B,WAAO,QAAQ,QAAQ;AAAA,EAAA;AAE3B;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es22.js","sources":["../../src/plugins/GenericPlugin.ts"],"sourcesContent":["import { BasePlugin } from './BasePlugin';\nimport { GenericPluginContext } from './PluginInterface';\nimport { StructuredTool } from '@langchain/core/tools';\n\n/**\n * Base class for platform-agnostic plugins that can be used across different implementations\n */\nexport abstract class GenericPlugin extends BasePlugin<GenericPluginContext> {\n /**\n * Namespace for the plugin, used for organizing and categorizing plugins\n */\n abstract namespace: string;\n\n /**\n * Get the tools provided by this plugin\n * @returns Array of tools provided by this plugin\n */\n abstract override getTools(): StructuredTool[];\n}"],"names":[],"mappings":";AAOO,MAAe,sBAAsB,WAAiC;AAW7E;"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { GenericPlugin } from "./standards-agent-kit.es22.js";
|
|
2
|
-
import { HCS10Client } from "./standards-agent-kit.es2.js";
|
|
3
|
-
import { OpenConvaiState } from "./standards-agent-kit.es16.js";
|
|
4
|
-
import { RegisterAgentTool } from "./standards-agent-kit.es3.js";
|
|
5
|
-
import { SendMessageTool } from "./standards-agent-kit.es4.js";
|
|
6
|
-
import { ConnectionTool } from "./standards-agent-kit.es5.js";
|
|
7
|
-
import { FindRegistrationsTool } from "./standards-agent-kit.es10.js";
|
|
8
|
-
import { InitiateConnectionTool } from "./standards-agent-kit.es7.js";
|
|
9
|
-
import { ListConnectionsTool } from "./standards-agent-kit.es8.js";
|
|
10
|
-
import { SendMessageToConnectionTool } from "./standards-agent-kit.es6.js";
|
|
11
|
-
import { CheckMessagesTool } from "./standards-agent-kit.es9.js";
|
|
12
|
-
import { ConnectionMonitorTool } from "./standards-agent-kit.es11.js";
|
|
13
|
-
import { ManageConnectionRequestsTool } from "./standards-agent-kit.es12.js";
|
|
14
|
-
import { AcceptConnectionRequestTool } from "./standards-agent-kit.es13.js";
|
|
15
|
-
import { RetrieveProfileTool } from "./standards-agent-kit.es14.js";
|
|
16
|
-
import { ListUnapprovedConnectionRequestsTool } from "./standards-agent-kit.es15.js";
|
|
17
|
-
class OpenConvAIPlugin extends GenericPlugin {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.id = "openconvai-standards-agent-kit";
|
|
21
|
-
this.name = "OpenConvAI Standards Agent Kit Plugin";
|
|
22
|
-
this.description = "Comprehensive plugin providing all HCS-10 agent tools for registration, connections, and messaging";
|
|
23
|
-
this.version = "1.0.0";
|
|
24
|
-
this.author = "Hashgraph Online";
|
|
25
|
-
this.namespace = "openconvai";
|
|
26
|
-
this.tools = [];
|
|
27
|
-
}
|
|
28
|
-
async initialize(context) {
|
|
29
|
-
await super.initialize(context);
|
|
30
|
-
if (!(context.client instanceof HCS10Client)) {
|
|
31
|
-
throw new Error("OpenConvAIPlugin requires an HCS10Client instance");
|
|
32
|
-
}
|
|
33
|
-
this.hcs10Client = context.client;
|
|
34
|
-
this.stateManager = context.stateManager || new OpenConvaiState();
|
|
35
|
-
this.initializeTools();
|
|
36
|
-
this.context.logger.info(
|
|
37
|
-
"OpenConvAI Standards Agent Kit Plugin initialized successfully"
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
initializeTools() {
|
|
41
|
-
if (!this.hcs10Client || !this.stateManager) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
"HCS10Client and StateManager must be initialized before creating tools"
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
this.tools = [
|
|
47
|
-
new RegisterAgentTool(this.hcs10Client, this.stateManager),
|
|
48
|
-
new SendMessageTool(this.hcs10Client),
|
|
49
|
-
new ConnectionTool({
|
|
50
|
-
client: this.hcs10Client,
|
|
51
|
-
stateManager: this.stateManager
|
|
52
|
-
}),
|
|
53
|
-
new FindRegistrationsTool({
|
|
54
|
-
hcsClient: this.hcs10Client
|
|
55
|
-
}),
|
|
56
|
-
new RetrieveProfileTool(this.hcs10Client),
|
|
57
|
-
new InitiateConnectionTool({
|
|
58
|
-
hcsClient: this.hcs10Client,
|
|
59
|
-
stateManager: this.stateManager
|
|
60
|
-
}),
|
|
61
|
-
new ListConnectionsTool({
|
|
62
|
-
hcsClient: this.hcs10Client,
|
|
63
|
-
stateManager: this.stateManager
|
|
64
|
-
}),
|
|
65
|
-
new SendMessageToConnectionTool({
|
|
66
|
-
hcsClient: this.hcs10Client,
|
|
67
|
-
stateManager: this.stateManager
|
|
68
|
-
}),
|
|
69
|
-
new CheckMessagesTool({
|
|
70
|
-
hcsClient: this.hcs10Client,
|
|
71
|
-
stateManager: this.stateManager
|
|
72
|
-
}),
|
|
73
|
-
new ConnectionMonitorTool({
|
|
74
|
-
hcsClient: this.hcs10Client,
|
|
75
|
-
stateManager: this.stateManager
|
|
76
|
-
}),
|
|
77
|
-
new ManageConnectionRequestsTool({
|
|
78
|
-
hcsClient: this.hcs10Client,
|
|
79
|
-
stateManager: this.stateManager
|
|
80
|
-
}),
|
|
81
|
-
new AcceptConnectionRequestTool({
|
|
82
|
-
hcsClient: this.hcs10Client,
|
|
83
|
-
stateManager: this.stateManager
|
|
84
|
-
}),
|
|
85
|
-
new ListUnapprovedConnectionRequestsTool({
|
|
86
|
-
stateManager: this.stateManager,
|
|
87
|
-
hcsClient: this.hcs10Client
|
|
88
|
-
})
|
|
89
|
-
];
|
|
90
|
-
}
|
|
91
|
-
getTools() {
|
|
92
|
-
return this.tools;
|
|
93
|
-
}
|
|
94
|
-
async cleanup() {
|
|
95
|
-
this.tools = [];
|
|
96
|
-
this.hcs10Client = void 0;
|
|
97
|
-
this.stateManager = void 0;
|
|
98
|
-
this.context.logger.info(
|
|
99
|
-
"OpenConvAI Standards Agent Kit Plugin cleaned up"
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
OpenConvAIPlugin
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=standards-agent-kit.es23.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es23.js","sources":["../../src/plugins/openconvai/OpenConvAIPlugin.ts"],"sourcesContent":["import { GenericPlugin } from '../GenericPlugin';\nimport { GenericPluginContext } from '../PluginInterface';\nimport { StructuredTool } from '@langchain/core/tools';\nimport { HCS10Client } from '../../hcs10/HCS10Client';\nimport { IStateManager } from '../../state/state-types';\nimport { OpenConvaiState } from '../../state/open-convai-state';\n\nimport { RegisterAgentTool } from '../../tools/RegisterAgentTool';\nimport { SendMessageTool } from '../../tools/SendMessageTool';\nimport { ConnectionTool } from '../../tools/ConnectionTool';\nimport { FindRegistrationsTool } from '../../tools/FindRegistrationsTool';\nimport { InitiateConnectionTool } from '../../tools/InitiateConnectionTool';\nimport { ListConnectionsTool } from '../../tools/ListConnectionsTool';\nimport { SendMessageToConnectionTool } from '../../tools/SendMessageToConnectionTool';\nimport { CheckMessagesTool } from '../../tools/CheckMessagesTool';\nimport { ConnectionMonitorTool } from '../../tools/ConnectionMonitorTool';\nimport { ManageConnectionRequestsTool } from '../../tools/ManageConnectionRequestsTool';\nimport { AcceptConnectionRequestTool } from '../../tools/AcceptConnectionRequestTool';\nimport { RetrieveProfileTool } from '../../tools/RetrieveProfileTool';\nimport { ListUnapprovedConnectionRequestsTool } from '../../tools/ListUnapprovedConnectionRequestsTool';\n\n/**\n * OpenConvAI Plugin that provides all the tools from standards-agent-kit\n * This plugin enables full HCS-10 agent functionality including registration,\n * connection management, and messaging capabilities.\n */\nexport class OpenConvAIPlugin extends GenericPlugin {\n id = 'openconvai-standards-agent-kit';\n name = 'OpenConvAI Standards Agent Kit Plugin';\n description =\n 'Comprehensive plugin providing all HCS-10 agent tools for registration, connections, and messaging';\n version = '1.0.0';\n author = 'Hashgraph Online';\n namespace = 'openconvai';\n\n private hcs10Client?: HCS10Client;\n private stateManager?: IStateManager;\n private tools: StructuredTool[] = [];\n\n override async initialize(context: GenericPluginContext): Promise<void> {\n await super.initialize(context);\n\n if (!(context.client instanceof HCS10Client)) {\n throw new Error('OpenConvAIPlugin requires an HCS10Client instance');\n }\n\n this.hcs10Client = context.client as HCS10Client;\n\n this.stateManager =\n (context.stateManager as IStateManager) || new OpenConvaiState();\n\n this.initializeTools();\n\n this.context.logger.info(\n 'OpenConvAI Standards Agent Kit Plugin initialized successfully'\n );\n }\n\n private initializeTools(): void {\n if (!this.hcs10Client || !this.stateManager) {\n throw new Error(\n 'HCS10Client and StateManager must be initialized before creating tools'\n );\n }\n\n this.tools = [\n new RegisterAgentTool(this.hcs10Client, this.stateManager),\n new SendMessageTool(this.hcs10Client),\n new ConnectionTool({\n client: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new FindRegistrationsTool({\n hcsClient: this.hcs10Client,\n }),\n new RetrieveProfileTool(this.hcs10Client),\n new InitiateConnectionTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new ListConnectionsTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new SendMessageToConnectionTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new CheckMessagesTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new ConnectionMonitorTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new ManageConnectionRequestsTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new AcceptConnectionRequestTool({\n hcsClient: this.hcs10Client,\n stateManager: this.stateManager,\n }),\n new ListUnapprovedConnectionRequestsTool({\n stateManager: this.stateManager,\n hcsClient: this.hcs10Client,\n }),\n ];\n }\n\n getTools(): StructuredTool[] {\n return this.tools;\n }\n\n override async cleanup(): Promise<void> {\n this.tools = [];\n this.hcs10Client = undefined;\n this.stateManager = undefined;\n this.context.logger.info(\n 'OpenConvAI Standards Agent Kit Plugin cleaned up'\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BO,MAAM,yBAAyB,cAAc;AAAA,EAA7C,cAAA;AAAA,UAAA,GAAA,SAAA;AACA,SAAA,KAAA;AACE,SAAA,OAAA;AAEL,SAAA,cAAA;AACQ,SAAA,UAAA;AACD,SAAA,SAAA;AACG,SAAA,YAAA;AAIZ,SAAQ,QAA0B,CAAC;AAAA,EAAA;AAAA,EAEnC,MAAe,WAAW,SAA8C;AAChE,UAAA,MAAM,WAAW,OAAO;AAE1B,QAAA,EAAE,QAAQ,kBAAkB,cAAc;AACtC,YAAA,IAAI,MAAM,mDAAmD;AAAA,IAAA;AAGrE,SAAK,cAAc,QAAQ;AAE3B,SAAK,eACF,QAAQ,gBAAkC,IAAI,gBAAgB;AAEjE,SAAK,gBAAgB;AAErB,SAAK,QAAQ,OAAO;AAAA,MAClB;AAAA,IACF;AAAA,EAAA;AAAA,EAGM,kBAAwB;AAC9B,QAAI,CAAC,KAAK,eAAe,CAAC,KAAK,cAAc;AAC3C,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IAAA;AAGF,SAAK,QAAQ;AAAA,MACX,IAAI,kBAAkB,KAAK,aAAa,KAAK,YAAY;AAAA,MACzD,IAAI,gBAAgB,KAAK,WAAW;AAAA,MACpC,IAAI,eAAe;AAAA,QACjB,QAAQ,KAAK;AAAA,QACb,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,sBAAsB;AAAA,QACxB,WAAW,KAAK;AAAA,MAAA,CACjB;AAAA,MACD,IAAI,oBAAoB,KAAK,WAAW;AAAA,MACxC,IAAI,uBAAuB;AAAA,QACzB,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,oBAAoB;AAAA,QACtB,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,4BAA4B;AAAA,QAC9B,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,kBAAkB;AAAA,QACpB,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,sBAAsB;AAAA,QACxB,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,6BAA6B;AAAA,QAC/B,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,4BAA4B;AAAA,QAC9B,WAAW,KAAK;AAAA,QAChB,cAAc,KAAK;AAAA,MAAA,CACpB;AAAA,MACD,IAAI,qCAAqC;AAAA,QACvC,cAAc,KAAK;AAAA,QACnB,WAAW,KAAK;AAAA,MACjB,CAAA;AAAA,IACH;AAAA,EAAA;AAAA,EAGF,WAA6B;AAC3B,WAAO,KAAK;AAAA,EAAA;AAAA,EAGd,MAAe,UAAyB;AACtC,SAAK,QAAQ,CAAC;AACd,SAAK,cAAc;AACnB,SAAK,eAAe;AACpB,SAAK,QAAQ,OAAO;AAAA,MAClB;AAAA,IACF;AAAA,EAAA;AAEJ;"}
|