@domainlang/language 0.5.2 → 0.7.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 (116) hide show
  1. package/README.md +1 -1
  2. package/out/domain-lang-module.js +5 -1
  3. package/out/domain-lang-module.js.map +1 -1
  4. package/out/generated/ast.d.ts +24 -0
  5. package/out/generated/ast.js.map +1 -1
  6. package/out/generated/grammar.js +22 -32
  7. package/out/generated/grammar.js.map +1 -1
  8. package/out/index.d.ts +2 -5
  9. package/out/index.js +10 -6
  10. package/out/index.js.map +1 -1
  11. package/out/lsp/domain-lang-code-actions.js +14 -8
  12. package/out/lsp/domain-lang-code-actions.js.map +1 -1
  13. package/out/lsp/domain-lang-completion.d.ts +3 -0
  14. package/out/lsp/domain-lang-completion.js +41 -13
  15. package/out/lsp/domain-lang-completion.js.map +1 -1
  16. package/out/lsp/domain-lang-formatter.js +24 -18
  17. package/out/lsp/domain-lang-formatter.js.map +1 -1
  18. package/out/lsp/domain-lang-index-manager.d.ts +170 -0
  19. package/out/lsp/domain-lang-index-manager.js +389 -0
  20. package/out/lsp/domain-lang-index-manager.js.map +1 -0
  21. package/out/lsp/domain-lang-scope-provider.d.ts +67 -0
  22. package/out/lsp/domain-lang-scope-provider.js +95 -0
  23. package/out/lsp/domain-lang-scope-provider.js.map +1 -0
  24. package/out/lsp/domain-lang-scope.js +31 -17
  25. package/out/lsp/domain-lang-scope.js.map +1 -1
  26. package/out/lsp/domain-lang-workspace-manager.d.ts +76 -9
  27. package/out/lsp/domain-lang-workspace-manager.js +176 -54
  28. package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
  29. package/out/lsp/hover/domain-lang-hover.d.ts +45 -1
  30. package/out/lsp/hover/domain-lang-hover.js +308 -232
  31. package/out/lsp/hover/domain-lang-hover.js.map +1 -1
  32. package/out/lsp/hover/domain-lang-keywords.d.ts +3 -7
  33. package/out/lsp/hover/domain-lang-keywords.js +115 -38
  34. package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
  35. package/out/lsp/manifest-diagnostics.js +95 -50
  36. package/out/lsp/manifest-diagnostics.js.map +1 -1
  37. package/out/main.js +204 -17
  38. package/out/main.js.map +1 -1
  39. package/out/services/import-resolver.d.ts +39 -2
  40. package/out/services/import-resolver.js +77 -12
  41. package/out/services/import-resolver.js.map +1 -1
  42. package/out/services/types.d.ts +2 -2
  43. package/out/services/workspace-manager.d.ts +33 -31
  44. package/out/services/workspace-manager.js +92 -148
  45. package/out/services/workspace-manager.js.map +1 -1
  46. package/out/utils/document-utils.d.ts +41 -0
  47. package/out/utils/document-utils.js +64 -0
  48. package/out/utils/document-utils.js.map +1 -0
  49. package/out/utils/import-utils.d.ts +0 -17
  50. package/out/utils/import-utils.js +2 -32
  51. package/out/utils/import-utils.js.map +1 -1
  52. package/out/utils/manifest-utils.d.ts +56 -0
  53. package/out/utils/manifest-utils.js +119 -0
  54. package/out/utils/manifest-utils.js.map +1 -0
  55. package/out/validation/constants.d.ts +13 -0
  56. package/out/validation/constants.js +18 -0
  57. package/out/validation/constants.js.map +1 -1
  58. package/out/validation/import.d.ts +12 -2
  59. package/out/validation/import.js +95 -22
  60. package/out/validation/import.js.map +1 -1
  61. package/out/validation/maps.js +51 -2
  62. package/out/validation/maps.js.map +1 -1
  63. package/package.json +1 -1
  64. package/src/domain-lang-module.ts +6 -1
  65. package/src/domain-lang.langium +37 -13
  66. package/src/generated/ast.ts +24 -0
  67. package/src/generated/grammar.ts +22 -32
  68. package/src/index.ts +12 -6
  69. package/src/lsp/domain-lang-code-actions.ts +13 -8
  70. package/src/lsp/domain-lang-completion.ts +61 -13
  71. package/src/lsp/domain-lang-formatter.ts +28 -23
  72. package/src/lsp/domain-lang-index-manager.ts +447 -0
  73. package/src/lsp/domain-lang-scope-provider.ts +134 -0
  74. package/src/lsp/domain-lang-scope.ts +29 -17
  75. package/src/lsp/domain-lang-workspace-manager.ts +201 -53
  76. package/src/lsp/hover/domain-lang-hover.ts +332 -226
  77. package/src/lsp/hover/domain-lang-keywords.ts +129 -43
  78. package/src/lsp/manifest-diagnostics.ts +100 -59
  79. package/src/main.ts +258 -16
  80. package/src/services/import-resolver.ts +91 -12
  81. package/src/services/types.ts +2 -2
  82. package/src/services/workspace-manager.ts +101 -175
  83. package/src/utils/document-utils.ts +80 -0
  84. package/src/utils/import-utils.ts +2 -40
  85. package/src/utils/manifest-utils.ts +132 -0
  86. package/src/validation/constants.ts +24 -0
  87. package/src/validation/import.ts +107 -24
  88. package/src/validation/maps.ts +59 -2
  89. package/out/lsp/hover/ddd-pattern-explanations.d.ts +0 -50
  90. package/out/lsp/hover/ddd-pattern-explanations.js +0 -196
  91. package/out/lsp/hover/ddd-pattern-explanations.js.map +0 -1
  92. package/out/services/dependency-analyzer.d.ts +0 -58
  93. package/out/services/dependency-analyzer.js +0 -254
  94. package/out/services/dependency-analyzer.js.map +0 -1
  95. package/out/services/dependency-resolver.d.ts +0 -146
  96. package/out/services/dependency-resolver.js +0 -452
  97. package/out/services/dependency-resolver.js.map +0 -1
  98. package/out/services/git-url-resolver.browser.d.ts +0 -10
  99. package/out/services/git-url-resolver.browser.js +0 -19
  100. package/out/services/git-url-resolver.browser.js.map +0 -1
  101. package/out/services/git-url-resolver.d.ts +0 -158
  102. package/out/services/git-url-resolver.js +0 -416
  103. package/out/services/git-url-resolver.js.map +0 -1
  104. package/out/services/governance-validator.d.ts +0 -44
  105. package/out/services/governance-validator.js +0 -153
  106. package/out/services/governance-validator.js.map +0 -1
  107. package/out/services/semver.d.ts +0 -98
  108. package/out/services/semver.js +0 -195
  109. package/out/services/semver.js.map +0 -1
  110. package/src/lsp/hover/ddd-pattern-explanations.ts +0 -237
  111. package/src/services/dependency-analyzer.ts +0 -321
  112. package/src/services/dependency-resolver.ts +0 -551
  113. package/src/services/git-url-resolver.browser.ts +0 -26
  114. package/src/services/git-url-resolver.ts +0 -517
  115. package/src/services/governance-validator.ts +0 -177
  116. package/src/services/semver.ts +0 -213
@@ -1,98 +0,0 @@
1
- /**
2
- * Semantic Versioning Utilities
3
- *
4
- * Centralized SemVer parsing, comparison, and validation for the dependency system.
5
- * All version-related logic should use these utilities to ensure consistency.
6
- *
7
- * Supported formats:
8
- * - "1.0.0" or "v1.0.0" (tags)
9
- * - "1.0.0-alpha.1" (pre-release)
10
- * - "main", "develop" (branches)
11
- * - "abc123def" (commit SHAs, 7-40 hex chars)
12
- */
13
- import type { SemVer, RefType, ParsedRef } from './types.js';
14
- /**
15
- * Parses a version string into SemVer components.
16
- * Returns undefined if not a valid SemVer.
17
- *
18
- * @example
19
- * parseSemVer("v1.2.3") // { major: 1, minor: 2, patch: 3, original: "v1.2.3" }
20
- * parseSemVer("1.0.0-alpha") // { major: 1, minor: 0, patch: 0, prerelease: "alpha", ... }
21
- * parseSemVer("main") // undefined (not SemVer)
22
- */
23
- export declare function parseSemVer(version: string): SemVer | undefined;
24
- /**
25
- * Detects the type of a git ref based on its format.
26
- *
27
- * @example
28
- * detectRefType("v1.0.0") // 'tag'
29
- * detectRefType("1.2.3") // 'tag'
30
- * detectRefType("main") // 'branch'
31
- * detectRefType("abc123def") // 'commit'
32
- */
33
- export declare function detectRefType(ref: string): RefType;
34
- /**
35
- * Parses a ref string into a structured ParsedRef with type and optional SemVer.
36
- */
37
- export declare function parseRef(ref: string): ParsedRef;
38
- /**
39
- * Compares two SemVer versions.
40
- * Returns: negative if a < b, positive if a > b, zero if equal.
41
- *
42
- * @example
43
- * compareSemVer(parse("1.0.0"), parse("2.0.0")) // negative (a < b)
44
- * compareSemVer(parse("1.5.0"), parse("1.2.0")) // positive (a > b)
45
- * compareSemVer(parse("1.0.0-alpha"), parse("1.0.0")) // negative (prerelease < release)
46
- */
47
- export declare function compareSemVer(a: SemVer, b: SemVer): number;
48
- /**
49
- * Picks the latest from a list of SemVer refs.
50
- * Returns the ref string (with original 'v' prefix if present).
51
- *
52
- * @example
53
- * pickLatestSemVer(["v1.0.0", "v1.5.0", "v1.2.0"]) // "v1.5.0"
54
- */
55
- export declare function pickLatestSemVer(refs: string[]): string | undefined;
56
- /**
57
- * Sorts version strings in descending order (newest first).
58
- * Non-SemVer refs are sorted lexicographically at the end.
59
- *
60
- * @example
61
- * sortVersionsDescending(["v1.0.0", "v2.0.0", "v1.5.0"]) // ["v2.0.0", "v1.5.0", "v1.0.0"]
62
- */
63
- export declare function sortVersionsDescending(versions: string[]): string[];
64
- /**
65
- * Checks if a version/ref is a pre-release.
66
- *
67
- * Pre-release identifiers: alpha, beta, rc, pre, dev, snapshot
68
- *
69
- * @example
70
- * isPreRelease("v1.0.0") // false
71
- * isPreRelease("v1.0.0-alpha") // true
72
- * isPreRelease("v1.0.0-rc.1") // true
73
- */
74
- export declare function isPreRelease(ref: string): boolean;
75
- /**
76
- * Checks if two SemVer versions are compatible (same major version).
77
- *
78
- * @example
79
- * areSameMajor(parse("1.0.0"), parse("1.5.0")) // true
80
- * areSameMajor(parse("1.0.0"), parse("2.0.0")) // false
81
- */
82
- export declare function areSameMajor(a: SemVer, b: SemVer): boolean;
83
- /**
84
- * Gets the major version number from a ref string.
85
- * Returns undefined if not a valid SemVer.
86
- */
87
- export declare function getMajorVersion(ref: string): number | undefined;
88
- /**
89
- * Filters refs to only stable versions (excludes pre-releases).
90
- *
91
- * @example
92
- * filterStableVersions(["v1.0.0", "v1.1.0-alpha", "v1.2.0"]) // ["v1.0.0", "v1.2.0"]
93
- */
94
- export declare function filterStableVersions(refs: string[]): string[];
95
- /**
96
- * Filters refs to only SemVer tags (excludes branches and commits).
97
- */
98
- export declare function filterSemVerTags(refs: string[]): string[];
@@ -1,195 +0,0 @@
1
- /**
2
- * Semantic Versioning Utilities
3
- *
4
- * Centralized SemVer parsing, comparison, and validation for the dependency system.
5
- * All version-related logic should use these utilities to ensure consistency.
6
- *
7
- * Supported formats:
8
- * - "1.0.0" or "v1.0.0" (tags)
9
- * - "1.0.0-alpha.1" (pre-release)
10
- * - "main", "develop" (branches)
11
- * - "abc123def" (commit SHAs, 7-40 hex chars)
12
- */
13
- // ============================================================================
14
- // Parsing
15
- // ============================================================================
16
- /**
17
- * Parses a version string into SemVer components.
18
- * Returns undefined if not a valid SemVer.
19
- *
20
- * @example
21
- * parseSemVer("v1.2.3") // { major: 1, minor: 2, patch: 3, original: "v1.2.3" }
22
- * parseSemVer("1.0.0-alpha") // { major: 1, minor: 0, patch: 0, prerelease: "alpha", ... }
23
- * parseSemVer("main") // undefined (not SemVer)
24
- */
25
- export function parseSemVer(version) {
26
- // Strip leading 'v' if present
27
- const normalized = version.startsWith('v') ? version.slice(1) : version;
28
- // Match semver pattern: major.minor.patch[-prerelease]
29
- const match = normalized.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);
30
- if (!match)
31
- return undefined;
32
- return {
33
- major: parseInt(match[1], 10),
34
- minor: parseInt(match[2], 10),
35
- patch: parseInt(match[3], 10),
36
- preRelease: match[4],
37
- original: version,
38
- };
39
- }
40
- /**
41
- * Detects the type of a git ref based on its format.
42
- *
43
- * @example
44
- * detectRefType("v1.0.0") // 'tag'
45
- * detectRefType("1.2.3") // 'tag'
46
- * detectRefType("main") // 'branch'
47
- * detectRefType("abc123def") // 'commit'
48
- */
49
- export function detectRefType(ref) {
50
- // Commit SHA: 7-40 hex characters
51
- if (/^[0-9a-f]{7,40}$/i.test(ref)) {
52
- return 'commit';
53
- }
54
- // Tags typically start with 'v' followed by semver
55
- if (/^v?\d+\.\d+\.\d+/.test(ref)) {
56
- return 'tag';
57
- }
58
- // Everything else is treated as a branch
59
- return 'branch';
60
- }
61
- /**
62
- * Parses a ref string into a structured ParsedRef with type and optional SemVer.
63
- */
64
- export function parseRef(ref) {
65
- const type = detectRefType(ref);
66
- const semver = type === 'tag' ? parseSemVer(ref) : undefined;
67
- return { original: ref, type, semver };
68
- }
69
- // ============================================================================
70
- // Comparison
71
- // ============================================================================
72
- /**
73
- * Compares two SemVer versions.
74
- * Returns: negative if a < b, positive if a > b, zero if equal.
75
- *
76
- * @example
77
- * compareSemVer(parse("1.0.0"), parse("2.0.0")) // negative (a < b)
78
- * compareSemVer(parse("1.5.0"), parse("1.2.0")) // positive (a > b)
79
- * compareSemVer(parse("1.0.0-alpha"), parse("1.0.0")) // negative (prerelease < release)
80
- */
81
- export function compareSemVer(a, b) {
82
- if (a.major !== b.major)
83
- return a.major - b.major;
84
- if (a.minor !== b.minor)
85
- return a.minor - b.minor;
86
- if (a.patch !== b.patch)
87
- return a.patch - b.patch;
88
- // Pre-release versions are lower than release versions
89
- if (a.preRelease && !b.preRelease)
90
- return -1;
91
- if (!a.preRelease && b.preRelease)
92
- return 1;
93
- if (a.preRelease && b.preRelease) {
94
- return a.preRelease.localeCompare(b.preRelease);
95
- }
96
- return 0;
97
- }
98
- /**
99
- * Picks the latest from a list of SemVer refs.
100
- * Returns the ref string (with original 'v' prefix if present).
101
- *
102
- * @example
103
- * pickLatestSemVer(["v1.0.0", "v1.5.0", "v1.2.0"]) // "v1.5.0"
104
- */
105
- export function pickLatestSemVer(refs) {
106
- const parsed = refs
107
- .map(ref => ({ ref, semver: parseSemVer(ref) }))
108
- .filter((item) => item.semver !== undefined);
109
- if (parsed.length === 0)
110
- return undefined;
111
- parsed.sort((a, b) => compareSemVer(b.semver, a.semver)); // Descending
112
- return parsed[0].ref;
113
- }
114
- /**
115
- * Sorts version strings in descending order (newest first).
116
- * Non-SemVer refs are sorted lexicographically at the end.
117
- *
118
- * @example
119
- * sortVersionsDescending(["v1.0.0", "v2.0.0", "v1.5.0"]) // ["v2.0.0", "v1.5.0", "v1.0.0"]
120
- */
121
- export function sortVersionsDescending(versions) {
122
- return [...versions].sort((a, b) => {
123
- const semverA = parseSemVer(a);
124
- const semverB = parseSemVer(b);
125
- // Both are SemVer - compare semantically
126
- if (semverA && semverB) {
127
- return compareSemVer(semverB, semverA); // Descending
128
- }
129
- // SemVer comes before non-SemVer
130
- if (semverA && !semverB)
131
- return -1;
132
- if (!semverA && semverB)
133
- return 1;
134
- // Both non-SemVer - lexicographic
135
- return b.localeCompare(a);
136
- });
137
- }
138
- // ============================================================================
139
- // Validation
140
- // ============================================================================
141
- /**
142
- * Checks if a version/ref is a pre-release.
143
- *
144
- * Pre-release identifiers: alpha, beta, rc, pre, dev, snapshot
145
- *
146
- * @example
147
- * isPreRelease("v1.0.0") // false
148
- * isPreRelease("v1.0.0-alpha") // true
149
- * isPreRelease("v1.0.0-rc.1") // true
150
- */
151
- export function isPreRelease(ref) {
152
- const semver = parseSemVer(ref);
153
- if (semver?.preRelease) {
154
- return true;
155
- }
156
- // Also check for common pre-release patterns without proper SemVer
157
- const clean = ref.replace(/^v/, '');
158
- return /-(alpha|beta|rc|pre|dev|snapshot)/i.test(clean);
159
- }
160
- /**
161
- * Checks if two SemVer versions are compatible (same major version).
162
- *
163
- * @example
164
- * areSameMajor(parse("1.0.0"), parse("1.5.0")) // true
165
- * areSameMajor(parse("1.0.0"), parse("2.0.0")) // false
166
- */
167
- export function areSameMajor(a, b) {
168
- return a.major === b.major;
169
- }
170
- /**
171
- * Gets the major version number from a ref string.
172
- * Returns undefined if not a valid SemVer.
173
- */
174
- export function getMajorVersion(ref) {
175
- return parseSemVer(ref)?.major;
176
- }
177
- // ============================================================================
178
- // Filtering
179
- // ============================================================================
180
- /**
181
- * Filters refs to only stable versions (excludes pre-releases).
182
- *
183
- * @example
184
- * filterStableVersions(["v1.0.0", "v1.1.0-alpha", "v1.2.0"]) // ["v1.0.0", "v1.2.0"]
185
- */
186
- export function filterStableVersions(refs) {
187
- return refs.filter(ref => !isPreRelease(ref));
188
- }
189
- /**
190
- * Filters refs to only SemVer tags (excludes branches and commits).
191
- */
192
- export function filterSemVerTags(refs) {
193
- return refs.filter(ref => detectRefType(ref) === 'tag' && parseSemVer(ref) !== undefined);
194
- }
195
- //# sourceMappingURL=semver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semver.js","sourceRoot":"","sources":["../../src/services/semver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,+EAA+E;AAC/E,UAAU;AACV,+EA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IACpC,OAAO,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS;IAC7C,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACvC,OAAO,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;AACnC,CAAC;AAED,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAc;IAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAc;IAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAC9F,CAAC"}
@@ -1,237 +0,0 @@
1
- /**
2
- * DDD Pattern Explanations for Hover Documentation
3
- *
4
- * Provides plain-English explanations for DDD integration patterns,
5
- * relationship types, and decision categories.
6
- */
7
-
8
- /**
9
- * Explanations for DDD integration role patterns (e.g., PL, ACL, SK).
10
- */
11
- export const rolePatternExplanations: Record<string, string> = {
12
- 'PL': `**Published Language (PL)**
13
-
14
- The upstream context provides a well-documented, stable API/model that downstream contexts consume.
15
-
16
- \`\`\`domain-lang
17
- [PL] UpstreamContext -> DownstreamContext
18
- \`\`\`
19
-
20
- *Use when:* Multiple consumers need a shared, stable interface.`,
21
-
22
- 'ACL': `**Anti-Corruption Layer (ACL)**
23
-
24
- Protects downstream from upstream changes by translating between models.
25
-
26
- \`\`\`domain-lang
27
- UpstreamContext -> [ACL] DownstreamContext
28
- \`\`\`
29
-
30
- *Use when:* You don't trust upstream stability or want isolation.`,
31
-
32
- 'SK': `**Shared Kernel (SK)**
33
-
34
- Both contexts share common domain model code requiring coordination.
35
-
36
- \`\`\`domain-lang
37
- [SK] Context1 <-> [SK] Context2 : SharedKernel
38
- \`\`\`
39
-
40
- *Use when:* Contexts are tightly coupled and teams can coordinate.`,
41
-
42
- 'CF': `**Conformist (CF)**
43
-
44
- Downstream accepts upstream model without translation.
45
-
46
- \`\`\`domain-lang
47
- UpstreamContext -> [CF] DownstreamContext
48
- \`\`\`
49
-
50
- *Use when:* Upstream model is acceptable and translation isn't worth it.`,
51
-
52
- 'OHS': `**Open Host Service (OHS)**
53
-
54
- Upstream defines a protocol/API for easy integration.
55
-
56
- \`\`\`domain-lang
57
- [OHS, PL] ApiContext -> ConsumerContext
58
- \`\`\`
59
-
60
- *Use when:* Multiple downstream contexts need integration.`,
61
-
62
- 'P': `**Partnership (P)**
63
-
64
- Teams coordinate development and align releases.
65
-
66
- \`\`\`domain-lang
67
- Context1 <-> Context2 : Partnership
68
- \`\`\`
69
-
70
- *Use when:* Mutual success dependency exists.`,
71
-
72
- 'BBoM': `**Big Ball of Mud (BBoM)**
73
-
74
- No clear boundaries - tangled models needing refactoring.
75
-
76
- \`\`\`domain-lang
77
- [BBoM] LegacySystem -> ModernContext
78
- \`\`\`
79
-
80
- *Use when:* Documenting legacy systems.`
81
- };
82
-
83
- /**
84
- * Explanations for relationship types (e.g., Partnership, CustomerSupplier).
85
- */
86
- export const relationshipTypeExplanations: Record<string, string> = {
87
- 'Partnership': '**Partnership**\n\nTwo contexts with mutual success dependency. Teams plan together and coordinate releases.\n\n*Example:* Sales and Order Fulfillment contexts that must evolve in sync.',
88
-
89
- 'SharedKernel': '**Shared Kernel**\n\nTwo contexts share a subset of code/model. Changes require agreement from both teams.\n\n*Example:* Two closely related contexts sharing common domain entities.',
90
-
91
- 'CustomerSupplier': '**Customer/Supplier**\n\nDownstream (customer) context depends on upstream (supplier) context. Supplier meets customer\'s needs through negotiation.\n\n*Example:* Payment context (customer) depends on Billing context (supplier).',
92
-
93
- 'UpstreamDownstream': '**Upstream/Downstream**\n\nUpstream context influences downstream context, but not vice versa. Downstream adapts to upstream changes.\n\n*Example:* Inventory (upstream) provides data to Reporting (downstream).',
94
-
95
- 'SeparateWays': '**Separate Ways**\n\nNo connection between contexts - they duplicate functionality rather than integrate.\n\n*Use when:* Integration cost exceeds benefit of sharing.'
96
- };
97
-
98
- /**
99
- * Explanations for relationship arrows.
100
- */
101
- export const arrowExplanations: Record<string, string> = {
102
- '<->': 'Bidirectional relationship - both contexts influence each other',
103
- '->': 'Downstream dependency - right depends on left (left is upstream)',
104
- '<-': 'Upstream dependency - left depends on right (right is upstream)',
105
- '><': 'Separate Ways - no integration between contexts',
106
- 'U/D': 'Upstream/Downstream - shorthand for upstream → downstream flow',
107
- 'u/d': 'Upstream/Downstream - shorthand for upstream → downstream flow',
108
- 'C/S': 'Customer/Supplier - shorthand for customer ← supplier relationship',
109
- 'c/s': 'Customer/Supplier - shorthand for customer ← supplier relationship'
110
- };
111
-
112
- /**
113
- * Explanations for decision categories.
114
- */
115
- export const decisionCategoryExplanations: Record<string, string> = {
116
- 'architectural': '**Architectural Decision**\n\nConcerns system structure, technology choices, or cross-cutting patterns.\n\n*Examples:* Microservices vs monolith, event sourcing, CQRS',
117
- 'arch': 'Short for "architectural" - concerns system structure and technology choices',
118
-
119
- 'business': '**Business Decision**\n\nConcerns business rules, policies, or domain logic.\n\n*Examples:* Pricing rules, refund policies, eligibility criteria',
120
- 'biz': 'Short for "business" - concerns business rules and domain logic',
121
-
122
- 'technical': '**Technical Decision**\n\nConcerns implementation details, algorithms, or technical constraints.\n\n*Examples:* Caching strategy, data structures, optimization approach',
123
- 'tech': 'Short for "technical" - concerns implementation details',
124
-
125
- 'compliance': '**Compliance Decision**\n\nConcerns legal, regulatory, or compliance requirements.\n\n*Examples:* GDPR data retention, SOX audit trails, HIPAA privacy',
126
-
127
- 'security': '**Security Decision**\n\nConcerns security, authentication, authorization, or data protection.\n\n*Examples:* OAuth vs JWT, encryption at rest, access control',
128
-
129
- 'operational': '**Operational Decision**\n\nConcerns deployment, monitoring, or operational procedures.\n\n*Examples:* Blue/green deployment, monitoring strategy, backup policy',
130
- 'ops': 'Short for "operational" - concerns deployment and operations'
131
- };
132
-
133
- /**
134
- * Explanations for common DDD classifications.
135
- */
136
- export const classificationExplanations: Record<string, string> = {
137
- 'Core': '**Core Domain**\n\nThe primary differentiator for your business - this is where you create unique value.\n\n*Invest heavily:* Best team, careful design, deep modeling.\n\n*Example:* Recommendation engine for Netflix, search for Google',
138
-
139
- 'Supporting': '**Supporting Subdomain**\n\nNecessary for the business but not a differentiator. Custom implementation needed but not the main focus.\n\n*Invest moderately:* Good team, solid implementation.\n\n*Example:* Inventory management, invoicing',
140
-
141
- 'Generic': '**Generic Subdomain**\n\nSolved problem - could use off-the-shelf solution. No competitive advantage.\n\n*Buy or reuse:* Use existing solutions when possible.\n\n*Example:* User authentication, email sending, payment processing',
142
-
143
- 'Strategic': '**Strategic** (Wardley Evolution)\n\nNovel, custom-built, competitive advantage. High value, low maturity.\n\n*Similar to Core Domain.*',
144
-
145
- 'Custom': '**Custom-Built** (Wardley Evolution)\n\nSpecialized solution, some precedent exists. Medium-high value, medium maturity.',
146
-
147
- 'Product': '**Product/Rental** (Wardley Evolution)\n\nStandardized product with features. Medium value, medium-high maturity.\n\n*Example:* SaaS tools, commercial software',
148
-
149
- 'Commodity': '**Commodity/Utility** (Wardley Evolution)\n\nUbiquitous, interchangeable, fully standardized. Low value, high maturity.\n\n*Example:* Cloud compute, email services'
150
- };
151
-
152
- /**
153
- * Get explanation for a role pattern.
154
- */
155
- export function explainRolePattern(role: string): string | undefined {
156
- return rolePatternExplanations[role];
157
- }
158
-
159
- /**
160
- * Get explanation for a relationship type.
161
- */
162
- export function explainRelationshipType(type: string): string | undefined {
163
- return relationshipTypeExplanations[type];
164
- }
165
-
166
- /**
167
- * Get explanation for an arrow symbol.
168
- */
169
- export function explainArrow(arrow: string): string | undefined {
170
- return arrowExplanations[arrow];
171
- }
172
-
173
- /**
174
- * Get explanation for a decision category.
175
- */
176
- export function explainDecisionCategory(category: string): string | undefined {
177
- return decisionCategoryExplanations[category];
178
- }
179
-
180
- /**
181
- * Get explanation for a classification.
182
- */
183
- export function explainClassification(name: string): string | undefined {
184
- return classificationExplanations[name];
185
- }
186
-
187
- /**
188
- * Generate relationship explanation from roles and type.
189
- */
190
- export function generateRelationshipExplanation(
191
- leftRoles: string[] | undefined,
192
- arrow: string | undefined,
193
- rightRoles: string[] | undefined,
194
- type: string | undefined
195
- ): string {
196
- const parts: string[] = [];
197
-
198
- // Arrow explanation
199
- if (arrow) {
200
- const arrowExp = explainArrow(arrow);
201
- if (arrowExp) {
202
- parts.push(`**Arrow:** ${arrowExp}`);
203
- }
204
- }
205
-
206
- // Left roles
207
- if (leftRoles && leftRoles.length > 0) {
208
- parts.push('**Left Context Patterns:**');
209
- leftRoles.forEach(role => {
210
- const exp = explainRolePattern(role);
211
- if (exp) {
212
- parts.push(exp);
213
- }
214
- });
215
- }
216
-
217
- // Right roles
218
- if (rightRoles && rightRoles.length > 0) {
219
- parts.push('**Right Context Patterns:**');
220
- rightRoles.forEach(role => {
221
- const exp = explainRolePattern(role);
222
- if (exp) {
223
- parts.push(exp);
224
- }
225
- });
226
- }
227
-
228
- // Relationship type
229
- if (type) {
230
- const typeExp = explainRelationshipType(type);
231
- if (typeExp) {
232
- parts.push(typeExp);
233
- }
234
- }
235
-
236
- return parts.join('\n\n---\n\n');
237
- }