From ffe3ac132750ffb464ac6f4b67fff6c99ff06e2e Mon Sep 17 00:00:00 2001 From: synw Date: Fri, 1 Nov 2024 14:33:03 +0100 Subject: [PATCH] Minor updates in cli --- packages/cli/bin/agent.ts | 9 ++++----- packages/cli/bin/cmd/clicmds/cmds.ts | 2 +- packages/cli/bin/cmd/lib/execute_task.ts | 2 ++ packages/cli/package.json | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/cli/bin/agent.ts b/packages/cli/bin/agent.ts index e8fe43d..5c9cb0b 100644 --- a/packages/cli/bin/agent.ts +++ b/packages/cli/bin/agent.ts @@ -2,7 +2,7 @@ import { useAgentBrain } from "@agent-smith/brain"; import { LmTaskBuilder } from "@agent-smith/lmtask"; import { MarkedExtension, marked } from 'marked'; import { markedTerminal } from "marked-terminal"; -import { FeatureType, RunMode } from "./interfaces.js"; +import { FeatureType } from "./interfaces.js"; marked.use(markedTerminal() as MarkedExtension); @@ -12,7 +12,6 @@ const taskBuilder = new LmTaskBuilder(brain); async function initExperts() { brain.experts.forEach((ex) => { - //ex.backend.setOnStartEmit(() => console.log("")) ex.backend.setOnToken((t) => { process.stdout.write(t) }); @@ -25,9 +24,9 @@ async function initAgent(isVerbose = false): Promise { //console.log("Init", isVerbose); await brain.initLocal(true, isVerbose); await initExperts(); - /*console.log("Backends:", brain.backends.map(x => x.name)); - console.log("Experts:", brain.experts.map(x => x.name)); - console.log("Bfm:", brain.backendsForModels);*/ + //console.log("Backends:", brain.backends.map(x => x.name)); + //console.log("Experts:", brain.experts.map(x => x.name)); + //console.log("Bfm:", brain.backendsForModels); } const brainUp = brain.state.get().isOn; if (isVerbose) { diff --git a/packages/cli/bin/cmd/clicmds/cmds.ts b/packages/cli/bin/cmd/clicmds/cmds.ts index 1a9b5b1..2ba2b0e 100644 --- a/packages/cli/bin/cmd/clicmds/cmds.ts +++ b/packages/cli/bin/cmd/clicmds/cmds.ts @@ -139,7 +139,7 @@ async function _executeTaskCmd(args: Array = [], options: any): Promise< console.warn(error) } if (formatMode.value == "markdown") { - console.log("\n\n------------------\n"); + console.log("\n------------------\n"); console.log((marked.parse(data) as string).trim()) } else { console.log() diff --git a/packages/cli/bin/cmd/lib/execute_task.ts b/packages/cli/bin/cmd/lib/execute_task.ts index 27da485..5b2b338 100644 --- a/packages/cli/bin/cmd/lib/execute_task.ts +++ b/packages/cli/bin/cmd/lib/execute_task.ts @@ -56,7 +56,9 @@ async function executeTaskCmd(args: Array = [], options: any = {}): Prom throw new Error("No expert found for model " + m) } ex.checkStatus(); + //ex.backend.setOnStartEmit(() => console.log("[START]")); ex.backend.setOnToken((t) => { + //console.log("|") process.stdout.write(t) }); conf.expert = ex; diff --git a/packages/cli/package.json b/packages/cli/package.json index e2c1faa..1579654 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -2,7 +2,7 @@ "name": "@agent-smith/cli", "description": "Agent Smith: terminal client for language model agents", "repository": "https://github.com/synw/agent-smith", - "version": "0.0.20", + "version": "0.0.21", "scripts": { "buildrl": "rm -rf dist/* && rollup -c", "build": "rm -rf dist/* && tsc",