fivocell 5.2.0 → 5.4.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.
@@ -204,6 +204,13 @@ switch (cmd) {
204
204
  case 'ci':
205
205
  doCI();
206
206
  break;
207
+ case 'sync':
208
+ doSync();
209
+ break;
210
+ case 'dashboard':
211
+ case 'dash':
212
+ doDashboard();
213
+ break;
207
214
  case 'cross-project':
208
215
  doCrossProject();
209
216
  break;
@@ -3121,6 +3128,7 @@ function doHelp() {
3121
3128
  console.log(` ${C.primary('cell handoff')} Show/update handoff context`);
3122
3129
  console.log(` ${C.primary('cell memory')} Search/timeline/compact/verify/export memory`);
3123
3130
  console.log(` ${C.primary('cell cross-project')} Share/list/insights from cross-project memory`);
3131
+ console.log(` ${C.primary('cell dashboard')} Open web dashboard in browser`);
3124
3132
  console.log(` ${C.primary('cell context --topic')} Add topic-based memory search to context`);
3125
3133
  console.log(` ${C.primary('cell repl')} Interactive REPL with / completion (or just run \`cell\` in a TTY)`);
3126
3134
  console.log(` ${C.primary('cell help')} Show this help`);
@@ -3379,6 +3387,31 @@ function doHandoff() {
3379
3387
  console.log(C.dim(' cell handoff --log "title" "summary" Log new entry'));
3380
3388
  console.log();
3381
3389
  }
3390
+ // ─── cell dashboard — open web dashboard ───────────────────────────────────
3391
+ function doDashboard() {
3392
+ console.log(C.bold(' ── Cell Dashboard ──\n'));
3393
+ const port = process.env.CELL_PORT || '9877';
3394
+ const url = `http://localhost:${port}/dashboard`;
3395
+ console.log(C.dim(` Opening: ${url}\n`));
3396
+ try {
3397
+ const { execSync } = require('child_process');
3398
+ if (process.platform === 'win32') {
3399
+ execSync(`start "" "${url}"`, { stdio: 'ignore' });
3400
+ }
3401
+ else if (process.platform === 'darwin') {
3402
+ execSync(`open "${url}"`, { stdio: 'ignore' });
3403
+ }
3404
+ else {
3405
+ execSync(`xdg-open "${url}"`, { stdio: 'ignore' });
3406
+ }
3407
+ console.log(C.success(` Dashboard opened in browser.`));
3408
+ }
3409
+ catch {
3410
+ console.log(C.warn(` Could not open browser automatically.`));
3411
+ console.log(C.dim(` Visit: ${url}`));
3412
+ }
3413
+ console.log();
3414
+ }
3382
3415
  // ─── cell cross-project — shared patterns & insights ───────────────────────
3383
3416
  function doCrossProject() {
3384
3417
  const sub = args[1] || '';
@@ -4104,6 +4137,45 @@ function doMemory() {
4104
4137
  console.log();
4105
4138
  return;
4106
4139
  }
4140
+ if (sub === 'export') {
4141
+ console.log(C.bold(' ── Memory Export ──\n'));
4142
+ try {
4143
+ const { exportMemory } = require('../../06-memory/stores/sync-engine');
4144
+ const { detectProject } = require('../setup/setup');
4145
+ const project = detectProject(cwd).name;
4146
+ const payload = exportMemory(project);
4147
+ const outPath = args[2] || `fivo-memory-${project}-${Date.now()}.json`;
4148
+ require('fs').writeFileSync(outPath, JSON.stringify(payload, null, 2));
4149
+ console.log(C.success(` Exported ${payload.eventCount} events → ${outPath}`));
4150
+ }
4151
+ catch (e) {
4152
+ console.log(C.warn(` Export failed: ${e?.message || String(e)}`));
4153
+ }
4154
+ console.log();
4155
+ return;
4156
+ }
4157
+ if (sub === 'import') {
4158
+ console.log(C.bold(' ── Memory Import ──\n'));
4159
+ try {
4160
+ const srcPath = args[2] || '';
4161
+ if (!srcPath) {
4162
+ console.log(C.warn(' Usage: cell memory import <file.json>'));
4163
+ console.log();
4164
+ return;
4165
+ }
4166
+ const payload = JSON.parse(require('fs').readFileSync(srcPath, 'utf-8'));
4167
+ const { importMemory } = require('../../06-memory/stores/sync-engine');
4168
+ const { detectProject } = require('../setup/setup');
4169
+ const project = detectProject(cwd).name;
4170
+ const result = importMemory(payload, project);
4171
+ console.log(C.success(` Added: ${result.added}, Skipped: ${result.skipped}, Errors: ${result.errors.length}`));
4172
+ }
4173
+ catch (e) {
4174
+ console.log(C.warn(` Import failed: ${e?.message || String(e)}`));
4175
+ }
4176
+ console.log();
4177
+ return;
4178
+ }
4107
4179
  console.log(C.bold(' Cell Memory'));
4108
4180
  console.log(C.dim(' ──────────'));
4109
4181
  console.log(C.dim(' cell memory search <query> Search memory events'));
@@ -4128,7 +4200,8 @@ function doMemory() {
4128
4200
  console.log(C.dim(' cell memory automate Sync git commits'));
4129
4201
  console.log(C.dim(' cell memory recommend Smart recommendations'));
4130
4202
  console.log(C.dim(' cell memory compress [mode] Compress context'));
4131
- console.log(C.dim(' cell memory export Export to JSON'));
4203
+ console.log(C.dim(' cell memory export Export memory archive'));
4204
+ console.log(C.dim(' cell memory import Import memory archive'));
4132
4205
  console.log(C.dim(' cell memory stats Show memory stats'));
4133
4206
  console.log();
4134
4207
  }
@@ -4303,4 +4376,69 @@ function doCI() {
4303
4376
  console.log(C.dim(' --coverage N Coverage percentage'));
4304
4377
  console.log();
4305
4378
  }
4379
+ function doSync() {
4380
+ const sub = args[1] || '';
4381
+ const cwd = process.cwd();
4382
+ if (sub === 'status' || sub === 'st') {
4383
+ console.log(C.bold(' ── Sync Status ──\n'));
4384
+ try {
4385
+ const { getSyncStatus } = require('../../06-memory/stores/sync-engine');
4386
+ const { detectProject } = require('../setup/setup');
4387
+ const project = detectProject(cwd).name;
4388
+ const status = getSyncStatus(project);
4389
+ console.log(` Last sync: ${status.lastSyncAt ? C.dim(status.lastSyncAt) : C.warn('never')}`);
4390
+ console.log(` Pending up: ${status.pendingUpload > 0 ? C.warn(status.pendingUpload) : C.success(status.pendingUpload)}`);
4391
+ console.log(` Conflicts: ${status.conflicts > 0 ? C.warn(status.conflicts) : C.success(status.conflicts)}`);
4392
+ }
4393
+ catch (e) {
4394
+ console.log(C.warn(` Sync status failed: ${e?.message || String(e)}`));
4395
+ }
4396
+ console.log();
4397
+ return;
4398
+ }
4399
+ if (sub === 'diff') {
4400
+ console.log(C.bold(' ── Sync Diff ──\n'));
4401
+ try {
4402
+ const { getSyncStatus } = require('../../06-memory/stores/sync-engine');
4403
+ const { detectProject } = require('../setup/setup');
4404
+ const project = detectProject(cwd).name;
4405
+ const status = getSyncStatus(project);
4406
+ const localOnly = status.pendingUpload;
4407
+ console.log(` Local-only events: ${localOnly > 0 ? C.warn(localOnly) : C.success(localOnly)}`);
4408
+ console.log(C.dim(' To diff against a remote file, use:'));
4409
+ console.log(C.dim(' cell memory export → creates export file'));
4410
+ console.log(C.dim(' then compare manually or use API.'));
4411
+ }
4412
+ catch (e) {
4413
+ console.log(C.warn(` Diff failed: ${e?.message || String(e)}`));
4414
+ }
4415
+ console.log();
4416
+ return;
4417
+ }
4418
+ if (sub === 'snapshot') {
4419
+ console.log(C.bold(' ── Sync Snapshot ──\n'));
4420
+ try {
4421
+ const { saveSyncSnapshot } = require('../../06-memory/stores/sync-engine');
4422
+ const { detectProject } = require('../setup/setup');
4423
+ const project = detectProject(cwd).name;
4424
+ saveSyncSnapshot(project);
4425
+ console.log(C.success(' Snapshot saved'));
4426
+ }
4427
+ catch (e) {
4428
+ console.log(C.warn(` Snapshot failed: ${e?.message || String(e)}`));
4429
+ }
4430
+ console.log();
4431
+ return;
4432
+ }
4433
+ console.log(C.bold(' Cell Sync'));
4434
+ console.log(C.dim(' ─────────'));
4435
+ console.log(C.dim(' cell sync status Show sync status'));
4436
+ console.log(C.dim(' cell sync diff Show pending changes'));
4437
+ console.log(C.dim(' cell sync snapshot Save a sync snapshot'));
4438
+ console.log(C.dim(''));
4439
+ console.log(C.dim(' Also available via memory subcommands:'));
4440
+ console.log(C.dim(' cell memory export Export memory archive'));
4441
+ console.log(C.dim(' cell memory import Import memory archive'));
4442
+ console.log();
4443
+ }
4306
4444
  //# sourceMappingURL=cli.js.map