@agent-smith/cli 0.0.2 → 0.0.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/dist/agent.js +1 -1
- package/dist/cmd/cmds.js +2 -1
- package/dist/cmd/lib/execute_job.js +7 -1
- package/dist/cmd/lib/utils.js +10 -2
- package/dist/index.js +0 -0
- package/dist/state/state.d.ts +5 -5
- package/package.json +9 -9
package/dist/agent.js
CHANGED
|
@@ -10,7 +10,7 @@ const modelsForExpert = {};
|
|
|
10
10
|
const taskReader = useLmTask(brain);
|
|
11
11
|
async function initExperts() {
|
|
12
12
|
brain.experts.forEach((ex) => {
|
|
13
|
-
ex.setOnStartEmit(() => console.log("
|
|
13
|
+
ex.setOnStartEmit(() => console.log(""));
|
|
14
14
|
ex.setOnToken((t) => {
|
|
15
15
|
if (formatMode.value == "markdown") {
|
|
16
16
|
logUpdate(marked.parse(ex.stream.get() + t).trim());
|
package/dist/cmd/cmds.js
CHANGED
|
@@ -134,7 +134,8 @@ async function _executeJobCmd(args = [], options) {
|
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
const name = args.shift();
|
|
137
|
-
const
|
|
137
|
+
const res = await executeJobCmd(name, args);
|
|
138
|
+
return res;
|
|
138
139
|
}
|
|
139
140
|
async function _readTaskCmd(args = [], options) {
|
|
140
141
|
if (args.length == 0) {
|
|
@@ -14,7 +14,13 @@ async function executeJobCmd(name, args = []) {
|
|
|
14
14
|
let res = {};
|
|
15
15
|
for (const name of Object.keys(job.tasks)) {
|
|
16
16
|
brain.expertsForModelsInfo();
|
|
17
|
-
|
|
17
|
+
try {
|
|
18
|
+
res = await job.runTask(name, params);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
console.log("ERR", err);
|
|
22
|
+
throw new Error(`Error executing task ${name}: ${err}`);
|
|
23
|
+
}
|
|
18
24
|
params = res.data;
|
|
19
25
|
}
|
|
20
26
|
await job.finish(true);
|
package/dist/cmd/lib/utils.js
CHANGED
|
@@ -29,10 +29,18 @@ function readPromptFile() {
|
|
|
29
29
|
async function processOutput(res) {
|
|
30
30
|
let data = "";
|
|
31
31
|
if (typeof res == "object") {
|
|
32
|
-
|
|
32
|
+
let hasOutput = false;
|
|
33
|
+
if (res?.data) {
|
|
34
|
+
data = res.data;
|
|
35
|
+
hasOutput = true;
|
|
36
|
+
}
|
|
37
|
+
if (res?.text) {
|
|
38
|
+
data = res.text;
|
|
39
|
+
hasOutput = true;
|
|
40
|
+
}
|
|
41
|
+
if (!hasOutput) {
|
|
33
42
|
throw new Error(`No data in res: ${res}`);
|
|
34
43
|
}
|
|
35
|
-
data = res.data;
|
|
36
44
|
}
|
|
37
45
|
else {
|
|
38
46
|
data = res;
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/state/state.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PythonShell } from 'python-shell';
|
|
2
2
|
import { InputMode, RunMode, FormatMode, OutputMode } from "../interfaces.js";
|
|
3
3
|
declare let pyShell: PythonShell;
|
|
4
|
-
declare const inputMode: import("@vue/reactivity").Ref<InputMode
|
|
5
|
-
declare const outputMode: import("@vue/reactivity").Ref<OutputMode
|
|
6
|
-
declare const runMode: import("@vue/reactivity").Ref<RunMode
|
|
7
|
-
declare const formatMode: import("@vue/reactivity").Ref<FormatMode
|
|
8
|
-
declare const promptfile: import("@vue/reactivity").Ref<string
|
|
4
|
+
declare const inputMode: import("@vue/reactivity").Ref<InputMode>;
|
|
5
|
+
declare const outputMode: import("@vue/reactivity").Ref<OutputMode>;
|
|
6
|
+
declare const runMode: import("@vue/reactivity").Ref<RunMode>;
|
|
7
|
+
declare const formatMode: import("@vue/reactivity").Ref<FormatMode>;
|
|
8
|
+
declare const promptfile: import("@vue/reactivity").Ref<string>;
|
|
9
9
|
declare const lastCmd: {
|
|
10
10
|
name: string;
|
|
11
11
|
args: Array<string>;
|
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.3",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@agent-smith/brain": "^0.0.18",
|
|
14
|
-
"@agent-smith/jobs": "^0.0.
|
|
15
|
-
"@agent-smith/lmtask": "^0.0.
|
|
14
|
+
"@agent-smith/jobs": "^0.0.7",
|
|
15
|
+
"@agent-smith/lmtask": "^0.0.10",
|
|
16
16
|
"@inquirer/prompts": "^5.3.8",
|
|
17
17
|
"@inquirer/select": "^2.4.7",
|
|
18
|
-
"@vue/reactivity": "^3.4.
|
|
19
|
-
"better-sqlite3": "^11.1
|
|
18
|
+
"@vue/reactivity": "^3.4.38",
|
|
19
|
+
"better-sqlite3": "^11.2.1",
|
|
20
20
|
"clipboardy": "^4.0.0",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
22
|
"log-update": "^6.1.0",
|
|
23
23
|
"marked-terminal": "^7.1.0",
|
|
24
|
-
"modprompt": "^0.7.
|
|
24
|
+
"modprompt": "^0.7.6",
|
|
25
25
|
"python-shell": "^5.0.0",
|
|
26
26
|
"yaml": "^2.5.0"
|
|
27
27
|
},
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
34
34
|
"@types/better-sqlite3": "^7.6.11",
|
|
35
35
|
"@types/marked-terminal": "^6.1.1",
|
|
36
|
-
"@types/node": "^22.
|
|
37
|
-
"rollup": "^4.
|
|
36
|
+
"@types/node": "^22.5.0",
|
|
37
|
+
"rollup": "^4.21.1",
|
|
38
38
|
"ts-node": "^10.9.2",
|
|
39
|
-
"tslib": "2.
|
|
39
|
+
"tslib": "2.7.0",
|
|
40
40
|
"typescript": "^5.5.4"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|