feat: workflow files part 1
This commit is contained in:
parent
fac7f5c449
commit
3069735ac5
3 changed files with 39 additions and 1 deletions
|
|
@ -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";
|
||||
|
|
|
|||
17
packages/config-yaml/src/markdown/workflowFiles.test.ts
Normal file
17
packages/config-yaml/src/markdown/workflowFiles.test.ts
Normal 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();
|
||||
20
packages/config-yaml/src/markdown/workflowFiles.ts
Normal file
20
packages/config-yaml/src/markdown/workflowFiles.ts
Normal 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>;
|
||||
Loading…
Add table
Reference in a new issue