@agent-smith/cli 0.0.110 → 0.0.111

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.
@@ -64,7 +64,7 @@ function initCommandsFromAliases(program, aliases, features) {
64
64
  const wcmd = program.command(`${alias.name} [args...]`)
65
65
  .description("workflow: " + alias.name)
66
66
  .action(async (...args) => {
67
- executeWorkflowCmd(alias.name, args);
67
+ await executeWorkflowCmd(alias.name, args);
68
68
  });
69
69
  allOptions.forEach(o => wcmd.addOption(o));
70
70
  }
package/dist/cmd/cmds.js CHANGED
@@ -7,7 +7,6 @@ import { isChatMode, runMode } from "../state/state.js";
7
7
  import { initCommandsFromAliases } from "./clicmds/aliases.js";
8
8
  import { initBaseCommands } from "./clicmds/base.js";
9
9
  import { initUserCmds } from "./clicmds/cmds.js";
10
- import { exit } from "node:process";
11
10
  //import { usePerfTimer } from "../main.js";
12
11
  const program = new Command();
13
12
  async function chat(program, options, agent, mcpServers) {
@@ -103,7 +102,8 @@ async function parseCmd(program) {
103
102
  program.name('Agent Smith terminal client');
104
103
  program.description('Terminal agents toolkit');
105
104
  await program.parseAsync();
106
- exit(0);
105
+ //console.log("CMD END");
106
+ //exit(0)
107
107
  /*if (isChatMode.value) {
108
108
  await chat(program)
109
109
  }*/
@@ -157,7 +157,7 @@ async function executeTask(name, payload, options) {
157
157
  };
158
158
  const perfTimer = usePerfTimer(false);
159
159
  let abort = options?.abort ? options.abort : new AbortController();
160
- setInterval(() => {
160
+ const abortTicker = setInterval(() => {
161
161
  //console.log("ABS", abort.signal.aborted);
162
162
  if (abort.signal.aborted) {
163
163
  agent.lm.abort();
@@ -294,7 +294,7 @@ async function executeTask(name, payload, options) {
294
294
  out = await task.run({ prompt: payload.prompt, ...vars }, tconf);
295
295
  }
296
296
  catch (e) {
297
- console.log("ERR CATCH", e);
297
+ //console.log("ERR CATCH", e);
298
298
  const errMsg = `${e}`;
299
299
  if (errMsg.includes("502 Bad Gateway")) {
300
300
  runtimeError("The server answered with a 502 Bad Gateway error. It might be down or misconfigured. Check your inference server.");
@@ -329,6 +329,7 @@ async function executeTask(name, payload, options) {
329
329
  throw new Error(errMsg);
330
330
  }
331
331
  }
332
+ clearInterval(abortTicker);
332
333
  //console.log("END TASK", out);
333
334
  if (!options?.isToolCall) {
334
335
  if (!out.answer.text.endsWith("\n")) {
@@ -125,6 +125,7 @@ async function executeWorkflow(wname, args, options = {}) {
125
125
  catch (e) {
126
126
  throw new Error(`workflow action ${i + 1}: ${e}`);
127
127
  }
128
+ //console.log("END ACTION", step.name)
128
129
  break;
129
130
  case "adaptater":
130
131
  try {
@@ -171,7 +172,13 @@ async function executeWorkflow(wname, args, options = {}) {
171
172
  throw new Error(`Command ${step.name} not found`);
172
173
  }
173
174
  const url = pathToFileURL(path).href;
174
- const jsa = await import(/* @vite-ignore */ url);
175
+ let jsa;
176
+ try {
177
+ jsa = await import(/* @vite-ignore */ url);
178
+ }
179
+ catch (e) {
180
+ throw new Error(`cmd import error ${e}`);
181
+ }
175
182
  if (!jsa?.runCmd) {
176
183
  runtimeError(`workflow ${wname}: can not import the runCmd function from step ${i} for command ${step.name}: please add a runCmd function export`);
177
184
  return;
@@ -210,6 +217,7 @@ async function executeWorkflow(wname, args, options = {}) {
210
217
  //console.log("WFR", taskRes)
211
218
  ++i;
212
219
  }
220
+ //console.log("WF RES")
213
221
  return taskRes;
214
222
  }
215
223
  async function executeWorkflowCmd(name, wargs) {
package/dist/index.js CHANGED
@@ -54,8 +54,10 @@ async function main() {
54
54
  break;
55
55
  default:
56
56
  await parseCmd(program);
57
+ //console.log("PARSE CMD END")
57
58
  break;
58
59
  }
60
+ //console.log("END");
59
61
  }
60
62
  (async () => {
61
63
  await main();
package/package.json CHANGED
@@ -1,23 +1,22 @@
1
1
  {
2
2
  "name": "@agent-smith/cli",
3
3
  "description": "Agent Smith: terminal client for language model agents",
4
- "repository": "https://github.com/synw/agent-smith",
5
- "version": "0.0.110",
4
+ "version": "0.0.111",
6
5
  "scripts": {
7
6
  "build": "rm -rf dist/* && tsc",
8
7
  "cli": "node --loader ts-node/esm bin/index.ts",
9
8
  "watch": "tsc --noCheck -p . -w"
10
9
  },
11
10
  "dependencies": {
12
- "@agent-smith/agent": "^0.3.0",
11
+ "@agent-smith/agent": "^0.3.1",
13
12
  "@agent-smith/nodetask": "^0.2.0",
14
- "@agent-smith/task": "^0.3.0",
13
+ "@agent-smith/task": "^0.3.1",
15
14
  "@agent-smith/tfm": "^0.2.0",
16
- "@inquirer/prompts": "^8.2.1",
15
+ "@inquirer/prompts": "^8.3.0",
17
16
  "@intrinsicai/gbnfgen": "^0.7.0",
18
17
  "@locallm/api": "^0.7.3",
19
- "@modelcontextprotocol/sdk": "^1.26.0",
20
- "@vue/reactivity": "^3.5.28",
18
+ "@modelcontextprotocol/sdk": "^1.27.0",
19
+ "@vue/reactivity": "^3.5.29",
21
20
  "ansi-colors": "^4.1.3",
22
21
  "better-sqlite3": "^12.6.2",
23
22
  "clipboardy": "^5.3.0",
@@ -37,7 +36,7 @@
37
36
  "@types/better-sqlite3": "^7.6.13",
38
37
  "@types/marked-terminal": "^6.1.1",
39
38
  "@types/node": "^25.3.0",
40
- "openai": "^6.22.0",
39
+ "openai": "^6.24.0",
41
40
  "restmix": "^0.6.1",
42
41
  "tslib": "2.8.1",
43
42
  "typescript": "^5.9.3"
@@ -60,5 +59,9 @@
60
59
  "access": "public",
61
60
  "registry": "https://registry.npmjs.org/"
62
61
  },
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/synw/agent-smith.git"
65
+ },
63
66
  "license": "MIT"
64
- }
67
+ }