@aigne/cli 1.59.0-beta.29 → 1.59.0-beta.30
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 +27 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/utils/aigne-hub/store/index.d.ts +1 -0
- package/dist/utils/aigne-hub/store/index.js +3 -0
- package/dist/utils/inquirer/checkbox.js +0 -1
- package/dist/utils/load-aigne.d.ts +2 -1
- package/dist/utils/load-aigne.js +4 -9
- package/dist/utils/run-chat-loop.js +0 -2
- package/dist/utils/run-with-aigne.js +25 -2
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.59.0-beta.30](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.29...cli-v1.59.0-beta.30) (2026-01-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **afs:** add AFSJSON module support mount a JSON/yaml file to AFS ([6adedc6](https://github.com/AIGNE-io/aigne-framework/commit/6adedc624bedb1bc741da8534f2fbb41e1bc6623))
|
|
9
|
+
* **cli:** start AFS explorer when agent running ([d532ff6](https://github.com/AIGNE-io/aigne-framework/commit/d532ff65d08fb295b3b68390f303f23cd9c266db))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @aigne/afs bumped to 1.4.0-beta.10
|
|
17
|
+
* @aigne/afs-explorer bumped to 1.0.0
|
|
18
|
+
* @aigne/afs-history bumped to 1.2.0-beta.11
|
|
19
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.25
|
|
20
|
+
* @aigne/agent-library bumped to 1.24.0-beta.26
|
|
21
|
+
* @aigne/agentic-memory bumped to 1.1.6-beta.24
|
|
22
|
+
* @aigne/aigne-hub bumped to 0.10.16-beta.30
|
|
23
|
+
* @aigne/core bumped to 1.72.0-beta.24
|
|
24
|
+
* @aigne/default-memory bumped to 1.4.0-beta.23
|
|
25
|
+
* @aigne/openai bumped to 0.16.16-beta.24
|
|
26
|
+
* @aigne/secrets bumped to 0.1.6-beta.24
|
|
27
|
+
* devDependencies
|
|
28
|
+
* @aigne/test-utils bumped to 0.5.69-beta.24
|
|
29
|
+
|
|
3
30
|
## [1.59.0-beta.29](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.59.0-beta.28...cli-v1.59.0-beta.29) (2026-01-15)
|
|
4
31
|
|
|
5
32
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare const availableMemories: (typeof DefaultMemory)[];
|
|
|
4
4
|
export declare const AIGNE_HUB_CREDITS_NOT_ENOUGH_ERROR_TYPE = "NOT_ENOUGH";
|
|
5
5
|
export declare const CHAT_MODEL_OPTIONS: string[];
|
|
6
6
|
export declare const DEFAULT_USER_ID = "cli-user";
|
|
7
|
+
export declare const DEFAULT_AFS_EXPLORER_PORT = 9670;
|
package/dist/constants.js
CHANGED
|
@@ -153,7 +153,6 @@ export default createPrompt((config, done) => {
|
|
|
153
153
|
let next = active;
|
|
154
154
|
do {
|
|
155
155
|
next = (next + offset + items.length) % items.length;
|
|
156
|
-
// biome-ignore lint/style/noNonNullAssertion: we need to access items dynamically
|
|
157
156
|
} while (!isSelectable(items[next]));
|
|
158
157
|
setActive(next);
|
|
159
158
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIGNE, type ChatModelInputOptions, type ImageModelInputOptions } from "@aigne/core";
|
|
1
|
+
import { AIGNE, type ChatModel, type ChatModelInputOptions, type ImageModelInputOptions } from "@aigne/core";
|
|
2
2
|
import type { AIGNEMetadata } from "@aigne/core/aigne/type.js";
|
|
3
3
|
import type { LoadCredentialOptions } from "./aigne-hub/type.js";
|
|
4
4
|
import type { AgentRunCommonOptions } from "./yargs.js";
|
|
@@ -8,6 +8,7 @@ export interface RunOptions extends AgentRunCommonOptions {
|
|
|
8
8
|
cacheDir?: string;
|
|
9
9
|
aigneHubUrl?: string;
|
|
10
10
|
}
|
|
11
|
+
export declare function printChatModelInfoBox(model: ChatModel, otherLines?: string[]): Promise<void>;
|
|
11
12
|
export declare function loadAIGNE({ path, modelOptions, imageModelOptions, skipModelLoading, metadata, }: {
|
|
12
13
|
path?: string;
|
|
13
14
|
modelOptions?: ChatModelInputOptions & LoadCredentialOptions;
|
package/dist/utils/load-aigne.js
CHANGED
|
@@ -6,8 +6,8 @@ import chalk from "chalk";
|
|
|
6
6
|
import { AIGNE_CLI_VERSION, availableMemories } from "../constants.js";
|
|
7
7
|
import { loadChatModel, loadImageModel, maskApiKey } from "./aigne-hub/model.js";
|
|
8
8
|
import { getUrlOrigin } from "./get-url-origin.js";
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export async function printChatModelInfoBox(model, otherLines) {
|
|
10
|
+
console.log(`${chalk.grey("TIPS:")} run ${chalk.cyan("aigne observe")} to start the observability server.\n`);
|
|
11
11
|
const credential = await model.credential;
|
|
12
12
|
const lines = [`${chalk.cyan("Provider")}: ${chalk.green(model.name.replace("ChatModel", ""))}`];
|
|
13
13
|
if (credential?.model) {
|
|
@@ -19,6 +19,8 @@ async function printChatModelInfoBox(model) {
|
|
|
19
19
|
if (credential?.apiKey) {
|
|
20
20
|
lines.push(`${chalk.cyan("API Key")}: ${chalk.green(maskApiKey(credential?.apiKey))}`);
|
|
21
21
|
}
|
|
22
|
+
if (otherLines?.length)
|
|
23
|
+
lines.push(...otherLines);
|
|
22
24
|
console.log(boxen(lines.join("\n"), { padding: 1, borderStyle: "classic", borderColor: "cyan" }));
|
|
23
25
|
console.log("");
|
|
24
26
|
}
|
|
@@ -74,12 +76,5 @@ export async function loadAIGNE({ path, modelOptions, imageModelOptions, skipMod
|
|
|
74
76
|
metadata: { ...metadata, cliVersion: AIGNE_CLI_VERSION },
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
if (!skipModelLoading && !printed) {
|
|
78
|
-
printed = true;
|
|
79
|
-
console.log(`${chalk.grey("TIPS:")} run ${chalk.cyan("aigne observe")} to start the observability server.\n`);
|
|
80
|
-
if (aigne.model) {
|
|
81
|
-
await printChatModelInfoBox(aigne.model);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
79
|
return aigne;
|
|
85
80
|
}
|
|
@@ -7,8 +7,6 @@ import { terminalInput } from "../ui/utils/terminal-input.js";
|
|
|
7
7
|
export const DEFAULT_CHAT_INPUT_KEY = "message";
|
|
8
8
|
export async function runChatLoopInTerminal(userAgent, options = {}) {
|
|
9
9
|
const { initialCall } = options;
|
|
10
|
-
if (options?.welcome)
|
|
11
|
-
console.log(options.welcome);
|
|
12
10
|
if (initialCall) {
|
|
13
11
|
await callAgent(userAgent, initialCall, options);
|
|
14
12
|
if (options.input && options.inputFileKey) {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { mkdir, stat, writeFile } from "node:fs/promises";
|
|
2
2
|
import { dirname, isAbsolute, join } from "node:path";
|
|
3
3
|
import { isatty } from "node:tty";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { startExplorer } from "@aigne/afs-explorer";
|
|
4
6
|
import { exists } from "@aigne/agent-library/utils/fs.js";
|
|
5
7
|
import { AIAgent, DEFAULT_OUTPUT_KEY, UserAgent, } from "@aigne/core";
|
|
6
8
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
7
9
|
import { isEmpty, isNil, omitBy, pick } from "@aigne/core/utils/type-utils.js";
|
|
8
10
|
import { v7 } from "@aigne/uuid";
|
|
9
11
|
import chalk from "chalk";
|
|
12
|
+
import { detect } from "detect-port";
|
|
10
13
|
import yargs from "yargs";
|
|
11
14
|
import { hideBin } from "yargs/helpers";
|
|
12
|
-
import { DEFAULT_USER_ID } from "../constants.js";
|
|
15
|
+
import { DEFAULT_AFS_EXPLORER_PORT, DEFAULT_USER_ID } from "../constants.js";
|
|
13
16
|
import { TerminalTracer } from "../tracer/terminal.js";
|
|
14
|
-
import { loadAIGNE } from "./load-aigne.js";
|
|
17
|
+
import { loadAIGNE, printChatModelInfoBox } from "./load-aigne.js";
|
|
15
18
|
import { DEFAULT_CHAT_INPUT_KEY, runChatLoopInTerminal, } from "./run-chat-loop.js";
|
|
16
19
|
import { parseAgentInput, withAgentInputSchema, withRunAgentCommonOptions, } from "./yargs.js";
|
|
17
20
|
export async function parseAgentInputByCommander(agent, options = {}) {
|
|
@@ -54,6 +57,8 @@ export async function runWithAIGNE(agentCreator, { aigne, argv = process.argv, c
|
|
|
54
57
|
...omitBy(pick(options, "model", "temperature", "topP", "presencePenalty", "frequencyPenalty"), (v) => isNil(v)),
|
|
55
58
|
},
|
|
56
59
|
});
|
|
60
|
+
let explorerServer;
|
|
61
|
+
let explorerServerURL;
|
|
57
62
|
try {
|
|
58
63
|
const agent = typeof agentCreator === "function" ? await agentCreator(aigne) : agentCreator;
|
|
59
64
|
const input = await parseAgentInputByCommander(agent, {
|
|
@@ -61,6 +66,23 @@ export async function runWithAIGNE(agentCreator, { aigne, argv = process.argv, c
|
|
|
61
66
|
inputKey: chatLoopOptions?.inputKey,
|
|
62
67
|
defaultInput: chatLoopOptions?.initialCall || chatLoopOptions?.defaultQuestion,
|
|
63
68
|
});
|
|
69
|
+
if (agent.afs) {
|
|
70
|
+
const port = await detect(DEFAULT_AFS_EXPLORER_PORT);
|
|
71
|
+
explorerServer = await startExplorer(agent.afs, {
|
|
72
|
+
port,
|
|
73
|
+
distPath: dirname(fileURLToPath(import.meta.resolve("@aigne/afs-explorer/index.html"))),
|
|
74
|
+
});
|
|
75
|
+
explorerServerURL = `http://localhost:${port}`;
|
|
76
|
+
}
|
|
77
|
+
if (aigne.model) {
|
|
78
|
+
const lines = [];
|
|
79
|
+
if (explorerServerURL) {
|
|
80
|
+
lines.push(`${chalk.cyan("AFS Explorer")}: ${chalk.green(explorerServerURL)}`);
|
|
81
|
+
}
|
|
82
|
+
await printChatModelInfoBox(aigne.model, lines);
|
|
83
|
+
}
|
|
84
|
+
if (chatLoopOptions?.welcome)
|
|
85
|
+
console.log(chatLoopOptions.welcome);
|
|
64
86
|
await runAgentWithAIGNE(aigne, agent, {
|
|
65
87
|
...options,
|
|
66
88
|
outputKey: outputKey || options.outputKey,
|
|
@@ -71,6 +93,7 @@ export async function runWithAIGNE(agentCreator, { aigne, argv = process.argv, c
|
|
|
71
93
|
});
|
|
72
94
|
}
|
|
73
95
|
finally {
|
|
96
|
+
await explorerServer?.stop();
|
|
74
97
|
await aigne.shutdown();
|
|
75
98
|
}
|
|
76
99
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.59.0-beta.
|
|
3
|
+
"version": "1.59.0-beta.30",
|
|
4
4
|
"description": "Your command center for agent development",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -90,17 +90,18 @@
|
|
|
90
90
|
"yoctocolors-cjs": "^2.1.3",
|
|
91
91
|
"zod": "^3.25.67",
|
|
92
92
|
"zod-to-json-schema": "^3.24.6",
|
|
93
|
-
"@aigne/afs": "^1.4.0-beta.
|
|
94
|
-
"@aigne/afs-
|
|
95
|
-
"@aigne/
|
|
96
|
-
"@aigne/afs-local-fs": "^1.4.0-beta.
|
|
97
|
-
"@aigne/
|
|
98
|
-
"@aigne/
|
|
99
|
-
"@aigne/aigne-hub": "^0.10.16-beta.
|
|
100
|
-
"@aigne/
|
|
101
|
-
"@aigne/
|
|
102
|
-
"@aigne/
|
|
103
|
-
"@aigne/
|
|
93
|
+
"@aigne/afs": "^1.4.0-beta.10",
|
|
94
|
+
"@aigne/afs-explorer": "^1.0.0",
|
|
95
|
+
"@aigne/afs-history": "^1.2.0-beta.11",
|
|
96
|
+
"@aigne/afs-local-fs": "^1.4.0-beta.25",
|
|
97
|
+
"@aigne/agent-library": "^1.24.0-beta.26",
|
|
98
|
+
"@aigne/agentic-memory": "^1.1.6-beta.24",
|
|
99
|
+
"@aigne/aigne-hub": "^0.10.16-beta.30",
|
|
100
|
+
"@aigne/core": "^1.72.0-beta.24",
|
|
101
|
+
"@aigne/observability-api": "^0.11.14-beta.6",
|
|
102
|
+
"@aigne/openai": "^0.16.16-beta.24",
|
|
103
|
+
"@aigne/secrets": "^0.1.6-beta.24",
|
|
104
|
+
"@aigne/default-memory": "^1.4.0-beta.23"
|
|
104
105
|
},
|
|
105
106
|
"devDependencies": {
|
|
106
107
|
"@inquirer/testing": "^2.1.50",
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
"rimraf": "^6.0.1",
|
|
119
120
|
"typescript": "^5.9.2",
|
|
120
121
|
"ufo": "^1.6.1",
|
|
121
|
-
"@aigne/test-utils": "^0.5.69-beta.
|
|
122
|
+
"@aigne/test-utils": "^0.5.69-beta.24"
|
|
122
123
|
},
|
|
123
124
|
"scripts": {
|
|
124
125
|
"lint": "tsc --noEmit",
|