claude-flow 2.7.0-alpha → 2.7.0-alpha.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.
@@ -1273,6 +1273,39 @@ ${commands.map((cmd)=>`- [${cmd}](./${cmd}.md)`).join('\n')}
1273
1273
  await fs.writeFile(`${workingDir}/memory/sessions/README.md`, createSessionsReadme(), 'utf8');
1274
1274
  printSuccess('✓ Initialized memory system');
1275
1275
  try {
1276
+ const dbPath = '.swarm/memory.db';
1277
+ const { existsSync } = await import('fs');
1278
+ const dbExistedBefore = existsSync(dbPath);
1279
+ if (dbExistedBefore) {
1280
+ console.log(' 🔍 Checking existing database for ReasoningBank schema...');
1281
+ try {
1282
+ const { initializeReasoningBank, checkReasoningBankTables, migrateReasoningBank } = await import('../../../reasoningbank/reasoningbank-adapter.js');
1283
+ process.env.CLAUDE_FLOW_DB_PATH = dbPath;
1284
+ const tableCheck = await checkReasoningBankTables();
1285
+ if (tableCheck.exists) {
1286
+ console.log(' ✅ ReasoningBank schema already complete');
1287
+ } else if (force) {
1288
+ console.log(` 🔄 Migrating database: ${tableCheck.missingTables.length} tables missing`);
1289
+ console.log(` Missing: ${tableCheck.missingTables.join(', ')}`);
1290
+ const migrationResult = await migrateReasoningBank();
1291
+ if (migrationResult.success) {
1292
+ printSuccess(` ✓ Migration complete: added ${migrationResult.addedTables?.length || 0} tables`);
1293
+ console.log(' Use --reasoningbank flag to enable AI-powered memory features');
1294
+ } else {
1295
+ console.log(` âš ī¸ Migration failed: ${migrationResult.message}`);
1296
+ console.log(' Basic memory will work, use: memory init --reasoningbank to retry');
1297
+ }
1298
+ } else {
1299
+ console.log(` â„šī¸ Database has ${tableCheck.missingTables.length} missing ReasoningBank tables`);
1300
+ console.log(` Missing: ${tableCheck.missingTables.join(', ')}`);
1301
+ console.log(' Use --force to migrate existing database');
1302
+ console.log(' Or use: memory init --reasoningbank');
1303
+ }
1304
+ } catch (rbErr) {
1305
+ console.log(` âš ī¸ ReasoningBank check failed: ${rbErr.message}`);
1306
+ console.log(' Will attempt normal initialization...');
1307
+ }
1308
+ }
1276
1309
  const { FallbackMemoryStore } = await import('../../../memory/fallback-store.js');
1277
1310
  const memoryStore = new FallbackMemoryStore();
1278
1311
  await memoryStore.initialize();
@@ -1281,6 +1314,18 @@ ${commands.map((cmd)=>`- [${cmd}](./${cmd}.md)`).join('\n')}
1281
1314
  console.log(' 💡 For persistent storage, install locally: npm install claude-flow@alpha');
1282
1315
  } else {
1283
1316
  printSuccess('✓ Initialized memory database (.swarm/memory.db)');
1317
+ if (!dbExistedBefore) {
1318
+ try {
1319
+ const { initializeReasoningBank } = await import('../../../reasoningbank/reasoningbank-adapter.js');
1320
+ process.env.CLAUDE_FLOW_DB_PATH = dbPath;
1321
+ console.log(' 🧠 Initializing ReasoningBank schema...');
1322
+ await initializeReasoningBank();
1323
+ printSuccess(' ✓ ReasoningBank schema initialized (use --reasoningbank flag for AI-powered memory)');
1324
+ } catch (rbErr) {
1325
+ console.log(` âš ī¸ ReasoningBank initialization failed: ${rbErr.message}`);
1326
+ console.log(' Basic memory will work, use: memory init --reasoningbank to retry');
1327
+ }
1328
+ }
1284
1329
  }
1285
1330
  memoryStore.close();
1286
1331
  } catch (err) {