@aigne/cli 1.58.1-beta.2 → 1.59.0-beta.11

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 CHANGED
@@ -1,5 +1,183 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.59.0-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.10...cli-v1.59.0-beta.11) (2025-12-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * add session compact support for AIAgent ([#863](https://github.com/AIGNE-io/aigne-framework/issues/863)) ([9010918](https://github.com/AIGNE-io/aigne-framework/commit/9010918cd3f18b02b5c60ddc9ed5c34b568d0b28))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/afs bumped to 1.4.0-beta.5
16
+ * @aigne/afs-history bumped to 1.2.0-beta.5
17
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.8
18
+ * @aigne/agent-library bumped to 1.24.0-beta.10
19
+ * @aigne/agentic-memory bumped to 1.1.6-beta.8
20
+ * @aigne/aigne-hub bumped to 0.10.16-beta.12
21
+ * @aigne/core bumped to 1.72.0-beta.8
22
+ * @aigne/default-memory bumped to 1.4.0-beta.7
23
+ * @aigne/openai bumped to 0.16.16-beta.8
24
+ * @aigne/secrets bumped to 0.1.6-beta.8
25
+ * devDependencies
26
+ * @aigne/test-utils bumped to 0.5.69-beta.8
27
+
28
+ ## [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)
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * The following workspace dependencies were updated
34
+ * dependencies
35
+ * @aigne/agent-library bumped to 1.24.0-beta.9
36
+ * @aigne/aigne-hub bumped to 0.10.16-beta.11
37
+
38
+ ## [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)
39
+
40
+
41
+ ### Features
42
+
43
+ * **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))
44
+
45
+
46
+ ### Dependencies
47
+
48
+ * The following workspace dependencies were updated
49
+ * dependencies
50
+ * @aigne/afs bumped to 1.4.0-beta.4
51
+ * @aigne/afs-history bumped to 1.2.0-beta.4
52
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.7
53
+ * @aigne/agent-library bumped to 1.24.0-beta.8
54
+ * @aigne/agentic-memory bumped to 1.1.6-beta.7
55
+ * @aigne/aigne-hub bumped to 0.10.16-beta.10
56
+ * @aigne/core bumped to 1.72.0-beta.7
57
+ * @aigne/default-memory bumped to 1.4.0-beta.6
58
+ * @aigne/openai bumped to 0.16.16-beta.7
59
+ * @aigne/secrets bumped to 0.1.6-beta.7
60
+ * devDependencies
61
+ * @aigne/test-utils bumped to 0.5.69-beta.7
62
+
63
+ ## [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)
64
+
65
+
66
+ ### Dependencies
67
+
68
+ * The following workspace dependencies were updated
69
+ * dependencies
70
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.6
71
+ * @aigne/agent-library bumped to 1.24.0-beta.7
72
+ * @aigne/agentic-memory bumped to 1.1.6-beta.6
73
+ * @aigne/aigne-hub bumped to 0.10.16-beta.9
74
+ * @aigne/core bumped to 1.72.0-beta.6
75
+ * @aigne/default-memory bumped to 1.3.6-beta.6
76
+ * @aigne/openai bumped to 0.16.16-beta.6
77
+ * @aigne/secrets bumped to 0.1.6-beta.6
78
+ * devDependencies
79
+ * @aigne/test-utils bumped to 0.5.69-beta.6
80
+
81
+ ## [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)
82
+
83
+
84
+ ### Dependencies
85
+
86
+ * The following workspace dependencies were updated
87
+ * dependencies
88
+ * @aigne/aigne-hub bumped to 0.10.16-beta.8
89
+
90
+ ## [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)
91
+
92
+
93
+ ### Dependencies
94
+
95
+ * The following workspace dependencies were updated
96
+ * dependencies
97
+ * @aigne/agent-library bumped to 1.24.0-beta.6
98
+ * @aigne/aigne-hub bumped to 0.10.16-beta.7
99
+
100
+ ## [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)
101
+
102
+
103
+ ### Dependencies
104
+
105
+ * The following workspace dependencies were updated
106
+ * dependencies
107
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.5
108
+ * @aigne/agent-library bumped to 1.24.0-beta.5
109
+ * @aigne/agentic-memory bumped to 1.1.6-beta.5
110
+ * @aigne/aigne-hub bumped to 0.10.16-beta.6
111
+ * @aigne/core bumped to 1.72.0-beta.5
112
+ * @aigne/default-memory bumped to 1.3.6-beta.5
113
+ * @aigne/openai bumped to 0.16.16-beta.5
114
+ * @aigne/secrets bumped to 0.1.6-beta.5
115
+ * devDependencies
116
+ * @aigne/test-utils bumped to 0.5.69-beta.5
117
+
118
+ ## [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)
119
+
120
+
121
+ ### Features
122
+
123
+ * add Agent Skill support ([#787](https://github.com/AIGNE-io/aigne-framework/issues/787)) ([f04fbe7](https://github.com/AIGNE-io/aigne-framework/commit/f04fbe76ec24cf3c59c74adf92d87b0c3784a8f7))
124
+
125
+
126
+ ### Bug Fixes
127
+
128
+ * **cli:** improve terminal outputs ([#847](https://github.com/AIGNE-io/aigne-framework/issues/847)) ([329e91b](https://github.com/AIGNE-io/aigne-framework/commit/329e91bc3323f72fc8a2d278ff5e6bba9adbd6e0))
129
+
130
+
131
+ ### Dependencies
132
+
133
+ * The following workspace dependencies were updated
134
+ * dependencies
135
+ * @aigne/afs bumped to 1.4.0-beta.3
136
+ * @aigne/afs-history bumped to 1.2.0-beta.3
137
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.4
138
+ * @aigne/agent-library bumped to 1.24.0-beta.4
139
+ * @aigne/agentic-memory bumped to 1.1.6-beta.4
140
+ * @aigne/aigne-hub bumped to 0.10.16-beta.5
141
+ * @aigne/core bumped to 1.72.0-beta.4
142
+ * @aigne/default-memory bumped to 1.3.6-beta.4
143
+ * @aigne/openai bumped to 0.16.16-beta.4
144
+ * @aigne/secrets bumped to 0.1.6-beta.4
145
+ * devDependencies
146
+ * @aigne/test-utils bumped to 0.5.69-beta.4
147
+
148
+ ## [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)
149
+
150
+
151
+ ### Dependencies
152
+
153
+ * The following workspace dependencies were updated
154
+ * dependencies
155
+ * @aigne/aigne-hub bumped to 0.10.16-beta.4
156
+
157
+ ## [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)
158
+
159
+
160
+ ### Features
161
+
162
+ * 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))
163
+
164
+
165
+ ### Dependencies
166
+
167
+ * The following workspace dependencies were updated
168
+ * dependencies
169
+ * @aigne/afs-local-fs bumped to 1.4.0-beta.3
170
+ * @aigne/agent-library bumped to 1.24.0-beta.3
171
+ * @aigne/agentic-memory bumped to 1.1.6-beta.3
172
+ * @aigne/aigne-hub bumped to 0.10.16-beta.3
173
+ * @aigne/core bumped to 1.72.0-beta.3
174
+ * @aigne/default-memory bumped to 1.3.6-beta.3
175
+ * @aigne/observability-api bumped to 0.11.14-beta.1
176
+ * @aigne/openai bumped to 0.16.16-beta.3
177
+ * @aigne/secrets bumped to 0.1.6-beta.3
178
+ * devDependencies
179
+ * @aigne/test-utils bumped to 0.5.69-beta.3
180
+
3
181
  ## [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
182
 
5
183
 
@@ -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: options.input.sessionId || v7(),
100
102
  });
101
103
  }
102
104
  finally {
@@ -60,15 +60,16 @@ export function createRunCommand({ aigneFilePath, } = {}) {
60
60
  }
61
61
  }
62
62
  const path = aigneFilePath || options.path || ".";
63
- if (!(await findAIGNEFile(path).catch((error) => {
64
- if (options._[0] !== "run") {
65
- yargsInstance?.showHelp();
66
- }
67
- else {
68
- throw error;
69
- }
70
- return false;
71
- }))) {
63
+ if (!isUrl(path) &&
64
+ !(await findAIGNEFile(path).catch((error) => {
65
+ if (options._[0] !== "run") {
66
+ yargsInstance?.showHelp();
67
+ }
68
+ else {
69
+ throw error;
70
+ }
71
+ return false;
72
+ }))) {
72
73
  return;
73
74
  }
74
75
  // Parse model options for loading application
@@ -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 || task.usage.outputTokens || task.usage.aigneHubCredits),
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();
@@ -1,5 +1,5 @@
1
1
  import { logger } from "@aigne/core/utils/logger.js";
2
- import { AIGNE_ENV_FILE } from "../constants.js";
2
+ import { AIGNE_ENV_FILE, isTest } from "../constants.js";
3
3
  import FileStore from "./file.js";
4
4
  import KeyringStore from "./keytar.js";
5
5
  import { migrateFileToKeyring } from "./migrate.js";
@@ -32,7 +32,7 @@ const getSecretStore = async () => {
32
32
  cachedSecretStore = await createSecretStore({
33
33
  filepath: AIGNE_ENV_FILE,
34
34
  serviceName: "aigne-hub",
35
- // forceKeytarUnavailable: true,
35
+ forceKeytarUnavailable: Boolean(isTest),
36
36
  });
37
37
  }
38
38
  return cachedSecretStore;
@@ -1,4 +1,4 @@
1
- import type { AgentResponseStream, Message } from "@aigne/core";
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 {
@@ -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: (options) => {
19
- if (!options?.running)
20
- return [];
21
- const r = this.myOptions.formatResult(this.result);
22
- if (typeof r !== "string")
23
- throw new Error("Must return a string result for running task");
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
- console.log(await this.myOptions.formatResult(this.result, { running: false, renderImage: true }));
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
  }
@@ -55,12 +55,12 @@ export async function loadAIGNE({ path, modelOptions, imageModelOptions, skipMod
55
55
  availableModules: [
56
56
  {
57
57
  module: "history",
58
- create: (options) => import("@aigne/afs-history").then((m) => new m.AFSHistory(options)),
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
- create: (options) => import("@aigne/afs-local-fs").then((m) => new m.LocalFS(options)),
63
+ load: (options) => import("@aigne/afs-local-fs").then((m) => m.LocalFS.load(options)),
64
64
  },
65
65
  ],
66
66
  },
@@ -1,6 +1,7 @@
1
1
  import { type Message, type UserAgent } from "@aigne/core";
2
2
  export declare const DEFAULT_CHAT_INPUT_KEY = "message";
3
3
  export interface ChatLoopOptions {
4
+ sessionId?: string;
4
5
  initialCall?: Message | string;
5
6
  welcome?: string;
6
7
  defaultQuestion?: string;
@@ -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
  }
@@ -5,6 +5,8 @@ import { ZodType } from "zod";
5
5
  export type InferArgv<T> = T extends Argv<infer U> ? U : never;
6
6
  export declare const withRunAgentCommonOptions: (yargs: Argv) => Argv<{
7
7
  chat: boolean;
8
+ } & {
9
+ "session-id": string | undefined;
8
10
  } & {
9
11
  model: string | undefined;
10
12
  } & {
@@ -56,6 +58,8 @@ export declare function withAgentInputSchema(yargs: Argv, options: Pick<Agent, "
56
58
  optionalInputs?: string[];
57
59
  }): Argv<{
58
60
  chat: boolean;
61
+ } & {
62
+ "session-id": string | undefined;
59
63
  } & {
60
64
  model: string | undefined;
61
65
  } & {
@@ -15,6 +15,10 @@ export const withRunAgentCommonOptions = (yargs) => yargs
15
15
  describe: "Run chat loop in terminal",
16
16
  type: "boolean",
17
17
  default: false,
18
+ })
19
+ .option("session-id", {
20
+ describe: "Session ID for chat-based agents to maintain context across interactions",
21
+ type: "string",
18
22
  })
19
23
  .option("model", {
20
24
  group: MODEL_OPTIONS_GROUP_NAME,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.58.1-beta.2",
3
+ "version": "1.59.0-beta.11",
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.6.0",
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.2",
93
- "@aigne/afs-history": "^1.2.0-beta.2",
94
- "@aigne/afs-local-fs": "^1.4.0-beta.2",
95
- "@aigne/agentic-memory": "^1.1.6-beta.2",
96
- "@aigne/agent-library": "^1.24.0-beta.2",
97
- "@aigne/aigne-hub": "^0.10.16-beta.2",
98
- "@aigne/core": "^1.72.0-beta.2",
99
- "@aigne/default-memory": "^1.3.6-beta.2",
100
- "@aigne/openai": "^0.16.16-beta.2",
101
- "@aigne/secrets": "^0.1.6-beta.2",
102
- "@aigne/observability-api": "^0.11.14-beta"
93
+ "@aigne/afs": "^1.4.0-beta.5",
94
+ "@aigne/afs-local-fs": "^1.4.0-beta.8",
95
+ "@aigne/afs-history": "^1.2.0-beta.5",
96
+ "@aigne/agent-library": "^1.24.0-beta.10",
97
+ "@aigne/agentic-memory": "^1.1.6-beta.8",
98
+ "@aigne/aigne-hub": "^0.10.16-beta.12",
99
+ "@aigne/default-memory": "^1.4.0-beta.7",
100
+ "@aigne/observability-api": "^0.11.14-beta.1",
101
+ "@aigne/core": "^1.72.0-beta.8",
102
+ "@aigne/openai": "^0.16.16-beta.8",
103
+ "@aigne/secrets": "^0.1.6-beta.8"
103
104
  },
104
105
  "devDependencies": {
105
106
  "@inquirer/testing": "^2.1.50",
@@ -116,14 +117,14 @@
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.2"
120
+ "@aigne/test-utils": "^0.5.69-beta.8"
120
121
  },
121
122
  "scripts": {
122
123
  "lint": "tsc --noEmit",
123
124
  "build": "tsc --build tsconfig.build.json",
124
125
  "clean": "rimraf dist test/coverage templates/coverage",
125
- "test": "run-s test:src test:templates",
126
- "test:coverage": "run-s test:src:coverage test:templates:coverage",
126
+ "test": "npm run test:src && npm run test:templates",
127
+ "test:coverage": "npm run test:src:coverage && npm run test:templates:coverage",
127
128
  "test:src": "bun --cwd test test",
128
129
  "test:src:coverage": "bun --cwd test test --coverage --coverage-reporter=lcov --coverage-reporter=text",
129
130
  "test:templates": "cd templates && node --test",