{"version":3,"file":"index.mjs","names":["parseMethods","parseProperties","extractNamespace","safeParse","DEFAULT_EXCEPTION_BASES","isExceptionClass","buildSurface","buildSurface","safeParse","buildSurface","buildSurface","safeParseWith","extractEnumModules","extractEnumModules","parseStructFields","extractPackageName","safeParse","buildSurface","buildSurface","parseEnums","parseParams","parseTypeAliases","safeParse","buildSurface","buildSurface","stripComments","extractJsonPropertyName","splitTopLevelCommas","parseClasses","parseMethods","buildSurface","buildSurface","stripComments","parseProperties","parseMethods","buildSurface","buildSurface","buildSurface","buildSurface"],"sources":["../../src/compat/concepts.ts","../../src/compat/report.ts","../../src/compat/approvals.ts","../../src/compat/extractors/shared.ts","../../src/compat/extractors/node.ts","../../src/compat/extractors/php-parser.ts","../../src/compat/extractors/php-surface.ts","../../src/compat/extractors/php.ts","../../src/compat/extractors/python-parser.ts","../../src/compat/extractors/python-surface.ts","../../src/compat/extractors/python.ts","../../src/compat/extractors/ruby-parser.ts","../../src/compat/extractors/ruby.ts","../../src/compat/extractors/go-parser.ts","../../src/compat/extractors/go-surface.ts","../../src/compat/extractors/go.ts","../../src/compat/extractors/rust-parser.ts","../../src/compat/extractors/rust-surface.ts","../../src/compat/extractors/rust.ts","../../src/compat/extractors/kotlin-parser.ts","../../src/compat/extractors/kotlin-surface.ts","../../src/compat/extractors/kotlin.ts","../../src/compat/extractors/dotnet-parser.ts","../../src/compat/extractors/dotnet-surface.ts","../../src/compat/extractors/dotnet.ts","../../src/compat/extractors/elixir-parser.ts","../../src/compat/extractors/elixir-surface.ts","../../src/compat/extractors/elixir.ts","../../src/compat/extractors/ios-parser.ts","../../src/compat/extractors/ios-surface.ts","../../src/compat/extractors/ios.ts"],"sourcesContent":["/**\n * Conceptual change grouping for cross-language compatibility analysis.\n *\n * Groups related changes across languages into a single conceptual change\n * with per-language severity. This allows reports to say \"parameter rename\n * on Authorization.check is breaking in PHP, Python, Kotlin, and .NET but\n * soft-risk in Go\" rather than treating these as unrelated per-language findings.\n */\n\nimport type { LanguageId } from './ir.js';\nimport type { CompatChangeSeverity, CompatChangeCategory } from './config.js';\nimport type { CompatDiffResult } from './differ.js';\n\n/** A conceptual change with per-language severity. */\nexport interface ConceptualChange {\n  /** Deterministic ID from symbol + category + match details. */\n  id: string;\n  /** IR-level symbol path (language-neutral). */\n  symbol: string;\n  /** The kind of change. */\n  category: CompatChangeCategory;\n  /** Per-language severity mapping. */\n  impact: Partial<Record<LanguageId, CompatChangeSeverity>>;\n  /** Human-readable description (from first language that reported it). */\n  message: string;\n  /** Old state details. */\n  old: Record<string, string>;\n  /** New state details. */\n  new: Record<string, string>;\n}\n\n/** Cross-language conceptual rollup. */\nexport interface ConceptualRollup {\n  conceptualChanges: ConceptualChange[];\n}\n\n/**\n * Group classified changes from multiple languages into conceptual changes.\n *\n * Changes are grouped by their `conceptualChangeId` — a deterministic ID\n * derived from the symbol, category, and match details. Changes with the\n * same ID across different languages represent the same conceptual change.\n */\nexport function buildConceptualRollup(\n  perLanguageResults: Array<{ diff: CompatDiffResult; language: LanguageId }>,\n): ConceptualRollup {\n  const grouped = new Map<string, ConceptualChange>();\n\n  for (const { diff: result, language } of perLanguageResults) {\n    for (const change of result.changes) {\n      const existing = grouped.get(change.conceptualChangeId);\n      if (existing) {\n        existing.impact[language] = change.severity;\n      } else {\n        grouped.set(change.conceptualChangeId, {\n          id: change.conceptualChangeId,\n          symbol: change.symbol,\n          category: change.category,\n          impact: { [language]: change.severity },\n          message: change.message,\n          old: change.old,\n          new: change.new,\n        });\n      }\n    }\n  }\n\n  return {\n    conceptualChanges: [...grouped.values()],\n  };\n}\n\n/** Get the highest severity across all languages for a conceptual change. */\nexport function highestSeverity(change: ConceptualChange): CompatChangeSeverity {\n  const severities = Object.values(change.impact);\n  if (severities.includes('breaking')) return 'breaking';\n  if (severities.includes('soft-risk')) return 'soft-risk';\n  return 'additive';\n}\n\n/** Count conceptual changes by highest severity. */\nexport function summarizeConceptualChanges(rollup: ConceptualRollup): {\n  breaking: number;\n  softRisk: number;\n  additive: number;\n} {\n  let breaking = 0;\n  let softRisk = 0;\n  let additive = 0;\n  for (const change of rollup.conceptualChanges) {\n    const sev = highestSeverity(change);\n    if (sev === 'breaking') breaking++;\n    else if (sev === 'soft-risk') softRisk++;\n    else additive++;\n  }\n  return { breaking, softRisk, additive };\n}\n","/**\n * Report generation for compatibility verification.\n *\n * Produces machine-readable JSON reports, human-readable terminal summaries,\n * and conceptual cross-language summaries.\n */\n\nimport type { LanguageId } from './ir.js';\nimport type { CompatChangeSeverity, CompatChangeCategory, CompatProvenance } from './config.js';\nimport type { CompatDiffResult } from './differ.js';\nimport { buildConceptualRollup, highestSeverity, summarizeConceptualChanges } from './concepts.js';\n\n// ---------------------------------------------------------------------------\n// Machine-readable report\n// ---------------------------------------------------------------------------\n\n/** Machine-readable compat report for a single language. */\nexport interface CompatReport {\n  schemaVersion: string;\n  language: string;\n  summary: {\n    breaking: number;\n    softRisk: number;\n    additive: number;\n  };\n  changes: CompatReportChange[];\n}\n\n/** A single change entry in the machine-readable report. */\nexport interface CompatReportChange {\n  severity: CompatChangeSeverity;\n  category: CompatChangeCategory;\n  symbol: string;\n  conceptualChangeId: string;\n  provenance: CompatProvenance;\n  old: Record<string, string>;\n  new: Record<string, string>;\n  message?: string;\n  /** Spec-level remediation hint when a recognized upstream pattern was detected. */\n  remediation?: string;\n}\n\n/** Generate a machine-readable compat report from a diff result. */\nexport function generateReport(diff: CompatDiffResult, language?: string): CompatReport {\n  return {\n    schemaVersion: '1',\n    language: language ?? 'unknown',\n    summary: diff.summary,\n    changes: diff.changes.map((c) => ({\n      severity: c.severity,\n      category: c.category,\n      symbol: c.symbol,\n      conceptualChangeId: c.conceptualChangeId,\n      provenance: c.provenance,\n      old: c.old,\n      new: c.new,\n      ...(c.message ? { message: c.message } : {}),\n      ...(c.remediation ? { remediation: c.remediation } : {}),\n    })),\n  };\n}\n\n// ---------------------------------------------------------------------------\n// Human-readable terminal summary\n// ---------------------------------------------------------------------------\n\n/** Generate a human-readable summary string for terminal output. */\nexport function formatHumanSummary(diff: CompatDiffResult, opts?: { explain?: boolean; language?: string }): string {\n  const lines: string[] = [];\n\n  lines.push(`Compat report${opts?.language ? ` for ${opts.language}` : ''}:`);\n  lines.push(\n    `  ${diff.summary.breaking} breaking, ${diff.summary.softRisk} soft-risk, ${diff.summary.additive} additive`,\n  );\n\n  if (diff.changes.length === 0) {\n    lines.push('  No compatibility changes detected.');\n    return lines.join('\\n');\n  }\n\n  // Group by severity for display\n  const breaking = diff.changes.filter((c) => c.severity === 'breaking');\n  const softRisk = diff.changes.filter((c) => c.severity === 'soft-risk');\n  const additive = diff.changes.filter((c) => c.severity === 'additive');\n\n  if (breaking.length > 0) {\n    lines.push('');\n    lines.push('  Breaking:');\n    for (const c of breaking) {\n      lines.push(`    [${c.category}] ${c.symbol} — ${c.message}`);\n      if (c.remediation) {\n        lines.push(`      hint: ${c.remediation}`);\n      }\n      if (opts?.explain && c.provenance !== 'unknown') {\n        lines.push(`      provenance: ${c.provenance}`);\n      }\n    }\n  }\n\n  if (softRisk.length > 0) {\n    lines.push('');\n    lines.push('  Soft-risk:');\n    for (const c of softRisk) {\n      lines.push(`    [${c.category}] ${c.symbol} — ${c.message}`);\n      if (c.remediation) {\n        lines.push(`      hint: ${c.remediation}`);\n      }\n      if (opts?.explain && c.provenance !== 'unknown') {\n        lines.push(`      provenance: ${c.provenance}`);\n      }\n    }\n  }\n\n  if (additive.length > 0) {\n    lines.push('');\n    lines.push(`  Additive: ${additive.length} new symbol(s)`);\n  }\n\n  return lines.join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Conceptual cross-language summary\n// ---------------------------------------------------------------------------\n\n/** Conceptual cross-language report. */\nexport interface ConceptualReport {\n  conceptualChanges: {\n    id: string;\n    symbol: string;\n    category: CompatChangeCategory;\n    impact: Partial<Record<LanguageId, CompatChangeSeverity>>;\n  }[];\n}\n\n/** Generate a conceptual cross-language report from multiple per-language results. */\nexport function generateConceptualReport(\n  perLanguageResults: Array<{ diff: CompatDiffResult; language: LanguageId }>,\n): ConceptualReport {\n  const rollup = buildConceptualRollup(perLanguageResults);\n  return {\n    conceptualChanges: rollup.conceptualChanges.map((c) => ({\n      id: c.id,\n      symbol: c.symbol,\n      category: c.category,\n      impact: c.impact,\n    })),\n  };\n}\n\n/** Format a conceptual cross-language summary for terminal output. */\nexport function formatConceptualSummary(\n  perLanguageResults: Array<{ diff: CompatDiffResult; language: LanguageId }>,\n): string {\n  const rollup = buildConceptualRollup(perLanguageResults);\n  const summary = summarizeConceptualChanges(rollup);\n  const lines: string[] = [];\n\n  lines.push('Cross-language conceptual summary:');\n  lines.push(`  ${summary.breaking} breaking, ${summary.softRisk} soft-risk, ${summary.additive} additive`);\n\n  if (rollup.conceptualChanges.length === 0) {\n    lines.push('  No cross-language changes.');\n    return lines.join('\\n');\n  }\n\n  for (const change of rollup.conceptualChanges) {\n    const sev = highestSeverity(change);\n    const impactStr = Object.entries(change.impact)\n      .map(([lang, s]) => `${lang}: ${s}`)\n      .join(', ');\n    lines.push(`  [${sev}] ${change.category}: ${change.symbol}`);\n    lines.push(`    impact: ${impactStr}`);\n  }\n\n  return lines.join('\\n');\n}\n","/**\n * Approval matching engine for compatibility verification.\n *\n * Matches CompatApproval entries from oagen.config.ts against classified\n * changes. Approved changes are excluded from failure thresholds.\n *\n * Approvals must be narrow (one symbol, one category, one conceptual change).\n * Overly broad approvals are rejected at validation time.\n */\n\nimport type { LanguageId } from './ir.js';\nimport type { CompatApproval } from './config.js';\nimport type { ClassifiedChange } from './classify.js';\n\n/** Result of matching a change against approvals. */\nexport interface ApprovalMatch {\n  /** The change that was matched. */\n  change: ClassifiedChange;\n  /** The approval that matched. null if no approval covers this change. */\n  approval: CompatApproval | null;\n  /** Whether the change is covered by an approval. */\n  approved: boolean;\n}\n\n/** Result of validating an approval for broadness. */\nexport interface ApprovalValidation {\n  valid: boolean;\n  errors: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\n/** Validate that an approval is narrow enough to be accepted. */\nexport function validateApproval(approval: CompatApproval): ApprovalValidation {\n  const errors: string[] = [];\n\n  if (!approval.symbol || approval.symbol.trim() === '') {\n    errors.push('Approval must target a specific symbol');\n  }\n\n  if (!approval.category) {\n    errors.push('Approval must specify a change category');\n  }\n\n  if (!approval.reason || approval.reason.trim() === '') {\n    errors.push('Approval must include a reason');\n  }\n\n  // Wildcard symbols are too broad\n  if (approval.symbol === '*' || approval.symbol.endsWith('.*') || approval.symbol.endsWith('::*')) {\n    errors.push(`Approval symbol \"${approval.symbol}\" is too broad — must target a specific symbol`);\n  }\n\n  return {\n    valid: errors.length === 0,\n    errors,\n  };\n}\n\n/** Validate all approvals in a config. Returns errors keyed by index. */\nexport function validateApprovals(approvals: CompatApproval[]): Map<number, string[]> {\n  const result = new Map<number, string[]>();\n  for (let i = 0; i < approvals.length; i++) {\n    const validation = validateApproval(approvals[i]);\n    if (!validation.valid) {\n      result.set(i, validation.errors);\n    }\n  }\n  return result;\n}\n\n// ---------------------------------------------------------------------------\n// Matching\n// ---------------------------------------------------------------------------\n\n/**\n * Match a classified change against a list of approvals.\n * Returns the first matching approval, or null if none match.\n */\nexport function matchApproval(\n  change: ClassifiedChange,\n  approvals: CompatApproval[],\n  language: LanguageId,\n): CompatApproval | null {\n  for (const approval of approvals) {\n    if (approvalMatchesChange(approval, change, language)) {\n      return approval;\n    }\n  }\n  return null;\n}\n\n/**\n * Apply approvals to a list of changes.\n * Returns matches for every change (approved or not).\n */\nexport function applyApprovals(\n  changes: ClassifiedChange[],\n  approvals: CompatApproval[],\n  language: LanguageId,\n): ApprovalMatch[] {\n  return changes.map((change) => {\n    const approval = matchApproval(change, approvals, language);\n    return {\n      change,\n      approval,\n      approved: approval !== null,\n    };\n  });\n}\n\n/**\n * Filter changes to only those NOT covered by approvals.\n * These are the remaining unapproved changes that may cause failure.\n */\nexport function unapprovedChanges(\n  changes: ClassifiedChange[],\n  approvals: CompatApproval[],\n  language: LanguageId,\n): ClassifiedChange[] {\n  return changes.filter((change) => !matchApproval(change, approvals, language));\n}\n\n// ---------------------------------------------------------------------------\n// Internal matching logic\n// ---------------------------------------------------------------------------\n\nfunction approvalMatchesChange(approval: CompatApproval, change: ClassifiedChange, language: LanguageId): boolean {\n  // Skip inactive approvals\n  if (approval.approved === false) return false;\n\n  // Category must match exactly\n  if (approval.category !== change.category) return false;\n\n  // Symbol must match\n  if (!symbolMatches(approval.symbol, change.symbol)) return false;\n\n  // Language scoping\n  if (!languageMatches(approval.appliesTo, language)) return false;\n\n  // Narrowing match (optional)\n  if (approval.match && !narrowingMatches(approval.match, change)) return false;\n\n  return true;\n}\n\nfunction symbolMatches(approvalSymbol: string, changeSymbol: string): boolean {\n  // Exact match\n  if (approvalSymbol === changeSymbol) return true;\n\n  // Normalize common separators for cross-language matching\n  // PHP uses :: and \\, others use . — normalize to dots for comparison\n  const normalizedApproval = approvalSymbol.replace(/::/g, '.').replace(/\\\\/g, '.');\n  const normalizedChange = changeSymbol.replace(/::/g, '.').replace(/\\\\/g, '.');\n  return normalizedApproval === normalizedChange;\n}\n\nfunction languageMatches(appliesTo: CompatApproval['appliesTo'], language: LanguageId): boolean {\n  if (!appliesTo || appliesTo === 'all-impacted-languages') return true;\n  return appliesTo.includes(language);\n}\n\nfunction narrowingMatches(match: NonNullable<CompatApproval['match']>, change: ClassifiedChange): boolean {\n  if (match.parameter) {\n    // Check if the change involves this parameter\n    const paramInOld = change.old.parameter === match.parameter;\n    const paramInNew = change.new.parameter === match.parameter;\n    if (!paramInOld && !paramInNew) return false;\n  }\n  if (match.member) {\n    const memberInOld = change.old.member === match.member;\n    const memberInNew = change.new.member === match.member;\n    if (!memberInOld && !memberInNew) return false;\n  }\n  if (match.oldName) {\n    const nameMatch = Object.values(change.old).some((v) => v === match.oldName);\n    if (!nameMatch) return false;\n  }\n  if (match.newName) {\n    const nameMatch = Object.values(change.new).some((v) => v === match.newName);\n    if (!nameMatch) return false;\n  }\n  return true;\n}\n","/** Sort an object's keys alphabetically. Shared across all extractors for deterministic output. */\nexport function sortRecord<T>(record: Record<string, T>): Record<string, T> {\n  const sorted: Record<string, T> = {};\n  for (const key of Object.keys(record).sort()) {\n    sorted[key] = record[key];\n  }\n  return sorted;\n}\n\n/** Collects per-file export names, deduplicating and sorting on finalization. */\nexport class ExportCollector {\n  private map = new Map<string, Set<string>>();\n\n  add(sourceFile: string, name: string): void {\n    let set = this.map.get(sourceFile);\n    if (!set) {\n      set = new Set();\n      this.map.set(sourceFile, set);\n    }\n    set.add(name);\n  }\n\n  toRecord(): Record<string, string[]> {\n    const result: Record<string, string[]> = {};\n    for (const [file, names] of this.map) {\n      result[file] = [...names].sort();\n    }\n    return result;\n  }\n}\n","import ts from 'typescript';\nimport { readFileSync } from 'node:fs';\nimport path, { resolve, relative } from 'node:path';\nimport { ExtractorError } from '../../errors.js';\nimport type {\n  ApiSurface,\n  Extractor,\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n} from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { nodeHints } from '../language-hints.js';\nimport { sortRecord } from './shared.js';\n\nexport const nodeExtractor: Extractor = {\n  language: 'node',\n  hints: nodeHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    sdkPath = resolve(sdkPath);\n    const configPath = ts.findConfigFile(sdkPath, ts.sys.fileExists, 'tsconfig.json');\n    if (!configPath)\n      throw new ExtractorError(\n        `No tsconfig.json found in ${sdkPath}`,\n        `Create a tsconfig.json in \"${sdkPath}\" or verify the --sdk-path argument points to a TypeScript project root.`,\n      );\n\n    const configFile = ts.readConfigFile(configPath, ts.sys.readFile);\n    const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, sdkPath);\n    const program = ts.createProgram(parsedConfig.fileNames, parsedConfig.options);\n    const checker = program.getTypeChecker();\n\n    const entryPoint = resolveEntryPoint(sdkPath, program);\n    const entrySourceFile = program.getSourceFile(entryPoint);\n    if (!entrySourceFile)\n      throw new ExtractorError(\n        `Entry point not found: ${entryPoint}`,\n        `Ensure the file \"${entryPoint}\" exists and is included in the tsconfig.json \"include\" or \"files\" array.`,\n      );\n\n    const moduleSymbol = checker.getSymbolAtLocation(entrySourceFile);\n    if (!moduleSymbol)\n      throw new ExtractorError(\n        'No exports found at entry point',\n        `Verify that \"${entryPoint}\" has at least one \\`export\\` statement. The extractor needs public exports to build an API surface.`,\n      );\n\n    const exportedSymbols = checker.getExportsOfModule(moduleSymbol);\n\n    const classes: Record<string, ApiClass> = {};\n    const interfaces: Record<string, ApiInterface> = {};\n    const typeAliases: Record<string, ApiTypeAlias> = {};\n    const enums: Record<string, ApiEnum> = {};\n\n    for (const sym of exportedSymbols) {\n      const resolved = resolveAlias(sym, checker);\n      const declarations = resolved.getDeclarations();\n      if (!declarations || declarations.length === 0) continue;\n      const decl = declarations[0];\n\n      const sourceFile = relative(sdkPath, decl.getSourceFile().fileName);\n\n      if (ts.isClassDeclaration(decl)) {\n        classes[resolved.name] = { ...extractClass(resolved, checker), sourceFile };\n      } else if (ts.isInterfaceDeclaration(decl)) {\n        interfaces[resolved.name] = { ...extractInterface(resolved, checker), sourceFile };\n      } else if (ts.isTypeAliasDeclaration(decl)) {\n        typeAliases[resolved.name] = { ...extractTypeAlias(resolved, checker), sourceFile };\n      } else if (ts.isEnumDeclaration(decl)) {\n        enums[resolved.name] = { ...extractEnum(resolved, checker), sourceFile };\n      }\n    }\n\n    // Follow property types on extracted classes to discover resource classes\n    // (e.g., Client.widgets: Widgets → extract Widgets)\n    followPropertyTypeClasses(exportedSymbols, checker, classes, sdkPath);\n\n    const exports = buildExportMap(entrySourceFile, checker, sdkPath, program);\n\n    return {\n      language: 'node',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes: sortRecord(classes),\n      interfaces: sortRecord(interfaces),\n      typeAliases: sortRecord(typeAliases),\n      enums: sortRecord(enums),\n      exports: sortRecord(exports),\n    };\n  },\n};\n\nfunction followPropertyTypeClasses(\n  exportedSymbols: ts.Symbol[],\n  checker: ts.TypeChecker,\n  classes: Record<string, ApiClass>,\n  sdkPath: string,\n): void {\n  // Build initial set of class symbols from exports\n  const classSymbols = new Map<string, ts.Symbol>();\n  for (const sym of exportedSymbols) {\n    const resolved = resolveAlias(sym, checker);\n    const decls = resolved.getDeclarations();\n    if (decls?.some((d) => ts.isClassDeclaration(d))) {\n      classSymbols.set(resolved.name, resolved);\n    }\n  }\n\n  const toVisit = [...classSymbols.values()];\n  const visited = new Set(classSymbols.keys());\n\n  while (toVisit.length > 0) {\n    const sym = toVisit.pop()!;\n    const type = checker.getDeclaredTypeOfSymbol(sym);\n    const decls = sym.getDeclarations();\n    if (!decls || decls.length === 0) continue;\n\n    for (const prop of type.getProperties()) {\n      const propDecls = prop.getDeclarations();\n      if (!propDecls || propDecls.length === 0) continue;\n      const propDecl = propDecls[0];\n\n      // Skip private/protected\n      const modifiers = ts.canHaveModifiers(propDecl) ? ts.getModifiers(propDecl) : undefined;\n      if (\n        modifiers?.some((m) => m.kind === ts.SyntaxKind.PrivateKeyword || m.kind === ts.SyntaxKind.ProtectedKeyword)\n      ) {\n        continue;\n      }\n\n      const propType = checker.getTypeOfSymbolAtLocation(prop, propDecl);\n      const propSymbol = propType.getSymbol();\n      if (!propSymbol) continue;\n\n      const propName = propSymbol.name;\n      if (visited.has(propName)) continue;\n\n      const propSymDecls = propSymbol.getDeclarations();\n      if (!propSymDecls?.some((d) => ts.isClassDeclaration(d))) continue;\n\n      // Found a class referenced by property type — extract it\n      visited.add(propName);\n      const sourceFile = relative(sdkPath, propSymDecls[0].getSourceFile().fileName);\n      classes[propName] = { ...extractClass(propSymbol, checker), sourceFile };\n      toVisit.push(propSymbol);\n    }\n  }\n}\n\nfunction resolveEntryPoint(sdkPath: string, program: ts.Program): string {\n  const pkgPath = resolve(sdkPath, 'package.json');\n  try {\n    const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n    // Check \"exports\" field first\n    if (pkg.exports) {\n      const mainExport =\n        typeof pkg.exports === 'string'\n          ? pkg.exports\n          : (pkg.exports['.']?.import ?? pkg.exports['.']?.default ?? pkg.exports['.']);\n      if (typeof mainExport === 'string') {\n        const resolved = resolveSourceFile(sdkPath, mainExport, program);\n        if (resolved) return resolved;\n      }\n    }\n    // Fallback to \"main\"\n    if (pkg.main) {\n      const resolved = resolveSourceFile(sdkPath, pkg.main, program);\n      if (resolved) return resolved;\n    }\n  } catch {\n    // No package.json or invalid — fall through to default\n  }\n\n  // Default fallback\n  const fallback = resolve(sdkPath, 'src/index.ts');\n  if (program.getSourceFile(fallback)) return fallback;\n  throw new ExtractorError(\n    `No entry point found. Tried: package.json exports/main, src/index.ts`,\n    `Add an \"exports\" or \"main\" field to package.json in \"${sdkPath}\", or create a src/index.ts file that re-exports the public API.`,\n  );\n}\n\nfunction resolveSourceFile(sdkPath: string, entryPath: string, program: ts.Program): string | undefined {\n  // Try the path as-is, then swap .js → .ts, then try index.ts\n  const candidates = [\n    resolve(sdkPath, entryPath),\n    resolve(sdkPath, entryPath.replace(/\\.js$/, '.ts')),\n    resolve(sdkPath, entryPath.replace(/\\.js$/, '/index.ts')),\n  ];\n  for (const candidate of candidates) {\n    if (program.getSourceFile(candidate)) return candidate;\n  }\n  return undefined;\n}\n\nfunction resolveAlias(sym: ts.Symbol, checker: ts.TypeChecker): ts.Symbol {\n  if (sym.flags & ts.SymbolFlags.Alias) {\n    return checker.getAliasedSymbol(sym);\n  }\n  return sym;\n}\n\nfunction extractClass(sym: ts.Symbol, checker: ts.TypeChecker): ApiClass {\n  const type = checker.getDeclaredTypeOfSymbol(sym);\n  const methods: Record<string, ApiMethod[]> = {};\n  const properties: Record<string, ApiProperty> = {};\n  const constructorParams: ApiParam[] = [];\n  let deprecationMessage: string | undefined;\n\n  // Extract constructor params\n  const declarations = sym.getDeclarations();\n  if (declarations) {\n    for (const decl of declarations) {\n      if (ts.isClassDeclaration(decl)) {\n        // Look for `@deprecated` in the class's JSDoc.  JSDoc nodes are\n        // attached to the declaration's parent range; TS exposes them via\n        // ts.getJSDocDeprecatedTag.\n        const deprecatedTag = ts.getJSDocDeprecatedTag(decl);\n        if (deprecatedTag) {\n          const comment = deprecatedTag.comment;\n          if (typeof comment === 'string') {\n            deprecationMessage = comment.trim() || '';\n          } else if (Array.isArray(comment)) {\n            deprecationMessage =\n              comment\n                .map((c) => c.text)\n                .join('')\n                .trim() || '';\n          } else {\n            deprecationMessage = '';\n          }\n        }\n        for (const member of decl.members) {\n          if (ts.isConstructorDeclaration(member)) {\n            for (const param of member.parameters) {\n              const { name: paramName, isDestructured } = extractParameterInfo(param, param.name.getText());\n              const paramType = param.type ? checker.typeToString(checker.getTypeFromTypeNode(param.type)) : 'any';\n              constructorParams.push({\n                name: paramName,\n                type: paramType,\n                optional: !!param.questionToken || !!param.initializer,\n                passingStyle: isDestructured ? 'options_object' : 'positional',\n              });\n            }\n          }\n        }\n      }\n    }\n  }\n\n  // Extract methods and properties from the type\n  for (const prop of type.getProperties()) {\n    // Skip private/protected members\n    const propDeclarations = prop.getDeclarations();\n    if (propDeclarations && propDeclarations.length > 0) {\n      const decl = propDeclarations[0];\n      const modifiers = ts.canHaveModifiers(decl) ? ts.getModifiers(decl) : undefined;\n      if (\n        modifiers?.some((m) => m.kind === ts.SyntaxKind.PrivateKeyword || m.kind === ts.SyntaxKind.ProtectedKeyword)\n      ) {\n        continue;\n      }\n    }\n\n    const propType = checker.getTypeOfSymbolAtLocation(prop, declarations![0]);\n    const callSignatures = propType.getCallSignatures();\n\n    if (callSignatures.length > 0) {\n      if (!methods[prop.name]) methods[prop.name] = [];\n      // Extract ALL overloads, not just the first\n      for (const sig of callSignatures) {\n        methods[prop.name].push({\n          name: prop.name,\n          params: sig.getParameters().map((p) => extractParam(p, checker)),\n          returnType: checker.typeToString(sig.getReturnType()),\n          async: checker.typeToString(sig.getReturnType()).startsWith('Promise<'),\n        });\n      }\n    } else {\n      const typeStr = checker.typeToString(propType);\n      const isReadonly = propDeclarations?.some((d) => {\n        const mods = ts.canHaveModifiers(d) ? ts.getModifiers(d) : undefined;\n        return mods?.some((m) => m.kind === ts.SyntaxKind.ReadonlyKeyword);\n      });\n      properties[prop.name] = {\n        name: prop.name,\n        type: typeStr,\n        readonly: !!isReadonly,\n      };\n    }\n  }\n\n  return {\n    name: sym.name,\n    methods: sortRecord(methods),\n    properties: sortRecord(properties),\n    constructorParams,\n    ...(deprecationMessage !== undefined && { deprecationMessage }),\n  };\n}\n\nfunction extractParam(sym: ts.Symbol, checker: ts.TypeChecker): ApiParam {\n  const decl = sym.getDeclarations()?.[0];\n  const isOptional = decl && ts.isParameter(decl) ? !!decl.questionToken || !!decl.initializer : false;\n  const type = checker.getTypeOfSymbolAtLocation(sym, decl!);\n  const { name, isDestructured } = extractParameterInfo(decl, sym.name);\n  const typeStr = checker.typeToString(type);\n\n  // Detect options object pattern:\n  // - destructured object binding ({a, b}: Options)\n  // - single non-primitive param with an object/interface type\n  let passingStyle: ApiParam['passingStyle'];\n  if (isDestructured) {\n    passingStyle = 'options_object';\n  } else {\n    const resolvedType = checker.getTypeOfSymbolAtLocation(sym, decl!);\n    // An optional param (`options?: Options`) has type `Options | undefined`,\n    // a union — which is neither a class/interface nor a TypeFlags.Object — so\n    // strip the nullable arm before the object-like check. Without this an\n    // all-optional options param reads as 'positional', which makes the next\n    // regeneration drop its baseline and rename the options type.\n    const objectType = checker.getNonNullableType(resolvedType);\n    const isObjectLike = objectType.isClassOrInterface() || (objectType.getFlags() & ts.TypeFlags.Object) !== 0;\n    const isPrimitive = [\n      'string',\n      'number',\n      'boolean',\n      'undefined',\n      'null',\n      'void',\n      'never',\n      'any',\n      'unknown',\n    ].includes(typeStr);\n    if (isObjectLike && !isPrimitive && !typeStr.startsWith('Promise<')) {\n      passingStyle = 'options_object';\n    } else {\n      passingStyle = 'positional';\n    }\n  }\n\n  return {\n    name,\n    type: typeStr,\n    optional: isOptional,\n    passingStyle,\n  };\n}\n\nfunction extractParameterInfo(\n  decl: ts.Declaration | undefined,\n  fallback: string,\n): { name: string; isDestructured: boolean } {\n  if (!decl || !ts.isParameter(decl)) return { name: fallback, isDestructured: false };\n  if (ts.isIdentifier(decl.name)) return { name: decl.name.text, isDestructured: false };\n\n  const parentWithParameters = decl.parent as ts.Node & { parameters?: ts.NodeArray<ts.ParameterDeclaration> };\n  const index = parentWithParameters.parameters?.indexOf(decl) ?? -1;\n  const suffix = index > 0 ? String(index) : '';\n\n  if (ts.isObjectBindingPattern(decl.name)) return { name: `options${suffix}`, isDestructured: true };\n  if (ts.isArrayBindingPattern(decl.name)) return { name: `args${suffix}`, isDestructured: false };\n\n  return { name: fallback, isDestructured: false };\n}\n\nfunction extractInterface(sym: ts.Symbol, checker: ts.TypeChecker): ApiInterface {\n  const type = checker.getDeclaredTypeOfSymbol(sym);\n  const fields: Record<string, ApiField> = {};\n  const extendsNames: string[] = [];\n\n  // Get extends clauses\n  const declarations = sym.getDeclarations();\n  if (declarations) {\n    for (const decl of declarations) {\n      if (ts.isInterfaceDeclaration(decl) && decl.heritageClauses) {\n        for (const clause of decl.heritageClauses) {\n          for (const typeExpr of clause.types) {\n            extendsNames.push(typeExpr.getText());\n          }\n        }\n      }\n    }\n  }\n\n  for (const prop of type.getProperties()) {\n    const propType = checker.getTypeOfSymbolAtLocation(prop, declarations![0]);\n    const propDecl = prop.getDeclarations()?.[0];\n    const isOptional = propDecl && ts.isPropertySignature(propDecl) ? !!propDecl.questionToken : false;\n    let typeStr = checker.typeToString(propType);\n    if (isOptional) {\n      typeStr = stripUndefined(typeStr);\n    }\n    fields[prop.name] = {\n      name: prop.name,\n      type: typeStr,\n      optional: isOptional,\n    };\n  }\n\n  // Fallback: walk AST declaration members for fields that type.getProperties() missed.\n  // This handles generic interfaces (e.g., List<T>) where the checker may not resolve\n  // all properties when the type parameter is unbound.\n  if (declarations) {\n    for (const decl of declarations) {\n      if (ts.isInterfaceDeclaration(decl)) {\n        for (const member of decl.members) {\n          if (ts.isPropertySignature(member) && member.name) {\n            const memberName = member.name.getText();\n            if (!fields[memberName]) {\n              const memberType = member.type ? checker.typeToString(checker.getTypeFromTypeNode(member.type)) : 'any';\n              const isOpt = !!member.questionToken;\n              fields[memberName] = {\n                name: memberName,\n                type: isOpt ? stripUndefined(memberType) : memberType,\n                optional: isOpt,\n              };\n            }\n          }\n        }\n      }\n    }\n  }\n\n  return {\n    name: sym.name,\n    fields: sortRecord(fields),\n    extends: extendsNames.sort(),\n  };\n}\n\nfunction extractTypeAlias(sym: ts.Symbol, checker: ts.TypeChecker): ApiTypeAlias {\n  const type = checker.getDeclaredTypeOfSymbol(sym);\n  return {\n    name: sym.name,\n    value: checker.typeToString(type, undefined, ts.TypeFormatFlags.InTypeAlias | ts.TypeFormatFlags.NoTruncation),\n  };\n}\n\nfunction extractEnum(sym: ts.Symbol, checker: ts.TypeChecker): ApiEnum {\n  const members: Record<string, string | number> = {};\n  const type = checker.getDeclaredTypeOfSymbol(sym);\n\n  if (type.isUnion()) {\n    for (const memberType of type.types) {\n      if (memberType.symbol) {\n        const constValue = checker.getConstantValue(memberType.symbol.getDeclarations()![0] as ts.EnumMember);\n        if (constValue !== undefined) {\n          members[memberType.symbol.name] = constValue;\n        }\n      }\n    }\n  }\n\n  return {\n    name: sym.name,\n    members: sortRecord(members),\n  };\n}\n\nfunction buildExportMap(\n  entryFile: ts.SourceFile,\n  checker: ts.TypeChecker,\n  sdkPath: string,\n  program: ts.Program,\n): Record<string, string[]> {\n  const exports: Record<string, string[]> = {};\n  const visited = new Set<string>();\n\n  function walk(sourceFile: ts.SourceFile): void {\n    const absPath = sourceFile.fileName;\n    if (visited.has(absPath)) return;\n    visited.add(absPath);\n\n    const relPath = relative(sdkPath, absPath);\n    const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n    if (moduleSymbol) {\n      const names = checker.getExportsOfModule(moduleSymbol).map((s) => s.name);\n      if (names.length > 0) {\n        exports[relPath] = names.sort();\n      }\n    }\n\n    for (const stmt of sourceFile.statements) {\n      if (ts.isExportDeclaration(stmt) && stmt.moduleSpecifier && ts.isStringLiteral(stmt.moduleSpecifier)) {\n        const target = stmt.moduleSpecifier.text;\n        const resolved = resolveSourceFile(path.dirname(absPath), target, program);\n        if (resolved) {\n          const targetFile = program.getSourceFile(resolved);\n          if (targetFile) {\n            walk(targetFile);\n          }\n        }\n      }\n    }\n  }\n\n  walk(entryFile);\n  return exports;\n}\n\nfunction stripUndefined(typeStr: string): string {\n  return typeStr.replace(/\\s*\\|\\s*undefined$/, '').replace(/^undefined\\s*\\|\\s*/, '');\n}\n","/**\n * PHP source parser — tree-sitter-based extraction of classes, interfaces,\n * methods, properties, and constants from PHP source files.\n */\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport Parser from 'tree-sitter';\nimport PhpGrammar from 'tree-sitter-php';\nimport type { SyntaxNode } from 'tree-sitter';\nimport { safeParse } from '../../utils/tree-sitter.js';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface PhpParam {\n  name: string;\n  type: string;\n  optional: boolean;\n}\n\nexport interface PhpMethod {\n  name: string;\n  visibility: 'public' | 'protected' | 'private';\n  isStatic: boolean;\n  params: PhpParam[];\n  returnType: string;\n}\n\nexport interface PhpConstant {\n  name: string;\n  value: string;\n}\n\nexport interface PhpProperty {\n  name: string;\n  type: string;\n  visibility: 'public' | 'protected' | 'private';\n}\n\nexport interface PhpClass {\n  name: string;\n  namespace: string;\n  extends: string | null;\n  isInterface: boolean;\n  methods: PhpMethod[];\n  properties: PhpProperty[];\n  constants: PhpConstant[];\n  resourceAttributes: string[];\n  /** True if the class defines its own constructFromResponse method (not inherited). */\n  hasCustomConstructor: boolean;\n  sourceFile: string;\n}\n\n// ---------------------------------------------------------------------------\n// Shared parser instance\n// ---------------------------------------------------------------------------\n\nconst phpParser = new Parser();\nphpParser.setLanguage(PhpGrammar.php_only);\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkPhpFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === 'vendor' || entry === 'tests' || entry === 'test') continue;\n      results.push(...walkPhpFiles(fullPath));\n    } else if (entry.endsWith('.php')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\ninterface PhpDocInfo {\n  params: Map<string, string>; // $name → type\n  returnType: string;\n}\n\nfunction parsePhpDoc(commentText: string): PhpDocInfo {\n  const params = new Map<string, string>();\n  let returnType = '';\n\n  const lines = commentText.split('\\n');\n  for (const line of lines) {\n    // Match @param type $name\n    const paramMatch = line.match(/@param\\s+(\\S+)\\s+\\$(\\w+)/);\n    if (paramMatch) {\n      params.set(paramMatch[2], paramMatch[1]);\n    }\n    // Match @return type\n    const returnMatch = line.match(/@return\\s+(\\S+)/);\n    if (returnMatch) {\n      returnType = returnMatch[1];\n    }\n  }\n\n  return { params, returnType };\n}\n\n/** Find the doc comment immediately preceding a node. */\nfunction findDocComment(node: SyntaxNode): PhpDocInfo | null {\n  // Walk backward through siblings to find comment\n  let sibling = node.previousNamedSibling;\n  if (sibling && sibling.type === 'comment' && sibling.text.startsWith('/**')) {\n    return parsePhpDoc(sibling.text);\n  }\n  return null;\n}\n\nfunction getVisibility(node: SyntaxNode): 'public' | 'protected' | 'private' {\n  for (const child of node.children) {\n    if (child.type === 'visibility_modifier') {\n      const text = child.text.toLowerCase();\n      if (text === 'public') return 'public';\n      if (text === 'protected') return 'protected';\n      if (text === 'private') return 'private';\n    }\n  }\n  return 'public'; // PHP default\n}\n\nfunction isStaticMethod(node: SyntaxNode): boolean {\n  for (const child of node.children) {\n    if (child.type === 'static_modifier') return true;\n  }\n  return false;\n}\n\n/** Parse a PHP array literal to extract string values: [\"id\", \"name\", ...] */\nfunction parseArrayLiteral(node: SyntaxNode): string[] {\n  const values: string[] = [];\n  // In tree-sitter-php, array elements contain encapsed_string → string_content\n  // For simple indexed arrays, each array_element_initializer has one encapsed_string\n  for (const elemInit of node.descendantsOfType('array_element_initializer')) {\n    const strings = elemInit.namedChildren.filter((c) => c.type === 'encapsed_string' || c.type === 'string');\n    // For indexed arrays (no =>), there's one string per element\n    if (strings.length === 1) {\n      const contentNode = strings[0].namedChildren.find((c) => c.type === 'string_content');\n      if (contentNode) {\n        values.push(contentNode.text);\n      }\n    }\n  }\n  return values;\n}\n\n/** Extract the name and value from a const_element node. */\nfunction parseConstElement(constElement: SyntaxNode): { name: string; value: string } | null {\n  const nameNode = constElement.namedChildren.find((c) => c.type === 'name');\n  if (!nameNode) return null;\n\n  const constName = nameNode.text;\n\n  // Skip RESOURCE_ATTRIBUTES and RESPONSE_TO_RESOURCE_KEY (they're arrays, not scalar constants)\n  if (constName === 'RESOURCE_ATTRIBUTES' || constName === 'RESPONSE_TO_RESOURCE_KEY') return null;\n\n  // Find the value node (encapsed_string, string, integer, etc.)\n  const valueNode = constElement.namedChildren.find((c) => c.type !== 'name');\n  if (!valueNode) return null;\n\n  // For string values, extract string_content\n  if (valueNode.type === 'encapsed_string') {\n    const contentNode = valueNode.namedChildren.find((c) => c.type === 'string_content');\n    return { name: constName, value: contentNode ? contentNode.text : '' };\n  }\n  if (valueNode.type === 'string') {\n    const contentNode = valueNode.namedChildren.find((c) => c.type === 'string_content');\n    return { name: constName, value: contentNode ? contentNode.text : '' };\n  }\n\n  // For other types (integers, etc.), use the raw text\n  return { name: constName, value: valueNode.text };\n}\n\n// ---------------------------------------------------------------------------\n// Method extraction\n// ---------------------------------------------------------------------------\n\nfunction parseMethods(classBody: SyntaxNode): { methods: PhpMethod[]; promotedProperties: PhpProperty[] } {\n  const methods: PhpMethod[] = [];\n  const allPromotedProperties: PhpProperty[] = [];\n\n  for (const child of classBody.namedChildren) {\n    if (child.type !== 'method_declaration') continue;\n\n    const nameNode = child.childForFieldName('name');\n    if (!nameNode) continue;\n    const methodName = nameNode.text;\n\n    // Skip magic methods except __construct\n    if (methodName.startsWith('__') && methodName !== '__construct') continue;\n\n    const visibility = getVisibility(child);\n    const isStatic = isStaticMethod(child);\n\n    // Get PHPDoc info\n    const docInfo = findDocComment(child);\n\n    // Parse parameters. Two PHP parameter shapes are accepted:\n    //   - `simple_parameter`: standard `Type $name = default`\n    //   - `property_promotion_parameter`: PHP 8 constructor-promoted\n    //     property `public Type $name`. These declare *both* a parameter\n    //     on the constructor AND a property on the class. Without accepting\n    //     this node type the parser skips the parameter\n    //     entirely, model fields disappear from the surface, and the\n    //     compat differ has no field-level signal to pair renamed types.\n    const promotedProperties: PhpProperty[] = [];\n    const params: PhpParam[] = [];\n    const paramsList = child.childForFieldName('parameters');\n    if (paramsList) {\n      for (const paramNode of paramsList.namedChildren) {\n        if (paramNode.type !== 'simple_parameter' && paramNode.type !== 'property_promotion_parameter') continue;\n\n        const paramNameNode = paramNode.namedChildren.find((c) => c.type === 'variable_name');\n        if (!paramNameNode) continue;\n\n        const paramName = paramNameNode.text.replace(/^\\$/, '');\n\n        // Check for native type hint\n        let paramType = '';\n        const typeNode = paramNode.childForFieldName('type');\n        if (typeNode) {\n          paramType = typeNode.text;\n        }\n        // Fall back to PHPDoc\n        if (!paramType && docInfo) {\n          paramType = docInfo.params.get(paramName) || 'mixed';\n        }\n        if (!paramType) {\n          paramType = 'mixed';\n        }\n\n        // Check for default value (means optional)\n        const defaultNode = paramNode.childForFieldName('default_value');\n        const hasDefault = defaultNode !== null;\n\n        params.push({\n          name: paramName,\n          type: paramType,\n          optional: hasDefault,\n        });\n\n        // When the parameter carries a visibility modifier it is a\n        // *promoted property* — `public Type $field` declares the field\n        // on the class. Surface as a property so model classes pick up\n        // their fields without needing a separate `property_declaration`.\n        if (paramNode.type === 'property_promotion_parameter') {\n          const visibilityNode = paramNode.namedChildren.find((c) => c.type === 'visibility_modifier');\n          const visibility = (visibilityNode?.text as 'public' | 'protected' | 'private' | undefined) ?? 'public';\n          promotedProperties.push({\n            name: paramName,\n            type: paramType,\n            visibility,\n          });\n        }\n      }\n    }\n\n    // Return type\n    let returnType = '';\n    const returnTypeNode = child.childForFieldName('return_type');\n    if (returnTypeNode) {\n      returnType = returnTypeNode.text;\n    }\n    if (!returnType && docInfo) {\n      returnType = docInfo.returnType || 'mixed';\n    }\n    if (!returnType) {\n      returnType = 'mixed';\n    }\n\n    methods.push({\n      name: methodName,\n      visibility,\n      isStatic,\n      params,\n      returnType,\n    });\n\n    // Promoted properties surface only from `__construct`. PHP's grammar\n    // technically allows them on any method, but only the constructor's\n    // promoted-properties create class fields per the language spec.\n    if (methodName === '__construct') {\n      allPromotedProperties.push(...promotedProperties);\n    }\n  }\n\n  return { methods, promotedProperties: allPromotedProperties };\n}\n\n// ---------------------------------------------------------------------------\n// Property extraction\n// ---------------------------------------------------------------------------\n\nfunction parseProperties(classBody: SyntaxNode): PhpProperty[] {\n  const properties: PhpProperty[] = [];\n\n  for (const child of classBody.namedChildren) {\n    if (child.type !== 'property_declaration') continue;\n\n    const visibility = getVisibility(child);\n\n    // Get property name from property_element → variable_name\n    for (const propElement of child.namedChildren) {\n      if (propElement.type !== 'property_element') continue;\n      const varNameNode = propElement.namedChildren.find((c) => c.type === 'variable_name');\n      if (!varNameNode) continue;\n\n      const propName = varNameNode.text.replace(/^\\$/, '');\n\n      // Check for type hint\n      let propType = 'mixed';\n      const typeNode = child.namedChildren.find(\n        (c) =>\n          c.type === 'union_type' ||\n          c.type === 'named_type' ||\n          c.type === 'optional_type' ||\n          c.type === 'primitive_type',\n      );\n      if (typeNode) {\n        propType = typeNode.text;\n      }\n\n      properties.push({\n        name: propName,\n        type: propType,\n        visibility,\n      });\n    }\n  }\n\n  return properties;\n}\n\n// ---------------------------------------------------------------------------\n// Constant extraction\n// ---------------------------------------------------------------------------\n\nfunction parseConstants(classBody: SyntaxNode): PhpConstant[] {\n  const constants: PhpConstant[] = [];\n\n  for (const child of classBody.namedChildren) {\n    if (child.type !== 'const_declaration') continue;\n\n    for (const constElement of child.namedChildren) {\n      if (constElement.type !== 'const_element') continue;\n\n      const parsed = parseConstElement(constElement);\n      if (parsed) {\n        constants.push(parsed);\n      }\n    }\n  }\n\n  return constants;\n}\n\n// ---------------------------------------------------------------------------\n// Resource attributes extraction\n// ---------------------------------------------------------------------------\n\nfunction parseResourceAttributes(classBody: SyntaxNode): string[] {\n  for (const child of classBody.namedChildren) {\n    if (child.type !== 'const_declaration') continue;\n\n    for (const constElement of child.namedChildren) {\n      if (constElement.type !== 'const_element') continue;\n\n      const nameNode = constElement.namedChildren.find((c) => c.type === 'name');\n      if (!nameNode || nameNode.text !== 'RESOURCE_ATTRIBUTES') continue;\n\n      const arrayNode = constElement.namedChildren.find((c) => c.type === 'array_creation_expression');\n      if (!arrayNode) continue;\n\n      return parseArrayLiteral(arrayNode);\n    }\n  }\n  return [];\n}\n\n// ---------------------------------------------------------------------------\n// Namespace extraction\n// ---------------------------------------------------------------------------\n\nfunction extractNamespace(tree: Parser.Tree): string {\n  for (const node of tree.rootNode.namedChildren) {\n    if (node.type === 'namespace_definition') {\n      const nameNode = node.childForFieldName('name');\n      return nameNode ? nameNode.text : '';\n    }\n  }\n  return '';\n}\n\n// ---------------------------------------------------------------------------\n// Class/interface extraction\n// ---------------------------------------------------------------------------\n\nfunction parseClassDeclarations(tree: Parser.Tree, sourceFile: string, namespace: string): PhpClass[] {\n  const classes: PhpClass[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('class_declaration')) {\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    // Check for extends\n    let extendsName: string | null = null;\n    const baseClause = node.namedChildren.find((c) => c.type === 'base_clause');\n    if (baseClause) {\n      const baseNameNode = baseClause.namedChildren.find((c) => c.type === 'name' || c.type === 'qualified_name');\n      if (baseNameNode) {\n        // Strip leading backslash and namespace qualifiers for base name\n        const fullName = baseNameNode.text.replace(/^\\\\/, '');\n        const parts = fullName.split('\\\\');\n        extendsName = parts[parts.length - 1];\n      }\n    }\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    const { methods, promotedProperties } = parseMethods(bodyNode);\n    const properties = parseProperties(bodyNode);\n    const constants = parseConstants(bodyNode);\n    const resourceAttributes = parseResourceAttributes(bodyNode);\n\n    const hasCustomConstructor = methods.some((m) => m.name === 'constructFromResponse' && m.isStatic);\n\n    // Merge constructor-promoted properties into the class properties so\n    // model classes (PHP 8 readonly classes that put their fields on the\n    // constructor) carry their field info into the surface.\n    const allProperties: PhpProperty[] = [...properties, ...promotedProperties];\n\n    classes.push({\n      name: nameNode.text,\n      namespace,\n      extends: extendsName,\n      isInterface: false,\n      methods,\n      properties: allProperties,\n      constants,\n      resourceAttributes,\n      hasCustomConstructor,\n      sourceFile,\n    });\n  }\n\n  return classes;\n}\n\nfunction parseInterfaceDeclarations(tree: Parser.Tree, sourceFile: string, namespace: string): PhpClass[] {\n  const interfaces: PhpClass[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('interface_declaration')) {\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    const { methods } = parseMethods(bodyNode);\n\n    interfaces.push({\n      name: nameNode.text,\n      namespace,\n      extends: null,\n      isInterface: true,\n      methods,\n      properties: [],\n      constants: [],\n      resourceAttributes: [],\n      hasCustomConstructor: false,\n      sourceFile,\n    });\n  }\n\n  return interfaces;\n}\n\n// ---------------------------------------------------------------------------\n// PHP 8.1 enum extraction\n// ---------------------------------------------------------------------------\n\nfunction parseEnumDeclarations(tree: Parser.Tree, sourceFile: string, namespace: string): PhpClass[] {\n  const enums: PhpClass[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('enum_declaration')) {\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    // Extract enum cases as constants\n    const constants: PhpConstant[] = [];\n    for (const child of bodyNode.namedChildren) {\n      if (child.type !== 'enum_case') continue;\n      const caseNameNode = child.childForFieldName('name');\n      if (!caseNameNode) continue;\n\n      // Get the value (backed enum): case Foo = 'foo'\n      let value = caseNameNode.text;\n      const valueNode = child.namedChildren.find(\n        (c) => c.type === 'encapsed_string' || c.type === 'string' || c.type === 'integer',\n      );\n      if (valueNode) {\n        const contentNode = valueNode.namedChildren.find((c) => c.type === 'string_content');\n        value = contentNode ? contentNode.text : valueNode.text;\n      }\n\n      constants.push({ name: caseNameNode.text, value });\n    }\n\n    const { methods } = parseMethods(bodyNode);\n\n    enums.push({\n      name: nameNode.text,\n      namespace,\n      extends: null,\n      isInterface: false,\n      methods,\n      properties: [],\n      constants,\n      resourceAttributes: [],\n      hasCustomConstructor: false,\n      sourceFile,\n    });\n  }\n\n  return enums;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\nexport interface ParsedPhpFile {\n  classes: PhpClass[];\n}\n\n/** Parse a single PHP source file and return all extracted symbols. */\nexport function parsePhpFile(filePath: string, sdkPath: string): ParsedPhpFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const tree = safeParse(phpParser, source);\n  const namespace = extractNamespace(tree);\n\n  const classDecls = parseClassDeclarations(tree, relPath, namespace);\n  const interfaceDecls = parseInterfaceDeclarations(tree, relPath, namespace);\n  const enumDecls = parseEnumDeclarations(tree, relPath, namespace);\n\n  return {\n    classes: [...classDecls, ...interfaceDecls, ...enumDecls],\n  };\n}\n","/**\n * PHP surface builder — transforms parsed PHP classes into an ApiSurface.\n *\n * Mapping:\n *   Class extending a resource base      → ApiInterface (fields from RESOURCE_ATTRIBUTES)\n *   Class with only constants             → ApiEnum (const values)\n *   Service class with public methods     → ApiClass\n *   Static utility class                  → ApiClass\n *   PHP interface declaration             → ApiInterface (methods as fields)\n *   Exception class                       → ApiClass\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiEnum,\n  LanguageHints,\n} from '../types.js';\nimport type { PhpClass } from './php-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Default resource base classes (empty — consumer provides via hints.modelBaseClasses). */\nconst DEFAULT_RESOURCE_BASES: string[] = [];\n\n/** Default exception base classes. */\nconst DEFAULT_EXCEPTION_BASES = ['Exception', '\\\\Exception'];\n\n/** Check if a class is a resource class (extends a known resource base and has attributes). */\nfunction isResourceClass(cls: PhpClass, resourceBases: Set<string>): boolean {\n  return !!cls.extends && resourceBases.has(cls.extends) && cls.resourceAttributes.length > 0;\n}\n\n/**\n * Check if a class is a \"value object\" — PHP 8 model class whose fields\n * live on the constructor as promoted properties (`public Type $field`).\n * This covers the common generated shape:\n * `readonly class Foo implements \\JsonSerializable { use JsonSerializableTrait;\n * public function __construct(public Type $field, …) {} }`.\n * The parser collects promoted properties under\n * `cls.properties` so any class with at least one public promoted\n * property is a value object — the field set is its identity.\n *\n * Exception classes are explicitly excluded: an exception subclass that\n * happens to declare a public property (e.g. `BaseRequestException` with\n * a `$requestId` field) is still semantically an exception, not a model.\n * The `isExceptionClass` check is performed by the caller so this stays\n * a pure structural test.\n */\nfunction isValueObjectClass(cls: PhpClass): boolean {\n  if (cls.isInterface) return false;\n  if (cls.constants.length > 0) return false; // enum-shaped, not a model\n  return cls.properties.some((p) => p.visibility === 'public');\n}\n\n/** Check if a class is enum-like (only constants, no public methods). */\nfunction isEnumClass(cls: PhpClass): boolean {\n  if (cls.isInterface) return false;\n  if (cls.constants.length === 0) return false;\n  // Must have only constants — no public instance methods (excluding inherited)\n  const publicMethods = cls.methods.filter((m) => m.visibility === 'public' && m.name !== '__construct');\n  return publicMethods.length === 0 && cls.properties.length === 0 && !cls.extends;\n}\n\n/** Check if a class is an exception. */\nfunction isExceptionClass(cls: PhpClass, exceptionBases: Set<string>): boolean {\n  if (!cls.extends) return false;\n  return exceptionBases.has(cls.extends);\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allClasses: PhpClass[],\n  hints?: LanguageHints,\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const resourceBases = new Set(hints?.modelBaseClasses ?? DEFAULT_RESOURCE_BASES);\n  const exceptionBases = new Set(hints?.exceptionBaseClasses ?? DEFAULT_EXCEPTION_BASES);\n\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  const collector = new ExportCollector();\n\n  for (const cls of allClasses) {\n    if (cls.isInterface) {\n      // PHP interface → ApiInterface\n      const fields: Record<string, ApiField> = {};\n      for (const method of cls.methods) {\n        if (method.visibility !== 'public') continue;\n        fields[method.name] = {\n          name: method.name,\n          type: method.returnType || 'mixed',\n          optional: false,\n        };\n      }\n      interfaces[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        fields: sortRecord(fields),\n        extends: [],\n      };\n      collector.add(cls.sourceFile, cls.name);\n    } else if (isResourceClass(cls, resourceBases)) {\n      // Resource class → ApiInterface with fields from RESOURCE_ATTRIBUTES\n      // Preserve the original field order (don't sort) — it determines toArray() output order\n      const fields: Record<string, ApiField> = {};\n      for (const attr of cls.resourceAttributes) {\n        fields[attr] = {\n          name: attr,\n          type: 'mixed',\n          optional: false,\n        };\n      }\n      interfaces[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        fields, // Intentionally NOT sorted — order matches RESOURCE_ATTRIBUTES\n        extends: cls.extends ? [cls.extends] : [],\n        ...(cls.hasCustomConstructor ? { hasCustomConstructor: true } : {}),\n      };\n      collector.add(cls.sourceFile, cls.name);\n    } else if (isValueObjectClass(cls) && !isExceptionClass(cls, exceptionBases)) {\n      // PHP 8 value-object class (constructor-promoted properties) →\n      // ApiInterface. The promoted properties are the public fields; the\n      // class's `__construct` / `fromArray` / `toArray` helpers don't\n      // contribute identity. Without this branch the class would fall through\n      // to the service-class path below and lose its field info.\n      const fields: Record<string, ApiField> = {};\n      for (const prop of cls.properties) {\n        if (prop.visibility !== 'public') continue;\n        fields[prop.name] = {\n          name: prop.name,\n          type: prop.type,\n          optional: false,\n        };\n      }\n      interfaces[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        fields, // Intentionally NOT sorted — preserves declaration order.\n        extends: cls.extends ? [cls.extends] : [],\n      };\n      collector.add(cls.sourceFile, cls.name);\n    } else if (isEnumClass(cls)) {\n      // Enum-like class → ApiEnum\n      const members: Record<string, string | number> = {};\n      for (const constant of cls.constants) {\n        members[constant.name] = constant.value;\n      }\n      enums[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        members: sortRecord(members),\n      };\n      collector.add(cls.sourceFile, cls.name);\n    } else {\n      // Service class, static utility class, or exception → ApiClass\n      const apiMethods: Record<string, ApiMethod[]> = {};\n      const properties: Record<string, ApiProperty> = {};\n\n      // Only include public methods\n      for (const method of cls.methods) {\n        if (method.visibility !== 'public') continue;\n\n        const params: ApiParam[] = method.params.map((p) => ({\n          name: p.name,\n          type: p.type,\n          optional: p.optional,\n          passingStyle: 'named' as const,\n        }));\n\n        if (!apiMethods[method.name]) apiMethods[method.name] = [];\n        apiMethods[method.name].push({\n          name: method.name,\n          params,\n          returnType: method.returnType || 'mixed',\n          async: false, // PHP is synchronous\n        });\n      }\n\n      // Include public properties\n      for (const prop of cls.properties) {\n        if (prop.visibility !== 'public') continue;\n        properties[prop.name] = {\n          name: prop.name,\n          type: prop.type,\n          readonly: false,\n        };\n      }\n\n      // Only add if there's something meaningful (methods or properties)\n      if (\n        Object.keys(apiMethods).length > 0 ||\n        Object.keys(properties).length > 0 ||\n        isExceptionClass(cls, exceptionBases)\n      ) {\n        classes[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          methods: sortRecord(apiMethods),\n          properties: sortRecord(properties),\n          constructorParams: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n      }\n    }\n  }\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * PHP API surface extractor.\n *\n * Walks `.php` files under `lib/` (or `src/`), parses classes, interfaces,\n * methods, properties, and constants, then builds an `ApiSurface`.\n *\n * Parser:  `php-parser.ts`  — tree-sitter-based PHP source analysis\n * Surface: `php-surface.ts` — ApiSurface construction\n */\n\nimport { statSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkPhpFiles, parsePhpFile } from './php-parser.js';\nimport { buildSurface } from './php-surface.js';\nimport type { PhpClass } from './php-parser.js';\nimport { sortRecord } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst PHP_BODY_TYPES = new Set(['array', 'mixed']);\n\nconst phpHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    // ?string → string\n    if (type.startsWith('?')) return type.slice(1);\n    // null|string → string, string|null → string\n    const parts = type.split('|').filter((p) => p.trim().toLowerCase() !== 'null');\n    if (parts.length < type.split('|').length) return parts.join('|');\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(a: string, b: string): boolean {\n    // Parse pipe-separated types, sort, compare\n    const sortParts = (t: string) =>\n      t\n        .split('|')\n        .map((s) => s.trim())\n        .sort()\n        .join('|');\n    return a !== b && sortParts(a) === sortParts(b);\n  },\n  isGenericTypeParam(_type: string): boolean {\n    return false; // PHP has no generics\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'mixed' || type === 'Object';\n  },\n  tolerateCategoryMismatch: false,\n  extractReturnTypeName(returnType: string): string | null {\n    // Strip nullable: ?Foo → Foo, null|Foo → Foo\n    const stripped = this.stripNullable(returnType) ?? returnType;\n    if (['string', 'int', 'float', 'bool', 'void', 'array', 'mixed'].includes(stripped)) return null;\n    return stripped.replace(/^\\\\/, '');\n  },\n  extractParamTypeName(paramType: string): string | null {\n    const stripped = this.stripNullable(paramType) ?? paramType;\n    if (['string', 'int', 'float', 'bool', 'void', 'array', 'mixed', 'null', 'callable'].includes(stripped)) {\n      return null;\n    }\n    return stripped.replace(/^\\\\/, '');\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    // camelCase → PascalCase comparison\n    return propertyName.toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(_modelName: string): string[] {\n    return [];\n  },\n\n  isSignatureEquivalent(\n    baseline: import('../types.js').ApiMethod,\n    candidate: import('../types.js').ApiMethod,\n    _candidateSurface: import('../types.js').ApiSurface,\n  ): boolean {\n    // Tolerate return type differences common in PHP SDK compat:\n    // - mixed ≡ any specific return type (resource response ≡ void, etc.)\n    // - array ≡ mixed ≡ specific resource type\n    const returnOk =\n      baseline.returnType === candidate.returnType ||\n      baseline.returnType === 'mixed' ||\n      candidate.returnType === 'mixed' ||\n      (baseline.returnType === 'void' && candidate.returnType === 'void') ||\n      (baseline.returnType === 'array' && candidate.returnType === 'array');\n\n    // More lenient: tolerate any return type difference when one side is a\n    // namespace-qualified resource type.\n    const returnTolerated =\n      returnOk || baseline.returnType.includes('\\\\Resource\\\\') || candidate.returnType.includes('\\\\Resource\\\\');\n\n    if (!returnTolerated) return false;\n\n    // Case 1: Same number of required params, just name differences.\n    // The spec may use generic names (id) while the live SDK uses domain names (organization).\n    // Tolerate when the types match but names differ.\n    if (baseline.params.length === candidate.params.length) {\n      let allTypesMatch = true;\n      for (let i = 0; i < baseline.params.length; i++) {\n        if (baseline.params[i].type !== candidate.params[i].type) {\n          allTypesMatch = false;\n          break;\n        }\n      }\n      if (allTypesMatch) return true;\n    }\n\n    // Case 2: Candidate uses array $options / array $payload for body/query params\n    // while baseline has explicit typed params.\n    // Tolerate when the candidate's params are a prefix of the baseline\n    // followed by an array/mixed param that absorbs the rest.\n    const candHasArrayParam = candidate.params.some((p) => PHP_BODY_TYPES.has(p.type));\n    if (candHasArrayParam) return true;\n\n    // Case 3: Baseline has explicit params that the candidate absorbs into path params\n    // with different names (e.g., organization vs id)\n    if (baseline.params.length >= 1 && candidate.params.length >= 1) {\n      // Check if all param types match (allow name differences)\n      let typeMatch = true;\n      const minLen = Math.min(baseline.params.length, candidate.params.length);\n      for (let i = 0; i < minLen; i++) {\n        if (baseline.params[i].type !== candidate.params[i].type) {\n          typeMatch = false;\n          break;\n        }\n      }\n      // Extra candidate params must be optional\n      if (typeMatch) {\n        const extraCandOk = candidate.params.slice(minLen).every((p) => p.optional);\n        const extraBaseOk = baseline.params.slice(minLen).every((p) => p.optional);\n        if (extraCandOk && extraBaseOk) return true;\n      }\n    }\n\n    return false;\n  },\n\n  modelBaseClasses: [],\n  exceptionBaseClasses: ['Exception', '\\\\Exception'],\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\n/** Create a PHP extractor with optional hint overrides. */\nexport function createPhpExtractor(hintOverrides?: Partial<LanguageHints>): Extractor {\n  const mergedHints: LanguageHints = hintOverrides ? { ...phpHints, ...hintOverrides } : phpHints;\n\n  return {\n    language: 'php',\n    hints: mergedHints,\n\n    async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n      const surface = await this.extract(sdkPath);\n      return apiSurfaceToSnapshot(surface);\n    },\n\n    async extract(sdkPath: string): Promise<ApiSurface> {\n      // Determine the source directory: prefer lib/, fallback to src/\n      let sourceDir: string;\n      const libPath = resolve(sdkPath, 'lib');\n      const srcPath = resolve(sdkPath, 'src');\n\n      try {\n        statSync(libPath);\n        sourceDir = libPath;\n      } catch {\n        try {\n          statSync(srcPath);\n          sourceDir = srcPath;\n        } catch {\n          throw new ExtractorError(\n            `No lib/ or src/ directory found in ${sdkPath}`,\n            `Ensure the --sdk-path argument points to a PHP project root containing a lib/ or src/ directory.`,\n          );\n        }\n      }\n\n      const phpFiles = walkPhpFiles(sourceDir);\n      if (phpFiles.length === 0) {\n        throw new ExtractorError(\n          `No .php files found in ${sourceDir}`,\n          `Ensure the source directory contains PHP source files.`,\n        );\n      }\n\n      const allClasses: PhpClass[] = [];\n\n      for (const filePath of phpFiles) {\n        const parsed = parsePhpFile(filePath, sdkPath);\n        allClasses.push(...parsed.classes);\n      }\n\n      const { classes, interfaces, enums, exports } = buildSurface(allClasses, mergedHints);\n\n      return {\n        language: 'php',\n        extractedFrom: sdkPath,\n        extractedAt: new Date().toISOString(),\n        classes: sortRecord(classes),\n        interfaces: sortRecord(interfaces),\n        typeAliases: {},\n        enums: sortRecord(enums),\n        exports: sortRecord(exports),\n      };\n    },\n  };\n}\n\n/** Default PHP extractor with generic language hints (no SDK-specific bases). */\nexport const phpExtractor: Extractor = createPhpExtractor();\n","/** Python source parser — tree-sitter-based extraction of classes, type aliases, and symbols. */\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport Parser from 'tree-sitter';\nimport Python from 'tree-sitter-python';\nimport type { SyntaxNode } from 'tree-sitter';\nimport { safeParse } from '../../utils/tree-sitter.js';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface PythonField {\n  name: string;\n  type: string;\n  hasDefault: boolean;\n}\n\nexport interface PythonMethod {\n  name: string;\n  params: {\n    name: string;\n    type: string;\n    optional: boolean;\n    passingStyle?: 'positional' | 'keyword' | 'keyword_or_positional';\n  }[];\n  returnType: string;\n  isAsync: boolean;\n  isProperty: boolean;\n  isClassMethod: boolean;\n  isStaticMethod: boolean;\n}\n\nexport interface PythonClass {\n  name: string;\n  bases: string[];\n  fields: PythonField[];\n  methods: PythonMethod[];\n  decorators: string[];\n  sourceFile: string;\n}\n\nexport interface PythonTypeAlias {\n  name: string;\n  value: string;\n  sourceFile: string;\n}\n\nexport interface PythonImport {\n  names: string[];\n  sourceFile: string;\n}\n\n// ---------------------------------------------------------------------------\n// Shared parser instance\n// ---------------------------------------------------------------------------\n\nconst pythonParser = new Parser();\npythonParser.setLanguage(Python);\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkPythonFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (\n        entry.startsWith('.') ||\n        entry === '__pycache__' ||\n        entry === 'tests' ||\n        entry === 'test' ||\n        entry === 'node_modules'\n      )\n        continue;\n      results.push(...walkPythonFiles(fullPath));\n    } else if (entry.endsWith('.py')) {\n      // Skip test files\n      if (entry.endsWith('_test.py') || entry.startsWith('test_')) continue;\n      // Skip dunder modules (but include __init__.py). Single-underscore files\n      // like `_resource.py` or `_client.py` are an internal-by-convention\n      // pattern whose symbols get re-exported via `__init__.py`, so they carry\n      // public API surface and must be walked.\n      if (entry.startsWith('__') && entry !== '__init__.py') continue;\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n/** Find the Python source root (prefers `src/`, falls back to top-level package). */\n/** True if a directory looks like a Python package (has __init__.py or .py files). */\nfunction isPythonPackageDir(dir: string): boolean {\n  try {\n    statSync(join(dir, '__init__.py'));\n    return true;\n  } catch {\n    // no __init__.py — check for .py files as a fallback\n    // (generated output may omit __init__.py when it's hand-maintained)\n  }\n  try {\n    const entries = readdirSync(dir);\n    return entries.some((e) => e.endsWith('.py'));\n  } catch {\n    return false;\n  }\n}\n\nexport function findPythonSourceRoot(sdkPath: string): string | null {\n  // Strategy 1: src/ directory\n  const srcDir = join(sdkPath, 'src');\n  try {\n    const stat = statSync(srcDir);\n    if (stat.isDirectory()) {\n      const entries = readdirSync(srcDir);\n      for (const entry of entries) {\n        const pkgDir = join(srcDir, entry);\n        try {\n          const pkgStat = statSync(pkgDir);\n          if (pkgStat.isDirectory() && isPythonPackageDir(pkgDir)) {\n            return srcDir;\n          }\n        } catch {\n          continue;\n        }\n      }\n    }\n  } catch {\n    // no src/, continue\n  }\n\n  // Strategy 2: top-level package directory\n  try {\n    const entries = readdirSync(sdkPath);\n    for (const entry of entries) {\n      if (entry.startsWith('.') || entry === 'tests' || entry === 'test' || entry === 'node_modules') continue;\n      const pkgDir = join(sdkPath, entry);\n      try {\n        const pkgStat = statSync(pkgDir);\n        if (pkgStat.isDirectory() && isPythonPackageDir(pkgDir)) {\n          return sdkPath;\n        }\n      } catch {\n        continue;\n      }\n    }\n  } catch {\n    // can't read sdkPath\n  }\n\n  return null;\n}\n\n/** Get all decorator names from a decorated_definition or class_definition. */\nfunction getDecorators(node: SyntaxNode): string[] {\n  const decorators: string[] = [];\n  // Decorated definition wraps the class or function\n  if (node.type === 'decorated_definition') {\n    for (const child of node.namedChildren) {\n      if (child.type === 'decorator') {\n        const exprNode = child.namedChildren[0];\n        if (exprNode) decorators.push(exprNode.text);\n      }\n    }\n  }\n  return decorators;\n}\n\n/** Extract base class names from a class definition's argument_list. */\nfunction getBaseClasses(classNode: SyntaxNode): string[] {\n  const bases: string[] = [];\n  const argList = classNode.childForFieldName('superclasses');\n  if (!argList) return bases;\n\n  for (const child of argList.namedChildren) {\n    if (child.type === 'identifier' || child.type === 'attribute') {\n      bases.push(child.text);\n    } else if (child.type === 'keyword_argument') {\n      // skip keyword arguments like total=False\n    }\n  }\n  return bases;\n}\n\n/** Extract annotated fields from a class body. */\nfunction extractClassFields(bodyNode: SyntaxNode): PythonField[] {\n  const fields: PythonField[] = [];\n\n  for (const child of bodyNode.namedChildren) {\n    if (child.type !== 'expression_statement') continue;\n\n    const stmtChild = child.namedChildren[0];\n    if (!stmtChild || stmtChild.type !== 'assignment') continue;\n\n    const left = stmtChild.childForFieldName('left');\n    const typeNode = stmtChild.childForFieldName('type');\n\n    // Must be an annotated assignment (has a type annotation)\n    if (!left || !typeNode) continue;\n    // Only simple identifier on left side (not tuple unpacking, etc.)\n    if (left.type !== 'identifier') continue;\n\n    const right = stmtChild.childForFieldName('right');\n\n    fields.push({\n      name: left.text,\n      type: typeNode.text,\n      hasDefault: right !== null,\n    });\n  }\n  return fields;\n}\n\n/** Extract methods from a class body. */\nfunction extractClassMethods(bodyNode: SyntaxNode): PythonMethod[] {\n  const methods: PythonMethod[] = [];\n\n  for (const child of bodyNode.namedChildren) {\n    let funcNode: SyntaxNode | null = null;\n    let decorators: string[] = [];\n\n    if (child.type === 'decorated_definition') {\n      decorators = getDecorators(child);\n      // The actual function/class is the last named child\n      funcNode = child.namedChildren.find((c) => c.type === 'function_definition') || null;\n    } else if (child.type === 'function_definition') {\n      funcNode = child;\n    }\n\n    if (!funcNode) continue;\n\n    const nameNode = funcNode.childForFieldName('name');\n    if (!nameNode) continue;\n    const methodName = nameNode.text;\n\n    // Skip private methods (starting with _) but keep __init__\n    if (methodName.startsWith('_') && methodName !== '__init__') continue;\n\n    const isAsync = funcNode.namedChildren.some((c) => c.type === 'async');\n    const isProperty = decorators.includes('property');\n    const isClassMethod = decorators.includes('classmethod');\n    const isStaticMethod = decorators.includes('staticmethod');\n\n    // Extract parameters\n    const paramsNode = funcNode.childForFieldName('parameters');\n    const params = extractFunctionParams(paramsNode, isStaticMethod || isClassMethod);\n\n    // Extract return type\n    const returnTypeNode = funcNode.childForFieldName('return_type');\n    const returnType = returnTypeNode ? returnTypeNode.text : '';\n\n    methods.push({\n      name: methodName,\n      params,\n      returnType,\n      isAsync,\n      isProperty,\n      isClassMethod,\n      isStaticMethod,\n    });\n  }\n\n  return methods;\n}\n\n/** Extract parameters from a function's parameter list. */\nfunction extractFunctionParams(\n  paramsNode: SyntaxNode | null,\n  skipFirst: boolean,\n): {\n  name: string;\n  type: string;\n  optional: boolean;\n  passingStyle?: 'positional' | 'keyword' | 'keyword_or_positional';\n}[] {\n  if (!paramsNode) return [];\n  const params: {\n    name: string;\n    type: string;\n    optional: boolean;\n    passingStyle?: 'positional' | 'keyword' | 'keyword_or_positional';\n  }[] = [];\n  let skippedFirst = false;\n  let seenStarMarker = false;\n\n  for (const child of paramsNode.namedChildren) {\n    // Skip `self` or `cls` parameter\n    if (!skippedFirst && !skipFirst && child.type === 'identifier' && (child.text === 'self' || child.text === 'cls')) {\n      skippedFirst = true;\n      continue;\n    }\n    if (!skippedFirst && !skipFirst && child.type === 'typed_parameter' && child.namedChildren[0]?.text === 'self') {\n      skippedFirst = true;\n      continue;\n    }\n\n    // `*` separator in parameters (keyword-only marker)\n    if (child.text === '*') {\n      seenStarMarker = true;\n      continue;\n    }\n\n    // *args — variadic positional (also marks subsequent params as keyword-only)\n    if (child.type === 'list_splat_pattern') {\n      seenStarMarker = true;\n      const nameNode = child.namedChildren.find((c: SyntaxNode) => c.type === 'identifier');\n      params.push({\n        name: nameNode ? `*${nameNode.text}` : '*args',\n        type: '',\n        optional: true,\n        passingStyle: 'positional',\n      });\n      continue;\n    }\n\n    // **kwargs — variadic keyword\n    if (child.type === 'dictionary_splat_pattern') {\n      const nameNode = child.namedChildren.find((c: SyntaxNode) => c.type === 'identifier');\n      params.push({\n        name: nameNode ? `**${nameNode.text}` : '**kwargs',\n        type: '',\n        optional: true,\n        passingStyle: 'keyword',\n      });\n      continue;\n    }\n\n    const passingStyle = seenStarMarker ? ('keyword' as const) : ('keyword_or_positional' as const);\n\n    if (child.type === 'typed_parameter') {\n      const nameNode = child.namedChildren.find((c) => c.type === 'identifier');\n      const typeNode = child.childForFieldName('type');\n      if (nameNode) {\n        params.push({\n          name: nameNode.text,\n          type: typeNode ? typeNode.text : '',\n          optional: false,\n          passingStyle,\n        });\n      }\n    } else if (child.type === 'typed_default_parameter') {\n      const nameNode = child.childForFieldName('name');\n      const typeNode = child.childForFieldName('type');\n      if (nameNode) {\n        params.push({\n          name: nameNode.text,\n          type: typeNode ? typeNode.text : '',\n          optional: true,\n          passingStyle,\n        });\n      }\n    } else if (child.type === 'default_parameter') {\n      const nameNode = child.childForFieldName('name');\n      if (nameNode) {\n        params.push({\n          name: nameNode.text,\n          type: '',\n          optional: true,\n          passingStyle,\n        });\n      }\n    } else if (child.type === 'identifier') {\n      params.push({\n        name: child.text,\n        type: '',\n        optional: false,\n        passingStyle,\n      });\n    }\n  }\n\n  return params;\n}\n\n/** Extract module-level type aliases (e.g., FooType = Literal[\"a\", \"b\"]). */\nfunction extractTypeAliases(tree: Parser.Tree, sourceFile: string): PythonTypeAlias[] {\n  const aliases: PythonTypeAlias[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    // type alias statement (Python 3.12+): type X = ...\n    if (node.type === 'type_alias_statement') {\n      const nameNode = node.childForFieldName('name');\n      const valueNode = node.childForFieldName('value');\n      if (nameNode && valueNode) {\n        aliases.push({ name: nameNode.text, value: valueNode.text, sourceFile });\n      }\n      continue;\n    }\n\n    // Assignment: X = Literal[...] or X = \"SomeResource[...]\"\n    if (node.type === 'expression_statement') {\n      const inner = node.namedChildren[0];\n      if (!inner || inner.type !== 'assignment') continue;\n\n      const left = inner.childForFieldName('left');\n      const right = inner.childForFieldName('right');\n      if (!left || !right) continue;\n\n      // Only consider simple name assignments (not a: type = value)\n      if (left.type !== 'identifier') continue;\n\n      const name = left.text;\n      // Skip private names and dunder names\n      if (name.startsWith('_')) continue;\n      // Skip ALL_CAPS constants that are not type aliases\n      if (/^[A-Z][A-Z_0-9]*$/.test(name)) continue;\n\n      const value = right.text;\n\n      // Only take subscript expressions (Literal[...], SomeResource[...], etc.)\n      // or string literals that look like type aliases\n      if (right.type === 'subscript' || (right.type === 'string' && value.includes('['))) {\n        // For string literals, strip quotes\n        let cleanValue = value;\n        if (right.type === 'string') {\n          cleanValue = value.replace(/^[\"']|[\"']$/g, '');\n        }\n        aliases.push({ name, value: cleanValue, sourceFile });\n      }\n    }\n  }\n\n  return aliases;\n}\n\n/** Extract __all__ exports from a module. */\nfunction extractAllExports(tree: Parser.Tree): string[] {\n  const exports: string[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    if (node.type !== 'expression_statement') continue;\n    const inner = node.namedChildren[0];\n    if (!inner || inner.type !== 'assignment') continue;\n\n    const left = inner.childForFieldName('left');\n    const right = inner.childForFieldName('right');\n    if (!left || !right) continue;\n    if (left.text !== '__all__') continue;\n\n    // __all__ = [\"Foo\", \"Bar\"]\n    if (right.type === 'list') {\n      for (const elem of right.namedChildren) {\n        if (elem.type === 'string') {\n          const text = elem.text.replace(/^[\"']|[\"']$/g, '');\n          exports.push(text);\n        }\n      }\n    }\n  }\n\n  return exports;\n}\n\nfunction extractClassesFromTree(tree: Parser.Tree, sourceFile: string): PythonClass[] {\n  const classes: PythonClass[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    let classNode: SyntaxNode | null = null;\n    let decorators: string[] = [];\n\n    if (node.type === 'decorated_definition') {\n      decorators = getDecorators(node);\n      classNode = node.namedChildren.find((c) => c.type === 'class_definition') || null;\n    } else if (node.type === 'class_definition') {\n      classNode = node;\n    }\n\n    if (!classNode) continue;\n\n    const nameNode = classNode.childForFieldName('name');\n    if (!nameNode) continue;\n    const className = nameNode.text;\n\n    const bases = getBaseClasses(classNode);\n\n    const bodyNode = classNode.childForFieldName('body');\n    if (!bodyNode) {\n      classes.push({ name: className, bases, fields: [], methods: [], decorators, sourceFile });\n      continue;\n    }\n\n    const fields = extractClassFields(bodyNode);\n    const methods = extractClassMethods(bodyNode);\n\n    classes.push({ name: className, bases, fields, methods, decorators, sourceFile });\n  }\n\n  return classes;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\nexport interface ParsedPythonFile {\n  classes: PythonClass[];\n  typeAliases: PythonTypeAlias[];\n  allExports: string[];\n  sourceFile: string;\n}\n\n/** Parse a single Python source file and return all extracted symbols. */\nexport function parsePythonFile(filePath: string, sdkPath: string): ParsedPythonFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const tree = safeParse(pythonParser, source);\n\n  const classes = extractClassesFromTree(tree, relPath);\n  const typeAliases = extractTypeAliases(tree, relPath);\n  const allExports = extractAllExports(tree);\n\n  return { classes, typeAliases, allExports, sourceFile: relPath };\n}\n","/**\n * Python surface builder — transforms parsed Python symbols into an ApiSurface.\n *\n * Mapping:\n *   class Foo(BaseModel/custom model)  → ApiInterface (fields from annotations)\n *   class Foo(TypedDict)              → ApiInterface (fields)\n *   class Foo(Protocol)               → ApiClass (canonical service)\n *   Sync/Async impl classes           → skip (Protocol takes precedence)\n *   FooType = Literal[...]            → ApiEnum (members = literal strings)\n *   FooResource = ListResource[...]    → ApiTypeAlias\n *   Exception subclass                → ApiClass\n *   Other class with methods          → ApiClass\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n  LanguageHints,\n} from '../types.js';\nimport type { PythonClass, ParsedPythonFile } from './python-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Default model base classes. Overridden by hints.modelBaseClasses when provided. */\nconst DEFAULT_MODEL_BASES: string[] = [];\n\n/** Known dict-like base classes (→ ApiInterface). */\nconst DICT_BASES = new Set(['TypedDict']);\n\n/** Known protocol bases (→ ApiClass as service). */\nconst PROTOCOL_BASES = new Set(['Protocol']);\n\n/** Default exception bases. Overridden by hints.exceptionBaseClasses when provided. */\nconst DEFAULT_EXCEPTION_BASES = ['Exception', 'BaseException'];\n\n/** Check if a class has any of the given base classes (by simple name). */\nfunction hasBase(cls: PythonClass, bases: Set<string>): boolean {\n  return cls.bases.some((b) => bases.has(b));\n}\n\n/**\n * True when the class carries a `@dataclass` decorator (with or without\n * arguments — `@dataclass`, `@dataclass()`, `@dataclass(slots=True)`, etc.).\n *\n * Dataclasses are the canonical \"data-shape\" Python construct: their\n * structural identity is the field set, even when generated alongside\n * helper methods like `from_dict` / `to_dict`. Without this signal the\n * extractor categorizes them as plain method-bearing classes (category 5)\n * and loses the field info — which then prevents the compat differ from\n * recognizing renames structurally.\n */\nfunction isDataclass(cls: PythonClass): boolean {\n  return cls.decorators.some((d) => /^dataclass(\\s*\\(.*\\))?$/.test(d));\n}\n\n/** Check if a class is a model class (inherits from BaseModel or configured model bases,\n *  transitively from another class that does). */\nfunction isModelClass(cls: PythonClass, allClasses: Map<string, PythonClass>, modelBases: Set<string>): boolean {\n  if (hasBase(cls, modelBases)) return true;\n  // Check transitively: if parent class is a model\n  for (const base of cls.bases) {\n    const parentCls = allClasses.get(base);\n    if (parentCls && isModelClass(parentCls, allClasses, modelBases)) return true;\n  }\n  return false;\n}\n\n/** Check if a class is an exception class. */\nfunction isExceptionClass(\n  cls: PythonClass,\n  allClasses: Map<string, PythonClass>,\n  exceptionBases: Set<string>,\n): boolean {\n  if (hasBase(cls, exceptionBases)) return true;\n  for (const base of cls.bases) {\n    const parentCls = allClasses.get(base);\n    if (parentCls && isExceptionClass(parentCls, allClasses, exceptionBases)) return true;\n  }\n  return false;\n}\n\n/** Parse Literal[\"a\", \"b\", \"c\"] into member strings. */\nfunction parseLiteralMembers(value: string): Record<string, string> | null {\n  const match = value.match(/^Literal\\[(.+)\\]$/s);\n  if (!match) return null;\n\n  const inner = match[1];\n  const members: Record<string, string> = {};\n\n  // Split by comma, handling nested brackets\n  const parts: string[] = [];\n  let depth = 0;\n  let current = '';\n  for (const char of inner) {\n    if (char === '[' || char === '(') depth++;\n    else if (char === ']' || char === ')') depth--;\n    else if (char === ',' && depth === 0) {\n      parts.push(current.trim());\n      current = '';\n      continue;\n    }\n    current += char;\n  }\n  if (current.trim()) parts.push(current.trim());\n\n  for (const part of parts) {\n    // Strip quotes\n    const stripped = part.replace(/^[\"']|[\"']$/g, '');\n    if (stripped) {\n      members[stripped] = stripped;\n    }\n  }\n\n  return Object.keys(members).length > 0 ? members : null;\n}\n\n/** Unwrap SyncOrAsync[T] → T. */\nfunction unwrapReturnType(returnType: string): string {\n  const syncOrAsyncMatch = returnType.match(/^SyncOrAsync\\[(.+)\\]$/);\n  if (syncOrAsyncMatch) return syncOrAsyncMatch[1];\n  const awaitableMatch = returnType.match(/^Awaitable\\[(.+)\\]$/);\n  if (awaitableMatch) return awaitableMatch[1];\n  return returnType;\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  parsedFiles: ParsedPythonFile[],\n  hints?: LanguageHints,\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  typeAliases: Record<string, ApiTypeAlias>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const MODEL_BASES = new Set(hints?.modelBaseClasses ?? DEFAULT_MODEL_BASES);\n  const EXCEPTION_BASES = new Set(hints?.exceptionBaseClasses ?? DEFAULT_EXCEPTION_BASES);\n\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const typeAliases: Record<string, ApiTypeAlias> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  // Collect all classes for transitive base lookups\n  const allClassesByName = new Map<string, PythonClass>();\n  for (const file of parsedFiles) {\n    for (const cls of file.classes) {\n      allClassesByName.set(cls.name, cls);\n    }\n  }\n\n  // Track protocol class names to skip sync/async impls\n  const protocolNames = new Set<string>();\n  for (const file of parsedFiles) {\n    for (const cls of file.classes) {\n      if (hasBase(cls, PROTOCOL_BASES)) {\n        protocolNames.add(cls.name);\n      }\n    }\n  }\n\n  // Build export map from __all__ and file-level symbols\n  const collector = new ExportCollector();\n\n  for (const file of parsedFiles) {\n    // Process type aliases\n    for (const alias of file.typeAliases) {\n      const literalMembers = parseLiteralMembers(alias.value);\n      if (literalMembers) {\n        // Literal type alias → ApiEnum\n        enums[alias.name] = {\n          name: alias.name,\n          sourceFile: alias.sourceFile,\n          members: sortRecord(literalMembers),\n        };\n        collector.add(alias.sourceFile, alias.name);\n      } else {\n        // Regular type alias → ApiTypeAlias\n        typeAliases[alias.name] = {\n          name: alias.name,\n          sourceFile: alias.sourceFile,\n          value: alias.value,\n        };\n        collector.add(alias.sourceFile, alias.name);\n      }\n    }\n\n    // Process classes\n    for (const cls of file.classes) {\n      // 1. Protocol classes → ApiClass (canonical service)\n      if (hasBase(cls, PROTOCOL_BASES)) {\n        const apiMethods: Record<string, ApiMethod[]> = {};\n\n        for (const method of cls.methods) {\n          // Skip __init__ for protocols (they don't have constructors)\n          if (method.name === '__init__') continue;\n\n          const params: ApiParam[] = method.params.map((p) => ({\n            name: p.name,\n            type: p.type,\n            optional: p.optional,\n            ...(p.passingStyle ? { passingStyle: p.passingStyle } : {}),\n          }));\n\n          const returnType = unwrapReturnType(method.returnType);\n\n          if (!apiMethods[method.name]) apiMethods[method.name] = [];\n          apiMethods[method.name].push({\n            name: method.name,\n            params,\n            returnType,\n            async: method.isAsync,\n          });\n        }\n\n        classes[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          methods: sortRecord(apiMethods),\n          properties: {},\n          constructorParams: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 2. Model classes (BaseModel or configured model bases) → ApiInterface\n      if (isModelClass(cls, allClassesByName, MODEL_BASES)) {\n        const fields: Record<string, ApiField> = {};\n        for (const field of cls.fields) {\n          fields[field.name] = {\n            name: field.name,\n            type: field.type,\n            optional: field.hasDefault,\n          };\n        }\n\n        // Compute extends list: filter out model bases themselves\n        const extendsArr = cls.bases.filter((b) => !MODEL_BASES.has(b) && allClassesByName.has(b));\n\n        interfaces[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          fields: sortRecord(fields),\n          extends: extendsArr,\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 3. TypedDict classes → ApiInterface\n      if (hasBase(cls, DICT_BASES)) {\n        const fields: Record<string, ApiField> = {};\n        for (const field of cls.fields) {\n          fields[field.name] = {\n            name: field.name,\n            type: field.type,\n            optional: field.hasDefault,\n          };\n        }\n\n        interfaces[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          fields: sortRecord(fields),\n          extends: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 4. Exception classes → ApiClass\n      if (isExceptionClass(cls, allClassesByName, EXCEPTION_BASES)) {\n        const apiMethods: Record<string, ApiMethod[]> = {};\n        // Extract any non-private, non-init methods\n        for (const method of cls.methods) {\n          if (method.name === '__init__') continue;\n          const params: ApiParam[] = method.params.map((p) => ({\n            name: p.name,\n            type: p.type,\n            optional: p.optional,\n            ...(p.passingStyle ? { passingStyle: p.passingStyle } : {}),\n          }));\n          if (!apiMethods[method.name]) apiMethods[method.name] = [];\n          apiMethods[method.name].push({\n            name: method.name,\n            params,\n            returnType: unwrapReturnType(method.returnType),\n            async: method.isAsync,\n          });\n        }\n\n        // Exception fields as properties if they have annotations\n        const fields: Record<string, ApiField> = {};\n        for (const field of cls.fields) {\n          fields[field.name] = {\n            name: field.name,\n            type: field.type,\n            optional: field.hasDefault,\n          };\n        }\n\n        classes[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          methods: sortRecord(apiMethods),\n          properties: {},\n          constructorParams: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 4b. Dataclasses → ApiInterface. A `@dataclass`-decorated class is\n      //     fundamentally a data-shape; its structural identity is the\n      //     field set even when oagen also emits `from_dict` / `to_dict`\n      //     helper methods on it. Without this branch the class falls\n      //     through to category 5 (ApiClass with methods) and the field\n      //     info is dropped — which prevents the compat differ from\n      //     pairing renamed types structurally.\n      if (isDataclass(cls) && cls.fields.length > 0) {\n        const fields: Record<string, ApiField> = {};\n        for (const field of cls.fields) {\n          fields[field.name] = {\n            name: field.name,\n            type: field.type,\n            optional: field.hasDefault,\n          };\n        }\n        interfaces[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          fields: sortRecord(fields),\n          extends: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 5. Other class with methods → ApiClass\n      if (cls.methods.length > 0) {\n        const apiMethods: Record<string, ApiMethod[]> = {};\n        const constructorParams: ApiParam[] = [];\n\n        for (const method of cls.methods) {\n          if (method.name === '__init__') {\n            constructorParams.push(\n              ...method.params.map((p) => ({\n                name: p.name,\n                type: p.type,\n                optional: p.optional,\n                ...(p.passingStyle ? { passingStyle: p.passingStyle } : {}),\n              })),\n            );\n            continue;\n          }\n\n          const params: ApiParam[] = method.params.map((p) => ({\n            name: p.name,\n            type: p.type,\n            optional: p.optional,\n            ...(p.passingStyle ? { passingStyle: p.passingStyle } : {}),\n          }));\n          if (!apiMethods[method.name]) apiMethods[method.name] = [];\n          apiMethods[method.name].push({\n            name: method.name,\n            params,\n            returnType: unwrapReturnType(method.returnType),\n            async: method.isAsync,\n          });\n        }\n\n        classes[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          methods: sortRecord(apiMethods),\n          properties: {},\n          constructorParams,\n        };\n        collector.add(cls.sourceFile, cls.name);\n        continue;\n      }\n\n      // 6. Class with only fields and no methods → ApiInterface\n      if (cls.fields.length > 0) {\n        const fields: Record<string, ApiField> = {};\n        for (const field of cls.fields) {\n          fields[field.name] = {\n            name: field.name,\n            type: field.type,\n            optional: field.hasDefault,\n          };\n        }\n        interfaces[cls.name] = {\n          name: cls.name,\n          sourceFile: cls.sourceFile,\n          fields: sortRecord(fields),\n          extends: [],\n        };\n        collector.add(cls.sourceFile, cls.name);\n      }\n    }\n\n    // Add __all__ exports\n    if (file.allExports.length > 0) {\n      for (const name of file.allExports) {\n        collector.add(file.sourceFile, name);\n      }\n    }\n  }\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    typeAliases: sortRecord(typeAliases),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * Python API surface extractor.\n *\n * Walks `.py` files under `src/` (fallback to top-level package dirs),\n * parses classes, type aliases, and module exports, then builds an\n * `ApiSurface` with Protocol-based services, Pydantic model interfaces,\n * Literal type enums, and exception classes.\n *\n * Parser:  `python-parser.ts`  — tree-sitter-based Python source analysis\n * Surface: `python-surface.ts` — ApiSurface construction\n */\n\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport {\n  NAMED_TYPE_RE,\n  typeExistsInSurface,\n  namedTypeWordsOverlap,\n  defaultIsNullableOnlyDifference,\n} from '../language-hints.js';\nimport { walkPythonFiles, findPythonSourceRoot, parsePythonFile } from './python-parser.js';\nimport { buildSurface } from './python-surface.js';\nimport type { ParsedPythonFile } from './python-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst PYTHON_PRIMITIVE_TYPES = new Set(['str', 'int', 'float', 'bool', 'bytes']);\n\nconst pythonHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    // Normalize whitespace before matching\n    const normalized = type.replace(/\\s+/g, ' ').trim();\n    // Optional[T] → T\n    const optMatch = normalized.match(/^Optional\\[(.+)\\]$/);\n    if (optMatch) return optMatch[1].trim();\n    // NotRequired[T] → T (TypedDict optionality ≡ nullable for compat purposes)\n    const nrMatch = normalized.match(/^NotRequired\\[(.+)\\]$/);\n    if (nrMatch) return nrMatch[1].trim();\n    // T | None → T, None | T → T\n    const parts = normalized\n      .split('|')\n      .map((p) => p.trim())\n      .filter((p) => p !== 'None');\n    if (parts.length < normalized.split('|').length) return parts.join(' | ');\n    return null;\n  },\n\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n\n  isUnionReorder(a: string, b: string): boolean {\n    const parseUnion = (t: string) => {\n      const unionMatch = t.match(/^Union\\[(.+)\\]$/);\n      if (unionMatch)\n        return unionMatch[1]\n          .split(',')\n          .map((s) => s.trim())\n          .sort();\n      return t\n        .split('|')\n        .map((s) => s.trim())\n        .sort();\n    };\n    return a !== b && parseUnion(a).join(',') === parseUnion(b).join(',');\n  },\n\n  isGenericTypeParam(type: string): boolean {\n    return /^[A-Z]$/.test(type) || /^T[A-Z][a-zA-Z]*$/.test(type);\n  },\n\n  isExtractionArtifact(type: string): boolean {\n    return type === 'Any' || type === 'object';\n  },\n\n  tolerateCategoryMismatch: true,\n\n  extractReturnTypeName(returnType: string): string | null {\n    let inner = returnType;\n    const syncOrAsyncMatch = inner.match(/^SyncOrAsync\\[(.+)\\]$/);\n    if (syncOrAsyncMatch) inner = syncOrAsyncMatch[1];\n    const awaitableMatch = inner.match(/^Awaitable\\[(.+)\\]$/);\n    if (awaitableMatch) inner = awaitableMatch[1];\n    const optMatch = inner.match(/^Optional\\[(.+)\\]$/);\n    if (optMatch) inner = optMatch[1];\n    // Unwrap list resource patterns (e.g., SomeListResource[T, ...] → T)\n    for (const pattern of this.listResourcePatterns ?? []) {\n      const prefix = pattern + '[';\n      if (inner.startsWith(prefix)) {\n        // Extract first type arg: everything up to the first comma or closing bracket\n        const rest = inner.slice(prefix.length);\n        const end = rest.search(/[,\\]]/);\n        if (end > 0) {\n          inner = rest.slice(0, end).trim();\n          break;\n        }\n      }\n    }\n    // Sequence[T] → T\n    const seqMatch = inner.match(/^Sequence\\[(.+)\\]$/);\n    if (seqMatch) inner = seqMatch[1];\n    if (['str', 'int', 'float', 'bool', 'None', 'bytes', 'dict', 'list'].includes(inner)) return null;\n    return inner;\n  },\n\n  extractParamTypeName(paramType: string): string | null {\n    let inner = paramType;\n    const optMatch = inner.match(/^Optional\\[(.+)\\]$/);\n    if (optMatch) inner = optMatch[1];\n    if (['str', 'int', 'float', 'bool', 'None', 'bytes', 'dict', 'list'].includes(inner)) return null;\n    return inner;\n  },\n\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    return propertyName.replace(/_/g, '').toLowerCase() === className.toLowerCase();\n  },\n\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n\n  isTypeEquivalent(baselineType: string, candidateType: string, candidateSurface: ApiSurface): boolean {\n    // Strip nullable wrappers from both sides\n    const stripNullable = (t: string): string => {\n      const normalized = t.replace(/\\s+/g, ' ').trim();\n      const optMatch = normalized.match(/^Optional\\[(.+)\\]$/);\n      if (optMatch) return optMatch[1].trim();\n      const nrMatch = normalized.match(/^NotRequired\\[(.+)\\]$/);\n      if (nrMatch) return nrMatch[1].trim();\n      const parts = normalized\n        .split('|')\n        .map((p) => p.trim())\n        .filter((p) => p !== 'None');\n      if (parts.length < normalized.split('|').length) return parts.join(' | ');\n      return normalized;\n    };\n    const baseClean = stripNullable(baselineType);\n    const candClean = stripNullable(candidateType);\n\n    // Literal quote style equivalence: Literal[\"foo\"] ≡ Literal['foo']\n    const literalMatch = (t: string) => t.match(/^Literal\\[(['\"])(.+)\\1\\]$/);\n    const baseLit = literalMatch(baseClean);\n    const candLit = literalMatch(candClean);\n    if (baseLit && candLit && baseLit[2] === candLit[2]) return true;\n\n    // LiteralOrUntyped[T] ≡ T (custom wrapper type) — strip recursively\n    const stripWrappers = (t: string): string => {\n      let inner = t;\n      // Strip LiteralOrUntyped[...]\n      const louMatch = inner.match(/^LiteralOrUntyped\\[(.+)\\]$/);\n      if (louMatch) inner = louMatch[1];\n      // Strip Literal[...] to get the enum name if it's a Literal of literals\n      return inner;\n    };\n    const baseUnwrapped = stripWrappers(baseClean);\n    const candUnwrapped = stripWrappers(candClean);\n    if (baseUnwrapped !== baseClean || candUnwrapped !== candClean) {\n      // After unwrapping, check equivalence\n      if (baseUnwrapped === candClean || candUnwrapped === baseClean) return true;\n      if (baseUnwrapped === candUnwrapped) return true;\n      // LiteralOrUntyped[Literal[\"a\", \"b\"]] ≡ enum type\n      if (baseUnwrapped.startsWith('Literal[') && candidateSurface.enums[candClean]) return true;\n      if (candUnwrapped.startsWith('Literal[') && candidateSurface.enums?.[baseClean]) return true;\n    }\n\n    // Sequence[T] ≡ list[T] ≡ List[T]\n    const seqPattern = /^(?:Sequence|list|List)\\[(.+)\\]$/;\n    const baseSeq = baseClean.match(seqPattern);\n    const candSeq = candClean.match(seqPattern);\n    if (baseSeq && candSeq) {\n      if (baseSeq[1] === candSeq[1]) return true;\n      // Inner types may differ by named type (InlineRole vs DirectoryUserRole)\n      const baseInner = baseSeq[1];\n      const candInner = candSeq[1];\n      if (NAMED_TYPE_RE.test(baseInner) && NAMED_TYPE_RE.test(candInner)) {\n        if (typeExistsInSurface(candInner, candidateSurface)) {\n          if (candInner.includes(baseInner) || baseInner.includes(candInner)) return true;\n          if (namedTypeWordsOverlap(baseInner, candInner)) return true;\n        }\n      }\n      // Tolerate model collection vs primitive collection: Sequence[OrganizationDomain] ≡ list[str]\n      // The spec may define a field as a primitive array while the live SDK wraps it in a model.\n      const primitiveTypes = PYTHON_PRIMITIVE_TYPES;\n      if (\n        (primitiveTypes.has(baseInner) && NAMED_TYPE_RE.test(candInner)) ||\n        (primitiveTypes.has(candInner) && NAMED_TYPE_RE.test(baseInner))\n      ) {\n        return true;\n      }\n    }\n    // Cross-container tolerance: Sequence[T] vs list[str] (different container names)\n    if (baseSeq && !candSeq) {\n      const candListMatch = candClean.match(/^(?:list|List)\\[(.+)\\]$/);\n      if (candListMatch) {\n        const baseInner = baseSeq[1];\n        const candInner = candListMatch[1];\n        if (baseInner === candInner) return true;\n        const primitiveTypes = PYTHON_PRIMITIVE_TYPES;\n        if (\n          (primitiveTypes.has(baseInner) && NAMED_TYPE_RE.test(candInner)) ||\n          (primitiveTypes.has(candInner) && NAMED_TYPE_RE.test(baseInner))\n        ) {\n          return true;\n        }\n      }\n    }\n\n    // Mapping[K, V] ≡ dict[K, V] (Mapping is the ABC for dict)\n    const mappingPattern = /^(?:Mapping|dict|Dict)\\[(.+)\\]$/;\n    const baseMapping = baseClean.match(mappingPattern);\n    const candMapping = candClean.match(mappingPattern);\n    if (baseMapping && candMapping) {\n      // Both are map-like — compare key/value types loosely\n      return true;\n    }\n\n    // dict map equivalence: dict[str, str] ≡ dict[str, Any] ≡ Dict[str, Any] ≡ dict[str, str | float | bool]\n    const dictLikePattern = /^(?:dict|Dict|Mapping)\\[str,\\s*.+\\]$/;\n    if (dictLikePattern.test(baseClean) && dictLikePattern.test(candClean)) return true;\n\n    // Named metadata type ≡ dict[str, ...] (custom type alias for dict)\n    const isMapType = (t: string) => dictLikePattern.test(t) || /^(?:Metadata|\\w+Metadata)$/.test(t);\n    if (isMapType(baseClean) && isMapType(candClean)) return true;\n\n    // Named type alias for a map/dict type ≡ inline dict expression\n    // e.g., AuditLogMetadata ≡ dict[str, str | float | bool]\n    if (NAMED_TYPE_RE.test(baseClean) && dictLikePattern.test(candClean)) {\n      // Assume named types ending in \"Metadata\" or \"Attributes\" are dict aliases\n      if (/(?:Metadata|Attributes)$/.test(baseClean)) return true;\n    }\n    if (NAMED_TYPE_RE.test(candClean) && dictLikePattern.test(baseClean)) {\n      if (/(?:Metadata|Attributes)$/.test(candClean)) return true;\n    }\n\n    // str ≡ Literal[\"...\"] (literal string type vs plain str)\n    if (baseClean === 'str' && candClean.startsWith('Literal[')) return true;\n    if (candClean === 'str' && baseClean.startsWith('Literal[')) return true;\n\n    // Literal[...] ≡ enum name (candidate has an enum, baseline has Literal)\n    if (baseClean.startsWith('Literal[') && candidateSurface.enums[candClean]) return true;\n    if (candClean.startsWith('Literal[') && candidateSurface.enums?.[baseClean]) return true;\n\n    // str ≡ enum type (baseline says str, candidate uses enum)\n    if (baseClean === 'str' && candidateSurface.enums[candClean]) return true;\n    if (candClean === 'str' && candidateSurface.enums?.[baseClean]) return true;\n\n    // int ≡ float (JSON number coercion)\n    const numericTypes = new Set(['int', 'float']);\n    if (numericTypes.has(baseClean) && numericTypes.has(candClean)) return true;\n\n    // Named type tolerance\n    if (NAMED_TYPE_RE.test(baseClean) && NAMED_TYPE_RE.test(candClean)) {\n      if (typeExistsInSurface(candClean, candidateSurface)) {\n        if (candClean.includes(baseClean) || baseClean.includes(candClean)) return true;\n        const baseNoResp = baseClean.replace(/Response$/, '');\n        const candNoResp = candClean.replace(/Response$/, '');\n        if (candNoResp.includes(baseNoResp) || baseNoResp.includes(candNoResp)) return true;\n        if (namedTypeWordsOverlap(baseClean, candClean)) return true;\n      }\n    }\n\n    return false;\n  },\n\n  isSignatureEquivalent(\n    baseline: import('../types.js').ApiMethod,\n    candidate: import('../types.js').ApiMethod,\n    _candidateSurface: ApiSurface,\n  ): boolean {\n    // Tolerate methods where the candidate uses a body dict (payload: dict[str, Any])\n    // while the baseline unpacks the body into individual typed params.\n    // The first N params that match by name and type are consumed, then the remaining\n    // baseline params are tolerated if the candidate has a dict payload param.\n\n    // Return types must be equivalent (use named type tolerance)\n    if (baseline.returnType !== candidate.returnType) {\n      const baseRet = baseline.returnType;\n      const candRet = candidate.returnType;\n      if (!(NAMED_TYPE_RE.test(baseRet) && NAMED_TYPE_RE.test(candRet))) return false;\n      // Check named-type containment or word overlap\n      if (!candRet.includes(baseRet) && !baseRet.includes(candRet)) {\n        if (!namedTypeWordsOverlap(baseRet, candRet)) return false;\n      }\n    }\n\n    // Check if candidate has a body dict param\n    const bodyDictTypes = new Set(['dict[str, Any]', 'Dict[str, Any]', 'dict']);\n    const candBodyIdx = candidate.params.findIndex(\n      (p) => bodyDictTypes.has(p.type) && (p.name === 'payload' || p.name === 'body' || p.name === 'data'),\n    );\n    if (candBodyIdx < 0) return false;\n\n    // All candidate params before the body dict must match baseline params by name and type\n    for (let i = 0; i < candBodyIdx; i++) {\n      if (i >= baseline.params.length) return false;\n      if (baseline.params[i].name !== candidate.params[i].name) return false;\n      if (baseline.params[i].type !== candidate.params[i].type) return false;\n    }\n\n    // Remaining baseline params after the matched prefix are tolerated as body fields\n    return true;\n  },\n\n  // Consumers should configure modelBaseClasses for their framework (e.g., ['BaseModel'] for Pydantic)\n  modelBaseClasses: [],\n  exceptionBaseClasses: ['Exception', 'BaseException'],\n  listResourcePatterns: [],\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\n/** Create a Python extractor with optional hint overrides. */\nexport function createPythonExtractor(hintOverrides?: Partial<LanguageHints>): Extractor {\n  const mergedHints: LanguageHints = hintOverrides ? { ...pythonHints, ...hintOverrides } : pythonHints;\n\n  return {\n    language: 'python',\n    hints: mergedHints,\n\n    async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n      const surface = await this.extract(sdkPath);\n      return apiSurfaceToSnapshot(surface);\n    },\n\n    async extract(sdkPath: string): Promise<ApiSurface> {\n      const sourceRoot = findPythonSourceRoot(sdkPath);\n      if (!sourceRoot) {\n        throw new ExtractorError(\n          `No Python package found in ${sdkPath}`,\n          `Ensure the --sdk-path argument points to a Python project root containing a package directory with __init__.py.`,\n        );\n      }\n\n      const pyFiles = walkPythonFiles(sourceRoot);\n      if (pyFiles.length === 0) {\n        throw new ExtractorError(\n          `No .py files found in ${sdkPath}`,\n          `Ensure the project contains Python source files.`,\n        );\n      }\n\n      const parsedFiles: ParsedPythonFile[] = [];\n      for (const filePath of pyFiles) {\n        const parsed = parsePythonFile(filePath, sdkPath);\n        parsedFiles.push(parsed);\n      }\n\n      const { classes, interfaces, typeAliases, enums, exports } = buildSurface(parsedFiles, mergedHints);\n\n      return {\n        language: 'python',\n        extractedFrom: sdkPath,\n        extractedAt: new Date().toISOString(),\n        classes,\n        interfaces,\n        typeAliases,\n        enums,\n        exports,\n      };\n    },\n  };\n}\n\n/** Default Python extractor with generic language hints (no SDK-specific bases). */\nexport const pythonExtractor: Extractor = createPythonExtractor();\n","/**\n * Ruby entity extraction — tree-sitter-based parsing of classes, service modules,\n * and enum modules from Ruby source files.\n */\n\nimport Parser from 'tree-sitter';\nimport Ruby from 'tree-sitter-ruby';\nimport type { SyntaxNode } from 'tree-sitter';\nimport type { ApiClass, ApiEnum, ApiMethod, ApiParam, ApiProperty } from '../types.js';\nimport { safeParse as safeParseWith } from '../../utils/tree-sitter.js';\nimport { sortRecord } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Shared parser instance\n// ---------------------------------------------------------------------------\n\nconst rubyParser = new Parser();\nrubyParser.setLanguage(Ruby);\n\nfunction safeParse(source: string): Parser.Tree {\n  return safeParseWith(rubyParser, source);\n}\n\n// ---------------------------------------------------------------------------\n// Public API — called from ruby.ts\n// ---------------------------------------------------------------------------\n\n/** Parse a Ruby source string and return all class declarations (excluding service modules). */\nexport function extractClasses(source: string): ApiClass[] {\n  const tree = safeParse(source);\n  const classes: ApiClass[] = [];\n\n  // Collect line ranges of service modules so we can skip nested classes\n  const serviceModuleNodes = findServiceModulesFromTree(tree.rootNode);\n  const serviceRanges = serviceModuleNodes.map((n) => [n.startPosition.row, n.endPosition.row] as [number, number]);\n\n  for (const node of tree.rootNode.descendantsOfType('class')) {\n    // Skip singleton_class nodes (class << self)\n    if (node.type !== 'class') continue;\n\n    // Skip classes inside service modules\n    if (isInsideRanges(node.startPosition.row, serviceRanges)) continue;\n\n    // Skip if this class contains a singleton_class (class << self) — those are service modules\n    if (node.descendantsOfType('singleton_class').length > 0) continue;\n\n    // Skip enum-shaped classes — they're handled by `extractEnumModules`\n    // (which also picks up class-shape enums alongside module-shape ones).\n    // Without this skip we'd double-emit the same name as both an\n    // ApiClass and an ApiEnum.\n    if (isEnumShapedClass(node)) continue;\n\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n    const className = nameNode.text;\n\n    const bodyNode = node.childForFieldName('body');\n\n    const methods: Record<string, ApiMethod[]> = {};\n    const properties: Record<string, ApiProperty> = {};\n    const constructorParams: ApiParam[] = [];\n\n    // Only extract body content if body exists (single-line classes like `class Foo < Bar; end` may not have a body)\n    if (bodyNode) {\n      // Extract attr_accessor/attr_reader\n      extractAttributes(bodyNode, properties);\n\n      // Extract methods (respecting visibility)\n      const extractedMethods = extractMethodsFromBody(bodyNode);\n      for (const method of extractedMethods) {\n        if (method.name === 'initialize') {\n          constructorParams.push(...method.params);\n        } else {\n          if (!methods[method.name]) methods[method.name] = [];\n          methods[method.name].push(method);\n        }\n      }\n    }\n\n    classes.push({\n      name: className,\n      methods: sortRecord(methods),\n      properties: sortRecord(properties),\n      constructorParams,\n    });\n  }\n\n  return classes;\n}\n\n/** Extract service modules (modules with `class << self` at immediate depth). */\nexport function extractServiceModules(source: string): ApiClass[] {\n  const tree = safeParse(source);\n  const services: ApiClass[] = [];\n\n  for (const moduleNode of findServiceModulesFromTree(tree.rootNode)) {\n    const nameNode = moduleNode.childForFieldName('name');\n    if (!nameNode) continue;\n    const moduleName = nameNode.text;\n\n    const bodyNode = moduleNode.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    // Find the singleton_class (class << self) at immediate depth\n    const singletonNode = findImmediateSingletonClass(bodyNode);\n    if (!singletonNode) continue;\n\n    const singletonBody = singletonNode.childForFieldName('body');\n    if (!singletonBody) continue;\n\n    const methods: Record<string, ApiMethod[]> = {};\n    const properties: Record<string, ApiProperty> = {};\n\n    // Extract methods from the singleton class body\n    const extractedMethods = extractMethodsFromBody(singletonBody);\n    for (const method of extractedMethods) {\n      if (!methods[method.name]) methods[method.name] = [];\n      methods[method.name].push(method);\n    }\n\n    // Extract constants as properties\n    extractConstantsAsProperties(singletonBody, properties);\n\n    if (Object.keys(methods).length > 0 || Object.keys(properties).length > 0) {\n      services.push({\n        name: moduleName,\n        methods: sortRecord(methods),\n        properties: sortRecord(properties),\n        constructorParams: [],\n      });\n    }\n  }\n\n  return services;\n}\n\n/**\n * True when a `class` node looks like a Ruby enum: only constant\n * assignments, no methods, no attr_*, no singleton class. The\n * `extractEnumModules` pass picks these up; `extractClasses` skips\n * them to avoid double-emission. Shared so the two stay in sync.\n */\nfunction isEnumShapedClass(classNode: SyntaxNode): boolean {\n  const bodyNode = classNode.childForFieldName('body');\n  if (!bodyNode) return false;\n  // Reject if the class has any method-shaped or call-shaped child\n  // (call covers attr_accessor / attr_reader / include).\n  for (const c of bodyNode.namedChildren) {\n    if (c.type === 'method' || c.type === 'singleton_method' || c.type === 'call') return false;\n  }\n  // Must have at least 2 scalar constants to be considered an enum.\n  const constants = extractEnumConstants(bodyNode);\n  return Object.keys(constants).length >= 2;\n}\n\n/** Extract enum-like modules (modules with string/number constants, no class << self). */\nexport function extractEnumModules(source: string): ApiEnum[] {\n  const tree = safeParse(source);\n  const enums: ApiEnum[] = [];\n\n  const serviceModuleNodes = findServiceModulesFromTree(tree.rootNode);\n  const serviceRanges = serviceModuleNodes.map((n) => [n.startPosition.row, n.endPosition.row] as [number, number]);\n\n  for (const node of tree.rootNode.descendantsOfType('module')) {\n    // Skip modules inside service modules\n    if (isInsideRanges(node.startPosition.row, serviceRanges)) continue;\n\n    // Skip modules that have singleton_class (service modules)\n    if (node.descendantsOfType('singleton_class').length > 0) continue;\n\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    const constants = extractEnumConstants(bodyNode);\n    if (Object.keys(constants).length < 2) continue;\n\n    enums.push({\n      name: nameNode.text,\n      members: sortRecord(constants),\n    });\n  }\n\n  // Also extract enum-shaped *classes*: some Ruby SDKs emit deduped ordering\n  // enums and similar value-set types as\n  // `class ApplicationsOrder; ASC = \"asc\"; …; ALL = [...].freeze; end`\n  // — a class with only constants (no instance methods, no constructor).\n  // Without this branch they fall through to `extractClasses`, become\n  // ApiClass with no methods/properties, and surface as `kind:\n  // 'service_accessor'` with no enum_member children — which the compat\n  // differ can't pair on for canonical-flip detection.\n  for (const node of tree.rootNode.descendantsOfType('class')) {\n    if (node.type !== 'class') continue;\n    if (isInsideRanges(node.startPosition.row, serviceRanges)) continue;\n    if (node.descendantsOfType('singleton_class').length > 0) continue;\n\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    // Reject if the class has any non-constant declarations (methods,\n    // attr_accessor, etc.). The `ALL` aggregator constant (`ALL = [A,\n    // B, C].freeze`) is allowed and skipped — `extractEnumConstants`\n    // only collects scalar string/number values, so non-scalar\n    // constants (arrays) are naturally excluded.\n    const hasNonConstantBody = bodyNode.namedChildren.some(\n      (c) => c.type === 'method' || c.type === 'singleton_method' || c.type === 'call',\n    );\n    if (hasNonConstantBody) continue;\n\n    const constants = extractEnumConstants(bodyNode);\n    if (Object.keys(constants).length < 2) continue;\n\n    enums.push({\n      name: nameNode.text,\n      members: sortRecord(constants),\n    });\n  }\n\n  return enums;\n}\n\n/** Extract autoload declarations to build the export map. */\nexport function extractAutoloads(source: string): string[] {\n  const tree = safeParse(source);\n  const names: string[] = [];\n\n  for (const callNode of tree.rootNode.descendantsOfType('call')) {\n    const methodNode = callNode.childForFieldName('method');\n    if (!methodNode || methodNode.text !== 'autoload') continue;\n\n    const argsNode = callNode.childForFieldName('arguments');\n    if (!argsNode) continue;\n\n    // First argument is the symbol name\n    const firstArg = argsNode.namedChildren[0];\n    if (firstArg && (firstArg.type === 'simple_symbol' || firstArg.type === 'symbol')) {\n      names.push(firstArg.text.replace(/^:/, ''));\n    }\n  }\n\n  return names;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: finding service modules\n// ---------------------------------------------------------------------------\n\n/** Find module nodes that have `class << self` at their immediate body level. */\nfunction findServiceModulesFromTree(rootNode: SyntaxNode): SyntaxNode[] {\n  const result: SyntaxNode[] = [];\n\n  for (const moduleNode of rootNode.descendantsOfType('module')) {\n    const bodyNode = moduleNode.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    if (findImmediateSingletonClass(bodyNode)) {\n      result.push(moduleNode);\n    }\n  }\n\n  return result;\n}\n\n/** Find a singleton_class (class << self) at the immediate body level (not nested). */\nfunction findImmediateSingletonClass(bodyNode: SyntaxNode): SyntaxNode | null {\n  for (const child of bodyNode.namedChildren) {\n    if (child.type === 'singleton_class') return child;\n  }\n  return null;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: method extraction with visibility tracking\n// ---------------------------------------------------------------------------\n\n/** Extract methods from a body_statement, respecting private/protected/public markers. */\nfunction extractMethodsFromBody(bodyNode: SyntaxNode): ApiMethod[] {\n  const methods: ApiMethod[] = [];\n  let isPrivate = false;\n\n  for (const child of bodyNode.namedChildren) {\n    // Track visibility markers: bare `private`, `public`, `protected` calls\n    if (child.type === 'identifier') {\n      if (child.text === 'private') {\n        isPrivate = true;\n        continue;\n      }\n      if (child.text === 'public') {\n        isPrivate = false;\n        continue;\n      }\n      if (child.text === 'protected') {\n        isPrivate = true;\n        continue;\n      }\n    }\n\n    if (isPrivate) continue;\n\n    if (child.type === 'method') {\n      const nameNode = child.childForFieldName('name');\n      if (!nameNode) continue;\n\n      const params = extractMethodParams(child);\n      methods.push({\n        name: nameNode.text,\n        params,\n        returnType: 'Object',\n        async: false,\n      });\n    }\n  }\n\n  return methods;\n}\n\n/** Extract parameters from a method node. */\nfunction extractMethodParams(methodNode: SyntaxNode): ApiParam[] {\n  const paramsNode = methodNode.childForFieldName('parameters');\n  if (!paramsNode) return [];\n\n  const params: ApiParam[] = [];\n\n  for (const paramNode of paramsNode.namedChildren) {\n    switch (paramNode.type) {\n      case 'identifier': {\n        // Plain positional argument\n        params.push({ name: paramNode.text, type: 'Object', optional: false, passingStyle: 'positional' as const });\n        break;\n      }\n      case 'optional_parameter': {\n        // Positional argument with default: name = value\n        const nameNode = paramNode.childForFieldName('name');\n        if (nameNode) {\n          params.push({ name: nameNode.text, type: 'Object', optional: true, passingStyle: 'positional' as const });\n        }\n        break;\n      }\n      case 'keyword_parameter': {\n        // Keyword argument: name: or name: default\n        const nameNode = paramNode.childForFieldName('name');\n        if (nameNode) {\n          const valueNode = paramNode.childForFieldName('value');\n          params.push({\n            name: nameNode.text,\n            type: 'Object',\n            optional: valueNode !== null,\n            passingStyle: 'keyword' as const,\n          });\n        }\n        break;\n      }\n      case 'splat_parameter': {\n        // *args — variadic positional\n        const nameNode = paramNode.childForFieldName('name');\n        params.push({\n          name: nameNode ? `*${nameNode.text}` : '*args',\n          type: 'Object',\n          optional: true,\n          passingStyle: 'positional' as const,\n        });\n        break;\n      }\n      case 'hash_splat_parameter': {\n        // **kwargs — variadic keyword\n        const nameNode = paramNode.childForFieldName('name');\n        params.push({\n          name: nameNode ? `**${nameNode.text}` : '**kwargs',\n          type: 'Object',\n          optional: true,\n          passingStyle: 'keyword' as const,\n        });\n        break;\n      }\n      case 'block_parameter': {\n        // &block — block argument\n        const nameNode = paramNode.childForFieldName('name');\n        params.push({\n          name: nameNode ? `&${nameNode.text}` : '&block',\n          type: 'Object',\n          optional: true,\n          passingStyle: 'positional' as const,\n        });\n        break;\n      }\n      default:\n        break;\n    }\n  }\n\n  return params;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: attribute extraction\n// ---------------------------------------------------------------------------\n\n/** Extract attr_accessor/attr_reader calls into properties. */\nfunction extractAttributes(bodyNode: SyntaxNode, properties: Record<string, ApiProperty>): void {\n  for (const callNode of bodyNode.descendantsOfType('call')) {\n    const methodNode = callNode.childForFieldName('method');\n    if (!methodNode) continue;\n    const methodName = methodNode.text;\n    if (methodName !== 'attr_accessor' && methodName !== 'attr_reader') continue;\n\n    const isReadonly = methodName === 'attr_reader';\n\n    const argsNode = callNode.childForFieldName('arguments');\n    if (!argsNode) continue;\n\n    for (const argNode of argsNode.namedChildren) {\n      if (argNode.type === 'simple_symbol' || argNode.type === 'symbol') {\n        const name = argNode.text.replace(/^:/, '');\n        properties[name] = { name, type: 'Object', readonly: isReadonly };\n      }\n    }\n  }\n}\n\n// ---------------------------------------------------------------------------\n// Internal: constant extraction\n// ---------------------------------------------------------------------------\n\n/** Extract UPPER_CASE constants from a body as readonly properties. */\nfunction extractConstantsAsProperties(bodyNode: SyntaxNode, properties: Record<string, ApiProperty>): void {\n  for (const child of bodyNode.namedChildren) {\n    if (child.type !== 'assignment') continue;\n    const leftNode = child.childForFieldName('left');\n    if (!leftNode || leftNode.type !== 'constant') continue;\n    const name = leftNode.text;\n    if (!/^[A-Z][A-Z_0-9]*$/.test(name)) continue;\n    properties[name] = { name, type: 'Object', readonly: true };\n  }\n}\n\n/** Extract enum-style constants (ConstantName = 'value') from a module body. */\nfunction extractEnumConstants(bodyNode: SyntaxNode): Record<string, string | number> {\n  const constants: Record<string, string | number> = {};\n\n  for (const child of bodyNode.namedChildren) {\n    if (child.type !== 'assignment') continue;\n    const leftNode = child.childForFieldName('left');\n    if (!leftNode || leftNode.type !== 'constant') continue;\n    const name = leftNode.text;\n    if (name === 'ALL') continue; // Skip aggregate constants\n\n    const rightNode = child.childForFieldName('right');\n    if (!rightNode) continue;\n\n    const value = extractLiteralValue(rightNode);\n    if (value !== undefined) {\n      constants[name] = value;\n    }\n  }\n\n  return constants;\n}\n\n/** Extract a literal string or number value from a tree-sitter node. */\nfunction extractLiteralValue(node: SyntaxNode): string | number | undefined {\n  if (node.type === 'string' || node.type === 'string_content') {\n    // String: strip surrounding quotes\n    const text = node.text;\n    if ((text.startsWith(\"'\") && text.endsWith(\"'\")) || (text.startsWith('\"') && text.endsWith('\"'))) {\n      return text.slice(1, -1);\n    }\n    // For string_content (inside a string node), return as-is\n    return text;\n  }\n  if (node.type === 'integer') {\n    return Number(node.text);\n  }\n  if (node.type === 'float') {\n    return Number(node.text);\n  }\n  // For strings, tree-sitter wraps in a `string` node with `string_content` children\n  if (node.type === 'string') {\n    const contentNode = node.namedChildren.find((c) => c.type === 'string_content');\n    if (contentNode) return contentNode.text;\n  }\n  return undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: tree traversal helpers\n// ---------------------------------------------------------------------------\n\n/** Check if a line number falls inside any of the given ranges. */\nfunction isInsideRanges(line: number, ranges: Array<[number, number]>): boolean {\n  for (const [start, end] of ranges) {\n    if (line > start && line < end) return true;\n  }\n  return false;\n}\n\nexport { sortRecord } from './shared.js';\n","/**\n * Ruby API surface extractor.\n *\n * Walks `.rb` files under `lib/`, parses class/module declarations,\n * and builds an `ApiSurface` with classes, service modules, and enum modules.\n *\n * Parser: `ruby-parser.ts` — tree-sitter-based class/module/enum extraction\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { resolve, relative, join } from 'node:path';\nimport { ExtractorError } from '../../errors.js';\nimport type { ApiSurface, Extractor, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport {\n  extractClasses,\n  extractServiceModules,\n  extractEnumModules,\n  extractAutoloads,\n  sortRecord,\n} from './ruby-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst rubyHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    const match = type.match(/^T\\.nilable\\((.+)\\)$/);\n    return match ? match[1] : null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false;\n  },\n  isGenericTypeParam(type: string): boolean {\n    return type === 'T.untyped';\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'T.untyped' || type === 'BasicObject';\n  },\n  tolerateCategoryMismatch: false,\n  extractReturnTypeName(returnType: string): string | null {\n    return returnType || null;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    if (['String', 'Integer', 'Float', 'Boolean', 'NilClass'].includes(paramType)) return null;\n    return paramType;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    return propertyName.replace(/_/g, '').toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(_modelName: string): string[] {\n    return [];\n  },\n};\n\n// ---------------------------------------------------------------------------\n// File collection\n// ---------------------------------------------------------------------------\n\n/** Recursively collect all .rb files under a directory. */\nfunction collectRbFiles(dir: string): string[] {\n  const result: string[] = [];\n  const entries = readdirSync(dir);\n  for (const entry of entries.sort()) {\n    const full = join(dir, entry);\n    const stat = statSync(full);\n    if (stat.isDirectory()) {\n      result.push(...collectRbFiles(full));\n    } else if (entry.endsWith('.rb')) {\n      result.push(full);\n    }\n  }\n  return result;\n}\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const rubyExtractor: Extractor = {\n  language: 'ruby',\n  hints: rubyHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    const libPath = resolve(sdkPath, 'lib');\n    try {\n      statSync(libPath);\n    } catch {\n      throw new ExtractorError(\n        `No lib/ directory found in ${sdkPath}`,\n        `Verify the --sdk-path argument points to a Ruby project root containing a lib/ directory.`,\n      );\n    }\n\n    const rbFiles = collectRbFiles(libPath);\n    if (rbFiles.length === 0) {\n      throw new ExtractorError(\n        `No .rb files found in ${libPath}`,\n        `Ensure the lib/ directory contains Ruby source files.`,\n      );\n    }\n\n    const classes: Record<string, import('../types.js').ApiClass> = {};\n    const enums: Record<string, import('../types.js').ApiEnum> = {};\n    const exports: Record<string, string[]> = {};\n\n    for (const absPath of rbFiles) {\n      const relPath = relative(sdkPath, absPath);\n      const source = readFileSync(absPath, 'utf-8');\n\n      const fileExports: string[] = [];\n\n      // Extract classes (model classes and struct classes)\n      const extractedClasses = extractClasses(source);\n      for (const cls of extractedClasses) {\n        classes[cls.name] = { ...cls, sourceFile: relPath };\n        fileExports.push(cls.name);\n      }\n\n      // Extract service modules (modules with class << self)\n      const extractedServices = extractServiceModules(source);\n      for (const svc of extractedServices) {\n        classes[svc.name] = { ...svc, sourceFile: relPath };\n        fileExports.push(svc.name);\n      }\n\n      // Extract enum-like modules (modules with constants)\n      const extractedEnums = extractEnumModules(source);\n      for (const en of extractedEnums) {\n        enums[en.name] = { ...en, sourceFile: relPath };\n        fileExports.push(en.name);\n      }\n\n      // Extract autoload declarations as exports\n      const autoloadNames = extractAutoloads(source);\n      if (autoloadNames.length > 0) {\n        fileExports.push(...autoloadNames);\n      }\n\n      if (fileExports.length > 0) {\n        exports[relPath] = [...new Set(fileExports)].sort();\n      }\n    }\n\n    return {\n      language: 'ruby',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes: sortRecord(classes),\n      interfaces: {},\n      typeAliases: {},\n      enums: sortRecord(enums),\n      exports: sortRecord(exports),\n    };\n  },\n};\n","/**\n * Go source parser — tree-sitter-based extraction of structs, functions, types,\n * and const blocks from Go source files.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport Parser from 'tree-sitter';\nimport Go from 'tree-sitter-go';\nimport type { SyntaxNode } from 'tree-sitter';\nimport { safeParse } from '../../utils/tree-sitter.js';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface GoStructField {\n  name: string;\n  type: string;\n  jsonTag?: string;\n  optional: boolean;\n}\n\nexport interface GoStruct {\n  name: string;\n  fields: GoStructField[];\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface GoFunc {\n  receiverType: string | null;\n  name: string;\n  params: { name: string; type: string }[];\n  returnTypes: string[];\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface GoConst {\n  name: string;\n  typeName: string;\n  value: string;\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface GoTypeDecl {\n  name: string;\n  underlyingType: string;\n  isAlias: boolean;\n  sourceFile: string;\n  packageName: string;\n}\n\n// ---------------------------------------------------------------------------\n// Shared parser instance\n// ---------------------------------------------------------------------------\n\nconst goParser = new Parser();\ngoParser.setLanguage(Go);\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkGoFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === 'vendor' || entry === 'testdata' || entry === 'internal') continue;\n      results.push(...walkGoFiles(fullPath));\n    } else if (entry.endsWith('.go') && !entry.endsWith('_test.go')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// Node helpers\n// ---------------------------------------------------------------------------\n\n/** Get the text of a child node by field name, or null. */\nfunction fieldText(node: SyntaxNode, field: string): string | null {\n  const child = node.childForFieldName(field);\n  return child ? child.text : null;\n}\n\n/** Extract the JSON field name from a struct tag. */\nfunction extractJsonTag(tagText: string): { name: string; omitempty: boolean } | null {\n  const match = tagText.match(/json:\"([^\"]*)\"/);\n  if (!match) return null;\n  const parts = match[1].split(',');\n  const name = parts[0].trim();\n  const omitempty = parts.includes('omitempty');\n  if (name === '-') return null;\n  return { name, omitempty };\n}\n\n/** Render a type node back to its Go source representation. */\nfunction typeNodeText(node: SyntaxNode): string {\n  return node.text;\n}\n\n// ---------------------------------------------------------------------------\n// Struct extraction\n// ---------------------------------------------------------------------------\n\nfunction parseStructFields(structNode: SyntaxNode): GoStructField[] {\n  const fields: GoStructField[] = [];\n  const fieldList = structNode.namedChildren.find((c) => c.type === 'field_declaration_list');\n  if (!fieldList) return fields;\n\n  for (const fieldDecl of fieldList.namedChildren) {\n    if (fieldDecl.type !== 'field_declaration') continue;\n\n    // Get all field identifiers (there can be multiple: `A, B int`)\n    const nameNodes = fieldDecl.namedChildren.filter((c) => c.type === 'field_identifier');\n    if (nameNodes.length === 0) {\n      // Embedded field (struct composition) — extract the type name as the field name.\n      // e.g., `type Foo struct { Bar }` → field named \"Bar\" of type \"Bar\"\n      const typeNode = fieldDecl.namedChildren.find(\n        (c) => c.type !== 'raw_string_literal' && c.type !== 'interpreted_string_literal',\n      );\n      if (typeNode) {\n        const typeName = typeNode.text.replace(/^\\*/, ''); // strip pointer\n        if (/^[A-Z]/.test(typeName)) {\n          fields.push({\n            name: typeName,\n            type: typeNode.text,\n            optional: false,\n          });\n        }\n      }\n      continue;\n    }\n\n    // The type node: find the first named child that isn't a field_identifier and isn't a tag\n    const typeNode = fieldDecl.namedChildren.find(\n      (c) =>\n        c.type !== 'field_identifier' && c.type !== 'raw_string_literal' && c.type !== 'interpreted_string_literal',\n    );\n    if (!typeNode) continue;\n\n    // Only export fields that start with uppercase\n    const fieldType = typeNodeText(typeNode);\n\n    // Tag is a raw_string_literal child\n    const tagNode = fieldDecl.namedChildren.find(\n      (c) => c.type === 'raw_string_literal' || c.type === 'interpreted_string_literal',\n    );\n    const jsonTag = tagNode ? extractJsonTag(tagNode.text) : null;\n\n    for (const nameNode of nameNodes) {\n      const name = nameNode.text;\n      if (!/^[A-Z]/.test(name)) continue; // skip unexported\n      fields.push({\n        name,\n        type: fieldType,\n        jsonTag: jsonTag?.name || undefined,\n        optional: jsonTag?.omitempty || false,\n      });\n    }\n  }\n  return fields;\n}\n\n// ---------------------------------------------------------------------------\n// Type declarations\n// ---------------------------------------------------------------------------\n\nexport function parseTypeDecls(\n  tree: Parser.Tree,\n  sourceFile: string,\n  packageName: string,\n): { structs: GoStruct[]; types: GoTypeDecl[] } {\n  const structs: GoStruct[] = [];\n  const types: GoTypeDecl[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    if (node.type !== 'type_declaration') continue;\n\n    for (const spec of node.namedChildren) {\n      const name = fieldText(spec, 'name');\n      if (!name || !/^[A-Z]/.test(name)) continue;\n\n      if (spec.type === 'type_spec') {\n        const typeNode = spec.childForFieldName('type');\n        if (!typeNode) continue;\n\n        if (typeNode.type === 'struct_type') {\n          structs.push({ name, fields: parseStructFields(typeNode), sourceFile, packageName });\n        } else if (typeNode.type !== 'interface_type') {\n          types.push({ name, underlyingType: typeNodeText(typeNode), isAlias: false, sourceFile, packageName });\n        }\n      } else if (spec.type === 'type_alias') {\n        const typeNode = spec.childForFieldName('type');\n        if (typeNode) {\n          types.push({ name, underlyingType: typeNodeText(typeNode), isAlias: true, sourceFile, packageName });\n        }\n      }\n    }\n  }\n\n  return { structs, types };\n}\n\n// ---------------------------------------------------------------------------\n// Const blocks\n// ---------------------------------------------------------------------------\n\n/** Strip surrounding quotes from a string value. */\nfunction stripQuotes(value: string): string {\n  if ((value.startsWith('\"') && value.endsWith('\"')) || (value.startsWith(\"'\") && value.endsWith(\"'\"))) {\n    return value.slice(1, -1);\n  }\n  const convMatch = value.match(/^\\w+(?:\\.\\w+)?\\(\"([^\"]*)\"\\)$/);\n  if (convMatch) return convMatch[1];\n  return value;\n}\n\nexport function parseConstBlocks(tree: Parser.Tree, sourceFile: string, packageName: string): GoConst[] {\n  const consts: GoConst[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    if (node.type !== 'const_declaration') continue;\n\n    let lastType = '';\n\n    for (const spec of node.namedChildren) {\n      if (spec.type !== 'const_spec') continue;\n\n      const nameNodes = spec.namedChildren.filter((c) => c.type === 'identifier');\n      if (nameNodes.length === 0) continue;\n      const constName = nameNodes[0].text;\n      if (!/^[A-Z]/.test(constName)) continue;\n\n      // Type field (optional)\n      const typeNode = spec.childForFieldName('type');\n      if (typeNode) {\n        lastType = typeNode.text;\n      }\n\n      // Value field\n      const valueNode = spec.childForFieldName('value');\n      if (valueNode) {\n        // expression_list may contain a single value or a call expression\n        const valueText = valueNode.text.trim();\n        const strippedValue = stripQuotes(valueText);\n\n        // Check for type conversion: TypeName(\"value\") or TypeName(value)\n        if (!typeNode) {\n          const convMatch = valueText.match(/^([A-Z]\\w*)\\((.+)\\)$/);\n          if (convMatch) {\n            consts.push({\n              name: constName,\n              typeName: convMatch[1],\n              value: stripQuotes(convMatch[2].trim()),\n              sourceFile,\n              packageName,\n            });\n            continue;\n          }\n        }\n\n        if (lastType) {\n          consts.push({ name: constName, typeName: lastType, value: strippedValue, sourceFile, packageName });\n        }\n      } else if (lastType) {\n        // iota continuation — no value node\n        consts.push({ name: constName, typeName: lastType, value: constName, sourceFile, packageName });\n      }\n    }\n  }\n\n  return consts;\n}\n\n// ---------------------------------------------------------------------------\n// Function & method declarations\n// ---------------------------------------------------------------------------\n\nfunction parseParamList(paramListNode: SyntaxNode | null): { name: string; type: string }[] {\n  if (!paramListNode) return [];\n  const params: { name: string; type: string }[] = [];\n\n  let unnamedIndex = 0;\n  for (const paramDecl of paramListNode.namedChildren) {\n    if (paramDecl.type !== 'parameter_declaration' && paramDecl.type !== 'variadic_parameter_declaration') continue;\n\n    const nameNode = paramDecl.namedChildren.find((c) => c.type === 'identifier');\n    const typeNode = paramDecl.childForFieldName('type');\n    if (!typeNode) continue;\n\n    // When Go omits the parameter name (e.g., `func Foo(string, int)`),\n    // synthesize a positional name so signature matching doesn't break.\n    const name = nameNode ? nameNode.text : `_arg${unnamedIndex++}`;\n    params.push({\n      name,\n      type: typeNodeText(typeNode),\n    });\n  }\n  return params;\n}\n\nfunction parseReturnTypes(resultNode: SyntaxNode | null): string[] {\n  if (!resultNode) return [];\n\n  if (resultNode.type === 'parameter_list') {\n    // Multiple return values: (Type1, Type2)\n    return resultNode.namedChildren\n      .filter((c) => c.type === 'parameter_declaration')\n      .map((c) => {\n        const t = c.childForFieldName('type');\n        return t ? typeNodeText(t) : c.text;\n      });\n  }\n\n  // Single return value\n  return [typeNodeText(resultNode)];\n}\n\nexport function parseFunctions(tree: Parser.Tree, sourceFile: string, packageName: string): GoFunc[] {\n  const funcs: GoFunc[] = [];\n\n  for (const node of tree.rootNode.namedChildren) {\n    if (node.type === 'function_declaration') {\n      const name = fieldText(node, 'name');\n      if (!name || !/^[A-Z]/.test(name)) continue;\n\n      funcs.push({\n        receiverType: null,\n        name,\n        params: parseParamList(node.childForFieldName('parameters')),\n        returnTypes: parseReturnTypes(node.childForFieldName('result')),\n        sourceFile,\n        packageName,\n      });\n    } else if (node.type === 'method_declaration') {\n      const name = fieldText(node, 'name');\n      if (!name || !/^[A-Z]/.test(name)) continue;\n\n      // Extract receiver type\n      const receiverNode = node.childForFieldName('receiver');\n      let receiverType: string | null = null;\n      if (receiverNode) {\n        const paramDecl = receiverNode.namedChildren.find((c) => c.type === 'parameter_declaration');\n        if (paramDecl) {\n          const typeNode = paramDecl.childForFieldName('type');\n          if (typeNode) {\n            // Strip pointer: *Foo → Foo\n            receiverType = typeNode.text.replace(/^\\*/, '');\n          }\n        }\n      }\n\n      funcs.push({\n        receiverType,\n        name,\n        params: parseParamList(node.childForFieldName('parameters')),\n        returnTypes: parseReturnTypes(node.childForFieldName('result')),\n        sourceFile,\n        packageName,\n      });\n    }\n  }\n  return funcs;\n}\n\n// ---------------------------------------------------------------------------\n// Package name extraction\n// ---------------------------------------------------------------------------\n\nexport function extractPackageName(tree: Parser.Tree): string {\n  const pkgClause = tree.rootNode.namedChildren.find((c) => c.type === 'package_clause');\n  if (!pkgClause) return 'unknown';\n  const nameNode = pkgClause.namedChildren.find((c) => c.type === 'package_identifier');\n  return nameNode ? nameNode.text : 'unknown';\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\nexport interface ParsedGoFile {\n  structs: GoStruct[];\n  types: GoTypeDecl[];\n  funcs: GoFunc[];\n  consts: GoConst[];\n}\n\n/** Parse a single Go source file and return all extracted symbols. */\nexport function parseGoFile(filePath: string, sdkPath: string): ParsedGoFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const tree = safeParse(goParser, source);\n  const packageName = extractPackageName(tree);\n\n  const { structs, types } = parseTypeDecls(tree, relPath, packageName);\n  const funcs = parseFunctions(tree, relPath, packageName);\n  const consts = parseConstBlocks(tree, relPath, packageName);\n\n  return { structs, types, funcs, consts };\n}\n","/**\n * Go surface builder — transforms parsed Go symbols into an ApiSurface\n * with proper package-qualified names for collision avoidance.\n */\n\nimport { basename, dirname } from 'node:path';\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n} from '../types.js';\nimport type { GoStruct, GoTypeDecl, GoFunc, GoConst } from './go-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction goTypeToString(t: string): string {\n  return t.replace(/json\\.RawMessage/g, '[]byte').replace(/\\bcontext\\.Context\\b/g, 'context.Context');\n}\n\nfunction buildReturnType(returnTypes: string[]): string {\n  const nonError = returnTypes.filter((r) => r !== 'error');\n  if (nonError.length === 0) return 'error';\n  if (nonError.length === 1) return goTypeToString(nonError[0]);\n  return `(${nonError.map(goTypeToString).join(', ')})`;\n}\n\n/** Get the package directory name from a source file relative path. */\nfunction getPackageDirName(relPath: string): string {\n  const dir = dirname(relPath);\n  return basename(dir) || 'root';\n}\n\n// ---------------------------------------------------------------------------\n// Qualified name resolution\n// ---------------------------------------------------------------------------\n\n/**\n * When multiple packages define the same exported symbol, qualify with the\n * package directory name (e.g., \"organizations.Client\", \"sso.Client\").\n * Unique symbols keep their bare name.\n */\nfunction buildQualifiedNames(\n  items: Array<{ name: string; packageName: string; sourceFile: string }>,\n): Map<string, string> {\n  const nameToPackages = new Map<string, Set<string>>();\n  for (const item of items) {\n    if (!nameToPackages.has(item.name)) nameToPackages.set(item.name, new Set());\n    nameToPackages.get(item.name)!.add(item.packageName);\n  }\n\n  const result = new Map<string, string>();\n  for (const item of items) {\n    const key = `${item.sourceFile}:${item.name}`;\n    const packages = nameToPackages.get(item.name)!;\n    result.set(key, packages.size > 1 ? `${getPackageDirName(item.sourceFile)}.${item.name}` : item.name);\n  }\n  return result;\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allStructs: GoStruct[],\n  allTypes: GoTypeDecl[],\n  allFuncs: GoFunc[],\n  allConsts: GoConst[],\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  typeAliases: Record<string, ApiTypeAlias>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const typeAliases: Record<string, ApiTypeAlias> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  // Group consts by (packageName, typeName)\n  const constsByPkgAndType = new Map<string, GoConst[]>();\n  for (const c of allConsts) {\n    const key = `${c.packageName}:${c.typeName}`;\n    if (!constsByPkgAndType.has(key)) constsByPkgAndType.set(key, []);\n    constsByPkgAndType.get(key)!.push(c);\n  }\n\n  // Group methods by (packageName, receiverType)\n  const methodsByPkgAndReceiver = new Map<string, GoFunc[]>();\n  const packageFuncs: GoFunc[] = [];\n  for (const fn of allFuncs) {\n    if (fn.receiverType) {\n      const key = `${fn.packageName}:${fn.receiverType}`;\n      if (!methodsByPkgAndReceiver.has(key)) methodsByPkgAndReceiver.set(key, []);\n      methodsByPkgAndReceiver.get(key)!.push(fn);\n    } else {\n      packageFuncs.push(fn);\n    }\n  }\n\n  // Build qualified names\n  const allSymbols: Array<{ name: string; packageName: string; sourceFile: string }> = [];\n  for (const s of allStructs) allSymbols.push({ name: s.name, packageName: s.packageName, sourceFile: s.sourceFile });\n  for (const t of allTypes) allSymbols.push({ name: t.name, packageName: t.packageName, sourceFile: t.sourceFile });\n  const qualifiedNames = buildQualifiedNames(allSymbols);\n\n  // Process type declarations\n  for (const typeDecl of allTypes) {\n    const qName = qualifiedNames.get(`${typeDecl.sourceFile}:${typeDecl.name}`) || typeDecl.name;\n    const typeConsts = constsByPkgAndType.get(`${typeDecl.packageName}:${typeDecl.name}`);\n\n    if (typeDecl.isAlias) {\n      typeAliases[qName] = {\n        name: qName,\n        sourceFile: typeDecl.sourceFile,\n        value: goTypeToString(typeDecl.underlyingType),\n      };\n    } else if (typeConsts && typeConsts.length > 0) {\n      const members: Record<string, string | number> = {};\n      for (const c of typeConsts) {\n        // Strip the type name prefix from enum constant names to produce\n        // consistent short member keys (e.g., \"AuthenticationFactorTypeGenericOtp\"\n        // → \"GenericOtp\"). This matches Go SDK conventions where the type prefix\n        // is an implementation detail, not part of the public API contract.\n        const memberKey = c.name.startsWith(typeDecl.name) ? c.name.slice(typeDecl.name.length) || c.name : c.name;\n        members[memberKey] = c.value;\n      }\n      enums[qName] = { name: qName, sourceFile: typeDecl.sourceFile, members: sortRecord(members) };\n    } else {\n      typeAliases[qName] = {\n        name: qName,\n        sourceFile: typeDecl.sourceFile,\n        value: goTypeToString(typeDecl.underlyingType),\n      };\n    }\n  }\n\n  // Process structs\n  for (const s of allStructs) {\n    const qName = qualifiedNames.get(`${s.sourceFile}:${s.name}`) || s.name;\n    const methods = methodsByPkgAndReceiver.get(`${s.packageName}:${s.name}`);\n\n    if (methods && methods.length > 0) {\n      const apiMethods: Record<string, ApiMethod[]> = {};\n      const properties: Record<string, ApiProperty> = {};\n\n      for (const field of s.fields) {\n        properties[field.name] = { name: field.name, type: goTypeToString(field.type), readonly: false };\n      }\n\n      for (const fn of methods) {\n        const params: ApiParam[] = fn.params\n          .filter((p) => p.type !== 'context.Context')\n          .map((p) => ({\n            name: p.name,\n            type: goTypeToString(p.type),\n            optional: false,\n            passingStyle: 'positional' as const,\n          }));\n        if (!apiMethods[fn.name]) apiMethods[fn.name] = [];\n        apiMethods[fn.name].push({ name: fn.name, params, returnType: buildReturnType(fn.returnTypes), async: false });\n      }\n\n      classes[qName] = {\n        name: qName,\n        sourceFile: s.sourceFile,\n        methods: sortRecord(apiMethods),\n        properties: sortRecord(properties),\n        constructorParams: [],\n      };\n    } else {\n      const fields: Record<string, ApiField> = {};\n      for (const field of s.fields) {\n        const fieldName = field.jsonTag || field.name;\n        fields[fieldName] = { name: fieldName, type: goTypeToString(field.type), optional: field.optional };\n      }\n      interfaces[qName] = { name: qName, sourceFile: s.sourceFile, fields: sortRecord(fields), extends: [] };\n    }\n  }\n\n  // Build export map\n  const collector = new ExportCollector();\n\n  for (const [name, cls] of Object.entries(classes)) if (cls.sourceFile) collector.add(cls.sourceFile, name);\n  for (const [name, iface] of Object.entries(interfaces)) if (iface.sourceFile) collector.add(iface.sourceFile, name);\n  for (const [name, ta] of Object.entries(typeAliases)) if (ta.sourceFile) collector.add(ta.sourceFile, name);\n  for (const [name, en] of Object.entries(enums)) if (en.sourceFile) collector.add(en.sourceFile, name);\n  for (const c of allConsts) {\n    const typeDecl = allTypes.find((t) => t.name === c.typeName && t.packageName === c.packageName);\n    if (typeDecl) collector.add(typeDecl.sourceFile, c.name);\n  }\n  for (const fn of packageFuncs) collector.add(fn.sourceFile, fn.name);\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    typeAliases: sortRecord(typeAliases),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * Go API surface extractor.\n *\n * Walks `.go` files (excluding `_test.go` and `internal/`), parses exported\n * structs, functions, type declarations, and const blocks, then builds an\n * `ApiSurface` with package-qualified names to avoid collisions when\n * multiple packages define the same symbol (e.g., `Client`).\n *\n * Parser: `go-parser.ts`   — regex-based Go source analysis\n * Surface: `go-surface.ts` — ApiSurface construction & name qualification\n */\n\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkGoFiles, parseGoFile } from './go-parser.js';\nimport { buildSurface } from './go-surface.js';\nimport type { GoStruct, GoTypeDecl, GoFunc, GoConst } from './go-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\n/**\n * Go acronyms that may differ in casing between hand-written and generated code.\n * e.g., hand-written uses \"Json\" / \"Uri\" while generated uses \"JSON\" / \"URI\".\n */\nconst GO_ACRONYMS = [\n  'ID',\n  'URL',\n  'API',\n  'HTTP',\n  'HTTPS',\n  'JSON',\n  'XML',\n  'SQL',\n  'HTML',\n  'CSS',\n  'URI',\n  'SSO',\n  'IP',\n  'TLS',\n  'SSL',\n  'DNS',\n  'TCP',\n  'UDP',\n  'SSH',\n  'JWT',\n  'MFA',\n  'SAML',\n  'SCIM',\n];\n\n// Precompiled regex matching all acronym forms (uppercase + title-case) in a single pass.\nconst GO_ACRONYM_RE = new RegExp(\n  GO_ACRONYMS.flatMap((a) => [a, a.charAt(0) + a.slice(1).toLowerCase()]).join('|'),\n  'g',\n);\n\n/**\n * Normalize a Go type string so that acronym casing differences don't cause\n * false mismatches. Lowercases all known Go acronyms to a canonical form.\n */\nfunction normalizeGoAcronyms(type: string): string {\n  return type.replace(GO_ACRONYM_RE, (match) => match.toLowerCase());\n}\n\nconst goHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    if (type.startsWith('*')) return type.slice(1);\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false;\n  },\n  isGenericTypeParam(type: string): boolean {\n    return type === 'interface{}' || type === 'any';\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'interface{}' || type === 'any';\n  },\n  tolerateCategoryMismatch: false,\n  extractReturnTypeName(returnType: string): string | null {\n    const stripped = returnType.replace(/^\\*/, '').replace(/\\[\\]/, '');\n    return stripped || null;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    const stripped = paramType.replace(/^\\*/, '');\n    if (['string', 'int', 'int64', 'float64', 'bool'].includes(stripped)) return null;\n    return stripped;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    return propertyName.toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(_modelName: string): string[] {\n    // Go SDK does not generate *Response wrapper types — models are returned directly.\n    // Don't derive extra names, as they would create false positives in compat checks\n    // when the live SDK has hand-written response wrappers.\n    return [];\n  },\n  isTypeEquivalent(baselineType: string, candidateType: string, candidateSurface: ApiSurface): boolean {\n    // Normalize Go acronym casing differences (e.g., \"Json\" vs \"JSON\", \"Uri\" vs \"URI\")\n    const normBase = normalizeGoAcronyms(baselineType);\n    const normCand = normalizeGoAcronyms(candidateType);\n    if (normBase === normCand) return true;\n\n    // Also try after stripping nullable wrappers and slice prefixes on both sides\n    const stripType = (t: string) => t.replace(/^\\*/, '').replace(/^\\[\\]/, '');\n    const strippedBase = stripType(normBase);\n    const strippedCand = stripType(normCand);\n    if (strippedBase === strippedCand) return true;\n\n    // Strip package qualifiers (e.g., \"common.RoleResponse\" → \"RoleResponse\")\n    const unqualBase = strippedBase.includes('.') ? strippedBase.split('.').pop()! : strippedBase;\n    const unqualCand = strippedCand.includes('.') ? strippedCand.split('.').pop()! : strippedCand;\n    if (unqualBase === unqualCand) return true;\n\n    // Suffix match: the baseline may use a shorter shared type name while the\n    // generated code prefixes it with the parent struct name.\n    // e.g., baseline \"FactorType\" matches generated \"AuthenticationFactorType\"\n    // Only match if the candidate type actually exists in the generated surface.\n    const candRaw = stripType(candidateType);\n    if (unqualCand.endsWith(unqualBase) && unqualCand.length > unqualBase.length) {\n      const exists =\n        candidateSurface.enums[candRaw] != null ||\n        candidateSurface.interfaces[candRaw] != null ||\n        candidateSurface.classes[candRaw] != null ||\n        candidateSurface.typeAliases[candRaw] != null;\n      if (exists) return true;\n    }\n\n    return false;\n  },\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const goExtractor: Extractor = {\n  language: 'go',\n  hints: goHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    const goFiles = walkGoFiles(sdkPath);\n    if (goFiles.length === 0) {\n      throw new ExtractorError(\n        `No .go files found in ${sdkPath}`,\n        `Ensure the --sdk-path argument points to a Go project root containing .go source files.`,\n      );\n    }\n\n    const allStructs: GoStruct[] = [];\n    const allTypes: GoTypeDecl[] = [];\n    const allFuncs: GoFunc[] = [];\n    const allConsts: GoConst[] = [];\n\n    for (const filePath of goFiles) {\n      const parsed = parseGoFile(filePath, sdkPath);\n      allStructs.push(...parsed.structs);\n      allTypes.push(...parsed.types);\n      allFuncs.push(...parsed.funcs);\n      allConsts.push(...parsed.consts);\n    }\n\n    const { classes, interfaces, typeAliases, enums, exports } = buildSurface(\n      allStructs,\n      allTypes,\n      allFuncs,\n      allConsts,\n    );\n\n    return {\n      language: 'go',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes,\n      interfaces,\n      typeAliases,\n      enums,\n      exports,\n    };\n  },\n};\n","/**\n * Rust source parser — tree-sitter-based extraction of structs, enums,\n * impl blocks, traits, type aliases, and functions from Rust source files.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport Parser from 'tree-sitter';\nimport RustLang from 'tree-sitter-rust';\nimport type { SyntaxNode } from 'tree-sitter';\nimport { safeParse } from '../../utils/tree-sitter.js';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface RustStructField {\n  name: string;\n  type: string;\n  serdeRename?: string;\n  optional: boolean;\n}\n\nexport interface RustStruct {\n  name: string;\n  fields: RustStructField[];\n  sourceFile: string;\n}\n\nexport interface RustEnum {\n  name: string;\n  variants: RustEnumVariant[];\n  sourceFile: string;\n}\n\nexport interface RustEnumVariant {\n  name: string;\n  serdeRename?: string;\n}\n\nexport interface RustFunc {\n  receiverType: string | null;\n  name: string;\n  params: { name: string; type: string }[];\n  returnType: string;\n  isAsync: boolean;\n  sourceFile: string;\n}\n\nexport interface RustTypeAlias {\n  name: string;\n  underlyingType: string;\n  sourceFile: string;\n}\n\nexport interface RustTrait {\n  name: string;\n  methods: RustFunc[];\n  sourceFile: string;\n}\n\n// ---------------------------------------------------------------------------\n// Shared parser instance\n// ---------------------------------------------------------------------------\n\nconst rustParser = new Parser();\nrustParser.setLanguage(RustLang);\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkRustFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === 'target' || entry === 'benches' || entry === 'examples') continue;\n      results.push(...walkRustFiles(fullPath));\n    } else if (entry.endsWith('.rs') && !entry.endsWith('_test.rs')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// Serde attribute helpers\n// ---------------------------------------------------------------------------\n\n/** Extract the serde rename value from an attribute_item preceding a node. */\nfunction extractSerdeRename(attributeNode: SyntaxNode): string | null {\n  const attr = attributeNode.namedChildren.find((c) => c.type === 'attribute');\n  if (!attr) return null;\n\n  const ident = attr.namedChildren.find((c) => c.type === 'identifier');\n  if (!ident || ident.text !== 'serde') return null;\n\n  const tokenTree = attr.namedChildren.find((c) => c.type === 'token_tree');\n  if (!tokenTree) return null;\n\n  const renameIdent = tokenTree.namedChildren.find((c) => c.type === 'identifier' && c.text === 'rename');\n  if (!renameIdent) return null;\n\n  const strLit = tokenTree.namedChildren.find((c) => c.type === 'string_literal');\n  if (!strLit) return null;\n\n  const content = strLit.namedChildren.find((c) => c.type === 'string_content');\n  return content ? content.text : null;\n}\n\n/** Check if a node is preceded by a serde(skip) or serde(skip_serializing) attribute. */\nfunction hasSerdeSkip(attributeNode: SyntaxNode): boolean {\n  const attr = attributeNode.namedChildren.find((c) => c.type === 'attribute');\n  if (!attr) return false;\n\n  const ident = attr.namedChildren.find((c) => c.type === 'identifier');\n  if (!ident || ident.text !== 'serde') return false;\n\n  const tokenTree = attr.namedChildren.find((c) => c.type === 'token_tree');\n  if (!tokenTree) return false;\n\n  return tokenTree.namedChildren.some(\n    (c) => c.type === 'identifier' && (c.text === 'skip' || c.text === 'skip_serializing'),\n  );\n}\n\n/** Check if a type is Option<T> and return the inner type. */\nfunction isOptionType(typeText: string): boolean {\n  return typeText.startsWith('Option<') && typeText.endsWith('>');\n}\n\n/** Check if a node has `pub` visibility. */\nfunction isPublic(node: SyntaxNode): boolean {\n  return node.namedChildren.some((c) => c.type === 'visibility_modifier');\n}\n\n// ---------------------------------------------------------------------------\n// Struct extraction\n// ---------------------------------------------------------------------------\n\nfunction parseStructFields(bodyNode: SyntaxNode): RustStructField[] {\n  const fields: RustStructField[] = [];\n  let pendingAttr: SyntaxNode | null = null;\n\n  for (const child of bodyNode.namedChildren) {\n    if (child.type === 'attribute_item') {\n      pendingAttr = child;\n      continue;\n    }\n\n    if (child.type === 'field_declaration') {\n      // Skip non-pub fields\n      if (!isPublic(child)) {\n        pendingAttr = null;\n        continue;\n      }\n\n      // Skip serde(skip) fields\n      if (pendingAttr && hasSerdeSkip(pendingAttr)) {\n        pendingAttr = null;\n        continue;\n      }\n\n      const nameNode = child.namedChildren.find((c) => c.type === 'field_identifier');\n      const typeNode = child.childForFieldName('type');\n      if (!nameNode || !typeNode) {\n        pendingAttr = null;\n        continue;\n      }\n\n      const fieldName = nameNode.text;\n      const fieldType = typeNode.text;\n      const serdeRename = pendingAttr ? extractSerdeRename(pendingAttr) : null;\n\n      fields.push({\n        name: fieldName,\n        type: fieldType,\n        serdeRename: serdeRename || undefined,\n        optional: isOptionType(fieldType),\n      });\n\n      pendingAttr = null;\n    } else {\n      pendingAttr = null;\n    }\n  }\n  return fields;\n}\n\nexport function parseStructs(tree: Parser.Tree, sourceFile: string): RustStruct[] {\n  const structs: RustStruct[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('struct_item')) {\n    if (!isPublic(node)) continue;\n\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode || bodyNode.type !== 'field_declaration_list') {\n      // Tuple struct or unit struct — no named fields\n      structs.push({ name: nameNode.text, fields: [], sourceFile });\n      continue;\n    }\n\n    structs.push({ name: nameNode.text, fields: parseStructFields(bodyNode), sourceFile });\n  }\n\n  return structs;\n}\n\n// ---------------------------------------------------------------------------\n// Enum extraction\n// ---------------------------------------------------------------------------\n\nexport function parseEnums(tree: Parser.Tree, sourceFile: string): RustEnum[] {\n  const enums: RustEnum[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('enum_item')) {\n    if (!isPublic(node)) continue;\n\n    const nameNode = node.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = node.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    const variants: RustEnumVariant[] = [];\n    let pendingAttr: SyntaxNode | null = null;\n\n    for (const child of bodyNode.namedChildren) {\n      if (child.type === 'attribute_item') {\n        pendingAttr = child;\n        continue;\n      }\n      if (child.type === 'enum_variant') {\n        const variantName = child.childForFieldName('name');\n        if (variantName) {\n          const serdeRename = pendingAttr ? extractSerdeRename(pendingAttr) : null;\n          variants.push({ name: variantName.text, serdeRename: serdeRename || undefined });\n        }\n        pendingAttr = null;\n      } else {\n        pendingAttr = null;\n      }\n    }\n\n    if (variants.length > 0) {\n      enums.push({ name: nameNode.text, variants, sourceFile });\n    }\n  }\n\n  return enums;\n}\n\n// ---------------------------------------------------------------------------\n// Impl & function extraction\n// ---------------------------------------------------------------------------\n\nfunction parseParams(paramsNode: SyntaxNode): { name: string; type: string }[] {\n  const params: { name: string; type: string }[] = [];\n\n  for (const child of paramsNode.namedChildren) {\n    if (child.type === 'self_parameter') continue; // skip &self, &mut self\n\n    if (child.type === 'parameter') {\n      const patternNode = child.childForFieldName('pattern');\n      const typeNode = child.childForFieldName('type');\n      if (patternNode && typeNode) {\n        params.push({ name: patternNode.text, type: typeNode.text });\n      }\n    }\n  }\n\n  return params;\n}\n\nfunction extractReturnType(funcNode: SyntaxNode): string {\n  const retNode = funcNode.childForFieldName('return_type');\n  if (!retNode) return '()';\n  return retNode.text;\n}\n\nfunction isAsyncFunc(funcNode: SyntaxNode): boolean {\n  return funcNode.namedChildren.some((c) => c.type === 'function_modifiers' && c.text.includes('async'));\n}\n\nexport function parseImplBlocks(tree: Parser.Tree, sourceFile: string): RustFunc[] {\n  const funcs: RustFunc[] = [];\n\n  for (const implNode of tree.rootNode.descendantsOfType('impl_item')) {\n    const typeNode = implNode.childForFieldName('type');\n    if (!typeNode) continue;\n    const receiverType = typeNode.text;\n\n    const bodyNode = implNode.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    for (const child of bodyNode.namedChildren) {\n      if (child.type !== 'function_item') continue;\n      if (!isPublic(child)) continue;\n\n      const nameNode = child.childForFieldName('name');\n      if (!nameNode) continue;\n\n      const paramsNode = child.childForFieldName('parameters');\n\n      funcs.push({\n        receiverType,\n        name: nameNode.text,\n        params: paramsNode ? parseParams(paramsNode) : [],\n        returnType: extractReturnType(child),\n        isAsync: isAsyncFunc(child),\n        sourceFile,\n      });\n    }\n  }\n\n  return funcs;\n}\n\n// ---------------------------------------------------------------------------\n// Trait extraction\n// ---------------------------------------------------------------------------\n\nexport function parseTraits(tree: Parser.Tree, sourceFile: string): RustTrait[] {\n  const traits: RustTrait[] = [];\n\n  for (const traitNode of tree.rootNode.descendantsOfType('trait_item')) {\n    if (!isPublic(traitNode)) continue;\n\n    const nameNode = traitNode.childForFieldName('name');\n    if (!nameNode) continue;\n\n    const bodyNode = traitNode.childForFieldName('body');\n    if (!bodyNode) continue;\n\n    const methods: RustFunc[] = [];\n\n    for (const child of bodyNode.namedChildren) {\n      // Trait methods appear as function_signature_item (no body)\n      if (child.type !== 'function_signature_item' && child.type !== 'function_item') continue;\n\n      const methodName = child.childForFieldName('name');\n      if (!methodName) continue;\n\n      const paramsNode = child.childForFieldName('parameters');\n\n      methods.push({\n        receiverType: null,\n        name: methodName.text,\n        params: paramsNode ? parseParams(paramsNode) : [],\n        returnType: extractReturnType(child),\n        isAsync: isAsyncFunc(child),\n        sourceFile,\n      });\n    }\n\n    if (methods.length > 0) {\n      traits.push({ name: nameNode.text, methods, sourceFile });\n    }\n  }\n\n  return traits;\n}\n\n// ---------------------------------------------------------------------------\n// Type alias extraction\n// ---------------------------------------------------------------------------\n\nexport function parseTypeAliases(tree: Parser.Tree, sourceFile: string): RustTypeAlias[] {\n  const aliases: RustTypeAlias[] = [];\n\n  for (const node of tree.rootNode.descendantsOfType('type_item')) {\n    if (!isPublic(node)) continue;\n\n    const nameNode = node.childForFieldName('name');\n    const typeNode = node.childForFieldName('type');\n    if (!nameNode || !typeNode) continue;\n\n    aliases.push({ name: nameNode.text, underlyingType: typeNode.text, sourceFile });\n  }\n\n  return aliases;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\nexport interface ParsedRustFile {\n  structs: RustStruct[];\n  enums: RustEnum[];\n  funcs: RustFunc[];\n  traits: RustTrait[];\n  typeAliases: RustTypeAlias[];\n}\n\nexport function parseRustFile(filePath: string, sdkPath: string): ParsedRustFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const tree = safeParse(rustParser, source);\n\n  return {\n    structs: parseStructs(tree, relPath),\n    enums: parseEnums(tree, relPath),\n    funcs: parseImplBlocks(tree, relPath),\n    traits: parseTraits(tree, relPath),\n    typeAliases: parseTypeAliases(tree, relPath),\n  };\n}\n","/**\n * Rust surface builder — transforms parsed Rust symbols into an ApiSurface.\n *\n * Mapping:\n *   pub struct + impl methods → ApiClass\n *   pub struct (no methods)   → ApiInterface (data-only)\n *   pub enum                  → ApiEnum (serde renames as member values)\n *   pub type X = Y            → ApiTypeAlias\n *   pub trait                 → ApiClass (trait methods as API surface)\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n} from '../types.js';\nimport type { RustStruct, RustEnum, RustFunc, RustTrait, RustTypeAlias as RustTypeAliasType } from './rust-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction rustTypeToString(t: string): string {\n  return t;\n}\n\n/** Strip Result<T, E> to just T. */\nfunction unwrapResultType(returnType: string): string {\n  const match = returnType.match(/^Result\\s*<\\s*(.+)\\s*,\\s*.+\\s*>$/);\n  if (match) return match[1].trim();\n  return returnType;\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allStructs: RustStruct[],\n  allEnums: RustEnum[],\n  allFuncs: RustFunc[],\n  allTraits: RustTrait[],\n  allTypeAliases: RustTypeAliasType[],\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  typeAliases: Record<string, ApiTypeAlias>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const typeAliases: Record<string, ApiTypeAlias> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  // Group impl methods by receiver type\n  const methodsByReceiver = new Map<string, RustFunc[]>();\n  for (const fn of allFuncs) {\n    if (!fn.receiverType) continue;\n    if (!methodsByReceiver.has(fn.receiverType)) methodsByReceiver.set(fn.receiverType, []);\n    methodsByReceiver.get(fn.receiverType)!.push(fn);\n  }\n\n  // Process structs\n  for (const s of allStructs) {\n    const methods = methodsByReceiver.get(s.name);\n\n    if (methods && methods.length > 0) {\n      // Struct with impl methods → ApiClass\n      const apiMethods: Record<string, ApiMethod[]> = {};\n      const properties: Record<string, ApiProperty> = {};\n\n      for (const field of s.fields) {\n        const fieldName = field.serdeRename || field.name;\n        properties[fieldName] = {\n          name: fieldName,\n          type: rustTypeToString(field.type),\n          readonly: false,\n        };\n      }\n\n      for (const fn of methods) {\n        const params: ApiParam[] = fn.params.map((p) => ({\n          name: p.name,\n          type: rustTypeToString(p.type),\n          optional: p.type.startsWith('Option<'),\n          passingStyle: 'positional' as const,\n        }));\n        const returnType = unwrapResultType(fn.returnType);\n        if (!apiMethods[fn.name]) apiMethods[fn.name] = [];\n        apiMethods[fn.name].push({\n          name: fn.name,\n          params,\n          returnType: rustTypeToString(returnType),\n          async: fn.isAsync,\n        });\n      }\n\n      classes[s.name] = {\n        name: s.name,\n        sourceFile: s.sourceFile,\n        methods: sortRecord(apiMethods),\n        properties: sortRecord(properties),\n        constructorParams: [],\n      };\n    } else {\n      // Struct without methods → ApiInterface\n      const fields: Record<string, ApiField> = {};\n      for (const field of s.fields) {\n        const fieldName = field.serdeRename || field.name;\n        fields[fieldName] = {\n          name: fieldName,\n          type: rustTypeToString(field.type),\n          optional: field.optional,\n        };\n      }\n      interfaces[s.name] = {\n        name: s.name,\n        sourceFile: s.sourceFile,\n        fields: sortRecord(fields),\n        extends: [],\n      };\n    }\n  }\n\n  // Process enums\n  for (const e of allEnums) {\n    const members: Record<string, string | number> = {};\n    for (const v of e.variants) {\n      members[v.name] = v.serdeRename || v.name;\n    }\n    enums[e.name] = { name: e.name, sourceFile: e.sourceFile, members: sortRecord(members) };\n  }\n\n  // Process type aliases\n  for (const ta of allTypeAliases) {\n    typeAliases[ta.name] = { name: ta.name, sourceFile: ta.sourceFile, value: rustTypeToString(ta.underlyingType) };\n  }\n\n  // Process traits → ApiClass (trait methods define the API contract)\n  for (const trait of allTraits) {\n    const apiMethods: Record<string, ApiMethod[]> = {};\n\n    for (const fn of trait.methods) {\n      const params: ApiParam[] = fn.params.map((p) => ({\n        name: p.name,\n        type: rustTypeToString(p.type),\n        optional: p.type.startsWith('Option<'),\n      }));\n      const returnType = unwrapResultType(fn.returnType);\n      if (!apiMethods[fn.name]) apiMethods[fn.name] = [];\n      apiMethods[fn.name].push({\n        name: fn.name,\n        params,\n        returnType: rustTypeToString(returnType),\n        async: fn.isAsync,\n      });\n    }\n\n    classes[trait.name] = {\n      name: trait.name,\n      sourceFile: trait.sourceFile,\n      methods: sortRecord(apiMethods),\n      properties: {},\n      constructorParams: [],\n    };\n  }\n\n  // Build export map\n  const collector = new ExportCollector();\n\n  for (const [name, cls] of Object.entries(classes)) if (cls.sourceFile) collector.add(cls.sourceFile, name);\n  for (const [name, iface] of Object.entries(interfaces)) if (iface.sourceFile) collector.add(iface.sourceFile, name);\n  for (const [name, ta] of Object.entries(typeAliases)) if (ta.sourceFile) collector.add(ta.sourceFile, name);\n  for (const [name, en] of Object.entries(enums)) if (en.sourceFile) collector.add(en.sourceFile, name);\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    typeAliases: sortRecord(typeAliases),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * Rust API surface extractor.\n *\n * Walks `.rs` files under `src/`, parses pub structs, enums, impl blocks,\n * traits, and type aliases, then builds an ApiSurface.\n *\n * Parser:  `rust-parser.ts`  — tree-sitter-based Rust source analysis\n * Surface: `rust-surface.ts` — ApiSurface construction\n */\n\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkRustFiles, parseRustFile } from './rust-parser.js';\nimport { buildSurface } from './rust-surface.js';\nimport type { RustStruct, RustEnum, RustFunc, RustTrait, RustTypeAlias } from './rust-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst rustHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    const match = type.match(/^Option<(.+)>$/);\n    return match ? match[1] : null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false; // Rust doesn't have union types in the TS sense\n  },\n  isGenericTypeParam(type: string): boolean {\n    // Single uppercase letter or T-prefixed: T, U, V, TResult\n    return /^[A-Z]$/.test(type) || /^T[A-Z][a-zA-Z]*$/.test(type);\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'serde_json::Value' || type === 'Box<dyn std::error::Error>';\n  },\n  tolerateCategoryMismatch: false,\n  extractReturnTypeName(returnType: string): string | null {\n    // Unwrap Result<T, E> → T, Vec<T> → T, Option<T> → T\n    let inner = returnType;\n    const resultMatch = inner.match(/^Result\\s*<\\s*(.+)\\s*,\\s*.+\\s*>$/);\n    if (resultMatch) inner = resultMatch[1].trim();\n    const vecMatch = inner.match(/^Vec\\s*<\\s*(.+)\\s*>$/);\n    if (vecMatch) inner = vecMatch[1].trim();\n    const optMatch = inner.match(/^Option\\s*<\\s*(.+)\\s*>$/);\n    if (optMatch) inner = optMatch[1].trim();\n    // Strip references\n    inner = inner.replace(/^&(?:mut\\s+)?(?:'[a-z]+\\s+)?/, '');\n    if (['()', 'String', 'str', 'bool', 'i32', 'i64', 'u32', 'u64', 'f32', 'f64', 'usize'].includes(inner)) {\n      return null;\n    }\n    return inner;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    let inner = paramType.replace(/^&(?:mut\\s+)?(?:'[a-z]+\\s+)?/, '');\n    if (['String', '&str', 'str', 'bool', 'i32', 'i64', 'u32', 'u64', 'f32', 'f64', 'usize'].includes(inner)) {\n      return null;\n    }\n    return inner;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    // snake_case property vs PascalCase class\n    const normalized = propertyName.replace(/_/g, '').toLowerCase();\n    return normalized === className.toLowerCase();\n  },\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const rustExtractor: Extractor = {\n  language: 'rust',\n  hints: rustHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    const rsFiles = walkRustFiles(sdkPath);\n    if (rsFiles.length === 0) {\n      throw new ExtractorError(\n        `No .rs files found in ${sdkPath}`,\n        `Ensure the --sdk-path argument points to a Rust project root containing .rs source files.`,\n      );\n    }\n\n    const allStructs: RustStruct[] = [];\n    const allEnums: RustEnum[] = [];\n    const allFuncs: RustFunc[] = [];\n    const allTraits: RustTrait[] = [];\n    const allTypeAliases: RustTypeAlias[] = [];\n\n    for (const filePath of rsFiles) {\n      const parsed = parseRustFile(filePath, sdkPath);\n      allStructs.push(...parsed.structs);\n      allEnums.push(...parsed.enums);\n      allFuncs.push(...parsed.funcs);\n      allTraits.push(...parsed.traits);\n      allTypeAliases.push(...parsed.typeAliases);\n    }\n\n    const { classes, interfaces, typeAliases, enums, exports } = buildSurface(\n      allStructs,\n      allEnums,\n      allFuncs,\n      allTraits,\n      allTypeAliases,\n    );\n\n    return {\n      language: 'rust',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes,\n      interfaces,\n      typeAliases,\n      enums,\n      exports,\n    };\n  },\n};\n","/**\n * Kotlin source parser — regex-based extraction of classes, data classes,\n * enum classes, functions, and type aliases from Kotlin source files.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface KotlinField {\n  name: string;\n  type: string;\n  jsonName?: string;\n  optional: boolean;\n}\n\nexport interface KotlinDataClass {\n  name: string;\n  fields: KotlinField[];\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface KotlinClass {\n  name: string;\n  constructorParams: { name: string; type: string }[];\n  methods: KotlinMethod[];\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface KotlinMethod {\n  name: string;\n  params: { name: string; type: string; optional: boolean }[];\n  returnType: string;\n  visibility: string;\n}\n\nexport interface KotlinEnum {\n  name: string;\n  members: Record<string, string>;\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface KotlinTypeAlias {\n  name: string;\n  value: string;\n  sourceFile: string;\n  packageName: string;\n}\n\nexport interface ParsedKotlinFile {\n  dataClasses: KotlinDataClass[];\n  classes: KotlinClass[];\n  enums: KotlinEnum[];\n  typeAliases: KotlinTypeAlias[];\n}\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkKotlinFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === 'build' || entry === 'test' || entry === 'androidTest') continue;\n      results.push(...walkKotlinFiles(fullPath));\n    } else if (entry.endsWith('.kt') && !entry.endsWith('Test.kt')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Extract the package name from a Kotlin source file. */\nfunction extractPackageName(source: string): string {\n  const match = source.match(/^package\\s+([\\w.]+)/m);\n  return match ? match[1] : 'unknown';\n}\n\n/** Strip single-line and block comments from source to avoid false matches. */\nfunction stripComments(source: string): string {\n  // Remove block comments\n  let result = source.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n  // Remove single-line comments\n  result = result.replace(/\\/\\/[^\\n]*/g, '');\n  return result;\n}\n\n/**\n * Extract the @JsonProperty(\"name\") annotation value before a parameter.\n * Looks for the pattern immediately preceding the parameter declaration.\n */\nfunction extractJsonPropertyName(text: string): string | null {\n  const match = text.match(/@JsonProperty\\(\"([^\"]+)\"\\)/);\n  return match ? match[1] : null;\n}\n\n/**\n * Parse constructor parameters from a data class or class declaration.\n * Handles multi-line parameter lists with annotations.\n */\nfunction parseConstructorParams(paramsBlock: string): KotlinField[] {\n  const fields: KotlinField[] = [];\n\n  // Split by top-level commas (not nested in angle brackets or parens)\n  const params = splitTopLevelCommas(paramsBlock);\n\n  for (const param of params) {\n    const trimmed = param.trim();\n    if (!trimmed) continue;\n\n    // Extract JsonProperty annotation if present\n    const jsonName = extractJsonPropertyName(trimmed);\n\n    // Match val/var name: Type pattern, possibly with default value\n    const paramMatch = trimmed.match(\n      /(?:(?:override|private|protected)\\s+)?(?:val|var)\\s+(\\w+)\\s*:\\s*([^=,]+?)(?:\\s*=\\s*(.+))?$/m,\n    );\n    if (!paramMatch) continue;\n\n    const name = paramMatch[1];\n    const rawType = paramMatch[2].trim();\n    const hasDefault = paramMatch[3] !== undefined;\n\n    // Check if the type is nullable (ends with ?)\n    const isNullable = rawType.endsWith('?');\n    const type = rawType;\n\n    fields.push({\n      name,\n      type,\n      jsonName: jsonName || undefined,\n      optional: isNullable || hasDefault,\n    });\n  }\n\n  return fields;\n}\n\n/** Split a string by top-level commas, ignoring commas inside angle brackets, parens, or strings. */\nfunction splitTopLevelCommas(text: string): string[] {\n  const result: string[] = [];\n  let depth = 0;\n  let current = '';\n  let inString = false;\n  let stringChar = '';\n\n  for (let i = 0; i < text.length; i++) {\n    const ch = text[i];\n\n    if (inString) {\n      current += ch;\n      if (ch === stringChar && text[i - 1] !== '\\\\') {\n        inString = false;\n      }\n      continue;\n    }\n\n    if (ch === '\"' || ch === \"'\") {\n      inString = true;\n      stringChar = ch;\n      current += ch;\n      continue;\n    }\n\n    if (ch === '<' || ch === '(' || ch === '[') {\n      depth++;\n      current += ch;\n    } else if (ch === '>' || ch === ')' || ch === ']') {\n      depth--;\n      current += ch;\n    } else if (ch === ',' && depth === 0) {\n      result.push(current);\n      current = '';\n    } else {\n      current += ch;\n    }\n  }\n\n  if (current.trim()) {\n    result.push(current);\n  }\n\n  return result;\n}\n\n// ---------------------------------------------------------------------------\n// Enum extraction\n// ---------------------------------------------------------------------------\n\nfunction parseEnumClass(source: string, sourceFile: string, packageName: string): KotlinEnum[] {\n  const enums: KotlinEnum[] = [];\n\n  // Match: enum class Name(@JsonValue val value: Type) { Member1(\"val1\"), Member2(\"val2\") }\n  const enumRegex = /enum\\s+class\\s+(\\w+)(?:\\([^)]*\\))?\\s*\\{([^}]*)\\}/g;\n  let match;\n  while ((match = enumRegex.exec(source)) !== null) {\n    const name = match[1];\n    const body = match[2];\n\n    const members: Record<string, string> = {};\n\n    // Match enum members: MemberName(\"value\") or MemberName\n    const memberRegex = /(\\w+)\\s*(?:\\(\"([^\"]*)\"\\))?/g;\n    let memberMatch;\n    while ((memberMatch = memberRegex.exec(body)) !== null) {\n      const memberName = memberMatch[1];\n      // Skip keywords that might match\n      if (['val', 'var', 'fun', 'override', 'companion', 'object'].includes(memberName)) continue;\n      const memberValue = memberMatch[2] !== undefined ? memberMatch[2] : memberName;\n      members[memberName] = memberValue;\n    }\n\n    if (Object.keys(members).length > 0) {\n      enums.push({ name, members, sourceFile, packageName });\n    }\n  }\n\n  return enums;\n}\n\n// ---------------------------------------------------------------------------\n// Data class extraction\n// ---------------------------------------------------------------------------\n\nfunction parseDataClasses(source: string, sourceFile: string, packageName: string): KotlinDataClass[] {\n  const dataClasses: KotlinDataClass[] = [];\n\n  // Match: data class Name(params) or data class Name @Annotation constructor(params)\n  // Use a regex that captures the opening paren, then find the matching close\n  const dataClassStartRegex = /data\\s+class\\s+(\\w+)\\s*(?:@\\w+(?:\\([^)]*\\))?\\s+)?(?:constructor\\s*)?\\(/g;\n  let match;\n  while ((match = dataClassStartRegex.exec(source)) !== null) {\n    const name = match[1];\n    const startIdx = match.index + match[0].length;\n\n    // Find matching closing paren\n    let depth = 1;\n    let idx = startIdx;\n    while (idx < source.length && depth > 0) {\n      if (source[idx] === '(') depth++;\n      else if (source[idx] === ')') depth--;\n      idx++;\n    }\n\n    const paramsBlock = source.slice(startIdx, idx - 1);\n    const fields = parseConstructorParams(paramsBlock);\n\n    dataClasses.push({ name, fields, sourceFile, packageName });\n  }\n\n  return dataClasses;\n}\n\n// ---------------------------------------------------------------------------\n// Class extraction (non-data classes)\n// ---------------------------------------------------------------------------\n\nfunction parseClasses(source: string, sourceFile: string, packageName: string): KotlinClass[] {\n  const classes: KotlinClass[] = [];\n\n  // Match non-data, non-enum classes: class Name(params) { body }\n  // Skip abstract, sealed, and open classes that aren't services\n  const classStartRegex =\n    /(?<!data\\s)(?<!enum\\s)(?<!abstract\\s)(?<!sealed\\s)(?:open\\s+)?class\\s+(\\w+)\\s*(?:\\(([^)]*)\\))?\\s*(?::\\s*[^{]+)?\\s*\\{/g;\n  let match;\n  while ((match = classStartRegex.exec(source)) !== null) {\n    const name = match[1];\n    const constructorBlock = match[2] || '';\n\n    // Find matching closing brace for the class body\n    const braceStart = source.indexOf('{', match.index + match[0].length - 1);\n    let depth = 1;\n    let idx = braceStart + 1;\n    while (idx < source.length && depth > 0) {\n      if (source[idx] === '{') depth++;\n      else if (source[idx] === '}') depth--;\n      idx++;\n    }\n\n    const classBody = source.slice(braceStart + 1, idx - 1);\n\n    // Parse constructor params\n    const constructorParams: { name: string; type: string }[] = [];\n    if (constructorBlock.trim()) {\n      const params = splitTopLevelCommas(constructorBlock);\n      for (const param of params) {\n        const trimmed = param.trim();\n        const paramMatch = trimmed.match(/(?:(?:private|protected)\\s+)?(?:val|var)\\s+(\\w+)\\s*:\\s*(.+)/);\n        if (paramMatch) {\n          constructorParams.push({ name: paramMatch[1], type: paramMatch[2].trim() });\n        }\n      }\n    }\n\n    // Parse methods\n    const methods = parseMethods(classBody);\n\n    if (methods.length > 0) {\n      classes.push({ name, constructorParams, methods, sourceFile, packageName });\n    }\n  }\n\n  return classes;\n}\n\n/** Parse method declarations from a class body. */\nfunction parseMethods(classBody: string): KotlinMethod[] {\n  const methods: KotlinMethod[] = [];\n\n  // Match: fun methodName(params): ReturnType or fun methodName(params)\n  // Handle suspend fun, private fun, etc.\n  const methodRegex =\n    /(private|protected|internal|public)?\\s*(?:suspend\\s+)?fun\\s+(\\w+)\\s*\\(([^)]*)\\)\\s*(?::\\s*([^\\s{]+))?/g;\n  let match;\n  while ((match = methodRegex.exec(classBody)) !== null) {\n    const visibility = match[1] || 'public';\n    const name = match[2];\n    const paramsStr = match[3];\n    const returnType = match[4] || 'Unit';\n\n    // Skip private/protected methods\n    if (visibility === 'private' || visibility === 'protected') continue;\n\n    const params: { name: string; type: string; optional: boolean }[] = [];\n    if (paramsStr.trim()) {\n      const paramParts = splitTopLevelCommas(paramsStr);\n      for (const part of paramParts) {\n        const trimmed = part.trim();\n        const paramMatch = trimmed.match(/(\\w+)\\s*:\\s*([^=]+?)(?:\\s*=\\s*(.+))?$/);\n        if (paramMatch) {\n          const paramType = paramMatch[2].trim();\n          const hasDefault = paramMatch[3] !== undefined;\n          params.push({\n            name: paramMatch[1],\n            type: paramType,\n            optional: paramType.endsWith('?') || hasDefault,\n          });\n        }\n      }\n    }\n\n    methods.push({ name, params, returnType, visibility });\n  }\n\n  return methods;\n}\n\n// ---------------------------------------------------------------------------\n// Type alias extraction\n// ---------------------------------------------------------------------------\n\nfunction parseTypeAliases(source: string, sourceFile: string, packageName: string): KotlinTypeAlias[] {\n  const aliases: KotlinTypeAlias[] = [];\n\n  const aliasRegex = /typealias\\s+(\\w+)\\s*=\\s*([^\\n]+)/g;\n  let match;\n  while ((match = aliasRegex.exec(source)) !== null) {\n    aliases.push({\n      name: match[1],\n      value: match[2].trim(),\n      sourceFile,\n      packageName,\n    });\n  }\n\n  return aliases;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\n/** Parse a single Kotlin source file and return all extracted symbols. */\nexport function parseKotlinFile(filePath: string, sdkPath: string): ParsedKotlinFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const cleaned = stripComments(source);\n  const packageName = extractPackageName(cleaned);\n\n  return {\n    dataClasses: parseDataClasses(cleaned, relPath, packageName),\n    classes: parseClasses(cleaned, relPath, packageName),\n    enums: parseEnumClass(cleaned, relPath, packageName),\n    typeAliases: parseTypeAliases(cleaned, relPath, packageName),\n  };\n}\n","/**\n * Kotlin surface builder — transforms parsed Kotlin symbols into an ApiSurface.\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n} from '../types.js';\nimport type { KotlinDataClass, KotlinClass, KotlinEnum, KotlinTypeAlias } from './kotlin-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allDataClasses: KotlinDataClass[],\n  allClasses: KotlinClass[],\n  allEnums: KotlinEnum[],\n  allTypeAliases: KotlinTypeAlias[],\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  typeAliases: Record<string, ApiTypeAlias>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const typeAliases: Record<string, ApiTypeAlias> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  const collector = new ExportCollector();\n\n  // Process data classes as interfaces (they represent data models)\n  for (const dc of allDataClasses) {\n    const fields: Record<string, ApiField> = {};\n    for (const field of dc.fields) {\n      const fieldName = field.jsonName || field.name;\n      fields[fieldName] = {\n        name: fieldName,\n        type: field.type,\n        optional: field.optional,\n      };\n    }\n    interfaces[dc.name] = {\n      name: dc.name,\n      sourceFile: dc.sourceFile,\n      fields: sortRecord(fields),\n      extends: [],\n    };\n    collector.add(dc.sourceFile, dc.name);\n  }\n\n  // Process classes (service classes with methods)\n  for (const cls of allClasses) {\n    const methods: Record<string, ApiMethod[]> = {};\n    const properties: Record<string, ApiProperty> = {};\n\n    for (const method of cls.methods) {\n      const params: ApiParam[] = method.params.map((p) => ({\n        name: p.name,\n        type: p.type,\n        optional: p.optional,\n        passingStyle: 'named' as const,\n      }));\n\n      if (!methods[method.name]) methods[method.name] = [];\n      methods[method.name].push({\n        name: method.name,\n        params,\n        returnType: method.returnType,\n        async: false,\n      });\n    }\n\n    const constructorParams: ApiParam[] = cls.constructorParams.map((p) => ({\n      name: p.name,\n      type: p.type,\n      optional: false,\n      passingStyle: 'named' as const,\n    }));\n\n    classes[cls.name] = {\n      name: cls.name,\n      sourceFile: cls.sourceFile,\n      methods: sortRecord(methods),\n      properties: sortRecord(properties),\n      constructorParams,\n    };\n    collector.add(cls.sourceFile, cls.name);\n  }\n\n  // Process enums\n  for (const en of allEnums) {\n    enums[en.name] = {\n      name: en.name,\n      sourceFile: en.sourceFile,\n      members: sortRecord(en.members),\n    };\n    collector.add(en.sourceFile, en.name);\n  }\n\n  // Process type aliases\n  for (const ta of allTypeAliases) {\n    typeAliases[ta.name] = {\n      name: ta.name,\n      sourceFile: ta.sourceFile,\n      value: ta.value,\n    };\n    collector.add(ta.sourceFile, ta.name);\n  }\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    typeAliases: sortRecord(typeAliases),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * Kotlin API surface extractor.\n *\n * Walks `.kt` files (excluding test files and build directories), parses\n * data classes, classes, enum classes, and type aliases, then builds an\n * `ApiSurface`.\n *\n * Parser:  `kotlin-parser.ts`  — regex-based Kotlin source analysis\n * Surface: `kotlin-surface.ts` — ApiSurface construction\n */\n\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkKotlinFiles, parseKotlinFile } from './kotlin-parser.js';\nimport { buildSurface } from './kotlin-surface.js';\nimport type { KotlinDataClass, KotlinClass, KotlinEnum, KotlinTypeAlias } from './kotlin-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst kotlinHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    if (type.endsWith('?')) return type.slice(0, -1);\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false; // Kotlin doesn't have union types\n  },\n  isGenericTypeParam(type: string): boolean {\n    return /^[A-Z]$/.test(type) || /^T[A-Z][a-zA-Z]*$/.test(type);\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'Any' || type === 'Any?';\n  },\n  tolerateCategoryMismatch: true,\n  extractReturnTypeName(returnType: string): string | null {\n    let inner = returnType;\n    // Unwrap nullable\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    // Unwrap List<T> → T\n    const listMatch = inner.match(/^(?:List|MutableList|ArrayList)<(.+)>$/);\n    if (listMatch) inner = listMatch[1];\n    // Unwrap PaginatedList<T> → T\n    const paginatedMatch = inner.match(/^PaginatedList<(.+)>$/);\n    if (paginatedMatch) inner = paginatedMatch[1];\n    // Primitives\n    if (['String', 'Int', 'Long', 'Float', 'Double', 'Boolean', 'Unit', 'Void'].includes(inner)) return null;\n    return inner;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    let inner = paramType;\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    if (['String', 'Int', 'Long', 'Float', 'Double', 'Boolean'].includes(inner)) return null;\n    return inner;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    // camelCase property vs PascalCase class\n    return propertyName.toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const kotlinExtractor: Extractor = {\n  language: 'kotlin',\n  hints: kotlinHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    const ktFiles = walkKotlinFiles(sdkPath);\n    if (ktFiles.length === 0) {\n      throw new ExtractorError(\n        `No .kt files found in ${sdkPath}`,\n        `Ensure the --sdk-path argument points to a Kotlin project root containing .kt source files.`,\n      );\n    }\n\n    const allDataClasses: KotlinDataClass[] = [];\n    const allClasses: KotlinClass[] = [];\n    const allEnums: KotlinEnum[] = [];\n    const allTypeAliases: KotlinTypeAlias[] = [];\n\n    for (const filePath of ktFiles) {\n      const parsed = parseKotlinFile(filePath, sdkPath);\n      allDataClasses.push(...parsed.dataClasses);\n      allClasses.push(...parsed.classes);\n      allEnums.push(...parsed.enums);\n      allTypeAliases.push(...parsed.typeAliases);\n    }\n\n    const { classes, interfaces, typeAliases, enums, exports } = buildSurface(\n      allDataClasses,\n      allClasses,\n      allEnums,\n      allTypeAliases,\n    );\n\n    return {\n      language: 'kotlin',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes,\n      interfaces,\n      typeAliases,\n      enums,\n      exports,\n    };\n  },\n};\n","/**\n * C# (.NET) source parser — regex-based extraction of classes, enums,\n * properties, and methods from C# source files.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface CSharpProperty {\n  name: string;\n  type: string;\n  jsonName?: string;\n  readonly: boolean;\n}\n\nexport interface CSharpMethod {\n  name: string;\n  params: { name: string; type: string; optional: boolean }[];\n  returnType: string;\n  visibility: string;\n  isAsync: boolean;\n}\n\nexport interface CSharpClass {\n  name: string;\n  namespace: string;\n  properties: CSharpProperty[];\n  methods: CSharpMethod[];\n  constructorParams: { name: string; type: string }[];\n  isService: boolean;\n  sourceFile: string;\n}\n\nexport interface CSharpEnum {\n  name: string;\n  namespace: string;\n  members: Record<string, string>;\n  sourceFile: string;\n}\n\nexport interface ParsedCSharpFile {\n  classes: CSharpClass[];\n  enums: CSharpEnum[];\n}\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkCSharpFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === 'bin' || entry === 'obj' || entry === 'test' || entry === 'tests') {\n        continue;\n      }\n      results.push(...walkCSharpFiles(fullPath));\n    } else if (entry.endsWith('.cs') && !entry.endsWith('Test.cs') && !entry.endsWith('Tests.cs')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Extract the namespace from a C# source file. */\nfunction extractNamespace(source: string): string {\n  // File-scoped namespace (C# 10+): namespace Foo.Bar;\n  const fileScopedMatch = source.match(/^namespace\\s+([\\w.]+)\\s*;/m);\n  if (fileScopedMatch) return fileScopedMatch[1];\n\n  // Block-scoped namespace: namespace Foo.Bar { ... }\n  const blockMatch = source.match(/^namespace\\s+([\\w.]+)\\s*\\{/m);\n  if (blockMatch) return blockMatch[1];\n\n  return 'unknown';\n}\n\n/** Strip single-line and block comments from source. */\nfunction stripComments(source: string): string {\n  let result = source.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n  result = result.replace(/\\/\\/[^\\n]*/g, '');\n  return result;\n}\n\n/** Extract [JsonProperty(\"name\")] value from text preceding a property. */\nfunction extractJsonPropertyName(text: string): string | null {\n  const match = text.match(/\\[JsonProperty\\(\"([^\"]+)\"\\)\\]/);\n  return match ? match[1] : null;\n}\n\n/** Extract [EnumMember(Value = \"name\")] value from text. */\nfunction extractEnumMemberValue(text: string): string | null {\n  const match = text.match(/\\[EnumMember\\(Value\\s*=\\s*\"([^\"]+)\"\\)\\]/);\n  return match ? match[1] : null;\n}\n\n// ---------------------------------------------------------------------------\n// Enum extraction\n// ---------------------------------------------------------------------------\n\nfunction parseEnums(source: string, sourceFile: string): CSharpEnum[] {\n  const enums: CSharpEnum[] = [];\n  const ns = extractNamespace(source);\n\n  // Match: public enum Name { ... }\n  const enumRegex = /public\\s+enum\\s+(\\w+)\\s*\\{([^}]*)\\}/g;\n  let match;\n  while ((match = enumRegex.exec(source)) !== null) {\n    const name = match[1];\n    const body = match[2];\n    const members: Record<string, string> = {};\n\n    // Split by commas and extract each member\n    const lines = body.split(',');\n    for (const line of lines) {\n      const trimmed = line.trim();\n      if (!trimmed) continue;\n\n      const enumValue = extractEnumMemberValue(trimmed);\n      const memberNameMatch = trimmed.match(/(\\w+)\\s*$/);\n      if (memberNameMatch) {\n        const memberName = memberNameMatch[1];\n        members[memberName] = enumValue || memberName;\n      }\n    }\n\n    if (Object.keys(members).length > 0) {\n      enums.push({ name, namespace: ns, members, sourceFile });\n    }\n  }\n\n  return enums;\n}\n\n// ---------------------------------------------------------------------------\n// Class extraction\n// ---------------------------------------------------------------------------\n\nfunction parseClasses(source: string, sourceFile: string): CSharpClass[] {\n  const classes: CSharpClass[] = [];\n  const ns = extractNamespace(source);\n\n  // Match: public class Name { ... } — need to handle nested braces\n  const classStartRegex = /public\\s+class\\s+(\\w+)(?:\\s*:\\s*[\\w.,\\s<>]+)?\\s*\\{/g;\n  let match;\n  while ((match = classStartRegex.exec(source)) !== null) {\n    const name = match[1];\n    const braceStart = source.indexOf('{', match.index + match[0].length - 1);\n\n    // Find matching closing brace\n    let depth = 1;\n    let idx = braceStart + 1;\n    while (idx < source.length && depth > 0) {\n      if (source[idx] === '{') depth++;\n      else if (source[idx] === '}') depth--;\n      idx++;\n    }\n\n    const classBody = source.slice(braceStart + 1, idx - 1);\n\n    // Parse properties\n    const properties = parseProperties(classBody);\n\n    // Parse methods\n    const methods = parseMethods(classBody);\n\n    // Parse constructor params\n    const constructorParams = parseConstructor(classBody, name);\n\n    // A class is a \"service\" if it has methods\n    const isService = methods.length > 0;\n\n    classes.push({\n      name,\n      namespace: ns,\n      properties,\n      methods,\n      constructorParams,\n      isService,\n      sourceFile,\n    });\n  }\n\n  return classes;\n}\n\n/** Parse properties from a class body. */\nfunction parseProperties(classBody: string): CSharpProperty[] {\n  const properties: CSharpProperty[] = [];\n\n  // Split into lines so we can look at annotations on the line above\n  const lines = classBody.split('\\n');\n  let pendingJsonName: string | null = null;\n\n  for (const line of lines) {\n    const trimmed = line.trim();\n\n    // Check for JsonProperty annotation\n    const jsonPropMatch = extractJsonPropertyName(trimmed);\n    if (jsonPropMatch) {\n      pendingJsonName = jsonPropMatch;\n      continue;\n    }\n\n    // Match: public Type Name { get; set; } or public Type Name { get; }\n    const propMatch = trimmed.match(/public\\s+(\\S+(?:<[^>]+>)?(?:\\?)?)\\s+(\\w+)\\s*\\{\\s*get;\\s*(set;\\s*)?\\}/);\n    if (propMatch) {\n      const type = propMatch[1];\n      const name = propMatch[2];\n      const hasSetter = !!propMatch[3];\n\n      properties.push({\n        name,\n        type,\n        jsonName: pendingJsonName || undefined,\n        readonly: !hasSetter,\n      });\n      pendingJsonName = null;\n      continue;\n    }\n\n    // Reset pending annotation if we hit a non-annotation, non-property line\n    if (!trimmed.startsWith('[') && trimmed.length > 0) {\n      pendingJsonName = null;\n    }\n  }\n\n  return properties;\n}\n\n/** Parse methods from a class body. */\nfunction parseMethods(classBody: string): CSharpMethod[] {\n  const methods: CSharpMethod[] = [];\n\n  // Match: public [async] ReturnType MethodName(params)\n  const methodRegex =\n    /(private|protected|internal|public)\\s+(?:(static)\\s+)?(?:(async)\\s+)?(\\S+(?:<[^>]+>)?)\\s+(\\w+)\\s*\\(([^)]*)\\)/g;\n  let match;\n  while ((match = methodRegex.exec(classBody)) !== null) {\n    const visibility = match[1];\n    const isAsync = match[3] === 'async';\n    const returnType = match[4];\n    const name = match[5];\n    const paramsStr = match[6];\n\n    // Skip private/protected methods and constructors\n    if (visibility === 'private' || visibility === 'protected') continue;\n\n    const params: { name: string; type: string; optional: boolean }[] = [];\n    if (paramsStr.trim()) {\n      const paramParts = paramsStr.split(',');\n      for (const part of paramParts) {\n        const trimmed = part.trim();\n        // Match: Type name or Type name = default\n        const paramMatch = trimmed.match(/(\\S+(?:<[^>]+>)?(?:\\?)?)\\s+(\\w+)(?:\\s*=\\s*(.+))?/);\n        if (paramMatch) {\n          const paramType = paramMatch[1];\n          const paramName = paramMatch[2];\n          const hasDefault = paramMatch[3] !== undefined;\n          params.push({\n            name: paramName,\n            type: paramType,\n            optional: paramType.endsWith('?') || hasDefault,\n          });\n        }\n      }\n    }\n\n    methods.push({\n      name,\n      params,\n      returnType,\n      visibility,\n      isAsync,\n    });\n  }\n\n  return methods;\n}\n\n/** Parse constructor parameters. */\nfunction parseConstructor(classBody: string, className: string): { name: string; type: string }[] {\n  const params: { name: string; type: string }[] = [];\n\n  // Match: public ClassName(params) — use indexOf to find the constructor\n  const ctorPrefix = `public ${className}`;\n  const ctorIdx = classBody.indexOf(ctorPrefix);\n  if (ctorIdx < 0) return params;\n  const afterCtor = classBody.slice(ctorIdx + ctorPrefix.length);\n  const match = afterCtor.match(/^\\s*\\(([^)]*)\\)/);\n  if (!match) return params;\n\n  const paramsStr = match[1];\n  if (!paramsStr.trim()) return params;\n\n  const paramParts = paramsStr.split(',');\n  for (const part of paramParts) {\n    const trimmed = part.trim();\n    const paramMatch = trimmed.match(/(\\S+(?:<[^>]+>)?)\\s+(\\w+)/);\n    if (paramMatch) {\n      params.push({ name: paramMatch[2], type: paramMatch[1] });\n    }\n  }\n\n  return params;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\n/** Parse a single C# source file and return all extracted symbols. */\nexport function parseCSharpFile(filePath: string, sdkPath: string): ParsedCSharpFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const cleaned = stripComments(source);\n\n  return {\n    classes: parseClasses(cleaned, relPath),\n    enums: parseEnums(cleaned, relPath),\n  };\n}\n","/**\n * DotNet (.NET/C#) surface builder — transforms parsed C# symbols into an ApiSurface.\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiEnum,\n  LanguageHints,\n} from '../types.js';\nimport type { CSharpClass, CSharpEnum } from './dotnet-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allClasses: CSharpClass[],\n  allEnums: CSharpEnum[],\n  _hints: LanguageHints,\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  const collector = new ExportCollector();\n\n  // Process classes\n  for (const cls of allClasses) {\n    if (cls.isService) {\n      // Service class — has methods\n      const methods: Record<string, ApiMethod[]> = {};\n      const properties: Record<string, ApiProperty> = {};\n\n      for (const method of cls.methods) {\n        const params: ApiParam[] = method.params.map((p) => ({\n          name: p.name,\n          type: p.type,\n          optional: p.optional,\n          passingStyle: 'named' as const,\n        }));\n\n        if (!methods[method.name]) methods[method.name] = [];\n        methods[method.name].push({\n          name: method.name,\n          params,\n          returnType: method.returnType,\n          async: method.isAsync,\n        });\n      }\n\n      // Add public properties to service class\n      for (const prop of cls.properties) {\n        const propName = prop.jsonName || prop.name;\n        properties[propName] = {\n          name: propName,\n          type: prop.type,\n          readonly: prop.readonly,\n        };\n      }\n\n      const constructorParams: ApiParam[] = cls.constructorParams.map((p) => ({\n        name: p.name,\n        type: p.type,\n        optional: false,\n        passingStyle: 'named' as const,\n      }));\n\n      classes[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        methods: sortRecord(methods),\n        properties: sortRecord(properties),\n        constructorParams,\n      };\n    } else {\n      // Data class — no methods, treat as interface\n      const fields: Record<string, ApiField> = {};\n      for (const prop of cls.properties) {\n        const fieldName = prop.jsonName || prop.name;\n        const isNullable = prop.type.endsWith('?');\n        fields[fieldName] = {\n          name: fieldName,\n          type: prop.type,\n          optional: isNullable,\n        };\n      }\n\n      interfaces[cls.name] = {\n        name: cls.name,\n        sourceFile: cls.sourceFile,\n        fields: sortRecord(fields),\n        extends: [],\n      };\n    }\n    collector.add(cls.sourceFile, cls.name);\n  }\n\n  // Process enums\n  for (const en of allEnums) {\n    enums[en.name] = {\n      name: en.name,\n      sourceFile: en.sourceFile,\n      members: sortRecord(en.members),\n    };\n    collector.add(en.sourceFile, en.name);\n  }\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * DotNet (C#) API surface extractor.\n *\n * Walks `.cs` files (excluding test, bin, and obj directories), parses\n * classes, enums, properties, and methods, then builds an `ApiSurface`.\n *\n * Parser:  `dotnet-parser.ts`  — regex-based C# source analysis\n * Surface: `dotnet-surface.ts` — ApiSurface construction\n */\n\nimport { statSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport {\n  NAMED_TYPE_RE,\n  typeExistsInSurface,\n  namedTypeWordsOverlap,\n  defaultIsNullableOnlyDifference,\n} from '../language-hints.js';\nimport { walkCSharpFiles, parseCSharpFile } from './dotnet-parser.js';\nimport { buildSurface } from './dotnet-surface.js';\nimport type { CSharpClass, CSharpEnum } from './dotnet-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst DOTNET_PRIMITIVE_TYPES = new Set(['string', 'int', 'long', 'float', 'double', 'bool', 'decimal']);\n\nconst dotnetHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    // Nullable<T> → T\n    const nullableMatch = type.match(/^Nullable<(.+)>$/);\n    if (nullableMatch) return nullableMatch[1];\n    // T? → T\n    if (type.endsWith('?')) return type.slice(0, -1);\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false; // C# doesn't have union types\n  },\n  isGenericTypeParam(type: string): boolean {\n    return /^[A-Z]$/.test(type) || /^T[A-Z][a-zA-Z]*$/.test(type);\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'object' || type === 'dynamic';\n  },\n  tolerateCategoryMismatch: false,\n  extractReturnTypeName(returnType: string): string | null {\n    let inner = returnType;\n    // Unwrap Task<T> → T\n    const taskMatch = inner.match(/^Task<(.+)>$/);\n    if (taskMatch) inner = taskMatch[1];\n    // Unwrap Task → void\n    if (inner === 'Task') return null;\n    // Unwrap nullable\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    // Unwrap List<T> → T\n    const listMatch = inner.match(/^(?:List|IList|IEnumerable|IReadOnlyList)<(.+)>$/);\n    if (listMatch) inner = listMatch[1];\n    // Primitives\n    if (['string', 'int', 'long', 'float', 'double', 'bool', 'void', 'decimal'].includes(inner)) return null;\n    return inner;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    let inner = paramType;\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    if (['string', 'int', 'long', 'float', 'double', 'bool', 'decimal'].includes(inner)) return null;\n    return inner;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    return propertyName.toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n\n  isTypeEquivalent(baselineType: string, candidateType: string, candidateSurface: ApiSurface): boolean {\n    // Strip nullable from both sides for comparison\n    const stripNullable = (t: string) => {\n      if (t.endsWith('?')) return t.slice(0, -1);\n      const m = t.match(/^Nullable<(.+)>$/);\n      return m ? m[1] : t;\n    };\n    const baseClean = stripNullable(baselineType);\n    const candClean = stripNullable(candidateType);\n\n    // Map/dictionary equivalence: Dictionary<string, string> ≡ Dictionary<string, object>\n    const dictPattern = /^Dictionary<string,\\s*(string|object|dynamic|Object)>$/;\n    if (dictPattern.test(baseClean) && dictPattern.test(candClean)) {\n      return true;\n    }\n\n    // Array notation equivalence: T[] ≡ List<T>\n    const arrayMatch = baseClean.match(/^(.+)\\[\\]$/);\n    const listMatch = candClean.match(/^(?:List|IList|IEnumerable|IReadOnlyList)<(.+)>$/);\n    if (arrayMatch && listMatch) {\n      // Compare inner types — allow named type tolerance\n      const baseInner = arrayMatch[1];\n      const candInner = listMatch[1];\n      if (baseInner === candInner) return true;\n      // Recurse for named type equivalence\n      if (NAMED_TYPE_RE.test(baseInner) && NAMED_TYPE_RE.test(candInner)) {\n        if (typeExistsInSurface(candInner, candidateSurface)) {\n          if (candInner.includes(baseInner) || baseInner.includes(candInner)) return true;\n          const baseNoResp = baseInner.replace(/Response$/, '');\n          const candNoResp = candInner.replace(/Response$/, '');\n          if (candNoResp.includes(baseNoResp) || baseNoResp.includes(candNoResp)) return true;\n          // Word overlap\n          if (namedTypeWordsOverlap(baseInner, candInner)) return true;\n        }\n      }\n      // Tolerate model collection vs primitive collection: OrganizationDomain[] ≡ List<string>\n      // The spec may define a field as a primitive array while the live SDK wraps it in a model.\n      if (\n        (DOTNET_PRIMITIVE_TYPES.has(baseInner) && NAMED_TYPE_RE.test(candInner)) ||\n        (DOTNET_PRIMITIVE_TYPES.has(candInner) && NAMED_TYPE_RE.test(baseInner))\n      ) {\n        return true;\n      }\n    }\n    // Also handle reverse: baseline is List<T>, candidate is T[]\n    const baseListMatch = baseClean.match(/^(?:List|IList|IEnumerable|IReadOnlyList)<(.+)>$/);\n    const candArrayMatch = candClean.match(/^(.+)\\[\\]$/);\n    if (baseListMatch && candArrayMatch) {\n      const baseInner = baseListMatch[1];\n      const candInner = candArrayMatch[1];\n      if (baseInner === candInner) return true;\n      if (NAMED_TYPE_RE.test(baseInner) && NAMED_TYPE_RE.test(candInner)) {\n        if (typeExistsInSurface(candInner, candidateSurface)) {\n          if (candInner.includes(baseInner) || baseInner.includes(candInner)) return true;\n        }\n      }\n    }\n\n    // Generic container equivalence: List<T> vs List<U>, T[] vs U[]\n    // where T and U are different named types for the same concept\n    const genericPattern = /^(?:List|IList|IEnumerable|IReadOnlyList)<(.+)>$/;\n    const baseGeneric = baseClean.match(genericPattern);\n    const candGeneric = candClean.match(genericPattern);\n    if (baseGeneric && candGeneric) {\n      const baseInner = baseGeneric[1];\n      const candInner = candGeneric[1];\n      if (baseInner === candInner) return true;\n      if (NAMED_TYPE_RE.test(baseInner) && NAMED_TYPE_RE.test(candInner)) {\n        if (typeExistsInSurface(candInner, candidateSurface)) {\n          if (candInner.includes(baseInner) || baseInner.includes(candInner)) return true;\n          const baseNoResp = baseInner.replace(/Response$/, '');\n          const candNoResp = candInner.replace(/Response$/, '');\n          if (candNoResp.includes(baseNoResp) || baseNoResp.includes(candNoResp)) return true;\n          if (namedTypeWordsOverlap(baseInner, candInner)) return true;\n        }\n      }\n    }\n\n    // Named type tolerance: different PascalCase names for the same concept\n    // (e.g., EmailObject vs DirectoryUsersEmail, RoleResponse vs DirectoryUserRole)\n    if (NAMED_TYPE_RE.test(baseClean) && NAMED_TYPE_RE.test(candClean)) {\n      if (typeExistsInSurface(candClean, candidateSurface)) {\n        if (candClean.includes(baseClean) || baseClean.includes(candClean)) return true;\n        const baseNoResp = baseClean.replace(/Response$/, '');\n        const candNoResp = candClean.replace(/Response$/, '');\n        if (candNoResp.includes(baseNoResp) || baseNoResp.includes(candNoResp)) return true;\n        // Word-component overlap\n        if (namedTypeWordsOverlap(baseClean, candClean)) return true;\n      }\n    }\n\n    // Numeric type equivalence: int ≡ double, long ≡ double (JSON numbers)\n    const numericTypes = new Set(['int', 'long', 'float', 'double', 'decimal']);\n    if (numericTypes.has(baseClean) && numericTypes.has(candClean)) return true;\n\n    // Date type equivalence: DateTime ≡ string (spec uses string with date-time format)\n    if ((baseClean === 'DateTime' && candClean === 'string') || (baseClean === 'string' && candClean === 'DateTime')) {\n      return true;\n    }\n\n    // Enum name vs string equivalence (candidate has an enum, baseline says string)\n    if (baseClean === 'string' && candidateSurface.enums[candClean]) return true;\n    if (candClean === 'string' && candidateSurface.enums?.[baseClean]) return true;\n\n    return false;\n  },\n\n  modelBaseClasses: [],\n  exceptionBaseClasses: ['Exception'],\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\n/** Create a DotNet extractor with optional hint overrides. */\nexport function createDotnetExtractor(hintOverrides?: Partial<LanguageHints>): Extractor {\n  const mergedHints: LanguageHints = hintOverrides ? { ...dotnetHints, ...hintOverrides } : dotnetHints;\n\n  return {\n    language: 'dotnet',\n    hints: mergedHints,\n\n    async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n      const surface = await this.extract(sdkPath);\n      return apiSurfaceToSnapshot(surface);\n    },\n\n    async extract(sdkPath: string): Promise<ApiSurface> {\n      // Determine the source directory: prefer src/, fallback to root\n      let sourceDir: string;\n      const srcPath = resolve(sdkPath, 'src');\n\n      try {\n        statSync(srcPath);\n        sourceDir = srcPath;\n      } catch {\n        sourceDir = sdkPath;\n      }\n\n      const csFiles = walkCSharpFiles(sourceDir);\n      if (csFiles.length === 0) {\n        throw new ExtractorError(\n          `No .cs files found in ${sdkPath}`,\n          `Ensure the --sdk-path argument points to a .NET project root containing .cs source files.`,\n        );\n      }\n\n      const allClasses: CSharpClass[] = [];\n      const allEnums: CSharpEnum[] = [];\n\n      for (const filePath of csFiles) {\n        const parsed = parseCSharpFile(filePath, sdkPath);\n        allClasses.push(...parsed.classes);\n        allEnums.push(...parsed.enums);\n      }\n\n      const { classes, interfaces, enums, exports } = buildSurface(allClasses, allEnums, mergedHints);\n\n      return {\n        language: 'dotnet',\n        extractedFrom: sdkPath,\n        extractedAt: new Date().toISOString(),\n        classes,\n        interfaces,\n        typeAliases: {},\n        enums,\n        exports,\n      };\n    },\n  };\n}\n\n/** Default DotNet extractor with generic language hints. */\nexport const dotnetExtractor: Extractor = createDotnetExtractor();\n","/**\n * Elixir source parser — regex-based extraction of modules, structs,\n * functions, and type specs from Elixir source files.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface ElixirStruct {\n  moduleName: string;\n  fields: string[];\n  sourceFile: string;\n}\n\nexport interface ElixirFunction {\n  moduleName: string;\n  name: string;\n  arity: number;\n  params: string[];\n  /** Per-param passing style: 'positional' or 'keyword' (for keyword list params). */\n  paramStyles: ('positional' | 'keyword')[];\n  isPrivate: boolean;\n  sourceFile: string;\n}\n\nexport interface ElixirTypeSpec {\n  moduleName: string;\n  name: string;\n  definition: string;\n  sourceFile: string;\n}\n\nexport interface ElixirEnumModule {\n  moduleName: string;\n  members: Record<string, string>;\n  sourceFile: string;\n}\n\nexport interface ParsedElixirFile {\n  structs: ElixirStruct[];\n  functions: ElixirFunction[];\n  typeSpecs: ElixirTypeSpec[];\n  enumModules: ElixirEnumModule[];\n  moduleNames: string[];\n}\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nexport function walkElixirFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || entry === '_build' || entry === 'deps' || entry === 'test') continue;\n      results.push(...walkElixirFiles(fullPath));\n    } else if (entry.endsWith('.ex') && !entry.endsWith('_test.exs')) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Strip comments and heredoc strings from Elixir source code.\n * This prevents false matches of keywords like `do`/`end` inside strings\n * and doc comments.\n */\nfunction stripCommentsAndHeredocs(source: string): string {\n  // Replace triple-quoted heredocs (@moduledoc \"\"\", @doc \"\"\", etc.)\n  let result = source.replace(/\"\"\"[\\s\\S]*?\"\"\"/g, '\"\"\"\"\"\"');\n  // Remove single-line comments — but never `#{` interpolation markers:\n  // truncating `\"/orgs/#{URI.encode(id)}\"` would leave an unterminated string\n  // literal that derails the do/end scanner for the rest of the module.\n  result = result.replace(/#(?!\\{)[^\\n]*/g, '');\n  return result;\n}\n\n// ---------------------------------------------------------------------------\n// Module body extraction using line-based do/end counting\n// ---------------------------------------------------------------------------\n\n/**\n * Given the full source and the position right after `defmodule ... do`,\n * find the module body text up to the matching `end`.\n *\n * Uses a character-by-character scan that skips string literals and\n * counts block-level `do`/`end` keywords only when they appear as\n * standalone tokens (word boundaries).\n */\nfunction extractModuleBody(source: string, startIdx: number): string | null {\n  let depth = 1;\n  // Walk through source counting do/end as word boundaries\n  // Skip strings (single and double quoted)\n  let i = startIdx;\n  while (i < source.length && depth > 0) {\n    const ch = source[i];\n\n    // Skip string literals\n    if (ch === '\"') {\n      i++;\n      while (i < source.length && source[i] !== '\"') {\n        if (source[i] === '\\\\') i++; // skip escaped char\n        i++;\n      }\n      i++; // skip closing quote\n      continue;\n    }\n    if (ch === \"'\") {\n      i++;\n      while (i < source.length && source[i] !== \"'\") {\n        if (source[i] === '\\\\') i++;\n        i++;\n      }\n      i++;\n      continue;\n    }\n\n    // Check for word-boundary keywords\n    // Only match `do` and `end` as full words (not `done`, `donut`, `endor`, etc.)\n    if (isWordBoundary(source, i)) {\n      if (source.slice(i, i + 2) === 'do' && isWordEnd(source, i + 2)) {\n        // Make sure this is block `do`, not keyword `do:` form\n        if (source[i + 2] !== ':') {\n          depth++;\n        }\n        i += 2;\n        continue;\n      }\n      if (source.slice(i, i + 2) === 'fn' && isWordEnd(source, i + 2)) {\n        depth++;\n        i += 2;\n        continue;\n      }\n      if (source.slice(i, i + 3) === 'end' && isWordEnd(source, i + 3)) {\n        depth--;\n        if (depth === 0) {\n          return source.slice(startIdx, i);\n        }\n        i += 3;\n        continue;\n      }\n    }\n\n    i++;\n  }\n\n  return null;\n}\n\nfunction isWordBoundary(source: string, idx: number): boolean {\n  if (idx === 0) return true;\n  const prev = source[idx - 1];\n  return !/[a-zA-Z0-9_]/.test(prev);\n}\n\nfunction isWordEnd(source: string, idx: number): boolean {\n  if (idx >= source.length) return true;\n  return !/[a-zA-Z0-9_]/.test(source[idx]);\n}\n\n// ---------------------------------------------------------------------------\n// Module extraction\n// ---------------------------------------------------------------------------\n\ninterface ExtractedModule {\n  name: string;\n  body: string;\n}\n\n/** Find all defmodule blocks and extract their bodies in a single pass. */\nfunction extractModules(source: string): ExtractedModule[] {\n  const modules: ExtractedModule[] = [];\n  const moduleRegex = /defmodule\\s+([\\w.]+)\\s+do\\b/g;\n  let match;\n  while ((match = moduleRegex.exec(source)) !== null) {\n    const body = extractModuleBody(source, match.index + match[0].length);\n    if (body) {\n      modules.push({ name: match[1], body });\n    }\n  }\n  return modules;\n}\n\n// ---------------------------------------------------------------------------\n// Struct extraction\n// ---------------------------------------------------------------------------\n\nfunction extractStructs(modules: ExtractedModule[], sourceFile: string): ElixirStruct[] {\n  const structs: ElixirStruct[] = [];\n\n  for (const { name: moduleName, body: moduleBody } of modules) {\n    // Look for defstruct inside this module\n    const structMatch = moduleBody.match(/defstruct\\s+\\[([^\\]]*)\\]/);\n    if (!structMatch) continue;\n\n    const fieldsStr = structMatch[1];\n    const fields: string[] = [];\n    const fieldRegex = /:(\\w+)/g;\n    let fieldMatch;\n    while ((fieldMatch = fieldRegex.exec(fieldsStr)) !== null) {\n      fields.push(fieldMatch[1]);\n    }\n\n    if (fields.length > 0) {\n      structs.push({ moduleName, fields, sourceFile });\n    }\n  }\n\n  return structs;\n}\n\n// ---------------------------------------------------------------------------\n// Function extraction\n// ---------------------------------------------------------------------------\n\nfunction extractFunctions(modules: ExtractedModule[], sourceFile: string): ElixirFunction[] {\n  const functions: ElixirFunction[] = [];\n\n  for (const { name: moduleName, body: moduleBody } of modules) {\n    // Match both styles:\n    // 1. Block: def name(params) do ... end\n    // 2. Keyword: def name(params), do: ...\n    // 3. Keyword no-args: def name, do: ...\n    const funcRegex = /(def|defp)\\s+(\\w+)(?:\\(([^)]*)\\))?(?:\\s+do\\b|\\s*,\\s*do:)/g;\n    let funcMatch;\n    while ((funcMatch = funcRegex.exec(moduleBody)) !== null) {\n      const isPrivate = funcMatch[1] === 'defp';\n      const name = funcMatch[2];\n      const paramsStr = funcMatch[3] || '';\n\n      // Skip module/struct macros\n      if (name === 'defstruct' || name === 'defmodule') continue;\n\n      const params: string[] = [];\n      const paramStyles: ('positional' | 'keyword')[] = [];\n      if (paramsStr.trim()) {\n        const paramParts = paramsStr.split(',');\n        for (const part of paramParts) {\n          const trimmed = part.trim();\n          // Extract parameter name (before :: type annotation or \\\\ default)\n          const paramNameMatch = trimmed.match(/^(\\w+)/);\n          if (paramNameMatch) {\n            params.push(paramNameMatch[1]);\n            // Detect keyword list params: `opts \\\\ []` or `options \\\\ []`\n            const isKeywordList = /\\\\\\\\\\s*\\[/.test(trimmed);\n            paramStyles.push(isKeywordList ? 'keyword' : 'positional');\n          }\n        }\n      }\n\n      functions.push({\n        moduleName,\n        name,\n        arity: params.length,\n        params,\n        paramStyles,\n        isPrivate,\n        sourceFile,\n      });\n    }\n  }\n\n  return functions;\n}\n\n// ---------------------------------------------------------------------------\n// Type spec extraction\n// ---------------------------------------------------------------------------\n\nfunction extractTypeSpecs(modules: ExtractedModule[], sourceFile: string): ElixirTypeSpec[] {\n  const specs: ElixirTypeSpec[] = [];\n\n  for (const { name: moduleName, body: moduleBody } of modules) {\n    // Match @type t :: ... capturing multi-line definitions\n    // The definition continues until we hit a blank line, a new @-attribute, or def/defstruct\n    const typeRegex = /@type\\s+(\\w+)\\s*::\\s*/g;\n    let typeMatch;\n    while ((typeMatch = typeRegex.exec(moduleBody)) !== null) {\n      const typeName = typeMatch[1];\n      const defStart = typeMatch.index + typeMatch[0].length;\n\n      // Find the end of the type definition:\n      // It ends at a blank line, a new @attribute, def, defp, defstruct, or end-of-module\n      let defEnd = defStart;\n      let braceDepth = 0;\n      for (let j = defStart; j < moduleBody.length; j++) {\n        const ch = moduleBody[j];\n        if (ch === '{') braceDepth++;\n        else if (ch === '}') {\n          braceDepth--;\n          if (braceDepth < 0) break;\n          if (braceDepth === 0) {\n            defEnd = j + 1;\n            break;\n          }\n        } else if (braceDepth === 0 && ch === '\\n') {\n          // Check if next non-whitespace line starts a new declaration\n          const remaining = moduleBody.slice(j + 1);\n          const nextLineMatch = remaining.match(/^\\s*\\S/);\n          if (nextLineMatch) {\n            const nextContent = remaining.trimStart();\n            if (\n              nextContent.startsWith('@') ||\n              nextContent.startsWith('def ') ||\n              nextContent.startsWith('defp ') ||\n              nextContent.startsWith('defstruct') ||\n              nextContent.startsWith('defmodule')\n            ) {\n              defEnd = j;\n              break;\n            }\n          } else {\n            // Blank line — end of definition\n            defEnd = j;\n            break;\n          }\n        }\n        defEnd = j + 1;\n      }\n\n      const definition = moduleBody.slice(defStart, defEnd).trim();\n      specs.push({ moduleName, name: typeName, definition, sourceFile });\n    }\n  }\n\n  return specs;\n}\n\n// ---------------------------------------------------------------------------\n// Enum module extraction\n// ---------------------------------------------------------------------------\n\n/** Named escapes Elixir recognizes inside double-quoted strings/atoms. */\nconst ELIXIR_STRING_ESCAPES: Record<string, string> = {\n  '0': '\\0',\n  a: '\\x07',\n  b: '\\b',\n  d: '\\x7f',\n  e: '\\x1b',\n  f: '\\f',\n  n: '\\n',\n  r: '\\r',\n  s: ' ',\n  t: '\\t',\n  v: '\\v',\n};\n\n/** Undo backslash escapes inside a double-quoted Elixir string/atom. */\nfunction unescapeElixirString(s: string): string {\n  return s.replace(/\\\\(.)/g, (_, ch: string) => ELIXIR_STRING_ESCAPES[ch] ?? ch);\n}\n\nfunction extractEnumModules(modules: ExtractedModule[], sourceFile: string): ElixirEnumModule[] {\n  const enumModules: ElixirEnumModule[] = [];\n\n  for (const { name: moduleName, body: moduleBody } of modules) {\n    // Check if this module has a `values` function (indicator of enum-like module)\n    if (!moduleBody.match(/def\\s+values[\\s,]/)) continue;\n\n    // Also verify there's no defstruct (structs aren't enums)\n    if (moduleBody.match(/defstruct\\b/)) continue;\n\n    const members: Record<string, string> = {};\n\n    // Tier 1 — hand-written style: zero-arg value functions `def name, do: \"value\"`.\n    const valueFuncRegex = /def\\s+(\\w+),\\s*do:\\s*\"([^\"]+)\"/g;\n    let valueFuncMatch;\n    while ((valueFuncMatch = valueFuncRegex.exec(moduleBody)) !== null) {\n      const funcName = valueFuncMatch[1];\n      const funcValue = valueFuncMatch[2];\n      if (funcName === 'values') continue;\n      members[funcName] = funcValue;\n    }\n\n    // Tier 2 — generated style: `def values, do: [...]` literal list. Entries\n    // may be atoms (:dns), quoted atoms (:\"urn:x\"), strings, or numbers, and\n    // mix format may wrap the list across lines. Atom entries always name a\n    // member; bare string/number entries only count when Tier 1 named nothing\n    // (hand-written SDKs list wire strings that Tier 1 already named).\n    // Quoted entries may themselves contain `]`, so the list body must skip\n    // over double-quoted segments rather than stop at the first `]`.\n    const hadNamedMembers = Object.keys(members).length > 0;\n    const valuesList = moduleBody.match(/def\\s+values,\\s*do:\\s*\\[((?:\"(?:[^\"\\\\]|\\\\.)*\"|[^\\]\"])*)\\]/);\n    if (valuesList) {\n      const tokenRegex = /:\"((?:[^\"\\\\]|\\\\.)*)\"|:([a-zA-Z_][a-zA-Z0-9_@]*[?!]?)|\"((?:[^\"\\\\]|\\\\.)*)\"|(-?\\d+(?:\\.\\d+)?)/g;\n      let token;\n      while ((token = tokenRegex.exec(valuesList[1])) !== null) {\n        const isAtom = token[1] != null || token[2] != null;\n        if (!isAtom && hadNamedMembers) continue;\n        const text = token[1] ?? token[2] ?? token[3] ?? token[4];\n        const name = token[2] ?? unescapeElixirString(text);\n        if (!(name in members)) {\n          members[name] = unescapeElixirString(text);\n        }\n      }\n    }\n\n    // Tier 3 — generated `dump/1` clauses carry the exact wire value per atom\n    // (`def dump(:urn_grant), do: \"urn:...\"`), refining the wire values of\n    // members Tiers 1–2 already found. Atoms that appear only in `dump/1`\n    // (e.g. legacy clauses for values dropped from `values/0`) are not members.\n    const dumpRegex =\n      /def\\s+dump\\(:(?:\"((?:[^\"\\\\]|\\\\.)*)\"|([a-zA-Z_][a-zA-Z0-9_@]*[?!]?))\\),\\s*do:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"/g;\n    let dumpMatch;\n    while ((dumpMatch = dumpRegex.exec(moduleBody)) !== null) {\n      const atomName = dumpMatch[1] != null ? unescapeElixirString(dumpMatch[1]) : dumpMatch[2];\n      if (atomName in members) {\n        members[atomName] = unescapeElixirString(dumpMatch[3]);\n      }\n    }\n\n    if (Object.keys(members).length > 0) {\n      enumModules.push({ moduleName, members, sourceFile });\n    }\n  }\n\n  return enumModules;\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\n/** Parse a single Elixir source file and return all extracted symbols. */\nexport function parseElixirFile(filePath: string, sdkPath: string): ParsedElixirFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n  const cleaned = stripCommentsAndHeredocs(source);\n  const modules = extractModules(cleaned);\n\n  return {\n    structs: extractStructs(modules, relPath),\n    functions: extractFunctions(modules, relPath),\n    typeSpecs: extractTypeSpecs(modules, relPath),\n    enumModules: extractEnumModules(modules, relPath),\n    moduleNames: modules.map((m) => m.name),\n  };\n}\n","/**\n * Elixir surface builder — transforms parsed Elixir symbols into an ApiSurface.\n *\n * Elixir conventions:\n * - Data types (defstruct) → ApiInterface\n * - Modules with public functions → ApiClass\n * - Enum-like modules (with value functions) → ApiEnum\n */\n\nimport type { ApiClass, ApiMethod, ApiParam, ApiInterface, ApiField, ApiEnum } from '../types.js';\nimport type { ElixirStruct, ElixirFunction, ElixirEnumModule, ElixirTypeSpec } from './elixir-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Get the short name from a fully qualified Elixir module name. */\nfunction shortName(moduleName: string): string {\n  const parts = moduleName.split('.');\n  return parts[parts.length - 1];\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allStructs: ElixirStruct[],\n  allFunctions: ElixirFunction[],\n  allEnumModules: ElixirEnumModule[],\n  allTypeSpecs: ElixirTypeSpec[],\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  const collector = new ExportCollector();\n\n  // Collect struct module names so we can distinguish struct modules from service modules\n  const structModuleNames = new Set(allStructs.map((s) => s.moduleName));\n  const enumModuleNames = new Set(allEnumModules.map((e) => e.moduleName));\n\n  // Process structs as interfaces\n  for (const struct of allStructs) {\n    const name = shortName(struct.moduleName);\n    const fields: Record<string, ApiField> = {};\n\n    // Build fields from struct keys — types come from @type spec if available\n    const typeSpec = allTypeSpecs.find((ts) => ts.moduleName === struct.moduleName && ts.name === 't');\n\n    for (const field of struct.fields) {\n      // Try to extract type from the @type spec\n      let fieldType = 'any';\n      let optional = false;\n\n      if (typeSpec) {\n        // Parse the type definition to find this field's type\n        const fieldPrefix = field + ':';\n        const prefixIdx = typeSpec.definition.indexOf(fieldPrefix);\n        const fieldTypeMatch =\n          prefixIdx >= 0 ? typeSpec.definition.slice(prefixIdx + fieldPrefix.length).match(/^\\s*([^,}]+)/) : null;\n        if (fieldTypeMatch) {\n          fieldType = fieldTypeMatch[1].trim();\n          // Check if nullable (contains | nil)\n          if (fieldType.includes('| nil') || fieldType.includes('nil |')) {\n            optional = true;\n            fieldType = fieldType\n              .replace(/\\s*\\|\\s*nil/g, '')\n              .replace(/nil\\s*\\|\\s*/g, '')\n              .trim();\n          }\n        }\n      }\n\n      fields[field] = {\n        name: field,\n        type: fieldType,\n        optional,\n      };\n    }\n\n    interfaces[name] = {\n      name,\n      sourceFile: struct.sourceFile,\n      fields: sortRecord(fields),\n      extends: [],\n    };\n    collector.add(struct.sourceFile, name);\n  }\n\n  // Process enum modules\n  for (const enumModule of allEnumModules) {\n    const name = shortName(enumModule.moduleName);\n    enums[name] = {\n      name,\n      sourceFile: enumModule.sourceFile,\n      members: sortRecord(enumModule.members),\n    };\n    collector.add(enumModule.sourceFile, name);\n  }\n\n  // Group public functions by module\n  const funcsByModule = new Map<string, ElixirFunction[]>();\n  for (const func of allFunctions) {\n    if (func.isPrivate) continue;\n\n    // Skip functions from struct modules (they are data, not services)\n    // and enum modules (already handled)\n    if (structModuleNames.has(func.moduleName) && !funcsByModule.has(func.moduleName)) {\n      // Struct modules might still have functions, but only if they have\n      // functions beyond just struct-related ones\n    }\n    if (enumModuleNames.has(func.moduleName)) continue;\n\n    if (!funcsByModule.has(func.moduleName)) funcsByModule.set(func.moduleName, []);\n    funcsByModule.get(func.moduleName)!.push(func);\n  }\n\n  // Convert function modules to classes\n  for (const [moduleName, funcs] of funcsByModule) {\n    // Skip if this is a struct-only module (no meaningful functions)\n    if (structModuleNames.has(moduleName)) continue;\n\n    const name = shortName(moduleName);\n    const methods: Record<string, ApiMethod[]> = {};\n\n    // Deduplicate by function name (Elixir allows multiple clauses)\n    const seenFuncs = new Set<string>();\n    for (const func of funcs) {\n      if (seenFuncs.has(func.name)) continue;\n      seenFuncs.add(func.name);\n\n      const params: ApiParam[] = func.params.map((p, i) => ({\n        name: p,\n        type: 'any',\n        optional: false,\n        passingStyle: func.paramStyles[i] ?? ('positional' as const),\n      }));\n\n      if (!methods[func.name]) methods[func.name] = [];\n      methods[func.name].push({\n        name: func.name,\n        params,\n        returnType: 'any',\n        async: false,\n      });\n    }\n\n    if (Object.keys(methods).length > 0) {\n      classes[name] = {\n        name,\n        sourceFile: funcs[0].sourceFile,\n        methods: sortRecord(methods),\n        properties: {},\n        constructorParams: [],\n      };\n      collector.add(funcs[0].sourceFile, name);\n    }\n  }\n\n  const exports = collector.toRecord();\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    enums: sortRecord(enums),\n    exports: sortRecord(exports),\n  };\n}\n","/**\n * Elixir API surface extractor.\n *\n * Walks `.ex` files under `lib/` (the standard Elixir source directory),\n * parses modules, structs, functions, and type specs, then builds an\n * `ApiSurface`.\n *\n * Parser:  `elixir-parser.ts`  — regex-based Elixir source analysis\n * Surface: `elixir-surface.ts` — ApiSurface construction\n */\n\nimport { statSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkElixirFiles, parseElixirFile } from './elixir-parser.js';\nimport { buildSurface } from './elixir-surface.js';\nimport type { ElixirStruct, ElixirFunction, ElixirEnumModule, ElixirTypeSpec } from './elixir-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst elixirHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    // T | nil → T\n    if (type.includes('| nil')) return type.replace(/\\s*\\|\\s*nil/g, '').trim();\n    if (type.includes('nil |')) return type.replace(/nil\\s*\\|\\s*/g, '').trim();\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(a: string, b: string): boolean {\n    // Parse pipe-separated types, sort, compare\n    const sortParts = (t: string) =>\n      t\n        .split('|')\n        .map((s) => s.trim())\n        .sort()\n        .join('|');\n    return a !== b && sortParts(a) === sortParts(b);\n  },\n  isGenericTypeParam(type: string): boolean {\n    // Elixir doesn't have generic type params in the same sense\n    return type === 'any' || type === 'term';\n  },\n  isExtractionArtifact(type: string): boolean {\n    return type === 'any' || type === 'term' || type === 'any()';\n  },\n  tolerateCategoryMismatch: true,\n  extractReturnTypeName(returnType: string): string | null {\n    let inner = returnType;\n    // Unwrap {:ok, T} → T\n    const okMatch = inner.match(/^\\{:ok,\\s*(.+)\\}$/);\n    if (okMatch) inner = okMatch[1].trim();\n    // Unwrap [T] → T\n    const listMatch = inner.match(/^\\[(.+)\\]$/);\n    if (listMatch) inner = listMatch[1].trim();\n    // Primitives\n    if (['any', 'term', 'atom', 'binary', 'boolean', 'integer', 'float', 'number', 'pid'].includes(inner)) {\n      return null;\n    }\n    // String.t() → String\n    const typeCallMatch = inner.match(/^(\\w+)\\.t\\(\\)$/);\n    if (typeCallMatch) return typeCallMatch[1];\n    return inner || null;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    if (\n      ['any', 'term', 'atom', 'binary', 'boolean', 'integer', 'float', 'number', 'pid', 'keyword'].includes(paramType)\n    ) {\n      return null;\n    }\n    const typeCallMatch = paramType.match(/^(\\w+)\\.t\\(\\)$/);\n    if (typeCallMatch) return typeCallMatch[1];\n    return paramType;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    // snake_case → PascalCase comparison\n    return propertyName.replace(/_/g, '').toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const elixirExtractor: Extractor = {\n  language: 'elixir',\n  hints: elixirHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    // Determine the source directory: prefer lib/, fallback to root\n    let sourceDir: string;\n    const libPath = resolve(sdkPath, 'lib');\n\n    try {\n      statSync(libPath);\n      sourceDir = libPath;\n    } catch {\n      sourceDir = sdkPath;\n    }\n\n    const exFiles = walkElixirFiles(sourceDir);\n    if (exFiles.length === 0) {\n      throw new ExtractorError(\n        `No .ex files found in ${sdkPath}`,\n        `Ensure the --sdk-path argument points to an Elixir project root containing .ex source files in lib/.`,\n      );\n    }\n\n    const allStructs: ElixirStruct[] = [];\n    const allFunctions: ElixirFunction[] = [];\n    const allEnumModules: ElixirEnumModule[] = [];\n    const allTypeSpecs: ElixirTypeSpec[] = [];\n\n    for (const filePath of exFiles) {\n      const parsed = parseElixirFile(filePath, sdkPath);\n      allStructs.push(...parsed.structs);\n      allFunctions.push(...parsed.functions);\n      allEnumModules.push(...parsed.enumModules);\n      allTypeSpecs.push(...parsed.typeSpecs);\n    }\n\n    const { classes, interfaces, enums, exports } = buildSurface(\n      allStructs,\n      allFunctions,\n      allEnumModules,\n      allTypeSpecs,\n    );\n\n    return {\n      language: 'elixir',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes,\n      interfaces,\n      typeAliases: {},\n      enums,\n      exports,\n    };\n  },\n};\n","/**\n * Swift source parser — regex-based extraction of structs, classes, actors,\n * extensions, enums, and type aliases from Swift source files.\n *\n * Swift-specific concerns handled here that the other parsers can ignore:\n *  - String literals may contain `//` (URLs) and braces, so comment stripping\n *    and brace matching are both string-aware.\n *  - Files marked `@oagen-ignore-file` are hand-maintained and skipped, so an\n *    `extension` of a hand-written type (e.g. `WorkOSClient+Resources.swift`)\n *    owns the surface it contributes.\n *  - Generated enums carry an `unknown(String)` escape-hatch case and encode\n *    member raw values in `init(rawValue:)` / `var rawValue` switches rather\n *    than `case name = \"value\"` declarations.\n */\n\nimport { readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\n// ---------------------------------------------------------------------------\n// Internal types\n// ---------------------------------------------------------------------------\n\nexport interface SwiftProperty {\n  name: string;\n  type: string;\n  optional: boolean;\n  readonly: boolean;\n}\n\nexport interface SwiftParam {\n  name: string;\n  type: string;\n  optional: boolean;\n}\n\nexport interface SwiftMethod {\n  name: string;\n  params: SwiftParam[];\n  returnType: string;\n  async: boolean;\n  /** `static func` or `class func` — a type-level method. */\n  isStatic: boolean;\n}\n\nexport interface SwiftTypeDecl {\n  kind: 'struct' | 'class' | 'actor' | 'extension';\n  name: string;\n  properties: SwiftProperty[];\n  methods: SwiftMethod[];\n  initOverloads: SwiftParam[][];\n  sourceFile: string;\n}\n\nexport interface SwiftEnum {\n  name: string;\n  members: Record<string, string>;\n  sourceFile: string;\n}\n\nexport interface SwiftTypeAlias {\n  name: string;\n  value: string;\n  sourceFile: string;\n}\n\nexport interface ParsedSwiftFile {\n  types: SwiftTypeDecl[];\n  enums: SwiftEnum[];\n  typeAliases: SwiftTypeAlias[];\n}\n\n// ---------------------------------------------------------------------------\n// File walker\n// ---------------------------------------------------------------------------\n\nconst SKIP_DIRS = new Set(['build', 'Tests', 'DerivedData', 'Pods', 'Carthage']);\n\nexport function walkSwiftFiles(dir: string): string[] {\n  const results: string[] = [];\n  let entries: string[];\n  try {\n    entries = readdirSync(dir);\n  } catch {\n    return results;\n  }\n  for (const entry of entries) {\n    const fullPath = join(dir, entry);\n    let stat;\n    try {\n      stat = statSync(fullPath);\n    } catch {\n      continue;\n    }\n    if (stat.isDirectory()) {\n      if (entry.startsWith('.') || SKIP_DIRS.has(entry)) continue;\n      results.push(...walkSwiftFiles(fullPath));\n    } else if (\n      entry.endsWith('.swift') &&\n      !entry.endsWith('Tests.swift') &&\n      !entry.endsWith('Test.swift') &&\n      entry !== 'Package.swift'\n    ) {\n      results.push(fullPath);\n    }\n  }\n  return results.sort();\n}\n\n// ---------------------------------------------------------------------------\n// String-aware scanning helpers\n// ---------------------------------------------------------------------------\n\n/** Advance past a string literal starting at `idx` (which must point at `\"`).\n *  Handles escapes, multi-line `\"\"\"` literals, and `\\(...)` interpolations —\n *  whose expressions may contain nested string literals and braces. Returns\n *  the index just past the closing quote(s). */\nfunction skipString(source: string, idx: number): number {\n  const n = source.length;\n  if (source.startsWith('\"\"\"', idx)) {\n    const end = source.indexOf('\"\"\"', idx + 3);\n    return end === -1 ? n : end + 3;\n  }\n  let i = idx + 1;\n  while (i < n && source[i] !== '\"') {\n    if (source[i] === '\\\\') {\n      if (source[i + 1] === '(') {\n        // Interpolation: skip to the matching `)`, recursing into nested\n        // string literals so an inner `\"` doesn't terminate the outer string.\n        let depth = 1;\n        let j = i + 2;\n        while (j < n && depth > 0) {\n          const ch = source[j];\n          if (ch === '\"') {\n            j = skipString(source, j);\n            continue;\n          }\n          if (ch === '(') depth++;\n          else if (ch === ')') depth--;\n          j++;\n        }\n        i = j;\n        continue;\n      }\n      i++;\n    }\n    i++;\n  }\n  return Math.min(i + 1, n);\n}\n\n/** Strip line and (nesting) block comments. String literals are preserved\n *  verbatim, including any `//` sequences inside them (URLs). */\nfunction stripComments(source: string): string {\n  let out = '';\n  let i = 0;\n  const n = source.length;\n  while (i < n) {\n    const ch = source[i];\n    if (ch === '\"') {\n      const end = skipString(source, i);\n      out += source.slice(i, end);\n      i = end;\n      continue;\n    }\n    if (ch === '/' && source[i + 1] === '/') {\n      while (i < n && source[i] !== '\\n') i++;\n      continue;\n    }\n    if (ch === '/' && source[i + 1] === '*') {\n      let depth = 1;\n      i += 2;\n      while (i < n && depth > 0) {\n        if (source[i] === '/' && source[i + 1] === '*') {\n          depth++;\n          i += 2;\n        } else if (source[i] === '*' && source[i + 1] === '/') {\n          depth--;\n          i += 2;\n        } else {\n          i++;\n        }\n      }\n      continue;\n    }\n    out += ch;\n    i++;\n  }\n  return out;\n}\n\n/** Given the index of an opening `{`, return the index just past its matching\n *  `}`. String-aware so braces inside literals don't skew the depth. */\nfunction matchBrace(source: string, openIdx: number): number {\n  const n = source.length;\n  let depth = 1;\n  let i = openIdx + 1;\n  while (i < n && depth > 0) {\n    const ch = source[i];\n    if (ch === '\"') {\n      i = skipString(source, i);\n      continue;\n    }\n    if (ch === '{') depth++;\n    else if (ch === '}') depth--;\n    i++;\n  }\n  return i;\n}\n\n/** Reduce a type body to its top-level text: nested `{...}` blocks are\n *  replaced with a newline so declaration signatures survive while method\n *  bodies, computed-property accessors, and nested types disappear. */\nfunction topLevelText(body: string): string {\n  let out = '';\n  let i = 0;\n  const n = body.length;\n  while (i < n) {\n    const ch = body[i];\n    if (ch === '\"') {\n      const end = skipString(body, i);\n      out += body.slice(i, end);\n      i = end;\n      continue;\n    }\n    if (ch === '{') {\n      out += '\\n';\n      i = matchBrace(body, i);\n      continue;\n    }\n    out += ch;\n    i++;\n  }\n  return out;\n}\n\n/** Split by top-level commas, ignoring commas nested in brackets or strings. */\nfunction splitTopLevelCommas(text: string): string[] {\n  const result: string[] = [];\n  let depth = 0;\n  let current = '';\n  let i = 0;\n  while (i < text.length) {\n    const ch = text[i];\n    if (ch === '\"') {\n      const end = skipString(text, i);\n      current += text.slice(i, end);\n      i = end;\n      continue;\n    }\n    if (ch === '<' || ch === '(' || ch === '[') {\n      depth++;\n      current += ch;\n    } else if (ch === '>' || ch === ')' || ch === ']') {\n      depth--;\n      current += ch;\n    } else if (ch === ',' && depth === 0) {\n      result.push(current);\n      current = '';\n    } else {\n      current += ch;\n    }\n    i++;\n  }\n  if (current.trim()) result.push(current);\n  return result;\n}\n\n/** Given the index of an opening `(`, return the index just past its matching `)`. */\nfunction matchParen(source: string, openIdx: number): number {\n  const n = source.length;\n  let depth = 1;\n  let i = openIdx + 1;\n  while (i < n && depth > 0) {\n    const ch = source[i];\n    if (ch === '\"') {\n      i = skipString(source, i);\n      continue;\n    }\n    if (ch === '(') depth++;\n    else if (ch === ')') depth--;\n    i++;\n  }\n  return i;\n}\n\n// ---------------------------------------------------------------------------\n// Member parsing\n// ---------------------------------------------------------------------------\n\nconst VISIBILITY_PUBLIC = /\\b(?:public|open)\\b/;\n\n/** Parse `label name: Type = default` parameter fragments. The public name is\n *  the external argument label; `_ name:` falls back to the internal name. */\nfunction parseParams(paramsBlock: string): SwiftParam[] {\n  const params: SwiftParam[] = [];\n  for (const part of splitTopLevelCommas(paramsBlock)) {\n    const trimmed = part.trim();\n    if (!trimmed) continue;\n    const paramMatch = trimmed.match(/^(?:(\\w+|_)\\s+)?(\\w+)\\s*:\\s*([^=]+?)(?:\\s*=\\s*(.+))?$/s);\n    if (!paramMatch) continue;\n    const label = paramMatch[1];\n    const internalName = paramMatch[2];\n    const type = paramMatch[3].trim();\n    const hasDefault = paramMatch[4] !== undefined;\n    const name = !label || label === '_' ? internalName : label;\n    params.push({ name, type, optional: type.endsWith('?') || hasDefault });\n  }\n  return params;\n}\n\n/** Parse stored and computed property declarations from top-level type text. */\nfunction parseProperties(surfaceText: string, defaultPublic: boolean): SwiftProperty[] {\n  const properties: SwiftProperty[] = [];\n  const propRegex =\n    /^[ \\t]*((?:@\\w+(?:\\([^)]*\\))?\\s+)*(?:(?:public|open|package|internal|fileprivate|private|static|class|final|lazy|weak|nonisolated)(?:\\([^)]*\\))?\\s+)*)(let|var)\\s+(\\w+)\\s*:\\s*([^\\n={]+)/gm;\n  let match;\n  while ((match = propRegex.exec(surfaceText)) !== null) {\n    const modifiers = match[1] || '';\n    if (\n      !VISIBILITY_PUBLIC.test(modifiers) &&\n      !(defaultPublic && !/\\b(?:internal|fileprivate|private|package)\\b/.test(modifiers))\n    )\n      continue;\n    if (/\\bstatic\\b/.test(modifiers)) continue;\n    const keyword = match[2];\n    const name = match[3];\n    const type = match[4].trim();\n    properties.push({\n      name,\n      type,\n      optional: type.endsWith('?'),\n      readonly: keyword === 'let',\n    });\n  }\n  return properties;\n}\n\n/** Parse `func` declarations from top-level type text. */\nfunction parseMethods(surfaceText: string, defaultPublic: boolean): SwiftMethod[] {\n  const methods: SwiftMethod[] = [];\n  const funcRegex =\n    /((?:@\\w+(?:\\([^)]*\\))?\\s+)*(?:(?:public|open|package|internal|fileprivate|private|static|class|final|nonisolated|mutating)(?:\\([^)]*\\))?\\s+)*)func\\s+(\\w+)(?:<[^>]*>)?\\s*\\(/g;\n  let match;\n  while ((match = funcRegex.exec(surfaceText)) !== null) {\n    const modifiers = match[1] || '';\n    if (\n      !VISIBILITY_PUBLIC.test(modifiers) &&\n      !(defaultPublic && !/\\b(?:internal|fileprivate|private|package)\\b/.test(modifiers))\n    )\n      continue;\n    const name = match[2];\n    const parenOpen = match.index + match[0].length - 1;\n    const parenClose = matchParen(surfaceText, parenOpen);\n    const params = parseParams(surfaceText.slice(parenOpen + 1, parenClose - 1));\n\n    const tail = surfaceText.slice(parenClose);\n    const tailMatch = tail.match(/^\\s*(async)?\\s*(?:throws|rethrows)?\\s*(?:->\\s*([^\\n]+))?/);\n    let returnType = tailMatch?.[2]?.trim() ?? 'Void';\n    const whereIdx = returnType.indexOf(' where ');\n    if (whereIdx !== -1) returnType = returnType.slice(0, whereIdx).trim();\n\n    methods.push({\n      name,\n      params,\n      returnType,\n      async: tailMatch?.[1] === 'async',\n      isStatic: /\\b(?:static|class)\\b/.test(modifiers),\n    });\n    funcRegex.lastIndex = parenClose;\n  }\n  return methods;\n}\n\n/** Parse `init` declarations from top-level type text. */\nfunction parseInits(surfaceText: string, defaultPublic: boolean): SwiftParam[][] {\n  const overloads: SwiftParam[][] = [];\n  const initRegex =\n    /((?:@\\w+(?:\\([^)]*\\))?\\s+)*(?:(?:public|open|package|internal|fileprivate|private|convenience|required|nonisolated)\\s+)*)init\\s*\\??\\s*\\(/g;\n  let match;\n  while ((match = initRegex.exec(surfaceText)) !== null) {\n    const modifiers = match[1] || '';\n    if (\n      !VISIBILITY_PUBLIC.test(modifiers) &&\n      !(defaultPublic && !/\\b(?:internal|fileprivate|private|package)\\b/.test(modifiers))\n    )\n      continue;\n    const parenOpen = match.index + match[0].length - 1;\n    const parenClose = matchParen(surfaceText, parenOpen);\n    overloads.push(parseParams(surfaceText.slice(parenOpen + 1, parenClose - 1)));\n    initRegex.lastIndex = parenClose;\n  }\n  return overloads;\n}\n\n// ---------------------------------------------------------------------------\n// Enum extraction\n// ---------------------------------------------------------------------------\n\nfunction parseEnumBody(name: string, body: string, sourceFile: string): SwiftEnum | null {\n  const surface = topLevelText(body);\n\n  // Collect member names from top-level `case` declarations. Cases with\n  // associated values — e.g. the generated `unknown(String)` escape hatch —\n  // are not spec members and are skipped.\n  const declared: { name: string; rawValue?: string }[] = [];\n  const caseLineRegex = /^\\s*(?:indirect\\s+)?case\\s+(.+)$/gm;\n  let match;\n  while ((match = caseLineRegex.exec(surface)) !== null) {\n    for (const entry of splitTopLevelCommas(match[1])) {\n      const trimmed = entry.trim();\n      if (!trimmed) continue;\n      const caseMatch = trimmed.match(/^`?(\\w+)`?(\\([^)]*\\))?(?:\\s*=\\s*\"([^\"]*)\")?/);\n      if (!caseMatch) continue;\n      if (caseMatch[2] !== undefined) continue; // associated value case\n      declared.push({ name: caseMatch[1], rawValue: caseMatch[3] });\n    }\n  }\n  if (declared.length === 0) return null;\n\n  // Raw values live in the `var rawValue` getter (`case .name: return \"value\"`)\n  // or the `init(rawValue:)` switch (`case \"value\": self = .name`). Scan the\n  // full body — these switches sit inside nested braces.\n  const valueByMember = new Map<string, string>();\n  const getterRegex = /case\\s+\\.(\\w+)\\s*:\\s*return\\s+\"((?:[^\"\\\\]|\\\\.)*)\"/g;\n  while ((match = getterRegex.exec(body)) !== null) {\n    valueByMember.set(match[1], match[2]);\n  }\n  const initRegex = /case\\s+\"((?:[^\"\\\\]|\\\\.)*)\"\\s*:\\s*self\\s*=\\s*\\.(\\w+)/g;\n  while ((match = initRegex.exec(body)) !== null) {\n    if (!valueByMember.has(match[2])) valueByMember.set(match[2], match[1]);\n  }\n\n  const members: Record<string, string> = {};\n  for (const { name: memberName, rawValue } of declared) {\n    members[memberName] = rawValue ?? valueByMember.get(memberName) ?? memberName;\n  }\n  return { name, members, sourceFile };\n}\n\n// ---------------------------------------------------------------------------\n// Full file parser\n// ---------------------------------------------------------------------------\n\n/** Parse a single Swift source file and return all extracted symbols.\n *  Files marked `@oagen-ignore-file` are hand-maintained and yield nothing. */\nexport function parseSwiftFile(filePath: string, sdkPath: string): ParsedSwiftFile {\n  const source = readFileSync(filePath, 'utf-8');\n  const relPath = relative(sdkPath, filePath);\n\n  const empty: ParsedSwiftFile = { types: [], enums: [], typeAliases: [] };\n  if (source.includes('@oagen-ignore-file')) return empty;\n\n  const cleaned = stripComments(source);\n\n  // Function-local so `g`-flag `lastIndex` state can never leak between files\n  // (an exception mid-scan would leave a module-level regex mid-file).\n  const typeDeclRegex =\n    /((?:@\\w+(?:\\([^)]*\\))?\\s+)*(?:(?:public|open|package|internal|fileprivate|private|final|indirect)\\s+)*)(struct|class|actor|enum)\\s+(\\w+)(?:<[^>]*>)?(?:\\s*:\\s*[^{]+?)?\\s*\\{/g;\n  const extensionRegex =\n    /(^|\\n)\\s*((?:public|package|internal|fileprivate|private)\\s+)?extension\\s+(\\w+)(?:\\s*:\\s*[^{]+?)?\\s*\\{/g;\n  const types: SwiftTypeDecl[] = [];\n  const enums: SwiftEnum[] = [];\n  const typeAliases: SwiftTypeAlias[] = [];\n\n  let match;\n  while ((match = typeDeclRegex.exec(cleaned)) !== null) {\n    const modifiers = match[1] || '';\n    const kind = match[2] as 'struct' | 'class' | 'actor' | 'enum';\n    const name = match[3];\n    const braceIdx = match.index + match[0].length - 1;\n    const bodyEnd = matchBrace(cleaned, braceIdx);\n    const body = cleaned.slice(braceIdx + 1, bodyEnd - 1);\n\n    if (!VISIBILITY_PUBLIC.test(modifiers)) continue;\n\n    if (kind === 'enum') {\n      const parsed = parseEnumBody(name, body, relPath);\n      if (parsed) enums.push(parsed);\n      continue;\n    }\n\n    const surface = topLevelText(body);\n    types.push({\n      kind,\n      name,\n      properties: parseProperties(surface, false),\n      methods: parseMethods(surface, false),\n      initOverloads: parseInits(surface, false),\n      sourceFile: relPath,\n    });\n  }\n\n  while ((match = extensionRegex.exec(cleaned)) !== null) {\n    const isPublicExtension = (match[2] || '').trim() === 'public';\n    const name = match[3];\n    const braceIdx = match.index + match[0].length - 1;\n    const bodyEnd = matchBrace(cleaned, braceIdx);\n    const body = cleaned.slice(braceIdx + 1, bodyEnd - 1);\n    const surface = topLevelText(body);\n\n    const decl: SwiftTypeDecl = {\n      kind: 'extension',\n      name,\n      properties: parseProperties(surface, isPublicExtension),\n      methods: parseMethods(surface, isPublicExtension),\n      initOverloads: parseInits(surface, isPublicExtension),\n      sourceFile: relPath,\n    };\n    if (decl.properties.length > 0 || decl.methods.length > 0 || decl.initOverloads.length > 0) {\n      types.push(decl);\n    }\n  }\n\n  const aliasRegex = /(?:public|open)\\s+typealias\\s+(\\w+)(?:<[^>]*>)?\\s*=\\s*([^\\n]+)/g;\n  while ((match = aliasRegex.exec(cleaned)) !== null) {\n    typeAliases.push({ name: match[1], value: match[2].trim(), sourceFile: relPath });\n  }\n\n  return { types, enums, typeAliases };\n}\n","/**\n * Swift surface builder — transforms parsed Swift symbols into an ApiSurface.\n *\n * Classification rules:\n *  - A struct with no public methods is a data model → ApiInterface, with its\n *    stored properties as fields (Swift property names are the public API;\n *    wire names live in the private CodingKeys enum).\n *  - Anything with public methods is a service → ApiClass.\n *  - Extension-contributed members merge into their extended type; when the\n *    extended type's own declaration is hand-maintained (skipped by the\n *    parser), the extension entry stands alone with the extension's source\n *    file. This is how `WorkOSClient+Resources.swift` accessors survive\n *    manifest filtering while the hand-written client core does not.\n */\n\nimport type {\n  ApiClass,\n  ApiMethod,\n  ApiParam,\n  ApiProperty,\n  ApiInterface,\n  ApiField,\n  ApiTypeAlias,\n  ApiEnum,\n} from '../types.js';\nimport type { SwiftTypeDecl, SwiftEnum, SwiftTypeAlias } from './ios-parser.js';\nimport { sortRecord, ExportCollector } from './shared.js';\n\ninterface MergedType {\n  name: string;\n  /** Kind of the type's own declaration; null when only extensions were seen. */\n  declKind: 'struct' | 'class' | 'actor' | null;\n  properties: SwiftTypeDecl['properties'];\n  methods: SwiftTypeDecl['methods'];\n  initOverloads: SwiftTypeDecl['initOverloads'];\n  sourceFile: string;\n}\n\nfunction mergeTypes(allTypes: SwiftTypeDecl[]): MergedType[] {\n  const byName = new Map<string, MergedType>();\n  for (const decl of allTypes) {\n    let entry = byName.get(decl.name);\n    if (!entry) {\n      entry = {\n        name: decl.name,\n        declKind: null,\n        properties: [],\n        methods: [],\n        initOverloads: [],\n        sourceFile: decl.sourceFile,\n      };\n      byName.set(decl.name, entry);\n    }\n    if (decl.kind !== 'extension' && entry.declKind === null) {\n      entry.declKind = decl.kind;\n      entry.sourceFile = decl.sourceFile;\n    }\n    entry.properties.push(...decl.properties);\n    entry.methods.push(...decl.methods);\n    entry.initOverloads.push(...decl.initOverloads);\n  }\n  return [...byName.values()];\n}\n\n// ---------------------------------------------------------------------------\n// Surface builder\n// ---------------------------------------------------------------------------\n\nexport function buildSurface(\n  allTypes: SwiftTypeDecl[],\n  allEnums: SwiftEnum[],\n  allTypeAliases: SwiftTypeAlias[],\n): {\n  classes: Record<string, ApiClass>;\n  interfaces: Record<string, ApiInterface>;\n  typeAliases: Record<string, ApiTypeAlias>;\n  enums: Record<string, ApiEnum>;\n  exports: Record<string, string[]>;\n} {\n  const classes: Record<string, ApiClass> = {};\n  const interfaces: Record<string, ApiInterface> = {};\n  const typeAliases: Record<string, ApiTypeAlias> = {};\n  const enums: Record<string, ApiEnum> = {};\n\n  const collector = new ExportCollector();\n\n  for (const type of mergeTypes(allTypes)) {\n    // Data model: a struct (or struct-less property bag from extensions of a\n    // struct) with no callable surface → interface with fields.\n    if (type.declKind === 'struct' && type.methods.length === 0) {\n      if (type.properties.length === 0) continue;\n      const fields: Record<string, ApiField> = {};\n      for (const prop of type.properties) {\n        fields[prop.name] = {\n          name: prop.name,\n          type: prop.type,\n          optional: prop.optional,\n        };\n      }\n      interfaces[type.name] = {\n        name: type.name,\n        sourceFile: type.sourceFile,\n        fields: sortRecord(fields),\n        extends: [],\n      };\n      collector.add(type.sourceFile, type.name);\n      continue;\n    }\n\n    // Service / client surface → class with methods and properties.\n    if (type.methods.length === 0 && type.properties.length === 0) continue;\n\n    const methods: Record<string, ApiMethod[]> = {};\n    for (const method of type.methods) {\n      // Swift argument labels are required at the call site AND fixed in\n      // declaration order, so parameters model as labeled positional args.\n      const params: ApiParam[] = method.params.map((p) => ({\n        name: p.name,\n        type: p.type,\n        optional: p.optional,\n        passingStyle: 'positional' as const,\n      }));\n\n      if (!methods[method.name]) methods[method.name] = [];\n      methods[method.name].push({\n        name: method.name,\n        params,\n        returnType: method.returnType,\n        async: method.async,\n        isStatic: method.isStatic,\n      });\n    }\n\n    const properties: Record<string, ApiProperty> = {};\n    for (const prop of type.properties) {\n      properties[prop.name] = {\n        name: prop.name,\n        type: prop.type,\n        readonly: prop.readonly,\n      };\n    }\n\n    const constructorParams: ApiParam[] = (type.initOverloads[0] ?? []).map((p) => ({\n      name: p.name,\n      type: p.type,\n      optional: p.optional,\n      passingStyle: 'positional' as const,\n    }));\n\n    classes[type.name] = {\n      name: type.name,\n      sourceFile: type.sourceFile,\n      methods: sortRecord(methods),\n      properties: sortRecord(properties),\n      constructorParams,\n    };\n    collector.add(type.sourceFile, type.name);\n  }\n\n  for (const en of allEnums) {\n    enums[en.name] = {\n      name: en.name,\n      sourceFile: en.sourceFile,\n      members: sortRecord(en.members),\n    };\n    collector.add(en.sourceFile, en.name);\n  }\n\n  for (const ta of allTypeAliases) {\n    typeAliases[ta.name] = {\n      name: ta.name,\n      sourceFile: ta.sourceFile,\n      value: ta.value,\n    };\n    collector.add(ta.sourceFile, ta.name);\n  }\n\n  return {\n    classes: sortRecord(classes),\n    interfaces: sortRecord(interfaces),\n    typeAliases: sortRecord(typeAliases),\n    enums: sortRecord(enums),\n    exports: sortRecord(collector.toRecord()),\n  };\n}\n","/**\n * Swift (iOS) API surface extractor.\n *\n * Walks `.swift` files (excluding tests, Package.swift, and build\n * directories), parses public structs, classes, actors, extensions, enums,\n * and type aliases, then builds an `ApiSurface`.\n *\n * Parser:  `ios-parser.ts`  — string-aware regex Swift source analysis\n * Surface: `ios-surface.ts` — ApiSurface construction\n */\n\nimport { ExtractorError } from '../../errors.js';\nimport type { Extractor, ApiSurface, LanguageHints } from '../types.js';\nimport type { CompatSnapshot } from '../ir.js';\nimport { apiSurfaceToSnapshot } from '../ir.js';\nimport { defaultIsNullableOnlyDifference } from '../language-hints.js';\nimport { walkSwiftFiles, parseSwiftFile } from './ios-parser.js';\nimport { buildSurface } from './ios-surface.js';\nimport type { SwiftTypeDecl, SwiftEnum, SwiftTypeAlias } from './ios-parser.js';\n\n// ---------------------------------------------------------------------------\n// Language hints\n// ---------------------------------------------------------------------------\n\nconst PRIMITIVES = [\n  'String',\n  'Int',\n  'Int32',\n  'Int64',\n  'Double',\n  'Float',\n  'Bool',\n  'Void',\n  'Data',\n  'Date',\n  'URL',\n  'UUID',\n];\n\n/** Unwrap `[Element]` and `[Key: Value]` sugar; returns the element/value type. */\nfunction unwrapBrackets(type: string): string {\n  const bracketMatch = type.match(/^\\[(.+)\\]$/);\n  if (!bracketMatch) return type;\n  const inner = bracketMatch[1].trim();\n  // Dictionary: the value type is the interesting one.\n  const colonIdx = inner.indexOf(':');\n  return colonIdx === -1 ? inner : inner.slice(colonIdx + 1).trim();\n}\n\nconst iosHints: LanguageHints = {\n  stripNullable(type: string): string | null {\n    if (type.endsWith('?')) return type.slice(0, -1);\n    return null;\n  },\n  isNullableOnlyDifference(a: string, b: string): boolean {\n    return defaultIsNullableOnlyDifference(this, a, b);\n  },\n  isUnionReorder(_a: string, _b: string): boolean {\n    return false; // Swift doesn't have union types\n  },\n  isGenericTypeParam(type: string): boolean {\n    return /^[A-Z]$/.test(type) || /^T[A-Z][a-zA-Z]*$/.test(type);\n  },\n  isExtractionArtifact(type: string): boolean {\n    return ['Any', 'Any?', 'AnyObject', 'AnyCodable', 'AnyCodable?'].includes(type);\n  },\n  tolerateCategoryMismatch: true,\n  extractReturnTypeName(returnType: string): string | null {\n    let inner = returnType.trim();\n    // Unwrap optional\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    // Unwrap [Element] / [Key: Value] sugar\n    inner = unwrapBrackets(inner);\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    // Unwrap Page<T> → T (the generated pagination wrapper)\n    const pageMatch = inner.match(/^Page<(.+)>$/);\n    if (pageMatch) inner = pageMatch[1];\n    if (PRIMITIVES.includes(inner)) return null;\n    return inner;\n  },\n  extractParamTypeName(paramType: string): string | null {\n    let inner = paramType.trim();\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    inner = unwrapBrackets(inner);\n    if (inner.endsWith('?')) inner = inner.slice(0, -1);\n    if (PRIMITIVES.includes(inner)) return null;\n    return inner;\n  },\n  propertyMatchesClass(propertyName: string, className: string): boolean {\n    // camelCase property vs PascalCase type\n    return propertyName.toLowerCase() === className.toLowerCase();\n  },\n  derivedModelNames(modelName: string): string[] {\n    return [`${modelName}Response`];\n  },\n};\n\n// ---------------------------------------------------------------------------\n// Extractor\n// ---------------------------------------------------------------------------\n\nexport const iosExtractor: Extractor = {\n  language: 'ios',\n  hints: iosHints,\n\n  async extractSnapshot(sdkPath: string): Promise<CompatSnapshot> {\n    const surface = await this.extract(sdkPath);\n    return apiSurfaceToSnapshot(surface);\n  },\n\n  async extract(sdkPath: string): Promise<ApiSurface> {\n    const swiftFiles = walkSwiftFiles(sdkPath);\n    if (swiftFiles.length === 0) {\n      throw new ExtractorError(\n        `No .swift files found in ${sdkPath}`,\n        `Ensure the --sdk-path argument points to a Swift package root containing .swift source files.`,\n      );\n    }\n\n    const allTypes: SwiftTypeDecl[] = [];\n    const allEnums: SwiftEnum[] = [];\n    const allTypeAliases: SwiftTypeAlias[] = [];\n\n    for (const filePath of swiftFiles) {\n      const parsed = parseSwiftFile(filePath, sdkPath);\n      allTypes.push(...parsed.types);\n      allEnums.push(...parsed.enums);\n      allTypeAliases.push(...parsed.typeAliases);\n    }\n\n    const { classes, interfaces, typeAliases, enums, exports } = buildSurface(allTypes, allEnums, allTypeAliases);\n\n    return {\n      language: 'ios',\n      extractedFrom: sdkPath,\n      extractedAt: new Date().toISOString(),\n      classes,\n      interfaces,\n      typeAliases,\n      enums,\n      exports,\n    };\n  },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,sBACd,oBACkB;CAClB,MAAM,0BAAU,IAAI,IAA8B;CAElD,KAAK,MAAM,EAAE,MAAM,QAAQ,cAAc,oBACvC,KAAK,MAAM,UAAU,OAAO,SAAS;EACnC,MAAM,WAAW,QAAQ,IAAI,OAAO,kBAAkB;EACtD,IAAI,UACF,SAAS,OAAO,YAAY,OAAO;OAEnC,QAAQ,IAAI,OAAO,oBAAoB;GACrC,IAAI,OAAO;GACX,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,QAAQ,GAAG,WAAW,OAAO,SAAS;GACtC,SAAS,OAAO;GAChB,KAAK,OAAO;GACZ,KAAK,OAAO;EACd,CAAC;CAEL;CAGF,OAAO,EACL,mBAAmB,CAAC,GAAG,QAAQ,OAAO,CAAC,EACzC;AACF;;AAGA,SAAgB,gBAAgB,QAAgD;CAC9E,MAAM,aAAa,OAAO,OAAO,OAAO,MAAM;CAC9C,IAAI,WAAW,SAAS,UAAU,GAAG,OAAO;CAC5C,IAAI,WAAW,SAAS,WAAW,GAAG,OAAO;CAC7C,OAAO;AACT;;AAGA,SAAgB,2BAA2B,QAIzC;CACA,IAAI,WAAW;CACf,IAAI,WAAW;CACf,IAAI,WAAW;CACf,KAAK,MAAM,UAAU,OAAO,mBAAmB;EAC7C,MAAM,MAAM,gBAAgB,MAAM;EACl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