@agent-smith/cli 0.0.119 → 0.0.121

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.
package/dist/cmd/base.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Option } from "commander";
2
2
  import { conf, state } from "@agent-smith/core";
3
3
  import { parseCommandArgs } from "../utils.js";
4
- import { processAgentCmd, processAgentsCmd, recreateDbCmd, resetDbCmd } from "./cmds.js";
4
+ import { manageWorkspaces, processAgentCmd, processAgentsCmd, recreateDbCmd, resetDbCmd } from "./cmds.js";
5
5
  import { displayOptions, inferenceOptions } from "../options.js";
6
6
  function initBaseCommands(program) {
7
7
  /*program.command("ping")
@@ -59,6 +59,13 @@ function initBaseCommands(program) {
59
59
  .action(async (...args) => {
60
60
  await recreateDbCmd();
61
61
  });
62
+ const wsCmd = program.command("ws")
63
+ .description("manage the workspaces")
64
+ .action(async (...args) => {
65
+ const ca = parseCommandArgs(args);
66
+ await manageWorkspaces(ca.args, ca.options);
67
+ });
68
+ wsCmd.addOption(new Option("-a, --activate <name>", "activate a workspace"));
62
69
  return program;
63
70
  }
64
71
  export { initBaseCommands };
@@ -5,4 +5,5 @@ declare function resetDbCmd(): Promise<any>;
5
5
  declare function recreateDbCmd(): Promise<any>;
6
6
  declare function processAgentsCmd(args: Array<string>, options: Record<string, any>): Promise<void>;
7
7
  declare function processAgentCmd(args: Array<string>, options: Record<string, any>): Promise<any>;
8
- export { initUserCmds, processAgentCmd, processAgentsCmd, resetDbCmd, recreateDbCmd, };
8
+ declare function manageWorkspaces(args: Array<string>, options: Record<string, any>): Promise<void>;
9
+ export { initUserCmds, processAgentCmd, processAgentsCmd, resetDbCmd, recreateDbCmd, manageWorkspaces, };
package/dist/cmd/cmds.js CHANGED
@@ -139,4 +139,24 @@ async function processAgentCmd(args, options) {
139
139
  }
140
140
  //console.log(JSON.stringify(ts, null, " "));
141
141
  }
142
- export { initUserCmds, processAgentCmd, processAgentsCmd, resetDbCmd, recreateDbCmd, };
142
+ async function manageWorkspaces(args, options) {
143
+ if (!options?.activate) {
144
+ const { found, setting } = db.readSetting("workspace");
145
+ const dws = found ? setting : null;
146
+ const ws = db.readWorkspaces();
147
+ ws.forEach(w => {
148
+ const msg = dws == w.name ? colors.bold(w.name) + " " + colors.yellow("[active]") : colors.bold(w.name);
149
+ console.log("- " + msg + " " + w.path);
150
+ });
151
+ }
152
+ else {
153
+ const { found, workspace } = db.readWorkspace(options.activate);
154
+ if (!found) {
155
+ runtimeDataError(`Workspace ${options.activate} not found`);
156
+ return;
157
+ }
158
+ db.upsertSetting("workspace", workspace.name);
159
+ console.log(`Workspace ${colors.bold(options.activate)} activated`);
160
+ }
161
+ }
162
+ export { initUserCmds, processAgentCmd, processAgentsCmd, resetDbCmd, recreateDbCmd, manageWorkspaces, };
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@agent-smith/cli",
3
3
  "description": "Agent Smith: terminal client for language model agents",
4
- "version": "0.0.119",
4
+ "version": "0.0.121",
5
5
  "scripts": {
6
6
  "build": "rm -rf dist/* && tsc",
7
7
  "cli": "node --loader ts-node/esm bin/index.ts",
8
8
  "watch": "tsc --noCheck -p . -w"
9
9
  },
10
10
  "dependencies": {
11
- "@agent-smith/core": "^0.0.3",
11
+ "@agent-smith/core": "^0.0.10",
12
12
  "@inquirer/prompts": "^8.5.2",
13
- "@vue/reactivity": "^3.5.38",
13
+ "@vue/reactivity": "^3.5.39",
14
14
  "ansi-colors": "^4.1.3",
15
15
  "clipboardy": "^5.3.1",
16
16
  "commander": "^15.0.0",
17
17
  "marked-terminal": "^7.3.0",
18
- "ora": "^9.4.0",
18
+ "ora": "^9.4.1",
19
19
  "yaml": "^2.9.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@agent-smith/agent": "^0.5.2",
23
- "@agent-smith/types": "^0.0.6",
23
+ "@agent-smith/types": "^0.0.7",
24
24
  "@cfworker/json-schema": "^4.1.1",
25
25
  "@commander-js/extra-typings": "^15.0.0",
26
26
  "@rollup/plugin-node-resolve": "^16.0.3",
27
27
  "@rollup/plugin-typescript": "^12.3.0",
28
28
  "@types/marked-terminal": "^6.1.1",
29
- "@types/node": "^25.9.3",
29
+ "@types/node": "^26.1.0",
30
30
  "ts-node": "^10.9.2",
31
31
  "tslib": "2.8.1",
32
32
  "typescript": "^6.0.3"