@aigne/cli 1.36.2 → 1.36.4
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 +33 -0
- package/dist/commands/hub.js +17 -13
- package/dist/utils/get-url-origin.d.ts +1 -0
- package/dist/utils/get-url-origin.js +8 -0
- package/dist/utils/load-aigne.js +5 -4
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.36.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.36.3...cli-v1.36.4) (2025-08-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **core:** make getCredential async for aigne-hub mount point retrieval ([#372](https://github.com/AIGNE-io/aigne-framework/issues/372)) ([34ce7a6](https://github.com/AIGNE-io/aigne-framework/commit/34ce7a645fa83994d3dfe0f29ca70098cfecac9c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.21.21
|
|
16
|
+
* @aigne/agentic-memory bumped to 1.0.21
|
|
17
|
+
* @aigne/aigne-hub bumped to 0.6.3
|
|
18
|
+
* @aigne/core bumped to 1.50.1
|
|
19
|
+
* @aigne/default-memory bumped to 1.1.3
|
|
20
|
+
* @aigne/openai bumped to 0.11.3
|
|
21
|
+
|
|
22
|
+
## [1.36.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.36.2...cli-v1.36.3) (2025-08-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **cli:** display only the origin URL when linking to hub ([#369](https://github.com/AIGNE-io/aigne-framework/issues/369)) ([b3baf3f](https://github.com/AIGNE-io/aigne-framework/commit/b3baf3f2c98f965d5279dd0dfb282be9f5ffb6c2))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* The following workspace dependencies were updated
|
|
33
|
+
* dependencies
|
|
34
|
+
* @aigne/aigne-hub bumped to 0.6.2
|
|
35
|
+
|
|
3
36
|
## [1.36.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.36.1...cli-v1.36.2) (2025-08-15)
|
|
4
37
|
|
|
5
38
|
|
package/dist/commands/hub.js
CHANGED
|
@@ -6,6 +6,7 @@ import Table from "cli-table3";
|
|
|
6
6
|
import inquirer from "inquirer";
|
|
7
7
|
import { parse, stringify } from "yaml";
|
|
8
8
|
import { getUserInfo } from "../utils/aigne-hub-user.js";
|
|
9
|
+
import { getUrlOrigin } from "../utils/get-url-origin.js";
|
|
9
10
|
const formatNumber = (balance) => {
|
|
10
11
|
const balanceNum = String(balance).split(".")[0];
|
|
11
12
|
return chalk.yellow((balanceNum || "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
|
|
@@ -82,8 +83,8 @@ async function formatHubsList(statusList) {
|
|
|
82
83
|
});
|
|
83
84
|
console.log(chalk.blue("Connected AIGNE Hubs:\n"));
|
|
84
85
|
for (const status of statusList) {
|
|
85
|
-
const isConnected =
|
|
86
|
-
table.push([status.apiUrl, isConnected ? "YES" : "NO"]);
|
|
86
|
+
const isConnected = getUrlOrigin(status.apiUrl) === getUrlOrigin(defaultHub);
|
|
87
|
+
table.push([getUrlOrigin(status.apiUrl), isConnected ? "YES" : "NO"]);
|
|
87
88
|
}
|
|
88
89
|
console.log(table.toString());
|
|
89
90
|
console.log(chalk.blue("Use 'aigne hub use' to switch to a different hub."));
|
|
@@ -158,7 +159,7 @@ async function useHub() {
|
|
|
158
159
|
name: "hubApiKey",
|
|
159
160
|
message: `Choose a hub to switch to:`,
|
|
160
161
|
choices: hubs.map((h) => ({
|
|
161
|
-
name:
|
|
162
|
+
name: getUrlOrigin(h.apiUrl),
|
|
162
163
|
value: h.apiUrl,
|
|
163
164
|
})),
|
|
164
165
|
});
|
|
@@ -170,7 +171,7 @@ async function showStatus() {
|
|
|
170
171
|
console.log(chalk.red("No active hub."));
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
|
-
console.log(`Active hub: ${active} - online`);
|
|
174
|
+
console.log(`Active hub: ${getUrlOrigin(active)} - online`);
|
|
174
175
|
}
|
|
175
176
|
async function removeHub() {
|
|
176
177
|
const hubs = await getHubs();
|
|
@@ -183,7 +184,7 @@ async function removeHub() {
|
|
|
183
184
|
name: "hubApiKey",
|
|
184
185
|
message: `Choose a hub to remove:`,
|
|
185
186
|
choices: hubs.map((h) => ({
|
|
186
|
-
name:
|
|
187
|
+
name: getUrlOrigin(h.apiUrl),
|
|
187
188
|
value: h.apiUrl,
|
|
188
189
|
})),
|
|
189
190
|
});
|
|
@@ -200,7 +201,7 @@ async function showInfo() {
|
|
|
200
201
|
name: "hubApiKey",
|
|
201
202
|
message: `Choose a hub to view info:`,
|
|
202
203
|
choices: hubs.map((h) => ({
|
|
203
|
-
name:
|
|
204
|
+
name: getUrlOrigin(h.apiUrl),
|
|
204
205
|
value: h.apiUrl,
|
|
205
206
|
})),
|
|
206
207
|
});
|
|
@@ -219,9 +220,12 @@ async function saveAndConnect(url) {
|
|
|
219
220
|
const envs = parse(await readFile(AIGNE_ENV_FILE, "utf8").catch(() => stringify({})));
|
|
220
221
|
const host = new URL(url).host;
|
|
221
222
|
if (envs[host]) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
const currentUrl = envs[host]?.AIGNE_HUB_API_URL;
|
|
224
|
+
if (currentUrl) {
|
|
225
|
+
await setDefaultHub(currentUrl);
|
|
226
|
+
console.log(chalk.green(`✓ Hub ${getUrlOrigin(currentUrl)} connected successfully.`));
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
225
229
|
}
|
|
226
230
|
try {
|
|
227
231
|
if (isTest) {
|
|
@@ -237,7 +241,7 @@ async function saveAndConnect(url) {
|
|
|
237
241
|
return;
|
|
238
242
|
}
|
|
239
243
|
await connectToAIGNEHub(url);
|
|
240
|
-
console.log(chalk.green(`✓ Hub ${url} connected successfully.`));
|
|
244
|
+
console.log(chalk.green(`✓ Hub ${getUrlOrigin(url)} connected successfully.`));
|
|
241
245
|
}
|
|
242
246
|
catch (error) {
|
|
243
247
|
console.error(chalk.red("✗ Failed to connect:"), error.message);
|
|
@@ -251,7 +255,7 @@ async function setDefaultHub(url) {
|
|
|
251
255
|
return;
|
|
252
256
|
}
|
|
253
257
|
await writeFile(AIGNE_ENV_FILE, stringify({ ...envs, default: { AIGNE_HUB_API_URL: envs[host]?.AIGNE_HUB_API_URL } }));
|
|
254
|
-
console.log(chalk.green(`✓ Switched active hub to ${url}`));
|
|
258
|
+
console.log(chalk.green(`✓ Switched active hub to ${getUrlOrigin(url)}`));
|
|
255
259
|
}
|
|
256
260
|
async function deleteHub(url) {
|
|
257
261
|
const envs = parse(await readFile(AIGNE_ENV_FILE, "utf8").catch(() => stringify({})));
|
|
@@ -261,7 +265,7 @@ async function deleteHub(url) {
|
|
|
261
265
|
delete envs.default;
|
|
262
266
|
}
|
|
263
267
|
await writeFile(AIGNE_ENV_FILE, stringify(envs));
|
|
264
|
-
console.log(chalk.green(`✓ Hub ${url} removed`));
|
|
268
|
+
console.log(chalk.green(`✓ Hub ${getUrlOrigin(url)} removed`));
|
|
265
269
|
}
|
|
266
270
|
async function printHubDetails(url) {
|
|
267
271
|
const envs = parse(await readFile(AIGNE_ENV_FILE, "utf8").catch(() => stringify({})));
|
|
@@ -271,7 +275,7 @@ async function printHubDetails(url) {
|
|
|
271
275
|
apiKey: envs[host]?.AIGNE_HUB_API_KEY || "",
|
|
272
276
|
}).catch(() => null);
|
|
273
277
|
printHubStatus({
|
|
274
|
-
hub: url,
|
|
278
|
+
hub: getUrlOrigin(url),
|
|
275
279
|
status: userInfo ? "Connected" : "Not connected",
|
|
276
280
|
user: {
|
|
277
281
|
name: userInfo?.user.fullName || "",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getUrlOrigin: (url: string) => string;
|
package/dist/utils/load-aigne.js
CHANGED
|
@@ -10,20 +10,21 @@ import chalk from "chalk";
|
|
|
10
10
|
import inquirer from "inquirer";
|
|
11
11
|
import { parse, stringify } from "yaml";
|
|
12
12
|
import { availableMemories } from "../constants.js";
|
|
13
|
+
import { getUrlOrigin } from "./get-url-origin.js";
|
|
13
14
|
const isTest = process.env.CI || process.env.NODE_ENV === "test";
|
|
14
15
|
const mockInquirerPrompt = (() => Promise.resolve({ useAigneHub: true }));
|
|
15
16
|
let printed = false;
|
|
16
|
-
function printChatModelInfoBox(model) {
|
|
17
|
+
async function printChatModelInfoBox(model) {
|
|
17
18
|
if (printed)
|
|
18
19
|
return;
|
|
19
20
|
printed = true;
|
|
20
|
-
const credential = model.getCredential();
|
|
21
|
+
const credential = await model.getCredential();
|
|
21
22
|
const lines = [`${chalk.cyan("Provider")}: ${chalk.green(model.name.replace("ChatModel", ""))}`];
|
|
22
23
|
if (credential?.model) {
|
|
23
24
|
lines.push(`${chalk.cyan("Model")}: ${chalk.green(credential?.model)}`);
|
|
24
25
|
}
|
|
25
26
|
if (credential?.url) {
|
|
26
|
-
lines.push(`${chalk.cyan("API URL")}: ${chalk.green(credential?.url || "N/A")}`);
|
|
27
|
+
lines.push(`${chalk.cyan("API URL")}: ${chalk.green(getUrlOrigin(credential?.url) || "N/A")}`);
|
|
27
28
|
}
|
|
28
29
|
if (credential?.apiKey) {
|
|
29
30
|
lines.push(`${chalk.cyan("API Key")}: ${chalk.green(maskApiKey(credential?.apiKey))}`);
|
|
@@ -70,7 +71,7 @@ export async function loadAIGNE({ path, options, modelOptions, actionOptions, })
|
|
|
70
71
|
frequencyPenalty,
|
|
71
72
|
}, modelOptions, { aigneHubUrl: AIGNE_HUB_URL, inquirerPromptFn: actionOptions?.inquirerPromptFn });
|
|
72
73
|
if (model) {
|
|
73
|
-
printChatModelInfoBox(model);
|
|
74
|
+
await printChatModelInfoBox(model);
|
|
74
75
|
}
|
|
75
76
|
if (path) {
|
|
76
77
|
return await AIGNE.load(path, { loadModel, memories: availableMemories, model });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.4",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"yaml": "^2.8.0",
|
|
73
73
|
"yargs": "^18.0.0",
|
|
74
74
|
"zod": "^3.25.67",
|
|
75
|
-
"@aigne/agent-library": "^1.21.
|
|
76
|
-
"@aigne/aigne-hub": "^0.6.
|
|
77
|
-
"@aigne/
|
|
78
|
-
"@aigne/
|
|
79
|
-
"@aigne/
|
|
80
|
-
"@aigne/openai": "^0.11.
|
|
75
|
+
"@aigne/agent-library": "^1.21.21",
|
|
76
|
+
"@aigne/aigne-hub": "^0.6.3",
|
|
77
|
+
"@aigne/agentic-memory": "^1.0.21",
|
|
78
|
+
"@aigne/core": "^1.50.1",
|
|
79
|
+
"@aigne/default-memory": "^1.1.3",
|
|
80
|
+
"@aigne/openai": "^0.11.3",
|
|
81
81
|
"@aigne/observability-api": "^0.9.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|