@hashgraphonline/standards-agent-kit 0.2.134 → 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/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +1 -0
- package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +19 -0
- package/dist/es/standards-agent-kit.es33.js +12 -0
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +2 -2
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +2 -2
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +25 -8
- package/dist/es/standards-agent-kit.es37.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +2 -2
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +1 -0
- package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +19 -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/InscribeHashinalTool.d.ts +1 -0
- package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +19 -0
- package/package.json +2 -2
- package/src/tools/inscriber/InscribeFromBufferTool.ts +2 -2
- package/src/tools/inscriber/InscribeFromUrlTool.ts +2 -2
- package/src/tools/inscriber/InscribeHashinalTool.ts +43 -21
- package/src/tools/inscriber/base-inscriber-tools.ts +26 -0
- package/src/types/inscription-response.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es51.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: '
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es51.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"],"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;"}
|
|
@@ -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>;
|
|
@@ -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
|