Skip to main content
Type contracts exported by this package: interfaces, type aliases, and enums.

MigrationOptions

Options controlling migration behavior.
PropertyTypeRequiredDescription
writebooleanYesWrite .cant files to disk (false = dry-run preview).
verbosebooleanYesShow detailed conversion log during migration.
outputDirstring | undefinedNoWhere to write .cant files (default: .cleo/agents/).

MigrationResult

Result of migrating a single markdown file.
PropertyTypeRequiredDescription
inputFilestringYesAbsolute path to the input markdown file.
outputFilesConvertedFile[]YesArray of .cant files produced (or that would be produced in dry-run).
unconvertedUnconvertedSection[]YesSections that could not be automatically converted.
summarystringYesHuman-readable summary string.

ConvertedFile

A single converted .cant output file.
PropertyTypeRequiredDescription
pathstringYesRelative path for the output file (e.g. “.cleo/agents/code-reviewer.cant”).
kindstringYesDocument kind: agent, skill, hook, or workflow.
contentstringYesThe full .cant file content including frontmatter.

UnconvertedSection

A section of markdown that was not converted.
PropertyTypeRequiredDescription
lineStartnumberYes1-based line number where the section starts.
lineEndnumberYes1-based line number where the section ends.
reasonstringYesHuman-readable reason why conversion was skipped.
contentstringYesThe raw markdown content of the section.

MarkdownSection

A parsed markdown section identified by heading. Used internally by the markdown parser to structure the input before classification and conversion.
PropertyTypeRequiredDescription
headingstringYesThe heading text (without the # prefix).
levelnumberYesThe heading level (2 for ##, 3 for ###, etc.).
lineStartnumberYes1-based line number where the section starts.
lineEndnumberYes1-based line number where the section ends (inclusive).
bodyLinesstring[]YesLines of content below the heading (excluding the heading line).
classificationSectionClassificationYesClassified type of this section, determined by heuristic matching.

SectionClassification

Classification of a markdown section for conversion purposes.
SectionClassification

ExtractedProperty

A key-value property extracted from a markdown bullet list. Matches patterns like - **Key**: value or - Key: value.
PropertyTypeRequiredDescription
keystringYesProperty key (lowercased, normalized).
valuestringYesProperty value (trimmed).

ExtractedPermission

A permission entry extracted from markdown. Matches patterns like - Tasks: read, write or - Read and write tasks.
PropertyTypeRequiredDescription
domainstringYesThe domain (e.g. “tasks”, “session”, “memory”).
valuesstring[]YesPermission values (e.g. [“read”, “write”]).

CantDocumentIR

Intermediate representation of a CANT document for serialization. This is the bridge between the converter’s output and the final .cant file text. Each field maps to a CANT construct.
PropertyTypeRequiredDescription
kindstringYesDocument kind (agent, skill, hook, workflow).
versionnumberYesDocument version (default: 1).
blockCantBlockIRYesThe primary block (agent definition, hook, workflow, etc.).

CantBlockIR

A CANT block (agent, skill, hook, or workflow).
PropertyTypeRequiredDescription
typestringYesBlock type keyword (agent, skill, on, workflow, pipeline).
namestringYesBlock name/identifier (agent name, event name, workflow name).
propertiesCantPropertyIR[]YesKey-value properties.
permissionsExtractedPermission[]YesPermission entries (only for agent blocks).
childrenCantBlockIR[]YesNested sub-blocks (hooks inside agents, steps in pipelines, etc.).
bodyLinesstring[] | undefinedNoRaw body lines for hook/workflow bodies that are directive sequences.

CantPropertyIR

A single property key-value pair.
PropertyTypeRequiredDescription
keystringYesProperty key.
valuestring | number | boolean | string[]YesProperty value (string, array, number, boolean).

NativeParseResult

Shape returned by the native Rust WASM cantParse function.
PropertyTypeRequiredDescription
directivestring | undefinedNodirective
directiveTypestring | undefinedNodirectiveType
addressesstring[] | undefinedNoaddresses
taskRefsstring[] | undefinedNotaskRefs
tagsstring[] | undefinedNotags
headerRawstring | undefinedNoheaderRaw
bodystring | undefinedNobody

DirectiveType

DirectiveType

ParsedCANTMessage

PropertyTypeRequiredDescription
directivestring | undefinedNodirective
directive_typeDirectiveTypeYesdirective_type
addressesstring[]Yesaddresses
task_refsstring[]Yestask_refs
tagsstring[]Yestags
header_rawstringYesheader_raw
bodystringYesbody