@aigne/cli 1.48.2 → 1.48.3-beta
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/CHANGELOG.md +7 -0
- package/dist/commands/hub.d.ts +1 -0
- package/dist/commands/hub.js +17 -10
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.48.3-beta](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.48.2...cli-v1.48.3-beta) (2025-09-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* improved number formatting for credit balance display in hub commands ([c5ec419](https://github.com/AIGNE-io/aigne-framework/commit/c5ec41910435b58957611fe48105ed3c69c56e17))
|
|
9
|
+
|
|
3
10
|
## [1.48.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.48.1...cli-v1.48.2) (2025-09-18)
|
|
4
11
|
|
|
5
12
|
|
package/dist/commands/hub.d.ts
CHANGED
package/dist/commands/hub.js
CHANGED
|
@@ -9,9 +9,16 @@ import { AIGNE_ENV_FILE, isTest } from "../utils/aigne-hub/constants.js";
|
|
|
9
9
|
import { connectToAIGNEHub } from "../utils/aigne-hub/credential.js";
|
|
10
10
|
import { getUserInfo } from "../utils/aigne-hub-user.js";
|
|
11
11
|
import { getUrlOrigin } from "../utils/get-url-origin.js";
|
|
12
|
-
const formatNumber = (balance) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
export const formatNumber = (balance) => {
|
|
13
|
+
const cleanNumber = String(balance).replace(/[^\d.-]/g, "");
|
|
14
|
+
const balanceNum = cleanNumber.split(".")[0];
|
|
15
|
+
if (!balanceNum) {
|
|
16
|
+
return "0";
|
|
17
|
+
}
|
|
18
|
+
return (balanceNum || "").trim().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
19
|
+
};
|
|
20
|
+
const formatNumberWithColor = (balance) => {
|
|
21
|
+
return chalk.yellow(formatNumber(balance));
|
|
15
22
|
};
|
|
16
23
|
function formatHubInfoName(name) {
|
|
17
24
|
return chalk.bold(`${name}:`.padEnd(10));
|
|
@@ -32,9 +39,9 @@ function printHubStatus(data) {
|
|
|
32
39
|
console.log("");
|
|
33
40
|
if (data.enableCredit) {
|
|
34
41
|
console.log(chalk.bold("Credits:"));
|
|
35
|
-
console.log(` ${formatHubInfoName("Total")} ${
|
|
36
|
-
console.log(` ${formatHubInfoName("Used")} ${
|
|
37
|
-
console.log(` ${formatHubInfoName("Available")} ${
|
|
42
|
+
console.log(` ${formatHubInfoName("Total")} ${formatNumberWithColor(data.credits.total)}`);
|
|
43
|
+
console.log(` ${formatHubInfoName("Used")} ${formatNumberWithColor(data.credits.used)}`);
|
|
44
|
+
console.log(` ${formatHubInfoName("Available")} ${formatNumberWithColor(data.credits.available)}`);
|
|
38
45
|
console.log("");
|
|
39
46
|
console.log(chalk.bold("Links:"));
|
|
40
47
|
if (data.links.payment) {
|
|
@@ -282,10 +289,10 @@ async function printHubDetails(url) {
|
|
|
282
289
|
email: userInfo?.user.email || "",
|
|
283
290
|
},
|
|
284
291
|
credits: {
|
|
285
|
-
available:
|
|
286
|
-
total:
|
|
287
|
-
used:
|
|
288
|
-
parseFloat(userInfo?.creditBalance?.balance || "0"))
|
|
292
|
+
available: userInfo?.creditBalance?.balance || "0",
|
|
293
|
+
total: userInfo?.creditBalance?.total || "0",
|
|
294
|
+
used: String(parseFloat(userInfo?.creditBalance?.total || "0") -
|
|
295
|
+
parseFloat(userInfo?.creditBalance?.balance || "0")),
|
|
289
296
|
},
|
|
290
297
|
links: {
|
|
291
298
|
payment: userInfo?.paymentLink || "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.3-beta",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"yargs": "^18.0.0",
|
|
82
82
|
"yoctocolors-cjs": "^2.1.3",
|
|
83
83
|
"zod": "^3.25.67",
|
|
84
|
-
"@aigne/agentic-memory": "^1.0.45",
|
|
85
84
|
"@aigne/agent-library": "^1.21.45",
|
|
86
|
-
"@aigne/default-memory": "^1.2.8",
|
|
87
85
|
"@aigne/core": "^1.60.3",
|
|
86
|
+
"@aigne/aigne-hub": "^0.9.6",
|
|
87
|
+
"@aigne/default-memory": "^1.2.8",
|
|
88
|
+
"@aigne/agentic-memory": "^1.0.45",
|
|
88
89
|
"@aigne/observability-api": "^0.10.4",
|
|
89
|
-
"@aigne/openai": "^0.15.4"
|
|
90
|
-
"@aigne/aigne-hub": "^0.9.6"
|
|
90
|
+
"@aigne/openai": "^0.15.4"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@inquirer/testing": "^2.1.50",
|