@aigne/cli 1.58.1-beta.2 → 1.59.0-beta.10
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 +153 -0
- package/dist/commands/app/agent.js +2 -0
- package/dist/tracer/terminal.js +11 -1
- package/dist/ui/utils/terminal-input.d.ts +1 -0
- package/dist/ui/utils/terminal-input.js +4 -0
- package/dist/utils/listr.d.ts +3 -1
- package/dist/utils/listr.js +59 -8
- package/dist/utils/load-aigne.js +2 -2
- package/dist/utils/run-chat-loop.d.ts +1 -0
- package/dist/utils/run-chat-loop.js +2 -1
- package/dist/utils/run-with-aigne.d.ts +2 -1
- package/dist/utils/run-with-aigne.js +2 -1
- package/package.json +15 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,158 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.59.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.9...cli-v1.59.0-beta.10) (2025-12-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* The following workspace dependencies were updated
|
|
9
|
+
* dependencies
|
|
10
|
+
* @aigne/agent-library bumped to 1.24.0-beta.9
|
|
11
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.11
|
|
12
|
+
|
|
13
|
+
## [1.59.0-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.8...cli-v1.59.0-beta.9) (2025-12-26)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **core:** add session history support ([#858](https://github.com/AIGNE-io/aigne-framework/issues/858)) ([28a070e](https://github.com/AIGNE-io/aigne-framework/commit/28a070ed33b821d1fd344b899706d817ca992b9f))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Dependencies
|
|
22
|
+
|
|
23
|
+
* The following workspace dependencies were updated
|
|
24
|
+
* dependencies
|
|
25
|
+
* @aigne/afs bumped to 1.4.0-beta.4
|
|
26
|
+
* @aigne/afs-history bumped to 1.2.0-beta.4
|
|
27
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.7
|
|
28
|
+
* @aigne/agent-library bumped to 1.24.0-beta.8
|
|
29
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.7
|
|
30
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.10
|
|
31
|
+
* @aigne/core bumped to 1.72.0-beta.7
|
|
32
|
+
* @aigne/default-memory bumped to 1.4.0-beta.6
|
|
33
|
+
* @aigne/openai bumped to 0.16.16-beta.7
|
|
34
|
+
* @aigne/secrets bumped to 0.1.6-beta.7
|
|
35
|
+
* devDependencies
|
|
36
|
+
* @aigne/test-utils bumped to 0.5.69-beta.7
|
|
37
|
+
|
|
38
|
+
## [1.59.0-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.7...cli-v1.59.0-beta.8) (2025-12-25)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
* The following workspace dependencies were updated
|
|
44
|
+
* dependencies
|
|
45
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.6
|
|
46
|
+
* @aigne/agent-library bumped to 1.24.0-beta.7
|
|
47
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.6
|
|
48
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.9
|
|
49
|
+
* @aigne/core bumped to 1.72.0-beta.6
|
|
50
|
+
* @aigne/default-memory bumped to 1.3.6-beta.6
|
|
51
|
+
* @aigne/openai bumped to 0.16.16-beta.6
|
|
52
|
+
* @aigne/secrets bumped to 0.1.6-beta.6
|
|
53
|
+
* devDependencies
|
|
54
|
+
* @aigne/test-utils bumped to 0.5.69-beta.6
|
|
55
|
+
|
|
56
|
+
## [1.59.0-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.6...cli-v1.59.0-beta.7) (2025-12-25)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Dependencies
|
|
60
|
+
|
|
61
|
+
* The following workspace dependencies were updated
|
|
62
|
+
* dependencies
|
|
63
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.8
|
|
64
|
+
|
|
65
|
+
## [1.59.0-beta.6](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.5...cli-v1.59.0-beta.6) (2025-12-25)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Dependencies
|
|
69
|
+
|
|
70
|
+
* The following workspace dependencies were updated
|
|
71
|
+
* dependencies
|
|
72
|
+
* @aigne/agent-library bumped to 1.24.0-beta.6
|
|
73
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.7
|
|
74
|
+
|
|
75
|
+
## [1.59.0-beta.5](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.4...cli-v1.59.0-beta.5) (2025-12-25)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Dependencies
|
|
79
|
+
|
|
80
|
+
* The following workspace dependencies were updated
|
|
81
|
+
* dependencies
|
|
82
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.5
|
|
83
|
+
* @aigne/agent-library bumped to 1.24.0-beta.5
|
|
84
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.5
|
|
85
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.6
|
|
86
|
+
* @aigne/core bumped to 1.72.0-beta.5
|
|
87
|
+
* @aigne/default-memory bumped to 1.3.6-beta.5
|
|
88
|
+
* @aigne/openai bumped to 0.16.16-beta.5
|
|
89
|
+
* @aigne/secrets bumped to 0.1.6-beta.5
|
|
90
|
+
* devDependencies
|
|
91
|
+
* @aigne/test-utils bumped to 0.5.69-beta.5
|
|
92
|
+
|
|
93
|
+
## [1.59.0-beta.4](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.3...cli-v1.59.0-beta.4) (2025-12-24)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Features
|
|
97
|
+
|
|
98
|
+
* add Agent Skill support ([#787](https://github.com/AIGNE-io/aigne-framework/issues/787)) ([f04fbe7](https://github.com/AIGNE-io/aigne-framework/commit/f04fbe76ec24cf3c59c74adf92d87b0c3784a8f7))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Bug Fixes
|
|
102
|
+
|
|
103
|
+
* **cli:** improve terminal outputs ([#847](https://github.com/AIGNE-io/aigne-framework/issues/847)) ([329e91b](https://github.com/AIGNE-io/aigne-framework/commit/329e91bc3323f72fc8a2d278ff5e6bba9adbd6e0))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Dependencies
|
|
107
|
+
|
|
108
|
+
* The following workspace dependencies were updated
|
|
109
|
+
* dependencies
|
|
110
|
+
* @aigne/afs bumped to 1.4.0-beta.3
|
|
111
|
+
* @aigne/afs-history bumped to 1.2.0-beta.3
|
|
112
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.4
|
|
113
|
+
* @aigne/agent-library bumped to 1.24.0-beta.4
|
|
114
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.4
|
|
115
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.5
|
|
116
|
+
* @aigne/core bumped to 1.72.0-beta.4
|
|
117
|
+
* @aigne/default-memory bumped to 1.3.6-beta.4
|
|
118
|
+
* @aigne/openai bumped to 0.16.16-beta.4
|
|
119
|
+
* @aigne/secrets bumped to 0.1.6-beta.4
|
|
120
|
+
* devDependencies
|
|
121
|
+
* @aigne/test-utils bumped to 0.5.69-beta.4
|
|
122
|
+
|
|
123
|
+
## [1.59.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.2...cli-v1.59.0-beta.3) (2025-12-22)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
* The following workspace dependencies were updated
|
|
129
|
+
* dependencies
|
|
130
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.4
|
|
131
|
+
|
|
132
|
+
## [1.59.0-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.58.1-beta.2...cli-v1.59.0-beta.2) (2025-12-19)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* add prompt caching for OpenAI/Gemini/Anthropic and cache token display ([#838](https://github.com/AIGNE-io/aigne-framework/issues/838)) ([46c628f](https://github.com/AIGNE-io/aigne-framework/commit/46c628f180572ea1b955d1a9888aad6145204842))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* The following workspace dependencies were updated
|
|
143
|
+
* dependencies
|
|
144
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.3
|
|
145
|
+
* @aigne/agent-library bumped to 1.24.0-beta.3
|
|
146
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.3
|
|
147
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.3
|
|
148
|
+
* @aigne/core bumped to 1.72.0-beta.3
|
|
149
|
+
* @aigne/default-memory bumped to 1.3.6-beta.3
|
|
150
|
+
* @aigne/observability-api bumped to 0.11.14-beta.1
|
|
151
|
+
* @aigne/openai bumped to 0.16.16-beta.3
|
|
152
|
+
* @aigne/secrets bumped to 0.1.6-beta.3
|
|
153
|
+
* devDependencies
|
|
154
|
+
* @aigne/test-utils bumped to 0.5.69-beta.3
|
|
155
|
+
|
|
3
156
|
## [1.58.1-beta.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.58.1-beta.1...cli-v1.58.1-beta.2) (2025-12-19)
|
|
4
157
|
|
|
5
158
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert";
|
|
2
2
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
3
|
+
import { v7 } from "@aigne/uuid";
|
|
3
4
|
import { runAgentWithAIGNE } from "../../utils/run-with-aigne.js";
|
|
4
5
|
import { parseAgentInput, withAgentInputSchema, } from "../../utils/yargs.js";
|
|
5
6
|
import { serveMCPServerFromDir } from "../serve-mcp.js";
|
|
@@ -97,6 +98,7 @@ export async function invokeAgent(options) {
|
|
|
97
98
|
...options.input,
|
|
98
99
|
input,
|
|
99
100
|
chat: options.input.chat,
|
|
101
|
+
sessionId: v7(),
|
|
100
102
|
});
|
|
101
103
|
}
|
|
102
104
|
finally {
|
package/dist/tracer/terminal.js
CHANGED
|
@@ -118,7 +118,11 @@ export class TerminalTracer {
|
|
|
118
118
|
taskWrapper.title = await this.formatTaskTitle(task.agent, {
|
|
119
119
|
input: task.input,
|
|
120
120
|
task,
|
|
121
|
-
usage: Boolean(task.usage.inputTokens ||
|
|
121
|
+
usage: Boolean(task.usage.inputTokens ||
|
|
122
|
+
task.usage.outputTokens ||
|
|
123
|
+
task.usage.aigneHubCredits ||
|
|
124
|
+
task.usage.cacheCreationInputTokens ||
|
|
125
|
+
task.usage.cacheReadInputTokens),
|
|
122
126
|
time: context.id === collapsed.ancestor.contextId,
|
|
123
127
|
});
|
|
124
128
|
if (context.id === collapsed.ancestor.contextId) {
|
|
@@ -255,6 +259,12 @@ export class TerminalTracer {
|
|
|
255
259
|
formatTokenUsage(usage, extra) {
|
|
256
260
|
const items = [
|
|
257
261
|
[chalk.yellow(usage.inputTokens), chalk.grey("input tokens")],
|
|
262
|
+
usage.cacheReadInputTokens
|
|
263
|
+
? [chalk.green(usage.cacheReadInputTokens), chalk.grey("cached")]
|
|
264
|
+
: undefined,
|
|
265
|
+
usage.cacheCreationInputTokens
|
|
266
|
+
? [chalk.yellow(usage.cacheCreationInputTokens), chalk.grey("cache write")]
|
|
267
|
+
: undefined,
|
|
258
268
|
[chalk.cyan(usage.outputTokens), chalk.grey("output tokens")],
|
|
259
269
|
usage.aigneHubCredits
|
|
260
270
|
? this.formatAigneHubCredits(usage.aigneHubCredits, usage.creditPrefix)
|
|
@@ -6,6 +6,7 @@ export declare function terminalInput({ render: r, ...options }?: {
|
|
|
6
6
|
required?: boolean;
|
|
7
7
|
validate?: (input: string) => string | boolean | Promise<string | boolean>;
|
|
8
8
|
render?: typeof render;
|
|
9
|
+
clear?: boolean;
|
|
9
10
|
}): Promise<string>;
|
|
10
11
|
export declare function TerminalInput(props: {
|
|
11
12
|
message?: string;
|
|
@@ -12,10 +12,14 @@ export async function terminalInput({ render: r = render, ...options } = {}) {
|
|
|
12
12
|
process.addListener("SIGINT", handleSigInt);
|
|
13
13
|
const clean = () => process.removeListener("SIGINT", handleSigInt);
|
|
14
14
|
const app = r(_jsx(TerminalInput, { ...options, onSubmit: (value) => {
|
|
15
|
+
if (options.clear)
|
|
16
|
+
app.clear();
|
|
15
17
|
app.unmount();
|
|
16
18
|
resolve(value);
|
|
17
19
|
clean();
|
|
18
20
|
}, onError: (error) => {
|
|
21
|
+
if (options.clear)
|
|
22
|
+
app.clear();
|
|
19
23
|
app.unmount();
|
|
20
24
|
reject(error);
|
|
21
25
|
clean();
|
package/dist/utils/listr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AgentResponseStream, type Message } from "@aigne/core";
|
|
2
2
|
import type { PromiseOrValue } from "@aigne/core/utils/type-utils.js";
|
|
3
3
|
import { DefaultRenderer, Listr, type ListrDefaultRendererOptions, ListrLogger, type ListrSimpleRendererOptions, type ListrTaskWrapper, SimpleRenderer, Spinner } from "@aigne/listr2";
|
|
4
4
|
import type { createLogUpdate } from "log-update";
|
|
@@ -22,7 +22,9 @@ export declare class AIGNEListr extends Listr<object, typeof AIGNEListrRenderer,
|
|
|
22
22
|
renderImage?: boolean;
|
|
23
23
|
}) => string | Promise<string>;
|
|
24
24
|
}, ...[task, options, parentTask]: ConstructorParameters<typeof Listr<object, typeof AIGNEListrRenderer, typeof AIGNEListrFallbackRenderer>>);
|
|
25
|
+
private needLogResult;
|
|
25
26
|
run(stream: () => PromiseOrValue<AgentResponseStream<Message>>): Promise<Message>;
|
|
27
|
+
private marked;
|
|
26
28
|
private extractStream;
|
|
27
29
|
}
|
|
28
30
|
export interface AIGNEListrRendererOptions extends ListrDefaultRendererOptions {
|
package/dist/utils/listr.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { EOL } from "node:os";
|
|
2
2
|
import { format } from "node:util";
|
|
3
|
+
import { isAgentResponseProgress } from "@aigne/core";
|
|
3
4
|
import { LogLevel, logger } from "@aigne/core/utils/logger.js";
|
|
4
5
|
import { mergeAgentResponseChunk } from "@aigne/core/utils/stream-utils.js";
|
|
5
6
|
import { color, DefaultRenderer, figures, Listr, ListrDefaultRendererLogLevels, ListrLogger, SimpleRenderer, Spinner, } from "@aigne/listr2";
|
|
7
|
+
import { markedTerminal } from "@aigne/marked-terminal";
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import { Marked } from "marked";
|
|
6
10
|
import wrap from "wrap-ansi";
|
|
7
11
|
export class AIGNEListr extends Listr {
|
|
8
12
|
myOptions;
|
|
@@ -15,13 +19,12 @@ export class AIGNEListr extends Listr {
|
|
|
15
19
|
getStdoutLogs: () => {
|
|
16
20
|
return this.logs.splice(0);
|
|
17
21
|
},
|
|
18
|
-
getBottomBarLogs: (
|
|
19
|
-
if (!options?.running)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return [r];
|
|
22
|
+
getBottomBarLogs: (_options) => {
|
|
23
|
+
// if (!options?.running) return [];
|
|
24
|
+
// const r = this.myOptions.formatResult(this.result);
|
|
25
|
+
// if (typeof r !== "string") throw new Error("Must return a string result for running task");
|
|
26
|
+
// return [r];
|
|
27
|
+
return [];
|
|
25
28
|
},
|
|
26
29
|
};
|
|
27
30
|
super(task, {
|
|
@@ -55,6 +58,7 @@ export class AIGNEListr extends Listr {
|
|
|
55
58
|
this.myOptions = myOptions;
|
|
56
59
|
this.spinner = new Spinner();
|
|
57
60
|
}
|
|
61
|
+
needLogResult = true;
|
|
58
62
|
async run(stream) {
|
|
59
63
|
const originalLog = logger.logMessage;
|
|
60
64
|
const originalConsole = { ...console };
|
|
@@ -81,7 +85,9 @@ export class AIGNEListr extends Listr {
|
|
|
81
85
|
throw this.error;
|
|
82
86
|
return { ...this.result };
|
|
83
87
|
});
|
|
84
|
-
|
|
88
|
+
if (this.needLogResult) {
|
|
89
|
+
console.log(await this.myOptions.formatResult(this.result, { running: false, renderImage: true }));
|
|
90
|
+
}
|
|
85
91
|
return result;
|
|
86
92
|
}
|
|
87
93
|
finally {
|
|
@@ -90,11 +96,56 @@ export class AIGNEListr extends Listr {
|
|
|
90
96
|
this.spinner.stop();
|
|
91
97
|
}
|
|
92
98
|
}
|
|
99
|
+
marked = new Marked().use({
|
|
100
|
+
// marked-terminal does not support code block meta, so we need to strip it
|
|
101
|
+
walkTokens: (token) => {
|
|
102
|
+
if (token.type === "code") {
|
|
103
|
+
if (typeof token.lang === "string") {
|
|
104
|
+
token.lang = token.lang.trim().split(/\s+/)[0];
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
}, markedTerminal({ forceHyperLink: false }, {
|
|
109
|
+
theme: {
|
|
110
|
+
string: chalk.green,
|
|
111
|
+
},
|
|
112
|
+
}));
|
|
93
113
|
async extractStream(stream) {
|
|
94
114
|
try {
|
|
95
115
|
this.result = {};
|
|
96
116
|
for await (const value of stream) {
|
|
97
117
|
mergeAgentResponseChunk(this.result, value);
|
|
118
|
+
if (isAgentResponseProgress(value) && value.progress.event === "message") {
|
|
119
|
+
const { message } = value.progress;
|
|
120
|
+
const rendered = [];
|
|
121
|
+
if (message.role === "user" || message.role === "agent") {
|
|
122
|
+
if (message.role === "agent" && message.toolCalls) {
|
|
123
|
+
for (const call of message.toolCalls) {
|
|
124
|
+
rendered.push(`${chalk.bold.gray(`[${call.function.name}]`)} ${chalk.gray(`${JSON.stringify(call.function.arguments).slice(0, 200)}...`)}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (typeof message.content === "string") {
|
|
128
|
+
rendered.push(this.marked.parse(message.content, { async: false }).trim());
|
|
129
|
+
}
|
|
130
|
+
else if (Array.isArray(message.content)) {
|
|
131
|
+
for (const msg of message.content) {
|
|
132
|
+
if (msg.type === "text") {
|
|
133
|
+
if (msg.isThinking) {
|
|
134
|
+
rendered.push(chalk.dim(chalk.grey(chalk.italic(`[Thinking] ${msg.text}`))));
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
rendered.push(this.marked.parse(msg.text, { async: false }).trim());
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (rendered.length) {
|
|
144
|
+
const prefix = message.role === "user" ? chalk.blue.bold(">") : chalk.green.bold("•");
|
|
145
|
+
console.log(`${prefix} ${rendered.join("\n")}\n`);
|
|
146
|
+
this.needLogResult = false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
98
149
|
}
|
|
99
150
|
return this.result;
|
|
100
151
|
}
|
package/dist/utils/load-aigne.js
CHANGED
|
@@ -55,12 +55,12 @@ export async function loadAIGNE({ path, modelOptions, imageModelOptions, skipMod
|
|
|
55
55
|
availableModules: [
|
|
56
56
|
{
|
|
57
57
|
module: "history",
|
|
58
|
-
|
|
58
|
+
load: (options) => import("@aigne/afs-history").then((m) => new m.AFSHistory(options.parsed)),
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
module: "local-fs",
|
|
62
62
|
alias: ["system-fs"],
|
|
63
|
-
|
|
63
|
+
load: (options) => import("@aigne/afs-local-fs").then((m) => m.LocalFS.load(options)),
|
|
64
64
|
},
|
|
65
65
|
],
|
|
66
66
|
},
|
|
@@ -19,6 +19,7 @@ export async function runChatLoopInTerminal(userAgent, options = {}) {
|
|
|
19
19
|
const question = await terminalInput({
|
|
20
20
|
message: "💬",
|
|
21
21
|
default: i === 0 ? options?.defaultQuestion : undefined,
|
|
22
|
+
clear: true,
|
|
22
23
|
});
|
|
23
24
|
if (!question?.trim())
|
|
24
25
|
continue;
|
|
@@ -74,7 +75,7 @@ async function callAgent(userAgent, input, options) {
|
|
|
74
75
|
const tracer = new TerminalTracer(userAgent.context, options);
|
|
75
76
|
await tracer.run(userAgent, typeof input === "string"
|
|
76
77
|
? { ...options.input, [options.inputKey || DEFAULT_CHAT_INPUT_KEY]: input }
|
|
77
|
-
: { ...options.input, ...input });
|
|
78
|
+
: { ...options.input, ...input }, { userContext: { sessionId: options.sessionId } });
|
|
78
79
|
}
|
|
79
80
|
const COMMANDS = {
|
|
80
81
|
"/exit": () => ({ exit: true }),
|
|
@@ -15,7 +15,8 @@ export declare function runWithAIGNE(agentCreator: ((aigne: AIGNE) => PromiseOrV
|
|
|
15
15
|
modelOptions?: ChatModelInputOptions;
|
|
16
16
|
outputKey?: string;
|
|
17
17
|
}): Promise<void>;
|
|
18
|
-
export declare function runAgentWithAIGNE(aigne: AIGNE, agent: Agent, { outputKey, outputFileKey, chatLoopOptions, ...options }?: {
|
|
18
|
+
export declare function runAgentWithAIGNE(aigne: AIGNE, agent: Agent, { sessionId, outputKey, outputFileKey, chatLoopOptions, ...options }?: {
|
|
19
|
+
sessionId?: string;
|
|
19
20
|
outputKey?: string;
|
|
20
21
|
outputFileKey?: string;
|
|
21
22
|
chatLoopOptions?: ChatLoopOptions;
|
|
@@ -84,7 +84,7 @@ export async function runWithAIGNE(agentCreator, { aigne, argv = process.argv, c
|
|
|
84
84
|
process.exit(1);
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
export async function runAgentWithAIGNE(aigne, agent, { outputKey, outputFileKey, chatLoopOptions, ...options } = {}) {
|
|
87
|
+
export async function runAgentWithAIGNE(aigne, agent, { sessionId, outputKey, outputFileKey, chatLoopOptions, ...options } = {}) {
|
|
88
88
|
if (options.output) {
|
|
89
89
|
const outputPath = isAbsolute(options.output)
|
|
90
90
|
? options.output
|
|
@@ -112,6 +112,7 @@ export async function runAgentWithAIGNE(aigne, agent, { outputKey, outputFileKey
|
|
|
112
112
|
outputKey,
|
|
113
113
|
inputFileKey: agent instanceof AIAgent ? agent.inputFileKey : undefined,
|
|
114
114
|
input: options.input,
|
|
115
|
+
sessionId,
|
|
115
116
|
});
|
|
116
117
|
return;
|
|
117
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.0-beta.10",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@aigne/json-schema-to-zod": "^1.3.3",
|
|
49
49
|
"@aigne/listr2": "^1.0.10",
|
|
50
50
|
"@aigne/marked-terminal": "^7.3.2",
|
|
51
|
+
"@aigne/uuid": "^13.0.1",
|
|
51
52
|
"@fast-csv/format": "^5.0.5",
|
|
52
53
|
"@inquirer/core": "^10.2.2",
|
|
53
54
|
"@inquirer/figures": "^1.0.13",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"marked": "^16.3.0",
|
|
75
76
|
"nunjucks": "^3.2.4",
|
|
76
77
|
"open": "^10.2.0",
|
|
77
|
-
"openai": "^6.
|
|
78
|
+
"openai": "^6.14.0",
|
|
78
79
|
"p-wait-for": "^5.0.2",
|
|
79
80
|
"prettier": "^3.6.2",
|
|
80
81
|
"react": "^19.1.1",
|
|
@@ -89,17 +90,17 @@
|
|
|
89
90
|
"yoctocolors-cjs": "^2.1.3",
|
|
90
91
|
"zod": "^3.25.67",
|
|
91
92
|
"zod-to-json-schema": "^3.24.6",
|
|
92
|
-
"@aigne/afs": "^1.4.0-beta.
|
|
93
|
-
"@aigne/afs-history": "^1.2.0-beta.
|
|
94
|
-
"@aigne/afs-local-fs": "^1.4.0-beta.
|
|
95
|
-
"@aigne/agentic-memory": "^1.1.6-beta.
|
|
96
|
-
"@aigne/agent-library": "^1.24.0-beta.
|
|
97
|
-
"@aigne/
|
|
98
|
-
"@aigne/
|
|
99
|
-
"@aigne/
|
|
100
|
-
"@aigne/
|
|
101
|
-
"@aigne/
|
|
102
|
-
"@aigne/
|
|
93
|
+
"@aigne/afs": "^1.4.0-beta.4",
|
|
94
|
+
"@aigne/afs-history": "^1.2.0-beta.4",
|
|
95
|
+
"@aigne/afs-local-fs": "^1.4.0-beta.7",
|
|
96
|
+
"@aigne/agentic-memory": "^1.1.6-beta.7",
|
|
97
|
+
"@aigne/agent-library": "^1.24.0-beta.9",
|
|
98
|
+
"@aigne/core": "^1.72.0-beta.7",
|
|
99
|
+
"@aigne/default-memory": "^1.4.0-beta.6",
|
|
100
|
+
"@aigne/aigne-hub": "^0.10.16-beta.11",
|
|
101
|
+
"@aigne/observability-api": "^0.11.14-beta.1",
|
|
102
|
+
"@aigne/openai": "^0.16.16-beta.7",
|
|
103
|
+
"@aigne/secrets": "^0.1.6-beta.7"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
106
|
"@inquirer/testing": "^2.1.50",
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"rimraf": "^6.0.1",
|
|
117
118
|
"typescript": "^5.9.2",
|
|
118
119
|
"ufo": "^1.6.1",
|
|
119
|
-
"@aigne/test-utils": "^0.5.69-beta.
|
|
120
|
+
"@aigne/test-utils": "^0.5.69-beta.7"
|
|
120
121
|
},
|
|
121
122
|
"scripts": {
|
|
122
123
|
"lint": "tsc --noEmit",
|