mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 17:06:23 +02:00
fix: - remove changes to package-lock
- remove output messages from app.js and moved them into importExample
This commit is contained in:
parent
014c8a56f5
commit
55097817c6
3 changed files with 45 additions and 40 deletions
|
|
@ -44,35 +44,8 @@ yargs(hideBin(process.argv))
|
|||
description: "The example to import",
|
||||
}),
|
||||
async (argv) => {
|
||||
const exampleName = String(argv.example).trim();
|
||||
try {
|
||||
const imported = await importExample(exampleName);
|
||||
|
||||
// Build output message
|
||||
const output = [
|
||||
`✓ Imported example '${exampleName}'`,
|
||||
` Agents: ${imported.importedAgents.join(", ")}`,
|
||||
` Primary: ${imported.entryAgent}`,
|
||||
];
|
||||
|
||||
if (imported.addedServers.length > 0) {
|
||||
output.push(` MCP servers added: ${imported.addedServers.join(", ")}`);
|
||||
}
|
||||
if (imported.skippedServers.length > 0) {
|
||||
output.push(` MCP servers skipped (already configured): ${imported.skippedServers.join(", ")}`);
|
||||
}
|
||||
|
||||
console.log(output.join("\n"));
|
||||
|
||||
if (imported.postInstallInstructions) {
|
||||
console.log("\n" + "=".repeat(60));
|
||||
console.log("POST-INSTALL INSTRUCTIONS");
|
||||
console.log("=".repeat(60));
|
||||
console.log(imported.postInstallInstructions);
|
||||
console.log("=".repeat(60) + "\n");
|
||||
}
|
||||
|
||||
console.log(`\nRun: rowboatx --agent ${imported.entryAgent}`);
|
||||
await importExample(String(argv.example).trim());
|
||||
} catch (error) {
|
||||
console.error("Error:", error?.message ?? error);
|
||||
process.exit(1);
|
||||
|
|
|
|||
6
apps/cli/package-lock.json
generated
6
apps/cli/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@rowboatlabs/rowboatx",
|
||||
"version": "0.12.0",
|
||||
"version": "0.10.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@rowboatlabs/rowboatx",
|
||||
"version": "0.12.0",
|
||||
"version": "0.10.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ai-sdk/anthropic": "^2.0.44",
|
||||
|
|
@ -1779,4 +1779,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -467,21 +467,53 @@ async function mergeMcpServers(servers: Record<string, z.infer<typeof McpServerD
|
|||
}
|
||||
|
||||
export async function importExample(exampleName: string) {
|
||||
// Validate example exists
|
||||
const example = examples[exampleName];
|
||||
const postInstallInstructions = example.instructions;
|
||||
if (!example) {
|
||||
const availableExamples = Object.keys(examples);
|
||||
const listMessage = availableExamples.length
|
||||
? `Available examples: ${availableExamples.join(", ")}`
|
||||
: "No packaged examples are available.";
|
||||
throw new Error(`Unknown example '${exampleName}'. ${listMessage}`);
|
||||
}
|
||||
|
||||
// Import agents and MCP servers
|
||||
await writeAgents(example.agents);
|
||||
let serverMerge = { added: [] as string[], skipped: [] as string[] };
|
||||
if (example.mcpServers) {
|
||||
serverMerge = await mergeMcpServers(example.mcpServers);
|
||||
}
|
||||
return {
|
||||
id: example.id,
|
||||
entryAgent: example.entryAgent,
|
||||
importedAgents: example.agents?.map((agent) => agent.name) ?? [],
|
||||
addedServers: serverMerge.added,
|
||||
skippedServers: serverMerge.skipped,
|
||||
postInstallInstructions,
|
||||
};
|
||||
|
||||
// Build and display output message
|
||||
const importedAgents = example.agents?.map((agent) => agent.name) ?? [];
|
||||
const entryAgent = example.entryAgent ?? importedAgents[0] ?? "";
|
||||
|
||||
const output = [
|
||||
`✓ Imported example '${exampleName}'`,
|
||||
` Agents: ${importedAgents.join(", ")}`,
|
||||
` Primary: ${entryAgent}`,
|
||||
];
|
||||
|
||||
if (serverMerge.added.length > 0) {
|
||||
output.push(` MCP servers added: ${serverMerge.added.join(", ")}`);
|
||||
}
|
||||
if (serverMerge.skipped.length > 0) {
|
||||
output.push(` MCP servers skipped (already configured): ${serverMerge.skipped.join(", ")}`);
|
||||
}
|
||||
|
||||
console.log(output.join("\n"));
|
||||
|
||||
// Display post-install instructions if present
|
||||
if (example.instructions) {
|
||||
console.log("\n" + "=".repeat(60));
|
||||
console.log("POST-INSTALL INSTRUCTIONS");
|
||||
console.log("=".repeat(60));
|
||||
console.log(example.instructions);
|
||||
console.log("=".repeat(60) + "\n");
|
||||
}
|
||||
|
||||
// Display next steps
|
||||
console.log(`\nRun: rowboatx --agent ${entryAgent}`);
|
||||
}
|
||||
|
||||
export async function listExamples() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue