claude-memory-layer 1.0.38 → 1.0.40

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.
@@ -9295,7 +9295,7 @@ function computeKpiMetrics(events, usefulRecallRate) {
9295
9295
  };
9296
9296
  }
9297
9297
  statsRouter.get("/shared", async (c) => {
9298
- const memoryService = getServiceFromQuery(c);
9298
+ const memoryService = getLightweightServiceFromQuery(c);
9299
9299
  try {
9300
9300
  await memoryService.initialize();
9301
9301
  const sharedStats = await memoryService.getSharedStoreStats();
@@ -9319,8 +9319,7 @@ statsRouter.get("/shared", async (c) => {
9319
9319
  }
9320
9320
  });
9321
9321
  statsRouter.get("/endless", async (c) => {
9322
- const projectPath = c.req.query("project") || process.cwd();
9323
- const memoryService = getMemoryServiceForProject(projectPath);
9322
+ const memoryService = getLightweightServiceFromQuery(c);
9324
9323
  try {
9325
9324
  await memoryService.initialize();
9326
9325
  const status = await memoryService.getEndlessModeStatus();
@@ -9352,7 +9351,7 @@ statsRouter.get("/levels/:level", async (c) => {
9352
9351
  if (!validLevels.includes(level)) {
9353
9352
  return c.json({ error: `Invalid level. Must be one of: ${validLevels.join(", ")}` }, 400);
9354
9353
  }
9355
- const memoryService = getServiceFromQuery(c);
9354
+ const memoryService = getLightweightServiceFromQuery(c);
9356
9355
  try {
9357
9356
  await memoryService.initialize();
9358
9357
  let events = await memoryService.getEventsByLevel(level, { limit: limit * 2, offset });
@@ -9444,7 +9443,7 @@ statsRouter.get("/", async (c) => {
9444
9443
  });
9445
9444
  statsRouter.get("/most-accessed", async (c) => {
9446
9445
  const limit = parseInt(c.req.query("limit") || "10", 10);
9447
- const memoryService = getServiceFromQuery(c);
9446
+ const memoryService = getLightweightServiceFromQuery(c);
9448
9447
  try {
9449
9448
  await memoryService.initialize();
9450
9449
  console.log("[most-accessed] Fetching most accessed memories, limit:", limit);
@@ -9475,7 +9474,7 @@ statsRouter.get("/most-accessed", async (c) => {
9475
9474
  });
9476
9475
  statsRouter.get("/timeline", async (c) => {
9477
9476
  const days = parseInt(c.req.query("days") || "7", 10);
9478
- const memoryService = getServiceFromQuery(c);
9477
+ const memoryService = getLightweightServiceFromQuery(c);
9479
9478
  try {
9480
9479
  await memoryService.initialize();
9481
9480
  const recentEvents = await memoryService.getRecentEvents(1e4);
@@ -9507,7 +9506,7 @@ statsRouter.get("/timeline", async (c) => {
9507
9506
  });
9508
9507
  statsRouter.get("/helpfulness", async (c) => {
9509
9508
  const limit = parseInt(c.req.query("limit") || "10", 10);
9510
- const memoryService = getServiceFromQuery(c);
9509
+ const memoryService = getLightweightServiceFromQuery(c);
9511
9510
  try {
9512
9511
  await memoryService.initialize();
9513
9512
  const stats = await memoryService.getHelpfulnessStats();
@@ -9564,7 +9563,7 @@ statsRouter.get("/usefulness", async (c) => {
9564
9563
  });
9565
9564
  statsRouter.get("/retrieval-traces", async (c) => {
9566
9565
  const limit = parseInt(c.req.query("limit") || "50", 10);
9567
- const memoryService = getServiceFromQuery(c);
9566
+ const memoryService = getLightweightServiceFromQuery(c);
9568
9567
  try {
9569
9568
  await memoryService.initialize();
9570
9569
  const traces = await memoryService.getRecentRetrievalTraces(limit);
@@ -9618,7 +9617,7 @@ statsRouter.get("/retrieval-traces", async (c) => {
9618
9617
  statsRouter.get("/retrieval-review-queue", async (c) => {
9619
9618
  const limit = parseStatsLimit(c.req.query("limit"), 10, 50);
9620
9619
  const scanLimit = parseStatsLimit(c.req.query("scanLimit"), 500, 5e3);
9621
- const memoryService = getServiceFromQuery(c);
9620
+ const memoryService = getLightweightServiceFromQuery(c);
9622
9621
  try {
9623
9622
  await memoryService.initialize();
9624
9623
  const traces = await memoryService.getRecentRetrievalTraces(scanLimit);
@@ -9652,7 +9651,7 @@ statsRouter.get("/retrieval-review-queue", async (c) => {
9652
9651
  statsRouter.get("/kpi", async (c) => {
9653
9652
  const rawWindow = c.req.query("window") || "7d";
9654
9653
  const window = rawWindow === "24h" || rawWindow === "30d" ? rawWindow : "7d";
9655
- const memoryService = getServiceFromQuery(c);
9654
+ const memoryService = getLightweightServiceFromQuery(c);
9656
9655
  try {
9657
9656
  await memoryService.initialize();
9658
9657
  const now = Date.now();
@@ -10355,7 +10354,7 @@ function streamClaudeResponse(prompt, stream) {
10355
10354
  import { Hono as Hono9 } from "hono";
10356
10355
  var healthRouter = new Hono9();
10357
10356
  healthRouter.get("/", async (c) => {
10358
- const memoryService = getServiceFromQuery(c);
10357
+ const memoryService = getLightweightServiceFromQuery(c);
10359
10358
  try {
10360
10359
  await memoryService.initialize();
10361
10360
  const [stats, outbox] = await Promise.all([