@fabersep/memory 0.0.0-stage → 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.
- package/LICENSE +202 -0
- package/README.md +271 -2
- package/dist/src/bm25.d.ts +26 -0
- package/dist/src/bm25.js +183 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +434 -0
- package/dist/src/compiler.d.ts +19 -0
- package/dist/src/compiler.js +171 -0
- package/dist/src/config.d.ts +20 -0
- package/dist/src/config.js +134 -0
- package/dist/src/frontmatter.d.ts +22 -0
- package/dist/src/frontmatter.js +199 -0
- package/dist/src/git.d.ts +33 -0
- package/dist/src/git.js +251 -0
- package/dist/src/hygiene.d.ts +3 -0
- package/dist/src/hygiene.js +81 -0
- package/dist/src/importer.d.ts +26 -0
- package/dist/src/importer.js +211 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +13 -0
- package/dist/src/init.d.ts +42 -0
- package/dist/src/init.js +242 -0
- package/dist/src/mcp.d.ts +128 -0
- package/dist/src/mcp.js +381 -0
- package/dist/src/proposals.d.ts +34 -0
- package/dist/src/proposals.js +383 -0
- package/dist/src/store.d.ts +23 -0
- package/dist/src/store.js +161 -0
- package/dist/src/sync.d.ts +13 -0
- package/dist/src/sync.js +47 -0
- package/dist/src/types.d.ts +100 -0
- package/dist/src/types.js +17 -0
- package/package.json +50 -4
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export type Scope = 'personal' | 'team' | 'project';
|
|
2
|
+
export type EntryType = 'rule' | 'decision' | 'lesson' | 'preference' | 'reference';
|
|
3
|
+
export type EntryStatus = 'active' | 'deprecated' | 'superseded';
|
|
4
|
+
export type L0Mode = 'none' | 'line' | 'body';
|
|
5
|
+
export type TeamSubmitMode = 'auto' | 'pr';
|
|
6
|
+
export type ProposalAction = 'create' | 'update' | 'supersede';
|
|
7
|
+
export type ProposalStatus = 'pending' | 'awaiting_commit' | 'push_failed';
|
|
8
|
+
export type ProjectRootSource = 'mcp-roots' | 'cwd' | 'none';
|
|
9
|
+
export declare const COMPILER_VERSION = "0.1.0";
|
|
10
|
+
export declare const DEFAULT_TOKEN_BUDGET = 1500;
|
|
11
|
+
export declare const DEFAULT_STALE_DAYS = 14;
|
|
12
|
+
export declare const DEFAULT_SIMILARITY_THRESHOLD = 0.45;
|
|
13
|
+
export declare const VALID_TYPES: readonly EntryType[];
|
|
14
|
+
export declare const VALID_STATUSES: readonly EntryStatus[];
|
|
15
|
+
export declare const VALID_L0_MODES: readonly L0Mode[];
|
|
16
|
+
export interface RootConfig {
|
|
17
|
+
uuid: string;
|
|
18
|
+
path: string;
|
|
19
|
+
scope: 'personal' | 'team';
|
|
20
|
+
remote?: string;
|
|
21
|
+
defaultBranch?: string;
|
|
22
|
+
submitMode?: TeamSubmitMode;
|
|
23
|
+
}
|
|
24
|
+
export interface UserConfig {
|
|
25
|
+
version: 1;
|
|
26
|
+
userTag: string;
|
|
27
|
+
tokenBudget: number;
|
|
28
|
+
staleDays: number;
|
|
29
|
+
similarityThreshold: number;
|
|
30
|
+
roots: {
|
|
31
|
+
personal?: RootConfig;
|
|
32
|
+
team?: RootConfig;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface EntryFrontmatter {
|
|
36
|
+
summary: string;
|
|
37
|
+
type: EntryType;
|
|
38
|
+
tags: string[];
|
|
39
|
+
status: EntryStatus;
|
|
40
|
+
superseded_by?: string;
|
|
41
|
+
l0: L0Mode;
|
|
42
|
+
last_verified?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface MemoryEntry extends EntryFrontmatter {
|
|
45
|
+
id: string;
|
|
46
|
+
scope: Scope;
|
|
47
|
+
filePath: string;
|
|
48
|
+
body: string;
|
|
49
|
+
links: string[];
|
|
50
|
+
shadowed?: boolean;
|
|
51
|
+
shadowWarning?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ValidationError {
|
|
54
|
+
scope: Scope;
|
|
55
|
+
filePath: string;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
export interface HygieneFinding {
|
|
59
|
+
line: number;
|
|
60
|
+
category: 'secret' | 'machine-path';
|
|
61
|
+
pattern: string;
|
|
62
|
+
message: string;
|
|
63
|
+
redactedSnippet: string;
|
|
64
|
+
}
|
|
65
|
+
export interface Proposal {
|
|
66
|
+
id: string;
|
|
67
|
+
rootUuid: string;
|
|
68
|
+
scope: Scope;
|
|
69
|
+
action: ProposalAction;
|
|
70
|
+
entryId: string;
|
|
71
|
+
targetId?: string;
|
|
72
|
+
summary: string;
|
|
73
|
+
type: EntryType;
|
|
74
|
+
tags: string[];
|
|
75
|
+
l0?: L0Mode;
|
|
76
|
+
body: string;
|
|
77
|
+
forceNew?: boolean;
|
|
78
|
+
reason?: string;
|
|
79
|
+
status: ProposalStatus;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
error?: string;
|
|
82
|
+
projectRootPath?: string;
|
|
83
|
+
targetFilePath?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ProjectRootResolution {
|
|
86
|
+
source: ProjectRootSource;
|
|
87
|
+
projectRoot?: string;
|
|
88
|
+
memoryDir?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface SearchResultItem {
|
|
91
|
+
id: string;
|
|
92
|
+
scope: Scope;
|
|
93
|
+
type: EntryType;
|
|
94
|
+
summary: string;
|
|
95
|
+
tags: string[];
|
|
96
|
+
pending?: boolean;
|
|
97
|
+
proposal_id?: string;
|
|
98
|
+
shadowed?: boolean;
|
|
99
|
+
shadow_warning?: string;
|
|
100
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const COMPILER_VERSION = '0.1.0';
|
|
2
|
+
export const DEFAULT_TOKEN_BUDGET = 1500;
|
|
3
|
+
export const DEFAULT_STALE_DAYS = 14;
|
|
4
|
+
export const DEFAULT_SIMILARITY_THRESHOLD = 0.45;
|
|
5
|
+
export const VALID_TYPES = [
|
|
6
|
+
'rule',
|
|
7
|
+
'decision',
|
|
8
|
+
'lesson',
|
|
9
|
+
'preference',
|
|
10
|
+
'reference',
|
|
11
|
+
];
|
|
12
|
+
export const VALID_STATUSES = [
|
|
13
|
+
'active',
|
|
14
|
+
'deprecated',
|
|
15
|
+
'superseded',
|
|
16
|
+
];
|
|
17
|
+
export const VALID_L0_MODES = ['none', 'line', 'body'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabersep/memory",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Prefix-cache-first, Git-backed Markdown memory MCP server, pre-memory staging, and import CLI for AI coding agents.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/fabersep/memory.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/fabersep/memory#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/fabersep/memory/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"fabersep",
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"memory",
|
|
19
|
+
"mcp",
|
|
20
|
+
"prompt-caching",
|
|
21
|
+
"markdown",
|
|
22
|
+
"git"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"bin": {
|
|
26
|
+
"faber-memory": "dist/src/cli.js"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": "./dist/src/index.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/src",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.json",
|
|
44
|
+
"prepublishOnly": "npm run build",
|
|
45
|
+
"test": "npm run build && node --test dist/test/*.test.js",
|
|
46
|
+
"faber-memory": "node dist/src/cli.js"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.10.2",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
51
|
+
}
|
|
52
|
+
}
|