homegraph 1.5.5 → 1.5.7

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 (83) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +10 -4
  3. package/dist/bin/homegraph.js +6 -0
  4. package/dist/bin/homegraph.js.map +1 -1
  5. package/dist/context/index.d.ts.map +1 -1
  6. package/dist/context/index.js +120 -15
  7. package/dist/context/index.js.map +1 -1
  8. package/dist/db/migrations.d.ts +1 -1
  9. package/dist/db/migrations.d.ts.map +1 -1
  10. package/dist/db/migrations.js +37 -1
  11. package/dist/db/migrations.js.map +1 -1
  12. package/dist/db/queries.d.ts +25 -0
  13. package/dist/db/queries.d.ts.map +1 -1
  14. package/dist/db/queries.js +50 -2
  15. package/dist/db/queries.js.map +1 -1
  16. package/dist/db/schema.sql +24 -0
  17. package/dist/extraction/languages/arkts.d.ts +40 -3
  18. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  19. package/dist/extraction/languages/arkts.js +302 -22
  20. package/dist/extraction/languages/arkts.js.map +1 -1
  21. package/dist/index.d.ts +31 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +87 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp/engine.d.ts +26 -0
  26. package/dist/mcp/engine.d.ts.map +1 -1
  27. package/dist/mcp/engine.js +229 -8
  28. package/dist/mcp/engine.js.map +1 -1
  29. package/dist/mcp/evidence-rendering.d.ts +10 -0
  30. package/dist/mcp/evidence-rendering.d.ts.map +1 -0
  31. package/dist/mcp/evidence-rendering.js +71 -0
  32. package/dist/mcp/evidence-rendering.js.map +1 -0
  33. package/dist/mcp/explore-repeat-guard.d.ts +8 -13
  34. package/dist/mcp/explore-repeat-guard.d.ts.map +1 -1
  35. package/dist/mcp/explore-repeat-guard.js +54 -114
  36. package/dist/mcp/explore-repeat-guard.js.map +1 -1
  37. package/dist/mcp/explore-session-state.d.ts +26 -4
  38. package/dist/mcp/explore-session-state.d.ts.map +1 -1
  39. package/dist/mcp/explore-session-state.js +50 -4
  40. package/dist/mcp/explore-session-state.js.map +1 -1
  41. package/dist/mcp/index.d.ts.map +1 -1
  42. package/dist/mcp/index.js +16 -1
  43. package/dist/mcp/index.js.map +1 -1
  44. package/dist/mcp/query-cache.d.ts +1 -1
  45. package/dist/mcp/query-cache.d.ts.map +1 -1
  46. package/dist/mcp/query-cache.js +86 -3
  47. package/dist/mcp/query-cache.js.map +1 -1
  48. package/dist/mcp/query-pool.js +4 -4
  49. package/dist/mcp/server-instructions.d.ts +2 -2
  50. package/dist/mcp/server-instructions.d.ts.map +1 -1
  51. package/dist/mcp/server-instructions.js +36 -21
  52. package/dist/mcp/server-instructions.js.map +1 -1
  53. package/dist/mcp/tools.d.ts +29 -3
  54. package/dist/mcp/tools.d.ts.map +1 -1
  55. package/dist/mcp/tools.js +827 -109
  56. package/dist/mcp/tools.js.map +1 -1
  57. package/dist/project-map/index.d.ts +33 -0
  58. package/dist/project-map/index.d.ts.map +1 -0
  59. package/dist/project-map/index.js +260 -0
  60. package/dist/project-map/index.js.map +1 -0
  61. package/dist/search/literal-evidence.d.ts +44 -0
  62. package/dist/search/literal-evidence.d.ts.map +1 -0
  63. package/dist/search/literal-evidence.js +278 -0
  64. package/dist/search/literal-evidence.js.map +1 -0
  65. package/dist/search/query-plan-provider.d.ts +6 -0
  66. package/dist/search/query-plan-provider.d.ts.map +1 -0
  67. package/dist/search/query-plan-provider.js +289 -0
  68. package/dist/search/query-plan-provider.js.map +1 -0
  69. package/dist/search/query-plan.d.ts +98 -0
  70. package/dist/search/query-plan.d.ts.map +1 -0
  71. package/dist/search/query-plan.js +334 -0
  72. package/dist/search/query-plan.js.map +1 -0
  73. package/dist/search/query-utils.d.ts +6 -1
  74. package/dist/search/query-utils.d.ts.map +1 -1
  75. package/dist/search/query-utils.js +64 -5
  76. package/dist/search/query-utils.js.map +1 -1
  77. package/dist/sync/watcher.d.ts +15 -3
  78. package/dist/sync/watcher.d.ts.map +1 -1
  79. package/dist/sync/watcher.js +14 -1
  80. package/dist/sync/watcher.js.map +1 -1
  81. package/dist/types.d.ts +23 -0
  82. package/dist/types.d.ts.map +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"arkts.d.ts","sourceRoot":"","sources":["../../../src/extraction/languages/arkts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,OAAO,EAIL,QAAQ,EACR,OAAO,EACP,SAAS,EAiBT,cAAc,EACd,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,eAAe,EACf,gBAAgB,EAKjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiC3D,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAWpF;AAyCD,8FAA8F;AAC9F,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,GAChB;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAoC7C;AA8BD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAGrD;AAkCD,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,mFAAmF;AACnF,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,g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AC,gBAAgB,GAAG,uBAAuB,GAAG,IAAI,CAAC,CAkB5D;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,GAAG,IAAI,CAerF"}
@@ -69,8 +69,12 @@ exports.buildArkMethodSignatureFields = buildArkMethodSignatureFields;
69
69
  exports.shouldUseIsolatedArkTSBuild = shouldUseIsolatedArkTSBuild;
70
70
  exports.normalizeHarmonyModuleSrcPath = normalizeHarmonyModuleSrcPath;
71
71
  exports.listHarmonyProjectModules = listHarmonyProjectModules;
72
+ exports.findSyntheticArkModuleRoot = findSyntheticArkModuleRoot;
73
+ exports.listOrphanArkAnalyzerSources = listOrphanArkAnalyzerSources;
74
+ exports.listSyntheticArkModuleRoots = listSyntheticArkModuleRoots;
72
75
  exports.resolveDirtyHarmonyModules = resolveDirtyHarmonyModules;
73
76
  exports.isArkAnalyzerSourcePath = isArkAnalyzerSourcePath;
77
+ exports.languageForArkAnalyzerPath = languageForArkAnalyzerPath;
74
78
  exports.scanEtsFiles = scanEtsFiles;
75
79
  exports.runIsolatedArkTSBatchEntry = runIsolatedArkTSBatchEntry;
76
80
  exports.primeArkTSBatch = primeArkTSBatch;
@@ -79,11 +83,13 @@ exports.isArkTSBatchCommitted = isArkTSBatchCommitted;
79
83
  exports.resetArkTSBatch = resetArkTSBatch;
80
84
  exports.shrinkArkTSBatchPostParse = shrinkArkTSBatchPostParse;
81
85
  exports.createArkRelPathNormalizer = createArkRelPathNormalizer;
86
+ exports.docstringFromArkModel = docstringFromArkModel;
82
87
  exports.collectExportedRtaEntryPointsFromFiles = collectExportedRtaEntryPointsFromFiles;
83
88
  exports.stateDecoratorKinds = stateDecoratorKinds;
84
89
  exports.fieldDecoratorEntries = fieldDecoratorEntries;
85
90
  exports.fieldDecoratorsEncoded = fieldDecoratorsEncoded;
86
91
  exports.stateTransferViaForField = stateTransferViaForField;
92
+ exports.viewTreeArkuiId = viewTreeArkuiId;
87
93
  exports.isUnclearArkClassSignature = isUnclearArkClassSignature;
88
94
  exports.isUnclearArkMethodSignature = isUnclearArkMethodSignature;
89
95
  exports.pickPreferredClassNodeId = pickPreferredClassNodeId;
@@ -351,6 +357,121 @@ function listHarmonyProjectModules(rootDir) {
351
357
  }
352
358
  return out;
353
359
  }
360
+ /**
361
+ * Absolute path for ArkAnalyzer module registration (realpath when available).
362
+ * Must match how incremental target matching resolves `srcPath`.
363
+ */
364
+ function resolveArkModuleAbsPath(rootDir, relSrcPath) {
365
+ const resolved = path.resolve(rootDir, relSrcPath);
366
+ try {
367
+ return fs.realpathSync(resolved);
368
+ }
369
+ catch {
370
+ return resolved;
371
+ }
372
+ }
373
+ /**
374
+ * Nearest package-like directory for an orphan Ark source, or the first path
375
+ * segment. Never returns the project root (registering `.` would re-scan every
376
+ * Harmony module). Lone files directly under the root return null.
377
+ */
378
+ function findSyntheticArkModuleRoot(rootDir, relFile) {
379
+ const file = normIndexPath(relFile);
380
+ if (!file || file.startsWith('@'))
381
+ return null;
382
+ let dir = path.posix.dirname(file);
383
+ if (dir === '.' || dir === '')
384
+ return null;
385
+ const rootAbs = path.resolve(rootDir);
386
+ let curAbs = path.resolve(rootDir, dir);
387
+ for (;;) {
388
+ const relFromRoot = path.relative(rootAbs, curAbs);
389
+ if (!relFromRoot || relFromRoot.startsWith('..') || path.isAbsolute(relFromRoot))
390
+ break;
391
+ const rel = relFromRoot.replace(/\\/g, '/');
392
+ if (fs.existsSync(path.join(curAbs, 'package.json')) ||
393
+ fs.existsSync(path.join(curAbs, 'oh-package.json5'))) {
394
+ return normalizeHarmonyModuleSrcPath(rel);
395
+ }
396
+ const parent = path.dirname(curAbs);
397
+ if (parent === curAbs)
398
+ break;
399
+ curAbs = parent;
400
+ }
401
+ const first = file.split('/')[0];
402
+ if (!first || first === file)
403
+ return null;
404
+ return normalizeHarmonyModuleSrcPath(first);
405
+ }
406
+ /**
407
+ * ArkAnalyzer sources under `scannedFiles` that are not inside any
408
+ * build-profile PROJECT module `srcPath`.
409
+ */
410
+ function listOrphanArkAnalyzerSources(scannedFiles, harmonyModules) {
411
+ const orphans = [];
412
+ for (const raw of scannedFiles) {
413
+ const f = normIndexPath(raw);
414
+ if (!f || !isArkAnalyzerSourcePath(f) || f.startsWith('@'))
415
+ continue;
416
+ if (findLongestHarmonyModule(f, harmonyModules))
417
+ continue;
418
+ orphans.push(f);
419
+ }
420
+ orphans.sort();
421
+ return orphans;
422
+ }
423
+ /**
424
+ * Cluster orphan `.ets`/`.ts`/`.d.ts` into synthetic PROJECT module roots
425
+ * (e.g. `HMRouterPlugin` for a Node hvigor plugin living beside HAP modules).
426
+ */
427
+ function listSyntheticArkModuleRoots(rootDir, scannedFiles, harmonyModules) {
428
+ const modules = harmonyModules ?? listHarmonyProjectModules(rootDir);
429
+ const orphans = listOrphanArkAnalyzerSources(scannedFiles, modules);
430
+ const bySrc = new Map();
431
+ for (const f of orphans) {
432
+ const srcPath = findSyntheticArkModuleRoot(rootDir, f);
433
+ if (!srcPath)
434
+ continue;
435
+ // Never shadow a real Harmony module path.
436
+ if (modules.some((m) => m.srcPath === srcPath))
437
+ continue;
438
+ if (bySrc.has(srcPath))
439
+ continue;
440
+ const abs = path.resolve(rootDir, srcPath);
441
+ if (!fs.existsSync(abs) || !fs.statSync(abs).isDirectory())
442
+ continue;
443
+ bySrc.set(srcPath, {
444
+ name: `synthetic:${path.basename(srcPath)}`,
445
+ srcPath,
446
+ });
447
+ }
448
+ return [...bySrc.values()].sort((a, b) => a.srcPath.localeCompare(b.srcPath));
449
+ }
450
+ /**
451
+ * Register orphan trees as PROJECT modules before dependency analysis so they
452
+ * enter `analyseByModule` topo order. No `oh-package.json5` → empty dep edges
453
+ * (npm-only deps stay unresolved); that is expected for Node plugins.
454
+ */
455
+ function registerSyntheticArkModules(builder, rootDir, scannedFiles, harmonyModules) {
456
+ const synthetics = listSyntheticArkModuleRoots(rootDir, scannedFiles, harmonyModules);
457
+ for (const syn of synthetics) {
458
+ const abs = resolveArkModuleAbsPath(rootDir, syn.srcPath);
459
+ builder.registerModule(abs, syn.name);
460
+ }
461
+ return synthetics;
462
+ }
463
+ /** Prep PROJECT + oh_modules, inject synthetic orphan modules, then build the dep graph. */
464
+ function prepareArkModulesWithSynthetics(scene, rootDir, scannedFiles) {
465
+ if (scene.isModulesRegistered())
466
+ return [];
467
+ const builder = new arkanalyzer_1.ModuleBuilder(scene);
468
+ builder.prepareModules();
469
+ const harmonyModules = listHarmonyProjectModules(rootDir);
470
+ const synthetics = registerSyntheticArkModules(builder, rootDir, scannedFiles, harmonyModules);
471
+ builder.analyzeModuleDependencies();
472
+ scene.setModulesRegistered(true);
473
+ return synthetics;
474
+ }
354
475
  function findLongestHarmonyModule(fileRel, modules) {
355
476
  const file = normIndexPath(fileRel);
356
477
  let best = null;
@@ -365,8 +486,9 @@ function findLongestHarmonyModule(fileRel, modules) {
365
486
  }
366
487
  /**
367
488
  * Map changed/removed paths to Harmony modules for incremental ArkTS sync.
368
- * Structural project files (`build-profile.json5`, root `oh-package.json5`) or
369
- * ArkAnalyzer sources outside every module force a full rebuild.
489
+ * Structural project files (`build-profile.json5`, root `oh-package.json5`)
490
+ * force a full rebuild. Orphan trees covered by synthetic PROJECT modules
491
+ * (e.g. `HMRouterPlugin`) map to those module srcPaths instead of full rebuild.
370
492
  */
371
493
  function resolveDirtyHarmonyModules(rootDir, changedFiles) {
372
494
  if (!shouldUseModularArkTSBuild(rootDir)) {
@@ -387,17 +509,22 @@ function resolveDirtyHarmonyModules(rootDir, changedFiles) {
387
509
  return { mode: 'full', reason: 'root oh-package.json5 changed' };
388
510
  }
389
511
  }
512
+ // Synthetic roots for orphans among the changed set (cheap; no full scan).
513
+ const synthetics = listSyntheticArkModuleRoots(rootDir, changed, modules);
514
+ const allModules = [...modules, ...synthetics];
390
515
  const dirty = new Set();
391
516
  const unmatched = [];
392
517
  for (const f of changed) {
393
518
  // Virtual ArkAnalyzer paths are batch artifacts, not Harmony module sources.
394
519
  if (f.startsWith('@'))
395
520
  continue;
396
- const isModuleMeta = f.endsWith('/module.json5') || f.endsWith('/oh-package.json5');
521
+ const isModuleMeta = f.endsWith('/module.json5') ||
522
+ f.endsWith('/oh-package.json5') ||
523
+ f.endsWith('/package.json');
397
524
  const isArkSrc = isArkAnalyzerSourcePath(f);
398
525
  if (!isArkSrc && !isModuleMeta)
399
526
  continue;
400
- const match = findLongestHarmonyModule(f, modules);
527
+ const match = findLongestHarmonyModule(f, allModules);
401
528
  if (match)
402
529
  dirty.add(match.srcPath);
403
530
  else if (isArkSrc)
@@ -428,6 +555,21 @@ function isArkAnalyzerSourcePath(filePath) {
428
555
  // `.d.ts` ends with `.ts` (Node extname) — one `.ts` suffix covers both.
429
556
  return base.endsWith('.ets') || base.endsWith('.ts');
430
557
  }
558
+ /**
559
+ * Graph `language` tag for an ArkAnalyzer-indexed path. Extraction still uses AA;
560
+ * the tag must match the source kind so status / language filters stay truthful.
561
+ */
562
+ function languageForArkAnalyzerPath(filePath) {
563
+ const base = path.basename(filePath).toLowerCase();
564
+ if (base.endsWith('.d.ets') || base.endsWith('.ets'))
565
+ return 'arkts';
566
+ if (base.endsWith('.d.ts') || base.endsWith('.ts') || base.endsWith('.mts') || base.endsWith('.cts')) {
567
+ return 'typescript';
568
+ }
569
+ if (base.endsWith('.js') || base.endsWith('.mjs') || base.endsWith('.cjs'))
570
+ return 'javascript';
571
+ return 'arkts';
572
+ }
431
573
  function isEtsFileName(name) {
432
574
  return name.endsWith('.ets');
433
575
  }
@@ -632,7 +774,7 @@ function persistFileResult(queries, filePath, content, stats, result, options) {
632
774
  .map((ref) => ({
633
775
  ...ref,
634
776
  filePath: ref.filePath ?? filePath,
635
- language: ref.language ?? 'arkts',
777
+ language: ref.language ?? languageForArkAnalyzerPath(filePath),
636
778
  }));
637
779
  if (refsWithContext.length > 0) {
638
780
  queries.insertUnresolvedRefsBatch(refsWithContext);
@@ -641,7 +783,7 @@ function persistFileResult(queries, filePath, content, stats, result, options) {
641
783
  const fileRecord = {
642
784
  path: filePath,
643
785
  contentHash,
644
- language: 'arkts',
786
+ language: languageForArkAnalyzerPath(filePath),
645
787
  size: stats.size,
646
788
  modifiedAt: stats.mtimeMs,
647
789
  indexedAt: Date.now(),
@@ -1195,12 +1337,27 @@ class ArkTSExtractor {
1195
1337
  }
1196
1338
  }
1197
1339
  exports.ArkTSExtractor = ArkTSExtractor;
1340
+ /** ArkAnalyzer {@link ClassCategory} (not re-exported from the npm entry). */
1198
1341
  const CLASS_CATEGORY = {
1199
1342
  CLASS: 0,
1200
1343
  STRUCT: 1,
1201
1344
  INTERFACE: 2,
1202
1345
  ENUM: 3,
1346
+ TYPE_LITERAL: 4,
1347
+ OBJECT: 5,
1348
+ /** C++ frontend only; never map to HomeGraph `class`. */
1349
+ UNION: 6,
1203
1350
  };
1351
+ /**
1352
+ * IR shapes that are `ArkClass` in ArkAnalyzer but are not declaration-level
1353
+ * types in HomeGraph's symbol graph. Indexing them as `class` inflates
1354
+ * `graph_class` and orphans them under the file node.
1355
+ */
1356
+ function isNonDeclarationArkClassCategory(category) {
1357
+ return (category === CLASS_CATEGORY.TYPE_LITERAL ||
1358
+ category === CLASS_CATEGORY.OBJECT ||
1359
+ category === CLASS_CATEGORY.UNION);
1360
+ }
1204
1361
  /** ArkAnalyzer {@link FieldCategory} values (not re-exported from the npm entry). */
1205
1362
  const FIELD_CATEGORY = {
1206
1363
  PROPERTY_DECLARATION: 0,
@@ -1380,7 +1537,10 @@ function classNodeKind(cls) {
1380
1537
  return 'enum';
1381
1538
  case CLASS_CATEGORY.STRUCT:
1382
1539
  return 'struct';
1540
+ case CLASS_CATEGORY.CLASS:
1541
+ return 'class';
1383
1542
  default:
1543
+ // TYPE_LITERAL / OBJECT / UNION must be filtered before indexClass.
1384
1544
  return 'class';
1385
1545
  }
1386
1546
  }
@@ -1456,6 +1616,69 @@ function modelModifiersToNodeExtras(model) {
1456
1616
  extra.visibility = 'protected';
1457
1617
  return extra;
1458
1618
  }
1619
+ /** ArkMetadataKind values — package entry does not re-export the enum. */
1620
+ const ARK_META_LEADING_COMMENTS = 0;
1621
+ const ARK_META_JSDOC = 2;
1622
+ /** Strip line/block comment markers so FTS stores prose (aligned with tree-sitter helpers). */
1623
+ function cleanArkCommentContent(raw) {
1624
+ let c = raw.trim().replace(/\r\n/g, '\n');
1625
+ if (c.startsWith('/*'))
1626
+ c = c.replace(/^\/\*+!?/, '').replace(/\*+\/$/, '');
1627
+ return c
1628
+ .replace(/^\/\/[/!]?\s?/gm, '')
1629
+ .replace(/^\s*\*\s?/gm, '')
1630
+ .trim();
1631
+ }
1632
+ /**
1633
+ * Declaration-leading docstring from ArkAnalyzer metadata (Spec 0020).
1634
+ * Prefer leading comments; fall back to JSDoc description.
1635
+ *
1636
+ * Accepts `object` (not only models typed with `getMetadata`) so Local / AliasType
1637
+ * and other ArkAnalyzer types without that method in their .d.ts still type-check;
1638
+ * runtime skips when metadata is absent.
1639
+ */
1640
+ function docstringFromArkModel(model) {
1641
+ try {
1642
+ const meta = model;
1643
+ if (typeof meta.getMetadata !== 'function')
1644
+ return undefined;
1645
+ const leading = meta.getMetadata(ARK_META_LEADING_COMMENTS);
1646
+ if (leading && typeof leading.getComments === 'function') {
1647
+ const parts = leading
1648
+ .getComments()
1649
+ .map((c) => cleanArkCommentContent(String(c?.content ?? '')))
1650
+ .filter(Boolean);
1651
+ if (parts.length > 0)
1652
+ return parts.join('\n').trim();
1653
+ }
1654
+ const jsdoc = meta.getMetadata(ARK_META_JSDOC);
1655
+ const docs = [];
1656
+ const pushDesc = (j) => {
1657
+ if (j && typeof j.getDescription === 'function') {
1658
+ const d = String(j.getDescription() ?? '').trim();
1659
+ if (d)
1660
+ docs.push(d);
1661
+ }
1662
+ };
1663
+ if (Array.isArray(jsdoc)) {
1664
+ for (const j of jsdoc)
1665
+ pushDesc(j);
1666
+ }
1667
+ else {
1668
+ pushDesc(jsdoc);
1669
+ }
1670
+ if (docs.length > 0)
1671
+ return docs.join('\n').trim();
1672
+ }
1673
+ catch {
1674
+ // metadata access must not abort indexing
1675
+ }
1676
+ return undefined;
1677
+ }
1678
+ function docstringExtras(model) {
1679
+ const docstring = docstringFromArkModel(model);
1680
+ return docstring ? { docstring } : {};
1681
+ }
1459
1682
  function fieldNodeKind(field, cls) {
1460
1683
  switch (field.getCategory()) {
1461
1684
  case FIELD_CATEGORY.ENUM_MEMBER:
@@ -1790,6 +2013,45 @@ function stateTransferViaForField(field) {
1790
2013
  function viewTreeLineFromStmt(stmt) {
1791
2014
  return stmt?.getOriginFullPosition()?.getFirstLine() ?? 1;
1792
2015
  }
2016
+ /**
2017
+ * ArkUI `.id('…')` from ViewTree attributes (string Constant only).
2018
+ * Not the HomeGraph node primary key.
2019
+ */
2020
+ function viewTreeArkuiId(node) {
2021
+ try {
2022
+ const entry = node.attributes?.get('id');
2023
+ if (!entry)
2024
+ return undefined;
2025
+ const values = entry[1];
2026
+ if (!values?.length)
2027
+ return undefined;
2028
+ for (const v of values) {
2029
+ if (v == null)
2030
+ continue;
2031
+ const isConstant = v instanceof arkanalyzer_1.Constant ||
2032
+ typeof v.getValue === 'function';
2033
+ if (!isConstant)
2034
+ continue;
2035
+ const raw = String(v.getValue()).trim();
2036
+ if (!raw)
2037
+ continue;
2038
+ const unquoted = raw.replace(/^['"]|['"]$/g, '');
2039
+ if (unquoted)
2040
+ return unquoted;
2041
+ }
2042
+ }
2043
+ catch {
2044
+ // attribute map may throw on malformed IR
2045
+ }
2046
+ return undefined;
2047
+ }
2048
+ /** First non-empty `arkuiId` wins when the same component is used with multiple ids. */
2049
+ function assignArkuiId(result, nodeId, arkuiId) {
2050
+ const n = result.nodes.find((x) => x.id === nodeId);
2051
+ if (!n || n.arkuiId)
2052
+ return;
2053
+ n.arkuiId = arkuiId;
2054
+ }
1793
2055
  function isViewTreeClassSignature(sig) {
1794
2056
  // Prefer instanceof; duck-type fallback if duplicate arkanalyzer copies break instanceof.
1795
2057
  if (sig instanceof arkanalyzer_1.ClassSignature)
@@ -2171,6 +2433,9 @@ function indexViewTreeForClass(ctx, cls, result, relativePath) {
2171
2433
  // keep build() line
2172
2434
  }
2173
2435
  link(buildId, childId, 'references', 'child-component', line);
2436
+ const arkuiId = viewTreeArkuiId(node);
2437
+ if (arkuiId)
2438
+ assignArkuiId(result, childId, arkuiId);
2174
2439
  }
2175
2440
  }
2176
2441
  else {
@@ -2941,7 +3206,7 @@ class ArkTSAdapter {
2941
3206
  let result = this.fileResults.get(relativePath);
2942
3207
  if (!result) {
2943
3208
  result = {
2944
- nodes: [makeFileNode(relativePath, 'arkts', lineCount)],
3209
+ nodes: [makeFileNode(relativePath, languageForArkAnalyzerPath(relativePath), lineCount)],
2945
3210
  edges: [],
2946
3211
  unresolvedReferences: [],
2947
3212
  errors: [],
@@ -2960,7 +3225,7 @@ class ArkTSAdapter {
2960
3225
  }
2961
3226
  indexFile(arkFile) {
2962
3227
  const relativePath = this.normalizeRelPath(arkFile.getFilePath());
2963
- const language = 'arkts';
3228
+ const language = languageForArkAnalyzerPath(relativePath);
2964
3229
  let lineCount = 1;
2965
3230
  try {
2966
3231
  lineCount = arkFile.getCode()?.split('\n').length ?? 1;
@@ -3053,6 +3318,8 @@ class ArkTSAdapter {
3053
3318
  const localNode = makeNode(relativePath, language, kind, name, qn, line, endLine, col, {
3054
3319
  signature: local.getType()?.toString(),
3055
3320
  ...modelModifiersToNodeExtras(local),
3321
+ // Local's public TS surface doesn't declare getMetadata; runtime may still carry it.
3322
+ ...docstringExtras(local),
3056
3323
  });
3057
3324
  this.addNode(result, localNode);
3058
3325
  result.edges.push(arkEdge(parentId, localNode.id, 'contains'));
@@ -3071,6 +3338,8 @@ class ArkTSAdapter {
3071
3338
  const aliasNode = makeNode(relativePath, language, 'type_alias', name, qn, line, endLine, col, {
3072
3339
  signature: aliasType.getOriginalType()?.toString(),
3073
3340
  ...modelModifiersToNodeExtras(aliasType),
3341
+ // AliasType's public TS surface doesn't declare getMetadata; runtime may still carry it.
3342
+ ...docstringExtras(aliasType),
3074
3343
  });
3075
3344
  this.addNode(result, aliasNode);
3076
3345
  result.edges.push(arkEdge(parentId, aliasNode.id, 'contains'));
@@ -3102,6 +3371,7 @@ class ArkTSAdapter {
3102
3371
  const { line, endLine, col } = linesFromPosition(positions[0]);
3103
3372
  const nsNode = makeNode(relativePath, language, 'namespace', ns.getName(), qn, line, endLine, col, {
3104
3373
  ...modelModifiersToNodeExtras(ns),
3374
+ ...docstringExtras(ns),
3105
3375
  });
3106
3376
  this.addNode(result, nsNode);
3107
3377
  result.edges.push(arkEdge(parentId, nsNode.id, 'contains'));
@@ -3122,6 +3392,10 @@ class ArkTSAdapter {
3122
3392
  indexClass(relativePath, language, result, cls, parentId) {
3123
3393
  if (cls.isDefaultArkClass())
3124
3394
  return;
3395
+ // Object / type literals (and C++ unions) are ArkAnalyzer IR classes, not
3396
+ // HomeGraph declaration nodes — skip the shell and its nested fields.
3397
+ if (isNonDeclarationArkClassCategory(cls.getCategory()))
3398
+ return;
3125
3399
  const displayName = classDisplayName(cls);
3126
3400
  const qn = buildClassQualifiedName(cls);
3127
3401
  const kind = classNodeKind(cls);
@@ -3129,6 +3403,7 @@ class ArkTSAdapter {
3129
3403
  const classDecs = (0, migrate_semantics_1.encodeDecoratorEntries)(modelDecoratorEntries(cls));
3130
3404
  const classNode = makeNode(relativePath, language, kind, displayName, qn, line, endLine, col, {
3131
3405
  ...modelModifiersToNodeExtras(cls),
3406
+ ...docstringExtras(cls),
3132
3407
  ...(classDecs.length > 0 ? { decorators: classDecs } : {}),
3133
3408
  });
3134
3409
  this.addNode(result, classNode);
@@ -3159,6 +3434,7 @@ class ArkTSAdapter {
3159
3434
  if (cls.hasComponentDecorator()) {
3160
3435
  const componentNode = makeNode(relativePath, language, 'component', displayName, qn, line, endLine, col, {
3161
3436
  ...modelModifiersToNodeExtras(cls),
3437
+ ...docstringExtras(cls),
3162
3438
  ...(classDecs.length > 0 ? { decorators: classDecs } : {}),
3163
3439
  });
3164
3440
  this.addNode(result, componentNode);
@@ -3215,6 +3491,7 @@ class ArkTSAdapter {
3215
3491
  const aliasNode = makeNode(relativePath, language, 'type_alias', name, qn, line, endLine, col, {
3216
3492
  signature: aliasType.getOriginalType()?.toString(),
3217
3493
  ...modelModifiersToNodeExtras(aliasType),
3494
+ ...docstringExtras(aliasType),
3218
3495
  });
3219
3496
  this.addNode(result, aliasNode);
3220
3497
  result.edges.push(arkEdge(parentId, aliasNode.id, 'contains'));
@@ -3251,6 +3528,7 @@ class ArkTSAdapter {
3251
3528
  signature: field.getType()?.toString(),
3252
3529
  ...(encodedDecs.length > 0 ? { decorators: encodedDecs } : {}),
3253
3530
  ...modelModifiersToNodeExtras(field),
3531
+ ...docstringExtras(field),
3254
3532
  });
3255
3533
  this.addNode(result, fieldNode);
3256
3534
  this.fieldToId.set(field, fieldNode.id);
@@ -3467,7 +3745,7 @@ class ArkTSAdapter {
3467
3745
  if (classId)
3468
3746
  return classId;
3469
3747
  const fileId = `file:${relativePath}`;
3470
- this.indexClass(relativePath, 'arkts', result, cls, fileId);
3748
+ this.indexClass(relativePath, languageForArkAnalyzerPath(relativePath), result, cls, fileId);
3471
3749
  return this.resolveClassNodeId(cls) ?? fileId;
3472
3750
  }
3473
3751
  /**
@@ -3508,7 +3786,7 @@ class ArkTSAdapter {
3508
3786
  const parentId = this.resolveMethodParentId(method, relativePath, result);
3509
3787
  const cls = method.getDeclaringArkClass();
3510
3788
  const kind = cls.isDefaultArkClass() ? 'function' : 'method';
3511
- this.indexMethod(relativePath, 'arkts', result, method, parentId, kind, displayName);
3789
+ this.indexMethod(relativePath, languageForArkAnalyzerPath(relativePath), result, method, parentId, kind, displayName);
3512
3790
  return this.methodToId.get(method) ?? null;
3513
3791
  }
3514
3792
  addViewTreeEdge(result, source, target, kind, callerFile, via, line, extraMeta) {
@@ -3552,7 +3830,7 @@ class ArkTSAdapter {
3552
3830
  return null;
3553
3831
  const cls = method.getDeclaringArkClass();
3554
3832
  const kind = cls.isDefaultArkClass() ? 'function' : 'method';
3555
- this.indexMethod(relativePath, 'arkts', result, method, parentId, kind, displayName);
3833
+ this.indexMethod(relativePath, languageForArkAnalyzerPath(relativePath), result, method, parentId, kind, displayName);
3556
3834
  return this.methodToId.get(method) ?? null;
3557
3835
  }
3558
3836
  indexMethod(relativePath, language, result, method, parentId, forcedKind, forcedDisplayName) {
@@ -3568,6 +3846,7 @@ class ArkTSAdapter {
3568
3846
  ...(signature ? { signature } : {}),
3569
3847
  ...(returnType ? { returnType } : {}),
3570
3848
  ...modelModifiersToNodeExtras(method),
3849
+ ...docstringExtras(method),
3571
3850
  });
3572
3851
  this.addNode(result, methodNode);
3573
3852
  this.methodToId.set(method, methodNode.id);
@@ -3695,6 +3974,9 @@ function buildSceneConfig(rootDir, extra) {
3695
3974
  return (0, arkanalyzer_1.buildSceneConfigFromProject)(rootDir, process.env.OHOS_SDK_HOME, {
3696
3975
  supportFileExts: ['.ets', '.ts', '.d.ts'],
3697
3976
  enableMethodBodyBuild: true,
3977
+ // Spec 0020: feed nodes.docstring → nodes_fts (leading + JSDoc).
3978
+ enableLeadingComments: true,
3979
+ enableJSDoc: true,
3698
3980
  ...(extra?.memoryLimitMB !== undefined ? { memoryLimitMB: extra.memoryLimitMB } : {}),
3699
3981
  });
3700
3982
  }
@@ -3753,23 +4035,21 @@ function buildArkTSIndexByModuleInner(rootDir, scannedFiles, options) {
3753
4035
  };
3754
4036
  try {
3755
4037
  scene.config(sceneConfig);
4038
+ // Register build-profile modules + orphan trees (no oh-package) before the
4039
+ // dep graph is frozen — otherwise analyseByModule never sees HMRouterPlugin-style .ts.
4040
+ const synthetics = prepareArkModulesWithSynthetics(scene, rootDir, scannedList);
4041
+ if (synthetics.length > 0) {
4042
+ process.stderr.write(`\n\x1b[33m ArkTS: synthetic PROJECT modules (${synthetics.length}, no oh-package deps): ${synthetics
4043
+ .map((s) => s.srcPath)
4044
+ .join(', ')}...\x1b[0m\n`);
4045
+ }
3756
4046
  const config = new arkanalyzer_1.ModuleAnalysisConfig();
3757
4047
  config.setLoadLevel(arkanalyzer_1.ModuleDepthLevel.BODIES);
3758
4048
  // SIGNATURES is enough for ViewTree stubs / types; BODIES on deps caused
3759
4049
  // each module's RTA to re-walk shared library CFGs (multi-hour indexes).
3760
4050
  config.setDependencyLoadLevel(arkanalyzer_1.ModuleDepthLevel.SIGNATURES);
3761
4051
  if (targetSrcSet) {
3762
- // Prep + SDK only (no PROJECT targets) so we can resolve ModuleIDs.
3763
- scene.analyseByModule(() => { }, new arkanalyzer_1.ModuleAnalysisConfig());
3764
- const wantAbs = new Set([...targetSrcSet].map((src) => {
3765
- const resolved = path.resolve(rootDir, src);
3766
- try {
3767
- return fs.realpathSync(resolved).toLowerCase();
3768
- }
3769
- catch {
3770
- return resolved.toLowerCase();
3771
- }
3772
- }));
4052
+ const wantAbs = new Set([...targetSrcSet].map((src) => resolveArkModuleAbsPath(rootDir, src).toLowerCase()));
3773
4053
  const ids = [];
3774
4054
  for (const mod of scene.getModules()) {
3775
4055
  if (mod.getModuleType() !== arkanalyzer_1.ModuleType.PROJECT)