true-mem 1.0.1 → 1.0.3

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 CHANGED
@@ -7,17 +7,13 @@
7
7
  ## Table of Contents
8
8
 
9
9
  - [Overview](#overview)
10
- - [The Problem](#the-problem)
11
- - [The Solution](#the-solution)
12
- - [The Psychology Behind It](#the-psychology-behind-it)
13
10
  - [Key Features](#key-features)
11
+ - [Noise Filtering](#noise-filtering)
14
12
  - [Installation](#installation)
15
13
  - [Usage](#usage)
16
14
  - [Architecture](#architecture)
17
15
  - [Memory Classifications](#memory-classifications)
18
16
  - [Technical Details](#technical-details)
19
- - [Inspiration](#inspiration)
20
- - [Debug](#debug)
21
17
 
22
18
  ---
23
19
 
@@ -57,7 +53,7 @@ What makes True-Mem different from a simple database? It's modeled after how hum
57
53
 
58
54
  **Dual-Store Architecture (STM/LTM)** - Short-term and long-term memory stores with automatic promotion. High-strength memories get promoted to LTM; weak ones stay in STM or decay.
59
55
 
60
- **Four-Layer Defense System** - Prevents false positives with Negative Pattern filtering (including AI meta-talk detection), Multi-Keyword Scoring, Confidence Thresholds, and Role Validation (only Human messages for user-level preferences).
56
+ **Four-Layer Defense System** - Prevents false positives with Question Detection (filters questions before classification), Negative Pattern filtering (including AI meta-talk detection), Multi-Keyword Scoring with sentence-level isolation, Confidence Thresholds, and Role Validation (only Human messages for user-level preferences).
61
57
 
62
58
  **Reconsolidation** - When new information conflicts with existing memories, the system detects similarity and handles it intelligently (merge duplicates, keep both complements, or resolve conflicts).
63
59
 
@@ -78,13 +74,36 @@ What makes True-Mem different from a simple database? It's modeled after how hum
78
74
 
79
75
  ---
80
76
 
81
- ## Installation
77
+ ## Noise Filtering
82
78
 
83
- ```bash
84
- npm install true-mem
85
- ```
79
+ What truly sets True-Mem apart is its ability to distinguish **signal from noise**. Unlike simpler memory plugins that store everything matching a keyword, True-Mem understands context and intent:
80
+
81
+ **What gets filtered OUT:**
82
+
83
+ | Pattern Type | Example | Why filtered |
84
+ |--------------|---------|--------------|
85
+ | Questions | "Do you remember this?" | It's a question, not a statement |
86
+ | 1st person recall | "I remember when we fixed that" | Recounting, not requesting storage |
87
+ | Remind-me recall | "Remind me how we did this" | Asking AI to recall info, not store |
88
+ | AI meta-talk | "Goal: The user is trying to..." | AI-generated, not user content |
89
+ | List selections | "I prefer option 3" | Context-specific choice, not general preference |
90
+
91
+ **What gets stored:**
92
+
93
+ | Pattern Type | Example | Why stored |
94
+ |--------------|---------|------------|
95
+ | Imperatives | "Remember this: always run tests" | Explicit storage request |
96
+ | Preferences | "I prefer TypeScript over JavaScript" | General, reusable preference |
97
+ | Decisions | "We decided to use SQLite" | Project-level decision |
98
+ | Constraints | "Never use var keyword" | Permanent rule |
86
99
 
87
- Then add to your `~/.config/opencode/opencode.jsonc`:
100
+ All filtering patterns support **10 languages**: English, Italian, Spanish, French, German, Portuguese, Dutch, Polish, Turkish, and Russian.
101
+
102
+ ---
103
+
104
+ ## Installation
105
+
106
+ Add to your `~/.config/opencode/opencode.jsonc`:
88
107
 
89
108
  ```jsonc
90
109
  {
@@ -94,6 +113,8 @@ Then add to your `~/.config/opencode/opencode.jsonc`:
94
113
  }
95
114
  ```
96
115
 
116
+ OpenCode will automatically download the plugin from npm.
117
+
97
118
  ---
98
119
 
99
120
  ## Usage
@@ -111,11 +132,11 @@ Just have conversations with OpenCode. True-Mem extracts relevant info in the ba
111
132
 
112
133
  ### Explicit Memory Storage
113
134
 
114
- Use phrases like "Remember this:" or "Ricorda questo:" to force storage:
135
+ Use phrases like "Remember this:" or "Remember that ..." to force storage:
115
136
 
116
137
  ```
117
- "Ricorda questo: preferisco sempre usare TypeScript per i miei progetti"
118
138
  "Remember this: never commit without running tests first"
139
+ "Remember that I prefer to use TypeScript in my projects"
119
140
  ```
120
141
 
121
142
  ---
@@ -182,10 +203,10 @@ true-mem/
182
203
 
183
204
  | Layer | Purpose |
184
205
  |-------|---------|
185
- | 1. Negative Patterns | Filter known false positives |
186
- | 2. Multi-Keyword Scoring | Require 2+ signals |
187
- | 3. Confidence Threshold | Store only if score >= 0.6 |
188
- | 4. Role Validation | Human-only for user-level memories |
206
+ | 1. Question Detection | Filter questions before classification |
207
+ | 2. Negative Patterns | AI meta-talk, list selections, 1st person recall, remind-me recall (10 languages) |
208
+ | 3. Multi-Keyword + Sentence-Level | Require 2+ signals in the same sentence |
209
+ | 4. Confidence Threshold | Store only if score >= 0.6 |
189
210
 
190
211
  ### Decay Strategy
191
212
 
@@ -212,6 +233,5 @@ sqlite3 ~/.true-mem/memory.db "SELECT classification, summary, strength FROM mem
212
233
 
213
234
  ---
214
235
 
215
- **Version**: 1.0.0
216
236
  **License**: MIT
217
237
  **Status**: Production-ready, actively maintained
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAiBzD,QAAA,MAAM,UAAU,EAAE,MAgGjB,CAAC;AAEF,eAAe,UAAU,CAAC;AAG1B,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,qBAAqB,CAAC;AAkBzD,QAAA,MAAM,UAAU,EAAE,MAgGjB,CAAC;AAEF,eAAe,UAAU,CAAC;AAG1B,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -844,16 +844,32 @@ var init_database = __esm(() => {
844
844
  function isAIMetaTalk(text) {
845
845
  return AI_META_TALK_PATTERNS.some((pattern) => pattern.test(text.trim()));
846
846
  }
847
+ function isQuestion(text) {
848
+ const trimmed = text.trim();
849
+ if (trimmed.endsWith("?"))
850
+ return true;
851
+ const questionPatterns = [
852
+ /\b(?:cosa|come|quando|dove|perch\u00E9|chi|quale|quanto)\s+(?:devo|posso|dovrei|potrei|conviene)\b/i,
853
+ /\b(?:potr\u00F2|dovr\u00F2|posso|devo)\s+\w+/i
854
+ ];
855
+ return questionPatterns.some((p) => p.test(trimmed));
856
+ }
847
857
  function matchesNegativePattern(text, classification) {
848
858
  if (isAIMetaTalk(text)) {
849
859
  return true;
850
860
  }
861
+ if (FIRST_PERSON_RECALL_PATTERNS.some((pattern) => pattern.test(text))) {
862
+ return true;
863
+ }
864
+ if (REMIND_RECALL_PATTERNS.some((pattern) => pattern.test(text))) {
865
+ return true;
866
+ }
851
867
  const patterns = NEGATIVE_PATTERNS[classification];
852
868
  if (!patterns)
853
869
  return false;
854
870
  return patterns.some((pattern) => pattern.test(text));
855
871
  }
856
- var AI_META_TALK_PATTERNS, NEGATIVE_PATTERNS;
872
+ var AI_META_TALK_PATTERNS, FIRST_PERSON_RECALL_PATTERNS, REMIND_RECALL_PATTERNS, NEGATIVE_PATTERNS;
857
873
  var init_negative_patterns = __esm(() => {
858
874
  AI_META_TALK_PATTERNS = [
859
875
  /^(Goal|Summary|Context|Analysis|Note|Overview|Background):\s+The user/i,
@@ -869,7 +885,51 @@ var init_negative_patterns = __esm(() => {
869
885
  /^Here('s| is) (the|a)/i,
870
886
  /^Based on (the|my) analysis/i,
871
887
  /^After (reviewing|analyzing|examining)/i,
872
- /^Looking at (the|this)/i
888
+ /^Looking at (the|this)/i,
889
+ /^\|[^|]+\|[^|]+\|/i,
890
+ /^[\s]*\|[^\n]+\|[^\n]*$/im,
891
+ /^[\s]*\/.*\/[gimsuvy]*\s*$/i,
892
+ /\|\w+\|.*\.\.\./i,
893
+ /^\|.+\|$/i
894
+ ];
895
+ FIRST_PERSON_RECALL_PATTERNS = [
896
+ /\bI\s+(remember|recall|recollect|don'?t\s+forget)\b/i,
897
+ /\bwe\s+(remember|recall|recollect)\b/i,
898
+ /\bI\s+can\s+remember\b/i,
899
+ /\b(io\s+)?ricordo\b/i,
900
+ /\bmi\s+ricordo\b/i,
901
+ /\bho\s+ricordato\b/i,
902
+ /\b(ci\s+)?ricordiamo\s+(che|di|quando|come|perch)\b/i,
903
+ /\b(yo\s+)?recuerdo\b/i,
904
+ /\bme\s+acuerdo\b/i,
905
+ /\brecordamos\b/i,
906
+ /\bje\s+(me\s+)?souviens\b/i,
907
+ /\bnous\s+(nous\s+)?souvenons\b/i,
908
+ /\bich\s+erinnere(\s+mich)?\b/i,
909
+ /\bwir\s+erinnern(\s+uns)?\b/i,
910
+ /\b(eu\s+)?(me\s+)?lembro\b/i,
911
+ /\bnos\s+lembramos\b/i,
912
+ /\bik\s+herinner(\s+me)?\b/i,
913
+ /\bwe\s+herinneren(\s+ons)?\b/i,
914
+ /\bpami\u0119tam\b/i,
915
+ /\bpami\u0119tamy\b/i,
916
+ /\bhat\u0131rl\u0131yorum\b/i,
917
+ /\bhat\u0131rl\u0131yoruz\b/i
918
+ ];
919
+ REMIND_RECALL_PATTERNS = [
920
+ /\bremind\s+me\s+(how|what|when|where|why|who|which)\b/i,
921
+ /\bremind\s+me\s+of\s+(the|what|how|when|where|why)\b/i,
922
+ /\bricordami\s+(come|cosa|quando|dove|perch[e\u00E9]|chi|quale|quanto)\b/i,
923
+ /\bricordami\s+che\s+(cosa|tipo|ragione)\b/i,
924
+ /\brec[u\u00FA]rdame\s+(c[o\u00F3]mo|qu[e\u00E9]|cu[a\u00E1]ndo|d[o\u00F3]nde|por\s*qu[e\u00E9]|qui[e\u00E9]n|cu[a\u00E1]l)\b/i,
925
+ /\brappelle[s]?\s*-?\s*moi\s+(comment|quand|o[u\u00F9]|pourquoi|qui|quel)\b/i,
926
+ /\brappelle[s]?\s*-?\s*moi\s+ce\s+que\b/i,
927
+ /\berinner\s+(mich|uns)\s+(wie|was|wann|wo|warum|wer|welche[ns]?)\b/i,
928
+ /\blembre\s*-?\s*me\s+(como|quando|onde|por\s*que|quem|qual)\b/i,
929
+ /\blembre\s*-?\s*me\s+o\s+que\b/i,
930
+ /\bherinner\s+(me|ons)\s+(hoe|wat|wanneer|waar|waarom|wie|welke)\b/i,
931
+ /\bprzypomnij\s+mi\s+(jak|co|kiedy|gdzie|dlaczego|kto|kt[o\u00F3]ry)\b/i,
932
+ /\bhat[\u0131i]rlat\s+(bana)\s+(nas[\u0131i]l|ne|ne\s+zaman|nere[dy]e|neden|kim|hangi)\b/i
873
933
  ];
874
934
  NEGATIVE_PATTERNS = {
875
935
  bugfix: [
@@ -907,6 +967,13 @@ var init_negative_patterns = __esm(() => {
907
967
  /database\s+constraint/i,
908
968
  /foreign\s+key\s+constraint/i,
909
969
  /unique\s+constraint/i
970
+ ],
971
+ preference: [
972
+ /\b(preferisco|scelgo|voglio|prendo|opto)\s+(?:la\s+)?[0-9]+(?:a|o)?\b/i,
973
+ /\b(preferisco|scelgo|voglio|prendo|opto)\s+(?:la\s+)?(prima|seconda|terza|quarta|quinta|primo|secondo|terzo)\b/i,
974
+ /\b(preferisco|scelgo|voglio|prendo|opto)\s+(?:l'|il\s+)?(?:opzione\s+)?[0-9]+\b/i,
975
+ /\b(?:option|opzione)\s+[0-9]+\b/i,
976
+ /\b(preferisco|scelgo|voglio)\s+[0-9]\s*[,.\n]/i
910
977
  ]
911
978
  };
912
979
  });
@@ -967,19 +1034,34 @@ function calculateClassificationScore(text, classification) {
967
1034
  const keywords = CLASSIFICATION_KEYWORDS[classification];
968
1035
  if (!keywords)
969
1036
  return 0;
970
- const textLower = text.toLowerCase();
971
- const { primary, boosters } = keywords;
972
- const primaryMatches = primary.filter((k) => textLower.includes(k.toLowerCase())).length;
973
- const boosterMatches = boosters.filter((k) => textLower.includes(k.toLowerCase())).length;
974
- if (primaryMatches === 0)
975
- return 0;
976
- if (primaryMatches === 1 && boosterMatches === 0)
1037
+ const sentences = text.split(/[.!?\n]+/).filter((s) => s.trim().length > 0);
1038
+ let bestSentenceScore = 0;
1039
+ for (const sentence of sentences) {
1040
+ const sentenceLower = sentence.toLowerCase();
1041
+ const { primary, boosters } = keywords;
1042
+ const primaryMatches = primary.filter((k) => sentenceLower.includes(k.toLowerCase())).length;
1043
+ const boosterMatches = boosters.filter((k) => sentenceLower.includes(k.toLowerCase())).length;
1044
+ if (primaryMatches === 0)
1045
+ continue;
1046
+ const primaryScore = Math.min(0.5, primaryMatches * 0.2);
1047
+ const boosterScore = Math.min(0.3, boosterMatches * 0.15);
1048
+ const sentenceScore = Math.min(1, 0.3 + primaryScore + boosterScore);
1049
+ if (sentenceScore > bestSentenceScore) {
1050
+ bestSentenceScore = sentenceScore;
1051
+ }
1052
+ }
1053
+ if (bestSentenceScore === 0.3)
977
1054
  return 0.4;
978
- const primaryScore = Math.min(0.5, primaryMatches * 0.2);
979
- const boosterScore = Math.min(0.3, boosterMatches * 0.15);
980
- return Math.min(1, 0.3 + primaryScore + boosterScore);
1055
+ return bestSentenceScore;
981
1056
  }
982
1057
  function shouldStoreMemory(text, classification, baseSignalScore) {
1058
+ if (isQuestion(text)) {
1059
+ return {
1060
+ store: false,
1061
+ confidence: 0,
1062
+ reason: "is_question_not_statement"
1063
+ };
1064
+ }
983
1065
  if (matchesNegativePattern(text, classification)) {
984
1066
  return {
985
1067
  store: false,
@@ -1049,8 +1131,6 @@ function classifyWithExplicitIntent(text, signals) {
1049
1131
  /\bmemorizziamo\b:?\s*/gi,
1050
1132
  /\bricordiamoci che\b:?\s*/gi,
1051
1133
  /\bricordiamoci di\b:?\s*/gi,
1052
- /\bricorda\b:?\s*/gi,
1053
- /\bremember\b:?\s*/gi,
1054
1134
  /\btieni a mente\b:?\s*/gi,
1055
1135
  /\bkeep in mind\b:?\s*/gi,
1056
1136
  /\bnota che\b:?\s*/gi,
@@ -2872,6 +2952,63 @@ var init_opencode = __esm(() => {
2872
2952
 
2873
2953
  // src/index.ts
2874
2954
  init_logger();
2955
+ // package.json
2956
+ var package_default = {
2957
+ name: "true-mem",
2958
+ version: "1.0.3",
2959
+ description: "Persistent memory plugin for OpenCode with cognitive psychology-based memory management",
2960
+ main: "dist/index.js",
2961
+ types: "dist/index.d.ts",
2962
+ type: "module",
2963
+ exports: {
2964
+ ".": {
2965
+ types: "./dist/index.d.ts",
2966
+ import: "./dist/index.js"
2967
+ }
2968
+ },
2969
+ scripts: {
2970
+ build: "bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
2971
+ dev: "bun build src/index.ts --outdir dist --target bun --format esm --watch",
2972
+ typecheck: "tsc --noEmit"
2973
+ },
2974
+ keywords: [
2975
+ "opencode",
2976
+ "ai",
2977
+ "memory",
2978
+ "plugin",
2979
+ "persistent",
2980
+ "cognitive",
2981
+ "coding-assistant"
2982
+ ],
2983
+ author: "rizal72",
2984
+ license: "MIT",
2985
+ repository: {
2986
+ type: "git",
2987
+ url: "git+https://github.com/rizal72/true-mem.git"
2988
+ },
2989
+ bugs: {
2990
+ url: "https://github.com/rizal72/true-mem/issues"
2991
+ },
2992
+ homepage: "https://github.com/rizal72/true-mem#readme",
2993
+ files: [
2994
+ "dist/",
2995
+ "README.md",
2996
+ "LICENSE"
2997
+ ],
2998
+ dependencies: {
2999
+ "@opencode-ai/plugin": "^1.2.6",
3000
+ "@opencode-ai/sdk": "^1.2.6",
3001
+ uuid: "^13.0.0"
3002
+ },
3003
+ devDependencies: {
3004
+ "@types/node": "^25.0.0",
3005
+ "@types/uuid": "^10.0.0",
3006
+ "bun-types": "^1.3.0",
3007
+ typescript: "^5.9.3"
3008
+ }
3009
+ };
3010
+
3011
+ // src/index.ts
2875
3012
  var state = {
2876
3013
  initialized: false,
2877
3014
  initPromise: null,
@@ -2879,7 +3016,7 @@ var state = {
2879
3016
  realHooks: null
2880
3017
  };
2881
3018
  var TrueMemory = async (ctx) => {
2882
- console.log("\uD83E\uDDE0 True-Mem: Plugin loading...");
3019
+ console.log(`True-Mem v${package_default.version}: Plugin loading...`);
2883
3020
  state.ctx = ctx;
2884
3021
  state.initPromise = (async () => {
2885
3022
  log("Phase 1: Initializing plugin (lightweight)...");
@@ -1 +1 @@
1
- {"version":3,"file":"classifier.d.ts","sourceRoot":"","sources":["../../src/memory/classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAoCjE,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAsBzF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,GACtB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAiDxD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc/D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG,EAAE,GACb;IAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CA4FhF;AAMD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,WAAW,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA8CpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG,EAAE,EACd,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GACxC;IACD,cAAc,E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AW,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA8CpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG,EAAE,EACd,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GACxC;IACD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAsEA;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,GACX,MAAM,CAWR"}
@@ -19,6 +19,32 @@ export declare const AI_META_TALK_PATTERNS: RegExp[];
19
19
  * Check if text appears to be AI-generated meta-talk
20
20
  */
21
21
  export declare function isAIMetaTalk(text: string): boolean;
22
+ /**
23
+ * Check if text is a question (should NOT be stored as a statement)
24
+ */
25
+ export declare function isQuestion(text: string): boolean;
26
+ /**
27
+ * First Person Recall Patterns
28
+ *
29
+ * These patterns detect when the user is recounting/recalling something
30
+ * (1st person indicative) rather than requesting storage (imperative).
31
+ *
32
+ * "I remember when..." = recounting, NOT storage request
33
+ * "Remember this!" = imperative, storage request
34
+ */
35
+ export declare const FIRST_PERSON_RECALL_PATTERNS: RegExp[];
36
+ /**
37
+ * Remind Recall Patterns
38
+ *
39
+ * These patterns detect when "remind me" is used to request INFORMATION
40
+ * (recall) rather than to store something (imperative).
41
+ *
42
+ * "Remind me how we did this" = asking AI to recall → DON'T store
43
+ * "Remind me to commit" = imperative to store → STORE
44
+ *
45
+ * Key distinction: question word vs. preposition/demonstrative after "remind me"
46
+ */
47
+ export declare const REMIND_RECALL_PATTERNS: RegExp[];
22
48
  export declare const NEGATIVE_PATTERNS: Record<string, RegExp[]>;
23
49
  /**
24
50
  * Check if text matches any negative pattern for the given classification
@@ -1 +1 @@
1
- {"version":3,"file":"negative-patterns.d.ts","sourceRoot":"","sources":["../../src/memory/negative-patterns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAwBzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAGD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAiDtD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAUpF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB1F"}
1
+ {"version":3,"file":"negative-patterns.d.ts","sourceRoot":"","sources":["../../src/memory/negative-patterns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAmCzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAahD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,EA0ChD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,EA+B1C,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CA0DtD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,E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;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;CAyFnC,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;AAMD;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAEtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "true-mem",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Persistent memory plugin for OpenCode with cognitive psychology-based memory management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",