@mingxy/cerebro 1.6.9 → 1.7.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/package.json +1 -1
- package/src/index.ts +1 -16
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -116,25 +116,10 @@ const OmemPlugin: Plugin = async (input) => {
|
|
|
116
116
|
config: async (cfg: any) => {
|
|
117
117
|
cfg.command ??= {};
|
|
118
118
|
cfg.command["memory-toggle"] = {
|
|
119
|
-
template: "
|
|
119
|
+
template: "Use the memory_toggle tool with state='$ARGUMENTS' to toggle Cerebro auto-store for this session. You MUST call the memory_toggle tool, do not just acknowledge.",
|
|
120
120
|
description: "Toggle Cerebro auto-store ON or OFF for current session",
|
|
121
121
|
};
|
|
122
122
|
},
|
|
123
|
-
"command.execute.before": async (input: { command: string; sessionID: string; arguments: string }, output: { parts: any[] }) => {
|
|
124
|
-
if (input.command !== "memory-toggle") return;
|
|
125
|
-
const arg = input.arguments.trim().toLowerCase();
|
|
126
|
-
const sessionId = input.sessionID;
|
|
127
|
-
if (arg === "off") {
|
|
128
|
-
setAutoStoreEnabled(sessionId, false);
|
|
129
|
-
output.parts = [{ type: "text", text: "⏸️ Cerebro auto-store: OFF — manual memory_store still works" }];
|
|
130
|
-
} else if (arg === "on") {
|
|
131
|
-
setAutoStoreEnabled(sessionId, true);
|
|
132
|
-
output.parts = [{ type: "text", text: "✅ Cerebro auto-store: ON" }];
|
|
133
|
-
} else {
|
|
134
|
-
const current = isAutoStoreEnabled(sessionId);
|
|
135
|
-
output.parts = [{ type: "text", text: `Cerebro auto-store: ${current ? "✅ ON" : "⏸️ OFF"}\nUsage: /memory-toggle on | off` }];
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
123
|
"experimental.chat.system.transform": async (input: any, output: any) => {
|
|
139
124
|
if (input.sessionID) currentSessionId = input.sessionID;
|
|
140
125
|
return recallHook(input, output);
|