@agent-smith/cli 0.0.14 → 0.0.16

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.
@@ -35,7 +35,6 @@ let cmds = {
35
35
  t: {
36
36
  cmd: _executeTaskCmd,
37
37
  description: "execute a task",
38
- args: "arguments: \n-task (required): the task name\n-args: prompt and other arguments if any for the task"
39
38
  },
40
39
  j: {
41
40
  cmd: _executeJobCmd,
@@ -66,21 +65,18 @@ function initAliases() {
66
65
  _cmds[alias.name] = {
67
66
  cmd: (args = [], options) => _executeTaskCmd([alias.name, ...args], options),
68
67
  description: "task: " + alias.name,
69
- args: "arguments: \n-args: prompt and other arguments if any for the task"
70
68
  };
71
69
  break;
72
70
  case "action":
73
71
  _cmds[alias.name] = {
74
72
  cmd: (args = [], options = {}, quiet = false) => executeActionCmd([alias.name, ...args], options, quiet),
75
73
  description: "action: " + alias.name,
76
- args: "arguments: \n-args: other arguments if any for the action"
77
74
  };
78
75
  break;
79
76
  case "job":
80
77
  _cmds[alias.name] = {
81
78
  cmd: (args = [], options) => _executeJobCmd([alias.name, ...args], options),
82
79
  description: "job: " + alias.name,
83
- args: "arguments: \n-args: other arguments if any for the job"
84
80
  };
85
81
  }
86
82
  });
@@ -147,7 +143,7 @@ async function _executeJobCmd(args = [], options) {
147
143
  return;
148
144
  }
149
145
  const name = args.shift();
150
- const res = await executeJobCmd(name, args);
146
+ const res = await executeJobCmd(name, args, options);
151
147
  return res;
152
148
  }
153
149
  async function _readTaskCmd(args = [], options) {
@@ -49,7 +49,7 @@ async function executeActionCmd(args = [], options = {}, quiet = false) {
49
49
  throw new Error(`Action ext ${ext} not implemented`);
50
50
  break;
51
51
  }
52
- const res = await act.run(args);
52
+ const res = await act.run(args, options);
53
53
  if (!quiet) {
54
54
  console.log(res.data);
55
55
  }
@@ -1,4 +1,4 @@
1
- declare function executeJobCmd(name: string, args?: Array<any>): Promise<Record<string, any>>;
1
+ declare function executeJobCmd(name: string, args?: Array<any>, options?: any): Promise<Record<string, any>>;
2
2
  declare function readJob(name: string): Promise<{
3
3
  found: boolean;
4
4
  data: Record<string, any>;
@@ -5,7 +5,7 @@ import { brain, marked, taskBuilder } from '../../agent.js';
5
5
  import { getFeatureSpec } from '../../state/features.js';
6
6
  import { formatMode } from '../../state/state.js';
7
7
  import { initTaskVars, readTask } from './utils.js';
8
- async function executeJobCmd(name, args = []) {
8
+ async function executeJobCmd(name, args = [], options = {}) {
9
9
  const { job, found } = await _dispatchReadJob(name);
10
10
  if (!found) {
11
11
  console.log(`Job ${name} not found`);
@@ -64,10 +64,10 @@ async function executeJobCmd(name, args = []) {
64
64
  else {
65
65
  try {
66
66
  if (i == 0) {
67
- res = await job.runTask(name, args);
67
+ res = await job.runTask(name, args, options);
68
68
  }
69
69
  else {
70
- res = await job.runTask(name, params);
70
+ res = await job.runTask(name, params, options);
71
71
  }
72
72
  params = res.data;
73
73
  }
@@ -1,16 +1,19 @@
1
1
  import { brain, initAgent, taskBuilder } from "../../agent.js";
2
2
  import { getFeatureSpec } from "../../state/features.js";
3
- import { isDebug, runMode } from "../../state/state.js";
4
- import { initTaskVars, readTask } from "./utils.js";
3
+ import { inputMode, isDebug, runMode } from "../../state/state.js";
4
+ import { initTaskVars, readPromptFile, readTask } from "./utils.js";
5
5
  import { readClipboard } from "../sys/clipboard.js";
6
6
  async function executeTaskCmd(args = [], options = {}) {
7
7
  await initAgent(runMode.value);
8
8
  const name = args.shift();
9
9
  const params = args.filter((x) => x.length > 0);
10
10
  let pr;
11
- if (options?.Ic == true) {
11
+ if (options?.Ic == true || inputMode.value == "clipboard") {
12
12
  pr = await readClipboard();
13
13
  }
14
+ else if (options.Pf || inputMode.value == "promptfile") {
15
+ pr = readPromptFile();
16
+ }
14
17
  else if (params.length > 0) {
15
18
  pr = params.shift();
16
19
  }
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.14",
5
+ "version": "0.0.16",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",