@mingxy/cerebro 1.12.0 → 1.12.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Cerebro persistent memory plugin for OpenCode — auto-recall, auto-capture, 9 memory tools with clustering",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/hooks.ts CHANGED
@@ -323,7 +323,7 @@ export function autoRecallHook(client: CerebroClient, containerTags: string[], t
323
323
  if (policy === "none") return;
324
324
 
325
325
  try {
326
- logDebug("autoRecallHook start", { sessionId: input.sessionID, agentId, policy });
326
+ logDebug("autoRecallHook start", { sessionId: input.sessionID, agentId, policy, similarityThreshold, maxRecallResults, fetchMultiplier, topkCapMultiplier, mmrJaccardThreshold, mmrPenaltyFactor, phase2Multiplier, llmMaxEval, refineStrategy, refineMediumChars });
327
327
  const messages = sessionMessages.get(input.sessionID) ?? [];
328
328
  const userMessages = messages.filter((m) => m.role === "user");
329
329
 
@@ -379,13 +379,13 @@ export function autoRecallHook(client: CerebroClient, containerTags: string[], t
379
379
  let profileCountText = "";
380
380
  let profileBlock = "";
381
381
  const lastInjected = profileInjectedSessions.get(input.sessionID);
382
- const ttlExpired = !lastInjected || (Date.now() - lastInjected > 5 * 60 * 1000);
382
+ const ttlExpired = !lastInjected || (Date.now() - lastInjected > 30 * 60 * 1000);
383
383
  const isFirstInjection = !lastInjected;
384
384
  if (profile && ttlExpired) {
385
385
  const prefs = ((profile as any)?.static_facts ?? [])
386
386
  .filter((sf: any) => {
387
387
  const t: string[] = sf.tags ?? [];
388
- return t.includes("preferences") || t.includes("preference_extract") || t.some((tag: string) => tag.includes("偏好"));
388
+ return t.includes("preferences");
389
389
  })
390
390
  .map((sf: any) => sf.l2_content ?? sf.content ?? "")
391
391
  .filter(Boolean);
package/src/tools.ts CHANGED
@@ -52,17 +52,17 @@ export function buildTools(client: CerebroClient, containerTags: string[], conte
52
52
  "Do NOT overuse 'private' for normal work notes — default 'global' is correct for most cases."
53
53
  ),
54
54
  category: tool.schema
55
- .string()
55
+ .enum(["cases", "preferences", "entities", "events", "profile", "patterns"])
56
56
  .optional()
57
57
  .describe(
58
- "MUST be one of (choose the BEST fit): " +
59
- "'cases' (default) = work records, bug fixes, architecture decisions, implementation notes, meeting conclusions; " +
60
- "'preferences' = user likes/dislikes, coding style preferences, tool choices (e.g. 'prefers Vim over VSCode'); " +
61
- "'entities' = projects, tools, people, concepts — defining what something IS (e.g. 'omem-server: Rust memory backend using LanceDB'); " +
58
+ "Memory category. MUST be one of these exact values (lowercase): " +
59
+ "'cases' (default) = work records, bug fixes, architecture decisions; " +
60
+ "'preferences' = user likes/dislikes, coding style, tool choices; " +
61
+ "'entities' = projects, tools, people, concepts; " +
62
62
  "'events' = time-bound milestones (deployments, releases, incidents); " +
63
63
  "'profile' = user identity traits (role, skills, team membership); " +
64
- "'patterns' = workflows, methodologies, best practices, recurring solutions. " +
65
- "When in doubt, use 'cases'."
64
+ "'patterns' = workflows, methodologies, best practices. " +
65
+ "When in doubt, omit this field (defaults to 'cases')."
66
66
  ),
67
67
  },
68
68
  async execute(args) {