psychmem 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/README.md +632 -0
- package/dist/adapters/claude-code/index.d.ts +125 -0
- package/dist/adapters/claude-code/index.d.ts.map +1 -0
- package/dist/adapters/claude-code/index.js +398 -0
- package/dist/adapters/claude-code/index.js.map +1 -0
- package/dist/adapters/opencode/index.d.ts +50 -0
- package/dist/adapters/opencode/index.d.ts.map +1 -0
- package/dist/adapters/opencode/index.js +793 -0
- package/dist/adapters/opencode/index.js.map +1 -0
- package/dist/adapters/types.d.ts +226 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +6 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +461 -0
- package/dist/cli.js.map +1 -0
- package/dist/hooks/index.d.ts +92 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +304 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/post-tool-use.d.ts +26 -0
- package/dist/hooks/post-tool-use.d.ts.map +1 -0
- package/dist/hooks/post-tool-use.js +69 -0
- package/dist/hooks/post-tool-use.js.map +1 -0
- package/dist/hooks/session-end.d.ts +32 -0
- package/dist/hooks/session-end.d.ts.map +1 -0
- package/dist/hooks/session-end.js +66 -0
- package/dist/hooks/session-end.js.map +1 -0
- package/dist/hooks/session-start.d.ts +55 -0
- package/dist/hooks/session-start.d.ts.map +1 -0
- package/dist/hooks/session-start.js +173 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/hooks/stop.d.ts +72 -0
- package/dist/hooks/stop.d.ts.map +1 -0
- package/dist/hooks/stop.js +273 -0
- package/dist/hooks/stop.js.map +1 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +191 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/context-sweep.d.ts +107 -0
- package/dist/memory/context-sweep.d.ts.map +1 -0
- package/dist/memory/context-sweep.js +557 -0
- package/dist/memory/context-sweep.js.map +1 -0
- package/dist/memory/patterns.d.ts +106 -0
- package/dist/memory/patterns.d.ts.map +1 -0
- package/dist/memory/patterns.js +613 -0
- package/dist/memory/patterns.js.map +1 -0
- package/dist/memory/selective-memory.d.ts +78 -0
- package/dist/memory/selective-memory.d.ts.map +1 -0
- package/dist/memory/selective-memory.js +227 -0
- package/dist/memory/selective-memory.js.map +1 -0
- package/dist/memory/structural-analyzer.d.ts +75 -0
- package/dist/memory/structural-analyzer.d.ts.map +1 -0
- package/dist/memory/structural-analyzer.js +359 -0
- package/dist/memory/structural-analyzer.js.map +1 -0
- package/dist/retrieval/index.d.ts +106 -0
- package/dist/retrieval/index.d.ts.map +1 -0
- package/dist/retrieval/index.js +291 -0
- package/dist/retrieval/index.js.map +1 -0
- package/dist/storage/database.d.ts +138 -0
- package/dist/storage/database.d.ts.map +1 -0
- package/dist/storage/database.js +748 -0
- package/dist/storage/database.js.map +1 -0
- package/dist/storage/sqlite-adapter.d.ts +35 -0
- package/dist/storage/sqlite-adapter.d.ts.map +1 -0
- package/dist/storage/sqlite-adapter.js +103 -0
- package/dist/storage/sqlite-adapter.js.map +1 -0
- package/dist/transcript/index.d.ts +8 -0
- package/dist/transcript/index.d.ts.map +1 -0
- package/dist/transcript/index.js +6 -0
- package/dist/transcript/index.js.map +1 -0
- package/dist/transcript/parser.d.ts +93 -0
- package/dist/transcript/parser.d.ts.map +1 -0
- package/dist/transcript/parser.js +373 -0
- package/dist/transcript/parser.js.map +1 -0
- package/dist/transcript/sweep.d.ts +75 -0
- package/dist/transcript/sweep.d.ts.map +1 -0
- package/dist/transcript/sweep.js +202 -0
- package/dist/transcript/sweep.js.map +1 -0
- package/dist/types/index.d.ts +328 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +80 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/paths.d.ts +19 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +43 -0
- package/dist/utils/paths.js.map +1 -0
- package/hooks/hooks.json +54 -0
- package/package.json +83 -0
- package/plugin.js +45 -0
- package/plugin.json +19 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multilingual Importance Pattern Dictionaries
|
|
3
|
+
*
|
|
4
|
+
* Patterns for detecting importance signals across 15 languages:
|
|
5
|
+
* English, Spanish, French, German, Portuguese, Japanese, Chinese, Korean,
|
|
6
|
+
* Russian, Arabic, Hindi, Italian, Dutch, Turkish, Polish
|
|
7
|
+
*
|
|
8
|
+
* For Latin scripts: compiled to single \b-bounded regex per category
|
|
9
|
+
* For CJK/Arabic/Hindi: matched via string.includes() since \b doesn't work
|
|
10
|
+
*/
|
|
11
|
+
import type { ImportanceSignal, ImportanceSignalType } from '../types/index.js';
|
|
12
|
+
export interface PatternCategory {
|
|
13
|
+
signalType: ImportanceSignalType;
|
|
14
|
+
weight: number;
|
|
15
|
+
/** Latin-script keywords (compiled to regex with \b word boundaries) */
|
|
16
|
+
latin: string[];
|
|
17
|
+
/** Non-Latin keywords (matched via string.includes) */
|
|
18
|
+
nonLatin: string[];
|
|
19
|
+
/** Compiled regex for Latin keywords (cached after first use) */
|
|
20
|
+
compiledRegex?: RegExp;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Explicit remember signals - user explicitly asks to remember something
|
|
24
|
+
* Weight: 0.9 (highest - direct user intent)
|
|
25
|
+
*/
|
|
26
|
+
export declare const EXPLICIT_REMEMBER: PatternCategory;
|
|
27
|
+
/**
|
|
28
|
+
* Emphasis cue signals - words indicating importance/emphasis
|
|
29
|
+
* Weight: 0.8
|
|
30
|
+
*/
|
|
31
|
+
export declare const EMPHASIS_CUE: PatternCategory;
|
|
32
|
+
/**
|
|
33
|
+
* Correction signals - user correcting themselves or the AI
|
|
34
|
+
* Weight: 0.7
|
|
35
|
+
*/
|
|
36
|
+
export declare const CORRECTION: PatternCategory;
|
|
37
|
+
/**
|
|
38
|
+
* Preference signals - user expressing preferences
|
|
39
|
+
* Weight: 0.6
|
|
40
|
+
*/
|
|
41
|
+
export declare const PREFERENCE: PatternCategory;
|
|
42
|
+
/**
|
|
43
|
+
* Decision signals - decisions being made
|
|
44
|
+
* Weight: 0.7
|
|
45
|
+
*/
|
|
46
|
+
export declare const DECISION: PatternCategory;
|
|
47
|
+
/**
|
|
48
|
+
* Constraint signals - rules and limitations
|
|
49
|
+
* Weight: 0.7
|
|
50
|
+
*/
|
|
51
|
+
export declare const CONSTRAINT: PatternCategory;
|
|
52
|
+
/**
|
|
53
|
+
* Bug/error signals - errors and issues
|
|
54
|
+
* Weight: 0.8
|
|
55
|
+
*/
|
|
56
|
+
export declare const BUG_FIX: PatternCategory;
|
|
57
|
+
/**
|
|
58
|
+
* Learning signals - discoveries and insights
|
|
59
|
+
* Weight: 0.8
|
|
60
|
+
*/
|
|
61
|
+
export declare const LEARNING: PatternCategory;
|
|
62
|
+
export declare const ALL_PATTERNS: PatternCategory[];
|
|
63
|
+
/**
|
|
64
|
+
* Patterns for classifying content after importance is detected.
|
|
65
|
+
* More specific than importance patterns - used to determine MemoryClassification.
|
|
66
|
+
*/
|
|
67
|
+
export declare const CLASSIFICATION_PATTERNS: {
|
|
68
|
+
bugfix: {
|
|
69
|
+
latin: string[];
|
|
70
|
+
nonLatin: string[];
|
|
71
|
+
};
|
|
72
|
+
learning: {
|
|
73
|
+
latin: string[];
|
|
74
|
+
nonLatin: string[];
|
|
75
|
+
};
|
|
76
|
+
constraint: {
|
|
77
|
+
latin: string[];
|
|
78
|
+
nonLatin: string[];
|
|
79
|
+
};
|
|
80
|
+
decision: {
|
|
81
|
+
latin: string[];
|
|
82
|
+
nonLatin: string[];
|
|
83
|
+
};
|
|
84
|
+
preference: {
|
|
85
|
+
latin: string[];
|
|
86
|
+
nonLatin: string[];
|
|
87
|
+
};
|
|
88
|
+
procedural: {
|
|
89
|
+
latin: string[];
|
|
90
|
+
nonLatin: string[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Match text against a pattern category, returning an ImportanceSignal if matched.
|
|
95
|
+
*/
|
|
96
|
+
export declare function matchPattern(text: string, category: PatternCategory): ImportanceSignal | null;
|
|
97
|
+
/**
|
|
98
|
+
* Match text against all pattern categories, returning all matched signals.
|
|
99
|
+
*/
|
|
100
|
+
export declare function matchAllPatterns(text: string): ImportanceSignal[];
|
|
101
|
+
/**
|
|
102
|
+
* Classify content based on matched keywords.
|
|
103
|
+
* Returns the best-matching MemoryClassification.
|
|
104
|
+
*/
|
|
105
|
+
export declare function classifyByPatterns(text: string): string | null;
|
|
106
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/memory/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMhF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,oBAAoB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,eA0C/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,eA8C1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,eA+CxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,eA8CxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,eAuCtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,eAwCxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,eA0CrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,eAgDtB,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;CAuFnC,CAAC;AAqCF;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,gBAAgB,GAAG,IAAI,CA2B7F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAWjE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6B9D"}
|