musubix 1.4.4 → 1.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.
@@ -17,10 +17,16 @@
17
17
  11. [C4コード生成](#c4コード生成)
18
18
  12. [シンボリック推論](#シンボリック推論) *(v1.2.0)*
19
19
  13. [正誤性検証](#正誤性検証) *(v1.4.1)*
20
- 14. [MCPサーバー連携](#mcpサーバー連携)
21
- 15. [YATA知識グラフ](#yata知識グラフ)
22
- 15. [ベストプラクティス](#ベストプラクティス)
23
- 16. [トラブルシューティング](#トラブルシューティング)
20
+ 14. [高度な推論](#高度な推論) *(v1.4.5)*
21
+ 15. [対話的REPLモード](#対話的replモード) *(v1.5.0)*
22
+ 16. [YATA Local](#yata-local) *(v1.6.3)*
23
+ 17. [YATA Global](#yata-global) *(v1.6.3)*
24
+ 18. [KGPR - Knowledge Graph Pull Request](#kgpr---knowledge-graph-pull-request) *(v1.6.4)*
25
+ 19. [YATA プラットフォーム拡張](#yata-プラットフォーム拡張) *(v1.7.0)*
26
+ 20. [MCPサーバー連携](#mcpサーバー連携)
27
+ 21. [YATA知識グラフ](#yata知識グラフ)
28
+ 22. [ベストプラクティス](#ベストプラクティス)
29
+ 23. [トラブルシューティング](#トラブルシューティング)
24
30
 
25
31
  ---
26
32
 
@@ -840,6 +846,711 @@ const semanticDuplicates = validator.findSemanticDuplicates(allTriples);
840
846
 
841
847
  ---
842
848
 
849
+ ## 高度な推論
850
+
851
+ *(v1.4.5 新機能)*
852
+
853
+ ### 概要
854
+
855
+ 高度な推論は、知識グラフにOWL 2 RL推論とDatalog評価機能を提供します。暗黙的な事実の実体化、ルールベースの推論、人間が理解しやすい説明の生成をサポートします。
856
+
857
+ ### 主要コンポーネント
858
+
859
+ | コンポーネント | 説明 |
860
+ |--------------|------|
861
+ | `OWL2RLReasoner` | 20以上のビルトインルールを持つOWL 2 RL推論エンジン |
862
+ | `DatalogEngine` | 階層化評価対応のDatalogエンジン |
863
+ | `InferenceExplainer` | 自然言語での説明生成 |
864
+ | `ProgressReporter` | リアルタイム推論進捗追跡 |
865
+
866
+ ### OWL 2 RL 推論
867
+
868
+ ```typescript
869
+ import { OWL2RLReasoner } from '@nahisaho/musubix-ontology-mcp';
870
+
871
+ const reasoner = new OWL2RLReasoner({
872
+ maxIterations: 100,
873
+ enablePropertyChains: true,
874
+ enableInverseProperties: true
875
+ });
876
+
877
+ // ストアに対して推論を実行
878
+ const result = await reasoner.reason(store, {
879
+ onProgress: (progress) => {
880
+ console.log(`反復 ${progress.iteration}: ${progress.newTriples} 新規トリプル`);
881
+ }
882
+ });
883
+
884
+ console.log(`${result.inferredCount} 個の新しい事実を推論`);
885
+ console.log(`適用ルール: ${result.rulesApplied.join(', ')}`);
886
+ ```
887
+
888
+ ### OWL 2 RL ルール
889
+
890
+ | ルールID | 名称 | 説明 |
891
+ |---------|------|------|
892
+ | `prp-dom` | Property Domain | プロパティのドメインから型を推論 |
893
+ | `prp-rng` | Property Range | プロパティのレンジから型を推論 |
894
+ | `prp-inv1/2` | Inverse Properties | 逆関係を推論 |
895
+ | `prp-trp` | Transitive Properties | 推移的プロパティを連鎖 |
896
+ | `prp-symp` | Symmetric Properties | 対称関係を推論 |
897
+ | `cax-sco` | SubClassOf | クラスメンバーシップを伝播 |
898
+ | `scm-spo` | SubPropertyOf | プロパティの包摂関係 |
899
+ | `eq-rep-s/p/o` | SameAs Replacement | 同一個体の置換 |
900
+
901
+ ### Datalog 評価
902
+
903
+ ```typescript
904
+ import { DatalogEngine } from '@nahisaho/musubix-ontology-mcp';
905
+
906
+ const engine = new DatalogEngine();
907
+
908
+ // ルールを定義
909
+ const rules = [
910
+ {
911
+ head: { predicate: 'ancestor', args: ['?x', '?y'] },
912
+ body: [
913
+ { predicate: 'parent', args: ['?x', '?y'] }
914
+ ]
915
+ },
916
+ {
917
+ head: { predicate: 'ancestor', args: ['?x', '?z'] },
918
+ body: [
919
+ { predicate: 'parent', args: ['?x', '?y'] },
920
+ { predicate: 'ancestor', args: ['?y', '?z'] }
921
+ ]
922
+ }
923
+ ];
924
+
925
+ // ルールを評価
926
+ const result = await engine.evaluate(rules, facts, {
927
+ onProgress: (progress) => {
928
+ console.log(`階層 ${progress.stratum}: ${progress.rule} を評価中`);
929
+ }
930
+ });
931
+
932
+ console.log(`${result.derivedFacts.length} 個の新しい事実を導出`);
933
+ ```
934
+
935
+ ### 推論説明
936
+
937
+ ```typescript
938
+ import { InferenceExplainer, ExplanationFormat } from '@nahisaho/musubix-ontology-mcp';
939
+
940
+ const explainer = new InferenceExplainer(reasoner.getProvenanceLog());
941
+
942
+ // 特定のトリプルの説明を取得
943
+ const explanation = explainer.explain(
944
+ 'http://example.org/Animal',
945
+ 'rdf:type',
946
+ 'owl:Class',
947
+ ExplanationFormat.TEXT
948
+ );
949
+
950
+ console.log(explanation);
951
+ // 出力: "Animal は owl:Class として宣言されているため Class です(ルール cax-sco)"
952
+
953
+ // HTML形式の説明を生成
954
+ const htmlExplanation = explainer.explain(
955
+ subject, predicate, object,
956
+ ExplanationFormat.HTML
957
+ );
958
+ ```
959
+
960
+ ### 進捗レポート
961
+
962
+ ```typescript
963
+ import { createProgressReporter } from '@nahisaho/musubix-ontology-mcp';
964
+
965
+ const reporter = createProgressReporter({
966
+ onProgress: (info) => {
967
+ console.log(`フェーズ: ${info.phase}`);
968
+ console.log(`反復: ${info.iteration}/${info.maxIterations}`);
969
+ console.log(`トリプル数: ${info.totalTriples}`);
970
+ console.log(`新規推論: ${info.newInferences}`);
971
+ },
972
+ throttleMs: 500 // 500ms間隔でレポート
973
+ });
974
+
975
+ await reasoner.reason(store, { progressReporter: reporter });
976
+ ```
977
+
978
+ ---
979
+
980
+ ## 対話的REPLモード
981
+
982
+ *(v1.5.0 新規、v1.6.0 強化)*
983
+
984
+ MUSUBIXは、リアルタイムでコマンドを実行・探索できる対話的REPLシェルを提供します。
985
+
986
+ ### REPLの起動
987
+
988
+ ```bash
989
+ # 対話的REPLを起動
990
+ musubix repl
991
+
992
+ # カスタム履歴ファイルを指定
993
+ musubix repl --history ~/.musubix-repl-history
994
+
995
+ # カラー表示なし
996
+ musubix repl --no-color
997
+ ```
998
+
999
+ ### REPL機能
1000
+
1001
+ | 機能 | 説明 |
1002
+ |------|------|
1003
+ | コマンド補完 | TABキーでコマンド・オプションを補完 |
1004
+ | 履歴ナビゲーション | 上下矢印、履歴検索 |
1005
+ | セッション変数 | `$name=value` で設定、`$name` で参照 |
1006
+ | 出力フォーマット | JSON、YAML、テーブル自動整形 |
1007
+ | CLI統合 | CLIコマンドをそのまま実行可能 |
1008
+
1009
+ ### 基本的な使い方
1010
+
1011
+ ```bash
1012
+ musubix> help # すべてのコマンドを表示
1013
+ musubix> help requirements # コマンド詳細を表示
1014
+ musubix> requirements analyze input.md # CLIコマンドを実行
1015
+ musubix> $project=my-app # セッション変数を設定
1016
+ musubix> design generate $project # 変数をコマンドで使用
1017
+ musubix> history # コマンド履歴を表示
1018
+ musubix> exit # REPLを終了
1019
+ ```
1020
+
1021
+ ### セッション変数
1022
+
1023
+ ```bash
1024
+ # 変数の設定
1025
+ musubix> $req=REQ-001
1026
+ musubix> $file=./docs/requirements.md
1027
+
1028
+ # コマンドで使用
1029
+ musubix> requirements validate $file
1030
+ musubix> trace impact $req
1031
+
1032
+ # 特殊変数: $_ は前回の実行結果を保持
1033
+ musubix> requirements analyze input.md
1034
+ musubix> $_ # 前回の結果にアクセス
1035
+ ```
1036
+
1037
+ ### 出力フォーマット
1038
+
1039
+ ```bash
1040
+ # 自動検出(デフォルト)
1041
+ musubix> learn status
1042
+
1043
+ # JSON出力を強制
1044
+ musubix> set format json
1045
+ musubix> learn patterns
1046
+
1047
+ # YAML出力を強制
1048
+ musubix> set format yaml
1049
+
1050
+ # テーブル出力を強制
1051
+ musubix> set format table
1052
+ ```
1053
+
1054
+ ### 履歴管理
1055
+
1056
+ ```bash
1057
+ # 最近のコマンドを表示
1058
+ musubix> history
1059
+
1060
+ # 履歴を検索(Ctrl+Rスタイル)
1061
+ musubix> history search requirements
1062
+
1063
+ # 履歴をクリア
1064
+ musubix> history clear
1065
+ ```
1066
+
1067
+ ### REPLコンポーネント
1068
+
1069
+ | コンポーネント | 役割 |
1070
+ |---------------|------|
1071
+ | `ReplEngine` | REPLメインコントローラー |
1072
+ | `CommandCompleter` | TAB補完プロバイダー |
1073
+ | `HistoryManager` | コマンド履歴の永続化 |
1074
+ | `SessionState` | 変数ストレージ |
1075
+ | `OutputFormatter` | JSON/YAML/テーブル出力 |
1076
+ | `PromptRenderer` | 動的プロンプト表示 |
1077
+
1078
+ ---
1079
+
1080
+ ## YATA Local
1081
+
1082
+ *(v1.6.3 新規)*
1083
+
1084
+ YATA Localは、高性能なSQLiteベースのローカル知識グラフです。推論機能を内蔵し、シングルユーザー・オフライン環境でデータ主権と速度が重要な場合に最適です。
1085
+
1086
+ ### 機能
1087
+
1088
+ | 機能 | 説明 |
1089
+ |------|------|
1090
+ | **SQLiteストレージ** | WALモードで並行読み取り、シングルライター |
1091
+ | **全文検索** | FTS5ベースのトリプル検索 |
1092
+ | **グラフ探索** | BFS/DFSアルゴリズム、深度制御 |
1093
+ | **推論エンジン** | 4つのOWL-liteルール(推移性、対称性、逆関係、ドメイン/レンジ) |
1094
+ | **制約** | 4つの検証ルール(カーディナリティ、排他、一意性、必須) |
1095
+ | **ACIDトランザクション** | 完全なトランザクションサポート |
1096
+
1097
+ ### インストール
1098
+
1099
+ ```bash
1100
+ npm install @nahisaho/yata-local
1101
+ ```
1102
+
1103
+ ### クイックスタート
1104
+
1105
+ ```typescript
1106
+ import { YataLocal } from '@nahisaho/yata-local';
1107
+
1108
+ // デフォルト設定で初期化
1109
+ const yata = new YataLocal('./knowledge.db');
1110
+ await yata.initialize();
1111
+
1112
+ // トリプルを追加
1113
+ await yata.addTriple({
1114
+ subject: 'Person:john',
1115
+ predicate: 'hasParent',
1116
+ object: 'Person:mary'
1117
+ });
1118
+
1119
+ // トリプルをクエリ
1120
+ const results = await yata.query({
1121
+ subject: 'Person:john',
1122
+ predicate: 'hasParent'
1123
+ });
1124
+
1125
+ // 全文検索
1126
+ const searchResults = await yata.search('john parent');
1127
+
1128
+ // グラフ探索(BFS)
1129
+ const ancestors = await yata.traverse('Person:john', 'hasParent', {
1130
+ direction: 'outgoing',
1131
+ maxDepth: 5,
1132
+ algorithm: 'bfs'
1133
+ });
1134
+
1135
+ // クリーンアップ
1136
+ await yata.close();
1137
+ ```
1138
+
1139
+ ### 推論エンジン
1140
+
1141
+ YATA Localは4つのOWL-lite推論ルールをサポートします:
1142
+
1143
+ | ルール | 説明 | 例 |
1144
+ |--------|------|-----|
1145
+ | **推移性** | A→BかつB→CならA→C | hasAncestorは推移的 |
1146
+ | **対称性** | A→BならB→A | friendOfは対称的 |
1147
+ | **逆関係** | A→B(P経由)ならB→A(P⁻¹経由) | hasChild ↔ hasParent |
1148
+ | **ドメイン/レンジ** | 述語から型を推論 | hasAgeはPersonを示唆 |
1149
+
1150
+ ```typescript
1151
+ // 推論を実行
1152
+ const inferred = await yata.infer();
1153
+ console.log(`${inferred.length}個の新しいトリプルを推論`);
1154
+ ```
1155
+
1156
+ ### 制約
1157
+
1158
+ ```typescript
1159
+ // 制約を定義
1160
+ await yata.addConstraint({
1161
+ type: 'cardinality',
1162
+ predicate: 'hasSpouse',
1163
+ max: 1
1164
+ });
1165
+
1166
+ // 検証
1167
+ const violations = await yata.validate();
1168
+ if (violations.length > 0) {
1169
+ console.error('制約違反:', violations);
1170
+ }
1171
+ ```
1172
+
1173
+ ### 設定オプション
1174
+
1175
+ ```typescript
1176
+ const yata = new YataLocal('./knowledge.db', {
1177
+ // WALモードで並行性向上(デフォルト: true)
1178
+ walMode: true,
1179
+
1180
+ // FTS5検索を有効化(デフォルト: true)
1181
+ enableSearch: true,
1182
+
1183
+ // 書き込み時に自動推論(デフォルト: false)
1184
+ autoInfer: false,
1185
+
1186
+ // ジャーナルモード(デフォルト: 'wal')
1187
+ journalMode: 'wal'
1188
+ });
1189
+ ```
1190
+
1191
+ ---
1192
+
1193
+ ## YATA Global
1194
+
1195
+ *(v1.6.3 新規)*
1196
+
1197
+ YATA Globalは、チームコラボレーション向けの分散型知識グラフプラットフォームです。共有知識グラフへのREST APIアクセスと、オフラインサポート・インテリジェントな同期機能を提供します。
1198
+
1199
+ ### 機能
1200
+
1201
+ | 機能 | 説明 |
1202
+ |------|------|
1203
+ | **REST API** | HTTP経由の完全なCRUD操作 |
1204
+ | **オフラインキャッシュ** | SQLiteベースのローカルキャッシュ |
1205
+ | **同期エンジン** | Push/Pullと競合解決 |
1206
+ | **競合解決** | Last-write-winsまたはカスタム戦略 |
1207
+ | **認証** | APIキーベースの認証 |
1208
+ | **バッチ操作** | 一括トリプル操作 |
1209
+
1210
+ ### インストール
1211
+
1212
+ ```bash
1213
+ npm install @nahisaho/yata-global
1214
+ ```
1215
+
1216
+ ### クイックスタート
1217
+
1218
+ ```typescript
1219
+ import { YataGlobal } from '@nahisaho/yata-global';
1220
+
1221
+ // クライアントを初期化
1222
+ const yata = new YataGlobal({
1223
+ endpoint: 'https://yata.example.com/api',
1224
+ apiKey: 'your-api-key',
1225
+ graphId: 'project-knowledge'
1226
+ });
1227
+
1228
+ await yata.initialize();
1229
+
1230
+ // トリプルを追加(バッチ)
1231
+ await yata.addTriples([
1232
+ { subject: 'Task:001', predicate: 'assignedTo', object: 'User:alice' },
1233
+ { subject: 'Task:001', predicate: 'status', object: 'in-progress' }
1234
+ ]);
1235
+
1236
+ // フィルタ付きクエリ
1237
+ const tasks = await yata.query({
1238
+ predicate: 'assignedTo',
1239
+ object: 'User:alice'
1240
+ });
1241
+
1242
+ // クリーンアップ
1243
+ await yata.close();
1244
+ ```
1245
+
1246
+ ### オフラインサポート
1247
+
1248
+ YATA Globalは自動同期によるオフラインファースト操作をサポートします:
1249
+
1250
+ ```typescript
1251
+ const yata = new YataGlobal({
1252
+ endpoint: 'https://yata.example.com/api',
1253
+ apiKey: 'your-api-key',
1254
+ graphId: 'project-knowledge',
1255
+
1256
+ // オフライン設定
1257
+ offlineMode: true,
1258
+ cachePath: './yata-cache.db',
1259
+ syncInterval: 60000 // 60秒ごとに自動同期
1260
+ });
1261
+
1262
+ // オフラインでも動作 - ローカルにキャッシュ
1263
+ await yata.addTriple({
1264
+ subject: 'Note:001',
1265
+ predicate: 'content',
1266
+ object: '重要な会議メモ'
1267
+ });
1268
+
1269
+ // オンライン時に手動同期
1270
+ await yata.sync();
1271
+ ```
1272
+
1273
+ ### 競合解決
1274
+
1275
+ ```typescript
1276
+ const yata = new YataGlobal({
1277
+ // ... その他のオプション
1278
+
1279
+ conflictStrategy: 'last-write-wins', // デフォルト
1280
+ // または: 'server-wins', 'client-wins', 'manual'
1281
+
1282
+ onConflict: async (local, remote) => {
1283
+ // カスタム解決ロジック
1284
+ console.log('競合を検出:', local, remote);
1285
+ return remote; // リモート版を優先
1286
+ }
1287
+ });
1288
+ ```
1289
+
1290
+ ### 同期ステータス
1291
+
1292
+ ```typescript
1293
+ // 同期ステータスを確認
1294
+ const status = await yata.getSyncStatus();
1295
+ console.log(`保留中の変更: ${status.pendingPush}`);
1296
+ console.log(`最終同期: ${status.lastSyncAt}`);
1297
+
1298
+ // 完全同期を強制
1299
+ await yata.sync({ force: true });
1300
+ ```
1301
+
1302
+ ### YATA Local vs YATA Global の選択
1303
+
1304
+ | ユースケース | 推奨 |
1305
+ |-------------|------|
1306
+ | 個人用ナレッジベース | YATA Local |
1307
+ | シングルユーザーアプリ | YATA Local |
1308
+ | プライバシー重視のデータ | YATA Local |
1309
+ | チームコラボレーション | YATA Global |
1310
+ | クロスデバイスアクセス | YATA Global |
1311
+ | 共有プロジェクト知識 | YATA Global |
1312
+ | 同期付きオフラインファースト | YATA Global |
1313
+
1314
+ ---
1315
+
1316
+ ## KGPR - Knowledge Graph Pull Request
1317
+
1318
+ *(v1.6.4)*
1319
+
1320
+ KGPR(Knowledge Graph Pull Request)は、GitHub PRと同様のワークフローで、YATA LocalからYATA Globalへ安全に知識グラフを共有する機能です。
1321
+
1322
+ ### ワークフロー
1323
+
1324
+ ```
1325
+ ┌─────────────┐ ┌──────────────┐ ┌───────────────┐
1326
+ │ YATA Local │ ──► │ KGPR (Draft) │ ──► │ YATA Global │
1327
+ │ (ローカルKG) │ │ (差分抽出) │ │ (レビュー・マージ) │
1328
+ └─────────────┘ └──────────────┘ └───────────────┘
1329
+
1330
+ ステータス遷移:
1331
+ draft → open → reviewing → approved/changes_requested → merged/closed
1332
+ ```
1333
+
1334
+ ### プライバシーレベル
1335
+
1336
+ | レベル | フィルタ対象 |
1337
+ |-------|------------|
1338
+ | `strict` | ファイルパス、URL、認証情報、全メタデータ |
1339
+ | `moderate` | ファイルパス、URL、認証情報 |
1340
+ | `none` | フィルタなし |
1341
+
1342
+ ### CLIコマンド
1343
+
1344
+ ```bash
1345
+ # KGPRを作成
1346
+ musubix kgpr create -t "認証パターンの追加"
1347
+
1348
+ # 作成前に差分をプレビュー
1349
+ musubix kgpr diff --namespace myproject --privacy moderate
1350
+
1351
+ # KGPR一覧を表示
1352
+ musubix kgpr list
1353
+
1354
+ # KGPRをレビューに送信
1355
+ musubix kgpr submit <id>
1356
+
1357
+ # KGPR詳細を表示
1358
+ musubix kgpr show <id>
1359
+
1360
+ # マージせずにクローズ
1361
+ musubix kgpr close <id>
1362
+ ```
1363
+
1364
+ ### MCPツール
1365
+
1366
+ | ツール | 説明 |
1367
+ |-------|------|
1368
+ | `kgpr_create` | ローカル知識グラフからKGPRを作成 |
1369
+ | `kgpr_diff` | KGPR作成前に差分をプレビュー |
1370
+ | `kgpr_list` | 全KGPRを一覧表示 |
1371
+ | `kgpr_submit` | KGPRをレビューに送信 |
1372
+ | `kgpr_review` | KGPRをレビュー(approve/changes_requested/commented) |
1373
+
1374
+ ### 使用例
1375
+
1376
+ ```bash
1377
+ # 1. 共有内容をプレビュー
1378
+ musubix kgpr diff --privacy strict
1379
+
1380
+ # 2. 説明付きでKGPRを作成
1381
+ musubix kgpr create -t "Reactパターンの共有" -d "project-xから学習したパターン"
1382
+
1383
+ # 3. KGPRを確認
1384
+ musubix kgpr show KGPR-001
1385
+
1386
+ # 4. レビューに送信
1387
+ musubix kgpr submit KGPR-001
1388
+ ```
1389
+
1390
+ ---
1391
+
1392
+ ## YATA プラットフォーム拡張
1393
+
1394
+ *(v1.7.0)*
1395
+
1396
+ バージョン1.7.0では、YATAプラットフォームに5つの主要機能が追加されました。
1397
+
1398
+ ### Phase 1: インデックス最適化
1399
+
1400
+ YATA Localのクエリパフォーマンスを複合インデックスで最適化。
1401
+
1402
+ ```typescript
1403
+ import { IndexOptimizer } from '@nahisaho/yata-local';
1404
+
1405
+ const optimizer = new IndexOptimizer(database);
1406
+
1407
+ // クエリパターンを分析して最適なインデックスを作成
1408
+ const analysis = await optimizer.analyzeQueryPatterns();
1409
+ const created = await optimizer.createOptimalIndexes();
1410
+
1411
+ // インデックスの健全性をチェック
1412
+ const health = await optimizer.checkIndexHealth();
1413
+ ```
1414
+
1415
+ **主な機能:**
1416
+ - 一般的なクエリパターン用の複合インデックス作成
1417
+ - 断片化検出によるインデックス健全性監視
1418
+ - 自動最適化推奨
1419
+
1420
+ ### Phase 2: 拡張エクスポートパイプライン
1421
+
1422
+ 増分エクスポートと複数フォーマット対応の強力なエクスポート機能。
1423
+
1424
+ ```typescript
1425
+ import { ExportPipeline } from '@nahisaho/yata-local';
1426
+
1427
+ const pipeline = new ExportPipeline(database);
1428
+
1429
+ // フルエクスポート
1430
+ const fullData = await pipeline.exportFull({ namespace: 'myproject' });
1431
+
1432
+ // 増分エクスポート(前回エクスポート以降の変更)
1433
+ const changes = await pipeline.exportIncremental({
1434
+ since: lastExportTimestamp,
1435
+ format: 'json'
1436
+ });
1437
+
1438
+ // 変換付きエクスポート
1439
+ const transformed = await pipeline.exportWithTransform({
1440
+ format: 'rdf',
1441
+ includeMetadata: true
1442
+ });
1443
+ ```
1444
+
1445
+ **対応フォーマット:**
1446
+ - JSON(デフォルト)
1447
+ - RDF/Turtle
1448
+ - N-Triples
1449
+ - カスタムトランスフォーマー
1450
+
1451
+ ### Phase 3: Global同期統合
1452
+
1453
+ YATA LocalとYATA Global間のシームレスな同期。
1454
+
1455
+ ```typescript
1456
+ import { GlobalSyncClient, SyncEngine } from '@nahisaho/yata-global';
1457
+
1458
+ const client = new GlobalSyncClient({
1459
+ endpoint: 'https://yata-global.example.com',
1460
+ offlineMode: true
1461
+ });
1462
+
1463
+ // 同期を初期化
1464
+ await client.initialize();
1465
+
1466
+ // ローカル変更をプッシュ
1467
+ const syncResult = await client.sync({
1468
+ namespace: 'myproject',
1469
+ direction: 'push'
1470
+ });
1471
+
1472
+ // グローバルから更新をプル
1473
+ await client.sync({
1474
+ namespace: 'shared-patterns',
1475
+ direction: 'pull'
1476
+ });
1477
+ ```
1478
+
1479
+ **機能:**
1480
+ - オフラインファーストと自動同期
1481
+ - 競合解決戦略
1482
+ - 選択的な名前空間同期
1483
+ - フレームワークパターンリポジトリ
1484
+
1485
+ ### Phase 4: コードジェネレーター強化
1486
+
1487
+ 設計ドキュメントからの高度なコード生成。
1488
+
1489
+ ```typescript
1490
+ import { CodeGenerator } from '@nahisaho/yata-local';
1491
+
1492
+ const generator = new CodeGenerator({
1493
+ language: 'typescript',
1494
+ outputDir: './src/generated'
1495
+ });
1496
+
1497
+ // C4設計から生成
1498
+ const result = await generator.generateFromC4(designDocument);
1499
+
1500
+ // カスタムテンプレートで生成
1501
+ await generator.generate({
1502
+ template: 'repository-pattern',
1503
+ context: { entityName: 'User' }
1504
+ });
1505
+ ```
1506
+
1507
+ **対応パターン:**
1508
+ - Repositoryパターン
1509
+ - Serviceレイヤー
1510
+ - Factoryパターン
1511
+ - ドメインイベント
1512
+ - Value Objects
1513
+
1514
+ ### Phase 5: YATA UI(Web可視化)
1515
+
1516
+ 知識グラフのWebベース可視化・管理インターフェース。
1517
+
1518
+ ```typescript
1519
+ import { YataUIServer, createYataUIServer } from '@nahisaho/yata-ui';
1520
+
1521
+ // サーバーを作成して起動
1522
+ const server = createYataUIServer({
1523
+ port: 3000,
1524
+ enableRealtime: true
1525
+ });
1526
+
1527
+ // データプロバイダーを設定
1528
+ server.setDataProvider(async () => ({
1529
+ nodes: await getEntities(),
1530
+ edges: await getRelationships()
1531
+ }));
1532
+
1533
+ await server.start();
1534
+ console.log(`UI: ${server.getUrl()}`);
1535
+ ```
1536
+
1537
+ **UI機能:**
1538
+ - インタラクティブなグラフ可視化
1539
+ - WebSocketによるリアルタイム更新
1540
+ - 名前空間フィルタリング
1541
+ - エンティティ/リレーションシップ編集
1542
+ - エクスポート/インポート機能
1543
+
1544
+ ### v1.7.0 パッケージ概要
1545
+
1546
+ | パッケージ | 説明 |
1547
+ |-----------|------|
1548
+ | `@nahisaho/yata-local` | IndexOptimizer, ExportPipeline, CodeGenerator |
1549
+ | `@nahisaho/yata-global` | GlobalSyncClient, SyncEngine, CacheManager |
1550
+ | `@nahisaho/yata-ui` | YataUIServer, グラフ可視化 |
1551
+
1552
+ ---
1553
+
843
1554
  ## MCPサーバー連携
844
1555
 
845
1556
  ### MCPサーバーの起動
@@ -1152,6 +1863,6 @@ const client = createYATAClient({
1152
1863
 
1153
1864
  ---
1154
1865
 
1155
- **バージョン**: 1.3.0
1156
- **最終更新**: 2026-01-05
1866
+ **バージョン**: 1.6.0
1867
+ **最終更新**: 2026-01-06
1157
1868
  **MUSUBIX Project**