Implement spec parser

t-320.4·WorkTask·
·
·
·Omni/Agentd/Spec.hs
Parent:t-320·Created1 month ago·Updated1 month ago

Dependencies

Description

Edit

Summary

Parse markdown files with YAML frontmatter into AgentdSpec.

Types

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.

Parsing

1. Split file at --- delimiters 2. Parse YAML frontmatter 3. Body is everything after second ---

API

parseSpec :: FilePath -> IO (Either Text AgentdSpec)
parseSpecText :: Text -> Either Text AgentdSpec

Example

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."
  }

Deliverables

  • [ ] Omni/Agentd/Spec.hs
  • [ ] Unit tests for parsing
  • [ ] Error messages for invalid specs

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago