Skip to main content
API reference for the cant package.

Functions & Classes

SymbolKindDescription
parseMarkdownSections()functionParse markdown content into classified sections. Splits on ## and ### he…
classifySection()functionClassify a markdown section based on its heading and content. Uses heuristic…
extractProperties()functionExtract key-value properties from markdown bullet lists. Matches patterns li…
extractPermissions()functionExtract permission entries from markdown content. Handles two formats: 1. St…
headingToIdentifier()functionNormalize a heading into a valid CANT identifier. Converts “Code Review Agen…
headingToEventName()functionMap a hook heading to a CAAMP event name. Converts headings like “On Session…
getCaampEvents()functionGet the full set of CAAMP event names.
serializeCantDocument()functionSerialize a CANT document IR into .cant file text. Produces a complete .cant…
formatValue()functionFormat a property value for .cant output. - Strings are double-quoted - Arra…
propertiesToIR()functionConvert extracted properties to CANT property IR format. Maps known markdown…
migrateMarkdown()functionMigrate a markdown file to CANT format. Parses the markdown into sections, c…
showDiff()functionShow a color-coded diff of the migration result. Displays: - A summary heade…
showSummary()functionGenerate a simple text-only summary (no color). Suitable for logging or non-…
isNativeAvailable()functionCheck if the native addon is available
cantParseNative()functionParse a CANT message using the native addon
cantClassifyDirectiveNative()functionClassify a directive using the native addon
initCantParser()functionInitialize the CANT parser With napi-rs native addons, this is a no-op (nati…
parseCANTMessage()functionParse a CANT message If the native addon is available, uses the Rust cant-co…
initWasm()functionInitialize the WASM module Must be called before using any WASM functions
isWasmAvailable()functionCheck if WASM is available
cantParseWASM()functionParse a CANT message using WASM
cantClassifyDirectiveWASM()functionClassify a directive using WASM

Types & Interfaces

SymbolKindDescription
MigrationOptionsinterfaceOptions controlling migration behavior.
MigrationResultinterfaceResult of migrating a single markdown file.
ConvertedFileinterfaceA single converted .cant output file.
UnconvertedSectioninterfaceA section of markdown that was not converted.
MarkdownSectioninterfaceA parsed markdown section identified by heading. Used internally by the mark…
SectionClassificationtypeClassification of a markdown section for conversion purposes.
ExtractedPropertyinterfaceA key-value property extracted from a markdown bullet list. Matches patterns…
ExtractedPermissioninterfaceA permission entry extracted from markdown. Matches patterns like…
CantDocumentIRinterfaceIntermediate representation of a CANT document for serialization. This is th…
CantBlockIRinterfaceA CANT block (agent, skill, hook, or workflow).
CantPropertyIRinterfaceA single property key-value pair.
NativeParseResultinterfaceShape returned by the native Rust WASM cantParse function.
DirectiveTypetype
ParsedCANTMessageinterface

Other Exports