@nahisaho/musubix-core 1.0.9 → 1.0.13

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 (44) hide show
  1. package/dist/cli/commands/codegen.d.ts.map +1 -1
  2. package/dist/cli/commands/codegen.js +218 -1
  3. package/dist/cli/commands/codegen.js.map +1 -1
  4. package/dist/cli/commands/index.d.ts +1 -0
  5. package/dist/cli/commands/index.d.ts.map +1 -1
  6. package/dist/cli/commands/index.js +5 -0
  7. package/dist/cli/commands/index.js.map +1 -1
  8. package/dist/cli/commands/learn.d.ts +17 -0
  9. package/dist/cli/commands/learn.d.ts.map +1 -0
  10. package/dist/cli/commands/learn.js +285 -0
  11. package/dist/cli/commands/learn.js.map +1 -0
  12. package/dist/cli/commands/requirements.d.ts +1 -0
  13. package/dist/cli/commands/requirements.d.ts.map +1 -1
  14. package/dist/cli/commands/requirements.js +67 -16
  15. package/dist/cli/commands/requirements.js.map +1 -1
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/learning/feedback-collector.d.ts +108 -0
  21. package/dist/learning/feedback-collector.d.ts.map +1 -0
  22. package/dist/learning/feedback-collector.js +231 -0
  23. package/dist/learning/feedback-collector.js.map +1 -0
  24. package/dist/learning/index.d.ts +19 -0
  25. package/dist/learning/index.d.ts.map +1 -0
  26. package/dist/learning/index.js +19 -0
  27. package/dist/learning/index.js.map +1 -0
  28. package/dist/learning/learning-engine.d.ts +140 -0
  29. package/dist/learning/learning-engine.d.ts.map +1 -0
  30. package/dist/learning/learning-engine.js +338 -0
  31. package/dist/learning/learning-engine.js.map +1 -0
  32. package/dist/learning/pattern-extractor.d.ts +138 -0
  33. package/dist/learning/pattern-extractor.d.ts.map +1 -0
  34. package/dist/learning/pattern-extractor.js +400 -0
  35. package/dist/learning/pattern-extractor.js.map +1 -0
  36. package/dist/learning/types.d.ts +159 -0
  37. package/dist/learning/types.d.ts.map +1 -0
  38. package/dist/learning/types.js +20 -0
  39. package/dist/learning/types.js.map +1 -0
  40. package/dist/version.d.ts +1 -1
  41. package/dist/version.d.ts.map +1 -1
  42. package/dist/version.js +1 -1
  43. package/dist/version.js.map +1 -1
  44. package/package.json +1 -1
@@ -0,0 +1,400 @@
1
+ /**
2
+ * Pattern Extractor
3
+ *
4
+ * Extracts patterns from accumulated feedback
5
+ *
6
+ * @see REQ-LEARN-002 - Pattern Extraction
7
+ * @module @musubix/core/learning
8
+ */
9
+ import { randomUUID } from 'crypto';
10
+ import { promises as fs } from 'fs';
11
+ import { join, dirname } from 'path';
12
+ /**
13
+ * Pattern Extractor class
14
+ *
15
+ * Analyzes feedback to extract recurring patterns
16
+ *
17
+ * @see REQ-LEARN-002 - Pattern Extraction
18
+ */
19
+ export class PatternExtractor {
20
+ patternCache = new Map();
21
+ storagePath;
22
+ threshold;
23
+ loaded = false;
24
+ constructor(config = {}) {
25
+ this.storagePath = config.storagePath || 'storage/learning';
26
+ this.threshold = config.patternThreshold || 3;
27
+ }
28
+ /**
29
+ * Extract patterns from feedback list
30
+ *
31
+ * @see REQ-LEARN-002 - Pattern Extraction
32
+ * @param feedbackList - List of feedback to analyze
33
+ * @returns Newly created patterns
34
+ */
35
+ async extractPatterns(feedbackList) {
36
+ await this.ensureLoaded();
37
+ // Group feedback by similarity
38
+ const candidates = this.findCandidates(feedbackList);
39
+ // Create patterns from candidates that meet threshold
40
+ const newPatterns = [];
41
+ for (const candidate of candidates) {
42
+ if (candidate.occurrences >= this.threshold) {
43
+ const existing = this.findSimilarPattern(candidate);
44
+ if (existing) {
45
+ // Update existing pattern
46
+ existing.occurrences += candidate.occurrences;
47
+ existing.confidence = this.calculateConfidence(existing);
48
+ existing.lastUsed = new Date();
49
+ }
50
+ else {
51
+ // Create new pattern
52
+ const pattern = this.createPattern(candidate);
53
+ this.patternCache.set(pattern.id, pattern);
54
+ newPatterns.push(pattern);
55
+ }
56
+ }
57
+ }
58
+ await this.persist();
59
+ return newPatterns;
60
+ }
61
+ /**
62
+ * Get all patterns
63
+ */
64
+ async getPatterns() {
65
+ await this.ensureLoaded();
66
+ return Array.from(this.patternCache.values());
67
+ }
68
+ /**
69
+ * Get pattern by ID
70
+ */
71
+ async getPattern(id) {
72
+ await this.ensureLoaded();
73
+ return this.patternCache.get(id);
74
+ }
75
+ /**
76
+ * Add pattern manually
77
+ *
78
+ * @param name - Pattern name
79
+ * @param category - Pattern category
80
+ * @param trigger - Trigger conditions
81
+ * @param action - Action to take
82
+ * @param confidence - Initial confidence (default: 0.5)
83
+ */
84
+ async addPattern(name, category, trigger, action, confidence = 0.5) {
85
+ await this.ensureLoaded();
86
+ const pattern = {
87
+ id: `PAT-${randomUUID().slice(0, 8).toUpperCase()}`,
88
+ name,
89
+ category,
90
+ trigger,
91
+ action,
92
+ confidence: Math.max(0, Math.min(1, confidence)),
93
+ occurrences: 1,
94
+ lastUsed: new Date(),
95
+ createdAt: new Date(),
96
+ source: 'manual',
97
+ };
98
+ this.patternCache.set(pattern.id, pattern);
99
+ await this.persist();
100
+ return pattern;
101
+ }
102
+ /**
103
+ * Remove pattern by ID
104
+ */
105
+ async removePattern(id) {
106
+ await this.ensureLoaded();
107
+ const deleted = this.patternCache.delete(id);
108
+ if (deleted) {
109
+ await this.persist();
110
+ }
111
+ return deleted;
112
+ }
113
+ /**
114
+ * Update pattern confidence based on usage
115
+ */
116
+ async updatePatternUsage(id, success) {
117
+ await this.ensureLoaded();
118
+ const pattern = this.patternCache.get(id);
119
+ if (!pattern)
120
+ return undefined;
121
+ pattern.lastUsed = new Date();
122
+ if (success) {
123
+ pattern.occurrences++;
124
+ pattern.confidence = Math.min(1, pattern.confidence + 0.05);
125
+ }
126
+ else {
127
+ pattern.confidence = Math.max(0, pattern.confidence - 0.1);
128
+ }
129
+ await this.persist();
130
+ return pattern;
131
+ }
132
+ /**
133
+ * Apply decay to unused patterns
134
+ *
135
+ * @see REQ-LEARN-004 - Pattern Decay
136
+ * @param days - Days threshold for decay
137
+ * @param rate - Decay rate
138
+ * @param minConfidence - Minimum confidence to keep
139
+ */
140
+ async applyDecay(days = 30, rate = 0.1, minConfidence = 0.1) {
141
+ await this.ensureLoaded();
142
+ const now = new Date();
143
+ const threshold = new Date(now.getTime() - days * 24 * 60 * 60 * 1000);
144
+ let decayed = 0;
145
+ let archived = 0;
146
+ const toArchive = [];
147
+ for (const pattern of this.patternCache.values()) {
148
+ if (pattern.lastUsed < threshold) {
149
+ pattern.confidence = Math.max(0, pattern.confidence - rate);
150
+ decayed++;
151
+ if (pattern.confidence < minConfidence) {
152
+ toArchive.push(pattern.id);
153
+ archived++;
154
+ }
155
+ }
156
+ }
157
+ // Archive patterns below threshold
158
+ for (const id of toArchive) {
159
+ await this.archivePattern(id);
160
+ this.patternCache.delete(id);
161
+ }
162
+ await this.persist();
163
+ return { decayed, archived };
164
+ }
165
+ /**
166
+ * Get patterns by category
167
+ */
168
+ async getPatternsByCategory(category) {
169
+ await this.ensureLoaded();
170
+ return Array.from(this.patternCache.values()).filter((p) => p.category === category);
171
+ }
172
+ /**
173
+ * Get high confidence patterns
174
+ */
175
+ async getHighConfidencePatterns(threshold = 0.7) {
176
+ await this.ensureLoaded();
177
+ return Array.from(this.patternCache.values())
178
+ .filter((p) => p.confidence >= threshold)
179
+ .sort((a, b) => b.confidence - a.confidence);
180
+ }
181
+ /**
182
+ * Export patterns
183
+ */
184
+ async export() {
185
+ await this.ensureLoaded();
186
+ return Array.from(this.patternCache.values());
187
+ }
188
+ /**
189
+ * Import patterns
190
+ */
191
+ async import(patterns) {
192
+ await this.ensureLoaded();
193
+ let imported = 0;
194
+ for (const pattern of patterns) {
195
+ if (!this.patternCache.has(pattern.id)) {
196
+ this.patternCache.set(pattern.id, pattern);
197
+ imported++;
198
+ }
199
+ }
200
+ await this.persist();
201
+ return imported;
202
+ }
203
+ /**
204
+ * Find pattern candidates from feedback
205
+ */
206
+ findCandidates(feedbackList) {
207
+ const candidateMap = new Map();
208
+ for (const feedback of feedbackList) {
209
+ // Generate candidate key based on context
210
+ const key = this.generateCandidateKey(feedback);
211
+ if (candidateMap.has(key)) {
212
+ const candidate = candidateMap.get(key);
213
+ candidate.occurrences++;
214
+ candidate.feedbackIds.push(feedback.id);
215
+ }
216
+ else {
217
+ candidateMap.set(key, {
218
+ key,
219
+ category: feedback.artifactType,
220
+ context: this.extractContext(feedback),
221
+ actionType: this.mapFeedbackToAction(feedback.type),
222
+ content: this.extractContent(feedback),
223
+ occurrences: 1,
224
+ feedbackIds: [feedback.id],
225
+ });
226
+ }
227
+ }
228
+ return Array.from(candidateMap.values());
229
+ }
230
+ /**
231
+ * Generate a key for grouping similar feedback
232
+ */
233
+ generateCandidateKey(feedback) {
234
+ const parts = [
235
+ feedback.artifactType,
236
+ feedback.type,
237
+ feedback.context.language || 'any',
238
+ feedback.context.framework || 'any',
239
+ ];
240
+ return parts.join(':');
241
+ }
242
+ /**
243
+ * Extract context from feedback
244
+ */
245
+ extractContext(feedback) {
246
+ const context = {};
247
+ if (feedback.context.language) {
248
+ context.language = feedback.context.language;
249
+ }
250
+ if (feedback.context.framework) {
251
+ context.framework = feedback.context.framework;
252
+ }
253
+ return context;
254
+ }
255
+ /**
256
+ * Map feedback type to pattern action
257
+ */
258
+ mapFeedbackToAction(type) {
259
+ switch (type) {
260
+ case 'accept':
261
+ return 'prefer';
262
+ case 'reject':
263
+ return 'avoid';
264
+ case 'modify':
265
+ return 'suggest';
266
+ }
267
+ }
268
+ /**
269
+ * Extract content for pattern
270
+ */
271
+ extractContent(feedback) {
272
+ if (feedback.modified) {
273
+ return feedback.modified;
274
+ }
275
+ if (feedback.reason) {
276
+ return feedback.reason;
277
+ }
278
+ return `${feedback.type} ${feedback.artifactType}`;
279
+ }
280
+ /**
281
+ * Find similar existing pattern
282
+ */
283
+ findSimilarPattern(candidate) {
284
+ for (const pattern of this.patternCache.values()) {
285
+ if (pattern.category === candidate.category &&
286
+ pattern.action.type === candidate.actionType &&
287
+ this.contextMatches(pattern.trigger.context, candidate.context)) {
288
+ return pattern;
289
+ }
290
+ }
291
+ return undefined;
292
+ }
293
+ /**
294
+ * Check if contexts match
295
+ */
296
+ contextMatches(a, b) {
297
+ const keysA = Object.keys(a);
298
+ const keysB = Object.keys(b);
299
+ if (keysA.length !== keysB.length)
300
+ return false;
301
+ return keysA.every((key) => a[key] === b[key]);
302
+ }
303
+ /**
304
+ * Create pattern from candidate
305
+ */
306
+ createPattern(candidate) {
307
+ return {
308
+ id: `PAT-${randomUUID().slice(0, 8).toUpperCase()}`,
309
+ name: `Auto: ${candidate.category} ${candidate.actionType}`,
310
+ category: candidate.category,
311
+ trigger: {
312
+ context: candidate.context,
313
+ conditions: [],
314
+ },
315
+ action: {
316
+ type: candidate.actionType,
317
+ content: candidate.content,
318
+ },
319
+ confidence: this.calculateInitialConfidence(candidate),
320
+ occurrences: candidate.occurrences,
321
+ lastUsed: new Date(),
322
+ createdAt: new Date(),
323
+ source: 'auto',
324
+ };
325
+ }
326
+ /**
327
+ * Calculate initial confidence for new pattern
328
+ */
329
+ calculateInitialConfidence(candidate) {
330
+ // Base confidence starts at 0.3 and increases with occurrences
331
+ const base = 0.3;
332
+ const bonus = Math.min(0.5, (candidate.occurrences - this.threshold) * 0.1);
333
+ return Math.min(1, base + bonus);
334
+ }
335
+ /**
336
+ * Calculate confidence for existing pattern
337
+ */
338
+ calculateConfidence(pattern) {
339
+ // Confidence increases with occurrences, max 0.95
340
+ const base = 0.3;
341
+ const bonus = Math.min(0.65, pattern.occurrences * 0.05);
342
+ return Math.min(0.95, base + bonus);
343
+ }
344
+ /**
345
+ * Archive pattern to separate file
346
+ */
347
+ async archivePattern(id) {
348
+ const pattern = this.patternCache.get(id);
349
+ if (!pattern)
350
+ return;
351
+ const archivePath = join(this.storagePath, 'patterns-archive.json');
352
+ let archive = [];
353
+ try {
354
+ const data = await fs.readFile(archivePath, 'utf-8');
355
+ archive = JSON.parse(data);
356
+ }
357
+ catch {
358
+ // File doesn't exist
359
+ }
360
+ archive.push(pattern);
361
+ await fs.writeFile(archivePath, JSON.stringify(archive, null, 2), 'utf-8');
362
+ }
363
+ /**
364
+ * Ensure data is loaded from storage
365
+ */
366
+ async ensureLoaded() {
367
+ if (this.loaded)
368
+ return;
369
+ const filePath = join(this.storagePath, 'patterns.json');
370
+ try {
371
+ const data = await fs.readFile(filePath, 'utf-8');
372
+ const patterns = JSON.parse(data);
373
+ for (const pattern of patterns) {
374
+ pattern.lastUsed = new Date(pattern.lastUsed);
375
+ pattern.createdAt = new Date(pattern.createdAt);
376
+ this.patternCache.set(pattern.id, pattern);
377
+ }
378
+ }
379
+ catch {
380
+ // File doesn't exist yet
381
+ }
382
+ this.loaded = true;
383
+ }
384
+ /**
385
+ * Persist data to storage
386
+ */
387
+ async persist() {
388
+ const filePath = join(this.storagePath, 'patterns.json');
389
+ const dir = dirname(filePath);
390
+ try {
391
+ await fs.mkdir(dir, { recursive: true });
392
+ }
393
+ catch {
394
+ // Directory exists
395
+ }
396
+ const patterns = Array.from(this.patternCache.values());
397
+ await fs.writeFile(filePath, JSON.stringify(patterns, null, 2), 'utf-8');
398
+ }
399
+ }
400
+ //# sourceMappingURL=pattern-extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pattern-extractor.js","sourceRoot":"","sources":["../../src/learning/pattern-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAwBrC;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IACnB,YAAY,GAAgC,IAAI,GAAG,EAAE,CAAC;IACtD,WAAW,CAAS;IACpB,SAAS,CAAS;IAClB,MAAM,GAAY,KAAK,CAAC;IAEhC,YAAY,SAAkC,EAAE;QAC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AC,QAAQ,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC9C,OAAO,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,OAAO;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QAAC,MAAM,CAAC;YACP,mBAAmB;QACrB,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;QACxD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Learning Module Types
3
+ *
4
+ * Type definitions for the self-learning system
5
+ *
6
+ * @see REQ-LEARN-001 - Feedback Collection
7
+ * @see REQ-LEARN-002 - Pattern Extraction
8
+ * @module @musubix/core/learning
9
+ */
10
+ /**
11
+ * Feedback type indicating user response to generated artifacts
12
+ */
13
+ export type FeedbackType = 'accept' | 'reject' | 'modify';
14
+ /**
15
+ * Artifact types that can receive feedback
16
+ */
17
+ export type ArtifactType = 'requirement' | 'design' | 'code' | 'test';
18
+ /**
19
+ * Pattern categories for classification
20
+ */
21
+ export type PatternCategory = 'code' | 'design' | 'requirement' | 'test';
22
+ /**
23
+ * Pattern action types
24
+ */
25
+ export type PatternActionType = 'prefer' | 'avoid' | 'suggest';
26
+ /**
27
+ * Pattern source indicating how the pattern was created
28
+ */
29
+ export type PatternSource = 'auto' | 'manual';
30
+ /**
31
+ * Context information for feedback
32
+ * @see REQ-LEARN-001 - Context attachment
33
+ */
34
+ export interface FeedbackContext {
35
+ /** Project name or identifier */
36
+ project: string;
37
+ /** Programming language (if applicable) */
38
+ language?: string;
39
+ /** Framework being used (if applicable) */
40
+ framework?: string;
41
+ /** Additional tags for categorization */
42
+ tags: string[];
43
+ }
44
+ /**
45
+ * User feedback on generated artifacts
46
+ * @see REQ-LEARN-001 - Feedback Collection
47
+ */
48
+ export interface Feedback {
49
+ /** Unique identifier */
50
+ id: string;
51
+ /** Timestamp of feedback */
52
+ timestamp: Date;
53
+ /** Type of feedback */
54
+ type: FeedbackType;
55
+ /** Type of artifact receiving feedback */
56
+ artifactType: ArtifactType;
57
+ /** ID of the artifact */
58
+ artifactId: string;
59
+ /** Context information */
60
+ context: FeedbackContext;
61
+ /** Optional reason for the feedback */
62
+ reason?: string;
63
+ /** Original content (for modify type) */
64
+ original?: string;
65
+ /** Modified content (for modify type) */
66
+ modified?: string;
67
+ }
68
+ /**
69
+ * Pattern trigger conditions
70
+ */
71
+ export interface PatternTrigger {
72
+ /** Context matching conditions */
73
+ context: Record<string, string>;
74
+ /** Additional conditions as expressions */
75
+ conditions: string[];
76
+ }
77
+ /**
78
+ * Pattern action to take when triggered
79
+ */
80
+ export interface PatternAction {
81
+ /** Type of action */
82
+ type: PatternActionType;
83
+ /** Action content/template */
84
+ content: string;
85
+ }
86
+ /**
87
+ * Learned pattern from feedback analysis
88
+ * @see REQ-LEARN-002 - Pattern Extraction
89
+ */
90
+ export interface LearnedPattern {
91
+ /** Unique identifier */
92
+ id: string;
93
+ /** Human-readable pattern name */
94
+ name: string;
95
+ /** Category of the pattern */
96
+ category: PatternCategory;
97
+ /** Trigger conditions */
98
+ trigger: PatternTrigger;
99
+ /** Action to take */
100
+ action: PatternAction;
101
+ /** Confidence score (0.0 - 1.0) */
102
+ confidence: number;
103
+ /** Number of times this pattern was observed */
104
+ occurrences: number;
105
+ /** Last time the pattern was used */
106
+ lastUsed: Date;
107
+ /** Creation timestamp */
108
+ createdAt: Date;
109
+ /** How the pattern was created */
110
+ source: PatternSource;
111
+ }
112
+ /**
113
+ * Learning statistics
114
+ */
115
+ export interface LearningStats {
116
+ /** Total feedback count */
117
+ totalFeedback: number;
118
+ /** Feedback by type */
119
+ feedbackByType: Record<FeedbackType, number>;
120
+ /** Total pattern count */
121
+ totalPatterns: number;
122
+ /** Patterns by category */
123
+ patternsByCategory: Record<PatternCategory, number>;
124
+ /** Average confidence score */
125
+ averageConfidence: number;
126
+ /** Last learning update */
127
+ lastUpdate: Date;
128
+ }
129
+ /**
130
+ * Pattern match result
131
+ */
132
+ export interface PatternMatch {
133
+ /** Matched pattern */
134
+ pattern: LearnedPattern;
135
+ /** Match score (0.0 - 1.0) */
136
+ matchScore: number;
137
+ /** Matched context keys */
138
+ matchedKeys: string[];
139
+ }
140
+ /**
141
+ * Learning engine configuration
142
+ */
143
+ export interface LearningConfig {
144
+ /** Minimum occurrences to create pattern (default: 3) */
145
+ patternThreshold: number;
146
+ /** Days before decay starts (default: 30) */
147
+ decayDays: number;
148
+ /** Decay rate per period (default: 0.1) */
149
+ decayRate: number;
150
+ /** Minimum confidence to keep pattern (default: 0.1) */
151
+ minConfidence: number;
152
+ /** Storage path for learning data */
153
+ storagePath: string;
154
+ }
155
+ /**
156
+ * Default learning configuration
157
+ */
158
+ export declare const DEFAULT_LEARNING_CONFIG: LearningConfig;
159
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/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E,MAAM,CAAC;IACnB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,cAMrC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Learning Module Types
3
+ *
4
+ * Type definitions for the self-learning system
5
+ *
6
+ * @see REQ-LEARN-001 - Feedback Collection
7
+ * @see REQ-LEARN-002 - Pattern Extraction
8
+ * @module @musubix/core/learning
9
+ */
10
+ /**
11
+ * Default learning configuration
12
+ */
13
+ export const DEFAULT_LEARNING_CONFIG = {
14
+ patternThreshold: 3,
15
+ decayDays: 30,
16
+ decayRate: 0.1,
17
+ minConfidence: 0.1,
18
+ storagePath: 'storage/learning',
19
+ };
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/learning/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgKH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,kBAAkB;CAChC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -4,5 +4,5 @@
4
4
  * @packageDocumentation
5
5
  * @module @musubix/core/version
6
6
  */
7
- export declare const VERSION = "1.0.9";
7
+ export declare const VERSION = "1.0.13";
8
8
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/dist/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * @packageDocumentation
5
5
  * @module @musubix/core/version
6
6
  */
7
- export const VERSION = '1.0.9';
7
+ export const VERSION = '1.0.13';
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/musubix-core",
3
- "version": "1.0.9",
3
+ "version": "1.0.13",
4
4
  "description": "MUSUBIX Core Library - Neuro-Symbolic Integration Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",