@agent-smith/cli 0.0.51 → 0.0.53
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/actions/cmd.js +1 -1
- package/dist/cmd/lib/tasks/cmd.js +8 -9
- package/dist/db/db.js +2 -0
- package/dist/db/schemas.js +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.js +2 -1
- package/package.json +8 -8
|
@@ -57,7 +57,7 @@ async function executeActionCmd(args = [], options = {}, quiet = false) {
|
|
|
57
57
|
}
|
|
58
58
|
const { found, path, ext } = getFeatureSpec(name, "action");
|
|
59
59
|
if (!found) {
|
|
60
|
-
throw new Error(
|
|
60
|
+
throw new Error(`Action ${name} not found at ${path}`);
|
|
61
61
|
}
|
|
62
62
|
let act;
|
|
63
63
|
switch (ext) {
|
|
@@ -72,28 +72,27 @@ async function executeTaskCmd(args = [], options = {}) {
|
|
|
72
72
|
taskSpec.tools = [];
|
|
73
73
|
for (const toolName of taskSpec.toolsList) {
|
|
74
74
|
const { found, tool, type } = readTool(toolName);
|
|
75
|
+
if (!found) {
|
|
76
|
+
throw new Error(`tool ${toolName} not found for task ${taskSpec.name}`);
|
|
77
|
+
}
|
|
75
78
|
const lmTool = {
|
|
76
79
|
...tool,
|
|
77
|
-
execute: async (
|
|
80
|
+
execute: async (args) => {
|
|
78
81
|
switch (type) {
|
|
79
82
|
case "action":
|
|
80
|
-
const res = await executeActionCmd([
|
|
83
|
+
const res = await executeActionCmd([toolName, ...Object.values(args)], options, true);
|
|
81
84
|
return res;
|
|
82
85
|
case "task":
|
|
83
|
-
const tres = await executeTaskCmd([
|
|
86
|
+
const tres = await executeTaskCmd([toolName, args], options);
|
|
84
87
|
return tres;
|
|
85
88
|
case "workflow":
|
|
86
|
-
const wres = await executeWorkflowCmd(
|
|
89
|
+
const wres = await executeWorkflowCmd(toolName, ...Object.values(args), options);
|
|
87
90
|
return wres;
|
|
88
91
|
default:
|
|
89
|
-
throw new Error(`unknown tool execution function type: ${type}`);
|
|
92
|
+
throw new Error(`unknown tool execution function type: ${type} for ${toolName}`);
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
|
-
if (!found) {
|
|
94
|
-
console.warn(`Problem: tool ${toolName} not found for task ${taskSpec.name}`);
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
96
|
taskSpec.tools.push(lmTool);
|
|
98
97
|
}
|
|
99
98
|
delete taskSpec.toolsList;
|
package/dist/db/db.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import DatabaseConstructor from "better-sqlite3";
|
|
2
2
|
import { schemas } from "./schemas.js";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import { createDirectoryIfNotExists } from "../cmd/sys/dirs.js";
|
|
4
5
|
const confDir = path.join(process.env.HOME ?? "~/", ".config/agent-smith/cli");
|
|
5
6
|
const dbPath = path.join(confDir, "config.db");
|
|
6
7
|
let db;
|
|
7
8
|
function initDb(isVerbose, execSchema = false) {
|
|
8
9
|
if (execSchema) {
|
|
10
|
+
createDirectoryIfNotExists(confDir, true);
|
|
9
11
|
db = new DatabaseConstructor(dbPath, { fileMustExist: false });
|
|
10
12
|
schemas.forEach((s) => {
|
|
11
13
|
db.exec(s);
|
package/dist/db/schemas.js
CHANGED
|
@@ -61,7 +61,7 @@ const modelfile = `CREATE TABLE IF NOT EXISTS modelfile (
|
|
|
61
61
|
);`;
|
|
62
62
|
const model = `CREATE TABLE IF NOT EXISTS model (
|
|
63
63
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
64
|
-
name TEXT
|
|
64
|
+
name TEXT NOT NULL,
|
|
65
65
|
shortname TEXT UNIQUE NOT NULL,
|
|
66
66
|
data TEXT NOT NULL
|
|
67
67
|
);`;
|
package/dist/main.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ import { usePerfTimer } from "./primitives/perf.js";
|
|
|
10
10
|
import { parseInferenceArgs } from "./primitives/args.js";
|
|
11
11
|
import { parseTaskVars } from "./cmd/lib/tasks/conf.js";
|
|
12
12
|
import { LmTaskConf } from "@agent-smith/lmtask/dist/interfaces.js";
|
|
13
|
-
|
|
13
|
+
import { extractToolDoc } from "./cmd/lib/tools.js";
|
|
14
|
+
export { execute, run, pingCmd, executeWorkflowCmd, executeActionCmd, executeTaskCmd, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseInferenceArgs, parseTaskVars, extractToolDoc, LmTaskConf, };
|
package/dist/main.js
CHANGED
|
@@ -9,4 +9,5 @@ import { initState, pluginDataDir } from "./state/state.js";
|
|
|
9
9
|
import { usePerfTimer } from "./primitives/perf.js";
|
|
10
10
|
import { parseInferenceArgs } from "./primitives/args.js";
|
|
11
11
|
import { parseTaskVars } from "./cmd/lib/tasks/conf.js";
|
|
12
|
-
|
|
12
|
+
import { extractToolDoc } from "./cmd/lib/tools.js";
|
|
13
|
+
export { execute, run, pingCmd, executeWorkflowCmd, executeActionCmd, executeTaskCmd, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseInferenceArgs, parseTaskVars, extractToolDoc, };
|
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.53",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@agent-smith/brain": "^0.0.42",
|
|
14
14
|
"@agent-smith/jobs": "^0.0.14",
|
|
15
|
-
"@agent-smith/lmtask": "^0.0.
|
|
15
|
+
"@agent-smith/lmtask": "^0.0.38",
|
|
16
16
|
"@agent-smith/tfm": "^0.1.2",
|
|
17
|
-
"@inquirer/prompts": "^7.
|
|
18
|
-
"@inquirer/select": "^4.
|
|
17
|
+
"@inquirer/prompts": "^7.5.0",
|
|
18
|
+
"@inquirer/select": "^4.2.0",
|
|
19
19
|
"@vue/reactivity": "^3.5.13",
|
|
20
|
-
"@wllama/wllama": "^2.3.
|
|
20
|
+
"@wllama/wllama": "^2.3.1",
|
|
21
21
|
"ansi-colors": "^4.1.3",
|
|
22
22
|
"better-sqlite3": "^11.9.1",
|
|
23
23
|
"clipboardy": "^4.0.0",
|
|
24
24
|
"commander": "^13.1.0",
|
|
25
25
|
"marked-terminal": "^7.3.0",
|
|
26
|
-
"modprompt": "^0.
|
|
26
|
+
"modprompt": "^0.11.0",
|
|
27
27
|
"python-shell": "^5.0.0",
|
|
28
28
|
"yaml": "^2.7.1"
|
|
29
29
|
},
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
36
36
|
"@types/better-sqlite3": "^7.6.13",
|
|
37
37
|
"@types/marked-terminal": "^6.1.1",
|
|
38
|
-
"@types/node": "^22.
|
|
38
|
+
"@types/node": "^22.15.3",
|
|
39
39
|
"restmix": "^0.5.0",
|
|
40
|
-
"rollup": "^4.
|
|
40
|
+
"rollup": "^4.40.1",
|
|
41
41
|
"ts-node": "^10.9.2",
|
|
42
42
|
"tslib": "2.8.1",
|
|
43
43
|
"typescript": "^5.8.3"
|