@cleocode/contracts 2026.4.29 → 2026.4.31
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/dist/dependency.d.ts +94 -0
- package/dist/dependency.d.ts.map +1 -0
- package/dist/dependency.js +11 -0
- package/dist/dependency.js.map +1 -0
- package/dist/graph.d.ts +192 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +12 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dependency.ts +97 -0
- package/src/graph.ts +297 -0
- package/src/index.ts +19 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency registry contracts for CLEO runtime dependency verification.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth (SSoT) for all CLEO dependency types.
|
|
5
|
+
* All health check systems that inspect external dependencies MUST use these
|
|
6
|
+
* contracts rather than defining inline or ad-hoc types.
|
|
7
|
+
*
|
|
8
|
+
* @task T507
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Classification of a CLEO dependency by necessity.
|
|
12
|
+
*
|
|
13
|
+
* - `required` — CLEO cannot function without this dependency.
|
|
14
|
+
* - `optional` — CLEO works without this but specific features are disabled.
|
|
15
|
+
* - `feature` — A bundled or internally-managed dependency (e.g. native addons).
|
|
16
|
+
*/
|
|
17
|
+
export type DependencyCategory = 'required' | 'optional' | 'feature';
|
|
18
|
+
/**
|
|
19
|
+
* Static specification describing a single CLEO dependency.
|
|
20
|
+
*
|
|
21
|
+
* This is the registry entry — it does NOT carry check results.
|
|
22
|
+
* Use {@link DependencyCheckResult} for runtime check outcomes.
|
|
23
|
+
*/
|
|
24
|
+
export interface DependencySpec {
|
|
25
|
+
/** Canonical identifier used as a lookup key (e.g. `"git"`, `"gh"`). */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Classification of the dependency by necessity. */
|
|
28
|
+
category: DependencyCategory;
|
|
29
|
+
/** Human-readable description of what the dependency is used for. */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Semver-style constraint string (e.g. `">=24.0.0"`). Optional. */
|
|
32
|
+
versionConstraint?: string;
|
|
33
|
+
/** URL pointing to installation or documentation for this dependency. */
|
|
34
|
+
documentationUrl?: string;
|
|
35
|
+
/** Shell command to install the dependency (informational only). */
|
|
36
|
+
installCommand?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Platforms on which this dependency applies.
|
|
39
|
+
* When absent the dependency is considered applicable on all platforms.
|
|
40
|
+
*/
|
|
41
|
+
platforms?: ('linux' | 'darwin' | 'win32')[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Runtime check result for a single CLEO dependency.
|
|
45
|
+
*
|
|
46
|
+
* Produced by `checkDependency()` and collected into a {@link DependencyReport}.
|
|
47
|
+
*/
|
|
48
|
+
export interface DependencyCheckResult {
|
|
49
|
+
/** Canonical identifier matching the corresponding {@link DependencySpec}. */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Classification of the dependency (copied from its spec). */
|
|
52
|
+
category: DependencyCategory;
|
|
53
|
+
/** Whether the dependency is present on the system. */
|
|
54
|
+
installed: boolean;
|
|
55
|
+
/** Detected version string, if available (e.g. `"2.43.0"`). */
|
|
56
|
+
version?: string;
|
|
57
|
+
/** Filesystem path where the dependency was found (e.g. `/usr/bin/git`). */
|
|
58
|
+
location?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the dependency passes all health criteria.
|
|
61
|
+
*
|
|
62
|
+
* For `required` dependencies this means installed AND the version satisfies
|
|
63
|
+
* `versionConstraint`. For `optional` and `feature` dependencies a missing
|
|
64
|
+
* dependency is still considered healthy (the feature is simply disabled).
|
|
65
|
+
*/
|
|
66
|
+
healthy: boolean;
|
|
67
|
+
/** Human-readable error or diagnostic message when `healthy` is `false`. */
|
|
68
|
+
error?: string;
|
|
69
|
+
/** Actionable fix suggestion to show the user when `healthy` is `false`. */
|
|
70
|
+
suggestedFix?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Full dependency report produced by `checkAllDependencies()`.
|
|
74
|
+
*
|
|
75
|
+
* Intended for consumption by `coreDoctorReport()` and any CLI output layer.
|
|
76
|
+
*/
|
|
77
|
+
export interface DependencyReport {
|
|
78
|
+
/** ISO 8601 timestamp of when the report was generated. */
|
|
79
|
+
timestamp: string;
|
|
80
|
+
/** `process.platform` value at check time (e.g. `"linux"`, `"darwin"`). */
|
|
81
|
+
platform: string;
|
|
82
|
+
/** Node.js version string without the `v` prefix (e.g. `"24.0.0"`). */
|
|
83
|
+
nodeVersion: string;
|
|
84
|
+
/** Per-dependency check results. */
|
|
85
|
+
results: DependencyCheckResult[];
|
|
86
|
+
/**
|
|
87
|
+
* `true` when every `required` dependency is healthy.
|
|
88
|
+
* Optional and feature dependencies do not affect this flag.
|
|
89
|
+
*/
|
|
90
|
+
allRequiredMet: boolean;
|
|
91
|
+
/** Non-fatal advisory messages (e.g. optional dep missing, feature unavailable). */
|
|
92
|
+
warnings: string[];
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../src/dependency.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency registry contracts for CLEO runtime dependency verification.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth (SSoT) for all CLEO dependency types.
|
|
5
|
+
* All health check systems that inspect external dependencies MUST use these
|
|
6
|
+
* contracts rather than defining inline or ad-hoc types.
|
|
7
|
+
*
|
|
8
|
+
* @task T507
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency.js","sourceRoot":"","sources":["../src/dependency.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph type contracts for CLEO code intelligence.
|
|
3
|
+
*
|
|
4
|
+
* Defines the node types, relationship types, and structures that form the
|
|
5
|
+
* foundation of the code intelligence graph. Ported from GitNexus graph
|
|
6
|
+
* primitives and adapted for CLEO's lightweight, in-process use case.
|
|
7
|
+
*
|
|
8
|
+
* @task T512
|
|
9
|
+
* @module contracts/graph
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* All supported symbol node kinds in the code intelligence graph.
|
|
13
|
+
*
|
|
14
|
+
* Covers file/folder structural nodes plus every symbol-level construct
|
|
15
|
+
* that tree-sitter can identify across TypeScript, JavaScript, and future
|
|
16
|
+
* language providers. Includes synthetic graph-level nodes produced by
|
|
17
|
+
* analysis phases (community detection, process detection, route extraction).
|
|
18
|
+
*
|
|
19
|
+
* @since T529 — expanded from T512 baseline with 17 new kinds
|
|
20
|
+
*/
|
|
21
|
+
export type GraphNodeKind = 'file' | 'folder' | 'module' | 'namespace' | 'function' | 'method' | 'constructor' | 'class' | 'interface' | 'struct' | 'trait' | 'impl' | 'type_alias' | 'enum' | 'property' | 'constant' | 'variable' | 'static' | 'record' | 'delegate' | 'macro' | 'union' | 'typedef' | 'annotation' | 'template' | 'community' | 'process' | 'route' | 'tool' | 'section' | 'import' | 'export' | 'type';
|
|
22
|
+
/**
|
|
23
|
+
* All supported directed relationship types between graph nodes.
|
|
24
|
+
*
|
|
25
|
+
* Types are intentionally lowercase to match CLEO convention.
|
|
26
|
+
* Each type carries semantic meaning about the nature of the dependency.
|
|
27
|
+
*
|
|
28
|
+
* @since T529 — expanded from T512 baseline with 10 new relation types
|
|
29
|
+
*/
|
|
30
|
+
export type GraphRelationType = 'contains' | 'defines' | 'imports' | 'accesses' | 'calls' | 'extends' | 'implements' | 'method_overrides' | 'method_implements' | 'has_method' | 'has_property' | 'member_of' | 'step_in_process' | 'handles_route' | 'fetches' | 'handles_tool' | 'entry_point_of' | 'wraps' | 'queries' | 'documents' | 'applies_to';
|
|
31
|
+
/**
|
|
32
|
+
* A node in the code intelligence graph representing a symbol or structural
|
|
33
|
+
* element extracted from source code.
|
|
34
|
+
*
|
|
35
|
+
* The `id` field is a stable identifier for the node, typically derived from
|
|
36
|
+
* the file path and symbol name (e.g., `src/foo.ts::parseFile`).
|
|
37
|
+
*/
|
|
38
|
+
export interface GraphNode {
|
|
39
|
+
/** Unique, stable node identifier. Typically `<filePath>::<name>`. */
|
|
40
|
+
id: string;
|
|
41
|
+
/** Kind of code element this node represents. */
|
|
42
|
+
kind: GraphNodeKind;
|
|
43
|
+
/** Symbol name as it appears in source code. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** File path relative to the project root. */
|
|
46
|
+
filePath: string;
|
|
47
|
+
/** Start line in the source file (1-based). */
|
|
48
|
+
startLine: number;
|
|
49
|
+
/** End line in the source file (1-based). */
|
|
50
|
+
endLine: number;
|
|
51
|
+
/** Language of the source file (e.g., "typescript", "javascript"). */
|
|
52
|
+
language: string;
|
|
53
|
+
/** Whether the symbol is publicly exported from its module. */
|
|
54
|
+
exported: boolean;
|
|
55
|
+
/** Parent node ID, if this symbol is nested (e.g., method inside class). */
|
|
56
|
+
parent?: string;
|
|
57
|
+
/** Parameter names or signatures for functions and methods. */
|
|
58
|
+
parameters?: string[];
|
|
59
|
+
/** Return type annotation text, if available. */
|
|
60
|
+
returnType?: string;
|
|
61
|
+
/** First line of the TSDoc/JSDoc comment for this symbol, if present. */
|
|
62
|
+
docSummary?: string;
|
|
63
|
+
/** Community ID this node belongs to (set after Phase 5 community detection). */
|
|
64
|
+
communityId?: string;
|
|
65
|
+
/** Execution flow process IDs this node participates in (set after Phase 6). */
|
|
66
|
+
processIds?: string[];
|
|
67
|
+
/** Kind-specific metadata blob (matches nexus_nodes.meta_json). */
|
|
68
|
+
meta?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A directed relationship between two nodes in the code intelligence graph.
|
|
72
|
+
*
|
|
73
|
+
* The `source` and `target` fields reference node IDs (see {@link GraphNode.id}).
|
|
74
|
+
* Confidence reflects how certain the extractor is about this relationship,
|
|
75
|
+
* from 0.0 (speculative) to 1.0 (statically verified).
|
|
76
|
+
*/
|
|
77
|
+
export interface GraphRelation {
|
|
78
|
+
/** ID of the originating node. */
|
|
79
|
+
source: string;
|
|
80
|
+
/** ID of the target node. */
|
|
81
|
+
target: string;
|
|
82
|
+
/** Semantic type of the relationship. */
|
|
83
|
+
type: GraphRelationType;
|
|
84
|
+
/**
|
|
85
|
+
* Extractor confidence for this relationship (0.0 to 1.0).
|
|
86
|
+
*
|
|
87
|
+
* Common values by type:
|
|
88
|
+
* - `calls` / `imports`: 0.9 (direct, strongly typed)
|
|
89
|
+
* - `extends` / `implements`: 0.85 (statically verifiable)
|
|
90
|
+
* - `has_method` / `has_property`: 0.95 (structural containment)
|
|
91
|
+
* - `accesses`: 0.8 (field read/write, may be indirect)
|
|
92
|
+
*/
|
|
93
|
+
confidence: number;
|
|
94
|
+
/** Human-readable note explaining why this relation was emitted. */
|
|
95
|
+
reason?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Result of a BFS-based impact analysis starting from a named symbol.
|
|
99
|
+
*
|
|
100
|
+
* Affected nodes are grouped into three depth tiers that reflect the
|
|
101
|
+
* likelihood and urgency of breakage:
|
|
102
|
+
*
|
|
103
|
+
* - **depth1_willBreak** (d=1): Direct callers/importers — WILL break.
|
|
104
|
+
* Must be updated whenever the target changes.
|
|
105
|
+
* - **depth2_likelyAffected** (d=2): Indirect dependants — LIKELY affected.
|
|
106
|
+
* Should be tested.
|
|
107
|
+
* - **depth3_mayNeedTesting** (d=3): Transitive dependants — MAY need testing.
|
|
108
|
+
* Test if the symbol is on a critical path.
|
|
109
|
+
*/
|
|
110
|
+
export interface ImpactResult {
|
|
111
|
+
/** Name or ID of the symbol that was analyzed. */
|
|
112
|
+
target: string;
|
|
113
|
+
/**
|
|
114
|
+
* Overall risk classification based on the number and type of affected nodes.
|
|
115
|
+
*
|
|
116
|
+
* - `low`: 0–3 direct dependants, no cross-module spread
|
|
117
|
+
* - `medium`: 4–9 direct dependants, or limited cross-module spread
|
|
118
|
+
* - `high`: 10+ direct dependants, or significant cross-module spread
|
|
119
|
+
* - `critical`: Exported symbol with high cross-module usage
|
|
120
|
+
*/
|
|
121
|
+
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
122
|
+
/** Human-readable summary of the impact analysis outcome. */
|
|
123
|
+
summary: string;
|
|
124
|
+
/** Nodes affected at each traversal depth. */
|
|
125
|
+
affectedByDepth: {
|
|
126
|
+
/** d=1: Direct dependants — WILL BREAK. */
|
|
127
|
+
depth1_willBreak: GraphNode[];
|
|
128
|
+
/** d=2: Indirect dependants — LIKELY AFFECTED. */
|
|
129
|
+
depth2_likelyAffected: GraphNode[];
|
|
130
|
+
/** d=3: Transitive dependants — MAY NEED TESTING. */
|
|
131
|
+
depth3_mayNeedTesting: GraphNode[];
|
|
132
|
+
};
|
|
133
|
+
/** Total number of affected nodes across all depths. */
|
|
134
|
+
totalAffected: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* An in-memory symbol table entry tracking all files where a name appears.
|
|
138
|
+
* Used during ingestion to resolve cross-file call targets.
|
|
139
|
+
*/
|
|
140
|
+
export interface SymbolIndex {
|
|
141
|
+
/** Symbol name as it appears in source (e.g., "parseFile"). */
|
|
142
|
+
name: string;
|
|
143
|
+
/** All node IDs that define this name across the project. */
|
|
144
|
+
nodeIds: string[];
|
|
145
|
+
/** All file paths that export this name. */
|
|
146
|
+
exportingFiles: string[];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The in-memory KnowledgeGraph assembled during a single ingestion run.
|
|
150
|
+
* Flushed to nexus_nodes + nexus_relations after all phases complete.
|
|
151
|
+
*/
|
|
152
|
+
export interface KnowledgeGraph {
|
|
153
|
+
/** Primary node store: nodeId → GraphNode. */
|
|
154
|
+
nodes: Map<string, GraphNode>;
|
|
155
|
+
/** All directed edges (appended during ingestion, deduplicated at flush). */
|
|
156
|
+
relations: GraphRelation[];
|
|
157
|
+
/** Indexes for fast lookup during resolution phases. */
|
|
158
|
+
symbolTable: SymbolIndex[];
|
|
159
|
+
/** Files that changed since last index (incremental mode only). */
|
|
160
|
+
changedFiles?: Set<string>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A community (module cluster) identified by Louvain community detection
|
|
164
|
+
* during Phase 5. Represents a group of cohesive symbols within the graph.
|
|
165
|
+
*/
|
|
166
|
+
export interface CommunityNode {
|
|
167
|
+
/** Node ID format: `community:<n>` */
|
|
168
|
+
id: string;
|
|
169
|
+
/** Inferred label from the top folder name. */
|
|
170
|
+
label: string;
|
|
171
|
+
/** Number of member symbols in this community. */
|
|
172
|
+
memberCount: number;
|
|
173
|
+
/** Top-level folders contributing most members. */
|
|
174
|
+
topFolders: string[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A detected execution flow (process) from BFS entry point analysis
|
|
178
|
+
* during Phase 6. Represents a named sequence of function calls.
|
|
179
|
+
*/
|
|
180
|
+
export interface ProcessNode {
|
|
181
|
+
/** Node ID format: `process:<slug>` */
|
|
182
|
+
id: string;
|
|
183
|
+
/** Entry point function name used as the process label. */
|
|
184
|
+
label: string;
|
|
185
|
+
/** Node ID of the entry point function. */
|
|
186
|
+
entryPointId: string;
|
|
187
|
+
/** Ordered node IDs representing each step in the flow. */
|
|
188
|
+
stepIds: string[];
|
|
189
|
+
/** Total number of steps in this execution flow. */
|
|
190
|
+
stepCount: number;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
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I,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9B,6EAA6E;IAC7E,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,wDAAwD;IACxD,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,mEAAmE;IACnE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/graph.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph type contracts for CLEO code intelligence.
|
|
3
|
+
*
|
|
4
|
+
* Defines the node types, relationship types, and structures that form the
|
|
5
|
+
* foundation of the code intelligence graph. Ported from GitNexus graph
|
|
6
|
+
* primitives and adapted for CLEO's lightweight, in-process use case.
|
|
7
|
+
*
|
|
8
|
+
* @task T512
|
|
9
|
+
* @module contracts/graph
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,11 +16,13 @@ export type { Conduit, ConduitConfig, ConduitMessage, ConduitSendOptions, Condui
|
|
|
16
16
|
export type { BackupConfig, BrainConfig, BrainEmbeddingConfig, BrainMemoryBridgeConfig, BrainSummarizationConfig, CleoConfig, ConfigSource, DateFormat, EnforcementProfile, HierarchyConfig, LifecycleConfig, LifecycleEnforcementMode, LoggingConfig, LogLevel, OutputConfig, OutputFormat, ResolvedValue, SessionConfig, SessionSummaryInput, SharingConfig, SharingMode, SignalDockConfig, SignalDockMode, } from './config.js';
|
|
17
17
|
export type { AdapterContextMonitorProvider } from './context-monitor.js';
|
|
18
18
|
export type { ArchiveFields, ArchiveFile, DataAccessor, DataAccessorAgentInstance, QueryTasksResult, TaskFieldUpdates, TaskQueryFilters, TransactionAccessor, } from './data-accessor.js';
|
|
19
|
+
export type { DependencyCategory, DependencyCheckResult, DependencyReport, DependencySpec, } from './dependency.js';
|
|
19
20
|
export type { AdapterManifest, DetectionPattern } from './discovery.js';
|
|
20
21
|
export { createErrorResult, createSuccessResult, formatError, getErrorMessage, isErrorResult, isErrorType, normalizeError, } from './errors.js';
|
|
21
22
|
export { ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
|
|
22
23
|
export type { AdminAPI, AgentCapacity, AgentHealthStatus, AgentInstanceRow, AgentInstanceStatus, AgentsAPI, AgentType, BlastRadius, BlastRadiusSeverity, BrainObservationType, CleoInitOptions, DuplicateStrategy, HybridSearchOptions, ImpactedTask, ImpactReport, ImportParams, IntelligenceAPI, LifecycleAPI, MemoryAPI, NexusAPI, OrchestrationAPI, RegisterAgentOptions, ReleaseAPI, SessionsAPI, StickyAPI, SyncAPI, TaskStartResult, TasksAPI, } from './facade.js';
|
|
23
24
|
export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
|
|
25
|
+
export type { CommunityNode, GraphNode, GraphNodeKind, GraphRelation, GraphRelationType, ImpactResult, KnowledgeGraph, ProcessNode, SymbolIndex, } from './graph.js';
|
|
24
26
|
export type { AdapterHookProvider } from './hooks.js';
|
|
25
27
|
export type { AdapterInstallProvider, InstallOptions, InstallResult } from './install.js';
|
|
26
28
|
export type { CleoResponse, ConformanceReport, FlagInput, GatewayEnvelope, GatewayError, GatewayMeta, GatewaySuccess, LAFSEnvelope, LAFSError, LAFSErrorCategory, LAFSMeta, LAFSPage, LAFSPageNone, LAFSPageOffset, LAFSTransport, LafsAlternative, LafsEnvelope, LafsError, LafsErrorDetail, LafsSuccess, MVILevel, Warning, } from './lafs.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E,YAAY,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,eAAe,E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,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgHH,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,iBAAiB,CAAC;AA+BzB,gCAAgC;AAChC,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAuCrB,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,WAAW,CAAC;AAUnB,8FAA8F;AAC9F,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAG7C,kCAAkC;AAClC,OAAO,EAKL,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAgCtC,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,uEAAuE;AACvE,OAAO,EACL,YAAY,EAIZ,aAAa,EAEb,aAAa,EACb,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB;AAEjB,gBAAgB;AAChB,qBAAqB,EAErB,gBAAgB,EAEhB,kBAAkB,EAClB,eAAe,EAEf,yBAAyB,EACzB,2BAA2B;AAC3B,YAAY;AACZ,aAAa,EAGb,0BAA0B,EAC1B,uBAAuB;AACvB,sBAAsB;AACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AA6E9B,yCAAyC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency registry contracts for CLEO runtime dependency verification.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth (SSoT) for all CLEO dependency types.
|
|
5
|
+
* All health check systems that inspect external dependencies MUST use these
|
|
6
|
+
* contracts rather than defining inline or ad-hoc types.
|
|
7
|
+
*
|
|
8
|
+
* @task T507
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Classification of a CLEO dependency by necessity.
|
|
13
|
+
*
|
|
14
|
+
* - `required` — CLEO cannot function without this dependency.
|
|
15
|
+
* - `optional` — CLEO works without this but specific features are disabled.
|
|
16
|
+
* - `feature` — A bundled or internally-managed dependency (e.g. native addons).
|
|
17
|
+
*/
|
|
18
|
+
export type DependencyCategory = 'required' | 'optional' | 'feature';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Static specification describing a single CLEO dependency.
|
|
22
|
+
*
|
|
23
|
+
* This is the registry entry — it does NOT carry check results.
|
|
24
|
+
* Use {@link DependencyCheckResult} for runtime check outcomes.
|
|
25
|
+
*/
|
|
26
|
+
export interface DependencySpec {
|
|
27
|
+
/** Canonical identifier used as a lookup key (e.g. `"git"`, `"gh"`). */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Classification of the dependency by necessity. */
|
|
30
|
+
category: DependencyCategory;
|
|
31
|
+
/** Human-readable description of what the dependency is used for. */
|
|
32
|
+
description: string;
|
|
33
|
+
/** Semver-style constraint string (e.g. `">=24.0.0"`). Optional. */
|
|
34
|
+
versionConstraint?: string;
|
|
35
|
+
/** URL pointing to installation or documentation for this dependency. */
|
|
36
|
+
documentationUrl?: string;
|
|
37
|
+
/** Shell command to install the dependency (informational only). */
|
|
38
|
+
installCommand?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Platforms on which this dependency applies.
|
|
41
|
+
* When absent the dependency is considered applicable on all platforms.
|
|
42
|
+
*/
|
|
43
|
+
platforms?: ('linux' | 'darwin' | 'win32')[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Runtime check result for a single CLEO dependency.
|
|
48
|
+
*
|
|
49
|
+
* Produced by `checkDependency()` and collected into a {@link DependencyReport}.
|
|
50
|
+
*/
|
|
51
|
+
export interface DependencyCheckResult {
|
|
52
|
+
/** Canonical identifier matching the corresponding {@link DependencySpec}. */
|
|
53
|
+
name: string;
|
|
54
|
+
/** Classification of the dependency (copied from its spec). */
|
|
55
|
+
category: DependencyCategory;
|
|
56
|
+
/** Whether the dependency is present on the system. */
|
|
57
|
+
installed: boolean;
|
|
58
|
+
/** Detected version string, if available (e.g. `"2.43.0"`). */
|
|
59
|
+
version?: string;
|
|
60
|
+
/** Filesystem path where the dependency was found (e.g. `/usr/bin/git`). */
|
|
61
|
+
location?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the dependency passes all health criteria.
|
|
64
|
+
*
|
|
65
|
+
* For `required` dependencies this means installed AND the version satisfies
|
|
66
|
+
* `versionConstraint`. For `optional` and `feature` dependencies a missing
|
|
67
|
+
* dependency is still considered healthy (the feature is simply disabled).
|
|
68
|
+
*/
|
|
69
|
+
healthy: boolean;
|
|
70
|
+
/** Human-readable error or diagnostic message when `healthy` is `false`. */
|
|
71
|
+
error?: string;
|
|
72
|
+
/** Actionable fix suggestion to show the user when `healthy` is `false`. */
|
|
73
|
+
suggestedFix?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Full dependency report produced by `checkAllDependencies()`.
|
|
78
|
+
*
|
|
79
|
+
* Intended for consumption by `coreDoctorReport()` and any CLI output layer.
|
|
80
|
+
*/
|
|
81
|
+
export interface DependencyReport {
|
|
82
|
+
/** ISO 8601 timestamp of when the report was generated. */
|
|
83
|
+
timestamp: string;
|
|
84
|
+
/** `process.platform` value at check time (e.g. `"linux"`, `"darwin"`). */
|
|
85
|
+
platform: string;
|
|
86
|
+
/** Node.js version string without the `v` prefix (e.g. `"24.0.0"`). */
|
|
87
|
+
nodeVersion: string;
|
|
88
|
+
/** Per-dependency check results. */
|
|
89
|
+
results: DependencyCheckResult[];
|
|
90
|
+
/**
|
|
91
|
+
* `true` when every `required` dependency is healthy.
|
|
92
|
+
* Optional and feature dependencies do not affect this flag.
|
|
93
|
+
*/
|
|
94
|
+
allRequiredMet: boolean;
|
|
95
|
+
/** Non-fatal advisory messages (e.g. optional dep missing, feature unavailable). */
|
|
96
|
+
warnings: string[];
|
|
97
|
+
}
|
package/src/graph.ts
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph type contracts for CLEO code intelligence.
|
|
3
|
+
*
|
|
4
|
+
* Defines the node types, relationship types, and structures that form the
|
|
5
|
+
* foundation of the code intelligence graph. Ported from GitNexus graph
|
|
6
|
+
* primitives and adapted for CLEO's lightweight, in-process use case.
|
|
7
|
+
*
|
|
8
|
+
* @task T512
|
|
9
|
+
* @module contracts/graph
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Node kinds
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* All supported symbol node kinds in the code intelligence graph.
|
|
18
|
+
*
|
|
19
|
+
* Covers file/folder structural nodes plus every symbol-level construct
|
|
20
|
+
* that tree-sitter can identify across TypeScript, JavaScript, and future
|
|
21
|
+
* language providers. Includes synthetic graph-level nodes produced by
|
|
22
|
+
* analysis phases (community detection, process detection, route extraction).
|
|
23
|
+
*
|
|
24
|
+
* @since T529 — expanded from T512 baseline with 17 new kinds
|
|
25
|
+
*/
|
|
26
|
+
export type GraphNodeKind =
|
|
27
|
+
// Structural
|
|
28
|
+
| 'file'
|
|
29
|
+
| 'folder'
|
|
30
|
+
// Module-level
|
|
31
|
+
| 'module'
|
|
32
|
+
| 'namespace'
|
|
33
|
+
// Callable
|
|
34
|
+
| 'function'
|
|
35
|
+
| 'method'
|
|
36
|
+
| 'constructor'
|
|
37
|
+
// Type hierarchy
|
|
38
|
+
| 'class'
|
|
39
|
+
| 'interface'
|
|
40
|
+
| 'struct'
|
|
41
|
+
| 'trait'
|
|
42
|
+
| 'impl'
|
|
43
|
+
| 'type_alias'
|
|
44
|
+
| 'enum'
|
|
45
|
+
// Value-level
|
|
46
|
+
| 'property'
|
|
47
|
+
| 'constant'
|
|
48
|
+
| 'variable'
|
|
49
|
+
| 'static'
|
|
50
|
+
| 'record'
|
|
51
|
+
| 'delegate'
|
|
52
|
+
// Language-specific constructs
|
|
53
|
+
| 'macro'
|
|
54
|
+
| 'union'
|
|
55
|
+
| 'typedef'
|
|
56
|
+
| 'annotation'
|
|
57
|
+
| 'template'
|
|
58
|
+
// Graph-level (synthetic, from analysis phases)
|
|
59
|
+
| 'community'
|
|
60
|
+
| 'process'
|
|
61
|
+
| 'route'
|
|
62
|
+
| 'tool'
|
|
63
|
+
| 'section'
|
|
64
|
+
// Legacy (kept for T506 compatibility)
|
|
65
|
+
| 'import'
|
|
66
|
+
| 'export'
|
|
67
|
+
| 'type';
|
|
68
|
+
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Relationship types
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* All supported directed relationship types between graph nodes.
|
|
75
|
+
*
|
|
76
|
+
* Types are intentionally lowercase to match CLEO convention.
|
|
77
|
+
* Each type carries semantic meaning about the nature of the dependency.
|
|
78
|
+
*
|
|
79
|
+
* @since T529 — expanded from T512 baseline with 10 new relation types
|
|
80
|
+
*/
|
|
81
|
+
export type GraphRelationType =
|
|
82
|
+
// Structural
|
|
83
|
+
| 'contains'
|
|
84
|
+
// Definition / usage
|
|
85
|
+
| 'defines'
|
|
86
|
+
| 'imports'
|
|
87
|
+
| 'accesses'
|
|
88
|
+
// Callable
|
|
89
|
+
| 'calls'
|
|
90
|
+
// Type hierarchy
|
|
91
|
+
| 'extends'
|
|
92
|
+
| 'implements'
|
|
93
|
+
| 'method_overrides'
|
|
94
|
+
| 'method_implements'
|
|
95
|
+
// Class structure
|
|
96
|
+
| 'has_method'
|
|
97
|
+
| 'has_property'
|
|
98
|
+
// Graph-level (synthetic, from analysis phases)
|
|
99
|
+
| 'member_of' // symbol → community node
|
|
100
|
+
| 'step_in_process' // symbol → process node
|
|
101
|
+
// Web / API
|
|
102
|
+
| 'handles_route' // function → route node
|
|
103
|
+
| 'fetches' // function → external URL
|
|
104
|
+
// Tool / agent
|
|
105
|
+
| 'handles_tool'
|
|
106
|
+
| 'entry_point_of' // function → process node
|
|
107
|
+
// Wrapping / delegation
|
|
108
|
+
| 'wraps'
|
|
109
|
+
// Data access
|
|
110
|
+
| 'queries'
|
|
111
|
+
// Cross-graph (brain integration)
|
|
112
|
+
| 'documents' // brain node → nexus node
|
|
113
|
+
| 'applies_to'; // brain decision/learning → nexus node
|
|
114
|
+
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
// Node interface
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* A node in the code intelligence graph representing a symbol or structural
|
|
121
|
+
* element extracted from source code.
|
|
122
|
+
*
|
|
123
|
+
* The `id` field is a stable identifier for the node, typically derived from
|
|
124
|
+
* the file path and symbol name (e.g., `src/foo.ts::parseFile`).
|
|
125
|
+
*/
|
|
126
|
+
export interface GraphNode {
|
|
127
|
+
/** Unique, stable node identifier. Typically `<filePath>::<name>`. */
|
|
128
|
+
id: string;
|
|
129
|
+
/** Kind of code element this node represents. */
|
|
130
|
+
kind: GraphNodeKind;
|
|
131
|
+
/** Symbol name as it appears in source code. */
|
|
132
|
+
name: string;
|
|
133
|
+
/** File path relative to the project root. */
|
|
134
|
+
filePath: string;
|
|
135
|
+
/** Start line in the source file (1-based). */
|
|
136
|
+
startLine: number;
|
|
137
|
+
/** End line in the source file (1-based). */
|
|
138
|
+
endLine: number;
|
|
139
|
+
/** Language of the source file (e.g., "typescript", "javascript"). */
|
|
140
|
+
language: string;
|
|
141
|
+
/** Whether the symbol is publicly exported from its module. */
|
|
142
|
+
exported: boolean;
|
|
143
|
+
/** Parent node ID, if this symbol is nested (e.g., method inside class). */
|
|
144
|
+
parent?: string;
|
|
145
|
+
/** Parameter names or signatures for functions and methods. */
|
|
146
|
+
parameters?: string[];
|
|
147
|
+
/** Return type annotation text, if available. */
|
|
148
|
+
returnType?: string;
|
|
149
|
+
/** First line of the TSDoc/JSDoc comment for this symbol, if present. */
|
|
150
|
+
docSummary?: string;
|
|
151
|
+
/** Community ID this node belongs to (set after Phase 5 community detection). */
|
|
152
|
+
communityId?: string;
|
|
153
|
+
/** Execution flow process IDs this node participates in (set after Phase 6). */
|
|
154
|
+
processIds?: string[];
|
|
155
|
+
/** Kind-specific metadata blob (matches nexus_nodes.meta_json). */
|
|
156
|
+
meta?: Record<string, unknown>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
// Relation interface
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A directed relationship between two nodes in the code intelligence graph.
|
|
165
|
+
*
|
|
166
|
+
* The `source` and `target` fields reference node IDs (see {@link GraphNode.id}).
|
|
167
|
+
* Confidence reflects how certain the extractor is about this relationship,
|
|
168
|
+
* from 0.0 (speculative) to 1.0 (statically verified).
|
|
169
|
+
*/
|
|
170
|
+
export interface GraphRelation {
|
|
171
|
+
/** ID of the originating node. */
|
|
172
|
+
source: string;
|
|
173
|
+
/** ID of the target node. */
|
|
174
|
+
target: string;
|
|
175
|
+
/** Semantic type of the relationship. */
|
|
176
|
+
type: GraphRelationType;
|
|
177
|
+
/**
|
|
178
|
+
* Extractor confidence for this relationship (0.0 to 1.0).
|
|
179
|
+
*
|
|
180
|
+
* Common values by type:
|
|
181
|
+
* - `calls` / `imports`: 0.9 (direct, strongly typed)
|
|
182
|
+
* - `extends` / `implements`: 0.85 (statically verifiable)
|
|
183
|
+
* - `has_method` / `has_property`: 0.95 (structural containment)
|
|
184
|
+
* - `accesses`: 0.8 (field read/write, may be indirect)
|
|
185
|
+
*/
|
|
186
|
+
confidence: number;
|
|
187
|
+
/** Human-readable note explaining why this relation was emitted. */
|
|
188
|
+
reason?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
// Impact analysis result
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Result of a BFS-based impact analysis starting from a named symbol.
|
|
197
|
+
*
|
|
198
|
+
* Affected nodes are grouped into three depth tiers that reflect the
|
|
199
|
+
* likelihood and urgency of breakage:
|
|
200
|
+
*
|
|
201
|
+
* - **depth1_willBreak** (d=1): Direct callers/importers — WILL break.
|
|
202
|
+
* Must be updated whenever the target changes.
|
|
203
|
+
* - **depth2_likelyAffected** (d=2): Indirect dependants — LIKELY affected.
|
|
204
|
+
* Should be tested.
|
|
205
|
+
* - **depth3_mayNeedTesting** (d=3): Transitive dependants — MAY need testing.
|
|
206
|
+
* Test if the symbol is on a critical path.
|
|
207
|
+
*/
|
|
208
|
+
export interface ImpactResult {
|
|
209
|
+
/** Name or ID of the symbol that was analyzed. */
|
|
210
|
+
target: string;
|
|
211
|
+
/**
|
|
212
|
+
* Overall risk classification based on the number and type of affected nodes.
|
|
213
|
+
*
|
|
214
|
+
* - `low`: 0–3 direct dependants, no cross-module spread
|
|
215
|
+
* - `medium`: 4–9 direct dependants, or limited cross-module spread
|
|
216
|
+
* - `high`: 10+ direct dependants, or significant cross-module spread
|
|
217
|
+
* - `critical`: Exported symbol with high cross-module usage
|
|
218
|
+
*/
|
|
219
|
+
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
220
|
+
/** Human-readable summary of the impact analysis outcome. */
|
|
221
|
+
summary: string;
|
|
222
|
+
/** Nodes affected at each traversal depth. */
|
|
223
|
+
affectedByDepth: {
|
|
224
|
+
/** d=1: Direct dependants — WILL BREAK. */
|
|
225
|
+
depth1_willBreak: GraphNode[];
|
|
226
|
+
/** d=2: Indirect dependants — LIKELY AFFECTED. */
|
|
227
|
+
depth2_likelyAffected: GraphNode[];
|
|
228
|
+
/** d=3: Transitive dependants — MAY NEED TESTING. */
|
|
229
|
+
depth3_mayNeedTesting: GraphNode[];
|
|
230
|
+
};
|
|
231
|
+
/** Total number of affected nodes across all depths. */
|
|
232
|
+
totalAffected: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ---------------------------------------------------------------------------
|
|
236
|
+
// Pipeline interfaces (T529)
|
|
237
|
+
// ---------------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* An in-memory symbol table entry tracking all files where a name appears.
|
|
241
|
+
* Used during ingestion to resolve cross-file call targets.
|
|
242
|
+
*/
|
|
243
|
+
export interface SymbolIndex {
|
|
244
|
+
/** Symbol name as it appears in source (e.g., "parseFile"). */
|
|
245
|
+
name: string;
|
|
246
|
+
/** All node IDs that define this name across the project. */
|
|
247
|
+
nodeIds: string[];
|
|
248
|
+
/** All file paths that export this name. */
|
|
249
|
+
exportingFiles: string[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The in-memory KnowledgeGraph assembled during a single ingestion run.
|
|
254
|
+
* Flushed to nexus_nodes + nexus_relations after all phases complete.
|
|
255
|
+
*/
|
|
256
|
+
export interface KnowledgeGraph {
|
|
257
|
+
/** Primary node store: nodeId → GraphNode. */
|
|
258
|
+
nodes: Map<string, GraphNode>;
|
|
259
|
+
/** All directed edges (appended during ingestion, deduplicated at flush). */
|
|
260
|
+
relations: GraphRelation[];
|
|
261
|
+
/** Indexes for fast lookup during resolution phases. */
|
|
262
|
+
symbolTable: SymbolIndex[];
|
|
263
|
+
/** Files that changed since last index (incremental mode only). */
|
|
264
|
+
changedFiles?: Set<string>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* A community (module cluster) identified by Louvain community detection
|
|
269
|
+
* during Phase 5. Represents a group of cohesive symbols within the graph.
|
|
270
|
+
*/
|
|
271
|
+
export interface CommunityNode {
|
|
272
|
+
/** Node ID format: `community:<n>` */
|
|
273
|
+
id: string;
|
|
274
|
+
/** Inferred label from the top folder name. */
|
|
275
|
+
label: string;
|
|
276
|
+
/** Number of member symbols in this community. */
|
|
277
|
+
memberCount: number;
|
|
278
|
+
/** Top-level folders contributing most members. */
|
|
279
|
+
topFolders: string[];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* A detected execution flow (process) from BFS entry point analysis
|
|
284
|
+
* during Phase 6. Represents a named sequence of function calls.
|
|
285
|
+
*/
|
|
286
|
+
export interface ProcessNode {
|
|
287
|
+
/** Node ID format: `process:<slug>` */
|
|
288
|
+
id: string;
|
|
289
|
+
/** Entry point function name used as the process label. */
|
|
290
|
+
label: string;
|
|
291
|
+
/** Node ID of the entry point function. */
|
|
292
|
+
entryPointId: string;
|
|
293
|
+
/** Ordered node IDs representing each step in the flow. */
|
|
294
|
+
stepIds: string[];
|
|
295
|
+
/** Total number of steps in this execution flow. */
|
|
296
|
+
stepCount: number;
|
|
297
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -108,6 +108,13 @@ export type {
|
|
|
108
108
|
TaskQueryFilters,
|
|
109
109
|
TransactionAccessor,
|
|
110
110
|
} from './data-accessor.js';
|
|
111
|
+
// === Dependency Registry Contracts ===
|
|
112
|
+
export type {
|
|
113
|
+
DependencyCategory,
|
|
114
|
+
DependencyCheckResult,
|
|
115
|
+
DependencyReport,
|
|
116
|
+
DependencySpec,
|
|
117
|
+
} from './dependency.js';
|
|
111
118
|
export type { AdapterManifest, DetectionPattern } from './discovery.js';
|
|
112
119
|
// === Error Utilities ===
|
|
113
120
|
export {
|
|
@@ -164,6 +171,18 @@ export {
|
|
|
164
171
|
AGENT_TYPES,
|
|
165
172
|
BRAIN_OBSERVATION_TYPES,
|
|
166
173
|
} from './facade.js';
|
|
174
|
+
// === Graph Intelligence Types (T512, T529) ===
|
|
175
|
+
export type {
|
|
176
|
+
CommunityNode,
|
|
177
|
+
GraphNode,
|
|
178
|
+
GraphNodeKind,
|
|
179
|
+
GraphRelation,
|
|
180
|
+
GraphRelationType,
|
|
181
|
+
ImpactResult,
|
|
182
|
+
KnowledgeGraph,
|
|
183
|
+
ProcessNode,
|
|
184
|
+
SymbolIndex,
|
|
185
|
+
} from './graph.js';
|
|
167
186
|
export type { AdapterHookProvider } from './hooks.js';
|
|
168
187
|
export type { AdapterInstallProvider, InstallOptions, InstallResult } from './install.js';
|
|
169
188
|
export type {
|