@mingxy/cerebro 1.8.1 → 1.8.2
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/client.ts +2 -0
- package/src/tools.ts +5 -0
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -173,6 +173,7 @@ export class OmemClient {
|
|
|
173
173
|
agentId?: string,
|
|
174
174
|
sessionId?: string,
|
|
175
175
|
visibility?: string,
|
|
176
|
+
category?: string,
|
|
176
177
|
): Promise<MemoryDto | null> {
|
|
177
178
|
const safeContent = sanitizeContent(content, this.getCfg("maxContentChars", 30000));
|
|
178
179
|
return this.post<MemoryDto>("/v1/memories", {
|
|
@@ -183,6 +184,7 @@ export class OmemClient {
|
|
|
183
184
|
agent_id: agentId,
|
|
184
185
|
session_id: sessionId,
|
|
185
186
|
visibility,
|
|
187
|
+
category,
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
190
|
|
package/src/tools.ts
CHANGED
|
@@ -50,6 +50,10 @@ export function buildTools(client: OmemClient, containerTags: string[], context:
|
|
|
50
50
|
.string()
|
|
51
51
|
.optional()
|
|
52
52
|
.describe("Memory visibility: 'global' (default, visible to all agents) or 'private' (only visible to the storing agent). Use 'private' for sensitive data like credentials, personal info, or anything the user wouldn't want shared."),
|
|
53
|
+
category: tool.schema
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Memory category: 'cases' (default, for work/facts/decisions), 'preferences' (likes/dislikes), 'entities' (projects/tools/people), 'events' (milestones), 'profile' (identity traits), 'patterns' (workflows)"),
|
|
53
57
|
},
|
|
54
58
|
async execute(args) {
|
|
55
59
|
const allTags = [...containerTags, ...(args.tags ?? [])];
|
|
@@ -61,6 +65,7 @@ export function buildTools(client: OmemClient, containerTags: string[], context:
|
|
|
61
65
|
context.agentId,
|
|
62
66
|
context.getSessionId(),
|
|
63
67
|
args.visibility,
|
|
68
|
+
args.category,
|
|
64
69
|
);
|
|
65
70
|
if (!result) return JSON.stringify({ ok: false, error: "The omem server may be unavailable." });
|
|
66
71
|
return JSON.stringify({ ok: true, id: result.id, tags: result.tags });
|