@aigne/cli 1.60.0-beta → 1.74.0-beta
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/README.md +12 -12
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/bunwrapper.cjs +22 -0
- package/dist/bunwrapper.d.cts +1 -0
- package/dist/bunwrapper.d.mts +1 -0
- package/dist/bunwrapper.mjs +23 -0
- package/dist/bunwrapper.mjs.map +1 -0
- package/dist/cli.cjs +42 -0
- package/dist/cli.d.cts +9 -0
- package/dist/cli.d.cts.map +1 -0
- package/dist/cli.d.mts +10 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +41 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/commands/aigne.cjs +23 -0
- package/dist/commands/aigne.mjs +22 -0
- package/dist/commands/aigne.mjs.map +1 -0
- package/dist/commands/app/agent.cjs +117 -0
- package/dist/commands/app/agent.mjs +113 -0
- package/dist/commands/app/agent.mjs.map +1 -0
- package/dist/commands/app/app.cjs +92 -0
- package/dist/commands/app/app.mjs +90 -0
- package/dist/commands/app/app.mjs.map +1 -0
- package/dist/commands/app/cli.cjs +6 -0
- package/dist/commands/app/cli.d.cts +1 -0
- package/dist/commands/app/cli.d.mts +1 -0
- package/dist/commands/app/cli.mjs +8 -0
- package/dist/commands/app/cli.mjs.map +1 -0
- package/dist/commands/app/upgrade.cjs +243 -0
- package/dist/commands/app/upgrade.mjs +240 -0
- package/dist/commands/app/upgrade.mjs.map +1 -0
- package/dist/commands/app.cjs +53 -0
- package/dist/commands/app.mjs +53 -0
- package/dist/commands/app.mjs.map +1 -0
- package/dist/commands/create.cjs +66 -0
- package/dist/commands/create.mjs +65 -0
- package/dist/commands/create.mjs.map +1 -0
- package/dist/commands/deploy.cjs +237 -0
- package/dist/commands/deploy.mjs +237 -0
- package/dist/commands/deploy.mjs.map +1 -0
- package/dist/commands/eval.cjs +88 -0
- package/dist/commands/eval.mjs +88 -0
- package/dist/commands/eval.mjs.map +1 -0
- package/dist/commands/hub.cjs +297 -0
- package/dist/commands/hub.mjs +294 -0
- package/dist/commands/hub.mjs.map +1 -0
- package/dist/commands/observe.cjs +49 -0
- package/dist/commands/observe.mjs +46 -0
- package/dist/commands/observe.mjs.map +1 -0
- package/dist/commands/run-skill.cjs +84 -0
- package/dist/commands/run-skill.mjs +81 -0
- package/dist/commands/run-skill.mjs.map +1 -0
- package/dist/commands/run.cjs +172 -0
- package/dist/commands/run.mjs +171 -0
- package/dist/commands/run.mjs.map +1 -0
- package/dist/commands/serve-mcp.cjs +68 -0
- package/dist/commands/serve-mcp.mjs +67 -0
- package/dist/commands/serve-mcp.mjs.map +1 -0
- package/dist/commands/test.cjs +40 -0
- package/dist/commands/test.mjs +39 -0
- package/dist/commands/test.mjs.map +1 -0
- package/dist/constants.cjs +28 -0
- package/dist/constants.d.cts +9 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +9 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +24 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/global.d.cjs +0 -0
- package/dist/global.d.cts +6 -0
- package/dist/global.d.cts.map +1 -0
- package/dist/global.d.mts +6 -0
- package/dist/global.d.mts.map +1 -0
- package/dist/index.cjs +0 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/tracer/terminal.cjs +336 -0
- package/dist/tracer/terminal.mjs +332 -0
- package/dist/tracer/terminal.mjs.map +1 -0
- package/dist/type.cjs +0 -0
- package/dist/type.d.cts +10 -0
- package/dist/type.d.cts.map +1 -0
- package/dist/type.d.mts +10 -0
- package/dist/type.d.mts.map +1 -0
- package/dist/type.mjs +1 -0
- package/dist/ui/utils/terminal-input.cjs +145 -0
- package/dist/ui/utils/terminal-input.mjs +144 -0
- package/dist/ui/utils/terminal-input.mjs.map +1 -0
- package/dist/ui/utils/text-buffer.cjs +865 -0
- package/dist/ui/utils/text-buffer.mjs +865 -0
- package/dist/ui/utils/text-buffer.mjs.map +1 -0
- package/dist/ui/utils/text-utils.cjs +85 -0
- package/dist/ui/utils/text-utils.mjs +78 -0
- package/dist/ui/utils/text-utils.mjs.map +1 -0
- package/dist/utils/agent-v1.cjs +180 -0
- package/dist/utils/agent-v1.d.cts +138 -0
- package/dist/utils/agent-v1.d.cts.map +1 -0
- package/dist/utils/agent-v1.d.mts +138 -0
- package/dist/utils/agent-v1.d.mts.map +1 -0
- package/dist/utils/agent-v1.mjs +179 -0
- package/dist/utils/agent-v1.mjs.map +1 -0
- package/dist/utils/aigne-hub/constants.cjs +22 -0
- package/dist/utils/aigne-hub/constants.mjs +18 -0
- package/dist/utils/aigne-hub/constants.mjs.map +1 -0
- package/dist/utils/aigne-hub/credential.cjs +179 -0
- package/dist/utils/aigne-hub/credential.mjs +175 -0
- package/dist/utils/aigne-hub/credential.mjs.map +1 -0
- package/dist/utils/aigne-hub/crypto.cjs +41 -0
- package/dist/utils/aigne-hub/crypto.mjs +33 -0
- package/dist/utils/aigne-hub/crypto.mjs.map +1 -0
- package/dist/utils/aigne-hub/model.cjs +112 -0
- package/dist/utils/aigne-hub/model.d.cts +19 -0
- package/dist/utils/aigne-hub/model.d.cts.map +1 -0
- package/dist/utils/aigne-hub/model.d.mts +19 -0
- package/dist/utils/aigne-hub/model.d.mts.map +1 -0
- package/dist/utils/aigne-hub/model.mjs +106 -0
- package/dist/utils/aigne-hub/model.mjs.map +1 -0
- package/dist/utils/aigne-hub/store/file.cjs +64 -0
- package/dist/utils/aigne-hub/store/file.mjs +64 -0
- package/dist/utils/aigne-hub/store/file.mjs.map +1 -0
- package/dist/utils/aigne-hub/store/index.cjs +37 -0
- package/dist/utils/aigne-hub/store/index.mjs +37 -0
- package/dist/utils/aigne-hub/store/index.mjs.map +1 -0
- package/dist/utils/aigne-hub/store/keytar.cjs +61 -0
- package/dist/utils/aigne-hub/store/keytar.mjs +61 -0
- package/dist/utils/aigne-hub/store/keytar.mjs.map +1 -0
- package/dist/utils/aigne-hub/store/migrate.cjs +46 -0
- package/dist/utils/aigne-hub/store/migrate.mjs +45 -0
- package/dist/utils/aigne-hub/store/migrate.mjs.map +1 -0
- package/dist/utils/aigne-hub/type.d.cts +18 -0
- package/dist/utils/aigne-hub/type.d.cts.map +1 -0
- package/dist/utils/aigne-hub/type.d.mts +18 -0
- package/dist/utils/aigne-hub/type.d.mts.map +1 -0
- package/dist/utils/aigne-hub-user.cjs +11 -0
- package/dist/utils/aigne-hub-user.d.cts +23 -0
- package/dist/utils/aigne-hub-user.d.cts.map +1 -0
- package/dist/utils/aigne-hub-user.d.mts +23 -0
- package/dist/utils/aigne-hub-user.d.mts.map +1 -0
- package/dist/utils/aigne-hub-user.mjs +11 -0
- package/dist/utils/aigne-hub-user.mjs.map +1 -0
- package/dist/utils/ascii-logo.cjs +30 -0
- package/dist/utils/ascii-logo.d.cts +5 -0
- package/dist/utils/ascii-logo.d.cts.map +1 -0
- package/dist/utils/ascii-logo.d.mts +5 -0
- package/dist/utils/ascii-logo.d.mts.map +1 -0
- package/dist/utils/{ascii-logo.js → ascii-logo.mjs} +13 -3
- package/dist/utils/ascii-logo.mjs.map +1 -0
- package/dist/utils/download.cjs +25 -0
- package/dist/utils/download.d.cts +7 -0
- package/dist/utils/download.d.cts.map +1 -0
- package/dist/utils/download.d.mts +7 -0
- package/dist/utils/download.d.mts.map +1 -0
- package/dist/utils/download.mjs +25 -0
- package/dist/utils/download.mjs.map +1 -0
- package/dist/utils/evaluation/core.cjs +84 -0
- package/dist/utils/evaluation/core.mjs +84 -0
- package/dist/utils/evaluation/core.mjs.map +1 -0
- package/dist/utils/evaluation/dataset.cjs +47 -0
- package/dist/utils/evaluation/dataset.mjs +46 -0
- package/dist/utils/evaluation/dataset.mjs.map +1 -0
- package/dist/utils/evaluation/evaluator.cjs +109 -0
- package/dist/utils/evaluation/{evaluator.js → evaluator.mjs} +48 -45
- package/dist/utils/evaluation/evaluator.mjs.map +1 -0
- package/dist/utils/evaluation/reporter.cjs +225 -0
- package/dist/utils/evaluation/reporter.mjs +220 -0
- package/dist/utils/evaluation/reporter.mjs.map +1 -0
- package/dist/utils/evaluation/runner.cjs +85 -0
- package/dist/utils/evaluation/runner.mjs +85 -0
- package/dist/utils/evaluation/runner.mjs.map +1 -0
- package/dist/utils/get-url-origin.cjs +12 -0
- package/dist/utils/get-url-origin.d.cts +5 -0
- package/dist/utils/get-url-origin.d.cts.map +1 -0
- package/dist/utils/get-url-origin.d.mts +5 -0
- package/dist/utils/get-url-origin.d.mts.map +1 -0
- package/dist/utils/get-url-origin.mjs +12 -0
- package/dist/utils/get-url-origin.mjs.map +1 -0
- package/dist/utils/inquirer/checkbox.cjs +265 -0
- package/dist/utils/inquirer/checkbox.mjs +262 -0
- package/dist/utils/inquirer/checkbox.mjs.map +1 -0
- package/dist/utils/listr.cjs +226 -0
- package/dist/utils/listr.d.cts +71 -0
- package/dist/utils/listr.d.cts.map +1 -0
- package/dist/utils/listr.d.mts +71 -0
- package/dist/utils/listr.d.mts.map +1 -0
- package/dist/utils/listr.mjs +222 -0
- package/dist/utils/listr.mjs.map +1 -0
- package/dist/utils/load-aigne.cjs +77 -0
- package/dist/utils/load-aigne.d.cts +29 -0
- package/dist/utils/load-aigne.d.cts.map +1 -0
- package/dist/utils/load-aigne.d.mts +29 -0
- package/dist/utils/load-aigne.d.mts.map +1 -0
- package/dist/utils/load-aigne.mjs +74 -0
- package/dist/utils/load-aigne.mjs.map +1 -0
- package/dist/utils/run-chat-loop.cjs +90 -0
- package/dist/utils/run-chat-loop.d.cts +20 -0
- package/dist/utils/run-chat-loop.d.cts.map +1 -0
- package/dist/utils/run-chat-loop.d.mts +20 -0
- package/dist/utils/run-chat-loop.d.mts.map +1 -0
- package/dist/utils/run-chat-loop.mjs +89 -0
- package/dist/utils/run-chat-loop.mjs.map +1 -0
- package/dist/utils/run-with-aigne.cjs +131 -0
- package/dist/utils/run-with-aigne.d.cts +46 -0
- package/dist/utils/run-with-aigne.d.cts.map +1 -0
- package/dist/utils/run-with-aigne.d.mts +46 -0
- package/dist/utils/run-with-aigne.d.mts.map +1 -0
- package/dist/utils/run-with-aigne.mjs +126 -0
- package/dist/utils/run-with-aigne.mjs.map +1 -0
- package/dist/utils/serve-mcp.cjs +91 -0
- package/dist/utils/serve-mcp.d.cts +20 -0
- package/dist/utils/serve-mcp.d.cts.map +1 -0
- package/dist/utils/serve-mcp.d.mts +20 -0
- package/dist/utils/serve-mcp.d.mts.map +1 -0
- package/dist/utils/serve-mcp.mjs +89 -0
- package/dist/utils/serve-mcp.mjs.map +1 -0
- package/dist/utils/spinner.cjs +19 -0
- package/dist/utils/spinner.d.cts +5 -0
- package/dist/utils/spinner.d.cts.map +1 -0
- package/dist/utils/spinner.d.mts +5 -0
- package/dist/utils/spinner.d.mts.map +1 -0
- package/dist/utils/spinner.mjs +19 -0
- package/dist/utils/spinner.mjs.map +1 -0
- package/dist/utils/string-utils.cjs +11 -0
- package/dist/utils/string-utils.d.cts +5 -0
- package/dist/utils/string-utils.d.cts.map +1 -0
- package/dist/utils/string-utils.d.mts +5 -0
- package/dist/utils/string-utils.d.mts.map +1 -0
- package/dist/utils/string-utils.mjs +10 -0
- package/dist/utils/string-utils.mjs.map +1 -0
- package/dist/utils/time.cjs +14 -0
- package/dist/utils/time.d.cts +5 -0
- package/dist/utils/time.d.cts.map +1 -0
- package/dist/utils/time.d.mts +5 -0
- package/dist/utils/time.d.mts.map +1 -0
- package/dist/utils/time.mjs +14 -0
- package/dist/utils/time.mjs.map +1 -0
- package/dist/utils/url.cjs +8 -0
- package/dist/utils/url.d.cts +5 -0
- package/dist/utils/url.d.cts.map +1 -0
- package/dist/utils/url.d.mts +5 -0
- package/dist/utils/url.d.mts.map +1 -0
- package/dist/utils/url.mjs +8 -0
- package/dist/utils/url.mjs.map +1 -0
- package/dist/utils/yargs.cjs +191 -0
- package/dist/utils/yargs.d.cts +96 -0
- package/dist/utils/yargs.d.cts.map +1 -0
- package/dist/utils/yargs.d.mts +96 -0
- package/dist/utils/yargs.d.mts.map +1 -0
- package/dist/utils/yargs.mjs +186 -0
- package/dist/utils/yargs.mjs.map +1 -0
- package/package.json +122 -45
- package/CHANGELOG.md +0 -5019
- package/dist/bunwrapper.d.ts +0 -2
- package/dist/bunwrapper.js +0 -18
- package/dist/cli.d.ts +0 -7
- package/dist/cli.js +0 -42
- package/dist/commands/aigne.d.ts +0 -4
- package/dist/commands/aigne.js +0 -35
- package/dist/commands/app/agent.d.ts +0 -26
- package/dist/commands/app/agent.js +0 -122
- package/dist/commands/app/app.d.ts +0 -7
- package/dist/commands/app/app.js +0 -92
- package/dist/commands/app/cli.d.ts +0 -1
- package/dist/commands/app/cli.js +0 -2
- package/dist/commands/app/upgrade.d.ts +0 -54
- package/dist/commands/app/upgrade.js +0 -236
- package/dist/commands/app.d.ts +0 -4
- package/dist/commands/app.js +0 -54
- package/dist/commands/create.d.ts +0 -6
- package/dist/commands/create.js +0 -74
- package/dist/commands/deploy.d.ts +0 -11
- package/dist/commands/deploy.js +0 -255
- package/dist/commands/eval.d.ts +0 -11
- package/dist/commands/eval.js +0 -110
- package/dist/commands/hub.d.ts +0 -3
- package/dist/commands/hub.js +0 -323
- package/dist/commands/observe.d.ts +0 -7
- package/dist/commands/observe.js +0 -41
- package/dist/commands/run-skill.d.ts +0 -6
- package/dist/commands/run-skill.js +0 -102
- package/dist/commands/run.d.ts +0 -9
- package/dist/commands/run.js +0 -187
- package/dist/commands/serve-mcp.d.ts +0 -20
- package/dist/commands/serve-mcp.js +0 -67
- package/dist/commands/test.d.ts +0 -9
- package/dist/commands/test.js +0 -33
- package/dist/constants.d.ts +0 -7
- package/dist/constants.js +0 -21
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/tracer/terminal.d.ts +0 -62
- package/dist/tracer/terminal.js +0 -404
- package/dist/type.d.ts +0 -5
- package/dist/type.js +0 -1
- package/dist/ui/utils/terminal-input.d.ts +0 -19
- package/dist/ui/utils/terminal-input.js +0 -123
- package/dist/ui/utils/text-buffer.d.ts +0 -87
- package/dist/ui/utils/text-buffer.js +0 -1059
- package/dist/ui/utils/text-utils.d.ts +0 -37
- package/dist/ui/utils/text-utils.js +0 -185
- package/dist/utils/agent-v1.d.ts +0 -134
- package/dist/utils/agent-v1.js +0 -213
- package/dist/utils/aigne-hub/constants.d.ts +0 -6
- package/dist/utils/aigne-hub/constants.js +0 -12
- package/dist/utils/aigne-hub/credential.d.ts +0 -20
- package/dist/utils/aigne-hub/credential.js +0 -182
- package/dist/utils/aigne-hub/crypto.d.ts +0 -4
- package/dist/utils/aigne-hub/crypto.js +0 -30
- package/dist/utils/aigne-hub/model.d.ts +0 -13
- package/dist/utils/aigne-hub/model.js +0 -122
- package/dist/utils/aigne-hub/store/file.d.ts +0 -15
- package/dist/utils/aigne-hub/store/file.js +0 -69
- package/dist/utils/aigne-hub/store/index.d.ts +0 -5
- package/dist/utils/aigne-hub/store/index.js +0 -43
- package/dist/utils/aigne-hub/store/keytar.d.ts +0 -15
- package/dist/utils/aigne-hub/store/keytar.js +0 -67
- package/dist/utils/aigne-hub/store/migrate.d.ts +0 -2
- package/dist/utils/aigne-hub/store/migrate.js +0 -57
- package/dist/utils/aigne-hub/type.d.ts +0 -38
- package/dist/utils/aigne-hub/type.js +0 -1
- package/dist/utils/aigne-hub-user.d.ts +0 -16
- package/dist/utils/aigne-hub-user.js +0 -10
- package/dist/utils/ascii-logo.d.ts +0 -1
- package/dist/utils/download.d.ts +0 -3
- package/dist/utils/download.js +0 -19
- package/dist/utils/evaluation/core.d.ts +0 -8
- package/dist/utils/evaluation/core.js +0 -83
- package/dist/utils/evaluation/dataset.d.ts +0 -15
- package/dist/utils/evaluation/dataset.js +0 -61
- package/dist/utils/evaluation/evaluator.d.ts +0 -9
- package/dist/utils/evaluation/reporter.d.ts +0 -28
- package/dist/utils/evaluation/reporter.js +0 -221
- package/dist/utils/evaluation/runner.d.ts +0 -16
- package/dist/utils/evaluation/runner.js +0 -129
- package/dist/utils/evaluation/type.d.ts +0 -69
- package/dist/utils/evaluation/type.js +0 -1
- package/dist/utils/get-url-origin.d.ts +0 -1
- package/dist/utils/get-url-origin.js +0 -8
- package/dist/utils/inquirer/checkbox.d.ts +0 -55
- package/dist/utils/inquirer/checkbox.js +0 -319
- package/dist/utils/listr.d.ts +0 -64
- package/dist/utils/listr.js +0 -265
- package/dist/utils/load-aigne.d.ts +0 -18
- package/dist/utils/load-aigne.js +0 -80
- package/dist/utils/run-chat-loop.d.ts +0 -15
- package/dist/utils/run-chat-loop.js +0 -87
- package/dist/utils/run-with-aigne.d.ts +0 -27
- package/dist/utils/run-with-aigne.js +0 -157
- package/dist/utils/serve-mcp.d.ts +0 -9
- package/dist/utils/serve-mcp.js +0 -93
- package/dist/utils/spinner.d.ts +0 -1
- package/dist/utils/spinner.js +0 -14
- package/dist/utils/string-utils.d.ts +0 -1
- package/dist/utils/string-utils.js +0 -4
- package/dist/utils/time.d.ts +0 -1
- package/dist/utils/time.js +0 -12
- package/dist/utils/url.d.ts +0 -1
- package/dist/utils/url.js +0 -3
- package/dist/utils/yargs.d.ts +0 -94
- package/dist/utils/yargs.js +0 -210
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { isTest } from "../utils/aigne-hub/constants.mjs";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { constants } from "node:fs";
|
|
4
|
+
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { access, copyFile, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
7
|
+
import { Listr } from "@aigne/listr2";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { input, select } from "@inquirer/prompts";
|
|
10
|
+
import { ListrInquirerPromptAdapter } from "@listr2/prompt-adapter-inquirer";
|
|
11
|
+
import { parse, stringify } from "yaml";
|
|
12
|
+
|
|
13
|
+
//#region src/commands/deploy.ts
|
|
14
|
+
async function fileExists(p) {
|
|
15
|
+
try {
|
|
16
|
+
await access(p, constants.F_OK);
|
|
17
|
+
return true;
|
|
18
|
+
} catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const DEPLOYED_FILE = isTest ? "deployed.test.yaml" : "deployed.yaml";
|
|
23
|
+
async function run(cmd, args = [], opts = {}) {
|
|
24
|
+
return new Promise((resolve$1, reject) => {
|
|
25
|
+
const { catchOutput = true, ...rest } = opts;
|
|
26
|
+
const child = spawn(cmd, args, {
|
|
27
|
+
shell: true,
|
|
28
|
+
...rest,
|
|
29
|
+
stdio: catchOutput ? "pipe" : "inherit"
|
|
30
|
+
});
|
|
31
|
+
if (catchOutput) {
|
|
32
|
+
let stdout = "";
|
|
33
|
+
let stderr = "";
|
|
34
|
+
child.stdout?.on("data", (data) => {
|
|
35
|
+
stdout += data.toString();
|
|
36
|
+
});
|
|
37
|
+
child.stderr?.on("data", (data) => {
|
|
38
|
+
stderr += data.toString();
|
|
39
|
+
});
|
|
40
|
+
child.on("close", (code) => {
|
|
41
|
+
if (code === 0) resolve$1(stdout.trim());
|
|
42
|
+
else reject(new Error(stderr.trim() || `Process failed with code ${code}`));
|
|
43
|
+
});
|
|
44
|
+
} else child.on("close", (code) => {
|
|
45
|
+
if (code === 0) resolve$1("");
|
|
46
|
+
else reject(/* @__PURE__ */ new Error(`${cmd} ${args.join(" ")} failed with code ${code}`));
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function createDeployCommands() {
|
|
51
|
+
return {
|
|
52
|
+
command: "deploy",
|
|
53
|
+
describe: "Deploy an aigne application",
|
|
54
|
+
builder: (yargs) => {
|
|
55
|
+
return yargs.option("path", { type: "string" }).option("endpoint", {
|
|
56
|
+
type: "string",
|
|
57
|
+
describe: "Deploy an aigne application to a specified endpoint."
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
handler: async (argv) => {
|
|
61
|
+
const path$1 = argv.path;
|
|
62
|
+
const endpoint = argv.endpoint;
|
|
63
|
+
if (!path$1) {
|
|
64
|
+
console.error("path is required");
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
if (!endpoint) {
|
|
68
|
+
console.error("endpoint is required");
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
await deploy(isAbsolute(path$1) ? path$1 : resolve(process.cwd(), path$1), endpoint);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async function copyDir(src, dest) {
|
|
76
|
+
await mkdir(dest, { recursive: true });
|
|
77
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
78
|
+
const skip = [".deploy", "node_modules"];
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
const srcPath = join(src, entry.name);
|
|
81
|
+
const destPath = join(dest, entry.name);
|
|
82
|
+
if (skip.includes(entry.name)) continue;
|
|
83
|
+
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
84
|
+
else await copyFile(srcPath, destPath);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const deploy = async (path$1, endpoint) => {
|
|
88
|
+
const aigneHomeDir = join(homedir(), ".aigne");
|
|
89
|
+
if (!await fileExists(aigneHomeDir)) await mkdir(aigneHomeDir, { recursive: true });
|
|
90
|
+
const deployRoot = join(path$1, ".deploy");
|
|
91
|
+
const agentDest = join(deployRoot, "agent");
|
|
92
|
+
const tasks = new Listr([
|
|
93
|
+
{
|
|
94
|
+
title: "Prepare deploy environment",
|
|
95
|
+
task: async (ctx, task) => {
|
|
96
|
+
ctx.logs = [];
|
|
97
|
+
task.output = "Preparing deploy environment...";
|
|
98
|
+
const entryFile = join(path$1, "aigne.yaml");
|
|
99
|
+
if (!await fileExists(entryFile)) throw new Error(`Entry file not found: ${entryFile}`);
|
|
100
|
+
await rm(deployRoot, {
|
|
101
|
+
recursive: true,
|
|
102
|
+
force: true
|
|
103
|
+
});
|
|
104
|
+
task.output = "Copying template files...";
|
|
105
|
+
await copyDir(join(dirname(fileURLToPath(import.meta.url)), "../../templates/blocklet"), deployRoot);
|
|
106
|
+
await copyDir(path$1, agentDest);
|
|
107
|
+
for (const file of [
|
|
108
|
+
"package.json",
|
|
109
|
+
"package-lock.json",
|
|
110
|
+
"README.md",
|
|
111
|
+
"CHANGELOG.md",
|
|
112
|
+
"biome.json"
|
|
113
|
+
]) {
|
|
114
|
+
const srcFile = join(path$1, file);
|
|
115
|
+
if (await fileExists(srcFile)) {
|
|
116
|
+
await copyFile(srcFile, join(deployRoot, file));
|
|
117
|
+
await rm(join(deployRoot, file), { force: true });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (await fileExists(join(deployRoot, "package.json"))) {
|
|
121
|
+
task.output = "Running npm install...";
|
|
122
|
+
await run("npm", ["install"], { cwd: deployRoot });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
title: "Check Blocklet CLI",
|
|
128
|
+
task: async (_, task) => {
|
|
129
|
+
try {
|
|
130
|
+
task.output = "Checking Blocklet CLI Version...";
|
|
131
|
+
await run("blocklet", ["--version"], { cwd: deployRoot });
|
|
132
|
+
} catch {
|
|
133
|
+
task.output = "Blocklet CLI not installed, asking to install...";
|
|
134
|
+
const { install } = await task.prompt(ListrInquirerPromptAdapter).run(select, {
|
|
135
|
+
type: "list",
|
|
136
|
+
name: "install",
|
|
137
|
+
message: "Install Blocklet CLI?",
|
|
138
|
+
choices: ["yes", "no"],
|
|
139
|
+
default: "yes"
|
|
140
|
+
});
|
|
141
|
+
if (install === "yes") {
|
|
142
|
+
task.output = "Installing Blocklet CLI...";
|
|
143
|
+
await run("npm", [
|
|
144
|
+
"install",
|
|
145
|
+
"-g",
|
|
146
|
+
"@blocklet/cli"
|
|
147
|
+
], { cwd: deployRoot });
|
|
148
|
+
} else throw new Error("Blocklet CLI not found, please install manually: npm install -g @blocklet/cli");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
title: "Configure Blocklet",
|
|
154
|
+
task: async (ctx, task) => {
|
|
155
|
+
task.output = "Configuring Blocklet...";
|
|
156
|
+
if (await fileExists(join(deployRoot, "blocklet.yml"))) {
|
|
157
|
+
const agentName = parse(await readFile(join(path$1, "aigne.yaml"), "utf-8")).name;
|
|
158
|
+
const deployed = parse(await readFile(join(aigneHomeDir, DEPLOYED_FILE), "utf-8").catch(() => stringify({})));
|
|
159
|
+
let blockletName = deployed[path$1]?.name;
|
|
160
|
+
if (!blockletName) {
|
|
161
|
+
task.output = "Asking for Blocklet name...";
|
|
162
|
+
blockletName = await task.prompt(ListrInquirerPromptAdapter).run(input, {
|
|
163
|
+
type: "input",
|
|
164
|
+
name: "blockletName",
|
|
165
|
+
message: "Please input agent blocklet name:",
|
|
166
|
+
default: deployed[path$1]?.name || agentName || basename(path$1),
|
|
167
|
+
validate: (input$1) => {
|
|
168
|
+
if (input$1.trim() === "") return "Blocklet name cannot be empty.";
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
let did = deployed[path$1]?.did;
|
|
174
|
+
if (!did) {
|
|
175
|
+
task.output = "Creating DID...";
|
|
176
|
+
const info = await run("blocklet", ["create", "--did-only"], {
|
|
177
|
+
cwd: deployRoot,
|
|
178
|
+
catchOutput: true
|
|
179
|
+
});
|
|
180
|
+
const match = info.match(/Created Blocklet DID:\s+(\S+)/);
|
|
181
|
+
if (match?.[1]) did = match[1];
|
|
182
|
+
else throw new Error(`DID not found. Output content: ${info}`);
|
|
183
|
+
}
|
|
184
|
+
task.output = `Blocklet name: ${blockletName}, DID: ${did}`;
|
|
185
|
+
ctx.logs.push(task.output);
|
|
186
|
+
const data = parse(await readFile(join(deployRoot, "blocklet.yml"), "utf-8"));
|
|
187
|
+
data.name = blockletName;
|
|
188
|
+
data.title = blockletName;
|
|
189
|
+
data.did = did;
|
|
190
|
+
await writeFile(join(deployRoot, "blocklet.yml"), stringify(data));
|
|
191
|
+
await writeFile(join(aigneHomeDir, DEPLOYED_FILE), stringify({
|
|
192
|
+
...deployed,
|
|
193
|
+
[path$1]: {
|
|
194
|
+
name: blockletName,
|
|
195
|
+
did
|
|
196
|
+
}
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
title: "Bundle Blocklet",
|
|
203
|
+
task: async (_, task) => {
|
|
204
|
+
task.output = "Running blocklet bundle...";
|
|
205
|
+
await run("blocklet", ["bundle", "--create-release"], { cwd: deployRoot });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
], {
|
|
209
|
+
concurrent: false,
|
|
210
|
+
exitOnError: true,
|
|
211
|
+
rendererOptions: { collapseSubtasks: false }
|
|
212
|
+
});
|
|
213
|
+
try {
|
|
214
|
+
await tasks.run();
|
|
215
|
+
await run("blocklet", [
|
|
216
|
+
"deploy",
|
|
217
|
+
"--endpoint",
|
|
218
|
+
endpoint,
|
|
219
|
+
".blocklet/bundle"
|
|
220
|
+
], {
|
|
221
|
+
cwd: deployRoot,
|
|
222
|
+
catchOutput: false
|
|
223
|
+
});
|
|
224
|
+
await rm(deployRoot, {
|
|
225
|
+
recursive: true,
|
|
226
|
+
force: true
|
|
227
|
+
});
|
|
228
|
+
console.log(`✅ Deploy completed: ${path$1} -> ${endpoint}`);
|
|
229
|
+
} catch (error) {
|
|
230
|
+
console.error(`❌ Deploy failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
231
|
+
process.exit(1);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
//#endregion
|
|
236
|
+
export { createDeployCommands };
|
|
237
|
+
//# sourceMappingURL=deploy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.mjs","names":["path","selectInquirer","inputInquirer","input"],"sources":["../../src/commands/deploy.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport { constants } from \"node:fs\";\nimport { access, copyFile, mkdir, readdir, readFile, rm, writeFile } from \"node:fs/promises\";\nimport { homedir } from \"node:os\";\nimport { basename, dirname, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { Listr } from \"@aigne/listr2\";\nimport { input as inputInquirer, select as selectInquirer } from \"@inquirer/prompts\";\nimport { ListrInquirerPromptAdapter } from \"@listr2/prompt-adapter-inquirer\";\nimport { parse, stringify } from \"yaml\";\nimport type { CommandModule } from \"yargs\";\nimport { isTest } from \"../utils/aigne-hub/constants.js\";\n\ninterface DeployOptions {\n path?: string;\n endpoint?: string;\n}\n\nexport async function fileExists(p: string) {\n try {\n await access(p, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const DEPLOYED_FILE = isTest ? \"deployed.test.yaml\" : \"deployed.yaml\";\n\nexport async function run(cmd: string, args: string[] = [], opts: any = {}): Promise<string> {\n return new Promise((resolve, reject) => {\n const { catchOutput = true, ...rest } = opts;\n const spawnOpts = { shell: true, ...rest, stdio: catchOutput ? \"pipe\" : \"inherit\" };\n const child = spawn(cmd, args, spawnOpts);\n\n if (catchOutput) {\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n\n child.stderr?.on(\"data\", (data) => {\n stderr += data.toString();\n });\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(new Error(stderr.trim() || `Process failed with code ${code}`));\n }\n });\n } else {\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(\"\");\n } else {\n reject(new Error(`${cmd} ${args.join(\" \")} failed with code ${code}`));\n }\n });\n }\n });\n}\n\nexport function createDeployCommands(): CommandModule<unknown, DeployOptions> {\n return {\n command: \"deploy\",\n describe: \"Deploy an aigne application\",\n builder: (yargs) => {\n return yargs\n .option(\"path\", {\n type: \"string\",\n })\n .option(\"endpoint\", {\n type: \"string\",\n describe: \"Deploy an aigne application to a specified endpoint.\",\n });\n },\n handler: async (argv) => {\n const path = argv.path;\n const endpoint = argv.endpoint;\n\n if (!path) {\n console.error(\"path is required\");\n process.exit(1);\n }\n\n if (!endpoint) {\n console.error(\"endpoint is required\");\n process.exit(1);\n }\n\n const absolutePath = isAbsolute(path) ? path : resolve(process.cwd(), path);\n await deploy(absolutePath, endpoint);\n },\n };\n}\n\nasync function copyDir(src: string, dest: string) {\n await mkdir(dest, { recursive: true });\n const entries = await readdir(src, { withFileTypes: true });\n\n const skip = [\".deploy\", \"node_modules\"];\n\n for (const entry of entries) {\n const srcPath = join(src, entry.name);\n const destPath = join(dest, entry.name);\n\n if (skip.includes(entry.name)) continue;\n\n if (entry.isDirectory()) {\n await copyDir(srcPath, destPath);\n } else {\n await copyFile(srcPath, destPath);\n }\n }\n}\n\nexport const deploy = async (path: string, endpoint: string) => {\n const aigneHomeDir = join(homedir(), \".aigne\");\n if (!(await fileExists(aigneHomeDir))) {\n await mkdir(aigneHomeDir, { recursive: true });\n }\n\n const deployRoot = join(path, \".deploy\");\n const agentDest = join(deployRoot, \"agent\");\n\n const tasks = new Listr<{ logs: string[] }>(\n [\n {\n title: \"Prepare deploy environment\",\n task: async (ctx, task) => {\n ctx.logs = [];\n\n task.output = \"Preparing deploy environment...\";\n\n const entryFile = join(path, \"aigne.yaml\");\n if (!(await fileExists(entryFile))) {\n throw new Error(`Entry file not found: ${entryFile}`);\n }\n\n await rm(deployRoot, { recursive: true, force: true });\n\n task.output = \"Copying template files...\";\n\n const templatePath = join(\n dirname(fileURLToPath(import.meta.url)),\n \"../../templates/blocklet\",\n );\n await copyDir(templatePath, deployRoot);\n\n await copyDir(path, agentDest);\n\n const specialFiles = [\n \"package.json\",\n \"package-lock.json\",\n \"README.md\",\n \"CHANGELOG.md\",\n \"biome.json\",\n ];\n for (const file of specialFiles) {\n const srcFile = join(path, file);\n if (await fileExists(srcFile)) {\n await copyFile(srcFile, join(deployRoot, file));\n await rm(join(deployRoot, file), { force: true });\n }\n }\n\n if (await fileExists(join(deployRoot, \"package.json\"))) {\n task.output = \"Running npm install...\";\n await run(\"npm\", [\"install\"], { cwd: deployRoot });\n }\n },\n },\n {\n title: \"Check Blocklet CLI\",\n task: async (_, task) => {\n try {\n task.output = \"Checking Blocklet CLI Version...\";\n await run(\"blocklet\", [\"--version\"], { cwd: deployRoot });\n } catch {\n task.output = \"Blocklet CLI not installed, asking to install...\";\n const { install } = await task\n .prompt(ListrInquirerPromptAdapter as any)\n .run(selectInquirer, {\n type: \"list\",\n name: \"install\",\n message: \"Install Blocklet CLI?\",\n choices: [\"yes\", \"no\"],\n default: \"yes\",\n });\n\n if (install === \"yes\") {\n task.output = \"Installing Blocklet CLI...\";\n await run(\"npm\", [\"install\", \"-g\", \"@blocklet/cli\"], { cwd: deployRoot });\n } else {\n throw new Error(\n \"Blocklet CLI not found, please install manually: npm install -g @blocklet/cli\",\n );\n }\n }\n },\n },\n {\n title: \"Configure Blocklet\",\n task: async (ctx, task) => {\n task.output = \"Configuring Blocklet...\";\n\n if (await fileExists(join(deployRoot, \"blocklet.yml\"))) {\n const entryFile = join(path, \"aigne.yaml\");\n const aigneFile = await readFile(entryFile, \"utf-8\");\n const aigneData = parse(aigneFile);\n const agentName = aigneData.name;\n const deployed = parse(\n await readFile(join(aigneHomeDir, DEPLOYED_FILE), \"utf-8\").catch(() => stringify({})),\n );\n\n let blockletName = deployed[path]?.name;\n\n if (!blockletName) {\n task.output = \"Asking for Blocklet name...\";\n blockletName = await task\n .prompt(ListrInquirerPromptAdapter as any)\n .run(inputInquirer, {\n type: \"input\",\n name: \"blockletName\",\n message: \"Please input agent blocklet name:\",\n default: deployed[path]?.name || agentName || basename(path),\n validate: (input: string) => {\n if (input.trim() === \"\") return \"Blocklet name cannot be empty.\";\n return true;\n },\n });\n }\n\n let did = deployed[path]?.did;\n if (!did) {\n task.output = \"Creating DID...\";\n const info = await run(\"blocklet\", [\"create\", \"--did-only\"], {\n cwd: deployRoot,\n catchOutput: true,\n });\n\n const match = info.match(/Created Blocklet DID:\\s+(\\S+)/);\n if (match?.[1]) {\n did = match[1];\n } else {\n throw new Error(`DID not found. Output content: ${info}`);\n }\n }\n\n task.output = `Blocklet name: ${blockletName}, DID: ${did}`;\n ctx.logs.push(task.output);\n\n const yml = await readFile(join(deployRoot, \"blocklet.yml\"), \"utf-8\");\n const data = parse(yml);\n data.name = blockletName;\n data.title = blockletName;\n data.did = did;\n\n await writeFile(join(deployRoot, \"blocklet.yml\"), stringify(data));\n await writeFile(\n join(aigneHomeDir, DEPLOYED_FILE),\n stringify({ ...deployed, [path]: { name: blockletName, did } }),\n );\n }\n },\n },\n {\n title: \"Bundle Blocklet\",\n task: async (_, task) => {\n task.output = \"Running blocklet bundle...\";\n await run(\"blocklet\", [\"bundle\", \"--create-release\"], { cwd: deployRoot });\n },\n },\n ],\n {\n concurrent: false,\n exitOnError: true,\n rendererOptions: {\n collapseSubtasks: false,\n },\n },\n );\n\n try {\n await tasks.run();\n\n await run(\"blocklet\", [\"deploy\", \"--endpoint\", endpoint, \".blocklet/bundle\"], {\n cwd: deployRoot,\n catchOutput: false,\n });\n\n await rm(deployRoot, { recursive: true, force: true });\n\n console.log(`✅ Deploy completed: ${path} -> ${endpoint}`);\n } catch (error) {\n console.error(`❌ Deploy failed: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAkBA,eAAsB,WAAW,GAAW;AAC1C,KAAI;AACF,QAAM,OAAO,GAAG,UAAU,KAAK;AAC/B,SAAO;SACD;AACN,SAAO;;;AAIX,MAAa,gBAAgB,SAAS,uBAAuB;AAE7D,eAAsB,IAAI,KAAa,OAAiB,EAAE,EAAE,OAAY,EAAE,EAAmB;AAC3F,QAAO,IAAI,SAAS,WAAS,WAAW;EACtC,MAAM,EAAE,cAAc,MAAM,GAAG,SAAS;EAExC,MAAM,QAAQ,MAAM,KAAK,MADP;GAAE,OAAO;GAAM,GAAG;GAAM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time = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils_load_aigne = require('../utils/load-aigne.cjs');
|
|
3
|
+
const require_reporter = require('../utils/evaluation/reporter.cjs');
|
|
4
|
+
const require_core = require('../utils/evaluation/core.cjs');
|
|
5
|
+
const require_dataset = require('../utils/evaluation/dataset.cjs');
|
|
6
|
+
const require_evaluator = require('../utils/evaluation/evaluator.cjs');
|
|
7
|
+
const require_runner = require('../utils/evaluation/runner.cjs');
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
let _aigne_agent_library_utils_fs = require("@aigne/agent-library/utils/fs");
|
|
10
|
+
let _aigne_core_utils_agent_utils = require("@aigne/core/utils/agent-utils");
|
|
11
|
+
let zod = require("zod");
|
|
12
|
+
|
|
13
|
+
//#region src/commands/eval.ts
|
|
14
|
+
const schema = zod.z.object({
|
|
15
|
+
path: zod.z.string().optional(),
|
|
16
|
+
agent: zod.z.string(),
|
|
17
|
+
dataset: zod.z.string(),
|
|
18
|
+
evaluator: zod.z.string().optional(),
|
|
19
|
+
concurrency: zod.z.number().optional(),
|
|
20
|
+
output: zod.z.string().optional()
|
|
21
|
+
});
|
|
22
|
+
const getResolvePath = (path) => {
|
|
23
|
+
return (0, node_path.isAbsolute)(path) ? path : (0, node_path.resolve)(process.cwd(), path);
|
|
24
|
+
};
|
|
25
|
+
function createEvalCommand({ aigneFilePath } = {}) {
|
|
26
|
+
return {
|
|
27
|
+
command: "eval [path] [agent]",
|
|
28
|
+
describe: "Evaluate AIGNE for the specified path",
|
|
29
|
+
builder: async (yargs) => {
|
|
30
|
+
return yargs.positional("path", {
|
|
31
|
+
type: "string",
|
|
32
|
+
describe: "Path to the agents directory or URL to an aigne project",
|
|
33
|
+
default: "."
|
|
34
|
+
}).positional("agent", {
|
|
35
|
+
type: "string",
|
|
36
|
+
describe: "Name of the agent to evaluate"
|
|
37
|
+
}).positional("dataset", {
|
|
38
|
+
type: "string",
|
|
39
|
+
describe: "Path to the dataset file"
|
|
40
|
+
}).positional("evaluator", {
|
|
41
|
+
type: "string",
|
|
42
|
+
describe: "Name of the evaluator to use"
|
|
43
|
+
}).positional("output", {
|
|
44
|
+
alias: "o",
|
|
45
|
+
type: "string",
|
|
46
|
+
describe: "Path to the output file"
|
|
47
|
+
}).positional("concurrency", {
|
|
48
|
+
type: "number",
|
|
49
|
+
describe: "Concurrency level",
|
|
50
|
+
default: 1
|
|
51
|
+
}).help(false).version(false).strict(false);
|
|
52
|
+
},
|
|
53
|
+
handler: async (options) => {
|
|
54
|
+
const parsedOptions = await schema.safeParseAsync(options);
|
|
55
|
+
if (!parsedOptions.success) throw new Error(`Invalid options: ${JSON.stringify(parsedOptions.error.format())}`);
|
|
56
|
+
const { agent: entryAgent, dataset: datasetPath, evaluator: evaluatorName, concurrency } = parsedOptions.data;
|
|
57
|
+
const path = parsedOptions.data?.path;
|
|
58
|
+
const aigne = await require_utils_load_aigne.loadAIGNE({ path: aigneFilePath || path || "." });
|
|
59
|
+
const resolvedDatasetPath = getResolvePath(datasetPath);
|
|
60
|
+
if (!await (0, _aigne_agent_library_utils_fs.exists)(resolvedDatasetPath)) throw new Error("Dataset file does not exist");
|
|
61
|
+
const { chat } = aigne.cli;
|
|
62
|
+
const agent = chat && chat.name === entryAgent ? chat : (0, _aigne_core_utils_agent_utils.findCliAgent)(aigne.cli, "*", entryAgent) || aigne.agents[entryAgent] || aigne.skills[entryAgent] || aigne.mcpServer.agents[entryAgent];
|
|
63
|
+
if (!agent) throw new Error("Entry agent does not exist");
|
|
64
|
+
agent.model = agent.model ?? aigne.model;
|
|
65
|
+
let evaluatorAgent;
|
|
66
|
+
if (evaluatorName) evaluatorAgent = (0, _aigne_core_utils_agent_utils.findCliAgent)(aigne.cli, "*", evaluatorName) || aigne.agents[evaluatorName] || aigne.skills[evaluatorName] || aigne.mcpServer.agents[evaluatorName];
|
|
67
|
+
if (evaluatorAgent) evaluatorAgent.model = evaluatorAgent.model ?? aigne.model;
|
|
68
|
+
const dataset = new require_dataset.FileDataset(resolvedDatasetPath);
|
|
69
|
+
const runner = new require_runner.DefaultRunnerWithConcurrency(agent, aigne);
|
|
70
|
+
const evaluator = new require_evaluator.LLMEvaluator(aigne, evaluatorAgent);
|
|
71
|
+
const reporters = [new require_reporter.ConsoleReporter()];
|
|
72
|
+
if (options.output) {
|
|
73
|
+
const reporter = new require_reporter.CsvReporter(getResolvePath(options.output));
|
|
74
|
+
reporters.push(reporter);
|
|
75
|
+
}
|
|
76
|
+
await require_core.runEvaluationPipeline({
|
|
77
|
+
dataset,
|
|
78
|
+
runner,
|
|
79
|
+
evaluators: [evaluator],
|
|
80
|
+
reporters,
|
|
81
|
+
options: { concurrency }
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.createEvalCommand = createEvalCommand;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { loadAIGNE } from "../utils/load-aigne.mjs";
|
|
2
|
+
import { ConsoleReporter, CsvReporter } from "../utils/evaluation/reporter.mjs";
|
|
3
|
+
import { runEvaluationPipeline } from "../utils/evaluation/core.mjs";
|
|
4
|
+
import { FileDataset } from "../utils/evaluation/dataset.mjs";
|
|
5
|
+
import { LLMEvaluator } from "../utils/evaluation/evaluator.mjs";
|
|
6
|
+
import { DefaultRunnerWithConcurrency } from "../utils/evaluation/runner.mjs";
|
|
7
|
+
import { isAbsolute, resolve } from "node:path";
|
|
8
|
+
import { exists } from "@aigne/agent-library/utils/fs";
|
|
9
|
+
import { findCliAgent } from "@aigne/core/utils/agent-utils";
|
|
10
|
+
import { z as z$1 } from "zod";
|
|
11
|
+
|
|
12
|
+
//#region src/commands/eval.ts
|
|
13
|
+
const schema = z$1.object({
|
|
14
|
+
path: z$1.string().optional(),
|
|
15
|
+
agent: z$1.string(),
|
|
16
|
+
dataset: z$1.string(),
|
|
17
|
+
evaluator: z$1.string().optional(),
|
|
18
|
+
concurrency: z$1.number().optional(),
|
|
19
|
+
output: z$1.string().optional()
|
|
20
|
+
});
|
|
21
|
+
const getResolvePath = (path$1) => {
|
|
22
|
+
return isAbsolute(path$1) ? path$1 : resolve(process.cwd(), path$1);
|
|
23
|
+
};
|
|
24
|
+
function createEvalCommand({ aigneFilePath } = {}) {
|
|
25
|
+
return {
|
|
26
|
+
command: "eval [path] [agent]",
|
|
27
|
+
describe: "Evaluate AIGNE for the specified path",
|
|
28
|
+
builder: async (yargs) => {
|
|
29
|
+
return yargs.positional("path", {
|
|
30
|
+
type: "string",
|
|
31
|
+
describe: "Path to the agents directory or URL to an aigne project",
|
|
32
|
+
default: "."
|
|
33
|
+
}).positional("agent", {
|
|
34
|
+
type: "string",
|
|
35
|
+
describe: "Name of the agent to evaluate"
|
|
36
|
+
}).positional("dataset", {
|
|
37
|
+
type: "string",
|
|
38
|
+
describe: "Path to the dataset file"
|
|
39
|
+
}).positional("evaluator", {
|
|
40
|
+
type: "string",
|
|
41
|
+
describe: "Name of the evaluator to use"
|
|
42
|
+
}).positional("output", {
|
|
43
|
+
alias: "o",
|
|
44
|
+
type: "string",
|
|
45
|
+
describe: "Path to the output file"
|
|
46
|
+
}).positional("concurrency", {
|
|
47
|
+
type: "number",
|
|
48
|
+
describe: "Concurrency level",
|
|
49
|
+
default: 1
|
|
50
|
+
}).help(false).version(false).strict(false);
|
|
51
|
+
},
|
|
52
|
+
handler: async (options) => {
|
|
53
|
+
const parsedOptions = await schema.safeParseAsync(options);
|
|
54
|
+
if (!parsedOptions.success) throw new Error(`Invalid options: ${JSON.stringify(parsedOptions.error.format())}`);
|
|
55
|
+
const { agent: entryAgent, dataset: datasetPath, evaluator: evaluatorName, concurrency } = parsedOptions.data;
|
|
56
|
+
const path$1 = parsedOptions.data?.path;
|
|
57
|
+
const aigne = await loadAIGNE({ path: aigneFilePath || path$1 || "." });
|
|
58
|
+
const resolvedDatasetPath = getResolvePath(datasetPath);
|
|
59
|
+
if (!await exists(resolvedDatasetPath)) throw new Error("Dataset file does not exist");
|
|
60
|
+
const { chat } = aigne.cli;
|
|
61
|
+
const agent = chat && chat.name === entryAgent ? chat : findCliAgent(aigne.cli, "*", entryAgent) || aigne.agents[entryAgent] || aigne.skills[entryAgent] || aigne.mcpServer.agents[entryAgent];
|
|
62
|
+
if (!agent) throw new Error("Entry agent does not exist");
|
|
63
|
+
agent.model = agent.model ?? aigne.model;
|
|
64
|
+
let evaluatorAgent;
|
|
65
|
+
if (evaluatorName) evaluatorAgent = findCliAgent(aigne.cli, "*", evaluatorName) || aigne.agents[evaluatorName] || aigne.skills[evaluatorName] || aigne.mcpServer.agents[evaluatorName];
|
|
66
|
+
if (evaluatorAgent) evaluatorAgent.model = evaluatorAgent.model ?? aigne.model;
|
|
67
|
+
const dataset = new FileDataset(resolvedDatasetPath);
|
|
68
|
+
const runner = new DefaultRunnerWithConcurrency(agent, aigne);
|
|
69
|
+
const evaluator = new LLMEvaluator(aigne, evaluatorAgent);
|
|
70
|
+
const reporters = [new ConsoleReporter()];
|
|
71
|
+
if (options.output) {
|
|
72
|
+
const reporter = new CsvReporter(getResolvePath(options.output));
|
|
73
|
+
reporters.push(reporter);
|
|
74
|
+
}
|
|
75
|
+
await runEvaluationPipeline({
|
|
76
|
+
dataset,
|
|
77
|
+
runner,
|
|
78
|
+
evaluators: [evaluator],
|
|
79
|
+
reporters,
|
|
80
|
+
options: { concurrency }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { createEvalCommand };
|
|
88
|
+
//# sourceMappingURL=eval.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval.mjs","names":["z","path"],"sources":["../../src/commands/eval.ts"],"sourcesContent":["import { isAbsolute, resolve } from \"node:path\";\nimport { exists } from \"@aigne/agent-library/utils/fs\";\nimport type { Agent } from \"@aigne/core\";\nimport { findCliAgent } from \"@aigne/core/utils/agent-utils\";\nimport type { CommandModule } from \"yargs\";\nimport { z } from \"zod\";\nimport { runEvaluationPipeline } from \"../utils/evaluation/core.js\";\nimport { FileDataset } from \"../utils/evaluation/dataset.js\";\nimport { LLMEvaluator } from \"../utils/evaluation/evaluator.js\";\nimport { ConsoleReporter, CsvReporter } from \"../utils/evaluation/reporter.js\";\nimport { DefaultRunnerWithConcurrency } from \"../utils/evaluation/runner.js\";\nimport { loadAIGNE } from \"../utils/load-aigne.js\";\n\nconst schema = z.object({\n path: z.string().optional(),\n agent: z.string(),\n dataset: z.string(),\n evaluator: z.string().optional(),\n concurrency: z.number().optional(),\n output: z.string().optional(),\n});\n\nconst getResolvePath = (path: string) => {\n return isAbsolute(path) ? path : resolve(process.cwd(), path);\n};\n\nexport function createEvalCommand({\n aigneFilePath,\n}: {\n aigneFilePath?: string;\n} = {}): CommandModule<\n unknown,\n {\n path?: string;\n agent?: string;\n dataset?: string;\n evaluator?: string;\n concurrency?: number;\n output?: string;\n }\n> {\n return {\n command: \"eval [path] [agent]\",\n describe: \"Evaluate AIGNE for the specified path\",\n builder: async (yargs) => {\n return yargs\n .positional(\"path\", {\n type: \"string\",\n describe: \"Path to the agents directory or URL to an aigne project\",\n default: \".\",\n })\n .positional(\"agent\", {\n type: \"string\",\n describe: \"Name of the agent to evaluate\",\n })\n .positional(\"dataset\", {\n type: \"string\",\n describe: \"Path to the dataset file\",\n })\n .positional(\"evaluator\", {\n type: \"string\",\n describe: \"Name of the evaluator to use\",\n })\n .positional(\"output\", {\n alias: \"o\",\n type: \"string\",\n describe: \"Path to the output file\",\n })\n .positional(\"concurrency\", {\n type: \"number\",\n describe: \"Concurrency level\",\n default: 1,\n })\n .help(false)\n .version(false)\n .strict(false);\n },\n handler: async (options) => {\n const parsedOptions = await schema.safeParseAsync(options);\n if (!parsedOptions.success) {\n throw new Error(`Invalid options: ${JSON.stringify(parsedOptions.error.format())}`);\n }\n\n const {\n agent: entryAgent,\n dataset: datasetPath,\n evaluator: evaluatorName,\n concurrency,\n } = parsedOptions.data;\n\n const path = parsedOptions.data?.path;\n const aigne = await loadAIGNE({ path: aigneFilePath || path || \".\" });\n\n const resolvedDatasetPath = getResolvePath(datasetPath);\n if (!(await exists(resolvedDatasetPath))) {\n throw new Error(\"Dataset file does not exist\");\n }\n\n const { chat } = aigne.cli;\n const agent =\n chat && chat.name === entryAgent\n ? chat\n : findCliAgent(aigne.cli, \"*\", entryAgent) ||\n aigne.agents[entryAgent] ||\n aigne.skills[entryAgent] ||\n aigne.mcpServer.agents[entryAgent];\n\n if (!agent) throw new Error(\"Entry agent does not exist\");\n agent.model = agent.model ?? aigne.model;\n\n let evaluatorAgent: Agent | undefined;\n if (evaluatorName) {\n evaluatorAgent =\n findCliAgent(aigne.cli, \"*\", evaluatorName) ||\n aigne.agents[evaluatorName] ||\n aigne.skills[evaluatorName] ||\n aigne.mcpServer.agents[evaluatorName];\n }\n\n if (evaluatorAgent) {\n evaluatorAgent.model = evaluatorAgent.model ?? aigne.model;\n }\n\n const dataset = new FileDataset(resolvedDatasetPath);\n const runner = new DefaultRunnerWithConcurrency(agent, aigne);\n const evaluator = new LLMEvaluator(aigne, evaluatorAgent);\n const reporters = [new ConsoleReporter()];\n if (options.output) {\n const resolvedReporterPath = getResolvePath(options.output);\n const reporter = new CsvReporter(resolvedReporterPath);\n reporters.push(reporter);\n }\n\n await runEvaluationPipeline({\n dataset,\n runner,\n evaluators: [evaluator],\n reporters: reporters,\n options: { concurrency },\n });\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,SAASA,IAAE,OAAO;CACtB,MAAMA,IAAE,QAAQ,CAAC,UAAU;CAC3B,OAAOA,IAAE,QAAQ;CACjB,SAASA,IAAE,QAAQ;CACnB,WAAWA,IAAE,QAAQ,CAAC,UAAU;CAChC,aAAaA,IAAE,QAAQ,CAAC,UAAU;CAClC,QAAQA,IAAE,QAAQ,CAAC,UAAU;CAC9B,CAAC;AAEF,MAAM,kBAAkB,WAAiB;AACvC,QAAO,WAAWC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