@hashgraphonline/standards-agent-kit 0.2.132 → 0.2.135
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/hcs10/hcs10-builder.d.ts +0 -2
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +2 -39
- package/dist/cjs/lib/zod-render/config-extractor.d.ts +0 -21
- package/dist/cjs/lib/zod-render/index.d.ts +3 -3
- package/dist/cjs/lib/zod-render/schema-extension.d.ts +1 -9
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/index.d.ts +0 -1
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +42 -1
- package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +19 -0
- package/dist/es/builders/hcs10/hcs10-builder.d.ts +0 -2
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +2 -39
- package/dist/es/lib/zod-render/config-extractor.d.ts +0 -21
- package/dist/es/lib/zod-render/index.d.ts +3 -3
- package/dist/es/lib/zod-render/schema-extension.d.ts +1 -9
- package/dist/es/standards-agent-kit.es.js +47 -6228
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +91 -0
- package/dist/es/standards-agent-kit.es10.js.map +1 -0
- package/dist/es/standards-agent-kit.es11.js +40 -0
- package/dist/es/standards-agent-kit.es11.js.map +1 -0
- package/dist/es/standards-agent-kit.es12.js +40 -0
- package/dist/es/standards-agent-kit.es12.js.map +1 -0
- package/dist/es/standards-agent-kit.es13.js +50 -0
- package/dist/es/standards-agent-kit.es13.js.map +1 -0
- package/dist/es/standards-agent-kit.es14.js +62 -0
- package/dist/es/standards-agent-kit.es14.js.map +1 -0
- package/dist/es/standards-agent-kit.es15.js +72 -0
- package/dist/es/standards-agent-kit.es15.js.map +1 -0
- package/dist/es/standards-agent-kit.es16.js +35 -0
- package/dist/es/standards-agent-kit.es16.js.map +1 -0
- package/dist/es/standards-agent-kit.es17.js +35 -0
- package/dist/es/standards-agent-kit.es17.js.map +1 -0
- package/dist/es/standards-agent-kit.es18.js +45 -0
- package/dist/es/standards-agent-kit.es18.js.map +1 -0
- package/dist/es/standards-agent-kit.es19.js +21 -0
- package/dist/es/standards-agent-kit.es19.js.map +1 -0
- package/dist/es/standards-agent-kit.es2.js +25 -0
- package/dist/es/standards-agent-kit.es2.js.map +1 -0
- package/dist/es/standards-agent-kit.es20.js +143 -0
- package/dist/es/standards-agent-kit.es20.js.map +1 -0
- package/dist/es/standards-agent-kit.es21.js +32 -0
- package/dist/es/standards-agent-kit.es21.js.map +1 -0
- package/dist/es/standards-agent-kit.es22.js +46 -0
- package/dist/es/standards-agent-kit.es22.js.map +1 -0
- package/dist/es/standards-agent-kit.es23.js +48 -0
- package/dist/es/standards-agent-kit.es23.js.map +1 -0
- package/dist/es/standards-agent-kit.es24.js +51 -0
- package/dist/es/standards-agent-kit.es24.js.map +1 -0
- package/dist/es/standards-agent-kit.es25.js +45 -0
- package/dist/es/standards-agent-kit.es25.js.map +1 -0
- package/dist/es/standards-agent-kit.es26.js +48 -0
- package/dist/es/standards-agent-kit.es26.js.map +1 -0
- package/dist/es/standards-agent-kit.es27.js +45 -0
- package/dist/es/standards-agent-kit.es27.js.map +1 -0
- package/dist/es/standards-agent-kit.es28.js +32 -0
- package/dist/es/standards-agent-kit.es28.js.map +1 -0
- package/dist/es/standards-agent-kit.es29.js +35 -0
- package/dist/es/standards-agent-kit.es29.js.map +1 -0
- package/dist/es/standards-agent-kit.es3.js +1568 -0
- package/dist/es/standards-agent-kit.es3.js.map +1 -0
- package/dist/es/standards-agent-kit.es30.js +48 -0
- package/dist/es/standards-agent-kit.es30.js.map +1 -0
- package/dist/es/standards-agent-kit.es31.js +46 -0
- package/dist/es/standards-agent-kit.es31.js.map +1 -0
- package/dist/es/standards-agent-kit.es32.js +48 -0
- package/dist/es/standards-agent-kit.es32.js.map +1 -0
- package/dist/es/standards-agent-kit.es33.js +98 -0
- package/dist/es/standards-agent-kit.es33.js.map +1 -0
- package/dist/es/standards-agent-kit.es34.js +241 -0
- package/dist/es/standards-agent-kit.es34.js.map +1 -0
- package/dist/es/standards-agent-kit.es35.js +223 -0
- package/dist/es/standards-agent-kit.es35.js.map +1 -0
- package/dist/es/standards-agent-kit.es36.js +187 -0
- package/dist/es/standards-agent-kit.es36.js.map +1 -0
- package/dist/es/standards-agent-kit.es37.js +636 -0
- package/dist/es/standards-agent-kit.es37.js.map +1 -0
- package/dist/es/standards-agent-kit.es38.js +46 -0
- package/dist/es/standards-agent-kit.es38.js.map +1 -0
- package/dist/es/standards-agent-kit.es39.js +249 -0
- package/dist/es/standards-agent-kit.es39.js.map +1 -0
- package/dist/es/standards-agent-kit.es4.js +95 -0
- package/dist/es/standards-agent-kit.es4.js.map +1 -0
- package/dist/es/standards-agent-kit.es40.js +141 -0
- package/dist/es/standards-agent-kit.es40.js.map +1 -0
- package/dist/es/standards-agent-kit.es41.js +33 -0
- package/dist/es/standards-agent-kit.es41.js.map +1 -0
- package/dist/es/standards-agent-kit.es42.js +427 -0
- package/dist/es/standards-agent-kit.es42.js.map +1 -0
- package/dist/es/standards-agent-kit.es43.js +189 -0
- package/dist/es/standards-agent-kit.es43.js.map +1 -0
- package/dist/es/standards-agent-kit.es44.js +7 -0
- package/dist/es/standards-agent-kit.es44.js.map +1 -0
- package/dist/es/standards-agent-kit.es45.js +28 -0
- package/dist/es/standards-agent-kit.es45.js.map +1 -0
- package/dist/es/standards-agent-kit.es46.js +7 -0
- package/dist/es/standards-agent-kit.es46.js.map +1 -0
- package/dist/es/standards-agent-kit.es47.js +57 -0
- package/dist/es/standards-agent-kit.es47.js.map +1 -0
- package/dist/es/standards-agent-kit.es48.js +6 -0
- package/dist/es/standards-agent-kit.es48.js.map +1 -0
- package/dist/es/standards-agent-kit.es49.js +43 -0
- package/dist/es/standards-agent-kit.es49.js.map +1 -0
- package/dist/es/standards-agent-kit.es5.js +113 -0
- package/dist/es/standards-agent-kit.es5.js.map +1 -0
- package/dist/es/standards-agent-kit.es50.js +22 -0
- package/dist/es/standards-agent-kit.es50.js.map +1 -0
- package/dist/es/standards-agent-kit.es51.js +57 -0
- package/dist/es/standards-agent-kit.es51.js.map +1 -0
- package/dist/es/standards-agent-kit.es6.js +56 -0
- package/dist/es/standards-agent-kit.es6.js.map +1 -0
- package/dist/es/standards-agent-kit.es7.js +332 -0
- package/dist/es/standards-agent-kit.es7.js.map +1 -0
- package/dist/es/standards-agent-kit.es8.js +32 -0
- package/dist/es/standards-agent-kit.es8.js.map +1 -0
- package/dist/es/standards-agent-kit.es9.js +244 -0
- package/dist/es/standards-agent-kit.es9.js.map +1 -0
- package/dist/es/tools/index.d.ts +0 -1
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +42 -1
- package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +19 -0
- package/dist/umd/builders/hcs10/hcs10-builder.d.ts +0 -2
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +2 -39
- package/dist/umd/lib/zod-render/config-extractor.d.ts +0 -21
- package/dist/umd/lib/zod-render/index.d.ts +3 -3
- package/dist/umd/lib/zod-render/schema-extension.d.ts +1 -9
- 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/index.d.ts +0 -1
- package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +42 -1
- package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +19 -0
- package/package.json +33 -29
- package/src/builders/hcs10/hcs10-builder.ts +0 -4
- package/src/builders/inscriber/inscriber-builder.ts +2 -45
- package/src/lib/zod-render/config-extractor.ts +0 -92
- package/src/lib/zod-render/index.ts +1 -7
- package/src/lib/zod-render/schema-extension.ts +1 -69
- package/src/tools/index.ts +1 -2
- package/src/tools/inscriber/InscribeFromBufferTool.ts +2 -2
- package/src/tools/inscriber/InscribeFromUrlTool.ts +2 -2
- package/src/tools/inscriber/InscribeHashinalTool.ts +129 -20
- package/src/tools/inscriber/base-inscriber-tools.ts +26 -0
- package/src/types/inscription-response.ts +2 -2
- package/dist/cjs/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
- package/dist/cjs/tools/hedera/HederaCreateNftTool.d.ts +0 -72
- package/dist/cjs/tools/hedera/index.d.ts +0 -1
- package/dist/es/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
- package/dist/es/tools/hedera/HederaCreateNftTool.d.ts +0 -72
- package/dist/es/tools/hedera/index.d.ts +0 -1
- package/dist/umd/lib/zod-render/__tests__/withRender.test.d.ts +0 -1
- package/dist/umd/tools/hedera/HederaCreateNftTool.d.ts +0 -72
- package/dist/umd/tools/hedera/index.d.ts +0 -1
- package/src/lib/zod-render/__tests__/withRender.test.ts +0 -205
- package/src/tools/hedera/HederaCreateNftTool.ts +0 -294
- package/src/tools/hedera/index.ts +0 -1
|
@@ -37,6 +37,7 @@ declare const inscribeHashinalSchema: import('../..').ZodSchemaWithRender<{
|
|
|
37
37
|
export declare class InscribeHashinalTool extends BaseInscriberQueryTool implements FormValidatable {
|
|
38
38
|
name: string;
|
|
39
39
|
description: string;
|
|
40
|
+
getEntityResolutionPreferences(): Record<string, string>;
|
|
40
41
|
get specificInputSchema(): z.ZodObject<z.ZodRawShape>;
|
|
41
42
|
private _schemaWithRenderConfig?;
|
|
42
43
|
get schema(): z.ZodObject<z.ZodRawShape>;
|
|
@@ -60,7 +61,47 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool impleme
|
|
|
60
61
|
};
|
|
61
62
|
protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<InscriptionResponse>;
|
|
62
63
|
/**
|
|
63
|
-
* Creates HashLink block
|
|
64
|
+
* Creates HashLink block configuration for Hashinal inscriptions.
|
|
65
|
+
* Automatically detects network and selects appropriate block ID configuration.
|
|
66
|
+
* Uses testnet block as fallback for unknown networks or undeployed mainnet blocks.
|
|
67
|
+
*
|
|
68
|
+
* @param response The inscription response containing metadata and network information
|
|
69
|
+
* @param _mimeType Optional MIME type (currently unused, preserved for compatibility)
|
|
70
|
+
* @returns HCS12BlockResult with network-specific block configuration
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* // Testnet usage (automatic detection from client)
|
|
75
|
+
* const testnetClient = Client.forTestnet();
|
|
76
|
+
* const tool = new InscribeHashinalTool(testnetClient);
|
|
77
|
+
* const block = await tool.createHashLinkBlock(inscriptionResponse);
|
|
78
|
+
* console.log(block.blockId); // '0.0.6617393'
|
|
79
|
+
* console.log(block.hashLink); // 'hcs://12/0.0.6617393'
|
|
80
|
+
*
|
|
81
|
+
* // Mainnet usage (automatic detection from client)
|
|
82
|
+
* const mainnetClient = Client.forMainnet();
|
|
83
|
+
* const tool = new InscribeHashinalTool(mainnetClient);
|
|
84
|
+
* const block = await tool.createHashLinkBlock(inscriptionResponse);
|
|
85
|
+
* console.log(block.blockId); // Network-specific mainnet block ID
|
|
86
|
+
*
|
|
87
|
+
* // HashLink Block Response Structure:
|
|
88
|
+
* {
|
|
89
|
+
* blockId: string; // Hedera account ID format (e.g., '0.0.6617393')
|
|
90
|
+
* hashLink: string; // HCS-12 URL format: 'hcs://12/{blockId}'
|
|
91
|
+
* template: string; // Block template reference matching blockId
|
|
92
|
+
* attributes: { // Metadata for client-side processing
|
|
93
|
+
* name: string; // Content display name
|
|
94
|
+
* creator: string; // Creator account ID
|
|
95
|
+
* topicId: string; // HCS topic containing the inscription
|
|
96
|
+
* hrl: string; // Hedera Resource Locator
|
|
97
|
+
* network: string; // Network type: 'testnet' | 'mainnet'
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* // Render function usage in HashLink blocks:
|
|
102
|
+
* // The block's JavaScript render function receives this structure
|
|
103
|
+
* // and can access network-specific resources through attributes.network
|
|
104
|
+
* ```
|
|
64
105
|
*/
|
|
65
106
|
private createHashLinkBlock;
|
|
66
107
|
private resolveContent;
|
|
@@ -4,12 +4,22 @@ import { InscriberTransactionToolParams, InscriberQueryToolParams } from './insc
|
|
|
4
4
|
import { ContentResolverInterface } from '../../types/content-resolver';
|
|
5
5
|
import { InscriptionInput, InscriptionOptions, QuoteResult } from '@hashgraphonline/standards-sdk';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Event emitted when an entity is created during inscription
|
|
9
|
+
*/
|
|
10
|
+
export interface EntityCreationEvent {
|
|
11
|
+
entityId: string;
|
|
12
|
+
entityName: string;
|
|
13
|
+
entityType: string;
|
|
14
|
+
transactionId?: string;
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* Base class for Inscriber transaction tools
|
|
9
18
|
*/
|
|
10
19
|
export declare abstract class BaseInscriberTransactionTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaTransactionTool<T> {
|
|
11
20
|
protected inscriberBuilder: InscriberBuilder;
|
|
12
21
|
protected contentResolver: ContentResolverInterface | null;
|
|
22
|
+
protected onEntityCreated?: (event: EntityCreationEvent) => void;
|
|
13
23
|
namespace: "inscriber";
|
|
14
24
|
constructor(params: InscriberTransactionToolParams);
|
|
15
25
|
/**
|
|
@@ -20,6 +30,10 @@ export declare abstract class BaseInscriberTransactionTool<T extends z.ZodObject
|
|
|
20
30
|
* Get content resolver with fallback to registry
|
|
21
31
|
*/
|
|
22
32
|
protected getContentResolver(): ContentResolverInterface | null;
|
|
33
|
+
/**
|
|
34
|
+
* Set entity creation handler for automatic entity storage
|
|
35
|
+
*/
|
|
36
|
+
setEntityCreationHandler(handler: (event: EntityCreationEvent) => void): void;
|
|
23
37
|
/**
|
|
24
38
|
* Generate a quote for an inscription without executing it
|
|
25
39
|
* @param input - The inscription input data
|
|
@@ -34,6 +48,7 @@ export declare abstract class BaseInscriberTransactionTool<T extends z.ZodObject
|
|
|
34
48
|
export declare abstract class BaseInscriberQueryTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaQueryTool<T> {
|
|
35
49
|
protected inscriberBuilder: InscriberBuilder;
|
|
36
50
|
protected contentResolver: ContentResolverInterface | null;
|
|
51
|
+
protected onEntityCreated?: (event: EntityCreationEvent) => void;
|
|
37
52
|
namespace: "inscriber";
|
|
38
53
|
constructor(params: InscriberQueryToolParams);
|
|
39
54
|
/**
|
|
@@ -44,6 +59,10 @@ export declare abstract class BaseInscriberQueryTool<T extends z.ZodObject<z.Zod
|
|
|
44
59
|
* Get content resolver with fallback to registry
|
|
45
60
|
*/
|
|
46
61
|
protected getContentResolver(): ContentResolverInterface | null;
|
|
62
|
+
/**
|
|
63
|
+
* Set entity creation handler for automatic entity storage
|
|
64
|
+
*/
|
|
65
|
+
setEntityCreationHandler(handler: (event: EntityCreationEvent) => void): void;
|
|
47
66
|
/**
|
|
48
67
|
* Generate a quote for an inscription without executing it
|
|
49
68
|
* @param input - The inscription input data
|
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.135",
|
|
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.
|
|
93
|
+
"@hashgraphonline/standards-sdk": "0.0.187",
|
|
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.
|
|
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
|
-
"
|
|
105
|
-
|
|
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
|
|
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
|
|
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
|
package/src/tools/index.ts
CHANGED
|
@@ -59,8 +59,8 @@ export class InscribeFromBufferTool extends BaseInscriberQueryTool<
|
|
|
59
59
|
waitForConfirmation: params.quoteOnly
|
|
60
60
|
? false
|
|
61
61
|
: params.waitForConfirmation ?? true,
|
|
62
|
-
waitMaxAttempts:
|
|
63
|
-
waitIntervalMs:
|
|
62
|
+
waitMaxAttempts: 60,
|
|
63
|
+
waitIntervalMs: 5000,
|
|
64
64
|
apiKey: params.apiKey,
|
|
65
65
|
network: this.inscriberBuilder['hederaKit'].client.network
|
|
66
66
|
.toString()
|
|
@@ -242,8 +242,8 @@ export class InscribeFromUrlTool extends BaseInscriberQueryTool<
|
|
|
242
242
|
waitForConfirmation: params.quoteOnly
|
|
243
243
|
? false
|
|
244
244
|
: params.waitForConfirmation ?? true,
|
|
245
|
-
waitMaxAttempts:
|
|
246
|
-
waitIntervalMs:
|
|
245
|
+
waitMaxAttempts: 60,
|
|
246
|
+
waitIntervalMs: 5000,
|
|
247
247
|
apiKey: params.apiKey,
|
|
248
248
|
network: this.inscriberBuilder['hederaKit'].client.network
|
|
249
249
|
.toString()
|