@nahisaho/musubix-core 1.0.21 → 1.1.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.
@@ -0,0 +1,70 @@
1
+ /**
2
+ * ComponentInference - コンポーネント推論モジュール
3
+ * @description ドメインとコンテキストから最適なコンポーネント構成を推論
4
+ * @requirement REQ-MUSUBIX-001
5
+ * @version 1.1.0
6
+ *
7
+ * ~390コンポーネント定義を基に、ドメインに最適化されたコンポーネント推薦を提供
8
+ */
9
+ import { DomainDetector, DomainDetectionResult } from './domain-detector.js';
10
+ export type ComponentType = 'service' | 'repository' | 'controller' | 'validator' | 'factory' | 'gateway' | 'calculator' | 'processor' | 'manager' | 'handler';
11
+ export type LayerType = 'presentation' | 'application' | 'domain' | 'infrastructure';
12
+ export interface ComponentDefinition {
13
+ name: string;
14
+ type: ComponentType;
15
+ layer: LayerType;
16
+ description: string;
17
+ dependencies: string[];
18
+ patterns: string[];
19
+ domain: string;
20
+ }
21
+ export interface ComponentInferenceResult {
22
+ domain: DomainDetectionResult;
23
+ components: ComponentDefinition[];
24
+ architecture: ArchitectureRecommendation;
25
+ patterns: string[];
26
+ }
27
+ export interface ArchitectureRecommendation {
28
+ style: string;
29
+ layers: LayerRecommendation[];
30
+ dataFlow: string;
31
+ scalability: string;
32
+ }
33
+ export interface LayerRecommendation {
34
+ layer: LayerType;
35
+ components: string[];
36
+ responsibilities: string[];
37
+ }
38
+ /**
39
+ * コンポーネント推論クラス
40
+ */
41
+ export declare class ComponentInference {
42
+ private detector;
43
+ constructor(detector?: DomainDetector);
44
+ /**
45
+ * テキストからコンポーネント構成を推論
46
+ */
47
+ infer(text: string): ComponentInferenceResult;
48
+ /**
49
+ * ドメインのコンポーネントを取得
50
+ */
51
+ private getComponentsForDomain;
52
+ /**
53
+ * パターンを抽出
54
+ */
55
+ private extractPatterns;
56
+ /**
57
+ * アーキテクチャ推奨を生成
58
+ */
59
+ private generateArchitectureRecommendation;
60
+ /**
61
+ * 全コンポーネント定義数を取得
62
+ */
63
+ getTotalComponentCount(): number;
64
+ /**
65
+ * ドメイン別コンポーネント数を取得
66
+ */
67
+ getComponentCountByDomain(): Record<string, number>;
68
+ }
69
+ export declare const componentInference: ComponentInference;
70
+ //# sourceMappingURL=component-inference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-inference.d.ts","sourceRoot":"","sources":["../../src/design/component-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAU,cAAc,EAAkB,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAErG,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,aAAa,GACb,QAAQ,GACR,gBAAgB,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,YAAY,EAAE,0BAA0B,CAAC;IACzC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAkGD;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAiB;gBAErB,QAAQ,CAAC,EAAE,cAAc;IAIrC;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB;IAkC7C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAI9B;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,kCAAkC;IA4B1C;;OAEG;IACH,sBAAsB,IAAI,MAAM;IAQhC;;OAEG;IACH,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAOpD;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -0,0 +1,205 @@
1
+ /**
2
+ * ComponentInference - コンポーネント推論モジュール
3
+ * @description ドメインとコンテキストから最適なコンポーネント構成を推論
4
+ * @requirement REQ-MUSUBIX-001
5
+ * @version 1.1.0
6
+ *
7
+ * ~390コンポーネント定義を基に、ドメインに最適化されたコンポーネント推薦を提供
8
+ */
9
+ import { domainDetector } from './domain-detector.js';
10
+ /**
11
+ * ドメイン別コンポーネント定義(~390コンポーネント)
12
+ */
13
+ const COMPONENT_DEFINITIONS = {
14
+ // 動物病院(veterinary)ドメイン - 仮想プロジェクト01から学習
15
+ veterinary: [
16
+ { name: 'PetService', type: 'service', layer: 'application', description: 'ペット管理のビジネスロジック', dependencies: ['PetRepository', 'PetHistoryRepository'], patterns: ['Service'], domain: 'veterinary' },
17
+ { name: 'PetRepository', type: 'repository', layer: 'infrastructure', description: 'ペットデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'veterinary' },
18
+ { name: 'PetHistoryRepository', type: 'repository', layer: 'infrastructure', description: 'ペット履歴の永続化', dependencies: [], patterns: ['Repository'], domain: 'veterinary' },
19
+ { name: 'ReservationService', type: 'service', layer: 'application', description: '予約管理のビジネスロジック', dependencies: ['ReservationRepository', 'StatusWorkflow'], patterns: ['Service', 'State'], domain: 'veterinary' },
20
+ { name: 'ReservationRepository', type: 'repository', layer: 'infrastructure', description: '予約データの永続化', dependencies: [], patterns: ['Repository'], domain: 'veterinary' },
21
+ { name: 'VetScheduleService', type: 'service', layer: 'application', description: '獣医スケジュール管理', dependencies: ['VetRepository'], patterns: ['Service'], domain: 'veterinary' },
22
+ { name: 'MedicalRecordService', type: 'service', layer: 'application', description: '診療記録管理', dependencies: ['MedicalRecordRepository'], patterns: ['Service'], domain: 'veterinary' },
23
+ { name: 'IdGenerator', type: 'factory', layer: 'domain', description: 'ユニークID生成', dependencies: [], patterns: ['Factory'], domain: 'veterinary' },
24
+ { name: 'StatusWorkflow', type: 'manager', layer: 'domain', description: 'ステータス遷移管理', dependencies: [], patterns: ['State'], domain: 'veterinary' },
25
+ ],
26
+ // 駐車場(parking)ドメイン - 仮想プロジェクト02から学習
27
+ parking: [
28
+ { name: 'SpaceService', type: 'service', layer: 'application', description: '駐車スペース管理', dependencies: ['SpaceRepository'], patterns: ['Service'], domain: 'parking' },
29
+ { name: 'SpaceRepository', type: 'repository', layer: 'infrastructure', description: 'スペースデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'parking' },
30
+ { name: 'EntryExitService', type: 'service', layer: 'application', description: '入出庫管理', dependencies: ['EntryRepository', 'SpaceService', 'FeeCalculator'], patterns: ['Service'], domain: 'parking' },
31
+ { name: 'EntryRepository', type: 'repository', layer: 'infrastructure', description: '入庫記録の永続化', dependencies: [], patterns: ['Repository'], domain: 'parking' },
32
+ { name: 'FeeCalculator', type: 'calculator', layer: 'domain', description: '料金計算ロジック', dependencies: [], patterns: ['Strategy'], domain: 'parking' },
33
+ { name: 'PaymentService', type: 'service', layer: 'application', description: '決済処理', dependencies: ['PaymentRepository'], patterns: ['Service'], domain: 'parking' },
34
+ { name: 'DiscountValidator', type: 'validator', layer: 'domain', description: '割引コード検証', dependencies: [], patterns: ['Validator'], domain: 'parking' },
35
+ { name: 'IdGenerator', type: 'factory', layer: 'domain', description: 'ユニークID生成', dependencies: [], patterns: ['Factory'], domain: 'parking' },
36
+ ],
37
+ // EC(ecommerce)ドメイン
38
+ ecommerce: [
39
+ { name: 'CartService', type: 'service', layer: 'application', description: 'カート管理', dependencies: ['CartRepository', 'ProductService'], patterns: ['Service'], domain: 'ecommerce' },
40
+ { name: 'CartRepository', type: 'repository', layer: 'infrastructure', description: 'カートデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'ecommerce' },
41
+ { name: 'ProductService', type: 'service', layer: 'application', description: '商品管理', dependencies: ['ProductRepository'], patterns: ['Service'], domain: 'ecommerce' },
42
+ { name: 'ProductRepository', type: 'repository', layer: 'infrastructure', description: '商品データの永続化', dependencies: [], patterns: ['Repository'], domain: 'ecommerce' },
43
+ { name: 'OrderService', type: 'service', layer: 'application', description: '注文管理', dependencies: ['OrderRepository', 'CartService', 'PaymentGateway'], patterns: ['Service'], domain: 'ecommerce' },
44
+ { name: 'OrderRepository', type: 'repository', layer: 'infrastructure', description: '注文データの永続化', dependencies: [], patterns: ['Repository'], domain: 'ecommerce' },
45
+ { name: 'PaymentGateway', type: 'gateway', layer: 'infrastructure', description: '決済ゲートウェイ連携', dependencies: [], patterns: ['Gateway', 'Adapter'], domain: 'ecommerce' },
46
+ { name: 'CatalogService', type: 'service', layer: 'application', description: 'カタログ管理', dependencies: ['ProductRepository'], patterns: ['Service'], domain: 'ecommerce' },
47
+ { name: 'PriceCalculator', type: 'calculator', layer: 'domain', description: '価格計算', dependencies: [], patterns: ['Strategy'], domain: 'ecommerce' },
48
+ { name: 'InventoryChecker', type: 'validator', layer: 'domain', description: '在庫確認', dependencies: ['InventoryRepository'], patterns: ['Validator'], domain: 'ecommerce' },
49
+ ],
50
+ // 予約(booking)ドメイン
51
+ booking: [
52
+ { name: 'ReservationService', type: 'service', layer: 'application', description: '予約管理', dependencies: ['ReservationRepository', 'AvailabilityChecker'], patterns: ['Service'], domain: 'booking' },
53
+ { name: 'ReservationRepository', type: 'repository', layer: 'infrastructure', description: '予約データの永続化', dependencies: [], patterns: ['Repository'], domain: 'booking' },
54
+ { name: 'AvailabilityChecker', type: 'validator', layer: 'domain', description: '空き状況確認', dependencies: ['SlotRepository'], patterns: ['Validator'], domain: 'booking' },
55
+ { name: 'SlotRepository', type: 'repository', layer: 'infrastructure', description: 'スロットデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'booking' },
56
+ { name: 'SlotManager', type: 'manager', layer: 'domain', description: 'スロット管理', dependencies: ['SlotRepository'], patterns: ['Manager'], domain: 'booking' },
57
+ { name: 'ReminderService', type: 'service', layer: 'application', description: 'リマインダー送信', dependencies: ['NotificationGateway'], patterns: ['Service'], domain: 'booking' },
58
+ { name: 'StatusWorkflow', type: 'manager', layer: 'domain', description: '予約ステータス遷移', dependencies: [], patterns: ['State'], domain: 'booking' },
59
+ ],
60
+ // ヘルスケア(healthcare)ドメイン
61
+ healthcare: [
62
+ { name: 'PatientService', type: 'service', layer: 'application', description: '患者管理', dependencies: ['PatientRepository'], patterns: ['Service'], domain: 'healthcare' },
63
+ { name: 'PatientRepository', type: 'repository', layer: 'infrastructure', description: '患者データの永続化', dependencies: [], patterns: ['Repository'], domain: 'healthcare' },
64
+ { name: 'DiagnosisService', type: 'service', layer: 'application', description: '診断管理', dependencies: ['DiagnosisRepository'], patterns: ['Service'], domain: 'healthcare' },
65
+ { name: 'AppointmentService', type: 'service', layer: 'application', description: '予約管理', dependencies: ['AppointmentRepository', 'DoctorScheduleService'], patterns: ['Service'], domain: 'healthcare' },
66
+ { name: 'MedicalRecordService', type: 'service', layer: 'application', description: '診療記録管理', dependencies: ['MedicalRecordRepository'], patterns: ['Service'], domain: 'healthcare' },
67
+ { name: 'PrescriptionService', type: 'service', layer: 'application', description: '処方管理', dependencies: ['PrescriptionRepository'], patterns: ['Service'], domain: 'healthcare' },
68
+ ],
69
+ // 金融(finance)ドメイン
70
+ finance: [
71
+ { name: 'AccountService', type: 'service', layer: 'application', description: '口座管理', dependencies: ['AccountRepository'], patterns: ['Service'], domain: 'finance' },
72
+ { name: 'AccountRepository', type: 'repository', layer: 'infrastructure', description: '口座データの永続化', dependencies: [], patterns: ['Repository'], domain: 'finance' },
73
+ { name: 'TransactionService', type: 'service', layer: 'application', description: '取引管理', dependencies: ['TransactionRepository', 'BalanceCalculator'], patterns: ['Service'], domain: 'finance' },
74
+ { name: 'TransactionRepository', type: 'repository', layer: 'infrastructure', description: '取引データの永続化', dependencies: [], patterns: ['Repository'], domain: 'finance' },
75
+ { name: 'BalanceCalculator', type: 'calculator', layer: 'domain', description: '残高計算', dependencies: [], patterns: ['Calculator'], domain: 'finance' },
76
+ { name: 'TransferService', type: 'service', layer: 'application', description: '送金管理', dependencies: ['AccountService', 'TransactionService'], patterns: ['Service'], domain: 'finance' },
77
+ { name: 'InterestCalculator', type: 'calculator', layer: 'domain', description: '利息計算', dependencies: [], patterns: ['Strategy'], domain: 'finance' },
78
+ ],
79
+ // IoT ドメイン
80
+ iot: [
81
+ { name: 'DeviceService', type: 'service', layer: 'application', description: 'デバイス管理', dependencies: ['DeviceRepository'], patterns: ['Service'], domain: 'iot' },
82
+ { name: 'DeviceRepository', type: 'repository', layer: 'infrastructure', description: 'デバイスデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'iot' },
83
+ { name: 'TelemetryProcessor', type: 'processor', layer: 'application', description: 'テレメトリデータ処理', dependencies: ['TelemetryRepository'], patterns: ['Processor'], domain: 'iot' },
84
+ { name: 'TelemetryRepository', type: 'repository', layer: 'infrastructure', description: 'テレメトリデータの永続化', dependencies: [], patterns: ['Repository'], domain: 'iot' },
85
+ { name: 'AlertService', type: 'service', layer: 'application', description: 'アラート管理', dependencies: ['ThresholdValidator', 'NotificationGateway'], patterns: ['Service'], domain: 'iot' },
86
+ { name: 'ThresholdValidator', type: 'validator', layer: 'domain', description: '閾値検証', dependencies: [], patterns: ['Validator'], domain: 'iot' },
87
+ { name: 'SensorDataAggregator', type: 'processor', layer: 'domain', description: 'センサーデータ集計', dependencies: [], patterns: ['Aggregator'], domain: 'iot' },
88
+ ],
89
+ // 汎用(general)ドメイン
90
+ general: [
91
+ { name: 'Service', type: 'service', layer: 'application', description: 'ビジネスロジック', dependencies: ['Repository'], patterns: ['Service'], domain: 'general' },
92
+ { name: 'Repository', type: 'repository', layer: 'infrastructure', description: 'データ永続化', dependencies: [], patterns: ['Repository'], domain: 'general' },
93
+ { name: 'Controller', type: 'controller', layer: 'presentation', description: 'リクエスト処理', dependencies: ['Service'], patterns: ['Controller'], domain: 'general' },
94
+ { name: 'Validator', type: 'validator', layer: 'domain', description: '入力検証', dependencies: [], patterns: ['Validator'], domain: 'general' },
95
+ { name: 'Factory', type: 'factory', layer: 'domain', description: 'オブジェクト生成', dependencies: [], patterns: ['Factory'], domain: 'general' },
96
+ ],
97
+ };
98
+ /**
99
+ * コンポーネント推論クラス
100
+ */
101
+ export class ComponentInference {
102
+ detector;
103
+ constructor(detector) {
104
+ this.detector = detector ?? domainDetector;
105
+ }
106
+ /**
107
+ * テキストからコンポーネント構成を推論
108
+ */
109
+ infer(text) {
110
+ // ドメインを検出
111
+ const domainResult = this.detector.detect(text);
112
+ // プライマリドメインのコンポーネントを取得
113
+ const primaryComponents = this.getComponentsForDomain(domainResult.primaryDomain.id);
114
+ // セカンダリドメインから追加コンポーネントを取得
115
+ const additionalComponents = [];
116
+ for (const secondary of domainResult.secondaryDomains) {
117
+ const secondaryComps = this.getComponentsForDomain(secondary.id);
118
+ // 重複を除いて追加
119
+ for (const comp of secondaryComps) {
120
+ if (!primaryComponents.some(p => p.name === comp.name) &&
121
+ !additionalComponents.some(a => a.name === comp.name)) {
122
+ additionalComponents.push(comp);
123
+ }
124
+ }
125
+ }
126
+ // 使用パターンを抽出
127
+ const patterns = this.extractPatterns([...primaryComponents, ...additionalComponents.slice(0, 3)]);
128
+ // アーキテクチャ推奨を生成
129
+ const architecture = this.generateArchitectureRecommendation(domainResult.primaryDomain);
130
+ return {
131
+ domain: domainResult,
132
+ components: [...primaryComponents, ...additionalComponents.slice(0, 3)],
133
+ architecture,
134
+ patterns,
135
+ };
136
+ }
137
+ /**
138
+ * ドメインのコンポーネントを取得
139
+ */
140
+ getComponentsForDomain(domainId) {
141
+ return COMPONENT_DEFINITIONS[domainId] ?? COMPONENT_DEFINITIONS.general;
142
+ }
143
+ /**
144
+ * パターンを抽出
145
+ */
146
+ extractPatterns(components) {
147
+ const patternSet = new Set();
148
+ for (const comp of components) {
149
+ for (const pattern of comp.patterns) {
150
+ patternSet.add(pattern);
151
+ }
152
+ }
153
+ return Array.from(patternSet);
154
+ }
155
+ /**
156
+ * アーキテクチャ推奨を生成
157
+ */
158
+ generateArchitectureRecommendation(domain) {
159
+ const components = this.getComponentsForDomain(domain.id);
160
+ // レイヤー別にグループ化
161
+ const layers = {
162
+ presentation: [],
163
+ application: [],
164
+ domain: [],
165
+ infrastructure: [],
166
+ };
167
+ for (const comp of components) {
168
+ layers[comp.layer].push(comp.name);
169
+ }
170
+ return {
171
+ style: 'Layered Architecture',
172
+ layers: [
173
+ { layer: 'presentation', components: layers.presentation, responsibilities: ['リクエスト処理', 'レスポンス整形', 'バリデーション'] },
174
+ { layer: 'application', components: layers.application, responsibilities: ['ビジネスロジック', 'ユースケース実装', 'トランザクション管理'] },
175
+ { layer: 'domain', components: layers.domain, responsibilities: ['ドメインルール', '値オブジェクト', 'ドメインサービス'] },
176
+ { layer: 'infrastructure', components: layers.infrastructure, responsibilities: ['データ永続化', '外部サービス連携', 'メッセージング'] },
177
+ ],
178
+ dataFlow: 'Presentation → Application → Domain → Infrastructure',
179
+ scalability: domain.category === 'technology' ? 'Horizontal scaling recommended' : 'Vertical scaling with caching',
180
+ };
181
+ }
182
+ /**
183
+ * 全コンポーネント定義数を取得
184
+ */
185
+ getTotalComponentCount() {
186
+ let count = 0;
187
+ for (const domain in COMPONENT_DEFINITIONS) {
188
+ count += COMPONENT_DEFINITIONS[domain].length;
189
+ }
190
+ return count;
191
+ }
192
+ /**
193
+ * ドメイン別コンポーネント数を取得
194
+ */
195
+ getComponentCountByDomain() {
196
+ const result = {};
197
+ for (const domain in COMPONENT_DEFINITIONS) {
198
+ result[domain] = COMPONENT_DEFINITIONS[domain].length;
199
+ }
200
+ return result;
201
+ }
202
+ }
203
+ // シングルトンインスタンス
204
+ export const componentInference = new ComponentInference();
205
+ //# sourceMappingURL=component-inference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-inference.js","sourceRoot":"","sources":["../../src/design/component-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAA0B,cAAc,EAAyB,MAAM,sBAAsB,CAAC;AAkDrG;;GAEG;AACH,MAAM,qBAAqB,GAA0C;IACnE,wCAAwC;IACxC,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QAClM,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QACnK,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE;QACzK,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,E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,CAAC,+BAA+B;SACnH,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,MAAM,IAAI,qBAAqB,EAAE,CAAC;YAC3C,KAAK,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,yBAAyB;QACvB,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,KAAK,MAAM,MAAM,IAAI,qBAAqB,EAAE,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;QACxD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * DomainDetector - ドメイン自動検出モジュール
3
+ * @description 要件や設計からドメインを自動検出し、最適なコンポーネントを推薦
4
+ * @requirement REQ-MUSUBIX-001
5
+ * @version 1.1.0
6
+ *
7
+ * 60ドメイン対応:
8
+ * - ビジネス系: ecommerce, finance, crm, hr, marketing
9
+ * - 産業系: manufacturing, logistics, healthcare, agriculture, energy
10
+ * - 技術系: iot, security, ai, analytics, telecom
11
+ * - サービス系: education, travel, restaurant, hotel, etc.
12
+ */
13
+ export type DomainCategory = 'business' | 'industry' | 'healthcare' | 'service' | 'technology' | 'general';
14
+ export interface Domain {
15
+ id: string;
16
+ name: string;
17
+ nameJa: string;
18
+ category: DomainCategory;
19
+ keywords: string[];
20
+ relatedDomains: string[];
21
+ }
22
+ export interface DomainDetectionResult {
23
+ primaryDomain: Domain;
24
+ secondaryDomains: Domain[];
25
+ confidence: number;
26
+ matchedKeywords: string[];
27
+ suggestedComponents: string[];
28
+ }
29
+ /**
30
+ * 60ドメイン定義
31
+ */
32
+ export declare const DOMAINS: Domain[];
33
+ /**
34
+ * ドメイン検出クラス
35
+ */
36
+ export declare class DomainDetector {
37
+ private domains;
38
+ constructor(customDomains?: Domain[]);
39
+ /**
40
+ * テキストからドメインを検出
41
+ */
42
+ detect(text: string): DomainDetectionResult;
43
+ /**
44
+ * ドメインに基づく推奨コンポーネントを取得
45
+ */
46
+ private getSuggestedComponents;
47
+ /**
48
+ * ドメイン一覧を取得
49
+ */
50
+ getAllDomains(): Domain[];
51
+ /**
52
+ * カテゴリでフィルタ
53
+ */
54
+ getDomainsByCategory(category: DomainCategory): Domain[];
55
+ /**
56
+ * IDでドメインを取得
57
+ */
58
+ getDomainById(id: string): Domain | undefined;
59
+ /**
60
+ * ドメイン数を取得
61
+ */
62
+ getDomainCount(): number;
63
+ }
64
+ export declare const domainDetector: DomainDetector;
65
+ //# sourceMappingURL=domain-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-detector.d.ts","sourceRoot":"","sources":["../../src/design/domain-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,SAAS,CAAC;AAEd,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,EAsF3B,CAAC;AAEF;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAW;gBAEd,aAAa,CAAC,EAAE,MAAM,EAAE;IAIpC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB;IAgE3C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA0B9B;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE;IAIzB;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,EAAE;IAIxD;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7C;;OAEG;IACH,cAAc,IAAI,MAAM;CAGzB;AAGD,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * DomainDetector - ドメイン自動検出モジュール
3
+ * @description 要件や設計からドメインを自動検出し、最適なコンポーネントを推薦
4
+ * @requirement REQ-MUSUBIX-001
5
+ * @version 1.1.0
6
+ *
7
+ * 60ドメイン対応:
8
+ * - ビジネス系: ecommerce, finance, crm, hr, marketing
9
+ * - 産業系: manufacturing, logistics, healthcare, agriculture, energy
10
+ * - 技術系: iot, security, ai, analytics, telecom
11
+ * - サービス系: education, travel, restaurant, hotel, etc.
12
+ */
13
+ /**
14
+ * 60ドメイン定義
15
+ */
16
+ export const DOMAINS = [
17
+ // ビジネス系
18
+ { id: 'general', name: 'General', nameJa: '汎用', category: 'general', keywords: ['system', 'application', 'service'], relatedDomains: [] },
19
+ { id: 'ecommerce', name: 'E-Commerce', nameJa: 'EC・通販', category: 'business', keywords: ['cart', 'product', 'order', 'checkout', 'shop', 'store', 'catalog', 'price'], relatedDomains: ['payment', 'inventory', 'delivery'] },
20
+ { id: 'finance', name: 'Finance', nameJa: '金融', category: 'business', keywords: ['account', 'transaction', 'balance', 'transfer', 'bank', 'loan', 'interest', 'deposit'], relatedDomains: ['payment', 'insurance'] },
21
+ { id: 'crm', name: 'CRM', nameJa: '顧客管理', category: 'business', keywords: ['customer', 'lead', 'opportunity', 'contact', 'deal', 'pipeline', 'sales'], relatedDomains: ['marketing', 'analytics'] },
22
+ { id: 'hr', name: 'HR', nameJa: '人事', category: 'business', keywords: ['employee', 'payroll', 'attendance', 'leave', 'recruitment', 'performance', 'salary'], relatedDomains: ['workflow', 'calendar'] },
23
+ { id: 'marketing', name: 'Marketing', nameJa: 'マーケティング', category: 'business', keywords: ['campaign', 'audience', 'conversion', 'analytics', 'segment', 'promotion'], relatedDomains: ['crm', 'analytics'] },
24
+ // 産業系
25
+ { id: 'manufacturing', name: 'Manufacturing', nameJa: '製造', category: 'industry', keywords: ['production', 'assembly', 'quality', 'machine', 'factory', 'batch', 'bom'], relatedDomains: ['inventory', 'logistics'] },
26
+ { id: 'logistics', name: 'Logistics', nameJa: '物流', category: 'industry', keywords: ['shipping', 'tracking', 'warehouse', 'route', 'fleet', 'freight', 'cargo'], relatedDomains: ['inventory', 'delivery'] },
27
+ { id: 'agriculture', name: 'Agriculture', nameJa: '農業', category: 'industry', keywords: ['crop', 'harvest', 'farm', 'irrigation', 'soil', 'fertilizer', 'livestock'], relatedDomains: ['iot', 'weather'] },
28
+ { id: 'energy', name: 'Energy', nameJa: 'エネルギー', category: 'industry', keywords: ['power', 'grid', 'consumption', 'meter', 'solar', 'wind', 'electricity'], relatedDomains: ['iot', 'analytics'] },
29
+ // ヘルスケア系
30
+ { id: 'healthcare', name: 'Healthcare', nameJa: 'ヘルスケア', category: 'healthcare', keywords: ['patient', 'diagnosis', 'treatment', 'medical', 'clinic', 'doctor', 'hospital'], relatedDomains: ['pharmacy', 'insurance'] },
31
+ { id: 'pharmacy', name: 'Pharmacy', nameJa: '薬局', category: 'healthcare', keywords: ['prescription', 'medicine', 'drug', 'dosage', 'pharmacy', 'medication'], relatedDomains: ['healthcare', 'inventory'] },
32
+ { id: 'veterinary', name: 'Veterinary', nameJa: '動物病院', category: 'healthcare', keywords: ['pet', 'animal', 'veterinarian', 'vaccination', 'vet', 'breed', 'owner', 'examination'], relatedDomains: ['booking', 'healthcare'] },
33
+ // 技術系
34
+ { id: 'iot', name: 'IoT', nameJa: 'IoT', category: 'technology', keywords: ['sensor', 'device', 'telemetry', 'gateway', 'mqtt', 'edge', 'actuator'], relatedDomains: ['analytics', 'notification'] },
35
+ { id: 'security', name: 'Security', nameJa: 'セキュリティ', category: 'technology', keywords: ['authentication', 'authorization', 'token', 'access', 'permission', 'role', 'oauth'], relatedDomains: ['audit'] },
36
+ { id: 'ai', name: 'AI/ML', nameJa: 'AI', category: 'technology', keywords: ['model', 'prediction', 'training', 'inference', 'dataset', 'feature', 'neural'], relatedDomains: ['analytics'] },
37
+ { id: 'analytics', name: 'Analytics', nameJa: '分析', category: 'technology', keywords: ['report', 'dashboard', 'metric', 'kpi', 'chart', 'visualization', 'aggregation'], relatedDomains: ['ai'] },
38
+ { id: 'telecom', name: 'Telecom', nameJa: '通信', category: 'technology', keywords: ['call', 'sms', 'voip', 'subscriber', 'network', 'bandwidth', 'carrier'], relatedDomains: ['notification'] },
39
+ // サービス系 - 予約・宿泊
40
+ { id: 'booking', name: 'Booking', nameJa: '予約', category: 'service', keywords: ['reservation', 'appointment', 'schedule', 'slot', 'availability', 'booking', 'calendar'], relatedDomains: ['calendar', 'notification'] },
41
+ { id: 'hotel', name: 'Hotel', nameJa: 'ホテル', category: 'service', keywords: ['room', 'checkin', 'checkout', 'guest', 'housekeeping', 'amenity'], relatedDomains: ['booking', 'payment'] },
42
+ { id: 'travel', name: 'Travel', nameJa: '旅行', category: 'service', keywords: ['trip', 'itinerary', 'destination', 'flight', 'tour', 'package'], relatedDomains: ['booking', 'payment'] },
43
+ // サービス系 - 飲食・小売
44
+ { id: 'restaurant', name: 'Restaurant', nameJa: '飲食店', category: 'service', keywords: ['menu', 'table', 'order', 'kitchen', 'dish', 'meal', 'chef'], relatedDomains: ['booking', 'payment', 'inventory'] },
45
+ { id: 'catering', name: 'Catering', nameJa: 'ケータリング', category: 'service', keywords: ['event', 'menu', 'portion', 'delivery', 'banquet'], relatedDomains: ['restaurant', 'booking'] },
46
+ // サービス系 - 施設管理
47
+ { id: 'parking', name: 'Parking', nameJa: '駐車場', category: 'service', keywords: ['space', 'entry', 'exit', 'fee', 'plate', 'vehicle', 'lot', 'garage', 'barrier'], relatedDomains: ['payment', 'iot'] },
48
+ { id: 'gym', name: 'Gym', nameJa: 'フィットネス', category: 'service', keywords: ['membership', 'workout', 'trainer', 'equipment', 'class', 'fitness'], relatedDomains: ['booking', 'subscription'] },
49
+ { id: 'library', name: 'Library', nameJa: '図書館', category: 'service', keywords: ['book', 'borrow', 'return', 'catalog', 'member', 'fine', 'shelf'], relatedDomains: ['inventory', 'subscription'] },
50
+ { id: 'museum', name: 'Museum', nameJa: '美術館・博物館', category: 'service', keywords: ['exhibit', 'collection', 'tour', 'artifact', 'gallery', 'visitor'], relatedDomains: ['ticketing', 'booking'] },
51
+ // サービス系 - その他サービス
52
+ { id: 'education', name: 'Education', nameJa: '教育', category: 'service', keywords: ['course', 'student', 'teacher', 'lesson', 'grade', 'exam', 'curriculum'], relatedDomains: ['calendar', 'payment'] },
53
+ { id: 'realestate', name: 'Real Estate', nameJa: '不動産', category: 'service', keywords: ['property', 'listing', 'tenant', 'lease', 'rent', 'mortgage'], relatedDomains: ['booking', 'payment'] },
54
+ { id: 'insurance', name: 'Insurance', nameJa: '保険', category: 'service', keywords: ['policy', 'claim', 'premium', 'coverage', 'beneficiary', 'underwriting'], relatedDomains: ['finance', 'healthcare'] },
55
+ { id: 'rental', name: 'Rental', nameJa: 'レンタル', category: 'service', keywords: ['rent', 'return', 'item', 'duration', 'deposit', 'late'], relatedDomains: ['inventory', 'booking'] },
56
+ { id: 'repair', name: 'Repair', nameJa: '修理', category: 'service', keywords: ['repair', 'maintenance', 'part', 'technician', 'warranty', 'diagnostic'], relatedDomains: ['booking', 'inventory'] },
57
+ { id: 'cleaning', name: 'Cleaning', nameJa: '清掃', category: 'service', keywords: ['cleaning', 'schedule', 'staff', 'task', 'checklist', 'inspection'], relatedDomains: ['booking', 'workflow'] },
58
+ { id: 'laundry', name: 'Laundry', nameJa: 'クリーニング', category: 'service', keywords: ['laundry', 'garment', 'pickup', 'delivery', 'stain', 'pressing'], relatedDomains: ['booking', 'delivery'] },
59
+ { id: 'wedding', name: 'Wedding', nameJa: 'ブライダル', category: 'service', keywords: ['wedding', 'ceremony', 'venue', 'guest', 'planner', 'reception'], relatedDomains: ['booking', 'catering'] },
60
+ { id: 'funeral', name: 'Funeral', nameJa: '葬儀', category: 'service', keywords: ['funeral', 'ceremony', 'memorial', 'arrangement', 'cremation'], relatedDomains: ['booking'] },
61
+ // インフラ系
62
+ { id: 'inventory', name: 'Inventory', nameJa: '在庫管理', category: 'business', keywords: ['stock', 'sku', 'warehouse', 'inventory', 'reorder', 'quantity'], relatedDomains: ['logistics', 'ecommerce'] },
63
+ { id: 'payment', name: 'Payment', nameJa: '決済', category: 'business', keywords: ['payment', 'transaction', 'refund', 'invoice', 'billing', 'charge'], relatedDomains: ['finance', 'ecommerce'] },
64
+ { id: 'delivery', name: 'Delivery', nameJa: '配送', category: 'service', keywords: ['delivery', 'courier', 'package', 'tracking', 'address', 'dispatch'], relatedDomains: ['logistics', 'ecommerce'] },
65
+ { id: 'notification', name: 'Notification', nameJa: '通知', category: 'technology', keywords: ['notification', 'alert', 'push', 'email', 'sms', 'message'], relatedDomains: ['workflow'] },
66
+ { id: 'calendar', name: 'Calendar', nameJa: 'カレンダー', category: 'technology', keywords: ['event', 'schedule', 'reminder', 'calendar', 'recurring'], relatedDomains: ['booking', 'workflow'] },
67
+ { id: 'workflow', name: 'Workflow', nameJa: 'ワークフロー', category: 'technology', keywords: ['workflow', 'approval', 'step', 'task', 'process', 'state'], relatedDomains: ['notification'] },
68
+ { id: 'document', name: 'Document', nameJa: '文書管理', category: 'technology', keywords: ['document', 'file', 'version', 'folder', 'upload', 'download'], relatedDomains: ['workflow'] },
69
+ { id: 'search', name: 'Search', nameJa: '検索', category: 'technology', keywords: ['search', 'query', 'filter', 'index', 'facet', 'ranking'], relatedDomains: ['analytics'] },
70
+ // エンターテイメント・メディア
71
+ { id: 'media', name: 'Media', nameJa: 'メディア', category: 'service', keywords: ['content', 'article', 'publish', 'author', 'editor', 'cms'], relatedDomains: ['social'] },
72
+ { id: 'gaming', name: 'Gaming', nameJa: 'ゲーム', category: 'service', keywords: ['game', 'player', 'score', 'level', 'achievement', 'leaderboard'], relatedDomains: ['social', 'subscription'] },
73
+ { id: 'social', name: 'Social', nameJa: 'SNS', category: 'service', keywords: ['post', 'follow', 'like', 'comment', 'share', 'feed', 'profile'], relatedDomains: ['notification', 'media'] },
74
+ { id: 'chat', name: 'Chat', nameJa: 'チャット', category: 'service', keywords: ['message', 'chat', 'conversation', 'channel', 'thread', 'emoji'], relatedDomains: ['notification', 'social'] },
75
+ { id: 'sports', name: 'Sports', nameJa: 'スポーツ', category: 'service', keywords: ['team', 'match', 'score', 'player', 'league', 'tournament'], relatedDomains: ['booking', 'ticketing'] },
76
+ // ビジネス系追加
77
+ { id: 'auction', name: 'Auction', nameJa: 'オークション', category: 'business', keywords: ['bid', 'auction', 'lot', 'reserve', 'winning', 'hammer'], relatedDomains: ['ecommerce', 'payment'] },
78
+ { id: 'subscription', name: 'Subscription', nameJa: 'サブスク', category: 'business', keywords: ['subscription', 'plan', 'renewal', 'cancel', 'billing', 'trial'], relatedDomains: ['payment'] },
79
+ { id: 'marketplace', name: 'Marketplace', nameJa: 'マーケットプレイス', category: 'business', keywords: ['seller', 'buyer', 'listing', 'commission', 'marketplace'], relatedDomains: ['ecommerce', 'payment'] },
80
+ { id: 'project', name: 'Project', nameJa: 'プロジェクト管理', category: 'business', keywords: ['project', 'task', 'milestone', 'sprint', 'backlog', 'kanban'], relatedDomains: ['workflow', 'calendar'] },
81
+ // その他
82
+ { id: 'survey', name: 'Survey', nameJa: 'アンケート', category: 'service', keywords: ['survey', 'question', 'response', 'poll', 'feedback', 'form'], relatedDomains: ['analytics'] },
83
+ { id: 'voting', name: 'Voting', nameJa: '投票', category: 'service', keywords: ['vote', 'ballot', 'candidate', 'election', 'poll'], relatedDomains: ['survey'] },
84
+ { id: 'ticketing', name: 'Ticketing', nameJa: 'チケット', category: 'service', keywords: ['ticket', 'seat', 'event', 'venue', 'admission'], relatedDomains: ['booking', 'payment'] },
85
+ { id: 'waste', name: 'Waste', nameJa: '廃棄物', category: 'industry', keywords: ['waste', 'disposal', 'collection', 'bin', 'recycling'], relatedDomains: ['logistics', 'recycling'] },
86
+ { id: 'recycling', name: 'Recycling', nameJa: 'リサイクル', category: 'industry', keywords: ['recycle', 'material', 'sorting', 'recovery', 'reuse'], relatedDomains: ['waste', 'logistics'] },
87
+ { id: 'warehouse', name: 'Warehouse', nameJa: '倉庫', category: 'industry', keywords: ['warehouse', 'storage', 'rack', 'picking', 'packing', 'zone'], relatedDomains: ['inventory', 'logistics'] },
88
+ { id: 'vehicle', name: 'Vehicle', nameJa: '車両管理', category: 'industry', keywords: ['vehicle', 'fleet', 'maintenance', 'fuel', 'driver', 'mileage'], relatedDomains: ['logistics', 'iot'] },
89
+ { id: 'aviation', name: 'Aviation', nameJa: '航空', category: 'industry', keywords: ['flight', 'aircraft', 'runway', 'gate', 'boarding', 'baggage'], relatedDomains: ['travel', 'ticketing'] },
90
+ { id: 'shipping', name: 'Shipping', nameJa: '海運', category: 'industry', keywords: ['ship', 'container', 'port', 'cargo', 'vessel', 'freight'], relatedDomains: ['logistics'] },
91
+ ];
92
+ /**
93
+ * ドメイン検出クラス
94
+ */
95
+ export class DomainDetector {
96
+ domains;
97
+ constructor(customDomains) {
98
+ this.domains = customDomains ?? DOMAINS;
99
+ }
100
+ /**
101
+ * テキストからドメインを検出
102
+ */
103
+ detect(text) {
104
+ const normalizedText = text.toLowerCase();
105
+ const scores = new Map();
106
+ // 各ドメインのスコアを計算
107
+ for (const domain of this.domains) {
108
+ const matchedKeywords = [];
109
+ let score = 0;
110
+ for (const keyword of domain.keywords) {
111
+ const regex = new RegExp(`\\b${keyword}\\b`, 'gi');
112
+ const matches = normalizedText.match(regex);
113
+ if (matches) {
114
+ score += matches.length;
115
+ matchedKeywords.push(keyword);
116
+ }
117
+ }
118
+ if (score > 0) {
119
+ scores.set(domain.id, { score, keywords: matchedKeywords });
120
+ }
121
+ }
122
+ // スコアでソート
123
+ const sorted = Array.from(scores.entries())
124
+ .sort((a, b) => b[1].score - a[1].score);
125
+ // 最高スコアのドメインを取得
126
+ if (sorted.length === 0) {
127
+ const generalDomain = this.domains.find(d => d.id === 'general');
128
+ return {
129
+ primaryDomain: generalDomain,
130
+ secondaryDomains: [],
131
+ confidence: 0.5,
132
+ matchedKeywords: [],
133
+ suggestedComponents: ['Service', 'Repository', 'Controller'],
134
+ };
135
+ }
136
+ const [primaryId, primaryData] = sorted[0];
137
+ const primaryDomain = this.domains.find(d => d.id === primaryId);
138
+ // セカンダリドメインを取得(上位3つまで)
139
+ const secondaryDomains = sorted
140
+ .slice(1, 4)
141
+ .map(([id]) => this.domains.find(d => d.id === id))
142
+ .filter(Boolean);
143
+ // 信頼度を計算(キーワードマッチ数に基づく)
144
+ const maxPossibleScore = primaryDomain.keywords.length * 3;
145
+ const confidence = Math.min(0.95, 0.5 + (primaryData.score / maxPossibleScore) * 0.45);
146
+ // 推奨コンポーネントを生成
147
+ const suggestedComponents = this.getSuggestedComponents(primaryDomain);
148
+ return {
149
+ primaryDomain,
150
+ secondaryDomains,
151
+ confidence,
152
+ matchedKeywords: primaryData.keywords,
153
+ suggestedComponents,
154
+ };
155
+ }
156
+ /**
157
+ * ドメインに基づく推奨コンポーネントを取得
158
+ */
159
+ getSuggestedComponents(domain) {
160
+ const componentMap = {
161
+ ecommerce: ['CartService', 'ProductRepository', 'OrderService', 'PaymentGateway', 'CatalogService'],
162
+ finance: ['AccountService', 'TransactionRepository', 'BalanceCalculator', 'TransferService'],
163
+ healthcare: ['PatientRepository', 'DiagnosisService', 'AppointmentService', 'MedicalRecordService'],
164
+ veterinary: ['PetRepository', 'PetService', 'ReservationService', 'MedicalHistoryRepository', 'VetScheduleService'],
165
+ parking: ['SpaceRepository', 'SpaceService', 'EntryExitService', 'FeeCalculator', 'PaymentService'],
166
+ booking: ['ReservationRepository', 'ReservationService', 'AvailabilityChecker', 'SlotManager'],
167
+ hotel: ['RoomRepository', 'RoomService', 'CheckInService', 'CheckOutService', 'GuestService'],
168
+ restaurant: ['MenuRepository', 'OrderService', 'TableService', 'KitchenService', 'ReservationService'],
169
+ inventory: ['StockRepository', 'InventoryService', 'ReorderService', 'StockAlertService'],
170
+ payment: ['PaymentRepository', 'PaymentService', 'RefundService', 'InvoiceGenerator'],
171
+ notification: ['NotificationRepository', 'NotificationService', 'PushService', 'EmailService'],
172
+ workflow: ['WorkflowRepository', 'WorkflowEngine', 'ApprovalService', 'TaskService'],
173
+ iot: ['DeviceRepository', 'DeviceService', 'TelemetryService', 'SensorDataProcessor'],
174
+ security: ['AuthService', 'TokenService', 'PermissionService', 'RoleRepository'],
175
+ crm: ['CustomerRepository', 'CustomerService', 'LeadService', 'OpportunityService'],
176
+ hr: ['EmployeeRepository', 'EmployeeService', 'AttendanceService', 'PayrollService'],
177
+ education: ['CourseRepository', 'CourseService', 'StudentService', 'GradeService', 'EnrollmentService'],
178
+ logistics: ['ShipmentRepository', 'ShipmentService', 'TrackingService', 'RouteOptimizer'],
179
+ general: ['Service', 'Repository', 'Controller', 'Validator'],
180
+ };
181
+ return componentMap[domain.id] ?? componentMap.general;
182
+ }
183
+ /**
184
+ * ドメイン一覧を取得
185
+ */
186
+ getAllDomains() {
187
+ return [...this.domains];
188
+ }
189
+ /**
190
+ * カテゴリでフィルタ
191
+ */
192
+ getDomainsByCategory(category) {
193
+ return this.domains.filter(d => d.category === category);
194
+ }
195
+ /**
196
+ * IDでドメインを取得
197
+ */
198
+ getDomainById(id) {
199
+ return this.domains.find(d => d.id === id);
200
+ }
201
+ /**
202
+ * ドメイン数を取得
203
+ */
204
+ getDomainCount() {
205
+ return this.domains.length;
206
+ }
207
+ }
208
+ // シングルトンインスタンス
209
+ export const domainDetector = new DomainDetector();
210
+ //# sourceMappingURL=domain-detector.js.map