@agent-smith/cli 0.0.81 → 0.0.83

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.
@@ -28,6 +28,7 @@ async function executeTask(name, payload, options, quiet) {
28
28
  }
29
29
  if (options?.debug) {
30
30
  console.log("Task model:", model);
31
+ console.log("Task vars:", vars);
31
32
  }
32
33
  let c = false;
33
34
  const useTemplates = agent.lm.providerType !== "openai";
@@ -144,20 +145,14 @@ async function executeTask(name, payload, options, quiet) {
144
145
  conf.inferParams.stream = true;
145
146
  const tconf = {
146
147
  model: model,
147
- debug: options?.debug ?? false,
148
148
  onToolCall: onToolCall,
149
149
  onToolCallEnd: onToolCallEnd,
150
150
  ...conf,
151
151
  };
152
152
  let out;
153
- try {
154
- out = await task.run({ prompt: payload.prompt, ...vars }, tconf);
155
- if (!out.answer.text.endsWith("\n")) {
156
- console.log();
157
- }
158
- }
159
- catch (err) {
160
- throw new Error(`executing task: ${name} (${err})`);
153
+ out = await task.run({ prompt: payload.prompt, ...vars }, tconf);
154
+ if (!out.answer.text.endsWith("\n")) {
155
+ console.log();
161
156
  }
162
157
  mcpServers.forEach(async (s) => await s.stop());
163
158
  await processOutput(out);
@@ -1,5 +1,5 @@
1
- import { InferenceParams } from "@locallm/types";
2
- import { LmTaskConfig, LmTaskFileSpec, ModelSpec } from "../../../interfaces.js";
1
+ import type { InferenceParams } from "@locallm/types";
2
+ import type { LmTaskConfig, LmTaskFileSpec, ModelSpec } from "../../../interfaces.js";
3
3
  declare function configureTaskModel(itConf: LmTaskConfig, taskSpec: LmTaskFileSpec): ModelSpec;
4
4
  declare function mergeConfOptions(conf: LmTaskConfig, options: Record<string, any>): LmTaskConfig;
5
5
  declare function mergeInferParams(userInferParams: Record<string, any>, taskInferParams: InferenceParams): InferenceParams;
@@ -78,11 +78,9 @@ function configureTaskModel(itConf, taskSpec) {
78
78
  model = m;
79
79
  }
80
80
  }
81
- model.inferParams = ip;
82
81
  if (!model?.ctx || !isModelFromTaskFile) {
83
82
  model.ctx = taskSpec.ctx;
84
83
  }
85
- model.inferParams = ip;
86
84
  if (templateName.length > 0) {
87
85
  model.template = templateName;
88
86
  }
@@ -26,18 +26,24 @@ async function readTask(name, payload, options, agent) {
26
26
  }
27
27
  const taskSpec = taskFileSpec;
28
28
  let vars = {};
29
- if (taskSpec.variables?.optional) {
29
+ if (taskSpec?.variables?.optional) {
30
30
  for (const k of Object.keys(taskSpec.variables.optional)) {
31
31
  if (k in options) {
32
32
  vars[k] = options[k];
33
33
  }
34
+ else if (k in payload) {
35
+ vars[k] = payload[k];
36
+ }
34
37
  }
35
38
  }
36
- if (taskSpec.variables?.required) {
39
+ if (taskSpec?.variables?.required) {
37
40
  for (const k of Object.keys(taskSpec.variables.required)) {
38
41
  if (k in options) {
39
42
  vars[k] = options[k];
40
43
  }
44
+ else if (k in payload) {
45
+ vars[k] = payload[k];
46
+ }
41
47
  }
42
48
  }
43
49
  const mcpServers = new Array();
@@ -26,7 +26,7 @@ async function executeWorkflow(name, params, options) {
26
26
  case "task":
27
27
  try {
28
28
  const tr = await executeTask(name, taskRes, options, true);
29
- taskRes = tr;
29
+ taskRes = { ...tr, ...params };
30
30
  }
31
31
  catch (e) {
32
32
  throw new Error(`workflow task ${i + 1}: ${e}`);
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.81",
5
+ "version": "0.0.83",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",
@@ -10,35 +10,36 @@
10
10
  "watch": "tsc --noCheck -p . -w"
11
11
  },
12
12
  "dependencies": {
13
- "@agent-smith/agent": "^0.0.7",
14
- "@agent-smith/task": "^0.0.5",
13
+ "@agent-smith/agent": "^0.1.1",
14
+ "@agent-smith/task": "^0.1.1",
15
15
  "@agent-smith/tfm": "^0.1.2",
16
- "@inquirer/prompts": "^7.9.0",
16
+ "@inquirer/prompts": "^7.10.0",
17
17
  "@intrinsicai/gbnfgen": "0.12.0",
18
- "@locallm/api": "0.5.1",
19
- "@modelcontextprotocol/sdk": "^1.20.2",
20
- "@vue/reactivity": "^3.5.22",
18
+ "@locallm/api": "^0.6.2",
19
+ "@modelcontextprotocol/sdk": "^1.21.1",
20
+ "@vue/reactivity": "^3.5.24",
21
21
  "ansi-colors": "^4.1.3",
22
22
  "better-sqlite3": "^12.4.1",
23
23
  "clipboardy": "^5.0.0",
24
24
  "commander": "^14.0.2",
25
25
  "marked-terminal": "^7.3.0",
26
- "modprompt": "^0.12.2",
26
+ "modprompt": "^0.12.3",
27
27
  "ora": "^9.0.0",
28
28
  "python-shell": "^5.0.0",
29
29
  "yaml": "^2.8.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@agent-smith/tmem-jobs": "^0.0.4",
33
+ "@cfworker/json-schema": "^4.1.1",
33
34
  "@commander-js/extra-typings": "^14.0.0",
34
35
  "@locallm/types": "^0.4.2",
35
36
  "@rollup/plugin-node-resolve": "^16.0.3",
36
37
  "@rollup/plugin-typescript": "^12.3.0",
37
38
  "@types/better-sqlite3": "^7.6.13",
38
39
  "@types/marked-terminal": "^6.1.1",
39
- "@types/node": "^24.9.1",
40
+ "@types/node": "^24.10.0",
40
41
  "restmix": "^0.5.0",
41
- "rollup": "^4.52.5",
42
+ "rollup": "^4.53.2",
42
43
  "ts-node": "^10.9.2",
43
44
  "tslib": "2.8.1",
44
45
  "typescript": "^5.9.3"