claude-memory-layer 1.0.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.
- package/.claude-plugin/commands/memory-forget.md +42 -0
- package/.claude-plugin/commands/memory-history.md +34 -0
- package/.claude-plugin/commands/memory-import.md +56 -0
- package/.claude-plugin/commands/memory-list.md +37 -0
- package/.claude-plugin/commands/memory-search.md +36 -0
- package/.claude-plugin/commands/memory-stats.md +34 -0
- package/.claude-plugin/hooks.json +59 -0
- package/.claude-plugin/plugin.json +24 -0
- package/.history/package_20260201112328.json +45 -0
- package/.history/package_20260201113602.json +45 -0
- package/.history/package_20260201113713.json +45 -0
- package/.history/package_20260201114110.json +45 -0
- package/Memo.txt +558 -0
- package/README.md +520 -0
- package/context.md +636 -0
- package/dist/.claude-plugin/commands/memory-forget.md +42 -0
- package/dist/.claude-plugin/commands/memory-history.md +34 -0
- package/dist/.claude-plugin/commands/memory-import.md +56 -0
- package/dist/.claude-plugin/commands/memory-list.md +37 -0
- package/dist/.claude-plugin/commands/memory-search.md +36 -0
- package/dist/.claude-plugin/commands/memory-stats.md +34 -0
- package/dist/.claude-plugin/hooks.json +59 -0
- package/dist/.claude-plugin/plugin.json +24 -0
- package/dist/cli/index.js +3539 -0
- package/dist/cli/index.js.map +7 -0
- package/dist/core/index.js +4408 -0
- package/dist/core/index.js.map +7 -0
- package/dist/hooks/session-end.js +2971 -0
- package/dist/hooks/session-end.js.map +7 -0
- package/dist/hooks/session-start.js +2969 -0
- package/dist/hooks/session-start.js.map +7 -0
- package/dist/hooks/stop.js +3123 -0
- package/dist/hooks/stop.js.map +7 -0
- package/dist/hooks/user-prompt-submit.js +2960 -0
- package/dist/hooks/user-prompt-submit.js.map +7 -0
- package/dist/services/memory-service.js +2931 -0
- package/dist/services/memory-service.js.map +7 -0
- package/package.json +45 -0
- package/plan.md +1642 -0
- package/scripts/build.ts +102 -0
- package/spec.md +624 -0
- package/specs/citations-system/context.md +243 -0
- package/specs/citations-system/plan.md +495 -0
- package/specs/citations-system/spec.md +371 -0
- package/specs/endless-mode/context.md +305 -0
- package/specs/endless-mode/plan.md +620 -0
- package/specs/endless-mode/spec.md +455 -0
- package/specs/entity-edge-model/context.md +401 -0
- package/specs/entity-edge-model/plan.md +459 -0
- package/specs/entity-edge-model/spec.md +391 -0
- package/specs/evidence-aligner-v2/context.md +401 -0
- package/specs/evidence-aligner-v2/plan.md +303 -0
- package/specs/evidence-aligner-v2/spec.md +312 -0
- package/specs/mcp-desktop-integration/context.md +278 -0
- package/specs/mcp-desktop-integration/plan.md +550 -0
- package/specs/mcp-desktop-integration/spec.md +494 -0
- package/specs/post-tool-use-hook/context.md +319 -0
- package/specs/post-tool-use-hook/plan.md +469 -0
- package/specs/post-tool-use-hook/spec.md +364 -0
- package/specs/private-tags/context.md +288 -0
- package/specs/private-tags/plan.md +412 -0
- package/specs/private-tags/spec.md +345 -0
- package/specs/progressive-disclosure/context.md +346 -0
- package/specs/progressive-disclosure/plan.md +663 -0
- package/specs/progressive-disclosure/spec.md +415 -0
- package/specs/task-entity-system/context.md +297 -0
- package/specs/task-entity-system/plan.md +301 -0
- package/specs/task-entity-system/spec.md +314 -0
- package/specs/vector-outbox-v2/context.md +470 -0
- package/specs/vector-outbox-v2/plan.md +562 -0
- package/specs/vector-outbox-v2/spec.md +466 -0
- package/specs/web-viewer-ui/context.md +384 -0
- package/specs/web-viewer-ui/plan.md +797 -0
- package/specs/web-viewer-ui/spec.md +516 -0
- package/src/cli/index.ts +570 -0
- package/src/core/canonical-key.ts +186 -0
- package/src/core/citation-generator.ts +63 -0
- package/src/core/consolidated-store.ts +279 -0
- package/src/core/consolidation-worker.ts +384 -0
- package/src/core/context-formatter.ts +276 -0
- package/src/core/continuity-manager.ts +336 -0
- package/src/core/edge-repo.ts +324 -0
- package/src/core/embedder.ts +124 -0
- package/src/core/entity-repo.ts +342 -0
- package/src/core/event-store.ts +672 -0
- package/src/core/evidence-aligner.ts +635 -0
- package/src/core/graduation.ts +365 -0
- package/src/core/index.ts +32 -0
- package/src/core/matcher.ts +210 -0
- package/src/core/metadata-extractor.ts +203 -0
- package/src/core/privacy/filter.ts +179 -0
- package/src/core/privacy/index.ts +20 -0
- package/src/core/privacy/tag-parser.ts +145 -0
- package/src/core/progressive-retriever.ts +415 -0
- package/src/core/retriever.ts +235 -0
- package/src/core/task/blocker-resolver.ts +325 -0
- package/src/core/task/index.ts +9 -0
- package/src/core/task/task-matcher.ts +238 -0
- package/src/core/task/task-projector.ts +345 -0
- package/src/core/task/task-resolver.ts +414 -0
- package/src/core/types.ts +841 -0
- package/src/core/vector-outbox.ts +295 -0
- package/src/core/vector-store.ts +182 -0
- package/src/core/vector-worker.ts +488 -0
- package/src/core/working-set-store.ts +244 -0
- package/src/hooks/post-tool-use.ts +127 -0
- package/src/hooks/session-end.ts +78 -0
- package/src/hooks/session-start.ts +57 -0
- package/src/hooks/stop.ts +78 -0
- package/src/hooks/user-prompt-submit.ts +54 -0
- package/src/mcp/handlers.ts +212 -0
- package/src/mcp/index.ts +47 -0
- package/src/mcp/tools.ts +78 -0
- package/src/server/api/citations.ts +101 -0
- package/src/server/api/events.ts +101 -0
- package/src/server/api/index.ts +18 -0
- package/src/server/api/search.ts +98 -0
- package/src/server/api/sessions.ts +111 -0
- package/src/server/api/stats.ts +97 -0
- package/src/server/index.ts +91 -0
- package/src/services/memory-service.ts +626 -0
- package/src/services/session-history-importer.ts +367 -0
- package/tests/canonical-key.test.ts +101 -0
- package/tests/evidence-aligner.test.ts +152 -0
- package/tests/matcher.test.ts +112 -0
- package/tsconfig.json +24 -0
- package/vitest.config.ts +15 -0
package/scripts/build.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build script for code-memory plugin
|
|
3
|
+
* Uses esbuild for fast bundling
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as esbuild from 'esbuild';
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
|
|
10
|
+
const outdir = 'dist';
|
|
11
|
+
|
|
12
|
+
// Clean output directory
|
|
13
|
+
if (fs.existsSync(outdir)) {
|
|
14
|
+
fs.rmSync(outdir, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
fs.mkdirSync(outdir, { recursive: true });
|
|
17
|
+
|
|
18
|
+
// Common build options
|
|
19
|
+
const commonOptions: esbuild.BuildOptions = {
|
|
20
|
+
bundle: true,
|
|
21
|
+
platform: 'node',
|
|
22
|
+
target: 'node18',
|
|
23
|
+
format: 'esm',
|
|
24
|
+
sourcemap: true,
|
|
25
|
+
external: [
|
|
26
|
+
'@lancedb/lancedb',
|
|
27
|
+
'@xenova/transformers',
|
|
28
|
+
'duckdb',
|
|
29
|
+
'commander',
|
|
30
|
+
'zod'
|
|
31
|
+
],
|
|
32
|
+
banner: {
|
|
33
|
+
js: `import { createRequire } from 'module';
|
|
34
|
+
import { fileURLToPath } from 'url';
|
|
35
|
+
import { dirname } from 'path';
|
|
36
|
+
const require = createRequire(import.meta.url);
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
38
|
+
const __dirname = dirname(__filename);`
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
async function build() {
|
|
43
|
+
console.log('šØ Building code-memory plugin...\n');
|
|
44
|
+
|
|
45
|
+
// Build CLI
|
|
46
|
+
console.log('š¦ Building CLI...');
|
|
47
|
+
await esbuild.build({
|
|
48
|
+
...commonOptions,
|
|
49
|
+
entryPoints: ['src/cli/index.ts'],
|
|
50
|
+
outfile: 'dist/cli/index.js'
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Build hooks
|
|
54
|
+
console.log('š¦ Building hooks...');
|
|
55
|
+
const hooks = [
|
|
56
|
+
'session-start',
|
|
57
|
+
'user-prompt-submit',
|
|
58
|
+
'stop',
|
|
59
|
+
'session-end'
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
for (const hook of hooks) {
|
|
63
|
+
await esbuild.build({
|
|
64
|
+
...commonOptions,
|
|
65
|
+
entryPoints: [`src/hooks/${hook}.ts`],
|
|
66
|
+
outfile: `dist/hooks/${hook}.js`
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Build core modules as library
|
|
71
|
+
console.log('š¦ Building core modules...');
|
|
72
|
+
await esbuild.build({
|
|
73
|
+
...commonOptions,
|
|
74
|
+
entryPoints: ['src/core/index.ts'],
|
|
75
|
+
outfile: 'dist/core/index.js'
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Build services
|
|
79
|
+
console.log('š¦ Building services...');
|
|
80
|
+
await esbuild.build({
|
|
81
|
+
...commonOptions,
|
|
82
|
+
entryPoints: ['src/services/memory-service.ts'],
|
|
83
|
+
outfile: 'dist/services/memory-service.js'
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Copy plugin manifest
|
|
87
|
+
console.log('š Copying plugin files...');
|
|
88
|
+
fs.cpSync('.claude-plugin', path.join(outdir, '.claude-plugin'), { recursive: true });
|
|
89
|
+
|
|
90
|
+
console.log('\nā
Build complete!');
|
|
91
|
+
console.log(`\nOutput: ${outdir}/`);
|
|
92
|
+
console.log(' - cli/index.js');
|
|
93
|
+
console.log(' - hooks/*.js');
|
|
94
|
+
console.log(' - core/index.js');
|
|
95
|
+
console.log(' - services/memory-service.js');
|
|
96
|
+
console.log(' - .claude-plugin/');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
build().catch((err) => {
|
|
100
|
+
console.error('Build failed:', err);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
});
|