import type { Environment } from '../config/environments.js'; import { type ApiDeps } from '../http/client.js'; import type { TemplateEntry } from './project.js'; export interface SuggestTemplateOptions { environment: Environment; token: string; /** The creator's `--idea` pitch. */ idea: string; /** The creator's own request, verbatim — recorded server-side for analytics, never used to pick. */ creatorPrompt?: string; /** Every template this engine bundle carries — the model may only choose from these. */ templates: TemplateEntry[]; defaultTemplateId: string; deps: ApiDeps; } export interface TemplateSuggestion { templateId: string; /** One short clause for the creator; may be empty if the model omitted it. */ reason: string; } /** * Ask api-server which template fits the creator's idea, or null if it cannot say. * * **This function never throws.** Template selection is a convenience on top of a default that is * already a working answer, so nothing here — being offline, an expired feature flag, a model that * invents an id — is allowed to fail `bitmagic init`. Every failure path returns null and the * caller scaffolds the default template. * * The template list travels in the request because api-server has no copy of the bundle the CLI * just downloaded, and because validating the reply against the ids we SENT is what makes a * hallucinated id harmless rather than a scaffold from a directory that does not exist. */ export declare function suggestTemplate(options: SuggestTemplateOptions): Promise;