@aigne/cli 1.11.1 → 1.11.3
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 +46 -0
- package/dist/commands/run.js +2 -2
- package/dist/commands/serve.js +5 -2
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/tracer/terminal.d.ts +4 -4
- package/dist/tracer/terminal.js +8 -3
- package/dist/utils/serve-mcp.js +1 -1
- package/package.json +11 -10
- package/dist/utils/promise-with-resolvers.d.ts +0 -6
- package/dist/utils/promise-with-resolvers.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.11.3](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.11.2...cli-v1.11.3) (2025-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* compatible nodejs version >=20 ([#149](https://github.com/AIGNE-io/aigne-framework/issues/149)) ([d5ae9f2](https://github.com/AIGNE-io/aigne-framework/commit/d5ae9f245972e87e70fd87cdd960ade9940f288c))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/agent-library bumped to 1.12.3
|
|
16
|
+
* @aigne/anthropic bumped to 0.2.4
|
|
17
|
+
* @aigne/bedrock bumped to 0.2.4
|
|
18
|
+
* @aigne/core bumped to 1.18.3
|
|
19
|
+
* @aigne/deepseek bumped to 0.2.4
|
|
20
|
+
* @aigne/gemini bumped to 0.2.4
|
|
21
|
+
* @aigne/ollama bumped to 0.2.4
|
|
22
|
+
* @aigne/open-router bumped to 0.2.4
|
|
23
|
+
* @aigne/openai bumped to 0.2.4
|
|
24
|
+
* @aigne/xai bumped to 0.2.4
|
|
25
|
+
|
|
26
|
+
## [1.11.2](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.11.1...cli-v1.11.2) (2025-05-30)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* provide available memories for AIGNE ([#145](https://github.com/AIGNE-io/aigne-framework/issues/145)) ([c5dc960](https://github.com/AIGNE-io/aigne-framework/commit/c5dc9605e0fb7ca60e1f5fa2f0da67ffec00c601))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
* The following workspace dependencies were updated
|
|
37
|
+
* dependencies
|
|
38
|
+
* @aigne/agent-library bumped to 1.12.2
|
|
39
|
+
* @aigne/anthropic bumped to 0.2.3
|
|
40
|
+
* @aigne/bedrock bumped to 0.2.3
|
|
41
|
+
* @aigne/core bumped to 1.18.2
|
|
42
|
+
* @aigne/deepseek bumped to 0.2.3
|
|
43
|
+
* @aigne/gemini bumped to 0.2.3
|
|
44
|
+
* @aigne/ollama bumped to 0.2.3
|
|
45
|
+
* @aigne/open-router bumped to 0.2.3
|
|
46
|
+
* @aigne/openai bumped to 0.2.3
|
|
47
|
+
* @aigne/xai bumped to 0.2.3
|
|
48
|
+
|
|
3
49
|
## [1.11.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.11.0...cli-v1.11.1) (2025-05-30)
|
|
4
50
|
|
|
5
51
|
|
package/dist/commands/run.js
CHANGED
|
@@ -7,7 +7,7 @@ import { loadModel } from "@aigne/core/loader/index.js";
|
|
|
7
7
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
8
8
|
import { isNonNullable } from "@aigne/core/utils/type-utils.js";
|
|
9
9
|
import { Listr, PRESET_TIMER } from "@aigne/listr2";
|
|
10
|
-
import { availableModels } from "../constants.js";
|
|
10
|
+
import { availableMemories, availableModels } from "../constants.js";
|
|
11
11
|
import { isV1Package, toAIGNEPackage } from "../utils/agent-v1.js";
|
|
12
12
|
import { downloadAndExtract } from "../utils/download.js";
|
|
13
13
|
import { createRunAIGNECommand, parseModelOption, runAgentWithAIGNE, } from "../utils/run-with-aigne.js";
|
|
@@ -92,7 +92,7 @@ async function loadAIGNE(path, options) {
|
|
|
92
92
|
const model = options.model
|
|
93
93
|
? await loadModel(availableModels, parseModelOption(options.model))
|
|
94
94
|
: undefined;
|
|
95
|
-
return await AIGNE.load(path, { models: availableModels, model });
|
|
95
|
+
return await AIGNE.load(path, { models: availableModels, memories: availableMemories, model });
|
|
96
96
|
}
|
|
97
97
|
async function downloadPackage(url, cacheDir) {
|
|
98
98
|
await rm(cacheDir, { recursive: true, force: true });
|
package/dist/commands/serve.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isAbsolute, resolve } from "node:path";
|
|
|
2
2
|
import { AIGNE } from "@aigne/core";
|
|
3
3
|
import { tryOrThrow } from "@aigne/core/utils/type-utils.js";
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
-
import { availableModels } from "../constants.js";
|
|
5
|
+
import { availableMemories, availableModels } from "../constants.js";
|
|
6
6
|
import { serveMCPServer } from "../utils/serve-mcp.js";
|
|
7
7
|
const DEFAULT_PORT = () => tryOrThrow(() => {
|
|
8
8
|
const { PORT } = process.env;
|
|
@@ -24,7 +24,10 @@ export function createServeCommand() {
|
|
|
24
24
|
.action(async (path, options) => {
|
|
25
25
|
const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);
|
|
26
26
|
const port = options.port || DEFAULT_PORT();
|
|
27
|
-
const aigne = await AIGNE.load(absolutePath, {
|
|
27
|
+
const aigne = await AIGNE.load(absolutePath, {
|
|
28
|
+
models: availableModels,
|
|
29
|
+
memories: availableMemories,
|
|
30
|
+
});
|
|
28
31
|
if (options.mcp)
|
|
29
32
|
await serveMCPServer({
|
|
30
33
|
aigne,
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { DefaultMemory } from "@aigne/agent-library/default-memory/index.js";
|
|
1
2
|
import { AnthropicChatModel } from "@aigne/anthropic";
|
|
2
3
|
import { BedrockChatModel } from "@aigne/bedrock";
|
|
3
4
|
import { OpenAIChatModel } from "@aigne/openai";
|
|
4
5
|
export declare const AIGNE_CLI_VERSION: string;
|
|
5
6
|
export declare const availableModels: (typeof OpenAIChatModel | typeof AnthropicChatModel | typeof BedrockChatModel)[];
|
|
7
|
+
export declare const availableMemories: (typeof DefaultMemory)[];
|
package/dist/constants.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DefaultMemory } from "@aigne/agent-library/default-memory/index.js";
|
|
1
2
|
import { AnthropicChatModel } from "@aigne/anthropic";
|
|
2
3
|
import { BedrockChatModel } from "@aigne/bedrock";
|
|
3
4
|
import { DeepSeekChatModel } from "@aigne/deepseek";
|
|
@@ -18,3 +19,4 @@ export const availableModels = [
|
|
|
18
19
|
OpenRouterChatModel,
|
|
19
20
|
XAIChatModel,
|
|
20
21
|
];
|
|
22
|
+
export const availableMemories = [DefaultMemory];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Agent, type Context, type ContextUsage,
|
|
1
|
+
import { type Agent, type Context, type ContextUsage, type Message } from "@aigne/core";
|
|
2
|
+
import { promiseWithResolvers } from "@aigne/core/utils/promise.js";
|
|
2
3
|
import { type Listr } from "@aigne/listr2";
|
|
3
4
|
import { type AIGNEListrTaskWrapper } from "../utils/listr.js";
|
|
4
|
-
import { promiseWithResolvers } from "../utils/promise-with-resolvers.js";
|
|
5
5
|
export interface TerminalTracerOptions {
|
|
6
6
|
printRequest?: boolean;
|
|
7
7
|
}
|
|
@@ -24,8 +24,8 @@ export declare class TerminalTracer {
|
|
|
24
24
|
time?: boolean;
|
|
25
25
|
}): string;
|
|
26
26
|
private marked;
|
|
27
|
-
formatRequest(_context: Context,
|
|
28
|
-
formatResult(context: Context,
|
|
27
|
+
formatRequest(_context: Context, m?: Message): string | undefined;
|
|
28
|
+
formatResult(context: Context, m?: Message): string;
|
|
29
29
|
}
|
|
30
30
|
type Task = ReturnType<typeof promiseWithResolvers<void>> & {
|
|
31
31
|
listr: ReturnType<typeof promiseWithResolvers<{
|
package/dist/tracer/terminal.js
CHANGED
|
@@ -2,12 +2,13 @@ import { EOL } from "node:os";
|
|
|
2
2
|
import { inspect } from "node:util";
|
|
3
3
|
import { ChatModel, MESSAGE_KEY, } from "@aigne/core";
|
|
4
4
|
import { LogLevel, logger } from "@aigne/core/utils/logger.js";
|
|
5
|
+
import { promiseWithResolvers } from "@aigne/core/utils/promise.js";
|
|
6
|
+
import { omitBy } from "@aigne/core/utils/type-utils.js";
|
|
5
7
|
import { figures } from "@aigne/listr2";
|
|
6
8
|
import { markedTerminal } from "@aigne/marked-terminal";
|
|
7
9
|
import chalk from "chalk";
|
|
8
10
|
import { Marked } from "marked";
|
|
9
11
|
import { AIGNEListr } from "../utils/listr.js";
|
|
10
|
-
import { promiseWithResolvers } from "../utils/promise-with-resolvers.js";
|
|
11
12
|
import { parseDuration } from "../utils/time.js";
|
|
12
13
|
export class TerminalTracer {
|
|
13
14
|
context;
|
|
@@ -121,18 +122,22 @@ export class TerminalTracer {
|
|
|
121
122
|
return title;
|
|
122
123
|
}
|
|
123
124
|
marked = new Marked().use(markedTerminal({ forceHyperLink: false }));
|
|
124
|
-
formatRequest(_context,
|
|
125
|
+
formatRequest(_context, m = {}) {
|
|
125
126
|
if (!logger.enabled(LogLevel.INFO))
|
|
126
127
|
return;
|
|
127
128
|
const prefix = `${chalk.grey(figures.pointer)} 💬 `;
|
|
129
|
+
const msg = m[MESSAGE_KEY];
|
|
130
|
+
const message = omitBy(m, (_, k) => k === MESSAGE_KEY);
|
|
128
131
|
const text = msg && typeof msg === "string" ? this.marked.parse(msg, { async: false }).trim() : undefined;
|
|
129
132
|
const json = Object.keys(message).length > 0 ? inspect(message, { colors: true }) : undefined;
|
|
130
133
|
return [prefix, [text, json].filter(Boolean).join(EOL)].join(" ");
|
|
131
134
|
}
|
|
132
|
-
formatResult(context,
|
|
135
|
+
formatResult(context, m = {}) {
|
|
133
136
|
const prefix = logger.enabled(LogLevel.INFO)
|
|
134
137
|
? `${chalk.grey(figures.tick)} 🤖 ${this.formatTokenUsage(context.usage)}`
|
|
135
138
|
: null;
|
|
139
|
+
const msg = m[MESSAGE_KEY];
|
|
140
|
+
const message = omitBy(m, (_, k) => k === MESSAGE_KEY);
|
|
136
141
|
const text = msg && typeof msg === "string" ? this.marked.parse(msg, { async: false }).trim() : undefined;
|
|
137
142
|
const json = Object.keys(message).length > 0
|
|
138
143
|
? inspect(message, { colors: process.stdout.isTTY })
|
package/dist/utils/serve-mcp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getMessage } from "@aigne/core";
|
|
2
|
+
import { promiseWithResolvers } from "@aigne/core/utils/promise.js";
|
|
2
3
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
4
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
5
|
import express, { Router, json } from "express";
|
|
5
6
|
import { ZodObject } from "zod";
|
|
6
7
|
import { AIGNE_CLI_VERSION } from "../constants.js";
|
|
7
|
-
import { promiseWithResolvers } from "./promise-with-resolvers.js";
|
|
8
8
|
export async function serveMCPServer({ pathname = "/mcp", aigne, host = "localhost", port, }) {
|
|
9
9
|
const app = express();
|
|
10
10
|
app.use(json());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/cli",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "cli for AIGNE framework",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -50,15 +50,16 @@
|
|
|
50
50
|
"tar": "^7.4.3",
|
|
51
51
|
"wrap-ansi": "^9.0.0",
|
|
52
52
|
"zod": "^3.24.4",
|
|
53
|
-
"@aigne/
|
|
54
|
-
"@aigne/
|
|
55
|
-
"@aigne/
|
|
56
|
-
"@aigne/
|
|
57
|
-
"@aigne/
|
|
58
|
-
"@aigne/
|
|
59
|
-
"@aigne/
|
|
60
|
-
"@aigne/
|
|
61
|
-
"@aigne/
|
|
53
|
+
"@aigne/agent-library": "^1.12.3",
|
|
54
|
+
"@aigne/anthropic": "^0.2.4",
|
|
55
|
+
"@aigne/bedrock": "^0.2.4",
|
|
56
|
+
"@aigne/core": "^1.18.3",
|
|
57
|
+
"@aigne/deepseek": "^0.2.4",
|
|
58
|
+
"@aigne/gemini": "^0.2.4",
|
|
59
|
+
"@aigne/ollama": "^0.2.4",
|
|
60
|
+
"@aigne/open-router": "^0.2.4",
|
|
61
|
+
"@aigne/xai": "^0.2.4",
|
|
62
|
+
"@aigne/openai": "^0.2.4"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@types/archiver": "^6.0.3",
|