@hasna/mementos 0.4.1 → 0.4.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/dist/cli/index.js +9 -0
- package/dist/db/agents.d.ts +3 -0
- package/dist/db/agents.d.ts.map +1 -1
- package/dist/db/database.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/mcp/index.js +448 -47
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +70 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2400,6 +2400,11 @@ var init_database = __esm(() => {
|
|
|
2400
2400
|
CREATE INDEX IF NOT EXISTS idx_entity_memories_memory ON entity_memories(memory_id);
|
|
2401
2401
|
|
|
2402
2402
|
INSERT OR IGNORE INTO _migrations (id) VALUES (5);
|
|
2403
|
+
`,
|
|
2404
|
+
`
|
|
2405
|
+
ALTER TABLE agents ADD COLUMN active_project_id TEXT REFERENCES projects(id) ON DELETE SET NULL;
|
|
2406
|
+
CREATE INDEX IF NOT EXISTS idx_agents_active_project ON agents(active_project_id);
|
|
2407
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (6);
|
|
2403
2408
|
`
|
|
2404
2409
|
];
|
|
2405
2410
|
});
|
|
@@ -2469,6 +2474,7 @@ function parseAgentRow(row) {
|
|
|
2469
2474
|
description: row["description"] || null,
|
|
2470
2475
|
role: row["role"] || null,
|
|
2471
2476
|
metadata: JSON.parse(row["metadata"] || "{}"),
|
|
2477
|
+
active_project_id: row["active_project_id"] || null,
|
|
2472
2478
|
created_at: row["created_at"],
|
|
2473
2479
|
last_seen_at: row["last_seen_at"]
|
|
2474
2480
|
};
|
|
@@ -2545,6 +2551,9 @@ function updateAgent(id, updates, db) {
|
|
|
2545
2551
|
if (updates.metadata !== undefined) {
|
|
2546
2552
|
d.run("UPDATE agents SET metadata = ? WHERE id = ?", [JSON.stringify(updates.metadata), agent.id]);
|
|
2547
2553
|
}
|
|
2554
|
+
if ("active_project_id" in updates) {
|
|
2555
|
+
d.run("UPDATE agents SET active_project_id = ? WHERE id = ?", [updates.active_project_id ?? null, agent.id]);
|
|
2556
|
+
}
|
|
2548
2557
|
d.run("UPDATE agents SET last_seen_at = ? WHERE id = ?", [timestamp, agent.id]);
|
|
2549
2558
|
return getAgent(agent.id, d);
|
|
2550
2559
|
}
|
package/dist/db/agents.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import type { Agent } from "../types/index.js";
|
|
|
3
3
|
export declare function registerAgent(name: string, description?: string, role?: string, db?: Database): Agent;
|
|
4
4
|
export declare function getAgent(idOrName: string, db?: Database): Agent | null;
|
|
5
5
|
export declare function listAgents(db?: Database): Agent[];
|
|
6
|
+
export declare function touchAgent(idOrName: string, db?: Database): void;
|
|
7
|
+
export declare function listAgentsByProject(projectId: string, db?: Database): Agent[];
|
|
6
8
|
export declare function updateAgent(id: string, updates: {
|
|
7
9
|
name?: string;
|
|
8
10
|
description?: string;
|
|
9
11
|
role?: string;
|
|
10
12
|
metadata?: Record<string, unknown>;
|
|
13
|
+
active_project_id?: string | null;
|
|
11
14
|
}, db?: Database): Agent | null;
|
|
12
15
|
//# sourceMappingURL=agents.d.ts.map
|
package/dist/db/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/db/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/db/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAgB/C,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,EAAE,CAAC,EAAE,QAAQ,GACZ,KAAK,CAsCP;AAED,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,EAChB,EAAE,CAAC,EAAE,QAAQ,GACZ,KAAK,GAAG,IAAI,CAsBd;AAED,wBAAgB,UAAU,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,CAMjD;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAKhE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,CAM7E;AAED,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACtI,EAAE,CAAC,EAAE,QAAQ,GACZ,KAAK,GAAG,IAAI,CAyCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmCtC,wBAAgB,SAAS,IAAI,MAAM,CAkBlC;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmCtC,wBAAgB,SAAS,IAAI,MAAM,CAkBlC;AAyOD,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAerD;AA+BD,wBAAgB,aAAa,IAAI,IAAI,CAKpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAef"}
|
package/dist/index.js
CHANGED
|
@@ -296,6 +296,11 @@ var MIGRATIONS = [
|
|
|
296
296
|
CREATE INDEX IF NOT EXISTS idx_entity_memories_memory ON entity_memories(memory_id);
|
|
297
297
|
|
|
298
298
|
INSERT OR IGNORE INTO _migrations (id) VALUES (5);
|
|
299
|
+
`,
|
|
300
|
+
`
|
|
301
|
+
ALTER TABLE agents ADD COLUMN active_project_id TEXT REFERENCES projects(id) ON DELETE SET NULL;
|
|
302
|
+
CREATE INDEX IF NOT EXISTS idx_agents_active_project ON agents(active_project_id);
|
|
303
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (6);
|
|
299
304
|
`
|
|
300
305
|
];
|
|
301
306
|
var _db = null;
|
|
@@ -401,6 +406,7 @@ function parseAgentRow(row) {
|
|
|
401
406
|
description: row["description"] || null,
|
|
402
407
|
role: row["role"] || null,
|
|
403
408
|
metadata: JSON.parse(row["metadata"] || "{}"),
|
|
409
|
+
active_project_id: row["active_project_id"] || null,
|
|
404
410
|
created_at: row["created_at"],
|
|
405
411
|
last_seen_at: row["last_seen_at"]
|
|
406
412
|
};
|
|
@@ -477,6 +483,9 @@ function updateAgent(id, updates, db) {
|
|
|
477
483
|
if (updates.metadata !== undefined) {
|
|
478
484
|
d.run("UPDATE agents SET metadata = ? WHERE id = ?", [JSON.stringify(updates.metadata), agent.id]);
|
|
479
485
|
}
|
|
486
|
+
if ("active_project_id" in updates) {
|
|
487
|
+
d.run("UPDATE agents SET active_project_id = ? WHERE id = ?", [updates.active_project_id ?? null, agent.id]);
|
|
488
|
+
}
|
|
480
489
|
d.run("UPDATE agents SET last_seen_at = ? WHERE id = ?", [timestamp, agent.id]);
|
|
481
490
|
return getAgent(agent.id, d);
|
|
482
491
|
}
|
package/dist/mcp/index.js
CHANGED
|
@@ -4278,6 +4278,11 @@ var MIGRATIONS = [
|
|
|
4278
4278
|
CREATE INDEX IF NOT EXISTS idx_entity_memories_memory ON entity_memories(memory_id);
|
|
4279
4279
|
|
|
4280
4280
|
INSERT OR IGNORE INTO _migrations (id) VALUES (5);
|
|
4281
|
+
`,
|
|
4282
|
+
`
|
|
4283
|
+
ALTER TABLE agents ADD COLUMN active_project_id TEXT REFERENCES projects(id) ON DELETE SET NULL;
|
|
4284
|
+
CREATE INDEX IF NOT EXISTS idx_agents_active_project ON agents(active_project_id);
|
|
4285
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (6);
|
|
4281
4286
|
`
|
|
4282
4287
|
];
|
|
4283
4288
|
var _db = null;
|
|
@@ -4367,6 +4372,7 @@ function parseAgentRow(row) {
|
|
|
4367
4372
|
description: row["description"] || null,
|
|
4368
4373
|
role: row["role"] || null,
|
|
4369
4374
|
metadata: JSON.parse(row["metadata"] || "{}"),
|
|
4375
|
+
active_project_id: row["active_project_id"] || null,
|
|
4370
4376
|
created_at: row["created_at"],
|
|
4371
4377
|
last_seen_at: row["last_seen_at"]
|
|
4372
4378
|
};
|
|
@@ -4418,6 +4424,18 @@ function listAgents(db) {
|
|
|
4418
4424
|
const rows = d.query("SELECT * FROM agents ORDER BY last_seen_at DESC").all();
|
|
4419
4425
|
return rows.map(parseAgentRow);
|
|
4420
4426
|
}
|
|
4427
|
+
function touchAgent(idOrName, db) {
|
|
4428
|
+
const d = db || getDatabase();
|
|
4429
|
+
const agent = getAgent(idOrName, d);
|
|
4430
|
+
if (!agent)
|
|
4431
|
+
return;
|
|
4432
|
+
d.run("UPDATE agents SET last_seen_at = ? WHERE id = ?", [now(), agent.id]);
|
|
4433
|
+
}
|
|
4434
|
+
function listAgentsByProject(projectId, db) {
|
|
4435
|
+
const d = db || getDatabase();
|
|
4436
|
+
const rows = d.query("SELECT * FROM agents WHERE active_project_id = ? ORDER BY last_seen_at DESC").all(projectId);
|
|
4437
|
+
return rows.map(parseAgentRow);
|
|
4438
|
+
}
|
|
4421
4439
|
function updateAgent(id, updates, db) {
|
|
4422
4440
|
const d = db || getDatabase();
|
|
4423
4441
|
const agent = getAgent(id, d);
|
|
@@ -4443,6 +4461,9 @@ function updateAgent(id, updates, db) {
|
|
|
4443
4461
|
if (updates.metadata !== undefined) {
|
|
4444
4462
|
d.run("UPDATE agents SET metadata = ? WHERE id = ?", [JSON.stringify(updates.metadata), agent.id]);
|
|
4445
4463
|
}
|
|
4464
|
+
if ("active_project_id" in updates) {
|
|
4465
|
+
d.run("UPDATE agents SET active_project_id = ? WHERE id = ?", [updates.active_project_id ?? null, agent.id]);
|
|
4466
|
+
}
|
|
4446
4467
|
d.run("UPDATE agents SET last_seen_at = ? WHERE id = ?", [timestamp, agent.id]);
|
|
4447
4468
|
return getAgent(agent.id, d);
|
|
4448
4469
|
}
|
|
@@ -6059,6 +6080,8 @@ server.tool("memory_save", "Save/upsert a memory. scope: global=all agents, shar
|
|
|
6059
6080
|
input.ttl_ms = parseDuration(args.ttl_ms);
|
|
6060
6081
|
}
|
|
6061
6082
|
const memory = createMemory(input);
|
|
6083
|
+
if (args.agent_id)
|
|
6084
|
+
touchAgent(args.agent_id);
|
|
6062
6085
|
return { content: [{ type: "text", text: `Saved: ${memory.key} (${memory.id.slice(0, 8)})` }] };
|
|
6063
6086
|
} catch (e) {
|
|
6064
6087
|
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
@@ -6076,6 +6099,8 @@ server.tool("memory_recall", "Recall a memory by key. Returns the best matching
|
|
|
6076
6099
|
const memory = getMemoryByKey(args.key, args.scope, args.agent_id, args.project_id, args.session_id);
|
|
6077
6100
|
if (memory) {
|
|
6078
6101
|
touchMemory(memory.id);
|
|
6102
|
+
if (args.agent_id)
|
|
6103
|
+
touchAgent(args.agent_id);
|
|
6079
6104
|
return { content: [{ type: "text", text: formatMemory(memory) }] };
|
|
6080
6105
|
}
|
|
6081
6106
|
const results = searchMemories(args.key, {
|
|
@@ -6424,7 +6449,7 @@ server.tool("list_agents", "List all registered agents", {}, async () => {
|
|
|
6424
6449
|
if (agents.length === 0) {
|
|
6425
6450
|
return { content: [{ type: "text", text: "No agents registered." }] };
|
|
6426
6451
|
}
|
|
6427
|
-
const lines = agents.map((a) => `${a.id} | ${a.name} | ${a.role || "agent"} | last seen: ${a.last_seen_at}`);
|
|
6452
|
+
const lines = agents.map((a) => `${a.id} | ${a.name} | ${a.role || "agent"} | project: ${a.active_project_id || "-"} | last seen: ${a.last_seen_at}`);
|
|
6428
6453
|
return { content: [{ type: "text", text: `${agents.length} agent(s):
|
|
6429
6454
|
${lines.join(`
|
|
6430
6455
|
`)}` }] };
|
|
@@ -6456,12 +6481,13 @@ Last seen: ${agent.last_seen_at}`
|
|
|
6456
6481
|
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
6457
6482
|
}
|
|
6458
6483
|
});
|
|
6459
|
-
server.tool("update_agent", "Update agent name, description, role, or
|
|
6484
|
+
server.tool("update_agent", "Update agent name, description, role, metadata, or active_project_id.", {
|
|
6460
6485
|
id: exports_external.string(),
|
|
6461
6486
|
name: exports_external.string().optional(),
|
|
6462
6487
|
description: exports_external.string().optional(),
|
|
6463
6488
|
role: exports_external.string().optional(),
|
|
6464
|
-
metadata: exports_external.record(exports_external.unknown()).optional()
|
|
6489
|
+
metadata: exports_external.record(exports_external.unknown()).optional(),
|
|
6490
|
+
active_project_id: exports_external.string().nullable().optional()
|
|
6465
6491
|
}, async (args) => {
|
|
6466
6492
|
try {
|
|
6467
6493
|
const { id, ...updates } = args;
|
|
@@ -6477,7 +6503,7 @@ ID: ${agent.id}
|
|
|
6477
6503
|
Name: ${agent.name}
|
|
6478
6504
|
Description: ${agent.description || "-"}
|
|
6479
6505
|
Role: ${agent.role || "agent"}
|
|
6480
|
-
|
|
6506
|
+
Active project: ${agent.active_project_id || "-"}
|
|
6481
6507
|
Last seen: ${agent.last_seen_at}`
|
|
6482
6508
|
}]
|
|
6483
6509
|
};
|
|
@@ -6485,6 +6511,22 @@ Last seen: ${agent.last_seen_at}`
|
|
|
6485
6511
|
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
6486
6512
|
}
|
|
6487
6513
|
});
|
|
6514
|
+
server.tool("list_agents_by_project", "List agents currently active on a project.", {
|
|
6515
|
+
project_id: exports_external.string()
|
|
6516
|
+
}, async (args) => {
|
|
6517
|
+
try {
|
|
6518
|
+
const agents = listAgentsByProject(args.project_id);
|
|
6519
|
+
if (agents.length === 0) {
|
|
6520
|
+
return { content: [{ type: "text", text: `No active agents for project: ${args.project_id}` }] };
|
|
6521
|
+
}
|
|
6522
|
+
const lines = agents.map((a) => `${a.id} | ${a.name} | ${a.role || "agent"} | last seen: ${a.last_seen_at}`);
|
|
6523
|
+
return { content: [{ type: "text", text: `${agents.length} agent(s) on project ${args.project_id}:
|
|
6524
|
+
${lines.join(`
|
|
6525
|
+
`)}` }] };
|
|
6526
|
+
} catch (e) {
|
|
6527
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
6528
|
+
}
|
|
6529
|
+
});
|
|
6488
6530
|
server.tool("register_project", "Register a project for memory scoping", {
|
|
6489
6531
|
name: exports_external.string(),
|
|
6490
6532
|
path: exports_external.string(),
|
|
@@ -6824,42 +6866,379 @@ server.tool("graph_stats", "Get entity and relation counts by type.", {}, async
|
|
|
6824
6866
|
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
6825
6867
|
}
|
|
6826
6868
|
});
|
|
6827
|
-
var
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6869
|
+
var FULL_SCHEMAS = {
|
|
6870
|
+
memory_save: {
|
|
6871
|
+
description: "Save/upsert a memory. Creates new or merges with existing key.",
|
|
6872
|
+
category: "memory",
|
|
6873
|
+
params: {
|
|
6874
|
+
key: { type: "string", description: "Unique key for the memory (kebab-case recommended)", required: true },
|
|
6875
|
+
value: { type: "string", description: "The memory content", required: true },
|
|
6876
|
+
scope: { type: "string", description: "Visibility: global=all agents, shared=project, private=single agent", enum: ["global", "shared", "private"] },
|
|
6877
|
+
category: { type: "string", description: "Memory type", enum: ["preference", "fact", "knowledge", "history"] },
|
|
6878
|
+
importance: { type: "number", description: "Priority 1-10 (10=critical)" },
|
|
6879
|
+
tags: { type: "array", description: "Searchable tags", items: { type: "string" } },
|
|
6880
|
+
summary: { type: "string", description: "Short summary for display" },
|
|
6881
|
+
agent_id: { type: "string", description: "Agent UUID to scope this memory to" },
|
|
6882
|
+
project_id: { type: "string", description: "Project UUID to scope this memory to" },
|
|
6883
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
6884
|
+
ttl_ms: { type: "string|number", description: "Time-to-live e.g. '7d', '2h', or ms integer" },
|
|
6885
|
+
source: { type: "string", description: "Origin of the memory", enum: ["user", "agent", "system", "auto", "imported"] },
|
|
6886
|
+
metadata: { type: "object", description: "Arbitrary JSON metadata" }
|
|
6887
|
+
},
|
|
6888
|
+
example: '{"key":"preferred-language","value":"TypeScript","scope":"global","importance":8,"tags":["language","preference"]}'
|
|
6889
|
+
},
|
|
6890
|
+
memory_recall: {
|
|
6891
|
+
description: "Recall a memory by exact key. Falls back to fuzzy search if no exact match.",
|
|
6892
|
+
category: "memory",
|
|
6893
|
+
params: {
|
|
6894
|
+
key: { type: "string", description: "Key to look up", required: true },
|
|
6895
|
+
scope: { type: "string", description: "Scope filter", enum: ["global", "shared", "private"] },
|
|
6896
|
+
agent_id: { type: "string", description: "Agent UUID filter" },
|
|
6897
|
+
project_id: { type: "string", description: "Project UUID filter" },
|
|
6898
|
+
session_id: { type: "string", description: "Session UUID filter" }
|
|
6899
|
+
},
|
|
6900
|
+
example: '{"key":"preferred-language","scope":"global"}'
|
|
6901
|
+
},
|
|
6902
|
+
memory_list: {
|
|
6903
|
+
description: "List memories with optional filters. Returns compact lines by default.",
|
|
6904
|
+
category: "memory",
|
|
6905
|
+
params: {
|
|
6906
|
+
scope: { type: "string", description: "Scope filter", enum: ["global", "shared", "private"] },
|
|
6907
|
+
category: { type: "string", description: "Category filter", enum: ["preference", "fact", "knowledge", "history"] },
|
|
6908
|
+
tags: { type: "array", description: "Filter by tags (AND logic)", items: { type: "string" } },
|
|
6909
|
+
min_importance: { type: "number", description: "Minimum importance threshold" },
|
|
6910
|
+
pinned: { type: "boolean", description: "Filter to pinned memories only" },
|
|
6911
|
+
agent_id: { type: "string", description: "Agent UUID filter" },
|
|
6912
|
+
project_id: { type: "string", description: "Project UUID filter" },
|
|
6913
|
+
session_id: { type: "string", description: "Session UUID filter" },
|
|
6914
|
+
status: { type: "string", description: "Memory status filter", enum: ["active", "archived", "expired"] },
|
|
6915
|
+
limit: { type: "number", description: "Max results (default 50)" },
|
|
6916
|
+
offset: { type: "number", description: "Pagination offset" },
|
|
6917
|
+
full: { type: "boolean", description: "Return full JSON objects instead of compact lines" },
|
|
6918
|
+
fields: { type: "array", description: "Fields to include in full mode", items: { type: "string" } }
|
|
6919
|
+
},
|
|
6920
|
+
example: '{"scope":"global","min_importance":7,"limit":20}'
|
|
6921
|
+
},
|
|
6922
|
+
memory_update: {
|
|
6923
|
+
description: "Update a memory's fields. Requires current version for optimistic concurrency.",
|
|
6924
|
+
category: "memory",
|
|
6925
|
+
params: {
|
|
6926
|
+
id: { type: "string", description: "Memory ID (partial OK)", required: true },
|
|
6927
|
+
version: { type: "number", description: "Current version (for conflict detection)", required: true },
|
|
6928
|
+
value: { type: "string", description: "New value" },
|
|
6929
|
+
category: { type: "string", description: "New category", enum: ["preference", "fact", "knowledge", "history"] },
|
|
6930
|
+
scope: { type: "string", description: "New scope", enum: ["global", "shared", "private"] },
|
|
6931
|
+
importance: { type: "number", description: "New importance 1-10" },
|
|
6932
|
+
tags: { type: "array", description: "New tags (replaces all)", items: { type: "string" } },
|
|
6933
|
+
summary: { type: "string", description: "New summary (null to clear)" },
|
|
6934
|
+
pinned: { type: "boolean", description: "Pin/unpin the memory" },
|
|
6935
|
+
status: { type: "string", description: "New status", enum: ["active", "archived", "expired"] },
|
|
6936
|
+
metadata: { type: "object", description: "New metadata (replaces existing)" },
|
|
6937
|
+
expires_at: { type: "string", description: "New expiry ISO timestamp (null to clear)" }
|
|
6938
|
+
},
|
|
6939
|
+
example: '{"id":"abc123","version":1,"importance":9,"tags":["correction","important"]}'
|
|
6940
|
+
},
|
|
6941
|
+
memory_forget: {
|
|
6942
|
+
description: "Delete a memory by ID or key.",
|
|
6943
|
+
category: "memory",
|
|
6944
|
+
params: {
|
|
6945
|
+
id: { type: "string", description: "Memory ID (partial OK)" },
|
|
6946
|
+
key: { type: "string", description: "Memory key" },
|
|
6947
|
+
scope: { type: "string", description: "Scope for key lookup", enum: ["global", "shared", "private"] },
|
|
6948
|
+
agent_id: { type: "string", description: "Agent UUID for key lookup" },
|
|
6949
|
+
project_id: { type: "string", description: "Project UUID for key lookup" }
|
|
6950
|
+
},
|
|
6951
|
+
example: '{"key":"old-preference","scope":"global"}'
|
|
6952
|
+
},
|
|
6953
|
+
memory_search: {
|
|
6954
|
+
description: "Full-text search across key, value, summary, and tags.",
|
|
6955
|
+
category: "memory",
|
|
6956
|
+
params: {
|
|
6957
|
+
query: { type: "string", description: "Search query", required: true },
|
|
6958
|
+
scope: { type: "string", description: "Scope filter", enum: ["global", "shared", "private"] },
|
|
6959
|
+
category: { type: "string", description: "Category filter", enum: ["preference", "fact", "knowledge", "history"] },
|
|
6960
|
+
tags: { type: "array", description: "Tag filter", items: { type: "string" } },
|
|
6961
|
+
agent_id: { type: "string", description: "Agent UUID filter" },
|
|
6962
|
+
project_id: { type: "string", description: "Project UUID filter" },
|
|
6963
|
+
limit: { type: "number", description: "Max results (default 20)" }
|
|
6964
|
+
},
|
|
6965
|
+
example: '{"query":"typescript","scope":"global","limit":10}'
|
|
6966
|
+
},
|
|
6967
|
+
memory_stats: {
|
|
6968
|
+
description: "Aggregate statistics: total, by scope, by category, pinned, expired counts.",
|
|
6969
|
+
category: "memory",
|
|
6970
|
+
params: {},
|
|
6971
|
+
example: "{}"
|
|
6972
|
+
},
|
|
6973
|
+
memory_export: {
|
|
6974
|
+
description: "Export memories as a JSON array.",
|
|
6975
|
+
category: "memory",
|
|
6976
|
+
params: {
|
|
6977
|
+
scope: { type: "string", description: "Scope filter", enum: ["global", "shared", "private"] },
|
|
6978
|
+
category: { type: "string", description: "Category filter", enum: ["preference", "fact", "knowledge", "history"] },
|
|
6979
|
+
agent_id: { type: "string", description: "Agent UUID filter" },
|
|
6980
|
+
project_id: { type: "string", description: "Project UUID filter" }
|
|
6981
|
+
},
|
|
6982
|
+
example: '{"scope":"global"}'
|
|
6983
|
+
},
|
|
6984
|
+
memory_import: {
|
|
6985
|
+
description: "Import memories from a JSON array. Merges by key by default.",
|
|
6986
|
+
category: "memory",
|
|
6987
|
+
params: {
|
|
6988
|
+
memories: { type: "array", description: "Array of memory objects with key+value (required), plus optional fields", required: true, items: { type: "object" } },
|
|
6989
|
+
overwrite: { type: "boolean", description: "false=create-only (skip existing keys), default=merge" }
|
|
6990
|
+
},
|
|
6991
|
+
example: '{"memories":[{"key":"foo","value":"bar","scope":"global","importance":7}]}'
|
|
6992
|
+
},
|
|
6993
|
+
memory_inject: {
|
|
6994
|
+
description: "Get formatted memory context for system prompt injection. Respects token budget.",
|
|
6995
|
+
category: "memory",
|
|
6996
|
+
params: {
|
|
6997
|
+
agent_id: { type: "string", description: "Agent UUID to include private memories" },
|
|
6998
|
+
project_id: { type: "string", description: "Project UUID to include shared memories" },
|
|
6999
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
7000
|
+
max_tokens: { type: "number", description: "Approximate token budget (default 500)" },
|
|
7001
|
+
categories: { type: "array", description: "Categories to include (default: preference, fact, knowledge)", items: { type: "string", enum: ["preference", "fact", "knowledge", "history"] } },
|
|
7002
|
+
min_importance: { type: "number", description: "Minimum importance (default 3)" },
|
|
7003
|
+
raw: { type: "boolean", description: "true=plain lines only, false=wrapped in <agent-memories> tags" }
|
|
7004
|
+
},
|
|
7005
|
+
example: '{"project_id":"proj-uuid","max_tokens":300,"min_importance":5}'
|
|
7006
|
+
},
|
|
7007
|
+
memory_context: {
|
|
7008
|
+
description: "Get active memories for the current context (agent/project/scope).",
|
|
7009
|
+
category: "memory",
|
|
7010
|
+
params: {
|
|
7011
|
+
agent_id: { type: "string", description: "Agent UUID filter" },
|
|
7012
|
+
project_id: { type: "string", description: "Project UUID filter" },
|
|
7013
|
+
scope: { type: "string", description: "Scope filter", enum: ["global", "shared", "private"] },
|
|
7014
|
+
limit: { type: "number", description: "Max results (default 30)" }
|
|
7015
|
+
},
|
|
7016
|
+
example: '{"project_id":"proj-uuid","scope":"shared","limit":20}'
|
|
7017
|
+
},
|
|
7018
|
+
register_agent: {
|
|
7019
|
+
description: "Register an agent. Idempotent \u2014 same name returns existing agent.",
|
|
7020
|
+
category: "agent",
|
|
7021
|
+
params: {
|
|
7022
|
+
name: { type: "string", description: "Agent name (e.g. 'maximus', 'cassius')", required: true },
|
|
7023
|
+
description: { type: "string", description: "Agent description" },
|
|
7024
|
+
role: { type: "string", description: "Agent role (default: 'agent')" }
|
|
7025
|
+
},
|
|
7026
|
+
example: '{"name":"maximus","role":"developer"}'
|
|
7027
|
+
},
|
|
7028
|
+
list_agents: {
|
|
7029
|
+
description: "List all registered agents with IDs, names, roles, and last-seen timestamps.",
|
|
7030
|
+
category: "agent",
|
|
7031
|
+
params: {},
|
|
7032
|
+
example: "{}"
|
|
7033
|
+
},
|
|
7034
|
+
get_agent: {
|
|
7035
|
+
description: "Get agent details by UUID or name.",
|
|
7036
|
+
category: "agent",
|
|
7037
|
+
params: {
|
|
7038
|
+
id: { type: "string", description: "Agent UUID or name", required: true }
|
|
7039
|
+
},
|
|
7040
|
+
example: '{"id":"maximus"}'
|
|
7041
|
+
},
|
|
7042
|
+
update_agent: {
|
|
7043
|
+
description: "Update agent name, description, role, metadata, or active_project_id. Call on session start to bind agent to current project.",
|
|
7044
|
+
category: "agent",
|
|
7045
|
+
params: {
|
|
7046
|
+
id: { type: "string", description: "Agent UUID or name", required: true },
|
|
7047
|
+
name: { type: "string", description: "New name" },
|
|
7048
|
+
description: { type: "string", description: "New description" },
|
|
7049
|
+
role: { type: "string", description: "New role" },
|
|
7050
|
+
metadata: { type: "object", description: "New metadata" },
|
|
7051
|
+
active_project_id: { type: "string", description: "Project ID this agent is currently working on (null to clear)" }
|
|
7052
|
+
},
|
|
7053
|
+
example: '{"id":"galba","active_project_id":"80a0be92-e0cc-4710-bce4-fb8a2e78e69e"}'
|
|
7054
|
+
},
|
|
7055
|
+
list_agents_by_project: {
|
|
7056
|
+
description: "List all agents currently active on a specific project.",
|
|
7057
|
+
category: "agent",
|
|
7058
|
+
params: {
|
|
7059
|
+
project_id: { type: "string", description: "Project ID", required: true }
|
|
7060
|
+
},
|
|
7061
|
+
example: '{"project_id":"80a0be92-e0cc-4710-bce4-fb8a2e78e69e"}'
|
|
7062
|
+
},
|
|
7063
|
+
register_project: {
|
|
7064
|
+
description: "Register a project for memory scoping. Idempotent by name.",
|
|
7065
|
+
category: "project",
|
|
7066
|
+
params: {
|
|
7067
|
+
name: { type: "string", description: "Project name (use git repo name)", required: true },
|
|
7068
|
+
path: { type: "string", description: "Absolute path to project root", required: true },
|
|
7069
|
+
description: { type: "string", description: "Project description" },
|
|
7070
|
+
memory_prefix: { type: "string", description: "Key prefix for project memories" }
|
|
7071
|
+
},
|
|
7072
|
+
example: '{"name":"open-mementos","path":"/Users/hasna/Workspace/hasna/opensource/opensourcedev/open-mementos"}'
|
|
7073
|
+
},
|
|
7074
|
+
list_projects: {
|
|
7075
|
+
description: "List all registered projects with IDs, names, and paths.",
|
|
7076
|
+
category: "project",
|
|
7077
|
+
params: {},
|
|
7078
|
+
example: "{}"
|
|
7079
|
+
},
|
|
7080
|
+
bulk_forget: {
|
|
7081
|
+
description: "Delete multiple memories by IDs in one call.",
|
|
7082
|
+
category: "bulk",
|
|
7083
|
+
params: {
|
|
7084
|
+
ids: { type: "array", description: "Array of memory IDs (partials OK)", required: true, items: { type: "string" } }
|
|
7085
|
+
},
|
|
7086
|
+
example: '{"ids":["abc123","def456"]}'
|
|
7087
|
+
},
|
|
7088
|
+
bulk_update: {
|
|
7089
|
+
description: "Apply the same field updates to multiple memories.",
|
|
7090
|
+
category: "bulk",
|
|
7091
|
+
params: {
|
|
7092
|
+
ids: { type: "array", description: "Array of memory IDs (partials OK)", required: true, items: { type: "string" } },
|
|
7093
|
+
importance: { type: "number", description: "New importance 1-10" },
|
|
7094
|
+
tags: { type: "array", description: "New tags (replaces all)", items: { type: "string" } },
|
|
7095
|
+
pinned: { type: "boolean", description: "Pin/unpin" },
|
|
7096
|
+
category: { type: "string", description: "New category", enum: ["preference", "fact", "knowledge", "history"] },
|
|
7097
|
+
status: { type: "string", description: "New status", enum: ["active", "archived", "expired"] }
|
|
7098
|
+
},
|
|
7099
|
+
example: '{"ids":["abc123","def456"],"importance":9,"tags":["important"]}'
|
|
7100
|
+
},
|
|
7101
|
+
clean_expired: {
|
|
7102
|
+
description: "Remove expired memories from the database. Returns count of removed entries.",
|
|
7103
|
+
category: "utility",
|
|
7104
|
+
params: {},
|
|
7105
|
+
example: "{}"
|
|
7106
|
+
},
|
|
7107
|
+
entity_create: {
|
|
7108
|
+
description: "Create a knowledge graph entity.",
|
|
7109
|
+
category: "graph",
|
|
7110
|
+
params: {
|
|
7111
|
+
name: { type: "string", description: "Entity name", required: true },
|
|
7112
|
+
type: { type: "string", description: "Entity type", required: true, enum: ["person", "project", "tool", "concept", "file", "api", "pattern", "organization"] },
|
|
7113
|
+
description: { type: "string", description: "Entity description" },
|
|
7114
|
+
project_id: { type: "string", description: "Project UUID to scope this entity" }
|
|
7115
|
+
},
|
|
7116
|
+
example: '{"name":"TypeScript","type":"tool","description":"Typed superset of JavaScript"}'
|
|
7117
|
+
},
|
|
7118
|
+
entity_get: {
|
|
7119
|
+
description: "Get entity details including relations summary and linked memory count.",
|
|
7120
|
+
category: "graph",
|
|
7121
|
+
params: {
|
|
7122
|
+
name_or_id: { type: "string", description: "Entity name or ID (partial OK)", required: true },
|
|
7123
|
+
type: { type: "string", description: "Type hint for name disambiguation", enum: ["person", "project", "tool", "concept", "file", "api", "pattern", "organization"] }
|
|
7124
|
+
},
|
|
7125
|
+
example: '{"name_or_id":"TypeScript"}'
|
|
7126
|
+
},
|
|
7127
|
+
entity_list: {
|
|
7128
|
+
description: "List entities with optional type, project, and search filters.",
|
|
7129
|
+
category: "graph",
|
|
7130
|
+
params: {
|
|
7131
|
+
type: { type: "string", description: "Type filter", enum: ["person", "project", "tool", "concept", "file", "api", "pattern", "organization"] },
|
|
7132
|
+
project_id: { type: "string", description: "Project UUID filter" },
|
|
7133
|
+
search: { type: "string", description: "Name search string" },
|
|
7134
|
+
limit: { type: "number", description: "Max results (default 50)" }
|
|
7135
|
+
},
|
|
7136
|
+
example: '{"type":"tool","limit":20}'
|
|
7137
|
+
},
|
|
7138
|
+
entity_delete: {
|
|
7139
|
+
description: "Delete an entity and all its relations.",
|
|
7140
|
+
category: "graph",
|
|
7141
|
+
params: {
|
|
7142
|
+
name_or_id: { type: "string", description: "Entity name or ID (partial OK)", required: true }
|
|
7143
|
+
},
|
|
7144
|
+
example: '{"name_or_id":"OldEntity"}'
|
|
7145
|
+
},
|
|
7146
|
+
entity_merge: {
|
|
7147
|
+
description: "Merge source entity into target \u2014 moves all relations and memory links.",
|
|
7148
|
+
category: "graph",
|
|
7149
|
+
params: {
|
|
7150
|
+
source: { type: "string", description: "Source entity name or ID (will be deleted)", required: true },
|
|
7151
|
+
target: { type: "string", description: "Target entity name or ID (will be kept)", required: true }
|
|
7152
|
+
},
|
|
7153
|
+
example: '{"source":"OldName","target":"NewName"}'
|
|
7154
|
+
},
|
|
7155
|
+
entity_link: {
|
|
7156
|
+
description: "Link an entity to a memory with a semantic role.",
|
|
7157
|
+
category: "graph",
|
|
7158
|
+
params: {
|
|
7159
|
+
entity_name_or_id: { type: "string", description: "Entity name or ID", required: true },
|
|
7160
|
+
memory_id: { type: "string", description: "Memory ID (partial OK)", required: true },
|
|
7161
|
+
role: { type: "string", description: "Semantic role (default: context)", enum: ["subject", "object", "context"] }
|
|
7162
|
+
},
|
|
7163
|
+
example: '{"entity_name_or_id":"TypeScript","memory_id":"abc123","role":"subject"}'
|
|
7164
|
+
},
|
|
7165
|
+
relation_create: {
|
|
7166
|
+
description: "Create a typed relation between two entities.",
|
|
7167
|
+
category: "graph",
|
|
7168
|
+
params: {
|
|
7169
|
+
source_entity: { type: "string", description: "Source entity name or ID", required: true },
|
|
7170
|
+
target_entity: { type: "string", description: "Target entity name or ID", required: true },
|
|
7171
|
+
relation_type: { type: "string", description: "Relation type", required: true, enum: ["uses", "knows", "depends_on", "created_by", "related_to", "contradicts", "part_of", "implements"] },
|
|
7172
|
+
weight: { type: "number", description: "Relation weight 0-1 (default 1.0)" }
|
|
7173
|
+
},
|
|
7174
|
+
example: '{"source_entity":"MyApp","target_entity":"TypeScript","relation_type":"uses"}'
|
|
7175
|
+
},
|
|
7176
|
+
relation_list: {
|
|
7177
|
+
description: "List relations for an entity, with optional type and direction filters.",
|
|
7178
|
+
category: "graph",
|
|
7179
|
+
params: {
|
|
7180
|
+
entity_name_or_id: { type: "string", description: "Entity name or ID", required: true },
|
|
7181
|
+
relation_type: { type: "string", description: "Type filter", enum: ["uses", "knows", "depends_on", "created_by", "related_to", "contradicts", "part_of", "implements"] },
|
|
7182
|
+
direction: { type: "string", description: "Direction filter (default: both)", enum: ["outgoing", "incoming", "both"] }
|
|
7183
|
+
},
|
|
7184
|
+
example: '{"entity_name_or_id":"MyApp","direction":"outgoing"}'
|
|
7185
|
+
},
|
|
7186
|
+
relation_delete: {
|
|
7187
|
+
description: "Delete a relation by ID.",
|
|
7188
|
+
category: "graph",
|
|
7189
|
+
params: {
|
|
7190
|
+
id: { type: "string", description: "Relation ID (partial OK)", required: true }
|
|
7191
|
+
},
|
|
7192
|
+
example: '{"id":"rel-abc123"}'
|
|
7193
|
+
},
|
|
7194
|
+
graph_query: {
|
|
7195
|
+
description: "Traverse the knowledge graph from an entity up to N hops. Returns entities and relations.",
|
|
7196
|
+
category: "graph",
|
|
7197
|
+
params: {
|
|
7198
|
+
entity_name_or_id: { type: "string", description: "Starting entity name or ID", required: true },
|
|
7199
|
+
depth: { type: "number", description: "Max traversal depth (default 2)" }
|
|
7200
|
+
},
|
|
7201
|
+
example: '{"entity_name_or_id":"MyApp","depth":3}'
|
|
7202
|
+
},
|
|
7203
|
+
graph_path: {
|
|
7204
|
+
description: "Find the shortest path between two entities in the knowledge graph.",
|
|
7205
|
+
category: "graph",
|
|
7206
|
+
params: {
|
|
7207
|
+
from_entity: { type: "string", description: "Starting entity name or ID", required: true },
|
|
7208
|
+
to_entity: { type: "string", description: "Target entity name or ID", required: true },
|
|
7209
|
+
max_depth: { type: "number", description: "Max search depth (default 5)" }
|
|
7210
|
+
},
|
|
7211
|
+
example: '{"from_entity":"Agent","to_entity":"Database","max_depth":4}'
|
|
7212
|
+
},
|
|
7213
|
+
graph_stats: {
|
|
7214
|
+
description: "Get entity and relation counts broken down by type.",
|
|
7215
|
+
category: "graph",
|
|
7216
|
+
params: {},
|
|
7217
|
+
example: "{}"
|
|
7218
|
+
},
|
|
7219
|
+
search_tools: {
|
|
7220
|
+
description: "Search available tools by name or keyword. Returns matching tool names and categories.",
|
|
7221
|
+
category: "meta",
|
|
7222
|
+
params: {
|
|
7223
|
+
query: { type: "string", description: "Search keyword (matches tool name or description)", required: true },
|
|
7224
|
+
category: { type: "string", description: "Category filter", enum: ["memory", "agent", "project", "bulk", "utility", "graph", "meta"] }
|
|
7225
|
+
},
|
|
7226
|
+
example: '{"query":"memory","category":"memory"}'
|
|
7227
|
+
},
|
|
7228
|
+
describe_tools: {
|
|
7229
|
+
description: "Get full parameter schemas and examples for specific tools. Omit names to list all tools.",
|
|
7230
|
+
category: "meta",
|
|
7231
|
+
params: {
|
|
7232
|
+
names: { type: "array", description: "Tool names to describe (omit for all tools)", items: { type: "string" } }
|
|
7233
|
+
},
|
|
7234
|
+
example: '{"names":["memory_save","memory_recall"]}'
|
|
7235
|
+
}
|
|
7236
|
+
};
|
|
7237
|
+
var TOOL_REGISTRY = Object.entries(FULL_SCHEMAS).map(([name, schema]) => ({
|
|
7238
|
+
name,
|
|
7239
|
+
description: schema.description,
|
|
7240
|
+
category: schema.category
|
|
7241
|
+
}));
|
|
6863
7242
|
server.tool("search_tools", "Search available tools by name or keyword. Returns names only.", {
|
|
6864
7243
|
query: exports_external.string(),
|
|
6865
7244
|
category: exports_external.enum(["memory", "agent", "project", "bulk", "utility", "graph", "meta"]).optional()
|
|
@@ -6868,17 +7247,39 @@ server.tool("search_tools", "Search available tools by name or keyword. Returns
|
|
|
6868
7247
|
const results = TOOL_REGISTRY.filter((t) => (!args.category || t.category === args.category) && (t.name.includes(q) || t.description.toLowerCase().includes(q)));
|
|
6869
7248
|
if (results.length === 0)
|
|
6870
7249
|
return { content: [{ type: "text", text: "No tools found." }] };
|
|
6871
|
-
return { content: [{ type: "text", text: results.map((t) => `${t.name} [${t.category}]`).join(`
|
|
7250
|
+
return { content: [{ type: "text", text: results.map((t) => `${t.name} [${t.category}]: ${t.description}`).join(`
|
|
6872
7251
|
`) }] };
|
|
6873
7252
|
});
|
|
6874
|
-
server.tool("describe_tools", "Get full schemas for
|
|
6875
|
-
names: exports_external.array(exports_external.string())
|
|
7253
|
+
server.tool("describe_tools", "Get full parameter schemas and examples for tools. Omit names to list all tools.", {
|
|
7254
|
+
names: exports_external.array(exports_external.string()).optional()
|
|
6876
7255
|
}, async (args) => {
|
|
6877
|
-
const
|
|
6878
|
-
|
|
7256
|
+
const targets = args.names && args.names.length > 0 ? args.names : Object.keys(FULL_SCHEMAS);
|
|
7257
|
+
const results = targets.filter((name) => (name in FULL_SCHEMAS)).map((name) => {
|
|
7258
|
+
const schema = FULL_SCHEMAS[name];
|
|
7259
|
+
const paramLines = Object.entries(schema.params).map(([pname, p]) => {
|
|
7260
|
+
const req = p.required ? " [required]" : "";
|
|
7261
|
+
const enumStr = p.enum ? ` (${p.enum.join("|")})` : "";
|
|
7262
|
+
return ` ${pname}${req}: ${p.type}${enumStr} \u2014 ${p.description}`;
|
|
7263
|
+
});
|
|
7264
|
+
const lines = [
|
|
7265
|
+
`### ${name} [${schema.category}]`,
|
|
7266
|
+
schema.description
|
|
7267
|
+
];
|
|
7268
|
+
if (paramLines.length > 0) {
|
|
7269
|
+
lines.push("Params:", ...paramLines);
|
|
7270
|
+
} else {
|
|
7271
|
+
lines.push("Params: none");
|
|
7272
|
+
}
|
|
7273
|
+
if (schema.example)
|
|
7274
|
+
lines.push(`Example: ${schema.example}`);
|
|
7275
|
+
return lines.join(`
|
|
7276
|
+
`);
|
|
7277
|
+
});
|
|
7278
|
+
if (results.length === 0) {
|
|
6879
7279
|
return { content: [{ type: "text", text: "No matching tools." }] };
|
|
6880
|
-
|
|
6881
|
-
return { content: [{ type: "text", text:
|
|
7280
|
+
}
|
|
7281
|
+
return { content: [{ type: "text", text: results.join(`
|
|
7282
|
+
|
|
6882
7283
|
`) }] };
|
|
6883
7284
|
});
|
|
6884
7285
|
server.resource("memories", "mementos://memories", { description: "All active memories", mimeType: "application/json" }, async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AA45BH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAoG9C"}
|
package/dist/server/index.js
CHANGED
|
@@ -289,6 +289,11 @@ var MIGRATIONS = [
|
|
|
289
289
|
CREATE INDEX IF NOT EXISTS idx_entity_memories_memory ON entity_memories(memory_id);
|
|
290
290
|
|
|
291
291
|
INSERT OR IGNORE INTO _migrations (id) VALUES (5);
|
|
292
|
+
`,
|
|
293
|
+
`
|
|
294
|
+
ALTER TABLE agents ADD COLUMN active_project_id TEXT REFERENCES projects(id) ON DELETE SET NULL;
|
|
295
|
+
CREATE INDEX IF NOT EXISTS idx_agents_active_project ON agents(active_project_id);
|
|
296
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (6);
|
|
292
297
|
`
|
|
293
298
|
];
|
|
294
299
|
var _db = null;
|
|
@@ -367,6 +372,7 @@ function parseAgentRow(row) {
|
|
|
367
372
|
description: row["description"] || null,
|
|
368
373
|
role: row["role"] || null,
|
|
369
374
|
metadata: JSON.parse(row["metadata"] || "{}"),
|
|
375
|
+
active_project_id: row["active_project_id"] || null,
|
|
370
376
|
created_at: row["created_at"],
|
|
371
377
|
last_seen_at: row["last_seen_at"]
|
|
372
378
|
};
|
|
@@ -418,6 +424,42 @@ function listAgents(db) {
|
|
|
418
424
|
const rows = d.query("SELECT * FROM agents ORDER BY last_seen_at DESC").all();
|
|
419
425
|
return rows.map(parseAgentRow);
|
|
420
426
|
}
|
|
427
|
+
function listAgentsByProject(projectId, db) {
|
|
428
|
+
const d = db || getDatabase();
|
|
429
|
+
const rows = d.query("SELECT * FROM agents WHERE active_project_id = ? ORDER BY last_seen_at DESC").all(projectId);
|
|
430
|
+
return rows.map(parseAgentRow);
|
|
431
|
+
}
|
|
432
|
+
function updateAgent(id, updates, db) {
|
|
433
|
+
const d = db || getDatabase();
|
|
434
|
+
const agent = getAgent(id, d);
|
|
435
|
+
if (!agent)
|
|
436
|
+
return null;
|
|
437
|
+
const timestamp = now();
|
|
438
|
+
if (updates.name) {
|
|
439
|
+
const normalizedNewName = updates.name.trim().toLowerCase();
|
|
440
|
+
if (normalizedNewName !== agent.name) {
|
|
441
|
+
const existing = d.query("SELECT id FROM agents WHERE LOWER(name) = ? AND id != ?").get(normalizedNewName, agent.id);
|
|
442
|
+
if (existing) {
|
|
443
|
+
throw new Error(`Agent name already taken: ${normalizedNewName}`);
|
|
444
|
+
}
|
|
445
|
+
d.run("UPDATE agents SET name = ? WHERE id = ?", [normalizedNewName, agent.id]);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (updates.description !== undefined) {
|
|
449
|
+
d.run("UPDATE agents SET description = ? WHERE id = ?", [updates.description, agent.id]);
|
|
450
|
+
}
|
|
451
|
+
if (updates.role !== undefined) {
|
|
452
|
+
d.run("UPDATE agents SET role = ? WHERE id = ?", [updates.role, agent.id]);
|
|
453
|
+
}
|
|
454
|
+
if (updates.metadata !== undefined) {
|
|
455
|
+
d.run("UPDATE agents SET metadata = ? WHERE id = ?", [JSON.stringify(updates.metadata), agent.id]);
|
|
456
|
+
}
|
|
457
|
+
if ("active_project_id" in updates) {
|
|
458
|
+
d.run("UPDATE agents SET active_project_id = ? WHERE id = ?", [updates.active_project_id ?? null, agent.id]);
|
|
459
|
+
}
|
|
460
|
+
d.run("UPDATE agents SET last_seen_at = ? WHERE id = ?", [timestamp, agent.id]);
|
|
461
|
+
return getAgent(agent.id, d);
|
|
462
|
+
}
|
|
421
463
|
|
|
422
464
|
// src/db/projects.ts
|
|
423
465
|
function parseProjectRow(row) {
|
|
@@ -2198,8 +2240,9 @@ addRoute("DELETE", "/api/memories/:id", (_req, _url, params) => {
|
|
|
2198
2240
|
}
|
|
2199
2241
|
return json({ deleted: true });
|
|
2200
2242
|
});
|
|
2201
|
-
addRoute("GET", "/api/agents", () => {
|
|
2202
|
-
const
|
|
2243
|
+
addRoute("GET", "/api/agents", (_req, url) => {
|
|
2244
|
+
const q = getSearchParams(url);
|
|
2245
|
+
const agents = q["project_id"] ? listAgentsByProject(q["project_id"]) : listAgents();
|
|
2203
2246
|
return json({ agents, count: agents.length });
|
|
2204
2247
|
});
|
|
2205
2248
|
addRoute("POST", "/api/agents", async (req) => {
|
|
@@ -2217,6 +2260,31 @@ addRoute("GET", "/api/agents/:id", (_req, _url, params) => {
|
|
|
2217
2260
|
}
|
|
2218
2261
|
return json(agent);
|
|
2219
2262
|
});
|
|
2263
|
+
addRoute("PATCH", "/api/agents/:id", async (req, _url, params) => {
|
|
2264
|
+
const body = await readJson(req);
|
|
2265
|
+
if (!body) {
|
|
2266
|
+
return errorResponse("Invalid JSON body", 400);
|
|
2267
|
+
}
|
|
2268
|
+
const updates = {};
|
|
2269
|
+
if (body["name"] !== undefined)
|
|
2270
|
+
updates.name = body["name"];
|
|
2271
|
+
if (body["description"] !== undefined)
|
|
2272
|
+
updates.description = body["description"];
|
|
2273
|
+
if (body["role"] !== undefined)
|
|
2274
|
+
updates.role = body["role"];
|
|
2275
|
+
if (body["metadata"] !== undefined)
|
|
2276
|
+
updates.metadata = body["metadata"];
|
|
2277
|
+
if ("active_project_id" in body)
|
|
2278
|
+
updates.active_project_id = body["active_project_id"] ?? null;
|
|
2279
|
+
try {
|
|
2280
|
+
const agent = updateAgent(params["id"], updates);
|
|
2281
|
+
if (!agent)
|
|
2282
|
+
return errorResponse("Agent not found", 404);
|
|
2283
|
+
return json(agent);
|
|
2284
|
+
} catch (e) {
|
|
2285
|
+
return errorResponse(e instanceof Error ? e.message : "Update failed", 400);
|
|
2286
|
+
}
|
|
2287
|
+
});
|
|
2220
2288
|
addRoute("GET", "/api/projects", () => {
|
|
2221
2289
|
const projects = listProjects();
|
|
2222
2290
|
return json({ projects, count: projects.length });
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAM1D,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;AAM7E,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAM7E,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAM7D,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC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