fivocell 4.9.0 → 5.0.0

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 (39) hide show
  1. package/dist/__tests__/context-compression.test.d.ts +2 -0
  2. package/dist/__tests__/context-compression.test.d.ts.map +1 -0
  3. package/dist/__tests__/context-compression.test.js +77 -0
  4. package/dist/__tests__/context-compression.test.js.map +1 -0
  5. package/dist/__tests__/memory-automation.test.d.ts +2 -0
  6. package/dist/__tests__/memory-automation.test.d.ts.map +1 -0
  7. package/dist/__tests__/memory-automation.test.js +136 -0
  8. package/dist/__tests__/memory-automation.test.js.map +1 -0
  9. package/dist/__tests__/memory-health.test.d.ts +2 -0
  10. package/dist/__tests__/memory-health.test.d.ts.map +1 -0
  11. package/dist/__tests__/memory-health.test.js +66 -0
  12. package/dist/__tests__/memory-health.test.js.map +1 -0
  13. package/dist/__tests__/smart-recommendations.test.d.ts +2 -0
  14. package/dist/__tests__/smart-recommendations.test.d.ts.map +1 -0
  15. package/dist/__tests__/smart-recommendations.test.js +74 -0
  16. package/dist/__tests__/smart-recommendations.test.js.map +1 -0
  17. package/dist/walls/06-memory/automation/memory-automation.d.ts +49 -0
  18. package/dist/walls/06-memory/automation/memory-automation.d.ts.map +1 -0
  19. package/dist/walls/06-memory/automation/memory-automation.js +396 -0
  20. package/dist/walls/06-memory/automation/memory-automation.js.map +1 -0
  21. package/dist/walls/06-memory/stores/context-compression.d.ts +33 -0
  22. package/dist/walls/06-memory/stores/context-compression.d.ts.map +1 -0
  23. package/dist/walls/06-memory/stores/context-compression.js +265 -0
  24. package/dist/walls/06-memory/stores/context-compression.js.map +1 -0
  25. package/dist/walls/06-memory/stores/memory-health.d.ts +32 -0
  26. package/dist/walls/06-memory/stores/memory-health.d.ts.map +1 -0
  27. package/dist/walls/06-memory/stores/memory-health.js +221 -0
  28. package/dist/walls/06-memory/stores/memory-health.js.map +1 -0
  29. package/dist/walls/06-memory/stores/smart-recommendations.d.ts +30 -0
  30. package/dist/walls/06-memory/stores/smart-recommendations.d.ts.map +1 -0
  31. package/dist/walls/06-memory/stores/smart-recommendations.js +222 -0
  32. package/dist/walls/06-memory/stores/smart-recommendations.js.map +1 -0
  33. package/dist/walls/06-memory/stores/weekly-report.js +1 -1
  34. package/dist/walls/07-runtime/cli/cli.js +92 -0
  35. package/dist/walls/07-runtime/cli/cli.js.map +1 -1
  36. package/dist/walls/07-runtime/daemon/server.d.ts.map +1 -1
  37. package/dist/walls/07-runtime/daemon/server.js +32 -0
  38. package/dist/walls/07-runtime/daemon/server.js.map +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateSmartRecommendations = generateSmartRecommendations;
4
+ exports.getRecommendationSummary = getRecommendationSummary;
5
+ const database_1 = require("../database/database");
6
+ function generateSmartRecommendations(project, context) {
7
+ const db = (0, database_1.getDb)();
8
+ const recs = [];
9
+ const since7d = new Date(Date.now() - 7 * 86400000).toISOString();
10
+ const since30d = new Date(Date.now() - 30 * 86400000).toISOString();
11
+ // 1. Unfixed errors — suggest fix priority
12
+ const unfixedErrors = db.prepare(`
13
+ SELECT id, summary, topic, files_json, importance, created_at FROM memory_events
14
+ WHERE project = ? AND type = 'error'
15
+ AND id NOT IN (
16
+ SELECT DISTINCT e2.id FROM memory_events e2
17
+ WHERE e2.project = ? AND e2.type = 'fix'
18
+ )
19
+ ORDER BY importance DESC, created_at DESC LIMIT 10
20
+ `).all(project, project);
21
+ for (const err of unfixedErrors) {
22
+ recs.push({
23
+ id: `fix-${err.id}`,
24
+ category: 'action',
25
+ priority: err.importance >= 8 ? 'high' : err.importance >= 6 ? 'medium' : 'low',
26
+ title: `Fix: ${err.summary.slice(0, 80)}`,
27
+ description: `Error logged ${formatAge(err.created_at)} ago without a corresponding fix. Importance: ${err.importance}/10.`,
28
+ rationale: `Unresolved errors accumulate and become harder to fix over time.`,
29
+ confidence: 0.85,
30
+ relatedFiles: parseFiles(err.files_json),
31
+ relatedTopics: err.topic ? [err.topic] : [],
32
+ createdAt: new Date().toISOString(),
33
+ });
34
+ }
35
+ // 2. High-frequency files need refactoring
36
+ const hotFiles = db.prepare(`
37
+ SELECT files_json, COUNT(*) as c, MAX(importance) as maxImp FROM memory_events
38
+ WHERE project = ? AND files_json IS NOT NULL AND created_at >= ?
39
+ GROUP BY files_json HAVING c >= 8 ORDER BY c DESC LIMIT 5
40
+ `).all(project, since30d);
41
+ for (const hf of hotFiles) {
42
+ const files = parseFiles(hf.files_json);
43
+ if (files.length > 0) {
44
+ recs.push({
45
+ id: `refactor-${hashStr(files[0])}`,
46
+ category: 'optimize',
47
+ priority: hf.c > 15 ? 'high' : 'medium',
48
+ title: `Consider refactoring: ${files[0]}`,
49
+ description: `File touched ${hf.c} times in 30 days — may be a hotspot needing decomposition.`,
50
+ rationale: `High edit frequency suggests the file has too many responsibilities.`,
51
+ confidence: 0.7,
52
+ relatedFiles: files,
53
+ relatedTopics: ['refactor'],
54
+ createdAt: new Date().toISOString(),
55
+ });
56
+ }
57
+ }
58
+ // 3. Missing tests for error-prone files
59
+ const errorFiles = db.prepare(`
60
+ SELECT files_json, COUNT(*) as c FROM memory_events
61
+ WHERE project = ? AND type = 'error' AND files_json IS NOT NULL AND created_at >= ?
62
+ GROUP BY files_json ORDER BY c DESC LIMIT 5
63
+ `).all(project, since30d);
64
+ const testFiles = db.prepare(`
65
+ SELECT files_json FROM memory_events
66
+ WHERE project = ? AND type = 'verification' AND files_json IS NOT NULL AND created_at >= ?
67
+ `).all(project, since30d);
68
+ const testedPaths = new Set();
69
+ for (const tf of testFiles) {
70
+ for (const f of parseFiles(tf.files_json))
71
+ testedPaths.add(f);
72
+ }
73
+ for (const ef of errorFiles) {
74
+ const files = parseFiles(ef.files_json);
75
+ for (const f of files) {
76
+ if (!testedPaths.has(f) && !f.includes('.test.') && !f.includes('.spec.')) {
77
+ recs.push({
78
+ id: `test-${hashStr(f)}`,
79
+ category: 'prevent',
80
+ priority: ef.c > 3 ? 'high' : 'medium',
81
+ title: `Add tests for: ${f}`,
82
+ description: `File has ${ef.c} errors but no test coverage logged.`,
83
+ rationale: `Files with repeated errors should have tests to prevent regressions.`,
84
+ confidence: 0.75,
85
+ relatedFiles: [f],
86
+ relatedTopics: ['testing'],
87
+ createdAt: new Date().toISOString(),
88
+ });
89
+ break;
90
+ }
91
+ }
92
+ }
93
+ // 4. Decision gaps — too many events without decisions
94
+ const eventCount = db.prepare(`SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?`).get(project, since7d);
95
+ const decisionCount = db.prepare(`SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'decision' AND created_at >= ?`).get(project, since7d);
96
+ if (eventCount.c > 20 && decisionCount.c < 3) {
97
+ recs.push({
98
+ id: 'decision-gap',
99
+ category: 'improve',
100
+ priority: 'medium',
101
+ title: 'Log more decisions',
102
+ description: `${eventCount.c} events but only ${decisionCount.c} decisions in 7 days. Decisions help AI understand your reasoning.`,
103
+ rationale: `Decision memory is critical for context continuity and AI recommendations.`,
104
+ confidence: 0.65,
105
+ relatedFiles: [],
106
+ relatedTopics: ['memory-system'],
107
+ createdAt: new Date().toISOString(),
108
+ });
109
+ }
110
+ // 5. Handoff staleness — suggest update
111
+ const lastHandoff = db.prepare(`
112
+ SELECT created_at FROM memory_events
113
+ WHERE project = ? AND type = 'handoff' ORDER BY created_at DESC LIMIT 1
114
+ `).get(project);
115
+ if (lastHandoff) {
116
+ const daysSince = (Date.now() - new Date(lastHandoff.created_at).getTime()) / 86400000;
117
+ if (daysSince > 5) {
118
+ recs.push({
119
+ id: 'stale-handoff',
120
+ category: 'action',
121
+ priority: 'medium',
122
+ title: 'Update handoff context',
123
+ description: `Last handoff was ${Math.round(daysSince)} days ago. Context may be stale.`,
124
+ rationale: `Fresh handoff context helps AI understand current project state.`,
125
+ confidence: 0.7,
126
+ relatedFiles: [],
127
+ relatedTopics: ['handoff'],
128
+ createdAt: new Date().toISOString(),
129
+ });
130
+ }
131
+ }
132
+ // 6. Error patterns — suggest systematic fix
133
+ const errorPatterns = db.prepare(`
134
+ SELECT topic, COUNT(*) as c FROM memory_events
135
+ WHERE project = ? AND type = 'error' AND topic IS NOT NULL AND created_at >= ?
136
+ GROUP BY topic HAVING c >= 3 ORDER BY c DESC LIMIT 3
137
+ `).all(project, since30d);
138
+ for (const ep of errorPatterns) {
139
+ recs.push({
140
+ id: `pattern-${hashStr(ep.topic)}`,
141
+ category: 'prevent',
142
+ priority: ep.c > 5 ? 'high' : 'medium',
143
+ title: `Systematic fix for "${ep.topic}" errors`,
144
+ description: `${ep.c} errors in the "${ep.topic}" area suggest a systemic issue.`,
145
+ rationale: `Addressing root cause prevents repeated fixes on the same problem.`,
146
+ confidence: 0.75,
147
+ relatedFiles: [],
148
+ relatedTopics: [ep.topic],
149
+ createdAt: new Date().toISOString(),
150
+ });
151
+ }
152
+ // 7. Learning suggestions — based on patterns you use
153
+ const typeCounts = db.prepare(`
154
+ SELECT type, COUNT(*) as c FROM memory_events
155
+ WHERE project = ? AND created_at >= ?
156
+ GROUP BY type ORDER BY c DESC
157
+ `).all(project, since30d);
158
+ const typeMap = {};
159
+ for (const t of typeCounts)
160
+ typeMap[t.type] = t.c;
161
+ if ((typeMap.fix || 0) > (typeMap.verification || 0) * 3) {
162
+ recs.push({
163
+ id: 'learn-testing',
164
+ category: 'learn',
165
+ priority: 'medium',
166
+ title: 'Improve verification coverage',
167
+ description: 'You fix errors 3x more often than you verify. Consider adding more test runs.',
168
+ rationale: 'Balanced fix/verification ratio leads to more stable code.',
169
+ confidence: 0.6,
170
+ relatedFiles: [],
171
+ relatedTopics: ['testing', 'verification'],
172
+ createdAt: new Date().toISOString(),
173
+ });
174
+ }
175
+ return recs.sort((a, b) => {
176
+ const prioOrder = { high: 0, medium: 1, low: 2 };
177
+ return prioOrder[a.priority] - prioOrder[b.priority];
178
+ });
179
+ }
180
+ function getRecommendationSummary(project) {
181
+ const recs = generateSmartRecommendations(project);
182
+ const byCategory = {};
183
+ for (const r of recs)
184
+ byCategory[r.category] = (byCategory[r.category] || 0) + 1;
185
+ return {
186
+ total: recs.length,
187
+ high: recs.filter(r => r.priority === 'high').length,
188
+ medium: recs.filter(r => r.priority === 'medium').length,
189
+ low: recs.filter(r => r.priority === 'low').length,
190
+ byCategory,
191
+ top3: recs.slice(0, 3),
192
+ };
193
+ }
194
+ function parseFiles(filesJson) {
195
+ if (!filesJson)
196
+ return [];
197
+ try {
198
+ const parsed = JSON.parse(filesJson);
199
+ return Array.isArray(parsed) ? parsed : [];
200
+ }
201
+ catch {
202
+ return [];
203
+ }
204
+ }
205
+ function formatAge(dateStr) {
206
+ const ms = Date.now() - new Date(dateStr).getTime();
207
+ const hours = Math.round(ms / 3600000);
208
+ if (hours < 1)
209
+ return 'just now';
210
+ if (hours < 24)
211
+ return `${hours}h`;
212
+ const days = Math.round(hours / 24);
213
+ return `${days}d`;
214
+ }
215
+ function hashStr(s) {
216
+ let hash = 0;
217
+ for (let i = 0; i < s.length; i++) {
218
+ hash = ((hash << 5) - hash + s.charCodeAt(i)) | 0;
219
+ }
220
+ return Math.abs(hash).toString(36);
221
+ }
222
+ //# sourceMappingURL=smart-recommendations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-recommendations.js","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/smart-recommendations.ts"],"names":[],"mappings":";;AAwBA,oEAuMC;AAED,4DAoBC;AArPD,mDAA6C;AAwB7C,SAAgB,4BAA4B,CAC1C,OAAe,EACf,OAA+B;IAE/B,MAAM,EAAE,GAAG,IAAA,gBAAK,GAAE,CAAC;IACnB,MAAM,IAAI,GAA0B,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAClE,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAA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201
201
  lines.push('```\n');
202
202
  lines.push(`---`);
203
- lines.push(`*Generated by FIVO Cell v4.8.0*`);
203
+ lines.push(`*Generated by FIVO Cell v5.0.0*`);
204
204
  return lines.join('\n');
205
205
  }
206
206
  //# sourceMappingURL=weekly-report.js.map
@@ -3944,6 +3944,94 @@ function doMemory() {
3944
3944
  console.log();
3945
3945
  return;
3946
3946
  }
3947
+ if (sub === 'automate' || sub === 'auto') {
3948
+ console.log(C.bold(' ── Memory Automation ──\n'));
3949
+ try {
3950
+ const { syncGitCommitsToMemory, getAutomationStatus, initAutomationConfig } = require('../../06-memory/automation/memory-automation');
3951
+ const { detectProject } = require('../setup/setup');
3952
+ const project = detectProject(cwd).name;
3953
+ const status = getAutomationStatus(cwd);
3954
+ console.log(` Git repo: ${status.isGitRepo ? C.success('yes') : C.warn('no')}`);
3955
+ console.log(` Branch: ${status.branch}`);
3956
+ console.log(` Latest commit: ${status.latestCommit ? status.latestCommit.slice(0, 8) : 'none'}`);
3957
+ console.log(` Config exists: ${status.configExists ? 'yes' : 'no'}`);
3958
+ console.log(` Last sync: ${status.lastSync || 'never'}`);
3959
+ if (status.isGitRepo) {
3960
+ console.log(C.dim('\n Syncing git commits to memory...'));
3961
+ initAutomationConfig(project, cwd);
3962
+ const result = syncGitCommitsToMemory(project, cwd);
3963
+ console.log(C.success(` Synced ${result.synced} new commits`));
3964
+ if (result.latestHash)
3965
+ console.log(C.dim(` Latest hash: ${result.latestHash.slice(0, 8)}`));
3966
+ }
3967
+ }
3968
+ catch (e) {
3969
+ console.log(C.warn(` Automation failed: ${e?.message || String(e)}`));
3970
+ }
3971
+ console.log();
3972
+ return;
3973
+ }
3974
+ if (sub === 'recommend' || sub === 'rec') {
3975
+ console.log(C.bold(' ── Smart Recommendations ──\n'));
3976
+ try {
3977
+ const { generateSmartRecommendations, getRecommendationSummary } = require('../../06-memory/stores/smart-recommendations');
3978
+ const { detectProject } = require('../setup/setup');
3979
+ const project = detectProject(cwd).name;
3980
+ const summary = getRecommendationSummary(project);
3981
+ console.log(` Total: ${summary.total} | High: ${C.warn(String(summary.high))} | Medium: ${C.primary(String(summary.medium))} | Low: ${C.dim(String(summary.low))}`);
3982
+ if (summary.top3.length > 0) {
3983
+ console.log(C.dim('\n Top recommendations:'));
3984
+ for (const r of summary.top3) {
3985
+ const prioColor = r.priority === 'high' ? C.warn : r.priority === 'medium' ? C.primary : C.dim;
3986
+ console.log(` ${prioColor(`[${r.priority}]`)} ${r.title}`);
3987
+ console.log(C.dim(` ${r.description.slice(0, 100)}`));
3988
+ }
3989
+ }
3990
+ if (Object.keys(summary.byCategory).length > 0) {
3991
+ console.log(C.dim('\n By category:'));
3992
+ for (const [cat, count] of Object.entries(summary.byCategory).sort((a, b) => b[1] - a[1])) {
3993
+ console.log(` ${cat}: ${count}`);
3994
+ }
3995
+ }
3996
+ }
3997
+ catch (e) {
3998
+ console.log(C.warn(` Recommendations failed: ${e?.message || String(e)}`));
3999
+ }
4000
+ console.log();
4001
+ return;
4002
+ }
4003
+ if (sub === 'compress' || sub === 'cx') {
4004
+ const mode = args[2] || 'compact';
4005
+ console.log(C.bold(` ── Context Compression (${mode}) ──\n`));
4006
+ try {
4007
+ const { compressContext, formatCompressedContext } = require('../../06-memory/stores/context-compression');
4008
+ const { detectProject } = require('../setup/setup');
4009
+ const project = detectProject(cwd).name;
4010
+ const ctx = compressContext({ project, mode: mode });
4011
+ console.log(formatCompressedContext(ctx));
4012
+ console.log(C.dim(` Token estimate: ~${ctx.tokenEstimate} | Sections: ${ctx.sections.length}`));
4013
+ }
4014
+ catch (e) {
4015
+ console.log(C.warn(` Compress failed: ${e?.message || String(e)}`));
4016
+ }
4017
+ console.log();
4018
+ return;
4019
+ }
4020
+ if (sub === 'score' || sub === 'sc') {
4021
+ console.log(C.bold(' ── Memory Health Score ──\n'));
4022
+ try {
4023
+ const { computeMemoryHealth, formatHealthReport } = require('../../06-memory/stores/memory-health');
4024
+ const { detectProject } = require('../setup/setup');
4025
+ const project = detectProject(cwd).name;
4026
+ const health = computeMemoryHealth(project);
4027
+ console.log(formatHealthReport(health));
4028
+ }
4029
+ catch (e) {
4030
+ console.log(C.warn(` Health score failed: ${e?.message || String(e)}`));
4031
+ }
4032
+ console.log();
4033
+ return;
4034
+ }
3947
4035
  console.log(C.bold(' Cell Memory'));
3948
4036
  console.log(C.dim(' ──────────'));
3949
4037
  console.log(C.dim(' cell memory search <query> Search memory events'));
@@ -3952,6 +4040,7 @@ function doMemory() {
3952
4040
  console.log(C.dim(' cell memory compact Compact & rotate'));
3953
4041
  console.log(C.dim(' cell memory verify Verify memory health'));
3954
4042
  console.log(C.dim(' cell memory health Full memory health check'));
4043
+ console.log(C.dim(' cell memory score Health score (0-100)'));
3955
4044
  console.log(C.dim(' cell memory summary [daily|weekly] Generate summary'));
3956
4045
  console.log(C.dim(' cell memory insights [days] Proactive insights'));
3957
4046
  console.log(C.dim(' cell memory chart [type] [days] Visual charts'));
@@ -3960,6 +4049,9 @@ function doMemory() {
3960
4049
  console.log(C.dim(' cell memory enrich [daily|weekly] AI enriched summary'));
3961
4050
  console.log(C.dim(' cell memory handoff-auto Auto-generate handoff'));
3962
4051
  console.log(C.dim(' cell memory digest Compact dashboard digest'));
4052
+ console.log(C.dim(' cell memory automate Sync git commits'));
4053
+ console.log(C.dim(' cell memory recommend Smart recommendations'));
4054
+ console.log(C.dim(' cell memory compress [mode] Compress context'));
3963
4055
  console.log(C.dim(' cell memory export Export to JSON'));
3964
4056
  console.log(C.dim(' cell memory stats Show memory stats'));
3965
4057
  console.log();