@hashgraphonline/standards-agent-kit 0.2.127 → 0.2.129
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/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +2 -10
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +62 -30
- package/dist/cjs/utils/content-resolver.d.ts +10 -0
- package/dist/cjs/utils/metadata-defaults.d.ts +18 -0
- package/dist/cjs/validation/content-ref-schemas.d.ts +9 -0
- package/dist/cjs/validation/hip412-schemas.d.ts +125 -0
- package/dist/es/standards-agent-kit.es36.js +11 -63
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +159 -33
- package/dist/es/standards-agent-kit.es37.js.map +1 -1
- package/dist/es/standards-agent-kit.es44.js +57 -0
- package/dist/es/standards-agent-kit.es44.js.map +1 -0
- package/dist/es/standards-agent-kit.es45.js +6 -0
- package/dist/es/standards-agent-kit.es45.js.map +1 -0
- package/dist/es/standards-agent-kit.es46.js +43 -0
- package/dist/es/standards-agent-kit.es46.js.map +1 -0
- package/dist/es/standards-agent-kit.es47.js +15 -0
- package/dist/es/standards-agent-kit.es47.js.map +1 -0
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +2 -10
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +62 -30
- package/dist/es/utils/content-resolver.d.ts +10 -0
- package/dist/es/utils/metadata-defaults.d.ts +18 -0
- package/dist/es/validation/content-ref-schemas.d.ts +9 -0
- package/dist/es/validation/hip412-schemas.d.ts +125 -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/inscriber/InscribeFromBufferTool.d.ts +2 -10
- package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +62 -30
- package/dist/umd/utils/content-resolver.d.ts +10 -0
- package/dist/umd/utils/metadata-defaults.d.ts +18 -0
- package/dist/umd/validation/content-ref-schemas.d.ts +9 -0
- package/dist/umd/validation/hip412-schemas.d.ts +125 -0
- package/package.json +34 -31
- package/src/tools/inscriber/InscribeFromBufferTool.ts +30 -133
- package/src/tools/inscriber/InscribeHashinalTool.ts +271 -46
- package/src/utils/content-resolver.ts +87 -0
- package/src/utils/metadata-defaults.ts +25 -0
- package/src/validation/content-ref-schemas.ts +20 -0
- package/src/validation/hip412-schemas.ts +52 -0
|
@@ -5,11 +5,15 @@ import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
|
5
5
|
* Schema for inscribing Hashinal NFT
|
|
6
6
|
*/
|
|
7
7
|
declare const inscribeHashinalSchema: z.ZodObject<{
|
|
8
|
-
url: z.ZodString
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
url: z.ZodOptional<z.ZodString>;
|
|
9
|
+
contentRef: z.ZodOptional<z.ZodString>;
|
|
10
|
+
base64Data: z.ZodOptional<z.ZodString>;
|
|
11
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
12
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
13
|
+
name: z.ZodOptional<z.ZodString>;
|
|
14
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
type: z.ZodOptional<z.ZodString>;
|
|
13
17
|
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
18
|
trait_type: z.ZodString;
|
|
15
19
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
@@ -22,6 +26,7 @@ declare const inscribeHashinalSchema: z.ZodObject<{
|
|
|
22
26
|
}>, "many">>;
|
|
23
27
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
28
|
jsonFileURL: z.ZodOptional<z.ZodString>;
|
|
29
|
+
fileStandard: z.ZodDefault<z.ZodOptional<z.ZodEnum<["1", "6"]>>>;
|
|
25
30
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
31
|
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
27
32
|
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -29,41 +34,51 @@ declare const inscribeHashinalSchema: z.ZodObject<{
|
|
|
29
34
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
30
35
|
quoteOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
31
36
|
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
url: string;
|
|
33
|
-
type: string;
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
creator: string;
|
|
37
37
|
quoteOnly: boolean;
|
|
38
|
+
fileStandard: "1" | "6";
|
|
39
|
+
url?: string | undefined;
|
|
40
|
+
type?: string | undefined;
|
|
41
|
+
name?: string | undefined;
|
|
42
|
+
description?: string | undefined;
|
|
38
43
|
tags?: string[] | undefined;
|
|
44
|
+
creator?: string | undefined;
|
|
39
45
|
properties?: Record<string, unknown> | undefined;
|
|
46
|
+
mimeType?: string | undefined;
|
|
40
47
|
chunkSize?: number | undefined;
|
|
41
48
|
waitForConfirmation?: boolean | undefined;
|
|
42
49
|
timeoutMs?: number | undefined;
|
|
43
50
|
apiKey?: string | undefined;
|
|
51
|
+
fileName?: string | undefined;
|
|
52
|
+
base64Data?: string | undefined;
|
|
44
53
|
attributes?: {
|
|
45
54
|
value: string | number;
|
|
46
55
|
trait_type: string;
|
|
47
56
|
}[] | undefined;
|
|
57
|
+
contentRef?: string | undefined;
|
|
48
58
|
jsonFileURL?: string | undefined;
|
|
49
59
|
}, {
|
|
50
|
-
url
|
|
51
|
-
type
|
|
52
|
-
name
|
|
53
|
-
description
|
|
54
|
-
creator: string;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
type?: string | undefined;
|
|
62
|
+
name?: string | undefined;
|
|
63
|
+
description?: string | undefined;
|
|
55
64
|
tags?: string[] | undefined;
|
|
65
|
+
creator?: string | undefined;
|
|
56
66
|
properties?: Record<string, unknown> | undefined;
|
|
67
|
+
mimeType?: string | undefined;
|
|
57
68
|
chunkSize?: number | undefined;
|
|
58
69
|
waitForConfirmation?: boolean | undefined;
|
|
59
70
|
timeoutMs?: number | undefined;
|
|
60
71
|
apiKey?: string | undefined;
|
|
61
72
|
quoteOnly?: boolean | undefined;
|
|
73
|
+
fileName?: string | undefined;
|
|
74
|
+
base64Data?: string | undefined;
|
|
62
75
|
attributes?: {
|
|
63
76
|
value: string | number;
|
|
64
77
|
trait_type: string;
|
|
65
78
|
}[] | undefined;
|
|
79
|
+
contentRef?: string | undefined;
|
|
66
80
|
jsonFileURL?: string | undefined;
|
|
81
|
+
fileStandard?: "1" | "6" | undefined;
|
|
67
82
|
}>;
|
|
68
83
|
/**
|
|
69
84
|
* Tool for inscribing Hashinal NFTs
|
|
@@ -72,11 +87,15 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool<typeof
|
|
|
72
87
|
name: string;
|
|
73
88
|
description: string;
|
|
74
89
|
get specificInputSchema(): z.ZodObject<{
|
|
75
|
-
url: z.ZodString
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
url: z.ZodOptional<z.ZodString>;
|
|
91
|
+
contentRef: z.ZodOptional<z.ZodString>;
|
|
92
|
+
base64Data: z.ZodOptional<z.ZodString>;
|
|
93
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
94
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
95
|
+
name: z.ZodOptional<z.ZodString>;
|
|
96
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
97
|
+
description: z.ZodOptional<z.ZodString>;
|
|
98
|
+
type: z.ZodOptional<z.ZodString>;
|
|
80
99
|
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
81
100
|
trait_type: z.ZodString;
|
|
82
101
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
@@ -89,6 +108,7 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool<typeof
|
|
|
89
108
|
}>, "many">>;
|
|
90
109
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
110
|
jsonFileURL: z.ZodOptional<z.ZodString>;
|
|
111
|
+
fileStandard: z.ZodDefault<z.ZodOptional<z.ZodEnum<["1", "6"]>>>;
|
|
92
112
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
93
113
|
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
94
114
|
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -96,42 +116,54 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool<typeof
|
|
|
96
116
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
97
117
|
quoteOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
98
118
|
}, "strip", z.ZodTypeAny, {
|
|
99
|
-
url: string;
|
|
100
|
-
type: string;
|
|
101
|
-
name: string;
|
|
102
|
-
description: string;
|
|
103
|
-
creator: string;
|
|
104
119
|
quoteOnly: boolean;
|
|
120
|
+
fileStandard: "1" | "6";
|
|
121
|
+
url?: string | undefined;
|
|
122
|
+
type?: string | undefined;
|
|
123
|
+
name?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
105
125
|
tags?: string[] | undefined;
|
|
126
|
+
creator?: string | undefined;
|
|
106
127
|
properties?: Record<string, unknown> | undefined;
|
|
128
|
+
mimeType?: string | undefined;
|
|
107
129
|
chunkSize?: number | undefined;
|
|
108
130
|
waitForConfirmation?: boolean | undefined;
|
|
109
131
|
timeoutMs?: number | undefined;
|
|
110
132
|
apiKey?: string | undefined;
|
|
133
|
+
fileName?: string | undefined;
|
|
134
|
+
base64Data?: string | undefined;
|
|
111
135
|
attributes?: {
|
|
112
136
|
value: string | number;
|
|
113
137
|
trait_type: string;
|
|
114
138
|
}[] | undefined;
|
|
139
|
+
contentRef?: string | undefined;
|
|
115
140
|
jsonFileURL?: string | undefined;
|
|
116
141
|
}, {
|
|
117
|
-
url
|
|
118
|
-
type
|
|
119
|
-
name
|
|
120
|
-
description
|
|
121
|
-
creator: string;
|
|
142
|
+
url?: string | undefined;
|
|
143
|
+
type?: string | undefined;
|
|
144
|
+
name?: string | undefined;
|
|
145
|
+
description?: string | undefined;
|
|
122
146
|
tags?: string[] | undefined;
|
|
147
|
+
creator?: string | undefined;
|
|
123
148
|
properties?: Record<string, unknown> | undefined;
|
|
149
|
+
mimeType?: string | undefined;
|
|
124
150
|
chunkSize?: number | undefined;
|
|
125
151
|
waitForConfirmation?: boolean | undefined;
|
|
126
152
|
timeoutMs?: number | undefined;
|
|
127
153
|
apiKey?: string | undefined;
|
|
128
154
|
quoteOnly?: boolean | undefined;
|
|
155
|
+
fileName?: string | undefined;
|
|
156
|
+
base64Data?: string | undefined;
|
|
129
157
|
attributes?: {
|
|
130
158
|
value: string | number;
|
|
131
159
|
trait_type: string;
|
|
132
160
|
}[] | undefined;
|
|
161
|
+
contentRef?: string | undefined;
|
|
133
162
|
jsonFileURL?: string | undefined;
|
|
163
|
+
fileStandard?: "1" | "6" | undefined;
|
|
134
164
|
}>;
|
|
135
165
|
protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
166
|
+
private resolveContent;
|
|
167
|
+
private handleDirectContent;
|
|
136
168
|
}
|
|
137
169
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ContentResolutionResult {
|
|
2
|
+
buffer: Buffer;
|
|
3
|
+
mimeType?: string;
|
|
4
|
+
fileName?: string;
|
|
5
|
+
wasReference?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolves content from various input formats (content-ref, base64, plain text)
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveContent(input: string, providedMimeType?: string, providedFileName?: string): Promise<ContentResolutionResult>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates default metadata for NFT inscription
|
|
3
|
+
*/
|
|
4
|
+
export declare function generateDefaultMetadata(params: {
|
|
5
|
+
name?: string;
|
|
6
|
+
creator?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
operatorAccount: string;
|
|
12
|
+
}): {
|
|
13
|
+
name: string;
|
|
14
|
+
creator: string;
|
|
15
|
+
description: string;
|
|
16
|
+
type: string;
|
|
17
|
+
image: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Validates content reference format
|
|
4
|
+
*/
|
|
5
|
+
export declare const contentRefSchema: z.ZodString;
|
|
6
|
+
/**
|
|
7
|
+
* Validates content reference or returns error for dumber models
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateContentRef(input: string): string;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* HIP-412 file schema for multi-file NFTs
|
|
4
|
+
*/
|
|
5
|
+
export declare const hip412FileSchema: z.ZodObject<{
|
|
6
|
+
uri: z.ZodString;
|
|
7
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
8
|
+
is_default_file: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
type: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
type: string;
|
|
12
|
+
uri: string;
|
|
13
|
+
checksum?: string | undefined;
|
|
14
|
+
is_default_file?: boolean | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
type: string;
|
|
17
|
+
uri: string;
|
|
18
|
+
checksum?: string | undefined;
|
|
19
|
+
is_default_file?: boolean | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* HIP-412 attribute schema for NFT traits
|
|
23
|
+
*/
|
|
24
|
+
export declare const hip412AttributeSchema: z.ZodObject<{
|
|
25
|
+
trait_type: z.ZodString;
|
|
26
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
27
|
+
display_type: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
value: string | number;
|
|
30
|
+
trait_type: string;
|
|
31
|
+
display_type?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
value: string | number;
|
|
34
|
+
trait_type: string;
|
|
35
|
+
display_type?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* HIP-412 compliant metadata schema for Hedera NFTs
|
|
39
|
+
*/
|
|
40
|
+
export declare const hip412MetadataSchema: z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
description: z.ZodString;
|
|
43
|
+
image: z.ZodString;
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
46
|
+
creatorDID: z.ZodOptional<z.ZodString>;
|
|
47
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
48
|
+
format: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
uri: z.ZodString;
|
|
51
|
+
checksum: z.ZodOptional<z.ZodString>;
|
|
52
|
+
is_default_file: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
type: z.ZodString;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
type: string;
|
|
56
|
+
uri: string;
|
|
57
|
+
checksum?: string | undefined;
|
|
58
|
+
is_default_file?: boolean | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
type: string;
|
|
61
|
+
uri: string;
|
|
62
|
+
checksum?: string | undefined;
|
|
63
|
+
is_default_file?: boolean | undefined;
|
|
64
|
+
}>, "many">>;
|
|
65
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
+
trait_type: z.ZodString;
|
|
67
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
68
|
+
display_type: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
value: string | number;
|
|
71
|
+
trait_type: string;
|
|
72
|
+
display_type?: string | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
value: string | number;
|
|
75
|
+
trait_type: string;
|
|
76
|
+
display_type?: string | undefined;
|
|
77
|
+
}>, "many">>;
|
|
78
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
type: string;
|
|
81
|
+
image: string;
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
format: string;
|
|
85
|
+
creator?: string | undefined;
|
|
86
|
+
properties?: Record<string, unknown> | undefined;
|
|
87
|
+
checksum?: string | undefined;
|
|
88
|
+
creatorDID?: string | undefined;
|
|
89
|
+
files?: {
|
|
90
|
+
type: string;
|
|
91
|
+
uri: string;
|
|
92
|
+
checksum?: string | undefined;
|
|
93
|
+
is_default_file?: boolean | undefined;
|
|
94
|
+
}[] | undefined;
|
|
95
|
+
attributes?: {
|
|
96
|
+
value: string | number;
|
|
97
|
+
trait_type: string;
|
|
98
|
+
display_type?: string | undefined;
|
|
99
|
+
}[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
type: string;
|
|
102
|
+
image: string;
|
|
103
|
+
name: string;
|
|
104
|
+
description: string;
|
|
105
|
+
creator?: string | undefined;
|
|
106
|
+
properties?: Record<string, unknown> | undefined;
|
|
107
|
+
checksum?: string | undefined;
|
|
108
|
+
creatorDID?: string | undefined;
|
|
109
|
+
format?: string | undefined;
|
|
110
|
+
files?: {
|
|
111
|
+
type: string;
|
|
112
|
+
uri: string;
|
|
113
|
+
checksum?: string | undefined;
|
|
114
|
+
is_default_file?: boolean | undefined;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
attributes?: {
|
|
117
|
+
value: string | number;
|
|
118
|
+
trait_type: string;
|
|
119
|
+
display_type?: string | undefined;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Validates metadata against HIP-412 standard
|
|
124
|
+
*/
|
|
125
|
+
export declare function validateHIP412Metadata(metadata: any): z.infer<typeof hip412MetadataSchema>;
|