First version copilot:

- basic llm call that can perform CRUD actions over dummy workflow json files
This commit is contained in:
tusharmagar 2025-10-30 16:09:19 +08:00 committed by Ramnique Singh
parent 055dda35b9
commit 4310b1d45d
11 changed files with 327 additions and 4 deletions

View file

@ -1,16 +1,29 @@
import path from "path";
import fs from "fs";
import { fileURLToPath } from "url";
import { McpServerConfig } from "../entities/mcp.js";
import { z } from "zod";
export const WorkDir = "/Users/ramnique/work/rb/rowboat/apps/cli/.rowboat"
// Resolve app root relative to compiled file location (dist/...)
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const AppRoot = path.resolve(__dirname, "../../..");
export const WorkDir = path.join(AppRoot, ".rowboat");
function ensureDirs() {
const ensure = (p: string) => { if (!fs.existsSync(p)) fs.mkdirSync(p, { recursive: true }); };
ensure(WorkDir);
ensure(path.join(WorkDir, "workflows"));
ensure(path.join(WorkDir, "agents"));
ensure(path.join(WorkDir, "mcp"));
}
function loadMcpServerConfig(): z.infer<typeof McpServerConfig> {
const configPath = path.join(WorkDir, "config", "mcp.json");
ensureDirs();
const configPath = path.join(WorkDir, "mcp", "servers.json");
if (!fs.existsSync(configPath)) return { mcpServers: [] };
const config = fs.readFileSync(configPath, "utf8");
return McpServerConfig.parse(JSON.parse(config));
}
const { mcpServers } = loadMcpServerConfig();
export const McpServers = mcpServers;
export const McpServers = mcpServers;