@everme/claude-code 0.4.2 → 0.6.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.
@@ -10,7 +10,7 @@
10
10
  "name": "everme",
11
11
  "source": "./",
12
12
  "description": "Automatic memory recall for Claude Code through the EverMe gateway. Saves and recalls per-session context using your EverMe account credentials.",
13
- "version": "0.4.2",
13
+ "version": "0.6.0",
14
14
  "homepage": "https://everme.evermind.ai",
15
15
  "license": "Apache-2.0"
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everme",
3
- "version": "0.4.2",
3
+ "version": "0.6.0",
4
4
  "description": "EverMe — automatic memory recall for Claude Code. Recalls relevant context from past sessions before each prompt and saves new turns through the EverMe gateway.",
5
5
  "author": {
6
6
  "name": "EverMind AI",
@@ -25,6 +25,7 @@ import {
25
25
  savePersonalMemory,
26
26
  AGENT_MEMORY_ROLES,
27
27
  redactError,
28
+ describeError,
28
29
  EvermeError,
29
30
  } from "@everme/agent-sdk";
30
31
  import { getConfig, isConfigured } from "./lib/config.js";
@@ -48,8 +49,23 @@ const SUPPORTED_PROTOCOL_VERSIONS = new Set(["2024-11-05", "2025-03-26"]);
48
49
  const LATEST_PROTOCOL_VERSION = "2025-03-26";
49
50
  let client;
50
51
 
52
+ // stdout carries the JSON-RPC stream; HTTP diagnostics (per-request
53
+ // requestId lines) go to stderr like every other hook surface.
54
+ const stderrLog = {
55
+ info(line) {
56
+ try {
57
+ process.stderr.write(`${line}\n`);
58
+ } catch {
59
+ // A closed stderr must never break the MCP stream.
60
+ }
61
+ },
62
+ warn(line) {
63
+ this.info(line);
64
+ },
65
+ };
66
+
51
67
  function getClient() {
52
- if (!client) client = createClient(getConfig());
68
+ if (!client) client = createClient(getConfig(), stderrLog);
53
69
  return client;
54
70
  }
55
71
 
@@ -305,14 +321,14 @@ const handlers = {
305
321
  switch (name) {
306
322
  case "mem_search": {
307
323
  const topK = Math.min(Number(args.topK) || 10, 50);
308
- const res = await searchMemory(getClient(), { query: String(args.query || ""), topK });
324
+ const res = await searchMemory(getClient(), { query: String(args.query || ""), topK }, stderrLog);
309
325
  const body = buildMemoryPrompt(res, { wrapInCodeBlock: false });
310
326
  const header = `## EverMe search results for "${String(args.query || "")}"`;
311
327
  const trimmed = body.replace(/^## Relevant memory\n\n?/, "");
312
328
  const text = trimmed
313
329
  ? `${header}\n\n${trimmed}`
314
330
  : `${header}\n\n_(no matching memories)_`;
315
- return ok(redactError(text));
331
+ return ok(appendRequestID(redactError(text), res?.requestId));
316
332
  }
317
333
  case "mem_context": {
318
334
  // Profile-only: `query` is accepted for compat but ignored.
@@ -320,9 +336,10 @@ const handlers = {
320
336
  getClient(),
321
337
  "",
322
338
  { forceRefresh: args.forceRefresh === true },
339
+ stderrLog,
323
340
  );
324
341
  const text = ctx?.context || "_(no profile available — your EverMe account has no extracted memories yet)_";
325
- return ok(redactError(text));
342
+ return ok(appendRequestID(redactError(text), ctx?.requestId));
326
343
  }
327
344
  case "mem_save_turn": {
328
345
  let messages;
@@ -341,7 +358,7 @@ const handlers = {
341
358
  conversationId: args.sessionKey || "default",
342
359
  messages,
343
360
  flush: args.flush !== false,
344
- });
361
+ }, stderrLog);
345
362
  return okJson({
346
363
  saved: !!res,
347
364
  accepted: !!res,
@@ -350,6 +367,7 @@ const handlers = {
350
367
  flushed: !!res?.flushed,
351
368
  profileStatus: res?.personalStatus || null,
352
369
  profileUpdated: !!res?.personalExtracted,
370
+ requestId: res?.requestId || null,
353
371
  });
354
372
  }
355
373
  case "mem_save_fact": {
@@ -378,7 +396,7 @@ const handlers = {
378
396
  conversationId: args.sessionKey || "default",
379
397
  messages,
380
398
  flush: args.flush !== false,
381
- });
399
+ }, stderrLog);
382
400
  if (!res) {
383
401
  return errResp("mem_save_fact wrote nothing — every message had empty content after normalization");
384
402
  }
@@ -392,13 +410,14 @@ const handlers = {
392
410
  // profileUpdated aliases extracted — the only signal that the
393
411
  // fact really materialised into the profile.
394
412
  profileUpdated: !!res?.extracted,
413
+ requestId: res?.requestId || null,
395
414
  });
396
415
  }
397
416
  default:
398
417
  return errResp(`unknown tool: ${name}`);
399
418
  }
400
419
  } catch (err) {
401
- const safe = redactError(err instanceof EvermeError ? err.message : err?.message || String(err));
420
+ const safe = describeError(err);
402
421
  return errResp(safe);
403
422
  }
404
423
  },
@@ -414,6 +433,13 @@ function errResp(msg) {
414
433
  return { isError: true, content: [{ type: "text", text: `error: ${msg}` }] };
415
434
  }
416
435
 
436
+ // appendRequestID mirrors @everme/memory-mcp: tack the trace id onto a
437
+ // markdown payload so a user can quote it to support.
438
+ function appendRequestID(text, requestId) {
439
+ if (!requestId) return text;
440
+ return `${text}\n\n_(requestId: ${requestId})_`;
441
+ }
442
+
417
443
  // normaliseTurnMessage coerces an LLM-provided message into the SDK
418
444
  // agent-memory shape — accepts both legacy {role, text} and canonical
419
445
  // {role, content, toolCalls, toolCallId} forms. Mirrors the equivalent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everme/claude-code",
3
- "version": "0.4.2",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "EverMe native plugin for Claude Code — automatic memory recall via SessionStart/UserPromptSubmit/Stop/SessionEnd hooks, plus /recall slash + bundled MCP server.",
6
6
  "license": "Apache-2.0",
@@ -21,7 +21,7 @@
21
21
  "README.md"
22
22
  ],
23
23
  "dependencies": {
24
- "@everme/agent-sdk": "^0.4.2"
24
+ "@everme/agent-sdk": "^0.6.0"
25
25
  },
26
26
  "keywords": [
27
27
  "evermind",