@aigne/cli 1.50.1-beta.3 → 1.51.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,158 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.51.0-beta.11](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.10...cli-v1.51.0-beta.11) (2025-10-16)
4
+
5
+
6
+ ### Dependencies
7
+
8
+ * The following workspace dependencies were updated
9
+ * dependencies
10
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.5
11
+ * @aigne/agent-library bumped to 1.21.48-beta.9
12
+ * @aigne/agentic-memory bumped to 1.0.48-beta.9
13
+ * @aigne/aigne-hub bumped to 0.10.2-beta.9
14
+ * @aigne/core bumped to 1.63.0-beta.9
15
+ * @aigne/default-memory bumped to 1.2.11-beta.9
16
+ * @aigne/observability-api bumped to 0.11.2-beta.4
17
+ * @aigne/openai bumped to 0.16.2-beta.9
18
+ * devDependencies
19
+ * @aigne/test-utils bumped to 0.5.55-beta.9
20
+
21
+ ## [1.51.0-beta.10](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.9...cli-v1.51.0-beta.10) (2025-10-16)
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * The following workspace dependencies were updated
27
+ * dependencies
28
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.4
29
+ * @aigne/agent-library bumped to 1.21.48-beta.8
30
+ * @aigne/agentic-memory bumped to 1.0.48-beta.8
31
+ * @aigne/aigne-hub bumped to 0.10.2-beta.8
32
+ * @aigne/core bumped to 1.63.0-beta.8
33
+ * @aigne/default-memory bumped to 1.2.11-beta.8
34
+ * @aigne/observability-api bumped to 0.11.2-beta.3
35
+ * @aigne/openai bumped to 0.16.2-beta.8
36
+ * devDependencies
37
+ * @aigne/test-utils bumped to 0.5.55-beta.8
38
+
39
+ ## [1.51.0-beta.9](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.8...cli-v1.51.0-beta.9) (2025-10-16)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * ensure tips are only printed once during AIGNE loading ([#628](https://github.com/AIGNE-io/aigne-framework/issues/628)) ([7d49508](https://github.com/AIGNE-io/aigne-framework/commit/7d4950882436169986eedab75c232db2c0a30732))
45
+
46
+ ## [1.51.0-beta.8](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.7...cli-v1.51.0-beta.8) (2025-10-15)
47
+
48
+
49
+ ### Dependencies
50
+
51
+ * The following workspace dependencies were updated
52
+ * dependencies
53
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.3
54
+ * @aigne/agent-library bumped to 1.21.48-beta.7
55
+ * @aigne/agentic-memory bumped to 1.0.48-beta.7
56
+ * @aigne/aigne-hub bumped to 0.10.2-beta.7
57
+ * @aigne/core bumped to 1.63.0-beta.7
58
+ * @aigne/default-memory bumped to 1.2.11-beta.7
59
+ * @aigne/openai bumped to 0.16.2-beta.7
60
+ * devDependencies
61
+ * @aigne/test-utils bumped to 0.5.55-beta.7
62
+
63
+ ## [1.51.0-beta.7](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.51.0-beta.6...cli-v1.51.0-beta.7) (2025-10-15)
64
+
65
+
66
+ ### Dependencies
67
+
68
+ * The following workspace dependencies were updated
69
+ * dependencies
70
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.2
71
+ * @aigne/agent-library bumped to 1.21.48-beta.6
72
+ * @aigne/agentic-memory bumped to 1.0.48-beta.6
73
+ * @aigne/aigne-hub bumped to 0.10.2-beta.6
74
+ * @aigne/core bumped to 1.63.0-beta.6
75
+ * @aigne/default-memory bumped to 1.2.11-beta.6
76
+ * @aigne/observability-api bumped to 0.11.2-beta.2
77
+ * @aigne/openai bumped to 0.16.2-beta.6
78
+ * devDependencies
79
+ * @aigne/test-utils bumped to 0.5.55-beta.6
80
+
81
+ ## [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)
82
+
83
+
84
+ ### Bug Fixes
85
+
86
+ * 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))
87
+ * **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))
88
+
89
+
90
+ ### Dependencies
91
+
92
+ * The following workspace dependencies were updated
93
+ * dependencies
94
+ * @aigne/afs-system-fs bumped to 1.0.1-beta.1
95
+ * @aigne/agent-library bumped to 1.21.48-beta.5
96
+ * @aigne/agentic-memory bumped to 1.0.48-beta.5
97
+ * @aigne/aigne-hub bumped to 0.10.2-beta.5
98
+ * @aigne/core bumped to 1.63.0-beta.5
99
+ * @aigne/default-memory bumped to 1.2.11-beta.5
100
+ * @aigne/openai bumped to 0.16.2-beta.5
101
+ * devDependencies
102
+ * @aigne/test-utils bumped to 0.5.55-beta.5
103
+
104
+ ## [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)
105
+
106
+
107
+ ### Bug Fixes
108
+
109
+ * 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))
110
+
111
+ ## [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)
112
+
113
+
114
+ ### Dependencies
115
+
116
+ * The following workspace dependencies were updated
117
+ * dependencies
118
+ * @aigne/afs-system-fs bumped to 1.0.1-beta
119
+ * @aigne/agent-library bumped to 1.21.48-beta.4
120
+ * @aigne/agentic-memory bumped to 1.0.48-beta.4
121
+ * @aigne/aigne-hub bumped to 0.10.2-beta.4
122
+ * @aigne/core bumped to 1.63.0-beta.4
123
+ * @aigne/default-memory bumped to 1.2.11-beta.4
124
+ * @aigne/openai bumped to 0.16.2-beta.4
125
+ * devDependencies
126
+ * @aigne/test-utils bumped to 0.5.55-beta.4
127
+
128
+ ## [1.51.0-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.50.1-beta.3...cli-v1.51.0-beta.3) (2025-10-11)
129
+
130
+
131
+ ### Features
132
+
133
+ * **afs:** add module system fs for afs ([#594](https://github.com/AIGNE-io/aigne-framework/issues/594)) ([83c7b65](https://github.com/AIGNE-io/aigne-framework/commit/83c7b6555d21c606a5005eb05f6686882fb8ffa3))
134
+
135
+
136
+ ### Bug Fixes
137
+
138
+ * improve exit event handling for cli ([#609](https://github.com/AIGNE-io/aigne-framework/issues/609)) ([00211f8](https://github.com/AIGNE-io/aigne-framework/commit/00211f8ad4686ea673ea8e2eac5b850bcbd8c1f6))
139
+
140
+
141
+ ### Dependencies
142
+
143
+ * The following workspace dependencies were updated
144
+ * dependencies
145
+ * @aigne/afs-system-fs bumped to 1.0.0
146
+ * @aigne/agent-library bumped to 1.21.48-beta.3
147
+ * @aigne/agentic-memory bumped to 1.0.48-beta.3
148
+ * @aigne/aigne-hub bumped to 0.10.2-beta.3
149
+ * @aigne/core bumped to 1.63.0-beta.3
150
+ * @aigne/default-memory bumped to 1.2.11-beta.3
151
+ * @aigne/observability-api bumped to 0.11.2-beta.1
152
+ * @aigne/openai bumped to 0.16.2-beta.3
153
+ * devDependencies
154
+ * @aigne/test-utils bumped to 0.5.55-beta.3
155
+
3
156
  ## [1.50.1-beta.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.50.1-beta.2...cli-v1.50.1-beta.3) (2025-10-09)
4
157
 
5
158
 
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
- console.log(""); // Add an empty line for better readability
32
- console.error(`${chalk.red("Error:")} ${highlightUrl(error.message)}`);
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
  });
@@ -147,7 +147,7 @@ export const agentCommandModule = ({ dir, agent, chat, }) => {
147
147
  await runAIGNEInChildProcess("invokeCLIAgentFromDir", {
148
148
  dir,
149
149
  agent: agent.name,
150
- input: { ...options, chat },
150
+ input: { ...options, chat: chat ?? options.chat },
151
151
  });
152
152
  process.exit(0);
153
153
  },
@@ -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", dir).catch(async (error) => {
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
  }
@@ -111,7 +111,7 @@ async function loadApplication(path) {
111
111
  }
112
112
  // Load env files in the aigne directory
113
113
  config({ path: dir, silent: true });
114
- const aigne = await loadAIGNE({ path: dir, printTips: false });
114
+ const aigne = await loadAIGNE({ path: dir });
115
115
  return { aigne, path: dir };
116
116
  }
117
117
  async function downloadPackage(url, cacheDir) {
@@ -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 SIGINTError("Input aborted by user"));
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>>;
@@ -21,21 +21,37 @@ 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 = false, skipModelLoading = false, }) {
25
25
  let aigne;
26
26
  if (path) {
27
27
  aigne = await AIGNE.load(path, {
28
28
  memories: availableMemories,
29
- model: (options) => loadChatModel({
30
- ...options,
31
- ...omitBy(modelOptions ?? {}, (v) => isNil(v)),
32
- model: modelOptions?.model || process.env.MODEL || options?.model,
33
- }),
34
- imageModel: (options) => loadImageModel({
35
- ...options,
36
- ...omitBy(imageModelOptions ?? {}, (v) => isNil(v)),
37
- model: imageModelOptions?.model || process.env.IMAGE_MODEL || options?.model,
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
+ },
47
+ afs: {
48
+ availableModules: [
49
+ {
50
+ module: "system-fs",
51
+ create: (options) => import("@aigne/afs-system-fs").then((m) => new m.SystemFS(options)),
52
+ },
53
+ ],
54
+ },
39
55
  });
40
56
  }
41
57
  else {
@@ -1,7 +1,8 @@
1
- import { AIGNE, type Message } from "@aigne/core";
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(...args: Parameters<typeof AIGNE.load>): Promise<{
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(...args) {
40
- const aigne = await AIGNE.load(...args);
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: {
@@ -53,6 +52,7 @@ export async function invokeCLIAgentFromDirInChildProcess(options) {
53
52
  const aigne = await loadAIGNE({
54
53
  path: options.dir,
55
54
  modelOptions: options.input,
55
+ printTips: true,
56
56
  imageModelOptions: {
57
57
  model: options.input.imageModel,
58
58
  },
@@ -14,16 +14,25 @@ export function serializeAgent(agent) {
14
14
  }
15
15
  export async function runAIGNEInChildProcess(method, ...args) {
16
16
  return await new Promise((resolve, reject) => {
17
+ let completed = false;
17
18
  const child = fork(join(dirname(fileURLToPath(import.meta.url)), "./run-aigne-in-child-process-worker.js"));
18
19
  child.on("message", (event) => {
19
- if (event.method !== method)
20
+ if (event.method !== method) {
20
21
  reject(new Error(`Unknown method: ${event.method} expected: ${method}`));
21
- else if (event.error)
22
- reject(new Error(event.error.message));
23
- else
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 {
24
29
  resolve(event.result);
30
+ }
31
+ completed = true;
25
32
  });
26
33
  child.on("exit", (code) => {
34
+ if (!completed)
35
+ process.exit(code);
27
36
  reject(new Error(`Child process exited with code ${code}`));
28
37
  });
29
38
  child.send({ method, args, logLevel: logger.level });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.50.1-beta.3",
3
+ "version": "1.51.0-beta.11",
4
4
  "description": "Your command center for agent development",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -89,13 +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/agent-library": "^1.21.48-beta.2",
93
- "@aigne/aigne-hub": "^0.10.2-beta.2",
94
- "@aigne/agentic-memory": "^1.0.48-beta.2",
95
- "@aigne/core": "^1.63.0-beta.2",
96
- "@aigne/default-memory": "^1.2.11-beta.2",
97
- "@aigne/observability-api": "^0.11.2-beta",
98
- "@aigne/openai": "^0.16.2-beta.2"
92
+ "@aigne/afs-system-fs": "^1.0.1-beta.5",
93
+ "@aigne/agent-library": "^1.21.48-beta.9",
94
+ "@aigne/aigne-hub": "^0.10.2-beta.9",
95
+ "@aigne/core": "^1.63.0-beta.9",
96
+ "@aigne/agentic-memory": "^1.0.48-beta.9",
97
+ "@aigne/observability-api": "^0.11.2-beta.4",
98
+ "@aigne/openai": "^0.16.2-beta.9",
99
+ "@aigne/default-memory": "^1.2.11-beta.9"
99
100
  },
100
101
  "devDependencies": {
101
102
  "@inquirer/testing": "^2.1.50",
@@ -112,7 +113,7 @@
112
113
  "rimraf": "^6.0.1",
113
114
  "typescript": "^5.9.2",
114
115
  "ufo": "^1.6.1",
115
- "@aigne/test-utils": "^0.5.55-beta.2"
116
+ "@aigne/test-utils": "^0.5.55-beta.9"
116
117
  },
117
118
  "scripts": {
118
119
  "lint": "tsc --noEmit",
@@ -1,2 +0,0 @@
1
- export declare class SIGINTError extends Error {
2
- }
@@ -1,2 +0,0 @@
1
- export class SIGINTError extends Error {
2
- }