pikakit 3.0.5 → 3.7.2
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 +1 -1
- package/bin/lib/commands/install.js +119 -242
- package/package.json +3 -4
- package/lib/agent-cli/bin/agent.js +0 -187
- package/lib/agent-cli/dashboard/dashboard_server.js +0 -312
- package/lib/agent-cli/lib/ab-testing.js +0 -364
- package/lib/agent-cli/lib/audit.js +0 -154
- package/lib/agent-cli/lib/audit.test.js +0 -100
- package/lib/agent-cli/lib/auto-learn.js +0 -319
- package/lib/agent-cli/lib/backup.js +0 -138
- package/lib/agent-cli/lib/backup.test.js +0 -78
- package/lib/agent-cli/lib/causality-engine.js +0 -331
- package/lib/agent-cli/lib/cognitive-lesson.js +0 -476
- package/lib/agent-cli/lib/completion.js +0 -149
- package/lib/agent-cli/lib/config.js +0 -35
- package/lib/agent-cli/lib/dashboard-data.js +0 -380
- package/lib/agent-cli/lib/eslint-fix.js +0 -238
- package/lib/agent-cli/lib/evolution-signal.js +0 -215
- package/lib/agent-cli/lib/export.js +0 -86
- package/lib/agent-cli/lib/export.test.js +0 -65
- package/lib/agent-cli/lib/fix.js +0 -337
- package/lib/agent-cli/lib/fix.test.js +0 -80
- package/lib/agent-cli/lib/gemini-export.js +0 -83
- package/lib/agent-cli/lib/generate-registry.js +0 -42
- package/lib/agent-cli/lib/hooks/install-hooks.js +0 -152
- package/lib/agent-cli/lib/hooks/lint-learn.js +0 -172
- package/lib/agent-cli/lib/icons.js +0 -93
- package/lib/agent-cli/lib/ignore.js +0 -116
- package/lib/agent-cli/lib/ignore.test.js +0 -58
- package/lib/agent-cli/lib/init.js +0 -124
- package/lib/agent-cli/lib/knowledge-index.js +0 -326
- package/lib/agent-cli/lib/knowledge-metrics.js +0 -335
- package/lib/agent-cli/lib/knowledge-retention.js +0 -398
- package/lib/agent-cli/lib/knowledge-validator.js +0 -312
- package/lib/agent-cli/lib/learn.js +0 -255
- package/lib/agent-cli/lib/learn.test.js +0 -70
- package/lib/agent-cli/lib/metrics-collector.js +0 -410
- package/lib/agent-cli/lib/proposals.js +0 -199
- package/lib/agent-cli/lib/proposals.test.js +0 -56
- package/lib/agent-cli/lib/recall.js +0 -835
- package/lib/agent-cli/lib/recall.test.js +0 -107
- package/lib/agent-cli/lib/reinforcement.js +0 -299
- package/lib/agent-cli/lib/selfevolution-bridge.js +0 -167
- package/lib/agent-cli/lib/settings.js +0 -203
- package/lib/agent-cli/lib/skill-generator.js +0 -379
- package/lib/agent-cli/lib/skill-learn.js +0 -296
- package/lib/agent-cli/lib/stats.js +0 -132
- package/lib/agent-cli/lib/stats.test.js +0 -94
- package/lib/agent-cli/lib/types.js +0 -33
- package/lib/agent-cli/lib/ui/audit-ui.js +0 -146
- package/lib/agent-cli/lib/ui/backup-ui.js +0 -107
- package/lib/agent-cli/lib/ui/clack-helpers.js +0 -317
- package/lib/agent-cli/lib/ui/common.js +0 -83
- package/lib/agent-cli/lib/ui/completion-ui.js +0 -126
- package/lib/agent-cli/lib/ui/custom-select.js +0 -69
- package/lib/agent-cli/lib/ui/dashboard-ui.js +0 -222
- package/lib/agent-cli/lib/ui/evolution-signals-ui.js +0 -107
- package/lib/agent-cli/lib/ui/export-ui.js +0 -94
- package/lib/agent-cli/lib/ui/fix-all-ui.js +0 -191
- package/lib/agent-cli/lib/ui/help-ui.js +0 -49
- package/lib/agent-cli/lib/ui/index.js +0 -199
- package/lib/agent-cli/lib/ui/init-ui.js +0 -56
- package/lib/agent-cli/lib/ui/knowledge-ui.js +0 -55
- package/lib/agent-cli/lib/ui/learn-ui.js +0 -706
- package/lib/agent-cli/lib/ui/lessons-ui.js +0 -148
- package/lib/agent-cli/lib/ui/pretty.js +0 -145
- package/lib/agent-cli/lib/ui/proposals-ui.js +0 -99
- package/lib/agent-cli/lib/ui/recall-ui.js +0 -342
- package/lib/agent-cli/lib/ui/routing-demo.js +0 -79
- package/lib/agent-cli/lib/ui/routing-ui.js +0 -325
- package/lib/agent-cli/lib/ui/settings-ui.js +0 -381
- package/lib/agent-cli/lib/ui/stats-ui.js +0 -123
- package/lib/agent-cli/lib/ui/watch-ui.js +0 -236
- package/lib/agent-cli/lib/watcher.js +0 -181
- package/lib/agent-cli/lib/watcher.test.js +0 -85
- package/lib/agent-cli/src/MIGRATION.md +0 -418
- package/lib/agent-cli/src/README.md +0 -367
- package/lib/agent-cli/src/core/evolution/evolution-signal.js +0 -42
- package/lib/agent-cli/src/core/evolution/index.js +0 -17
- package/lib/agent-cli/src/core/evolution/review-gate.js +0 -40
- package/lib/agent-cli/src/core/evolution/signal-detector.js +0 -137
- package/lib/agent-cli/src/core/evolution/signal-queue.js +0 -79
- package/lib/agent-cli/src/core/evolution/threshold-checker.js +0 -79
- package/lib/agent-cli/src/core/index.js +0 -15
- package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +0 -282
- package/lib/agent-cli/src/core/learning/index.js +0 -12
- package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +0 -83
- package/lib/agent-cli/src/core/scanning/index.js +0 -14
- package/lib/agent-cli/src/data/index.js +0 -13
- package/lib/agent-cli/src/data/repositories/index.js +0 -8
- package/lib/agent-cli/src/data/repositories/lesson-repository.js +0 -130
- package/lib/agent-cli/src/data/repositories/signal-repository.js +0 -119
- package/lib/agent-cli/src/data/storage/index.js +0 -8
- package/lib/agent-cli/src/data/storage/json-storage.js +0 -64
- package/lib/agent-cli/src/data/storage/yaml-storage.js +0 -66
- package/lib/agent-cli/src/infrastructure/index.js +0 -13
- package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +0 -232
- package/lib/agent-cli/src/services/export-service.js +0 -162
- package/lib/agent-cli/src/services/index.js +0 -13
- package/lib/agent-cli/src/services/learning-service.js +0 -99
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LearningService - Application Service
|
|
3
|
-
*
|
|
4
|
-
* Orchestrates learning workflow:
|
|
5
|
-
* - Load raw data (mistakes, improvements)
|
|
6
|
-
* - Synthesize cognitive lessons
|
|
7
|
-
* - Manage lesson CRUD operations
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { LessonSynthesizer } from '../core/learning/lesson-synthesizer.js';
|
|
11
|
-
|
|
12
|
-
export class LearningService {
|
|
13
|
-
constructor(lessonRepository) {
|
|
14
|
-
this.lessonRepository = lessonRepository;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get all cognitive lessons
|
|
19
|
-
* @returns {Promise<Array>}
|
|
20
|
-
*/
|
|
21
|
-
async getCognitiveLessons() {
|
|
22
|
-
const mistakesDb = await this.lessonRepository.loadMistakes();
|
|
23
|
-
const improvementsDb = await this.lessonRepository.loadImprovements();
|
|
24
|
-
|
|
25
|
-
return LessonSynthesizer.synthesize(
|
|
26
|
-
mistakesDb.mistakes || [],
|
|
27
|
-
improvementsDb.improvements || []
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Add a lesson to legacy format
|
|
33
|
-
* @param {string} pattern - Regex pattern
|
|
34
|
-
* @param {string} message - Explanation message
|
|
35
|
-
* @param {string} severity - WARNING or ERROR
|
|
36
|
-
* @param {string} category - Category tag
|
|
37
|
-
* @returns {Promise<object>}
|
|
38
|
-
*/
|
|
39
|
-
async addLesson(pattern, message, severity = 'WARNING', category = 'general') {
|
|
40
|
-
// Validate Regex
|
|
41
|
-
try {
|
|
42
|
-
new RegExp(pattern);
|
|
43
|
-
} catch (e) {
|
|
44
|
-
throw new Error(`Invalid Regex pattern: ${e.message}`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Validate severity
|
|
48
|
-
if (!['WARNING', 'ERROR'].includes(severity.toUpperCase())) {
|
|
49
|
-
throw new Error('Invalid severity. Must be WARNING or ERROR');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Check for duplicates
|
|
53
|
-
const db = await this.lessonRepository.loadLegacyLessons();
|
|
54
|
-
const exists = db.lessons.some(l => l.pattern === pattern);
|
|
55
|
-
|
|
56
|
-
if (exists) {
|
|
57
|
-
throw new Error('Pattern already exists in knowledge base');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const id = `LEARN-${String(db.lessons.length + 1).padStart(3, '0')}`;
|
|
61
|
-
|
|
62
|
-
const lesson = {
|
|
63
|
-
id,
|
|
64
|
-
pattern,
|
|
65
|
-
message,
|
|
66
|
-
severity: severity.toUpperCase(),
|
|
67
|
-
category,
|
|
68
|
-
source: 'manual',
|
|
69
|
-
hitCount: 0,
|
|
70
|
-
lastHit: null,
|
|
71
|
-
autoEscalated: false,
|
|
72
|
-
addedAt: new Date().toISOString()
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return this.lessonRepository.addLegacyLesson(lesson);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Remove a lesson
|
|
80
|
-
* @param {string} lessonId
|
|
81
|
-
*/
|
|
82
|
-
async removeLesson(lessonId) {
|
|
83
|
-
return this.lessonRepository.removeLegacyLesson(lessonId);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* List all lessons
|
|
88
|
-
* @param {string} category - Optional category filter
|
|
89
|
-
*/
|
|
90
|
-
async listLessons(category = null) {
|
|
91
|
-
const db = await this.lessonRepository.loadLegacyLessons();
|
|
92
|
-
|
|
93
|
-
if (category) {
|
|
94
|
-
return db.lessons.filter(l => l.category === category);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return db.lessons;
|
|
98
|
-
}
|
|
99
|
-
}
|