fivocell 4.5.0 → 4.7.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.
- package/dist/__tests__/context-ranker.test.d.ts +2 -0
- package/dist/__tests__/context-ranker.test.d.ts.map +1 -0
- package/dist/__tests__/context-ranker.test.js +61 -0
- package/dist/__tests__/context-ranker.test.js.map +1 -0
- package/dist/__tests__/cross-project-memory.test.d.ts +2 -0
- package/dist/__tests__/cross-project-memory.test.d.ts.map +1 -0
- package/dist/__tests__/cross-project-memory.test.js +105 -0
- package/dist/__tests__/cross-project-memory.test.js.map +1 -0
- package/dist/__tests__/memory-charts.test.d.ts +2 -0
- package/dist/__tests__/memory-charts.test.d.ts.map +1 -0
- package/dist/__tests__/memory-charts.test.js +52 -0
- package/dist/__tests__/memory-charts.test.js.map +1 -0
- package/dist/__tests__/memory-compact.test.d.ts +2 -0
- package/dist/__tests__/memory-compact.test.d.ts.map +1 -0
- package/dist/__tests__/memory-compact.test.js +43 -0
- package/dist/__tests__/memory-compact.test.js.map +1 -0
- package/dist/__tests__/memory-insights.test.d.ts +2 -0
- package/dist/__tests__/memory-insights.test.d.ts.map +1 -0
- package/dist/__tests__/memory-insights.test.js +71 -0
- package/dist/__tests__/memory-insights.test.js.map +1 -0
- package/dist/__tests__/summary-generator.test.d.ts +2 -0
- package/dist/__tests__/summary-generator.test.d.ts.map +1 -0
- package/dist/__tests__/summary-generator.test.js +53 -0
- package/dist/__tests__/summary-generator.test.js.map +1 -0
- package/dist/walls/01-context/context/prompt-builder.d.ts +7 -0
- package/dist/walls/01-context/context/prompt-builder.d.ts.map +1 -1
- package/dist/walls/01-context/context/prompt-builder.js +29 -0
- package/dist/walls/01-context/context/prompt-builder.js.map +1 -1
- package/dist/walls/06-memory/archive/memory-compact.d.ts +17 -0
- package/dist/walls/06-memory/archive/memory-compact.d.ts.map +1 -0
- package/dist/walls/06-memory/archive/memory-compact.js +128 -0
- package/dist/walls/06-memory/archive/memory-compact.js.map +1 -0
- package/dist/walls/06-memory/database/database.d.ts.map +1 -1
- package/dist/walls/06-memory/database/database.js +16 -1
- package/dist/walls/06-memory/database/database.js.map +1 -1
- package/dist/walls/06-memory/stores/context-ranker.d.ts +21 -0
- package/dist/walls/06-memory/stores/context-ranker.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/context-ranker.js +84 -0
- package/dist/walls/06-memory/stores/context-ranker.js.map +1 -0
- package/dist/walls/06-memory/stores/cross-project-memory.d.ts +53 -0
- package/dist/walls/06-memory/stores/cross-project-memory.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/cross-project-memory.js +200 -0
- package/dist/walls/06-memory/stores/cross-project-memory.js.map +1 -0
- package/dist/walls/06-memory/stores/memory-charts.d.ts +14 -0
- package/dist/walls/06-memory/stores/memory-charts.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/memory-charts.js +128 -0
- package/dist/walls/06-memory/stores/memory-charts.js.map +1 -0
- package/dist/walls/06-memory/stores/memory-insights.d.ts +26 -0
- package/dist/walls/06-memory/stores/memory-insights.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/memory-insights.js +218 -0
- package/dist/walls/06-memory/stores/memory-insights.js.map +1 -0
- package/dist/walls/06-memory/stores/summary-generator.d.ts +16 -0
- package/dist/walls/06-memory/stores/summary-generator.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/summary-generator.js +151 -0
- package/dist/walls/06-memory/stores/summary-generator.js.map +1 -0
- package/dist/walls/07-runtime/cli/cli.js +268 -0
- package/dist/walls/07-runtime/cli/cli.js.map +1 -1
- package/dist/walls/07-runtime/daemon/server.d.ts.map +1 -1
- package/dist/walls/07-runtime/daemon/server.js +156 -0
- package/dist/walls/07-runtime/daemon/server.js.map +1 -1
- package/dist/walls/07-runtime/watcher/live-watcher.d.ts.map +1 -1
- package/dist/walls/07-runtime/watcher/live-watcher.js +32 -0
- package/dist/walls/07-runtime/watcher/live-watcher.js.map +1 -1
- package/package.json +1 -1
|
@@ -195,6 +195,9 @@ switch (cmd) {
|
|
|
195
195
|
case 'memory':
|
|
196
196
|
doMemory();
|
|
197
197
|
break;
|
|
198
|
+
case 'cross-project':
|
|
199
|
+
doCrossProject();
|
|
200
|
+
break;
|
|
198
201
|
case 'repl':
|
|
199
202
|
case '-i':
|
|
200
203
|
case '--interactive':
|
|
@@ -3108,6 +3111,7 @@ function doHelp() {
|
|
|
3108
3111
|
console.log(` ${C.primary('cell why <topic>')} Search decisions by topic`);
|
|
3109
3112
|
console.log(` ${C.primary('cell handoff')} Show/update handoff context`);
|
|
3110
3113
|
console.log(` ${C.primary('cell memory')} Search/timeline/compact/verify/export memory`);
|
|
3114
|
+
console.log(` ${C.primary('cell cross-project')} Share/list/insights from cross-project memory`);
|
|
3111
3115
|
console.log(` ${C.primary('cell context --topic')} Add topic-based memory search to context`);
|
|
3112
3116
|
console.log(` ${C.primary('cell repl')} Interactive REPL with / completion (or just run \`cell\` in a TTY)`);
|
|
3113
3117
|
console.log(` ${C.primary('cell help')} Show this help`);
|
|
@@ -3366,6 +3370,136 @@ function doHandoff() {
|
|
|
3366
3370
|
console.log(C.dim(' cell handoff --log "title" "summary" Log new entry'));
|
|
3367
3371
|
console.log();
|
|
3368
3372
|
}
|
|
3373
|
+
// ─── cell cross-project — shared patterns & insights ───────────────────────
|
|
3374
|
+
function doCrossProject() {
|
|
3375
|
+
const sub = args[1] || '';
|
|
3376
|
+
const cwd = process.cwd();
|
|
3377
|
+
if (sub === 'share') {
|
|
3378
|
+
const pattern = args[2] || '';
|
|
3379
|
+
const category = args[3] || 'general';
|
|
3380
|
+
if (!pattern) {
|
|
3381
|
+
console.log(C.warn(' Usage: cell cross-project share <pattern> [category]'));
|
|
3382
|
+
console.log();
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
console.log(C.bold(' ── Share Pattern ──\n'));
|
|
3386
|
+
try {
|
|
3387
|
+
const { sharePatternToMemory } = require('../../06-memory/stores/cross-project-memory');
|
|
3388
|
+
const id = sharePatternToMemory(cwd, { category, rule: pattern });
|
|
3389
|
+
console.log(C.success(` Shared pattern: ${id}`));
|
|
3390
|
+
console.log(C.dim(` Category: ${category}`));
|
|
3391
|
+
}
|
|
3392
|
+
catch (e) {
|
|
3393
|
+
console.log(C.warn(` Share failed: ${e?.message || String(e)}`));
|
|
3394
|
+
}
|
|
3395
|
+
console.log();
|
|
3396
|
+
return;
|
|
3397
|
+
}
|
|
3398
|
+
if (sub === 'list') {
|
|
3399
|
+
console.log(C.bold(' ── Shared Patterns ──\n'));
|
|
3400
|
+
try {
|
|
3401
|
+
const { getSharedPatterns } = require('../../06-memory/stores/cross-project-memory');
|
|
3402
|
+
const patterns = getSharedPatterns(cwd);
|
|
3403
|
+
if (patterns.length === 0) {
|
|
3404
|
+
console.log(C.dim(' No shared patterns yet.'));
|
|
3405
|
+
}
|
|
3406
|
+
else {
|
|
3407
|
+
for (const p of patterns) {
|
|
3408
|
+
console.log(` ${C.primary('⭐')} [${p.category}] ${p.pattern}`);
|
|
3409
|
+
console.log(C.dim(` from: ${p.sourceProject} | success: ${Math.round(p.success_rate * 100)}%`));
|
|
3410
|
+
}
|
|
3411
|
+
console.log(C.dim(`\n ${patterns.length} pattern(s) total.`));
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
catch (e) {
|
|
3415
|
+
console.log(C.warn(` List failed: ${e?.message || String(e)}`));
|
|
3416
|
+
}
|
|
3417
|
+
console.log();
|
|
3418
|
+
return;
|
|
3419
|
+
}
|
|
3420
|
+
if (sub === 'compatible') {
|
|
3421
|
+
console.log(C.bold(' ── Compatible Patterns (from other projects) ──\n'));
|
|
3422
|
+
try {
|
|
3423
|
+
const { getCompatiblePatterns } = require('../../06-memory/stores/cross-project-memory');
|
|
3424
|
+
const { detectProject } = require('../setup/setup');
|
|
3425
|
+
const project = detectProject(cwd).name;
|
|
3426
|
+
const patterns = getCompatiblePatterns(project, ['TypeScript', 'Node']);
|
|
3427
|
+
if (patterns.length === 0) {
|
|
3428
|
+
console.log(C.dim(' No compatible patterns found.'));
|
|
3429
|
+
}
|
|
3430
|
+
else {
|
|
3431
|
+
for (const p of patterns) {
|
|
3432
|
+
console.log(` ${C.primary('⭐')} [${p.category}] ${p.pattern}`);
|
|
3433
|
+
console.log(C.dim(` from: ${p.sourceProject} | success: ${Math.round(p.success_rate * 100)}%`));
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
catch (e) {
|
|
3438
|
+
console.log(C.warn(` Compatible check failed: ${e?.message || String(e)}`));
|
|
3439
|
+
}
|
|
3440
|
+
console.log();
|
|
3441
|
+
return;
|
|
3442
|
+
}
|
|
3443
|
+
if (sub === 'insights') {
|
|
3444
|
+
console.log(C.bold(' ── Cross-Project Insights ──\n'));
|
|
3445
|
+
try {
|
|
3446
|
+
const { getCrossProjectInsights } = require('../../06-memory/stores/cross-project-memory');
|
|
3447
|
+
const insights = getCrossProjectInsights(cwd, []);
|
|
3448
|
+
if (insights.compatiblePatterns.length > 0) {
|
|
3449
|
+
console.log(C.dim(' Compatible patterns:'));
|
|
3450
|
+
for (const p of insights.compatiblePatterns.slice(0, 5)) {
|
|
3451
|
+
console.log(` ${C.primary('→')} ${p.pattern} (${Math.round(p.compatibility * 100)}% match)`);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
if (insights.sharedErrors.length > 0) {
|
|
3455
|
+
console.log(C.dim('\n Shared errors across projects:'));
|
|
3456
|
+
for (const e of insights.sharedErrors.slice(0, 5)) {
|
|
3457
|
+
console.log(` ${C.warn('✗')} ${e.error} (${e.projects.join(', ')})`);
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
if (insights.compatiblePatterns.length === 0 && insights.sharedErrors.length === 0) {
|
|
3461
|
+
console.log(C.dim(' No cross-project insights yet.'));
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
catch (e) {
|
|
3465
|
+
console.log(C.warn(` Insights failed: ${e?.message || String(e)}`));
|
|
3466
|
+
}
|
|
3467
|
+
console.log();
|
|
3468
|
+
return;
|
|
3469
|
+
}
|
|
3470
|
+
if (sub === 'stats') {
|
|
3471
|
+
console.log(C.bold(' ── Cross-Project Stats ──\n'));
|
|
3472
|
+
try {
|
|
3473
|
+
const { getCrossProjectStats } = require('../../06-memory/stores/cross-project-memory');
|
|
3474
|
+
const stats = getCrossProjectStats();
|
|
3475
|
+
console.log(` Total patterns: ${stats.totalPatterns}`);
|
|
3476
|
+
console.log(` Projects: ${stats.totalProjects}`);
|
|
3477
|
+
if (stats.topCategories.length > 0) {
|
|
3478
|
+
console.log(C.dim('\n Top categories:'));
|
|
3479
|
+
for (const c of stats.topCategories)
|
|
3480
|
+
console.log(` ${c.category}: ${c.count}`);
|
|
3481
|
+
}
|
|
3482
|
+
if (stats.topProjects.length > 0) {
|
|
3483
|
+
console.log(C.dim('\n Top projects:'));
|
|
3484
|
+
for (const p of stats.topProjects)
|
|
3485
|
+
console.log(` ${p.project}: ${p.count}`);
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
catch (e) {
|
|
3489
|
+
console.log(C.warn(` Stats failed: ${e?.message || String(e)}`));
|
|
3490
|
+
}
|
|
3491
|
+
console.log();
|
|
3492
|
+
return;
|
|
3493
|
+
}
|
|
3494
|
+
console.log(C.bold(' Cell Cross-Project'));
|
|
3495
|
+
console.log(C.dim(' ─────────────────'));
|
|
3496
|
+
console.log(C.dim(' cell cross-project share <pattern> [category] Share a pattern'));
|
|
3497
|
+
console.log(C.dim(' cell cross-project list List shared patterns'));
|
|
3498
|
+
console.log(C.dim(' cell cross-project compatible Find compatible patterns'));
|
|
3499
|
+
console.log(C.dim(' cell cross-project insights Cross-project insights'));
|
|
3500
|
+
console.log(C.dim(' cell cross-project stats Cross-project stats'));
|
|
3501
|
+
console.log();
|
|
3502
|
+
}
|
|
3369
3503
|
// ─── cell memory — search/timeline/compact/verify/export ─────────────────────
|
|
3370
3504
|
function doMemory() {
|
|
3371
3505
|
const sub = args[1] || '';
|
|
@@ -3523,12 +3657,146 @@ function doMemory() {
|
|
|
3523
3657
|
console.log();
|
|
3524
3658
|
return;
|
|
3525
3659
|
}
|
|
3660
|
+
if (sub === 'health') {
|
|
3661
|
+
console.log(C.bold(' ── Memory Health ──\n'));
|
|
3662
|
+
try {
|
|
3663
|
+
const { getMemoryHealth } = require('../../06-memory/archive/memory-compact');
|
|
3664
|
+
const h = getMemoryHealth(cwd);
|
|
3665
|
+
console.log(` Events: ${C.num(String(h.eventCount))}`);
|
|
3666
|
+
console.log(` Archive chunks: ${h.archiveChunks}`);
|
|
3667
|
+
console.log(` Handoff lines: ${h.handoffLines}`);
|
|
3668
|
+
console.log(` Avg importance: ${h.avgImportance}`);
|
|
3669
|
+
console.log(` Oldest: ${h.oldestEvent || 'none'}`);
|
|
3670
|
+
console.log(` Newest: ${h.newestEvent || 'none'}`);
|
|
3671
|
+
}
|
|
3672
|
+
catch (e) {
|
|
3673
|
+
console.log(C.warn(` Health check failed: ${e?.message || String(e)}`));
|
|
3674
|
+
}
|
|
3675
|
+
console.log();
|
|
3676
|
+
return;
|
|
3677
|
+
}
|
|
3678
|
+
if (sub === 'summary' || sub === 'sum') {
|
|
3679
|
+
const period = args[2] || 'daily';
|
|
3680
|
+
console.log(C.bold(` ── Memory Summary (${period}) ──\n`));
|
|
3681
|
+
try {
|
|
3682
|
+
const { generateDailySummary, generateWeeklySummary } = require('../../06-memory/stores/summary-generator');
|
|
3683
|
+
const { detectProject } = require('../setup/setup');
|
|
3684
|
+
const project = detectProject(cwd).name;
|
|
3685
|
+
const summary = period === 'weekly'
|
|
3686
|
+
? generateWeeklySummary(project, cwd)
|
|
3687
|
+
: generateDailySummary(project);
|
|
3688
|
+
console.log(` Date: ${summary.date}`);
|
|
3689
|
+
console.log(` Project: ${summary.project}`);
|
|
3690
|
+
console.log(` Total events: ${summary.totalEvents}`);
|
|
3691
|
+
console.log(` Avg importance: ${summary.importance}`);
|
|
3692
|
+
if (summary.topTopics.length > 0)
|
|
3693
|
+
console.log(` Top topics: ${summary.topTopics.join(', ')}`);
|
|
3694
|
+
if (summary.keyDecisions.length > 0) {
|
|
3695
|
+
console.log(C.dim('\n Key decisions:'));
|
|
3696
|
+
for (const d of summary.keyDecisions.slice(0, 5))
|
|
3697
|
+
console.log(` ${C.primary('→')} ${d}`);
|
|
3698
|
+
}
|
|
3699
|
+
if (summary.errors.length > 0) {
|
|
3700
|
+
console.log(C.dim('\n Errors:'));
|
|
3701
|
+
for (const e of summary.errors.slice(0, 5))
|
|
3702
|
+
console.log(` ${C.warn('✗')} ${e}`);
|
|
3703
|
+
}
|
|
3704
|
+
if (Object.keys(summary.byType).length > 0) {
|
|
3705
|
+
console.log(C.dim('\n By type:'));
|
|
3706
|
+
for (const [type, count] of Object.entries(summary.byType).sort((a, b) => b[1] - a[1])) {
|
|
3707
|
+
console.log(` ${type}: ${count}`);
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
catch (e) {
|
|
3712
|
+
console.log(C.warn(` Summary failed: ${e?.message || String(e)}`));
|
|
3713
|
+
}
|
|
3714
|
+
console.log();
|
|
3715
|
+
return;
|
|
3716
|
+
}
|
|
3717
|
+
if (sub === 'insights' || sub === 'i') {
|
|
3718
|
+
const days = parseInt(args[2] || '30', 10);
|
|
3719
|
+
console.log(C.bold(` ── Memory Insights (${days} days) ──\n`));
|
|
3720
|
+
try {
|
|
3721
|
+
const { generateMemoryInsights, getInsightSummary } = require('../../06-memory/stores/memory-insights');
|
|
3722
|
+
const { detectProject } = require('../setup/setup');
|
|
3723
|
+
const project = detectProject(cwd).name;
|
|
3724
|
+
const summary = getInsightSummary(project, days);
|
|
3725
|
+
const iconMap = { trend: '📈', risk: '⚠️', pattern: '⭐', recommendation: '💡', milestone: '🎯' };
|
|
3726
|
+
const sevColor = { critical: C.warn, warning: C.primary, info: C.dim };
|
|
3727
|
+
if (summary.total === 0) {
|
|
3728
|
+
console.log(C.dim(' No insights available yet. Need more memory events.'));
|
|
3729
|
+
}
|
|
3730
|
+
else {
|
|
3731
|
+
console.log(` Total insights: ${summary.total}`);
|
|
3732
|
+
if (Object.keys(summary.bySeverity).length > 0) {
|
|
3733
|
+
console.log(C.dim(` By severity: ${Object.entries(summary.bySeverity).map(([s, c]) => `${s}:${c}`).join(' | ')}`));
|
|
3734
|
+
}
|
|
3735
|
+
console.log();
|
|
3736
|
+
for (const insight of summary.topInsights) {
|
|
3737
|
+
const icon = iconMap[insight.type] || '📊';
|
|
3738
|
+
const colorFn = sevColor[insight.severity] || C.dim;
|
|
3739
|
+
console.log(` ${icon} ${colorFn(insight.title)}`);
|
|
3740
|
+
console.log(C.dim(` ${insight.description}`));
|
|
3741
|
+
if (insight.evidence.length > 0) {
|
|
3742
|
+
for (const e of insight.evidence.slice(0, 3))
|
|
3743
|
+
console.log(C.dim(` • ${e}`));
|
|
3744
|
+
}
|
|
3745
|
+
console.log();
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
catch (e) {
|
|
3750
|
+
console.log(C.warn(` Insights failed: ${e?.message || String(e)}`));
|
|
3751
|
+
}
|
|
3752
|
+
console.log();
|
|
3753
|
+
return;
|
|
3754
|
+
}
|
|
3755
|
+
if (sub === 'chart' || sub === 'ch') {
|
|
3756
|
+
const chartType = args[2] || 'activity';
|
|
3757
|
+
const days = parseInt(args[3] || '14', 10);
|
|
3758
|
+
console.log();
|
|
3759
|
+
try {
|
|
3760
|
+
const charts = require('../../06-memory/stores/memory-charts');
|
|
3761
|
+
const { detectProject } = require('../setup/setup');
|
|
3762
|
+
const project = detectProject(cwd).name;
|
|
3763
|
+
switch (chartType) {
|
|
3764
|
+
case 'activity':
|
|
3765
|
+
console.log(charts.renderActivityChart(project, days));
|
|
3766
|
+
break;
|
|
3767
|
+
case 'type':
|
|
3768
|
+
console.log(charts.renderTypeDistribution(project));
|
|
3769
|
+
break;
|
|
3770
|
+
case 'importance':
|
|
3771
|
+
console.log(charts.renderImportanceChart(project));
|
|
3772
|
+
break;
|
|
3773
|
+
case 'timeline':
|
|
3774
|
+
console.log(charts.renderTimelineChart(project, days));
|
|
3775
|
+
break;
|
|
3776
|
+
case 'all':
|
|
3777
|
+
console.log(charts.renderFullDashboard(project));
|
|
3778
|
+
break;
|
|
3779
|
+
default:
|
|
3780
|
+
console.log(C.dim(` Unknown chart type: ${chartType}`));
|
|
3781
|
+
console.log(C.dim(' Available: activity, type, importance, timeline, all'));
|
|
3782
|
+
}
|
|
3783
|
+
}
|
|
3784
|
+
catch (e) {
|
|
3785
|
+
console.log(C.warn(` Chart failed: ${e?.message || String(e)}`));
|
|
3786
|
+
}
|
|
3787
|
+
console.log();
|
|
3788
|
+
return;
|
|
3789
|
+
}
|
|
3526
3790
|
console.log(C.bold(' Cell Memory'));
|
|
3527
3791
|
console.log(C.dim(' ──────────'));
|
|
3528
3792
|
console.log(C.dim(' cell memory search <query> Search memory events'));
|
|
3529
3793
|
console.log(C.dim(' cell memory timeline [days] Show activity timeline'));
|
|
3530
3794
|
console.log(C.dim(' cell memory compact Compact & rotate'));
|
|
3531
3795
|
console.log(C.dim(' cell memory verify Verify memory health'));
|
|
3796
|
+
console.log(C.dim(' cell memory health Full memory health check'));
|
|
3797
|
+
console.log(C.dim(' cell memory summary [daily|weekly] Generate summary'));
|
|
3798
|
+
console.log(C.dim(' cell memory insights [days] Proactive insights'));
|
|
3799
|
+
console.log(C.dim(' cell memory chart [type] [days] Visual charts'));
|
|
3532
3800
|
console.log(C.dim(' cell memory export Export to JSON'));
|
|
3533
3801
|
console.log(C.dim(' cell memory stats Show memory stats'));
|
|
3534
3802
|
console.log();
|