@hashgraphonline/standards-agent-kit 0.2.145 → 0.2.147
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/builders/inscriber/inscriber-builder.d.ts +15 -1
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/utils/inscription-utils.d.ts +1 -1
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +15 -1
- package/dist/es/standards-agent-kit.es41.js +1 -1
- package/dist/es/standards-agent-kit.es42.js +1 -1
- package/dist/es/standards-agent-kit.es47.js +24 -3
- package/dist/es/standards-agent-kit.es47.js.map +1 -1
- package/dist/es/standards-agent-kit.es48.js +6 -23
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +3 -7
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +1 -1
- package/dist/es/standards-agent-kit.es51.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 +2 -1
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +1 -1
- package/dist/es/utils/inscription-utils.d.ts +1 -1
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +15 -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/utils/inscription-utils.d.ts +1 -1
- package/package.json +2 -2
- package/src/builders/inscriber/inscriber-builder.ts +20 -24
- package/src/utils/inscription-utils.ts +2 -2
|
@@ -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.147",
|
|
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",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@hashgraph/sdk": "^2.72.0",
|
|
93
|
-
"@hashgraphonline/standards-sdk": "^0.1.
|
|
93
|
+
"@hashgraphonline/standards-sdk": "^0.1.109",
|
|
94
94
|
"@kiloscribe/inscription-sdk": "^1.0.60",
|
|
95
95
|
"@langchain/community": "^0.3.5",
|
|
96
96
|
"@langchain/core": "^0.3.71",
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
NetworkType,
|
|
13
13
|
getTopicId,
|
|
14
14
|
} from '@hashgraphonline/standards-sdk';
|
|
15
|
-
import { InscriptionSDK } from '@kiloscribe/inscription-sdk';
|
|
15
|
+
import { InscriptionResult, InscriptionSDK } from '@kiloscribe/inscription-sdk';
|
|
16
16
|
import type { AgentOperationalMode } from 'hedera-agent-kit';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -23,6 +23,21 @@ interface DAppSigner {
|
|
|
23
23
|
[key: string]: unknown;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export interface PendingInscriptionResponse {
|
|
27
|
+
transactionBytes: string;
|
|
28
|
+
tx_id?: string;
|
|
29
|
+
topic_id?: string;
|
|
30
|
+
status?: string;
|
|
31
|
+
completed?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CompletedInscriptionResponse {
|
|
35
|
+
confirmed?: boolean;
|
|
36
|
+
result?: InscriptionResult;
|
|
37
|
+
inscription?: RetrievedInscriptionResult;
|
|
38
|
+
jsonTopicId?: string;
|
|
39
|
+
network?: string;
|
|
40
|
+
}
|
|
26
41
|
/**
|
|
27
42
|
* Builder for Inscription operations
|
|
28
43
|
*/
|
|
@@ -36,27 +51,11 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
36
51
|
| Promise<{ accountId: string; network: 'mainnet' | 'testnet' } | null>
|
|
37
52
|
| { accountId: string; network: 'mainnet' | 'testnet' }
|
|
38
53
|
| null;
|
|
54
|
+
|
|
39
55
|
private static startInscriptionDelegate?: (
|
|
40
56
|
request: Record<string, unknown>,
|
|
41
57
|
network: 'mainnet' | 'testnet'
|
|
42
|
-
) => Promise<
|
|
43
|
-
| {
|
|
44
|
-
transactionBytes: string;
|
|
45
|
-
tx_id?: string;
|
|
46
|
-
topic_id?: string;
|
|
47
|
-
status?: string;
|
|
48
|
-
completed?: boolean;
|
|
49
|
-
}
|
|
50
|
-
| {
|
|
51
|
-
confirmed?: boolean;
|
|
52
|
-
result?: unknown;
|
|
53
|
-
inscription?: unknown;
|
|
54
|
-
jsonTopicId?: string;
|
|
55
|
-
metadataTopicId?: string;
|
|
56
|
-
metadata_topic_id?: string;
|
|
57
|
-
network?: string;
|
|
58
|
-
}
|
|
59
|
-
>;
|
|
58
|
+
) => Promise<PendingInscriptionResponse | CompletedInscriptionResponse>;
|
|
60
59
|
private static walletExecutor?: (
|
|
61
60
|
base64: string,
|
|
62
61
|
network: 'mainnet' | 'testnet'
|
|
@@ -279,12 +278,9 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
279
278
|
network
|
|
280
279
|
);
|
|
281
280
|
|
|
281
|
+
const completedStart = start as CompletedInscriptionResponse;
|
|
282
282
|
const isCompletedResponse =
|
|
283
|
-
|
|
284
|
-
typeof start === 'object' &&
|
|
285
|
-
!('transactionBytes' in start) &&
|
|
286
|
-
((start as { inscription?: unknown }).inscription !== undefined ||
|
|
287
|
-
(start as { result?: unknown }).result !== undefined);
|
|
283
|
+
completedStart?.inscription && completedStart?.confirmed;
|
|
288
284
|
|
|
289
285
|
if (isCompletedResponse) {
|
|
290
286
|
const completed = start as {
|
|
@@ -19,11 +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
|
|
26
|
+
inscription?.jsonTopicId || getStringProp(inscription, 'json_topic_id');
|
|
27
27
|
|
|
28
28
|
const imageTopicId =
|
|
29
29
|
getStringProp(inscription, 'topic_id') ||
|