intentumdiff-python 0.0.1__py3-none-win_arm64.whl

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 (165) hide show
  1. intentumdiff/__init__.py +134 -0
  2. intentumdiff/_differ_gate.py +210 -0
  3. intentumdiff/_differ_presentation.py +786 -0
  4. intentumdiff/_differ_runtime.py +320 -0
  5. intentumdiff/analysis/__init__.py +1 -0
  6. intentumdiff/analysis/compile_commands.py +151 -0
  7. intentumdiff/analysis/cross_file.py +71 -0
  8. intentumdiff/analysis/diagnostics.py +309 -0
  9. intentumdiff/analysis/guardrail_reports.py +254 -0
  10. intentumdiff/analysis/guardrails.py +318 -0
  11. intentumdiff/analysis/invariances.py +1207 -0
  12. intentumdiff/analysis/keyed_profiles.py +25 -0
  13. intentumdiff/analysis/resource_profiles.py +14 -0
  14. intentumdiff/analysis/schema_resolver.py +816 -0
  15. intentumdiff/analysis/text_review.py +46 -0
  16. intentumdiff/analysis/user_schemas.py +430 -0
  17. intentumdiff/assets.py +45 -0
  18. intentumdiff/cache/__init__.py +37 -0
  19. intentumdiff/cache/duckdb_store.py +98 -0
  20. intentumdiff/cache/sqlite_store.py +149 -0
  21. intentumdiff/cache/store.py +190 -0
  22. intentumdiff/cli/__init__.py +199 -0
  23. intentumdiff/cli/_commands.py +2141 -0
  24. intentumdiff/cli/_parser.py +1061 -0
  25. intentumdiff/cli/_shared.py +644 -0
  26. intentumdiff/content_type.py +59 -0
  27. intentumdiff/core/__init__.py +1 -0
  28. intentumdiff/core/commit_differ.py +599 -0
  29. intentumdiff/core/config.py +51 -0
  30. intentumdiff/core/cst_serializer.py +101 -0
  31. intentumdiff/core/diffignore.py +87 -0
  32. intentumdiff/core/index.py +189 -0
  33. intentumdiff/core/indexer.py +792 -0
  34. intentumdiff/core/models.py +837 -0
  35. intentumdiff/differ.py +2195 -0
  36. intentumdiff/github_app.py +287 -0
  37. intentumdiff/intentumdiff_rust_core/__init__.py +7 -0
  38. intentumdiff/intentumdiff_rust_core/ffi.py +8 -0
  39. intentumdiff/intentumdiff_rust_core/intentumdiff_rust_core.dll +0 -0
  40. intentumdiff/invariances/__init__.py +2 -0
  41. intentumdiff/invariances/rules.schema.json +283 -0
  42. intentumdiff/invariances/rules.yaml +349 -0
  43. intentumdiff/live_server.py +1314 -0
  44. intentumdiff/lsp/__init__.py +67 -0
  45. intentumdiff/lsp/client.py +544 -0
  46. intentumdiff/lsp/config.py +96 -0
  47. intentumdiff/lsp/enricher.py +227 -0
  48. intentumdiff/lsp/exceptions.py +27 -0
  49. intentumdiff/lsp/launcher.py +273 -0
  50. intentumdiff/lsp/servers.py +356 -0
  51. intentumdiff/lsp_server/__init__.py +14 -0
  52. intentumdiff/lsp_server/_codelens.py +67 -0
  53. intentumdiff/lsp_server/_diagnostics.py +62 -0
  54. intentumdiff/lsp_server/_handlers.py +175 -0
  55. intentumdiff/lsp_server/server.py +205 -0
  56. intentumdiff/plugins/__init__.py +1 -0
  57. intentumdiff/plugins/adapter.py +397 -0
  58. intentumdiff/plugins/builtins.py +323 -0
  59. intentumdiff/plugins/exceptions.py +93 -0
  60. intentumdiff/plugins/hub.py +1155 -0
  61. intentumdiff/plugins/language_metadata.py +250 -0
  62. intentumdiff/plugins/loader.py +1252 -0
  63. intentumdiff/plugins/registry.py +1079 -0
  64. intentumdiff/plugins/registry.schema.json +99 -0
  65. intentumdiff/plugins/registry_schema.py +280 -0
  66. intentumdiff/plugins/wit/plugin.wit +351 -0
  67. intentumdiff/rust_core.py +2370 -0
  68. intentumdiff/serve/__init__.py +19 -0
  69. intentumdiff/serve/_app.py +485 -0
  70. intentumdiff/serve/_static/index.html +326 -0
  71. intentumdiff/serve/_static/playground.js +567 -0
  72. intentumdiff/sources/__init__.py +1 -0
  73. intentumdiff/sources/base.py +28 -0
  74. intentumdiff/sources/file_source.py +48 -0
  75. intentumdiff/sources/git_source.py +375 -0
  76. intentumdiff/sources/live_buffer_source.py +113 -0
  77. intentumdiff/sources/patch_source.py +126 -0
  78. intentumdiff/sources/string_source.py +44 -0
  79. intentumdiff/testing.py +165 -0
  80. intentumdiff/vcs/__init__.py +37 -0
  81. intentumdiff/vcs/_safe_path.py +50 -0
  82. intentumdiff/vcs/base.py +136 -0
  83. intentumdiff/vcs/git_backend.py +97 -0
  84. intentumdiff/vcs/git_cli.py +100 -0
  85. intentumdiff/vcs/hg_backend.py +94 -0
  86. intentumdiff/vcs/perforce_backend.py +109 -0
  87. intentumdiff/vcs/svn_backend.py +105 -0
  88. intentumdiff/wasm/.gitkeep +2 -0
  89. intentumdiff/wasm/abap_parser.wasm +0 -0
  90. intentumdiff/wasm/adf_parser.wasm +0 -0
  91. intentumdiff/wasm/asciidoc_parser.wasm +0 -0
  92. intentumdiff/wasm/asm_parser.wasm +0 -0
  93. intentumdiff/wasm/assemblyscript_parser.wasm +0 -0
  94. intentumdiff/wasm/astro_parser.wasm +0 -0
  95. intentumdiff/wasm/bash_parser.wasm +0 -0
  96. intentumdiff/wasm/clojure_parser.wasm +0 -0
  97. intentumdiff/wasm/cmake_parser.wasm +0 -0
  98. intentumdiff/wasm/cpp_parser.wasm +0 -0
  99. intentumdiff/wasm/csharp_parser.wasm +0 -0
  100. intentumdiff/wasm/css_parser.wasm +0 -0
  101. intentumdiff/wasm/dart_parser.wasm +0 -0
  102. intentumdiff/wasm/databricks_parser.wasm +0 -0
  103. intentumdiff/wasm/dax_parser.wasm +0 -0
  104. intentumdiff/wasm/delphi_parser.wasm +0 -0
  105. intentumdiff/wasm/dockerfile_parser.wasm +0 -0
  106. intentumdiff/wasm/elixir_parser.wasm +0 -0
  107. intentumdiff/wasm/freebasic_parser.wasm +0 -0
  108. intentumdiff/wasm/generic_parser.wasm +0 -0
  109. intentumdiff/wasm/gitignore_parser.wasm +0 -0
  110. intentumdiff/wasm/go_parser.wasm +0 -0
  111. intentumdiff/wasm/gomod_parser.wasm +0 -0
  112. intentumdiff/wasm/graphql_parser.wasm +0 -0
  113. intentumdiff/wasm/groovy_parser.wasm +0 -0
  114. intentumdiff/wasm/haskell_parser.wasm +0 -0
  115. intentumdiff/wasm/html_parser.wasm +0 -0
  116. intentumdiff/wasm/ini_parser.wasm +0 -0
  117. intentumdiff/wasm/java_parser.wasm +0 -0
  118. intentumdiff/wasm/js_ts_parser.wasm +0 -0
  119. intentumdiff/wasm/json_parser.wasm +0 -0
  120. intentumdiff/wasm/kotlin_parser.wasm +0 -0
  121. intentumdiff/wasm/latex_parser.wasm +0 -0
  122. intentumdiff/wasm/lua_parser.wasm +0 -0
  123. intentumdiff/wasm/make_parser.wasm +0 -0
  124. intentumdiff/wasm/markdown_parser.wasm +0 -0
  125. intentumdiff/wasm/mdx_parser.wasm +0 -0
  126. intentumdiff/wasm/ocaml_parser.wasm +0 -0
  127. intentumdiff/wasm/odin_parser.wasm +0 -0
  128. intentumdiff/wasm/parser_manifest.json +590 -0
  129. intentumdiff/wasm/perl_parser.wasm +0 -0
  130. intentumdiff/wasm/php_parser.wasm +0 -0
  131. intentumdiff/wasm/plsql_parser.wasm +0 -0
  132. intentumdiff/wasm/po_parser.wasm +0 -0
  133. intentumdiff/wasm/postscript_parser.wasm +0 -0
  134. intentumdiff/wasm/powershell_parser.wasm +0 -0
  135. intentumdiff/wasm/proto_parser.wasm +0 -0
  136. intentumdiff/wasm/puppet_parser.wasm +0 -0
  137. intentumdiff/wasm/python_parser.wasm +0 -0
  138. intentumdiff/wasm/qsharp_parser.wasm +0 -0
  139. intentumdiff/wasm/r_parser.wasm +0 -0
  140. intentumdiff/wasm/reasonml_parser.wasm +0 -0
  141. intentumdiff/wasm/ruby_parser.wasm +0 -0
  142. intentumdiff/wasm/rust_parser.wasm +0 -0
  143. intentumdiff/wasm/sas_parser.wasm +0 -0
  144. intentumdiff/wasm/scala_parser.wasm +0 -0
  145. intentumdiff/wasm/scss_parser.wasm +0 -0
  146. intentumdiff/wasm/sql_parser.wasm +0 -0
  147. intentumdiff/wasm/squirrel_parser.wasm +0 -0
  148. intentumdiff/wasm/svelte_parser.wasm +0 -0
  149. intentumdiff/wasm/swift_parser.wasm +0 -0
  150. intentumdiff/wasm/terraform_parser.wasm +0 -0
  151. intentumdiff/wasm/toml_parser.wasm +0 -0
  152. intentumdiff/wasm/tsql_parser.wasm +0 -0
  153. intentumdiff/wasm/vbnet_parser.wasm +0 -0
  154. intentumdiff/wasm/vue_parser.wasm +0 -0
  155. intentumdiff/wasm/wat_parser.wasm +0 -0
  156. intentumdiff/wasm/xml_parser.wasm +0 -0
  157. intentumdiff/wasm/yaml_parser.wasm +0 -0
  158. intentumdiff/wasm/zig_parser.wasm +0 -0
  159. intentumdiff/watcher.py +259 -0
  160. intentumdiff_python-0.0.1.dist-info/METADATA +112 -0
  161. intentumdiff_python-0.0.1.dist-info/RECORD +165 -0
  162. intentumdiff_python-0.0.1.dist-info/WHEEL +4 -0
  163. intentumdiff_python-0.0.1.dist-info/entry_points.txt +80 -0
  164. intentumdiff_python-0.0.1.dist-info/licenses/LICENSE +21 -0
  165. intentumdiff_python-0.0.1.dist-info/sboms/intentumdiff-rust-core.cyclonedx.json +10968 -0
@@ -0,0 +1,351 @@
1
+ /// intentumdiff Plugin Interface v1.0.0
2
+ ///
3
+ /// This WIT file is the SOLE contract between the host (Python runtime) and
4
+ /// any plugin (parser or renderer), regardless of what language the plugin is
5
+ /// written in. Use `wit-bindgen` to generate host or guest bindings.
6
+ ///
7
+ /// Worlds
8
+ /// ──────
9
+ /// parser-plugin — implement a parser (full-parse mode for new parsers)
10
+ /// renderer-plugin — implement a renderer
11
+ ///
12
+ /// Host imports
13
+ /// ────────────
14
+ /// The host exposes three utilities via `host-utils`. Every world imports them
15
+ /// so plugins can call them without carrying their own implementations.
16
+
17
+ package intentdiff:plugin@1.0.0;
18
+
19
+ // ---------------------------------------------------------------------------
20
+ // Host-provided utilities
21
+ // ---------------------------------------------------------------------------
22
+
23
+ /// Functions implemented by the Python host and imported by every plugin.
24
+ /// All I/O through these functions is the only outside-world contact a plugin
25
+ /// has — the Wasm sandbox grants zero WASI capabilities.
26
+ interface host-utils {
27
+ /// Remove trivia nodes from a CST JSON document.
28
+ ///
29
+ /// `cst-json` — the raw CST returned by `cst-serializer` (host side).
30
+ /// `trivia-types` — node type names to strip, e.g. ["comment", "whitespace"].
31
+ ///
32
+ /// Returns the filtered CST JSON string.
33
+ strip-trivia: func(cst-json: string, trivia-types: list<string>) -> string;
34
+
35
+ /// Compute a structural hash for a CST subtree (JSON object or array).
36
+ ///
37
+ /// Algorithm: SHA-256, identical to the host's own hash so hashes are
38
+ /// comparable across plugin boundaries.
39
+ /// leaf: sha256(type + ":" + text)
40
+ /// internal: sha256(type + "|" + join("|", map(hash, children)))
41
+ ///
42
+ /// Returns a lowercase hex string.
43
+ structural-hash: func(cst-json: string) -> string;
44
+
45
+ /// Emit a log message that the host routes to its logging subsystem.
46
+ ///
47
+ /// `level` — one of "trace", "debug", "info", "warn", "error".
48
+ log: func(level: string, message: string);
49
+ }
50
+
51
+ // ---------------------------------------------------------------------------
52
+ // Parser interface
53
+ // ---------------------------------------------------------------------------
54
+
55
+ /// Implemented and exported by parser plugins.
56
+ interface parser {
57
+ /// Declares how a parser plugin receives source input.
58
+ enum parser-mode {
59
+ /// Legacy compatibility mode. The host parses the source file and
60
+ /// passes CST JSON to `process`.
61
+ ///
62
+ /// New first-party and third-party parser plugins must use
63
+ /// `full-parse`. Product parser paths reject `interpret-cst` so the
64
+ /// engine boundary stays Rust/Wasm-owned.
65
+ interpret-cst,
66
+
67
+ /// The plugin receives raw source text and is responsible for parsing it
68
+ /// entirely on its own, usually with a Rust parser or tree-sitter grammar
69
+ /// compiled into the .wasm binary. This is the recommended and supported
70
+ /// mode for parser plugins.
71
+ full-parse,
72
+ }
73
+
74
+ /// Return the parsing mode for this plugin.
75
+ get-parser-mode: func() -> parser-mode;
76
+
77
+ /// A short unique identifier for the grammar, e.g. "python", "sql",
78
+ /// "solidity". Must be lowercase, ASCII, no spaces.
79
+ grammar-id: func() -> string;
80
+
81
+ /// Given a filename and a snippet of content, return a language hint
82
+ /// string (e.g. "python") or an empty string if this plugin cannot
83
+ /// handle the file. The host calls this for every registered parser
84
+ /// in priority order. This is also the source of truth for the
85
+ /// playground /detect API; browser clients must not duplicate parser
86
+ /// language heuristics.
87
+ detect-language: func(filename: string, content: string) -> string;
88
+
89
+ /// Transform the input into a SemanticTree JSON string.
90
+ ///
91
+ /// `input` — raw source (full-parse) or CST JSON (legacy interpret-cst).
92
+ /// `language` — language hint from `detect-language`.
93
+ /// `filename` — original filename (for diagnostics).
94
+ ///
95
+ /// Returns a JSON string conforming to the `SemanticTree` schema.
96
+ /// On error, return a JSON object with a top-level `"error"` key.
97
+ process: func(input: string, language: string, filename: string) -> string;
98
+
99
+ /// Return the list of CST node type names this plugin considers trivia
100
+ /// (comments, whitespace, semicolons, …). The host calls `strip-trivia`
101
+ /// with this list before diffing.
102
+ trivia-node-types: func() -> list<string>;
103
+
104
+ /// All language IDs this plugin can handle. This is the source of truth
105
+ /// for the playground /languages API.
106
+ language-ids: func() -> list<string>;
107
+
108
+ /// Rich language metadata for playgrounds and API clients.
109
+ ///
110
+ /// This is the source of truth for editor language modes, default
111
+ /// filenames, file extensions, display names, plugin author metadata, and
112
+ /// the playground /language-info API. It must include one record for every
113
+ /// value returned by `language-ids`.
114
+ language-info: func() -> list<language-info-record>;
115
+
116
+ /// Dispatch priority. Higher values win when multiple plugins claim the
117
+ /// same language. Built-in parsers use 0. Third-party plugins should
118
+ /// use 1 or higher to override built-ins.
119
+ priority: func() -> s32;
120
+
121
+ /// Optional source transformation applied before parser processing.
122
+ ///
123
+ /// Plugins that do not need any source transformation must return
124
+ /// ``source`` unchanged.
125
+ ///
126
+ /// Primary use-case: the dbt parser strips Jinja2 template expressions and
127
+ /// replaces them with SQL-valid placeholder identifiers (e.g.
128
+ /// ``dbt_ref__orders``) so that tree-sitter produces a clean AST. The
129
+ /// dbt enricher plugin later decodes the placeholders and injects proper
130
+ /// ``jinja_ref`` / ``jinja_source`` semantic nodes.
131
+ preprocess-source: func(source: string) -> string;
132
+
133
+ /// Return a before/after source-code example for *language*.
134
+ /// This is the source of truth for the playground /example/{language} API.
135
+ ///
136
+ /// The `language` argument matches one of the values returned by
137
+ /// `language-ids`. Both `old` and `new` must be non-empty and show a
138
+ /// meaningful semantic change (e.g. a refactoring or feature addition).
139
+ example: func(language: string) -> example-pair;
140
+
141
+ /// A before/after source-code example pair.
142
+ record example-pair {
143
+ old: string,
144
+ new: string,
145
+ }
146
+
147
+ /// Metadata for one language ID exposed by this parser plugin.
148
+ record language-info-record {
149
+ language-id: string,
150
+ language-name: string,
151
+ language-short-name: string,
152
+ monaco-language: string,
153
+ default-filename: string,
154
+ language-file-extensions: list<string>,
155
+ author: string,
156
+ plugin-version: string,
157
+ last-updated: string,
158
+ }
159
+ }
160
+
161
+ // ---------------------------------------------------------------------------
162
+ // Enricher interface
163
+ // ---------------------------------------------------------------------------
164
+
165
+ /// Implemented and exported by enricher plugins.
166
+ ///
167
+ /// An enricher runs after the base parser and receives both the
168
+ /// already-parsed SemanticNode tree (as JSON) and the original raw source.
169
+ /// It may inject, modify, or annotate nodes and must return the updated
170
+ /// tree as JSON.
171
+ ///
172
+ /// Enrichers enable composable plugins: the dbt enricher injects
173
+ /// ``jinja_ref``, ``jinja_source``, and ``macro_def`` nodes into an
174
+ /// existing SQL SemanticNode tree without reimplementing SQL parsing.
175
+ interface enricher {
176
+ /// Enrich a SemanticNode tree with additional semantic information.
177
+ ///
178
+ /// ``semantic-tree-json`` — JSON string of the SemanticNode tree produced
179
+ /// by the base parser's ``process`` function.
180
+ /// ``raw-source`` — original (un-preprocessed) source text.
181
+ /// ``language`` — the language ID that selected this enricher.
182
+ /// ``filename`` — original filename (for diagnostics).
183
+ ///
184
+ /// Returns an updated SemanticNode tree JSON string.
185
+ /// On error, return ``semantic-tree-json`` unchanged so the pipeline
186
+ /// can continue without enrichment.
187
+ enrich: func(semantic-tree-json: string, raw-source: string, language: string, filename: string) -> string;
188
+
189
+ /// Language IDs this enricher handles (same vocabulary as parser language-ids).
190
+ language-ids: func() -> list<string>;
191
+
192
+ /// Dispatch priority; same semantics as ``parser.priority``.
193
+ priority: func() -> s32;
194
+ }
195
+
196
+ // ---------------------------------------------------------------------------
197
+ // Renderer interface
198
+ // ---------------------------------------------------------------------------
199
+
200
+ /// Implemented and exported by renderer plugins.
201
+ interface renderer {
202
+ /// Human-readable format name, e.g. "terminal", "html", "patch".
203
+ format-name: func() -> string;
204
+
205
+ /// Render a `SemanticDiff` JSON string into the target format.
206
+ ///
207
+ /// `diff-json` — a JSON string conforming to the `SemanticDiff` schema.
208
+ ///
209
+ /// Returns the rendered output as a string (ANSI, HTML, unified diff, …).
210
+ render: func(diff-json: string) -> string;
211
+
212
+ /// List of option keys this renderer accepts (for documentation / UIs).
213
+ supported-options: func() -> list<string>;
214
+
215
+ /// Dispatch priority; same semantics as `parser.priority`.
216
+ priority: func() -> s32;
217
+ }
218
+
219
+ // ---------------------------------------------------------------------------
220
+ // Worlds
221
+ // ---------------------------------------------------------------------------
222
+
223
+ /// World that a parser plugin must satisfy.
224
+ world parser-plugin {
225
+ /// Access host utilities.
226
+ import host-utils;
227
+ /// Expose the parser implementation.
228
+ export parser;
229
+ }
230
+
231
+ /// World that a renderer plugin must satisfy.
232
+ world renderer-plugin {
233
+ /// Access host utilities.
234
+ import host-utils;
235
+ /// Expose the renderer implementation.
236
+ export renderer;
237
+ }
238
+
239
+ /// World that an enricher plugin must satisfy.
240
+ world enricher-plugin {
241
+ /// Access host utilities.
242
+ import host-utils;
243
+ /// Expose the enricher implementation.
244
+ export enricher;
245
+ }
246
+
247
+ // ---------------------------------------------------------------------------
248
+ // Index-engine interface
249
+ // ---------------------------------------------------------------------------
250
+
251
+ /// Implemented and exported by the index-engine plugin.
252
+ ///
253
+ /// The index engine builds and diffs symbol tables across multiple files,
254
+ /// enabling cross-file semantic analysis (MOVE_TO_MODULE, CROSS_FILE_RENAME,
255
+ /// SPLIT_MODULE).
256
+ /// It is the hot path for the ``SemanticIndex`` Python host API.
257
+ interface index-engine {
258
+ /// Build a symbol table from a set of parsed files.
259
+ ///
260
+ /// ``files-json`` — JSON array of objects, each with shape:
261
+ /// { "filename": str, "language": str, "tree": SemanticNode }
262
+ ///
263
+ /// Returns a ``SymbolTable`` JSON object:
264
+ /// { "<qualified_name>": [{ "file": str, "node_type": str,
265
+ /// "node_id": str, "start_line": u32,
266
+ /// "start_col": u32, "end_line": u32,
267
+ /// "end_col": u32 }] }
268
+ ///
269
+ /// On error, returns a JSON object with a top-level ``"error"`` key.
270
+ build-symbol-table: func(files-json: string) -> string;
271
+
272
+ /// Compare two symbol tables and detect cross-file movements.
273
+ ///
274
+ /// ``old-json`` / ``new-json`` — ``SymbolTable`` JSON as returned by
275
+ /// ``build-symbol-table``.
276
+ ///
277
+ /// Returns a JSON array of ``CrossFileChange`` objects:
278
+ /// [{ "change_type": "MOVE_TO_MODULE" | "CROSS_FILE_RENAME" | "SPLIT_MODULE",
279
+ /// "old_file": str, "new_file": str, "symbol_name": str,
280
+ /// "old_node_id": str | null, "new_node_id": str | null,
281
+ /// "confidence": f64, "description": str }]
282
+ diff-symbol-tables: func(old-json: string, new-json: string) -> string;
283
+
284
+ /// Build a reference table (call-sites and import usages) from a set of
285
+ /// parsed files.
286
+ ///
287
+ /// ``files-json`` — same input format as ``build-symbol-table``:
288
+ /// JSON array of { "filename": str, "language": str, "tree": SemanticNode }
289
+ ///
290
+ /// Returns a ``ReferenceTable`` JSON object:
291
+ /// { "<label>": [{ "qualified_name": str, "file": str, "node_id": str,
292
+ /// "reference_kind": "CALL" | "IMPORT" | "TYPE_USAGE",
293
+ /// "position": { "start_line": u32, "start_col": u32,
294
+ /// "end_line": u32, "end_col": u32 },
295
+ /// "language": str, "enclosing_scope": str | null }] }
296
+ ///
297
+ /// On error, returns a JSON object with a top-level ``"error"`` key.
298
+ build-reference-table: func(files-json: string) -> string;
299
+ }
300
+
301
+ /// World that an index-engine plugin must satisfy.
302
+ world index-engine-plugin {
303
+ /// Access host utilities.
304
+ import host-utils;
305
+ /// Expose the index engine implementation.
306
+ export index-engine;
307
+ }
308
+
309
+ // ---------------------------------------------------------------------------
310
+ // Diff-analyzer interface
311
+ // ---------------------------------------------------------------------------
312
+
313
+ /// Implemented and exported by diff-analyzer plugins.
314
+ ///
315
+ /// A diff analyzer runs after the classification stage and receives the
316
+ /// complete SemanticDiff JSON for a single file. It may add, modify, or
317
+ /// annotate Change objects — including emitting custom language-specific
318
+ /// change_type strings (e.g. "SQL_RENAME_TABLE", "GO_INTERFACE_CHANGE").
319
+ ///
320
+ /// Diff analyzers enable language-specific post-processing without
321
+ /// modifying the core diff engine. They are discovered via the
322
+ /// ``intentumdiff.diff_analyzers`` entry-point group.
323
+ interface diff-analyzer {
324
+ /// Analyze a completed SemanticDiff and return an updated version.
325
+ ///
326
+ /// ``diff-json`` — JSON string of the SemanticDiff produced by the
327
+ /// classification stage.
328
+ /// ``language`` — the language ID of the file being analyzed.
329
+ /// ``filename`` — original filename (for diagnostics).
330
+ ///
331
+ /// Returns an updated SemanticDiff JSON string with any additional or
332
+ /// modified Change objects. Return ``diff-json`` unchanged if no
333
+ /// language-specific changes apply.
334
+ /// On error, return ``diff-json`` unchanged so the pipeline continues.
335
+ analyze-diff: func(diff-json: string, language: string, filename: string) -> string;
336
+
337
+ /// Language IDs this analyzer handles (same vocabulary as parser language-ids).
338
+ language-ids: func() -> list<string>;
339
+
340
+ /// Dispatch priority; same semantics as ``parser.priority``.
341
+ /// Higher values run first. Analyzers are chained in priority order.
342
+ priority: func() -> s32;
343
+ }
344
+
345
+ /// World that a diff-analyzer plugin must satisfy.
346
+ world diff-analyzer-plugin {
347
+ /// Access host utilities.
348
+ import host-utils;
349
+ /// Expose the diff analyzer implementation.
350
+ export diff-analyzer;
351
+ }