@mingxy/cerebro 1.16.9 → 1.17.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 (59) hide show
  1. package/package.json +6 -1
  2. package/src/config.ts +19 -4
  3. package/src/hooks.ts +25 -13
  4. package/src/index.ts +30 -0
  5. package/src/web-server.ts +180 -0
  6. package/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  7. package/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  8. package/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  9. package/web/assets/index-B-0ucKQF.js +119 -0
  10. package/web/assets/index-Dxd5Um3O.css +1 -0
  11. package/web/favicon.svg +1 -0
  12. package/web/icons.svg +24 -0
  13. package/web/index.html +15 -0
  14. package/.omo/evidence/f1-verification.txt +0 -44
  15. package/INJECTION_FLOW.md +0 -434
  16. package/cerebro.example.jsonc +0 -72
  17. package/dist/client.d.ts +0 -165
  18. package/dist/client.d.ts.map +0 -1
  19. package/dist/client.js +0 -222
  20. package/dist/client.js.map +0 -1
  21. package/dist/config.d.ts +0 -46
  22. package/dist/config.d.ts.map +0 -1
  23. package/dist/config.js +0 -201
  24. package/dist/config.js.map +0 -1
  25. package/dist/hooks.d.ts +0 -41
  26. package/dist/hooks.d.ts.map +0 -1
  27. package/dist/hooks.js +0 -1066
  28. package/dist/hooks.js.map +0 -1
  29. package/dist/index.d.ts +0 -11
  30. package/dist/index.d.ts.map +0 -1
  31. package/dist/index.js +0 -118
  32. package/dist/index.js.map +0 -1
  33. package/dist/keywords.d.ts +0 -3
  34. package/dist/keywords.d.ts.map +0 -1
  35. package/dist/keywords.js +0 -21
  36. package/dist/keywords.js.map +0 -1
  37. package/dist/logger.d.ts +0 -5
  38. package/dist/logger.d.ts.map +0 -1
  39. package/dist/logger.js +0 -62
  40. package/dist/logger.js.map +0 -1
  41. package/dist/privacy.d.ts +0 -3
  42. package/dist/privacy.d.ts.map +0 -1
  43. package/dist/privacy.js +0 -10
  44. package/dist/privacy.js.map +0 -1
  45. package/dist/tags.d.ts +0 -3
  46. package/dist/tags.d.ts.map +0 -1
  47. package/dist/tags.js +0 -13
  48. package/dist/tags.js.map +0 -1
  49. package/dist/tools.d.ts +0 -209
  50. package/dist/tools.d.ts.map +0 -1
  51. package/dist/tools.js +0 -344
  52. package/dist/tools.js.map +0 -1
  53. package/dist/tui.d.ts +0 -7
  54. package/dist/tui.d.ts.map +0 -1
  55. package/dist/tui.js +0 -63
  56. package/dist/tui.js.map +0 -1
  57. package/mingxy-omem-0.1.6.tgz +0 -0
  58. package/schema.json +0 -225
  59. package/tsconfig.json +0 -26
package/schema.json DELETED
@@ -1,225 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://www.mengxy.cc/schemas/cerebro-plugin-config.json",
4
- "title": "Cerebro Plugin Configuration",
5
- "description": "Configuration schema for @mingxy/cerebro OpenCode plugin",
6
- "type": "object",
7
- "properties": {
8
- "connection": {
9
- "type": "object",
10
- "description": "API endpoint and authentication for the Cerebro server",
11
- "properties": {
12
- "apiUrl": {
13
- "type": "string",
14
- "format": "uri",
15
- "description": "Cerebro server URL (env: OMEM_API_URL takes priority)",
16
- "default": "https://www.mengxy.cc"
17
- },
18
- "apiKey": {
19
- "type": "string",
20
- "description": "Your tenant API key (env: OMEM_API_KEY takes priority)",
21
- "default": ""
22
- },
23
- "requestTimeoutMs": {
24
- "type": "number",
25
- "description": "HTTP request timeout in milliseconds",
26
- "default": 15000,
27
- "minimum": 1000,
28
- "maximum": 120000
29
- }
30
- },
31
- "additionalProperties": false,
32
- "required": ["apiUrl", "apiKey"]
33
- },
34
- "content": {
35
- "type": "object",
36
- "description": "Limits for content processing and ingestion",
37
- "properties": {
38
- "maxQueryLength": {
39
- "type": "number",
40
- "description": "Max characters for recall queries",
41
- "default": 200,
42
- "minimum": 50,
43
- "maximum": 1000
44
- },
45
- "maxContentChars": {
46
- "type": "number",
47
- "description": "Max content chars sent to the server per ingestion",
48
- "default": 30000,
49
- "minimum": 1000,
50
- "maximum": 100000
51
- },
52
- "maxContentLength": {
53
- "type": "number",
54
- "description": "Max single content item length for auto-capture",
55
- "default": 500,
56
- "minimum": 100,
57
- "maximum": 5000
58
- }
59
- },
60
- "additionalProperties": false
61
- },
62
- "ingest": {
63
- "type": "object",
64
- "description": "Controls how memories are captured and stored",
65
- "properties": {
66
- "autoCaptureThreshold": {
67
- "type": "number",
68
- "description": "Minimum number of messages before auto-capture triggers",
69
- "default": 5,
70
- "minimum": 1,
71
- "maximum": 100
72
- },
73
- "ingestMode": {
74
- "type": "string",
75
- "description": "Ingestion mode: smart = LLM-powered extraction, raw = store as-is",
76
- "enum": ["smart", "raw"],
77
- "default": "smart"
78
- }
79
- },
80
- "additionalProperties": false
81
- },
82
- "recall": {
83
- "type": "object",
84
- "description": "Tuning for memory retrieval relevance",
85
- "properties": {
86
- "similarityThreshold": {
87
- "type": "number",
88
- "description": "Minimum cosine similarity to include a result (0.0-1.0)",
89
- "default": 0.4,
90
- "minimum": 0.0,
91
- "maximum": 1.0
92
- },
93
- "maxRecallResults": {
94
- "type": "number",
95
- "description": "Maximum number of memories returned per recall",
96
- "default": 10,
97
- "minimum": 1,
98
- "maximum": 50
99
- },
100
- "fetchMultiplier": {
101
- "type": "number",
102
- "description": "Search breadth multiplier: fetch_limit = max_results * N",
103
- "default": 3,
104
- "minimum": 1,
105
- "maximum": 10
106
- },
107
- "topkCapMultiplier": {
108
- "type": "number",
109
- "description": "Candidate cap multiplier: topk_cap = max_results * N",
110
- "default": 2,
111
- "minimum": 1,
112
- "maximum": 10
113
- },
114
- "mmrJaccardThreshold": {
115
- "type": "number",
116
- "description": "Jaccard similarity threshold for MMR diversity penalty",
117
- "default": 0.85,
118
- "minimum": 0.0,
119
- "maximum": 1.0
120
- },
121
- "mmrPenaltyFactor": {
122
- "type": "number",
123
- "description": "Score penalty factor for similar memories in MMR diversity",
124
- "default": 0.5,
125
- "minimum": 0.0,
126
- "maximum": 1.0
127
- },
128
- "phase2Multiplier": {
129
- "type": "number",
130
- "description": "Phase2 global fallback search multiplier",
131
- "default": 2,
132
- "minimum": 1,
133
- "maximum": 10
134
- },
135
- "llmMaxEval": {
136
- "type": "number",
137
- "description": "Maximum candidates sent to LLM for relevance evaluation",
138
- "default": 15,
139
- "minimum": 1,
140
- "maximum": 50
141
- },
142
- "refineStrategy": {
143
- "type": "string",
144
- "description": "LLM refinement strategy: strict (high only), balanced (high+medium), loose (keep all)",
145
- "enum": ["strict", "balanced", "loose"],
146
- "default": "balanced"
147
- }
148
- },
149
- "additionalProperties": false
150
- },
151
- "logging": {
152
- "type": "object",
153
- "description": "Diagnostic logging for debugging plugin behavior",
154
- "properties": {
155
- "logEnabled": {
156
- "type": "boolean",
157
- "description": "Enable/disable file logging",
158
- "default": true
159
- },
160
- "logLevel": {
161
- "type": "string",
162
- "description": "Log verbosity",
163
- "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
164
- "default": "INFO"
165
- },
166
- "logDir": {
167
- "type": "string",
168
- "description": "Directory for log files",
169
- "default": "~/.config/cerebro"
170
- }
171
- },
172
- "additionalProperties": false
173
- },
174
- "ui": {
175
- "type": "object",
176
- "description": "Terminal UI behavior tuning",
177
- "properties": {
178
- "toastDelayMs": {
179
- "type": "number",
180
- "description": "Delay in ms before toast notifications auto-dismiss",
181
- "default": 7000,
182
- "minimum": 1000,
183
- "maximum": 30000
184
- }
185
- },
186
- "additionalProperties": false
187
- },
188
- "agentMemoryPolicy": {
189
- "type": "object",
190
- "description": "Control which sub-agents can read/write memories",
191
- "additionalProperties": {
192
- "type": "string",
193
- "enum": ["none", "readonly", "readwrite"],
194
- "description": "Policy for this agent name"
195
- },
196
- "examples": [
197
- {
198
- "explore": "readonly",
199
- "librarian": "readonly"
200
- }
201
- ]
202
- },
203
- "defaultPolicy": {
204
- "type": "string",
205
- "description": "Default policy for agents not listed in agentMemoryPolicy",
206
- "enum": ["none", "readonly", "readwrite"],
207
- "default": "readwrite"
208
- },
209
- "profile": {
210
- "type": "object",
211
- "description": "Profile injection configuration",
212
- "properties": {
213
- "ttlMs": {
214
- "type": "number",
215
- "description": "Profile injection TTL (milliseconds). Within TTL, profile injection is skipped but context injection proceeds normally",
216
- "default": 300000,
217
- "minimum": 0,
218
- "maximum": 3600000
219
- }
220
- },
221
- "additionalProperties": false
222
- }
223
- },
224
- "additionalProperties": false
225
- }
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "strict": true,
7
- "esModuleInterop": true,
8
- "skipLibCheck": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "outDir": "dist",
11
- "rootDir": "src",
12
- "declaration": true,
13
- "declarationMap": true,
14
- "sourceMap": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "resolveJsonModule": true,
19
- "isolatedModules": true,
20
- "jsx": "react-jsx",
21
- "jsxImportSource": "@opentui/solid",
22
- "types": ["node"]
23
- },
24
- "include": ["src/**/*.ts", "src/**/*.tsx"],
25
- "exclude": ["node_modules", "dist"]
26
- }