@agent-smith/cli 0.0.62 → 0.0.63

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.
@@ -5,6 +5,7 @@ import { execute } from "../../sys/execute.js";
5
5
  import { runPyScript } from "../../sys/run_python.js";
6
6
  import { pyShell } from "../../../state/state.js";
7
7
  import { createJsAction } from "./read.js";
8
+ import { runtimeError } from "../../../utils/user_msgs.js";
8
9
  function systemAction(path) {
9
10
  const action = useAgentTask({
10
11
  id: "system_action",
@@ -23,6 +24,10 @@ function systemAction(path) {
23
24
  runArgs = args;
24
25
  }
25
26
  const actionSpec = readYmlFile(path);
27
+ if (!actionSpec.found) {
28
+ runtimeError("System action yml file", path, "not found");
29
+ }
30
+ console.log("Yml action", JSON.stringify(actionSpec.data, null, " "));
26
31
  if (!actionSpec.data?.args) {
27
32
  actionSpec.data.args = [];
28
33
  }
@@ -93,7 +98,7 @@ async function executeActionCmd(args = [], options = {}, quiet = false) {
93
98
  const res = await act.run(args, options);
94
99
  if (!quiet) {
95
100
  if (res) {
96
- console.log("ARES", res);
101
+ console.log(res);
97
102
  }
98
103
  }
99
104
  return res;
@@ -0,0 +1,5 @@
1
+ declare function runtimeError(...msg: string[]): void;
2
+ declare function runtimeWarning(...msg: string[]): void;
3
+ declare function runtimeDataError(...msg: string[]): void;
4
+ declare function runtimeInfo(...msg: string[]): void;
5
+ export { runtimeError, runtimeWarning, runtimeDataError, runtimeInfo, };
@@ -0,0 +1,17 @@
1
+ import { exit } from "process";
2
+ import chalk from 'chalk';
3
+ function runtimeError(...msg) {
4
+ console.warn("💥", chalk.dim("Runtime error:"), ...msg);
5
+ exit(1);
6
+ }
7
+ function runtimeWarning(...msg) {
8
+ console.warn("⚠️", chalk.dim("Runtime warning:"), ...msg);
9
+ }
10
+ function runtimeDataError(...msg) {
11
+ console.warn("❌", chalk.dim("Runtime data error:"), ...msg);
12
+ exit(1);
13
+ }
14
+ function runtimeInfo(...msg) {
15
+ console.log("📫", chalk.dim("Info:"), ...msg);
16
+ }
17
+ export { runtimeError, runtimeWarning, runtimeDataError, runtimeInfo, };
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.62",
5
+ "version": "0.0.63",
6
6
  "scripts": {
7
7
  "buildrl": "rm -rf dist/* && rollup -c",
8
8
  "build": "rm -rf dist/* && tsc",