@domainlang/language 0.1.20

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 (212) hide show
  1. package/README.md +163 -0
  2. package/out/ast-augmentation.d.ts +6 -0
  3. package/out/ast-augmentation.js +2 -0
  4. package/out/ast-augmentation.js.map +1 -0
  5. package/out/domain-lang-module.d.ts +57 -0
  6. package/out/domain-lang-module.js +67 -0
  7. package/out/domain-lang-module.js.map +1 -0
  8. package/out/generated/ast.d.ts +759 -0
  9. package/out/generated/ast.js +556 -0
  10. package/out/generated/ast.js.map +1 -0
  11. package/out/generated/grammar.d.ts +6 -0
  12. package/out/generated/grammar.js +2407 -0
  13. package/out/generated/grammar.js.map +1 -0
  14. package/out/generated/module.d.ts +13 -0
  15. package/out/generated/module.js +21 -0
  16. package/out/generated/module.js.map +1 -0
  17. package/out/index.d.ts +16 -0
  18. package/out/index.js +22 -0
  19. package/out/index.js.map +1 -0
  20. package/out/lsp/domain-lang-code-actions.d.ts +55 -0
  21. package/out/lsp/domain-lang-code-actions.js +143 -0
  22. package/out/lsp/domain-lang-code-actions.js.map +1 -0
  23. package/out/lsp/domain-lang-completion.d.ts +37 -0
  24. package/out/lsp/domain-lang-completion.js +452 -0
  25. package/out/lsp/domain-lang-completion.js.map +1 -0
  26. package/out/lsp/domain-lang-formatter.d.ts +15 -0
  27. package/out/lsp/domain-lang-formatter.js +43 -0
  28. package/out/lsp/domain-lang-formatter.js.map +1 -0
  29. package/out/lsp/domain-lang-naming.d.ts +34 -0
  30. package/out/lsp/domain-lang-naming.js +49 -0
  31. package/out/lsp/domain-lang-naming.js.map +1 -0
  32. package/out/lsp/domain-lang-scope.d.ts +59 -0
  33. package/out/lsp/domain-lang-scope.js +102 -0
  34. package/out/lsp/domain-lang-scope.js.map +1 -0
  35. package/out/lsp/domain-lang-workspace-manager.d.ts +21 -0
  36. package/out/lsp/domain-lang-workspace-manager.js +93 -0
  37. package/out/lsp/domain-lang-workspace-manager.js.map +1 -0
  38. package/out/lsp/hover/ddd-pattern-explanations.d.ts +50 -0
  39. package/out/lsp/hover/ddd-pattern-explanations.js +196 -0
  40. package/out/lsp/hover/ddd-pattern-explanations.js.map +1 -0
  41. package/out/lsp/hover/domain-lang-hover.d.ts +19 -0
  42. package/out/lsp/hover/domain-lang-hover.js +302 -0
  43. package/out/lsp/hover/domain-lang-hover.js.map +1 -0
  44. package/out/lsp/hover/domain-lang-keywords.d.ts +13 -0
  45. package/out/lsp/hover/domain-lang-keywords.js +47 -0
  46. package/out/lsp/hover/domain-lang-keywords.js.map +1 -0
  47. package/out/lsp/manifest-diagnostics.d.ts +82 -0
  48. package/out/lsp/manifest-diagnostics.js +230 -0
  49. package/out/lsp/manifest-diagnostics.js.map +1 -0
  50. package/out/main-browser.d.ts +1 -0
  51. package/out/main-browser.js +11 -0
  52. package/out/main-browser.js.map +1 -0
  53. package/out/main.d.ts +1 -0
  54. package/out/main.js +74 -0
  55. package/out/main.js.map +1 -0
  56. package/out/sdk/ast-augmentation.d.ts +136 -0
  57. package/out/sdk/ast-augmentation.js +62 -0
  58. package/out/sdk/ast-augmentation.js.map +1 -0
  59. package/out/sdk/index.d.ts +94 -0
  60. package/out/sdk/index.js +97 -0
  61. package/out/sdk/index.js.map +1 -0
  62. package/out/sdk/indexes.d.ts +16 -0
  63. package/out/sdk/indexes.js +97 -0
  64. package/out/sdk/indexes.js.map +1 -0
  65. package/out/sdk/loader-node.d.ts +51 -0
  66. package/out/sdk/loader-node.js +119 -0
  67. package/out/sdk/loader-node.js.map +1 -0
  68. package/out/sdk/loader.d.ts +49 -0
  69. package/out/sdk/loader.js +85 -0
  70. package/out/sdk/loader.js.map +1 -0
  71. package/out/sdk/patterns.d.ts +93 -0
  72. package/out/sdk/patterns.js +123 -0
  73. package/out/sdk/patterns.js.map +1 -0
  74. package/out/sdk/query.d.ts +90 -0
  75. package/out/sdk/query.js +679 -0
  76. package/out/sdk/query.js.map +1 -0
  77. package/out/sdk/resolution.d.ts +52 -0
  78. package/out/sdk/resolution.js +68 -0
  79. package/out/sdk/resolution.js.map +1 -0
  80. package/out/sdk/types.d.ts +280 -0
  81. package/out/sdk/types.js +8 -0
  82. package/out/sdk/types.js.map +1 -0
  83. package/out/services/dependency-analyzer.d.ts +58 -0
  84. package/out/services/dependency-analyzer.js +254 -0
  85. package/out/services/dependency-analyzer.js.map +1 -0
  86. package/out/services/dependency-resolver.d.ts +146 -0
  87. package/out/services/dependency-resolver.js +452 -0
  88. package/out/services/dependency-resolver.js.map +1 -0
  89. package/out/services/git-url-resolver.browser.d.ts +10 -0
  90. package/out/services/git-url-resolver.browser.js +19 -0
  91. package/out/services/git-url-resolver.browser.js.map +1 -0
  92. package/out/services/git-url-resolver.d.ts +158 -0
  93. package/out/services/git-url-resolver.js +416 -0
  94. package/out/services/git-url-resolver.js.map +1 -0
  95. package/out/services/governance-validator.d.ts +44 -0
  96. package/out/services/governance-validator.js +153 -0
  97. package/out/services/governance-validator.js.map +1 -0
  98. package/out/services/import-resolver.d.ts +77 -0
  99. package/out/services/import-resolver.js +240 -0
  100. package/out/services/import-resolver.js.map +1 -0
  101. package/out/services/performance-optimizer.d.ts +60 -0
  102. package/out/services/performance-optimizer.js +140 -0
  103. package/out/services/performance-optimizer.js.map +1 -0
  104. package/out/services/relationship-inference.d.ts +11 -0
  105. package/out/services/relationship-inference.js +98 -0
  106. package/out/services/relationship-inference.js.map +1 -0
  107. package/out/services/semver.d.ts +98 -0
  108. package/out/services/semver.js +195 -0
  109. package/out/services/semver.js.map +1 -0
  110. package/out/services/types.d.ts +340 -0
  111. package/out/services/types.js +46 -0
  112. package/out/services/types.js.map +1 -0
  113. package/out/services/workspace-manager.d.ts +123 -0
  114. package/out/services/workspace-manager.js +489 -0
  115. package/out/services/workspace-manager.js.map +1 -0
  116. package/out/syntaxes/domain-lang.monarch.d.ts +76 -0
  117. package/out/syntaxes/domain-lang.monarch.js +29 -0
  118. package/out/syntaxes/domain-lang.monarch.js.map +1 -0
  119. package/out/utils/import-utils.d.ts +49 -0
  120. package/out/utils/import-utils.js +128 -0
  121. package/out/utils/import-utils.js.map +1 -0
  122. package/out/validation/bounded-context.d.ts +11 -0
  123. package/out/validation/bounded-context.js +79 -0
  124. package/out/validation/bounded-context.js.map +1 -0
  125. package/out/validation/classification.d.ts +3 -0
  126. package/out/validation/classification.js +3 -0
  127. package/out/validation/classification.js.map +1 -0
  128. package/out/validation/constants.d.ts +180 -0
  129. package/out/validation/constants.js +235 -0
  130. package/out/validation/constants.js.map +1 -0
  131. package/out/validation/domain-lang-validator.d.ts +2 -0
  132. package/out/validation/domain-lang-validator.js +27 -0
  133. package/out/validation/domain-lang-validator.js.map +1 -0
  134. package/out/validation/domain.d.ts +11 -0
  135. package/out/validation/domain.js +63 -0
  136. package/out/validation/domain.js.map +1 -0
  137. package/out/validation/import.d.ts +68 -0
  138. package/out/validation/import.js +237 -0
  139. package/out/validation/import.js.map +1 -0
  140. package/out/validation/manifest.d.ts +144 -0
  141. package/out/validation/manifest.js +327 -0
  142. package/out/validation/manifest.js.map +1 -0
  143. package/out/validation/maps.d.ts +21 -0
  144. package/out/validation/maps.js +60 -0
  145. package/out/validation/maps.js.map +1 -0
  146. package/out/validation/metadata.d.ts +7 -0
  147. package/out/validation/metadata.js +16 -0
  148. package/out/validation/metadata.js.map +1 -0
  149. package/out/validation/model.d.ts +12 -0
  150. package/out/validation/model.js +29 -0
  151. package/out/validation/model.js.map +1 -0
  152. package/out/validation/relationships.d.ts +12 -0
  153. package/out/validation/relationships.js +94 -0
  154. package/out/validation/relationships.js.map +1 -0
  155. package/out/validation/shared.d.ts +6 -0
  156. package/out/validation/shared.js +12 -0
  157. package/out/validation/shared.js.map +1 -0
  158. package/package.json +110 -0
  159. package/src/ast-augmentation.ts +5 -0
  160. package/src/domain-lang-module.ts +112 -0
  161. package/src/domain-lang.langium +351 -0
  162. package/src/generated/ast.ts +986 -0
  163. package/src/generated/grammar.ts +2409 -0
  164. package/src/generated/module.ts +25 -0
  165. package/src/index.ts +24 -0
  166. package/src/lsp/domain-lang-code-actions.ts +189 -0
  167. package/src/lsp/domain-lang-completion.ts +514 -0
  168. package/src/lsp/domain-lang-formatter.ts +51 -0
  169. package/src/lsp/domain-lang-naming.ts +56 -0
  170. package/src/lsp/domain-lang-scope.ts +137 -0
  171. package/src/lsp/domain-lang-workspace-manager.ts +104 -0
  172. package/src/lsp/hover/ddd-pattern-explanations.ts +237 -0
  173. package/src/lsp/hover/domain-lang-hover.ts +338 -0
  174. package/src/lsp/hover/domain-lang-keywords.ts +50 -0
  175. package/src/lsp/manifest-diagnostics.ts +290 -0
  176. package/src/main-browser.ts +15 -0
  177. package/src/main.ts +85 -0
  178. package/src/sdk/README.md +297 -0
  179. package/src/sdk/ast-augmentation.ts +157 -0
  180. package/src/sdk/index.ts +126 -0
  181. package/src/sdk/indexes.ts +155 -0
  182. package/src/sdk/loader-node.ts +146 -0
  183. package/src/sdk/loader.ts +99 -0
  184. package/src/sdk/patterns.ts +147 -0
  185. package/src/sdk/query.ts +802 -0
  186. package/src/sdk/resolution.ts +78 -0
  187. package/src/sdk/types.ts +323 -0
  188. package/src/services/dependency-analyzer.ts +321 -0
  189. package/src/services/dependency-resolver.ts +551 -0
  190. package/src/services/git-url-resolver.browser.ts +26 -0
  191. package/src/services/git-url-resolver.ts +517 -0
  192. package/src/services/governance-validator.ts +177 -0
  193. package/src/services/import-resolver.ts +292 -0
  194. package/src/services/performance-optimizer.ts +170 -0
  195. package/src/services/relationship-inference.ts +121 -0
  196. package/src/services/semver.ts +213 -0
  197. package/src/services/types.ts +415 -0
  198. package/src/services/workspace-manager.ts +607 -0
  199. package/src/syntaxes/domain-lang.monarch.ts +29 -0
  200. package/src/utils/import-utils.ts +152 -0
  201. package/src/validation/bounded-context.ts +99 -0
  202. package/src/validation/classification.ts +5 -0
  203. package/src/validation/constants.ts +304 -0
  204. package/src/validation/domain-lang-validator.ts +33 -0
  205. package/src/validation/domain.ts +77 -0
  206. package/src/validation/import.ts +295 -0
  207. package/src/validation/manifest.ts +439 -0
  208. package/src/validation/maps.ts +76 -0
  209. package/src/validation/metadata.ts +18 -0
  210. package/src/validation/model.ts +37 -0
  211. package/src/validation/relationships.ts +154 -0
  212. package/src/validation/shared.ts +14 -0
@@ -0,0 +1,986 @@
1
+ /******************************************************************************
2
+ * This file was generated by langium-cli 4.2.0.
3
+ * DO NOT EDIT MANUALLY!
4
+ ******************************************************************************/
5
+
6
+ /* eslint-disable */
7
+ import * as langium from 'langium';
8
+
9
+ export const DomainLangTerminals = {
10
+ WS: /\s+/,
11
+ ID: /[_a-zA-Z][\w_-]*/,
12
+ STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,
13
+ ML_COMMENT: /\/\*[\s\S]*?\*\//,
14
+ SL_COMMENT: /\/\/[^\n\r]*/,
15
+ };
16
+
17
+ export type DomainLangTerminalNames = keyof typeof DomainLangTerminals;
18
+
19
+ export type DomainLangKeywordNames =
20
+ | ","
21
+ | "->"
22
+ | "."
23
+ | ":"
24
+ | "<-"
25
+ | "<->"
26
+ | "="
27
+ | "><"
28
+ | "ACL"
29
+ | "AntiCorruptionLayer"
30
+ | "BBoM"
31
+ | "BigBallOfMud"
32
+ | "BoundedContext"
33
+ | "CF"
34
+ | "Classification"
35
+ | "Conformist"
36
+ | "ContextMap"
37
+ | "CustomerSupplier"
38
+ | "Decision"
39
+ | "Domain"
40
+ | "DomainMap"
41
+ | "Import"
42
+ | "Metadata"
43
+ | "Namespace"
44
+ | "OHS"
45
+ | "OpenHostService"
46
+ | "P"
47
+ | "PL"
48
+ | "Partnership"
49
+ | "Policy"
50
+ | "PublishedLanguage"
51
+ | "Rule"
52
+ | "SK"
53
+ | "SeparateWays"
54
+ | "SharedKernel"
55
+ | "Team"
56
+ | "Term"
57
+ | "UpstreamDownstream"
58
+ | "["
59
+ | "]"
60
+ | "aka"
61
+ | "archetype"
62
+ | "as"
63
+ | "bc"
64
+ | "businessModel"
65
+ | "by"
66
+ | "classification"
67
+ | "cmap"
68
+ | "contains"
69
+ | "decision"
70
+ | "decisions"
71
+ | "description"
72
+ | "dmap"
73
+ | "dom"
74
+ | "evolution"
75
+ | "examples"
76
+ | "for"
77
+ | "glossary"
78
+ | "import"
79
+ | "in"
80
+ | "integrations"
81
+ | "is"
82
+ | "meta"
83
+ | "metadata"
84
+ | "ns"
85
+ | "policy"
86
+ | "relationships"
87
+ | "rule"
88
+ | "rules"
89
+ | "synonyms"
90
+ | "team"
91
+ | "term"
92
+ | "terminology"
93
+ | "this"
94
+ | "type"
95
+ | "vision"
96
+ | "{"
97
+ | "}";
98
+
99
+ export type DomainLangTokenNames = DomainLangTerminalNames | DomainLangKeywordNames;
100
+
101
+ /**
102
+ * Decisions, Policies, and Business Rules.
103
+ * All types are interchangeable - use what reads best for your domain.
104
+ */
105
+ export type AbstractDecision = BusinessRule | Decision | Policy;
106
+
107
+ export const AbstractDecision = {
108
+ $type: 'AbstractDecision'
109
+ } as const;
110
+
111
+ export function isAbstractDecision(item: unknown): item is AbstractDecision {
112
+ return reflection.isInstance(item, AbstractDecision.$type);
113
+ }
114
+
115
+ /**
116
+ * Assignment operators - flexible syntax.
117
+ */
118
+ export type Assignment = ':' | '=' | 'is';
119
+
120
+ export function isAssignment(item: unknown): item is Assignment {
121
+ return item === ':' || item === 'is' || item === '=';
122
+ }
123
+
124
+ /**
125
+ * Bounded Context - A boundary within which a domain model is defined.
126
+ * Central pattern in DDD for managing complexity and team boundaries.
127
+ * Belongs to exactly ONE domain (fundamental DDD principle).
128
+ * Body properties can appear in any order. Validation enforces at-most-once constraint.
129
+ * The `classification` property indicates strategic importance per Bounded Context Canvas.
130
+ * The `evolution` property indicates maturity stage per Wardley Maps/BC Canvas.
131
+ * The `archetype` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).
132
+ */
133
+ export interface BoundedContext extends langium.AstNode {
134
+ readonly $container: Model | NamespaceDeclaration;
135
+ readonly $type: 'Assignment' | 'BoundedContext';
136
+ archetype?: langium.Reference<Classification>;
137
+ businessModel?: langium.Reference<Classification>;
138
+ classification: Array<langium.Reference<Classification>>;
139
+ decisions: Array<AbstractDecision>;
140
+ description?: string;
141
+ domain?: langium.Reference<Domain>;
142
+ evolution?: langium.Reference<Classification>;
143
+ metadata: Array<MetadataEntry>;
144
+ name: string;
145
+ relationships: Array<Relationship>;
146
+ team: Array<langium.Reference<Team>>;
147
+ terminology: Array<DomainTerm>;
148
+ }
149
+
150
+ export const BoundedContext = {
151
+ $type: 'BoundedContext',
152
+ archetype: 'archetype',
153
+ businessModel: 'businessModel',
154
+ classification: 'classification',
155
+ decisions: 'decisions',
156
+ description: 'description',
157
+ domain: 'domain',
158
+ evolution: 'evolution',
159
+ metadata: 'metadata',
160
+ name: 'name',
161
+ relationships: 'relationships',
162
+ team: 'team',
163
+ terminology: 'terminology'
164
+ } as const;
165
+
166
+ export function isBoundedContext(item: unknown): item is BoundedContext {
167
+ return reflection.isInstance(item, BoundedContext.$type);
168
+ }
169
+
170
+ /**
171
+ * Context reference - can be 'this' (self-reference) or a qualified name.
172
+ */
173
+ export interface BoundedContextRef extends langium.AstNode {
174
+ readonly $type: 'BoundedContextRef' | 'ThisRef';
175
+ link?: langium.Reference<BoundedContext>;
176
+ }
177
+
178
+ export const BoundedContextRef = {
179
+ $type: 'BoundedContextRef',
180
+ link: 'link'
181
+ } as const;
182
+
183
+ export function isBoundedContextRef(item: unknown): item is BoundedContextRef {
184
+ return reflection.isInstance(item, BoundedContextRef.$type);
185
+ }
186
+
187
+ export interface BusinessRule extends langium.AstNode {
188
+ readonly $container: BoundedContext;
189
+ readonly $type: 'Assignment' | 'BusinessRule';
190
+ classification: langium.Reference<Classification>;
191
+ name: string;
192
+ value: string;
193
+ }
194
+
195
+ export const BusinessRule = {
196
+ $type: 'BusinessRule',
197
+ classification: 'classification',
198
+ name: 'name',
199
+ value: 'value'
200
+ } as const;
201
+
202
+ export function isBusinessRule(item: unknown): item is BusinessRule {
203
+ return reflection.isInstance(item, BusinessRule.$type);
204
+ }
205
+
206
+ /**
207
+ * Classification - Reusable label for categorizing elements.
208
+ * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.
209
+ */
210
+ export interface Classification extends langium.AstNode {
211
+ readonly $container: Model | NamespaceDeclaration;
212
+ readonly $type: 'Classification';
213
+ name: string;
214
+ }
215
+
216
+ export const Classification = {
217
+ $type: 'Classification',
218
+ name: 'name'
219
+ } as const;
220
+
221
+ export function isClassification(item: unknown): item is Classification {
222
+ return reflection.isInstance(item, Classification.$type);
223
+ }
224
+
225
+ export type Container = Model | NamespaceDeclaration;
226
+
227
+ export const Container = {
228
+ $type: 'Container'
229
+ } as const;
230
+
231
+ export function isContainer(item: unknown): item is Container {
232
+ return reflection.isInstance(item, Container.$type);
233
+ }
234
+
235
+ /**
236
+ * Context Map - Visualizes relationships between Bounded Contexts.
237
+ * Shows integration patterns and team interactions.
238
+ */
239
+ export interface ContextMap extends langium.AstNode {
240
+ readonly $container: Model | NamespaceDeclaration;
241
+ readonly $type: 'ContextMap';
242
+ boundedContexts: Array<langium.MultiReference<BoundedContext>>;
243
+ name: string;
244
+ relationships: Array<Relationship>;
245
+ }
246
+
247
+ export const ContextMap = {
248
+ $type: 'ContextMap',
249
+ boundedContexts: 'boundedContexts',
250
+ name: 'name',
251
+ relationships: 'relationships'
252
+ } as const;
253
+
254
+ export function isContextMap(item: unknown): item is ContextMap {
255
+ return reflection.isInstance(item, ContextMap.$type);
256
+ }
257
+
258
+ export interface Decision extends langium.AstNode {
259
+ readonly $container: BoundedContext;
260
+ readonly $type: 'Assignment' | 'Decision';
261
+ classification: langium.Reference<Classification>;
262
+ name: string;
263
+ value: string;
264
+ }
265
+
266
+ export const Decision = {
267
+ $type: 'Decision',
268
+ classification: 'classification',
269
+ name: 'name',
270
+ value: 'value'
271
+ } as const;
272
+
273
+ export function isDecision(item: unknown): item is Decision {
274
+ return reflection.isInstance(item, Decision.$type);
275
+ }
276
+
277
+ /**
278
+ * Domain - A sphere of knowledge or activity in DDD.
279
+ * Can be nested via `in` to show subdomain hierarchy.
280
+ * The `type` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.
281
+ * Body is optional - allows header-only Domain definitions.
282
+ */
283
+ export interface Domain extends langium.AstNode {
284
+ readonly $container: Model | NamespaceDeclaration;
285
+ readonly $type: 'Assignment' | 'Domain';
286
+ description?: string;
287
+ name: string;
288
+ parent?: langium.Reference<Domain>;
289
+ type?: langium.Reference<Classification>;
290
+ vision?: string;
291
+ }
292
+
293
+ export const Domain = {
294
+ $type: 'Domain',
295
+ description: 'description',
296
+ name: 'name',
297
+ parent: 'parent',
298
+ type: 'type',
299
+ vision: 'vision'
300
+ } as const;
301
+
302
+ export function isDomain(item: unknown): item is Domain {
303
+ return reflection.isInstance(item, Domain.$type);
304
+ }
305
+
306
+ /**
307
+ * Domain Map - Visualizes relationships between Domains.
308
+ * Shows high-level domain organization and subdomain structure.
309
+ */
310
+ export interface DomainMap extends langium.AstNode {
311
+ readonly $container: Model | NamespaceDeclaration;
312
+ readonly $type: 'DomainMap';
313
+ domains: Array<langium.MultiReference<Domain>>;
314
+ name: string;
315
+ }
316
+
317
+ export const DomainMap = {
318
+ $type: 'DomainMap',
319
+ domains: 'domains',
320
+ name: 'name'
321
+ } as const;
322
+
323
+ export function isDomainMap(item: unknown): item is DomainMap {
324
+ return reflection.isInstance(item, DomainMap.$type);
325
+ }
326
+
327
+ /**
328
+ * Domain Terminology - Ubiquitous language terms with definitions.
329
+ * Supports synonyms and examples for richer glossaries.
330
+ */
331
+ export interface DomainTerm extends langium.AstNode {
332
+ readonly $container: BoundedContext;
333
+ readonly $type: 'Assignment' | 'DomainTerm';
334
+ examples: Array<string>;
335
+ meaning?: string;
336
+ name: string;
337
+ synonyms: Array<string>;
338
+ }
339
+
340
+ export const DomainTerm = {
341
+ $type: 'DomainTerm',
342
+ examples: 'examples',
343
+ meaning: 'meaning',
344
+ name: 'name',
345
+ synonyms: 'synonyms'
346
+ } as const;
347
+
348
+ export function isDomainTerm(item: unknown): item is DomainTerm {
349
+ return reflection.isInstance(item, DomainTerm.$type);
350
+ }
351
+
352
+ /**
353
+ * Import Statement - Manifest-centric import system per PRS-010.
354
+ *
355
+ * Simplified syntax where import statements use short specifiers:
356
+ * - External dependencies (from manifest): import "core" as Core
357
+ * - Local files: import "./shared/types.dlang"
358
+ * - Workspace-relative: import "~/contexts/sales.dlang"
359
+ *
360
+ * All resolution details (source, version, integrity) live in model.yaml manifest.
361
+ * Named imports and inline integrity checks have been removed per PRS-010.
362
+ */
363
+ export interface ImportStatement extends langium.AstNode {
364
+ readonly $container: Model;
365
+ readonly $type: 'ImportStatement';
366
+ alias?: string;
367
+ uri: string;
368
+ }
369
+
370
+ export const ImportStatement = {
371
+ $type: 'ImportStatement',
372
+ alias: 'alias',
373
+ uri: 'uri'
374
+ } as const;
375
+
376
+ export function isImportStatement(item: unknown): item is ImportStatement {
377
+ return reflection.isInstance(item, ImportStatement.$type);
378
+ }
379
+
380
+ /**
381
+ * DDD Integration Patterns (used in relationships).
382
+ */
383
+ export type IntegrationPattern = 'ACL' | 'AntiCorruptionLayer' | 'BBoM' | 'BigBallOfMud' | 'CF' | 'Conformist' | 'OHS' | 'OpenHostService' | 'P' | 'PL' | 'Partnership' | 'PublishedLanguage' | 'SK' | 'SharedKernel';
384
+
385
+ export function isIntegrationPattern(item: unknown): item is IntegrationPattern {
386
+ return item === 'PL' || item === 'PublishedLanguage' || item === 'OHS' || item === 'OpenHostService' || item === 'CF' || item === 'Conformist' || item === 'ACL' || item === 'AntiCorruptionLayer' || item === 'P' || item === 'Partnership' || item === 'SK' || item === 'SharedKernel' || item === 'BBoM' || item === 'BigBallOfMud';
387
+ }
388
+
389
+ /**
390
+ * Metadata - Defines a key that can be used in metadata blocks.
391
+ * Examples: Language, Framework, Database, Repository.
392
+ * Can be defined locally or imported from stdlib.
393
+ */
394
+ export interface Metadata extends langium.AstNode {
395
+ readonly $container: Model | NamespaceDeclaration;
396
+ readonly $type: 'Metadata';
397
+ name: string;
398
+ }
399
+
400
+ export const Metadata = {
401
+ $type: 'Metadata',
402
+ name: 'name'
403
+ } as const;
404
+
405
+ export function isMetadata(item: unknown): item is Metadata {
406
+ return reflection.isInstance(item, Metadata.$type);
407
+ }
408
+
409
+ export interface MetadataEntry extends langium.AstNode {
410
+ readonly $container: BoundedContext;
411
+ readonly $type: 'Assignment' | 'MetadataEntry';
412
+ key: langium.Reference<Metadata>;
413
+ value: string;
414
+ }
415
+
416
+ export const MetadataEntry = {
417
+ $type: 'MetadataEntry',
418
+ key: 'key',
419
+ value: 'value'
420
+ } as const;
421
+
422
+ export function isMetadataEntry(item: unknown): item is MetadataEntry {
423
+ return reflection.isInstance(item, MetadataEntry.$type);
424
+ }
425
+
426
+ /**
427
+ * Root AST node - aggregates all top-level DDD elements.
428
+ * Produces the entry point for parsing .dlang files.
429
+ */
430
+ export interface Model extends langium.AstNode {
431
+ readonly $type: 'Model';
432
+ children: Array<StructureElement>;
433
+ imports: Array<ImportStatement>;
434
+ }
435
+
436
+ export const Model = {
437
+ $type: 'Model',
438
+ children: 'children',
439
+ imports: 'imports'
440
+ } as const;
441
+
442
+ export function isModel(item: unknown): item is Model {
443
+ return reflection.isInstance(item, Model.$type);
444
+ }
445
+
446
+ /**
447
+ * Namespace Declaration - Hierarchical namespacing for organizing models.
448
+ * Combines package modularity with group-style nesting.
449
+ */
450
+ export interface NamespaceDeclaration extends langium.AstNode {
451
+ readonly $container: Model | NamespaceDeclaration;
452
+ readonly $type: 'NamespaceDeclaration';
453
+ children: Array<StructureElement>;
454
+ name: QualifiedName;
455
+ }
456
+
457
+ export const NamespaceDeclaration = {
458
+ $type: 'NamespaceDeclaration',
459
+ children: 'children',
460
+ name: 'name'
461
+ } as const;
462
+
463
+ export function isNamespaceDeclaration(item: unknown): item is NamespaceDeclaration {
464
+ return reflection.isInstance(item, NamespaceDeclaration.$type);
465
+ }
466
+
467
+ /**
468
+ * Union of mapping constructs for visualizing architecture.
469
+ */
470
+ export type ObjectMap = ContextMap | DomainMap;
471
+
472
+ export const ObjectMap = {
473
+ $type: 'ObjectMap'
474
+ } as const;
475
+
476
+ export function isObjectMap(item: unknown): item is ObjectMap {
477
+ return reflection.isInstance(item, ObjectMap.$type);
478
+ }
479
+
480
+ export interface Policy extends langium.AstNode {
481
+ readonly $container: BoundedContext;
482
+ readonly $type: 'Assignment' | 'Policy';
483
+ classification: langium.Reference<Classification>;
484
+ name: string;
485
+ value: string;
486
+ }
487
+
488
+ export const Policy = {
489
+ $type: 'Policy',
490
+ classification: 'classification',
491
+ name: 'name',
492
+ value: 'value'
493
+ } as const;
494
+
495
+ export function isPolicy(item: unknown): item is Policy {
496
+ return reflection.isInstance(item, Policy.$type);
497
+ }
498
+
499
+ /**
500
+ * Qualified Name - Hierarchical namespacing with dots.
501
+ */
502
+ export type QualifiedName = string;
503
+
504
+ export function isQualifiedName(item: unknown): item is QualifiedName {
505
+ return typeof item === 'string';
506
+ }
507
+
508
+ /**
509
+ * Relationship - Connection between two Bounded Contexts.
510
+ * Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.
511
+ */
512
+ export interface Relationship extends langium.AstNode {
513
+ readonly $container: BoundedContext | ContextMap;
514
+ readonly $type: 'Assignment' | 'Relationship';
515
+ arrow: RelationshipArrow;
516
+ left: BoundedContextRef;
517
+ leftPatterns: Array<IntegrationPattern>;
518
+ right: BoundedContextRef;
519
+ rightPatterns: Array<IntegrationPattern>;
520
+ type?: RelationshipType;
521
+ }
522
+
523
+ export const Relationship = {
524
+ $type: 'Relationship',
525
+ arrow: 'arrow',
526
+ left: 'left',
527
+ leftPatterns: 'leftPatterns',
528
+ right: 'right',
529
+ rightPatterns: 'rightPatterns',
530
+ type: 'type'
531
+ } as const;
532
+
533
+ export function isRelationship(item: unknown): item is Relationship {
534
+ return reflection.isInstance(item, Relationship.$type);
535
+ }
536
+
537
+ /**
538
+ * Relationship arrows - symbolic and named types.
539
+ *
540
+ * Arrow semantics:
541
+ * -> Upstream to downstream (left provides, right consumes)
542
+ * <- Downstream to upstream (right provides, left consumes)
543
+ * <-> Bidirectional/Partnership (mutual dependency)
544
+ * >< Separate Ways (no integration, teams go their own way)
545
+ */
546
+ export type RelationshipArrow = '->' | '<-' | '<->' | '><';
547
+
548
+ export function isRelationshipArrow(item: unknown): item is RelationshipArrow {
549
+ return item === '<->' || item === '->' || item === '<-' || item === '><';
550
+ }
551
+
552
+ /**
553
+ * DDD Relationship Types.
554
+ */
555
+ export type RelationshipType = 'CustomerSupplier' | 'Partnership' | 'SeparateWays' | 'SharedKernel' | 'UpstreamDownstream';
556
+
557
+ export function isRelationshipType(item: unknown): item is RelationshipType {
558
+ return item === 'Partnership' || item === 'SharedKernel' || item === 'CustomerSupplier' || item === 'UpstreamDownstream' || item === 'SeparateWays';
559
+ }
560
+
561
+ /**
562
+ * Top-level elements that can appear in the model.
563
+ * Unifies all major DDD constructs for flexible ordering.
564
+ */
565
+ export type StructureElement = NamespaceDeclaration | ObjectMap | Type;
566
+
567
+ export const StructureElement = {
568
+ $type: 'StructureElement'
569
+ } as const;
570
+
571
+ export function isStructureElement(item: unknown): item is StructureElement {
572
+ return reflection.isInstance(item, StructureElement.$type);
573
+ }
574
+
575
+ /**
576
+ * Team - People responsible for a Bounded Context or Domain.
577
+ * Represents organizational boundaries in DDD.
578
+ */
579
+ export interface Team extends langium.AstNode {
580
+ readonly $container: Model | NamespaceDeclaration;
581
+ readonly $type: 'Team';
582
+ name: string;
583
+ }
584
+
585
+ export const Team = {
586
+ $type: 'Team',
587
+ name: 'name'
588
+ } as const;
589
+
590
+ export function isTeam(item: unknown): item is Team {
591
+ return reflection.isInstance(item, Team.$type);
592
+ }
593
+
594
+ /**
595
+ * Context reference - can be 'this' (self-reference) or a qualified name.
596
+ */
597
+ export interface ThisRef extends BoundedContextRef {
598
+ readonly $type: 'ThisRef';
599
+ }
600
+
601
+ export const ThisRef = {
602
+ $type: 'ThisRef',
603
+ link: 'link'
604
+ } as const;
605
+
606
+ export function isThisRef(item: unknown): item is ThisRef {
607
+ return reflection.isInstance(item, ThisRef.$type);
608
+ }
609
+
610
+ /**
611
+ * Union of all main DDD type constructs.
612
+ */
613
+ export type Type = BoundedContext | Classification | Domain | Metadata | Team;
614
+
615
+ export const Type = {
616
+ $type: 'Type'
617
+ } as const;
618
+
619
+ export function isType(item: unknown): item is Type {
620
+ return reflection.isInstance(item, Type.$type);
621
+ }
622
+
623
+ export type DomainLangAstType = {
624
+ AbstractDecision: AbstractDecision
625
+ BoundedContext: BoundedContext
626
+ BoundedContextRef: BoundedContextRef
627
+ BusinessRule: BusinessRule
628
+ Classification: Classification
629
+ Container: Container
630
+ ContextMap: ContextMap
631
+ Decision: Decision
632
+ Domain: Domain
633
+ DomainMap: DomainMap
634
+ DomainTerm: DomainTerm
635
+ ImportStatement: ImportStatement
636
+ Metadata: Metadata
637
+ MetadataEntry: MetadataEntry
638
+ Model: Model
639
+ NamespaceDeclaration: NamespaceDeclaration
640
+ ObjectMap: ObjectMap
641
+ Policy: Policy
642
+ Relationship: Relationship
643
+ StructureElement: StructureElement
644
+ Team: Team
645
+ ThisRef: ThisRef
646
+ Type: Type
647
+ }
648
+
649
+ export class DomainLangAstReflection extends langium.AbstractAstReflection {
650
+ override readonly types = {
651
+ AbstractDecision: {
652
+ name: AbstractDecision.$type,
653
+ properties: {
654
+ },
655
+ superTypes: []
656
+ },
657
+ BoundedContext: {
658
+ name: BoundedContext.$type,
659
+ properties: {
660
+ archetype: {
661
+ name: BoundedContext.archetype,
662
+ referenceType: Classification.$type
663
+ },
664
+ businessModel: {
665
+ name: BoundedContext.businessModel,
666
+ referenceType: Classification.$type
667
+ },
668
+ classification: {
669
+ name: BoundedContext.classification,
670
+ defaultValue: [],
671
+ referenceType: Classification.$type
672
+ },
673
+ decisions: {
674
+ name: BoundedContext.decisions,
675
+ defaultValue: []
676
+ },
677
+ description: {
678
+ name: BoundedContext.description
679
+ },
680
+ domain: {
681
+ name: BoundedContext.domain,
682
+ referenceType: Domain.$type
683
+ },
684
+ evolution: {
685
+ name: BoundedContext.evolution,
686
+ referenceType: Classification.$type
687
+ },
688
+ metadata: {
689
+ name: BoundedContext.metadata,
690
+ defaultValue: []
691
+ },
692
+ name: {
693
+ name: BoundedContext.name
694
+ },
695
+ relationships: {
696
+ name: BoundedContext.relationships,
697
+ defaultValue: []
698
+ },
699
+ team: {
700
+ name: BoundedContext.team,
701
+ defaultValue: [],
702
+ referenceType: Team.$type
703
+ },
704
+ terminology: {
705
+ name: BoundedContext.terminology,
706
+ defaultValue: []
707
+ }
708
+ },
709
+ superTypes: [Type.$type]
710
+ },
711
+ BoundedContextRef: {
712
+ name: BoundedContextRef.$type,
713
+ properties: {
714
+ link: {
715
+ name: BoundedContextRef.link,
716
+ referenceType: BoundedContext.$type
717
+ }
718
+ },
719
+ superTypes: []
720
+ },
721
+ BusinessRule: {
722
+ name: BusinessRule.$type,
723
+ properties: {
724
+ classification: {
725
+ name: BusinessRule.classification,
726
+ referenceType: Classification.$type
727
+ },
728
+ name: {
729
+ name: BusinessRule.name
730
+ },
731
+ value: {
732
+ name: BusinessRule.value
733
+ }
734
+ },
735
+ superTypes: [AbstractDecision.$type]
736
+ },
737
+ Classification: {
738
+ name: Classification.$type,
739
+ properties: {
740
+ name: {
741
+ name: Classification.name
742
+ }
743
+ },
744
+ superTypes: [Type.$type]
745
+ },
746
+ Container: {
747
+ name: Container.$type,
748
+ properties: {
749
+ },
750
+ superTypes: []
751
+ },
752
+ ContextMap: {
753
+ name: ContextMap.$type,
754
+ properties: {
755
+ boundedContexts: {
756
+ name: ContextMap.boundedContexts,
757
+ defaultValue: [],
758
+ referenceType: BoundedContext.$type
759
+ },
760
+ name: {
761
+ name: ContextMap.name
762
+ },
763
+ relationships: {
764
+ name: ContextMap.relationships,
765
+ defaultValue: []
766
+ }
767
+ },
768
+ superTypes: [ObjectMap.$type]
769
+ },
770
+ Decision: {
771
+ name: Decision.$type,
772
+ properties: {
773
+ classification: {
774
+ name: Decision.classification,
775
+ referenceType: Classification.$type
776
+ },
777
+ name: {
778
+ name: Decision.name
779
+ },
780
+ value: {
781
+ name: Decision.value
782
+ }
783
+ },
784
+ superTypes: [AbstractDecision.$type]
785
+ },
786
+ Domain: {
787
+ name: Domain.$type,
788
+ properties: {
789
+ description: {
790
+ name: Domain.description
791
+ },
792
+ name: {
793
+ name: Domain.name
794
+ },
795
+ parent: {
796
+ name: Domain.parent,
797
+ referenceType: Domain.$type
798
+ },
799
+ type: {
800
+ name: Domain.type,
801
+ referenceType: Classification.$type
802
+ },
803
+ vision: {
804
+ name: Domain.vision
805
+ }
806
+ },
807
+ superTypes: [Type.$type]
808
+ },
809
+ DomainMap: {
810
+ name: DomainMap.$type,
811
+ properties: {
812
+ domains: {
813
+ name: DomainMap.domains,
814
+ defaultValue: [],
815
+ referenceType: Domain.$type
816
+ },
817
+ name: {
818
+ name: DomainMap.name
819
+ }
820
+ },
821
+ superTypes: [ObjectMap.$type]
822
+ },
823
+ DomainTerm: {
824
+ name: DomainTerm.$type,
825
+ properties: {
826
+ examples: {
827
+ name: DomainTerm.examples,
828
+ defaultValue: []
829
+ },
830
+ meaning: {
831
+ name: DomainTerm.meaning
832
+ },
833
+ name: {
834
+ name: DomainTerm.name
835
+ },
836
+ synonyms: {
837
+ name: DomainTerm.synonyms,
838
+ defaultValue: []
839
+ }
840
+ },
841
+ superTypes: []
842
+ },
843
+ ImportStatement: {
844
+ name: ImportStatement.$type,
845
+ properties: {
846
+ alias: {
847
+ name: ImportStatement.alias
848
+ },
849
+ uri: {
850
+ name: ImportStatement.uri
851
+ }
852
+ },
853
+ superTypes: []
854
+ },
855
+ Metadata: {
856
+ name: Metadata.$type,
857
+ properties: {
858
+ name: {
859
+ name: Metadata.name
860
+ }
861
+ },
862
+ superTypes: [Type.$type]
863
+ },
864
+ MetadataEntry: {
865
+ name: MetadataEntry.$type,
866
+ properties: {
867
+ key: {
868
+ name: MetadataEntry.key,
869
+ referenceType: Metadata.$type
870
+ },
871
+ value: {
872
+ name: MetadataEntry.value
873
+ }
874
+ },
875
+ superTypes: []
876
+ },
877
+ Model: {
878
+ name: Model.$type,
879
+ properties: {
880
+ children: {
881
+ name: Model.children,
882
+ defaultValue: []
883
+ },
884
+ imports: {
885
+ name: Model.imports,
886
+ defaultValue: []
887
+ }
888
+ },
889
+ superTypes: [Container.$type]
890
+ },
891
+ NamespaceDeclaration: {
892
+ name: NamespaceDeclaration.$type,
893
+ properties: {
894
+ children: {
895
+ name: NamespaceDeclaration.children,
896
+ defaultValue: []
897
+ },
898
+ name: {
899
+ name: NamespaceDeclaration.name
900
+ }
901
+ },
902
+ superTypes: [Container.$type, StructureElement.$type]
903
+ },
904
+ ObjectMap: {
905
+ name: ObjectMap.$type,
906
+ properties: {
907
+ },
908
+ superTypes: [StructureElement.$type]
909
+ },
910
+ Policy: {
911
+ name: Policy.$type,
912
+ properties: {
913
+ classification: {
914
+ name: Policy.classification,
915
+ referenceType: Classification.$type
916
+ },
917
+ name: {
918
+ name: Policy.name
919
+ },
920
+ value: {
921
+ name: Policy.value
922
+ }
923
+ },
924
+ superTypes: [AbstractDecision.$type]
925
+ },
926
+ Relationship: {
927
+ name: Relationship.$type,
928
+ properties: {
929
+ arrow: {
930
+ name: Relationship.arrow
931
+ },
932
+ left: {
933
+ name: Relationship.left
934
+ },
935
+ leftPatterns: {
936
+ name: Relationship.leftPatterns,
937
+ defaultValue: []
938
+ },
939
+ right: {
940
+ name: Relationship.right
941
+ },
942
+ rightPatterns: {
943
+ name: Relationship.rightPatterns,
944
+ defaultValue: []
945
+ },
946
+ type: {
947
+ name: Relationship.type
948
+ }
949
+ },
950
+ superTypes: []
951
+ },
952
+ StructureElement: {
953
+ name: StructureElement.$type,
954
+ properties: {
955
+ },
956
+ superTypes: []
957
+ },
958
+ Team: {
959
+ name: Team.$type,
960
+ properties: {
961
+ name: {
962
+ name: Team.name
963
+ }
964
+ },
965
+ superTypes: [Type.$type]
966
+ },
967
+ ThisRef: {
968
+ name: ThisRef.$type,
969
+ properties: {
970
+ link: {
971
+ name: ThisRef.link,
972
+ referenceType: BoundedContext.$type
973
+ }
974
+ },
975
+ superTypes: [BoundedContextRef.$type]
976
+ },
977
+ Type: {
978
+ name: Type.$type,
979
+ properties: {
980
+ },
981
+ superTypes: [StructureElement.$type]
982
+ }
983
+ } as const satisfies langium.AstMetaData
984
+ }
985
+
986
+ export const reflection = new DomainLangAstReflection();