fivocell 6.0.2 → 6.1.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 (67) hide show
  1. package/dist/__tests__/archive-versioning.test.d.ts +2 -0
  2. package/dist/__tests__/archive-versioning.test.d.ts.map +1 -0
  3. package/dist/__tests__/archive-versioning.test.js +131 -0
  4. package/dist/__tests__/archive-versioning.test.js.map +1 -0
  5. package/dist/__tests__/blob-vault.test.d.ts +2 -0
  6. package/dist/__tests__/blob-vault.test.d.ts.map +1 -0
  7. package/dist/__tests__/blob-vault.test.js +125 -0
  8. package/dist/__tests__/blob-vault.test.js.map +1 -0
  9. package/dist/__tests__/cell-mirror.test.d.ts +2 -0
  10. package/dist/__tests__/cell-mirror.test.d.ts.map +1 -0
  11. package/dist/__tests__/cell-mirror.test.js +122 -0
  12. package/dist/__tests__/cell-mirror.test.js.map +1 -0
  13. package/dist/__tests__/context-pipeline.test.d.ts +2 -0
  14. package/dist/__tests__/context-pipeline.test.d.ts.map +1 -0
  15. package/dist/__tests__/context-pipeline.test.js +119 -0
  16. package/dist/__tests__/context-pipeline.test.js.map +1 -0
  17. package/dist/__tests__/key-provider.test.d.ts +2 -0
  18. package/dist/__tests__/key-provider.test.d.ts.map +1 -0
  19. package/dist/__tests__/key-provider.test.js +74 -0
  20. package/dist/__tests__/key-provider.test.js.map +1 -0
  21. package/dist/walls/06-memory/archive/archive-versioning.d.ts +33 -0
  22. package/dist/walls/06-memory/archive/archive-versioning.d.ts.map +1 -0
  23. package/dist/walls/06-memory/archive/archive-versioning.js +201 -0
  24. package/dist/walls/06-memory/archive/archive-versioning.js.map +1 -0
  25. package/dist/walls/06-memory/archive/blob-vault.d.ts +47 -0
  26. package/dist/walls/06-memory/archive/blob-vault.d.ts.map +1 -0
  27. package/dist/walls/06-memory/archive/blob-vault.js +272 -0
  28. package/dist/walls/06-memory/archive/blob-vault.js.map +1 -0
  29. package/dist/walls/06-memory/archive/memory-archive.d.ts.map +1 -1
  30. package/dist/walls/06-memory/archive/memory-archive.js +19 -5
  31. package/dist/walls/06-memory/archive/memory-archive.js.map +1 -1
  32. package/dist/walls/06-memory/database/database.d.ts.map +1 -1
  33. package/dist/walls/06-memory/database/database.js +63 -22
  34. package/dist/walls/06-memory/database/database.js.map +1 -1
  35. package/dist/walls/06-memory/mirror/cell-mirror.d.ts +30 -0
  36. package/dist/walls/06-memory/mirror/cell-mirror.d.ts.map +1 -0
  37. package/dist/walls/06-memory/mirror/cell-mirror.js +297 -0
  38. package/dist/walls/06-memory/mirror/cell-mirror.js.map +1 -0
  39. package/dist/walls/06-memory/privacy/key-migration.d.ts +14 -0
  40. package/dist/walls/06-memory/privacy/key-migration.d.ts.map +1 -0
  41. package/dist/walls/06-memory/privacy/key-migration.js +124 -0
  42. package/dist/walls/06-memory/privacy/key-migration.js.map +1 -0
  43. package/dist/walls/06-memory/privacy/key-provider-file.d.ts +9 -0
  44. package/dist/walls/06-memory/privacy/key-provider-file.d.ts.map +1 -0
  45. package/dist/walls/06-memory/privacy/key-provider-file.js +129 -0
  46. package/dist/walls/06-memory/privacy/key-provider-file.js.map +1 -0
  47. package/dist/walls/06-memory/privacy/key-provider-os.d.ts +22 -0
  48. package/dist/walls/06-memory/privacy/key-provider-os.d.ts.map +1 -0
  49. package/dist/walls/06-memory/privacy/key-provider-os.js +201 -0
  50. package/dist/walls/06-memory/privacy/key-provider-os.js.map +1 -0
  51. package/dist/walls/06-memory/privacy/key-provider.d.ts +21 -0
  52. package/dist/walls/06-memory/privacy/key-provider.d.ts.map +1 -0
  53. package/dist/walls/06-memory/privacy/key-provider.js +123 -0
  54. package/dist/walls/06-memory/privacy/key-provider.js.map +1 -0
  55. package/dist/walls/06-memory/retrieval/context-pipeline.d.ts +36 -0
  56. package/dist/walls/06-memory/retrieval/context-pipeline.d.ts.map +1 -0
  57. package/dist/walls/06-memory/retrieval/context-pipeline.js +266 -0
  58. package/dist/walls/06-memory/retrieval/context-pipeline.js.map +1 -0
  59. package/dist/walls/06-memory/stores/memory-search.d.ts.map +1 -1
  60. package/dist/walls/06-memory/stores/memory-search.js +18 -4
  61. package/dist/walls/06-memory/stores/memory-search.js.map +1 -1
  62. package/dist/walls/06-memory/stores/sync-engine.d.ts.map +1 -1
  63. package/dist/walls/06-memory/stores/sync-engine.js +15 -0
  64. package/dist/walls/06-memory/stores/sync-engine.js.map +1 -1
  65. package/dist/walls/07-runtime/cli/cli.js +121 -0
  66. package/dist/walls/07-runtime/cli/cli.js.map +1 -1
  67. package/package.json +1 -1
@@ -3134,6 +3134,9 @@ function doHelp() {
3134
3134
  console.log(` ${C.primary('cell why <topic>')} Search decisions by topic`);
3135
3135
  console.log(` ${C.primary('cell handoff')} Show/update handoff context`);
3136
3136
  console.log(` ${C.primary('cell memory')} Search/timeline/compact/verify/export memory`);
3137
+ console.log(` ${C.primary('cell memory doctor')} Full health check — .cell structure + archive + memory`);
3138
+ console.log(` ${C.primary('cell memory mirror')} Sync DB → .cell portable readable files`);
3139
+ console.log(` ${C.primary('cell memory context')} Show context (--short/--full/--topic <name>)`);
3137
3140
  console.log(` ${C.primary('cell cross-project')} Share/list/insights from cross-project memory`);
3138
3141
  console.log(` ${C.primary('cell dashboard')} Open web dashboard in browser`);
3139
3142
  console.log(` ${C.primary('cell perf')} Show performance stats & cache info`);
@@ -3720,6 +3723,124 @@ function doMemory() {
3720
3723
  console.log();
3721
3724
  return;
3722
3725
  }
3726
+ if (sub === 'doctor' || sub === 'd') {
3727
+ console.log(C.bold(' ── Memory Doctor ──\n'));
3728
+ try {
3729
+ const project = path.basename(cwd);
3730
+ const { verifyCellHealth } = require('../../06-memory/mirror/cell-mirror');
3731
+ const { verifyArchiveIntegrity } = require('../../06-memory/archive/archive-versioning');
3732
+ const { getMemoryStats } = require('../../06-memory/stores/memory-event-store');
3733
+ // Cell mirror health
3734
+ const cellHealth = verifyCellHealth(cwd);
3735
+ console.log(C.dim(' .cell Structure:'));
3736
+ const checks = [
3737
+ ['handoff/current.md', cellHealth.handoffCurrent],
3738
+ ['handoff/history/', cellHealth.handoffHistory],
3739
+ ['summaries/daily/', cellHealth.summariesDaily],
3740
+ ['summaries/weekly/', cellHealth.summariesWeekly],
3741
+ ['summaries/monthly/', cellHealth.summariesMonthly],
3742
+ ['patterns/code-patterns.json', cellHealth.patternsCode],
3743
+ ['patterns/error-patterns.json', cellHealth.patternsError],
3744
+ ['patterns/fix-patterns.json', cellHealth.patternsFix],
3745
+ ['patterns/architecture-patterns.json', cellHealth.patternsArch],
3746
+ ['style/developer-style.json', cellHealth.styleDeveloper],
3747
+ ['style/project-style.json', cellHealth.styleProject],
3748
+ ['style/communication.md', cellHealth.styleCommunication],
3749
+ ['context/short.md', cellHealth.contextShort],
3750
+ ['context/full.md', cellHealth.contextFull],
3751
+ ['context/last-session.md', cellHealth.contextLastSession],
3752
+ ['memory/archive/', cellHealth.archiveDir],
3753
+ ['private/', cellHealth.privateDir],
3754
+ ];
3755
+ for (const [name, ok] of checks) {
3756
+ console.log(` ${ok ? C.success('✓') : C.warn('✗')} ${name}`);
3757
+ }
3758
+ console.log(` Total .cell files: ${C.num(String(cellHealth.totalFiles))}`);
3759
+ // Archive integrity
3760
+ console.log(C.dim('\n Archive Integrity:'));
3761
+ const archiveHealth = verifyArchiveIntegrity(cwd);
3762
+ console.log(` Total chunks: ${archiveHealth.totalChunks}`);
3763
+ console.log(` Versioned: ${archiveHealth.versionedChunks}`);
3764
+ console.log(` Unversioned: ${archiveHealth.unversionedChunks}`);
3765
+ console.log(` Total events: ${archiveHealth.totalEvents}`);
3766
+ if (archiveHealth.issues.length > 0) {
3767
+ for (const issue of archiveHealth.issues) {
3768
+ console.log(` ${C.warn('⚠')} ${issue}`);
3769
+ }
3770
+ }
3771
+ else {
3772
+ console.log(` ${C.success('All chunks healthy')}`);
3773
+ }
3774
+ // Memory stats
3775
+ console.log(C.dim('\n Memory Stats:'));
3776
+ const stats = getMemoryStats();
3777
+ console.log(` Events: ${C.num(String(stats.total))}`);
3778
+ console.log(` Avg importance: ${stats.avgImportance}`);
3779
+ console.log(` Oldest: ${stats.oldestEvent || 'none'}`);
3780
+ console.log(` Newest: ${stats.newestEvent || 'none'}`);
3781
+ // Overall verdict
3782
+ const totalIssues = cellHealth.issues.length + archiveHealth.issues.length;
3783
+ console.log();
3784
+ if (totalIssues === 0) {
3785
+ console.log(C.success(' Doctor verdict: HEALTHY ✓'));
3786
+ }
3787
+ else {
3788
+ console.log(C.warn(` Doctor verdict: ${totalIssues} issue(s) found`));
3789
+ for (const issue of cellHealth.issues) {
3790
+ console.log(` ${C.warn('⚠')} ${issue}`);
3791
+ }
3792
+ }
3793
+ }
3794
+ catch (e) {
3795
+ console.log(C.warn(` Doctor failed: ${e?.message || String(e)}`));
3796
+ }
3797
+ console.log();
3798
+ return;
3799
+ }
3800
+ if (sub === 'mirror' || sub === 'm') {
3801
+ console.log(C.bold(' ── Cell Mirror Sync ──\n'));
3802
+ try {
3803
+ const project = path.basename(cwd);
3804
+ const { syncCellMirror } = require('../../06-memory/mirror/cell-mirror');
3805
+ syncCellMirror(cwd, project);
3806
+ console.log(C.success(' .cell mirror synced successfully'));
3807
+ console.log(` Project: ${project}`);
3808
+ console.log(` Location: ${path.join(cwd, '.cell')}`);
3809
+ const { verifyCellHealth } = require('../../06-memory/mirror/cell-mirror');
3810
+ const health = verifyCellHealth(cwd);
3811
+ console.log(` Files: ${health.totalFiles}`);
3812
+ if (health.issues.length > 0) {
3813
+ console.log(C.dim(` Note: ${health.issues.length} missing items`));
3814
+ }
3815
+ }
3816
+ catch (e) {
3817
+ console.log(C.warn(` Mirror sync failed: ${e?.message || String(e)}`));
3818
+ }
3819
+ console.log();
3820
+ return;
3821
+ }
3822
+ if (sub === 'context' || sub === 'ctx') {
3823
+ const ctxMode = args[0] || '--short';
3824
+ console.log(C.bold(` ── Context (${ctxMode}) ──\n`));
3825
+ try {
3826
+ const project = path.basename(cwd);
3827
+ const { buildContext } = require('../../06-memory/retrieval/context-pipeline');
3828
+ const topic = args[1];
3829
+ const result = buildContext({
3830
+ project,
3831
+ projectDir: cwd,
3832
+ mode: ctxMode === '--full' ? 'full' : ctxMode === '--topic' ? 'topic' : 'short',
3833
+ topic,
3834
+ });
3835
+ console.log(result.compactContext);
3836
+ console.log(C.dim(`\n Sources: ${result.stats.totalSources} | Events: ${result.stats.totalEvents} | Score: ${result.stats.relevanceScore.toFixed(1)}`));
3837
+ }
3838
+ catch (e) {
3839
+ console.log(C.warn(` Context failed: ${e?.message || String(e)}`));
3840
+ }
3841
+ console.log();
3842
+ return;
3843
+ }
3723
3844
  if (sub === 'export' || sub === 'e') {
3724
3845
  console.log(C.bold(' ── Memory Export ──\n'));
3725
3846
  try {