@reepoe/plugin 1.3.0 → 1.3.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.
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ReePoe Clear Cache - Reset learned patterns
4
+ */
5
+
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+ const readline = require('readline');
9
+
10
+ async function clearCache() {
11
+ const projectRoot = process.cwd();
12
+ const storePath = path.join(projectRoot, 'data', 'mini_rag_store.json');
13
+ const logPath = path.join(projectRoot, 'logs', 'mini_rag.log');
14
+
15
+ console.log('\n╔═══════════════════════════════════════════════════════════╗');
16
+ console.log('║ ReePoe Cache Clearing ║');
17
+ console.log('╚═══════════════════════════════════════════════════════════╝\n');
18
+
19
+ // Check if files exist
20
+ const storeExists = fs.existsSync(storePath);
21
+ const logExists = fs.existsSync(logPath);
22
+
23
+ if (!storeExists && !logExists) {
24
+ console.log('✅ No cache files found - nothing to clear\n');
25
+ return;
26
+ }
27
+
28
+ console.log('📋 Files to clear:');
29
+ if (storeExists) {
30
+ try {
31
+ const stats = fs.statSync(storePath);
32
+ const storeContent = fs.readFileSync(storePath, 'utf8');
33
+ const patternCount = storeContent ? Object.keys(JSON.parse(storeContent)).length : 0;
34
+ console.log(` • ${storePath} (${patternCount} patterns, ${(stats.size / 1024).toFixed(1)} KB)`);
35
+ } catch (e) {
36
+ console.log(` • ${storePath} (error reading file)`);
37
+ }
38
+ }
39
+ if (logExists) {
40
+ try {
41
+ const stats = fs.statSync(logPath);
42
+ console.log(` • ${logPath} (${(stats.size / 1024).toFixed(1)} KB)`);
43
+ } catch (e) {
44
+ console.log(` • ${logPath} (error reading file)`);
45
+ }
46
+ }
47
+ console.log('');
48
+
49
+ // Confirm
50
+ const rl = readline.createInterface({
51
+ input: process.stdin,
52
+ output: process.stdout
53
+ });
54
+
55
+ const answer = await new Promise((resolve) => {
56
+ rl.question('⚠️ This will delete all learned patterns. Continue? (yes/no): ', (ans) => {
57
+ rl.close();
58
+ resolve(ans.trim().toLowerCase());
59
+ });
60
+ });
61
+
62
+ if (answer !== 'yes' && answer !== 'y') {
63
+ console.log('\n❌ Cancelled - cache not cleared\n');
64
+ return;
65
+ }
66
+
67
+ // Clear files
68
+ try {
69
+ if (storeExists) {
70
+ // Ensure directory exists
71
+ const storeDir = path.dirname(storePath);
72
+ if (!fs.existsSync(storeDir)) {
73
+ fs.mkdirSync(storeDir, { recursive: true });
74
+ }
75
+ fs.writeFileSync(storePath, '{}', 'utf8');
76
+ console.log(`✅ Cleared: ${storePath}`);
77
+ }
78
+ if (logExists) {
79
+ // Ensure directory exists
80
+ const logDir = path.dirname(logPath);
81
+ if (!fs.existsSync(logDir)) {
82
+ fs.mkdirSync(logDir, { recursive: true });
83
+ }
84
+ fs.writeFileSync(logPath, '', 'utf8');
85
+ console.log(`✅ Cleared: ${logPath}`);
86
+ }
87
+ console.log('\n✅ Cache cleared successfully!\n');
88
+ } catch (error) {
89
+ console.error(`\n❌ Error clearing cache: ${error.message}\n`);
90
+ process.exit(1);
91
+ }
92
+ }
93
+
94
+ clearCache().catch(error => {
95
+ console.error(`❌ Error: ${error.message}`);
96
+ process.exit(1);
97
+ });
98
+
package/bin/start.js CHANGED
@@ -302,7 +302,7 @@ async function setupProjectIfNeeded(port) {
302
302
  api: { port, host: '127.0.0.1' },
303
303
  mini_rag: {
304
304
  enabled: true,
305
- confidence_threshold: 0.6,
305
+ confidence_threshold: 0.85,
306
306
  cta_whitelist: ['run_tests', 'open_file', 'search_symbols', 'get_repo_stats']
307
307
  },
308
308
  scanner: { language: projectInfo.language, auto_scan: true }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reepoe/plugin",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "ReePoe AI Code Manager - Install in any codebase for instant AI agent integration",
5
5
  "keywords": [
6
6
  "ai",
@@ -27,7 +27,8 @@
27
27
  "reepoe-status": "./bin/status.js",
28
28
  "reepoe-metrics": "./bin/metrics.js",
29
29
  "reepoe-admin": "./bin/admin.js",
30
- "reepoe-extend-request": "./bin/extend-request.js"
30
+ "reepoe-extend-request": "./bin/extend-request.js",
31
+ "reepoe-clear-cache": "./bin/clear-cache.js"
31
32
  },
32
33
  "scripts": {
33
34
  "postinstall": "node scripts/setup.js"