UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

11 lines (10 loc) • 945 B
/** The fence text a writer emits. The reader below accepts exactly this, plus trailing blanks and a CR. */ export declare const FRONTMATTER_FENCE = "---"; /** The refusal sentence for a file that OPENS a frontmatter block and never reaches a closing fence. One wording for * every reader that refuses such a file: the block exists and cannot be read, so reading the file as one with no * frontmatter (and dropping what the block declared) is not an answer. */ export declare const UNCLOSED_FRONTMATTER_REASON = "opens with --- but is not closed by a whole-line ---"; /** True ⇔ `line` is exactly a frontmatter fence: {@link FRONTMATTER_FENCE}, then spaces / tabs only, then * at most one CR. The line must not contain `\n` (callers split on it first). The SAME predicate judges * the opening fence (line 0) and the closing fence (the first later line it accepts). */ export declare function isFrontmatterFence(line: string): boolean;