@agent-smith/cli 0.0.97 → 0.0.98

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/cmds.js CHANGED
@@ -20,7 +20,6 @@ async function chat(program, options) {
20
20
  await query(program);
21
21
  }
22
22
  }
23
- options.history = undefined;
24
23
  await agent.run(prompt, chatInferenceParams, options, chatTemplate ? chatTemplate : undefined);
25
24
  console.log();
26
25
  await chat(program, options);
@@ -98,7 +98,12 @@ async function executeTask(name, payload, options, quiet) {
98
98
  process.stdout.write(t);
99
99
  }
100
100
  };
101
- const hasTools = options?.tools;
101
+ let hasTools = false;
102
+ if (task.def?.tools) {
103
+ if (task.def.tools.length > 0) {
104
+ hasTools = true;
105
+ }
106
+ }
102
107
  let continueWrite = true;
103
108
  let skipNextEmptyLinesToken = false;
104
109
  const spinner = ora("Thinking ...");
@@ -146,10 +151,8 @@ async function executeTask(name, payload, options, quiet) {
146
151
  return;
147
152
  }
148
153
  else if (t == tpl.tags.toolCall?.end) {
149
- if (options?.verbose === true) {
150
- skipNextEmptyLinesToken = true;
151
- continueWrite = true;
152
- }
154
+ skipNextEmptyLinesToken = true;
155
+ continueWrite = true;
153
156
  return;
154
157
  }
155
158
  }
@@ -229,6 +232,18 @@ async function executeTask(name, payload, options, quiet) {
229
232
  if (tpl) {
230
233
  setChatTemplate(tpl);
231
234
  }
235
+ if (task.def.tools) {
236
+ options.tools = task.def.tools;
237
+ }
238
+ if (task.def.shots) {
239
+ options.history = task.def.shots;
240
+ }
241
+ if (task.def.template?.system) {
242
+ options.system = task.def.template.system;
243
+ }
244
+ if (task.def.template?.assistant) {
245
+ options.assistant = task.def.template.assistant;
246
+ }
232
247
  setChatInferenceParams(initialInferParams);
233
248
  await chat(program, options);
234
249
  }
@@ -44,7 +44,7 @@ async function executeWorkflow(wname, args, options = {}) {
44
44
  }
45
45
  }
46
46
  if (!pr) {
47
- throw new Error(`Workflow ${wname} step ${i + 1}: provide a prompt for the task ${name}`);
47
+ throw new Error(`Workflow ${wname} step ${i + 1}: provide a prompt for the task ${step.name}`);
48
48
  }
49
49
  const tr = await executeTask(step.name, { prompt: pr }, options, true);
50
50
  taskRes = { ...tr, ...taskRes };
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.97",
5
+ "version": "0.0.98",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",
@@ -10,8 +10,8 @@
10
10
  "watch": "tsc --noCheck -p . -w"
11
11
  },
12
12
  "dependencies": {
13
- "@agent-smith/agent": "^0.1.6",
14
- "@agent-smith/task": "^0.1.8",
13
+ "@agent-smith/agent": "^0.1.8",
14
+ "@agent-smith/task": "^0.1.9",
15
15
  "@agent-smith/tfm": "^0.2.0",
16
16
  "@inquirer/prompts": "^8.1.0",
17
17
  "@intrinsicai/gbnfgen": "0.12.0",
@@ -31,7 +31,7 @@
31
31
  "@agent-smith/tmem-jobs": "^0.0.4",
32
32
  "@cfworker/json-schema": "^4.1.1",
33
33
  "@commander-js/extra-typings": "^14.0.0",
34
- "@locallm/types": "^0.6.4",
34
+ "@locallm/types": "^0.6.5",
35
35
  "@rollup/plugin-node-resolve": "^16.0.3",
36
36
  "@rollup/plugin-typescript": "^12.3.0",
37
37
  "@types/better-sqlite3": "^7.6.13",