@aigne/cli 1.12.0 → 1.13.1

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,52 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.13.1](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.13.0...cli-v1.13.1) (2025-06-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **blocklet:** ensure only admins can access traces ([#173](https://github.com/AIGNE-io/aigne-framework/issues/173)) ([9c5cc06](https://github.com/AIGNE-io/aigne-framework/commit/9c5cc06c5841b9684d16c5c60af764d8c98c9c3e))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/agent-library bumped to 1.16.0
16
+ * @aigne/anthropic bumped to 0.3.5
17
+ * @aigne/bedrock bumped to 0.3.5
18
+ * @aigne/core bumped to 1.23.0
19
+ * @aigne/deepseek bumped to 0.3.5
20
+ * @aigne/gemini bumped to 0.3.5
21
+ * @aigne/observability bumped to 0.1.1
22
+ * @aigne/ollama bumped to 0.3.5
23
+ * @aigne/open-router bumped to 0.3.5
24
+ * @aigne/openai bumped to 0.3.5
25
+ * @aigne/xai bumped to 0.3.5
26
+
27
+ ## [1.13.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.12.0...cli-v1.13.0) (2025-06-24)
28
+
29
+
30
+ ### Features
31
+
32
+ * support observability for cli and blocklet ([#155](https://github.com/AIGNE-io/aigne-framework/issues/155)) ([5baa705](https://github.com/AIGNE-io/aigne-framework/commit/5baa705a33cfdba1efc5ccbe18674c27513ca97d))
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * dependencies
39
+ * @aigne/agent-library bumped to 1.15.0
40
+ * @aigne/anthropic bumped to 0.3.4
41
+ * @aigne/bedrock bumped to 0.3.4
42
+ * @aigne/core bumped to 1.22.0
43
+ * @aigne/deepseek bumped to 0.3.4
44
+ * @aigne/gemini bumped to 0.3.4
45
+ * @aigne/ollama bumped to 0.3.4
46
+ * @aigne/open-router bumped to 0.3.4
47
+ * @aigne/openai bumped to 0.3.4
48
+ * @aigne/xai bumped to 0.3.4
49
+
3
50
  ## [1.12.0](https://github.com/AIGNE-io/aigne-framework/compare/cli-v1.11.9...cli-v1.12.0) (2025-06-20)
4
51
 
5
52
 
@@ -2,6 +2,7 @@ import { Command } from "commander";
2
2
  import { AIGNE_CLI_VERSION } from "../constants.js";
3
3
  import { asciiLogo } from "../utils/ascii-logo.js";
4
4
  import { createCreateCommand } from "./create.js";
5
+ import { createObservabilityCommand } from "./observability.js";
5
6
  import { createRunCommand } from "./run.js";
6
7
  import { createServeCommand } from "./serve.js";
7
8
  import { createTestCommand } from "./test.js";
@@ -15,6 +16,7 @@ export function createAIGNECommand() {
15
16
  .addCommand(createTestCommand())
16
17
  .addCommand(createCreateCommand())
17
18
  .addCommand(createServeCommand())
19
+ .addCommand(createObservabilityCommand())
18
20
  .showHelpAfterError(true)
19
21
  .showSuggestionAfterError(true);
20
22
  }
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function createObservabilityCommand(): Command;
@@ -0,0 +1,27 @@
1
+ import { tryOrThrow } from "@aigne/core/utils/type-utils.js";
2
+ import { getObservabilityDbPath } from "@aigne/observability/db-path";
3
+ import { startServer as startObservabilityServer } from "@aigne/observability/server";
4
+ import { Command } from "commander";
5
+ const DEFAULT_PORT = () => tryOrThrow(() => {
6
+ const { PORT } = process.env;
7
+ if (!PORT)
8
+ return 7890;
9
+ const port = Number.parseInt(PORT);
10
+ if (!port || !Number.isInteger(port))
11
+ throw new Error(`Invalid PORT: ${PORT}`);
12
+ return port;
13
+ }, (error) => new Error(`parse PORT error ${error.message}`));
14
+ export function createObservabilityCommand() {
15
+ return new Command("observability")
16
+ .description("Start the observability server")
17
+ .option("--host <host>", "Host to run the MCP server on, use 0.0.0.0 to publicly expose the server", "localhost")
18
+ .option("--port <port>", "Port to run the MCP server on", (s) => Number.parseInt(s))
19
+ .action(async (options) => {
20
+ const port = options.port || DEFAULT_PORT();
21
+ const dbUrl = getObservabilityDbPath();
22
+ console.log("DB PATH:", dbUrl);
23
+ await startObservabilityServer({ port: Number(port) || 3000, dbUrl: dbUrl });
24
+ })
25
+ .showHelpAfterError(true)
26
+ .showSuggestionAfterError(true);
27
+ }
@@ -19,6 +19,7 @@ export class TerminalTracer {
19
19
  }
20
20
  tasks = {};
21
21
  async run(agent, input) {
22
+ await this.context.observer?.serve();
22
23
  const context = this.context.newContext({ reset: true });
23
24
  const listr = new AIGNEListr({
24
25
  formatRequest: () => this.options.printRequest ? this.formatRequest(agent, context, input) : undefined,
@@ -86,7 +87,7 @@ export class TerminalTracer {
86
87
  context.on("agentSucceed", onAgentSucceed);
87
88
  context.on("agentFailed", onAgentFailed);
88
89
  try {
89
- const result = await listr.run(() => context.invoke(agent, input, { streaming: true }));
90
+ const result = await listr.run(() => context.invoke(agent, input, { streaming: true, newContext: false }));
90
91
  return { result, context };
91
92
  }
92
93
  finally {
@@ -115,7 +115,10 @@ export async function runWithAIGNE(agentCreator, { argv = process.argv, chatLoop
115
115
  inputKey: chatLoopOptions?.inputKey,
116
116
  });
117
117
  if (isEmpty(input)) {
118
- Object.assign(input, chatLoopOptions?.initialCall || chatLoopOptions?.defaultQuestion);
118
+ const defaultInput = chatLoopOptions?.initialCall || chatLoopOptions?.defaultQuestion;
119
+ Object.assign(input, typeof defaultInput === "string"
120
+ ? { [chatLoopOptions?.inputKey || DEFAULT_CHAT_INPUT_KEY]: defaultInput }
121
+ : defaultInput);
119
122
  }
120
123
  await runAgentWithAIGNE(aigne, agent, {
121
124
  ...options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/cli",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "cli for AIGNE framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -51,16 +51,17 @@
51
51
  "wrap-ansi": "^9.0.0",
52
52
  "yaml": "^2.7.1",
53
53
  "zod": "^3.24.4",
54
- "@aigne/agent-library": "^1.14.0",
55
- "@aigne/anthropic": "^0.3.3",
56
- "@aigne/bedrock": "^0.3.3",
57
- "@aigne/deepseek": "^0.3.3",
58
- "@aigne/core": "^1.21.0",
59
- "@aigne/ollama": "^0.3.3",
60
- "@aigne/gemini": "^0.3.3",
61
- "@aigne/open-router": "^0.3.3",
62
- "@aigne/xai": "^0.3.3",
63
- "@aigne/openai": "^0.3.3"
54
+ "@aigne/agent-library": "^1.16.0",
55
+ "@aigne/bedrock": "^0.3.5",
56
+ "@aigne/anthropic": "^0.3.5",
57
+ "@aigne/deepseek": "^0.3.5",
58
+ "@aigne/core": "^1.23.0",
59
+ "@aigne/gemini": "^0.3.5",
60
+ "@aigne/ollama": "^0.3.5",
61
+ "@aigne/observability": "^0.1.1",
62
+ "@aigne/open-router": "^0.3.5",
63
+ "@aigne/openai": "^0.3.5",
64
+ "@aigne/xai": "^0.3.5"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@types/archiver": "^6.0.3",