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.
- package/LICENSE +21 -21
- package/README.md +305 -305
- package/dist/bin/command-supervision.d.ts.map +1 -1
- package/dist/bin/command-supervision.js +7 -4
- package/dist/bin/command-supervision.js.map +1 -1
- package/dist/bin/homegraph.js +9 -9
- package/dist/db/index.js +36 -36
- package/dist/db/migrations.js +37 -37
- package/dist/db/queries.js +156 -156
- package/dist/db/schema.sql +203 -203
- package/dist/directory.js +5 -5
- package/dist/extraction/languages/arkts-viewtree.d.ts +2 -4
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.js +6 -21
- package/dist/extraction/languages/arkts-viewtree.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +16 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +174 -21
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/installer/instructions-template.js +9 -9
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +185 -73
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/server-instructions.js +47 -47
- package/dist/reasoning/reasoner.js +32 -32
- package/dist/spec/db/commit-node.js +4 -4
- package/dist/spec/db/fragment-node.js +10 -10
- package/dist/spec/db/fts.js +8 -8
- package/dist/spec/db/relations.js +88 -88
- package/dist/spec/db/schema.js +6 -6
- package/dist/spec/db/schema.sql +121 -121
- package/dist/spec/db/spec-node.js +4 -4
- package/dist/spec/llm/prompts.js +53 -53
- package/dist/spec/utils.d.ts +16 -4
- package/dist/spec/utils.d.ts.map +1 -1
- package/dist/spec/utils.js +58 -6
- package/dist/spec/utils.js.map +1 -1
- package/package.json +62 -62
- package/scripts/_tmp-cfwk-resolve.log +0 -0
- package/scripts/_tmp-cfwk-sig.log +0 -0
- package/scripts/_tmp-cfwk-vt.log +0 -0
- package/scripts/add-lang/bench.sh +60 -60
- package/scripts/add-lang/check-grammar.mjs +75 -75
- package/scripts/add-lang/dump-ast.mjs +103 -103
- package/scripts/add-lang/verify-extraction.mjs +70 -70
- package/scripts/agent-eval/ab-adoption.sh +91 -91
- package/scripts/agent-eval/ab-hook.sh +86 -86
- package/scripts/agent-eval/ab-impl.sh +78 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -102
- package/scripts/agent-eval/ab-sufficiency.sh +78 -78
- package/scripts/agent-eval/arms-F.sh +21 -21
- package/scripts/agent-eval/arms-matrix.sh +37 -37
- package/scripts/agent-eval/audit.sh +68 -68
- package/scripts/agent-eval/bench-readme.sh +28 -28
- package/scripts/agent-eval/bench-why-repo.sh +22 -22
- package/scripts/agent-eval/block-read-hook.sh +19 -19
- package/scripts/agent-eval/hook-settings.json +15 -15
- package/scripts/agent-eval/itrun.sh +120 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -50
- package/scripts/agent-eval/offload-eval-setup.sh +24 -24
- package/scripts/agent-eval/offload-eval-styles.sh +71 -71
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -68
- package/scripts/agent-eval/offload-eval.md +76 -76
- package/scripts/agent-eval/parse-arms.mjs +116 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -84
- package/scripts/agent-eval/parse-run.mjs +45 -45
- package/scripts/agent-eval/parse-session.mjs +93 -93
- package/scripts/agent-eval/probe-context.mjs +21 -21
- package/scripts/agent-eval/probe-explore.mjs +40 -40
- package/scripts/agent-eval/probe-node.mjs +20 -20
- package/scripts/agent-eval/probe-sweep.mjs +119 -119
- package/scripts/agent-eval/probe-trace.mjs +20 -20
- package/scripts/agent-eval/redirect-read-hook.sh +38 -38
- package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -119
- package/scripts/agent-eval/repro-daemon-clients.mjs +125 -125
- package/scripts/agent-eval/run-agent.sh +34 -34
- package/scripts/agent-eval/run-all.sh +75 -75
- package/scripts/agent-eval/run-arms.sh +56 -56
- package/scripts/agent-eval/seq-matrix.mjs +137 -137
- package/scripts/bench-arkts-init-rss.log +0 -0
- package/scripts/build-bundle.sh +123 -123
- package/scripts/exp_boundary_eval/README.md +247 -247
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/_test_mcp_chain.py +78 -78
- package/scripts/exp_boundary_eval/_test_stdin.py +8 -8
- package/scripts/exp_boundary_eval/_utils.py +1116 -1116
- package/scripts/exp_boundary_eval/analyze.py +1313 -1313
- package/scripts/exp_boundary_eval/deveco_arm.py +519 -519
- package/scripts/exp_boundary_eval/run_all.py +378 -378
- package/scripts/exp_boundary_eval/run_one.py +165 -165
- package/scripts/exp_boundary_eval/run_session.py +158 -158
- package/scripts/exp_boundary_eval/setup.py +120 -120
- package/scripts/exp_boundary_eval/win_mcp_launcher.py +73 -73
- package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +36 -36
- package/scripts/exp_boundary_eval/win_node_launcher.py +24 -24
- package/scripts/extract-release-notes.mjs +130 -130
- package/scripts/local-install.sh +41 -41
- package/scripts/npm-sdk.js +75 -75
- package/scripts/npm-shim.js +275 -275
- package/scripts/ohos-sdk-publish.mjs +133 -133
- package/scripts/pack-npm.sh +119 -119
- package/scripts/prepare-release.mjs +270 -270
- package/scripts/probe-arkts-mem-why-run.log +0 -0
- package/scripts/probe-banner-livecard-ir.log +0 -0
- package/scripts/probe-cfwk-ast.stderr.log +0 -0
- package/scripts/probe-cfwk-ast.stdout.log +0 -0
- package/scripts/probe-cfwk-attr-shape.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
- package/scripts/probe-cfwk-cvc.stderr.log +0 -0
- package/scripts/probe-cfwk-cvc.stdout.log +0 -0
- package/scripts/probe-cfwk-diag2.log +0 -0
- package/scripts/probe-cfwk-diag3.log +0 -0
- package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
- package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
- package/scripts/probe-cfwk-fileresult.log +0 -0
- package/scripts/probe-cfwk-fix.stderr.log +0 -0
- package/scripts/probe-cfwk-fix.stdout.log +0 -0
- package/scripts/probe-cfwk-fix2.stderr.log +0 -0
- package/scripts/probe-cfwk-fix2.stdout.log +0 -0
- package/scripts/probe-cfwk-fix3.stderr.log +0 -0
- package/scripts/probe-cfwk-fix3.stdout.log +0 -0
- package/scripts/probe-cfwk-foreach.log +0 -0
- package/scripts/probe-cfwk-getmethod-throw.log +0 -0
- package/scripts/probe-cfwk-hg-extract.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
- package/scripts/probe-cfwk-resolve-sim.log +0 -0
- package/scripts/probe-cfwk-tree-shape.log +0 -0
- package/scripts/probe-cfwk-walk-abort.log +0 -0
- package/scripts/probe-cfwk.log +0 -0
- package/scripts/probe-force-index.log +0 -0
- package/scripts/probe-no-force-index.log +0 -0
- package/scripts/probe-samefile-ir.stderr.log +0 -0
- package/scripts/probe-samefile-ir.stdout.log +224 -0
- package/scripts/probe-sdk-vs-project.log +0 -0
- package/scripts/probe-viewtree-downgrade.log +0 -0
- package/dist/arkts/ohos-api-index.d.ts +0 -15
- package/dist/arkts/ohos-api-index.d.ts.map +0 -1
- package/dist/arkts/ohos-api-index.js +0 -190
- package/dist/arkts/ohos-api-index.js.map +0 -1
- package/dist/arkts/ohos-sdk-input.d.ts +0 -36
- package/dist/arkts/ohos-sdk-input.d.ts.map +0 -1
- package/dist/arkts/ohos-sdk-input.js +0 -214
- package/dist/arkts/ohos-sdk-input.js.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.d.ts +0 -13
- package/dist/extraction/languages/arkts-state-decorators.d.ts.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.js +0 -26
- package/dist/extraction/languages/arkts-state-decorators.js.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.d.ts +0 -34
- package/dist/extraction/languages/ohos-api-consumer.d.ts.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.js +0 -283
- package/dist/extraction/languages/ohos-api-consumer.js.map +0 -1
- package/dist/spec/build/git-scanner.d.ts +0 -93
- package/dist/spec/build/git-scanner.d.ts.map +0 -1
- package/dist/spec/build/git-scanner.js +0 -254
- package/dist/spec/build/git-scanner.js.map +0 -1
- package/dist/spec/git-utils.d.ts +0 -8
- package/dist/spec/git-utils.d.ts.map +0 -1
- package/dist/spec/git-utils.js +0 -14
- package/dist/spec/git-utils.js.map +0 -1
- package/dist/spec/mine/clusterer.d.ts +0 -63
- package/dist/spec/mine/clusterer.d.ts.map +0 -1
- package/dist/spec/mine/clusterer.js +0 -904
- package/dist/spec/mine/clusterer.js.map +0 -1
- package/dist/spec/mine/progress-handler.d.ts +0 -22
- package/dist/spec/mine/progress-handler.d.ts.map +0 -1
- package/dist/spec/mine/progress-handler.js +0 -108
- package/dist/spec/mine/progress-handler.js.map +0 -1
- package/dist/spec/mine/progress.d.ts +0 -23
- package/dist/spec/mine/progress.d.ts.map +0 -1
- package/dist/spec/mine/progress.js +0 -12
- 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.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
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)) {
|