Features: - Interactive TUI with React/Ink - Autonomous agent with tool calls (bash, read, write, edit, glob, grep) - Permission system with pattern-based rules - Session management with auto-compaction - Dual providers: GitHub Copilot and Ollama - MCP server integration - Todo panel and theme system - Streaming responses - GitHub-compatible project context
30 lines
831 B
TypeScript
30 lines
831 B
TypeScript
import { readFile, writeFile } from "fs/promises";
|
|
import { join, dirname } from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const ROOT_DIR = join(__dirname, "..");
|
|
const PACKAGE_JSON_PATH = join(ROOT_DIR, "package.json");
|
|
const VERSION_JSON_PATH = join(ROOT_DIR, "src/version.json");
|
|
|
|
const syncVersion = async (): Promise<void> => {
|
|
const packageJson = JSON.parse(await readFile(PACKAGE_JSON_PATH, "utf-8"));
|
|
const { version } = packageJson;
|
|
|
|
const versionJson = { version };
|
|
|
|
await writeFile(
|
|
VERSION_JSON_PATH,
|
|
JSON.stringify(versionJson, null, 2) + "\n",
|
|
);
|
|
|
|
console.log(`Synced version: ${version}`);
|
|
};
|
|
|
|
syncVersion().catch((error) => {
|
|
console.error("Failed to sync version:", error);
|
|
process.exit(1);
|
|
});
|