/** * Swift detection — CONTENT-AWARE Package.swift / Xcode classification. * * Kill line: Package.swift alone ≠ app. * SPM backs libraries, executables (CLI), server apps (Vapor / Hummingbird), * MCP servers (official swift-sdk product MCP), and Xcode client apps. * Static token scan only — never execute Package.swift / swift build. * * Same composition as go.ts / ruby.ts: knowledge in swift-detection.json. */ export type SwiftAppType = 'mcp' | 'backend' | 'cli' | 'app' | 'library'; export interface SwiftProject { appType: SwiftAppType; /** Primary framework label (Vapor / Hummingbird / MCP / ArgumentParser / …) or ''. */ framework: string; /** spm when Package.swift; xcode when only xcodeproj; both when combined. */ packageManager: 'spm' | 'xcode' | 'spm+xcode'; /** Glass Hood rationale for .faf `# found:`. */ found: string; } export interface PackageSwiftSignals { packageUrls: string[]; productNames: string[]; hasLibraryProduct: boolean; hasExecutableProduct: boolean; hasPluginProduct: boolean; hasExecutableTarget: boolean; hasLibraryTarget: boolean; } /** True if directory looks like a Swift project root. */ export declare function isSwiftRoot(dir: string): boolean; /** Root-level *.xcodeproj directory names. */ export declare function listXcodeprojs(dir: string): string[]; /** * Static scan of Package.swift — does NOT compile or evaluate Swift. * Strips line and block comments best-effort before token extraction. */ export declare function parsePackageSwift(content: string): PackageSwiftSignals; /** Best-effort strip of line (//) and block comments for static scan. */ export declare function stripSwiftComments(src: string): string; /** * Light pbxproj grep — no AST. Reads project.pbxproj under each .xcodeproj. */ export declare function scanXcodeProductTypes(dir: string): { hasApplication: boolean; hasTool: boolean; hit?: string; }; /** * Classify a Swift project from Package.swift (+ light Xcode). * Returns null if not a Swift root. */ export declare function detectSwiftProject(dir: string): SwiftProject | null;