homegraph 1.5.0 → 1.5.1

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 (214) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +305 -305
  3. package/dist/bin/command-supervision.d.ts.map +1 -1
  4. package/dist/bin/command-supervision.js +7 -4
  5. package/dist/bin/command-supervision.js.map +1 -1
  6. package/dist/bin/homegraph.js +9 -9
  7. package/dist/db/index.js +36 -36
  8. package/dist/db/migrations.js +37 -37
  9. package/dist/db/queries.js +156 -156
  10. package/dist/db/schema.sql +203 -203
  11. package/dist/directory.js +5 -5
  12. package/dist/extraction/languages/arkts-viewtree.d.ts +2 -4
  13. package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -1
  14. package/dist/extraction/languages/arkts-viewtree.js +6 -21
  15. package/dist/extraction/languages/arkts-viewtree.js.map +1 -1
  16. package/dist/extraction/languages/arkts.d.ts +16 -6
  17. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  18. package/dist/extraction/languages/arkts.js +174 -21
  19. package/dist/extraction/languages/arkts.js.map +1 -1
  20. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  21. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  22. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  23. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  24. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  25. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  26. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  27. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  28. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  29. package/dist/installer/instructions-template.js +9 -9
  30. package/dist/mcp/liveness-watchdog.d.ts +18 -0
  31. package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  32. package/dist/mcp/liveness-watchdog.js +185 -73
  33. package/dist/mcp/liveness-watchdog.js.map +1 -1
  34. package/dist/mcp/server-instructions.js +47 -47
  35. package/dist/reasoning/reasoner.js +32 -32
  36. package/dist/spec/db/commit-node.js +4 -4
  37. package/dist/spec/db/fragment-node.js +10 -10
  38. package/dist/spec/db/fts.js +8 -8
  39. package/dist/spec/db/relations.js +88 -88
  40. package/dist/spec/db/schema.js +6 -6
  41. package/dist/spec/db/schema.sql +121 -121
  42. package/dist/spec/db/spec-node.js +4 -4
  43. package/dist/spec/llm/prompts.js +53 -53
  44. package/dist/spec/utils.d.ts +16 -4
  45. package/dist/spec/utils.d.ts.map +1 -1
  46. package/dist/spec/utils.js +58 -6
  47. package/dist/spec/utils.js.map +1 -1
  48. package/package.json +62 -62
  49. package/scripts/_tmp-cfwk-resolve.log +0 -0
  50. package/scripts/_tmp-cfwk-sig.log +0 -0
  51. package/scripts/_tmp-cfwk-vt.log +0 -0
  52. package/scripts/add-lang/bench.sh +60 -60
  53. package/scripts/add-lang/check-grammar.mjs +75 -75
  54. package/scripts/add-lang/dump-ast.mjs +103 -103
  55. package/scripts/add-lang/verify-extraction.mjs +70 -70
  56. package/scripts/agent-eval/ab-adoption.sh +91 -91
  57. package/scripts/agent-eval/ab-hook.sh +86 -86
  58. package/scripts/agent-eval/ab-impl.sh +78 -78
  59. package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -102
  60. package/scripts/agent-eval/ab-sufficiency.sh +78 -78
  61. package/scripts/agent-eval/arms-F.sh +21 -21
  62. package/scripts/agent-eval/arms-matrix.sh +37 -37
  63. package/scripts/agent-eval/audit.sh +68 -68
  64. package/scripts/agent-eval/bench-readme.sh +28 -28
  65. package/scripts/agent-eval/bench-why-repo.sh +22 -22
  66. package/scripts/agent-eval/block-read-hook.sh +19 -19
  67. package/scripts/agent-eval/hook-settings.json +15 -15
  68. package/scripts/agent-eval/itrun.sh +120 -120
  69. package/scripts/agent-eval/offload-eval-3arm.sh +72 -72
  70. package/scripts/agent-eval/offload-eval-cost.mjs +133 -133
  71. package/scripts/agent-eval/offload-eval-effort.mjs +108 -108
  72. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -25
  73. package/scripts/agent-eval/offload-eval-frontload.sh +47 -47
  74. package/scripts/agent-eval/offload-eval-ground-truth.json +18 -18
  75. package/scripts/agent-eval/offload-eval-hook.mjs +84 -84
  76. package/scripts/agent-eval/offload-eval-judge.mjs +103 -103
  77. package/scripts/agent-eval/offload-eval-matrix.sh +20 -20
  78. package/scripts/agent-eval/offload-eval-metrics.mjs +94 -94
  79. package/scripts/agent-eval/offload-eval-refs1.sh +50 -50
  80. package/scripts/agent-eval/offload-eval-setup.sh +24 -24
  81. package/scripts/agent-eval/offload-eval-styles.sh +71 -71
  82. package/scripts/agent-eval/offload-eval-summarize.mjs +68 -68
  83. package/scripts/agent-eval/offload-eval.md +76 -76
  84. package/scripts/agent-eval/parse-arms.mjs +116 -116
  85. package/scripts/agent-eval/parse-bench-readme.mjs +84 -84
  86. package/scripts/agent-eval/parse-run.mjs +45 -45
  87. package/scripts/agent-eval/parse-session.mjs +93 -93
  88. package/scripts/agent-eval/probe-context.mjs +21 -21
  89. package/scripts/agent-eval/probe-explore.mjs +40 -40
  90. package/scripts/agent-eval/probe-node.mjs +20 -20
  91. package/scripts/agent-eval/probe-sweep.mjs +119 -119
  92. package/scripts/agent-eval/probe-trace.mjs +20 -20
  93. package/scripts/agent-eval/redirect-read-hook.sh +38 -38
  94. package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -119
  95. package/scripts/agent-eval/repro-daemon-clients.mjs +125 -125
  96. package/scripts/agent-eval/run-agent.sh +34 -34
  97. package/scripts/agent-eval/run-all.sh +75 -75
  98. package/scripts/agent-eval/run-arms.sh +56 -56
  99. package/scripts/agent-eval/seq-matrix.mjs +137 -137
  100. package/scripts/bench-arkts-init-rss.log +0 -0
  101. package/scripts/build-bundle.sh +123 -123
  102. package/scripts/exp_boundary_eval/README.md +247 -247
  103. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
  104. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
  105. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
  106. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
  107. package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
  108. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
  109. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
  110. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
  111. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
  112. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
  113. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
  114. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
  115. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
  116. package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
  117. package/scripts/exp_boundary_eval/_test_mcp_chain.py +78 -78
  118. package/scripts/exp_boundary_eval/_test_stdin.py +8 -8
  119. package/scripts/exp_boundary_eval/_utils.py +1116 -1116
  120. package/scripts/exp_boundary_eval/analyze.py +1313 -1313
  121. package/scripts/exp_boundary_eval/deveco_arm.py +519 -519
  122. package/scripts/exp_boundary_eval/run_all.py +378 -378
  123. package/scripts/exp_boundary_eval/run_one.py +165 -165
  124. package/scripts/exp_boundary_eval/run_session.py +158 -158
  125. package/scripts/exp_boundary_eval/setup.py +120 -120
  126. package/scripts/exp_boundary_eval/win_mcp_launcher.py +73 -73
  127. package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +36 -36
  128. package/scripts/exp_boundary_eval/win_node_launcher.py +24 -24
  129. package/scripts/extract-release-notes.mjs +130 -130
  130. package/scripts/local-install.sh +41 -41
  131. package/scripts/npm-sdk.js +75 -75
  132. package/scripts/npm-shim.js +275 -275
  133. package/scripts/ohos-sdk-publish.mjs +133 -133
  134. package/scripts/pack-npm.sh +119 -119
  135. package/scripts/prepare-release.mjs +270 -270
  136. package/scripts/probe-arkts-mem-why-run.log +0 -0
  137. package/scripts/probe-banner-livecard-ir.log +0 -0
  138. package/scripts/probe-cfwk-ast.stderr.log +0 -0
  139. package/scripts/probe-cfwk-ast.stdout.log +0 -0
  140. package/scripts/probe-cfwk-attr-shape.log +0 -0
  141. package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
  142. package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
  143. package/scripts/probe-cfwk-cvc.stderr.log +0 -0
  144. package/scripts/probe-cfwk-cvc.stdout.log +0 -0
  145. package/scripts/probe-cfwk-diag2.log +0 -0
  146. package/scripts/probe-cfwk-diag3.log +0 -0
  147. package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
  148. package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
  149. package/scripts/probe-cfwk-fileresult.log +0 -0
  150. package/scripts/probe-cfwk-fix.stderr.log +0 -0
  151. package/scripts/probe-cfwk-fix.stdout.log +0 -0
  152. package/scripts/probe-cfwk-fix2.stderr.log +0 -0
  153. package/scripts/probe-cfwk-fix2.stdout.log +0 -0
  154. package/scripts/probe-cfwk-fix3.stderr.log +0 -0
  155. package/scripts/probe-cfwk-fix3.stdout.log +0 -0
  156. package/scripts/probe-cfwk-foreach.log +0 -0
  157. package/scripts/probe-cfwk-getmethod-throw.log +0 -0
  158. package/scripts/probe-cfwk-hg-extract.log +0 -0
  159. package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
  160. package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
  161. package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
  162. package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
  163. package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
  164. package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
  165. package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
  166. package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
  167. package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
  168. package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
  169. package/scripts/probe-cfwk-resolve-sim.log +0 -0
  170. package/scripts/probe-cfwk-tree-shape.log +0 -0
  171. package/scripts/probe-cfwk-walk-abort.log +0 -0
  172. package/scripts/probe-cfwk.log +0 -0
  173. package/scripts/probe-force-index.log +0 -0
  174. package/scripts/probe-no-force-index.log +0 -0
  175. package/scripts/probe-samefile-ir.stderr.log +0 -0
  176. package/scripts/probe-samefile-ir.stdout.log +224 -0
  177. package/scripts/probe-sdk-vs-project.log +0 -0
  178. package/scripts/probe-viewtree-downgrade.log +0 -0
  179. package/dist/arkts/ohos-api-index.d.ts +0 -15
  180. package/dist/arkts/ohos-api-index.d.ts.map +0 -1
  181. package/dist/arkts/ohos-api-index.js +0 -190
  182. package/dist/arkts/ohos-api-index.js.map +0 -1
  183. package/dist/arkts/ohos-sdk-input.d.ts +0 -36
  184. package/dist/arkts/ohos-sdk-input.d.ts.map +0 -1
  185. package/dist/arkts/ohos-sdk-input.js +0 -214
  186. package/dist/arkts/ohos-sdk-input.js.map +0 -1
  187. package/dist/extraction/languages/arkts-state-decorators.d.ts +0 -13
  188. package/dist/extraction/languages/arkts-state-decorators.d.ts.map +0 -1
  189. package/dist/extraction/languages/arkts-state-decorators.js +0 -26
  190. package/dist/extraction/languages/arkts-state-decorators.js.map +0 -1
  191. package/dist/extraction/languages/ohos-api-consumer.d.ts +0 -34
  192. package/dist/extraction/languages/ohos-api-consumer.d.ts.map +0 -1
  193. package/dist/extraction/languages/ohos-api-consumer.js +0 -283
  194. package/dist/extraction/languages/ohos-api-consumer.js.map +0 -1
  195. package/dist/spec/build/git-scanner.d.ts +0 -93
  196. package/dist/spec/build/git-scanner.d.ts.map +0 -1
  197. package/dist/spec/build/git-scanner.js +0 -254
  198. package/dist/spec/build/git-scanner.js.map +0 -1
  199. package/dist/spec/git-utils.d.ts +0 -8
  200. package/dist/spec/git-utils.d.ts.map +0 -1
  201. package/dist/spec/git-utils.js +0 -14
  202. package/dist/spec/git-utils.js.map +0 -1
  203. package/dist/spec/mine/clusterer.d.ts +0 -63
  204. package/dist/spec/mine/clusterer.d.ts.map +0 -1
  205. package/dist/spec/mine/clusterer.js +0 -904
  206. package/dist/spec/mine/clusterer.js.map +0 -1
  207. package/dist/spec/mine/progress-handler.d.ts +0 -22
  208. package/dist/spec/mine/progress-handler.d.ts.map +0 -1
  209. package/dist/spec/mine/progress-handler.js +0 -108
  210. package/dist/spec/mine/progress-handler.js.map +0 -1
  211. package/dist/spec/mine/progress.d.ts +0 -23
  212. package/dist/spec/mine/progress.d.ts.map +0 -1
  213. package/dist/spec/mine/progress.js +0 -12
  214. package/dist/spec/mine/progress.js.map +0 -1
@@ -11,11 +11,14 @@
11
11
  * HarmonyOS multi-module projects (`build-profile.json5`) use
12
12
  * `Scene.analyseByModule` so each HAP/HSP/HAR is the atomic unit (like a file
13
13
  * for tree-sitter languages): symbols + ViewTree + **intra-module RTA** while
14
- * the module has BODIES. CFG does **not** stitch same-module calls (that
15
- * densified past unlimited RTA). Cross-module edges come from RTA with an exact
16
- * MethodSignature map, plus a CFG `%unk` bridge that recovers Class.method /
17
- * free functions from stmt text, UnclearReferenceType names, or PascalCase base
18
- * locals (import + unique target + fan-out blocklist). Deps load to SIGNATURES.
14
+ * the module has BODIES. Per-module RTA entries = DummyMain (Ability/Component
15
+ * lifecycle) **plus the module export surface** (exported functions and methods
16
+ * of exported classes), so non-UI libraries still grow reachable call edges.
17
+ * CFG does **not** stitch same-module calls (that densified past unlimited RTA).
18
+ * Cross-module edges come from RTA with an exact MethodSignature map, plus a
19
+ * CFG `%unk` bridge that recovers Class.method / free functions from stmt text,
20
+ * UnclearReferenceType names, or PascalCase base locals (import + unique target
21
+ * + fan-out blocklist). Deps load to SIGNATURES.
19
22
  *
20
23
  * Sync can re-index a **dirty module subset** (`primeArkTSBatch` + `changedFiles`)
21
24
  * via `ModuleAnalysisConfig.setTargetModuleIds`, instead of rebuilding every
@@ -73,6 +76,7 @@ exports.runIsolatedArkTSBatchEntry = runIsolatedArkTSBatchEntry;
73
76
  exports.primeArkTSBatch = primeArkTSBatch;
74
77
  exports.isArkTSBatchPersisted = isArkTSBatchPersisted;
75
78
  exports.resetArkTSBatch = resetArkTSBatch;
79
+ exports.collectExportedRtaEntryPointsFromFiles = collectExportedRtaEntryPointsFromFiles;
76
80
  exports.stateDecoratorKinds = stateDecoratorKinds;
77
81
  exports.stateTransferViaForField = stateTransferViaForField;
78
82
  exports.isUnclearArkClassSignature = isUnclearArkClassSignature;
@@ -113,6 +117,7 @@ const context_1 = require("../context");
113
117
  const default_ignore_1 = require("../default-ignore");
114
118
  const extraction_version_1 = require("../extraction-version");
115
119
  const version_1 = require("../../mcp/version");
120
+ const liveness_watchdog_1 = require("../../mcp/liveness-watchdog");
116
121
  const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
117
122
  const wasm_runtime_flags_1 = require("../wasm-runtime-flags");
118
123
  const ignore_1 = __importDefault(require("ignore"));
@@ -1303,6 +1308,140 @@ function collectNonUiRtaEntryPointsFromFiles(files) {
1303
1308
  }
1304
1309
  return entries;
1305
1310
  }
1311
+ /**
1312
+ * Methods another module can call into: module `export` surface as RTA entries.
1313
+ * - exported function/method → itself
1314
+ * - exported class/struct → all of its non-skip methods (with body)
1315
+ * Skips `export … from` re-exports (not this module's IR).
1316
+ */
1317
+ function collectExportedRtaEntryPointsFromFiles(files) {
1318
+ const seen = new Set();
1319
+ const out = [];
1320
+ const addMethod = (method) => {
1321
+ if (shouldSkipArkMethod(method))
1322
+ return;
1323
+ try {
1324
+ if (!method.getCfg())
1325
+ return;
1326
+ }
1327
+ catch {
1328
+ return;
1329
+ }
1330
+ try {
1331
+ const sig = method.getSignature();
1332
+ const key = sig.toString();
1333
+ if (seen.has(key))
1334
+ return;
1335
+ seen.add(key);
1336
+ out.push(sig);
1337
+ }
1338
+ catch {
1339
+ // signature unavailable
1340
+ }
1341
+ };
1342
+ const addClass = (cls) => {
1343
+ try {
1344
+ for (const method of cls.getMethods(true)) {
1345
+ addMethod(method);
1346
+ }
1347
+ }
1348
+ catch {
1349
+ // class IR unavailable
1350
+ }
1351
+ };
1352
+ const visitExportInfos = (infos) => {
1353
+ for (const info of infos) {
1354
+ try {
1355
+ if (info.getFrom?.())
1356
+ continue;
1357
+ }
1358
+ catch {
1359
+ continue;
1360
+ }
1361
+ let arkExport;
1362
+ try {
1363
+ arkExport = info.getArkExport?.() ?? null;
1364
+ }
1365
+ catch {
1366
+ continue;
1367
+ }
1368
+ if (!arkExport || typeof arkExport !== 'object')
1369
+ continue;
1370
+ const exp = arkExport;
1371
+ // Prefer ExportType when present (METHOD=2, CLASS=1, NAME_SPACE=0).
1372
+ let exportType;
1373
+ try {
1374
+ exportType = exp.getExportType?.();
1375
+ }
1376
+ catch {
1377
+ exportType = undefined;
1378
+ }
1379
+ if (exportType === 2 || (exportType === undefined && typeof exp.getDeclaringArkClass === 'function' && typeof exp.getCfg === 'function')) {
1380
+ addMethod(arkExport);
1381
+ continue;
1382
+ }
1383
+ if (exportType === 1 || (exportType === undefined && typeof exp.getMethods === 'function')) {
1384
+ addClass(arkExport);
1385
+ continue;
1386
+ }
1387
+ if (exportType === 0 || typeof exp.getClasses === 'function') {
1388
+ try {
1389
+ for (const cls of exp.getClasses?.() ?? []) {
1390
+ addClass(cls);
1391
+ }
1392
+ }
1393
+ catch {
1394
+ // ignore
1395
+ }
1396
+ const nested = exp.getExportInfos?.();
1397
+ if (nested)
1398
+ visitExportInfos(nested);
1399
+ }
1400
+ }
1401
+ };
1402
+ for (const file of files) {
1403
+ try {
1404
+ visitExportInfos(file.getExportInfos());
1405
+ }
1406
+ catch {
1407
+ // ignore
1408
+ }
1409
+ try {
1410
+ for (const ns of file.getNamespaces()) {
1411
+ try {
1412
+ visitExportInfos(ns.getExportInfos());
1413
+ }
1414
+ catch {
1415
+ // ignore
1416
+ }
1417
+ }
1418
+ }
1419
+ catch {
1420
+ // ignore
1421
+ }
1422
+ }
1423
+ return out;
1424
+ }
1425
+ /** Merge RTA entry signatures, preserving order and dropping duplicates. */
1426
+ function mergeRtaEntryPoints(...groups) {
1427
+ const seen = new Set();
1428
+ const out = [];
1429
+ for (const group of groups) {
1430
+ for (const sig of group) {
1431
+ try {
1432
+ const key = sig.toString();
1433
+ if (seen.has(key))
1434
+ continue;
1435
+ seen.add(key);
1436
+ out.push(sig);
1437
+ }
1438
+ catch {
1439
+ // ignore
1440
+ }
1441
+ }
1442
+ }
1443
+ return out;
1444
+ }
1306
1445
  function resolveRtaEntryPoints(scene) {
1307
1446
  return resolveRtaEntryPointsFromFiles(scene, scene.getFiles());
1308
1447
  }
@@ -2054,6 +2193,10 @@ class ArkTSAdapter {
2054
2193
  if (dummyMain) {
2055
2194
  this.indexArkanalyzerDummyMain(dummyMain);
2056
2195
  }
2196
+ // Export surface = cross-module call-ins; seed them as RTA entries so
2197
+ // non-UI libraries (Manager.getInstance → …) grow intra-module edges
2198
+ // without waiting for a Component DummyMain to reach them.
2199
+ entryPoints = mergeRtaEntryPoints(entryPoints, collectExportedRtaEntryPointsFromFiles(files));
2057
2200
  if (entryPoints.length === 0)
2058
2201
  return;
2059
2202
  let callGraph;
@@ -3072,8 +3215,15 @@ function emptyArkTSBatchIndex(errors) {
3072
3215
  * HomeGraph structures in the callback, let ArkAnalyzer evict under memoryLimitMB.
3073
3216
  * When `targetModuleSrcPaths` is set, only those modules are BODIES targets
3074
3217
  * (deps still load at SIGNATURES) — used for incremental sync.
3218
+ *
3219
+ * Runs with the #850 liveness watchdog suspended: ArkAnalyzer's native BODIES
3220
+ * load between module callbacks routinely exceeds the 60s heartbeat window on
3221
+ * large Harmony projects, and there is no JS yield point inside that span.
3075
3222
  */
3076
3223
  function buildArkTSIndexByModule(rootDir, scannedFiles, options) {
3224
+ return (0, liveness_watchdog_1.runWithoutLivenessWatchdog)(() => buildArkTSIndexByModuleInner(rootDir, scannedFiles, options));
3225
+ }
3226
+ function buildArkTSIndexByModuleInner(rootDir, scannedFiles, options) {
3077
3227
  const errors = [];
3078
3228
  const memoryLimitMB = resolveArkTSSceneMemoryLimitMB();
3079
3229
  const sceneConfig = buildSceneConfig(rootDir, { memoryLimitMB });
@@ -3181,22 +3331,25 @@ function buildArkTSIndexByModule(rootDir, scannedFiles, options) {
3181
3331
  }
3182
3332
  }
3183
3333
  function buildArkTSIndexFull(rootDir, scannedFiles, priorErrors = []) {
3184
- const { scene, errors } = tryBuildArkScene(rootDir);
3185
- const allErrors = [...priorErrors, ...errors];
3186
- if (!scene) {
3187
- return emptyArkTSBatchIndex(allErrors);
3188
- }
3189
- try {
3190
- const adapter = new ArkTSAdapter(rootDir, scannedFiles);
3191
- const index = adapter.build(scene);
3192
- index.errors.push(...allErrors);
3193
- return index;
3194
- }
3195
- catch (e) {
3196
- const message = e instanceof Error ? e.message : String(e);
3197
- allErrors.push({ message: `ArkTS adapter failed: ${message}`, severity: 'error' });
3198
- return emptyArkTSBatchIndex(allErrors);
3199
- }
3334
+ // Full Scene build is the same opaque native stall as analyseByModule.
3335
+ return (0, liveness_watchdog_1.runWithoutLivenessWatchdog)(() => {
3336
+ const { scene, errors } = tryBuildArkScene(rootDir);
3337
+ const allErrors = [...priorErrors, ...errors];
3338
+ if (!scene) {
3339
+ return emptyArkTSBatchIndex(allErrors);
3340
+ }
3341
+ try {
3342
+ const adapter = new ArkTSAdapter(rootDir, scannedFiles);
3343
+ const index = adapter.build(scene);
3344
+ index.errors.push(...allErrors);
3345
+ return index;
3346
+ }
3347
+ catch (e) {
3348
+ const message = e instanceof Error ? e.message : String(e);
3349
+ allErrors.push({ message: `ArkTS adapter failed: ${message}`, severity: 'error' });
3350
+ return emptyArkTSBatchIndex(allErrors);
3351
+ }
3352
+ });
3200
3353
  }
3201
3354
  function buildArkTSIndex(rootDir, scannedFiles) {
3202
3355
  if (shouldUseModularArkTSBuild(rootDir)) {