@agent-smith/cli 0.0.13 → 0.0.15
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/clicmds/cmds.js
CHANGED
|
@@ -35,7 +35,6 @@ let cmds = {
|
|
|
35
35
|
t: {
|
|
36
36
|
cmd: _executeTaskCmd,
|
|
37
37
|
description: "execute a task",
|
|
38
|
-
args: "arguments: \n-task (required): the task name\n-args: prompt and other arguments if any for the task"
|
|
39
38
|
},
|
|
40
39
|
j: {
|
|
41
40
|
cmd: _executeJobCmd,
|
|
@@ -66,7 +65,6 @@ function initAliases() {
|
|
|
66
65
|
_cmds[alias.name] = {
|
|
67
66
|
cmd: (args = [], options) => _executeTaskCmd([alias.name, ...args], options),
|
|
68
67
|
description: "task: " + alias.name,
|
|
69
|
-
args: "arguments: \n-args: prompt and other arguments if any for the task"
|
|
70
68
|
};
|
|
71
69
|
break;
|
|
72
70
|
case "action":
|
|
@@ -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,16 +1,19 @@
|
|
|
1
1
|
import { brain, initAgent, taskBuilder } from "../../agent.js";
|
|
2
2
|
import { getFeatureSpec } from "../../state/features.js";
|
|
3
|
-
import { runMode } from "../../state/state.js";
|
|
4
|
-
import { initTaskVars, readTask } from "./utils.js";
|
|
3
|
+
import { inputMode, isDebug, runMode } from "../../state/state.js";
|
|
4
|
+
import { initTaskVars, readPromptFile, readTask } from "./utils.js";
|
|
5
5
|
import { readClipboard } from "../sys/clipboard.js";
|
|
6
6
|
async function executeTaskCmd(args = [], options = {}) {
|
|
7
7
|
await initAgent(runMode.value);
|
|
8
8
|
const name = args.shift();
|
|
9
9
|
const params = args.filter((x) => x.length > 0);
|
|
10
10
|
let pr;
|
|
11
|
-
if (options?.Ic == true) {
|
|
11
|
+
if (options?.Ic == true || inputMode.value == "clipboard") {
|
|
12
12
|
pr = await readClipboard();
|
|
13
13
|
}
|
|
14
|
+
else if (options.Pf || inputMode.value == "promptfile") {
|
|
15
|
+
pr = readPromptFile();
|
|
16
|
+
}
|
|
14
17
|
else if (params.length > 0) {
|
|
15
18
|
pr = params.shift();
|
|
16
19
|
}
|
|
@@ -45,6 +48,9 @@ async function executeTaskCmd(args = [], options = {}) {
|
|
|
45
48
|
process.stdout.write(t);
|
|
46
49
|
});
|
|
47
50
|
conf.expert = ex;
|
|
51
|
+
if (isDebug.value) {
|
|
52
|
+
conf.debug = true;
|
|
53
|
+
}
|
|
48
54
|
const data = await task.run({ prompt: pr, ...vars }, conf);
|
|
49
55
|
if (data?.error) {
|
|
50
56
|
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.15",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -12,7 +12,7 @@
|
|
|
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.
|
|
15
|
+
"@agent-smith/lmtask": "^0.0.22",
|
|
16
16
|
"@inquirer/prompts": "^7.0.0",
|
|
17
17
|
"@inquirer/select": "^4.0.0",
|
|
18
18
|
"@vue/reactivity": "^3.5.12",
|