@exaudeus/memory-mcp 0.1.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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -0
  3. package/dist/__tests__/clock-and-validators.test.d.ts +1 -0
  4. package/dist/__tests__/clock-and-validators.test.js +237 -0
  5. package/dist/__tests__/config-manager.test.d.ts +1 -0
  6. package/dist/__tests__/config-manager.test.js +142 -0
  7. package/dist/__tests__/config.test.d.ts +1 -0
  8. package/dist/__tests__/config.test.js +236 -0
  9. package/dist/__tests__/crash-journal.test.d.ts +1 -0
  10. package/dist/__tests__/crash-journal.test.js +203 -0
  11. package/dist/__tests__/e2e.test.d.ts +1 -0
  12. package/dist/__tests__/e2e.test.js +788 -0
  13. package/dist/__tests__/ephemeral-benchmark.test.d.ts +1 -0
  14. package/dist/__tests__/ephemeral-benchmark.test.js +651 -0
  15. package/dist/__tests__/ephemeral.test.d.ts +1 -0
  16. package/dist/__tests__/ephemeral.test.js +435 -0
  17. package/dist/__tests__/git-service.test.d.ts +1 -0
  18. package/dist/__tests__/git-service.test.js +43 -0
  19. package/dist/__tests__/normalize.test.d.ts +1 -0
  20. package/dist/__tests__/normalize.test.js +161 -0
  21. package/dist/__tests__/store.test.d.ts +1 -0
  22. package/dist/__tests__/store.test.js +1153 -0
  23. package/dist/config-manager.d.ts +49 -0
  24. package/dist/config-manager.js +126 -0
  25. package/dist/config.d.ts +32 -0
  26. package/dist/config.js +162 -0
  27. package/dist/crash-journal.d.ts +38 -0
  28. package/dist/crash-journal.js +198 -0
  29. package/dist/ephemeral-weights.json +1847 -0
  30. package/dist/ephemeral.d.ts +20 -0
  31. package/dist/ephemeral.js +516 -0
  32. package/dist/formatters.d.ts +10 -0
  33. package/dist/formatters.js +92 -0
  34. package/dist/git-service.d.ts +5 -0
  35. package/dist/git-service.js +39 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/index.js +1197 -0
  38. package/dist/normalize.d.ts +2 -0
  39. package/dist/normalize.js +69 -0
  40. package/dist/store.d.ts +84 -0
  41. package/dist/store.js +813 -0
  42. package/dist/text-analyzer.d.ts +32 -0
  43. package/dist/text-analyzer.js +190 -0
  44. package/dist/thresholds.d.ts +39 -0
  45. package/dist/thresholds.js +75 -0
  46. package/dist/types.d.ts +186 -0
  47. package/dist/types.js +33 -0
  48. package/package.json +57 -0
@@ -0,0 +1,39 @@
1
+ // Git operations boundary — isolates shell/process calls from business logic.
2
+ // Inject fakeGitService in tests for determinism; realGitService in production.
3
+ import { execFile } from 'child_process';
4
+ import { promisify } from 'util';
5
+ const execFileAsync = promisify(execFile);
6
+ const GIT_TIMEOUT_MS = 5000;
7
+ /** Production git service using real git CLI */
8
+ export const realGitService = {
9
+ async getCurrentBranch(repoRoot) {
10
+ try {
11
+ const { stdout } = await execFileAsync('git', ['branch', '--show-current'], { cwd: repoRoot, timeout: GIT_TIMEOUT_MS });
12
+ const branch = stdout.trim();
13
+ if (branch)
14
+ return branch;
15
+ // Detached HEAD — use short SHA
16
+ const { stdout: sha } = await execFileAsync('git', ['rev-parse', '--short', 'HEAD'], { cwd: repoRoot, timeout: GIT_TIMEOUT_MS });
17
+ return `detached-${sha.trim()}`;
18
+ }
19
+ catch {
20
+ return 'unknown';
21
+ }
22
+ },
23
+ async getHeadSha(repoRoot) {
24
+ try {
25
+ const { stdout } = await execFileAsync('git', ['rev-parse', 'HEAD'], { cwd: repoRoot, timeout: GIT_TIMEOUT_MS });
26
+ return stdout.trim();
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ },
32
+ };
33
+ /** Fake git service for deterministic testing — no shell calls */
34
+ export function fakeGitService(branch = 'main') {
35
+ return {
36
+ async getCurrentBranch() { return branch; },
37
+ async getHeadSha() { return 'fake-sha-1234'; },
38
+ };
39
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};