@agent-smith/cli 0.0.10 → 0.0.11
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/dist/cmd/lib/execute_job.js +24 -7
- package/package.json +2 -2
|
@@ -12,13 +12,23 @@ async function executeJobCmd(name, args = []) {
|
|
|
12
12
|
return { error: `Job ${name} not found` };
|
|
13
13
|
}
|
|
14
14
|
await job.start();
|
|
15
|
-
let params = args;
|
|
16
15
|
let res = {};
|
|
16
|
+
let params = {};
|
|
17
17
|
brain.backendsForModelsInfo();
|
|
18
|
+
let i = 0;
|
|
18
19
|
for (const [name, task] of Object.entries(job.tasks)) {
|
|
19
20
|
if (task.type == "task") {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
let conf = {};
|
|
22
|
+
let vars = {};
|
|
23
|
+
if (i == 0) {
|
|
24
|
+
const tv = initTaskVars(args);
|
|
25
|
+
conf = tv.conf;
|
|
26
|
+
vars = tv.vars;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
conf = {};
|
|
30
|
+
vars = params;
|
|
31
|
+
}
|
|
22
32
|
const { found, path } = getFeatureSpec(name, "task");
|
|
23
33
|
if (!found) {
|
|
24
34
|
return { ok: false, data: {}, error: `Task ${name} not found` };
|
|
@@ -37,7 +47,6 @@ async function executeJobCmd(name, args = []) {
|
|
|
37
47
|
process.stdout.write(t);
|
|
38
48
|
});
|
|
39
49
|
conf["expert"] = ex;
|
|
40
|
-
vars["prompt"] = pr;
|
|
41
50
|
try {
|
|
42
51
|
res = await job.runTask(name, vars, conf);
|
|
43
52
|
if ("text" in res) {
|
|
@@ -46,19 +55,27 @@ async function executeJobCmd(name, args = []) {
|
|
|
46
55
|
console.log(marked.parse(res.text).trim());
|
|
47
56
|
}
|
|
48
57
|
}
|
|
58
|
+
params = res;
|
|
49
59
|
}
|
|
50
60
|
catch (err) {
|
|
51
|
-
return { error: `Error executing task ${name}: ${err}` };
|
|
61
|
+
return { error: `Error executing (${task.type}) task ${name}: ${err}` };
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
64
|
else {
|
|
55
65
|
try {
|
|
56
|
-
|
|
66
|
+
if (i == 0) {
|
|
67
|
+
res = await job.runTask(name, args);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
res = await job.runTask(name, params);
|
|
71
|
+
}
|
|
72
|
+
params = res.data;
|
|
57
73
|
}
|
|
58
74
|
catch (err) {
|
|
59
|
-
return { error: `Error executing task ${name}: ${err}` };
|
|
75
|
+
return { error: `Error executing (${task.type}) task ${name}: ${err}` };
|
|
60
76
|
}
|
|
61
77
|
}
|
|
78
|
+
++i;
|
|
62
79
|
}
|
|
63
80
|
await job.finish(true);
|
|
64
81
|
return res;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@agent-smith/cli",
|
|
3
3
|
"description": "Agent Smith: terminal client for language model agents",
|
|
4
4
|
"repository": "https://github.com/synw/agent-smith",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.11",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@agent-smith/lmtask": "^0.0.20",
|
|
16
16
|
"@inquirer/prompts": "^6.0.1",
|
|
17
17
|
"@inquirer/select": "^3.0.1",
|
|
18
|
-
"@vue/reactivity": "^3.5.
|
|
18
|
+
"@vue/reactivity": "^3.5.7",
|
|
19
19
|
"better-sqlite3": "^11.3.0",
|
|
20
20
|
"clipboardy": "^4.0.0",
|
|
21
21
|
"commander": "^12.1.0",
|