@descent-vtt/spec-guard 0.11.0 → 0.12.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +354 -3
  2. package/README.md +377 -22
  3. package/dist/cites.d.ts +192 -0
  4. package/dist/cites.d.ts.map +1 -0
  5. package/dist/cites.js +599 -0
  6. package/dist/cites.js.map +1 -0
  7. package/dist/cli.d.ts +14 -6
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +315 -22
  10. package/dist/cli.js.map +1 -1
  11. package/dist/comments.d.ts +1 -1
  12. package/dist/comments.js +1 -1
  13. package/dist/config.d.ts +3 -0
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js +46 -5
  16. package/dist/config.js.map +1 -1
  17. package/dist/engine.d.ts.map +1 -1
  18. package/dist/engine.js +38 -14
  19. package/dist/engine.js.map +1 -1
  20. package/dist/glob.d.ts +128 -24
  21. package/dist/glob.d.ts.map +1 -1
  22. package/dist/glob.js +304 -61
  23. package/dist/glob.js.map +1 -1
  24. package/dist/impact.d.ts +179 -0
  25. package/dist/impact.d.ts.map +1 -0
  26. package/dist/impact.js +360 -0
  27. package/dist/impact.js.map +1 -0
  28. package/dist/index.d.ts +13 -5
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +7 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/mcp.d.ts +16 -75
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +198 -370
  35. package/dist/mcp.js.map +1 -1
  36. package/dist/overlay.d.ts +39 -0
  37. package/dist/overlay.d.ts.map +1 -0
  38. package/dist/overlay.js +133 -0
  39. package/dist/overlay.js.map +1 -0
  40. package/dist/parser.d.ts +41 -24
  41. package/dist/parser.d.ts.map +1 -1
  42. package/dist/parser.js +217 -160
  43. package/dist/parser.js.map +1 -1
  44. package/dist/prove.d.ts +46 -0
  45. package/dist/prove.d.ts.map +1 -0
  46. package/dist/prove.js +549 -0
  47. package/dist/prove.js.map +1 -0
  48. package/dist/query.d.ts +11 -0
  49. package/dist/query.d.ts.map +1 -1
  50. package/dist/query.js +9 -3
  51. package/dist/query.js.map +1 -1
  52. package/dist/reporter.d.ts +139 -1
  53. package/dist/reporter.d.ts.map +1 -1
  54. package/dist/reporter.js +593 -21
  55. package/dist/reporter.js.map +1 -1
  56. package/dist/rules.js +3 -3
  57. package/dist/rules.js.map +1 -1
  58. package/dist/runner.d.ts +24 -1
  59. package/dist/runner.d.ts.map +1 -1
  60. package/dist/runner.js +84 -21
  61. package/dist/runner.js.map +1 -1
  62. package/dist/specs.d.ts +5 -1
  63. package/dist/specs.d.ts.map +1 -1
  64. package/dist/specs.js +5 -1
  65. package/dist/specs.js.map +1 -1
  66. package/dist/structure.d.ts.map +1 -1
  67. package/dist/structure.js +7 -6
  68. package/dist/structure.js.map +1 -1
  69. package/dist/types.d.ts +193 -0
  70. package/dist/types.d.ts.map +1 -1
  71. package/dist/vendor/spec-core/jsonrpc/index.d.ts +3 -0
  72. package/dist/vendor/spec-core/jsonrpc/index.d.ts.map +1 -0
  73. package/dist/vendor/spec-core/jsonrpc/index.js +2 -0
  74. package/dist/vendor/spec-core/jsonrpc/index.js.map +1 -0
  75. package/dist/vendor/spec-core/jsonrpc/mcp.d.ts +158 -0
  76. package/dist/vendor/spec-core/jsonrpc/mcp.d.ts.map +1 -0
  77. package/dist/vendor/spec-core/jsonrpc/mcp.js +353 -0
  78. package/dist/vendor/spec-core/jsonrpc/mcp.js.map +1 -0
  79. package/dist/vendor/spec-core/markdown/frontmatter.d.ts +104 -0
  80. package/dist/vendor/spec-core/markdown/frontmatter.d.ts.map +1 -0
  81. package/dist/vendor/spec-core/markdown/frontmatter.js +459 -0
  82. package/dist/vendor/spec-core/markdown/frontmatter.js.map +1 -0
  83. package/dist/vendor/spec-core/markdown/headings.d.ts +46 -0
  84. package/dist/vendor/spec-core/markdown/headings.d.ts.map +1 -0
  85. package/dist/vendor/spec-core/markdown/headings.js +199 -0
  86. package/dist/vendor/spec-core/markdown/headings.js.map +1 -0
  87. package/dist/vendor/spec-core/markdown/index.d.ts +6 -0
  88. package/dist/vendor/spec-core/markdown/index.d.ts.map +1 -0
  89. package/dist/vendor/spec-core/markdown/index.js +4 -0
  90. package/dist/vendor/spec-core/markdown/index.js.map +1 -0
  91. package/dist/vendor/spec-core/markdown/layout.d.ts +40 -0
  92. package/dist/vendor/spec-core/markdown/layout.d.ts.map +1 -0
  93. package/dist/vendor/spec-core/markdown/layout.js +28 -0
  94. package/dist/vendor/spec-core/markdown/layout.js.map +1 -0
  95. package/dist/vendor/spec-core/markdown/links.d.ts +23 -0
  96. package/dist/vendor/spec-core/markdown/links.d.ts.map +1 -0
  97. package/dist/vendor/spec-core/markdown/links.js +364 -0
  98. package/dist/vendor/spec-core/markdown/links.js.map +1 -0
  99. package/dist/vendor/spec-core/markdown/lists.d.ts +23 -0
  100. package/dist/vendor/spec-core/markdown/lists.d.ts.map +1 -0
  101. package/dist/vendor/spec-core/markdown/lists.js +127 -0
  102. package/dist/vendor/spec-core/markdown/lists.js.map +1 -0
  103. package/dist/vendor/spec-core/markdown/scan.d.ts +37 -0
  104. package/dist/vendor/spec-core/markdown/scan.d.ts.map +1 -0
  105. package/dist/vendor/spec-core/markdown/scan.js +439 -0
  106. package/dist/vendor/spec-core/markdown/scan.js.map +1 -0
  107. package/dist/vendor/spec-core/markdown/syntax.d.ts +76 -0
  108. package/dist/vendor/spec-core/markdown/syntax.d.ts.map +1 -0
  109. package/dist/vendor/spec-core/markdown/syntax.js +181 -0
  110. package/dist/vendor/spec-core/markdown/syntax.js.map +1 -0
  111. package/dist/vendor/spec-core/markdown/tables.d.ts +19 -0
  112. package/dist/vendor/spec-core/markdown/tables.d.ts.map +1 -0
  113. package/dist/vendor/spec-core/markdown/tables.js +86 -0
  114. package/dist/vendor/spec-core/markdown/tables.js.map +1 -0
  115. package/dist/vendor/spec-core/markdown/types.d.ts +288 -0
  116. package/dist/vendor/spec-core/markdown/types.d.ts.map +1 -0
  117. package/dist/vendor/spec-core/markdown/types.js +9 -0
  118. package/dist/vendor/spec-core/markdown/types.js.map +1 -0
  119. package/dist/vendor/spec-core/path/index.d.ts +2 -0
  120. package/dist/vendor/spec-core/path/index.d.ts.map +1 -0
  121. package/dist/vendor/spec-core/path/index.js +2 -0
  122. package/dist/vendor/spec-core/path/index.js.map +1 -0
  123. package/dist/vendor/spec-core/path/posix.d.ts +84 -0
  124. package/dist/vendor/spec-core/path/posix.d.ts.map +1 -0
  125. package/dist/vendor/spec-core/path/posix.js +150 -0
  126. package/dist/vendor/spec-core/path/posix.js.map +1 -0
  127. package/dist/vendor/spec-core/pattern/automaton.d.ts +130 -0
  128. package/dist/vendor/spec-core/pattern/automaton.d.ts.map +1 -0
  129. package/dist/vendor/spec-core/pattern/automaton.js +340 -0
  130. package/dist/vendor/spec-core/pattern/automaton.js.map +1 -0
  131. package/dist/vendor/spec-core/pattern/charset.d.ts +59 -0
  132. package/dist/vendor/spec-core/pattern/charset.d.ts.map +1 -0
  133. package/dist/vendor/spec-core/pattern/charset.js +116 -0
  134. package/dist/vendor/spec-core/pattern/charset.js.map +1 -0
  135. package/dist/vendor/spec-core/pattern/glob.d.ts +122 -0
  136. package/dist/vendor/spec-core/pattern/glob.d.ts.map +1 -0
  137. package/dist/vendor/spec-core/pattern/glob.js +481 -0
  138. package/dist/vendor/spec-core/pattern/glob.js.map +1 -0
  139. package/dist/vendor/spec-core/pattern/index.d.ts +7 -0
  140. package/dist/vendor/spec-core/pattern/index.d.ts.map +1 -0
  141. package/dist/vendor/spec-core/pattern/index.js +4 -0
  142. package/dist/vendor/spec-core/pattern/index.js.map +1 -0
  143. package/dist/vendor/spec-core/pattern/regex.d.ts +68 -0
  144. package/dist/vendor/spec-core/pattern/regex.d.ts.map +1 -0
  145. package/dist/vendor/spec-core/pattern/regex.js +813 -0
  146. package/dist/vendor/spec-core/pattern/regex.js.map +1 -0
  147. package/dist/vendor/spec-core/text/index.d.ts +3 -0
  148. package/dist/vendor/spec-core/text/index.d.ts.map +1 -0
  149. package/dist/vendor/spec-core/text/index.js +2 -0
  150. package/dist/vendor/spec-core/text/index.js.map +1 -0
  151. package/dist/vendor/spec-core/text/lines.d.ts +73 -0
  152. package/dist/vendor/spec-core/text/lines.d.ts.map +1 -0
  153. package/dist/vendor/spec-core/text/lines.js +156 -0
  154. package/dist/vendor/spec-core/text/lines.js.map +1 -0
  155. package/package.json +8 -1
  156. package/src/vendor/spec-core/LICENSE +21 -0
  157. package/src/vendor/spec-core/README.md +8 -0
@@ -0,0 +1,179 @@
1
+ /**
2
+ * `spec-guard impact`: who depends on a path, and which rules are in play
3
+ * there. ADR-0018.
4
+ *
5
+ * The question an agent asks before an edit is not only "what may I do here"
6
+ * - `query` answers that - but "what else does this change reach". This reads
7
+ * the import graph backwards: for each path, the files that import it, and the
8
+ * files that import those, with how far each is from the path; and the rules
9
+ * in force that govern any of them, by the arithmetic a query uses.
10
+ *
11
+ * The graph is the one ADR-0011 built for cycles, and holds to its rule: a
12
+ * reference is an edge only when path arithmetic names a file the walk found.
13
+ * A reference that cannot be followed that way is counted or listed, never
14
+ * guessed at, so a short list of dependents is never mistaken for a complete
15
+ * one when it is not.
16
+ */
17
+ import { type ModuleReference } from './imports.js';
18
+ import { type Io } from './io.js';
19
+ import { type RuleSetOptions } from './query.js';
20
+ import { type DocumentView, type QueryPath, type RuleView } from './rules.js';
21
+ import type { ConfigUse } from './types.js';
22
+ /** One import that makes an edge: the file that writes it, and the reference as written. */
23
+ interface Edge {
24
+ from: string;
25
+ reference: ModuleReference;
26
+ }
27
+ /**
28
+ * The file a relative Python import names, or null.
29
+ *
30
+ * `from .db import x` names the module `db` beside the importing file:
31
+ * `db.py`, or the package `db/__init__.py`. `from . import x` reaches the
32
+ * reader as `.x` too, and there `x` may be a module or a name the package
33
+ * defines, so when no module has the name the edge goes to the package's
34
+ * `__init__.py`, which is where the name comes from. Arithmetic and
35
+ * membership only, as ADR-0005 resolves every relative specifier.
36
+ */
37
+ export declare function resolvePython(specifier: string, importingFile: string, files: ReadonlySet<string>): string | null;
38
+ /** A reference the graph should have followed and could not, or one whose target no text names. */
39
+ export interface ImpactUnresolved {
40
+ file: string;
41
+ line: number;
42
+ /** The specifier as written, or what could not be resolved, as `import(name)`. */
43
+ specifier: string;
44
+ /** `unresolved`: relative, or an alias that cannot be a package, and naming no file; `dynamic`: a computed name. */
45
+ reason: 'unresolved' | 'dynamic';
46
+ }
47
+ /** The import graph of a whole tree, read backwards. */
48
+ export interface ReverseGraph {
49
+ /** Every file the walk found, root-relative. */
50
+ files: string[];
51
+ /** The files an edge can reach: JavaScript, TypeScript and Python. */
52
+ nodes: ReadonlySet<string>;
53
+ /** For each file, the imports of it, by the file that writes each. */
54
+ importers: Map<string, Edge[]>;
55
+ unresolved: ImpactUnresolved[];
56
+ /** References that name a module rather than a file, by language: counted, not followed. */
57
+ unfollowed: Map<string, number>;
58
+ /** Files whose imports could not be read in full. */
59
+ gaps: Array<{
60
+ file: string;
61
+ detail: string;
62
+ }>;
63
+ }
64
+ /**
65
+ * Reads every analysable file in the tree and builds the graph backwards.
66
+ *
67
+ * Nodes are the JavaScript, TypeScript and Python files in scope. A relative
68
+ * JavaScript or TypeScript specifier follows ADR-0011's resolution table, and
69
+ * a relative Python import names a module beside the importing file. Every
70
+ * other reference names a module rather than a file - an absolute Python
71
+ * import, a Go import path, a Rust `use`, a C# `using` - and which file that
72
+ * is depends on `sys.path`, `go.mod`, the crate's module tree or the compiler's
73
+ * symbol table. Those are counted by language and not followed.
74
+ */
75
+ export declare function buildReverseGraph(options: {
76
+ root: string;
77
+ exclude: readonly string[];
78
+ defaultSkips: boolean;
79
+ io: Io;
80
+ }): Promise<ReverseGraph>;
81
+ /** A file that depends on a path, how far from it, and the import that takes it one step closer. */
82
+ export interface ImpactDependent {
83
+ file: string;
84
+ /** 1 for a file that imports the path itself, 2 for one that imports such a file, and so on. */
85
+ depth: number;
86
+ /** The first import, in source order, of a file one step closer. */
87
+ via: {
88
+ imports: string;
89
+ line: number;
90
+ specifier: string;
91
+ };
92
+ }
93
+ /**
94
+ * The files that depend on `start`, breadth-first, each at its shortest
95
+ * distance, as deep as `maxDepth` allows. A cycle is safe: a file is visited
96
+ * once. Neighbours are taken in path order, so the answer is the same every
97
+ * time.
98
+ */
99
+ export declare function dependentsOf(graph: Pick<ReverseGraph, 'importers'>, start: readonly string[], maxDepth?: number): ImpactDependent[];
100
+ export interface ImpactOptions extends RuleSetOptions {
101
+ /** The paths to ask about, as typed. */
102
+ paths: readonly string[];
103
+ /** How many steps of dependents to follow; all of them when absent. */
104
+ depth?: number;
105
+ /** List rules from documents not in force, as `--ignore-status` does. */
106
+ includeInactive?: boolean;
107
+ }
108
+ export interface ImpactPath {
109
+ path: string;
110
+ shape: QueryPath['shape'];
111
+ /** The files of the path the graph holds: the file itself, or those under the directory. */
112
+ files: string[];
113
+ /** Why no dependent can be shown for this path, when none can. */
114
+ note?: string;
115
+ dependents: ImpactDependent[];
116
+ }
117
+ export interface ImpactReport {
118
+ root: string;
119
+ specFiles: string[];
120
+ exclude: string[];
121
+ /** The depth asked for, or null for every dependent. */
122
+ depth: number | null;
123
+ results: ImpactPath[];
124
+ /** Rules in force - or every rule, with `includeInactive` - that govern a path or a dependent, with the ones each governs. */
125
+ rules: Array<RuleView & {
126
+ governs: string[];
127
+ }>;
128
+ /** Rules in documents not in force that would govern them, counted, and their documents. */
129
+ withheld: {
130
+ rules: number;
131
+ documents: string[];
132
+ };
133
+ documents: DocumentView[];
134
+ /** References in scope that could depend on these paths and could not be followed. */
135
+ unresolved: ImpactUnresolved[];
136
+ /** References that name a module rather than a file, by kind, and how many. */
137
+ unfollowed: Array<{
138
+ kind: string;
139
+ references: number;
140
+ }>;
141
+ gaps: Array<{
142
+ file: string;
143
+ detail: string;
144
+ }>;
145
+ errors: Array<{
146
+ file: string;
147
+ line: number;
148
+ message: string;
149
+ }>;
150
+ /** Files the walk found. */
151
+ scanned: number;
152
+ durationMs: number;
153
+ /** What the command line took from the project's configuration, when it took anything. */
154
+ config?: ConfigUse;
155
+ }
156
+ /** A thrown reason the question cannot be answered. */
157
+ export declare class ImpactError extends Error {
158
+ }
159
+ /** Answers the question for every path, from one read of the tree and the specs. */
160
+ export declare function impactOf(options: ImpactOptions): Promise<ImpactReport>;
161
+ /** The human-readable form of an impact report. */
162
+ export declare function formatImpact(report: ImpactReport): string;
163
+ /**
164
+ * The version of `impact --json`'s document. A field removed or renamed moves
165
+ * it; a field added does not.
166
+ */
167
+ export declare const IMPACT_FORMAT_VERSION = 1;
168
+ /**
169
+ * The document `impact --json` writes, and the MCP server's `get_dependents`
170
+ * answers with as its structured content: one object, so the two cannot
171
+ * drift apart.
172
+ */
173
+ export declare function impactDocument(report: ImpactReport): {
174
+ formatVersion: number;
175
+ } & ImpactReport;
176
+ /** The JSON form of an impact report. */
177
+ export declare function formatImpactJson(report: ImpactReport): string;
178
+ export {};
179
+ //# sourceMappingURL=impact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../src/impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EAA4C,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAU,KAAK,EAAE,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAA6B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C,4FAA4F;AAC5F,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,eAAe,CAAC;CAC5B;AAOD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa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C;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,IAAI,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,uDAAuD;AACvD,qBAAa,WAAY,SAAQ,KAAK;CAAG;AAezC,oFAAoF;AACpF,wBAAsB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAoE5E;AAcD,mDAAmD;AACnD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAkFzD;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAE7F;AAED,yCAAyC;AACzC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7D"}
package/dist/impact.js ADDED
@@ -0,0 +1,360 @@
1
+ /**
2
+ * `spec-guard impact`: who depends on a path, and which rules are in play
3
+ * there. ADR-0018.
4
+ *
5
+ * The question an agent asks before an edit is not only "what may I do here"
6
+ * - `query` answers that - but "what else does this change reach". This reads
7
+ * the import graph backwards: for each path, the files that import it, and the
8
+ * files that import those, with how far each is from the path; and the rules
9
+ * in force that govern any of them, by the arithmetic a query uses.
10
+ *
11
+ * The graph is the one ADR-0011 built for cycles, and holds to its rule: a
12
+ * reference is an edge only when path arithmetic names a file the walk found.
13
+ * A reference that cannot be followed that way is counted or listed, never
14
+ * guessed at, so a short list of dependents is never mistaken for a complete
15
+ * one when it is not.
16
+ */
17
+ import path from 'node:path';
18
+ import { comparePaths, MAX_CONCURRENT_READS } from './engine.js';
19
+ import { createExcludeMatcher, toPosix, walkPaths } from './glob.js';
20
+ import { isGraphFile, resolveReference } from './graph.js';
21
+ import { ANALYSABLE_EXTENSIONS, createImportIndex } from './imports.js';
22
+ import { nodeIo } from './io.js';
23
+ import { languageFor, normalizeModule } from './polyglot.js';
24
+ import { loadRuleSet, resolveQueryPath } from './query.js';
25
+ import { governs, viewRule, within } from './rules.js';
26
+ import { formatOptionLines } from './reporter.js';
27
+ import { createScope } from './scope.js';
28
+ /** The files a relative Python import can name, most likely first. */
29
+ function pythonCandidates(resolved) {
30
+ return [`${resolved}.py`, `${resolved}.pyi`, `${resolved}/__init__.py`, `${resolved}/__init__.pyi`];
31
+ }
32
+ /**
33
+ * The file a relative Python import names, or null.
34
+ *
35
+ * `from .db import x` names the module `db` beside the importing file:
36
+ * `db.py`, or the package `db/__init__.py`. `from . import x` reaches the
37
+ * reader as `.x` too, and there `x` may be a module or a name the package
38
+ * defines, so when no module has the name the edge goes to the package's
39
+ * `__init__.py`, which is where the name comes from. Arithmetic and
40
+ * membership only, as ADR-0005 resolves every relative specifier.
41
+ */
42
+ export function resolvePython(specifier, importingFile, files) {
43
+ // Only ever called for a relative specifier, which starts with a dot. Each
44
+ // dot after the first climbs a directory, and one that would climb out of
45
+ // the root names nothing here.
46
+ const dots = /^\.+/.exec(specifier)[0];
47
+ const directory = path.posix.dirname(importingFile);
48
+ const depth = directory === '.' ? 0 : directory.split('/').length;
49
+ if (dots.length - 1 > depth)
50
+ return null;
51
+ const resolved = normalizeModule(specifier, importingFile, 'python');
52
+ const module = pythonCandidates(resolved).find((candidate) => files.has(candidate));
53
+ if (module !== undefined)
54
+ return module;
55
+ const packageDirectory = normalizeModule(dots, importingFile, 'python');
56
+ const prefix = packageDirectory === '.' ? '' : `${packageDirectory}/`;
57
+ return [`${prefix}__init__.py`, `${prefix}__init__.pyi`].find((candidate) => files.has(candidate)) ?? null;
58
+ }
59
+ /** What each language is called in a sentence. */
60
+ const LANGUAGE_NAMES = { go: 'Go', rust: 'Rust', csharp: 'C#' };
61
+ /** How a language's references are named where a report counts them. */
62
+ const UNFOLLOWED = {
63
+ python: 'absolute Python import',
64
+ go: 'Go import',
65
+ rust: 'Rust use',
66
+ csharp: 'C# using',
67
+ };
68
+ /**
69
+ * Reads every analysable file in the tree and builds the graph backwards.
70
+ *
71
+ * Nodes are the JavaScript, TypeScript and Python files in scope. A relative
72
+ * JavaScript or TypeScript specifier follows ADR-0011's resolution table, and
73
+ * a relative Python import names a module beside the importing file. Every
74
+ * other reference names a module rather than a file - an absolute Python
75
+ * import, a Go import path, a Rust `use`, a C# `using` - and which file that
76
+ * is depends on `sys.path`, `go.mod`, the crate's module tree or the compiler's
77
+ * symbol table. Those are counted by language and not followed.
78
+ */
79
+ export async function buildReverseGraph(options) {
80
+ const excluded = createExcludeMatcher(options.exclude);
81
+ const files = [];
82
+ const absolute = new Map();
83
+ for await (const entry of walkPaths(options.root, { io: options.io, scope: createScope(options.defaultSkips) })) {
84
+ if (excluded(entry.relativePath))
85
+ continue;
86
+ files.push(entry.relativePath);
87
+ absolute.set(entry.relativePath, entry.absolutePath);
88
+ }
89
+ const walked = new Set(files);
90
+ const javascript = new Set(files.filter(isGraphFile));
91
+ const python = files.filter((file) => languageFor(file) === 'python');
92
+ const nodes = new Set([...javascript, ...python]);
93
+ const scope = { nodes: javascript, walked, covers: () => true, excluded };
94
+ const index = createImportIndex(options.io);
95
+ const importers = new Map();
96
+ const unresolved = [];
97
+ const unfollowed = new Map();
98
+ const gaps = [];
99
+ const analysable = files.filter((file) => ANALYSABLE_EXTENSIONS.has(path.posix.extname(file)));
100
+ // Read in batches the size of the engine's read limit, as every other
101
+ // reader of a whole tree is: all at once is an EMFILE on a large one.
102
+ const analyses = [];
103
+ while (analyses.length < analysable.length) {
104
+ const batch = analysable.slice(analyses.length, analyses.length + MAX_CONCURRENT_READS);
105
+ analyses.push(...(await Promise.all(batch.map((file) => index.analyze(absolute.get(file), file)))));
106
+ }
107
+ analysable.forEach((file, position) => {
108
+ const { references, notes } = analyses[position];
109
+ for (const note of notes) {
110
+ if (note.kind === 'dynamic')
111
+ unresolved.push({ file, line: note.line, specifier: note.detail, reason: 'dynamic' });
112
+ else
113
+ gaps.push({ file, detail: note.detail });
114
+ }
115
+ const language = languageFor(file);
116
+ for (const reference of references) {
117
+ let target = null;
118
+ if (language === null) {
119
+ const resolution = resolveReference(reference.specifier, file, scope);
120
+ if (resolution.kind === 'edge')
121
+ target = resolution.file;
122
+ else if (resolution.kind === 'unresolved')
123
+ unresolved.push({ file, line: reference.line, specifier: reference.specifier, reason: 'unresolved' });
124
+ }
125
+ else if (language === 'python' && reference.specifier.startsWith('.')) {
126
+ target = resolvePython(reference.specifier, file, walked);
127
+ if (target === null)
128
+ unresolved.push({ file, line: reference.line, specifier: reference.specifier, reason: 'unresolved' });
129
+ }
130
+ else {
131
+ const kind = UNFOLLOWED[language];
132
+ unfollowed.set(kind, (unfollowed.get(kind) ?? 0) + 1);
133
+ }
134
+ if (target !== null && target !== file)
135
+ importers.set(target, [...(importers.get(target) ?? []), { from: file, reference }]);
136
+ }
137
+ });
138
+ unresolved.sort((a, b) => comparePaths(a.file, b.file) || a.line - b.line);
139
+ return { files, nodes, importers, unresolved, unfollowed, gaps };
140
+ }
141
+ /**
142
+ * The files that depend on `start`, breadth-first, each at its shortest
143
+ * distance, as deep as `maxDepth` allows. A cycle is safe: a file is visited
144
+ * once. Neighbours are taken in path order, so the answer is the same every
145
+ * time.
146
+ */
147
+ export function dependentsOf(graph, start, maxDepth = Number.POSITIVE_INFINITY) {
148
+ const seen = new Set(start);
149
+ const found = [];
150
+ let frontier = [...start].sort(comparePaths);
151
+ for (let depth = 1; depth <= maxDepth && frontier.length > 0; depth++) {
152
+ const next = [];
153
+ for (const target of frontier) {
154
+ const edges = [...(graph.importers.get(target) ?? [])].sort((a, b) => comparePaths(a.from, b.from) || a.reference.line - b.reference.line);
155
+ for (const { from, reference } of edges) {
156
+ if (seen.has(from))
157
+ continue;
158
+ seen.add(from);
159
+ next.push(from);
160
+ found.push({ file: from, depth, via: { imports: target, line: reference.line, specifier: reference.specifier } });
161
+ }
162
+ }
163
+ frontier = next.sort(comparePaths);
164
+ }
165
+ return found.sort((a, b) => a.depth - b.depth || comparePaths(a.file, b.file));
166
+ }
167
+ /** A thrown reason the question cannot be answered. */
168
+ export class ImpactError extends Error {
169
+ }
170
+ /** Why a path's dependents cannot be shown, or undefined when they can. */
171
+ function unreachable(query, files) {
172
+ if (files.length > 0)
173
+ return undefined;
174
+ if (query.shape === 'directory')
175
+ return 'no JavaScript, TypeScript or Python file under it is in scope';
176
+ const language = languageFor(query.path);
177
+ if (language === null ? isGraphFile(query.path) : language === 'python') {
178
+ return "it is not in scope: the project's exclude, or a directory the walk skips, leaves it out";
179
+ }
180
+ return language === null
181
+ ? 'it is not JavaScript, TypeScript or Python, so no import names it as a file'
182
+ : `a ${LANGUAGE_NAMES[language]} file is imported by the name of a module, not by its path, so what depends on it is not computed (ADR-0018)`;
183
+ }
184
+ /** Answers the question for every path, from one read of the tree and the specs. */
185
+ export async function impactOf(options) {
186
+ const startedAt = performance.now();
187
+ const io = options.io ?? nodeIo;
188
+ const queries = await Promise.all(options.paths.map((input) => resolveQueryPath(input, options.root, io)));
189
+ for (const query of queries) {
190
+ if (!query.exists)
191
+ throw new ImpactError(`"${query.path}" does not exist, so nothing depends on it yet`);
192
+ }
193
+ const ruleSet = await loadRuleSet({ ...options, io });
194
+ const graph = await buildReverseGraph({ root: options.root, exclude: ruleSet.exclude, defaultSkips: options.defaultSkips ?? true, io });
195
+ const results = queries.map((query) => {
196
+ // A file's only file is itself, and a directory's are the ones under it.
197
+ const files = [...graph.nodes].filter((file) => within(file, query.path)).sort(comparePaths);
198
+ const note = unreachable(query, files);
199
+ return {
200
+ path: query.path,
201
+ shape: query.shape,
202
+ files,
203
+ ...(note === undefined ? {} : { note }),
204
+ dependents: dependentsOf(graph, files, options.depth),
205
+ };
206
+ });
207
+ // Every path asked about, as asked, and every dependent as a file: the rules
208
+ // a query would show for each of them.
209
+ const governed = [
210
+ ...queries,
211
+ ...[...new Set(results.flatMap((result) => result.dependents.map((dependent) => dependent.file)))].map((file) => ({
212
+ path: file,
213
+ shape: 'file',
214
+ absolutePath: path.resolve(options.root, file),
215
+ })),
216
+ ];
217
+ const includeInactive = options.includeInactive ?? false;
218
+ const rules = [];
219
+ const withheld = new Set();
220
+ let withheldRules = 0;
221
+ const cited = new Map();
222
+ for (const { assertion, document } of ruleSet.rules) {
223
+ const covered = governed.filter((query) => governs(assertion, query)).map((query) => query.path);
224
+ if (covered.length === 0)
225
+ continue;
226
+ if (!document.inForce) {
227
+ withheldRules += 1;
228
+ withheld.add(document.file);
229
+ cited.set(document.file, document);
230
+ if (!includeInactive)
231
+ continue;
232
+ }
233
+ cited.set(document.file, document);
234
+ rules.push({ ...viewRule(assertion, document), governs: covered });
235
+ }
236
+ return {
237
+ root: toPosix(options.root),
238
+ specFiles: ruleSet.specFiles,
239
+ exclude: ruleSet.exclude,
240
+ depth: options.depth ?? null,
241
+ results,
242
+ rules,
243
+ withheld: { rules: withheldRules, documents: [...withheld] },
244
+ // In the order the rules were read, which is the spec files' order.
245
+ documents: [...cited.values()],
246
+ unresolved: graph.unresolved,
247
+ unfollowed: [...graph.unfollowed].map(([kind, references]) => ({ kind, references })).sort((a, b) => b.references - a.references || comparePaths(a.kind, b.kind)),
248
+ gaps: graph.gaps,
249
+ errors: ruleSet.errors.map((error) => ({ file: error.location.relativeFile, line: error.location.line, message: error.message })),
250
+ scanned: graph.files.length,
251
+ durationMs: performance.now() - startedAt,
252
+ };
253
+ }
254
+ /* --------------------------------------------------------------- formatting */
255
+ function plural(count, one, many) {
256
+ return `${count} ${count === 1 ? one : many}`;
257
+ }
258
+ /** At most this many unresolved references are listed in the human report; JSON has them all. */
259
+ const SHOWN_UNRESOLVED = 10;
260
+ /** At most this many files are named under a rule in the human report; JSON has them all. */
261
+ const SHOWN_GOVERNED = 5;
262
+ /** The human-readable form of an impact report. */
263
+ export function formatImpact(report) {
264
+ const out = [];
265
+ for (const result of report.results) {
266
+ const kind = result.shape === 'directory' ? ` (directory, ${plural(result.files.length, 'file', 'files')} in the graph)` : '';
267
+ out.push(`${result.path}${kind}`);
268
+ if (result.note !== undefined) {
269
+ out.push(` no dependents shown: ${result.note}`, '');
270
+ continue;
271
+ }
272
+ const direct = result.dependents.filter((dependent) => dependent.depth === 1).length;
273
+ const deepest = result.dependents.reduce((most, dependent) => Math.max(most, dependent.depth), 0);
274
+ out.push(result.dependents.length === 0
275
+ ? ' nothing in scope imports it'
276
+ : ` ${plural(result.dependents.length, 'file depends', 'files depend')} on it, ${direct} directly${deepest > 1 ? `, up to ${deepest} imports away` : ''}`);
277
+ const width = Math.max(0, ...result.dependents.map((dependent) => dependent.file.length));
278
+ for (const dependent of result.dependents) {
279
+ out.push(` ${dependent.depth} ${dependent.file.padEnd(width)} imports ${dependent.via.imports} (line ${dependent.via.line})`);
280
+ }
281
+ out.push('');
282
+ }
283
+ if (report.depth !== null)
284
+ out.push(`only dependents up to ${plural(report.depth, 'import', 'imports')} away are shown (--depth ${report.depth})`, '');
285
+ const documents = new Map(report.documents.map((document) => [document.file, document]));
286
+ const byDocument = new Map();
287
+ for (const rule of report.rules)
288
+ byDocument.set(rule.document, [...(byDocument.get(rule.document) ?? []), rule]);
289
+ out.push(report.specFiles.length === 0
290
+ ? 'no spec files matched, so no rules are shown'
291
+ : report.rules.length === 0
292
+ ? 'no rules in force govern these files'
293
+ : `${plural(report.rules.length, 'rule governs', 'rules govern')} these files, from ${plural(byDocument.size, 'document', 'documents')}`);
294
+ for (const [file, rules] of byDocument) {
295
+ const document = documents.get(file);
296
+ const status = document.inForce ? '' : `, ${document.status} - not in force`;
297
+ out.push('', ` ${document.title ?? file} (${file}${status})`);
298
+ for (const rule of rules) {
299
+ out.push(` :${rule.line} @${rule.kind} ${rule.description}`);
300
+ const more = rule.governs.length - SHOWN_GOVERNED;
301
+ out.push(` governs: ${rule.governs.slice(0, SHOWN_GOVERNED).join(', ')}${more > 0 ? ` and ${more} more` : ''}`);
302
+ if (rule.reason !== null)
303
+ out.push(` reason: ${rule.reason}`);
304
+ }
305
+ }
306
+ const unlisted = report.withheld.rules - report.rules.filter((rule) => !rule.inForce).length;
307
+ if (unlisted > 0) {
308
+ out.push('', ` ${plural(unlisted, 'more rule', 'more rules')} would govern them if ${report.withheld.documents.join(', ')} were in force; --ignore-status lists ${unlisted === 1 ? 'it' : 'them'}`);
309
+ }
310
+ out.push('');
311
+ if (report.unfollowed.length > 0) {
312
+ const counts = report.unfollowed.map(({ kind, references }) => plural(references, kind, `${kind}s`)).join(', ');
313
+ const one = report.unfollowed.length === 1 && report.unfollowed[0].references === 1;
314
+ out.push(`not followed: ${counts} ${one ? 'names' : 'name'} modules rather than files, so a file that depends on these paths through one is not shown (ADR-0018)`, '');
315
+ }
316
+ if (report.unresolved.length > 0) {
317
+ out.push(`${plural(report.unresolved.length, 'import', 'imports')} could not be resolved, and may depend on these paths:`);
318
+ for (const entry of report.unresolved.slice(0, SHOWN_UNRESOLVED)) {
319
+ out.push(` ${entry.file}:${entry.line} ${entry.specifier}${entry.reason === 'dynamic' ? '' : ' (names no file)'}`);
320
+ }
321
+ if (report.unresolved.length > SHOWN_UNRESOLVED)
322
+ out.push(` and ${report.unresolved.length - SHOWN_UNRESOLVED} more; --json lists them all`);
323
+ out.push('');
324
+ }
325
+ if (report.gaps.length > 0) {
326
+ out.push(`${plural(report.gaps.length, 'file', 'files')} whose imports could not all be read:`);
327
+ for (const gap of report.gaps)
328
+ out.push(` ${gap.file}: ${gap.detail}`);
329
+ out.push('');
330
+ }
331
+ if (report.errors.length > 0) {
332
+ out.push(`${plural(report.errors.length, 'directive', 'directives')} could not be read, so ${report.errors.length === 1 ? 'its rule governs' : 'their rules govern'} nothing:`);
333
+ for (const error of report.errors)
334
+ out.push(` ${error.file}:${error.line} ${error.message}`);
335
+ out.push('');
336
+ }
337
+ const optionLines = formatOptionLines(report.config, report.exclude);
338
+ if (optionLines.length > 0)
339
+ out.push(...optionLines, '');
340
+ out.push(`${plural(report.scanned, 'file', 'files')} and ${plural(report.specFiles.length, 'spec file', 'spec files')} read in ${report.durationMs.toFixed(1)}ms`);
341
+ return out.join('\n');
342
+ }
343
+ /**
344
+ * The version of `impact --json`'s document. A field removed or renamed moves
345
+ * it; a field added does not.
346
+ */
347
+ export const IMPACT_FORMAT_VERSION = 1;
348
+ /**
349
+ * The document `impact --json` writes, and the MCP server's `get_dependents`
350
+ * answers with as its structured content: one object, so the two cannot
351
+ * drift apart.
352
+ */
353
+ export function impactDocument(report) {
354
+ return { formatVersion: IMPACT_FORMAT_VERSION, ...report, durationMs: Math.round(report.durationMs * 1000) / 1000 };
355
+ }
356
+ /** The JSON form of an impact report. */
357
+ export function formatImpactJson(report) {
358
+ return JSON.stringify(impactDocument(report), null, 2);
359
+ }
360
+ //# sourceMappingURL=impact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact.js","sourceRoot":"","sources":["../src/impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAwB,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAW,MAAM,SAAS,C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G,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,YAAY,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnK,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAoB;IACjD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;AACtH,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -17,10 +17,18 @@ export { engineNamed, findConfig, loadConfig, parseConfig, parseStandaloneConfig
17
17
  export type { ConfigKey, FoundConfig, ProjectConfig } from './config.js';
18
18
  export { buildJsRegExp, buildRipgrepArgs, createCachedEngine, createJavaScriptEngine, enumerateCandidates, escapeRegExp, ANY_FILE_PROBE, findRipgrep, parseRipgrepErrors, isMissingBinary, javascriptEngine, resetRipgrepProbe, resolveEngine, runSearches, scanContent, sortLocations, MAX_FILE_SIZE, SMALL_TREE_BUDGET, } from './engine.js';
19
19
  export type { BatchEngine, CachedEngine, Engine, EnginePreference, Enumeration, EnumerationBudget, SearchRequest, } from './engine.js';
20
- export { compareDirents, createExcludeMatcher, createGlobMatcher, excludeListError, excludePatternError, expandSpecPatterns, globBase, globToRegExp, isGlob, normalizeExclude, normalizeGlob, toPosix, walkFiles, walkPaths, } from './glob.js';
20
+ export { compareDirents, createExcludeMatcher, createGlobMatcher, excludeListError, excludePatternError, expandSpecPatterns, globBase, globPatternError, globToRegExp, isGlob, normalizeExclude, normalizeGlob, specPatternError, toPosix, walkFiles, walkPaths, } from './glob.js';
21
21
  export type { WalkedFile, WalkedPath, WalkOptions } from './glob.js';
22
22
  export { nodeIo, readText, watchTree } from './io.js';
23
23
  export type { DirectoryReader, Io, TreeListener, TreeWatcher } from './io.js';
24
+ export { overlayIo, readOnce } from './overlay.js';
25
+ export type { TreeEdit } from './overlay.js';
26
+ export { proveSpecGuard, PROVE_NAME } from './prove.js';
27
+ export { citeFilesError, citeIdError, deriveFamilies, documentNumber, findCitations, findDocuments, inComments, isStale, numberKey, parseFilesTemplate, parseIdTemplate, qualified, scanCitations, CitesError, NUMBER, } from './cites.js';
28
+ export type { Citation, CitedDocument, CitesOptions, FilesTemplate, IdTemplate, ResolvedFamily } from './cites.js';
29
+ export { buildReverseGraph, dependentsOf, formatImpact, formatImpactJson, impactDocument, impactOf, resolvePython, ImpactError, IMPACT_FORMAT_VERSION } from './impact.js';
30
+ export type { ImpactDependent, ImpactOptions, ImpactPath, ImpactReport, ImpactUnresolved, ReverseGraph } from './impact.js';
31
+ export type { ProveOptions } from './prove.js';
24
32
  export { contentHash, createMemo, NO_MEMO } from './memo.js';
25
33
  export type { Memo, SessionMemo } from './memo.js';
26
34
  export { createFactCache, FACT_POLICY } from './facts.js';
@@ -46,13 +54,13 @@ export { readSpecs, specPath } from './specs.js';
46
54
  export type { SpecDocument, SpecSet } from './specs.js';
47
55
  export { governs, layerPosition, leftOutByOwnExclude, viewRule, within } from './rules.js';
48
56
  export type { DocumentView, LayerPosition, PathShape, QueryPath, RuleView } from './rules.js';
49
- export { answerQuery, formatQuery, formatQueryJson, inQueriedPaths, loadRuleSet, queryRules, resolveQueryPath, viewDocument, QueryPathError, } from './query.js';
57
+ export { answerQuery, formatQuery, formatQueryJson, inQueriedPaths, loadRuleSet, queryRules, resolveQueryPath, viewDocument, QueryPathError, QUERY_FORMAT_VERSION, } from './query.js';
50
58
  export type { PathRules, QueryOptions, QueryReport, RuleSet, RuleSetOptions } from './query.js';
51
59
  export { classifyRequest, createMcpHandler, documentPath, documentUri, envelopeIssue, negotiateLegacyVersion, serveStdio, LEGACY_PROTOCOL_VERSIONS, MODERN_PROTOCOL_VERSIONS, RESOURCE_TEMPLATES, TOOLS, } from './mcp.js';
52
60
  export type { Era, McpServerOptions, OutgoingMessage } from './mcp.js';
53
61
  export { applyBaseline, checkProjectExcludes, createScopeProbe, executeAssertion, planRun, reportRun, resolveDirective, runSpecGuard, specExclusions, DEFAULT_CONCURRENCY, DEFAULT_MAX_SNIPPETS, } from './runner.js';
54
62
  export type { ExecuteOptions, ResolveContext, RunOptions, RunPlan, RunResult } from './runner.js';
55
- export { createPainter, formatBaselines, formatConfigUse, formatJson, formatOptionLines, formatReport, formatSarif, shouldUseAscii, shouldUseColor, } from './reporter.js';
56
- export type { ReporterOptions } from './reporter.js';
57
- export type { Assertion, AssertionResult, BaselineEntry, Bounds, ConfigUse, Directive, DirectiveError, DirectiveKind, EngineName, ImportQuery, InactiveSpec, MatchLocation, ParseResult, RatchetMode, RunReport, RunSummary, SearchOptions, SearchResult, SourceLocation, SpecStatus, StaleBaselineEntry, StructureClaim, StructureQuery, } from './types.js';
63
+ export { citesAnnotations, createPainter, formatBaselines, formatCites, formatCitesJson, formatCitesSarif, formatConfigUse, formatGithub, formatGitlab, formatJson, formatOptionLines, formatProve, formatProveJson, formatProveSarif, formatReport, formatSarif, proveAnnotations, runAnnotations, CITES_FORMAT_VERSION, PROVE_FORMAT_VERSION, RUN_FORMAT_VERSION, shouldUseAscii, shouldUseColor, } from './reporter.js';
64
+ export type { Annotation, GitlabSeverity, ReporterOptions } from './reporter.js';
65
+ export type { Assertion, AssertionResult, BaselineEntry, Bounds, CiteFamily, CiteFamilyReport, CiteFinding, CiteGap, CiteRule, CitesReport, ConfigUse, Directive, DirectiveError, DirectiveKind, EngineName, ImportQuery, InactiveSpec, MaskedContext, MaskedDirective, MatchLocation, ParseResult, ProveClaim, ProveOutcome, ProveProbe, ProveReport, ProveResult, RatchetMode, RunReport, RunSummary, SearchOptions, SearchResult, SourceLocation, SpecStatus, SpecWarning, StaleBaselineEntry, StructureClaim, StructureQuery, TreeChange, } from './types.js';
58
66
  //# sourceMappingURL=index.d.ts.map