arkanalyzer 1.0.90 → 1.0.91

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 (122) hide show
  1. package/config/arkanalyzer.json +0 -1
  2. package/lib/Config.d.ts +3 -0
  3. package/lib/Config.d.ts.map +1 -1
  4. package/lib/Scene.d.ts +99 -0
  5. package/lib/Scene.d.ts.map +1 -1
  6. package/lib/Scene.js +229 -13
  7. package/lib/callgraph/common/Statistics.js +2 -2
  8. package/lib/callgraph/model/CallGraph.d.ts +2 -2
  9. package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
  10. package/lib/callgraph/model/CallGraph.js +6 -6
  11. package/lib/callgraph/model/CallSite.d.ts +1 -1
  12. package/lib/callgraph/model/CallSite.d.ts.map +1 -1
  13. package/lib/callgraph/model/CallSite.js +2 -2
  14. package/lib/core/base/Ref.d.ts.map +1 -1
  15. package/lib/core/base/Ref.js +6 -1
  16. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  17. package/lib/core/common/ArkIRTransformer.js +5 -0
  18. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  19. package/lib/core/common/ArkValueTransformer.js +2 -1
  20. package/lib/core/common/Const.d.ts +3 -0
  21. package/lib/core/common/Const.d.ts.map +1 -1
  22. package/lib/core/common/Const.js +5 -1
  23. package/lib/core/common/DummyMainCreater.d.ts +25 -12
  24. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  25. package/lib/core/common/DummyMainCreater.js +90 -76
  26. package/lib/core/common/EtsConst.d.ts +2 -0
  27. package/lib/core/common/EtsConst.d.ts.map +1 -1
  28. package/lib/core/common/EtsConst.js +133 -125
  29. package/lib/core/common/SdkUtils.d.ts +1 -0
  30. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  31. package/lib/core/common/SdkUtils.js +29 -0
  32. package/lib/core/graph/BaseExplicitGraph.d.ts +2 -0
  33. package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
  34. package/lib/core/graph/BaseExplicitGraph.js +12 -1
  35. package/lib/core/graph/BaseImplicitGraph.d.ts +16 -0
  36. package/lib/core/graph/BaseImplicitGraph.d.ts.map +1 -1
  37. package/lib/core/graph/BaseImplicitGraph.js +21 -0
  38. package/lib/core/graph/FileDepGraph.d.ts +75 -0
  39. package/lib/core/graph/FileDepGraph.d.ts.map +1 -0
  40. package/lib/core/graph/FileDepGraph.js +170 -0
  41. package/lib/core/graph/GraphTraits.d.ts +2 -0
  42. package/lib/core/graph/GraphTraits.d.ts.map +1 -1
  43. package/lib/core/graph/GraphTraits.js +1 -1
  44. package/lib/core/graph/ModuleDepGraph.d.ts +175 -0
  45. package/lib/core/graph/ModuleDepGraph.d.ts.map +1 -0
  46. package/lib/core/graph/ModuleDepGraph.js +421 -0
  47. package/lib/core/graph/Scc.d.ts +1 -3
  48. package/lib/core/graph/Scc.d.ts.map +1 -1
  49. package/lib/core/graph/Scc.js +6 -19
  50. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  51. package/lib/core/graph/builder/CfgBuilder.js +7 -1
  52. package/lib/core/graph/builder/TrapBuilder.d.ts +1 -0
  53. package/lib/core/graph/builder/TrapBuilder.d.ts.map +1 -1
  54. package/lib/core/graph/builder/TrapBuilder.js +27 -7
  55. package/lib/core/model/ArkBody.d.ts +1 -0
  56. package/lib/core/model/ArkBody.d.ts.map +1 -1
  57. package/lib/core/model/ArkBody.js +7 -0
  58. package/lib/core/model/ArkClass.d.ts +1 -0
  59. package/lib/core/model/ArkClass.d.ts.map +1 -1
  60. package/lib/core/model/ArkClass.js +37 -0
  61. package/lib/core/model/ArkExport.d.ts +1 -0
  62. package/lib/core/model/ArkExport.d.ts.map +1 -1
  63. package/lib/core/model/ArkExport.js +6 -0
  64. package/lib/core/model/ArkField.d.ts +1 -0
  65. package/lib/core/model/ArkField.d.ts.map +1 -1
  66. package/lib/core/model/ArkField.js +5 -0
  67. package/lib/core/model/ArkFile.d.ts +5 -0
  68. package/lib/core/model/ArkFile.d.ts.map +1 -1
  69. package/lib/core/model/ArkFile.js +30 -0
  70. package/lib/core/model/ArkImport.d.ts +1 -0
  71. package/lib/core/model/ArkImport.d.ts.map +1 -1
  72. package/lib/core/model/ArkImport.js +5 -0
  73. package/lib/core/model/ArkMethod.d.ts +8 -0
  74. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  75. package/lib/core/model/ArkMethod.js +22 -0
  76. package/lib/core/model/ArkModule.d.ts +136 -0
  77. package/lib/core/model/ArkModule.d.ts.map +1 -0
  78. package/lib/core/model/ArkModule.js +250 -0
  79. package/lib/core/model/ArkNamespace.d.ts +1 -0
  80. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  81. package/lib/core/model/ArkNamespace.js +18 -0
  82. package/lib/core/model/builder/ArkFileBuilder.d.ts +19 -0
  83. package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
  84. package/lib/core/model/builder/ArkFileBuilder.js +155 -51
  85. package/lib/frontend/FrontendBuilder.d.ts +116 -0
  86. package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
  87. package/lib/frontend/FrontendBuilder.js +256 -0
  88. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +11 -0
  89. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
  90. package/lib/frontend/arktsFrontend/ArktsFrontend.js +15 -0
  91. package/lib/frontend/common/MemoryMonitor.d.ts +62 -0
  92. package/lib/frontend/common/MemoryMonitor.d.ts.map +1 -0
  93. package/lib/frontend/common/MemoryMonitor.js +108 -0
  94. package/lib/frontend/common/ModuleAnalysisConfig.d.ts +92 -0
  95. package/lib/frontend/common/ModuleAnalysisConfig.d.ts.map +1 -0
  96. package/lib/frontend/common/ModuleAnalysisConfig.js +144 -0
  97. package/lib/frontend/common/ModuleBuilder.d.ts +497 -0
  98. package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -0
  99. package/lib/frontend/common/ModuleBuilder.js +1458 -0
  100. package/lib/frontend/common/ModuleCache.d.ts +119 -0
  101. package/lib/frontend/common/ModuleCache.d.ts.map +1 -0
  102. package/lib/frontend/common/ModuleCache.js +197 -0
  103. package/lib/frontend/common/ModuleDepth.d.ts +28 -0
  104. package/lib/frontend/common/ModuleDepth.d.ts.map +1 -0
  105. package/lib/frontend/common/ModuleDepth.js +45 -0
  106. package/lib/frontend/cppFrontend/CppFrontend.d.ts +5 -0
  107. package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
  108. package/lib/frontend/cppFrontend/CppFrontend.js +11 -1
  109. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +8 -0
  110. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
  111. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +105 -2
  112. package/lib/index.d.ts +9 -1
  113. package/lib/index.d.ts.map +1 -1
  114. package/lib/index.js +22 -3
  115. package/lib/utils/Canonicalizer.d.ts +105 -0
  116. package/lib/utils/Canonicalizer.d.ts.map +1 -0
  117. package/lib/utils/Canonicalizer.js +520 -0
  118. package/lib/utils/ModuleUtils.js +4 -2
  119. package/lib/utils/entryMethodUtils.d.ts +23 -0
  120. package/lib/utils/entryMethodUtils.d.ts.map +1 -1
  121. package/lib/utils/entryMethodUtils.js +53 -1
  122. package/package.json +1 -1
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.FileDepGraph = void 0;
18
+ const BaseImplicitGraph_1 = require("./BaseImplicitGraph");
19
+ const Scc_1 = require("./Scc");
20
+ /**
21
+ * File dependency graph, based on BaseImplicitGraph.
22
+ * The node type is ArkFile, and edges represent dependency relationships between files.
23
+ *
24
+ * Similar to ModuleDepGraph but operates at file granularity:
25
+ * - The node is the ArkFile itself, identified by its Canonicalizer-assigned ID
26
+ * - Edge information is implicitly stored via succMap/predMap (Map<NodeID, NodeID[]>)
27
+ * - Works with Canonicalizer<ArkFile> to provide bidirectional ArkFile <-> NodeID mapping
28
+ *
29
+ * SCCDetection is used to compute a topological order of files (depended-on files first).
30
+ */
31
+ class FileDepGraph extends BaseImplicitGraph_1.BaseImplicitGraph {
32
+ constructor(fileCanonicalizer) {
33
+ super();
34
+ /**
35
+ * Topological order of nodes after SCC computation, populated by computeTopoOrder.
36
+ * Depended-on files appear before their dependents.
37
+ */
38
+ this.topoOrder = [];
39
+ this.fileCanonicalizer = fileCanonicalizer;
40
+ this.nodeToIdMap = new Map();
41
+ this.idToNodeMap = new Map();
42
+ this.succMap = new Map();
43
+ this.predMap = new Map();
44
+ }
45
+ getGraphName() {
46
+ return 'FileDepGraph';
47
+ }
48
+ /**
49
+ * Add a file node to the graph.
50
+ * The node's NodeID directly uses the ID assigned by the Canonicalizer.
51
+ */
52
+ addFile(file) {
53
+ const id = this.fileCanonicalizer.getId(file);
54
+ this.nodeToIdMap.set(file, id);
55
+ this.idToNodeMap.set(id, file);
56
+ // Ensure the node has corresponding entries in succMap and predMap (empty arrays)
57
+ if (!this.succMap.has(id)) {
58
+ this.succMap.set(id, []);
59
+ }
60
+ if (!this.predMap.has(id)) {
61
+ this.predMap.set(id, []);
62
+ }
63
+ }
64
+ /**
65
+ * Add a dependency edge: src depends on dst (src -> dst).
66
+ * succMap stores successors (dependency targets), predMap stores predecessors (dependents).
67
+ */
68
+ addDependencyEdge(srcId, dstId) {
69
+ // Add successor
70
+ let succs = this.succMap.get(srcId);
71
+ if (!succs) {
72
+ succs = [];
73
+ this.succMap.set(srcId, succs);
74
+ }
75
+ if (!succs.includes(dstId)) {
76
+ succs.push(dstId);
77
+ }
78
+ // Add predecessor
79
+ let preds = this.predMap.get(dstId);
80
+ if (!preds) {
81
+ preds = [];
82
+ this.predMap.set(dstId, preds);
83
+ }
84
+ if (!preds.includes(srcId)) {
85
+ preds.push(srcId);
86
+ }
87
+ }
88
+ /**
89
+ * Remove a dependency edge.
90
+ */
91
+ removeDependencyEdge(srcId, dstId) {
92
+ this.removeFromAdjacencyList(this.succMap, srcId, dstId);
93
+ this.removeFromAdjacencyList(this.predMap, dstId, srcId);
94
+ }
95
+ /**
96
+ * Remove a node ID from an adjacency list entry.
97
+ */
98
+ removeFromAdjacencyList(adjMap, key, value) {
99
+ const list = adjMap.get(key);
100
+ if (!list) {
101
+ return;
102
+ }
103
+ const idx = list.indexOf(value);
104
+ if (idx >= 0) {
105
+ list.splice(idx, 1);
106
+ }
107
+ }
108
+ /**
109
+ * Get all successor (dependency target) file IDs of the specified file.
110
+ */
111
+ getSuccFileIds(fileId) {
112
+ var _a;
113
+ return (_a = this.succMap.get(fileId)) !== null && _a !== void 0 ? _a : [];
114
+ }
115
+ /**
116
+ * Get all predecessor (dependent) file IDs of the specified file.
117
+ */
118
+ getPredFileIds(fileId) {
119
+ var _a;
120
+ return (_a = this.predMap.get(fileId)) !== null && _a !== void 0 ? _a : [];
121
+ }
122
+ /**
123
+ * Check whether a dependency edge exists between two files.
124
+ */
125
+ hasDependencyEdge(srcId, dstId) {
126
+ const succs = this.succMap.get(srcId);
127
+ return succs !== undefined && succs.includes(dstId);
128
+ }
129
+ /**
130
+ * Get the total number of edges in the graph.
131
+ */
132
+ getEdgeCount() {
133
+ let count = 0;
134
+ this.succMap.forEach((succs) => {
135
+ count += succs.length;
136
+ });
137
+ return count;
138
+ }
139
+ /**
140
+ * Get the topological order produced by the last computeTopoOrder call.
141
+ * Depended-on files appear before their dependents.
142
+ */
143
+ getTopoOrder() {
144
+ return this.topoOrder;
145
+ }
146
+ /**
147
+ * Compute the topological order of all files using SCCDetection.
148
+ * Each SCC representative in the topological stack is expanded to its members,
149
+ * so every node appears exactly once. The result is stored in topoOrder and returned.
150
+ * Depended-on files appear before their dependents.
151
+ */
152
+ computeTopoOrder() {
153
+ const scc = new Scc_1.SCCDetection(this);
154
+ scc.find();
155
+ const topoStack = scc.getTopoAndCollapsedNodeStack();
156
+ this.topoOrder = [];
157
+ const added = new Set();
158
+ for (const repId of topoStack) {
159
+ const members = Array.from(scc.getMySCCNodes(repId));
160
+ for (const memberId of members) {
161
+ if (!added.has(memberId)) {
162
+ added.add(memberId);
163
+ this.topoOrder.push(memberId);
164
+ }
165
+ }
166
+ }
167
+ return this.topoOrder;
168
+ }
169
+ }
170
+ exports.FileDepGraph = FileDepGraph;
@@ -4,5 +4,7 @@ export interface GraphTraits<Node> {
4
4
  nodesItor(): IterableIterator<Node>;
5
5
  getGraphName(): string;
6
6
  getNode(id: NodeID): Node | undefined;
7
+ getNodeID(node: Node): NodeID;
8
+ succ(id: NodeID): NodeID[];
7
9
  }
8
10
  //# sourceMappingURL=GraphTraits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GraphTraits.d.ts","sourceRoot":"","sources":["../../../src/core/graph/GraphTraits.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,WAAW,WAAW,CAAC,IAAI;IAC7B,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,YAAY,IAAI,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC"}
1
+ {"version":3,"file":"GraphTraits.d.ts","sourceRoot":"","sources":["../../../src/core/graph/GraphTraits.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,WAAW,WAAW,CAAC,IAAI;IAC7B,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,YAAY,IAAI,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
3
+ * Copyright (c) 2024-2026 Huawei Device Co., Ltd.
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
6
6
  * You may obtain a copy of the License at
@@ -0,0 +1,175 @@
1
+ import { BaseImplicitGraph, NodeID } from './BaseImplicitGraph';
2
+ import { ArkModule, ModuleID } from '../model/ArkModule';
3
+ import { Canonicalizer } from '../../utils/Canonicalizer';
4
+ /**
5
+ * Dependency type enum, indicating the source of a dependency edge.
6
+ * Used during SCC post-processing to remove edges by priority when splitting oversized module groups.
7
+ *
8
+ * Priority (removal priority; higher value = removed first):
9
+ * - DEV_DEPENDENCIES (devDependencies): only needed during development, removed first
10
+ * - DYNAMIC (dynamicDependencies): runtime dynamic loading, removed next
11
+ * - DEPENDENCIES (dependencies): core dependency, removed last
12
+ */
13
+ export declare enum DependencyType {
14
+ DEPENDENCIES = 0,
15
+ DYNAMIC = 1,
16
+ DEV_DEPENDENCIES = 2
17
+ }
18
+ /**
19
+ * Module dependency graph, based on BaseImplicitGraph.
20
+ * The node type is ArkModule, and edges represent dependency relationships between modules.
21
+ *
22
+ * Differences from DependsGraph (BaseExplicitGraph):
23
+ * - No BaseNode/BaseEdge objects needed; the node is the ArkModule itself
24
+ * - Edge information is implicitly stored via succMap/predMap (Map<NodeID, NodeID[]>)
25
+ * - Works with Canonicalizer<ArkModule> to provide bidirectional ArkModule <-> NodeID mapping
26
+ *
27
+ * SCCDetection has been generalized to accept any graph implementing GraphTraits<any>,
28
+ * i.e. one providing nodesItor(), getNode(id), getNodeID(node), succ(id) methods.
29
+ * ModuleDepGraph satisfies these methods by inheriting from BaseImplicitGraph,
30
+ * without requiring nodes to have BaseNode methods like getID() or getOutgoingEdges().
31
+ */
32
+ export declare class ModuleDepGraph extends BaseImplicitGraph<ArkModule> {
33
+ /**
34
+ * Module Canonicalizer for bidirectional ArkModule <-> ModuleID(NodeID) mapping.
35
+ * Shares the same instance with the owning Scene's moduleCanonicalizer.
36
+ */
37
+ private moduleCanonicalizer;
38
+ /**
39
+ * Edge type map, key is `${srcId}->${dstId}`, value is the dependency type.
40
+ * Used during SCC post-processing to remove edges by dependency type priority.
41
+ */
42
+ private edgeTypeMap;
43
+ /**
44
+ * Topological order of nodes after SCC refinement, populated by refineSCCGroups.
45
+ * Depended-on modules appear before their dependents.
46
+ */
47
+ private topoOrder;
48
+ /**
49
+ * SCC groups: NodeID -> all NodeIDs in the same SCC group.
50
+ * Populated by refineSCCGroups and retained for later queries.
51
+ */
52
+ private sccGroups;
53
+ /**
54
+ * SCC post-processing threshold: the maximum allowed number of modules in a group; SCCs
55
+ * exceeding this size are split. Default 3; set to Number.MAX_SAFE_INTEGER to disable.
56
+ */
57
+ private maxSCCGroupSize;
58
+ constructor(moduleCanonicalizer: Canonicalizer<ArkModule>);
59
+ getGraphName(): string;
60
+ /**
61
+ * Add a module node to the graph.
62
+ * The node's NodeID directly uses the ModuleID assigned by the Canonicalizer.
63
+ */
64
+ addModule(module: ArkModule): void;
65
+ /**
66
+ * Add a dependency edge: src depends on dst (src -> dst).
67
+ * succMap stores successors (dependency targets), predMap stores predecessors (dependents).
68
+ * @param type Dependency type, used for edge removal priority during SCC post-processing.
69
+ * When the same edge is added twice, the type with the lower removal priority is kept (i.e. the more core dependency).
70
+ */
71
+ addDependencyEdge(srcId: NodeID, dstId: NodeID, type?: DependencyType): void;
72
+ /**
73
+ * Remove a dependency edge.
74
+ */
75
+ removeDependencyEdge(srcId: NodeID, dstId: NodeID): void;
76
+ /**
77
+ * Remove a node ID from an adjacency list entry.
78
+ */
79
+ private removeFromAdjacencyList;
80
+ /**
81
+ * Get the dependency type of a specific edge.
82
+ * @returns The dependency type, or undefined if the edge does not exist.
83
+ */
84
+ getEdgeType(srcId: NodeID, dstId: NodeID): DependencyType | undefined;
85
+ /**
86
+ * Get all successor (dependency target) module IDs of the specified module.
87
+ */
88
+ getSuccModuleIds(moduleId: ModuleID): ModuleID[];
89
+ /**
90
+ * Get all predecessor (dependent) module IDs of the specified module.
91
+ */
92
+ getPredModuleIds(moduleId: ModuleID): ModuleID[];
93
+ /**
94
+ * Check whether a dependency edge exists between two modules.
95
+ */
96
+ hasDependencyEdge(srcId: NodeID, dstId: NodeID): boolean;
97
+ /**
98
+ * Get the total number of edges in the graph.
99
+ */
100
+ getEdgeCount(): number;
101
+ /**
102
+ * Get the topological order produced by the last refineSCCGroups call.
103
+ * Depended-on modules appear before their dependents.
104
+ */
105
+ getTopoOrder(): NodeID[];
106
+ /**
107
+ * Get the SCC groups map (NodeID -> all NodeIDs in the same SCC group) produced by the last
108
+ * refineSCCGroups call.
109
+ */
110
+ getSCCGroups(): Map<NodeID, NodeID[]>;
111
+ /**
112
+ * Set the SCC post-processing threshold. SCCs larger than this size are split.
113
+ * Set to Number.MAX_SAFE_INTEGER to disable post-processing.
114
+ */
115
+ setMaxSCCGroupSize(maxGroupSize: number): void;
116
+ /** Current SCC post-processing threshold. */
117
+ getMaxSCCGroupSize(): number;
118
+ /**
119
+ * Detect strong bridges in the SCC subgraph.
120
+ * A strong bridge is a directed edge whose removal increases the number of SCCs.
121
+ * For each edge u->v, check if removing it causes u and v to no longer be
122
+ * mutually reachable. If either u cannot reach v or v cannot reach u without
123
+ * the edge, then u->v is a strong bridge.
124
+ * @param members Node IDs in the large SCC
125
+ * @returns Array of strong bridge edges with their dependency types
126
+ */
127
+ findStrongBridges(members: NodeID[]): Array<{
128
+ src: NodeID;
129
+ dst: NodeID;
130
+ type: DependencyType;
131
+ }>;
132
+ /**
133
+ * Check if 'from' can reach 'to' in the subgraph, excluding edge excludedSrc->excludedDst.
134
+ * Uses DFS over successor edges within the member set.
135
+ */
136
+ private canReachWithoutEdge;
137
+ /**
138
+ * Build a temporary subgraph excluding specified edges, for SCC post-processing.
139
+ * Does not modify the original graph. Edge type labels are preserved from the original graph.
140
+ * @param sccMembers Node IDs in the SCC subgraph
141
+ * @param excludedEdges Set of edge keys ("srcId->dstId") to exclude
142
+ * @returns A new ModuleDepGraph containing only the SCC subgraph without excluded edges
143
+ */
144
+ buildTempGraphWithoutEdges(sccMembers: NodeID[], excludedEdges: Set<string>): ModuleDepGraph;
145
+ /**
146
+ * Recompute SCC on a temporary subgraph excluding specified edges, returning group results.
147
+ * @param members Node IDs in the SCC
148
+ * @param excludedEdges Set of edge keys to exclude from the temporary subgraph
149
+ * @returns Array of SCC groups, each group is an array of NodeIDs
150
+ */
151
+ recomputeSCC(members: NodeID[], excludedEdges: Set<string>): NodeID[][];
152
+ /**
153
+ * Split a single large SCC using strong bridge detection first,
154
+ * then fall back to dependency type priority for remaining edges.
155
+ * Does not modify the original graph.
156
+ * @param members Node IDs in the large SCC
157
+ * @param maxGroupSize Maximum allowed group size after splitting
158
+ * @returns Array of split groups, each group is an array of NodeIDs
159
+ */
160
+ splitLargeSCC(members: NodeID[], maxGroupSize: number): NodeID[][];
161
+ /**
162
+ * Refine SCC groups: split groups exceeding maxGroupSize using strong bridge
163
+ * detection and dependency type priority fallback.
164
+ * Stores the resulting groups in {@link sccGroups} and returns the same map.
165
+ * Also populates the topoOrder field with nodes in dependency order (depended-on first).
166
+ * @param maxGroupSize Maximum allowed group size; Number.MAX_SAFE_INTEGER disables post-processing
167
+ * @returns Map from each member NodeID to its group members array
168
+ */
169
+ refineSCCGroups(maxGroupSize: number): Map<NodeID, NodeID[]>;
170
+ /**
171
+ * Add members to topoOrder and sccGroups, skipping already-added members.
172
+ */
173
+ private addToTopoAndGroups;
174
+ }
175
+ //# sourceMappingURL=ModuleDepGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleDepGraph.d.ts","sourceRoot":"","sources":["../../../src/core/graph/ModuleDepGraph.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D;;;;;;;;GAQG;AACH,oBAAY,cAAc;IACtB,YAAY,IAAI;IAChB,OAAO,IAAI;IACX,gBAAgB,IAAI;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAe,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAA2B;IAEtD;;;OAGG;IACH,OAAO,CAAC,WAAW,CAA0C;IAE7D;;;OAGG;IACH,OAAO,CAAC,SAAS,CAAgB;IAEjC;;;OAGG;IACH,OAAO,CAAC,SAAS,CAAoC;IAErD;;;OAGG;IACH,OAAO,CAAC,eAAe,CAAa;gBAExB,mBAAmB,EAAE,aAAa,CAAC,SAAS,CAAC;IAUlD,YAAY,IAAI,MAAM;IAI7B;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAczC;;;;;OAKG;IACI,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,cAA4C,GAAG,IAAI;IA6BhH;;OAEG;IACI,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/D;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;OAGG;IACI,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI5E;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE;IAIvD;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE;IAIvD;;OAEG;IACI,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAK/D;;OAEG;IACI,YAAY,IAAI,MAAM;IAQ7B;;;OAGG;IACI,YAAY,IAAI,MAAM,EAAE;IAI/B;;;OAGG;IACI,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAI5C;;;OAGG;IACI,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIrD,6CAA6C;IACtC,kBAAkB,IAAI,MAAM;IAInC;;;;;;;;OAQG;IACI,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IA6BtG;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAgC3B;;;;;;OAMG;IACI,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,cAAc;IAwBnG;;;;;OAKG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,EAAE;IAc9E;;;;;;;OAOG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE;IAoDzE;;;;;;;OAOG;IACI,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IA2BnE;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAS7B"}