@agent-smith/cli 0.0.53 → 0.0.55

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.
@@ -3,7 +3,7 @@ import { getFeatureSpec } from '../../../state/features.js';
3
3
  import { readYmlAction } from "../../sys/read_yml_action.js";
4
4
  import { execute } from "../../sys/execute.js";
5
5
  import { runPyScript } from "../../sys/run_python.js";
6
- import { pyShell } from "../../../state/state.js";
6
+ import { isStateReady, pyShell } from "../../../state/state.js";
7
7
  import { createJsAction } from "./read.js";
8
8
  function systemAction(path) {
9
9
  const action = useAgentTask({
@@ -43,6 +43,7 @@ function pythonAction(path) {
43
43
  return action;
44
44
  }
45
45
  async function executeActionCmd(args = [], options = {}, quiet = false) {
46
+ while (!isStateReady.value) { }
46
47
  const isWorkflow = !Array.isArray(args);
47
48
  let name;
48
49
  if (!isWorkflow) {
@@ -74,7 +75,9 @@ async function executeActionCmd(args = [], options = {}, quiet = false) {
74
75
  default:
75
76
  throw new Error(`Action ext ${ext} not implemented`);
76
77
  }
78
+ console.log("RUN");
77
79
  const res = await act.run(args, options);
80
+ console.log("ACT RES", res);
78
81
  if (res?.error) {
79
82
  throw res.error;
80
83
  }
@@ -108,6 +108,16 @@ function _initTaskParams(params, inferParams) {
108
108
  conf.templateName = params.templateName;
109
109
  delete params.templateName;
110
110
  }
111
+ if (params?.m) {
112
+ if (params.m.includes("/")) {
113
+ const _s = params.m.split("/");
114
+ conf.modelname = _s[0];
115
+ conf.templateName = _s[1];
116
+ }
117
+ else {
118
+ conf.modelname = params.m;
119
+ }
120
+ }
111
121
  const ip = conf.inferParams;
112
122
  if (params?.inferParams) {
113
123
  for (const [k, v] of Object.entries(params.inferParams)) {
@@ -1,2 +1,2 @@
1
- declare function executeWorkflowCmd(name: string, args?: Array<any>, options?: any): Promise<any>;
1
+ declare function executeWorkflowCmd(name: string, args?: Array<any> | Record<string, any>, options?: any): Promise<any>;
2
2
  export { executeWorkflowCmd, };
@@ -12,7 +12,7 @@ async function executeWorkflowCmd(name, args = [], options = {}) {
12
12
  if (isDebug.value || isVerbose.value) {
13
13
  console.log("Running workflow", name, stepNames.length, "steps");
14
14
  }
15
- let params = {};
15
+ let params = Array.isArray(args) ? {} : args;
16
16
  let i = 0;
17
17
  const finalTaskIndex = stepNames.length + 1;
18
18
  let taskRes = {};
package/dist/main.d.ts CHANGED
@@ -7,8 +7,8 @@ import { pingCmd } from "./cmd/clicmds/cmds.js";
7
7
  import { initAgent } from "./agent.js";
8
8
  import { initState, pluginDataDir } from "./state/state.js";
9
9
  import { usePerfTimer } from "./primitives/perf.js";
10
- import { parseInferenceArgs } from "./primitives/args.js";
10
+ import { parseArgs } 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, };
14
+ export { execute, run, pingCmd, executeWorkflowCmd, executeActionCmd, executeTaskCmd, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseArgs, parseTaskVars, extractToolDoc, LmTaskConf, };
package/dist/main.js CHANGED
@@ -7,7 +7,7 @@ import { pingCmd } from "./cmd/clicmds/cmds.js";
7
7
  import { initAgent } from "./agent.js";
8
8
  import { initState, pluginDataDir } from "./state/state.js";
9
9
  import { usePerfTimer } from "./primitives/perf.js";
10
- import { parseInferenceArgs } from "./primitives/args.js";
10
+ import { parseArgs } 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, };
13
+ export { execute, run, pingCmd, executeWorkflowCmd, executeActionCmd, executeTaskCmd, writeToClipboard, initAgent, initState, pluginDataDir, usePerfTimer, parseArgs, parseTaskVars, extractToolDoc, };
@@ -1,5 +1,5 @@
1
- declare function parseInferenceArgs(args: Array<string>): {
2
- inferenceVars: Record<string, any>;
3
- currentArgs: Array<string>;
1
+ declare function parseArgs(args: Array<string>): {
2
+ vars: Record<string, any>;
3
+ args: Array<string>;
4
4
  };
5
- export { parseInferenceArgs, };
5
+ export { parseArgs, };
@@ -1,6 +1,6 @@
1
- function parseInferenceArgs(args) {
2
- const vars = { "inferParams": {} };
3
- const nargs = new Array();
1
+ function parseArgs(args) {
2
+ const _vars = { "inferParams": {} };
3
+ const _nargs = new Array();
4
4
  args.forEach((a) => {
5
5
  if (a.includes("=")) {
6
6
  const t = a.split("=");
@@ -10,27 +10,27 @@ function parseInferenceArgs(args) {
10
10
  case "m":
11
11
  if (v.includes("/")) {
12
12
  const _s = v.split("/");
13
- vars.modelname = _s[0];
14
- vars.templateName = _s[1];
13
+ _vars.modelname = _s[0];
14
+ _vars.templateName = _s[1];
15
15
  }
16
16
  else {
17
- vars.modelname = v;
17
+ _vars.modelname = v;
18
18
  }
19
19
  break;
20
20
  case "ip":
21
21
  v.split(",").forEach((p) => {
22
22
  const s = p.split(":");
23
- vars["inferParams"][s[0]] = parseFloat(s[1]);
23
+ _vars["inferParams"][s[0]] = parseFloat(s[1]);
24
24
  });
25
25
  break;
26
26
  default:
27
- throw new Error(`unknown arg ${a}`);
27
+ _vars[k] = v;
28
28
  }
29
29
  }
30
30
  else {
31
- nargs.push(a);
31
+ _nargs.push(a);
32
32
  }
33
33
  });
34
- return { inferenceVars: vars, currentArgs: nargs };
34
+ return { vars: _vars, args: _nargs };
35
35
  }
36
- export { parseInferenceArgs, };
36
+ export { parseArgs, };
@@ -11,6 +11,7 @@ declare const isVerbose: import("@vue/reactivity").Ref<boolean, boolean>;
11
11
  declare const isShowTokens: import("@vue/reactivity").Ref<boolean, boolean>;
12
12
  declare const promptfilePath: import("@vue/reactivity").Ref<string, string>;
13
13
  declare const dataDirPath: import("@vue/reactivity").Ref<string, string>;
14
+ declare const isStateReady: import("@vue/reactivity").Ref<boolean, boolean>;
14
15
  declare const lastCmd: {
15
16
  name: string;
16
17
  args: Array<string>;
@@ -18,4 +19,4 @@ declare const lastCmd: {
18
19
  declare function initFilepaths(): void;
19
20
  declare function initState(): Promise<void>;
20
21
  declare function pluginDataDir(pluginName: string): string;
21
- export { inputMode, outputMode, isChatMode, isShowTokens, runMode, formatMode, lastCmd, isDebug, isVerbose, promptfilePath, dataDirPath, pluginDataDir, initState, initFilepaths, pyShell, };
22
+ export { inputMode, outputMode, isChatMode, isShowTokens, isStateReady, runMode, formatMode, lastCmd, isDebug, isVerbose, promptfilePath, dataDirPath, pluginDataDir, initState, initFilepaths, pyShell, };
@@ -51,4 +51,4 @@ function pluginDataDir(pluginName) {
51
51
  createDirectoryIfNotExists(pluginDatapath);
52
52
  return pluginDatapath;
53
53
  }
54
- export { inputMode, outputMode, isChatMode, isShowTokens, runMode, formatMode, lastCmd, isDebug, isVerbose, promptfilePath, dataDirPath, pluginDataDir, initState, initFilepaths, pyShell, };
54
+ export { inputMode, outputMode, isChatMode, isShowTokens, isStateReady, runMode, formatMode, lastCmd, isDebug, isVerbose, promptfilePath, dataDirPath, pluginDataDir, initState, initFilepaths, pyShell, };
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.53",
5
+ "version": "0.0.55",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",