@hashgraphonline/conversational-agent 0.2.215 → 0.2.216
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/esm/index10.js +1 -1
- package/dist/esm/index37.js +1 -1
- package/dist/esm/index47.js +95 -7
- package/dist/esm/index47.js.map +1 -1
- package/dist/esm/index48.js +7 -95
- package/dist/esm/index48.js.map +1 -1
- package/package.json +3 -3
package/dist/esm/index10.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Logger } from "@hashgraphonline/standards-sdk";
|
|
|
4
4
|
import { fieldTypeRegistry } from "./index12.js";
|
|
5
5
|
import { fieldGuidanceRegistry } from "./index13.js";
|
|
6
6
|
import "./index43.js";
|
|
7
|
-
import { FIELD_PRIORITIES } from "./
|
|
7
|
+
import { FIELD_PRIORITIES } from "./index48.js";
|
|
8
8
|
function isZodObjectSchema(schema) {
|
|
9
9
|
return typeof schema === "object" && schema !== null && "shape" in schema;
|
|
10
10
|
}
|
package/dist/esm/index37.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AccountBuilder } from "./
|
|
2
|
+
import { AccountBuilder } from "./index47.js";
|
|
3
3
|
import { BaseHederaTransactionTool } from "hedera-agent-kit";
|
|
4
4
|
const HbarTransferInputSchema = z.object({
|
|
5
5
|
accountId: z.string().describe('Account ID for the transfer (e.g., "0.0.xxxx").'),
|
package/dist/esm/index47.js
CHANGED
|
@@ -1,10 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { TransferTransaction, AccountId, Hbar } from "@hashgraph/sdk";
|
|
2
|
+
import BigNumber from "bignumber.js";
|
|
3
|
+
import { BaseServiceBuilder } from "hedera-agent-kit";
|
|
4
|
+
class AccountBuilder extends BaseServiceBuilder {
|
|
5
|
+
constructor(hederaKit) {
|
|
6
|
+
super(hederaKit);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Transfers HBAR between accounts with proper decimal handling
|
|
10
|
+
*/
|
|
11
|
+
transferHbar(params, isUserInitiated = true) {
|
|
12
|
+
this.clearNotes();
|
|
13
|
+
const transaction = new TransferTransaction();
|
|
14
|
+
if (!params.transfers || params.transfers.length === 0) {
|
|
15
|
+
throw new Error("HbarTransferParams must include at least one transfer.");
|
|
16
|
+
}
|
|
17
|
+
let netZeroInTinybars = new BigNumber(0);
|
|
18
|
+
let userTransferProcessedForScheduling = false;
|
|
19
|
+
if (isUserInitiated && this.kit.userAccountId && this.kit.operationalMode === "provideBytes" && params.transfers.length === 1) {
|
|
20
|
+
const receiverTransfer = params.transfers[0];
|
|
21
|
+
const amountValue = typeof receiverTransfer.amount === "string" || typeof receiverTransfer.amount === "number" ? receiverTransfer.amount : receiverTransfer.amount.toString();
|
|
22
|
+
const amountBigNum = new BigNumber(amountValue);
|
|
23
|
+
if (amountBigNum.isPositive()) {
|
|
24
|
+
const recipientAccountId = typeof receiverTransfer.accountId === "string" ? AccountId.fromString(receiverTransfer.accountId) : receiverTransfer.accountId;
|
|
25
|
+
const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);
|
|
26
|
+
const sdkHbarAmount = Hbar.fromString(roundedAmount);
|
|
27
|
+
this.logger.info(
|
|
28
|
+
`[AccountBuilder.transferHbar] Configuring user-initiated scheduled transfer: ${sdkHbarAmount.toString()} from ${this.kit.userAccountId} to ${recipientAccountId.toString()}`
|
|
29
|
+
);
|
|
30
|
+
this.addNote(
|
|
31
|
+
`Configured HBAR transfer from your account (${this.kit.userAccountId}) to ${recipientAccountId.toString()} for ${sdkHbarAmount.toString()}.`
|
|
32
|
+
);
|
|
33
|
+
transaction.addHbarTransfer(recipientAccountId, sdkHbarAmount);
|
|
34
|
+
transaction.addHbarTransfer(
|
|
35
|
+
AccountId.fromString(this.kit.userAccountId),
|
|
36
|
+
sdkHbarAmount.negated()
|
|
37
|
+
);
|
|
38
|
+
userTransferProcessedForScheduling = true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!userTransferProcessedForScheduling) {
|
|
42
|
+
const processedTransfers = [];
|
|
43
|
+
for (const transferInput of params.transfers) {
|
|
44
|
+
const accountId = typeof transferInput.accountId === "string" ? AccountId.fromString(transferInput.accountId) : transferInput.accountId;
|
|
45
|
+
const amountValue = typeof transferInput.amount === "string" || typeof transferInput.amount === "number" ? transferInput.amount : transferInput.amount.toString();
|
|
46
|
+
const amountBigNum = new BigNumber(amountValue);
|
|
47
|
+
const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);
|
|
48
|
+
this.logger.info(
|
|
49
|
+
`Processing transfer: ${amountValue} HBAR (rounded to ${roundedAmount}) for account ${accountId.toString()}`
|
|
50
|
+
);
|
|
51
|
+
const sdkHbarAmount = Hbar.fromString(roundedAmount);
|
|
52
|
+
processedTransfers.push({
|
|
53
|
+
accountId,
|
|
54
|
+
amount: amountBigNum,
|
|
55
|
+
hbar: sdkHbarAmount
|
|
56
|
+
});
|
|
57
|
+
const tinybarsContribution = sdkHbarAmount.toTinybars();
|
|
58
|
+
netZeroInTinybars = netZeroInTinybars.plus(
|
|
59
|
+
tinybarsContribution.toString()
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
if (!netZeroInTinybars.isZero()) {
|
|
63
|
+
this.logger.warn(
|
|
64
|
+
`Transfer sum not zero: ${netZeroInTinybars.toString()} tinybars off. Adjusting last transfer.`
|
|
65
|
+
);
|
|
66
|
+
if (processedTransfers.length > 0) {
|
|
67
|
+
const lastTransfer = processedTransfers[processedTransfers.length - 1];
|
|
68
|
+
const adjustment = netZeroInTinybars.dividedBy(-1e8);
|
|
69
|
+
const adjustedAmount = lastTransfer.amount.plus(adjustment);
|
|
70
|
+
const adjustedRounded = adjustedAmount.toFixed(
|
|
71
|
+
8,
|
|
72
|
+
BigNumber.ROUND_DOWN
|
|
73
|
+
);
|
|
74
|
+
lastTransfer.hbar = Hbar.fromString(adjustedRounded);
|
|
75
|
+
this.logger.info(
|
|
76
|
+
`Adjusted last transfer for ${lastTransfer.accountId.toString()} to ${adjustedRounded} HBAR`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const transfer of processedTransfers) {
|
|
81
|
+
transaction.addHbarTransfer(transfer.accountId, transfer.hbar);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (typeof params.memo !== "undefined") {
|
|
85
|
+
if (params.memo === null) {
|
|
86
|
+
this.logger.warn("Received null for memo in transferHbar.");
|
|
87
|
+
} else {
|
|
88
|
+
transaction.setTransactionMemo(params.memo);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
this.setCurrentTransaction(transaction);
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
7
95
|
export {
|
|
8
|
-
|
|
96
|
+
AccountBuilder
|
|
9
97
|
};
|
|
10
98
|
//# sourceMappingURL=index47.js.map
|
package/dist/esm/index47.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index47.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index47.js","sources":["../../src/plugins/hbar/AccountBuilder.ts"],"sourcesContent":["import { AccountId, Hbar, TransferTransaction } from '@hashgraph/sdk';\nimport BigNumber from 'bignumber.js';\nimport { HederaAgentKit, BaseServiceBuilder } from 'hedera-agent-kit';\nimport { HbarTransferParams } from './types';\n\n/**\n * Custom AccountBuilder that properly handles HBAR decimal conversion\n */\nexport class AccountBuilder extends BaseServiceBuilder {\n constructor(hederaKit: HederaAgentKit) {\n super(hederaKit);\n }\n\n /**\n * Transfers HBAR between accounts with proper decimal handling\n */\n public transferHbar(\n params: HbarTransferParams,\n isUserInitiated: boolean = true\n ): this {\n this.clearNotes();\n const transaction = new TransferTransaction();\n\n if (!params.transfers || params.transfers.length === 0) {\n throw new Error('HbarTransferParams must include at least one transfer.');\n }\n\n let netZeroInTinybars = new BigNumber(0);\n let userTransferProcessedForScheduling = false;\n\n if (\n isUserInitiated &&\n this.kit.userAccountId &&\n (this.kit.operationalMode as string) === 'provideBytes' &&\n params.transfers.length === 1\n ) {\n const receiverTransfer = params.transfers[0];\n const amountValue =\n typeof receiverTransfer.amount === 'string' ||\n typeof receiverTransfer.amount === 'number'\n ? receiverTransfer.amount\n : receiverTransfer.amount.toString();\n\n const amountBigNum = new BigNumber(amountValue);\n\n if (amountBigNum.isPositive()) {\n const recipientAccountId =\n typeof receiverTransfer.accountId === 'string'\n ? AccountId.fromString(receiverTransfer.accountId)\n : receiverTransfer.accountId;\n\n const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);\n const sdkHbarAmount = Hbar.fromString(roundedAmount);\n\n this.logger.info(\n `[AccountBuilder.transferHbar] Configuring user-initiated scheduled transfer: ${sdkHbarAmount.toString()} from ${\n this.kit.userAccountId\n } to ${recipientAccountId.toString()}`\n );\n\n this.addNote(\n `Configured HBAR transfer from your account (${\n this.kit.userAccountId\n }) to ${recipientAccountId.toString()} for ${sdkHbarAmount.toString()}.`\n );\n\n transaction.addHbarTransfer(recipientAccountId, sdkHbarAmount);\n transaction.addHbarTransfer(\n AccountId.fromString(this.kit.userAccountId),\n sdkHbarAmount.negated()\n );\n\n userTransferProcessedForScheduling = true;\n }\n }\n\n if (!userTransferProcessedForScheduling) {\n const processedTransfers: Array<{\n accountId: AccountId;\n amount: BigNumber;\n hbar: Hbar;\n }> = [];\n\n for (const transferInput of params.transfers) {\n const accountId =\n typeof transferInput.accountId === 'string'\n ? AccountId.fromString(transferInput.accountId)\n : transferInput.accountId;\n\n const amountValue =\n typeof transferInput.amount === 'string' ||\n typeof transferInput.amount === 'number'\n ? transferInput.amount\n : transferInput.amount.toString();\n\n const amountBigNum = new BigNumber(amountValue);\n const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);\n\n this.logger.info(\n `Processing transfer: ${amountValue} HBAR (rounded to ${roundedAmount}) for account ${accountId.toString()}`\n );\n\n const sdkHbarAmount = Hbar.fromString(roundedAmount);\n processedTransfers.push({\n accountId,\n amount: amountBigNum,\n hbar: sdkHbarAmount,\n });\n\n const tinybarsContribution = sdkHbarAmount.toTinybars();\n netZeroInTinybars = netZeroInTinybars.plus(\n tinybarsContribution.toString()\n );\n }\n\n if (!netZeroInTinybars.isZero()) {\n this.logger.warn(\n `Transfer sum not zero: ${netZeroInTinybars.toString()} tinybars off. Adjusting last transfer.`\n );\n\n if (processedTransfers.length > 0) {\n const lastTransfer =\n processedTransfers[processedTransfers.length - 1];\n const adjustment = netZeroInTinybars.dividedBy(-100000000);\n const adjustedAmount = lastTransfer.amount.plus(adjustment);\n const adjustedRounded = adjustedAmount.toFixed(\n 8,\n BigNumber.ROUND_DOWN\n );\n lastTransfer.hbar = Hbar.fromString(adjustedRounded);\n\n this.logger.info(\n `Adjusted last transfer for ${lastTransfer.accountId.toString()} to ${adjustedRounded} HBAR`\n );\n }\n }\n\n for (const transfer of processedTransfers) {\n transaction.addHbarTransfer(transfer.accountId, transfer.hbar);\n }\n }\n\n if (typeof params.memo !== 'undefined') {\n if (params.memo === null) {\n this.logger.warn('Received null for memo in transferHbar.');\n } else {\n transaction.setTransactionMemo(params.memo);\n }\n }\n\n this.setCurrentTransaction(transaction);\n return this;\n }\n}\n"],"names":[],"mappings":";;;AAQO,MAAM,uBAAuB,mBAAmB;AAAA,EACrD,YAAY,WAA2B;AACrC,UAAM,SAAS;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKO,aACL,QACA,kBAA2B,MACrB;AACN,SAAK,WAAA;AACL,UAAM,cAAc,IAAI,oBAAA;AAExB,QAAI,CAAC,OAAO,aAAa,OAAO,UAAU,WAAW,GAAG;AACtD,YAAM,IAAI,MAAM,wDAAwD;AAAA,IAC1E;AAEA,QAAI,oBAAoB,IAAI,UAAU,CAAC;AACvC,QAAI,qCAAqC;AAEzC,QACE,mBACA,KAAK,IAAI,iBACR,KAAK,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|
|
8
|
-
/**
|
|
9
|
-
* Transfers HBAR between accounts with proper decimal handling
|
|
10
|
-
*/
|
|
11
|
-
transferHbar(params, isUserInitiated = true) {
|
|
12
|
-
this.clearNotes();
|
|
13
|
-
const transaction = new TransferTransaction();
|
|
14
|
-
if (!params.transfers || params.transfers.length === 0) {
|
|
15
|
-
throw new Error("HbarTransferParams must include at least one transfer.");
|
|
16
|
-
}
|
|
17
|
-
let netZeroInTinybars = new BigNumber(0);
|
|
18
|
-
let userTransferProcessedForScheduling = false;
|
|
19
|
-
if (isUserInitiated && this.kit.userAccountId && this.kit.operationalMode === "provideBytes" && params.transfers.length === 1) {
|
|
20
|
-
const receiverTransfer = params.transfers[0];
|
|
21
|
-
const amountValue = typeof receiverTransfer.amount === "string" || typeof receiverTransfer.amount === "number" ? receiverTransfer.amount : receiverTransfer.amount.toString();
|
|
22
|
-
const amountBigNum = new BigNumber(amountValue);
|
|
23
|
-
if (amountBigNum.isPositive()) {
|
|
24
|
-
const recipientAccountId = typeof receiverTransfer.accountId === "string" ? AccountId.fromString(receiverTransfer.accountId) : receiverTransfer.accountId;
|
|
25
|
-
const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);
|
|
26
|
-
const sdkHbarAmount = Hbar.fromString(roundedAmount);
|
|
27
|
-
this.logger.info(
|
|
28
|
-
`[AccountBuilder.transferHbar] Configuring user-initiated scheduled transfer: ${sdkHbarAmount.toString()} from ${this.kit.userAccountId} to ${recipientAccountId.toString()}`
|
|
29
|
-
);
|
|
30
|
-
this.addNote(
|
|
31
|
-
`Configured HBAR transfer from your account (${this.kit.userAccountId}) to ${recipientAccountId.toString()} for ${sdkHbarAmount.toString()}.`
|
|
32
|
-
);
|
|
33
|
-
transaction.addHbarTransfer(recipientAccountId, sdkHbarAmount);
|
|
34
|
-
transaction.addHbarTransfer(
|
|
35
|
-
AccountId.fromString(this.kit.userAccountId),
|
|
36
|
-
sdkHbarAmount.negated()
|
|
37
|
-
);
|
|
38
|
-
userTransferProcessedForScheduling = true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (!userTransferProcessedForScheduling) {
|
|
42
|
-
const processedTransfers = [];
|
|
43
|
-
for (const transferInput of params.transfers) {
|
|
44
|
-
const accountId = typeof transferInput.accountId === "string" ? AccountId.fromString(transferInput.accountId) : transferInput.accountId;
|
|
45
|
-
const amountValue = typeof transferInput.amount === "string" || typeof transferInput.amount === "number" ? transferInput.amount : transferInput.amount.toString();
|
|
46
|
-
const amountBigNum = new BigNumber(amountValue);
|
|
47
|
-
const roundedAmount = amountBigNum.toFixed(8, BigNumber.ROUND_DOWN);
|
|
48
|
-
this.logger.info(
|
|
49
|
-
`Processing transfer: ${amountValue} HBAR (rounded to ${roundedAmount}) for account ${accountId.toString()}`
|
|
50
|
-
);
|
|
51
|
-
const sdkHbarAmount = Hbar.fromString(roundedAmount);
|
|
52
|
-
processedTransfers.push({
|
|
53
|
-
accountId,
|
|
54
|
-
amount: amountBigNum,
|
|
55
|
-
hbar: sdkHbarAmount
|
|
56
|
-
});
|
|
57
|
-
const tinybarsContribution = sdkHbarAmount.toTinybars();
|
|
58
|
-
netZeroInTinybars = netZeroInTinybars.plus(
|
|
59
|
-
tinybarsContribution.toString()
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
if (!netZeroInTinybars.isZero()) {
|
|
63
|
-
this.logger.warn(
|
|
64
|
-
`Transfer sum not zero: ${netZeroInTinybars.toString()} tinybars off. Adjusting last transfer.`
|
|
65
|
-
);
|
|
66
|
-
if (processedTransfers.length > 0) {
|
|
67
|
-
const lastTransfer = processedTransfers[processedTransfers.length - 1];
|
|
68
|
-
const adjustment = netZeroInTinybars.dividedBy(-1e8);
|
|
69
|
-
const adjustedAmount = lastTransfer.amount.plus(adjustment);
|
|
70
|
-
const adjustedRounded = adjustedAmount.toFixed(
|
|
71
|
-
8,
|
|
72
|
-
BigNumber.ROUND_DOWN
|
|
73
|
-
);
|
|
74
|
-
lastTransfer.hbar = Hbar.fromString(adjustedRounded);
|
|
75
|
-
this.logger.info(
|
|
76
|
-
`Adjusted last transfer for ${lastTransfer.accountId.toString()} to ${adjustedRounded} HBAR`
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
for (const transfer of processedTransfers) {
|
|
81
|
-
transaction.addHbarTransfer(transfer.accountId, transfer.hbar);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (typeof params.memo !== "undefined") {
|
|
85
|
-
if (params.memo === null) {
|
|
86
|
-
this.logger.warn("Received null for memo in transferHbar.");
|
|
87
|
-
} else {
|
|
88
|
-
transaction.setTransactionMemo(params.memo);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
this.setCurrentTransaction(transaction);
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
const FIELD_PRIORITIES = {
|
|
2
|
+
ESSENTIAL: "essential",
|
|
3
|
+
COMMON: "common",
|
|
4
|
+
ADVANCED: "advanced",
|
|
5
|
+
EXPERT: "expert"
|
|
6
|
+
};
|
|
95
7
|
export {
|
|
96
|
-
|
|
8
|
+
FIELD_PRIORITIES
|
|
97
9
|
};
|
|
98
10
|
//# sourceMappingURL=index48.js.map
|
package/dist/esm/index48.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index48.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index48.js","sources":["../../src/constants/form-priorities.ts"],"sourcesContent":["/**\n * Form field priorities for progressive disclosure\n */\nexport const FIELD_PRIORITIES = {\n ESSENTIAL: 'essential',\n COMMON: 'common', \n ADVANCED: 'advanced',\n EXPERT: 'expert'\n} as const;\n\n/**\n * Form field types\n */\nexport const FORM_FIELD_TYPES = {\n TEXT: 'text',\n NUMBER: 'number',\n SELECT: 'select',\n CHECKBOX: 'checkbox',\n TEXTAREA: 'textarea',\n FILE: 'file',\n ARRAY: 'array',\n OBJECT: 'object',\n CURRENCY: 'currency',\n PERCENTAGE: 'percentage',\n} as const;"],"names":[],"mappings":"AAGO,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/conversational-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.216",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@hashgraph/sdk": "^2.72.0",
|
|
78
78
|
"@hashgraphonline/hashinal-wc": "^1.0.107",
|
|
79
|
-
"@hashgraphonline/standards-agent-kit": "^0.2.
|
|
80
|
-
"@hashgraphonline/standards-sdk": "0.1.
|
|
79
|
+
"@hashgraphonline/standards-agent-kit": "^0.2.164",
|
|
80
|
+
"@hashgraphonline/standards-sdk": "0.1.111",
|
|
81
81
|
"@langchain/anthropic": "^0.3.28",
|
|
82
82
|
"@langchain/core": "^0.3.77",
|
|
83
83
|
"@langchain/openai": "^0.6.13",
|