@grec0/memory-bank-mcp 0.1.19 → 0.1.21
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.
|
@@ -32,8 +32,10 @@ export class AgentBoard {
|
|
|
32
32
|
await this.updateBoard((content) => {
|
|
33
33
|
const requests = this.parseTable(content, 'External Requests');
|
|
34
34
|
const now = new Date().toISOString();
|
|
35
|
+
// Sanitize context to fit in a table cell (no newlines, escape pipes)
|
|
36
|
+
const safeContext = context.replace(/[\r\n]+/g, '<br/>').replace(/\|/g, '\\|');
|
|
35
37
|
// Columns: ID, Title, From Project, Context, Status, Received At
|
|
36
|
-
requests.push([taskId, title, fromProject,
|
|
38
|
+
requests.push([taskId, title, fromProject, safeContext, 'PENDING', now]);
|
|
37
39
|
return this.updateTable(content, 'External Requests', ['ID', 'Title', 'From Project', 'Context', 'Status', 'Received At'], requests);
|
|
38
40
|
});
|
|
39
41
|
await this.logMessage('SYSTEM', `Received external prompt from project ${fromProject}: ${title}`);
|
|
@@ -247,8 +249,14 @@ export class AgentBoard {
|
|
|
247
249
|
const cols = line.split('|').map(c => c.trim()).filter(c => c !== '');
|
|
248
250
|
if (cols.length > 0) {
|
|
249
251
|
// Check if it's the header row
|
|
250
|
-
if (result.length === 0
|
|
251
|
-
|
|
252
|
+
if (result.length === 0) {
|
|
253
|
+
const firstCol = cols[0].toLowerCase();
|
|
254
|
+
if (firstCol.includes('agent id') || firstCol.includes('file pattern') || firstCol === 'id') {
|
|
255
|
+
// skip header
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
result.push(cols);
|
|
259
|
+
}
|
|
252
260
|
}
|
|
253
261
|
else {
|
|
254
262
|
result.push(cols);
|
package/dist/common/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Version of the MCP Kanban server
|
|
2
|
-
export const VERSION = "0.1.
|
|
2
|
+
export const VERSION = "0.1.21";
|
|
@@ -9,6 +9,27 @@ import { RegistryManager } from "../common/registryManager.js";
|
|
|
9
9
|
* Document templates for initialization
|
|
10
10
|
*/
|
|
11
11
|
const DOCUMENT_TEMPLATES = {
|
|
12
|
+
agentBoard: () => `# Multi-Agent Board
|
|
13
|
+
|
|
14
|
+
## Active Agents
|
|
15
|
+
| Agent ID | Status | Current Focus | Session ID | Last Heartbeat |
|
|
16
|
+
|---|---|---|---|---|
|
|
17
|
+
|
|
18
|
+
## Pending Tasks
|
|
19
|
+
| ID | Title | Assigned To | From | Status | Created At |
|
|
20
|
+
|---|---|---|---|---|---|
|
|
21
|
+
|
|
22
|
+
## External Requests
|
|
23
|
+
| ID | Title | From Project | Context | Status | Received At |
|
|
24
|
+
|---|---|---|---|---|---|
|
|
25
|
+
|
|
26
|
+
## File Locks
|
|
27
|
+
| File Pattern | Claimed By | Since |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
|
|
30
|
+
## Agent Messages
|
|
31
|
+
- [System]: Board initialized
|
|
32
|
+
`,
|
|
12
33
|
projectBrief: (projectName, description, date) => `# Project Brief
|
|
13
34
|
|
|
14
35
|
## Project Overview
|
|
@@ -315,6 +336,7 @@ export async function initializeMemoryBank(params, storagePath = ".memorybank")
|
|
|
315
336
|
"activeContext.md": DOCUMENT_TEMPLATES.activeContext(name, date),
|
|
316
337
|
"progress.md": DOCUMENT_TEMPLATES.progress(name, date),
|
|
317
338
|
"decisionLog.md": DOCUMENT_TEMPLATES.decisionLog(name, date),
|
|
339
|
+
"agentBoard.md": DOCUMENT_TEMPLATES.agentBoard(),
|
|
318
340
|
};
|
|
319
341
|
for (const [filename, content] of Object.entries(documents)) {
|
|
320
342
|
const filePath = path.join(docsPath, filename);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentBoard } from '../common/agentBoard.js';
|
|
2
|
+
import { RegistryManager } from '../common/registryManager.js';
|
|
2
3
|
import * as crypto from 'crypto';
|
|
3
4
|
const WORKSPACE_ROOT = process.cwd(); // Will be overridden by actual workspace logic if passed
|
|
4
5
|
export async function manageAgentsTool(params, workspaceRoot = WORKSPACE_ROOT) {
|
|
@@ -10,9 +11,20 @@ export async function manageAgentsTool(params, workspaceRoot = WORKSPACE_ROOT) {
|
|
|
10
11
|
if (!agentId)
|
|
11
12
|
throw new Error('agentId is required for register');
|
|
12
13
|
// Auto-generate session ID if not provided.
|
|
13
|
-
// This abstracts the session management from the agent.
|
|
14
14
|
const effectiveSessionId = sessionId || crypto.randomUUID();
|
|
15
|
+
// 1. Register agent on local board
|
|
15
16
|
await board.registerAgent(agentId, effectiveSessionId);
|
|
17
|
+
// 2. Ensure project is registered in Global Registry
|
|
18
|
+
try {
|
|
19
|
+
const registry = new RegistryManager();
|
|
20
|
+
// We try to infer keywords or description, but for now we keep it simple.
|
|
21
|
+
// If the project is already registered, this updates the "lastActive" timestamp.
|
|
22
|
+
await registry.registerProject(projectId, workspaceRoot, `Auto-registered via Agent ${agentId}`, ['auto-discovered']);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
console.error(`Failed to auto-register project in global registry: ${err}`);
|
|
26
|
+
// We don't fail the agent registration if global registry fails (e.g. permission issues)
|
|
27
|
+
}
|
|
16
28
|
return {
|
|
17
29
|
success: true,
|
|
18
30
|
message: `Agent ${agentId} registered`,
|