@hashgraphonline/standards-agent-kit 0.2.149 → 0.2.152
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/types/inscription-response.d.ts +0 -5
- package/dist/cjs/utils/inscription-utils.d.ts +1 -1
- package/dist/es/standards-agent-kit.es39.js +1 -3
- package/dist/es/standards-agent-kit.es39.js.map +1 -1
- package/dist/es/standards-agent-kit.es48.js +3 -7
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +7 -3
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es50.js +1 -1
- package/dist/es/standards-agent-kit.es50.js.map +1 -1
- package/dist/es/standards-agent-kit.es55.js +1 -11
- package/dist/es/standards-agent-kit.es55.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +1 -1
- package/dist/es/standards-agent-kit.es7.js +1 -1
- package/dist/es/standards-agent-kit.es8.js +10 -0
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +1 -1
- package/dist/es/types/inscription-response.d.ts +0 -5
- package/dist/es/utils/inscription-utils.d.ts +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/types/inscription-response.d.ts +0 -5
- package/dist/umd/utils/inscription-utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/builders/inscriber/inscriber-builder.ts +10 -0
- package/src/tools/inscriber/InscribeHashinalTool.ts +1 -4
- package/src/types/inscription-response.ts +1 -16
- package/src/utils/inscription-utils.ts +2 -4
|
@@ -12,8 +12,6 @@ export interface InscriptionSuccessResponse {
|
|
|
12
12
|
hrl: string;
|
|
13
13
|
/** Topic ID where the inscription was stored */
|
|
14
14
|
topicId: string;
|
|
15
|
-
/** Topic ID containing the JSON metadata when available */
|
|
16
|
-
jsonTopicId?: string;
|
|
17
15
|
/** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */
|
|
18
16
|
standard: 'Static' | 'Dynamic';
|
|
19
17
|
/** CDN URL for direct access to the inscribed content */
|
|
@@ -21,8 +19,6 @@ export interface InscriptionSuccessResponse {
|
|
|
21
19
|
/** Transaction ID of the inscription */
|
|
22
20
|
transactionId?: string;
|
|
23
21
|
};
|
|
24
|
-
/** Topic ID used for metadata lookups */
|
|
25
|
-
jsonTopicId?: string;
|
|
26
22
|
metadata: {
|
|
27
23
|
/** Name/title of the inscribed content */
|
|
28
24
|
name?: string;
|
|
@@ -101,7 +97,6 @@ export type InscriptionResponse = InscriptionSuccessResponse | InscriptionQuoteR
|
|
|
101
97
|
export declare function createInscriptionSuccess(params: {
|
|
102
98
|
hrl: string;
|
|
103
99
|
topicId: string;
|
|
104
|
-
jsonTopicId?: string;
|
|
105
100
|
standard: 'Static' | 'Dynamic';
|
|
106
101
|
cdnUrl?: string;
|
|
107
102
|
transactionId?: string;
|
|
@@ -9,7 +9,7 @@ export interface TopicIds {
|
|
|
9
9
|
* - Prefers jsonTopicId when present (for CDN linking)
|
|
10
10
|
* - Collects topic_id/topicId from either inscription or result
|
|
11
11
|
*/
|
|
12
|
-
export declare function extractTopicIds(inscription
|
|
12
|
+
export declare function extractTopicIds(inscription: RetrievedInscriptionResult, result?: unknown): TopicIds;
|
|
13
13
|
/**
|
|
14
14
|
* Build HRL/CDN URLs from extracted topic ids.
|
|
15
15
|
* - HRL prefers jsonTopicId, falls back to topicId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-agent-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.152",
|
|
4
4
|
"description": "A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/standards-agent-kit.cjs",
|
|
@@ -282,6 +282,10 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
282
282
|
result?: unknown;
|
|
283
283
|
inscription?: unknown;
|
|
284
284
|
};
|
|
285
|
+
this.logger.info(
|
|
286
|
+
'inscription already completed, short circuiting',
|
|
287
|
+
start
|
|
288
|
+
);
|
|
285
289
|
return {
|
|
286
290
|
quote: false,
|
|
287
291
|
confirmed: completed.confirmed === true,
|
|
@@ -313,6 +317,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
313
317
|
? false
|
|
314
318
|
: options.waitForConfirmation ?? true;
|
|
315
319
|
if (shouldWait) {
|
|
320
|
+
this.logger.debug('Will be retrieving inscription');
|
|
316
321
|
const maxAttempts =
|
|
317
322
|
(options as { waitMaxAttempts?: number }).waitMaxAttempts ?? 60;
|
|
318
323
|
const intervalMs =
|
|
@@ -342,6 +347,11 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
342
347
|
},
|
|
343
348
|
inscription: retrieved,
|
|
344
349
|
} as unknown as InscriptionResponse;
|
|
350
|
+
this.logger.debug(
|
|
351
|
+
'retrieved inscription',
|
|
352
|
+
resultConfirmed,
|
|
353
|
+
retrieved
|
|
354
|
+
);
|
|
345
355
|
return resultConfirmed;
|
|
346
356
|
}
|
|
347
357
|
} catch {}
|
|
@@ -546,12 +546,10 @@ export class InscribeHashinalTool
|
|
|
546
546
|
fileStandard
|
|
547
547
|
);
|
|
548
548
|
|
|
549
|
-
const txId =
|
|
550
|
-
(result.result as InscriptionResult)?.transactionId ?? 'unknown';
|
|
549
|
+
const txId = result?.inscription?.tx_id ?? 'unknown';
|
|
551
550
|
const successResponse = createInscriptionSuccess({
|
|
552
551
|
hrl: hrl || 'hcs://1/unknown',
|
|
553
552
|
topicId: topicId || 'unknown',
|
|
554
|
-
jsonTopicId: ids.jsonTopicId,
|
|
555
553
|
standard: fileStandard === '6' ? 'Dynamic' : 'Static',
|
|
556
554
|
cdnUrl,
|
|
557
555
|
transactionId: txId,
|
|
@@ -681,7 +679,6 @@ export class InscribeHashinalTool
|
|
|
681
679
|
name: response.metadata.name || 'Untitled Content',
|
|
682
680
|
creator: response.metadata.creator || '',
|
|
683
681
|
topicId: response.inscription.topicId,
|
|
684
|
-
jsonTopicId: response.inscription.jsonTopicId || response.jsonTopicId,
|
|
685
682
|
hrl: response.inscription.hrl,
|
|
686
683
|
network: network,
|
|
687
684
|
},
|
|
@@ -13,8 +13,6 @@ export interface InscriptionSuccessResponse {
|
|
|
13
13
|
hrl: string;
|
|
14
14
|
/** Topic ID where the inscription was stored */
|
|
15
15
|
topicId: string;
|
|
16
|
-
/** Topic ID containing the JSON metadata when available */
|
|
17
|
-
jsonTopicId?: string;
|
|
18
16
|
/** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */
|
|
19
17
|
standard: 'Static' | 'Dynamic';
|
|
20
18
|
/** CDN URL for direct access to the inscribed content */
|
|
@@ -22,8 +20,6 @@ export interface InscriptionSuccessResponse {
|
|
|
22
20
|
/** Transaction ID of the inscription */
|
|
23
21
|
transactionId?: string;
|
|
24
22
|
};
|
|
25
|
-
/** Topic ID used for metadata lookups */
|
|
26
|
-
jsonTopicId?: string;
|
|
27
23
|
metadata: {
|
|
28
24
|
/** Name/title of the inscribed content */
|
|
29
25
|
name?: string;
|
|
@@ -106,7 +102,6 @@ export type InscriptionResponse =
|
|
|
106
102
|
export function createInscriptionSuccess(params: {
|
|
107
103
|
hrl: string;
|
|
108
104
|
topicId: string;
|
|
109
|
-
jsonTopicId?: string;
|
|
110
105
|
standard: 'Static' | 'Dynamic';
|
|
111
106
|
cdnUrl?: string;
|
|
112
107
|
transactionId?: string;
|
|
@@ -118,15 +113,7 @@ export function createInscriptionSuccess(params: {
|
|
|
118
113
|
attributes?: Array<{ trait_type: string; value: string | number }>;
|
|
119
114
|
};
|
|
120
115
|
}): InscriptionSuccessResponse {
|
|
121
|
-
const {
|
|
122
|
-
hrl,
|
|
123
|
-
topicId,
|
|
124
|
-
jsonTopicId,
|
|
125
|
-
standard,
|
|
126
|
-
cdnUrl,
|
|
127
|
-
transactionId,
|
|
128
|
-
metadata,
|
|
129
|
-
} = params;
|
|
116
|
+
const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
|
|
130
117
|
|
|
131
118
|
return {
|
|
132
119
|
success: true,
|
|
@@ -138,12 +125,10 @@ export function createInscriptionSuccess(params: {
|
|
|
138
125
|
inscription: {
|
|
139
126
|
hrl,
|
|
140
127
|
topicId,
|
|
141
|
-
jsonTopicId,
|
|
142
128
|
standard,
|
|
143
129
|
cdnUrl,
|
|
144
130
|
transactionId,
|
|
145
131
|
},
|
|
146
|
-
jsonTopicId,
|
|
147
132
|
metadata,
|
|
148
133
|
nextSteps: {
|
|
149
134
|
primary: 'CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.',
|
|
@@ -19,13 +19,11 @@ function getStringProp(obj: unknown, key: string): string | undefined {
|
|
|
19
19
|
* - Collects topic_id/topicId from either inscription or result
|
|
20
20
|
*/
|
|
21
21
|
export function extractTopicIds(
|
|
22
|
-
inscription
|
|
22
|
+
inscription: RetrievedInscriptionResult,
|
|
23
23
|
result?: unknown
|
|
24
24
|
): TopicIds {
|
|
25
25
|
const jsonTopicId =
|
|
26
|
-
inscription
|
|
27
|
-
getStringProp(inscription, 'json_topic_id') ||
|
|
28
|
-
getStringProp(result, 'jsonTopicId');
|
|
26
|
+
inscription.jsonTopicId || getStringProp(inscription, 'json_topic_id');
|
|
29
27
|
|
|
30
28
|
const imageTopicId =
|
|
31
29
|
getStringProp(inscription, 'topic_id') ||
|