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.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/bin/lib/commands/install.js +119 -242
  3. package/package.json +3 -4
  4. package/lib/agent-cli/bin/agent.js +0 -187
  5. package/lib/agent-cli/dashboard/dashboard_server.js +0 -312
  6. package/lib/agent-cli/lib/ab-testing.js +0 -364
  7. package/lib/agent-cli/lib/audit.js +0 -154
  8. package/lib/agent-cli/lib/audit.test.js +0 -100
  9. package/lib/agent-cli/lib/auto-learn.js +0 -319
  10. package/lib/agent-cli/lib/backup.js +0 -138
  11. package/lib/agent-cli/lib/backup.test.js +0 -78
  12. package/lib/agent-cli/lib/causality-engine.js +0 -331
  13. package/lib/agent-cli/lib/cognitive-lesson.js +0 -476
  14. package/lib/agent-cli/lib/completion.js +0 -149
  15. package/lib/agent-cli/lib/config.js +0 -35
  16. package/lib/agent-cli/lib/dashboard-data.js +0 -380
  17. package/lib/agent-cli/lib/eslint-fix.js +0 -238
  18. package/lib/agent-cli/lib/evolution-signal.js +0 -215
  19. package/lib/agent-cli/lib/export.js +0 -86
  20. package/lib/agent-cli/lib/export.test.js +0 -65
  21. package/lib/agent-cli/lib/fix.js +0 -337
  22. package/lib/agent-cli/lib/fix.test.js +0 -80
  23. package/lib/agent-cli/lib/gemini-export.js +0 -83
  24. package/lib/agent-cli/lib/generate-registry.js +0 -42
  25. package/lib/agent-cli/lib/hooks/install-hooks.js +0 -152
  26. package/lib/agent-cli/lib/hooks/lint-learn.js +0 -172
  27. package/lib/agent-cli/lib/icons.js +0 -93
  28. package/lib/agent-cli/lib/ignore.js +0 -116
  29. package/lib/agent-cli/lib/ignore.test.js +0 -58
  30. package/lib/agent-cli/lib/init.js +0 -124
  31. package/lib/agent-cli/lib/knowledge-index.js +0 -326
  32. package/lib/agent-cli/lib/knowledge-metrics.js +0 -335
  33. package/lib/agent-cli/lib/knowledge-retention.js +0 -398
  34. package/lib/agent-cli/lib/knowledge-validator.js +0 -312
  35. package/lib/agent-cli/lib/learn.js +0 -255
  36. package/lib/agent-cli/lib/learn.test.js +0 -70
  37. package/lib/agent-cli/lib/metrics-collector.js +0 -410
  38. package/lib/agent-cli/lib/proposals.js +0 -199
  39. package/lib/agent-cli/lib/proposals.test.js +0 -56
  40. package/lib/agent-cli/lib/recall.js +0 -835
  41. package/lib/agent-cli/lib/recall.test.js +0 -107
  42. package/lib/agent-cli/lib/reinforcement.js +0 -299
  43. package/lib/agent-cli/lib/selfevolution-bridge.js +0 -167
  44. package/lib/agent-cli/lib/settings.js +0 -203
  45. package/lib/agent-cli/lib/skill-generator.js +0 -379
  46. package/lib/agent-cli/lib/skill-learn.js +0 -296
  47. package/lib/agent-cli/lib/stats.js +0 -132
  48. package/lib/agent-cli/lib/stats.test.js +0 -94
  49. package/lib/agent-cli/lib/types.js +0 -33
  50. package/lib/agent-cli/lib/ui/audit-ui.js +0 -146
  51. package/lib/agent-cli/lib/ui/backup-ui.js +0 -107
  52. package/lib/agent-cli/lib/ui/clack-helpers.js +0 -317
  53. package/lib/agent-cli/lib/ui/common.js +0 -83
  54. package/lib/agent-cli/lib/ui/completion-ui.js +0 -126
  55. package/lib/agent-cli/lib/ui/custom-select.js +0 -69
  56. package/lib/agent-cli/lib/ui/dashboard-ui.js +0 -222
  57. package/lib/agent-cli/lib/ui/evolution-signals-ui.js +0 -107
  58. package/lib/agent-cli/lib/ui/export-ui.js +0 -94
  59. package/lib/agent-cli/lib/ui/fix-all-ui.js +0 -191
  60. package/lib/agent-cli/lib/ui/help-ui.js +0 -49
  61. package/lib/agent-cli/lib/ui/index.js +0 -199
  62. package/lib/agent-cli/lib/ui/init-ui.js +0 -56
  63. package/lib/agent-cli/lib/ui/knowledge-ui.js +0 -55
  64. package/lib/agent-cli/lib/ui/learn-ui.js +0 -706
  65. package/lib/agent-cli/lib/ui/lessons-ui.js +0 -148
  66. package/lib/agent-cli/lib/ui/pretty.js +0 -145
  67. package/lib/agent-cli/lib/ui/proposals-ui.js +0 -99
  68. package/lib/agent-cli/lib/ui/recall-ui.js +0 -342
  69. package/lib/agent-cli/lib/ui/routing-demo.js +0 -79
  70. package/lib/agent-cli/lib/ui/routing-ui.js +0 -325
  71. package/lib/agent-cli/lib/ui/settings-ui.js +0 -381
  72. package/lib/agent-cli/lib/ui/stats-ui.js +0 -123
  73. package/lib/agent-cli/lib/ui/watch-ui.js +0 -236
  74. package/lib/agent-cli/lib/watcher.js +0 -181
  75. package/lib/agent-cli/lib/watcher.test.js +0 -85
  76. package/lib/agent-cli/src/MIGRATION.md +0 -418
  77. package/lib/agent-cli/src/README.md +0 -367
  78. package/lib/agent-cli/src/core/evolution/evolution-signal.js +0 -42
  79. package/lib/agent-cli/src/core/evolution/index.js +0 -17
  80. package/lib/agent-cli/src/core/evolution/review-gate.js +0 -40
  81. package/lib/agent-cli/src/core/evolution/signal-detector.js +0 -137
  82. package/lib/agent-cli/src/core/evolution/signal-queue.js +0 -79
  83. package/lib/agent-cli/src/core/evolution/threshold-checker.js +0 -79
  84. package/lib/agent-cli/src/core/index.js +0 -15
  85. package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +0 -282
  86. package/lib/agent-cli/src/core/learning/index.js +0 -12
  87. package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +0 -83
  88. package/lib/agent-cli/src/core/scanning/index.js +0 -14
  89. package/lib/agent-cli/src/data/index.js +0 -13
  90. package/lib/agent-cli/src/data/repositories/index.js +0 -8
  91. package/lib/agent-cli/src/data/repositories/lesson-repository.js +0 -130
  92. package/lib/agent-cli/src/data/repositories/signal-repository.js +0 -119
  93. package/lib/agent-cli/src/data/storage/index.js +0 -8
  94. package/lib/agent-cli/src/data/storage/json-storage.js +0 -64
  95. package/lib/agent-cli/src/data/storage/yaml-storage.js +0 -66
  96. package/lib/agent-cli/src/infrastructure/index.js +0 -13
  97. package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +0 -232
  98. package/lib/agent-cli/src/services/export-service.js +0 -162
  99. package/lib/agent-cli/src/services/index.js +0 -13
  100. package/lib/agent-cli/src/services/learning-service.js +0 -99
@@ -1,199 +0,0 @@
1
- /**
2
- * Main Menu UI - Interactive CLI interface
3
- */
4
- import { showIntro, showActionMenu, theme } from "./clack-helpers.js";
5
- import { loadSettings } from "../settings.js";
6
-
7
- import { fileURLToPath } from "url";
8
- import { dirname, join } from "path";
9
-
10
- // Import UI modules
11
- import { runLearnUI } from "./learn-ui.js";
12
- import { runStatsUI } from "./stats-ui.js";
13
- import { runRecallUI } from "./recall-ui.js";
14
- import { runFixAllUI } from "./fix-all-ui.js";
15
- import { runSettingsUI } from "./settings-ui.js";
16
- import { runBackupUI } from "./backup-ui.js";
17
- import { runExportUI } from "./export-ui.js";
18
- import { runProposalsUI } from "./proposals-ui.js";
19
- import { runCompletionUI } from "./completion-ui.js";
20
- import { runInitUI } from "./init-ui.js";
21
- // Removed: audit-ui and watch-ui (audit redundant with recall, watch kept as CLI-only)
22
- import { runLessonsUI } from "./lessons-ui.js";
23
- import { runEvolutionSignalsUI } from "./evolution-signals-ui.js";
24
- import { runKnowledgeUI } from "./knowledge-ui.js";
25
- import { runHelpUI } from "./help-ui.js";
26
- import { runDashboardUI } from "./dashboard-ui.js";
27
- import routingUI from "./routing-ui.js";
28
- import * as p from "@clack/prompts";
29
- import { VERSION } from "../config.js";
30
- import gradient from 'gradient-string';
31
-
32
- // ============================================================================
33
- // ASCII BANNER
34
- // ============================================================================
35
-
36
- const AGENT_BANNER = `
37
- _ _
38
- / \\ __ _ ___ _ __ | |_
39
- / _ \\ / _\` |/ _ \\ '_ \\| __|
40
- / ___ \\ (_| | __/ | | | |_
41
- /_/ \\_\\__, |\\___|_| |_|\\__|
42
- |___/
43
- `;
44
-
45
- // Custom gradient: white → gray (like PikaKit style)
46
- const agentGradient = gradient(['#ffffff', '#bbbbbb', '#888888', '#555555']);
47
-
48
- function showAgentBanner() {
49
- // Extra clear to remove Clack prompt residuals
50
- process.stdout.write('\x1B[2J\x1B[0f');
51
- console.clear();
52
- console.log(''); // Extra space at top
53
- const lines = AGENT_BANNER.split('\n').filter(l => l.trim() !== '');
54
-
55
- // Print all lines except last with gradient
56
- for (let i = 0; i < lines.length - 1; i++) {
57
- console.log(agentGradient(lines[i]));
58
- }
59
-
60
- // Last line + version (aligned like PikaKit)
61
- console.log(agentGradient(lines[lines.length - 1]) + theme.dim(` v${VERSION}`));
62
- console.log(''); // Empty line to break vertical connector
63
- }
64
-
65
- // ============================================================================
66
- // MAIN MENU
67
- // ============================================================================
68
-
69
- /**
70
- * Show main interactive menu
71
- */
72
- export async function showMainMenu() {
73
- while (true) {
74
- showAgentBanner();
75
-
76
- // Load settings to check auto-learning status
77
- const settings = loadSettings();
78
- const autoLearningEnabled = settings.autoLearn !== false; // Default to true
79
-
80
- // Build menu options dynamically
81
- const menuOptions = [
82
- // ═════════════════════════════════════════════
83
- // 🔍 SCANNING & ACTIONS
84
- // ═════════════════════════════════════════════
85
- { value: "scanall", label: "🔎 Scan All", hint: "Check & fix violations" },
86
-
87
- // ═════════════════════════════════════════════
88
- // 📚 LEARNING & KNOWLEDGE
89
- // ═════════════════════════════════════════════
90
- ];
91
-
92
- // Only show Learn if auto-learning is OFF
93
- if (!autoLearningEnabled) {
94
- menuOptions.push({ value: "learn", label: "📝 Learn", hint: "Teach new pattern" });
95
- }
96
-
97
- menuOptions.push(
98
- { value: "lessons", label: "📚 Lessons", hint: "View & manage" },
99
-
100
- // ═════════════════════════════════════════════
101
- // 📊 ANALYTICS
102
- // ═════════════════════════════════════════════
103
- { value: "stats", label: "💡 Insights", hint: "Stats & signals" },
104
-
105
- // ═════════════════════════════════════════════
106
- // ⚙️ SETTINGS & MANAGEMENT
107
- // ═════════════════════════════════════════════
108
- { value: "settings", label: "⚙️ Settings", hint: "Configure behavior" },
109
- { value: "backup", label: "💾 Backup", hint: "Data management" },
110
-
111
- // ═════════════════════════════════════════════
112
- // 📊 DASHBOARD
113
- // ═════════════════════════════════════════════
114
- { value: "dashboard", label: "📊 Dashboard", hint: "Web UI & Help" },
115
-
116
- { value: "exit", label: "👋 Exit" }
117
- );
118
-
119
- const action = await p.select({
120
- message: "What would you like to do?",
121
- options: menuOptions
122
- });
123
-
124
- if (p.isCancel(action) || action === "exit") {
125
- p.outro("Goodbye! 👋");
126
- process.exit(0);
127
- }
128
-
129
- // Execute action directly (no submenus)
130
- switch (action) {
131
- case "learn":
132
- await runLearnUI();
133
- break;
134
- case "lessons":
135
- await runLessonsUI();
136
- break;
137
- case "scanall":
138
- await runRecallUI(true); // Auto-scan mode with fix option
139
- break;
140
- case "stats":
141
- await runStatsUI(); // Now includes signals
142
- break;
143
- case "settings":
144
- await runSettingsUI();
145
- break;
146
- case "backup":
147
- await runBackupUI();
148
- break;
149
- case "dashboard":
150
- await runDashboardUI();
151
- break;
152
- }
153
-
154
- // After action completes, loop back to main menu
155
- }
156
- }
157
-
158
- // ============================================================================
159
- // ROUTING UI
160
- // ============================================================================
161
-
162
- async function runRoutingUI() {
163
- const request = await p.text({
164
- message: "Enter a request to test agent routing:",
165
- placeholder: "e.g., Fix the login authentication bug",
166
- validate: (value) => {
167
- if (!value || value.trim().length === 0) {
168
- return "Please enter a request";
169
- }
170
- }
171
- });
172
-
173
- if (p.isCancel(request)) {
174
- p.cancel("Cancelled");
175
- return;
176
- }
177
-
178
- // Use routing-ui to analyze and show routing
179
- routingUI.analyzeAndShowRouting(request);
180
-
181
- // Wait for user to see result
182
- await p.text({
183
- message: "Press Enter to continue...",
184
- placeholder: "",
185
- initialValue: ""
186
- });
187
- }
188
-
189
-
190
- // ============================================================================
191
- // CLI ENTRY
192
- // ============================================================================
193
-
194
- // Run if executed directly
195
- if (process.argv[1].includes("index.js") || process.argv[1].includes("ui")) {
196
- showMainMenu().catch(console.error);
197
- }
198
-
199
- export default showMainMenu;
@@ -1,56 +0,0 @@
1
- /**
2
- * Init UI - Project initialization wizard
3
- */
4
- import * as p from "@clack/prompts";
5
- import pc from "picocolors";
6
- import { detectProjectType, initProject, getDefaultIgnorePatterns } from "../init.js";
7
-
8
- /**
9
- * Interactive init wizard
10
- */
11
- export async function runInitUI() {
12
- const projectType = detectProjectType();
13
-
14
- p.intro(`Project Initialization`);
15
- p.note(`Detected project type: ${pc.cyan(projectType)}`, "Detection");
16
-
17
- const confirm = await p.confirm({
18
- message: `Initialize PikaKit for this ${projectType} project?`
19
- });
20
-
21
- if (p.isCancel(confirm) || !confirm) {
22
- p.cancel("Initialization cancelled.");
23
- return;
24
- }
25
-
26
- const s = p.spinner();
27
- s.start("Initializing...");
28
-
29
- try {
30
- const result = initProject();
31
- s.stop("Done!");
32
-
33
- if (result.success) {
34
- const patterns = getDefaultIgnorePatterns(projectType);
35
-
36
- p.note(
37
- `Created files:\n` +
38
- `• ${pc.cyan(".agent/knowledge/lessons-learned.yaml")}\n` +
39
- `• ${pc.cyan(".agentignore")} (${patterns.length} patterns)\n\n` +
40
- `Next steps:\n` +
41
- `1. Run ${pc.green("agent learn")} to teach patterns\n` +
42
- `2. Run ${pc.green("agent recall .")} to scan code\n` +
43
- `3. Add ${pc.yellow("agent-hook")} to pre-commit (optional)`,
44
- pc.green(result.message)
45
- );
46
- } else {
47
- p.note(result.message, pc.yellow("Skipped"));
48
- }
49
-
50
- } catch (e) {
51
- s.stop("Failed!");
52
- p.note(`Error: ${e.message}`, pc.red("Error"));
53
- }
54
- }
55
-
56
- export default runInitUI;
@@ -1,55 +0,0 @@
1
- /**
2
- * Knowledge UI - Unified Lessons + Signals Manager
3
- */
4
- import * as p from "@clack/prompts";
5
- import pc from "picocolors";
6
- import { runLessonsUI } from "./lessons-ui.js";
7
- import { runEvolutionSignalsUI } from "./evolution-signals-ui.js";
8
-
9
- /**
10
- * Show unified Knowledge management interface
11
- */
12
- export async function runKnowledgeUI() {
13
- // Clear terminal và reset cursor
14
- process.stdout.write('\x1Bc');
15
-
16
- p.intro(pc.cyan("📚 Knowledge Manager"));
17
-
18
- while (true) {
19
- const action = await p.select({
20
- message: "What would you like to do?",
21
- options: [
22
- {
23
- value: "lessons",
24
- label: "📖 Learned Patterns",
25
- hint: "View & manage lessons"
26
- },
27
- {
28
- value: "signals",
29
- label: "📡 Pending Review",
30
- hint: "Evolution signals queue"
31
- },
32
- {
33
- value: "back",
34
- label: "← Back",
35
- hint: "Return to main menu"
36
- }
37
- ]
38
- });
39
-
40
- if (p.isCancel(action) || action === "back") {
41
- return;
42
- }
43
-
44
- switch (action) {
45
- case "lessons":
46
- await runLessonsUI();
47
- break;
48
- case "signals":
49
- await runEvolutionSignalsUI();
50
- break;
51
- }
52
- }
53
- }
54
-
55
- export default runKnowledgeUI;