@aigne/cli 1.3.1-1 → 1.4.0

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.3.0...cli-v1.4.0) (2025-04-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * **core:** add model adapters for DeepSeek, Gemini, OpenRouter, and Ollama ([#53](https://github.com/AIGNE-io/aigne-framework/issues/53)) ([5d40546](https://github.com/AIGNE-io/aigne-framework/commit/5d40546bd5ddb70233d27ea3b20e5711b2af320a))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **cli:** display progressing for `run` command ([#68](https://github.com/AIGNE-io/aigne-framework/issues/68)) ([e3d2193](https://github.com/AIGNE-io/aigne-framework/commit/e3d21930bc2cf20edeb0ad7123e9e87e3e0ea653))
14
+ * **cli:** ensure dir exists before extract package ([#70](https://github.com/AIGNE-io/aigne-framework/issues/70)) ([5ebe56d](https://github.com/AIGNE-io/aigne-framework/commit/5ebe56d3483d4309d9e39ab0566d353b3787edce))
15
+
3
16
  ## [1.3.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.2.0...cli-v1.3.0) (2025-04-17)
4
17
 
5
18
 
@@ -1,6 +1,7 @@
1
1
  import { type Agent, type Context, type Message } from "@aigne/core";
2
2
  import type { ContextUsage } from "@aigne/core/execution-engine/usage";
3
3
  import { type DefaultRenderer, Listr, type ListrRenderer, type ListrTaskWrapper } from "@aigne/listr2";
4
+ import { promiseWithResolvers } from "../utils/promise-with-resolvers.js";
4
5
  export interface TerminalTracerOptions {
5
6
  verbose?: boolean;
6
7
  }
@@ -29,8 +30,8 @@ export declare class TerminalTracer {
29
30
  time?: boolean;
30
31
  }): string;
31
32
  }
32
- type Task = ReturnType<typeof Promise.withResolvers<void>> & {
33
- listr: ReturnType<typeof Promise.withResolvers<{
33
+ type Task = ReturnType<typeof promiseWithResolvers<void>> & {
34
+ listr: ReturnType<typeof promiseWithResolvers<{
34
35
  ctx: object;
35
36
  subtask: Listr;
36
37
  taskWrapper: ListrTaskWrapper<unknown, typeof DefaultRenderer, typeof ListrRenderer>;
@@ -3,6 +3,7 @@ import { ChatModel, } from "@aigne/core";
3
3
  import { Listr, ListrDefaultRendererLogLevels, Spinner, figures, } from "@aigne/listr2";
4
4
  import chalk from "chalk";
5
5
  import { z } from "zod";
6
+ import { promiseWithResolvers } from "../utils/promise-with-resolvers.js";
6
7
  import { parseDuration } from "../utils/time.js";
7
8
  const DEBUG_DEPTH = z.number().int().default(2).safeParse(Number(process.env.DEBUG_DEPTH)).data;
8
9
  export class TerminalTracer {
@@ -21,8 +22,8 @@ export class TerminalTracer {
21
22
  const listr = this.newListr();
22
23
  context.on("agentStarted", async ({ contextId, parentContextId, agent, input, timestamp }) => {
23
24
  const task = {
24
- ...Promise.withResolvers(),
25
- listr: Promise.withResolvers(),
25
+ ...promiseWithResolvers(),
26
+ listr: promiseWithResolvers(),
26
27
  startTime: timestamp,
27
28
  };
28
29
  this.tasks[contextId] = task;
@@ -156,7 +157,7 @@ ${this.formatMessage(data)}`;
156
157
  }
157
158
  }
158
159
  class MyListr extends Listr {
159
- taskPromise = Promise.withResolvers();
160
+ taskPromise = promiseWithResolvers();
160
161
  isTaskPromiseResolved = false;
161
162
  resolveWaitingTask() {
162
163
  if (!this.isTaskPromiseResolved) {
@@ -0,0 +1,6 @@
1
+ export interface PromiseWithResolvers<T> {
2
+ promise: Promise<T>;
3
+ resolve: (value: T | PromiseLike<T>) => void;
4
+ reject: (reason?: unknown) => void;
5
+ }
6
+ export declare function promiseWithResolvers<T = void>(): PromiseWithResolvers<T>;
@@ -0,0 +1,9 @@
1
+ export function promiseWithResolvers() {
2
+ let resolve;
3
+ let reject;
4
+ const promise = new Promise((res, rej) => {
5
+ resolve = res;
6
+ reject = rej;
7
+ });
8
+ return { promise, resolve, reject };
9
+ }
@@ -3,6 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
4
4
  import express from "express";
5
5
  import { ZodObject } from "zod";
6
+ import { promiseWithResolvers } from "./promise-with-resolvers.js";
6
7
  export async function serveMCPServer({ engine, port }) {
7
8
  const server = new McpServer({
8
9
  name: engine.name || "aigne-mcp-server",
@@ -53,7 +54,7 @@ export async function serveMCPServer({ engine, port }) {
53
54
  .status(error instanceof HttpError ? error.status : 500)
54
55
  .json({ error: { message: error.message } });
55
56
  }));
56
- const { promise, resolve, reject } = Promise.withResolvers();
57
+ const { promise, resolve, reject } = promiseWithResolvers();
57
58
  const httpServer = app.listen(port, (error) => {
58
59
  if (error)
59
60
  reject(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.3.1-1",
3
+ "version": "1.4.0",
4
4
  "description": "cli for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -47,7 +47,7 @@
47
47
  "pretty-error": "^4.0.0",
48
48
  "tar": "^7.4.3",
49
49
  "zod": "^3.24.2",
50
- "@aigne/core": "^1.8.0"
50
+ "@aigne/core": "^1.9.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/archiver": "^6.0.3",