@aigne/cli 1.22.1 → 1.22.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
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.22.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.22.1...cli-v1.22.2) (2025-07-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **model:** ensure last message is not system role for gemini ([#231](https://github.com/AIGNE-io/aigne-framework/issues/231)) ([1b72e1e](https://github.com/AIGNE-io/aigne-framework/commit/1b72e1e6be98060aa32e68585142b2eea401d109))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.20.1
|
|
16
|
+
* @aigne/anthropic bumped to 0.7.1
|
|
17
|
+
* @aigne/bedrock bumped to 0.7.1
|
|
18
|
+
* @aigne/core bumped to 1.32.1
|
|
19
|
+
* @aigne/deepseek bumped to 0.6.1
|
|
20
|
+
* @aigne/gemini bumped to 0.6.1
|
|
21
|
+
* @aigne/observability-api bumped to 0.7.0
|
|
22
|
+
* @aigne/ollama bumped to 0.6.1
|
|
23
|
+
* @aigne/open-router bumped to 0.6.1
|
|
24
|
+
* @aigne/openai bumped to 0.8.1
|
|
25
|
+
* @aigne/xai bumped to 0.6.1
|
|
26
|
+
|
|
3
27
|
## [1.22.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.22.0...cli-v1.22.1) (2025-07-08)
|
|
4
28
|
|
|
5
29
|
|
|
@@ -5,7 +5,6 @@ export interface ChatLoopOptions {
|
|
|
5
5
|
welcome?: string;
|
|
6
6
|
defaultQuestion?: string;
|
|
7
7
|
inputKey?: string;
|
|
8
|
-
skipLoop?: boolean;
|
|
9
8
|
outputKey?: string;
|
|
10
9
|
}
|
|
11
10
|
export declare function runChatLoopInTerminal(userAgent: UserAgent<any, any>, options?: ChatLoopOptions): Promise<void>;
|
|
@@ -2,14 +2,12 @@ import inquirer from "inquirer";
|
|
|
2
2
|
import { TerminalTracer } from "../tracer/terminal.js";
|
|
3
3
|
export const DEFAULT_CHAT_INPUT_KEY = "message";
|
|
4
4
|
export async function runChatLoopInTerminal(userAgent, options = {}) {
|
|
5
|
-
const { initialCall
|
|
5
|
+
const { initialCall } = options;
|
|
6
6
|
let prompt;
|
|
7
7
|
if (options?.welcome)
|
|
8
8
|
console.log(options.welcome);
|
|
9
9
|
if (initialCall) {
|
|
10
10
|
await callAgent(userAgent, initialCall, { ...options });
|
|
11
|
-
if (skipLoop)
|
|
12
|
-
return;
|
|
13
11
|
}
|
|
14
12
|
for (let i = 0;; i++) {
|
|
15
13
|
prompt = inquirer.prompt([
|
|
@@ -21,6 +21,7 @@ export declare const createRunAIGNECommand: (name?: string) => Command;
|
|
|
21
21
|
export declare function parseAgentInputByCommander(agent: Agent, options?: RunAIGNECommandOptions & {
|
|
22
22
|
inputKey?: string;
|
|
23
23
|
argv?: string[];
|
|
24
|
+
defaultInput?: string | Message;
|
|
24
25
|
}): Promise<Message>;
|
|
25
26
|
export declare const parseModelOption: (model?: string) => {
|
|
26
27
|
provider: string | undefined;
|
|
@@ -69,7 +69,7 @@ export async function parseAgentInputByCommander(agent, options = {}) {
|
|
|
69
69
|
const rawInput = options.input ||
|
|
70
70
|
(isatty(process.stdin.fd) || !(await stdinHasData())
|
|
71
71
|
? null
|
|
72
|
-
: [await readAllString(process.stdin)]);
|
|
72
|
+
: [await readAllString(process.stdin)].filter(Boolean));
|
|
73
73
|
if (rawInput?.length) {
|
|
74
74
|
for (let raw of rawInput) {
|
|
75
75
|
if (raw.startsWith("@")) {
|
|
@@ -88,6 +88,12 @@ export async function parseAgentInputByCommander(agent, options = {}) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
if (isEmpty(input)) {
|
|
92
|
+
const defaultInput = options.defaultInput || process.env.INITIAL_CALL;
|
|
93
|
+
Object.assign(input, typeof defaultInput === "string"
|
|
94
|
+
? { [options?.inputKey || DEFAULT_CHAT_INPUT_KEY]: defaultInput }
|
|
95
|
+
: defaultInput);
|
|
96
|
+
}
|
|
91
97
|
return input;
|
|
92
98
|
}
|
|
93
99
|
export const parseModelOption = (model) => {
|
|
@@ -115,13 +121,8 @@ export async function runWithAIGNE(agentCreator, { argv = process.argv, chatLoop
|
|
|
115
121
|
const input = await parseAgentInputByCommander(agent, {
|
|
116
122
|
...options,
|
|
117
123
|
inputKey: chatLoopOptions?.inputKey,
|
|
124
|
+
defaultInput: chatLoopOptions?.initialCall || chatLoopOptions?.defaultQuestion,
|
|
118
125
|
});
|
|
119
|
-
if (isEmpty(input)) {
|
|
120
|
-
const defaultInput = chatLoopOptions?.initialCall || chatLoopOptions?.defaultQuestion;
|
|
121
|
-
Object.assign(input, typeof defaultInput === "string"
|
|
122
|
-
? { [chatLoopOptions?.inputKey || DEFAULT_CHAT_INPUT_KEY]: defaultInput }
|
|
123
|
-
: defaultInput);
|
|
124
|
-
}
|
|
125
126
|
await runAgentWithAIGNE(aigne, agent, {
|
|
126
127
|
...options,
|
|
127
128
|
outputKey: outputKey || options.outputKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.2",
|
|
4
4
|
"description": "cli for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"wrap-ansi": "^9.0.0",
|
|
56
56
|
"yaml": "^2.8.0",
|
|
57
57
|
"zod": "^3.25.67",
|
|
58
|
-
"@aigne/agent-library": "^1.20.
|
|
59
|
-
"@aigne/anthropic": "^0.7.
|
|
60
|
-
"@aigne/
|
|
61
|
-
"@aigne/deepseek": "^0.6.
|
|
62
|
-
"@aigne/
|
|
63
|
-
"@aigne/
|
|
64
|
-
"@aigne/
|
|
65
|
-
"@aigne/
|
|
66
|
-
"@aigne/
|
|
67
|
-
"@aigne/
|
|
68
|
-
"@aigne/xai": "^0.6.
|
|
58
|
+
"@aigne/agent-library": "^1.20.1",
|
|
59
|
+
"@aigne/anthropic": "^0.7.1",
|
|
60
|
+
"@aigne/core": "^1.32.1",
|
|
61
|
+
"@aigne/deepseek": "^0.6.1",
|
|
62
|
+
"@aigne/bedrock": "^0.7.1",
|
|
63
|
+
"@aigne/gemini": "^0.6.1",
|
|
64
|
+
"@aigne/ollama": "^0.6.1",
|
|
65
|
+
"@aigne/open-router": "^0.6.1",
|
|
66
|
+
"@aigne/observability-api": "^0.7.0",
|
|
67
|
+
"@aigne/openai": "^0.8.1",
|
|
68
|
+
"@aigne/xai": "^0.6.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/archiver": "^6.0.3",
|