/**
 * AI-behavior library whitelist — single source of truth for which
 * external libraries AI-generated `behaviors/*.ai.ts` pure-function
 * bodies are allowed to dynamic-import.
 *
 * Three things keyed off this module:
 *
 *   1. The validator in `ai-behaviors-generator.ts` rejects any
 *      generated body whose `await import('LITERAL')` calls reference
 *      a literal not in `AI_BEHAVIOR_LIBRARY_WHITELIST`. Closes the
 *      gap where the validator previously failed equally on whitelisted
 *      and unwhitelisted imports (because the engines workspace lacks
 *      both), so non-whitelisted libs slipped through to AI-INVALID
 *      and only crashed at runtime in the realized backend.
 *
 *   2. `backend-package-json-generator.ts` calls
 *      `predictAiBehaviorLibraries(spec)` and only emits deps for libs
 *      whose triggers fire in the spec's step text. Avoids the dep
 *      bloat where every realized backend installed all 5 libs even
 *      when 97% of bodies needed none.
 *
 *   3. The behavior prompt YAML's "LIBRARY WHITELIST" section is the
 *      author-facing description — the trigger phrases here MUST stay
 *      in sync with the prompt. If you add or rename a trigger here,
 *      update `assets/prompts/core/standard/default/behavior.prompt.yaml`
 *      and bump `PROMPT_VERSION` in `ai-behaviors-generator.ts`.
 *
 * Triage status (2026-05-02 audit, #43K-B-review):
 *   jsonwebtoken — used in 2 of 49 cached bodies. KEEP.
 *   expr-eval    — used in 1 of 49 cached bodies. MONITORED.
 *   bcryptjs     — 0 of 49. MONITORED — drop after 2026-11 if no real spec uses it.
 *   crypto       — 0 of 49. MONITORED — drop after 2026-11 if no real spec uses it.
 *   uuid         — 0 of 49. MONITORED — drop after 2026-11 if no real spec uses it.
 */
export declare const AI_BEHAVIOR_LIBRARY_WHITELIST: readonly ["jsonwebtoken", "bcryptjs", "uuid", "crypto", "expr-eval"];
export type AiBehaviorLibrary = typeof AI_BEHAVIOR_LIBRARY_WHITELIST[number];
/** Is `name` a member of the whitelist? */
export declare function isWhitelistedLibrary(name: string): name is AiBehaviorLibrary;
/**
 * Trigger phrases per library — when any regex matches a step's text,
 * the corresponding library is predicted to be needed by the AI body
 * the realize engine will generate for that step.
 *
 * Kept in sync with `behavior.prompt.yaml`'s LIBRARY WHITELIST section.
 * If you change the prompt's triggers, update both places + bump
 * PROMPT_VERSION.
 */
export declare const AI_BEHAVIOR_LIBRARY_TRIGGERS: Record<AiBehaviorLibrary, RegExp[]>;
/**
 * Walk every step text in a SpecVerse spec and predict which whitelist
 * libraries the AI body generator will need. The set is the basis for
 * the realized backend's `package.json` deps — only libs predicted as
 * needed get added.
 *
 * Walks: spec.components[].(controllers / services).operations[].steps[]
 *        + spec.components[].models[].behaviors[].steps[]
 */
export declare function predictAiBehaviorLibraries(spec: any): Set<AiBehaviorLibrary>;
/**
 * Extract the literal module specifiers from every `await import('X')`
 * (or bare `import('X')`) call in a TS source string. Used by the AI
 * body validator to enforce whitelist compliance — any returned name
 * not in `AI_BEHAVIOR_LIBRARY_WHITELIST` rejects the body.
 *
 * Walks char-by-char tracking string + comment context — ignores any
 * `import(...)` syntax that appears inside a comment or string literal,
 * so commented-out examples and string content can't false-positive.
 *
 * Computed specifiers (`import(varName)`) and template-string
 * specifiers (`` import(`name`) ``) are intentionally NOT extracted:
 * they're rejected by the validator anyway (only allow string-literal
 * specifiers) and the safe answer when we can't statically resolve a
 * specifier is "don't try."
 */
export declare function extractDynamicImports(code: string): string[];
/**
 * Validate that every dynamic import in `code` references a whitelisted
 * library. Returns a list of violating specifiers (empty list = clean).
 */
export declare function validateImportWhitelist(code: string): string[];
//# sourceMappingURL=library-whitelist.d.ts.map