/** * Language detection for `opensip init`. * * Inspects the cwd for well-known language markers (Cargo.toml, * pyproject.toml, go.mod, pom.xml/build.gradle, CMakeLists.txt, * tsconfig.json/package.json) and returns the unique set of detected * languages in host-canonical `ALL_LANGUAGES` order. Also parses the * `--language ` flag that overrides detection. * * Polyglot projects are not ambiguous: every detected marker language is * accepted. Explicit `--language` remains the override for forced sets. */ export type SupportedLanguage = 'typescript' | 'rust' | 'python' | 'go' | 'java' | 'cpp'; export declare const ALL_LANGUAGES: readonly SupportedLanguage[]; /** * Reorder + dedupe into host-canonical starter order (`ALL_LANGUAGES`). */ export declare function canonicalizeLanguages(languages: readonly SupportedLanguage[]): SupportedLanguage[]; /** * Inspect the cwd for language markers. Returns the unique set of * detected languages in detection order (callers that need host-canonical * order should pass through {@link canonicalizeLanguages} / * {@link resolveLanguages}). TypeScript is detected only when there's a * `tsconfig.json` (or a `package.json` with no other marker present — * fallback for plain JS/TS projects). */ export declare function detectLanguages(cwd: string): SupportedLanguage[]; /** * Parse the `--language ` argv string into a list of * known languages in host-canonical order. Throws on unknown entries — * the CLI surfaces it as an exit-2 configuration error. * * @throws {Error} When `raw` contains a token not present in `ALL_LANGUAGES`. */ export declare function parseLanguageFlag(raw: string): SupportedLanguage[]; export type LanguageResolution = { ok: true; languages: SupportedLanguage[]; } | { ok: false; error: { detected: SupportedLanguage[]; message: string; }; }; /** * Resolve the language set for an init run: either parse the explicit * --language flag, or fall back to filesystem detection. Returns every * detected marker language in canonical order (polyglot is not an error). * Returns an error variant when no markers are found or when the flag is * invalid/empty/unknown. */ export declare function resolveLanguages(cwd: string, languageFlag: readonly string[] | undefined): LanguageResolution; //# sourceMappingURL=language-detection.d.ts.map