@agent-smith/cli 0.0.66 → 0.0.67
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.
|
@@ -5,7 +5,8 @@ declare class McpServer {
|
|
|
5
5
|
transport: StdioClientTransport;
|
|
6
6
|
client: Client;
|
|
7
7
|
authorizedTools: Array<string> | null;
|
|
8
|
-
|
|
8
|
+
tools: Record<string, LmTaskToolSpec>;
|
|
9
|
+
constructor(command: string, args: Array<string>, authorizedTools?: Array<string> | null);
|
|
9
10
|
start(): Promise<void>;
|
|
10
11
|
stop(): Promise<void>;
|
|
11
12
|
extractTools(): Promise<Array<LmTaskToolSpec>>;
|
|
@@ -4,7 +4,8 @@ class McpServer {
|
|
|
4
4
|
transport;
|
|
5
5
|
client;
|
|
6
6
|
authorizedTools = null;
|
|
7
|
-
|
|
7
|
+
tools = {};
|
|
8
|
+
constructor(command, args, authorizedTools = null) {
|
|
8
9
|
this.transport = new StdioClientTransport({
|
|
9
10
|
command: command,
|
|
10
11
|
args: args
|
|
@@ -37,10 +38,11 @@ class McpServer {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
const exec = async (args) => {
|
|
40
|
-
const
|
|
41
|
+
const payload = {
|
|
41
42
|
name: tool.name,
|
|
42
43
|
arguments: args,
|
|
43
|
-
}
|
|
44
|
+
};
|
|
45
|
+
const res = await this.client.callTool(payload);
|
|
44
46
|
return res;
|
|
45
47
|
};
|
|
46
48
|
const t = {
|
|
@@ -49,6 +51,7 @@ class McpServer {
|
|
|
49
51
|
arguments: args,
|
|
50
52
|
execute: exec
|
|
51
53
|
};
|
|
54
|
+
this.tools[tool.name] = t;
|
|
52
55
|
toolSpecs.push(t);
|
|
53
56
|
}
|
|
54
57
|
return toolSpecs;
|
|
@@ -11,11 +11,11 @@ import { isChatMode, runMode } from "../../../state/state.js";
|
|
|
11
11
|
import { program } from "../../cmds.js";
|
|
12
12
|
import { executeAction } from "../actions/cmd.js";
|
|
13
13
|
import { parseCommandArgs, parseTaskConfigOptions } from "../options_parsers.js";
|
|
14
|
-
import { runtimeDataError } from "../user_msgs.js";
|
|
14
|
+
import { runtimeDataError, runtimeWarning } from "../user_msgs.js";
|
|
15
15
|
import { formatStats, readPromptFile } from "../utils.js";
|
|
16
16
|
import { executeWorkflow } from "../workflows/cmd.js";
|
|
17
17
|
import { configureTaskModel, mergeInferParams } from "./conf.js";
|
|
18
|
-
import { McpServer } from "
|
|
18
|
+
import { McpServer } from "../mcp.js";
|
|
19
19
|
import { openTaskSpec } from "./utils.js";
|
|
20
20
|
async function executeTask(name, payload, options, quiet, expert) {
|
|
21
21
|
await initAgent();
|
|
@@ -229,7 +229,12 @@ async function executeTask(name, payload, options, quiet, expert) {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
if (options?.debug === true || options?.verbose === true) {
|
|
232
|
-
|
|
232
|
+
try {
|
|
233
|
+
console.log("\n", formatStats(out.answer.stats));
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
runtimeWarning("Error formating stats:", `${e}`);
|
|
237
|
+
}
|
|
233
238
|
}
|
|
234
239
|
return out;
|
|
235
240
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ import { extractToolDoc } from "./cmd/lib/tools.js";
|
|
|
12
12
|
import { openTaskSpec } from "./cmd/lib/tasks/utils.js";
|
|
13
13
|
import { extractBetweenTags, splitThinking } from "./utils/text.js";
|
|
14
14
|
import { displayOptions, ioOptions, inferenceOptions, taskOptions, actionOptions, workflowOptions } from "./cmd/options.js";
|
|
15
|
-
|
|
15
|
+
import { McpServer } from "./cmd/lib/mcp.js";
|
|
16
|
+
export { execute, run, executeTask, executeAction, executeWorkflow, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseCommandArgs, extractToolDoc, LmTaskConf, openTaskSpec, extractBetweenTags, splitThinking, displayOptions, ioOptions, inferenceOptions, taskOptions, actionOptions, workflowOptions, McpServer, };
|
package/dist/main.js
CHANGED
|
@@ -11,4 +11,5 @@ import { extractToolDoc } from "./cmd/lib/tools.js";
|
|
|
11
11
|
import { openTaskSpec } from "./cmd/lib/tasks/utils.js";
|
|
12
12
|
import { extractBetweenTags, splitThinking } from "./utils/text.js";
|
|
13
13
|
import { displayOptions, ioOptions, inferenceOptions, taskOptions, actionOptions, workflowOptions } from "./cmd/options.js";
|
|
14
|
-
|
|
14
|
+
import { McpServer } from "./cmd/lib/mcp.js";
|
|
15
|
+
export { execute, run, executeTask, executeAction, executeWorkflow, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseCommandArgs, extractToolDoc, openTaskSpec, extractBetweenTags, splitThinking, displayOptions, ioOptions, inferenceOptions, taskOptions, actionOptions, workflowOptions, McpServer, };
|
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.67",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"buildrl": "rm -rf dist/* && rollup -c",
|
|
8
8
|
"build": "rm -rf dist/* && tsc",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@agent-smith/tfm": "^0.1.2",
|
|
17
17
|
"@inquirer/prompts": "^7.5.3",
|
|
18
18
|
"@inquirer/select": "^4.2.3",
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
19
20
|
"@vue/reactivity": "^3.5.16",
|
|
20
21
|
"ansi-colors": "^4.1.3",
|
|
21
22
|
"better-sqlite3": "^11.10.0",
|