@agent-smith/cli 0.0.12 → 0.0.14
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.
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { formatMode, inputMode, outputMode, runMode } from "../../state/state.js";
|
|
1
|
+
import { formatMode, inputMode, isDebug, outputMode, runMode } from "../../state/state.js";
|
|
2
2
|
const modes = {
|
|
3
|
+
"-d": {
|
|
4
|
+
cmd: async () => {
|
|
5
|
+
isDebug.value = true;
|
|
6
|
+
},
|
|
7
|
+
description: "use debug mode",
|
|
8
|
+
},
|
|
3
9
|
"-if": {
|
|
4
10
|
cmd: async () => {
|
|
5
11
|
inputMode.value = "promptfile";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brain, initAgent, taskBuilder } from "../../agent.js";
|
|
2
2
|
import { getFeatureSpec } from "../../state/features.js";
|
|
3
|
-
import { runMode } from "../../state/state.js";
|
|
3
|
+
import { isDebug, runMode } from "../../state/state.js";
|
|
4
4
|
import { initTaskVars, readTask } from "./utils.js";
|
|
5
5
|
import { readClipboard } from "../sys/clipboard.js";
|
|
6
6
|
async function executeTaskCmd(args = [], options = {}) {
|
|
@@ -28,16 +28,26 @@ async function executeTaskCmd(args = [], options = {}) {
|
|
|
28
28
|
const taskSpec = taskBuilder.readFromYaml(res.ymlTask);
|
|
29
29
|
const task = taskBuilder.fromYaml(res.ymlTask);
|
|
30
30
|
const { conf, vars } = initTaskVars(args);
|
|
31
|
-
|
|
31
|
+
let m = taskSpec.model.name;
|
|
32
|
+
let t = taskSpec.template.name;
|
|
33
|
+
if (conf?.model) {
|
|
34
|
+
m = conf.model;
|
|
35
|
+
}
|
|
36
|
+
if (conf?.template) {
|
|
37
|
+
t = conf.template;
|
|
38
|
+
}
|
|
39
|
+
const ex = brain.getOrCreateExpertForModel(m, t);
|
|
32
40
|
if (!ex) {
|
|
33
|
-
throw new Error("No expert found for model " +
|
|
41
|
+
throw new Error("No expert found for model " + m);
|
|
34
42
|
}
|
|
35
43
|
ex.checkStatus();
|
|
36
44
|
ex.backend.setOnToken((t) => {
|
|
37
45
|
process.stdout.write(t);
|
|
38
46
|
});
|
|
39
47
|
conf.expert = ex;
|
|
40
|
-
|
|
48
|
+
if (isDebug.value) {
|
|
49
|
+
conf.debug = true;
|
|
50
|
+
}
|
|
41
51
|
const data = await task.run({ prompt: pr, ...vars }, conf);
|
|
42
52
|
if (data?.error) {
|
|
43
53
|
return { ok: false, data: {}, error: `Error executing task: ${data.error}` };
|
package/dist/state/state.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare const inputMode: import("@vue/reactivity").Ref<InputMode, InputMode>;
|
|
|
5
5
|
declare const outputMode: import("@vue/reactivity").Ref<OutputMode, OutputMode>;
|
|
6
6
|
declare const runMode: import("@vue/reactivity").Ref<RunMode, RunMode>;
|
|
7
7
|
declare const formatMode: import("@vue/reactivity").Ref<FormatMode, FormatMode>;
|
|
8
|
+
declare const isDebug: import("@vue/reactivity").Ref<boolean, boolean>;
|
|
8
9
|
declare const promptfile: import("@vue/reactivity").Ref<string, string>;
|
|
9
10
|
declare const lastCmd: {
|
|
10
11
|
name: string;
|
|
@@ -12,4 +13,4 @@ declare const lastCmd: {
|
|
|
12
13
|
};
|
|
13
14
|
declare function initFeatures(): Promise<void>;
|
|
14
15
|
declare function initState(): Promise<void>;
|
|
15
|
-
export { inputMode, outputMode, runMode, formatMode, lastCmd, promptfile, initState, initFeatures, pyShell, };
|
|
16
|
+
export { inputMode, outputMode, runMode, formatMode, lastCmd, isDebug, promptfile, initState, initFeatures, pyShell, };
|
package/dist/state/state.js
CHANGED
|
@@ -10,6 +10,7 @@ const inputMode = ref("manual");
|
|
|
10
10
|
const outputMode = ref("txt");
|
|
11
11
|
const runMode = ref("cmd");
|
|
12
12
|
const formatMode = ref("text");
|
|
13
|
+
const isDebug = ref(false);
|
|
13
14
|
const promptfile = ref("");
|
|
14
15
|
const lastCmd = reactive({
|
|
15
16
|
name: "",
|
|
@@ -34,4 +35,4 @@ async function initState() {
|
|
|
34
35
|
initConf();
|
|
35
36
|
await initFeatures();
|
|
36
37
|
}
|
|
37
|
-
export { inputMode, outputMode, runMode, formatMode, lastCmd, promptfile, initState, initFeatures, pyShell, };
|
|
38
|
+
export { inputMode, outputMode, runMode, formatMode, lastCmd, isDebug, promptfile, initState, initFeatures, pyShell, };
|
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.14",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@agent-smith/brain": "^0.0.31",
|
|
14
14
|
"@agent-smith/jobs": "^0.0.11",
|
|
15
|
-
"@agent-smith/lmtask": "^0.0.
|
|
16
|
-
"@inquirer/prompts": "^
|
|
17
|
-
"@inquirer/select": "^
|
|
18
|
-
"@vue/reactivity": "^3.5.
|
|
15
|
+
"@agent-smith/lmtask": "^0.0.22",
|
|
16
|
+
"@inquirer/prompts": "^7.0.0",
|
|
17
|
+
"@inquirer/select": "^4.0.0",
|
|
18
|
+
"@vue/reactivity": "^3.5.12",
|
|
19
19
|
"better-sqlite3": "^11.3.0",
|
|
20
20
|
"clipboardy": "^4.0.0",
|
|
21
21
|
"commander": "^12.1.0",
|
|
22
22
|
"draftlog": "^1.0.13",
|
|
23
23
|
"marked-terminal": "^7.1.0",
|
|
24
|
-
"modprompt": "^0.
|
|
24
|
+
"modprompt": "^0.8.1",
|
|
25
25
|
"python-shell": "^5.0.0",
|
|
26
26
|
"yaml": "^2.5.1"
|
|
27
27
|
},
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"@rollup/plugin-typescript": "^12.1.0",
|
|
34
34
|
"@types/better-sqlite3": "^7.6.11",
|
|
35
35
|
"@types/marked-terminal": "^6.1.1",
|
|
36
|
-
"@types/node": "^22.7.
|
|
36
|
+
"@types/node": "^22.7.5",
|
|
37
37
|
"restmix": "^0.5.0",
|
|
38
38
|
"rollup": "^4.24.0",
|
|
39
39
|
"ts-node": "^10.9.2",
|
|
40
40
|
"tslib": "2.7.0",
|
|
41
|
-
"typescript": "^5.6.
|
|
41
|
+
"typescript": "^5.6.3"
|
|
42
42
|
},
|
|
43
43
|
"type": "module",
|
|
44
44
|
"preferGlobal": true,
|