musubix 3.4.1 → 3.4.3
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.
- package/README.md +50 -315
- package/bin/musubix.js +1 -9
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -57
- package/.github/AGENTS.md +0 -949
- package/.github/prompts/sdd-change-apply.prompt.md +0 -283
- package/.github/prompts/sdd-change-archive.prompt.md +0 -241
- package/.github/prompts/sdd-change-init.prompt.md +0 -269
- package/.github/prompts/sdd-design.prompt.md +0 -250
- package/.github/prompts/sdd-implement.prompt.md +0 -387
- package/.github/prompts/sdd-requirements.prompt.md +0 -193
- package/.github/prompts/sdd-review.prompt.md +0 -155
- package/.github/prompts/sdd-security.prompt.md +0 -228
- package/.github/prompts/sdd-steering.prompt.md +0 -269
- package/.github/prompts/sdd-tasks.prompt.md +0 -255
- package/.github/prompts/sdd-test.prompt.md +0 -230
- package/.github/prompts/sdd-validate.prompt.md +0 -304
- package/.github/skills/musubix-adr-generation/SKILL.md +0 -209
- package/.github/skills/musubix-best-practices/SKILL.md +0 -315
- package/.github/skills/musubix-c4-design/SKILL.md +0 -162
- package/.github/skills/musubix-code-generation/SKILL.md +0 -237
- package/.github/skills/musubix-domain-inference/SKILL.md +0 -196
- package/.github/skills/musubix-ears-validation/SKILL.md +0 -161
- package/.github/skills/musubix-sdd-workflow/SKILL.md +0 -217
- package/.github/skills/musubix-technical-writing/SKILL.md +0 -444
- package/.github/skills/musubix-test-generation/SKILL.md +0 -212
- package/.github/skills/musubix-traceability/SKILL.md +0 -141
- package/AGENTS.md +0 -1134
- package/LICENSE +0 -21
- package/README.ja.md +0 -313
- package/bin/musubix-mcp.js +0 -15
- package/docs/API-REFERENCE.md +0 -1425
- package/docs/GITHUB-ACTIONS-NPM-SETUP.md +0 -132
- package/docs/INSTALL-GUIDE.ja.md +0 -459
- package/docs/INSTALL-GUIDE.md +0 -459
- package/docs/MIGRATION-v3.0.md +0 -324
- package/docs/MUSUBI-enhancement_roadmap_20260105.md +0 -651
- package/docs/MUSUBIX-v3.0-User-Guide.md +0 -1357
- package/docs/MUSUBIXv2.2.0-Manual-outline.md +0 -136
- package/docs/MUSUBIXv2.2.0-Manual.md +0 -3123
- package/docs/MUSUBIXv2.3.5-Refactering.md +0 -1310
- package/docs/MUSUBIv1.6.1-enhancement_roadmap_20260105.md +0 -291
- package/docs/MUSUBIv2.2.0-USERGUIDE.md +0 -2079
- package/docs/ROADMAP-v1.5.md +0 -116
- package/docs/SwarmCoding.md +0 -1284
- package/docs/Test-prompt.md +0 -105
- package/docs/USER-GUIDE-v1.8.0.md +0 -2371
- package/docs/USER-GUIDE.ja.md +0 -2147
- package/docs/USER-GUIDE.md +0 -3022
- package/docs/YATA-GLOBAL-GUIDE.ja.md +0 -750
- package/docs/YATA-GLOBAL-GUIDE.md +0 -595
- package/docs/YATA-LOCAL-GUIDE.ja.md +0 -989
- package/docs/YATA-LOCAL-GUIDE.md +0 -730
- package/docs/adr/0001-real-time-pattern-learning-architecture-for-v1-5-0.md +0 -75
- package/docs/adr/0002-pattern-sharing-protocol-for-cross-team-collaborat.md +0 -79
- package/docs/adr/0003-owl-2-rl-implementation-strategy-for-advanced-infe.md +0 -90
- package/docs/adr/ADR-v3.4.0-001-deep-research-architecture.md +0 -217
- package/docs/adr/ADR-v3.4.0-002-search-provider-selection.md +0 -308
- package/docs/adr/ADR-v3.4.0-003-lm-api-integration.md +0 -475
- package/docs/enterprise-knowledge-management.md +0 -1737
- package/docs/evolution-from-musubi-to-musubix.md +0 -2170
- package/docs/getting-started-with-sdd.md +0 -1602
- package/docs/moodle-refactering-codegraph-musubix.md +0 -391
- package/docs/moodle-refactering-codegraph.md +0 -278
- package/docs/overview/MUSUBIX-CodeGraph.md +0 -322
- package/docs/overview/MUSUBIX-Core.md +0 -671
- package/docs/overview/MUSUBIX-Decisions.md +0 -494
- package/docs/overview/MUSUBIX-FormalVerify.md +0 -566
- package/docs/overview/MUSUBIX-Knowledge.md +0 -1231
- package/docs/overview/MUSUBIX-Learning.md +0 -837
- package/docs/overview/MUSUBIX-MCP-Server.md +0 -535
- package/docs/overview/MUSUBIX-Overview.md +0 -264
- package/docs/overview/MUSUBIX-Phase1-Complete.md +0 -271
- package/docs/overview/MUSUBIX-Phase2-Complete.md +0 -310
- package/docs/overview/MUSUBIX-Policy.md +0 -477
- package/docs/overview/MUSUBIX-Roadmap-v2.md +0 -399
- package/docs/overview/MUSUBIX-Security-Plan.md +0 -939
- package/docs/overview/MUSUBIX-Security-v2.1.md +0 -668
- package/docs/overview/MUSUBIX-Security.md +0 -891
- package/docs/overview/MUSUBIX-YATA.md +0 -666
- package/docs/overview/MUSUBIX-v2.2.0-Advanced-Learning.md +0 -513
- package/docs/overview/Neuro-SymbolicAI.md +0 -159
- package/docs/packages/knowledge.md +0 -594
- package/docs/qiita-linux-kernel-knowledge-graph.md +0 -596
- package/scripts/generate-quality-gate-report.ts +0 -106
- package/scripts/postinstall.js +0 -94
- package/steering/.musubi-version +0 -1
- package/steering/product.ja.md +0 -572
- package/steering/project.yml +0 -66
- package/steering/rules/constitution.md +0 -491
- package/steering/structure.ja.md +0 -503
- package/steering/tech.ja.md +0 -208
|
@@ -1,595 +0,0 @@
|
|
|
1
|
-
# YATA Global User Guide
|
|
2
|
-
|
|
3
|
-
> **YATA Global** - Distributed Knowledge Graph Platform
|
|
4
|
-
|
|
5
|
-
## 📖 Overview
|
|
6
|
-
|
|
7
|
-
YATA Global (`@nahisaho/yata-global`) is a community-based knowledge sharing platform. It enables global sharing and searching of framework knowledge, design patterns, and best practices.
|
|
8
|
-
|
|
9
|
-
### Key Features
|
|
10
|
-
|
|
11
|
-
| Feature | Description |
|
|
12
|
-
|---------|-------------|
|
|
13
|
-
| **Framework Knowledge** | Knowledge base for various frameworks |
|
|
14
|
-
| **Pattern Sharing** | Share design patterns and code patterns |
|
|
15
|
-
| **KGPR** | Contribution via Knowledge Graph Pull Request |
|
|
16
|
-
| **Offline Mode** | Offline operation via local cache |
|
|
17
|
-
| **Sync Engine** | Automatic/manual data synchronization |
|
|
18
|
-
| **Authentication** | User authentication and access control |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 🚀 Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install @nahisaho/yata-global
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Prerequisites
|
|
29
|
-
|
|
30
|
-
- Node.js >= 20.0.0
|
|
31
|
-
- npm >= 10.0.0
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 📘 Basic Usage
|
|
36
|
-
|
|
37
|
-
### Client Initialization
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
import { createYataGlobal } from '@nahisaho/yata-global';
|
|
41
|
-
|
|
42
|
-
const yataGlobal = createYataGlobal({
|
|
43
|
-
serverUrl: 'https://api.yata.example.com', // API server URL
|
|
44
|
-
offlineMode: false, // Offline mode
|
|
45
|
-
cacheSize: 100, // Cache size (MB)
|
|
46
|
-
autoSync: true, // Auto sync
|
|
47
|
-
syncInterval: 300000, // Sync interval (5 minutes)
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Register event listeners
|
|
51
|
-
yataGlobal.on('sync:start', () => console.log('Sync started'));
|
|
52
|
-
yataGlobal.on('sync:complete', (result) => console.log('Sync complete:', result));
|
|
53
|
-
yataGlobal.on('sync:error', (error) => console.error('Sync error:', error));
|
|
54
|
-
|
|
55
|
-
// On exit
|
|
56
|
-
yataGlobal.close();
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Configuration Options
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
interface SyncConfig {
|
|
63
|
-
serverUrl: string; // API server URL
|
|
64
|
-
offlineMode: boolean; // Offline mode (default: false)
|
|
65
|
-
cacheSize: number; // Local cache size (default: 100MB)
|
|
66
|
-
autoSync: boolean; // Auto sync (default: true)
|
|
67
|
-
syncInterval: number; // Sync interval (ms, default: 300000)
|
|
68
|
-
retryAttempts: number; // Retry attempts (default: 3)
|
|
69
|
-
timeout: number; // Timeout (ms)
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## 🔐 Authentication
|
|
76
|
-
|
|
77
|
-
### Login
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
// Login with username/password
|
|
81
|
-
const token = await yataGlobal.login({
|
|
82
|
-
username: 'developer',
|
|
83
|
-
password: 'secure-password',
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
console.log('Logged in, token expires:', token.expiresAt);
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Token Authentication
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
// Login with existing token
|
|
93
|
-
const token = await yataGlobal.loginWithToken('your-access-token');
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Logout
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
await yataGlobal.logout();
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Check Authentication Status
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
if (yataGlobal.isAuthenticated()) {
|
|
106
|
-
const user = await yataGlobal.getCurrentUser();
|
|
107
|
-
console.log('Current user:', user?.username);
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 📚 Framework Knowledge
|
|
114
|
-
|
|
115
|
-
### Search Frameworks
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
const result = await yataGlobal.searchFrameworks({
|
|
119
|
-
query: 'react',
|
|
120
|
-
category: 'web-frontend',
|
|
121
|
-
language: 'typescript',
|
|
122
|
-
tags: ['ui', 'component'],
|
|
123
|
-
minQuality: 70,
|
|
124
|
-
sortBy: 'popularity', // 'popularity' | 'quality' | 'updated' | 'relevance'
|
|
125
|
-
limit: 20,
|
|
126
|
-
offset: 0,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
console.log(`Found ${result.total} frameworks`);
|
|
130
|
-
for (const fw of result.items) {
|
|
131
|
-
console.log(`- ${fw.name} v${fw.version} (${fw.popularity}★)`);
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Framework Categories
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
type FrameworkCategory =
|
|
139
|
-
| 'web-frontend' // Web Frontend
|
|
140
|
-
| 'web-backend' // Web Backend
|
|
141
|
-
| 'mobile' // Mobile
|
|
142
|
-
| 'desktop' // Desktop
|
|
143
|
-
| 'database' // Database
|
|
144
|
-
| 'orm' // ORM
|
|
145
|
-
| 'testing' // Testing
|
|
146
|
-
| 'build-tool' // Build Tool
|
|
147
|
-
| 'cli' // CLI
|
|
148
|
-
| 'ai-ml' // AI/ML
|
|
149
|
-
| 'devops' // DevOps
|
|
150
|
-
| 'cloud' // Cloud
|
|
151
|
-
| 'security' // Security
|
|
152
|
-
| 'networking' // Networking
|
|
153
|
-
| 'data-processing' // Data Processing
|
|
154
|
-
| 'logging' // Logging
|
|
155
|
-
| 'monitoring' // Monitoring
|
|
156
|
-
| 'documentation' // Documentation
|
|
157
|
-
| 'other'; // Other
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Get Individual Framework
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
const framework = await yataGlobal.getFramework('react-18');
|
|
164
|
-
if (framework) {
|
|
165
|
-
console.log('Name:', framework.name);
|
|
166
|
-
console.log('Version:', framework.version);
|
|
167
|
-
console.log('Description:', framework.description);
|
|
168
|
-
console.log('Docs:', framework.documentationUrl);
|
|
169
|
-
console.log('Quality:', framework.quality);
|
|
170
|
-
console.log('Tags:', framework.tags.join(', '));
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 🧩 Patterns
|
|
177
|
-
|
|
178
|
-
### Search Patterns
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
const patterns = await yataGlobal.searchPatterns({
|
|
182
|
-
query: 'repository pattern',
|
|
183
|
-
category: 'data-access',
|
|
184
|
-
language: 'typescript',
|
|
185
|
-
sortBy: 'quality',
|
|
186
|
-
limit: 20,
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
for (const pattern of patterns.items) {
|
|
190
|
-
console.log(`- ${pattern.name}: ${pattern.description}`);
|
|
191
|
-
console.log(` Rating: ${pattern.rating.average}/5 (${pattern.downloads} downloads)`);
|
|
192
|
-
}
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Pattern Categories
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
type PatternCategory =
|
|
199
|
-
| 'architecture' // Architecture
|
|
200
|
-
| 'design-pattern' // Design Pattern
|
|
201
|
-
| 'testing' // Testing
|
|
202
|
-
| 'error-handling' // Error Handling
|
|
203
|
-
| 'authentication' // Authentication
|
|
204
|
-
| 'authorization' // Authorization
|
|
205
|
-
| 'api-design' // API Design
|
|
206
|
-
| 'data-access' // Data Access
|
|
207
|
-
| 'validation' // Validation
|
|
208
|
-
| 'logging' // Logging
|
|
209
|
-
| 'caching' // Caching
|
|
210
|
-
| 'async' // Async
|
|
211
|
-
| 'configuration' // Configuration
|
|
212
|
-
| 'other'; // Other
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Share Patterns
|
|
216
|
-
|
|
217
|
-
```typescript
|
|
218
|
-
// Authentication required
|
|
219
|
-
if (!yataGlobal.isAuthenticated()) {
|
|
220
|
-
await yataGlobal.login({ username, password });
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const patternId = await yataGlobal.sharePattern({
|
|
224
|
-
name: 'Service Layer Pattern',
|
|
225
|
-
description: 'Service layer pattern for encapsulating business logic',
|
|
226
|
-
category: 'architecture',
|
|
227
|
-
language: 'typescript',
|
|
228
|
-
frameworks: ['nestjs', 'express'],
|
|
229
|
-
template: `
|
|
230
|
-
export class {{ServiceName}} {
|
|
231
|
-
constructor(private readonly repository: I{{EntityName}}Repository) {}
|
|
232
|
-
|
|
233
|
-
async create(dto: Create{{EntityName}}Dto): Promise<{{EntityName}}> {
|
|
234
|
-
return this.repository.save(dto);
|
|
235
|
-
}
|
|
236
|
-
}`,
|
|
237
|
-
tags: ['service', 'layer', 'architecture'],
|
|
238
|
-
visibility: 'public',
|
|
239
|
-
official: false,
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
console.log('Pattern shared:', patternId);
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Rate Patterns
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
await yataGlobal.ratePattern('pattern-id', 5); // 1-5 rating
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
## 🔄 Sync
|
|
254
|
-
|
|
255
|
-
### Manual Sync
|
|
256
|
-
|
|
257
|
-
```typescript
|
|
258
|
-
const syncResult = await yataGlobal.sync();
|
|
259
|
-
|
|
260
|
-
console.log('Sync result:');
|
|
261
|
-
console.log(` Frameworks synced: ${syncResult.frameworksSynced}`);
|
|
262
|
-
console.log(` Patterns synced: ${syncResult.patternsSynced}`);
|
|
263
|
-
console.log(` Duration: ${syncResult.duration}ms`);
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
### Sync Status
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
const status = yataGlobal.getSyncStatus();
|
|
270
|
-
|
|
271
|
-
console.log('Sync status:');
|
|
272
|
-
console.log(` Last sync: ${status.lastSyncAt}`);
|
|
273
|
-
console.log(` Pending changes: ${status.pendingChanges}`);
|
|
274
|
-
console.log(` Is syncing: ${status.isSyncing}`);
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Offline Mode
|
|
278
|
-
|
|
279
|
-
```typescript
|
|
280
|
-
// Enable offline mode
|
|
281
|
-
yataGlobal.enableOfflineMode();
|
|
282
|
-
|
|
283
|
-
// Disable offline mode (go online)
|
|
284
|
-
yataGlobal.disableOfflineMode();
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
In offline mode:
|
|
288
|
-
- Data is retrieved from local cache
|
|
289
|
-
- Change operations are saved to sync queue
|
|
290
|
-
- Auto-sync on reconnection
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## 📤 KGPR (Knowledge Graph Pull Request)
|
|
295
|
-
|
|
296
|
-
KGPR is a workflow for contributing local knowledge graph changes to YATA Global.
|
|
297
|
-
|
|
298
|
-
### KGPR Workflow
|
|
299
|
-
|
|
300
|
-
```
|
|
301
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
302
|
-
│ KGPR Workflow │
|
|
303
|
-
│ │
|
|
304
|
-
│ [YATA Local] [YATA Global] │
|
|
305
|
-
│ │ │ │
|
|
306
|
-
│ 1. Create KGPR │ │
|
|
307
|
-
│ (Apply privacy filter) │ │
|
|
308
|
-
│ │ │ │
|
|
309
|
-
│ ▼ │ │
|
|
310
|
-
│ 2. Calculate diff │ │
|
|
311
|
-
│ (Entities & relationships) │ │
|
|
312
|
-
│ │ │ │
|
|
313
|
-
│ └─── 3. Submit KGPR ─────►│ │
|
|
314
|
-
│ │ │
|
|
315
|
-
│ 4. Review │
|
|
316
|
-
│ (approve/reject) │
|
|
317
|
-
│ │ │
|
|
318
|
-
│ 5. Merge │
|
|
319
|
-
│ (Conflict resolution) │
|
|
320
|
-
│ │ │
|
|
321
|
-
│ ◄───── 6. Notification ───┘ │
|
|
322
|
-
└─────────────────────────────────────────────────────────────┘
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
### KGPR REST API Endpoints
|
|
326
|
-
|
|
327
|
-
| Method | Endpoint | Description |
|
|
328
|
-
|--------|----------|-------------|
|
|
329
|
-
| GET | `/api/v1/kgprs` | List KGPRs |
|
|
330
|
-
| POST | `/api/v1/kgprs` | Create KGPR |
|
|
331
|
-
| GET | `/api/v1/kgprs/:id` | Get KGPR details |
|
|
332
|
-
| POST | `/api/v1/kgprs/:id/review` | Review KGPR |
|
|
333
|
-
| POST | `/api/v1/kgprs/:id/merge` | Merge KGPR |
|
|
334
|
-
|
|
335
|
-
### Create KGPR (REST API)
|
|
336
|
-
|
|
337
|
-
```bash
|
|
338
|
-
curl -X POST http://localhost:3000/api/v1/kgprs \
|
|
339
|
-
-H "Content-Type: application/json" \
|
|
340
|
-
-d '{
|
|
341
|
-
"title": "Add UserService pattern",
|
|
342
|
-
"description": "Patterns learned from user authentication flow",
|
|
343
|
-
"sourceNamespace": "app.services",
|
|
344
|
-
"labels": ["pattern", "authentication"],
|
|
345
|
-
"diff": {
|
|
346
|
-
"entities": {
|
|
347
|
-
"added": [
|
|
348
|
-
{
|
|
349
|
-
"changeType": "add",
|
|
350
|
-
"localId": "entity-1",
|
|
351
|
-
"name": "UserService",
|
|
352
|
-
"entityType": "class",
|
|
353
|
-
"namespace": "app.services",
|
|
354
|
-
"description": "User management service"
|
|
355
|
-
}
|
|
356
|
-
],
|
|
357
|
-
"updated": [],
|
|
358
|
-
"deleted": []
|
|
359
|
-
},
|
|
360
|
-
"relationships": {
|
|
361
|
-
"added": [],
|
|
362
|
-
"updated": [],
|
|
363
|
-
"deleted": []
|
|
364
|
-
},
|
|
365
|
-
"stats": {
|
|
366
|
-
"entitiesAdded": 1,
|
|
367
|
-
"entitiesUpdated": 0,
|
|
368
|
-
"entitiesDeleted": 0,
|
|
369
|
-
"relationshipsAdded": 0,
|
|
370
|
-
"relationshipsUpdated": 0,
|
|
371
|
-
"relationshipsDeleted": 0,
|
|
372
|
-
"totalChanges": 1
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}'
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
### Review KGPR (REST API)
|
|
379
|
-
|
|
380
|
-
```bash
|
|
381
|
-
# Approve
|
|
382
|
-
curl -X POST http://localhost:3000/api/v1/kgprs/KGPR-abc123/review \
|
|
383
|
-
-H "Content-Type: application/json" \
|
|
384
|
-
-d '{
|
|
385
|
-
"decision": "approve",
|
|
386
|
-
"comment": "LGTM! Great pattern."
|
|
387
|
-
}'
|
|
388
|
-
|
|
389
|
-
# Request changes
|
|
390
|
-
curl -X POST http://localhost:3000/api/v1/kgprs/KGPR-abc123/review \
|
|
391
|
-
-H "Content-Type: application/json" \
|
|
392
|
-
-d '{
|
|
393
|
-
"decision": "changes_requested",
|
|
394
|
-
"comment": "Please add more documentation."
|
|
395
|
-
}'
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
### Merge KGPR (REST API)
|
|
399
|
-
|
|
400
|
-
```bash
|
|
401
|
-
curl -X POST http://localhost:3000/api/v1/kgprs/KGPR-abc123/merge \
|
|
402
|
-
-H "Content-Type: application/json" \
|
|
403
|
-
-d '{
|
|
404
|
-
"conflictStrategy": "skip_conflicts"
|
|
405
|
-
}'
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
### Conflict Types
|
|
409
|
-
|
|
410
|
-
```typescript
|
|
411
|
-
type ConflictType =
|
|
412
|
-
| 'entity_exists' // Entity with same name already exists
|
|
413
|
-
| 'entity_modified' // Entity was modified after KGPR creation
|
|
414
|
-
| 'entity_deleted' // Entity was deleted after KGPR creation
|
|
415
|
-
| 'relationship_exists' // Relationship already exists
|
|
416
|
-
| 'relationship_broken' // Source/target entity doesn't exist
|
|
417
|
-
| 'circular_dependency' // Would create circular dependency
|
|
418
|
-
| 'schema_violation'; // Global KG schema violation
|
|
419
|
-
|
|
420
|
-
type ConflictResolution =
|
|
421
|
-
| 'use_local' // Use local (KGPR) value
|
|
422
|
-
| 'use_global' // Keep global value
|
|
423
|
-
| 'merge' // Merge both values
|
|
424
|
-
| 'skip' // Skip this change
|
|
425
|
-
| 'rename'; // Rename to avoid conflict
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
---
|
|
429
|
-
|
|
430
|
-
## 🐳 Docker Environment
|
|
431
|
-
|
|
432
|
-
### Start with Docker Compose
|
|
433
|
-
|
|
434
|
-
```bash
|
|
435
|
-
cd docker
|
|
436
|
-
docker compose up -d
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### Architecture
|
|
440
|
-
|
|
441
|
-
```
|
|
442
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
443
|
-
│ Docker Network │
|
|
444
|
-
│ ┌──────────────────┐ ┌──────────────────────────────┐ │
|
|
445
|
-
│ │ yata-global │ │ musubix-dev │ │
|
|
446
|
-
│ │ (Port 3000) │◄───│ (Development Environment) │ │
|
|
447
|
-
│ │ │ │ │ │
|
|
448
|
-
│ │ - HTTP API │ │ - MUSUBIX CLI │ │
|
|
449
|
-
│ │ - KGPR Server │ │ - YATA Local │ │
|
|
450
|
-
│ │ - Pattern Store │ │ - Project Workspace │ │
|
|
451
|
-
│ └──────────────────┘ └──────────────────────────────┘ │
|
|
452
|
-
└─────────────────────────────────────────────────────────────┘
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
### Health Check
|
|
456
|
-
|
|
457
|
-
```bash
|
|
458
|
-
curl http://localhost:3000/health
|
|
459
|
-
# {"status":"healthy","timestamp":"...","version":"1.0.0"}
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
### E2E Test
|
|
463
|
-
|
|
464
|
-
```bash
|
|
465
|
-
cd docker
|
|
466
|
-
./test-kgpr-flow.sh
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
---
|
|
470
|
-
|
|
471
|
-
## 🔧 HTTP Server
|
|
472
|
-
|
|
473
|
-
YATA Global HTTP server can be started standalone.
|
|
474
|
-
|
|
475
|
-
### Start Server
|
|
476
|
-
|
|
477
|
-
```bash
|
|
478
|
-
# Via npm
|
|
479
|
-
npx yata-global-server
|
|
480
|
-
|
|
481
|
-
# Or directly
|
|
482
|
-
node packages/yata-global/dist/bin/yata-global-server.js
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
### Environment Variables
|
|
486
|
-
|
|
487
|
-
| Variable | Default | Description |
|
|
488
|
-
|----------|---------|-------------|
|
|
489
|
-
| `PORT` | 3000 | Listen port |
|
|
490
|
-
| `HOST` | 0.0.0.0 | Listen host |
|
|
491
|
-
|
|
492
|
-
### API Endpoints
|
|
493
|
-
|
|
494
|
-
| Method | Path | Description |
|
|
495
|
-
|--------|------|-------------|
|
|
496
|
-
| GET | `/health` | Health check |
|
|
497
|
-
| POST | `/auth/login` | Login |
|
|
498
|
-
| POST | `/auth/logout` | Logout |
|
|
499
|
-
| GET | `/api/v1/kgprs` | List KGPRs |
|
|
500
|
-
| POST | `/api/v1/kgprs` | Create KGPR |
|
|
501
|
-
| GET | `/api/v1/kgprs/:id` | Get KGPR |
|
|
502
|
-
| POST | `/api/v1/kgprs/:id/review` | Review |
|
|
503
|
-
| POST | `/api/v1/kgprs/:id/merge` | Merge |
|
|
504
|
-
| GET | `/api/v1/patterns` | List patterns |
|
|
505
|
-
| POST | `/api/v1/patterns` | Create pattern |
|
|
506
|
-
| GET | `/api/v1/patterns/:id` | Get pattern |
|
|
507
|
-
| GET | `/api/v1/frameworks` | List frameworks |
|
|
508
|
-
| GET | `/api/v1/frameworks/:id` | Get framework |
|
|
509
|
-
|
|
510
|
-
---
|
|
511
|
-
|
|
512
|
-
## 📱 Events
|
|
513
|
-
|
|
514
|
-
YataGlobal emits the following events:
|
|
515
|
-
|
|
516
|
-
```typescript
|
|
517
|
-
// Authentication events
|
|
518
|
-
yataGlobal.on('auth:login', (user) => {
|
|
519
|
-
console.log('User logged in:', user.username);
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
yataGlobal.on('auth:logout', () => {
|
|
523
|
-
console.log('User logged out');
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
// Sync events
|
|
527
|
-
yataGlobal.on('sync:start', () => {
|
|
528
|
-
console.log('Sync started');
|
|
529
|
-
});
|
|
530
|
-
|
|
531
|
-
yataGlobal.on('sync:complete', (result) => {
|
|
532
|
-
console.log('Sync completed:', result);
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
yataGlobal.on('sync:error', (error) => {
|
|
536
|
-
console.error('Sync error:', error);
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
// Connection events
|
|
540
|
-
yataGlobal.on('connection:online', () => {
|
|
541
|
-
console.log('Online');
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
yataGlobal.on('connection:offline', () => {
|
|
545
|
-
console.log('Offline');
|
|
546
|
-
});
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
---
|
|
550
|
-
|
|
551
|
-
## 🔒 Privacy Filter
|
|
552
|
-
|
|
553
|
-
When creating a KGPR, a privacy filter is applied.
|
|
554
|
-
|
|
555
|
-
### Privacy Levels
|
|
556
|
-
|
|
557
|
-
| Level | Description |
|
|
558
|
-
|-------|-------------|
|
|
559
|
-
| `strict` | Completely remove file paths, line numbers, sensitive metadata |
|
|
560
|
-
| `moderate` | Relativize file paths, keep line numbers, remove sensitive metadata |
|
|
561
|
-
| `none` | No filtering |
|
|
562
|
-
|
|
563
|
-
### Sensitive Information Detection
|
|
564
|
-
|
|
565
|
-
Information automatically filtered:
|
|
566
|
-
- API keys
|
|
567
|
-
- Passwords
|
|
568
|
-
- Tokens
|
|
569
|
-
- Personal information (email addresses, etc.)
|
|
570
|
-
- Internal path information
|
|
571
|
-
|
|
572
|
-
---
|
|
573
|
-
|
|
574
|
-
## 📚 Related Documentation
|
|
575
|
-
|
|
576
|
-
- [YATA Local User Guide](./YATA-LOCAL-GUIDE.md)
|
|
577
|
-
- [Docker Environment README](../docker/README.md)
|
|
578
|
-
- [API Reference](./API-REFERENCE.md)
|
|
579
|
-
- [MUSUBIX User Guide](./USER-GUIDE.md)
|
|
580
|
-
|
|
581
|
-
---
|
|
582
|
-
|
|
583
|
-
## 📝 Version History
|
|
584
|
-
|
|
585
|
-
| Version | Major Changes |
|
|
586
|
-
|---------|---------------|
|
|
587
|
-
| v2.4.1 | HTTP server added, Docker support |
|
|
588
|
-
| v1.7.0 | MergeEngine enhancement, conflict resolution |
|
|
589
|
-
| v1.6.5 | KGPR, privacy filter added |
|
|
590
|
-
| v1.0.0 | Initial release |
|
|
591
|
-
|
|
592
|
-
---
|
|
593
|
-
|
|
594
|
-
**Last Updated**: 2026-01-11
|
|
595
|
-
**Package**: `@nahisaho/yata-global`
|