@shadowforge0/aquifer-memory 1.8.0 → 1.8.1

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 (2) hide show
  1. package/consumers/cli.js +25 -2
  2. package/package.json +1 -1
package/consumers/cli.js CHANGED
@@ -204,7 +204,29 @@ function parseArgs(argv) {
204
204
  // Commands
205
205
  // ---------------------------------------------------------------------------
206
206
 
207
- async function cmdMigrate(aquifer) {
207
+ async function cmdMigrate(aquifer, args = { flags: {} }) {
208
+ if (args.flags && args.flags.json) {
209
+ const notices = [];
210
+ const originalStderrWrite = process.stderr.write;
211
+ process.stderr.write = function writeCapturedStderr(chunk, encoding, callback) {
212
+ notices.push(Buffer.isBuffer(chunk) ? chunk.toString('utf8') : String(chunk));
213
+ if (typeof encoding === 'function') encoding();
214
+ if (typeof callback === 'function') callback();
215
+ return true;
216
+ };
217
+ try {
218
+ await aquifer.migrate();
219
+ } finally {
220
+ process.stderr.write = originalStderrWrite;
221
+ }
222
+ console.log(JSON.stringify({
223
+ ok: true,
224
+ migrated: true,
225
+ notices: notices.join('').split(/\r?\n/).map(line => line.trim()).filter(Boolean),
226
+ }, null, 2));
227
+ return;
228
+ }
229
+
208
230
  await aquifer.migrate();
209
231
  console.log('Migrations applied successfully.');
210
232
  }
@@ -962,7 +984,7 @@ Operator examples:
962
984
  await cmdQuickstart(aquifer);
963
985
  break;
964
986
  case 'migrate':
965
- await cmdMigrate(aquifer);
987
+ await cmdMigrate(aquifer, args);
966
988
  break;
967
989
  case 'recall':
968
990
  await cmdRecall(aquifer, args);
@@ -1016,6 +1038,7 @@ module.exports = {
1016
1038
  parseArgs,
1017
1039
  selectedBackendInfo,
1018
1040
  cmdBackendInfo,
1041
+ cmdMigrate,
1019
1042
  cmdLocalQuickstart,
1020
1043
  cmdOperator,
1021
1044
  readSynthesisSummaryFromFlags,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shadowforge0/aquifer-memory",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "PG-native long-term memory for AI agents. Turn-level embedding, hybrid RRF ranking, optional knowledge graph. MCP server, CLI, and library API.",
5
5
  "main": "index.js",
6
6
  "files": [