mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 08:56:22 +02:00
add migrate agents script
This commit is contained in:
parent
e40c767336
commit
da20e280f4
3 changed files with 28 additions and 2 deletions
|
|
@ -77,7 +77,9 @@ export class FSAgentsRepo implements IAgentsRepo {
|
|||
}
|
||||
|
||||
async create(agent: z.infer<typeof Agent>): Promise<void> {
|
||||
await fs.writeFile(path.join(this.agentsDir, `${agent.name}.md`), agent.instructions);
|
||||
const { instructions, ...rest } = agent;
|
||||
const contents = `---\n${stringify(rest)}\n---\n${instructions}`;
|
||||
await fs.writeFile(path.join(this.agentsDir, `${agent.name}.md`), contents);
|
||||
}
|
||||
|
||||
async update(id: string, agent: z.infer<typeof UpdateAgentSchema>): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue