@promptbook/utils
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
20 lines (19 loc) • 818 B
TypeScript
/**
* Creates the regex used to recognize the uppercase commitment type at the beginning of a Book line.
*
* A fresh regular expression keeps Monaco tokenizer state isolated from parser calls.
*
* @returns Regular expression matching one Book commitment-like line.
*
* @private internal utility of Book parsing and `<BookEditor/>`
*/
export declare function createBookCommitmentLineTypeRegex(): RegExp;
/**
* Extracts the uppercase commitment type from a Book line, including types not registered by Promptbook.
*
* @param line - One raw Book source line.
* @returns Matched commitment type or `null` when the line does not begin with commitment syntax.
*
* @private internal utility of Book parsing and `<BookEditor/>`
*/
export declare function getBookCommitmentLineType(line: string): string | null;