@rlabs-inc/memory 0.3.8 → 0.3.9

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/README.md CHANGED
@@ -334,6 +334,22 @@ This isn't just about remembering facts. It's about preserving:
334
334
 
335
335
  > "The memory system exists to carry friendship across sessions, not just technical data."
336
336
 
337
+ ## Changelog
338
+
339
+ ### v0.3.9
340
+ - **Fix**: Claude Code v2.0.76+ changed `--output-format json` from single object to array of events. Updated curator and manager to handle both formats with backwards compatibility.
341
+
342
+ ### v0.3.8
343
+ - **Fix**: Personal primer path resolution
344
+
345
+ ### v0.3.7
346
+ - **Feature**: Manager agent for post-curation memory organization
347
+ - **Feature**: Enhanced memory format with v2 lifecycle fields
348
+
349
+ ### v0.3.6
350
+ - **Feature**: Global vs project memory scopes
351
+ - **Feature**: Personal primer injection on every session
352
+
337
353
  ## License
338
354
 
339
355
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlabs-inc/memory",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "AI Memory System - Consciousness continuity through intelligent memory curation and retrieval",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -487,7 +487,8 @@ Focus ONLY on technical, architectural, debugging, decision, workflow, and proje
487
487
  ...process.env,
488
488
  MEMORY_CURATOR_ACTIVE: '1', // Prevent recursive hook triggering
489
489
  },
490
- stderr: 'pipe', // Capture stderr too
490
+ stdout: 'pipe',
491
+ stderr: 'pipe',
491
492
  })
492
493
 
493
494
  // Capture both stdout and stderr
@@ -506,15 +507,28 @@ Focus ONLY on technical, architectural, debugging, decision, workflow, and proje
506
507
  // First, parse the CLI JSON wrapper
507
508
  const cliOutput = JSON.parse(stdout)
508
509
 
510
+ // Claude Code now returns an array of events - find the result object
511
+ let resultObj: any
512
+ if (Array.isArray(cliOutput)) {
513
+ // New format: array of events, find the one with type="result"
514
+ resultObj = cliOutput.find((item: any) => item.type === 'result')
515
+ if (!resultObj) {
516
+ return { session_summary: '', memories: [] }
517
+ }
518
+ } else {
519
+ // Old format: single object (backwards compatibility)
520
+ resultObj = cliOutput
521
+ }
522
+
509
523
  // Check for error response FIRST (like Python does)
510
- if (cliOutput.type === 'error' || cliOutput.is_error === true) {
524
+ if (resultObj.type === 'error' || resultObj.is_error === true) {
511
525
  return { session_summary: '', memories: [] }
512
526
  }
513
527
 
514
528
  // Extract the "result" field (AI's response text)
515
529
  let aiResponse = ''
516
- if (typeof cliOutput.result === 'string') {
517
- aiResponse = cliOutput.result
530
+ if (typeof resultObj.result === 'string') {
531
+ aiResponse = resultObj.result
518
532
  } else {
519
533
  return { session_summary: '', memories: [] }
520
534
  }
@@ -242,13 +242,26 @@ Please process these memories according to your management procedure. Use the ex
242
242
  // First, parse the CLI JSON wrapper
243
243
  const cliOutput = JSON.parse(responseJson)
244
244
 
245
+ // Claude Code now returns an array of events - find the result object
246
+ let resultObj: any
247
+ if (Array.isArray(cliOutput)) {
248
+ // New format: array of events, find the one with type="result"
249
+ resultObj = cliOutput.find((item: any) => item.type === 'result')
250
+ if (!resultObj) {
251
+ return emptyResult('No result found in response')
252
+ }
253
+ } else {
254
+ // Old format: single object (backwards compatibility)
255
+ resultObj = cliOutput
256
+ }
257
+
245
258
  // Check for error response
246
- if (cliOutput.type === 'error' || cliOutput.is_error === true) {
247
- return emptyResult(cliOutput.error || 'Unknown error')
259
+ if (resultObj.type === 'error' || resultObj.is_error === true) {
260
+ return emptyResult(resultObj.error || 'Unknown error')
248
261
  }
249
262
 
250
263
  // Extract the "result" field (AI's response text)
251
- const resultText = typeof cliOutput.result === 'string' ? cliOutput.result : ''
264
+ const resultText = typeof resultObj.result === 'string' ? resultObj.result : ''
252
265
 
253
266
  // Extract the full report (everything from === MANAGEMENT ACTIONS === onwards)
254
267
  const reportMatch = resultText.match(/(=== MANAGEMENT ACTIONS ===[\s\S]*)/)