@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.
Files changed (132) hide show
  1. package/dist/cjs/config/ContentReferenceConfig.d.ts +8 -0
  2. package/dist/cjs/index.d.ts +2 -0
  3. package/dist/cjs/standards-agent-kit.cjs +1 -1
  4. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  5. package/dist/cjs/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
  6. package/dist/cjs/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
  7. package/dist/cjs/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
  8. package/dist/cjs/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
  9. package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
  10. package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +11 -0
  11. package/dist/cjs/tools/inscriber/inscriber-tool-params.d.ts +3 -0
  12. package/dist/cjs/types/content-resolver.d.ts +6 -0
  13. package/dist/es/config/ContentReferenceConfig.d.ts +8 -0
  14. package/dist/es/index.d.ts +2 -0
  15. package/dist/es/standards-agent-kit.es.js +42 -40
  16. package/dist/es/standards-agent-kit.es.js.map +1 -1
  17. package/dist/es/standards-agent-kit.es10.js +72 -23
  18. package/dist/es/standards-agent-kit.es10.js.map +1 -1
  19. package/dist/es/standards-agent-kit.es11.js +27 -27
  20. package/dist/es/standards-agent-kit.es11.js.map +1 -1
  21. package/dist/es/standards-agent-kit.es12.js +20 -30
  22. package/dist/es/standards-agent-kit.es12.js.map +1 -1
  23. package/dist/es/standards-agent-kit.es13.js +27 -37
  24. package/dist/es/standards-agent-kit.es13.js.map +1 -1
  25. package/dist/es/standards-agent-kit.es14.js +48 -60
  26. package/dist/es/standards-agent-kit.es14.js.map +1 -1
  27. package/dist/es/standards-agent-kit.es15.js +60 -23
  28. package/dist/es/standards-agent-kit.es15.js.map +1 -1
  29. package/dist/es/standards-agent-kit.es16.js +23 -23
  30. package/dist/es/standards-agent-kit.es16.js.map +1 -1
  31. package/dist/es/standards-agent-kit.es17.js +23 -33
  32. package/dist/es/standards-agent-kit.es17.js.map +1 -1
  33. package/dist/es/standards-agent-kit.es18.js +34 -10
  34. package/dist/es/standards-agent-kit.es18.js.map +1 -1
  35. package/dist/es/standards-agent-kit.es19.js +16 -155
  36. package/dist/es/standards-agent-kit.es19.js.map +1 -1
  37. package/dist/es/standards-agent-kit.es2.js +21 -1567
  38. package/dist/es/standards-agent-kit.es2.js.map +1 -1
  39. package/dist/es/standards-agent-kit.es20.js +150 -22
  40. package/dist/es/standards-agent-kit.es20.js.map +1 -1
  41. package/dist/es/standards-agent-kit.es21.js +25 -39
  42. package/dist/es/standards-agent-kit.es21.js.map +1 -1
  43. package/dist/es/standards-agent-kit.es22.js +26 -28
  44. package/dist/es/standards-agent-kit.es22.js.map +1 -1
  45. package/dist/es/standards-agent-kit.es23.js +16 -19
  46. package/dist/es/standards-agent-kit.es23.js.map +1 -1
  47. package/dist/es/standards-agent-kit.es24.js +21 -15
  48. package/dist/es/standards-agent-kit.es24.js.map +1 -1
  49. package/dist/es/standards-agent-kit.es25.js +18 -21
  50. package/dist/es/standards-agent-kit.es25.js.map +1 -1
  51. package/dist/es/standards-agent-kit.es26.js +35 -32
  52. package/dist/es/standards-agent-kit.es26.js.map +1 -1
  53. package/dist/es/standards-agent-kit.es27.js +38 -25
  54. package/dist/es/standards-agent-kit.es27.js.map +1 -1
  55. package/dist/es/standards-agent-kit.es28.js +24 -37
  56. package/dist/es/standards-agent-kit.es28.js.map +1 -1
  57. package/dist/es/standards-agent-kit.es29.js +26 -43
  58. package/dist/es/standards-agent-kit.es29.js.map +1 -1
  59. package/dist/es/standards-agent-kit.es3.js +1532 -55
  60. package/dist/es/standards-agent-kit.es3.js.map +1 -1
  61. package/dist/es/standards-agent-kit.es30.js +35 -40
  62. package/dist/es/standards-agent-kit.es30.js.map +1 -1
  63. package/dist/es/standards-agent-kit.es31.js +35 -39
  64. package/dist/es/standards-agent-kit.es31.js.map +1 -1
  65. package/dist/es/standards-agent-kit.es32.js +39 -23
  66. package/dist/es/standards-agent-kit.es32.js.map +1 -1
  67. package/dist/es/standards-agent-kit.es33.js +39 -168
  68. package/dist/es/standards-agent-kit.es33.js.map +1 -1
  69. package/dist/es/standards-agent-kit.es34.js +93 -96
  70. package/dist/es/standards-agent-kit.es34.js.map +1 -1
  71. package/dist/es/standards-agent-kit.es35.js +99 -64
  72. package/dist/es/standards-agent-kit.es35.js.map +1 -1
  73. package/dist/es/standards-agent-kit.es36.js +166 -64
  74. package/dist/es/standards-agent-kit.es36.js.map +1 -1
  75. package/dist/es/standards-agent-kit.es37.js +87 -30
  76. package/dist/es/standards-agent-kit.es37.js.map +1 -1
  77. package/dist/es/standards-agent-kit.es38.js +38 -242
  78. package/dist/es/standards-agent-kit.es38.js.map +1 -1
  79. package/dist/es/standards-agent-kit.es39.js +246 -138
  80. package/dist/es/standards-agent-kit.es39.js.map +1 -1
  81. package/dist/es/standards-agent-kit.es4.js +39 -33
  82. package/dist/es/standards-agent-kit.es4.js.map +1 -1
  83. package/dist/es/standards-agent-kit.es40.js +134 -26
  84. package/dist/es/standards-agent-kit.es40.js.map +1 -1
  85. package/dist/es/standards-agent-kit.es41.js +27 -22
  86. package/dist/es/standards-agent-kit.es41.js.map +1 -1
  87. package/dist/es/standards-agent-kit.es42.js +24 -3
  88. package/dist/es/standards-agent-kit.es42.js.map +1 -1
  89. package/dist/es/standards-agent-kit.es43.js +7 -0
  90. package/dist/es/standards-agent-kit.es43.js.map +1 -0
  91. package/dist/es/standards-agent-kit.es5.js +65 -32
  92. package/dist/es/standards-agent-kit.es5.js.map +1 -1
  93. package/dist/es/standards-agent-kit.es6.js +35 -311
  94. package/dist/es/standards-agent-kit.es6.js.map +1 -1
  95. package/dist/es/standards-agent-kit.es7.js +320 -20
  96. package/dist/es/standards-agent-kit.es7.js.map +1 -1
  97. package/dist/es/standards-agent-kit.es8.js +19 -227
  98. package/dist/es/standards-agent-kit.es8.js.map +1 -1
  99. package/dist/es/standards-agent-kit.es9.js +216 -65
  100. package/dist/es/standards-agent-kit.es9.js.map +1 -1
  101. package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
  102. package/dist/es/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
  103. package/dist/es/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
  104. package/dist/es/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
  105. package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
  106. package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +11 -0
  107. package/dist/es/tools/inscriber/inscriber-tool-params.d.ts +3 -0
  108. package/dist/es/types/content-resolver.d.ts +6 -0
  109. package/dist/umd/config/ContentReferenceConfig.d.ts +8 -0
  110. package/dist/umd/index.d.ts +2 -0
  111. package/dist/umd/standards-agent-kit.umd.js +1 -1
  112. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  113. package/dist/umd/tools/hcs6/CreateDynamicRegistryTool.d.ts +7 -7
  114. package/dist/umd/tools/hcs6/QueryDynamicRegistryTool.d.ts +3 -3
  115. package/dist/umd/tools/hcs6/RegisterDynamicHashinalTool.d.ts +7 -7
  116. package/dist/umd/tools/hcs6/UpdateDynamicHashinalTool.d.ts +7 -7
  117. package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +7 -6
  118. package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +11 -0
  119. package/dist/umd/tools/inscriber/inscriber-tool-params.d.ts +3 -0
  120. package/dist/umd/types/content-resolver.d.ts +6 -0
  121. package/package.json +2 -2
  122. package/src/builders/hcs10/hcs10-builder.ts +2 -3
  123. package/src/config/ContentReferenceConfig.ts +30 -0
  124. package/src/index.ts +3 -1
  125. package/src/tools/hcs6/CreateDynamicRegistryTool.ts +22 -33
  126. package/src/tools/hcs6/QueryDynamicRegistryTool.ts +23 -33
  127. package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +25 -35
  128. package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +25 -36
  129. package/src/tools/inscriber/InscribeFromBufferTool.ts +239 -120
  130. package/src/tools/inscriber/base-inscriber-tools.ts +19 -0
  131. package/src/tools/inscriber/inscriber-tool-params.ts +3 -0
  132. package/src/types/content-resolver.ts +11 -0
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import { TransactionResponse } from 'hedera-agent-kit';
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 BaseHCS6TransactionTool<typeof CreateDynamicRegistrySchema> {
25
+ export declare class CreateDynamicRegistryTool extends BaseHCS6QueryTool<typeof CreateDynamicRegistrySchema> {
26
26
  name: string;
27
27
  description: string;
28
- schema: z.ZodObject<{
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: HCS6TransactionToolParams);
42
- protected _call(params: CreateDynamicRegistryInput): Promise<TransactionResponse>;
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 { TransactionResponse } from 'hedera-agent-kit';
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
- schema: z.ZodObject<{
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 _call(params: QueryDynamicRegistryInput): Promise<TransactionResponse>;
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 { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import { TransactionResponse } from 'hedera-agent-kit';
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 BaseHCS6TransactionTool<typeof RegisterDynamicHashinalSchema> {
54
+ export declare class RegisterDynamicHashinalTool extends BaseHCS6QueryTool<typeof RegisterDynamicHashinalSchema> {
55
55
  name: string;
56
56
  description: string;
57
- schema: z.ZodObject<{
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: HCS6TransactionToolParams);
100
- protected _call(params: RegisterDynamicHashinalInput): Promise<TransactionResponse>;
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 { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import { TransactionResponse } from 'hedera-agent-kit';
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 BaseHCS6TransactionTool<typeof UpdateDynamicHashinalSchema> {
51
+ export declare class UpdateDynamicHashinalTool extends BaseHCS6QueryTool<typeof UpdateDynamicHashinalSchema> {
52
52
  name: string;
53
53
  description: string;
54
- schema: z.ZodObject<{
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: HCS6TransactionToolParams);
94
- protected _call(params: UpdateDynamicHashinalInput): Promise<TransactionResponse>;
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,6 @@
1
+ /**
2
+ * Content Resolver Types
3
+ *
4
+ * Re-export types from standards-sdk for content resolution.
5
+ */
6
+ export type { ContentResolverInterface, ReferenceResolutionResult, ContentStoreInterface } from '@hashgraphonline/standards-sdk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashgraphonline/standards-agent-kit",
3
- "version": "0.2.119",
3
+ "version": "0.2.121",
4
4
  "description": "A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/standards-agent-kit.cjs",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@hashgraph/sdk": "^2.69.0",
66
- "@hashgraphonline/standards-sdk": "0.0.167",
66
+ "@hashgraphonline/standards-sdk": "file:.yalc/@hashgraphonline/standards-sdk",
67
67
  "@langchain/community": "^0.3.49",
68
68
  "@langchain/core": "^0.3.66",
69
69
  "@langchain/openai": "^0.6.3",
@@ -137,8 +137,8 @@ export class HCS10Builder extends BaseServiceBuilder {
137
137
  private standardClient: HCS10Client;
138
138
  private stateManager: IStateManager | undefined;
139
139
  private executeResult?: ExecuteResult & { rawResult?: unknown };
140
- private useEncryption: boolean;
141
- private guardedRegistryBaseUrl: string;
140
+ private useEncryption: boolean = false;
141
+ private guardedRegistryBaseUrl: string = '';
142
142
  private network: StandardNetworkType;
143
143
  private sdkLogger: SDKLogger;
144
144
 
@@ -175,7 +175,6 @@ export class HCS10Builder extends BaseServiceBuilder {
175
175
  network: this.network,
176
176
  operatorId: operatorId,
177
177
  operatorPrivateKey: operatorPrivateKey,
178
- guardedRegistryBaseUrl: this.guardedRegistryBaseUrl,
179
178
  logLevel: options?.logLevel || 'info',
180
179
  });
181
180
 
@@ -0,0 +1,30 @@
1
+ export interface ContentReferenceConfig {
2
+ maxInscriptionSize: number;
3
+ minContentSize: number;
4
+ logLevel: 'debug' | 'info' | 'warn' | 'error';
5
+ enableContentValidation: boolean;
6
+ }
7
+
8
+ export const DEFAULT_CONFIG: ContentReferenceConfig = {
9
+ maxInscriptionSize: 50 * 1024, // 50KB
10
+ minContentSize: 10,
11
+ logLevel: 'warn',
12
+ enableContentValidation: true,
13
+ };
14
+
15
+ export function loadConfig(): ContentReferenceConfig {
16
+ return {
17
+ maxInscriptionSize: parseInt(
18
+ process.env.REF_MAX_SIZE || DEFAULT_CONFIG.maxInscriptionSize.toString(),
19
+ 10
20
+ ),
21
+ minContentSize: parseInt(
22
+ process.env.REF_MIN_SIZE || DEFAULT_CONFIG.minContentSize.toString(),
23
+ 10
24
+ ),
25
+ logLevel:
26
+ (process.env.REF_LOG_LEVEL as ContentReferenceConfig['logLevel']) ||
27
+ DEFAULT_CONFIG.logLevel,
28
+ enableContentValidation: process.env.REF_ENABLE_VALIDATION !== 'false',
29
+ };
30
+ }
package/src/index.ts CHANGED
@@ -4,4 +4,6 @@ export * from './init';
4
4
  export * from './plugins';
5
5
  export { HCS10Builder, HCS2Builder, HCS6Builder, InscriberBuilder } from './builders';
6
6
  export type { ExecuteResult } from './builders';
7
- export { HCS10Client } from './hcs10';
7
+ export { HCS10Client } from './hcs10';
8
+ export type { ContentReferenceConfig } from './config/ContentReferenceConfig';
9
+ export { loadConfig } from './config/ContentReferenceConfig';
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import type { TransactionResponse } from 'hedera-agent-kit';
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
  /**
7
7
  * Schema for creating a dynamic hashinal registry
@@ -24,43 +24,32 @@ export type CreateDynamicRegistryInput = z.infer<typeof CreateDynamicRegistrySch
24
24
  /**
25
25
  * Tool for creating HCS-6 dynamic registries
26
26
  */
27
- export class CreateDynamicRegistryTool extends BaseHCS6TransactionTool<typeof CreateDynamicRegistrySchema> {
27
+ export class CreateDynamicRegistryTool extends BaseHCS6QueryTool<typeof CreateDynamicRegistrySchema> {
28
28
  name = 'createDynamicRegistry';
29
29
  description = 'Create a new HCS-6 dynamic registry for managing evolving content';
30
- schema = CreateDynamicRegistrySchema;
30
+
31
+ get specificInputSchema() {
32
+ return CreateDynamicRegistrySchema;
33
+ }
31
34
 
32
- constructor(params: HCS6TransactionToolParams) {
35
+ constructor(params: HCS6QueryToolParams) {
33
36
  super(params);
34
37
  }
35
38
 
36
- protected async _call(
37
- params: CreateDynamicRegistryInput
38
- ): Promise<TransactionResponse> {
39
- try {
40
- const result = await this.hcs6Builder.createRegistry({
41
- ttl: params.ttl,
42
- adminKey: params.adminKey,
43
- submitKey: params.submitKey,
44
- });
45
-
46
- if (!result.success) {
47
- throw new Error(result.error || 'Failed to create dynamic registry');
48
- }
39
+ protected async executeQuery(
40
+ params: CreateDynamicRegistryInput,
41
+ _runManager?: CallbackManagerForToolRun
42
+ ): Promise<unknown> {
43
+ const result = await this.hcs6Builder.createRegistry({
44
+ ttl: params.ttl,
45
+ adminKey: params.adminKey,
46
+ submitKey: params.submitKey,
47
+ });
49
48
 
50
- return {
51
- status: 'success',
52
- data: {
53
- topicId: result.topicId,
54
- transactionId: result.transactionId,
55
- ttl: params.ttl,
56
- memo: `hcs-6:1:${params.ttl}`,
57
- },
58
- };
59
- } catch (error) {
60
- return {
61
- status: 'error',
62
- message: error instanceof Error ? error.message : 'Unknown error',
63
- };
49
+ if (!result.success) {
50
+ throw new Error(result.error || 'Failed to create dynamic registry');
64
51
  }
52
+
53
+ return `Successfully created HCS-6 dynamic registry!\n\nTopic ID: ${result.topicId}\nTTL: ${params.ttl} seconds\n\nYou can now register dynamic hashinals to this registry using the topic ID.`;
65
54
  }
66
55
  }
@@ -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 type { TransactionResponse } from 'hedera-agent-kit';
4
+ import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
5
5
 
6
6
  /**
7
7
  * Schema for querying a dynamic registry
@@ -30,43 +30,33 @@ export type QueryDynamicRegistryInput = z.infer<typeof QueryDynamicRegistrySchem
30
30
  export class QueryDynamicRegistryTool extends BaseHCS6QueryTool<typeof QueryDynamicRegistrySchema> {
31
31
  name = 'queryDynamicRegistry';
32
32
  description = 'Query a dynamic registry to get the current state of a dynamic hashinal';
33
- schema = QueryDynamicRegistrySchema;
33
+
34
+ get specificInputSchema() {
35
+ return QueryDynamicRegistrySchema;
36
+ }
34
37
 
35
38
  constructor(params: HCS6QueryToolParams) {
36
39
  super(params);
37
40
  }
38
41
 
39
- protected async _call(
40
- params: QueryDynamicRegistryInput
41
- ): Promise<TransactionResponse> {
42
- try {
43
- const registry = await this.hcs6Builder.getRegistry(params.topicId, {
44
- limit: params.limit,
45
- order: params.order,
46
- skip: params.skip,
47
- });
42
+ protected async executeQuery(
43
+ params: QueryDynamicRegistryInput,
44
+ _runManager?: CallbackManagerForToolRun
45
+ ): Promise<unknown> {
46
+ const registry = await this.hcs6Builder.getRegistry(params.topicId, {
47
+ limit: params.limit,
48
+ order: params.order,
49
+ skip: params.skip,
50
+ });
51
+
52
+ const latestEntry = registry.latestEntry ? {
53
+ topicId: registry.latestEntry.message.t_id,
54
+ timestamp: registry.latestEntry.timestamp,
55
+ memo: registry.latestEntry.message.m,
56
+ sequence: registry.latestEntry.sequence,
57
+ payer: registry.latestEntry.payer,
58
+ } : null;
48
59
 
49
- return {
50
- status: 'success',
51
- data: {
52
- topicId: registry.topicId,
53
- registryType: 'NON_INDEXED',
54
- ttl: registry.ttl,
55
- latestEntry: registry.latestEntry ? {
56
- topicId: registry.latestEntry.message.t_id,
57
- timestamp: registry.latestEntry.timestamp,
58
- memo: registry.latestEntry.message.m,
59
- sequence: registry.latestEntry.sequence,
60
- payer: registry.latestEntry.payer,
61
- } : null,
62
- totalEntries: registry.entries.length,
63
- },
64
- };
65
- } catch (error) {
66
- return {
67
- status: 'error',
68
- message: error instanceof Error ? error.message : 'Unknown error',
69
- };
70
- }
60
+ return `Successfully queried dynamic registry!\n\nRegistry Topic: ${registry.topicId}\nRegistry Type: NON_INDEXED\nTTL: ${registry.ttl} seconds\nTotal Entries: ${registry.entries.length}${latestEntry ? `\n\nLatest Entry:\n- Topic ID: ${latestEntry.topicId}\n- Timestamp: ${latestEntry.timestamp}\n- Memo: ${latestEntry.memo || 'N/A'}\n- Sequence: ${latestEntry.sequence}` : '\n\nNo entries found in registry.'}`;
71
61
  }
72
62
  }
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import type { TransactionResponse } from 'hedera-agent-kit';
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
  /**
7
7
  * Schema for registering a dynamic hashinal
@@ -35,45 +35,35 @@ export type RegisterDynamicHashinalInput = z.infer<typeof RegisterDynamicHashina
35
35
  /**
36
36
  * Tool for registering (creating) dynamic hashinals
37
37
  */
38
- export class RegisterDynamicHashinalTool extends BaseHCS6TransactionTool<typeof RegisterDynamicHashinalSchema> {
38
+ export class RegisterDynamicHashinalTool extends BaseHCS6QueryTool<typeof RegisterDynamicHashinalSchema> {
39
39
  name = 'registerDynamicHashinal';
40
40
  description = 'Create and register a new dynamic hashinal that can be updated over time';
41
- schema = RegisterDynamicHashinalSchema;
41
+
42
+ get specificInputSchema() {
43
+ return RegisterDynamicHashinalSchema;
44
+ }
42
45
 
43
- constructor(params: HCS6TransactionToolParams) {
46
+ constructor(params: HCS6QueryToolParams) {
44
47
  super(params);
45
48
  }
46
49
 
47
- protected async _call(
48
- params: RegisterDynamicHashinalInput
49
- ): Promise<TransactionResponse> {
50
- try {
51
- const result = await this.hcs6Builder.register({
52
- metadata: params.metadata,
53
- data: params.data,
54
- memo: params.memo,
55
- ttl: params.ttl,
56
- registryTopicId: params.registryTopicId,
57
- submitKey: params.submitKey,
58
- });
59
-
60
- if (!result.success || !result.registryTopicId || !result.inscriptionTopicId) {
61
- throw new Error(result.error || 'Failed to register dynamic hashinal');
62
- }
50
+ protected async executeQuery(
51
+ params: RegisterDynamicHashinalInput,
52
+ _runManager?: CallbackManagerForToolRun
53
+ ): Promise<unknown> {
54
+ const result = await this.hcs6Builder.register({
55
+ metadata: params.metadata,
56
+ data: params.data,
57
+ memo: params.memo,
58
+ ttl: params.ttl,
59
+ registryTopicId: params.registryTopicId,
60
+ submitKey: params.submitKey,
61
+ });
63
62
 
64
- return {
65
- status: 'success',
66
- data: {
67
- registryTopicId: result.registryTopicId,
68
- inscriptionTopicId: result.inscriptionTopicId,
69
- transactionId: result.transactionId,
70
- },
71
- };
72
- } catch (error) {
73
- return {
74
- status: 'error',
75
- message: error instanceof Error ? error.message : 'Unknown error',
76
- };
63
+ if (!result.success) {
64
+ throw new Error(result.error || 'Failed to register dynamic hashinal');
77
65
  }
66
+
67
+ return `Successfully registered dynamic hashinal!\n\nRegistry Topic ID: ${result.registryTopicId}\nInscription Topic ID: ${result.inscriptionTopicId}${params.memo ? `\nMemo: ${params.memo}` : ''}\n\nThe dynamic hashinal has been created and can be updated using the registry topic ID.`;
78
68
  }
79
69
  }
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { BaseHCS6TransactionTool } from './base-hcs6-tools';
3
- import { HCS6TransactionToolParams } from './hcs6-tool-params';
4
- import type { TransactionResponse } from 'hedera-agent-kit';
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
  /**
7
7
  * Schema for updating a dynamic hashinal
@@ -29,46 +29,35 @@ export type UpdateDynamicHashinalInput = z.infer<typeof UpdateDynamicHashinalSch
29
29
  /**
30
30
  * Tool for updating dynamic hashinals
31
31
  */
32
- export class UpdateDynamicHashinalTool extends BaseHCS6TransactionTool<typeof UpdateDynamicHashinalSchema> {
32
+ export class UpdateDynamicHashinalTool extends BaseHCS6QueryTool<typeof UpdateDynamicHashinalSchema> {
33
33
  name = 'updateDynamicHashinal';
34
34
  description = 'Update an existing dynamic hashinal with new content while maintaining the same registry';
35
- schema = UpdateDynamicHashinalSchema;
35
+
36
+ get specificInputSchema() {
37
+ return UpdateDynamicHashinalSchema;
38
+ }
36
39
 
37
- constructor(params: HCS6TransactionToolParams) {
40
+ constructor(params: HCS6QueryToolParams) {
38
41
  super(params);
39
42
  }
40
43
 
41
- protected async _call(
42
- params: UpdateDynamicHashinalInput
43
- ): Promise<TransactionResponse> {
44
- try {
45
- // Use the register method with the existing registry ID
46
- const result = await this.hcs6Builder.register({
47
- metadata: params.metadata,
48
- data: params.data,
49
- memo: params.memo,
50
- registryTopicId: params.registryTopicId,
51
- submitKey: params.submitKey,
52
- });
53
-
54
- if (!result.success) {
55
- throw new Error(result.error || 'Failed to update dynamic hashinal');
56
- }
44
+ protected async executeQuery(
45
+ params: UpdateDynamicHashinalInput,
46
+ _runManager?: CallbackManagerForToolRun
47
+ ): Promise<unknown> {
48
+ // Use the register method with the existing registry ID to update
49
+ const result = await this.hcs6Builder.register({
50
+ metadata: params.metadata,
51
+ data: params.data,
52
+ memo: params.memo,
53
+ registryTopicId: params.registryTopicId,
54
+ submitKey: params.submitKey,
55
+ });
57
56
 
58
- return {
59
- status: 'success',
60
- data: {
61
- registryTopicId: result.registryTopicId,
62
- newInscriptionTopicId: result.inscriptionTopicId,
63
- transactionId: result.transactionId,
64
- updateMemo: params.memo,
65
- },
66
- };
67
- } catch (error) {
68
- return {
69
- status: 'error',
70
- message: error instanceof Error ? error.message : 'Unknown error',
71
- };
57
+ if (!result.success) {
58
+ throw new Error(result.error || 'Failed to update dynamic hashinal');
72
59
  }
60
+
61
+ return `Successfully updated dynamic hashinal!\n\nRegistry Topic ID: ${params.registryTopicId}\nInscription Topic ID: ${result.inscriptionTopicId}${params.memo ? `\nUpdate Memo: ${params.memo}` : ''}\n\nThe dynamic hashinal has been updated with new content.`;
73
62
  }
74
63
  }