@hashgraphonline/standards-agent-kit 0.2.153 → 0.2.155
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/es/standards-agent-kit.es24.js +1 -1
- package/dist/es/standards-agent-kit.es25.js +1 -1
- package/dist/es/standards-agent-kit.es26.js +1 -1
- package/dist/es/standards-agent-kit.es27.js +1 -1
- package/dist/es/standards-agent-kit.es28.js +1 -1
- package/dist/es/standards-agent-kit.es31.js +1 -1
- package/dist/es/standards-agent-kit.es32.js +1 -1
- package/dist/es/standards-agent-kit.es33.js +1 -1
- package/dist/es/standards-agent-kit.es36.js +1 -1
- package/dist/es/standards-agent-kit.es37.js +1 -1
- package/dist/es/standards-agent-kit.es38.js +3 -3
- package/dist/es/standards-agent-kit.es39.js +6 -6
- package/dist/es/standards-agent-kit.es39.js.map +1 -1
- package/dist/es/standards-agent-kit.es50.js +20 -3
- package/dist/es/standards-agent-kit.es50.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +50 -17
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/standards-agent-kit.es52.js +3 -54
- package/dist/es/standards-agent-kit.es52.js.map +1 -1
- package/dist/es/standards-agent-kit.es53.js +39 -2
- package/dist/es/standards-agent-kit.es53.js.map +1 -1
- package/dist/es/standards-agent-kit.es54.js +17 -38
- package/dist/es/standards-agent-kit.es54.js.map +1 -1
- package/dist/es/standards-agent-kit.es55.js +71 -16
- package/dist/es/standards-agent-kit.es55.js.map +1 -1
- package/dist/es/standards-agent-kit.es56.js +3 -73
- package/dist/es/standards-agent-kit.es56.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +55 -21
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/builders/inscriber/inscriber-builder.ts +61 -25
- package/src/tools/inscriber/InscribeHashinalTool.ts +2 -1
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.155",
|
|
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",
|
|
@@ -323,39 +323,75 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
323
323
|
const intervalMs =
|
|
324
324
|
(options as { waitIntervalMs?: number }).waitIntervalMs ?? 5000;
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
const sdk = await this.getInscriptionSDK(options);
|
|
327
|
+
if (sdk) {
|
|
327
328
|
try {
|
|
328
329
|
const retrieved: RetrievedInscriptionResult =
|
|
329
|
-
await
|
|
330
|
+
await sdk.waitForInscription(
|
|
331
|
+
transactionId,
|
|
332
|
+
maxAttempts,
|
|
333
|
+
intervalMs,
|
|
334
|
+
true
|
|
335
|
+
);
|
|
330
336
|
const topicIdFromInscription: string | undefined = getTopicId(
|
|
331
337
|
retrieved as unknown
|
|
332
338
|
);
|
|
333
339
|
const topicId: string | undefined =
|
|
334
340
|
topicIdFromInscription ?? startResponse.topic_id;
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
341
|
+
const resultConfirmed: InscriptionResponse = {
|
|
342
|
+
quote: false,
|
|
343
|
+
confirmed: true,
|
|
344
|
+
result: {
|
|
345
|
+
jobId: startResponse.tx_id || '',
|
|
346
|
+
transactionId,
|
|
347
|
+
topicId,
|
|
348
|
+
},
|
|
349
|
+
inscription: retrieved,
|
|
350
|
+
} as unknown as InscriptionResponse;
|
|
351
|
+
this.logger.debug(
|
|
352
|
+
'retrieved inscription',
|
|
353
|
+
resultConfirmed,
|
|
354
|
+
retrieved
|
|
355
|
+
);
|
|
356
|
+
return resultConfirmed;
|
|
357
|
+
} catch (error) {
|
|
358
|
+
this.logger.error('Failed to wait for inscription', error);
|
|
359
|
+
}
|
|
360
|
+
} else {
|
|
361
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
362
|
+
try {
|
|
363
|
+
const retrieved: RetrievedInscriptionResult =
|
|
364
|
+
await this.retrieveInscription(transactionId, options);
|
|
365
|
+
const topicIdFromInscription: string | undefined = getTopicId(
|
|
366
|
+
retrieved as unknown
|
|
354
367
|
);
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
368
|
+
const topicId: string | undefined =
|
|
369
|
+
topicIdFromInscription ?? startResponse.topic_id;
|
|
370
|
+
const status: string | undefined = (
|
|
371
|
+
retrieved as { status?: string }
|
|
372
|
+
).status;
|
|
373
|
+
const isDone = status === 'completed' || !!topicId;
|
|
374
|
+
if (isDone) {
|
|
375
|
+
const resultConfirmed: InscriptionResponse = {
|
|
376
|
+
quote: false,
|
|
377
|
+
confirmed: true,
|
|
378
|
+
result: {
|
|
379
|
+
jobId: startResponse.tx_id || '',
|
|
380
|
+
transactionId,
|
|
381
|
+
topicId,
|
|
382
|
+
},
|
|
383
|
+
inscription: retrieved,
|
|
384
|
+
} as unknown as InscriptionResponse;
|
|
385
|
+
this.logger.debug(
|
|
386
|
+
'retrieved inscription',
|
|
387
|
+
resultConfirmed,
|
|
388
|
+
retrieved
|
|
389
|
+
);
|
|
390
|
+
return resultConfirmed;
|
|
391
|
+
}
|
|
392
|
+
} catch {}
|
|
393
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
394
|
+
}
|
|
359
395
|
}
|
|
360
396
|
}
|
|
361
397
|
|
|
@@ -161,7 +161,8 @@ const inscribeHashinalSchema = extendZodSchema(
|
|
|
161
161
|
waitForConfirmation: z
|
|
162
162
|
.boolean()
|
|
163
163
|
.optional()
|
|
164
|
-
.describe('Whether to wait for inscription confirmation')
|
|
164
|
+
.describe('Whether to wait for inscription confirmation')
|
|
165
|
+
.default(true),
|
|
165
166
|
timeoutMs: z
|
|
166
167
|
.number()
|
|
167
168
|
.int()
|