extractPromptDefinitions()
extractPromptDefinitions(
program):PromptExtraction
Defined in: core/src/prompt-definitions.ts:714
Read every @prompts entry of a program into typed definitions.
Accepts the canonical AST (CanonicalBlock with FieldEntry values) and the
legacy AST (ObjectContent with TextContent values). Problems do not stop
the read: the entry keeps what is valid and each problem becomes an issue.
An entry whose key is reserved, malformed or collides with another key
(case-insensitively) is reported and left out of prompts.
Parameters
program
A resolved program, canonical or legacy
Returns
The definitions and the issues found
Example
const { prompts, issues } = extractPromptDefinitions(program);