@hashgraphonline/standards-agent-kit 0.2.119 → 0.2.121
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/config/ContentReferenceConfig.d.ts +8 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
- package/dist/cjs/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
- package/dist/cjs/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
- package/dist/cjs/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
- package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +11 -0
- package/dist/cjs/tools/inscriber/inscriber-tool-params.d.ts +3 -0
- package/dist/cjs/types/content-resolver.d.ts +6 -0
- package/dist/es/config/ContentReferenceConfig.d.ts +8 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/standards-agent-kit.es.js +42 -40
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +72 -23
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +27 -27
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +20 -30
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +27 -37
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +48 -60
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +60 -23
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +23 -23
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +23 -33
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +34 -10
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +16 -155
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es2.js +21 -1567
- package/dist/es/standards-agent-kit.es2.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +150 -22
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es21.js +25 -39
- package/dist/es/standards-agent-kit.es21.js.map +1 -1
- package/dist/es/standards-agent-kit.es22.js +26 -28
- package/dist/es/standards-agent-kit.es22.js.map +1 -1
- package/dist/es/standards-agent-kit.es23.js +16 -19
- package/dist/es/standards-agent-kit.es23.js.map +1 -1
- package/dist/es/standards-agent-kit.es24.js +21 -15
- package/dist/es/standards-agent-kit.es24.js.map +1 -1
- package/dist/es/standards-agent-kit.es25.js +18 -21
- package/dist/es/standards-agent-kit.es25.js.map +1 -1
- package/dist/es/standards-agent-kit.es26.js +35 -32
- package/dist/es/standards-agent-kit.es26.js.map +1 -1
- package/dist/es/standards-agent-kit.es27.js +38 -25
- package/dist/es/standards-agent-kit.es27.js.map +1 -1
- package/dist/es/standards-agent-kit.es28.js +24 -37
- package/dist/es/standards-agent-kit.es28.js.map +1 -1
- package/dist/es/standards-agent-kit.es29.js +26 -43
- package/dist/es/standards-agent-kit.es29.js.map +1 -1
- package/dist/es/standards-agent-kit.es3.js +1532 -55
- package/dist/es/standards-agent-kit.es3.js.map +1 -1
- package/dist/es/standards-agent-kit.es30.js +35 -40
- package/dist/es/standards-agent-kit.es30.js.map +1 -1
- package/dist/es/standards-agent-kit.es31.js +35 -39
- package/dist/es/standards-agent-kit.es31.js.map +1 -1
- package/dist/es/standards-agent-kit.es32.js +39 -23
- package/dist/es/standards-agent-kit.es32.js.map +1 -1
- package/dist/es/standards-agent-kit.es33.js +39 -168
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +93 -96
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +99 -64
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +166 -64
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +87 -30
- package/dist/es/standards-agent-kit.es37.js.map +1 -1
- package/dist/es/standards-agent-kit.es38.js +38 -242
- package/dist/es/standards-agent-kit.es38.js.map +1 -1
- package/dist/es/standards-agent-kit.es39.js +246 -138
- package/dist/es/standards-agent-kit.es39.js.map +1 -1
- package/dist/es/standards-agent-kit.es4.js +39 -33
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es40.js +134 -26
- package/dist/es/standards-agent-kit.es40.js.map +1 -1
- package/dist/es/standards-agent-kit.es41.js +27 -22
- package/dist/es/standards-agent-kit.es41.js.map +1 -1
- package/dist/es/standards-agent-kit.es42.js +24 -3
- package/dist/es/standards-agent-kit.es42.js.map +1 -1
- package/dist/es/standards-agent-kit.es43.js +7 -0
- package/dist/es/standards-agent-kit.es43.js.map +1 -0
- package/dist/es/standards-agent-kit.es5.js +65 -32
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +35 -311
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +320 -20
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +19 -227
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +216 -65
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
- package/dist/es/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
- package/dist/es/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
- package/dist/es/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
- package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +11 -0
- package/dist/es/tools/inscriber/inscriber-tool-params.d.ts +3 -0
- package/dist/es/types/content-resolver.d.ts +6 -0
- package/dist/umd/config/ContentReferenceConfig.d.ts +8 -0
- package/dist/umd/index.d.ts +2 -0
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
- package/dist/umd/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
- package/dist/umd/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
- package/dist/umd/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
- package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
- package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +11 -0
- package/dist/umd/tools/inscriber/inscriber-tool-params.d.ts +3 -0
- package/dist/umd/types/content-resolver.d.ts +6 -0
- package/package.json +2 -2
- package/src/builders/hcs10/hcs10-builder.ts +2 -3
- package/src/config/ContentReferenceConfig.ts +30 -0
- package/src/index.ts +3 -1
- package/src/tools/hcs6/CreateDynamicRegistryTool.ts +22 -33
- package/src/tools/hcs6/QueryDynamicRegistryTool.ts +23 -33
- package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +25 -35
- package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +25 -36
- package/src/tools/inscriber/InscribeFromBufferTool.ts +239 -120
- package/src/tools/inscriber/base-inscriber-tools.ts +19 -0
- package/src/tools/inscriber/inscriber-tool-params.ts +3 -0
- package/src/types/content-resolver.ts +11 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BaseHCS6QueryTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
5
5
|
/**
|
|
6
6
|
* Schema for creating a dynamic hashinal registry
|
|
7
7
|
*/
|
|
@@ -22,10 +22,10 @@ export type CreateDynamicRegistryInput = z.infer<typeof CreateDynamicRegistrySch
|
|
|
22
22
|
/**
|
|
23
23
|
* Tool for creating HCS-6 dynamic registries
|
|
24
24
|
*/
|
|
25
|
-
export declare class CreateDynamicRegistryTool extends
|
|
25
|
+
export declare class CreateDynamicRegistryTool extends BaseHCS6QueryTool<typeof CreateDynamicRegistrySchema> {
|
|
26
26
|
name: string;
|
|
27
27
|
description: string;
|
|
28
|
-
|
|
28
|
+
get specificInputSchema(): z.ZodObject<{
|
|
29
29
|
ttl: z.ZodDefault<z.ZodNumber>;
|
|
30
30
|
adminKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
31
31
|
submitKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
@@ -38,7 +38,7 @@ export declare class CreateDynamicRegistryTool extends BaseHCS6TransactionTool<t
|
|
|
38
38
|
adminKey?: string | boolean | undefined;
|
|
39
39
|
submitKey?: string | boolean | undefined;
|
|
40
40
|
}>;
|
|
41
|
-
constructor(params:
|
|
42
|
-
protected
|
|
41
|
+
constructor(params: HCS6QueryToolParams);
|
|
42
|
+
protected executeQuery(params: CreateDynamicRegistryInput, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
43
43
|
}
|
|
44
44
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseHCS6QueryTool } from './base-hcs6-tools';
|
|
3
3
|
import { HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
-
import {
|
|
4
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
5
5
|
/**
|
|
6
6
|
* Schema for querying a dynamic registry
|
|
7
7
|
*/
|
|
@@ -28,7 +28,7 @@ export type QueryDynamicRegistryInput = z.infer<typeof QueryDynamicRegistrySchem
|
|
|
28
28
|
export declare class QueryDynamicRegistryTool extends BaseHCS6QueryTool<typeof QueryDynamicRegistrySchema> {
|
|
29
29
|
name: string;
|
|
30
30
|
description: string;
|
|
31
|
-
|
|
31
|
+
get specificInputSchema(): z.ZodObject<{
|
|
32
32
|
topicId: z.ZodString;
|
|
33
33
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
34
34
|
order: z.ZodDefault<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
|
|
@@ -45,6 +45,6 @@ export declare class QueryDynamicRegistryTool extends BaseHCS6QueryTool<typeof Q
|
|
|
45
45
|
skip?: number | undefined;
|
|
46
46
|
}>;
|
|
47
47
|
constructor(params: HCS6QueryToolParams);
|
|
48
|
-
protected
|
|
48
|
+
protected executeQuery(params: QueryDynamicRegistryInput, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
49
49
|
}
|
|
50
50
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BaseHCS6QueryTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
5
5
|
/**
|
|
6
6
|
* Schema for registering a dynamic hashinal
|
|
7
7
|
*/
|
|
@@ -51,10 +51,10 @@ export type RegisterDynamicHashinalInput = z.infer<typeof RegisterDynamicHashina
|
|
|
51
51
|
/**
|
|
52
52
|
* Tool for registering (creating) dynamic hashinals
|
|
53
53
|
*/
|
|
54
|
-
export declare class RegisterDynamicHashinalTool extends
|
|
54
|
+
export declare class RegisterDynamicHashinalTool extends BaseHCS6QueryTool<typeof RegisterDynamicHashinalSchema> {
|
|
55
55
|
name: string;
|
|
56
56
|
description: string;
|
|
57
|
-
|
|
57
|
+
get specificInputSchema(): z.ZodObject<{
|
|
58
58
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
59
|
data: z.ZodOptional<z.ZodObject<{
|
|
60
60
|
base64: z.ZodOptional<z.ZodString>;
|
|
@@ -96,7 +96,7 @@ export declare class RegisterDynamicHashinalTool extends BaseHCS6TransactionTool
|
|
|
96
96
|
submitKey?: string | undefined;
|
|
97
97
|
registryTopicId?: string | undefined;
|
|
98
98
|
}>;
|
|
99
|
-
constructor(params:
|
|
100
|
-
protected
|
|
99
|
+
constructor(params: HCS6QueryToolParams);
|
|
100
|
+
protected executeQuery(params: RegisterDynamicHashinalInput, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
101
101
|
}
|
|
102
102
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { BaseHCS6QueryTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
5
5
|
/**
|
|
6
6
|
* Schema for updating a dynamic hashinal
|
|
7
7
|
*/
|
|
@@ -48,10 +48,10 @@ export type UpdateDynamicHashinalInput = z.infer<typeof UpdateDynamicHashinalSch
|
|
|
48
48
|
/**
|
|
49
49
|
* Tool for updating dynamic hashinals
|
|
50
50
|
*/
|
|
51
|
-
export declare class UpdateDynamicHashinalTool extends
|
|
51
|
+
export declare class UpdateDynamicHashinalTool extends BaseHCS6QueryTool<typeof UpdateDynamicHashinalSchema> {
|
|
52
52
|
name: string;
|
|
53
53
|
description: string;
|
|
54
|
-
|
|
54
|
+
get specificInputSchema(): z.ZodObject<{
|
|
55
55
|
registryTopicId: z.ZodString;
|
|
56
56
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
57
57
|
data: z.ZodOptional<z.ZodObject<{
|
|
@@ -90,7 +90,7 @@ export declare class UpdateDynamicHashinalTool extends BaseHCS6TransactionTool<t
|
|
|
90
90
|
} | undefined;
|
|
91
91
|
memo?: string | undefined;
|
|
92
92
|
}>;
|
|
93
|
-
constructor(params:
|
|
94
|
-
protected
|
|
93
|
+
constructor(params: HCS6QueryToolParams);
|
|
94
|
+
protected executeQuery(params: UpdateDynamicHashinalInput, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
95
95
|
}
|
|
96
96
|
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { BaseInscriberQueryTool } from './base-inscriber-tools';
|
|
3
3
|
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
4
|
-
/**
|
|
5
|
-
* Schema for inscribing from buffer
|
|
6
|
-
*/
|
|
7
4
|
declare const inscribeFromBufferSchema: z.ZodObject<{
|
|
8
5
|
base64Data: z.ZodString;
|
|
9
6
|
fileName: z.ZodString;
|
|
@@ -38,12 +35,10 @@ declare const inscribeFromBufferSchema: z.ZodObject<{
|
|
|
38
35
|
timeoutMs?: number | undefined;
|
|
39
36
|
apiKey?: string | undefined;
|
|
40
37
|
}>;
|
|
41
|
-
/**
|
|
42
|
-
* Tool for inscribing content from buffer
|
|
43
|
-
*/
|
|
44
38
|
export declare class InscribeFromBufferTool extends BaseInscriberQueryTool<typeof inscribeFromBufferSchema> {
|
|
45
39
|
name: string;
|
|
46
40
|
description: string;
|
|
41
|
+
private config;
|
|
47
42
|
get specificInputSchema(): z.ZodObject<{
|
|
48
43
|
base64Data: z.ZodString;
|
|
49
44
|
fileName: z.ZodString;
|
|
@@ -79,5 +74,11 @@ export declare class InscribeFromBufferTool extends BaseInscriberQueryTool<typeo
|
|
|
79
74
|
apiKey?: string | undefined;
|
|
80
75
|
}>;
|
|
81
76
|
protected executeQuery(params: z.infer<typeof inscribeFromBufferSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
77
|
+
private validateInput;
|
|
78
|
+
private validateContent;
|
|
79
|
+
private executeInscription;
|
|
80
|
+
private formatInscriptionResult;
|
|
81
|
+
private resolveContent;
|
|
82
|
+
private handleDirectContent;
|
|
82
83
|
}
|
|
83
84
|
export {};
|
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import { BaseHederaTransactionTool, BaseHederaQueryTool, BaseServiceBuilder } from 'hedera-agent-kit';
|
|
2
2
|
import { InscriberBuilder } from '../../builders/inscriber/inscriber-builder';
|
|
3
3
|
import { InscriberTransactionToolParams, InscriberQueryToolParams } from './inscriber-tool-params';
|
|
4
|
+
import { ContentResolverInterface } from '../../types/content-resolver';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
/**
|
|
6
7
|
* Base class for Inscriber transaction tools
|
|
7
8
|
*/
|
|
8
9
|
export declare abstract class BaseInscriberTransactionTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaTransactionTool<T> {
|
|
9
10
|
protected inscriberBuilder: InscriberBuilder;
|
|
11
|
+
protected contentResolver: ContentResolverInterface | null;
|
|
10
12
|
namespace: "inscriber";
|
|
11
13
|
constructor(params: InscriberTransactionToolParams);
|
|
12
14
|
/**
|
|
13
15
|
* Override to return the InscriberBuilder
|
|
14
16
|
*/
|
|
15
17
|
protected getServiceBuilder(): BaseServiceBuilder;
|
|
18
|
+
/**
|
|
19
|
+
* Get content resolver with fallback to registry
|
|
20
|
+
*/
|
|
21
|
+
protected getContentResolver(): ContentResolverInterface | null;
|
|
16
22
|
}
|
|
17
23
|
/**
|
|
18
24
|
* Base class for Inscriber query tools
|
|
19
25
|
*/
|
|
20
26
|
export declare abstract class BaseInscriberQueryTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaQueryTool<T> {
|
|
21
27
|
protected inscriberBuilder: InscriberBuilder;
|
|
28
|
+
protected contentResolver: ContentResolverInterface | null;
|
|
22
29
|
namespace: "inscriber";
|
|
23
30
|
constructor(params: InscriberQueryToolParams);
|
|
24
31
|
/**
|
|
25
32
|
* Override to return the InscriberBuilder
|
|
26
33
|
*/
|
|
27
34
|
protected getServiceBuilder(): BaseServiceBuilder;
|
|
35
|
+
/**
|
|
36
|
+
* Get content resolver with fallback to registry
|
|
37
|
+
*/
|
|
38
|
+
protected getContentResolver(): ContentResolverInterface | null;
|
|
28
39
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HederaAgentKit, BasePluginContext } from 'hedera-agent-kit';
|
|
2
2
|
import { InscriberBuilder } from '../../builders/inscriber/inscriber-builder';
|
|
3
|
+
import { ContentResolverInterface } from '../../types/content-resolver';
|
|
3
4
|
/**
|
|
4
5
|
* Parameters for Inscriber transaction tools
|
|
5
6
|
*/
|
|
@@ -7,6 +8,7 @@ export interface InscriberTransactionToolParams {
|
|
|
7
8
|
hederaKit: HederaAgentKit;
|
|
8
9
|
inscriberBuilder: InscriberBuilder;
|
|
9
10
|
logger?: BasePluginContext['logger'];
|
|
11
|
+
contentResolver?: ContentResolverInterface;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Parameters for Inscriber query tools
|
|
@@ -15,4 +17,5 @@ export interface InscriberQueryToolParams {
|
|
|
15
17
|
hederaKit: HederaAgentKit;
|
|
16
18
|
inscriberBuilder: InscriberBuilder;
|
|
17
19
|
logger?: BasePluginContext['logger'];
|
|
20
|
+
contentResolver?: ContentResolverInterface;
|
|
18
21
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ContentReferenceConfig {
|
|
2
|
+
maxInscriptionSize: number;
|
|
3
|
+
minContentSize: number;
|
|
4
|
+
logLevel: 'debug' | 'info' | 'warn' | 'error';
|
|
5
|
+
enableContentValidation: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_CONFIG: ContentReferenceConfig;
|
|
8
|
+
export declare function loadConfig(): ContentReferenceConfig;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export * from './plugins';
|
|
|
5
5
|
export { HCS10Builder, HCS2Builder, HCS6Builder, InscriberBuilder } from './builders';
|
|
6
6
|
export type { ExecuteResult } from './builders';
|
|
7
7
|
export { HCS10Client } from './hcs10';
|
|
8
|
+
export type { ContentReferenceConfig } from './config/ContentReferenceConfig';
|
|
9
|
+
export { loadConfig } from './config/ContentReferenceConfig';
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
1
|
+
import { loadConfig } from "./standards-agent-kit.es2.js";
|
|
2
|
+
import { HCS10Builder } from "./standards-agent-kit.es3.js";
|
|
3
|
+
import { HCS2Builder } from "./standards-agent-kit.es4.js";
|
|
4
|
+
import { HCS6Builder } from "./standards-agent-kit.es5.js";
|
|
5
|
+
import { InscriberBuilder } from "./standards-agent-kit.es6.js";
|
|
6
|
+
import { HCS10Client } from "./standards-agent-kit.es7.js";
|
|
7
|
+
import { BaseHCS10QueryTool, BaseHCS10TransactionTool } from "./standards-agent-kit.es8.js";
|
|
8
|
+
import { RegisterAgentTool } from "./standards-agent-kit.es9.js";
|
|
9
|
+
import { SendMessageToConnectionTool } from "./standards-agent-kit.es10.js";
|
|
10
|
+
import { InitiateConnectionTool } from "./standards-agent-kit.es11.js";
|
|
11
|
+
import { ListConnectionsTool } from "./standards-agent-kit.es12.js";
|
|
12
|
+
import { CheckMessagesTool } from "./standards-agent-kit.es13.js";
|
|
13
|
+
import { FindRegistrationsTool } from "./standards-agent-kit.es14.js";
|
|
14
|
+
import { ConnectionMonitorTool } from "./standards-agent-kit.es15.js";
|
|
15
|
+
import { ManageConnectionRequestsTool } from "./standards-agent-kit.es16.js";
|
|
16
|
+
import { AcceptConnectionRequestTool } from "./standards-agent-kit.es17.js";
|
|
17
|
+
import { RetrieveProfileTool } from "./standards-agent-kit.es18.js";
|
|
18
|
+
import { ListUnapprovedConnectionRequestsTool } from "./standards-agent-kit.es19.js";
|
|
19
|
+
import { NaturalLanguageMapper } from "./standards-agent-kit.es20.js";
|
|
20
|
+
import { BaseHCS2QueryTool, BaseHCS2TransactionTool } from "./standards-agent-kit.es21.js";
|
|
21
|
+
import { CreateRegistryTool } from "./standards-agent-kit.es22.js";
|
|
22
|
+
import { RegisterEntryTool } from "./standards-agent-kit.es23.js";
|
|
23
|
+
import { UpdateEntryTool } from "./standards-agent-kit.es24.js";
|
|
24
|
+
import { DeleteEntryTool } from "./standards-agent-kit.es25.js";
|
|
25
|
+
import { MigrateRegistryTool } from "./standards-agent-kit.es26.js";
|
|
26
|
+
import { QueryRegistryTool } from "./standards-agent-kit.es27.js";
|
|
27
|
+
import { BaseHCS6QueryTool, BaseHCS6TransactionTool } from "./standards-agent-kit.es28.js";
|
|
28
|
+
import { CreateDynamicRegistryTool } from "./standards-agent-kit.es29.js";
|
|
29
|
+
import { RegisterDynamicHashinalTool } from "./standards-agent-kit.es30.js";
|
|
30
|
+
import { UpdateDynamicHashinalTool } from "./standards-agent-kit.es31.js";
|
|
31
|
+
import { QueryDynamicRegistryTool } from "./standards-agent-kit.es32.js";
|
|
32
|
+
import { BaseInscriberQueryTool, BaseInscriberTransactionTool } from "./standards-agent-kit.es33.js";
|
|
33
|
+
import { InscribeFromUrlTool } from "./standards-agent-kit.es34.js";
|
|
34
|
+
import { InscribeFromFileTool } from "./standards-agent-kit.es35.js";
|
|
35
|
+
import { InscribeFromBufferTool } from "./standards-agent-kit.es36.js";
|
|
36
|
+
import { InscribeHashinalTool } from "./standards-agent-kit.es37.js";
|
|
37
|
+
import { RetrieveInscriptionTool } from "./standards-agent-kit.es38.js";
|
|
38
|
+
import { OpenConvaiState } from "./standards-agent-kit.es39.js";
|
|
39
|
+
import { initializeStandardsAgentKit } from "./standards-agent-kit.es40.js";
|
|
39
40
|
import { BasePlugin, HederaGetHbarPriceTool, PluginRegistry } from "hedera-agent-kit";
|
|
40
|
-
import { HbarPricePlugin } from "./standards-agent-kit.
|
|
41
|
+
import { HbarPricePlugin } from "./standards-agent-kit.es41.js";
|
|
41
42
|
export {
|
|
42
43
|
AcceptConnectionRequestTool,
|
|
43
44
|
BaseHCS10QueryTool,
|
|
@@ -84,6 +85,7 @@ export {
|
|
|
84
85
|
SendMessageToConnectionTool,
|
|
85
86
|
UpdateDynamicHashinalTool,
|
|
86
87
|
UpdateEntryTool,
|
|
87
|
-
initializeStandardsAgentKit
|
|
88
|
+
initializeStandardsAgentKit,
|
|
89
|
+
loadConfig
|
|
88
90
|
};
|
|
89
91
|
//# sourceMappingURL=standards-agent-kit.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,40 +1,89 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseHCS10TransactionTool } from "./standards-agent-kit.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
"The
|
|
2
|
+
import { BaseHCS10TransactionTool } from "./standards-agent-kit.es8.js";
|
|
3
|
+
const SendMessageToConnectionZodSchema = z.object({
|
|
4
|
+
targetIdentifier: z.string().optional().describe(
|
|
5
|
+
"The request key (e.g., 'req-1:0.0.6155171@0.0.6154875'), account ID (e.g., 0.0.12345) of the target agent, OR the connection number (e.g., '1', '2') from the 'list_connections' tool. Request key is most deterministic."
|
|
6
6
|
),
|
|
7
|
-
|
|
8
|
-
"
|
|
7
|
+
connectionId: z.string().optional().describe(
|
|
8
|
+
"The connection number (e.g., '1', '2') from the 'list_connections' tool."
|
|
9
9
|
),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
10
|
+
agentId: z.string().optional().describe("The account ID (e.g., 0.0.12345) of the target agent."),
|
|
11
|
+
message: z.string().describe("The text message content to send."),
|
|
12
|
+
disableMonitoring: z.boolean().optional().default(false)
|
|
13
13
|
});
|
|
14
|
-
class
|
|
14
|
+
class SendMessageToConnectionTool extends BaseHCS10TransactionTool {
|
|
15
15
|
constructor(params) {
|
|
16
16
|
super(params);
|
|
17
|
-
this.name = "
|
|
18
|
-
this.description = "
|
|
19
|
-
this.specificInputSchema =
|
|
20
|
-
this.neverScheduleThisTool = true;
|
|
17
|
+
this.name = "send_message_to_connection";
|
|
18
|
+
this.description = "Use this to send a message to an agent you already have an active connection with. Provide the target agent's account ID (e.g., 0.0.12345) and your message. If no active connection exists, this will fail - use initiate_connection instead to create a new connection first.";
|
|
19
|
+
this.specificInputSchema = SendMessageToConnectionZodSchema;
|
|
21
20
|
this.requiresMultipleTransactions = true;
|
|
21
|
+
this.neverScheduleThisTool = true;
|
|
22
22
|
}
|
|
23
23
|
async callBuilderMethod(builder, specificArgs) {
|
|
24
24
|
const hcs10Builder = builder;
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const targetIdentifier = specificArgs.targetIdentifier || specificArgs.agentId || specificArgs.connectionId;
|
|
26
|
+
if (!targetIdentifier) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
"Either targetIdentifier, connectionId, or agentId must be provided"
|
|
29
|
+
);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const stateManager = hcs10Builder.getStateManager();
|
|
32
|
+
if (stateManager) {
|
|
33
|
+
const connectionsManager = stateManager.getConnectionsManager();
|
|
34
|
+
if (connectionsManager) {
|
|
35
|
+
try {
|
|
36
|
+
const currentAgent = stateManager.getCurrentAgent();
|
|
37
|
+
if (currentAgent && currentAgent.accountId) {
|
|
38
|
+
await connectionsManager.fetchConnectionData(
|
|
39
|
+
currentAgent.accountId
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.debug("Could not refresh connections:", error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (targetIdentifier.match(/^\d+$/)) {
|
|
47
|
+
const connections = stateManager.listConnections();
|
|
48
|
+
const connectionIndex = parseInt(targetIdentifier) - 1;
|
|
49
|
+
const establishedConnections = connections.filter(
|
|
50
|
+
(conn) => conn.status === "established" && !conn.isPending && !conn.needsConfirmation
|
|
51
|
+
);
|
|
52
|
+
if (connectionIndex >= 0 && connectionIndex < establishedConnections.length) {
|
|
53
|
+
const selectedConnection = establishedConnections[connectionIndex];
|
|
54
|
+
if (selectedConnection && selectedConnection.connectionTopicId) {
|
|
55
|
+
await hcs10Builder.sendMessageToConnection({
|
|
56
|
+
targetIdentifier: selectedConnection.connectionTopicId,
|
|
57
|
+
message: specificArgs.message,
|
|
58
|
+
disableMonitoring: specificArgs.disableMonitoring
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (targetIdentifier.match(/^\d+\.\d+\.\d+$/)) {
|
|
65
|
+
const connections = stateManager.listConnections();
|
|
66
|
+
const establishedConnection = connections.find(
|
|
67
|
+
(conn) => (conn.targetAccountId === targetIdentifier || conn.targetAccountId === `0.0.${targetIdentifier}`) && conn.status === "established" && !conn.isPending && !conn.needsConfirmation
|
|
68
|
+
);
|
|
69
|
+
if (establishedConnection && establishedConnection.connectionTopicId) {
|
|
70
|
+
await hcs10Builder.sendMessageToConnection({
|
|
71
|
+
targetIdentifier: establishedConnection.connectionTopicId,
|
|
72
|
+
message: specificArgs.message,
|
|
73
|
+
disableMonitoring: specificArgs.disableMonitoring
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
33
78
|
}
|
|
34
|
-
await hcs10Builder.
|
|
79
|
+
await hcs10Builder.sendMessageToConnection({
|
|
80
|
+
targetIdentifier,
|
|
81
|
+
message: specificArgs.message,
|
|
82
|
+
disableMonitoring: specificArgs.disableMonitoring
|
|
83
|
+
});
|
|
35
84
|
}
|
|
36
85
|
}
|
|
37
86
|
export {
|
|
38
|
-
|
|
87
|
+
SendMessageToConnectionTool
|
|
39
88
|
};
|
|
40
89
|
//# sourceMappingURL=standards-agent-kit.es10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es10.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es10.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 .optional()\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 connectionId: z\n .string()\n .optional()\n .describe(\n \"The connection number (e.g., '1', '2') from the 'list_connections' tool.\"\n ),\n agentId: z\n .string()\n .optional()\n .describe('The account ID (e.g., 0.0.12345) of the target agent.'),\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 \"Use this to send a message to an agent you already have an active connection with. Provide the target agent's account ID (e.g., 0.0.12345) and your message. If no active connection exists, this will fail - use initiate_connection instead to create a new connection first.\";\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 const targetIdentifier =\n specificArgs.targetIdentifier ||\n specificArgs.agentId ||\n specificArgs.connectionId;\n\n if (!targetIdentifier) {\n throw new Error(\n 'Either targetIdentifier, connectionId, or agentId must be provided'\n );\n }\n\n const stateManager = hcs10Builder.getStateManager();\n if (stateManager) {\n const connectionsManager = stateManager.getConnectionsManager();\n if (connectionsManager) {\n try {\n const currentAgent = stateManager.getCurrentAgent();\n if (currentAgent && currentAgent.accountId) {\n await connectionsManager.fetchConnectionData(\n currentAgent.accountId\n );\n }\n } catch (error) {\n console.debug('Could not refresh connections:', error);\n }\n }\n\n if (targetIdentifier.match(/^\\d+$/)) {\n const connections = stateManager.listConnections();\n const connectionIndex = parseInt(targetIdentifier) - 1; // Connection numbers are 1-based\n\n const establishedConnections = connections.filter(\n (conn) =>\n conn.status === 'established' &&\n !conn.isPending &&\n !conn.needsConfirmation\n );\n\n if (\n connectionIndex >= 0 &&\n connectionIndex < establishedConnections.length\n ) {\n const selectedConnection = establishedConnections[connectionIndex];\n if (selectedConnection && selectedConnection.connectionTopicId) {\n await hcs10Builder.sendMessageToConnection({\n targetIdentifier: selectedConnection.connectionTopicId,\n message: specificArgs.message,\n disableMonitoring: specificArgs.disableMonitoring,\n });\n return;\n }\n }\n }\n\n if (targetIdentifier.match(/^\\d+\\.\\d+\\.\\d+$/)) {\n const connections = stateManager.listConnections();\n const establishedConnection = connections.find(\n (conn) =>\n (conn.targetAccountId === targetIdentifier ||\n conn.targetAccountId === `0.0.${targetIdentifier}`) &&\n conn.status === 'established' &&\n !conn.isPending &&\n !conn.needsConfirmation\n );\n\n if (establishedConnection && establishedConnection.connectionTopicId) {\n await hcs10Builder.sendMessageToConnection({\n targetIdentifier: establishedConnection.connectionTopicId,\n message: specificArgs.message,\n disableMonitoring: specificArgs.disableMonitoring,\n });\n return;\n }\n }\n }\n\n await hcs10Builder.sendMessageToConnection({\n targetIdentifier: targetIdentifier,\n message: specificArgs.message,\n disableMonitoring: specificArgs.disableMonitoring,\n });\n }\n}\n"],"names":[],"mappings":";;AAMA,MAAM,mCAAmC,EAAE,OAAO;AAAA,EAChD,kBAAkB,EACf,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,cAAc,EACX,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,SAAS,EACN,OAAA,EACA,SAAA,EACA,SAAS,uDAAuD;AAAA,EACnE,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,mBACJ,aAAa,oBACb,aAAa,WACb,aAAa;AAEf,QAAI,CAAC,kBAAkB;AACrB,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAAA,IAEJ;AAEA,UAAM,eAAe,aAAa,gBAAA;AAClC,QAAI,cAAc;AAChB,YAAM,qBAAqB,aAAa,sBAAA;AACxC,UAAI,oBAAoB;AACtB,YAAI;AACF,gBAAM,eAAe,aAAa,gBAAA;AAClC,cAAI,gBAAgB,aAAa,WAAW;AAC1C,kBAAM,mBAAmB;AAAA,cACvB,aAAa;AAAA,YAAA;AAAA,UAEjB;AAAA,QACF,SAAS,OAAO;AACd,kBAAQ,MAAM,kCAAkC,KAAK;AAAA,QACvD;AAAA,MACF;AAEA,UAAI,iBAAiB,MAAM,OAAO,GAAG;AACnC,cAAM,cAAc,aAAa,gBAAA;AACjC,cAAM,kBAAkB,SAAS,gBAAgB,IAAI;AAErD,cAAM,yBAAyB,YAAY;AAAA,UACzC,CAAC,SACC,KAAK,WAAW,iBAChB,CAAC,KAAK,aACN,CAAC,KAAK;AAAA,QAAA;AAGV,YACE,mBAAmB,KACnB,kBAAkB,uBAAuB,QACzC;AACA,gBAAM,qBAAqB,uBAAuB,eAAe;AACjE,cAAI,sBAAsB,mBAAmB,mBAAmB;AAC9D,kBAAM,aAAa,wBAAwB;AAAA,cACzC,kBAAkB,mBAAmB;AAAA,cACrC,SAAS,aAAa;AAAA,cACtB,mBAAmB,aAAa;AAAA,YAAA,CACjC;AACD;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAEA,UAAI,iBAAiB,MAAM,iBAAiB,GAAG;AAC7C,cAAM,cAAc,aAAa,gBAAA;AACjC,cAAM,wBAAwB,YAAY;AAAA,UACxC,CAAC,UACE,KAAK,oBAAoB,oBACxB,KAAK,oBAAoB,OAAO,gBAAgB,OAClD,KAAK,WAAW,iBAChB,CAAC,KAAK,aACN,CAAC,KAAK;AAAA,QAAA;AAGV,YAAI,yBAAyB,sBAAsB,mBAAmB;AACpE,gBAAM,aAAa,wBAAwB;AAAA,YACzC,kBAAkB,sBAAsB;AAAA,YACxC,SAAS,aAAa;AAAA,YACtB,mBAAmB,aAAa;AAAA,UAAA,CACjC;AACD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,UAAM,aAAa,wBAAwB;AAAA,MACzC;AAAA,MACA,SAAS,aAAa;AAAA,MACtB,mBAAmB,aAAa;AAAA,IAAA,CACjC;AAAA,EACH;AACF;"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
"
|
|
2
|
+
import { BaseHCS10TransactionTool } from "./standards-agent-kit.es8.js";
|
|
3
|
+
const InitiateConnectionZodSchema = z.object({
|
|
4
|
+
targetAccountId: z.string().describe(
|
|
5
|
+
"The Hedera account ID (e.g., 0.0.12345) of the agent you want to connect with."
|
|
6
6
|
),
|
|
7
|
-
|
|
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
|
+
)
|
|
8
13
|
});
|
|
9
|
-
class
|
|
14
|
+
class InitiateConnectionTool extends BaseHCS10TransactionTool {
|
|
10
15
|
constructor(params) {
|
|
11
16
|
super(params);
|
|
12
|
-
this.name = "
|
|
13
|
-
this.description = "
|
|
14
|
-
this.specificInputSchema =
|
|
17
|
+
this.name = "initiate_connection";
|
|
18
|
+
this.description = "ONLY use this to START a BRAND NEW connection to an agent you have NEVER connected to before. If you already have an active connection to this agent, use send_message_to_connection instead. This creates a new connection request and waits for acceptance.";
|
|
19
|
+
this.specificInputSchema = InitiateConnectionZodSchema;
|
|
20
|
+
this.neverScheduleThisTool = true;
|
|
21
|
+
this.requiresMultipleTransactions = true;
|
|
15
22
|
}
|
|
16
|
-
async
|
|
17
|
-
const hcs10Builder =
|
|
18
|
-
const params = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
params.showPending = args.showPending;
|
|
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;
|
|
24
30
|
}
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
};
|
|
31
|
+
if (specificArgs.memo !== void 0) {
|
|
32
|
+
params.memo = specificArgs.memo;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
await hcs10Builder.initiateConnection(params);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
InitiateConnectionTool
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=standards-agent-kit.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es11.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es11.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 'ONLY use this to START a BRAND NEW connection to an agent you have NEVER connected to before. If you already have an active connection to this agent, use send_message_to_connection instead. This creates a new connection request and waits for acceptance.';\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;"}
|