mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
Replace logo with 'pi' + version from package.json
This commit is contained in:
parent
5627b3054a
commit
9f0242d477
2 changed files with 16 additions and 5 deletions
|
|
@ -1,10 +1,19 @@
|
|||
import { Agent, ProviderTransport } from "@mariozechner/pi-agent";
|
||||
import { getModel } from "@mariozechner/pi-ai";
|
||||
import chalk from "chalk";
|
||||
import { readFileSync } from "fs";
|
||||
import { dirname, join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { SessionManager } from "./session-manager.js";
|
||||
import { codingTools } from "./tools/index.js";
|
||||
import { TuiRenderer } from "./tui-renderer.js";
|
||||
|
||||
// Get version from package.json
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
||||
const VERSION = packageJson.version;
|
||||
|
||||
interface Args {
|
||||
provider?: string;
|
||||
model?: string;
|
||||
|
|
@ -105,8 +114,8 @@ Guidelines:
|
|||
|
||||
Current directory: ${process.cwd()}`;
|
||||
|
||||
async function runInteractiveMode(agent: Agent, _sessionManager: SessionManager): Promise<void> {
|
||||
const renderer = new TuiRenderer(agent);
|
||||
async function runInteractiveMode(agent: Agent, _sessionManager: SessionManager, version: string): Promise<void> {
|
||||
const renderer = new TuiRenderer(agent, version);
|
||||
|
||||
// Initialize TUI
|
||||
await renderer.init();
|
||||
|
|
@ -238,7 +247,7 @@ export async function main(args: string[]) {
|
|||
const isInteractive = parsed.messages.length === 0;
|
||||
|
||||
if (isInteractive) {
|
||||
await runInteractiveMode(agent, sessionManager);
|
||||
await runInteractiveMode(agent, sessionManager, VERSION);
|
||||
} else {
|
||||
await runSingleShotMode(agent, sessionManager, parsed.messages);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@ export class TuiRenderer {
|
|||
private editor: CustomEditor;
|
||||
private footer: FooterComponent;
|
||||
private agent: Agent;
|
||||
private version: string;
|
||||
private isInitialized = false;
|
||||
private onInputCallback?: (text: string) => void;
|
||||
private loadingAnimation: Loader | null = null;
|
||||
|
|
@ -300,8 +301,9 @@ export class TuiRenderer {
|
|||
// Track assistant message with tool calls that needs stats shown after tools complete
|
||||
private deferredStats: { usage: any; toolCallIds: Set<string> } | null = null;
|
||||
|
||||
constructor(agent: Agent) {
|
||||
constructor(agent: Agent, version: string) {
|
||||
this.agent = agent;
|
||||
this.version = version;
|
||||
this.ui = new TUI(new ProcessTerminal());
|
||||
this.chatContainer = new Container();
|
||||
this.statusContainer = new Container();
|
||||
|
|
@ -333,7 +335,7 @@ export class TuiRenderer {
|
|||
if (this.isInitialized) return;
|
||||
|
||||
// Add header with logo and instructions
|
||||
const logo = chalk.cyan("==[ ") + chalk.bold.cyan("pi") + chalk.cyan(" ]==");
|
||||
const logo = chalk.bold.cyan("pi") + chalk.dim(` v${this.version}`);
|
||||
const instructions = chalk.dim(
|
||||
"esc" +
|
||||
chalk.gray(" to interrupt") +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue