@hashgraphonline/standards-agent-kit 0.2.132 → 0.2.134

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 (147) hide show
  1. package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +0 -2
  2. package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +2 -39
  3. package/dist/cjs/lib/zod-render/config-extractor.d.ts +0 -21
  4. package/dist/cjs/lib/zod-render/index.d.ts +3 -3
  5. package/dist/cjs/lib/zod-render/schema-extension.d.ts +1 -9
  6. package/dist/cjs/standards-agent-kit.cjs +1 -1
  7. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  8. package/dist/cjs/tools/index.d.ts +0 -1
  9. package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +41 -1
  10. package/dist/es/builders/hcs10/hcs10-builder.d.ts +0 -2
  11. package/dist/es/builders/inscriber/inscriber-builder.d.ts +2 -39
  12. package/dist/es/lib/zod-render/config-extractor.d.ts +0 -21
  13. package/dist/es/lib/zod-render/index.d.ts +3 -3
  14. package/dist/es/lib/zod-render/schema-extension.d.ts +1 -9
  15. package/dist/es/standards-agent-kit.es.js +47 -6228
  16. package/dist/es/standards-agent-kit.es.js.map +1 -1
  17. package/dist/es/standards-agent-kit.es10.js +91 -0
  18. package/dist/es/standards-agent-kit.es10.js.map +1 -0
  19. package/dist/es/standards-agent-kit.es11.js +40 -0
  20. package/dist/es/standards-agent-kit.es11.js.map +1 -0
  21. package/dist/es/standards-agent-kit.es12.js +40 -0
  22. package/dist/es/standards-agent-kit.es12.js.map +1 -0
  23. package/dist/es/standards-agent-kit.es13.js +50 -0
  24. package/dist/es/standards-agent-kit.es13.js.map +1 -0
  25. package/dist/es/standards-agent-kit.es14.js +62 -0
  26. package/dist/es/standards-agent-kit.es14.js.map +1 -0
  27. package/dist/es/standards-agent-kit.es15.js +72 -0
  28. package/dist/es/standards-agent-kit.es15.js.map +1 -0
  29. package/dist/es/standards-agent-kit.es16.js +35 -0
  30. package/dist/es/standards-agent-kit.es16.js.map +1 -0
  31. package/dist/es/standards-agent-kit.es17.js +35 -0
  32. package/dist/es/standards-agent-kit.es17.js.map +1 -0
  33. package/dist/es/standards-agent-kit.es18.js +45 -0
  34. package/dist/es/standards-agent-kit.es18.js.map +1 -0
  35. package/dist/es/standards-agent-kit.es19.js +21 -0
  36. package/dist/es/standards-agent-kit.es19.js.map +1 -0
  37. package/dist/es/standards-agent-kit.es2.js +25 -0
  38. package/dist/es/standards-agent-kit.es2.js.map +1 -0
  39. package/dist/es/standards-agent-kit.es20.js +143 -0
  40. package/dist/es/standards-agent-kit.es20.js.map +1 -0
  41. package/dist/es/standards-agent-kit.es21.js +32 -0
  42. package/dist/es/standards-agent-kit.es21.js.map +1 -0
  43. package/dist/es/standards-agent-kit.es22.js +46 -0
  44. package/dist/es/standards-agent-kit.es22.js.map +1 -0
  45. package/dist/es/standards-agent-kit.es23.js +48 -0
  46. package/dist/es/standards-agent-kit.es23.js.map +1 -0
  47. package/dist/es/standards-agent-kit.es24.js +51 -0
  48. package/dist/es/standards-agent-kit.es24.js.map +1 -0
  49. package/dist/es/standards-agent-kit.es25.js +45 -0
  50. package/dist/es/standards-agent-kit.es25.js.map +1 -0
  51. package/dist/es/standards-agent-kit.es26.js +48 -0
  52. package/dist/es/standards-agent-kit.es26.js.map +1 -0
  53. package/dist/es/standards-agent-kit.es27.js +45 -0
  54. package/dist/es/standards-agent-kit.es27.js.map +1 -0
  55. package/dist/es/standards-agent-kit.es28.js +32 -0
  56. package/dist/es/standards-agent-kit.es28.js.map +1 -0
  57. package/dist/es/standards-agent-kit.es29.js +35 -0
  58. package/dist/es/standards-agent-kit.es29.js.map +1 -0
  59. package/dist/es/standards-agent-kit.es3.js +1568 -0
  60. package/dist/es/standards-agent-kit.es3.js.map +1 -0
  61. package/dist/es/standards-agent-kit.es30.js +48 -0
  62. package/dist/es/standards-agent-kit.es30.js.map +1 -0
  63. package/dist/es/standards-agent-kit.es31.js +46 -0
  64. package/dist/es/standards-agent-kit.es31.js.map +1 -0
  65. package/dist/es/standards-agent-kit.es32.js +48 -0
  66. package/dist/es/standards-agent-kit.es32.js.map +1 -0
  67. package/dist/es/standards-agent-kit.es33.js +86 -0
  68. package/dist/es/standards-agent-kit.es33.js.map +1 -0
  69. package/dist/es/standards-agent-kit.es34.js +241 -0
  70. package/dist/es/standards-agent-kit.es34.js.map +1 -0
  71. package/dist/es/standards-agent-kit.es35.js +223 -0
  72. package/dist/es/standards-agent-kit.es35.js.map +1 -0
  73. package/dist/es/standards-agent-kit.es36.js +187 -0
  74. package/dist/es/standards-agent-kit.es36.js.map +1 -0
  75. package/dist/es/standards-agent-kit.es37.js +619 -0
  76. package/dist/es/standards-agent-kit.es37.js.map +1 -0
  77. package/dist/es/standards-agent-kit.es38.js +46 -0
  78. package/dist/es/standards-agent-kit.es38.js.map +1 -0
  79. package/dist/es/standards-agent-kit.es39.js +249 -0
  80. package/dist/es/standards-agent-kit.es39.js.map +1 -0
  81. package/dist/es/standards-agent-kit.es4.js +95 -0
  82. package/dist/es/standards-agent-kit.es4.js.map +1 -0
  83. package/dist/es/standards-agent-kit.es40.js +141 -0
  84. package/dist/es/standards-agent-kit.es40.js.map +1 -0
  85. package/dist/es/standards-agent-kit.es41.js +33 -0
  86. package/dist/es/standards-agent-kit.es41.js.map +1 -0
  87. package/dist/es/standards-agent-kit.es42.js +427 -0
  88. package/dist/es/standards-agent-kit.es42.js.map +1 -0
  89. package/dist/es/standards-agent-kit.es43.js +189 -0
  90. package/dist/es/standards-agent-kit.es43.js.map +1 -0
  91. package/dist/es/standards-agent-kit.es44.js +7 -0
  92. package/dist/es/standards-agent-kit.es44.js.map +1 -0
  93. package/dist/es/standards-agent-kit.es45.js +28 -0
  94. package/dist/es/standards-agent-kit.es45.js.map +1 -0
  95. package/dist/es/standards-agent-kit.es46.js +7 -0
  96. package/dist/es/standards-agent-kit.es46.js.map +1 -0
  97. package/dist/es/standards-agent-kit.es47.js +57 -0
  98. package/dist/es/standards-agent-kit.es47.js.map +1 -0
  99. package/dist/es/standards-agent-kit.es48.js +6 -0
  100. package/dist/es/standards-agent-kit.es48.js.map +1 -0
  101. package/dist/es/standards-agent-kit.es49.js +43 -0
  102. package/dist/es/standards-agent-kit.es49.js.map +1 -0
  103. package/dist/es/standards-agent-kit.es5.js +113 -0
  104. package/dist/es/standards-agent-kit.es5.js.map +1 -0
  105. package/dist/es/standards-agent-kit.es50.js +22 -0
  106. package/dist/es/standards-agent-kit.es50.js.map +1 -0
  107. package/dist/es/standards-agent-kit.es51.js +57 -0
  108. package/dist/es/standards-agent-kit.es51.js.map +1 -0
  109. package/dist/es/standards-agent-kit.es6.js +56 -0
  110. package/dist/es/standards-agent-kit.es6.js.map +1 -0
  111. package/dist/es/standards-agent-kit.es7.js +332 -0
  112. package/dist/es/standards-agent-kit.es7.js.map +1 -0
  113. package/dist/es/standards-agent-kit.es8.js +32 -0
  114. package/dist/es/standards-agent-kit.es8.js.map +1 -0
  115. package/dist/es/standards-agent-kit.es9.js +244 -0
  116. package/dist/es/standards-agent-kit.es9.js.map +1 -0
  117. package/dist/es/tools/index.d.ts +0 -1
  118. package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +41 -1
  119. package/dist/umd/builders/hcs10/hcs10-builder.d.ts +0 -2
  120. package/dist/umd/builders/inscriber/inscriber-builder.d.ts +2 -39
  121. package/dist/umd/lib/zod-render/config-extractor.d.ts +0 -21
  122. package/dist/umd/lib/zod-render/index.d.ts +3 -3
  123. package/dist/umd/lib/zod-render/schema-extension.d.ts +1 -9
  124. package/dist/umd/standards-agent-kit.umd.js +1 -1
  125. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  126. package/dist/umd/tools/index.d.ts +0 -1
  127. package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +41 -1
  128. package/package.json +33 -29
  129. package/src/builders/hcs10/hcs10-builder.ts +0 -4
  130. package/src/builders/inscriber/inscriber-builder.ts +2 -45
  131. package/src/lib/zod-render/config-extractor.ts +0 -92
  132. package/src/lib/zod-render/index.ts +1 -7
  133. package/src/lib/zod-render/schema-extension.ts +1 -69
  134. package/src/tools/index.ts +1 -2
  135. package/src/tools/inscriber/InscribeHashinalTool.ts +92 -5
  136. package/dist/cjs/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
  137. package/dist/cjs/tools/hedera/HederaCreateNftTool.d.ts +0 -72
  138. package/dist/cjs/tools/hedera/index.d.ts +0 -1
  139. package/dist/es/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
  140. package/dist/es/tools/hedera/HederaCreateNftTool.d.ts +0 -72
  141. package/dist/es/tools/hedera/index.d.ts +0 -1
  142. package/dist/umd/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
  143. package/dist/umd/tools/hedera/HederaCreateNftTool.d.ts +0 -72
  144. package/dist/umd/tools/hedera/index.d.ts +0 -1
  145. package/src/lib/zod-render/__tests__/withRender.test.ts +0 -205
  146. package/src/tools/hedera/HederaCreateNftTool.ts +0 -294
  147. package/src/tools/hedera/index.ts +0 -1
@@ -2,4 +2,3 @@ export * from './hcs10';
2
2
  export * from './hcs2';
3
3
  export * from './hcs6';
4
4
  export * from './inscriber';
5
- export * from './hedera';
@@ -60,7 +60,47 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool impleme
60
60
  };
61
61
  protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<InscriptionResponse>;
62
62
  /**
63
- * Creates HashLink block reference for inscription display
63
+ * Creates HashLink block configuration for Hashinal inscriptions.
64
+ * Automatically detects network and selects appropriate block ID configuration.
65
+ * Uses testnet block as fallback for unknown networks or undeployed mainnet blocks.
66
+ *
67
+ * @param response The inscription response containing metadata and network information
68
+ * @param _mimeType Optional MIME type (currently unused, preserved for compatibility)
69
+ * @returns HCS12BlockResult with network-specific block configuration
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * // Testnet usage (automatic detection from client)
74
+ * const testnetClient = Client.forTestnet();
75
+ * const tool = new InscribeHashinalTool(testnetClient);
76
+ * const block = await tool.createHashLinkBlock(inscriptionResponse);
77
+ * console.log(block.blockId); // '0.0.6617393'
78
+ * console.log(block.hashLink); // 'hcs://12/0.0.6617393'
79
+ *
80
+ * // Mainnet usage (automatic detection from client)
81
+ * const mainnetClient = Client.forMainnet();
82
+ * const tool = new InscribeHashinalTool(mainnetClient);
83
+ * const block = await tool.createHashLinkBlock(inscriptionResponse);
84
+ * console.log(block.blockId); // Network-specific mainnet block ID
85
+ *
86
+ * // HashLink Block Response Structure:
87
+ * {
88
+ * blockId: string; // Hedera account ID format (e.g., '0.0.6617393')
89
+ * hashLink: string; // HCS-12 URL format: 'hcs://12/{blockId}'
90
+ * template: string; // Block template reference matching blockId
91
+ * attributes: { // Metadata for client-side processing
92
+ * name: string; // Content display name
93
+ * creator: string; // Creator account ID
94
+ * topicId: string; // HCS topic containing the inscription
95
+ * hrl: string; // Hedera Resource Locator
96
+ * network: string; // Network type: 'testnet' | 'mainnet'
97
+ * }
98
+ * }
99
+ *
100
+ * // Render function usage in HashLink blocks:
101
+ * // The block's JavaScript render function receives this structure
102
+ * // and can access network-specific resources through attributes.network
103
+ * ```
64
104
  */
65
105
  private createHashLinkBlock;
66
106
  private resolveContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashgraphonline/standards-agent-kit",
3
- "version": "0.2.132",
3
+ "version": "0.2.134",
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",
@@ -21,6 +21,33 @@
21
21
  "LICENSE",
22
22
  "README.md"
23
23
  ],
24
+ "scripts": {
25
+ "clean": "rimraf dist",
26
+ "build:es": "BUILD_FORMAT=es vite build",
27
+ "build:cjs": "BUILD_FORMAT=cjs vite build",
28
+ "build:umd": "BUILD_FORMAT=umd vite build",
29
+ "build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
30
+ "test": "jest",
31
+ "lint": "eslint . --ext .ts",
32
+ "lint:fix": "eslint . --ext .ts --fix",
33
+ "prepare": "pnpm run build",
34
+ "prepublishOnly": "pnpm run build",
35
+ "release": "pnpm publish --access public",
36
+ "release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
37
+ "version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
38
+ "publish:canary": "pnpm run version:canary && pnpm run release:canary",
39
+ "demo:cli": "tsx examples/cli-demo.ts",
40
+ "demo:interactive": "tsx examples/interactive-demo.ts",
41
+ "demo:langchain": "tsx examples/langchain-demo.ts",
42
+ "demo:plugin": "tsx examples/plugin-system-example.ts",
43
+ "demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
44
+ "demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
45
+ "demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
46
+ "demo:inscription-quotes": "tsx examples/inscription-quote-demo.ts",
47
+ "standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
48
+ "standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
49
+ "typecheck": "tsc --noEmit"
50
+ },
24
51
  "keywords": [
25
52
  "hedera",
26
53
  "hcs10",
@@ -63,7 +90,8 @@
63
90
  },
64
91
  "dependencies": {
65
92
  "@hashgraph/sdk": "^2.69.0",
66
- "@hashgraphonline/standards-sdk": "0.0.182",
93
+ "@hashgraphonline/standards-sdk": "0.0.183",
94
+ "@kiloscribe/inscription-sdk": "^1.0.59",
67
95
  "@langchain/community": "^0.3.5",
68
96
  "@langchain/core": "^0.3.71",
69
97
  "@langchain/openai": "^0.6.7",
@@ -79,7 +107,7 @@
79
107
  "zod": "^3.25.28"
80
108
  },
81
109
  "devDependencies": {
82
- "@hashgraphonline/conversational-agent": "0.1.205",
110
+ "@hashgraphonline/conversational-agent": "0.1.217",
83
111
  "@rollup/plugin-commonjs": "^28.0.6",
84
112
  "@swc/core": "^1.11.21",
85
113
  "@swc/jest": "^0.2.36",
@@ -101,29 +129,5 @@
101
129
  "vite-plugin-node-polyfills": "^0.23.0",
102
130
  "vite-plugin-string-replace": "^1.1.3"
103
131
  },
104
- "scripts": {
105
- "clean": "rimraf dist",
106
- "build:es": "BUILD_FORMAT=es vite build",
107
- "build:cjs": "BUILD_FORMAT=cjs vite build",
108
- "build:umd": "BUILD_FORMAT=umd vite build",
109
- "build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
110
- "test": "jest",
111
- "lint": "eslint . --ext .ts",
112
- "lint:fix": "eslint . --ext .ts --fix",
113
- "release": "pnpm publish --access public",
114
- "release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
115
- "version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
116
- "publish:canary": "pnpm run version:canary && pnpm run release:canary",
117
- "demo:cli": "tsx examples/cli-demo.ts",
118
- "demo:interactive": "tsx examples/interactive-demo.ts",
119
- "demo:langchain": "tsx examples/langchain-demo.ts",
120
- "demo:plugin": "tsx examples/plugin-system-example.ts",
121
- "demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
122
- "demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
123
- "demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
124
- "demo:inscription-quotes": "tsx examples/inscription-quote-demo.ts",
125
- "standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
126
- "standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
127
- "typecheck": "tsc --noEmit"
128
- }
129
- }
132
+ "packageManager": "pnpm@10.11.1+sha512.e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912"
133
+ }
@@ -137,8 +137,6 @@ 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 = false;
141
- private guardedRegistryBaseUrl: string = '';
142
140
  private network: StandardNetworkType;
143
141
  private sdkLogger: SDKLogger;
144
142
 
@@ -153,8 +151,6 @@ export class HCS10Builder extends BaseServiceBuilder {
153
151
  ) {
154
152
  super(hederaKit);
155
153
  this.stateManager = stateManager;
156
- this.useEncryption = options?.useEncryption || false;
157
- this.guardedRegistryBaseUrl = options?.registryUrl || '';
158
154
 
159
155
  const network = this.hederaKit.client.network;
160
156
  this.network = network.toString().includes('mainnet')
@@ -11,59 +11,16 @@ import {
11
11
  HederaClientConfig,
12
12
  NetworkType,
13
13
  } from '@hashgraphonline/standards-sdk';
14
+ import { InscriptionSDK } from '@kiloscribe/inscription-sdk';
14
15
 
15
16
  /**
16
- * Type definition for DAppSigner from hedera-wallet-connect
17
+ * Type definition for DAppSigner interface compatible with inscription SDK
17
18
  */
18
19
  interface DAppSigner {
19
20
  getAccountId(): { toString(): string };
20
21
  [key: string]: unknown;
21
22
  }
22
23
 
23
- /**
24
- * Type definition for inscription request parameters
25
- */
26
- interface InscriptionRequest {
27
- [key: string]: unknown;
28
- }
29
-
30
- /**
31
- * Type definition for inscription configuration
32
- */
33
- interface InscriptionConfig {
34
- [key: string]: unknown;
35
- }
36
-
37
- /**
38
- * Type definition for inscription execution result
39
- */
40
- interface InscriptionExecutionResult {
41
- [key: string]: unknown;
42
- }
43
-
44
- /**
45
- * Type definition for inscription result
46
- */
47
- interface InscriptionResult {
48
- [key: string]: unknown;
49
- }
50
-
51
- /**
52
- * Type definition for wait for inscription result
53
- */
54
- interface WaitForInscriptionResult {
55
- [key: string]: unknown;
56
- }
57
-
58
- /**
59
- * Type definition for InscriptionSDK since we don't have the actual package
60
- */
61
- interface InscriptionSDK {
62
- inscribeAndExecute(request: InscriptionRequest, config: InscriptionConfig): Promise<InscriptionExecutionResult>;
63
- inscribe(request: InscriptionRequest, signer: DAppSigner): Promise<InscriptionResult>;
64
- waitForInscription(txId: string, maxAttempts: number, intervalMs: number, checkCompletion: boolean, progressCallback?: (...args: unknown[]) => void): Promise<WaitForInscriptionResult>;
65
- }
66
-
67
24
  /**
68
25
  * Builder for Inscription operations
69
26
  */
@@ -34,15 +34,6 @@ interface FieldConfigMapEntry {
34
34
  path: string[];
35
35
  }
36
36
 
37
- /**
38
- * Type definition for validation rules entries
39
- */
40
- interface ValidationRulesEntry {
41
- required: boolean;
42
- type: FormFieldType;
43
- constraints: Record<string, unknown>;
44
- customMessages?: Record<string, string>;
45
- }
46
37
 
47
38
  /**
48
39
  * Type definition for simple field configuration
@@ -326,91 +317,8 @@ export function createFieldConfigMap(schema: ZodType<unknown>): Record<string, F
326
317
  return configMap;
327
318
  }
328
319
 
329
- /**
330
- * Generates validation rules from schema and render configs
331
- */
332
- export function extractValidationRules(schema: ZodType<unknown>): Record<string, ValidationRulesEntry> {
333
- const extracted = extractRenderConfigs(schema);
334
- const rules: Record<string, ValidationRulesEntry> = {};
335
-
336
- for (const [fieldPath, metadata] of Object.entries(extracted.metadata)) {
337
- const renderConfig = extracted.fields[fieldPath];
338
-
339
- rules[fieldPath] = {
340
- required: metadata.required,
341
- type: metadata.type,
342
- constraints: metadata.constraints || {},
343
- customMessages: renderConfig?.validation?.customMessages
344
- };
345
- }
346
-
347
- return rules;
348
- }
349
-
350
- /**
351
- * Merges render configurations from multiple schemas
352
- */
353
- export function mergeRenderConfigs(
354
- ...configs: ExtractedRenderConfig[]
355
- ): ExtractedRenderConfig {
356
- const merged: ExtractedRenderConfig = {
357
- fields: {},
358
- groups: {},
359
- order: [],
360
- metadata: {}
361
- };
362
-
363
- for (const config of configs) {
364
- Object.assign(merged.fields, config.fields);
365
- Object.assign(merged.metadata, config.metadata);
366
-
367
- for (const [groupName, groupFields] of Object.entries(config.groups)) {
368
- if (!merged.groups[groupName]) {
369
- merged.groups[groupName] = [];
370
- }
371
- merged.groups[groupName].push(...groupFields);
372
- }
373
-
374
- merged.order.push(...config.order);
375
- }
376
-
377
- merged.order = [...new Set(merged.order)];
378
-
379
- return merged;
380
- }
381
-
382
- /**
383
- * Filters render configurations based on conditions
384
- */
385
- export function filterRenderConfigs(
386
- config: ExtractedRenderConfig,
387
- filter: (fieldPath: string, renderConfig: RenderConfigSchema) => boolean
388
- ): ExtractedRenderConfig {
389
- const filtered: ExtractedRenderConfig = {
390
- fields: {},
391
- groups: {},
392
- order: [],
393
- metadata: {}
394
- };
395
-
396
- for (const [fieldPath, renderConfig] of Object.entries(config.fields)) {
397
- if (filter(fieldPath, renderConfig)) {
398
- filtered.fields[fieldPath] = renderConfig;
399
- filtered.metadata[fieldPath] = config.metadata[fieldPath];
400
- }
401
- }
402
320
 
403
- for (const [groupName, groupFields] of Object.entries(config.groups)) {
404
- const filteredFields = groupFields.filter(fieldPath => filtered.fields[fieldPath]);
405
- if (filteredFields.length > 0) {
406
- filtered.groups[groupName] = filteredFields;
407
- }
408
- }
409
321
 
410
- filtered.order = config.order.filter(fieldPath => filtered.fields[fieldPath]);
411
-
412
- return filtered;
413
- }
414
322
 
415
323
  /**
416
324
  * Creates a simplified configuration for basic form rendering
@@ -6,18 +6,13 @@ export {
6
6
  extendZodSchema,
7
7
  hasRenderConfig,
8
8
  getRenderConfig,
9
- renderConfigs,
10
- createRenderConfig,
11
- schemaComposer
9
+ renderConfigs
12
10
  } from './schema-extension';
13
11
 
14
12
  export {
15
13
  extractRenderConfigs,
16
14
  generateFieldOrdering,
17
15
  createFieldConfigMap,
18
- extractValidationRules,
19
- mergeRenderConfigs,
20
- filterRenderConfigs,
21
16
  createSimpleConfig
22
17
  } from './config-extractor';
23
18
 
@@ -37,6 +32,5 @@ export type {
37
32
  SelectOption,
38
33
  FileUploadResult,
39
34
  FieldMetadata,
40
- SchemaComposer,
41
35
  ExtractedRenderConfig
42
36
  } from './types';
@@ -1,5 +1,5 @@
1
1
  import { ZodType } from 'zod';
2
- import { RenderConfigSchema, EnhancedRenderConfig, ZodSchemaWithRender, FormFieldType, FieldMetadata, SelectOption, SchemaComposer } from './types';
2
+ import { RenderConfigSchema, EnhancedRenderConfig, ZodSchemaWithRender, FormFieldType, FieldMetadata, SelectOption } from './types';
3
3
 
4
4
  // Type definitions for extended Zod schemas - using Record to extend existing properties
5
5
  interface ExtendedZodSchema {
@@ -376,75 +376,7 @@ export function extractFieldMetadata(schema: ZodType<unknown>): FieldMetadata {
376
376
  };
377
377
  }
378
378
 
379
- /**
380
- * Schema composition utilities for building complex forms
381
- */
382
- export const schemaComposer: SchemaComposer = {
383
- merge: <TSchema1, TSchema2>(schema1: ZodType<TSchema1>, schema2: ZodType<TSchema2>) => {
384
- const typeName1 = (schema1._def as Record<string, unknown>)?.typeName;
385
- const typeName2 = (schema2._def as Record<string, unknown>)?.typeName;
386
-
387
- if (typeName1 === 'ZodObject' && typeName2 === 'ZodObject') {
388
- return (schema1 as ZodType<TSchema1> & ExtendedZodSchema).merge?.(schema2) as ZodType<TSchema1 & TSchema2> || schema1 as ZodType<TSchema1 & TSchema2>;
389
- }
390
379
 
391
- throw new Error('Can only merge ZodObject schemas');
392
- },
393
-
394
- extend: <TSchema>(schema: ZodType<TSchema>, extensions: Record<string, ZodType<unknown>>) => {
395
- const typeName = (schema._def as Record<string, unknown>)?.typeName;
396
-
397
- if (typeName === 'ZodObject') {
398
- return (schema as ZodType<TSchema> & ExtendedZodSchema).extend?.(extensions) as ZodType<TSchema> || schema;
399
- }
400
-
401
- throw new Error('Can only extend ZodObject schemas');
402
- },
403
-
404
- pick: <TSchema>(schema: ZodType<TSchema>, keys: string[]) => {
405
- const typeName = (schema._def as Record<string, unknown>)?.typeName;
406
-
407
- if (typeName === 'ZodObject') {
408
- const pickObj: Record<string, boolean> = {};
409
- keys.forEach(key => pickObj[key] = true);
410
- return (schema as ZodType<TSchema> & ExtendedZodSchema).pick?.(pickObj) as ZodType<Partial<TSchema>> || schema as ZodType<Partial<TSchema>>;
411
- }
412
-
413
- throw new Error('Can only pick from ZodObject schemas');
414
- },
415
-
416
- omit: <TSchema>(schema: ZodType<TSchema>, keys: string[]) => {
417
- const typeName = (schema._def as Record<string, unknown>)?.typeName;
418
-
419
- if (typeName === 'ZodObject') {
420
- const omitObj: Record<string, boolean> = {};
421
- keys.forEach(key => omitObj[key] = true);
422
- return (schema as ZodType<TSchema> & ExtendedZodSchema).omit?.(omitObj) as ZodType<Omit<TSchema, string>> || schema as ZodType<Omit<TSchema, string>>;
423
- }
424
-
425
- throw new Error('Can only omit from ZodObject schemas');
426
- }
427
- };
428
-
429
- /**
430
- * Creates render configuration with sensible defaults
431
- */
432
- export function createRenderConfig(overrides: Partial<EnhancedRenderConfig> = {}): EnhancedRenderConfig {
433
- return {
434
- fieldType: 'text',
435
- ui: {
436
- label: '',
437
- width: 'full',
438
- priority: 'common',
439
- ...overrides.ui
440
- },
441
- progressive: {
442
- priority: 'common',
443
- ...overrides.progressive
444
- },
445
- ...overrides
446
- };
447
- }
448
380
 
449
381
  /**
450
382
  * Helper function to create common render configurations
@@ -1,5 +1,4 @@
1
1
  export * from './hcs10';
2
2
  export * from './hcs2';
3
3
  export * from './hcs6';
4
- export * from './inscriber';
5
- export * from './hedera';
4
+ export * from './inscriber';
@@ -24,6 +24,37 @@ import {
24
24
  } from '../../types/inscription-response';
25
25
  import { FormValidatable } from '../../interfaces/FormValidatable';
26
26
 
27
+ /**
28
+ * Network-specific Hashinal block configuration for HashLink blocks
29
+ */
30
+ const HASHLINK_BLOCK_CONFIG = {
31
+ testnet: {
32
+ blockId: '0.0.6617393',
33
+ hashLink: 'hcs://12/0.0.6617393',
34
+ template: '0.0.6617393',
35
+ },
36
+ mainnet: {
37
+ blockId: '0.0.TBD',
38
+ hashLink: 'hcs://12/0.0.TBD',
39
+ template: '0.0.TBD',
40
+ },
41
+ } as const;
42
+
43
+ /**
44
+ * Gets the appropriate HashLink block configuration for the specified network.
45
+ * Provides graceful fallback to testnet for unknown networks or undeployed mainnet blocks.
46
+ *
47
+ * @param network The network type to get configuration for
48
+ * @returns Network-specific block configuration with blockId, hashLink, and template
49
+ */
50
+ function getHashLinkBlockId(network: 'mainnet' | 'testnet') {
51
+ const config = HASHLINK_BLOCK_CONFIG[network];
52
+ if (!config || config.blockId === '0.0.TBD') {
53
+ return HASHLINK_BLOCK_CONFIG.testnet;
54
+ }
55
+ return config;
56
+ }
57
+
27
58
  /**
28
59
  * Result of HCS-12 block lookup
29
60
  */
@@ -692,20 +723,76 @@ export class InscribeHashinalTool
692
723
  }
693
724
 
694
725
  /**
695
- * Creates HashLink block reference for inscription display
726
+ * Creates HashLink block configuration for Hashinal inscriptions.
727
+ * Automatically detects network and selects appropriate block ID configuration.
728
+ * Uses testnet block as fallback for unknown networks or undeployed mainnet blocks.
729
+ *
730
+ * @param response The inscription response containing metadata and network information
731
+ * @param _mimeType Optional MIME type (currently unused, preserved for compatibility)
732
+ * @returns HCS12BlockResult with network-specific block configuration
733
+ *
734
+ * @example
735
+ * ```typescript
736
+ * // Testnet usage (automatic detection from client)
737
+ * const testnetClient = Client.forTestnet();
738
+ * const tool = new InscribeHashinalTool(testnetClient);
739
+ * const block = await tool.createHashLinkBlock(inscriptionResponse);
740
+ * console.log(block.blockId); // '0.0.6617393'
741
+ * console.log(block.hashLink); // 'hcs://12/0.0.6617393'
742
+ *
743
+ * // Mainnet usage (automatic detection from client)
744
+ * const mainnetClient = Client.forMainnet();
745
+ * const tool = new InscribeHashinalTool(mainnetClient);
746
+ * const block = await tool.createHashLinkBlock(inscriptionResponse);
747
+ * console.log(block.blockId); // Network-specific mainnet block ID
748
+ *
749
+ * // HashLink Block Response Structure:
750
+ * {
751
+ * blockId: string; // Hedera account ID format (e.g., '0.0.6617393')
752
+ * hashLink: string; // HCS-12 URL format: 'hcs://12/{blockId}'
753
+ * template: string; // Block template reference matching blockId
754
+ * attributes: { // Metadata for client-side processing
755
+ * name: string; // Content display name
756
+ * creator: string; // Creator account ID
757
+ * topicId: string; // HCS topic containing the inscription
758
+ * hrl: string; // Hedera Resource Locator
759
+ * network: string; // Network type: 'testnet' | 'mainnet'
760
+ * }
761
+ * }
762
+ *
763
+ * // Render function usage in HashLink blocks:
764
+ * // The block's JavaScript render function receives this structure
765
+ * // and can access network-specific resources through attributes.network
766
+ * ```
696
767
  */
697
768
  private async createHashLinkBlock(
698
769
  response: ReturnType<typeof createInscriptionSuccess>,
699
770
  _mimeType?: string
700
771
  ): Promise<HCS12BlockResult> {
701
- const network = response.inscription.cdnUrl?.includes('mainnet')
772
+ const clientNetwork = this.inscriberBuilder['hederaKit'].client.network
773
+ .toString()
774
+ .includes('mainnet')
775
+ ? 'mainnet'
776
+ : 'testnet';
777
+
778
+ const cdnNetwork = response.inscription.cdnUrl?.includes('mainnet')
702
779
  ? 'mainnet'
703
780
  : 'testnet';
704
781
 
782
+ if (clientNetwork !== cdnNetwork) {
783
+ const logger = new Logger({ module: 'InscribeHashinalTool' });
784
+ logger.warn(
785
+ `Network mismatch detected: client=${clientNetwork}, cdn=${cdnNetwork}. Using client network.`
786
+ );
787
+ }
788
+
789
+ const network = clientNetwork;
790
+ const config = getHashLinkBlockId(network);
791
+
705
792
  return {
706
- blockId: '0.0.6617393',
707
- hashLink: 'hcs://12/0.0.6617393',
708
- template: '0.0.6617393',
793
+ blockId: config.blockId,
794
+ hashLink: config.hashLink,
795
+ template: config.template,
709
796
  attributes: {
710
797
  name: response.metadata.name || 'Untitled Content',
711
798
  creator: response.metadata.creator || '',
@@ -1,72 +0,0 @@
1
- import { z } from 'zod';
2
- import { BaseHederaTransactionTool, BaseServiceBuilder } from 'hedera-agent-kit';
3
- /**
4
- * Enhanced NFT creation schema with render configurations
5
- */
6
- export declare const HederaCreateNftSchema: import('../..').ZodSchemaWithRender<{
7
- tokenName: string;
8
- memo?: string | undefined;
9
- adminKey?: string | undefined;
10
- tokenSymbol?: string | undefined;
11
- treasuryAccountId?: string | undefined;
12
- kycKey?: string | undefined;
13
- freezeKey?: string | undefined;
14
- wipeKey?: string | undefined;
15
- supplyKey?: string | undefined;
16
- feeScheduleKey?: string | undefined;
17
- pauseKey?: string | undefined;
18
- autoRenewAccountId?: string | undefined;
19
- autoRenewPeriod?: number | undefined;
20
- freezeDefault?: boolean | undefined;
21
- supplyType?: "FINITE" | "INFINITE" | undefined;
22
- maxSupply?: string | number | undefined;
23
- customFees?: ({
24
- type: "FIXED" | "FIXED_FEE";
25
- amount: string | number;
26
- feeCollectorAccountId?: string | undefined;
27
- denominatingTokenId?: string | undefined;
28
- } | {
29
- type: "FRACTIONAL" | "FRACTIONAL_FEE";
30
- numerator: number;
31
- denominator: number;
32
- feeCollectorAccountId?: string | undefined;
33
- minAmount?: string | number | undefined;
34
- maxAmount?: string | number | undefined;
35
- assessmentMethodInclusive?: boolean | undefined;
36
- } | {
37
- type: "ROYALTY" | "ROYALTY_FEE";
38
- numerator: number;
39
- denominator: number;
40
- feeCollectorAccountId?: string | undefined;
41
- fallbackFee?: {
42
- amount: string | number;
43
- feeCollectorAccountId?: string | undefined;
44
- denominatingTokenId?: string | undefined;
45
- } | undefined;
46
- })[] | undefined;
47
- }>;
48
- /**
49
- * Hedera Create NFT Tool with enhanced render configurations for form generation
50
- */
51
- export declare class HederaCreateNftTool extends BaseHederaTransactionTool<any> {
52
- name: string;
53
- description: string;
54
- specificInputSchema: any;
55
- namespace: string;
56
- /**
57
- * Returns the service builder for HTS operations
58
- */
59
- protected getServiceBuilder(): BaseServiceBuilder;
60
- /**
61
- * Calls the builder method to create the NFT collection
62
- */
63
- protected callBuilderMethod(builder: BaseServiceBuilder, specificArgs: z.infer<typeof HederaCreateNftSchema>): Promise<void>;
64
- /**
65
- * Provides helpful notes for specific field values
66
- */
67
- protected getNoteForKey(key: string, schemaDefaultValue: unknown, actualValue: unknown): string | undefined;
68
- /**
69
- * Validates the configuration before execution
70
- */
71
- protected validateInput(args: z.infer<typeof HederaCreateNftSchema>): Promise<void>;
72
- }
@@ -1 +0,0 @@
1
- export { HederaCreateNftTool, HederaCreateNftSchema } from './HederaCreateNftTool';
@@ -1 +0,0 @@
1
- export {};