@aigne/cli 1.41.0 → 1.41.2
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 +37 -0
- package/dist/commands/app.js +2 -1
- package/dist/tracer/terminal.js +12 -5
- package/dist/utils/aigne-hub/model.js +3 -3
- package/dist/utils/listr.d.ts +1 -0
- package/dist/utils/listr.js +21 -6
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.41.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.41.1...cli-v1.41.2) (2025-08-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/agent-library bumped to 1.21.29
|
|
11
|
+
* @aigne/agentic-memory bumped to 1.0.29
|
|
12
|
+
* @aigne/aigne-hub bumped to 0.7.0
|
|
13
|
+
* @aigne/default-memory bumped to 1.1.11
|
|
14
|
+
* @aigne/openai bumped to 0.13.0
|
|
15
|
+
|
|
16
|
+
## [1.41.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.41.0...cli-v1.41.1) (2025-08-26)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **cli:** reduce memory usage of AIGNE CLI ([#411](https://github.com/AIGNE-io/aigne-framework/issues/411)) ([9c36969](https://github.com/AIGNE-io/aigne-framework/commit/9c369699d966d37abf2d6a1624eac3d2fda4123b))
|
|
22
|
+
* **cli:** use corepack instead of npm install deps ([#413](https://github.com/AIGNE-io/aigne-framework/issues/413)) ([1b9150c](https://github.com/AIGNE-io/aigne-framework/commit/1b9150c534bfd0cfbb51f5bed51fff609da93628))
|
|
23
|
+
* optimize hub connect copy ([#415](https://github.com/AIGNE-io/aigne-framework/issues/415)) ([8acc4ad](https://github.com/AIGNE-io/aigne-framework/commit/8acc4adf5815afc9564235eeb40b09293c6ab00c))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @aigne/agent-library bumped to 1.21.28
|
|
31
|
+
* @aigne/agentic-memory bumped to 1.0.28
|
|
32
|
+
* @aigne/aigne-hub bumped to 0.6.10
|
|
33
|
+
* @aigne/core bumped to 1.55.1
|
|
34
|
+
* @aigne/default-memory bumped to 1.1.10
|
|
35
|
+
* @aigne/observability-api bumped to 0.10.1
|
|
36
|
+
* @aigne/openai bumped to 0.12.4
|
|
37
|
+
* devDependencies
|
|
38
|
+
* @aigne/test-utils bumped to 0.5.36
|
|
39
|
+
|
|
3
40
|
## [1.41.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.40.0...cli-v1.41.0) (2025-08-25)
|
|
4
41
|
|
|
5
42
|
|
package/dist/commands/app.js
CHANGED
|
@@ -186,9 +186,10 @@ async function isInstallationAvailable(dir, { cacheTimeMs = NPM_PACKAGE_CACHE_TI
|
|
|
186
186
|
}
|
|
187
187
|
async function installDependencies(dir, { log } = {}) {
|
|
188
188
|
await new Promise((resolve, reject) => {
|
|
189
|
-
const child = spawn("
|
|
189
|
+
const child = spawn("corepack", ["npm", "install", "--omit", "dev", "--verbose"], {
|
|
190
190
|
cwd: dir,
|
|
191
191
|
stdio: "pipe",
|
|
192
|
+
shell: process.platform === "win32",
|
|
192
193
|
});
|
|
193
194
|
child.stdout.on("data", (data) => {
|
|
194
195
|
log?.(data.toString());
|
package/dist/tracer/terminal.js
CHANGED
|
@@ -12,6 +12,7 @@ import { AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE } from "../constants.js";
|
|
|
12
12
|
import { AIGNEListr, AIGNEListrRenderer } from "../utils/listr.js";
|
|
13
13
|
import { highlightUrl } from "../utils/string-utils.js";
|
|
14
14
|
import { parseDuration } from "../utils/time.js";
|
|
15
|
+
const CREDITS_ERROR_PROCESSED_FLAG = "$credits_error_processed";
|
|
15
16
|
export class TerminalTracer {
|
|
16
17
|
context;
|
|
17
18
|
options;
|
|
@@ -26,7 +27,7 @@ export class TerminalTracer {
|
|
|
26
27
|
const listr = new AIGNEListr({
|
|
27
28
|
formatRequest: (options) => this.formatRequest(agent, context, input, options),
|
|
28
29
|
formatResult: (result, options) => [this.formatResult(agent, context, result, options)].filter(Boolean),
|
|
29
|
-
}, [], { concurrent: true });
|
|
30
|
+
}, [], { concurrent: true, exitOnError: false });
|
|
30
31
|
this.listr = listr;
|
|
31
32
|
const collapsedMap = new Map();
|
|
32
33
|
const hideContextIds = new Set();
|
|
@@ -145,10 +146,16 @@ export class TerminalTracer {
|
|
|
145
146
|
};
|
|
146
147
|
const onError = async ({ context, agent, error, ...event }) => {
|
|
147
148
|
if ("type" in error && error.type === AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
if (!Object.hasOwn(error, CREDITS_ERROR_PROCESSED_FLAG)) {
|
|
150
|
+
Object.defineProperty(error, CREDITS_ERROR_PROCESSED_FLAG, {
|
|
151
|
+
value: true,
|
|
152
|
+
enumerable: false,
|
|
153
|
+
});
|
|
154
|
+
const retry = await this.promptBuyCredits(error);
|
|
155
|
+
console.log("");
|
|
156
|
+
if (retry === "retry") {
|
|
157
|
+
return { retry: true };
|
|
158
|
+
}
|
|
152
159
|
}
|
|
153
160
|
}
|
|
154
161
|
const contextId = context.id;
|
|
@@ -31,14 +31,14 @@ export const formatModelName = async (model, inquirerPrompt) => {
|
|
|
31
31
|
const result = await inquirerPrompt({
|
|
32
32
|
type: "list",
|
|
33
33
|
name: "useAigneHub",
|
|
34
|
-
message: `
|
|
34
|
+
message: `No API key is configured for ${provider}/${name}, How would you like to proceed?`,
|
|
35
35
|
choices: [
|
|
36
36
|
{
|
|
37
|
-
name: `Connect to AIGNE Hub to use ${name} (
|
|
37
|
+
name: `Connect to AIGNE Hub to use ${name} (recommended — includes free credits)`,
|
|
38
38
|
value: true,
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
name: `Exit and
|
|
41
|
+
name: `Exit and use my own API key (set ${requireEnvs.join(" or ")})`,
|
|
42
42
|
value: false,
|
|
43
43
|
},
|
|
44
44
|
],
|
package/dist/utils/listr.d.ts
CHANGED
package/dist/utils/listr.js
CHANGED
|
@@ -2,11 +2,12 @@ import { EOL } from "node:os";
|
|
|
2
2
|
import { format } from "node:util";
|
|
3
3
|
import { LogLevel, logger } from "@aigne/core/utils/logger.js";
|
|
4
4
|
import { mergeAgentResponseChunk } from "@aigne/core/utils/stream-utils.js";
|
|
5
|
-
import { DefaultRenderer, Listr, ListrDefaultRendererLogLevels, ListrLogger, SimpleRenderer, Spinner, } from "@aigne/listr2";
|
|
5
|
+
import { color, DefaultRenderer, figures, Listr, ListrDefaultRendererLogLevels, ListrLogger, SimpleRenderer, Spinner, } from "@aigne/listr2";
|
|
6
6
|
import wrap from "wrap-ansi";
|
|
7
7
|
export class AIGNEListr extends Listr {
|
|
8
8
|
myOptions;
|
|
9
9
|
result = {};
|
|
10
|
+
error;
|
|
10
11
|
logs = [];
|
|
11
12
|
spinner;
|
|
12
13
|
constructor(myOptions, ...[task, options, parentTask]) {
|
|
@@ -25,6 +26,10 @@ export class AIGNEListr extends Listr {
|
|
|
25
26
|
collapseSubtasks: false,
|
|
26
27
|
icon: {
|
|
27
28
|
[ListrDefaultRendererLogLevels.PENDING]: () => this.spinner.fetch(),
|
|
29
|
+
[ListrDefaultRendererLogLevels.COMPLETED_WITH_FAILED_SUBTASKS]: figures.cross,
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
[ListrDefaultRendererLogLevels.COMPLETED_WITH_FAILED_SUBTASKS]: (m) => m ? color.red(m) : "",
|
|
28
33
|
},
|
|
29
34
|
aigne: aigneOptions,
|
|
30
35
|
},
|
|
@@ -66,7 +71,11 @@ export class AIGNEListr extends Listr {
|
|
|
66
71
|
}
|
|
67
72
|
const _stream = await stream();
|
|
68
73
|
this.add({ task: () => this.extractStream(_stream) });
|
|
69
|
-
return await super.run().then(() =>
|
|
74
|
+
return await super.run().then(() => {
|
|
75
|
+
if (this.error)
|
|
76
|
+
throw this.error;
|
|
77
|
+
return { ...this.result };
|
|
78
|
+
});
|
|
70
79
|
}
|
|
71
80
|
finally {
|
|
72
81
|
logger.logMessage = originalLog;
|
|
@@ -75,11 +84,17 @@ export class AIGNEListr extends Listr {
|
|
|
75
84
|
}
|
|
76
85
|
}
|
|
77
86
|
async extractStream(stream) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
try {
|
|
88
|
+
this.result = {};
|
|
89
|
+
for await (const value of stream) {
|
|
90
|
+
mergeAgentResponseChunk(this.result, value);
|
|
91
|
+
}
|
|
92
|
+
return this.result;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
this.error = error;
|
|
96
|
+
throw error;
|
|
81
97
|
}
|
|
82
|
-
return this.result;
|
|
83
98
|
}
|
|
84
99
|
}
|
|
85
100
|
export class AIGNEListrRenderer extends DefaultRenderer {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.2",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"yaml": "^2.8.0",
|
|
76
76
|
"yargs": "^18.0.0",
|
|
77
77
|
"zod": "^3.25.67",
|
|
78
|
-
"@aigne/agent-library": "^1.21.
|
|
79
|
-
"@aigne/
|
|
80
|
-
"@aigne/core": "^1.55.
|
|
81
|
-
"@aigne/
|
|
82
|
-
"@aigne/default-memory": "^1.1.
|
|
83
|
-
"@aigne/observability-api": "^0.10.
|
|
84
|
-
"@aigne/openai": "^0.
|
|
78
|
+
"@aigne/agent-library": "^1.21.29",
|
|
79
|
+
"@aigne/agentic-memory": "^1.0.29",
|
|
80
|
+
"@aigne/core": "^1.55.1",
|
|
81
|
+
"@aigne/aigne-hub": "^0.7.0",
|
|
82
|
+
"@aigne/default-memory": "^1.1.11",
|
|
83
|
+
"@aigne/observability-api": "^0.10.1",
|
|
84
|
+
"@aigne/openai": "^0.13.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/archiver": "^6.0.3",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"rimraf": "^6.0.1",
|
|
98
98
|
"typescript": "^5.8.3",
|
|
99
99
|
"ufo": "^1.6.1",
|
|
100
|
-
"@aigne/test-utils": "^0.5.
|
|
100
|
+
"@aigne/test-utils": "^0.5.36"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"lint": "tsc --noEmit",
|