feat: display version underneath ASCII art in intro message
This commit is contained in:
parent
4265335a1f
commit
13eae59287
1 changed files with 19 additions and 2 deletions
21
src/intro.ts
21
src/intro.ts
|
|
@ -1,10 +1,26 @@
|
|||
import { AssistantUnrolled } from "@continuedev/config-yaml";
|
||||
import { type AssistantConfig } from "@continuedev/sdk";
|
||||
import chalk from "chalk";
|
||||
import { readFileSync } from "fs";
|
||||
import { join, dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { CONTINUE_ASCII_ART } from "./asciiArt.js";
|
||||
import { MCPService } from "./mcp.js";
|
||||
import { getAllTools } from "./streamChatResponse.js";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
function getVersion(): string {
|
||||
try {
|
||||
const packagePath = join(__dirname, "..", "package.json");
|
||||
const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
||||
return packageJson.version;
|
||||
} catch (error) {
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
export function loadSystemMessage(
|
||||
assistant: AssistantConfig
|
||||
): string | undefined {
|
||||
|
|
@ -23,8 +39,9 @@ export function introMessage(
|
|||
const mcpPrompts = mcpService.getPrompts() ?? [];
|
||||
|
||||
console.info(chalk.cyan(CONTINUE_ASCII_ART));
|
||||
console.info(chalk.gray(`v${getVersion()}\n`));
|
||||
|
||||
console.info(`\n${chalk.bold.blue(`Agent: ${config.name}\n`)}`);
|
||||
console.info(`${chalk.bold.blue(`Agent: ${config.name}\n`)}`);
|
||||
console.info(`${chalk.yellow("Model:")} ${modelName.split("/").pop()}\n`);
|
||||
|
||||
console.info(chalk.yellow("Tools:"));
|
||||
|
|
@ -65,4 +82,4 @@ export function introMessage(
|
|||
});
|
||||
}
|
||||
console.info("");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue