feat: workflow files part 1

This commit is contained in:
Dallin Romney 2025-09-30 21:48:36 -07:00
parent fac7f5c449
commit 3069735ac5
3 changed files with 39 additions and 1 deletions

View file

@ -1,4 +1,5 @@
export * from "./createMarkdownRule.js";
export * from "./createMarkdownPrompt.js";
export * from "./createMarkdownRule.js";
export * from "./getRuleType.js";
export * from "./markdownToRule.js";
export * from "./workflowFiles.js";

View file

@ -0,0 +1,17 @@
const example = `
---
name: Example Agent / Workflow
description: Trying to wrap my head around what are these files
model: anthropic/claude-sonnet-4
tools:
- linear-mcp
- sentry-mcp:read-alerts
- Read
- Glob
- Bash(git diff:*)
rules:
- org/rule1
- org/rule2
---
This is the prompt
`.trim();

View file

@ -0,0 +1,20 @@
import z from "zod";
/*
Experimental/internal config format for workflows
*/
const workflowFileFrontmatterSchema = z.object({
name: z.string(),
description: z.string(),
model: z.string(),
tools: z.array(z.string()),
rules: z.array(z.string()),
});
export type WorkflowFileFrontmatter = z.infer<
typeof workflowFileFrontmatterSchema
>;
const workflowFileSchema = workflowFileFrontmatterSchema.extend({
prompt: z.string(),
});
export type WorkflowFile = z.infer<typeof workflowFileSchema>;