@hashgraphonline/standards-agent-kit 0.0.3 → 0.0.4
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/README.md +56 -48
- package/dist/examples/langchain-demo.d.ts +1 -0
- package/dist/examples/utils.d.ts +26 -0
- package/dist/index.es.js +39194 -38827
- package/dist/index.es.js.map +1 -1
- package/dist/src/hcs10/HCS10Client.d.ts +10 -1
- package/dist/src/tools/ConnectionTool.d.ts +5 -8
- package/dist/src/tools/InitiateConnectionTool.d.ts +4 -3
- package/dist/src/tools/RegisterAgentTool.d.ts +3 -3
- package/package.json +3 -3
|
@@ -16,9 +16,10 @@ export type StandardNetworkType = 'mainnet' | 'testnet';
|
|
|
16
16
|
* - Sends messages on Hedera topics (currently manual, potential for standard SDK integration).
|
|
17
17
|
*/
|
|
18
18
|
export declare class HCS10Client {
|
|
19
|
-
|
|
19
|
+
standardClient: StandardSDKClient;
|
|
20
20
|
private useEncryption;
|
|
21
21
|
agentChannels?: AgentChannels;
|
|
22
|
+
guardedRegistryBaseUrl: string;
|
|
22
23
|
constructor(operatorId: string, operatorPrivateKey: string, network: StandardNetworkType, options?: {
|
|
23
24
|
useEncryption?: boolean;
|
|
24
25
|
registryUrl?: string;
|
|
@@ -80,5 +81,13 @@ export declare class HCS10Client {
|
|
|
80
81
|
* @returns The resolved message content.
|
|
81
82
|
*/
|
|
82
83
|
getMessageContent(inscriptionIdOrData: string): Promise<string>;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves the inbound topic ID associated with the current operator.
|
|
86
|
+
* This typically involves fetching the operator's own HCS-10 profile.
|
|
87
|
+
* @returns A promise that resolves to the operator's inbound topic ID.
|
|
88
|
+
* @throws {Error} If the operator ID cannot be determined or the profile/topic cannot be retrieved.
|
|
89
|
+
*/
|
|
90
|
+
getInboundTopicId(): Promise<string>;
|
|
91
|
+
setClient(accountId: string, privateKey: string): StandardSDKClient;
|
|
83
92
|
}
|
|
84
93
|
export {};
|
|
@@ -7,8 +7,10 @@ export interface ConnectionToolParams extends ToolParams {
|
|
|
7
7
|
demoState: DemoState;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* ConnectionTool monitors
|
|
10
|
+
* ConnectionTool monitors the *current* agent's inbound topic for connection requests
|
|
11
11
|
* and automatically handles them using the HCS-10 standard SDK flow.
|
|
12
|
+
* Use this ONLY to passively LISTEN for other agents trying to connect TO YOU.
|
|
13
|
+
* This tool takes NO arguments and does NOT start outgoing connections.
|
|
12
14
|
*/
|
|
13
15
|
export declare class ConnectionTool extends StructuredTool {
|
|
14
16
|
name: string;
|
|
@@ -18,13 +20,7 @@ export declare class ConnectionTool extends StructuredTool {
|
|
|
18
20
|
private demoState;
|
|
19
21
|
private isMonitoring;
|
|
20
22
|
private monitoringTopic;
|
|
21
|
-
schema: z.ZodObject<{
|
|
22
|
-
inboundTopicId: z.ZodString;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
inboundTopicId: string;
|
|
25
|
-
}, {
|
|
26
|
-
inboundTopicId: string;
|
|
27
|
-
}>;
|
|
23
|
+
schema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
28
24
|
/**
|
|
29
25
|
* @param client - Instance of HCS10Client.
|
|
30
26
|
* @param demoState - Instance of DemoState for shared state management.
|
|
@@ -32,6 +28,7 @@ export declare class ConnectionTool extends StructuredTool {
|
|
|
32
28
|
constructor({ client, demoState, ...rest }: ConnectionToolParams);
|
|
33
29
|
/**
|
|
34
30
|
* Initiates the connection request monitoring process in the background.
|
|
31
|
+
* Gets the inbound topic ID from the configured client.
|
|
35
32
|
*/
|
|
36
33
|
_call(input: z.infer<typeof this.schema>): Promise<string>;
|
|
37
34
|
/**
|
|
@@ -7,9 +7,10 @@ export interface InitiateConnectionToolParams extends ToolParams {
|
|
|
7
7
|
demoState: DemoState;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* A tool to
|
|
11
|
-
*
|
|
12
|
-
* waits for confirmation, and
|
|
10
|
+
* A tool to actively START a NEW HCS-10 connection TO a target agent.
|
|
11
|
+
* Requires the target agent's account ID.
|
|
12
|
+
* It retrieves their profile, sends a connection request, waits for confirmation, and stores the connection.
|
|
13
|
+
* Use this tool ONLY to actively INITIATE an OUTGOING connection.
|
|
13
14
|
*/
|
|
14
15
|
export declare class InitiateConnectionTool extends StructuredTool {
|
|
15
16
|
name: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HCS10Client } from '../hcs10/HCS10Client';
|
|
2
2
|
import { StructuredTool } from '@langchain/core/tools';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { RegisteredAgent } from '../demo-state';
|
|
5
4
|
/**
|
|
6
5
|
* RegisterAgentTool wraps the createAndRegisterAgent() function of HCS10Client.
|
|
7
6
|
* It creates and registers an agent on Hedera using the HCS-10 standard SDK flow.
|
|
7
|
+
* On success, returns a JSON string containing the new agent's details (including private key).
|
|
8
8
|
*/
|
|
9
9
|
export declare class RegisterAgentTool extends StructuredTool {
|
|
10
10
|
name: string;
|
|
@@ -32,7 +32,7 @@ export declare class RegisterAgentTool extends StructuredTool {
|
|
|
32
32
|
constructor(client: HCS10Client);
|
|
33
33
|
/**
|
|
34
34
|
* Calls createAndRegisterAgent() with the provided metadata.
|
|
35
|
-
* Returns
|
|
35
|
+
* Returns a JSON string with agent details on success, or an error string.
|
|
36
36
|
*/
|
|
37
|
-
_call(input: z.infer<typeof this.schema>): Promise<
|
|
37
|
+
_call(input: z.infer<typeof this.schema>): Promise<string>;
|
|
38
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-agent-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "An Agents implementation of Hashgraph Online's Standards SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.es.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"release": "npm publish --access public",
|
|
19
19
|
"cli-demo": "tsx examples/cli-demo.ts",
|
|
20
20
|
"interactive-demo": "tsx examples/interactive-demo.ts",
|
|
21
|
-
"langchain-demo": "tsx examples/langchain-demo.
|
|
21
|
+
"langchain-demo": "tsx examples/langchain-demo.js"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"hedera",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@hashgraph/sdk": "^2.39.0",
|
|
34
|
-
"@hashgraphonline/standards-sdk": "0.0.
|
|
34
|
+
"@hashgraphonline/standards-sdk": "0.0.61",
|
|
35
35
|
"@langchain/community": "^0.3.37",
|
|
36
36
|
"@langchain/openai": "^0.5.1",
|
|
37
37
|
"dotenv": "^16.4.1",
|