@hashgraphonline/standards-agent-kit 0.2.130 → 0.2.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +36 -5
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/interfaces/FormValidatable.d.ts +45 -0
- package/dist/cjs/interfaces/index.d.ts +1 -0
- package/dist/cjs/lib/index.d.ts +1 -0
- package/dist/cjs/lib/zod-render/__tests__/withRender.test.d.ts +1 -0
- package/dist/cjs/lib/zod-render/config-extractor.d.ts +71 -0
- package/dist/cjs/lib/zod-render/index.d.ts +6 -0
- package/dist/cjs/lib/zod-render/schema-extension.d.ts +102 -0
- package/dist/cjs/lib/zod-render/types.d.ts +286 -0
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/hcs10/natural-language-mapper.d.ts +6 -1
- package/dist/cjs/tools/hcs2/CreateRegistryTool.d.ts +1 -16
- package/dist/cjs/tools/hcs2/DeleteEntryTool.d.ts +1 -13
- package/dist/cjs/tools/hcs2/RegisterEntryTool.d.ts +1 -16
- package/dist/cjs/tools/hcs2/UpdateEntryTool.d.ts +1 -19
- package/dist/cjs/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
- package/dist/cjs/tools/hedera/HederaCreateNftTool.d.ts +72 -0
- package/dist/cjs/tools/hedera/index.d.ts +1 -0
- package/dist/cjs/tools/index.d.ts +1 -0
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +42 -132
- package/dist/cjs/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
- package/dist/cjs/types/inscription-response.d.ts +172 -0
- package/dist/cjs/validation/hip412-schemas.d.ts +1 -1
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +36 -5
- package/dist/es/index.d.ts +2 -0
- package/dist/es/interfaces/FormValidatable.d.ts +45 -0
- package/dist/es/interfaces/index.d.ts +1 -0
- package/dist/es/lib/index.d.ts +1 -0
- package/dist/es/lib/zod-render/__tests__/withRender.test.d.ts +1 -0
- package/dist/es/lib/zod-render/config-extractor.d.ts +71 -0
- package/dist/es/lib/zod-render/index.d.ts +6 -0
- package/dist/es/lib/zod-render/schema-extension.d.ts +102 -0
- package/dist/es/lib/zod-render/types.d.ts +286 -0
- package/dist/es/standards-agent-kit.es.js +6248 -44
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/tools/hcs10/natural-language-mapper.d.ts +6 -1
- package/dist/es/tools/hcs2/CreateRegistryTool.d.ts +1 -16
- package/dist/es/tools/hcs2/DeleteEntryTool.d.ts +1 -13
- package/dist/es/tools/hcs2/RegisterEntryTool.d.ts +1 -16
- package/dist/es/tools/hcs2/UpdateEntryTool.d.ts +1 -19
- package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
- package/dist/es/tools/hedera/HederaCreateNftTool.d.ts +72 -0
- package/dist/es/tools/hedera/index.d.ts +1 -0
- package/dist/es/tools/index.d.ts +1 -0
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +42 -132
- package/dist/es/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
- package/dist/es/types/inscription-response.d.ts +172 -0
- package/dist/es/validation/hip412-schemas.d.ts +1 -1
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +36 -5
- package/dist/umd/index.d.ts +2 -0
- package/dist/umd/interfaces/FormValidatable.d.ts +45 -0
- package/dist/umd/interfaces/index.d.ts +1 -0
- package/dist/umd/lib/index.d.ts +1 -0
- package/dist/umd/lib/zod-render/__tests__/withRender.test.d.ts +1 -0
- package/dist/umd/lib/zod-render/config-extractor.d.ts +71 -0
- package/dist/umd/lib/zod-render/index.d.ts +6 -0
- package/dist/umd/lib/zod-render/schema-extension.d.ts +102 -0
- package/dist/umd/lib/zod-render/types.d.ts +286 -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/hcs10/natural-language-mapper.d.ts +6 -1
- package/dist/umd/tools/hcs2/CreateRegistryTool.d.ts +1 -16
- package/dist/umd/tools/hcs2/DeleteEntryTool.d.ts +1 -13
- package/dist/umd/tools/hcs2/RegisterEntryTool.d.ts +1 -16
- package/dist/umd/tools/hcs2/UpdateEntryTool.d.ts +1 -19
- package/dist/umd/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
- package/dist/umd/tools/hedera/HederaCreateNftTool.d.ts +72 -0
- package/dist/umd/tools/hedera/index.d.ts +1 -0
- package/dist/umd/tools/index.d.ts +1 -0
- package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +42 -132
- package/dist/umd/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
- package/dist/umd/types/inscription-response.d.ts +172 -0
- package/dist/umd/validation/hip412-schemas.d.ts +1 -1
- package/package.json +29 -32
- package/src/builders/inscriber/inscriber-builder.ts +42 -6
- package/src/hcs10/HCS10Client.ts +2 -5
- package/src/hcs10/types.ts +1 -15
- package/src/index.ts +2 -0
- package/src/init/init.ts +7 -10
- package/src/interfaces/FormValidatable.ts +57 -0
- package/src/interfaces/index.ts +1 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/zod-render/__tests__/withRender.test.ts +205 -0
- package/src/lib/zod-render/config-extractor.ts +443 -0
- package/src/lib/zod-render/index.ts +42 -0
- package/src/lib/zod-render/schema-extension.ts +612 -0
- package/src/lib/zod-render/types.ts +333 -0
- package/src/plugins/PluginInterface.ts +1 -2
- package/src/plugins/PluginRegistry.ts +1 -1
- package/src/plugins/hedera/HbarPricePlugin.ts +1 -1
- package/src/plugins/weather/index.ts +15 -4
- package/src/state/open-convai-state.ts +1 -11
- package/src/tools/hcs10/FindRegistrationsTool.ts +1 -1
- package/src/tools/hcs10/RegisterAgentTool.ts +3 -3
- package/src/tools/hcs10/SendMessageToConnectionTool.ts +4 -1
- package/src/tools/hcs10/natural-language-mapper.ts +35 -53
- package/src/tools/hcs2/CreateRegistryTool.ts +1 -1
- package/src/tools/hcs2/DeleteEntryTool.ts +1 -1
- package/src/tools/hcs2/RegisterEntryTool.ts +1 -1
- package/src/tools/hcs2/UpdateEntryTool.ts +1 -1
- package/src/tools/hcs6/CreateDynamicRegistryTool.ts +2 -2
- package/src/tools/hcs6/QueryDynamicRegistryTool.ts +1 -1
- package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +1 -1
- package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +2 -2
- package/src/tools/hedera/HederaCreateNftTool.ts +294 -0
- package/src/tools/hedera/index.ts +1 -0
- package/src/tools/index.ts +2 -1
- package/src/tools/inscriber/InscribeFromFileTool.ts +2 -11
- package/src/tools/inscriber/InscribeFromUrlTool.ts +15 -19
- package/src/tools/inscriber/InscribeHashinalTool.ts +596 -155
- package/src/tools/inscriber/RetrieveInscriptionTool.ts +34 -12
- package/src/tools/inscriber/base-inscriber-tools.ts +2 -24
- package/src/types/content-resolver.ts +3 -3
- package/src/types/inscription-response.ts +234 -0
- package/src/utils/Encryption.ts +1 -1
- package/src/utils/HederaClient.ts +1 -2
- package/src/utils/metadata-defaults.ts +15 -4
- package/src/utils/state-tools.ts +1 -2
- package/src/validation/content-ref-schemas.ts +2 -2
- package/src/validation/hip412-schemas.ts +1 -1
- package/dist/es/standards-agent-kit.es10.js +0 -89
- package/dist/es/standards-agent-kit.es10.js.map +0 -1
- package/dist/es/standards-agent-kit.es11.js +0 -40
- package/dist/es/standards-agent-kit.es11.js.map +0 -1
- package/dist/es/standards-agent-kit.es12.js +0 -40
- package/dist/es/standards-agent-kit.es12.js.map +0 -1
- package/dist/es/standards-agent-kit.es13.js +0 -50
- package/dist/es/standards-agent-kit.es13.js.map +0 -1
- package/dist/es/standards-agent-kit.es14.js +0 -60
- package/dist/es/standards-agent-kit.es14.js.map +0 -1
- package/dist/es/standards-agent-kit.es15.js +0 -72
- package/dist/es/standards-agent-kit.es15.js.map +0 -1
- package/dist/es/standards-agent-kit.es16.js +0 -35
- package/dist/es/standards-agent-kit.es16.js.map +0 -1
- package/dist/es/standards-agent-kit.es17.js +0 -35
- package/dist/es/standards-agent-kit.es17.js.map +0 -1
- package/dist/es/standards-agent-kit.es18.js +0 -45
- package/dist/es/standards-agent-kit.es18.js.map +0 -1
- package/dist/es/standards-agent-kit.es19.js +0 -21
- package/dist/es/standards-agent-kit.es19.js.map +0 -1
- package/dist/es/standards-agent-kit.es2.js +0 -25
- package/dist/es/standards-agent-kit.es2.js.map +0 -1
- package/dist/es/standards-agent-kit.es20.js +0 -160
- package/dist/es/standards-agent-kit.es20.js.map +0 -1
- package/dist/es/standards-agent-kit.es21.js +0 -32
- package/dist/es/standards-agent-kit.es21.js.map +0 -1
- package/dist/es/standards-agent-kit.es22.js +0 -46
- package/dist/es/standards-agent-kit.es22.js.map +0 -1
- package/dist/es/standards-agent-kit.es23.js +0 -48
- package/dist/es/standards-agent-kit.es23.js.map +0 -1
- package/dist/es/standards-agent-kit.es24.js +0 -51
- package/dist/es/standards-agent-kit.es24.js.map +0 -1
- package/dist/es/standards-agent-kit.es25.js +0 -45
- package/dist/es/standards-agent-kit.es25.js.map +0 -1
- package/dist/es/standards-agent-kit.es26.js +0 -48
- package/dist/es/standards-agent-kit.es26.js.map +0 -1
- package/dist/es/standards-agent-kit.es27.js +0 -45
- package/dist/es/standards-agent-kit.es27.js.map +0 -1
- package/dist/es/standards-agent-kit.es28.js +0 -32
- package/dist/es/standards-agent-kit.es28.js.map +0 -1
- package/dist/es/standards-agent-kit.es29.js +0 -35
- package/dist/es/standards-agent-kit.es29.js.map +0 -1
- package/dist/es/standards-agent-kit.es3.js +0 -1572
- package/dist/es/standards-agent-kit.es3.js.map +0 -1
- package/dist/es/standards-agent-kit.es30.js +0 -48
- package/dist/es/standards-agent-kit.es30.js.map +0 -1
- package/dist/es/standards-agent-kit.es31.js +0 -46
- package/dist/es/standards-agent-kit.es31.js.map +0 -1
- package/dist/es/standards-agent-kit.es32.js +0 -48
- package/dist/es/standards-agent-kit.es32.js.map +0 -1
- package/dist/es/standards-agent-kit.es33.js +0 -90
- package/dist/es/standards-agent-kit.es33.js.map +0 -1
- package/dist/es/standards-agent-kit.es34.js +0 -245
- package/dist/es/standards-agent-kit.es34.js.map +0 -1
- package/dist/es/standards-agent-kit.es35.js +0 -229
- package/dist/es/standards-agent-kit.es35.js.map +0 -1
- package/dist/es/standards-agent-kit.es36.js +0 -187
- package/dist/es/standards-agent-kit.es36.js.map +0 -1
- package/dist/es/standards-agent-kit.es37.js +0 -260
- package/dist/es/standards-agent-kit.es37.js.map +0 -1
- package/dist/es/standards-agent-kit.es38.js +0 -45
- package/dist/es/standards-agent-kit.es38.js.map +0 -1
- package/dist/es/standards-agent-kit.es39.js +0 -249
- package/dist/es/standards-agent-kit.es39.js.map +0 -1
- package/dist/es/standards-agent-kit.es4.js +0 -95
- package/dist/es/standards-agent-kit.es4.js.map +0 -1
- package/dist/es/standards-agent-kit.es40.js +0 -141
- package/dist/es/standards-agent-kit.es40.js.map +0 -1
- package/dist/es/standards-agent-kit.es41.js +0 -33
- package/dist/es/standards-agent-kit.es41.js.map +0 -1
- package/dist/es/standards-agent-kit.es42.js +0 -28
- package/dist/es/standards-agent-kit.es42.js.map +0 -1
- package/dist/es/standards-agent-kit.es43.js +0 -7
- package/dist/es/standards-agent-kit.es43.js.map +0 -1
- package/dist/es/standards-agent-kit.es44.js +0 -57
- package/dist/es/standards-agent-kit.es44.js.map +0 -1
- package/dist/es/standards-agent-kit.es45.js +0 -6
- package/dist/es/standards-agent-kit.es45.js.map +0 -1
- package/dist/es/standards-agent-kit.es46.js +0 -43
- package/dist/es/standards-agent-kit.es46.js.map +0 -1
- package/dist/es/standards-agent-kit.es47.js +0 -15
- package/dist/es/standards-agent-kit.es47.js.map +0 -1
- package/dist/es/standards-agent-kit.es5.js +0 -113
- package/dist/es/standards-agent-kit.es5.js.map +0 -1
- package/dist/es/standards-agent-kit.es6.js +0 -56
- package/dist/es/standards-agent-kit.es6.js.map +0 -1
- package/dist/es/standards-agent-kit.es7.js +0 -332
- package/dist/es/standards-agent-kit.es7.js.map +0 -1
- package/dist/es/standards-agent-kit.es8.js +0 -32
- package/dist/es/standards-agent-kit.es8.js.map +0 -1
- package/dist/es/standards-agent-kit.es9.js +0 -240
- package/dist/es/standards-agent-kit.es9.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-agent-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.132",
|
|
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,33 +21,6 @@
|
|
|
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
|
-
},
|
|
51
24
|
"keywords": [
|
|
52
25
|
"hedera",
|
|
53
26
|
"hcs10",
|
|
@@ -90,9 +63,9 @@
|
|
|
90
63
|
},
|
|
91
64
|
"dependencies": {
|
|
92
65
|
"@hashgraph/sdk": "^2.69.0",
|
|
93
|
-
"@hashgraphonline/standards-sdk": "0.0.
|
|
66
|
+
"@hashgraphonline/standards-sdk": "0.0.182",
|
|
94
67
|
"@langchain/community": "^0.3.5",
|
|
95
|
-
"@langchain/core": "^0.3.
|
|
68
|
+
"@langchain/core": "^0.3.71",
|
|
96
69
|
"@langchain/openai": "^0.6.7",
|
|
97
70
|
"@octokit/rest": "^21.1.1",
|
|
98
71
|
"axios": "^1.11.0",
|
|
@@ -128,5 +101,29 @@
|
|
|
128
101
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
129
102
|
"vite-plugin-string-replace": "^1.1.3"
|
|
130
103
|
},
|
|
131
|
-
"
|
|
132
|
-
|
|
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
|
+
}
|
|
@@ -13,19 +13,55 @@ import {
|
|
|
13
13
|
} from '@hashgraphonline/standards-sdk';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Type definition for DAppSigner
|
|
16
|
+
* Type definition for DAppSigner from hedera-wallet-connect
|
|
17
17
|
*/
|
|
18
18
|
interface DAppSigner {
|
|
19
19
|
getAccountId(): { toString(): string };
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
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;
|
|
20
56
|
}
|
|
21
57
|
|
|
22
58
|
/**
|
|
23
59
|
* Type definition for InscriptionSDK since we don't have the actual package
|
|
24
60
|
*/
|
|
25
61
|
interface InscriptionSDK {
|
|
26
|
-
inscribeAndExecute(request:
|
|
27
|
-
inscribe(request:
|
|
28
|
-
waitForInscription(txId: string, maxAttempts: number, intervalMs: number, checkCompletion: boolean, progressCallback?:
|
|
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>;
|
|
29
65
|
}
|
|
30
66
|
|
|
31
67
|
/**
|
|
@@ -42,7 +78,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
42
78
|
* Get or create Inscription SDK - temporarily returns null since we don't have the actual SDK
|
|
43
79
|
*/
|
|
44
80
|
protected async getInscriptionSDK(
|
|
45
|
-
|
|
81
|
+
_options: InscriptionOptions
|
|
46
82
|
): Promise<InscriptionSDK | null> {
|
|
47
83
|
return null;
|
|
48
84
|
}
|
|
@@ -81,7 +117,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
81
117
|
signer: DAppSigner,
|
|
82
118
|
options: InscriptionOptions
|
|
83
119
|
): Promise<InscriptionResponse> {
|
|
84
|
-
return await inscribeWithSigner(input, signer as
|
|
120
|
+
return await inscribeWithSigner(input, signer as unknown as Parameters<typeof inscribeWithSigner>[1], options);
|
|
85
121
|
}
|
|
86
122
|
|
|
87
123
|
/**
|
package/src/hcs10/HCS10Client.ts
CHANGED
|
@@ -17,7 +17,6 @@ import { AgentMetadata, AgentChannels } from './types';
|
|
|
17
17
|
import { encryptMessage } from '../utils/Encryption';
|
|
18
18
|
import { IStateManager } from '../state/state-types';
|
|
19
19
|
|
|
20
|
-
// Keep type alias as they were removed accidentally
|
|
21
20
|
type StandardHandleConnectionRequest = InstanceType<
|
|
22
21
|
typeof StandardSDKClient
|
|
23
22
|
>['handleConnectionRequest'];
|
|
@@ -444,13 +443,11 @@ export class HCS10Client {
|
|
|
444
443
|
error?: string;
|
|
445
444
|
}> {
|
|
446
445
|
try {
|
|
447
|
-
|
|
446
|
+
|
|
448
447
|
this.setClient(options.accountId, options.privateKey);
|
|
449
448
|
|
|
450
|
-
// Check if we can retrieve the operator ID
|
|
451
449
|
const operatorId = this.getOperatorId();
|
|
452
450
|
|
|
453
|
-
// If we got this far, basic validation passed
|
|
454
451
|
return {
|
|
455
452
|
isValid: true,
|
|
456
453
|
operator: { accountId: operatorId },
|
|
@@ -472,7 +469,7 @@ export class HCS10Client {
|
|
|
472
469
|
const validationResult = await this.validateOperator(options);
|
|
473
470
|
|
|
474
471
|
if (validationResult.isValid) {
|
|
475
|
-
|
|
472
|
+
|
|
476
473
|
if (options.stateManager) {
|
|
477
474
|
options.stateManager.initializeConnectionsManager(this.standardClient);
|
|
478
475
|
}
|
package/src/hcs10/types.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// src/hcs10/types.ts
|
|
2
1
|
|
|
3
2
|
import { FeeConfigBuilderInterface } from '@hashgraphonline/standards-sdk';
|
|
4
3
|
|
|
@@ -25,7 +24,7 @@ export interface AgentMetadata {
|
|
|
25
24
|
export interface AgentChannels {
|
|
26
25
|
inboundTopicId: string;
|
|
27
26
|
outboundTopicId: string;
|
|
28
|
-
|
|
27
|
+
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
/**
|
|
@@ -39,16 +38,3 @@ export interface HCS10Message {
|
|
|
39
38
|
messageId: string;
|
|
40
39
|
metadata?: Record<string, unknown>;
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
// export interface AgentRegistration {
|
|
44
|
-
// id: string;
|
|
45
|
-
// name: string;
|
|
46
|
-
// capabilities: string[];
|
|
47
|
-
// createdAt: number;
|
|
48
|
-
// publicKey: string;
|
|
49
|
-
// }
|
|
50
|
-
|
|
51
|
-
// export interface HCS10Config {
|
|
52
|
-
// topicId: string;
|
|
53
|
-
// network: 'mainnet' | 'testnet' | 'previewnet';
|
|
54
|
-
// }
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './tools';
|
|
|
2
2
|
export * from './state';
|
|
3
3
|
export * from './init';
|
|
4
4
|
export * from './plugins';
|
|
5
|
+
export * from './lib';
|
|
6
|
+
export * from './interfaces';
|
|
5
7
|
export { HCS10Builder, HCS2Builder, HCS6Builder, InscriberBuilder } from './builders';
|
|
6
8
|
export type { ExecuteResult } from './builders';
|
|
7
9
|
export { HCS10Client } from './hcs10';
|
package/src/init/init.ts
CHANGED
|
@@ -73,13 +73,19 @@ export const initializeStandardsAgentKit = async (
|
|
|
73
73
|
|
|
74
74
|
const networkEnv = config.network || process.env.HEDERA_NETWORK || 'testnet';
|
|
75
75
|
|
|
76
|
+
const shouldSilence = process.env.DISABLE_LOGGING === 'true';
|
|
77
|
+
const logger = Logger.getInstance({
|
|
78
|
+
level: config.logLevel || 'info',
|
|
79
|
+
silent: shouldSilence,
|
|
80
|
+
});
|
|
81
|
+
|
|
76
82
|
let network: 'mainnet' | 'testnet';
|
|
77
83
|
if (networkEnv === 'mainnet') {
|
|
78
84
|
network = 'mainnet';
|
|
79
85
|
} else if (networkEnv === 'testnet') {
|
|
80
86
|
network = 'testnet';
|
|
81
87
|
} else {
|
|
82
|
-
|
|
88
|
+
logger.warn(
|
|
83
89
|
`Unsupported network specified: '${networkEnv}'. Defaulting to 'testnet'.`
|
|
84
90
|
);
|
|
85
91
|
network = 'testnet';
|
|
@@ -91,12 +97,6 @@ export const initializeStandardsAgentKit = async (
|
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
const shouldSilence = process.env.DISABLE_LOGGING === 'true';
|
|
95
|
-
const logger = Logger.getInstance({
|
|
96
|
-
level: config.logLevel || 'info',
|
|
97
|
-
silent: shouldSilence,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
100
|
const stateManager =
|
|
101
101
|
options?.stateManager ||
|
|
102
102
|
new OpenConvaiState({
|
|
@@ -105,13 +105,11 @@ export const initializeStandardsAgentKit = async (
|
|
|
105
105
|
});
|
|
106
106
|
logger.info('State manager initialized');
|
|
107
107
|
|
|
108
|
-
// Create HederaAgentKit
|
|
109
108
|
const signer = new ServerSigner(operatorId, operatorPrivateKey, network);
|
|
110
109
|
const hederaKit = new HederaAgentKit(signer);
|
|
111
110
|
await hederaKit.initialize();
|
|
112
111
|
logger.info(`HederaAgentKit initialized for ${operatorId} on ${network}`);
|
|
113
112
|
|
|
114
|
-
// Create HCS10Builder
|
|
115
113
|
const hcs10Builder = new HCS10Builder(hederaKit, stateManager, {
|
|
116
114
|
useEncryption: config.useEncryption,
|
|
117
115
|
registryUrl: config.registryUrl,
|
|
@@ -135,7 +133,6 @@ export const initializeStandardsAgentKit = async (
|
|
|
135
133
|
|
|
136
134
|
const tools: Partial<HCS10Tools> = {};
|
|
137
135
|
|
|
138
|
-
// Always create RegisterAgentTool
|
|
139
136
|
tools.registerAgentTool = new RegisterAgentTool({
|
|
140
137
|
hederaKit,
|
|
141
138
|
hcs10Builder,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for tools that can provide custom form validation logic
|
|
5
|
+
*/
|
|
6
|
+
export interface FormValidatable {
|
|
7
|
+
/**
|
|
8
|
+
* Determines if a form should be generated for the given input
|
|
9
|
+
* @param input The input data to validate
|
|
10
|
+
* @returns true if a form should be generated, false if the tool can execute
|
|
11
|
+
*/
|
|
12
|
+
shouldGenerateForm(input: unknown): boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the schema to use for form generation
|
|
16
|
+
* This allows tools to provide a focused schema for forms
|
|
17
|
+
* @returns The schema to use for generating forms
|
|
18
|
+
*/
|
|
19
|
+
getFormSchema(): z.ZodSchema;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Optional method to validate metadata quality and provide detailed feedback
|
|
23
|
+
* @param input The input data to analyze
|
|
24
|
+
* @returns Object indicating if form is needed and the reason
|
|
25
|
+
*/
|
|
26
|
+
validateMetadataQuality?(input: unknown): { needsForm: boolean; reason: string };
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optional method to define which fields are essential for this tool
|
|
30
|
+
* Essential fields are always shown in forms even if marked as optional
|
|
31
|
+
* @returns Array of field names that are essential for user experience
|
|
32
|
+
*/
|
|
33
|
+
getEssentialFields?(): string[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Optional method to determine if a field value should be considered empty
|
|
37
|
+
* Allows tools to define custom empty logic for their specific data types
|
|
38
|
+
* @param fieldName The name of the field
|
|
39
|
+
* @param value The value to check
|
|
40
|
+
* @returns true if the field should be considered empty
|
|
41
|
+
*/
|
|
42
|
+
isFieldEmpty?(fieldName: string, value: unknown): boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Type guard to check if a tool implements FormValidatable
|
|
47
|
+
*/
|
|
48
|
+
export function isFormValidatable(tool: unknown): tool is FormValidatable {
|
|
49
|
+
return (
|
|
50
|
+
tool !== null &&
|
|
51
|
+
typeof tool === 'object' &&
|
|
52
|
+
'shouldGenerateForm' in tool &&
|
|
53
|
+
'getFormSchema' in tool &&
|
|
54
|
+
typeof (tool as FormValidatable).shouldGenerateForm === 'function' &&
|
|
55
|
+
typeof (tool as FormValidatable).getFormSchema === 'function'
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FormValidatable';
|
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zod-render';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
extendZodSchema,
|
|
4
|
+
hasRenderConfig,
|
|
5
|
+
getRenderConfig,
|
|
6
|
+
renderConfigs,
|
|
7
|
+
installZodRenderExtensions,
|
|
8
|
+
createProgressiveSchema,
|
|
9
|
+
extractProgressiveInfo,
|
|
10
|
+
enhanceRenderConfig
|
|
11
|
+
} from '../schema-extension';
|
|
12
|
+
import { EnhancedRenderConfig } from '../types';
|
|
13
|
+
|
|
14
|
+
describe('withRender Schema Extensions', () => {
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
|
|
17
|
+
installZodRenderExtensions();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('Basic withRender functionality', () => {
|
|
21
|
+
it('should extend a schema with render configuration', () => {
|
|
22
|
+
const schema = z.string();
|
|
23
|
+
const extendedSchema = extendZodSchema(schema);
|
|
24
|
+
|
|
25
|
+
expect(typeof extendedSchema.withRender).toBe('function');
|
|
26
|
+
expect(typeof extendedSchema.withProgressive).toBe('function');
|
|
27
|
+
expect(typeof extendedSchema.withBlock).toBe('function');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should store render configuration in schema', () => {
|
|
31
|
+
const config: EnhancedRenderConfig = {
|
|
32
|
+
fieldType: 'text',
|
|
33
|
+
ui: { label: 'Test Field', priority: 'essential' },
|
|
34
|
+
progressive: { priority: 'essential' }
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const schema = extendZodSchema(z.string()).withRender(config);
|
|
38
|
+
|
|
39
|
+
expect(hasRenderConfig(schema)).toBe(true);
|
|
40
|
+
expect(getRenderConfig(schema)).toEqual(config);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should support progressive disclosure configuration', () => {
|
|
44
|
+
const schema = extendZodSchema(z.string()).withProgressive('essential', 'Basic Info');
|
|
45
|
+
|
|
46
|
+
const progressiveInfo = extractProgressiveInfo(schema);
|
|
47
|
+
expect(progressiveInfo.priority).toBe('essential');
|
|
48
|
+
expect(progressiveInfo.group).toBe('Basic Info');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should support block configuration', () => {
|
|
52
|
+
const schema = extendZodSchema(z.string()).withBlock('account-input');
|
|
53
|
+
|
|
54
|
+
const config = getRenderConfig(schema);
|
|
55
|
+
expect(config?.block?.id).toBe('account-input');
|
|
56
|
+
expect(config?.block?.type).toBe('field');
|
|
57
|
+
expect(config?.block?.reusable).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('Progressive disclosure helpers', () => {
|
|
62
|
+
it('should create essential field configurations', () => {
|
|
63
|
+
const config = renderConfigs.essential.text('Name', 'Enter your name');
|
|
64
|
+
|
|
65
|
+
expect(config.fieldType).toBe('text');
|
|
66
|
+
expect(config.ui?.label).toBe('Name');
|
|
67
|
+
expect(config.ui?.placeholder).toBe('Enter your name');
|
|
68
|
+
expect(config.ui?.priority).toBe('essential');
|
|
69
|
+
expect(config.progressive?.priority).toBe('essential');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('should create advanced field configurations', () => {
|
|
73
|
+
const config = renderConfigs.advanced.number('Batch Size', 1, 100);
|
|
74
|
+
|
|
75
|
+
expect(config.fieldType).toBe('number');
|
|
76
|
+
expect(config.ui?.label).toBe('Batch Size');
|
|
77
|
+
expect(config.ui?.priority).toBe('advanced');
|
|
78
|
+
expect(config.progressive?.priority).toBe('advanced');
|
|
79
|
+
expect(config.constraints?.min).toBe(1);
|
|
80
|
+
expect(config.constraints?.max).toBe(100);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should create expert field configurations', () => {
|
|
84
|
+
const config = renderConfigs.expert.textarea('Debug Info', 5);
|
|
85
|
+
|
|
86
|
+
expect(config.fieldType).toBe('textarea');
|
|
87
|
+
expect(config.ui?.label).toBe('Debug Info');
|
|
88
|
+
expect(config.ui?.priority).toBe('expert');
|
|
89
|
+
expect(config.progressive?.priority).toBe('expert');
|
|
90
|
+
expect(config.props?.rows).toBe(5);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe('Global prototype extension', () => {
|
|
95
|
+
it('should add withRender to all Zod schemas', () => {
|
|
96
|
+
const stringSchema = z.string();
|
|
97
|
+
const numberSchema = z.number();
|
|
98
|
+
const objectSchema = z.object({ name: z.string() });
|
|
99
|
+
|
|
100
|
+
expect(typeof (stringSchema as any).withRender).toBe('function');
|
|
101
|
+
expect(typeof (numberSchema as any).withProgressive).toBe('function');
|
|
102
|
+
expect(typeof (objectSchema as any).withBlock).toBe('function');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should work with chained configurations', () => {
|
|
106
|
+
const schema = (z.string() as any)
|
|
107
|
+
.withProgressive('essential', 'Basic Info')
|
|
108
|
+
.withRender({ ui: { helpText: 'This is required' } });
|
|
109
|
+
|
|
110
|
+
const config = getRenderConfig(schema);
|
|
111
|
+
expect(config?.progressive?.priority).toBe('essential');
|
|
112
|
+
expect(config?.progressive?.group).toBe('Basic Info');
|
|
113
|
+
expect(config?.ui?.helpText).toBe('This is required');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('Progressive schema creation', () => {
|
|
118
|
+
it('should create schemas with grouped fields', () => {
|
|
119
|
+
const baseSchema = z.object({
|
|
120
|
+
name: z.string(),
|
|
121
|
+
symbol: z.string(),
|
|
122
|
+
batchSize: z.number().optional(),
|
|
123
|
+
adminKey: z.string().optional()
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const groups = {
|
|
127
|
+
'Basic Info': { priority: 'essential' as const, fields: ['name', 'symbol'] },
|
|
128
|
+
'Advanced': { priority: 'advanced' as const, fields: ['batchSize', 'adminKey'] }
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const progressiveSchema = createProgressiveSchema(baseSchema, groups);
|
|
132
|
+
|
|
133
|
+
expect(hasRenderConfig(progressiveSchema)).toBe(true);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe('Legacy compatibility', () => {
|
|
138
|
+
it('should enhance legacy render configs', () => {
|
|
139
|
+
const legacyConfig = {
|
|
140
|
+
fieldType: 'text' as const,
|
|
141
|
+
ui: { label: 'Test', priority: 'advanced' as const }
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const enhanced = enhanceRenderConfig(legacyConfig);
|
|
145
|
+
|
|
146
|
+
expect(enhanced.progressive?.priority).toBe('advanced');
|
|
147
|
+
expect(enhanced.ui?.label).toBe('Test');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('should handle configs without priority', () => {
|
|
151
|
+
const legacyConfig = {
|
|
152
|
+
fieldType: 'text' as const,
|
|
153
|
+
ui: { label: 'Test' }
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const enhanced = enhanceRenderConfig(legacyConfig);
|
|
157
|
+
|
|
158
|
+
expect(enhanced.progressive?.priority).toBe('common');
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
describe('Real-world usage patterns', () => {
|
|
163
|
+
it('should support individual field progressive disclosure', () => {
|
|
164
|
+
|
|
165
|
+
const tokenIdField = (z.string() as any).withProgressive('essential', 'Basic Info');
|
|
166
|
+
const batchSizeField = (z.number().optional() as any).withProgressive('advanced', 'Performance');
|
|
167
|
+
const timeoutField = (z.number().optional() as any).withProgressive('expert', 'Technical');
|
|
168
|
+
|
|
169
|
+
const tokenIdInfo = extractProgressiveInfo(tokenIdField);
|
|
170
|
+
expect(tokenIdInfo.priority).toBe('essential');
|
|
171
|
+
expect(tokenIdInfo.group).toBe('Basic Info');
|
|
172
|
+
|
|
173
|
+
const batchSizeInfo = extractProgressiveInfo(batchSizeField);
|
|
174
|
+
expect(batchSizeInfo.priority).toBe('advanced');
|
|
175
|
+
expect(batchSizeInfo.group).toBe('Performance');
|
|
176
|
+
|
|
177
|
+
const timeoutInfo = extractProgressiveInfo(timeoutField);
|
|
178
|
+
expect(timeoutInfo.priority).toBe('expert');
|
|
179
|
+
expect(timeoutInfo.group).toBe('Technical');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('should support complex NFT schema configuration', () => {
|
|
183
|
+
const nftSchema = z.object({
|
|
184
|
+
tokenId: z.string(),
|
|
185
|
+
name: z.string(),
|
|
186
|
+
description: z.string().optional(),
|
|
187
|
+
batchSize: z.number().optional(),
|
|
188
|
+
timeoutMs: z.number().optional()
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const enhancedSchema = (nftSchema as any).withRender({
|
|
192
|
+
fieldType: 'object',
|
|
193
|
+
progressive: {
|
|
194
|
+
priority: 'common',
|
|
195
|
+
group: 'NFT Creation'
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
expect(hasRenderConfig(enhancedSchema)).toBe(true);
|
|
200
|
+
const config = getRenderConfig(enhancedSchema);
|
|
201
|
+
expect(config?.progressive?.priority).toBe('common');
|
|
202
|
+
expect(config?.progressive?.group).toBe('NFT Creation');
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
});
|