@aman_asmuei/amem 0.18.1 → 0.20.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.
Files changed (80) hide show
  1. package/README.md +83 -11
  2. package/dist/cli.js +6 -7
  3. package/dist/cli.js.map +1 -1
  4. package/dist/dashboard.d.ts +1 -1
  5. package/dist/dashboard.js +1 -1
  6. package/dist/dashboard.js.map +1 -1
  7. package/dist/index.js +3 -7
  8. package/dist/index.js.map +1 -1
  9. package/dist/tools/advanced.d.ts +1 -1
  10. package/dist/tools/advanced.js +167 -4
  11. package/dist/tools/advanced.js.map +1 -1
  12. package/dist/tools/graph.d.ts +1 -1
  13. package/dist/tools/graph.js +1 -2
  14. package/dist/tools/graph.js.map +1 -1
  15. package/dist/tools/index.d.ts +2 -2
  16. package/dist/tools/index.js +2 -2
  17. package/dist/tools/index.js.map +1 -1
  18. package/dist/tools/log.d.ts +1 -1
  19. package/dist/tools/log.js +1 -2
  20. package/dist/tools/log.js.map +1 -1
  21. package/dist/tools/memory.d.ts +1 -2
  22. package/dist/tools/memory.js +35 -19
  23. package/dist/tools/memory.js.map +1 -1
  24. package/dist/tools/reminders.d.ts +1 -1
  25. package/dist/tools/reminders.js +4 -5
  26. package/dist/tools/reminders.js.map +1 -1
  27. package/dist/tools/versions.d.ts +1 -1
  28. package/dist/tools/versions.js +3 -4
  29. package/dist/tools/versions.js.map +1 -1
  30. package/dist/tools.test.js +1 -2
  31. package/dist/tools.test.js.map +1 -1
  32. package/package.json +3 -9
  33. package/dist/ann.d.ts +0 -26
  34. package/dist/ann.js +0 -155
  35. package/dist/ann.js.map +0 -1
  36. package/dist/auto-relate.d.ts +0 -14
  37. package/dist/auto-relate.js +0 -47
  38. package/dist/auto-relate.js.map +0 -1
  39. package/dist/config.d.ts +0 -51
  40. package/dist/config.js +0 -130
  41. package/dist/config.js.map +0 -1
  42. package/dist/database.d.ts +0 -146
  43. package/dist/database.js +0 -746
  44. package/dist/database.js.map +0 -1
  45. package/dist/database.test.d.ts +0 -1
  46. package/dist/database.test.js +0 -275
  47. package/dist/database.test.js.map +0 -1
  48. package/dist/doctor.d.ts +0 -23
  49. package/dist/doctor.js +0 -107
  50. package/dist/doctor.js.map +0 -1
  51. package/dist/embeddings.d.ts +0 -38
  52. package/dist/embeddings.js +0 -251
  53. package/dist/embeddings.js.map +0 -1
  54. package/dist/embeddings.test.d.ts +0 -1
  55. package/dist/embeddings.test.js +0 -106
  56. package/dist/embeddings.test.js.map +0 -1
  57. package/dist/extractor.d.ts +0 -13
  58. package/dist/extractor.js +0 -89
  59. package/dist/extractor.js.map +0 -1
  60. package/dist/memory.d.ts +0 -133
  61. package/dist/memory.js +0 -432
  62. package/dist/memory.js.map +0 -1
  63. package/dist/memory.test.d.ts +0 -1
  64. package/dist/memory.test.js +0 -172
  65. package/dist/memory.test.js.map +0 -1
  66. package/dist/query-expand.d.ts +0 -9
  67. package/dist/query-expand.js +0 -71
  68. package/dist/query-expand.js.map +0 -1
  69. package/dist/repair.d.ts +0 -8
  70. package/dist/repair.js +0 -90
  71. package/dist/repair.js.map +0 -1
  72. package/dist/schemas.d.ts +0 -885
  73. package/dist/schemas.js +0 -268
  74. package/dist/schemas.js.map +0 -1
  75. package/dist/sync.d.ts +0 -85
  76. package/dist/sync.js +0 -304
  77. package/dist/sync.js.map +0 -1
  78. package/dist/tools/helpers.d.ts +0 -7
  79. package/dist/tools/helpers.js +0 -23
  80. package/dist/tools/helpers.js.map +0 -1
package/dist/schemas.js DELETED
@@ -1,268 +0,0 @@
1
- import { z } from "zod";
2
- export const StoreResultSchema = z.union([
3
- z.object({
4
- action: z.literal("stored"),
5
- id: z.string(),
6
- type: z.string(),
7
- confidence: z.number(),
8
- tags: z.array(z.string()),
9
- total: z.number(),
10
- reinforced: z.number(),
11
- }),
12
- z.object({
13
- action: z.literal("conflict_resolved"),
14
- existingId: z.string(),
15
- similarity: z.number(),
16
- existingContent: z.string(),
17
- }),
18
- ]);
19
- const RecalledMemorySchema = z.object({
20
- id: z.string(),
21
- content: z.string().optional(),
22
- preview: z.string().optional(),
23
- type: z.string(),
24
- score: z.number(),
25
- confidence: z.number(),
26
- tags: z.array(z.string()).optional(),
27
- age: z.string().optional(),
28
- });
29
- export const RecallResultSchema = z.object({
30
- query: z.string(),
31
- total: z.number(),
32
- compact: z.boolean().optional(),
33
- tokenEstimate: z.number().optional(),
34
- memories: z.array(RecalledMemorySchema),
35
- });
36
- const ContextGroupSchema = z.object({
37
- type: z.string(),
38
- memories: z.array(z.object({
39
- content: z.string(),
40
- confidence: z.number(),
41
- })),
42
- });
43
- export const ContextResultSchema = z.object({
44
- topic: z.string(),
45
- groups: z.array(ContextGroupSchema),
46
- memoriesUsed: z.number(),
47
- });
48
- export const ForgetResultSchema = z.union([
49
- z.object({
50
- action: z.literal("deleted"),
51
- id: z.string(),
52
- content: z.string(),
53
- type: z.string(),
54
- }),
55
- z.object({
56
- action: z.literal("preview"),
57
- query: z.string(),
58
- total: z.number(),
59
- previewed: z.array(z.object({
60
- id: z.string(),
61
- content: z.string(),
62
- })),
63
- }),
64
- z.object({
65
- action: z.literal("bulk_deleted"),
66
- query: z.string(),
67
- deleted: z.number(),
68
- }),
69
- ]);
70
- export const ExtractResultSchema = z.object({
71
- stored: z.number(),
72
- reinforced: z.number(),
73
- total: z.number(),
74
- details: z.array(z.object({
75
- action: z.enum(["stored", "reinforced"]),
76
- content: z.string(),
77
- type: z.string().optional(),
78
- id: z.string().optional(),
79
- matchedContent: z.string().optional(),
80
- similarity: z.number().optional(),
81
- })),
82
- });
83
- export const StatsResultSchema = z.object({
84
- total: z.number(),
85
- byType: z.record(z.string(), z.number()),
86
- confidence: z.object({
87
- high: z.number(),
88
- medium: z.number(),
89
- low: z.number(),
90
- }),
91
- embeddingCoverage: z.object({
92
- withEmbeddings: z.number(),
93
- total: z.number(),
94
- }),
95
- });
96
- export const ExportResultSchema = z.object({
97
- exportedAt: z.string(),
98
- total: z.number(),
99
- markdown: z.string(),
100
- truncated: z.boolean(),
101
- });
102
- export const InjectResultSchema = z.object({
103
- topic: z.string(),
104
- corrections: z.array(z.string()),
105
- decisions: z.array(z.string()),
106
- context: z.string(),
107
- memoriesUsed: z.number(),
108
- });
109
- export const ConsolidateResultSchema = z.object({
110
- merged: z.number(),
111
- pruned: z.number(),
112
- promoted: z.number(),
113
- decayed: z.number(),
114
- healthScore: z.number(),
115
- before: z.object({ total: z.number() }),
116
- after: z.object({ total: z.number() }),
117
- actions: z.array(z.object({
118
- action: z.enum(["merged", "pruned", "promoted", "decayed"]),
119
- memoryIds: z.array(z.string()),
120
- description: z.string(),
121
- })),
122
- });
123
- export const PatchResultSchema = z.union([
124
- z.object({
125
- action: z.literal("patched"),
126
- id: z.string(),
127
- field: z.string(),
128
- previousContent: z.string(),
129
- reason: z.string(),
130
- versionSaved: z.boolean(),
131
- }),
132
- z.object({
133
- action: z.literal("not_found"),
134
- id: z.string(),
135
- }),
136
- ]);
137
- export const LogAppendResultSchema = z.object({
138
- id: z.string(),
139
- sessionId: z.string(),
140
- role: z.string(),
141
- appended: z.boolean(),
142
- });
143
- export const LogRecallResultSchema = z.object({
144
- query: z.string().optional(),
145
- sessionId: z.string().optional(),
146
- total: z.number(),
147
- entries: z.array(z.object({
148
- id: z.string(),
149
- role: z.string(),
150
- content: z.string(),
151
- timestamp: z.number(),
152
- age: z.string(),
153
- project: z.string(),
154
- })),
155
- });
156
- export const RelateResultSchema = z.union([
157
- z.object({
158
- action: z.literal("related"),
159
- relationId: z.string(),
160
- fromId: z.string(),
161
- toId: z.string(),
162
- type: z.string(),
163
- strength: z.number(),
164
- }),
165
- z.object({
166
- action: z.literal("unrelated"),
167
- relationId: z.string(),
168
- }),
169
- z.object({
170
- action: z.literal("graph"),
171
- memoryId: z.string(),
172
- relations: z.array(z.object({
173
- relatedId: z.string(),
174
- direction: z.enum(["outgoing", "incoming"]),
175
- type: z.string(),
176
- strength: z.number(),
177
- content: z.string().optional(),
178
- })),
179
- }),
180
- ]);
181
- export const VersionResultSchema = z.union([
182
- z.object({
183
- action: z.literal("history"),
184
- memoryId: z.string(),
185
- currentContent: z.string(),
186
- versions: z.array(z.object({
187
- versionId: z.string(),
188
- content: z.string(),
189
- confidence: z.number(),
190
- editedAt: z.number(),
191
- age: z.string(),
192
- reason: z.string(),
193
- })),
194
- }),
195
- z.object({
196
- action: z.literal("restored"),
197
- memoryId: z.string(),
198
- restoredContent: z.string(),
199
- versionId: z.string(),
200
- }),
201
- ]);
202
- export const TemporalResultSchema = z.object({
203
- from: z.string().optional(),
204
- to: z.string().optional(),
205
- total: z.number(),
206
- memories: z.array(z.object({
207
- id: z.string(),
208
- content: z.string(),
209
- type: z.string(),
210
- confidence: z.number(),
211
- createdAt: z.number(),
212
- age: z.string(),
213
- tags: z.array(z.string()),
214
- })),
215
- });
216
- // ── Memory Detail ───────────────────────────────────────
217
- export const DetailResultSchema = z.object({
218
- total: z.number(),
219
- tokenEstimate: z.number(),
220
- memories: z.array(z.object({
221
- id: z.string(),
222
- content: z.string(),
223
- type: z.string(),
224
- confidence: z.number(),
225
- tags: z.array(z.string()),
226
- age: z.string(),
227
- scope: z.string(),
228
- })),
229
- });
230
- // ── Reminders ───────────────────────────────────────────
231
- export const ReminderSetResultSchema = z.object({
232
- id: z.string(),
233
- content: z.string(),
234
- dueAt: z.number().nullable(),
235
- scope: z.string(),
236
- });
237
- export const ReminderListResultSchema = z.object({
238
- total: z.number(),
239
- reminders: z.array(z.object({
240
- id: z.string(),
241
- content: z.string(),
242
- dueAt: z.number().nullable(),
243
- completed: z.boolean(),
244
- scope: z.string(),
245
- })),
246
- });
247
- export const ReminderCheckResultSchema = z.object({
248
- total: z.number(),
249
- reminders: z.array(z.object({
250
- id: z.string(),
251
- content: z.string(),
252
- dueAt: z.number().nullable(),
253
- status: z.enum(["overdue", "today", "upcoming"]),
254
- scope: z.string(),
255
- })),
256
- });
257
- export const ReminderCompleteResultSchema = z.object({
258
- id: z.string(),
259
- completed: z.boolean(),
260
- content: z.string().optional(),
261
- });
262
- // ── Log Cleanup ─────────────────────────────────────────
263
- export const LogCleanupResultSchema = z.object({
264
- deleted: z.number(),
265
- remaining: z.number(),
266
- cutoffDate: z.string(),
267
- });
268
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC;IACvC,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;KACvB,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;KAC5B,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IACh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MAAM,CAAC;QAC1B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAChD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;KAClB,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC"}
package/dist/sync.d.ts DELETED
@@ -1,85 +0,0 @@
1
- /**
2
- * Sync engine: imports Claude Code auto-memory files into amem.
3
- *
4
- * Claude Code stores auto-memory as markdown files with YAML frontmatter:
5
- * ~/.claude/projects/<escaped-path>/memory/MEMORY.md (index)
6
- * ~/.claude/projects/<escaped-path>/memory/<name>.md (individual memories)
7
- *
8
- * Frontmatter format:
9
- * ---
10
- * name: <title>
11
- * description: <one-line summary>
12
- * type: user | feedback | project | reference
13
- * ---
14
- * <markdown body>
15
- *
16
- * Type mapping (Claude auto-memory → amem):
17
- * feedback → correction (user corrections, constraints)
18
- * project → decision (project-level decisions, architecture)
19
- * user → preference (user profile, preferences)
20
- * reference → topology (pointers to external resources, codebase locations)
21
- */
22
- import type { AmemDatabase } from "./database.js";
23
- interface ClaudeMemoryFile {
24
- name: string;
25
- description: string;
26
- type: string;
27
- body: string;
28
- filePath: string;
29
- }
30
- /**
31
- * Find all Claude auto-memory directories.
32
- * Returns map of project path → memory directory.
33
- */
34
- export declare function discoverClaudeMemories(): Map<string, string>;
35
- /**
36
- * Read all memory files from a Claude auto-memory directory.
37
- */
38
- export declare function readClaudeMemoryDir(memDir: string): ClaudeMemoryFile[];
39
- export interface SyncResult {
40
- imported: number;
41
- skipped: number;
42
- updated: number;
43
- details: Array<{
44
- action: "imported" | "skipped" | "updated";
45
- name: string;
46
- type: string;
47
- reason?: string;
48
- }>;
49
- projectsScanned: number;
50
- }
51
- /**
52
- * Sync Claude auto-memory into amem.
53
- *
54
- * @param db - amem database
55
- * @param projectFilter - only sync this project path (optional, syncs all if omitted)
56
- * @param dryRun - preview without writing (default: false)
57
- */
58
- export declare function syncFromClaude(db: AmemDatabase, projectFilter?: string, dryRun?: boolean): Promise<SyncResult>;
59
- export interface TeamExportOptions {
60
- userId: string;
61
- includeTypes?: string[];
62
- minConfidence?: number;
63
- }
64
- export interface TeamImportOptions {
65
- dryRun?: boolean;
66
- }
67
- export interface TeamImportResult {
68
- imported: number;
69
- skipped: number;
70
- from: string;
71
- }
72
- /**
73
- * Export shareable memories as a JSON file for team sync.
74
- * Filters out private/personal memories (type=preference with non-global scope).
75
- */
76
- export declare function exportForTeam(db: AmemDatabase, outputDir: string, options: TeamExportOptions): Promise<{
77
- file: string;
78
- count: number;
79
- }>;
80
- /**
81
- * Import a teammate's exported memory file.
82
- * Deduplicates by content hash and lowers confidence by 0.1 for second-hand memories.
83
- */
84
- export declare function importFromTeam(db: AmemDatabase, filePath: string, options?: TeamImportOptions): Promise<TeamImportResult>;
85
- export {};
package/dist/sync.js DELETED
@@ -1,304 +0,0 @@
1
- /**
2
- * Sync engine: imports Claude Code auto-memory files into amem.
3
- *
4
- * Claude Code stores auto-memory as markdown files with YAML frontmatter:
5
- * ~/.claude/projects/<escaped-path>/memory/MEMORY.md (index)
6
- * ~/.claude/projects/<escaped-path>/memory/<name>.md (individual memories)
7
- *
8
- * Frontmatter format:
9
- * ---
10
- * name: <title>
11
- * description: <one-line summary>
12
- * type: user | feedback | project | reference
13
- * ---
14
- * <markdown body>
15
- *
16
- * Type mapping (Claude auto-memory → amem):
17
- * feedback → correction (user corrections, constraints)
18
- * project → decision (project-level decisions, architecture)
19
- * user → preference (user profile, preferences)
20
- * reference → topology (pointers to external resources, codebase locations)
21
- */
22
- import path from "node:path";
23
- import os from "node:os";
24
- import fs from "node:fs";
25
- import { generateEmbedding } from "./embeddings.js";
26
- // ── Type mapping ────────────────────────────────────────
27
- const CLAUDE_TO_AMEM_TYPE = {
28
- feedback: "correction",
29
- project: "decision",
30
- user: "preference",
31
- reference: "topology",
32
- };
33
- const CLAUDE_TO_CONFIDENCE = {
34
- feedback: 1.0, // Corrections are high-confidence
35
- project: 0.85,
36
- user: 0.8,
37
- reference: 0.7,
38
- };
39
- function parseFrontmatter(content, filePath) {
40
- const match = content.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);
41
- if (!match)
42
- return null;
43
- const frontmatter = match[1];
44
- const body = match[2].trim();
45
- // Simple YAML key-value parser (no dependency needed)
46
- const fields = {};
47
- for (const line of frontmatter.split("\n")) {
48
- const kv = line.match(/^(\w+)\s*:\s*(.+)$/);
49
- if (kv)
50
- fields[kv[1]] = kv[2].trim();
51
- }
52
- if (!fields.name || !fields.type)
53
- return null;
54
- return {
55
- name: fields.name,
56
- description: fields.description || "",
57
- type: fields.type,
58
- body,
59
- filePath,
60
- };
61
- }
62
- // ── Discovery ───────────────────────────────────────────
63
- /**
64
- * Find all Claude auto-memory directories.
65
- * Returns map of project path → memory directory.
66
- */
67
- export function discoverClaudeMemories() {
68
- const claudeDir = path.join(os.homedir(), ".claude", "projects");
69
- const results = new Map();
70
- if (!fs.existsSync(claudeDir))
71
- return results;
72
- try {
73
- for (const entry of fs.readdirSync(claudeDir)) {
74
- const memDir = path.join(claudeDir, entry, "memory");
75
- if (fs.existsSync(memDir) && fs.statSync(memDir).isDirectory()) {
76
- // Decode project path from directory name
77
- const projectPath = entry.replace(/^-/, "/").replace(/-/g, "/");
78
- results.set(projectPath, memDir);
79
- }
80
- }
81
- }
82
- catch {
83
- // Permission errors etc.
84
- }
85
- return results;
86
- }
87
- /**
88
- * Read all memory files from a Claude auto-memory directory.
89
- */
90
- export function readClaudeMemoryDir(memDir) {
91
- const files = [];
92
- try {
93
- for (const name of fs.readdirSync(memDir)) {
94
- if (name === "MEMORY.md")
95
- continue; // Skip index file
96
- if (!name.endsWith(".md"))
97
- continue;
98
- const filePath = path.join(memDir, name);
99
- const content = fs.readFileSync(filePath, "utf-8");
100
- const parsed = parseFrontmatter(content, filePath);
101
- if (parsed)
102
- files.push(parsed);
103
- }
104
- }
105
- catch {
106
- // Read errors
107
- }
108
- return files;
109
- }
110
- /**
111
- * Sync Claude auto-memory into amem.
112
- *
113
- * @param db - amem database
114
- * @param projectFilter - only sync this project path (optional, syncs all if omitted)
115
- * @param dryRun - preview without writing (default: false)
116
- */
117
- export async function syncFromClaude(db, projectFilter, dryRun = false) {
118
- const discovered = discoverClaudeMemories();
119
- const result = {
120
- imported: 0,
121
- skipped: 0,
122
- updated: 0,
123
- details: [],
124
- projectsScanned: 0,
125
- };
126
- for (const [projectPath, memDir] of discovered) {
127
- if (projectFilter && !projectPath.includes(projectFilter))
128
- continue;
129
- result.projectsScanned++;
130
- const files = readClaudeMemoryDir(memDir);
131
- const scope = `project:${projectPath}`;
132
- for (const file of files) {
133
- const amemType = CLAUDE_TO_AMEM_TYPE[file.type];
134
- if (!amemType) {
135
- result.skipped++;
136
- result.details.push({
137
- action: "skipped",
138
- name: file.name,
139
- type: file.type,
140
- reason: `Unknown Claude memory type: ${file.type}`,
141
- });
142
- continue;
143
- }
144
- // Build the memory content: combine name + body for richness
145
- const content = file.body.length > 0
146
- ? `${file.name}: ${file.body}`
147
- : file.name;
148
- // Truncate very long memories (Claude project overviews can be huge)
149
- const truncated = content.length > 5000
150
- ? content.slice(0, 5000) + "\n\n[truncated from Claude auto-memory]"
151
- : content;
152
- // Check for existing duplicate by content hash
153
- const existing = db.findByContentHash(truncated);
154
- if (existing) {
155
- result.skipped++;
156
- result.details.push({
157
- action: "skipped",
158
- name: file.name,
159
- type: amemType,
160
- reason: "Already exists in amem (content hash match)",
161
- });
162
- continue;
163
- }
164
- // Check for semantic near-duplicate by name
165
- const nameMatch = db.fullTextSearch(file.name, 1);
166
- if (nameMatch.length > 0 && nameMatch[0].content.includes(file.name.split(":")[0])) {
167
- result.skipped++;
168
- result.details.push({
169
- action: "skipped",
170
- name: file.name,
171
- type: amemType,
172
- reason: `Similar memory already exists: "${nameMatch[0].content.slice(0, 60)}..."`,
173
- });
174
- continue;
175
- }
176
- if (dryRun) {
177
- result.imported++;
178
- result.details.push({
179
- action: "imported",
180
- name: file.name,
181
- type: amemType,
182
- reason: "(dry run)",
183
- });
184
- continue;
185
- }
186
- // Generate embedding and store
187
- const embedding = await generateEmbedding(truncated);
188
- const confidence = CLAUDE_TO_CONFIDENCE[file.type] ?? 0.7;
189
- // Use global scope for user/feedback, project scope for project/reference
190
- const memScope = (file.type === "user" || file.type === "feedback") ? "global" : scope;
191
- const tags = ["claude-sync", file.type];
192
- if (file.description) {
193
- // Extract potential tags from description
194
- const words = file.description.toLowerCase().split(/[\s,\-]+/);
195
- for (const w of words) {
196
- if (w.length > 3 && w.length < 20 && !tags.includes(w)) {
197
- tags.push(w);
198
- if (tags.length >= 8)
199
- break;
200
- }
201
- }
202
- }
203
- db.insertMemory({
204
- content: truncated,
205
- type: amemType,
206
- tags,
207
- confidence,
208
- source: "claude-auto-memory",
209
- embedding,
210
- scope: memScope,
211
- });
212
- result.imported++;
213
- result.details.push({
214
- action: "imported",
215
- name: file.name,
216
- type: amemType,
217
- });
218
- }
219
- }
220
- return result;
221
- }
222
- /**
223
- * Export shareable memories as a JSON file for team sync.
224
- * Filters out private/personal memories (type=preference with non-global scope).
225
- */
226
- export async function exportForTeam(db, outputDir, options) {
227
- const { userId, includeTypes, minConfidence } = options;
228
- const allowedTypes = includeTypes ?? ["correction", "decision", "pattern", "topology", "fact"];
229
- const all = db.getAll();
230
- const filtered = all.filter((m) => {
231
- // Filter out private/personal preferences (non-global scope)
232
- if (m.type === "preference" && m.scope !== "global")
233
- return false;
234
- // Only include allowed types
235
- if (!allowedTypes.includes(m.type))
236
- return false;
237
- // Min confidence filter
238
- if (minConfidence !== undefined && m.confidence < minConfidence)
239
- return false;
240
- return true;
241
- });
242
- const memories = filtered.map((m) => ({
243
- content: m.content,
244
- type: m.type,
245
- tags: m.tags,
246
- confidence: m.confidence,
247
- source: m.source,
248
- scope: m.scope,
249
- createdAt: m.createdAt,
250
- }));
251
- const exportData = {
252
- version: 1,
253
- userId,
254
- exportedAt: Date.now(),
255
- memories,
256
- };
257
- const timestamp = Date.now();
258
- const fileName = `amem-team-${userId}-${timestamp}.json`;
259
- const filePath = path.join(outputDir, fileName);
260
- fs.mkdirSync(outputDir, { recursive: true });
261
- fs.writeFileSync(filePath, JSON.stringify(exportData, null, 2) + "\n");
262
- return { file: filePath, count: memories.length };
263
- }
264
- /**
265
- * Import a teammate's exported memory file.
266
- * Deduplicates by content hash and lowers confidence by 0.1 for second-hand memories.
267
- */
268
- export async function importFromTeam(db, filePath, options) {
269
- const dryRun = options?.dryRun ?? false;
270
- const raw = fs.readFileSync(filePath, "utf-8");
271
- const data = JSON.parse(raw);
272
- const fromUser = data.userId;
273
- let imported = 0;
274
- let skipped = 0;
275
- for (const entry of data.memories) {
276
- // Dedup: skip if content already exists
277
- const existing = db.findByContentHash(entry.content);
278
- if (existing) {
279
- skipped++;
280
- continue;
281
- }
282
- if (dryRun) {
283
- imported++;
284
- continue;
285
- }
286
- // Lower confidence by 0.1 for second-hand memories, floor at 0.1
287
- const confidence = Math.max(0.1, entry.confidence - 0.1);
288
- // Tag with team-sync and the original userId
289
- const tags = [...entry.tags, "team-sync", `from:${fromUser}`];
290
- const embedding = await generateEmbedding(entry.content);
291
- db.insertMemory({
292
- content: entry.content,
293
- type: entry.type,
294
- tags,
295
- confidence,
296
- source: `team-sync:${fromUser}`,
297
- embedding,
298
- scope: entry.scope,
299
- });
300
- imported++;
301
- }
302
- return { imported, skipped, from: fromUser };
303
- }
304
- //# sourceMappingURL=sync.js.map