fix: better frontmatter errors

This commit is contained in:
Aiden Cline
2025-10-30 10:56:30 -05:00
parent 2d5df3ad76
commit 42e0b47a7d
3 changed files with 43 additions and 10 deletions

View File

@@ -9,7 +9,6 @@ import { Global } from "../global"
import fs from "fs/promises"
import { lazy } from "../util/lazy"
import { NamedError } from "../util/error"
import matter from "gray-matter"
import { Flag } from "../flag/flag"
import { Auth } from "../auth"
import {
@@ -21,6 +20,7 @@ import { Instance } from "../project/instance"
import { LSPServer } from "../lsp/server"
import { BunProc } from "@/bun"
import { Installation } from "@/installation"
import { ConfigMarkdown } from "./markdown"
export namespace Config {
const log = Log.create({ service: "config" })
@@ -191,8 +191,7 @@ export namespace Config {
dot: true,
cwd: dir,
})) {
const content = await Bun.file(item).text()
const md = matter(content)
const md = await ConfigMarkdown.parse(item)
if (!md.data) continue
const name = (() => {
@@ -231,8 +230,7 @@ export namespace Config {
dot: true,
cwd: dir,
})) {
const content = await Bun.file(item).text()
const md = matter(content)
const md = await ConfigMarkdown.parse(item)
if (!md.data) continue
// Extract relative path from agent folder for nested agents
@@ -274,8 +272,7 @@ export namespace Config {
dot: true,
cwd: dir,
})) {
const content = await Bun.file(item).text()
const md = matter(content)
const md = await ConfigMarkdown.parse(item)
if (!md.data) continue
const config = {