@living-architecture/riviere-builder 0.5.28 → 0.6.1

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 (91) hide show
  1. package/dist/domain/builder-facade.d.ts +171 -0
  2. package/dist/domain/builder-facade.d.ts.map +1 -0
  3. package/dist/domain/builder-facade.js +211 -0
  4. package/dist/domain/builder-graph.d.ts +10 -0
  5. package/dist/domain/builder-graph.d.ts.map +1 -0
  6. package/dist/domain/construction/builder-assertions.d.ts.map +1 -0
  7. package/dist/{builder-assertions.js → domain/construction/builder-assertions.js} +1 -1
  8. package/dist/domain/construction/builder-internals.d.ts.map +1 -0
  9. package/dist/{builder-internals.js → domain/construction/builder-internals.js} +1 -1
  10. package/dist/{errors.d.ts → domain/construction/construction-errors.d.ts} +1 -10
  11. package/dist/domain/construction/construction-errors.d.ts.map +1 -0
  12. package/dist/{errors.js → domain/construction/construction-errors.js} +0 -18
  13. package/dist/{types.d.ts → domain/construction/construction-types.d.ts} +2 -63
  14. package/dist/domain/construction/construction-types.d.ts.map +1 -0
  15. package/dist/domain/construction/construction-types.js +1 -0
  16. package/dist/domain/construction/graph-construction.d.ts +19 -0
  17. package/dist/domain/construction/graph-construction.d.ts.map +1 -0
  18. package/dist/domain/construction/graph-construction.js +154 -0
  19. package/dist/{deduplicate.d.ts → domain/enrichment/deduplicate-transitions.d.ts} +1 -2
  20. package/dist/domain/enrichment/deduplicate-transitions.d.ts.map +1 -0
  21. package/dist/{deduplicate.js → domain/enrichment/deduplicate-transitions.js} +0 -4
  22. package/dist/domain/enrichment/enrichment-errors.d.ts +6 -0
  23. package/dist/domain/enrichment/enrichment-errors.d.ts.map +1 -0
  24. package/dist/domain/enrichment/enrichment-errors.js +10 -0
  25. package/dist/domain/enrichment/enrichment-types.d.ts +9 -0
  26. package/dist/domain/enrichment/enrichment-types.d.ts.map +1 -0
  27. package/dist/domain/enrichment/enrichment-types.js +1 -0
  28. package/dist/domain/enrichment/graph-enrichment.d.ts +8 -0
  29. package/dist/domain/enrichment/graph-enrichment.d.ts.map +1 -0
  30. package/dist/domain/enrichment/graph-enrichment.js +39 -0
  31. package/dist/domain/enrichment/merge-behavior.d.ts.map +1 -0
  32. package/dist/{merge-behavior.js → domain/enrichment/merge-behavior.js} +1 -1
  33. package/dist/{component-suggestion.d.ts → domain/error-recovery/component-suggestion.d.ts} +2 -2
  34. package/dist/domain/error-recovery/component-suggestion.d.ts.map +1 -0
  35. package/dist/{component-suggestion.js → domain/error-recovery/component-suggestion.js} +2 -2
  36. package/dist/domain/error-recovery/match-types.d.ts +21 -0
  37. package/dist/domain/error-recovery/match-types.d.ts.map +1 -0
  38. package/dist/domain/error-recovery/match-types.js +1 -0
  39. package/dist/domain/error-recovery/near-match.d.ts +8 -0
  40. package/dist/domain/error-recovery/near-match.d.ts.map +1 -0
  41. package/dist/domain/error-recovery/near-match.js +10 -0
  42. package/dist/domain/index.d.ts +6 -0
  43. package/dist/domain/index.d.ts.map +1 -0
  44. package/dist/domain/index.js +5 -0
  45. package/dist/domain/inspection/graph-inspection.d.ts +14 -0
  46. package/dist/domain/inspection/graph-inspection.d.ts.map +1 -0
  47. package/dist/domain/inspection/graph-inspection.js +23 -0
  48. package/dist/{inspection.d.ts → domain/inspection/inspection-functions.d.ts} +2 -2
  49. package/dist/domain/inspection/inspection-functions.d.ts.map +1 -0
  50. package/dist/domain/inspection/inspection-types.d.ts +23 -0
  51. package/dist/domain/inspection/inspection-types.d.ts.map +1 -0
  52. package/dist/domain/inspection/inspection-types.js +1 -0
  53. package/dist/domain/linking/graph-linking.d.ts +10 -0
  54. package/dist/domain/linking/graph-linking.d.ts.map +1 -0
  55. package/dist/domain/linking/graph-linking.js +35 -0
  56. package/dist/domain/linking/linking-types.d.ts +15 -0
  57. package/dist/domain/linking/linking-types.d.ts.map +1 -0
  58. package/dist/domain/linking/linking-types.js +1 -0
  59. package/dist/domain/riviere-builder.d.ts +21 -0
  60. package/dist/domain/riviere-builder.d.ts.map +1 -0
  61. package/dist/domain/riviere-builder.js +73 -0
  62. package/dist/platform/domain/collection-utils/deduplicate-strings.d.ts +2 -0
  63. package/dist/platform/domain/collection-utils/deduplicate-strings.d.ts.map +1 -0
  64. package/dist/platform/domain/collection-utils/deduplicate-strings.js +4 -0
  65. package/dist/platform/domain/text-similarity/string-similarity.d.ts.map +1 -0
  66. package/package.json +10 -10
  67. package/dist/builder-assertions.d.ts.map +0 -1
  68. package/dist/builder-internals.d.ts.map +0 -1
  69. package/dist/builder-test-fixtures.d.ts +0 -7
  70. package/dist/builder-test-fixtures.d.ts.map +0 -1
  71. package/dist/builder-test-fixtures.js +0 -26
  72. package/dist/builder.d.ts +0 -479
  73. package/dist/builder.d.ts.map +0 -1
  74. package/dist/builder.js +0 -734
  75. package/dist/component-suggestion.d.ts.map +0 -1
  76. package/dist/deduplicate.d.ts.map +0 -1
  77. package/dist/errors.d.ts.map +0 -1
  78. package/dist/index.d.ts +0 -5
  79. package/dist/index.d.ts.map +0 -1
  80. package/dist/index.js +0 -4
  81. package/dist/inspection.d.ts.map +0 -1
  82. package/dist/merge-behavior.d.ts.map +0 -1
  83. package/dist/string-similarity.d.ts.map +0 -1
  84. package/dist/types.d.ts.map +0 -1
  85. /package/dist/{types.js → domain/builder-graph.js} +0 -0
  86. /package/dist/{builder-assertions.d.ts → domain/construction/builder-assertions.d.ts} +0 -0
  87. /package/dist/{builder-internals.d.ts → domain/construction/builder-internals.d.ts} +0 -0
  88. /package/dist/{merge-behavior.d.ts → domain/enrichment/merge-behavior.d.ts} +0 -0
  89. /package/dist/{inspection.js → domain/inspection/inspection-functions.js} +0 -0
  90. /package/dist/{string-similarity.d.ts → platform/domain/text-similarity/string-similarity.d.ts} +0 -0
  91. /package/dist/{string-similarity.js → platform/domain/text-similarity/string-similarity.js} +0 -0
@@ -0,0 +1,154 @@
1
+ import { CustomTypeAlreadyDefinedError, DuplicateComponentError, DuplicateDomainError, } from './construction-errors';
2
+ import { generateComponentId, validateCustomType, validateDomainExists, validateRequiredProperties, } from './builder-internals';
3
+ export class GraphConstruction {
4
+ graph;
5
+ constructor(graph) {
6
+ this.graph = graph;
7
+ }
8
+ addSource(source) {
9
+ this.graph.metadata.sources.push(source);
10
+ }
11
+ addDomain(input) {
12
+ if (this.graph.metadata.domains[input.name]) {
13
+ throw new DuplicateDomainError(input.name);
14
+ }
15
+ this.graph.metadata.domains[input.name] = {
16
+ description: input.description,
17
+ systemType: input.systemType,
18
+ };
19
+ }
20
+ addUI(input) {
21
+ validateDomainExists(this.graph.metadata.domains, input.domain);
22
+ const id = generateComponentId(input.domain, input.module, 'ui', input.name);
23
+ const component = {
24
+ id,
25
+ type: 'UI',
26
+ name: input.name,
27
+ domain: input.domain,
28
+ module: input.module,
29
+ route: input.route,
30
+ sourceLocation: input.sourceLocation,
31
+ ...(input.description !== undefined && { description: input.description }),
32
+ };
33
+ return this.registerComponent(component);
34
+ }
35
+ addApi(input) {
36
+ validateDomainExists(this.graph.metadata.domains, input.domain);
37
+ const id = generateComponentId(input.domain, input.module, 'api', input.name);
38
+ const component = {
39
+ id,
40
+ type: 'API',
41
+ name: input.name,
42
+ domain: input.domain,
43
+ module: input.module,
44
+ apiType: input.apiType,
45
+ sourceLocation: input.sourceLocation,
46
+ ...(input.httpMethod !== undefined && { httpMethod: input.httpMethod }),
47
+ ...(input.path !== undefined && { path: input.path }),
48
+ ...(input.operationName !== undefined && { operationName: input.operationName }),
49
+ ...(input.description !== undefined && { description: input.description }),
50
+ };
51
+ return this.registerComponent(component);
52
+ }
53
+ addUseCase(input) {
54
+ validateDomainExists(this.graph.metadata.domains, input.domain);
55
+ const id = generateComponentId(input.domain, input.module, 'usecase', input.name);
56
+ const component = {
57
+ id,
58
+ type: 'UseCase',
59
+ name: input.name,
60
+ domain: input.domain,
61
+ module: input.module,
62
+ sourceLocation: input.sourceLocation,
63
+ ...(input.description !== undefined && { description: input.description }),
64
+ };
65
+ return this.registerComponent(component);
66
+ }
67
+ addDomainOp(input) {
68
+ validateDomainExists(this.graph.metadata.domains, input.domain);
69
+ const id = generateComponentId(input.domain, input.module, 'domainop', input.name);
70
+ const component = {
71
+ id,
72
+ type: 'DomainOp',
73
+ name: input.name,
74
+ domain: input.domain,
75
+ module: input.module,
76
+ operationName: input.operationName,
77
+ sourceLocation: input.sourceLocation,
78
+ ...(input.entity !== undefined && { entity: input.entity }),
79
+ ...(input.signature !== undefined && { signature: input.signature }),
80
+ ...(input.behavior !== undefined && { behavior: input.behavior }),
81
+ ...(input.stateChanges !== undefined && { stateChanges: input.stateChanges }),
82
+ ...(input.businessRules !== undefined && { businessRules: input.businessRules }),
83
+ ...(input.description !== undefined && { description: input.description }),
84
+ };
85
+ return this.registerComponent(component);
86
+ }
87
+ addEvent(input) {
88
+ validateDomainExists(this.graph.metadata.domains, input.domain);
89
+ const id = generateComponentId(input.domain, input.module, 'event', input.name);
90
+ const component = {
91
+ id,
92
+ type: 'Event',
93
+ name: input.name,
94
+ domain: input.domain,
95
+ module: input.module,
96
+ eventName: input.eventName,
97
+ sourceLocation: input.sourceLocation,
98
+ ...(input.eventSchema !== undefined && { eventSchema: input.eventSchema }),
99
+ ...(input.description !== undefined && { description: input.description }),
100
+ };
101
+ return this.registerComponent(component);
102
+ }
103
+ addEventHandler(input) {
104
+ validateDomainExists(this.graph.metadata.domains, input.domain);
105
+ const id = generateComponentId(input.domain, input.module, 'eventhandler', input.name);
106
+ const component = {
107
+ id,
108
+ type: 'EventHandler',
109
+ name: input.name,
110
+ domain: input.domain,
111
+ module: input.module,
112
+ subscribedEvents: input.subscribedEvents,
113
+ sourceLocation: input.sourceLocation,
114
+ ...(input.description !== undefined && { description: input.description }),
115
+ };
116
+ return this.registerComponent(component);
117
+ }
118
+ defineCustomType(input) {
119
+ const customTypes = this.graph.metadata.customTypes;
120
+ if (customTypes[input.name]) {
121
+ throw new CustomTypeAlreadyDefinedError(input.name);
122
+ }
123
+ customTypes[input.name] = {
124
+ ...(input.requiredProperties !== undefined && { requiredProperties: input.requiredProperties, }),
125
+ ...(input.optionalProperties !== undefined && { optionalProperties: input.optionalProperties, }),
126
+ ...(input.description !== undefined && { description: input.description }),
127
+ };
128
+ }
129
+ addCustom(input) {
130
+ validateDomainExists(this.graph.metadata.domains, input.domain);
131
+ validateCustomType(this.graph.metadata.customTypes, input.customTypeName);
132
+ validateRequiredProperties(this.graph.metadata.customTypes, input.customTypeName, input.metadata);
133
+ const id = generateComponentId(input.domain, input.module, 'custom', input.name);
134
+ const component = {
135
+ id,
136
+ type: 'Custom',
137
+ customTypeName: input.customTypeName,
138
+ name: input.name,
139
+ domain: input.domain,
140
+ module: input.module,
141
+ sourceLocation: input.sourceLocation,
142
+ ...(input.description !== undefined && { description: input.description }),
143
+ ...input.metadata,
144
+ };
145
+ return this.registerComponent(component);
146
+ }
147
+ registerComponent(component) {
148
+ if (this.graph.components.some((c) => c.id === component.id)) {
149
+ throw new DuplicateComponentError(component.id);
150
+ }
151
+ this.graph.components.push(component);
152
+ return component;
153
+ }
154
+ }
@@ -1,4 +1,3 @@
1
1
  import type { StateTransition } from '@living-architecture/riviere-schema';
2
- export declare function deduplicateStrings(existing: string[], incoming: string[]): string[];
3
2
  export declare function deduplicateStateTransitions(existing: StateTransition[], incoming: StateTransition[]): StateTransition[];
4
- //# sourceMappingURL=deduplicate.d.ts.map
3
+ //# sourceMappingURL=deduplicate-transitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deduplicate-transitions.d.ts","sourceRoot":"","sources":["../../../src/domain/enrichment/deduplicate-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAE1E,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,eAAe,EAAE,EAC3B,QAAQ,EAAE,eAAe,EAAE,GAC1B,eAAe,EAAE,CAKnB"}
@@ -1,7 +1,3 @@
1
- export function deduplicateStrings(existing, incoming) {
2
- const existingSet = new Set(existing);
3
- return incoming.filter((item) => !existingSet.has(item));
4
- }
5
1
  export function deduplicateStateTransitions(existing, incoming) {
6
2
  return incoming.filter((item) => !existing.some((e) => e.from === item.from && e.to === item.to && e.trigger === item.trigger));
7
3
  }
@@ -0,0 +1,6 @@
1
+ export declare class InvalidEnrichmentTargetError extends Error {
2
+ readonly componentId: string;
3
+ readonly componentType: string;
4
+ constructor(componentId: string, componentType: string);
5
+ }
6
+ //# sourceMappingURL=enrichment-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enrichment-errors.d.ts","sourceRoot":"","sources":["../../../src/domain/enrichment/enrichment-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;gBAElB,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAMvD"}
@@ -0,0 +1,10 @@
1
+ export class InvalidEnrichmentTargetError extends Error {
2
+ componentId;
3
+ componentType;
4
+ constructor(componentId, componentType) {
5
+ super(`Only DomainOp components can be enriched. '${componentId}' is type '${componentType}'`);
6
+ this.name = 'InvalidEnrichmentTargetError';
7
+ this.componentId = componentId;
8
+ this.componentType = componentType;
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ import type { OperationBehavior, OperationSignature, StateTransition } from '@living-architecture/riviere-schema';
2
+ export interface EnrichmentInput {
3
+ entity?: string;
4
+ stateChanges?: StateTransition[];
5
+ businessRules?: string[];
6
+ behavior?: OperationBehavior;
7
+ signature?: OperationSignature;
8
+ }
9
+ //# sourceMappingURL=enrichment-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enrichment-types.d.ts","sourceRoot":"","sources":["../../../src/domain/enrichment/enrichment-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAChB,MAAM,qCAAqC,CAAA;AAE5C,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,eAAe,EAAE,CAAA;IAChC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,SAAS,CAAC,EAAE,kBAAkB,CAAA;CAC/B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { BuilderGraph } from '../builder-graph';
2
+ import type { EnrichmentInput } from './enrichment-types';
3
+ export declare class GraphEnrichment {
4
+ private readonly graph;
5
+ constructor(graph: BuilderGraph);
6
+ enrichComponent(id: string, enrichment: EnrichmentInput): void;
7
+ }
8
+ //# sourceMappingURL=graph-enrichment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-enrichment.d.ts","sourceRoot":"","sources":["../../../src/domain/enrichment/graph-enrichment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAOzD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,KAAK,EAAE,YAAY;IAI/B,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI;CA4B/D"}
@@ -0,0 +1,39 @@
1
+ import { InvalidEnrichmentTargetError } from './enrichment-errors';
2
+ import { createComponentNotFoundError } from '../construction/builder-internals';
3
+ import { deduplicateStateTransitions } from './deduplicate-transitions';
4
+ import { deduplicateStrings } from '../../platform/domain/collection-utils/deduplicate-strings';
5
+ import { mergeBehavior } from './merge-behavior';
6
+ export class GraphEnrichment {
7
+ graph;
8
+ constructor(graph) {
9
+ this.graph = graph;
10
+ }
11
+ enrichComponent(id, enrichment) {
12
+ const component = this.graph.components.find((c) => c.id === id);
13
+ if (!component) {
14
+ throw createComponentNotFoundError(this.graph.components, id);
15
+ }
16
+ if (component.type !== 'DomainOp') {
17
+ throw new InvalidEnrichmentTargetError(id, component.type);
18
+ }
19
+ if (enrichment.entity !== undefined) {
20
+ component.entity = enrichment.entity;
21
+ }
22
+ if (enrichment.stateChanges !== undefined) {
23
+ const existing = component.stateChanges ?? [];
24
+ const newItems = deduplicateStateTransitions(existing, enrichment.stateChanges);
25
+ component.stateChanges = [...existing, ...newItems];
26
+ }
27
+ if (enrichment.businessRules !== undefined) {
28
+ const existing = component.businessRules ?? [];
29
+ const newItems = deduplicateStrings(existing, enrichment.businessRules);
30
+ component.businessRules = [...existing, ...newItems];
31
+ }
32
+ if (enrichment.behavior !== undefined) {
33
+ component.behavior = mergeBehavior(component.behavior, enrichment.behavior);
34
+ }
35
+ if (enrichment.signature !== undefined) {
36
+ component.signature = enrichment.signature;
37
+ }
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-behavior.d.ts","sourceRoot":"","sources":["../../../src/domain/enrichment/merge-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAAE,iBAAiB,EACrC,MAAM,qCAAqC,CAAA;AAQ5C,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,EACvC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,CASnB"}
@@ -1,4 +1,4 @@
1
- import { deduplicateStrings } from './deduplicate';
1
+ import { deduplicateStrings } from '../../platform/domain/collection-utils/deduplicate-strings';
2
2
  function mergeStringArray(existing, incoming) {
3
3
  const base = existing ?? [];
4
4
  return [...base, ...deduplicateStrings(base, incoming)];
@@ -1,6 +1,6 @@
1
1
  import type { Component, ComponentId } from '@living-architecture/riviere-schema';
2
- import { ComponentNotFoundError } from './errors';
3
- import type { NearMatchOptions, NearMatchQuery, NearMatchResult } from './types';
2
+ import { ComponentNotFoundError } from '../construction/construction-errors';
3
+ import type { NearMatchOptions, NearMatchQuery, NearMatchResult } from './match-types';
4
4
  /**
5
5
  * Finds components similar to a query using fuzzy matching.
6
6
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-suggestion.d.ts","sourceRoot":"","sources":["../../../src/domain/error-recovery/component-suggestion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,WAAW,EACvB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACd,eAAe,EAChB,MAAM,eAAe,CAAA;AA+BtB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,SAAS,EAAE,EACvB,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,eAAe,EAAE,CAuBnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,SAAS,EAAE,EACvB,EAAE,EAAE,WAAW,GACd,sBAAsB,CAIxB"}
@@ -1,5 +1,5 @@
1
- import { ComponentNotFoundError } from './errors';
2
- import { similarityScore } from './string-similarity';
1
+ import { ComponentNotFoundError } from '../construction/construction-errors';
2
+ import { similarityScore } from '../../platform/domain/text-similarity/string-similarity';
3
3
  function detectMismatch(query, component) {
4
4
  const nameMatches = query.name.toLowerCase() === component.name.toLowerCase();
5
5
  if (!nameMatches) {
@@ -0,0 +1,21 @@
1
+ import type { ComponentType } from '@living-architecture/riviere-schema';
2
+ export interface NearMatchQuery {
3
+ name: string;
4
+ type?: ComponentType;
5
+ domain?: string;
6
+ }
7
+ export interface NearMatchMismatch {
8
+ field: 'type' | 'domain';
9
+ expected: string;
10
+ actual: string;
11
+ }
12
+ export interface NearMatchResult {
13
+ component: import('@living-architecture/riviere-schema').Component;
14
+ score: number;
15
+ mismatch?: NearMatchMismatch | undefined;
16
+ }
17
+ export interface NearMatchOptions {
18
+ threshold?: number;
19
+ limit?: number;
20
+ }
21
+ //# sourceMappingURL=match-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-types.d.ts","sourceRoot":"","sources":["../../../src/domain/error-recovery/match-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,OAAO,qCAAqC,EAAE,SAAS,CAAA;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAA;CACzC;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { BuilderGraph } from '../builder-graph';
2
+ import type { NearMatchOptions, NearMatchQuery, NearMatchResult } from './match-types';
3
+ export declare class NearMatch {
4
+ private readonly graph;
5
+ constructor(graph: BuilderGraph);
6
+ findNearMatches(query: NearMatchQuery, options?: NearMatchOptions): NearMatchResult[];
7
+ }
8
+ //# sourceMappingURL=near-match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"near-match.d.ts","sourceRoot":"","sources":["../../../src/domain/error-recovery/near-match.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EACV,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAClD,MAAM,eAAe,CAAA;AAGtB,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,KAAK,EAAE,YAAY;IAI/B,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe,EAAE;CAGtF"}
@@ -0,0 +1,10 @@
1
+ import { findNearMatches } from './component-suggestion';
2
+ export class NearMatch {
3
+ graph;
4
+ constructor(graph) {
5
+ this.graph = graph;
6
+ }
7
+ findNearMatches(query, options) {
8
+ return findNearMatches(this.graph.components, query, options);
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ export * from './builder-facade';
2
+ export { ComponentId, type ComponentIdParts } from '@living-architecture/riviere-schema';
3
+ export { DuplicateDomainError, DomainNotFoundError, CustomTypeNotFoundError, DuplicateComponentError, ComponentNotFoundError, CustomTypeAlreadyDefinedError, MissingRequiredPropertiesError, InvalidGraphError, MissingSourcesError, MissingDomainsError, BuildValidationError, } from './construction/construction-errors';
4
+ export { InvalidEnrichmentTargetError } from './enrichment/enrichment-errors';
5
+ export { findNearMatches } from './error-recovery/component-suggestion';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,WAAW,EAAE,KAAK,gBAAgB,EACnC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './builder-facade';
2
+ export { ComponentId } from '@living-architecture/riviere-schema';
3
+ export { DuplicateDomainError, DomainNotFoundError, CustomTypeNotFoundError, DuplicateComponentError, ComponentNotFoundError, CustomTypeAlreadyDefinedError, MissingRequiredPropertiesError, InvalidGraphError, MissingSourcesError, MissingDomainsError, BuildValidationError, } from './construction/construction-errors';
4
+ export { InvalidEnrichmentTargetError } from './enrichment/enrichment-errors';
5
+ export { findNearMatches } from './error-recovery/component-suggestion';
@@ -0,0 +1,14 @@
1
+ import type { ValidationResult } from '@living-architecture/riviere-query';
2
+ import { RiviereQuery } from '@living-architecture/riviere-query';
3
+ import type { BuilderGraph } from '../builder-graph';
4
+ import type { BuilderStats, BuilderWarning } from './inspection-types';
5
+ export declare class GraphInspection {
6
+ private readonly graph;
7
+ constructor(graph: BuilderGraph);
8
+ warnings(): BuilderWarning[];
9
+ stats(): BuilderStats;
10
+ orphans(): string[];
11
+ validate(): ValidationResult;
12
+ query(): RiviereQuery;
13
+ }
14
+ //# sourceMappingURL=graph-inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-inspection.d.ts","sourceRoot":"","sources":["../../../src/domain/inspection/graph-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EAAE,cAAc,EAC7B,MAAM,oBAAoB,CAAA;AAS3B,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,KAAK,EAAE,YAAY;IAI/B,QAAQ,IAAI,cAAc,EAAE;IAI5B,KAAK,IAAI,YAAY;IAIrB,OAAO,IAAI,MAAM,EAAE;IAInB,QAAQ,IAAI,gBAAgB;IAI5B,KAAK,IAAI,YAAY;CAGtB"}
@@ -0,0 +1,23 @@
1
+ import { RiviereQuery } from '@living-architecture/riviere-query';
2
+ import { calculateStats, findOrphans, findWarnings, toRiviereGraph, validateGraph, } from './inspection-functions';
3
+ export class GraphInspection {
4
+ graph;
5
+ constructor(graph) {
6
+ this.graph = graph;
7
+ }
8
+ warnings() {
9
+ return findWarnings(this.graph);
10
+ }
11
+ stats() {
12
+ return calculateStats(this.graph);
13
+ }
14
+ orphans() {
15
+ return findOrphans(this.graph);
16
+ }
17
+ validate() {
18
+ return validateGraph(this.graph);
19
+ }
20
+ query() {
21
+ return new RiviereQuery(toRiviereGraph(this.graph));
22
+ }
23
+ }
@@ -1,6 +1,6 @@
1
1
  import type { Component, CustomTypeDefinition, DomainMetadata, ExternalLink, Link, RiviereGraph, SourceInfo } from '@living-architecture/riviere-schema';
2
2
  import { type ValidationResult } from '@living-architecture/riviere-query';
3
- import type { BuilderStats, BuilderWarning } from './types';
3
+ import type { BuilderStats, BuilderWarning } from './inspection-types';
4
4
  interface InspectionGraph {
5
5
  version: string;
6
6
  metadata: {
@@ -87,4 +87,4 @@ export declare function toRiviereGraph(graph: InspectionGraph): RiviereGraph;
87
87
  */
88
88
  export declare function validateGraph(graph: InspectionGraph): ValidationResult;
89
89
  export {};
90
- //# sourceMappingURL=inspection.d.ts.map
90
+ //# sourceMappingURL=inspection-functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-functions.d.ts","sourceRoot":"","sources":["../../../src/domain/inspection/inspection-functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,UAAU,EACX,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACS,KAAK,gBAAgB,EACpC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EACV,YAAY,EAAE,cAAc,EAC7B,MAAM,oBAAoB,CAAA;AAE3B,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,EAAE,UAAU,EAAE,CAAA;QACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;QACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;KAClD,CAAA;IACD,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,EAAE,CAa5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAiBnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,EAAE,CAuBrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAiBnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAEtE"}
@@ -0,0 +1,23 @@
1
+ export interface BuilderStats {
2
+ componentCount: number;
3
+ componentsByType: {
4
+ UI: number;
5
+ API: number;
6
+ UseCase: number;
7
+ DomainOp: number;
8
+ Event: number;
9
+ EventHandler: number;
10
+ Custom: number;
11
+ };
12
+ linkCount: number;
13
+ externalLinkCount: number;
14
+ domainCount: number;
15
+ }
16
+ export type WarningCode = 'ORPHAN_COMPONENT' | 'UNUSED_DOMAIN';
17
+ export interface BuilderWarning {
18
+ code: WarningCode;
19
+ message: string;
20
+ componentId?: string;
21
+ domainName?: string;
22
+ }
23
+ //# sourceMappingURL=inspection-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspection-types.d.ts","sourceRoot":"","sources":["../../../src/domain/inspection/inspection-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE;QAChB,EAAE,EAAE,MAAM,CAAA;QACV,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAA;QACpB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ExternalLink, Link } from '@living-architecture/riviere-schema';
2
+ import type { BuilderGraph } from '../builder-graph';
3
+ import type { ExternalLinkInput, LinkInput } from './linking-types';
4
+ export declare class GraphLinking {
5
+ private readonly graph;
6
+ constructor(graph: BuilderGraph);
7
+ link(input: LinkInput): Link;
8
+ linkExternal(input: ExternalLinkInput): ExternalLink;
9
+ }
10
+ //# sourceMappingURL=graph-linking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-linking.d.ts","sourceRoot":"","sources":["../../../src/domain/linking/graph-linking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,IAAI,EACnB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EACV,iBAAiB,EAAE,SAAS,EAC7B,MAAM,iBAAiB,CAAA;AAGxB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,KAAK,EAAE,YAAY;IAI/B,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAe5B,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY;CAgBrD"}
@@ -0,0 +1,35 @@
1
+ import { createComponentNotFoundError } from '../construction/builder-internals';
2
+ export class GraphLinking {
3
+ graph;
4
+ constructor(graph) {
5
+ this.graph = graph;
6
+ }
7
+ link(input) {
8
+ const sourceExists = this.graph.components.some((c) => c.id === input.from);
9
+ if (!sourceExists) {
10
+ throw createComponentNotFoundError(this.graph.components, input.from);
11
+ }
12
+ const link = {
13
+ source: input.from,
14
+ target: input.to,
15
+ ...(input.type !== undefined && { type: input.type }),
16
+ };
17
+ this.graph.links.push(link);
18
+ return link;
19
+ }
20
+ linkExternal(input) {
21
+ const sourceExists = this.graph.components.some((c) => c.id === input.from);
22
+ if (!sourceExists) {
23
+ throw createComponentNotFoundError(this.graph.components, input.from);
24
+ }
25
+ const externalLink = {
26
+ source: input.from,
27
+ target: input.target,
28
+ ...(input.type !== undefined && { type: input.type }),
29
+ ...(input.description !== undefined && { description: input.description }),
30
+ ...(input.sourceLocation !== undefined && { sourceLocation: input.sourceLocation }),
31
+ };
32
+ this.graph.externalLinks.push(externalLink);
33
+ return externalLink;
34
+ }
35
+ }
@@ -0,0 +1,15 @@
1
+ import type { ExternalTarget, LinkType, SourceLocation } from '@living-architecture/riviere-schema';
2
+ export interface LinkInput {
3
+ from: string;
4
+ to: string;
5
+ type?: LinkType;
6
+ }
7
+ export interface ExternalLinkInput {
8
+ from: string;
9
+ target: ExternalTarget;
10
+ type?: LinkType;
11
+ description?: string;
12
+ sourceLocation?: SourceLocation;
13
+ metadata?: Record<string, unknown>;
14
+ }
15
+ //# sourceMappingURL=linking-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linking-types.d.ts","sourceRoot":"","sources":["../../../src/domain/linking/linking-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAAE,QAAQ,EAAE,cAAc,EACzC,MAAM,qCAAqC,CAAA;AAE5C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,cAAc,CAAA;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { RiviereGraph } from '@living-architecture/riviere-schema';
2
+ import { GraphConstruction } from './construction/graph-construction';
3
+ import { GraphEnrichment } from './enrichment/graph-enrichment';
4
+ import { GraphLinking } from './linking/graph-linking';
5
+ import { GraphInspection } from './inspection/graph-inspection';
6
+ import { NearMatch } from './error-recovery/near-match';
7
+ import type { BuilderOptions } from './construction/construction-types';
8
+ export declare class RiviereBuilder {
9
+ readonly construction: GraphConstruction;
10
+ readonly enrichment: GraphEnrichment;
11
+ readonly linking: GraphLinking;
12
+ readonly inspection: GraphInspection;
13
+ readonly errorRecovery: NearMatch;
14
+ private readonly graph;
15
+ private constructor();
16
+ static resume(graph: RiviereGraph): RiviereBuilder;
17
+ static new(options: BuilderOptions): RiviereBuilder;
18
+ serialize(): string;
19
+ build(): RiviereGraph;
20
+ }
21
+ //# sourceMappingURL=riviere-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"riviere-builder.d.ts","sourceRoot":"","sources":["../../src/domain/riviere-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASvE,qBAAa,cAAc;IACzB,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAA;IACxC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;IACpC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;IACpC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAA;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IAEpC,OAAO;IASP,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc;IAmBlD,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc;IA0BnD,SAAS,IAAI,MAAM;IAInB,KAAK,IAAI,YAAY;CAQtB"}