@hasna/mementos 0.14.12 → 0.14.13

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/dist/mcp/index.js +0 -68
  2. package/package.json +1 -1
package/dist/mcp/index.js CHANGED
@@ -29023,57 +29023,6 @@ function registerUtilityTools(server) {
29023
29023
  return { content: [{ type: "text", text: formatError11(e) }], isError: true };
29024
29024
  }
29025
29025
  });
29026
- server.tool("session_extract", "Extract memories from a session summary. Auto-creates structured memories from title, topics, notes.", {
29027
- session_id: exports_external2.string(),
29028
- title: exports_external2.string().optional(),
29029
- project: exports_external2.string().optional(),
29030
- model: exports_external2.string().optional(),
29031
- messages: exports_external2.coerce.number().optional(),
29032
- key_topics: exports_external2.array(exports_external2.string()).optional(),
29033
- summary: exports_external2.string().optional(),
29034
- agent_id: exports_external2.string().optional(),
29035
- project_id: exports_external2.string().optional()
29036
- }, async (args) => {
29037
- try {
29038
- let saveExtracted = function(key, value, category, importance) {
29039
- try {
29040
- const mem = createMemory({
29041
- key,
29042
- value,
29043
- category,
29044
- scope: "shared",
29045
- importance,
29046
- source: "auto",
29047
- agent_id,
29048
- project_id,
29049
- session_id
29050
- });
29051
- created.push(mem.id);
29052
- } catch {}
29053
- };
29054
- const { session_id, title, project, model, messages, key_topics, summary, agent_id, project_id } = args;
29055
- const created = [];
29056
- if (title) {
29057
- const meta = [project && `project: ${project}`, model && `model: ${model}`, messages && `messages: ${messages}`].filter(Boolean).join(", ");
29058
- saveExtracted(`session-${session_id}-summary`, `${title}${meta ? ` (${meta})` : ""}`, "history", 6);
29059
- }
29060
- if (key_topics?.length) {
29061
- saveExtracted(`session-${session_id}-topics`, `Key topics: ${key_topics.join(", ")}`, "knowledge", 5);
29062
- }
29063
- if (summary) {
29064
- saveExtracted(`session-${session_id}-notes`, summary, "knowledge", 7);
29065
- }
29066
- return {
29067
- content: [{
29068
- type: "text",
29069
- text: `Extracted ${created.length} memor${created.length === 1 ? "y" : "ies"} from session ${session_id}.${created.length > 0 ? `
29070
- IDs: ${created.join(", ")}` : ""}`
29071
- }]
29072
- };
29073
- } catch (e) {
29074
- return { content: [{ type: "text", text: formatError11(e) }], isError: true };
29075
- }
29076
- });
29077
29026
  server.tool("memory_briefing", "Lightweight delta briefing: what memories changed since an agent's last session. Use at session start instead of memory_context to avoid re-reading everything.", {
29078
29027
  agent_id: exports_external2.string().optional().describe("Agent ID or name. If provided, defaults since to agent's last_seen_at."),
29079
29028
  since: exports_external2.string().optional().describe("ISO 8601 timestamp. Defaults to agent's last_seen_at if agent_id provided, otherwise 24h ago."),
@@ -29525,23 +29474,6 @@ ${lines.join(`
29525
29474
  return { content: [{ type: "text", text: formatError12(e) }], isError: true };
29526
29475
  }
29527
29476
  });
29528
- server.tool("entity_disambiguate", "Find potential duplicate entities by name similarity (trigram). Returns pairs above the threshold within same type+project.", {
29529
- threshold: exports_external2.coerce.number().min(0).max(1).optional().describe("Similarity threshold 0-1 (default 0.8)")
29530
- }, async (args) => {
29531
- try {
29532
- const { findDuplicateEntities: findDuplicateEntities2 } = await Promise.resolve().then(() => (init_entities(), exports_entities));
29533
- const pairs = findDuplicateEntities2(args.threshold ?? 0.8);
29534
- if (pairs.length === 0) {
29535
- return { content: [{ type: "text", text: "No duplicate entities found." }] };
29536
- }
29537
- const lines = pairs.map((p) => `${p.entity_a.name} <-> ${p.entity_b.name} [${p.entity_a.type}] similarity=${p.similarity.toFixed(2)}`);
29538
- return { content: [{ type: "text", text: `Found ${pairs.length} potential duplicate(s):
29539
- ${lines.join(`
29540
- `)}` }] };
29541
- } catch (e) {
29542
- return { content: [{ type: "text", text: formatError12(e) }], isError: true };
29543
- }
29544
- });
29545
29477
  server.tool("memory_compress", "Compress multiple memories into a single summary memory. Uses LLM if available, otherwise truncates.", {
29546
29478
  memory_ids: exports_external2.array(exports_external2.string()).describe("Memory IDs to compress"),
29547
29479
  max_length: exports_external2.coerce.number().optional().describe("Max chars for compression (default 500)")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/mementos",
3
- "version": "0.14.12",
3
+ "version": "0.14.13",
4
4
  "description": "Universal memory system for AI agents - CLI + MCP server + library API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",