Parse markdown files with YAML frontmatter into AgentdSpec.
data AgentdSpec = AgentdSpec
{ specToolchain :: Text -- base, git, haskell
, specWorkspace :: FilePath -- host path to mount (writable)
, specModel :: Maybe Text -- model override
, specProvider :: Maybe Text -- auth provider
, specMaxCostCents :: Maybe Int
, specMaxIterations :: Maybe Int
, specTask :: Text -- body of the markdown
}
deriving (Show, Eq)
Note: No specSkills field. Skills are just files the agent reads on demand via read_file.
1. Split file at --- delimiters
2. Parse YAML frontmatter
3. Body is everything after second ---
parseSpec :: FilePath -> IO (Either Text AgentdSpec)
parseSpecText :: Text -> Either Text AgentdSpec
Input:
---
toolchain: git
workspace: ./src
---
Do the thing.
Output:
AgentdSpec
{ specToolchain = "git"
, specWorkspace = "./src"
, specModel = Nothing
, specProvider = Nothing
, specMaxCostCents = Nothing
, specMaxIterations = Nothing
, specTask = "Do the thing."
}
Omni/Agentd/Spec.hs