@hugobatist/smartcode 0.1.0
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 -0
- package/README.md +292 -0
- package/dist/cli.js +4324 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +374 -0
- package/dist/index.js +1167 -0
- package/dist/index.js.map +1 -0
- package/dist/static/annotations-panel.js +133 -0
- package/dist/static/annotations-svg.js +108 -0
- package/dist/static/annotations.css +367 -0
- package/dist/static/annotations.js +367 -0
- package/dist/static/app-init.js +497 -0
- package/dist/static/breakpoints.css +69 -0
- package/dist/static/breakpoints.js +197 -0
- package/dist/static/clipboard.js +94 -0
- package/dist/static/collapse-ui.js +325 -0
- package/dist/static/command-history.js +89 -0
- package/dist/static/context-menu.js +334 -0
- package/dist/static/custom-renderer.js +201 -0
- package/dist/static/dagre-layout.js +291 -0
- package/dist/static/diagram-dom.js +241 -0
- package/dist/static/diagram-editor.js +368 -0
- package/dist/static/editor-panel.js +107 -0
- package/dist/static/editor-popovers.js +187 -0
- package/dist/static/event-bus.js +57 -0
- package/dist/static/export.js +181 -0
- package/dist/static/file-tree.js +470 -0
- package/dist/static/ghost-paths.js +397 -0
- package/dist/static/heatmap.css +116 -0
- package/dist/static/heatmap.js +308 -0
- package/dist/static/icons.js +66 -0
- package/dist/static/inline-edit.js +294 -0
- package/dist/static/interaction-state.js +155 -0
- package/dist/static/interaction-tracker.js +93 -0
- package/dist/static/live.html +239 -0
- package/dist/static/main-layout.css +220 -0
- package/dist/static/main.css +334 -0
- package/dist/static/mcp-sessions.js +202 -0
- package/dist/static/modal.css +109 -0
- package/dist/static/modal.js +171 -0
- package/dist/static/node-drag.js +293 -0
- package/dist/static/pan-zoom.js +199 -0
- package/dist/static/renderer.js +280 -0
- package/dist/static/search.css +103 -0
- package/dist/static/search.js +304 -0
- package/dist/static/selection.js +353 -0
- package/dist/static/session-player.css +137 -0
- package/dist/static/session-player.js +411 -0
- package/dist/static/sidebar.css +248 -0
- package/dist/static/svg-renderer.js +313 -0
- package/dist/static/svg-shapes.js +218 -0
- package/dist/static/tokens.css +76 -0
- package/dist/static/vendor/dagre-bundle.js +43 -0
- package/dist/static/vendor/dagre.min.js +3 -0
- package/dist/static/vendor/graphlib.min.js +2 -0
- package/dist/static/viewport-transform.js +107 -0
- package/dist/static/workspace-switcher.js +202 -0
- package/dist/static/ws-client.js +71 -0
- package/dist/static/ws-handler.js +125 -0
- package/package.json +74 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/** Status of a diagram node */
|
|
2
|
+
type NodeStatus = 'ok' | 'problem' | 'in-progress' | 'discarded';
|
|
3
|
+
/** A flag annotation on a diagram node */
|
|
4
|
+
interface Flag {
|
|
5
|
+
nodeId: string;
|
|
6
|
+
message: string;
|
|
7
|
+
timestamp?: number;
|
|
8
|
+
}
|
|
9
|
+
/** A node in a Mermaid diagram */
|
|
10
|
+
interface DiagramNode {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
shape: string;
|
|
14
|
+
status?: NodeStatus;
|
|
15
|
+
}
|
|
16
|
+
/** An edge between two nodes */
|
|
17
|
+
interface DiagramEdge {
|
|
18
|
+
from: string;
|
|
19
|
+
to: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
type: 'arrow' | 'open' | 'dotted' | 'thick';
|
|
22
|
+
}
|
|
23
|
+
/** Parsed content of a .mmd file */
|
|
24
|
+
interface DiagramContent {
|
|
25
|
+
/** The raw file content including annotations */
|
|
26
|
+
raw: string;
|
|
27
|
+
/** Mermaid content with annotations stripped */
|
|
28
|
+
mermaidContent: string;
|
|
29
|
+
/** Parsed flag annotations */
|
|
30
|
+
flags: Map<string, Flag>;
|
|
31
|
+
/** Parsed status annotations */
|
|
32
|
+
statuses: Map<string, NodeStatus>;
|
|
33
|
+
/** Parsed breakpoint annotations (node IDs with active breakpoints) */
|
|
34
|
+
breakpoints: Set<string>;
|
|
35
|
+
/** Parsed risk annotations */
|
|
36
|
+
risks: Map<string, RiskAnnotation>;
|
|
37
|
+
/** Parsed ghost path annotations */
|
|
38
|
+
ghosts: GhostPathAnnotation[];
|
|
39
|
+
/** Validation result for the Mermaid syntax */
|
|
40
|
+
validation: ValidationResult;
|
|
41
|
+
/** Relative file path within the project */
|
|
42
|
+
filePath: string;
|
|
43
|
+
}
|
|
44
|
+
/** Result of Mermaid syntax validation */
|
|
45
|
+
interface ValidationResult {
|
|
46
|
+
valid: boolean;
|
|
47
|
+
errors: ValidationError[];
|
|
48
|
+
diagramType?: string;
|
|
49
|
+
}
|
|
50
|
+
/** A structured validation error */
|
|
51
|
+
interface ValidationError {
|
|
52
|
+
message: string;
|
|
53
|
+
line?: number;
|
|
54
|
+
column?: number;
|
|
55
|
+
}
|
|
56
|
+
/** Risk level for a node annotation */
|
|
57
|
+
type RiskLevel = 'high' | 'medium' | 'low';
|
|
58
|
+
/** A risk annotation on a diagram node */
|
|
59
|
+
interface RiskAnnotation {
|
|
60
|
+
nodeId: string;
|
|
61
|
+
level: RiskLevel;
|
|
62
|
+
reason: string;
|
|
63
|
+
}
|
|
64
|
+
/** A ghost path suggested by AI for alternative diagram flow */
|
|
65
|
+
interface GhostPath {
|
|
66
|
+
fromNodeId: string;
|
|
67
|
+
toNodeId: string;
|
|
68
|
+
label?: string;
|
|
69
|
+
timestamp: number;
|
|
70
|
+
}
|
|
71
|
+
/** A ghost path annotation persisted in a .mmd file (no timestamp) */
|
|
72
|
+
interface GhostPathAnnotation {
|
|
73
|
+
fromNodeId: string;
|
|
74
|
+
toNodeId: string;
|
|
75
|
+
label: string;
|
|
76
|
+
}
|
|
77
|
+
/** A project containing .mmd files */
|
|
78
|
+
interface Project {
|
|
79
|
+
/** Absolute path to the project root directory */
|
|
80
|
+
rootDir: string;
|
|
81
|
+
/** Relative paths to .mmd files within the project */
|
|
82
|
+
files: string[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type NodeShape = 'rect' | 'rounded' | 'stadium' | 'subroutine' | 'cylinder' | 'circle' | 'asymmetric' | 'diamond' | 'hexagon' | 'parallelogram' | 'parallelogram-alt' | 'trapezoid' | 'trapezoid-alt';
|
|
86
|
+
type EdgeType = 'arrow' | 'open' | 'dotted' | 'thick' | 'invisible';
|
|
87
|
+
type FlowDirection = 'TB' | 'LR' | 'BT' | 'RL';
|
|
88
|
+
interface GraphNode {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
shape: NodeShape;
|
|
92
|
+
status?: NodeStatus;
|
|
93
|
+
flag?: Flag;
|
|
94
|
+
subgraphId?: string;
|
|
95
|
+
cssClass?: string;
|
|
96
|
+
x?: number;
|
|
97
|
+
y?: number;
|
|
98
|
+
width?: number;
|
|
99
|
+
height?: number;
|
|
100
|
+
}
|
|
101
|
+
interface GraphEdge {
|
|
102
|
+
id: string;
|
|
103
|
+
from: string;
|
|
104
|
+
to: string;
|
|
105
|
+
label?: string;
|
|
106
|
+
type: EdgeType;
|
|
107
|
+
bidirectional?: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface GraphSubgraph {
|
|
110
|
+
id: string;
|
|
111
|
+
label: string;
|
|
112
|
+
parentId: string | null;
|
|
113
|
+
nodeIds: string[];
|
|
114
|
+
childSubgraphIds: string[];
|
|
115
|
+
}
|
|
116
|
+
interface GraphModel {
|
|
117
|
+
diagramType: 'flowchart' | 'graph';
|
|
118
|
+
direction: FlowDirection;
|
|
119
|
+
nodes: Map<string, GraphNode>;
|
|
120
|
+
edges: GraphEdge[];
|
|
121
|
+
subgraphs: Map<string, GraphSubgraph>;
|
|
122
|
+
classDefs: Map<string, string>;
|
|
123
|
+
nodeStyles: Map<string, string>;
|
|
124
|
+
linkStyles: Map<number, string>;
|
|
125
|
+
classAssignments: Map<string, string>;
|
|
126
|
+
filePath: string;
|
|
127
|
+
flags: Map<string, Flag>;
|
|
128
|
+
statuses: Map<string, NodeStatus>;
|
|
129
|
+
validation: ValidationResult;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* DiagramService -- single entry point for all .mmd file operations.
|
|
134
|
+
* Each instance is bound to a project root for path security.
|
|
135
|
+
*/
|
|
136
|
+
declare class DiagramService {
|
|
137
|
+
private readonly projectRoot;
|
|
138
|
+
/** Per-file write locks to serialize concurrent write operations */
|
|
139
|
+
private writeLocks;
|
|
140
|
+
/**
|
|
141
|
+
* Serialize write operations on a given file path.
|
|
142
|
+
* Each call waits for the previous write on the same file to finish before running.
|
|
143
|
+
* Cleans up lock entry when no further writes are queued.
|
|
144
|
+
*/
|
|
145
|
+
private withWriteLock;
|
|
146
|
+
constructor(projectRoot: string);
|
|
147
|
+
/**
|
|
148
|
+
* Read a .mmd file and parse all annotations + mermaid content in one pass.
|
|
149
|
+
*/
|
|
150
|
+
private readAllAnnotations;
|
|
151
|
+
/**
|
|
152
|
+
* Read-modify-write cycle for annotation mutations.
|
|
153
|
+
* Acquires the write lock, reads all annotations, calls modifyFn to mutate them,
|
|
154
|
+
* then writes the result back.
|
|
155
|
+
*/
|
|
156
|
+
private modifyAnnotation;
|
|
157
|
+
/**
|
|
158
|
+
* Read and parse a .mmd file.
|
|
159
|
+
* Resolves path with traversal protection, parses content, and validates syntax.
|
|
160
|
+
*/
|
|
161
|
+
readDiagram(filePath: string): Promise<DiagramContent>;
|
|
162
|
+
/**
|
|
163
|
+
* Read a .mmd file and parse it into a structured GraphModel.
|
|
164
|
+
*/
|
|
165
|
+
readGraph(filePath: string): Promise<GraphModel>;
|
|
166
|
+
/**
|
|
167
|
+
* Write a .mmd file. If flags or statuses are provided, injects annotation block.
|
|
168
|
+
* Creates parent directories if they don't exist.
|
|
169
|
+
*/
|
|
170
|
+
writeDiagram(filePath: string, content: string, flags?: Map<string, Flag>, statuses?: Map<string, NodeStatus>, breakpoints?: Set<string>, risks?: Map<string, RiskAnnotation>, ghosts?: GhostPathAnnotation[]): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Write diagram content while preserving existing developer-owned annotations (flags, breakpoints).
|
|
173
|
+
* Reads existing annotations first, merges caller-provided statuses/risks/ghosts on top, preserves flags
|
|
174
|
+
* and breakpoints unconditionally, then writes the merged result atomically under the write lock.
|
|
175
|
+
*
|
|
176
|
+
* Merge semantics:
|
|
177
|
+
* - `content`: always replaces the Mermaid diagram body
|
|
178
|
+
* - `statuses`: if provided, replaces all statuses; if undefined, preserves existing
|
|
179
|
+
* - `risks`: if provided, replaces all risks; if undefined, preserves existing
|
|
180
|
+
* - `ghosts`: if provided, replaces all ghosts; if undefined, preserves existing
|
|
181
|
+
* - `flags`: always preserved from the file (developer-owned, never touched by MCP)
|
|
182
|
+
* - `breakpoints`: always preserved from the file (developer-owned, never touched by MCP)
|
|
183
|
+
*/
|
|
184
|
+
writeDiagramPreserving(filePath: string, content: string, statuses?: Map<string, NodeStatus>, risks?: Map<string, RiskAnnotation>, ghosts?: GhostPathAnnotation[]): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Write raw content to a .mmd file under the write lock.
|
|
187
|
+
* Does NOT process annotations -- writes content as-is.
|
|
188
|
+
* Used by /save endpoint which receives pre-formatted content from the editor.
|
|
189
|
+
*/
|
|
190
|
+
writeRaw(filePath: string, content: string): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Internal write without acquiring the lock.
|
|
193
|
+
* Used by methods that already hold the write lock for the same file.
|
|
194
|
+
*/
|
|
195
|
+
private _writeDiagramInternal;
|
|
196
|
+
/** Get all flags from a .mmd file as an array. */
|
|
197
|
+
getFlags(filePath: string): Promise<Flag[]>;
|
|
198
|
+
/** Set (add or update) a flag on a specific node. */
|
|
199
|
+
setFlag(filePath: string, nodeId: string, message: string): Promise<void>;
|
|
200
|
+
/** Remove a flag from a specific node. */
|
|
201
|
+
removeFlag(filePath: string, nodeId: string): Promise<void>;
|
|
202
|
+
/** Get all statuses from a .mmd file. */
|
|
203
|
+
getStatuses(filePath: string): Promise<Map<string, NodeStatus>>;
|
|
204
|
+
/** Set (add or update) a status on a specific node. */
|
|
205
|
+
setStatus(filePath: string, nodeId: string, status: NodeStatus): Promise<void>;
|
|
206
|
+
/** Remove a status from a specific node. */
|
|
207
|
+
removeStatus(filePath: string, nodeId: string): Promise<void>;
|
|
208
|
+
/** Get all breakpoints from a .mmd file. */
|
|
209
|
+
getBreakpoints(filePath: string): Promise<Set<string>>;
|
|
210
|
+
/** Set (add) a breakpoint on a specific node. */
|
|
211
|
+
setBreakpoint(filePath: string, nodeId: string): Promise<void>;
|
|
212
|
+
/** Remove a breakpoint from a specific node. */
|
|
213
|
+
removeBreakpoint(filePath: string, nodeId: string): Promise<void>;
|
|
214
|
+
/** Get all risk annotations from a .mmd file. */
|
|
215
|
+
getRisks(filePath: string): Promise<Map<string, RiskAnnotation>>;
|
|
216
|
+
/** Set (add or update) a risk annotation on a specific node. */
|
|
217
|
+
setRisk(filePath: string, nodeId: string, level: RiskLevel, reason: string): Promise<void>;
|
|
218
|
+
/** Remove a risk annotation from a specific node. */
|
|
219
|
+
removeRisk(filePath: string, nodeId: string): Promise<void>;
|
|
220
|
+
/** Get all ghost path annotations from a .mmd file. */
|
|
221
|
+
getGhosts(filePath: string): Promise<GhostPathAnnotation[]>;
|
|
222
|
+
/** Add a ghost path annotation to a .mmd file. */
|
|
223
|
+
addGhost(filePath: string, fromNodeId: string, toNodeId: string, label: string): Promise<void>;
|
|
224
|
+
/** Remove a specific ghost path annotation (by from+to+label exact match). */
|
|
225
|
+
removeGhost(filePath: string, fromNodeId: string, toNodeId: string): Promise<void>;
|
|
226
|
+
/** Clear all ghost path annotations from a .mmd file. */
|
|
227
|
+
clearGhosts(filePath: string): Promise<void>;
|
|
228
|
+
/** Validate the Mermaid syntax of a .mmd file. */
|
|
229
|
+
validate(filePath: string): Promise<ValidationResult>;
|
|
230
|
+
/** List all .mmd files in the project root. */
|
|
231
|
+
listFiles(): Promise<string[]>;
|
|
232
|
+
/**
|
|
233
|
+
* Resolve a relative file path against the project root.
|
|
234
|
+
* Single chokepoint for path security -- rejects path traversal.
|
|
235
|
+
*/
|
|
236
|
+
private resolvePath;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Result of parsing all annotation types in a single pass */
|
|
240
|
+
interface AllAnnotations {
|
|
241
|
+
flags: Map<string, Flag>;
|
|
242
|
+
statuses: Map<string, NodeStatus>;
|
|
243
|
+
breakpoints: Set<string>;
|
|
244
|
+
risks: Map<string, RiskAnnotation>;
|
|
245
|
+
ghosts: GhostPathAnnotation[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Parse all annotation types (flags, statuses, breakpoints, risks) in a single pass.
|
|
249
|
+
* Iterates through lines once, matching each annotation regex.
|
|
250
|
+
* Unrecognized lines inside the annotation block are logged as debug warnings.
|
|
251
|
+
*/
|
|
252
|
+
declare function parseAllAnnotations(content: string): AllAnnotations;
|
|
253
|
+
/** Parse all `%% @flag` lines. Delegates to parseAllAnnotations. */
|
|
254
|
+
declare function parseFlags(content: string): Map<string, Flag>;
|
|
255
|
+
/**
|
|
256
|
+
* Remove the entire annotation block (from ANNOTATION_START to ANNOTATION_END inclusive)
|
|
257
|
+
* and any trailing blank lines. Returns pure Mermaid content.
|
|
258
|
+
*/
|
|
259
|
+
declare function stripAnnotations(content: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* Strip existing annotations, then append a new annotation block at the end.
|
|
262
|
+
* If both flags and statuses maps are empty, returns content with no annotation block.
|
|
263
|
+
* Escapes double quotes in flag messages by replacing " with ''.
|
|
264
|
+
*/
|
|
265
|
+
declare function injectAnnotations(content: string, flags: Map<string, Flag>, statuses?: Map<string, NodeStatus>, breakpoints?: Set<string>, risks?: Map<string, RiskAnnotation>, ghosts?: GhostPathAnnotation[]): string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Validate Mermaid syntax using a regex-based heuristic approach.
|
|
269
|
+
*
|
|
270
|
+
* The @mermaid-js/parser package (v0.6) only supports a limited set of diagram types
|
|
271
|
+
* (info, packet, pie, architecture, gitGraph, radar) and does NOT support flowchart,
|
|
272
|
+
* which is the primary diagram type for SmartCode. We use a heuristic validator that
|
|
273
|
+
* catches obvious syntax errors. Browser-side Mermaid.js catches the rest at render time.
|
|
274
|
+
*/
|
|
275
|
+
declare function validateMermaidSyntax(content: string): ValidationResult;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Extract the diagram type from the first non-empty, non-comment line.
|
|
279
|
+
* Returns the matched type string or undefined if no match.
|
|
280
|
+
*/
|
|
281
|
+
declare function parseDiagramType(content: string): string | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Convenience function that strips annotations, parses flags, and detects diagram type.
|
|
284
|
+
* Returns all three results together.
|
|
285
|
+
*/
|
|
286
|
+
declare function parseDiagramContent(rawContent: string): {
|
|
287
|
+
mermaidContent: string;
|
|
288
|
+
flags: Map<string, Flag>;
|
|
289
|
+
diagramType?: string;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* SmartCode - Mermaid to GraphModel Parser
|
|
294
|
+
* Multi-pass parser that converts raw .mmd content into a structured GraphModel.
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Parse raw .mmd content into a structured GraphModel.
|
|
299
|
+
* Uses a multi-pass pipeline: preprocessing, direction, styles,
|
|
300
|
+
* subgraphs, nodes, edges, annotations merge, validation.
|
|
301
|
+
*/
|
|
302
|
+
declare function parseMermaidToGraph(rawContent: string, filePath: string): GraphModel;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* SmartCode - GraphModel to Mermaid Serializer
|
|
306
|
+
* Converts a structured GraphModel back into valid Mermaid flowchart text.
|
|
307
|
+
* Counterpart to graph-parser.ts — together they enable round-trip fidelity.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Serialize a GraphModel to valid Mermaid flowchart text.
|
|
312
|
+
*
|
|
313
|
+
* Output order (canonical):
|
|
314
|
+
* 1. Direction line: `flowchart LR`
|
|
315
|
+
* 2. classDef directives
|
|
316
|
+
* 3. Subgraph blocks (recursive, with nodes inside)
|
|
317
|
+
* 4. Root-level nodes (not inside any subgraph)
|
|
318
|
+
* 5. Edges
|
|
319
|
+
* 6. style directives
|
|
320
|
+
* 7. linkStyle directives
|
|
321
|
+
* 8. class assignments
|
|
322
|
+
*/
|
|
323
|
+
declare function serializeGraphToMermaid(graph: GraphModel): string;
|
|
324
|
+
/**
|
|
325
|
+
* Serialize a GraphModel to a plain JSON-safe object.
|
|
326
|
+
* Converts all Map fields to plain objects for transmission over WebSocket or REST.
|
|
327
|
+
*/
|
|
328
|
+
declare function serializeGraphModel(graph: GraphModel): Record<string, unknown>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* ProjectManager managing multiple project directories.
|
|
332
|
+
* Each project gets its own DiagramService with independent path security.
|
|
333
|
+
*/
|
|
334
|
+
declare class ProjectManager {
|
|
335
|
+
private projects;
|
|
336
|
+
/**
|
|
337
|
+
* Register a project directory and return its DiagramService.
|
|
338
|
+
* If the directory is already registered, returns the existing service.
|
|
339
|
+
* Throws if the directory does not exist.
|
|
340
|
+
*/
|
|
341
|
+
addProject(rootDir: string): DiagramService;
|
|
342
|
+
/**
|
|
343
|
+
* Remove a project from management.
|
|
344
|
+
* Returns true if it was registered, false otherwise.
|
|
345
|
+
*/
|
|
346
|
+
removeProject(rootDir: string): boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Get the DiagramService for a registered project directory.
|
|
349
|
+
* Returns undefined if the directory is not registered.
|
|
350
|
+
*/
|
|
351
|
+
getProject(rootDir: string): DiagramService | undefined;
|
|
352
|
+
/**
|
|
353
|
+
* List all registered project root directories.
|
|
354
|
+
*/
|
|
355
|
+
listProjects(): string[];
|
|
356
|
+
/**
|
|
357
|
+
* Discover .mmd files across all registered projects.
|
|
358
|
+
* Returns a map of rootDir to file lists.
|
|
359
|
+
*/
|
|
360
|
+
discoverAll(): Promise<Map<string, string[]>>;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Discover all .mmd files recursively under the given directory.
|
|
365
|
+
* Returns relative paths (relative to the directory).
|
|
366
|
+
* Excludes node_modules, .git, test, dist, .planning, and .smartcode directories.
|
|
367
|
+
* Results are sorted alphabetically for deterministic output.
|
|
368
|
+
*
|
|
369
|
+
* Uses recursive readdir (Node 18.17+) with post-filtering to avoid
|
|
370
|
+
* external CJS dependency bundling issues with tsup ESM output.
|
|
371
|
+
*/
|
|
372
|
+
declare function discoverMmdFiles(directory: string): Promise<string[]>;
|
|
373
|
+
|
|
374
|
+
export { type AllAnnotations, type DiagramContent, type DiagramEdge, type DiagramNode, DiagramService, type EdgeType, type Flag, type FlowDirection, type GhostPath, type GhostPathAnnotation, type GraphEdge, type GraphModel, type GraphNode, type GraphSubgraph, type NodeShape, type NodeStatus, type Project, ProjectManager, type RiskAnnotation, type RiskLevel, type ValidationError, type ValidationResult, discoverMmdFiles, injectAnnotations, parseAllAnnotations, parseDiagramContent, parseDiagramType, parseFlags, parseMermaidToGraph, serializeGraphModel, serializeGraphToMermaid, stripAnnotations, validateMermaidSyntax };
|