@aigne/cli 1.30.0 → 1.30.1
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 +19 -0
- package/dist/commands/app.js +0 -1
- package/dist/tracer/terminal.js +3 -1
- package/dist/utils/listr.d.ts +1 -0
- package/dist/utils/listr.js +35 -21
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.30.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.30.0...cli-v1.30.1) (2025-08-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** persist prompts log and improve terminal output ([#307](https://github.com/AIGNE-io/aigne-framework/issues/307)) ([ac8116f](https://github.com/AIGNE-io/aigne-framework/commit/ac8116fc46f26169e7619860c392fb9f66bc3fee))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.21.10
|
|
16
|
+
* @aigne/agentic-memory bumped to 1.0.10
|
|
17
|
+
* @aigne/aigne-hub bumped to 0.4.1
|
|
18
|
+
* @aigne/openai bumped to 0.10.10
|
|
19
|
+
* @aigne/core bumped to 1.43.0
|
|
20
|
+
* @aigne/default-memory bumped to 1.0.10
|
|
21
|
+
|
|
3
22
|
## [1.30.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.29.0...cli-v1.30.0) (2025-08-01)
|
|
4
23
|
|
|
5
24
|
|
package/dist/commands/app.js
CHANGED
package/dist/tracer/terminal.js
CHANGED
|
@@ -70,9 +70,11 @@ export class TerminalTracer {
|
|
|
70
70
|
return undefined;
|
|
71
71
|
return async (config) => {
|
|
72
72
|
const { taskWrapper } = await task.listr.promise;
|
|
73
|
-
|
|
73
|
+
const result = await taskWrapper
|
|
74
74
|
.prompt(ListrInquirerPromptAdapter)
|
|
75
75
|
.run(method, config);
|
|
76
|
+
console.log(`${chalk.blue("✔")} ${chalk.bold(config.message)} ${result}`);
|
|
77
|
+
return result;
|
|
76
78
|
};
|
|
77
79
|
},
|
|
78
80
|
}),
|
package/dist/utils/listr.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare class AIGNEListrRenderer extends DefaultRenderer {
|
|
|
37
37
|
get _options(): AIGNEListrRendererOptions;
|
|
38
38
|
get _spinner(): Spinner;
|
|
39
39
|
update(): void;
|
|
40
|
+
private isPreviousPrompt;
|
|
40
41
|
create({ running, ...options }: Parameters<DefaultRenderer["create"]>[0] & {
|
|
41
42
|
running?: boolean;
|
|
42
43
|
}): string;
|
package/dist/utils/listr.js
CHANGED
|
@@ -47,21 +47,26 @@ export class AIGNEListr extends Listr {
|
|
|
47
47
|
}
|
|
48
48
|
async run(stream) {
|
|
49
49
|
const originalLog = logger.logMessage;
|
|
50
|
+
const originalConsole = { ...console };
|
|
50
51
|
try {
|
|
51
52
|
this.ctx = {};
|
|
52
53
|
this.spinner.start();
|
|
53
|
-
logger.logMessage = (...args) => this.logs.push(format(...args));
|
|
54
54
|
if (logger.enabled(LogLevel.INFO)) {
|
|
55
55
|
const request = this.myOptions.formatRequest();
|
|
56
56
|
if (request)
|
|
57
57
|
console.log(request);
|
|
58
58
|
}
|
|
59
|
+
logger.logMessage = (...args) => this.logs.push(format(...args));
|
|
60
|
+
for (const method of ["debug", "log", "info", "warn", "error"]) {
|
|
61
|
+
console[method] = (...args) => this.logs.push(format(...args));
|
|
62
|
+
}
|
|
59
63
|
const _stream = await stream();
|
|
60
64
|
this.add({ task: () => this.extractStream(_stream) });
|
|
61
65
|
return await super.run().then(() => ({ ...this.result }));
|
|
62
66
|
}
|
|
63
67
|
finally {
|
|
64
68
|
logger.logMessage = originalLog;
|
|
69
|
+
Object.assign(console, originalConsole);
|
|
65
70
|
this.spinner.stop();
|
|
66
71
|
}
|
|
67
72
|
}
|
|
@@ -92,35 +97,44 @@ export class AIGNEListrRenderer extends DefaultRenderer {
|
|
|
92
97
|
update() {
|
|
93
98
|
this._updater(this.create({ running: true }));
|
|
94
99
|
}
|
|
100
|
+
isPreviousPrompt = false;
|
|
95
101
|
create({ running = false, ...options }) {
|
|
96
102
|
const logs = this._options.aigne?.getStdoutLogs?.();
|
|
97
103
|
if (logs?.length) {
|
|
98
104
|
this._updater.clear();
|
|
99
105
|
this._logger.toStdout(logs.join(EOL));
|
|
100
106
|
}
|
|
101
|
-
let
|
|
102
|
-
const bottomBar = this._options.aigne?.getBottomBarLogs?.({ running });
|
|
103
|
-
if (bottomBar?.length) {
|
|
104
|
-
tasks += EOL.repeat(2);
|
|
105
|
-
const output = [...bottomBar, running ? this._spinner.fetch() : ""]
|
|
106
|
-
.map((i) => this._wrap(i))
|
|
107
|
-
.join(EOL);
|
|
108
|
-
// If the task is not running, we show all lines
|
|
109
|
-
if (!running) {
|
|
110
|
-
tasks += output;
|
|
111
|
-
}
|
|
112
|
-
// For running tasks, we only show the last few lines
|
|
113
|
-
else {
|
|
114
|
-
const { rows } = process.stdout;
|
|
115
|
-
const lines = rows - tasks.split(EOL).length - 2;
|
|
116
|
-
tasks += output.split(EOL).slice(-Math.max(4, lines)).join(EOL);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
107
|
+
let buffer = "";
|
|
119
108
|
const prompt = super["renderPrompt"]();
|
|
120
109
|
if (prompt.length) {
|
|
121
|
-
|
|
110
|
+
buffer += prompt.join(EOL);
|
|
111
|
+
this.isPreviousPrompt = true;
|
|
112
|
+
}
|
|
113
|
+
// Skip a frame if previous render was a prompt, and reset the flag
|
|
114
|
+
else if (this.isPreviousPrompt) {
|
|
115
|
+
this.isPreviousPrompt = false;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
buffer += super.create({ ...options, prompt: false });
|
|
119
|
+
const bottomBar = this._options.aigne?.getBottomBarLogs?.({ running });
|
|
120
|
+
if (bottomBar?.length) {
|
|
121
|
+
buffer += EOL.repeat(2);
|
|
122
|
+
const output = [...bottomBar, running ? this._spinner.fetch() : ""]
|
|
123
|
+
.map((i) => this._wrap(i))
|
|
124
|
+
.join(EOL);
|
|
125
|
+
// If the task is not running, we show all lines
|
|
126
|
+
if (!running) {
|
|
127
|
+
buffer += output;
|
|
128
|
+
}
|
|
129
|
+
// For running tasks, we only show the last few lines
|
|
130
|
+
else {
|
|
131
|
+
const { rows } = process.stdout;
|
|
132
|
+
const lines = rows - buffer.split(EOL).length - 2;
|
|
133
|
+
buffer += output.split(EOL).slice(-Math.max(4, lines)).join(EOL);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
122
136
|
}
|
|
123
|
-
return
|
|
137
|
+
return buffer;
|
|
124
138
|
}
|
|
125
139
|
_wrap(str) {
|
|
126
140
|
return wrap(str, process.stdout.columns ?? 80, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.1",
|
|
4
4
|
"description": "cli for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"yaml": "^2.8.0",
|
|
71
71
|
"yargs": "^18.0.0",
|
|
72
72
|
"zod": "^3.25.67",
|
|
73
|
-
"@aigne/
|
|
74
|
-
"@aigne/
|
|
75
|
-
"@aigne/
|
|
76
|
-
"@aigne/
|
|
77
|
-
"@aigne/
|
|
78
|
-
"@aigne/
|
|
79
|
-
"@aigne/
|
|
73
|
+
"@aigne/aigne-hub": "^0.4.1",
|
|
74
|
+
"@aigne/agent-library": "^1.21.10",
|
|
75
|
+
"@aigne/openai": "^0.10.10",
|
|
76
|
+
"@aigne/default-memory": "^1.0.10",
|
|
77
|
+
"@aigne/agentic-memory": "^1.0.10",
|
|
78
|
+
"@aigne/observability-api": "^0.9.0",
|
|
79
|
+
"@aigne/core": "^1.43.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/archiver": "^6.0.3",
|