@thanh01.pmt/domain-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +1101 -0
  2. package/dist/assembly/index.cjs +213 -0
  3. package/dist/assembly/index.cjs.map +1 -0
  4. package/dist/assembly/index.d.cts +66 -0
  5. package/dist/assembly/index.d.ts +66 -0
  6. package/dist/assembly/index.mjs +4 -0
  7. package/dist/assembly/index.mjs.map +1 -0
  8. package/dist/chunk-3H2HX7PR.mjs +324 -0
  9. package/dist/chunk-3H2HX7PR.mjs.map +1 -0
  10. package/dist/chunk-3VVPSRAM.mjs +1297 -0
  11. package/dist/chunk-3VVPSRAM.mjs.map +1 -0
  12. package/dist/chunk-DRVOV5ZD.mjs +314 -0
  13. package/dist/chunk-DRVOV5ZD.mjs.map +1 -0
  14. package/dist/chunk-F4RZNBOE.mjs +3 -0
  15. package/dist/chunk-F4RZNBOE.mjs.map +1 -0
  16. package/dist/chunk-GEUDHZE7.mjs +446 -0
  17. package/dist/chunk-GEUDHZE7.mjs.map +1 -0
  18. package/dist/chunk-HH4UX65C.mjs +100 -0
  19. package/dist/chunk-HH4UX65C.mjs.map +1 -0
  20. package/dist/chunk-KMYENICQ.mjs +3 -0
  21. package/dist/chunk-KMYENICQ.mjs.map +1 -0
  22. package/dist/chunk-KNDBODUQ.mjs +153 -0
  23. package/dist/chunk-KNDBODUQ.mjs.map +1 -0
  24. package/dist/chunk-MM2RWYNW.mjs +3 -0
  25. package/dist/chunk-MM2RWYNW.mjs.map +1 -0
  26. package/dist/chunk-MOKNFLUD.mjs +851 -0
  27. package/dist/chunk-MOKNFLUD.mjs.map +1 -0
  28. package/dist/chunk-ONQHJ4OH.mjs +211 -0
  29. package/dist/chunk-ONQHJ4OH.mjs.map +1 -0
  30. package/dist/chunk-PM42MMDJ.mjs +516 -0
  31. package/dist/chunk-PM42MMDJ.mjs.map +1 -0
  32. package/dist/chunk-RKRNOVKO.mjs +166 -0
  33. package/dist/chunk-RKRNOVKO.mjs.map +1 -0
  34. package/dist/chunk-VFART56O.mjs +884 -0
  35. package/dist/chunk-VFART56O.mjs.map +1 -0
  36. package/dist/chunk-XMHKWHVK.mjs +218 -0
  37. package/dist/chunk-XMHKWHVK.mjs.map +1 -0
  38. package/dist/conceptEscalator-YfMKIKCZ.d.ts +40 -0
  39. package/dist/conceptEscalator-ltRLtPhf.d.cts +40 -0
  40. package/dist/concepts/index.cjs +155 -0
  41. package/dist/concepts/index.cjs.map +1 -0
  42. package/dist/concepts/index.d.cts +79 -0
  43. package/dist/concepts/index.d.ts +79 -0
  44. package/dist/concepts/index.mjs +4 -0
  45. package/dist/concepts/index.mjs.map +1 -0
  46. package/dist/curriculumFeedSchema-TEeQg2bY.d.cts +549 -0
  47. package/dist/curriculumFeedSchema-TEeQg2bY.d.ts +549 -0
  48. package/dist/detector/index.cjs +889 -0
  49. package/dist/detector/index.cjs.map +1 -0
  50. package/dist/detector/index.d.cts +112 -0
  51. package/dist/detector/index.d.ts +112 -0
  52. package/dist/detector/index.mjs +3 -0
  53. package/dist/detector/index.mjs.map +1 -0
  54. package/dist/domainProfileSchema-CwT3Ffsw.d.cts +105 -0
  55. package/dist/domainProfileSchema-CwT3Ffsw.d.ts +105 -0
  56. package/dist/extractors/index.cjs +387 -0
  57. package/dist/extractors/index.cjs.map +1 -0
  58. package/dist/extractors/index.d.cts +46 -0
  59. package/dist/extractors/index.d.ts +46 -0
  60. package/dist/extractors/index.mjs +4 -0
  61. package/dist/extractors/index.mjs.map +1 -0
  62. package/dist/feed/index.cjs +421 -0
  63. package/dist/feed/index.cjs.map +1 -0
  64. package/dist/feed/index.d.cts +23 -0
  65. package/dist/feed/index.d.ts +23 -0
  66. package/dist/feed/index.mjs +4 -0
  67. package/dist/feed/index.mjs.map +1 -0
  68. package/dist/graph/index.cjs +2167 -0
  69. package/dist/graph/index.cjs.map +1 -0
  70. package/dist/graph/index.d.cts +226 -0
  71. package/dist/graph/index.d.ts +226 -0
  72. package/dist/graph/index.mjs +4 -0
  73. package/dist/graph/index.mjs.map +1 -0
  74. package/dist/graphVerifier-DsTP9uAN.d.ts +37 -0
  75. package/dist/graphVerifier-QjgDAJce.d.cts +37 -0
  76. package/dist/hybridGraphSchema-BCgXicgA.d.cts +2840 -0
  77. package/dist/hybridGraphSchema-BCgXicgA.d.ts +2840 -0
  78. package/dist/index.cjs +5539 -0
  79. package/dist/index.cjs.map +1 -0
  80. package/dist/index.d.cts +18 -0
  81. package/dist/index.d.ts +18 -0
  82. package/dist/index.mjs +17 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/keywordExtractor-CKaXqSku.d.ts +34 -0
  85. package/dist/keywordExtractor-zPAz2isq.d.cts +34 -0
  86. package/dist/llmClient-ysPhLjcH.d.cts +16 -0
  87. package/dist/llmClient-ysPhLjcH.d.ts +16 -0
  88. package/dist/parsers/index.cjs +323 -0
  89. package/dist/parsers/index.cjs.map +1 -0
  90. package/dist/parsers/index.d.cts +98 -0
  91. package/dist/parsers/index.d.ts +98 -0
  92. package/dist/parsers/index.mjs +4 -0
  93. package/dist/parsers/index.mjs.map +1 -0
  94. package/dist/pipeline/index.cjs +2166 -0
  95. package/dist/pipeline/index.cjs.map +1 -0
  96. package/dist/pipeline/index.d.cts +45 -0
  97. package/dist/pipeline/index.d.ts +45 -0
  98. package/dist/pipeline/index.mjs +8 -0
  99. package/dist/pipeline/index.mjs.map +1 -0
  100. package/dist/projectGraphSchema-DnD7orZV.d.cts +2581 -0
  101. package/dist/projectGraphSchema-DnD7orZV.d.ts +2581 -0
  102. package/dist/schemas/index.cjs +675 -0
  103. package/dist/schemas/index.cjs.map +1 -0
  104. package/dist/schemas/index.d.cts +253 -0
  105. package/dist/schemas/index.d.ts +253 -0
  106. package/dist/schemas/index.mjs +4 -0
  107. package/dist/schemas/index.mjs.map +1 -0
  108. package/package.json +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/detector/inputTypeDetector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ACvB,KAAK,QAAA;AAAU,MAAA,OAAO,cAAA;AAAA,IACtB;AAAS,MAAA,OAAO,eAAA;AAAA;AAEpB","file":"chunk-VFART56O.mjs","sourcesContent":["/**\n * Input Type Detection — determines what kind of input the user provided.\n *\n * Signals:\n * repository: repoUrl, repoDir, or source code files present\n * syllabus: syllabusText, chapters[], or curriculum-like structure\n * files: non-code files (3D models, images, documents)\n * description: free-text description (>100 chars)\n * mixed: combination of the above\n */\n\nimport type { InputType } from '../schemas/domainProfileSchema';\n\nexport interface InputTypeDetectionResult {\n inputType: InputType;\n confidence: number;\n evidence: string[];\n}\n\nexport interface DetectInputTypeOptions {\n repoUrl?: string;\n repoDir?: string;\n description?: string;\n syllabusText?: string;\n chapters?: string[];\n fileExtensions?: string[];\n goal?: string;\n}\n\nconst CODE_EXTENSIONS = new Set([\n '.swift', '.ts', '.tsx', '.js', '.jsx', '.py', '.ino', '.cpp', '.c', '.h', '.hpp',\n '.kt', '.kts', '.java', '.cs', '.rb', '.go', '.rs', '.php', '.lua', '.r', '.m',\n]);\n\nconst NON_CODE_EXTENSIONS = new Set([\n '.stl', '.obj', '.step', '.stp', '.iges', '.igs', // 3D models\n '.png', '.jpg', '.jpeg', '.gif', '.svg', '.bmp', // Images\n '.pdf', '.doc', '.docx', '.pptx', '.xlsx', // Documents\n '.tc3', '.f3d', // CAD files\n '.mp3', '.wav', '.midi', // Audio\n '.mp4', '.avi', '.mov', // Video\n]);\n\n/**\n * Detect input type from user-provided options.\n */\nexport function detectInputType(options: DetectInputTypeOptions): InputTypeDetectionResult {\n const evidence: string[] = [];\n let repoScore = 0;\n let syllabusScore = 0;\n let filesScore = 0;\n let descriptionScore = 0;\n\n // Check for repository signals\n if (options.repoUrl) {\n repoScore += 0.5;\n evidence.push(`repoUrl provided: ${options.repoUrl}`);\n }\n if (options.repoDir) {\n repoScore += 0.5;\n evidence.push(`repoDir provided: ${options.repoDir}`);\n }\n\n // Check for syllabus signals\n if (options.syllabusText && options.syllabusText.length > 50) {\n syllabusScore += 0.6;\n evidence.push(`syllabusText provided (${options.syllabusText.length} chars)`);\n }\n if (options.chapters && options.chapters.length > 0) {\n syllabusScore += 0.4;\n evidence.push(`${options.chapters.length} chapters provided`);\n }\n\n // Check for file signals\n if (options.fileExtensions && options.fileExtensions.length > 0) {\n const codeCount = options.fileExtensions.filter(ext => CODE_EXTENSIONS.has(ext)).length;\n const nonCodeCount = options.fileExtensions.filter(ext => NON_CODE_EXTENSIONS.has(ext)).length;\n\n if (nonCodeCount > 0) {\n filesScore += 0.7;\n evidence.push(`${nonCodeCount} non-code files detected: ${options.fileExtensions.filter(ext => NON_CODE_EXTENSIONS.has(ext)).join(', ')}`);\n }\n if (codeCount > 0 && repoScore === 0) {\n repoScore += 0.3;\n evidence.push(`${codeCount} source code files detected`);\n }\n }\n\n // Check for description signals\n if (options.description && options.description.length > 100) {\n descriptionScore += 0.5;\n evidence.push(`description provided (${options.description.length} chars)`);\n }\n if (options.goal && options.goal.length > 20) {\n descriptionScore += 0.3;\n evidence.push(`goal provided (${options.goal.length} chars)`);\n }\n\n // Determine winner\n const scores = [\n { type: 'repository' as InputType, score: repoScore },\n { type: 'syllabus' as InputType, score: syllabusScore },\n { type: 'files' as InputType, score: filesScore },\n { type: 'description' as InputType, score: descriptionScore },\n ];\n\n scores.sort((a, b) => b.score - a.score);\n const winner = scores[0];\n\n // Check for mixed\n const activeTypes = scores.filter(s => s.score >= 0.3);\n if (activeTypes.length >= 2) {\n return {\n inputType: 'mixed',\n confidence: 0.7,\n evidence: [...evidence, `Mixed input detected: ${activeTypes.map(t => t.type).join(' + ')}`],\n };\n }\n\n if (winner.score === 0) {\n return {\n inputType: 'description',\n confidence: 0.3,\n evidence: [...evidence, 'No strong signals — defaulting to description'],\n };\n }\n\n return {\n inputType: winner.type,\n confidence: Math.min(winner.score, 1.0),\n evidence,\n };\n}\n","/**\n * Domain Category Detection — determines the subject domain from context.\n *\n * Uses multi-signal scoring:\n * - File extensions (code vs non-code, context-dependent)\n * - Keywords in description/goal (multi-language)\n * - Tech stack mentions\n * - Subject-specific vocabulary\n * - Disambiguation for overlapping domains (e.g., .cpp in software vs hardware)\n */\n\nimport type { DomainCategory } from '../schemas/domainProfileSchema';\n\nexport interface DomainDetectionResult {\n domainCategory: DomainCategory;\n confidence: number;\n evidence: string[];\n detectedTechStack: string[];\n detectedSubject: string;\n ambiguous?: { domain1: DomainCategory; domain2: DomainCategory; reason: string };\n}\n\nexport interface DetectDomainOptions {\n description?: string;\n goal?: string;\n syllabusText?: string;\n techStack?: string;\n fileExtensions?: string[];\n repoUrl?: string;\n}\n\n\n\n\n// ─── Keyword lists per domain (broad matching) ──────────────────────────────\nconst DOMAIN_KEYWORDS: Record<DomainCategory, string[]> = {\n software: [\n 'app', 'web', 'api', 'database', 'frontend', 'backend', 'mobile',\n 'swift', 'react', 'vue', 'angular', 'node', 'python', 'java',\n 'typescript', 'javascript', 'html', 'css', 'sql', 'rest', 'graphql',\n 'git', 'docker', 'kubernetes', 'ci/cd', 'deploy',\n 'swiftui', 'uikit', 'flutter', 'kotlin', 'android', 'ios',\n 'nextjs', 'nuxt', 'svelte', 'django', 'flask', 'express',\n ],\n hardware_iot: [\n 'arduino', 'robot', 'sensor', 'motor', 'esp32', 'gpio',\n 'raspberry pi', 'iot', 'firmware', 'embedded', 'microcontroller',\n 'led', 'servo', 'potentiometer', 'breadboard', 'soldering',\n 'i2c', 'spi', 'pwm', 'uart', 'analog', 'digital',\n 'ultrasonic', 'infrared', 'bluetooth', 'wifi module',\n 'pin', 'voltage', 'resistor', 'capacitor', 'circuit',\n ],\n '3d_design': [\n 'tinkercad', '3d model', 'cad', 'parametric', 'stl', 'obj',\n 'fusion360', 'blender', 'solidworks', 'autocad', 'freecad',\n 'shape', 'dimension', 'extrude', 'revolve', 'fillet', 'chamfer',\n 'assembly', 'constraint', 'sketch', 'plane', 'axis',\n 'render', 'mesh', 'nurbs', 'surface', 'volume',\n ],\n math: [\n // Vietnamese\n 'hình học', 'đại số', 'giải tích', 'xác suất', 'thống kê',\n 'tam giác', 'đường tròn', 'phương trình', 'bất phương trình',\n 'số học', 'tổ hợp', 'hoán vị', 'độ đo', 'góc', 'cạnh',\n 'diện tích', 'thể tích', 'chu vi', 'đường cao', 'trung tuyến',\n // English\n 'geometry', 'algebra', 'calculus', 'trigonometry', 'logarithm',\n 'probability', 'statistics', 'derivative', 'integral', 'matrix',\n 'vector', 'theorem', 'proof', 'angle', 'perimeter', 'area',\n // Chinese\n '几何', '代数', '微积分', '概率', '统计', '三角形', '圆', '方程',\n // Japanese\n '幾何', '代数', '微分', '積分', '確率', '統計',\n // French\n 'géométrie', 'algèbre', 'calcul', 'trigonométrie', 'probabilité',\n ],\n science: [\n // Vietnamese\n 'lý thuyết', 'nguyên lý', 'thí nghiệm', 'điện', 'lực',\n 'hóa học', 'sinh học', 'vật lý', 'địa lý',\n 'phản ứng', 'nguyên tố', 'phân tử',\n 'năng lượng', 'cảm ứng', 'từ trường', 'quang học',\n 'môi trường', 'sinh thái',\n // English\n 'physics', 'chemistry', 'biology', 'earth science',\n 'cell', 'gene', 'evolution', 'ecosystem', 'molecule', 'atom',\n // Chinese\n '物理', '化学', '生物', '地理',\n // Japanese\n '物理', '化学', '生物',\n // French\n 'physique', 'chimie', 'biologie',\n ],\n language: [\n // Vietnamese\n 'tiếng anh', 'tiếng việt', 'ngữ pháp', 'từ vựng',\n 'đọc', 'viết', 'nói', 'nghe',\n // English\n 'grammar', 'vocabulary', 'writing', 'reading', 'speaking',\n 'listening', 'pronunciation', 'essay', 'paragraph', 'sentence',\n 'verb', 'noun', 'adjective', 'ielts', 'toeic', 'toefl',\n // Chinese\n '英语', '语法', '词汇', '阅读', '写作',\n // Japanese\n '英語', '文法', '語彙', '読解', '作文',\n // French\n 'anglais', 'grammaire', 'vocabulaire', 'lecture', 'écriture',\n ],\n arts: [\n // Vietnamese\n 'âm nhạc', 'nhạc lý', 'solfège', 'đàn', 'piano', 'guitar',\n 'hội họa', 'thiết kế', 'nhiếp ảnh',\n 'tranh', 'màu', 'sáng tác', 'biên khúc',\n // English\n 'music', 'art', 'painting', 'drawing', 'sketch', 'photography',\n 'color theory', 'composition', 'typography', 'layout',\n 'digital art', 'illustration', 'figma',\n // Chinese\n '音乐', '美术', '绘画', '摄影', '设计',\n // Japanese\n '音楽', '美術', '絵画', '写真', 'デザイン',\n // French\n 'musique', 'art', 'peinture', 'dessin', 'photographie',\n ],\n research: [\n // Vietnamese\n 'nghiên cứu', 'thống kê', 'phương pháp luận', 'phân tích dữ liệu',\n 'định tính', 'định lượng', 'giả thuyết',\n 'mẫu', 'tổng thể', 'tương quan', 'hồi quy',\n 'tài liệu tham khảo', 'trích dẫn', 'tóm tắt',\n // English\n 'research', 'survey', 'methodology', 'data analysis',\n 'qualitative', 'quantitative', 'hypothesis', 'experiment',\n 'sample', 'population', 'correlation', 'regression',\n 'literature review', 'citation', 'abstract',\n // Chinese\n '研究', '调查', '方法论', '数据分析',\n // Japanese\n '研究', '調査', '方法論', 'データ分析',\n // French\n 'recherche', 'enquête', 'méthodologie', 'analyse de données',\n ],\n business: [\n // Vietnamese\n 'kinh doanh', 'tài chính', 'quản lý', 'marketing', 'bán hàng',\n 'khởi nghiệp', 'kế hoạch kinh doanh', 'doanh thu', 'lợi nhuận',\n 'quản trị', 'tài khoản', 'đầu tư', 'ngân sách',\n // English\n 'business', 'finance', 'accounting', 'investment', 'budget',\n 'startup', 'revenue', 'profit', 'roi', 'sales',\n 'product management', 'agile', 'scrum', 'kanban',\n // Chinese\n '商业', '金融', '会计', '投资', '营销',\n // Japanese\n 'ビジネス', '金融', '会計', '投資', 'マーケティング',\n // French\n 'affaires', 'finance', 'comptabilité', 'investissement',\n ],\n other: [],\n};\n\n// ─── Extension → Domain mapping (context-dependent for ambiguous extensions) ──\nconst EXTENSION_DOMAIN: Record<string, DomainCategory> = {\n '.swift': 'software',\n '.ts': 'software', '.tsx': 'software',\n '.js': 'software', '.jsx': 'software',\n '.py': 'software',\n '.kt': 'software', '.kts': 'software',\n '.java': 'software', '.cs': 'software',\n '.go': 'software', '.rs': 'software',\n '.rb': 'software', '.php': 'software',\n '.lua': 'software', '.r': 'software',\n // .ino is ALWAYS hardware\n '.ino': 'hardware_iot',\n // .cpp/.c/.h are CONTEXT-DEPENDENT → resolve in detection logic\n '.stl': '3d_design', '.obj': '3d_design',\n '.step': '3d_design', '.stp': '3d_design',\n '.tc3': '3d_design', '.f3d': '3d_design',\n};\n\n// Extensions that need context disambiguation\nconst AMBIGUOUS_EXTENSIONS = new Set(['.cpp', '.c', '.h', '.hpp']);\n\n// ─── Syllabus language detection ─────────────────────────────────────────────\nconst LANG_PATTERNS: Array<{ lang: string; patterns: RegExp[] }> = [\n { lang: 'vi', patterns: [/[ạảãàáạảãạ]/i, /\\bgiải\\b/, /\\btính\\b/] },\n { lang: 'zh', patterns: [/[\\u4e00-\\u9fff]{2,}/] },\n { lang: 'ja', patterns: [/[\\u3040-\\u309f\\u30a0-\\u30ff]{2,}/] },\n { lang: 'ko', patterns: [/[\\uac00-\\ud7af]{2,}/] },\n { lang: 'fr', patterns: [/\\b(la|le|les|des|une|est|sont|avec|pour|dans)\\b/i] },\n];\n\nfunction detectSyllabusLanguage(text: string): string {\n for (const { lang, patterns } of LANG_PATTERNS) {\n if (patterns.some(p => p.test(text))) return lang;\n }\n return 'en';\n}\n\n// ─── Main Detection Function ─────────────────────────────────────────────────\nexport function detectDomain(options: DetectDomainOptions): DomainDetectionResult {\n const evidence: string[] = [];\n const detectedTechStack: string[] = [];\n let detectedSubject = '';\n let ambiguous: DomainDetectionResult['ambiguous'];\n\n const scores: Record<DomainCategory, number> = {\n software: 0, hardware_iot: 0, '3d_design': 0,\n math: 0, science: 0, language: 0, arts: 0,\n research: 0, business: 0, other: 0,\n };\n\n // ─── 1. File Extension Signals ───────────────────────────────────────────\n const hasHardwareContext = !!(\n options.techStack?.toLowerCase().match(/arduino|esp32|raspberry|embedded|iot/)\n || options.description?.toLowerCase().match(/arduino|robot|sensor|motor|circuit/)\n || options.goal?.toLowerCase().match(/arduino|robot|sensor|motor|circuit/)\n );\n\n const hasSoftwareContext = !!(\n options.techStack?.toLowerCase().match(/swift|react|vue|angular|python|java|typescript|javascript/)\n || options.description?.toLowerCase().match(/app|web|api|frontend|backend|mobile/)\n || options.goal?.toLowerCase().match(/app|web|api|frontend|backend|mobile/)\n );\n\n if (options.fileExtensions) {\n for (const ext of options.fileExtensions) {\n const extLower = ext.toLowerCase();\n\n // Always-hardware extensions\n if (extLower === '.ino') {\n scores.hardware_iot += 0.5;\n evidence.push(`File extension ${ext} → hardware_iot (always)`);\n continue;\n }\n\n // Ambiguous extensions → context-dependent\n if (AMBIGUOUS_EXTENSIONS.has(extLower)) {\n if (hasHardwareContext && !hasSoftwareContext) {\n scores.hardware_iot += 0.3;\n evidence.push(`File extension ${ext} → hardware_iot (hardware context)`);\n } else if (hasSoftwareContext && !hasHardwareContext) {\n scores.software += 0.3;\n evidence.push(`File extension ${ext} → software (software context)`);\n } else if (hasHardwareContext && hasSoftwareContext) {\n // Both contexts → slight preference for software (more common for .cpp)\n scores.software += 0.15;\n scores.hardware_iot += 0.15;\n evidence.push(`File extension ${ext} → ambiguous (both software and hardware context)`);\n ambiguous = {\n domain1: 'software',\n domain2: 'hardware_iot',\n reason: `.cpp/.c/.h files present with both software and hardware context keywords`,\n };\n } else {\n // No context → default to software\n scores.software += 0.2;\n evidence.push(`File extension ${ext} → software (default, no context)`);\n }\n continue;\n }\n\n // Clear mapping extensions\n const domain = EXTENSION_DOMAIN[extLower];\n if (domain) {\n scores[domain] += 0.3;\n evidence.push(`File extension ${ext} → ${domain}`);\n }\n }\n }\n\n // ─── 2. Text Content Signals (multi-language) ─────────────────────────────\n const textContent = [\n options.description || '',\n options.goal || '',\n options.syllabusText || '',\n ].join(' ').toLowerCase();\n\n for (const [domain, keywords] of Object.entries(DOMAIN_KEYWORDS)) {\n const cat = domain as DomainCategory;\n for (const kw of keywords) {\n if (textContent.includes(kw.toLowerCase())) {\n scores[cat] += 0.1;\n if (!evidence.some(e => e.includes(`\"${kw}\"`))) {\n evidence.push(`Keyword \"${kw}\" → ${cat}`);\n }\n }\n }\n }\n\n // ─── 3. Tech Stack Signals ────────────────────────────────────────────────\n if (options.techStack) {\n const techItems = options.techStack.split(',').map(t => t.trim());\n for (const tech of techItems) {\n const techL = tech.toLowerCase();\n if (['swift', 'swiftui', 'uikit', 'ios'].some(k => techL.includes(k))) {\n scores.software += 0.4;\n detectedTechStack.push(tech);\n } else if (['react', 'vue', 'angular', 'next', 'nuxt', 'typescript', 'javascript'].some(k => techL.includes(k))) {\n scores.software += 0.4;\n detectedTechStack.push(tech);\n } else if (['python', 'django', 'flask'].some(k => techL.includes(k))) {\n scores.software += 0.3;\n detectedTechStack.push(tech);\n } else if (['arduino', 'esp32', 'raspberry'].some(k => techL.includes(k))) {\n scores.hardware_iot += 0.5;\n detectedTechStack.push(tech);\n } else if (['tinkercad', 'fusion360', 'blender'].some(k => techL.includes(k))) {\n scores['3d_design'] += 0.5;\n detectedTechStack.push(tech);\n } else if (['c++', 'c', 'cpp'].some(k => techL === k || techL.endsWith(k))) {\n // C++/C → context-dependent\n if (hasHardwareContext) {\n scores.hardware_iot += 0.3;\n } else {\n scores.software += 0.3;\n }\n detectedTechStack.push(tech);\n }\n }\n }\n\n // ─── 4. Syllabus Content Signals (with language detection) ────────────────\n if (options.syllabusText) {\n const syllabusLang = detectSyllabusLanguage(options.syllabusText);\n const syllabusLower = options.syllabusText.toLowerCase();\n\n if (syllabusLower.includes('hình học') || syllabusLower.includes('đại số')\n || syllabusLower.includes('geometry') || syllabusLower.includes('algebra')\n || syllabusLower.includes('几何') || syllabusLower.includes('代数')\n || syllabusLower.includes('幾何') || syllabusLower.includes('代数')\n || syllabusLower.includes('géométrie') || syllabusLower.includes('algèbre')) {\n scores.math += 0.5;\n detectedSubject = 'Mathematics';\n } else if (syllabusLower.includes('vật lý') || syllabusLower.includes('hóa')\n || syllabusLower.includes('sinh') || syllabusLower.includes('physics')\n || syllabusLower.includes('chemistry') || syllabusLower.includes('biology')\n || syllabusLower.includes('物理') || syllabusLower.includes('化学')\n || syllabusLower.includes('物理') || syllabusLower.includes('化学')\n || syllabusLower.includes('physique') || syllabusLower.includes('chimie')) {\n scores.science += 0.5;\n detectedSubject = 'Natural Science';\n } else if (syllabusLower.includes('tiếng anh') || syllabusLower.includes('english')\n || syllabusLower.includes('grammar') || syllabusLower.includes('英语')\n || syllabusLower.includes('英語') || syllabusLower.includes('anglais')) {\n scores.language += 0.5;\n detectedSubject = 'English Language';\n }\n\n evidence.push(`Syllabus language detected: ${syllabusLang}`);\n }\n\n // ─── 5. Scoring & Winner ─────────────────────────────────────────────────\n const entries = Object.entries(scores).filter(([k]) => k !== 'other') as [DomainCategory, number][];\n entries.sort((a, b) => b[1] - a[1]);\n const [winner, winnerScore] = entries[0];\n\n if (winnerScore === 0) {\n return {\n domainCategory: 'other',\n confidence: 0.2,\n evidence: [...evidence, 'No domain signals detected'],\n detectedTechStack,\n detectedSubject,\n };\n }\n\n // Check for near-tie (within 0.15) → ambiguous\n const second = entries[1];\n if (second && (winnerScore - second[1]) < 0.15 && winnerScore > 0) {\n ambiguous = {\n domain1: winner,\n domain2: second[0],\n reason: `Scores very close: ${winner}=${winnerScore.toFixed(2)}, ${second[0]}=${second[1].toFixed(2)}`,\n };\n }\n\n const totalScore = entries.reduce((sum, [, s]) => sum + s, 0);\n const confidence = totalScore > 0 ? Math.min(winnerScore / totalScore + 0.3, 1.0) : 0.3;\n\n return {\n domainCategory: winner,\n confidence,\n evidence: evidence.slice(0, 20),\n detectedTechStack,\n detectedSubject,\n ambiguous,\n };\n}\n","/**\n * Learning Mode Detection — determines product vs concept vs hybrid.\n *\n * Logic:\n * - Repository + build verbs → product\n * - Syllabus + no source code → concept\n * - Repository + understanding verbs → hybrid\n * - Domain category heuristic (math/science → concept, software/hardware → product)\n */\n\nimport type { LearningMode, DomainCategory, InputType } from '../schemas/domainProfileSchema';\n\nexport interface LearningModeDetectionResult {\n learningMode: LearningMode;\n confidence: number;\n evidence: string[];\n}\n\nexport interface DetectLearningModeOptions {\n inputType: InputType;\n domainCategory: DomainCategory;\n goal?: string;\n description?: string;\n hasRepo: boolean;\n hasSyllabus: boolean;\n}\n\n// ─── Verb patterns ───────────────────────────────────────────────────────────\n\nconst BUILD_VERBS = [\n 'build', 'create', 'develop', 'implement', 'construct', 'make',\n 'xây dựng', 'tạo', 'phát triển', 'triển khai', 'lắp ráp',\n 'code', 'program', 'design a', 'set up', 'deploy',\n];\n\nconst UNDERSTAND_VERBS = [\n 'understand', 'learn', 'grasp', 'comprehend', 'master',\n 'hiểu', 'nắm vững', 'học', 'tiếp thu', 'am hiểu',\n 'vận dụng', 'phân tích', 'đánh giá', 'so sánh',\n 'explain', 'describe', 'analyze', 'evaluate', 'compare',\n];\n\nconst CONCEPT_DOMAINS: DomainCategory[] = ['math', 'science', 'language', 'arts', 'research', 'business'];\nconst PRODUCT_DOMAINS: DomainCategory[] = ['software', 'hardware_iot', '3d_design'];\n\n/**\n * Detect learning mode from context.\n */\nexport function detectLearningMode(options: DetectLearningModeOptions): LearningModeDetectionResult {\n const evidence: string[] = [];\n const text = [options.goal || '', options.description || ''].join(' ').toLowerCase();\n\n let productScore = 0;\n let conceptScore = 0;\n\n // 1. Input type signals\n if (options.hasRepo) {\n productScore += 0.3;\n evidence.push('Repository present → product signal');\n }\n if (options.hasSyllabus) {\n conceptScore += 0.3;\n evidence.push('Syllabus present → concept signal');\n }\n\n // 2. Domain category heuristic\n if (PRODUCT_DOMAINS.includes(options.domainCategory)) {\n productScore += 0.2;\n evidence.push(`Domain ${options.domainCategory} → product倾向`);\n }\n if (CONCEPT_DOMAINS.includes(options.domainCategory)) {\n conceptScore += 0.2;\n evidence.push(`Domain ${options.domainCategory} → concept倾向`);\n }\n\n // 3. Verb pattern matching\n const hasBuildVerbs = BUILD_VERBS.some(v => text.includes(v));\n const hasUnderstandVerbs = UNDERSTAND_VERBS.some(v => text.includes(v));\n\n if (hasBuildVerbs) {\n productScore += 0.3;\n evidence.push('Build verbs detected in goal/description');\n }\n if (hasUnderstandVerbs) {\n conceptScore += 0.3;\n evidence.push('Understand verbs detected in goal/description');\n }\n\n // 4. Determine mode\n const total = productScore + conceptScore;\n if (total === 0) {\n return {\n learningMode: 'product',\n confidence: 0.3,\n evidence: [...evidence, 'No signals — defaulting to product'],\n };\n }\n\n // Check for hybrid\n if (productScore >= 0.3 && conceptScore >= 0.3) {\n const hybridConf = Math.min((productScore + conceptScore) / 2, 1.0);\n return {\n learningMode: 'hybrid',\n confidence: hybridConf,\n evidence: [...evidence, `Mixed signals: product=${productScore.toFixed(2)}, concept=${conceptScore.toFixed(2)} → hybrid`],\n };\n }\n\n if (productScore > conceptScore) {\n const raw = total > 0 ? productScore / total : 0.5;\n return {\n learningMode: 'product',\n confidence: Math.min(Math.max(raw, 0) + 0.2, 1.0),\n evidence,\n };\n }\n\n const raw = total > 0 ? conceptScore / total : 0.5;\n return {\n learningMode: 'concept',\n confidence: Math.min(Math.max(raw, 0) + 0.2, 1.0),\n evidence,\n };\n}\n","/**\n * Domain Profile Detection Orchestrator — combines all detection modules.\n */\n\nimport { detectInputType, type DetectInputTypeOptions } from './inputTypeDetector';\nimport { detectDomain, type DetectDomainOptions } from './domainDetector';\nimport { detectLearningMode } from './learningModeDetector';\nimport type { DomainProfile, GraphType } from '../schemas/domainProfileSchema';\n\nexport interface DetectDomainProfileOptions {\n repoUrl?: string;\n repoDir?: string;\n description?: string;\n goal?: string;\n syllabusText?: string;\n chapters?: string[];\n fileExtensions?: string[];\n techStack?: string;\n gradeBand?: [number, number];\n}\n\nexport function detectDomainProfile(options: DetectDomainProfileOptions): DomainProfile {\n const inputResult = detectInputType(options);\n\n const domainResult = detectDomain({\n description: options.description,\n goal: options.goal,\n syllabusText: options.syllabusText,\n techStack: options.techStack,\n fileExtensions: options.fileExtensions,\n repoUrl: options.repoUrl,\n });\n\n const modeResult = detectLearningMode({\n inputType: inputResult.inputType,\n domainCategory: domainResult.domainCategory,\n goal: options.goal,\n description: options.description,\n hasRepo: !!(options.repoUrl || options.repoDir),\n hasSyllabus: !!(options.syllabusText || (options.chapters && options.chapters.length > 0)),\n });\n\n const graphType = determineGraphType(modeResult.learningMode);\n\n return {\n inputType: inputResult.inputType,\n domainCategory: domainResult.domainCategory,\n learningMode: modeResult.learningMode,\n graphType,\n confidence: {\n inputType: inputResult.confidence,\n domainCategory: domainResult.confidence,\n learningMode: modeResult.confidence,\n },\n evidence: [...inputResult.evidence, ...domainResult.evidence, ...modeResult.evidence],\n detectedTechStack: domainResult.detectedTechStack,\n detectedSubject: domainResult.detectedSubject,\n detectedDomain: domainResult.domainCategory,\n goal: options.goal || '',\n description: options.description || '',\n repoUrl: options.repoUrl || '',\n repoDir: options.repoDir || '',\n syllabusText: options.syllabusText || '',\n };\n}\n\nfunction determineGraphType(learningMode: string): GraphType {\n switch (learningMode) {\n case 'product': return 'project_graph';\n case 'concept': return 'knowledge_graph';\n case 'hybrid': return 'hybrid_graph';\n default: return 'project_graph';\n }\n}\n"]}
@@ -0,0 +1,218 @@
1
+ // src/extractors/keywordExtractor.ts
2
+ var STDLIB_MODULES = /* @__PURE__ */ new Set([
3
+ // Python
4
+ "os",
5
+ "sys",
6
+ "typing",
7
+ "json",
8
+ "re",
9
+ "math",
10
+ "random",
11
+ "time",
12
+ "datetime",
13
+ "pathlib",
14
+ "dataclasses",
15
+ "enum",
16
+ "collections",
17
+ "itertools",
18
+ "functools",
19
+ "logging",
20
+ "argparse",
21
+ "subprocess",
22
+ "threading",
23
+ "multiprocessing",
24
+ "asyncio",
25
+ "socket",
26
+ "http",
27
+ "urllib",
28
+ "ssl",
29
+ "hashlib",
30
+ "base64",
31
+ "csv",
32
+ "sqlite3",
33
+ "pickle",
34
+ "tempfile",
35
+ "shutil",
36
+ "glob",
37
+ "io",
38
+ "string",
39
+ "struct",
40
+ "uuid",
41
+ "abc",
42
+ "copy",
43
+ "decimal",
44
+ "fractions",
45
+ "statistics",
46
+ "queue",
47
+ "signal",
48
+ "traceback",
49
+ "warnings",
50
+ "weakref",
51
+ "contextlib",
52
+ "unittest",
53
+ "pytest",
54
+ "tkinter",
55
+ "tk",
56
+ "ttk",
57
+ "types",
58
+ "inspect",
59
+ "platform",
60
+ // Common third-party generic plumbing
61
+ "requests",
62
+ "urllib3",
63
+ "pydantic",
64
+ "dotenv",
65
+ "yaml",
66
+ "tomllib"
67
+ ]);
68
+ function platformFromPath(filePath) {
69
+ if (!filePath) return "app";
70
+ const fp = filePath.toLowerCase();
71
+ if (fp.endsWith(".ino") || fp.endsWith(".cpp") || fp.endsWith(".h") || fp.endsWith(".hpp") || fp.endsWith(".c")) {
72
+ if (fp.endsWith(".ino")) return "esp32";
73
+ if (fp.includes("firmware") || fp.includes("esp")) return "esp32";
74
+ return "app";
75
+ }
76
+ return "app";
77
+ }
78
+ function extractKeywords(sourceContext, basicAnalysis, repoDir, options) {
79
+ const keywords = [];
80
+ const effectiveStdlib = new Set(STDLIB_MODULES);
81
+ if (options?.extraStdlibModules) {
82
+ for (const m of options.extraStdlibModules) effectiveStdlib.add(m.toLowerCase());
83
+ }
84
+ if (options?.unskipModules) {
85
+ for (const m of options.unskipModules) effectiveStdlib.delete(m.toLowerCase());
86
+ }
87
+ if ("imports" in sourceContext) {
88
+ for (const imp of sourceContext.imports) {
89
+ let module;
90
+ let count = 1;
91
+ let platform = "app";
92
+ if (typeof imp === "string") {
93
+ module = imp;
94
+ } else if (imp && typeof imp === "object" && "module" in imp) {
95
+ const impObj = imp;
96
+ module = impObj.module;
97
+ count = impObj.count || 1;
98
+ platform = platformFromPath(impObj.file || "");
99
+ } else {
100
+ continue;
101
+ }
102
+ if (effectiveStdlib.has(module.toLowerCase())) continue;
103
+ keywords.push({
104
+ keyword: module,
105
+ source: "import",
106
+ platform,
107
+ weight: 1 + (count - 1) * 0.1,
108
+ context: `Imported ${count} times`
109
+ });
110
+ }
111
+ }
112
+ if ("types" in sourceContext) {
113
+ for (const typeDecl of sourceContext.types) {
114
+ const name = typeDecl.name;
115
+ const kind = typeDecl.kind;
116
+ const platform = platformFromPath(typeDecl.file || "");
117
+ if (["View", "Model", "ViewModel", "Controller", "Service", "Manager"].includes(name)) continue;
118
+ keywords.push({
119
+ keyword: name,
120
+ source: "type_declaration",
121
+ platform,
122
+ weight: 1.5,
123
+ context: `${kind} declaration`
124
+ });
125
+ }
126
+ }
127
+ if ("functions" in sourceContext) {
128
+ for (const func of sourceContext.functions) {
129
+ const name = func.name;
130
+ const platform = platformFromPath(func.file || "");
131
+ if (["init", "setup", "configure", "initialize"].includes(name)) continue;
132
+ keywords.push({
133
+ keyword: name,
134
+ source: "function_signature",
135
+ platform,
136
+ weight: 1.2,
137
+ context: "Function signature"
138
+ });
139
+ }
140
+ }
141
+ if ("docstrings" in sourceContext && Array.isArray(sourceContext.docstrings)) {
142
+ for (const doc of sourceContext.docstrings) {
143
+ const firstSentence = doc.trim().split("\n")[0].slice(0, 120);
144
+ if (firstSentence.length > 15) {
145
+ keywords.push({
146
+ keyword: firstSentence,
147
+ source: "docstring",
148
+ platform: "app",
149
+ weight: 1.8,
150
+ context: "Docstring (domain intent)"
151
+ });
152
+ }
153
+ }
154
+ }
155
+ if ("frameworks_used" in sourceContext && Array.isArray(sourceContext.frameworks_used)) {
156
+ for (const fw of sourceContext.frameworks_used) {
157
+ const fwName = typeof fw === "string" ? fw : fw.framework || "";
158
+ if (fwName) {
159
+ keywords.push({
160
+ keyword: fwName,
161
+ source: "framework_usage",
162
+ platform: "app",
163
+ weight: 1.4,
164
+ context: "Framework usage (real practice)"
165
+ });
166
+ }
167
+ }
168
+ }
169
+ if ("property_wrappers" in sourceContext && Array.isArray(sourceContext.property_wrappers)) {
170
+ for (const wrapper of sourceContext.property_wrappers) {
171
+ const wrapperName = typeof wrapper === "string" ? wrapper : wrapper.wrapper || "";
172
+ if (wrapperName) {
173
+ keywords.push({
174
+ keyword: `@${wrapperName}`,
175
+ source: "property_wrapper",
176
+ platform: "app",
177
+ weight: 2,
178
+ context: "Property wrapper"
179
+ });
180
+ }
181
+ }
182
+ }
183
+ const errorPatterns = "error_handling" in sourceContext ? sourceContext.error_handling : "error_handling_patterns" in sourceContext ? sourceContext.error_handling_patterns || [] : [];
184
+ for (const error of errorPatterns) {
185
+ let pattern;
186
+ let platform = "app";
187
+ if (typeof error === "string") {
188
+ pattern = error;
189
+ } else if (error && typeof error === "object" && "pattern" in error) {
190
+ const errObj = error;
191
+ pattern = errObj.pattern;
192
+ platform = platformFromPath(errObj.file || "");
193
+ } else {
194
+ continue;
195
+ }
196
+ keywords.push({
197
+ keyword: pattern,
198
+ source: "error_handling",
199
+ platform,
200
+ weight: 1.3,
201
+ context: "Error handling pattern"
202
+ });
203
+ }
204
+ const seen = /* @__PURE__ */ new Set();
205
+ const uniqueKeywords = [];
206
+ for (const kw of keywords) {
207
+ const key = kw.keyword.toLowerCase();
208
+ if (!seen.has(key)) {
209
+ seen.add(key);
210
+ uniqueKeywords.push(kw);
211
+ }
212
+ }
213
+ return uniqueKeywords;
214
+ }
215
+
216
+ export { extractKeywords };
217
+ //# sourceMappingURL=chunk-XMHKWHVK.mjs.map
218
+ //# sourceMappingURL=chunk-XMHKWHVK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/extractors/keywordExtractor.ts"],"names":[],"mappings":";AAgCA,IAAM,cAAA,uBAAqB,GAAA,CAAI;AAAA;AAAA,EAE7B,IAAA;AAAA,EAAM,KAAA;AAAA,EAAO,QAAA;AAAA,EAAU,MAAA;AAAA,EAAQ,IAAA;AAAA,EAAM,MAAA;AAAA,EAAQ,QAAA;AAAA,EAAU,MAAA;AAAA,EAAQ,UAAA;AAAA,EAC/D,SAAA;AAAA,EAAW,aAAA;AAAA,EAAe,MAAA;AAAA,EAAQ,aAAA;AAAA,EAAe,WAAA;AAAA,EAAa,WAAA;AAAA,EAC9D,SAAA;AAAA,EAAW,UAAA;AAAA,EAAY,YAAA;AAAA,EAAc,WAAA;AA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,OAAA,EAAS,OAAA;AAAA,MACT,MAAA,EAAQ,gBAAA;AAAA,MACR,QAAA;AAAA,MACA,MAAA,EAAQ,GAAA;AAAA,MACR,OAAA,EAAS;AAAA,KACV,CAAA;AAAA,EACH;AAGA,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,MAAM,iBAA4B,EAAC;AACnC,EAAA,KAAA,MAAW,MAAM,QAAA,EAAU;AACzB,IAAA,MAAM,GAAA,GAAM,EAAA,CAAG,OAAA,CAAQ,WAAA,EAAY;AACnC,IAAA,IAAI,CAAC,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA,EAAG;AAClB,MAAA,IAAA,CAAK,IAAI,GAAG,CAAA;AACZ,MAAA,cAAA,CAAe,KAAK,EAAE,CAAA;AAAA,IACxB;AAAA,EACF;AAEA,EAAA,OAAO,cAAA;AACT","file":"chunk-XMHKWHVK.mjs","sourcesContent":["/**\n * Keyword extraction logic — combines AST parser results into structured keywords\n * with source, weight, and context metadata.\n *\n * Ported from knowledge-tree/extract_project_keywords.py extract_keywords()\n */\n\nimport type { SwiftParseResult } from '../parsers/swift';\nimport type { TsParseResult } from '../parsers/typescript';\nimport type { PythonParseResult } from '../parsers/python';\nimport type { CppParseResult } from '../parsers/cpp';\n\nexport interface Keyword {\n keyword: string;\n source: string;\n platform: string;\n weight: number;\n context: string;\n}\n\nexport type SourceContext = SwiftParseResult | TsParseResult | PythonParseResult | CppParseResult;\n\nexport interface ExtractKeywordsOptions {\n /** Additional stdlib modules to skip (merged with defaults) */\n extraStdlibModules?: string[];\n /** Modules to un-skip even if in stdlib (e.g., 'math' for scientific projects) */\n unskipModules?: string[];\n}\n\n/**\n * Standard library modules that carry no domain signal — skip as keywords.\n */\nconst STDLIB_MODULES = new Set([\n // Python\n 'os', 'sys', 'typing', 'json', 're', 'math', 'random', 'time', 'datetime',\n 'pathlib', 'dataclasses', 'enum', 'collections', 'itertools', 'functools',\n 'logging', 'argparse', 'subprocess', 'threading', 'multiprocessing', 'asyncio',\n 'socket', 'http', 'urllib', 'ssl', 'hashlib', 'base64', 'csv', 'sqlite3',\n 'pickle', 'tempfile', 'shutil', 'glob', 'io', 'string', 'struct', 'uuid',\n 'abc', 'copy', 'decimal', 'fractions', 'statistics', 'queue', 'signal',\n 'traceback', 'warnings', 'weakref', 'contextlib', 'unittest', 'pytest',\n 'tkinter', 'tk', 'ttk', 'types', 'inspect', 'platform',\n // Common third-party generic plumbing\n 'requests', 'urllib3', 'pydantic', 'dotenv', 'yaml', 'tomllib',\n]);\n\n/**\n * Map file path → platform (multi-codebase project: Swift app vs ESP32 firmware).\n */\nfunction platformFromPath(filePath: string): string {\n if (!filePath) return 'app';\n const fp = filePath.toLowerCase();\n if (fp.endsWith('.ino') || fp.endsWith('.cpp') || fp.endsWith('.h') || fp.endsWith('.hpp') || fp.endsWith('.c')) {\n if (fp.endsWith('.ino')) return 'esp32';\n if (fp.includes('firmware') || fp.includes('esp')) return 'esp32';\n return 'app';\n }\n return 'app';\n}\n\n/**\n * Extract structured keywords from source context and basic analysis.\n *\n * Multi-target: each keyword is tagged with platform (app/esp32) from its source file,\n * so downstream SIO generation produces correct keywords for each codebase.\n */\nexport function extractKeywords(\n sourceContext: SourceContext,\n basicAnalysis?: { config_files?: string[] },\n repoDir?: string,\n options?: ExtractKeywordsOptions,\n): Keyword[] {\n const keywords: Keyword[] = [];\n\n // Build effective stdlib set with overrides\n const effectiveStdlib = new Set(STDLIB_MODULES);\n if (options?.extraStdlibModules) {\n for (const m of options.extraStdlibModules) effectiveStdlib.add(m.toLowerCase());\n }\n if (options?.unskipModules) {\n for (const m of options.unskipModules) effectiveStdlib.delete(m.toLowerCase());\n }\n\n // Source 1: Import statements → framework keywords\n if ('imports' in sourceContext) {\n for (const imp of sourceContext.imports) {\n let module: string;\n let count = 1;\n let platform = 'app';\n\n if (typeof imp === 'string') {\n module = imp;\n } else if (imp && typeof imp === 'object' && 'module' in imp) {\n const impObj = imp as { module: string; count?: number; file?: string };\n module = impObj.module;\n count = impObj.count || 1;\n platform = platformFromPath(impObj.file || '');\n } else {\n continue;\n }\n\n // Skip standard library / generic plumbing — no domain signal\n if (effectiveStdlib.has(module.toLowerCase())) continue;\n\n keywords.push({\n keyword: module,\n source: 'import',\n platform,\n weight: 1.0 + (count - 1) * 0.1,\n context: `Imported ${count} times`,\n });\n }\n }\n\n // Source 2: Type declarations → domain concepts\n if ('types' in sourceContext) {\n for (const typeDecl of sourceContext.types) {\n const name = typeDecl.name;\n const kind = typeDecl.kind;\n const platform = platformFromPath(typeDecl.file || '');\n\n // Skip generic/framework types\n if (['View', 'Model', 'ViewModel', 'Controller', 'Service', 'Manager'].includes(name)) continue;\n\n keywords.push({\n keyword: name,\n source: 'type_declaration',\n platform,\n weight: 1.5,\n context: `${kind} declaration`,\n });\n }\n }\n\n // Source 3: Function signatures → business logic\n if ('functions' in sourceContext) {\n for (const func of sourceContext.functions) {\n const name = func.name;\n const platform = platformFromPath(func.file || '');\n\n // Skip generic helpers\n if (['init', 'setup', 'configure', 'initialize'].includes(name)) continue;\n\n keywords.push({\n keyword: name,\n source: 'function_signature',\n platform,\n weight: 1.2,\n context: 'Function signature',\n });\n }\n }\n\n // Source 3.5: Docstrings → domain intent (high signal) — Python only\n if ('docstrings' in sourceContext && Array.isArray(sourceContext.docstrings)) {\n for (const doc of sourceContext.docstrings) {\n const firstSentence = doc.trim().split('\\n')[0].slice(0, 120);\n if (firstSentence.length > 15) {\n keywords.push({\n keyword: firstSentence,\n source: 'docstring',\n platform: 'app',\n weight: 1.8,\n context: 'Docstring (domain intent)',\n });\n }\n }\n }\n\n // Source 3.6: Framework usage → real practice keywords — Swift only\n if ('frameworks_used' in sourceContext && Array.isArray(sourceContext.frameworks_used)) {\n for (const fw of sourceContext.frameworks_used) {\n const fwName = typeof fw === 'string' ? fw : (fw as { framework?: string }).framework || '';\n if (fwName) {\n keywords.push({\n keyword: fwName,\n source: 'framework_usage',\n platform: 'app',\n weight: 1.4,\n context: 'Framework usage (real practice)',\n });\n }\n }\n }\n\n // Source 4: Property wrappers → state management patterns — Swift only\n if ('property_wrappers' in sourceContext && Array.isArray(sourceContext.property_wrappers)) {\n for (const wrapper of sourceContext.property_wrappers) {\n const wrapperName = typeof wrapper === 'string' ? wrapper : (wrapper as { wrapper?: string }).wrapper || '';\n if (wrapperName) {\n keywords.push({\n keyword: `@${wrapperName}`,\n source: 'property_wrapper',\n platform: 'app',\n weight: 2.0,\n context: 'Property wrapper',\n });\n }\n }\n }\n\n // Source 5: Error handling patterns → reliability concerns\n const errorPatterns = 'error_handling' in sourceContext\n ? sourceContext.error_handling\n : 'error_handling_patterns' in sourceContext\n ? (sourceContext as { error_handling_patterns?: Array<{ pattern: string; count?: number; file?: string }> }).error_handling_patterns || []\n : [];\n\n for (const error of errorPatterns) {\n let pattern: string;\n let platform = 'app';\n\n if (typeof error === 'string') {\n pattern = error;\n } else if (error && typeof error === 'object' && 'pattern' in error) {\n const errObj = error as { pattern: string; file?: string };\n pattern = errObj.pattern;\n platform = platformFromPath(errObj.file || '');\n } else {\n continue;\n }\n\n keywords.push({\n keyword: pattern,\n source: 'error_handling',\n platform,\n weight: 1.3,\n context: 'Error handling pattern',\n });\n }\n\n // Deduplicate by keyword (case-insensitive)\n const seen = new Set<string>();\n const uniqueKeywords: Keyword[] = [];\n for (const kw of keywords) {\n const key = kw.keyword.toLowerCase();\n if (!seen.has(key)) {\n seen.add(key);\n uniqueKeywords.push(kw);\n }\n }\n\n return uniqueKeywords;\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import { L as LlmClientConfig } from './llmClient-ysPhLjcH.js';
2
+ import { u as ProjectGraph } from './projectGraphSchema-DnD7orZV.js';
3
+
4
+ /**
5
+ * STEP E: Escalate keywords/api_usage to neutral concepts + ULO/CIO/SIO depth + evidence files join.
6
+ *
7
+ * Ported from knowledge-tree/llm_project_graph.py escalate_and_map_concepts()
8
+ * Maps concrete keywords to technology-neutral concept codes WITH depth levels.
9
+ *
10
+ * ULO/CIO/SIO model:
11
+ * - ULO: WHAT + WHY — concept is introduced (what it is, why it exists)
12
+ * - CIO: HOW — mechanism is explained (how it works)
13
+ * - SIO: IMPLEMENTATION — concrete tech-specific usage (syntax, API)
14
+ */
15
+
16
+ interface ConceptMapping {
17
+ concept_code: string;
18
+ concept_name: string;
19
+ keyword: string;
20
+ depth: 'ulo' | 'cio' | 'sio';
21
+ depth_rationale: string;
22
+ evidence_files: string[];
23
+ }
24
+ interface EscalateOptions {
25
+ projectGraph: ProjectGraph;
26
+ fileContentsMap: Map<string, string>;
27
+ availableConcepts?: string[];
28
+ conceptMapOverride?: Record<string, {
29
+ concept_code: string;
30
+ concept_name: string;
31
+ depth?: string;
32
+ }>;
33
+ llmConfig?: LlmClientConfig;
34
+ }
35
+ /**
36
+ * Escalate keywords/api_usage to neutral concepts with ULO/CIO/SIO depth and join evidence files.
37
+ */
38
+ declare function escalateAndMapConcepts(options: EscalateOptions): Promise<Map<string, ConceptMapping[]>>;
39
+
40
+ export { type ConceptMapping as C, type EscalateOptions as E, escalateAndMapConcepts as e };
@@ -0,0 +1,40 @@
1
+ import { L as LlmClientConfig } from './llmClient-ysPhLjcH.cjs';
2
+ import { u as ProjectGraph } from './projectGraphSchema-DnD7orZV.cjs';
3
+
4
+ /**
5
+ * STEP E: Escalate keywords/api_usage to neutral concepts + ULO/CIO/SIO depth + evidence files join.
6
+ *
7
+ * Ported from knowledge-tree/llm_project_graph.py escalate_and_map_concepts()
8
+ * Maps concrete keywords to technology-neutral concept codes WITH depth levels.
9
+ *
10
+ * ULO/CIO/SIO model:
11
+ * - ULO: WHAT + WHY — concept is introduced (what it is, why it exists)
12
+ * - CIO: HOW — mechanism is explained (how it works)
13
+ * - SIO: IMPLEMENTATION — concrete tech-specific usage (syntax, API)
14
+ */
15
+
16
+ interface ConceptMapping {
17
+ concept_code: string;
18
+ concept_name: string;
19
+ keyword: string;
20
+ depth: 'ulo' | 'cio' | 'sio';
21
+ depth_rationale: string;
22
+ evidence_files: string[];
23
+ }
24
+ interface EscalateOptions {
25
+ projectGraph: ProjectGraph;
26
+ fileContentsMap: Map<string, string>;
27
+ availableConcepts?: string[];
28
+ conceptMapOverride?: Record<string, {
29
+ concept_code: string;
30
+ concept_name: string;
31
+ depth?: string;
32
+ }>;
33
+ llmConfig?: LlmClientConfig;
34
+ }
35
+ /**
36
+ * Escalate keywords/api_usage to neutral concepts with ULO/CIO/SIO depth and join evidence files.
37
+ */
38
+ declare function escalateAndMapConcepts(options: EscalateOptions): Promise<Map<string, ConceptMapping[]>>;
39
+
40
+ export { type ConceptMapping as C, type EscalateOptions as E, escalateAndMapConcepts as e };
@@ -0,0 +1,155 @@
1
+ 'use strict';
2
+
3
+ // src/concepts/conceptResolver.ts
4
+ var SOURCE_THRESHOLDS = {
5
+ docstring: 0.45,
6
+ readme_description: 0.45,
7
+ readme: 0.5,
8
+ type_declaration: 0.55,
9
+ function_signature: 0.55,
10
+ import: 0.6,
11
+ property_wrapper: 0.55,
12
+ error_handling: 0.6,
13
+ config: 0.6,
14
+ framework_usage: 0.45
15
+ };
16
+ var DEFAULT_THRESHOLD = 0.55;
17
+ function uloCioAwareScore(query, depth, conceptData) {
18
+ const queryTerms = new Set(query.toLowerCase().split(/\s+/));
19
+ let targetText = "";
20
+ if (depth === "sio") {
21
+ targetText = conceptData.keywords || "";
22
+ } else if (depth === "cio") {
23
+ targetText = [conceptData.description || "", conceptData.cio || ""].join(" ");
24
+ } else {
25
+ targetText = [conceptData.ulo || "", conceptData.description || ""].join(" ");
26
+ }
27
+ const targetTerms = new Set(targetText.toLowerCase().split(/\s+/));
28
+ if (!queryTerms.size || !targetTerms.size) return 0;
29
+ let overlap = 0;
30
+ for (const t of queryTerms) {
31
+ if (targetTerms.has(t)) overlap++;
32
+ }
33
+ return Math.min(overlap / queryTerms.size, 1);
34
+ }
35
+ function inferFieldsFromGoal(goal) {
36
+ const goalLower = goal.toLowerCase();
37
+ const fieldKeywords = {
38
+ ASE: ["algorithm", "software", "programming", "code", "develop", "build", "app"],
39
+ DAI: ["data", "database", "storage", "query", "sql", "analytics"],
40
+ CSN: ["network", "protocol", "server", "client", "api", "http"],
41
+ HCI: ["user", "interface", "ui", "ux", "interaction", "design"],
42
+ MOB: ["mobile", "ios", "android", "swift", "kotlin", "flutter"],
43
+ WEB: ["web", "html", "css", "javascript", "react", "vue"]
44
+ };
45
+ const matched = [];
46
+ for (const [code, keywords] of Object.entries(fieldKeywords)) {
47
+ if (keywords.some((kw) => goalLower.includes(kw))) matched.push(code);
48
+ }
49
+ return matched.length > 0 ? matched : ["ASE"];
50
+ }
51
+ function inferDepthFromSource(source) {
52
+ const uloSources = ["docstring", "readme", "readme_description", "framework_usage"];
53
+ const cioSources = ["type_declaration", "function_signature", "config"];
54
+ if (uloSources.includes(source)) return "ulo";
55
+ if (cioSources.includes(source)) return "cio";
56
+ return "sio";
57
+ }
58
+ async function resolveConcepts(options) {
59
+ const { keywords, goal, embeddings, depthOverrides, topK = 3, threshold = DEFAULT_THRESHOLD, llmConfig } = options;
60
+ inferFieldsFromGoal(goal);
61
+ const resolved = [];
62
+ const proposed = [];
63
+ const hasEmbeddings = Object.keys(embeddings || {}).length > 0 && Object.values(embeddings || {}).some((d) => d.embedding && d.embedding.length > 0);
64
+ let search_mode = hasEmbeddings ? "embedding" : "keyword_overlap";
65
+ const concepts = embeddings || {};
66
+ for (const kwData of keywords) {
67
+ const keyword = kwData.keyword;
68
+ const source = kwData.source;
69
+ const depth = depthOverrides?.get(keyword) || inferDepthFromSource(source);
70
+ const scored = [];
71
+ for (const [code, data] of Object.entries(concepts)) {
72
+ const conceptKeywords = data.keywords || "";
73
+ const conceptDesc = data.description || "";
74
+ const conceptUlo = data.ulo;
75
+ const conceptCio = data.cio;
76
+ const awareScore = uloCioAwareScore(keyword, depth, {
77
+ keywords: conceptKeywords,
78
+ description: conceptDesc,
79
+ ulo: conceptUlo,
80
+ cio: conceptCio
81
+ });
82
+ const queryTerms = new Set(keyword.toLowerCase().split(/\s+/));
83
+ const allTerms = new Set([
84
+ ...conceptKeywords.toLowerCase().split(/\s+/),
85
+ ...conceptDesc.toLowerCase().split(/\s+/),
86
+ ...(conceptUlo || "").toLowerCase().split(/\s+/),
87
+ ...(conceptCio || "").toLowerCase().split(/\s+/)
88
+ ].filter(Boolean));
89
+ let overlapCount = 0;
90
+ for (const t of queryTerms) {
91
+ if (allTerms.has(t)) overlapCount++;
92
+ }
93
+ const fallbackScore = queryTerms.size > 0 ? Math.min(overlapCount / queryTerms.size, 1) : 0;
94
+ const usedAware = awareScore >= fallbackScore;
95
+ const finalScore = usedAware ? awareScore : fallbackScore;
96
+ if (finalScore > 0) {
97
+ scored.push({
98
+ code,
99
+ name: data.name || code,
100
+ description: conceptDesc,
101
+ keywords: conceptKeywords,
102
+ ulo: conceptUlo,
103
+ cio: conceptCio,
104
+ score: finalScore,
105
+ matched_level: usedAware ? depth : "sio",
106
+ method: hasEmbeddings && data.embedding && data.embedding.length > 0 ? "embedding" : "keyword_overlap"
107
+ });
108
+ }
109
+ }
110
+ scored.sort((a, b) => b.score - a.score);
111
+ const topMatches = scored.slice(0, topK);
112
+ if (topMatches.length === 0) {
113
+ proposed.push({
114
+ keyword,
115
+ source,
116
+ depth,
117
+ reason: "No matches in Master Tree"
118
+ });
119
+ continue;
120
+ }
121
+ const effThreshold = SOURCE_THRESHOLDS[source] || threshold;
122
+ const topMatch = topMatches[0];
123
+ if (topMatch.score >= effThreshold) {
124
+ resolved.push({
125
+ keyword,
126
+ source,
127
+ depth,
128
+ concept_codes: topMatches.filter((m) => m.score >= effThreshold).map((m) => m.code),
129
+ matches: topMatches
130
+ });
131
+ } else {
132
+ proposed.push({
133
+ keyword,
134
+ source,
135
+ depth,
136
+ best_match: topMatch,
137
+ reason: `Low confidence (${topMatch.score.toFixed(2)} < ${effThreshold})`
138
+ });
139
+ }
140
+ }
141
+ return {
142
+ resolved,
143
+ proposed,
144
+ summary: {
145
+ total_keywords: keywords.length,
146
+ resolved_count: resolved.length,
147
+ proposed_count: proposed.length,
148
+ search_mode
149
+ }
150
+ };
151
+ }
152
+
153
+ exports.resolveConcepts = resolveConcepts;
154
+ //# sourceMappingURL=index.cjs.map
155
+ //# sourceMappingURL=index.cjs.map