@hashgraphonline/standards-agent-kit 0.2.138 → 0.2.140

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 (38) hide show
  1. package/dist/cjs/standards-agent-kit.cjs +1 -1
  2. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  3. package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
  4. package/dist/es/standards-agent-kit.es24.js +1 -1
  5. package/dist/es/standards-agent-kit.es25.js +1 -1
  6. package/dist/es/standards-agent-kit.es26.js +1 -1
  7. package/dist/es/standards-agent-kit.es27.js +1 -1
  8. package/dist/es/standards-agent-kit.es28.js +1 -1
  9. package/dist/es/standards-agent-kit.es31.js +1 -1
  10. package/dist/es/standards-agent-kit.es32.js +1 -1
  11. package/dist/es/standards-agent-kit.es33.js +1 -1
  12. package/dist/es/standards-agent-kit.es36.js +1 -1
  13. package/dist/es/standards-agent-kit.es37.js +1 -1
  14. package/dist/es/standards-agent-kit.es38.js +15 -7
  15. package/dist/es/standards-agent-kit.es38.js.map +1 -1
  16. package/dist/es/standards-agent-kit.es39.js +8 -8
  17. package/dist/es/standards-agent-kit.es39.js.map +1 -1
  18. package/dist/es/standards-agent-kit.es50.js +3 -20
  19. package/dist/es/standards-agent-kit.es50.js.map +1 -1
  20. package/dist/es/standards-agent-kit.es51.js +17 -50
  21. package/dist/es/standards-agent-kit.es51.js.map +1 -1
  22. package/dist/es/standards-agent-kit.es52.js +54 -3
  23. package/dist/es/standards-agent-kit.es52.js.map +1 -1
  24. package/dist/es/standards-agent-kit.es53.js +2 -39
  25. package/dist/es/standards-agent-kit.es53.js.map +1 -1
  26. package/dist/es/standards-agent-kit.es54.js +38 -17
  27. package/dist/es/standards-agent-kit.es54.js.map +1 -1
  28. package/dist/es/standards-agent-kit.es55.js +16 -71
  29. package/dist/es/standards-agent-kit.es55.js.map +1 -1
  30. package/dist/es/standards-agent-kit.es56.js +73 -3
  31. package/dist/es/standards-agent-kit.es56.js.map +1 -1
  32. package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
  33. package/dist/umd/standards-agent-kit.umd.js +1 -1
  34. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  35. package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
  36. package/package.json +26 -34
  37. package/src/tools/inscriber/InscribeFromBufferTool.ts +16 -4
  38. package/src/tools/inscriber/InscribeHashinalTool.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es51.js","sources":["../../src/utils/content-resolver.ts"],"sourcesContent":["import { ContentResolverRegistry } from '@hashgraphonline/standards-sdk';\n\nexport interface ContentResolutionResult {\n buffer: Buffer;\n mimeType?: string;\n fileName?: string;\n wasReference?: boolean;\n}\n\n/**\n * Resolves content from various input formats (content-ref, base64, plain text)\n */\nexport async function resolveContent(\n input: string,\n providedMimeType?: string,\n providedFileName?: string\n): Promise<ContentResolutionResult> {\n const trimmedInput = input.trim();\n\n const resolver = ContentResolverRegistry.getResolver();\n\n if (!resolver) {\n return handleDirectContent(\n trimmedInput,\n providedMimeType,\n providedFileName\n );\n }\n\n const referenceId = resolver.extractReferenceId(trimmedInput);\n\n if (referenceId) {\n try {\n const resolution = await resolver.resolveReference(referenceId);\n\n return {\n buffer: resolution.content,\n mimeType: resolution.metadata?.mimeType || providedMimeType,\n fileName: resolution.metadata?.fileName || providedFileName,\n wasReference: true,\n };\n } catch (error) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : 'Unknown error resolving reference';\n throw new Error(`Reference resolution failed: ${errorMsg}`);\n }\n }\n\n return handleDirectContent(trimmedInput, providedMimeType, providedFileName);\n}\n\n/**\n * Handles direct content (base64 or plain text)\n */\nfunction handleDirectContent(\n input: string,\n providedMimeType?: string,\n providedFileName?: string\n): ContentResolutionResult {\n const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(input);\n\n if (isValidBase64) {\n try {\n const buffer = Buffer.from(input, 'base64');\n return {\n buffer,\n mimeType: providedMimeType,\n fileName: providedFileName,\n wasReference: false,\n };\n } catch (error) {\n throw new Error(\n 'Failed to decode base64 data. Please ensure the data is properly encoded.'\n );\n }\n }\n\n const buffer = Buffer.from(input, 'utf8');\n return {\n buffer,\n mimeType: providedMimeType || 'text/plain',\n fileName: providedFileName,\n wasReference: false,\n };\n}\n"],"names":["buffer"],"mappings":";AAYA,eAAsB,eACpB,OACA,kBACA,kBACkC;AAClC,QAAM,eAAe,MAAM,KAAA;AAE3B,QAAM,WAAW,wBAAwB,YAAA;AAEzC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,cAAc,SAAS,mBAAmB,YAAY;AAE5D,MAAI,aAAa;AACf,QAAI;AACF,YAAM,aAAa,MAAM,SAAS,iBAAiB,WAAW;AAE9D,aAAO;AAAA,QACL,QAAQ,WAAW;AAAA,QACnB,UAAU,WAAW,UAAU,YAAY;AAAA,QAC3C,UAAU,WAAW,UAAU,YAAY;AAAA,QAC3C,cAAc;AAAA,MAAA;AAAA,IAElB,SAAS,OAAO;AACd,YAAM,WACJ,iBAAiB,QACb,MAAM,UACN;AACN,YAAM,IAAI,MAAM,gCAAgC,QAAQ,EAAE;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,oBAAoB,cAAc,kBAAkB,gBAAgB;AAC7E;AAKA,SAAS,oBACP,OACA,kBACA,kBACyB;AACzB,QAAM,gBAAgB,yBAAyB,KAAK,KAAK;AAEzD,MAAI,eAAe;AACjB,QAAI;AACF,YAAMA,UAAS,OAAO,KAAK,OAAO,QAAQ;AAC1C,aAAO;AAAA,QACL,QAAAA;AAAAA,QACA,UAAU;AAAA,QACV,UAAU;AAAA,QACV,cAAc;AAAA,MAAA;AAAA,IAElB,SAAS,OAAO;AACd,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AAEA,QAAM,SAAS,OAAO,KAAK,OAAO,MAAM;AACxC,SAAO;AAAA,IACL;AAAA,IACA,UAAU,oBAAoB;AAAA,IAC9B,UAAU;AAAA,IACV,cAAc;AAAA,EAAA;AAElB;"}
1
+ {"version":3,"file":"standards-agent-kit.es51.js","sources":["../../src/utils/inscription-utils.ts"],"sourcesContent":["export type NetworkType = 'mainnet' | 'testnet';\n\nexport interface TopicIds {\n jsonTopicId?: string;\n topicId?: string;\n}\n\nfunction getStringProp(obj: unknown, key: string): string | undefined {\n if (!obj || typeof obj !== 'object') return undefined;\n const val = (obj as Record<string, unknown>)[key];\n return typeof val === 'string' && val.trim() ? val : undefined;\n}\n\n/**\n * Extract topic ids from an inscription and/or result object without using any.\n * - Prefers jsonTopicId when present (for CDN linking)\n * - Collects topic_id/topicId from either inscription or result\n */\nexport function extractTopicIds(\n inscription: unknown,\n result?: unknown\n): TopicIds {\n const jsonTopicId = getStringProp(inscription, 'jsonTopicId');\n\n const imageTopicId =\n getStringProp(inscription, 'topic_id') ||\n getStringProp(inscription, 'topicId') ||\n getStringProp(result, 'topicId') ||\n getStringProp(result, 'topic_id');\n\n return {\n jsonTopicId: jsonTopicId,\n topicId: imageTopicId,\n };\n}\n\n/**\n * Build HRL/CDN URLs from extracted topic ids.\n * - HRL prefers jsonTopicId, falls back to topicId\n * - CDN URL only provided when jsonTopicId is present\n */\nexport function buildInscriptionLinks(\n ids: TopicIds,\n network: NetworkType,\n fileStandard: string = '1'\n): { hrl?: string; cdnUrl?: string; topicId?: string } {\n const chosen = ids.jsonTopicId || ids.topicId;\n const hrl = chosen ? `hcs://${fileStandard}/${chosen}` : undefined;\n const cdnUrl = ids.jsonTopicId\n ? `https://kiloscribe.com/api/inscription-cdn/${ids.jsonTopicId}?network=${network}`\n : undefined;\n return { hrl, cdnUrl, topicId: chosen };\n}\n"],"names":[],"mappings":"AAOA,SAAS,cAAc,KAAc,KAAiC;AACpE,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO;AAC5C,QAAM,MAAO,IAAgC,GAAG;AAChD,SAAO,OAAO,QAAQ,YAAY,IAAI,KAAA,IAAS,MAAM;AACvD;AAOO,SAAS,gBACd,aACA,QACU;AACV,QAAM,cAAc,cAAc,aAAa,aAAa;AAE5D,QAAM,eACJ,cAAc,aAAa,UAAU,KACrC,cAAc,aAAa,SAAS,KACpC,cAAc,QAAQ,SAAS,KAC/B,cAAc,QAAQ,UAAU;AAElC,SAAO;AAAA,IACL;AAAA,IACA,SAAS;AAAA,EAAA;AAEb;AAOO,SAAS,sBACd,KACA,SACA,eAAuB,KAC8B;AACrD,QAAM,SAAS,IAAI,eAAe,IAAI;AACtC,QAAM,MAAM,SAAS,SAAS,YAAY,IAAI,MAAM,KAAK;AACzD,QAAM,SAAS,IAAI,cACf,8CAA8C,IAAI,WAAW,YAAY,OAAO,KAChF;AACJ,SAAO,EAAE,KAAK,QAAQ,SAAS,OAAA;AACjC;"}
@@ -1,6 +1,57 @@
1
- import { z } from "zod";
2
- const contentRefSchema = z.string().regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format "content-ref:[alphanumeric-id]"').describe('Content reference in format "content-ref:[id]"');
1
+ import { ContentResolverRegistry } from "@hashgraphonline/standards-sdk";
2
+ async function resolveContent(input, providedMimeType, providedFileName) {
3
+ const trimmedInput = input.trim();
4
+ const resolver = ContentResolverRegistry.getResolver();
5
+ if (!resolver) {
6
+ return handleDirectContent(
7
+ trimmedInput,
8
+ providedMimeType,
9
+ providedFileName
10
+ );
11
+ }
12
+ const referenceId = resolver.extractReferenceId(trimmedInput);
13
+ if (referenceId) {
14
+ try {
15
+ const resolution = await resolver.resolveReference(referenceId);
16
+ return {
17
+ buffer: resolution.content,
18
+ mimeType: resolution.metadata?.mimeType || providedMimeType,
19
+ fileName: resolution.metadata?.fileName || providedFileName,
20
+ wasReference: true
21
+ };
22
+ } catch (error) {
23
+ const errorMsg = error instanceof Error ? error.message : "Unknown error resolving reference";
24
+ throw new Error(`Reference resolution failed: ${errorMsg}`);
25
+ }
26
+ }
27
+ return handleDirectContent(trimmedInput, providedMimeType, providedFileName);
28
+ }
29
+ function handleDirectContent(input, providedMimeType, providedFileName) {
30
+ const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(input);
31
+ if (isValidBase64) {
32
+ try {
33
+ const buffer2 = Buffer.from(input, "base64");
34
+ return {
35
+ buffer: buffer2,
36
+ mimeType: providedMimeType,
37
+ fileName: providedFileName,
38
+ wasReference: false
39
+ };
40
+ } catch (error) {
41
+ throw new Error(
42
+ "Failed to decode base64 data. Please ensure the data is properly encoded."
43
+ );
44
+ }
45
+ }
46
+ const buffer = Buffer.from(input, "utf8");
47
+ return {
48
+ buffer,
49
+ mimeType: providedMimeType || "text/plain",
50
+ fileName: providedFileName,
51
+ wasReference: false
52
+ };
53
+ }
3
54
  export {
4
- contentRefSchema
55
+ resolveContent
5
56
  };
6
57
  //# sourceMappingURL=standards-agent-kit.es52.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es52.js","sources":["../../src/validation/content-ref-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Validates content reference format\n */\nexport const contentRefSchema = z\n .string()\n .regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format \"content-ref:[alphanumeric-id]\"')\n .describe('Content reference in format \"content-ref:[id]\"');\n\n/**\n * Validates content reference or returns error for dumber models\n */\nexport function validateContentRef(input: string): string {\n try {\n return contentRefSchema.parse(input);\n } catch (error) {\n throw new Error(`Invalid content reference format. Expected \"content-ref:[alphanumeric-id]\" but got \"${input}\"`);\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAC7B,SACA,MAAM,gCAAgC,qEAAqE,EAC3G,SAAS,gDAAgD;"}
1
+ {"version":3,"file":"standards-agent-kit.es52.js","sources":["../../src/utils/content-resolver.ts"],"sourcesContent":["import { ContentResolverRegistry } from '@hashgraphonline/standards-sdk';\n\nexport interface ContentResolutionResult {\n buffer: Buffer;\n mimeType?: string;\n fileName?: string;\n wasReference?: boolean;\n}\n\n/**\n * Resolves content from various input formats (content-ref, base64, plain text)\n */\nexport async function resolveContent(\n input: string,\n providedMimeType?: string,\n providedFileName?: string\n): Promise<ContentResolutionResult> {\n const trimmedInput = input.trim();\n\n const resolver = ContentResolverRegistry.getResolver();\n\n if (!resolver) {\n return handleDirectContent(\n trimmedInput,\n providedMimeType,\n providedFileName\n );\n }\n\n const referenceId = resolver.extractReferenceId(trimmedInput);\n\n if (referenceId) {\n try {\n const resolution = await resolver.resolveReference(referenceId);\n\n return {\n buffer: resolution.content,\n mimeType: resolution.metadata?.mimeType || providedMimeType,\n fileName: resolution.metadata?.fileName || providedFileName,\n wasReference: true,\n };\n } catch (error) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : 'Unknown error resolving reference';\n throw new Error(`Reference resolution failed: ${errorMsg}`);\n }\n }\n\n return handleDirectContent(trimmedInput, providedMimeType, providedFileName);\n}\n\n/**\n * Handles direct content (base64 or plain text)\n */\nfunction handleDirectContent(\n input: string,\n providedMimeType?: string,\n providedFileName?: string\n): ContentResolutionResult {\n const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(input);\n\n if (isValidBase64) {\n try {\n const buffer = Buffer.from(input, 'base64');\n return {\n buffer,\n mimeType: providedMimeType,\n fileName: providedFileName,\n wasReference: false,\n };\n } catch (error) {\n throw new Error(\n 'Failed to decode base64 data. Please ensure the data is properly encoded.'\n );\n }\n }\n\n const buffer = Buffer.from(input, 'utf8');\n return {\n buffer,\n mimeType: providedMimeType || 'text/plain',\n fileName: providedFileName,\n wasReference: false,\n };\n}\n"],"names":["buffer"],"mappings":";AAYA,eAAsB,eACpB,OACA,kBACA,kBACkC;AAClC,QAAM,eAAe,MAAM,KAAA;AAE3B,QAAM,WAAW,wBAAwB,YAAA;AAEzC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,cAAc,SAAS,mBAAmB,YAAY;AAE5D,MAAI,aAAa;AACf,QAAI;AACF,YAAM,aAAa,MAAM,SAAS,iBAAiB,WAAW;AAE9D,aAAO;AAAA,QACL,QAAQ,WAAW;AAAA,QACnB,UAAU,WAAW,UAAU,YAAY;AAAA,QAC3C,UAAU,WAAW,UAAU,YAAY;AAAA,QAC3C,cAAc;AAAA,MAAA;AAAA,IAElB,SAAS,OAAO;AACd,YAAM,WACJ,iBAAiB,QACb,MAAM,UACN;AACN,YAAM,IAAI,MAAM,gCAAgC,QAAQ,EAAE;AAAA,IAC5D;AAAA,EACF;AAEA,SAAO,oBAAoB,cAAc,kBAAkB,gBAAgB;AAC7E;AAKA,SAAS,oBACP,OACA,kBACA,kBACyB;AACzB,QAAM,gBAAgB,yBAAyB,KAAK,KAAK;AAEzD,MAAI,eAAe;AACjB,QAAI;AACF,YAAMA,UAAS,OAAO,KAAK,OAAO,QAAQ;AAC1C,aAAO;AAAA,QACL,QAAAA;AAAAA,QACA,UAAU;AAAA,QACV,UAAU;AAAA,QACV,cAAc;AAAA,MAAA;AAAA,IAElB,SAAS,OAAO;AACd,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AAEA,QAAM,SAAS,OAAO,KAAK,OAAO,MAAM;AACxC,SAAO;AAAA,IACL;AAAA,IACA,UAAU,oBAAoB;AAAA,IAC9B,UAAU;AAAA,IACV,cAAc;AAAA,EAAA;AAElB;"}
@@ -1,43 +1,6 @@
1
1
  import { z } from "zod";
2
- const hip412FileSchema = z.object({
3
- uri: z.string().describe("URI of the file"),
4
- checksum: z.string().optional().describe("SHA-256 checksum of the file"),
5
- is_default_file: z.boolean().optional().describe("Whether this is the default file"),
6
- type: z.string().describe("MIME type of the file")
7
- });
8
- const hip412AttributeSchema = z.object({
9
- trait_type: z.string().describe("The trait type"),
10
- value: z.union([z.string(), z.number()]).describe("The trait value"),
11
- display_type: z.string().optional().describe("Display type for the attribute")
12
- });
13
- const hip412MetadataSchema = z.object({
14
- name: z.string().describe("Token name (required by HIP-412)"),
15
- description: z.string().describe("Human readable description (required by HIP-412)"),
16
- image: z.string().describe("Preview image URI (required by HIP-412)"),
17
- type: z.string().describe("MIME type (required by HIP-412)"),
18
- creator: z.string().optional().describe("Creator name or comma-separated names"),
19
- creatorDID: z.string().optional().describe("Decentralized identifier for creator"),
20
- checksum: z.string().optional().describe("SHA-256 checksum of the image"),
21
- format: z.string().optional().default("HIP412@2.0.0").describe("Metadata format version"),
22
- files: z.array(hip412FileSchema).optional().describe("Array of files for multi-file NFTs"),
23
- attributes: z.array(hip412AttributeSchema).optional().describe("NFT attributes/traits"),
24
- properties: z.record(z.unknown()).optional().describe("Additional properties")
25
- });
26
- function validateHIP412Metadata(metadata) {
27
- try {
28
- return hip412MetadataSchema.parse(metadata);
29
- } catch (error) {
30
- if (error instanceof z.ZodError) {
31
- const issues = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
32
- throw new Error(`HIP-412 metadata validation failed: ${issues}`);
33
- }
34
- throw error;
35
- }
36
- }
2
+ const contentRefSchema = z.string().regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format "content-ref:[alphanumeric-id]"').describe('Content reference in format "content-ref:[id]"');
37
3
  export {
38
- hip412AttributeSchema,
39
- hip412FileSchema,
40
- hip412MetadataSchema,
41
- validateHIP412Metadata
4
+ contentRefSchema
42
5
  };
43
6
  //# sourceMappingURL=standards-agent-kit.es53.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es53.js","sources":["../../src/validation/hip412-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * HIP-412 file schema for multi-file NFTs\n */\nexport const hip412FileSchema = z.object({\n uri: z.string().describe('URI of the file'),\n checksum: z.string().optional().describe('SHA-256 checksum of the file'),\n is_default_file: z.boolean().optional().describe('Whether this is the default file'),\n type: z.string().describe('MIME type of the file'),\n});\n\n/**\n * HIP-412 attribute schema for NFT traits\n */\nexport const hip412AttributeSchema = z.object({\n trait_type: z.string().describe('The trait type'),\n value: z.union([z.string(), z.number()]).describe('The trait value'),\n display_type: z.string().optional().describe('Display type for the attribute'),\n});\n\n/**\n * HIP-412 compliant metadata schema for Hedera NFTs\n */\nexport const hip412MetadataSchema = z.object({\n name: z.string().describe('Token name (required by HIP-412)'),\n description: z.string().describe('Human readable description (required by HIP-412)'),\n image: z.string().describe('Preview image URI (required by HIP-412)'),\n type: z.string().describe('MIME type (required by HIP-412)'),\n creator: z.string().optional().describe('Creator name or comma-separated names'),\n creatorDID: z.string().optional().describe('Decentralized identifier for creator'),\n checksum: z.string().optional().describe('SHA-256 checksum of the image'),\n format: z.string().optional().default('HIP412@2.0.0').describe('Metadata format version'),\n files: z.array(hip412FileSchema).optional().describe('Array of files for multi-file NFTs'),\n attributes: z.array(hip412AttributeSchema).optional().describe('NFT attributes/traits'),\n properties: z.record(z.unknown()).optional().describe('Additional properties'),\n});\n\n/**\n * Validates metadata against HIP-412 standard\n */\nexport function validateHIP412Metadata(metadata: unknown): z.infer<typeof hip412MetadataSchema> {\n try {\n return hip412MetadataSchema.parse(metadata);\n } catch (error) {\n if (error instanceof z.ZodError) {\n const issues = error.errors.map(err => `${err.path.join('.')}: ${err.message}`).join('; ');\n throw new Error(`HIP-412 metadata validation failed: ${issues}`);\n }\n throw error;\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,KAAK,EAAE,SAAS,SAAS,iBAAiB;AAAA,EAC1C,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,8BAA8B;AAAA,EACvE,iBAAiB,EAAE,QAAA,EAAU,SAAA,EAAW,SAAS,kCAAkC;AAAA,EACnF,MAAM,EAAE,OAAA,EAAS,SAAS,uBAAuB;AACnD,CAAC;AAKM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,YAAY,EAAE,SAAS,SAAS,gBAAgB;AAAA,EAChD,OAAO,EAAE,MAAM,CAAC,EAAE,OAAA,GAAU,EAAE,OAAA,CAAQ,CAAC,EAAE,SAAS,iBAAiB;AAAA,EACnE,cAAc,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,gCAAgC;AAC/E,CAAC;AAKM,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,MAAM,EAAE,SAAS,SAAS,kCAAkC;AAAA,EAC5D,aAAa,EAAE,SAAS,SAAS,kDAAkD;AAAA,EACnF,OAAO,EAAE,SAAS,SAAS,yCAAyC;AAAA,EACpE,MAAM,EAAE,SAAS,SAAS,iCAAiC;AAAA,EAC3D,SAAS,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,uCAAuC;AAAA,EAC/E,YAAY,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,sCAAsC;AAAA,EACjF,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,+BAA+B;AAAA,EACxE,QAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,QAAQ,cAAc,EAAE,SAAS,yBAAyB;AAAA,EACxF,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAA,EAAW,SAAS,oCAAoC;AAAA,EACzF,YAAY,EAAE,MAAM,qBAAqB,EAAE,SAAA,EAAW,SAAS,uBAAuB;AAAA,EACtF,YAAY,EAAE,OAAO,EAAE,QAAA,CAAS,EAAE,WAAW,SAAS,uBAAuB;AAC/E,CAAC;AAKM,SAAS,uBAAuB,UAAyD;AAC9F,MAAI;AACF,WAAO,qBAAqB,MAAM,QAAQ;AAAA,EAC5C,SAAS,OAAO;AACd,QAAI,iBAAiB,EAAE,UAAU;AAC/B,YAAM,SAAS,MAAM,OAAO,IAAI,CAAA,QAAO,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,EAAE,KAAK,IAAI;AACzF,YAAM,IAAI,MAAM,uCAAuC,MAAM,EAAE;AAAA,IACjE;AACA,UAAM;AAAA,EACR;AACF;"}
1
+ {"version":3,"file":"standards-agent-kit.es53.js","sources":["../../src/validation/content-ref-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Validates content reference format\n */\nexport const contentRefSchema = z\n .string()\n .regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format \"content-ref:[alphanumeric-id]\"')\n .describe('Content reference in format \"content-ref:[id]\"');\n\n/**\n * Validates content reference or returns error for dumber models\n */\nexport function validateContentRef(input: string): string {\n try {\n return contentRefSchema.parse(input);\n } catch (error) {\n throw new Error(`Invalid content reference format. Expected \"content-ref:[alphanumeric-id]\" but got \"${input}\"`);\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAC7B,SACA,MAAM,gCAAgC,qEAAqE,EAC3G,SAAS,gDAAgD;"}
@@ -1,22 +1,43 @@
1
- function generateDefaultMetadata(params) {
2
- const defaultName = params.fileName?.replace(/\.[^/.]+$/, "") || "Hashinal NFT";
3
- let defaultType = "media";
4
- if (params.mimeType?.startsWith("image/")) {
5
- defaultType = "image";
6
- } else if (params.mimeType?.startsWith("video/")) {
7
- defaultType = "video";
8
- } else if (params.mimeType?.startsWith("audio/")) {
9
- defaultType = "audio";
1
+ import { z } from "zod";
2
+ const hip412FileSchema = z.object({
3
+ uri: z.string().describe("URI of the file"),
4
+ checksum: z.string().optional().describe("SHA-256 checksum of the file"),
5
+ is_default_file: z.boolean().optional().describe("Whether this is the default file"),
6
+ type: z.string().describe("MIME type of the file")
7
+ });
8
+ const hip412AttributeSchema = z.object({
9
+ trait_type: z.string().describe("The trait type"),
10
+ value: z.union([z.string(), z.number()]).describe("The trait value"),
11
+ display_type: z.string().optional().describe("Display type for the attribute")
12
+ });
13
+ const hip412MetadataSchema = z.object({
14
+ name: z.string().describe("Token name (required by HIP-412)"),
15
+ description: z.string().describe("Human readable description (required by HIP-412)"),
16
+ image: z.string().describe("Preview image URI (required by HIP-412)"),
17
+ type: z.string().describe("MIME type (required by HIP-412)"),
18
+ creator: z.string().optional().describe("Creator name or comma-separated names"),
19
+ creatorDID: z.string().optional().describe("Decentralized identifier for creator"),
20
+ checksum: z.string().optional().describe("SHA-256 checksum of the image"),
21
+ format: z.string().optional().default("HIP412@2.0.0").describe("Metadata format version"),
22
+ files: z.array(hip412FileSchema).optional().describe("Array of files for multi-file NFTs"),
23
+ attributes: z.array(hip412AttributeSchema).optional().describe("NFT attributes/traits"),
24
+ properties: z.record(z.unknown()).optional().describe("Additional properties")
25
+ });
26
+ function validateHIP412Metadata(metadata) {
27
+ try {
28
+ return hip412MetadataSchema.parse(metadata);
29
+ } catch (error) {
30
+ if (error instanceof z.ZodError) {
31
+ const issues = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
32
+ throw new Error(`HIP-412 metadata validation failed: ${issues}`);
33
+ }
34
+ throw error;
10
35
  }
11
- return {
12
- name: params.name || defaultName,
13
- creator: params.creator || params.operatorAccount,
14
- description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,
15
- type: params.type || defaultType,
16
- image: ""
17
- };
18
36
  }
19
37
  export {
20
- generateDefaultMetadata
38
+ hip412AttributeSchema,
39
+ hip412FileSchema,
40
+ hip412MetadataSchema,
41
+ validateHIP412Metadata
21
42
  };
22
43
  //# sourceMappingURL=standards-agent-kit.es54.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es54.js","sources":["../../src/utils/metadata-defaults.ts"],"sourcesContent":["/**\n * Generates default metadata for NFT inscription\n */\nexport function generateDefaultMetadata(params: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n fileName?: string;\n mimeType?: string;\n operatorAccount: string;\n}): {\n name: string;\n creator: string;\n description: string;\n type: string;\n image: string;\n} {\n const defaultName = params.fileName?.replace(/\\.[^/.]+$/, '') || 'Hashinal NFT';\n let defaultType = 'media';\n if (params.mimeType?.startsWith('image/')) {\n defaultType = 'image';\n } else if (params.mimeType?.startsWith('video/')) {\n defaultType = 'video';\n } else if (params.mimeType?.startsWith('audio/')) {\n defaultType = 'audio';\n }\n\n return {\n name: params.name || defaultName,\n creator: params.creator || params.operatorAccount,\n description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,\n type: params.type || defaultType,\n image: '',\n };\n}"],"names":[],"mappings":"AAGO,SAAS,wBAAwB,QActC;AACA,QAAM,cAAc,OAAO,UAAU,QAAQ,aAAa,EAAE,KAAK;AACjE,MAAI,cAAc;AAClB,MAAI,OAAO,UAAU,WAAW,QAAQ,GAAG;AACzC,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,MAAM,OAAO,QAAQ;AAAA,IACrB,SAAS,OAAO,WAAW,OAAO;AAAA,IAClC,aAAa,OAAO,eAAe,GAAG,YAAY,OAAO,CAAC,EAAE,YAAA,IAAgB,YAAY,MAAM,CAAC,CAAC;AAAA,IAChG,MAAM,OAAO,QAAQ;AAAA,IACrB,OAAO;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"standards-agent-kit.es54.js","sources":["../../src/validation/hip412-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * HIP-412 file schema for multi-file NFTs\n */\nexport const hip412FileSchema = z.object({\n uri: z.string().describe('URI of the file'),\n checksum: z.string().optional().describe('SHA-256 checksum of the file'),\n is_default_file: z.boolean().optional().describe('Whether this is the default file'),\n type: z.string().describe('MIME type of the file'),\n});\n\n/**\n * HIP-412 attribute schema for NFT traits\n */\nexport const hip412AttributeSchema = z.object({\n trait_type: z.string().describe('The trait type'),\n value: z.union([z.string(), z.number()]).describe('The trait value'),\n display_type: z.string().optional().describe('Display type for the attribute'),\n});\n\n/**\n * HIP-412 compliant metadata schema for Hedera NFTs\n */\nexport const hip412MetadataSchema = z.object({\n name: z.string().describe('Token name (required by HIP-412)'),\n description: z.string().describe('Human readable description (required by HIP-412)'),\n image: z.string().describe('Preview image URI (required by HIP-412)'),\n type: z.string().describe('MIME type (required by HIP-412)'),\n creator: z.string().optional().describe('Creator name or comma-separated names'),\n creatorDID: z.string().optional().describe('Decentralized identifier for creator'),\n checksum: z.string().optional().describe('SHA-256 checksum of the image'),\n format: z.string().optional().default('HIP412@2.0.0').describe('Metadata format version'),\n files: z.array(hip412FileSchema).optional().describe('Array of files for multi-file NFTs'),\n attributes: z.array(hip412AttributeSchema).optional().describe('NFT attributes/traits'),\n properties: z.record(z.unknown()).optional().describe('Additional properties'),\n});\n\n/**\n * Validates metadata against HIP-412 standard\n */\nexport function validateHIP412Metadata(metadata: unknown): z.infer<typeof hip412MetadataSchema> {\n try {\n return hip412MetadataSchema.parse(metadata);\n } catch (error) {\n if (error instanceof z.ZodError) {\n const issues = error.errors.map(err => `${err.path.join('.')}: ${err.message}`).join('; ');\n throw new Error(`HIP-412 metadata validation failed: ${issues}`);\n }\n throw error;\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,KAAK,EAAE,SAAS,SAAS,iBAAiB;AAAA,EAC1C,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,8BAA8B;AAAA,EACvE,iBAAiB,EAAE,QAAA,EAAU,SAAA,EAAW,SAAS,kCAAkC;AAAA,EACnF,MAAM,EAAE,OAAA,EAAS,SAAS,uBAAuB;AACnD,CAAC;AAKM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,YAAY,EAAE,SAAS,SAAS,gBAAgB;AAAA,EAChD,OAAO,EAAE,MAAM,CAAC,EAAE,OAAA,GAAU,EAAE,OAAA,CAAQ,CAAC,EAAE,SAAS,iBAAiB;AAAA,EACnE,cAAc,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,gCAAgC;AAC/E,CAAC;AAKM,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,MAAM,EAAE,SAAS,SAAS,kCAAkC;AAAA,EAC5D,aAAa,EAAE,SAAS,SAAS,kDAAkD;AAAA,EACnF,OAAO,EAAE,SAAS,SAAS,yCAAyC;AAAA,EACpE,MAAM,EAAE,SAAS,SAAS,iCAAiC;AAAA,EAC3D,SAAS,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,uCAAuC;AAAA,EAC/E,YAAY,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,sCAAsC;AAAA,EACjF,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,+BAA+B;AAAA,EACxE,QAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,QAAQ,cAAc,EAAE,SAAS,yBAAyB;AAAA,EACxF,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAA,EAAW,SAAS,oCAAoC;AAAA,EACzF,YAAY,EAAE,MAAM,qBAAqB,EAAE,SAAA,EAAW,SAAS,uBAAuB;AAAA,EACtF,YAAY,EAAE,OAAO,EAAE,QAAA,CAAS,EAAE,WAAW,SAAS,uBAAuB;AAC/E,CAAC;AAKM,SAAS,uBAAuB,UAAyD;AAC9F,MAAI;AACF,WAAO,qBAAqB,MAAM,QAAQ;AAAA,EAC5C,SAAS,OAAO;AACd,QAAI,iBAAiB,EAAE,UAAU;AAC/B,YAAM,SAAS,MAAM,OAAO,IAAI,CAAA,QAAO,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,EAAE,KAAK,IAAI;AACzF,YAAM,IAAI,MAAM,uCAAuC,MAAM,EAAE;AAAA,IACjE;AACA,UAAM;AAAA,EACR;AACF;"}
@@ -1,77 +1,22 @@
1
- function createInscriptionSuccess(params) {
2
- const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
1
+ function generateDefaultMetadata(params) {
2
+ const defaultName = params.fileName?.replace(/\.[^/.]+$/, "") || "Hashinal NFT";
3
+ let defaultType = "media";
4
+ if (params.mimeType?.startsWith("image/")) {
5
+ defaultType = "image";
6
+ } else if (params.mimeType?.startsWith("video/")) {
7
+ defaultType = "video";
8
+ } else if (params.mimeType?.startsWith("audio/")) {
9
+ defaultType = "audio";
10
+ }
3
11
  return {
4
- success: true,
5
- type: "inscription",
6
- title: `${standard} Hashinal Inscription Complete`,
7
- message: `Successfully inscribed "${metadata.name || "your content"}" as a ${standard} Hashinal. The content is now ready for NFT minting.`,
8
- inscription: {
9
- hrl,
10
- topicId,
11
- standard,
12
- cdnUrl,
13
- transactionId
14
- },
15
- metadata,
16
- nextSteps: {
17
- primary: "CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.",
18
- context: 'The metadata parameter for minting should be exactly: ["' + hrl + '"] - just the HRL string in an array, nothing else.',
19
- mintingMetadata: hrl
20
- }
21
- };
22
- }
23
- function createInscriptionQuote(params) {
24
- const { totalCostHbar, validUntil, breakdown, content } = params;
25
- return {
26
- success: true,
27
- type: "quote",
28
- title: "Inscription Cost Quote",
29
- message: `Estimated cost to inscribe "${content.name || "your content"}" is ${totalCostHbar} HBAR.`,
30
- quote: {
31
- totalCostHbar,
32
- validUntil,
33
- breakdown
34
- },
35
- content
36
- };
37
- }
38
- function createInscriptionError(params) {
39
- const { code, details, suggestions } = params;
40
- return {
41
- success: false,
42
- type: "error",
43
- title: "Inscription Failed",
44
- message: `Unable to complete inscription: ${details}`,
45
- error: {
46
- code,
47
- details,
48
- suggestions
49
- }
50
- };
51
- }
52
- function createInscriptionPending(params) {
53
- const { transactionId, details, suggestions } = params;
54
- const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;
55
- return {
56
- success: false,
57
- type: "error",
58
- title: "Inscription Submitted (Pending)",
59
- message: d,
60
- error: {
61
- code: "INSCRIPTION_PENDING",
62
- details: d,
63
- suggestions: suggestions || [
64
- "Wait a few moments for confirmation",
65
- "Check the transaction status on a Hedera explorer",
66
- "Try the inscription again if it doesn't confirm within 5 minutes"
67
- ]
68
- }
12
+ name: params.name || defaultName,
13
+ creator: params.creator || params.operatorAccount,
14
+ description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,
15
+ type: params.type || defaultType,
16
+ image: ""
69
17
  };
70
18
  }
71
19
  export {
72
- createInscriptionError,
73
- createInscriptionPending,
74
- createInscriptionQuote,
75
- createInscriptionSuccess
20
+ generateDefaultMetadata
76
21
  };
77
22
  //# sourceMappingURL=standards-agent-kit.es55.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es55.js","sources":["../../src/types/inscription-response.ts"],"sourcesContent":["/**\n * Structured response interface for inscription tools\n * Provides a consistent, user-friendly format for inscription results\n */\n\nexport interface InscriptionSuccessResponse {\n success: true;\n type: 'inscription';\n title: string;\n message: string;\n inscription: {\n /** The HRL (Hashinal Reference Link) for minting - e.g., \"hcs://1/0.0.123456\" */\n hrl: string;\n /** Topic ID where the inscription was stored */\n topicId: string;\n /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */\n standard: 'Static' | 'Dynamic';\n /** CDN URL for direct access to the inscribed content */\n cdnUrl?: string;\n /** Transaction ID of the inscription */\n transactionId?: string;\n };\n metadata: {\n /** Name/title of the inscribed content */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Description of the content */\n description?: string;\n /** Content type (image, text, etc.) */\n type?: string;\n /** Additional attributes */\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n nextSteps: {\n /** Primary action the user should take next */\n primary: string;\n /** Additional context or options */\n context?: string;\n /** Specific metadata value to use for minting */\n mintingMetadata: string;\n };\n /** HashLink block data (only present when withHashLinkBlocks=true) */\n hashLinkBlock?: {\n /** Block topic ID on HCS */\n blockId: string;\n /** HashLink reference to the block */\n hashLink: string;\n /** Template topic ID */\n template: string;\n /** Block attributes for rendering */\n attributes: BlockAttributes;\n };\n}\n\nexport interface InscriptionQuoteResponse {\n success: true;\n type: 'quote';\n title: string;\n message: string;\n quote: {\n /** Total cost in HBAR */\n totalCostHbar: string;\n /** When the quote expires */\n validUntil: string;\n /** Cost breakdown details */\n breakdown?: CostBreakdown;\n };\n content: {\n /** Name of the content to be inscribed */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Type of content */\n type?: string;\n };\n}\n\nexport interface InscriptionErrorResponse {\n success: false;\n type: 'error';\n title: string;\n message: string;\n error: {\n /** Error code for programmatic handling */\n code: string;\n /** Detailed error message */\n details: string;\n /** Suggestions for fixing the error */\n suggestions?: string[];\n };\n}\n\nexport type InscriptionResponse =\n | InscriptionSuccessResponse\n | InscriptionQuoteResponse\n | InscriptionErrorResponse;\n\n/**\n * Helper function to create a successful inscription response\n */\nexport function createInscriptionSuccess(params: {\n hrl: string;\n topicId: string;\n standard: 'Static' | 'Dynamic';\n cdnUrl?: string;\n transactionId?: string;\n metadata: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n}): InscriptionSuccessResponse {\n const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;\n\n return {\n success: true,\n type: 'inscription',\n title: `${standard} Hashinal Inscription Complete`,\n message: `Successfully inscribed \"${\n metadata.name || 'your content'\n }\" as a ${standard} Hashinal. The content is now ready for NFT minting.`,\n inscription: {\n hrl,\n topicId,\n standard,\n cdnUrl,\n transactionId,\n },\n metadata,\n nextSteps: {\n primary: 'CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.',\n context:\n 'The metadata parameter for minting should be exactly: [\"' + hrl + '\"] - just the HRL string in an array, nothing else.',\n mintingMetadata: hrl,\n },\n };\n}\n\n/**\n * Block attributes for HashLink rendering\n */\ninterface BlockAttributes {\n /** Display name */\n name?: string;\n /** Description text */\n description?: string;\n /** Image URL */\n image?: string;\n /** Content type */\n contentType?: string;\n /** Size in bytes */\n size?: number;\n /** Custom metadata */\n metadata?: Record<string, string | number | boolean>;\n}\n\n/**\n * Transfer details in cost breakdown\n */\ninterface TransferDetails {\n to: string;\n amount: string;\n description: string;\n}\n\n/**\n * Cost breakdown details for inscription quote\n */\ninterface CostBreakdown {\n transfers: TransferDetails[];\n baseFee?: number;\n sizeFee?: number;\n networkFee?: number;\n serviceFee?: number;\n totalFee?: number;\n currency?: string;\n}\n\n/**\n * Helper function to create a quote response\n */\nexport function createInscriptionQuote(params: {\n totalCostHbar: string;\n validUntil: string;\n breakdown?: CostBreakdown;\n content: {\n name?: string;\n creator?: string;\n type?: string;\n };\n}): InscriptionQuoteResponse {\n const { totalCostHbar, validUntil, breakdown, content } = params;\n\n return {\n success: true,\n type: 'quote',\n title: 'Inscription Cost Quote',\n message: `Estimated cost to inscribe \"${\n content.name || 'your content'\n }\" is ${totalCostHbar} HBAR.`,\n quote: {\n totalCostHbar,\n validUntil,\n breakdown,\n },\n content,\n };\n}\n\n/**\n * Helper function to create an error response\n */\nexport function createInscriptionError(params: {\n code: string;\n details: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { code, details, suggestions } = params;\n\n return {\n success: false,\n type: 'error',\n title: 'Inscription Failed',\n message: `Unable to complete inscription: ${details}`,\n error: {\n code,\n details,\n suggestions,\n },\n };\n}\n\n/**\n * Helper for pending inscription state (submitted but not yet confirmed)\n */\nexport function createInscriptionPending(params: {\n transactionId: string;\n details?: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { transactionId, details, suggestions } = params;\n const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;\n return {\n success: false,\n type: 'error',\n title: 'Inscription Submitted (Pending)',\n message: d,\n error: {\n code: 'INSCRIPTION_PENDING',\n details: d,\n suggestions: suggestions || [\n 'Wait a few moments for confirmation',\n 'Check the transaction status on a Hedera explorer',\n \"Try the inscription again if it doesn't confirm within 5 minutes\",\n ],\n },\n };\n}\n"],"names":[],"mappings":"AAqGO,SAAS,yBAAyB,QAaV;AAC7B,QAAM,EAAE,KAAK,SAAS,UAAU,QAAQ,eAAe,aAAa;AAEpE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO,GAAG,QAAQ;AAAA,IAClB,SAAS,2BACP,SAAS,QAAQ,cACnB,UAAU,QAAQ;AAAA,IAClB,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,MACT,SACE,6DAA6D,MAAM;AAAA,MACrE,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;AA6CO,SAAS,uBAAuB,QASV;AAC3B,QAAM,EAAE,eAAe,YAAY,WAAW,YAAY;AAE1D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,+BACP,QAAQ,QAAQ,cAClB,QAAQ,aAAa;AAAA,IACrB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,EAAA;AAEJ;AAKO,SAAS,uBAAuB,QAIV;AAC3B,QAAM,EAAE,MAAM,SAAS,YAAA,IAAgB;AAEvC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,mCAAmC,OAAO;AAAA,IACnD,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;AAKO,SAAS,yBAAyB,QAIZ;AAC3B,QAAM,EAAE,eAAe,SAAS,YAAA,IAAgB;AAChD,QAAM,IAAI,WAAW,gEAAgE,aAAa;AAClG,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,eAAe;AAAA,QAC1B;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"standards-agent-kit.es55.js","sources":["../../src/utils/metadata-defaults.ts"],"sourcesContent":["/**\n * Generates default metadata for NFT inscription\n */\nexport function generateDefaultMetadata(params: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n fileName?: string;\n mimeType?: string;\n operatorAccount: string;\n}): {\n name: string;\n creator: string;\n description: string;\n type: string;\n image: string;\n} {\n const defaultName = params.fileName?.replace(/\\.[^/.]+$/, '') || 'Hashinal NFT';\n let defaultType = 'media';\n if (params.mimeType?.startsWith('image/')) {\n defaultType = 'image';\n } else if (params.mimeType?.startsWith('video/')) {\n defaultType = 'video';\n } else if (params.mimeType?.startsWith('audio/')) {\n defaultType = 'audio';\n }\n\n return {\n name: params.name || defaultName,\n creator: params.creator || params.operatorAccount,\n description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,\n type: params.type || defaultType,\n image: '',\n };\n}"],"names":[],"mappings":"AAGO,SAAS,wBAAwB,QActC;AACA,QAAM,cAAc,OAAO,UAAU,QAAQ,aAAa,EAAE,KAAK;AACjE,MAAI,cAAc;AAClB,MAAI,OAAO,UAAU,WAAW,QAAQ,GAAG;AACzC,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,MAAM,OAAO,QAAQ;AAAA,IACrB,SAAS,OAAO,WAAW,OAAO;AAAA,IAClC,aAAa,OAAO,eAAe,GAAG,YAAY,OAAO,CAAC,EAAE,YAAA,IAAgB,YAAY,MAAM,CAAC,CAAC;AAAA,IAChG,MAAM,OAAO,QAAQ;AAAA,IACrB,OAAO;AAAA,EAAA;AAEX;"}
@@ -1,7 +1,77 @@
1
- function isWalletBytesResponse(value) {
2
- return !!value && typeof value.transactionBytes === "string";
1
+ function createInscriptionSuccess(params) {
2
+ const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
3
+ return {
4
+ success: true,
5
+ type: "inscription",
6
+ title: `${standard} Hashinal Inscription Complete`,
7
+ message: `Successfully inscribed "${metadata.name || "your content"}" as a ${standard} Hashinal. The content is now ready for NFT minting.`,
8
+ inscription: {
9
+ hrl,
10
+ topicId,
11
+ standard,
12
+ cdnUrl,
13
+ transactionId
14
+ },
15
+ metadata,
16
+ nextSteps: {
17
+ primary: "CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.",
18
+ context: 'The metadata parameter for minting should be exactly: ["' + hrl + '"] - just the HRL string in an array, nothing else.',
19
+ mintingMetadata: hrl
20
+ }
21
+ };
22
+ }
23
+ function createInscriptionQuote(params) {
24
+ const { totalCostHbar, validUntil, breakdown, content } = params;
25
+ return {
26
+ success: true,
27
+ type: "quote",
28
+ title: "Inscription Cost Quote",
29
+ message: `Estimated cost to inscribe "${content.name || "your content"}" is ${totalCostHbar} HBAR.`,
30
+ quote: {
31
+ totalCostHbar,
32
+ validUntil,
33
+ breakdown
34
+ },
35
+ content
36
+ };
37
+ }
38
+ function createInscriptionError(params) {
39
+ const { code, details, suggestions } = params;
40
+ return {
41
+ success: false,
42
+ type: "error",
43
+ title: "Inscription Failed",
44
+ message: `Unable to complete inscription: ${details}`,
45
+ error: {
46
+ code,
47
+ details,
48
+ suggestions
49
+ }
50
+ };
51
+ }
52
+ function createInscriptionPending(params) {
53
+ const { transactionId, details, suggestions } = params;
54
+ const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;
55
+ return {
56
+ success: false,
57
+ type: "error",
58
+ title: "Inscription Submitted (Pending)",
59
+ message: d,
60
+ error: {
61
+ code: "INSCRIPTION_PENDING",
62
+ details: d,
63
+ suggestions: suggestions || [
64
+ "Wait a few moments for confirmation",
65
+ "Check the transaction status on a Hedera explorer",
66
+ "Try the inscription again if it doesn't confirm within 5 minutes"
67
+ ]
68
+ }
69
+ };
3
70
  }
4
71
  export {
5
- isWalletBytesResponse
72
+ createInscriptionError,
73
+ createInscriptionPending,
74
+ createInscriptionQuote,
75
+ createInscriptionSuccess
6
76
  };
7
77
  //# sourceMappingURL=standards-agent-kit.es56.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-agent-kit.es56.js","sources":["../../src/types/tx-results.ts"],"sourcesContent":["import type { TopicRegistrationResponse, RegistryOperationResponse, HCS6TopicRegistrationResponse, HCS6RegistryOperationResponse, HCS6CreateHashinalResponse } from '@hashgraphonline/standards-sdk';\n\nexport interface WalletBytesResponse {\n success: true;\n transactionBytes: string;\n}\n\nexport function isWalletBytesResponse(value: unknown): value is WalletBytesResponse {\n return !!value && typeof (value as any).transactionBytes === 'string';\n}\n\nexport type TopicRegistrationResult = TopicRegistrationResponse | WalletBytesResponse;\nexport type RegistryOperationResult = RegistryOperationResponse | WalletBytesResponse;\nexport type SubmitMessageResult = { success: true; transactionId?: string } | WalletBytesResponse;\n\nexport type HCS6TopicRegistrationResult = HCS6TopicRegistrationResponse | WalletBytesResponse;\nexport type HCS6RegistryOperationResult = HCS6RegistryOperationResponse | WalletBytesResponse;\nexport type HCS6CreateHashinalResult = HCS6CreateHashinalResponse | WalletBytesResponse;\n"],"names":[],"mappings":"AAOO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,CAAC,CAAC,SAAS,OAAQ,MAAc,qBAAqB;AAC/D;"}
1
+ {"version":3,"file":"standards-agent-kit.es56.js","sources":["../../src/types/inscription-response.ts"],"sourcesContent":["/**\n * Structured response interface for inscription tools\n * Provides a consistent, user-friendly format for inscription results\n */\n\nexport interface InscriptionSuccessResponse {\n success: true;\n type: 'inscription';\n title: string;\n message: string;\n inscription: {\n /** The HRL (Hashinal Reference Link) for minting - e.g., \"hcs://1/0.0.123456\" */\n hrl: string;\n /** Topic ID where the inscription was stored */\n topicId: string;\n /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */\n standard: 'Static' | 'Dynamic';\n /** CDN URL for direct access to the inscribed content */\n cdnUrl?: string;\n /** Transaction ID of the inscription */\n transactionId?: string;\n };\n metadata: {\n /** Name/title of the inscribed content */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Description of the content */\n description?: string;\n /** Content type (image, text, etc.) */\n type?: string;\n /** Additional attributes */\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n nextSteps: {\n /** Primary action the user should take next */\n primary: string;\n /** Additional context or options */\n context?: string;\n /** Specific metadata value to use for minting */\n mintingMetadata: string;\n };\n /** HashLink block data (only present when withHashLinkBlocks=true) */\n hashLinkBlock?: {\n /** Block topic ID on HCS */\n blockId: string;\n /** HashLink reference to the block */\n hashLink: string;\n /** Template topic ID */\n template: string;\n /** Block attributes for rendering */\n attributes: BlockAttributes;\n };\n}\n\nexport interface InscriptionQuoteResponse {\n success: true;\n type: 'quote';\n title: string;\n message: string;\n quote: {\n /** Total cost in HBAR */\n totalCostHbar: string;\n /** When the quote expires */\n validUntil: string;\n /** Cost breakdown details */\n breakdown?: CostBreakdown;\n };\n content: {\n /** Name of the content to be inscribed */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Type of content */\n type?: string;\n };\n}\n\nexport interface InscriptionErrorResponse {\n success: false;\n type: 'error';\n title: string;\n message: string;\n error: {\n /** Error code for programmatic handling */\n code: string;\n /** Detailed error message */\n details: string;\n /** Suggestions for fixing the error */\n suggestions?: string[];\n };\n}\n\nexport type InscriptionResponse =\n | InscriptionSuccessResponse\n | InscriptionQuoteResponse\n | InscriptionErrorResponse;\n\n/**\n * Helper function to create a successful inscription response\n */\nexport function createInscriptionSuccess(params: {\n hrl: string;\n topicId: string;\n standard: 'Static' | 'Dynamic';\n cdnUrl?: string;\n transactionId?: string;\n metadata: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n}): InscriptionSuccessResponse {\n const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;\n\n return {\n success: true,\n type: 'inscription',\n title: `${standard} Hashinal Inscription Complete`,\n message: `Successfully inscribed \"${\n metadata.name || 'your content'\n }\" as a ${standard} Hashinal. The content is now ready for NFT minting.`,\n inscription: {\n hrl,\n topicId,\n standard,\n cdnUrl,\n transactionId,\n },\n metadata,\n nextSteps: {\n primary: 'CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.',\n context:\n 'The metadata parameter for minting should be exactly: [\"' + hrl + '\"] - just the HRL string in an array, nothing else.',\n mintingMetadata: hrl,\n },\n };\n}\n\n/**\n * Block attributes for HashLink rendering\n */\ninterface BlockAttributes {\n /** Display name */\n name?: string;\n /** Description text */\n description?: string;\n /** Image URL */\n image?: string;\n /** Content type */\n contentType?: string;\n /** Size in bytes */\n size?: number;\n /** Custom metadata */\n metadata?: Record<string, string | number | boolean>;\n}\n\n/**\n * Transfer details in cost breakdown\n */\ninterface TransferDetails {\n to: string;\n amount: string;\n description: string;\n}\n\n/**\n * Cost breakdown details for inscription quote\n */\ninterface CostBreakdown {\n transfers: TransferDetails[];\n baseFee?: number;\n sizeFee?: number;\n networkFee?: number;\n serviceFee?: number;\n totalFee?: number;\n currency?: string;\n}\n\n/**\n * Helper function to create a quote response\n */\nexport function createInscriptionQuote(params: {\n totalCostHbar: string;\n validUntil: string;\n breakdown?: CostBreakdown;\n content: {\n name?: string;\n creator?: string;\n type?: string;\n };\n}): InscriptionQuoteResponse {\n const { totalCostHbar, validUntil, breakdown, content } = params;\n\n return {\n success: true,\n type: 'quote',\n title: 'Inscription Cost Quote',\n message: `Estimated cost to inscribe \"${\n content.name || 'your content'\n }\" is ${totalCostHbar} HBAR.`,\n quote: {\n totalCostHbar,\n validUntil,\n breakdown,\n },\n content,\n };\n}\n\n/**\n * Helper function to create an error response\n */\nexport function createInscriptionError(params: {\n code: string;\n details: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { code, details, suggestions } = params;\n\n return {\n success: false,\n type: 'error',\n title: 'Inscription Failed',\n message: `Unable to complete inscription: ${details}`,\n error: {\n code,\n details,\n suggestions,\n },\n };\n}\n\n/**\n * Helper for pending inscription state (submitted but not yet confirmed)\n */\nexport function createInscriptionPending(params: {\n transactionId: string;\n details?: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { transactionId, details, suggestions } = params;\n const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;\n return {\n success: false,\n type: 'error',\n title: 'Inscription Submitted (Pending)',\n message: d,\n error: {\n code: 'INSCRIPTION_PENDING',\n details: d,\n suggestions: suggestions || [\n 'Wait a few moments for confirmation',\n 'Check the transaction status on a Hedera explorer',\n \"Try the inscription again if it doesn't confirm within 5 minutes\",\n ],\n },\n };\n}\n"],"names":[],"mappings":"AAqGO,SAAS,yBAAyB,QAaV;AAC7B,QAAM,EAAE,KAAK,SAAS,UAAU,QAAQ,eAAe,aAAa;AAEpE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO,GAAG,QAAQ;AAAA,IAClB,SAAS,2BACP,SAAS,QAAQ,cACnB,UAAU,QAAQ;AAAA,IAClB,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,MACT,SACE,6DAA6D,MAAM;AAAA,MACrE,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;AA6CO,SAAS,uBAAuB,QASV;AAC3B,QAAM,EAAE,eAAe,YAAY,WAAW,YAAY;AAE1D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,+BACP,QAAQ,QAAQ,cAClB,QAAQ,aAAa;AAAA,IACrB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,EAAA;AAEJ;AAKO,SAAS,uBAAuB,QAIV;AAC3B,QAAM,EAAE,MAAM,SAAS,YAAA,IAAgB;AAEvC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,mCAAmC,OAAO;AAAA,IACnD,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;AAKO,SAAS,yBAAyB,QAIZ;AAC3B,QAAM,EAAE,eAAe,SAAS,YAAA,IAAgB;AAChD,QAAM,IAAI,WAAW,gEAAgE,aAAa;AAClG,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,eAAe;AAAA,QAC1B;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
@@ -67,14 +67,14 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool impleme
67
67
  * const testnetClient = Client.forTestnet();
68
68
  * const tool = new InscribeHashinalTool(testnetClient);
69
69
  * const block = await tool.createHashLinkBlock(inscriptionResponse);
70
- * console.log(block.blockId); // '0.0.6617393'
71
- * console.log(block.hashLink); // 'hcs://12/0.0.6617393'
70
+ * const id = block.blockId; // '0.0.6617393'
71
+ * const link = block.hashLink; // 'hcs://12/0.0.6617393'
72
72
  *
73
73
  * // Mainnet usage (automatic detection from client)
74
74
  * const mainnetClient = Client.forMainnet();
75
75
  * const tool = new InscribeHashinalTool(mainnetClient);
76
76
  * const block = await tool.createHashLinkBlock(inscriptionResponse);
77
- * console.log(block.blockId); // Network-specific mainnet block ID
77
+ * const mainnetId = block.blockId; // Network-specific mainnet block ID
78
78
  *
79
79
  * // HashLink Block Response Structure:
80
80
  * {