@hashgraphonline/standards-agent-kit 0.2.135 → 0.2.137
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/README.md +3 -4
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/cjs/interfaces/FormValidatable.d.ts +4 -13
- 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 +2 -10
- package/dist/cjs/types/inscription-response.d.ts +8 -0
- package/dist/cjs/utils/inscription-utils.d.ts +21 -0
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/es/interfaces/FormValidatable.d.ts +4 -13
- package/dist/es/standards-agent-kit.es3.js +4 -0
- package/dist/es/standards-agent-kit.es3.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +12 -6
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +5 -4
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +13 -9
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +32 -48
- package/dist/es/standards-agent-kit.es37.js.map +1 -1
- package/dist/es/standards-agent-kit.es38.js +9 -10
- package/dist/es/standards-agent-kit.es38.js.map +1 -1
- package/dist/es/standards-agent-kit.es44.js +1 -1
- package/dist/es/standards-agent-kit.es44.js.map +1 -1
- package/dist/es/standards-agent-kit.es47.js +17 -50
- package/dist/es/standards-agent-kit.es47.js.map +1 -1
- package/dist/es/standards-agent-kit.es48.js +54 -3
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +2 -39
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es50.js +38 -17
- package/dist/es/standards-agent-kit.es50.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +16 -51
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/standards-agent-kit.es52.js +77 -0
- package/dist/es/standards-agent-kit.es52.js.map +1 -0
- package/dist/es/standards-agent-kit.es6.js +160 -4
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +2 -10
- package/dist/es/types/inscription-response.d.ts +8 -0
- package/dist/es/utils/inscription-utils.d.ts +21 -0
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/umd/interfaces/FormValidatable.d.ts +4 -13
- 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 +2 -10
- package/dist/umd/types/inscription-response.d.ts +8 -0
- package/dist/umd/utils/inscription-utils.d.ts +21 -0
- package/package.json +9 -4
- package/src/builders/hcs10/hcs10-builder.ts +4 -0
- package/src/builders/inscriber/inscriber-builder.ts +235 -2
- package/src/interfaces/FormValidatable.ts +9 -12
- package/src/tools/inscriber/InscribeFromBufferTool.ts +48 -19
- package/src/tools/inscriber/InscribeFromFileTool.ts +10 -13
- package/src/tools/inscriber/InscribeFromUrlTool.ts +15 -11
- package/src/tools/inscriber/InscribeHashinalTool.ts +42 -90
- package/src/tools/inscriber/RetrieveInscriptionTool.ts +15 -16
- package/src/types/inscription-response.ts +27 -0
- package/src/utils/inscription-utils.ts +53 -0
|
@@ -15,7 +15,9 @@ declare const inscribeHashinalSchema: import('../..').ZodSchemaWithRender<{
|
|
|
15
15
|
creator?: string | undefined;
|
|
16
16
|
properties?: Record<string, unknown> | undefined;
|
|
17
17
|
mimeType?: string | undefined;
|
|
18
|
+
fileStandard?: "1" | "6" | undefined;
|
|
18
19
|
chunkSize?: number | undefined;
|
|
20
|
+
jsonFileURL?: string | undefined;
|
|
19
21
|
waitForConfirmation?: boolean | undefined;
|
|
20
22
|
timeoutMs?: number | undefined;
|
|
21
23
|
quoteOnly?: boolean | undefined;
|
|
@@ -26,8 +28,6 @@ declare const inscribeHashinalSchema: import('../..').ZodSchemaWithRender<{
|
|
|
26
28
|
trait_type: string;
|
|
27
29
|
}[] | undefined;
|
|
28
30
|
contentRef?: string | undefined;
|
|
29
|
-
jsonFileURL?: string | undefined;
|
|
30
|
-
fileStandard?: "1" | "6" | undefined;
|
|
31
31
|
withHashLinkBlocks?: boolean | undefined;
|
|
32
32
|
renderForm?: boolean | undefined;
|
|
33
33
|
}>;
|
|
@@ -51,14 +51,6 @@ export declare class InscribeHashinalTool extends BaseInscriberQueryTool impleme
|
|
|
51
51
|
* Returns the focused schema for form generation
|
|
52
52
|
*/
|
|
53
53
|
getFormSchema(): z.ZodObject<z.ZodRawShape>;
|
|
54
|
-
/**
|
|
55
|
-
* Implementation of FormValidatable interface
|
|
56
|
-
* Validates metadata quality and provides detailed feedback
|
|
57
|
-
*/
|
|
58
|
-
validateMetadataQuality(input: unknown): {
|
|
59
|
-
needsForm: boolean;
|
|
60
|
-
reason: string;
|
|
61
|
-
};
|
|
62
54
|
protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<InscriptionResponse>;
|
|
63
55
|
/**
|
|
64
56
|
* Creates HashLink block configuration for Hashinal inscriptions.
|
|
@@ -169,4 +169,12 @@ export declare function createInscriptionError(params: {
|
|
|
169
169
|
details: string;
|
|
170
170
|
suggestions?: string[];
|
|
171
171
|
}): InscriptionErrorResponse;
|
|
172
|
+
/**
|
|
173
|
+
* Helper for pending inscription state (submitted but not yet confirmed)
|
|
174
|
+
*/
|
|
175
|
+
export declare function createInscriptionPending(params: {
|
|
176
|
+
transactionId: string;
|
|
177
|
+
details?: string;
|
|
178
|
+
suggestions?: string[];
|
|
179
|
+
}): InscriptionErrorResponse;
|
|
172
180
|
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type NetworkType = 'mainnet' | 'testnet';
|
|
2
|
+
export interface TopicIds {
|
|
3
|
+
jsonTopicId?: string;
|
|
4
|
+
topicId?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Extract topic ids from an inscription and/or result object without using any.
|
|
8
|
+
* - Prefers jsonTopicId when present (for CDN linking)
|
|
9
|
+
* - Collects topic_id/topicId from either inscription or result
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractTopicIds(inscription: unknown, result?: unknown): TopicIds;
|
|
12
|
+
/**
|
|
13
|
+
* Build HRL/CDN URLs from extracted topic ids.
|
|
14
|
+
* - HRL prefers jsonTopicId, falls back to topicId
|
|
15
|
+
* - CDN URL only provided when jsonTopicId is present
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildInscriptionLinks(ids: TopicIds, network: NetworkType, fileStandard?: string): {
|
|
18
|
+
hrl?: string;
|
|
19
|
+
cdnUrl?: string;
|
|
20
|
+
topicId?: string;
|
|
21
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseServiceBuilder, HederaAgentKit } from 'hedera-agent-kit';
|
|
1
|
+
import { BaseServiceBuilder, HederaAgentKit, AgentOperationalMode } from 'hedera-agent-kit';
|
|
2
2
|
import { InscriptionInput, InscriptionOptions, InscriptionResponse, RetrievedInscriptionResult } from '@hashgraphonline/standards-sdk';
|
|
3
3
|
import { InscriptionSDK } from '@kiloscribe/inscription-sdk';
|
|
4
4
|
/**
|
|
@@ -15,7 +15,37 @@ interface DAppSigner {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class InscriberBuilder extends BaseServiceBuilder {
|
|
17
17
|
protected inscriptionSDK?: InscriptionSDK;
|
|
18
|
+
private static signerProvider?;
|
|
19
|
+
private static walletInfoResolver?;
|
|
20
|
+
private static startInscriptionDelegate?;
|
|
21
|
+
private static walletExecutor?;
|
|
22
|
+
/** When true, do not allow server fallback; require a wallet path in Provide Bytes */
|
|
23
|
+
private static preferWalletOnly;
|
|
18
24
|
constructor(hederaKit: HederaAgentKit);
|
|
25
|
+
getOperationalMode(): AgentOperationalMode;
|
|
26
|
+
static setSignerProvider(provider: () => Promise<DAppSigner | null> | DAppSigner | null): void;
|
|
27
|
+
static setWalletInfoResolver(resolver: () => Promise<{
|
|
28
|
+
accountId: string;
|
|
29
|
+
network: 'mainnet' | 'testnet';
|
|
30
|
+
} | null> | {
|
|
31
|
+
accountId: string;
|
|
32
|
+
network: 'mainnet' | 'testnet';
|
|
33
|
+
} | null): void;
|
|
34
|
+
static setStartInscriptionDelegate(delegate: (request: Record<string, unknown>, network: 'mainnet' | 'testnet') => Promise<{
|
|
35
|
+
transactionBytes: string;
|
|
36
|
+
tx_id?: string;
|
|
37
|
+
topic_id?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
completed?: boolean;
|
|
40
|
+
}>): void;
|
|
41
|
+
static setWalletExecutor(executor: (base64: string, network: 'mainnet' | 'testnet') => Promise<{
|
|
42
|
+
transactionId: string;
|
|
43
|
+
}>): void;
|
|
44
|
+
/**
|
|
45
|
+
* Control fallback behavior. When true, wallet must be available for execution paths.
|
|
46
|
+
*/
|
|
47
|
+
static setPreferWalletOnly(flag: boolean): void;
|
|
48
|
+
getSigner(): Promise<DAppSigner | null>;
|
|
19
49
|
/**
|
|
20
50
|
* Get or create Inscription SDK - temporarily returns null since we don't have the actual SDK
|
|
21
51
|
*/
|
|
@@ -28,6 +58,7 @@ export declare class InscriberBuilder extends BaseServiceBuilder {
|
|
|
28
58
|
* Inscribe content using a DApp signer
|
|
29
59
|
*/
|
|
30
60
|
inscribeWithSigner(input: InscriptionInput, signer: DAppSigner, options: InscriptionOptions): Promise<InscriptionResponse>;
|
|
61
|
+
inscribeAuto(input: InscriptionInput, options: InscriptionOptions): Promise<InscriptionResponse>;
|
|
31
62
|
/**
|
|
32
63
|
* Retrieve an existing inscription
|
|
33
64
|
*/
|
|
@@ -16,28 +16,19 @@ export interface FormValidatable {
|
|
|
16
16
|
*/
|
|
17
17
|
getFormSchema(): z.ZodSchema;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param input The input data to analyze
|
|
21
|
-
* @returns Object indicating if form is needed and the reason
|
|
22
|
-
*/
|
|
23
|
-
validateMetadataQuality?(input: unknown): {
|
|
24
|
-
needsForm: boolean;
|
|
25
|
-
reason: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Optional method to define which fields are essential for this tool
|
|
19
|
+
* Defines which fields are essential for this tool
|
|
29
20
|
* Essential fields are always shown in forms even if marked as optional
|
|
30
21
|
* @returns Array of field names that are essential for user experience
|
|
31
22
|
*/
|
|
32
|
-
getEssentialFields
|
|
23
|
+
getEssentialFields(): string[];
|
|
33
24
|
/**
|
|
34
|
-
*
|
|
25
|
+
* Determines if a field value should be considered empty
|
|
35
26
|
* Allows tools to define custom empty logic for their specific data types
|
|
36
27
|
* @param fieldName The name of the field
|
|
37
28
|
* @param value The value to check
|
|
38
29
|
* @returns true if the field should be considered empty
|
|
39
30
|
*/
|
|
40
|
-
isFieldEmpty
|
|
31
|
+
isFieldEmpty(fieldName: string, value: unknown): boolean;
|
|
41
32
|
}
|
|
42
33
|
/**
|
|
43
34
|
* Type guard to check if a tool implements FormValidatable
|
|
@@ -7,6 +7,10 @@ const NOT_INITIALIZED_ERROR = "ConnectionsManager not initialized";
|
|
|
7
7
|
class HCS10Builder extends BaseServiceBuilder {
|
|
8
8
|
constructor(hederaKit, stateManager, options) {
|
|
9
9
|
super(hederaKit);
|
|
10
|
+
const isBytesMode = String(this.hederaKit.operationalMode || "returnBytes") === "returnBytes";
|
|
11
|
+
if (isBytesMode) {
|
|
12
|
+
throw new Error("HCS10Builder is not available in returnBytes mode (no local operator key). Use BrowserHCSClient with a wallet signer in the renderer.");
|
|
13
|
+
}
|
|
10
14
|
this.stateManager = stateManager;
|
|
11
15
|
const network = this.hederaKit.client.network;
|
|
12
16
|
this.network = network.toString().includes("mainnet") ? "mainnet" : "testnet";
|