Merge branch 'cli' of github.com:rowboatlabs/rowboat into cli

This commit is contained in:
tusharmagar 2025-11-14 11:13:14 +05:30
commit 571c69a177
8 changed files with 135 additions and 12 deletions

View file

@ -1,5 +1,4 @@
import { streamText, ModelMessage, tool, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import * as readline from "readline/promises";
import { stdin as input, stdout as output } from "process";
import { z } from "zod";
@ -11,8 +10,9 @@ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamRenderer } from "../lib/stream-renderer.js";
import { getProvider } from "../lib/models.js";
import { ModelConfig } from "../config/config.js";
const model = openai("gpt-5");
const rl = readline.createInterface({ input, output });
// Base directory for file operations - dynamically use user's home directory
@ -55,8 +55,12 @@ export async function startCopilot() {
messages.push({ role: "user", content: userInput });
// Stream AI response
process.stdout.write("\nCopilot: ");
let currentStep = 0;
const provider = getProvider();
const result = streamText({
model: model,
model: provider(ModelConfig.defaults.model),
messages: messages,
system: `You are an intelligent workflow assistant helping users manage their workflows in ${BASE_DIR}.