@aigne/cli 1.51.0-beta.4 → 1.51.0-beta.6
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 +30 -0
- package/dist/cli.js +4 -2
- package/dist/commands/app.js +5 -2
- package/dist/ui/utils/terminal-input.js +2 -2
- package/dist/utils/aigne-hub/model.js +9 -2
- package/dist/utils/load-aigne.d.ts +2 -1
- package/dist/utils/load-aigne.js +19 -11
- package/dist/utils/workers/run-aigne-in-child-process-worker.d.ts +3 -2
- package/dist/utils/workers/run-aigne-in-child-process-worker.js +3 -4
- package/dist/utils/workers/run-aigne-in-child-process.js +9 -4
- package/package.json +10 -10
- package/dist/ui/utils/error.d.ts +0 -2
- package/dist/ui/utils/error.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.51.0-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.5...cli-v1.51.0-beta.6) (2025-10-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add copy and download in observability detail and optimize the detail rendering ([#610](https://github.com/AIGNE-io/aigne-framework/issues/610)) ([b1885f2](https://github.com/AIGNE-io/aigne-framework/commit/b1885f2b969d7ca28a0cb1ac2b4707e7c785308b))
|
|
9
|
+
* **cli:** suppress error message for CTRL+C ([#617](https://github.com/AIGNE-io/aigne-framework/issues/617)) ([01f0ea7](https://github.com/AIGNE-io/aigne-framework/commit/01f0ea74affa5653dd94048e68b62b7d7e649d4a))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @aigne/afs-system-fs bumped to 1.0.1-beta.1
|
|
17
|
+
* @aigne/agent-library bumped to 1.21.48-beta.5
|
|
18
|
+
* @aigne/agentic-memory bumped to 1.0.48-beta.5
|
|
19
|
+
* @aigne/aigne-hub bumped to 0.10.2-beta.5
|
|
20
|
+
* @aigne/core bumped to 1.63.0-beta.5
|
|
21
|
+
* @aigne/default-memory bumped to 1.2.11-beta.5
|
|
22
|
+
* @aigne/openai bumped to 0.16.2-beta.5
|
|
23
|
+
* devDependencies
|
|
24
|
+
* @aigne/test-utils bumped to 0.5.55-beta.5
|
|
25
|
+
|
|
26
|
+
## [1.51.0-beta.5](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.4...cli-v1.51.0-beta.5) (2025-10-12)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* correct loading aigne with AFS config for `upgrade` command ([#613](https://github.com/AIGNE-io/aigne-framework/issues/613)) ([db1db97](https://github.com/AIGNE-io/aigne-framework/commit/db1db97b6305009d302a782dbc7fa3147900af47))
|
|
32
|
+
|
|
3
33
|
## [1.51.0-beta.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.3...cli-v1.51.0-beta.4) (2025-10-12)
|
|
4
34
|
|
|
5
35
|
|
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,9 @@ export default createAIGNECommand({ argv, aigneFilePath })
|
|
|
28
28
|
})
|
|
29
29
|
.parseAsync(argv)
|
|
30
30
|
.catch((error) => {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (error.name !== "ExitPromptError") {
|
|
32
|
+
console.log(""); // Add an empty line for better readability
|
|
33
|
+
console.error(`${chalk.red("Error:")} ${highlightUrl(error.message)}`);
|
|
34
|
+
}
|
|
33
35
|
process.exit(1);
|
|
34
36
|
});
|
package/dist/commands/app.js
CHANGED
|
@@ -193,7 +193,10 @@ export async function loadApplication(options) {
|
|
|
193
193
|
const { dir, packageName } = options;
|
|
194
194
|
const check = await checkInstallation(dir);
|
|
195
195
|
if (check && !check.expired) {
|
|
196
|
-
const aigne = await runAIGNEInChildProcess("loadAIGNE",
|
|
196
|
+
const aigne = await runAIGNEInChildProcess("loadAIGNE", {
|
|
197
|
+
path: dir,
|
|
198
|
+
skipModelLoading: true,
|
|
199
|
+
}).catch(async (error) => {
|
|
197
200
|
logger.error(`⚠️ Failed to load ${packageName}, trying to reinstall:`, error.message);
|
|
198
201
|
await withSpinner("", async () => {
|
|
199
202
|
await rm(options.dir, { recursive: true, force: true });
|
|
@@ -208,7 +211,7 @@ export async function loadApplication(options) {
|
|
|
208
211
|
return null;
|
|
209
212
|
const result = await installApp({ dir, packageName, beta: check?.version?.includes("beta") });
|
|
210
213
|
return {
|
|
211
|
-
aigne: await runAIGNEInChildProcess("loadAIGNE", dir),
|
|
214
|
+
aigne: await runAIGNEInChildProcess("loadAIGNE", { path: dir, skipModelLoading: true }),
|
|
212
215
|
version: result.version,
|
|
213
216
|
};
|
|
214
217
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExitPromptError } from "@inquirer/core";
|
|
2
3
|
import chalk from "chalk";
|
|
3
4
|
import { Box, render, Text, useInput } from "ink";
|
|
4
5
|
import { useState } from "react";
|
|
5
|
-
import { SIGINTError } from "./error.js";
|
|
6
6
|
import { useTextBuffer } from "./text-buffer.js";
|
|
7
7
|
export async function terminalInput(options = {}) {
|
|
8
8
|
return new Promise((resolve, reject) => {
|
|
@@ -30,7 +30,7 @@ function Input(props) {
|
|
|
30
30
|
if (character === "c" && key.ctrl) {
|
|
31
31
|
setStatus("error");
|
|
32
32
|
setTimeout(() => {
|
|
33
|
-
props.onError(new
|
|
33
|
+
props.onError(new ExitPromptError("Input aborted by user"));
|
|
34
34
|
});
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { AIGNE_HUB_DEFAULT_MODEL, findImageModel, findModel } from "@aigne/aigne-hub";
|
|
1
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { AIGNE_HUB_DEFAULT_MODEL, AIGNE_HUB_URL, findImageModel, findModel, } from "@aigne/aigne-hub";
|
|
3
3
|
import { flat, omit } from "@aigne/core/utils/type-utils.js";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import inquirer from "inquirer";
|
|
@@ -56,6 +56,13 @@ export const formatModelName = async (model, inquirerPrompt) => {
|
|
|
56
56
|
console.log(chalk.yellow(`You can use command "export ${requireEnvs[0]}=xxx" to set API Key in your shell. Or you can set environment variables in .env file.`));
|
|
57
57
|
process.exit(0);
|
|
58
58
|
}
|
|
59
|
+
if (!envs.default?.AIGNE_HUB_API_URL) {
|
|
60
|
+
const host = new URL(AIGNE_HUB_URL).host;
|
|
61
|
+
const defaultEnv = envs[host]?.AIGNE_HUB_API_URL
|
|
62
|
+
? envs[host]
|
|
63
|
+
: Object.values(envs)[0] || { AIGNE_HUB_API_URL: "" };
|
|
64
|
+
await writeFile(AIGNE_ENV_FILE, stringify({ ...envs, default: { AIGNE_HUB_API_URL: defaultEnv?.AIGNE_HUB_API_URL } }));
|
|
65
|
+
}
|
|
59
66
|
return { provider: AIGNE_HUB_PROVIDER, model: `${provider}/${name}` };
|
|
60
67
|
};
|
|
61
68
|
export async function loadChatModel(options) {
|
|
@@ -7,9 +7,10 @@ export interface RunOptions extends AgentRunCommonOptions {
|
|
|
7
7
|
cacheDir?: string;
|
|
8
8
|
aigneHubUrl?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function loadAIGNE({ path, modelOptions, imageModelOptions, printTips, }: {
|
|
10
|
+
export declare function loadAIGNE({ path, modelOptions, imageModelOptions, printTips, skipModelLoading, }: {
|
|
11
11
|
path?: string;
|
|
12
12
|
modelOptions?: ChatModelInputOptions & LoadCredentialOptions;
|
|
13
13
|
imageModelOptions?: ImageModelInputOptions & LoadCredentialOptions;
|
|
14
14
|
printTips?: boolean;
|
|
15
|
+
skipModelLoading?: boolean;
|
|
15
16
|
}): Promise<AIGNE<import("@aigne/core").UserContext>>;
|
package/dist/utils/load-aigne.js
CHANGED
|
@@ -21,21 +21,29 @@ async function printChatModelInfoBox(model) {
|
|
|
21
21
|
console.log(boxen(lines.join("\n"), { padding: 1, borderStyle: "classic", borderColor: "cyan" }));
|
|
22
22
|
console.log("");
|
|
23
23
|
}
|
|
24
|
-
export async function loadAIGNE({ path, modelOptions, imageModelOptions, printTips = true, }) {
|
|
24
|
+
export async function loadAIGNE({ path, modelOptions, imageModelOptions, printTips = true, skipModelLoading = false, }) {
|
|
25
25
|
let aigne;
|
|
26
26
|
if (path) {
|
|
27
27
|
aigne = await AIGNE.load(path, {
|
|
28
28
|
memories: availableMemories,
|
|
29
|
-
model: (options) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
model: (options) => {
|
|
30
|
+
if (skipModelLoading)
|
|
31
|
+
return undefined;
|
|
32
|
+
return loadChatModel({
|
|
33
|
+
...options,
|
|
34
|
+
...omitBy(modelOptions ?? {}, (v) => isNil(v)),
|
|
35
|
+
model: modelOptions?.model || process.env.MODEL || options?.model,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
imageModel: (options) => {
|
|
39
|
+
if (skipModelLoading)
|
|
40
|
+
return undefined;
|
|
41
|
+
return loadImageModel({
|
|
42
|
+
...options,
|
|
43
|
+
...omitBy(imageModelOptions ?? {}, (v) => isNil(v)),
|
|
44
|
+
model: imageModelOptions?.model || process.env.IMAGE_MODEL || options?.model,
|
|
45
|
+
});
|
|
46
|
+
},
|
|
39
47
|
afs: {
|
|
40
48
|
availableModules: [
|
|
41
49
|
{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Message } from "@aigne/core";
|
|
2
|
+
import { loadAIGNE } from "../load-aigne.js";
|
|
2
3
|
import { type AgentRunCommonOptions } from "../yargs.js";
|
|
3
4
|
import { type AgentInChildProcess, type CLIAgentInChildProcess } from "./run-aigne-in-child-process.js";
|
|
4
|
-
export declare function loadAIGNEInChildProcess(
|
|
5
|
+
export declare function loadAIGNEInChildProcess(options: Parameters<typeof loadAIGNE>[0]): Promise<{
|
|
5
6
|
agents?: AgentInChildProcess[];
|
|
6
7
|
cli?: {
|
|
7
8
|
chat?: AgentInChildProcess;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import assert from "node:assert";
|
|
2
|
-
import { AIGNE } from "@aigne/core";
|
|
3
2
|
import { findCliAgent, mapCliAgent } from "@aigne/core/utils/agent-utils.js";
|
|
4
3
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
5
4
|
import { loadAIGNE } from "../load-aigne.js";
|
|
@@ -30,14 +29,14 @@ process.on("message", async ({ method, args, ...options }) => {
|
|
|
30
29
|
await send({ method, result });
|
|
31
30
|
}
|
|
32
31
|
catch (error) {
|
|
33
|
-
await send({ method, error: { message: error.message } });
|
|
32
|
+
await send({ method, error: { name: error.name, message: error.message } });
|
|
34
33
|
}
|
|
35
34
|
finally {
|
|
36
35
|
process.exit(0);
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
|
-
export async function loadAIGNEInChildProcess(
|
|
40
|
-
const aigne = await
|
|
38
|
+
export async function loadAIGNEInChildProcess(options) {
|
|
39
|
+
const aigne = await loadAIGNE(options);
|
|
41
40
|
return {
|
|
42
41
|
agents: aigne.agents.map(serializeAgent),
|
|
43
42
|
cli: {
|
|
@@ -17,12 +17,17 @@ export async function runAIGNEInChildProcess(method, ...args) {
|
|
|
17
17
|
let completed = false;
|
|
18
18
|
const child = fork(join(dirname(fileURLToPath(import.meta.url)), "./run-aigne-in-child-process-worker.js"));
|
|
19
19
|
child.on("message", (event) => {
|
|
20
|
-
if (event.method !== method)
|
|
20
|
+
if (event.method !== method) {
|
|
21
21
|
reject(new Error(`Unknown method: ${event.method} expected: ${method}`));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
}
|
|
23
|
+
else if (event.error) {
|
|
24
|
+
const e = new Error(event.error.message);
|
|
25
|
+
e.name = event.error.name;
|
|
26
|
+
reject(e);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
25
29
|
resolve(event.result);
|
|
30
|
+
}
|
|
26
31
|
completed = true;
|
|
27
32
|
});
|
|
28
33
|
child.on("exit", (code) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.51.0-beta.
|
|
3
|
+
"version": "1.51.0-beta.6",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
"yoctocolors-cjs": "^2.1.3",
|
|
90
90
|
"zod": "^3.25.67",
|
|
91
91
|
"zod-to-json-schema": "^3.24.6",
|
|
92
|
-
"@aigne/afs-system-fs": "^1.0.1-beta",
|
|
93
|
-
"@aigne/
|
|
94
|
-
"@aigne/
|
|
95
|
-
"@aigne/aigne-hub": "^0.10.2-beta.
|
|
96
|
-
"@aigne/core": "^1.63.0-beta.
|
|
97
|
-
"@aigne/
|
|
98
|
-
"@aigne/
|
|
99
|
-
"@aigne/
|
|
92
|
+
"@aigne/afs-system-fs": "^1.0.1-beta.1",
|
|
93
|
+
"@aigne/agentic-memory": "^1.0.48-beta.5",
|
|
94
|
+
"@aigne/agent-library": "^1.21.48-beta.5",
|
|
95
|
+
"@aigne/aigne-hub": "^0.10.2-beta.5",
|
|
96
|
+
"@aigne/core": "^1.63.0-beta.5",
|
|
97
|
+
"@aigne/default-memory": "^1.2.11-beta.5",
|
|
98
|
+
"@aigne/openai": "^0.16.2-beta.5",
|
|
99
|
+
"@aigne/observability-api": "^0.11.2-beta.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@inquirer/testing": "^2.1.50",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"rimraf": "^6.0.1",
|
|
114
114
|
"typescript": "^5.9.2",
|
|
115
115
|
"ufo": "^1.6.1",
|
|
116
|
-
"@aigne/test-utils": "^0.5.55-beta.
|
|
116
|
+
"@aigne/test-utils": "^0.5.55-beta.5"
|
|
117
117
|
},
|
|
118
118
|
"scripts": {
|
|
119
119
|
"lint": "tsc --noEmit",
|
package/dist/ui/utils/error.d.ts
DELETED
package/dist/ui/utils/error.js
DELETED