@agent-smith/cli 0.0.1

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.
Files changed (53) hide show
  1. package/dist/agent.d.ts +15 -0
  2. package/dist/agent.js +47 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +44 -0
  5. package/dist/cmd/cmds.d.ts +7 -0
  6. package/dist/cmd/cmds.js +205 -0
  7. package/dist/cmd/lib/execute_action.d.ts +2 -0
  8. package/dist/cmd/lib/execute_action.js +58 -0
  9. package/dist/cmd/lib/execute_job.d.ts +6 -0
  10. package/dist/cmd/lib/execute_job.js +86 -0
  11. package/dist/cmd/lib/execute_task.d.ts +2 -0
  12. package/dist/cmd/lib/execute_task.js +28 -0
  13. package/dist/cmd/lib/utils.d.ts +4 -0
  14. package/dist/cmd/lib/utils.js +44 -0
  15. package/dist/cmd/options/modes.d.ts +3 -0
  16. package/dist/cmd/options/modes.js +58 -0
  17. package/dist/cmd/sys/clipboard.d.ts +3 -0
  18. package/dist/cmd/sys/clipboard.js +17 -0
  19. package/dist/cmd/sys/execute.d.ts +13 -0
  20. package/dist/cmd/sys/execute.js +44 -0
  21. package/dist/cmd/sys/read_cmds.d.ts +3 -0
  22. package/dist/cmd/sys/read_cmds.js +26 -0
  23. package/dist/cmd/sys/read_conf.d.ts +6 -0
  24. package/dist/cmd/sys/read_conf.js +11 -0
  25. package/dist/cmd/sys/read_features.d.ts +3 -0
  26. package/dist/cmd/sys/read_features.js +83 -0
  27. package/dist/cmd/sys/read_yml_action.d.ts +5 -0
  28. package/dist/cmd/sys/read_yml_action.js +11 -0
  29. package/dist/cmd/sys/run_python.d.ts +3 -0
  30. package/dist/cmd/sys/run_python.js +43 -0
  31. package/dist/conf.d.ts +4 -0
  32. package/dist/conf.js +12 -0
  33. package/dist/db/db.d.ts +5 -0
  34. package/dist/db/db.js +16 -0
  35. package/dist/db/read.d.ts +9 -0
  36. package/dist/db/read.js +53 -0
  37. package/dist/db/schemas.d.ts +2 -0
  38. package/dist/db/schemas.js +42 -0
  39. package/dist/db/write.d.ts +6 -0
  40. package/dist/db/write.js +56 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.js +25 -0
  43. package/dist/interfaces.d.ts +49 -0
  44. package/dist/interfaces.js +1 -0
  45. package/dist/main.d.ts +5 -0
  46. package/dist/main.js +5 -0
  47. package/dist/state/features.d.ts +8 -0
  48. package/dist/state/features.js +29 -0
  49. package/dist/state/plugins.d.ts +6 -0
  50. package/dist/state/plugins.js +24 -0
  51. package/dist/state/state.d.ts +15 -0
  52. package/dist/state/state.js +39 -0
  53. package/package.json +60 -0
@@ -0,0 +1,39 @@
1
+ import { reactive, ref } from "@vue/reactivity";
2
+ import { createConfDirIfNotExists, confDir } from "../conf.js";
3
+ import { initDb, dbPopulateDefaults } from "../db/db.js";
4
+ import { readFeaturePaths } from "../db/read.js";
5
+ import { updateFeatures } from "../db/write.js";
6
+ import { readFeaturesDirs } from "./features.js";
7
+ import { readPluginsPaths } from "./plugins.js";
8
+ let pyShell;
9
+ const inputMode = ref("manual");
10
+ const outputMode = ref("txt");
11
+ const runMode = ref("cmd");
12
+ const formatMode = ref("markdown");
13
+ const promptfile = ref("");
14
+ const lastCmd = reactive({
15
+ name: "",
16
+ args: [],
17
+ });
18
+ function initConf() {
19
+ const exists = createConfDirIfNotExists();
20
+ if (!exists) {
21
+ console.log("Created configuration directory", confDir);
22
+ initDb();
23
+ dbPopulateDefaults();
24
+ }
25
+ else {
26
+ initDb();
27
+ }
28
+ }
29
+ async function initFeatures() {
30
+ const fp = readFeaturePaths();
31
+ const pp = await readPluginsPaths();
32
+ const p = [...fp, ...pp];
33
+ const feats = readFeaturesDirs(p);
34
+ updateFeatures(feats);
35
+ }
36
+ async function initState() {
37
+ initConf();
38
+ }
39
+ export { inputMode, outputMode, runMode, formatMode, lastCmd, promptfile, initState, initFeatures, pyShell, };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@agent-smith/cli",
3
+ "description": "Agent Smith: terminal client for language model agents",
4
+ "repository": "https://github.com/synw/agent-smith",
5
+ "version": "0.0.1",
6
+ "scripts": {
7
+ "buildrl": "rm -rf dist/* && rollup -c",
8
+ "build": "rm -rf dist/* && tsc",
9
+ "cli": "node --loader ts-node/esm bin/index.ts",
10
+ "watch": "tsc -p . -w"
11
+ },
12
+ "dependencies": {
13
+ "@agent-smith/brain": "^0.0.18",
14
+ "@agent-smith/jobs": "^0.0.6",
15
+ "@agent-smith/lmtask": "^0.0.9",
16
+ "@inquirer/prompts": "^5.3.8",
17
+ "@inquirer/select": "^2.4.7",
18
+ "@vue/reactivity": "^3.4.36",
19
+ "better-sqlite3": "^11.1.2",
20
+ "clipboardy": "^4.0.0",
21
+ "log-update": "^6.1.0",
22
+ "marked-terminal": "^7.1.0",
23
+ "modprompt": "^0.7.5",
24
+ "python-shell": "^5.0.0",
25
+ "yaml": "^2.5.0"
26
+ },
27
+ "devDependencies": {
28
+ "rollup": "^4.20.0",
29
+ "@rollup/plugin-node-resolve": "^15.2.3",
30
+ "@rollup/plugin-typescript": "^11.1.6",
31
+ "@agent-smith/tmem-jobs": "^0.0.3",
32
+ "@commander-js/extra-typings": "^12.1.0",
33
+ "@locallm/types": "^0.0.17",
34
+ "@types/better-sqlite3": "^7.6.11",
35
+ "@types/marked-terminal": "^6.1.1",
36
+ "@types/node": "^22.1.0",
37
+ "ts-node": "^10.9.2",
38
+ "tslib": "2.6.3",
39
+ "typescript": "^5.5.4"
40
+ },
41
+ "type": "module",
42
+ "preferGlobal": true,
43
+ "main": "./dist/main.js",
44
+ "exports": {
45
+ ".": {
46
+ "import": "./dist/main.js"
47
+ }
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "bin": {
53
+ "lm": "./dist/index.js"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "registry": "https://registry.npmjs.org/"
58
+ },
59
+ "license": "MIT"
60
+ }