cntx-ui 3.0.4 → 3.0.6
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/bin/cntx-ui.js +16 -49
- package/lib/agent-runtime.js +70 -0
- package/lib/api-router.js +1 -136
- package/lib/bundle-manager.js +118 -28
- package/lib/mcp-server.js +0 -146
- package/package.json +1 -1
- package/server.js +85 -373
- package/templates/TOOLS.md +0 -6
- package/templates/agent-config.yaml +0 -5
- package/templates/agent-instructions.md +2 -15
- package/templates/agent-rules/project-specific/architecture.md +0 -1
- package/templates/hidden-files.json +0 -1
- package/web/dist/assets/index-D2RTcdqV.js +1968 -0
- package/web/dist/assets/index-DJi03HLz.css +1 -0
- package/web/dist/index.html +2 -2
- package/templates/activities/README.md +0 -67
- package/templates/activities/activities/create-project-bundles/README.md +0 -84
- package/templates/activities/activities/create-project-bundles/notes.md +0 -98
- package/templates/activities/activities/create-project-bundles/progress.md +0 -63
- package/templates/activities/activities/create-project-bundles/tasks.md +0 -39
- package/templates/activities/activities.json +0 -219
- package/templates/activities/lib/.markdownlint.jsonc +0 -18
- package/templates/activities/lib/create-activity.mdc +0 -63
- package/templates/activities/lib/generate-tasks.mdc +0 -64
- package/templates/activities/lib/process-task-list.mdc +0 -52
- package/templates/agent-rules/capabilities/activities-system.md +0 -147
- package/web/dist/assets/index-4p3KJ0jf.js +0 -2016
- package/web/dist/assets/index-BPIipM25.css +0 -1
package/lib/mcp-server.js
CHANGED
|
@@ -578,36 +578,6 @@ export class MCPServer {
|
|
|
578
578
|
required: ['path', 'content']
|
|
579
579
|
}
|
|
580
580
|
},
|
|
581
|
-
{
|
|
582
|
-
name: 'manage_activities',
|
|
583
|
-
description: 'CRUD operations for project activities',
|
|
584
|
-
inputSchema: {
|
|
585
|
-
type: 'object',
|
|
586
|
-
properties: {
|
|
587
|
-
action: {
|
|
588
|
-
type: 'string',
|
|
589
|
-
enum: ['list', 'get', 'create', 'update', 'delete'],
|
|
590
|
-
description: 'Action to perform on activities'
|
|
591
|
-
},
|
|
592
|
-
activityId: {
|
|
593
|
-
type: 'string',
|
|
594
|
-
description: 'Activity ID (required for get, update, delete)'
|
|
595
|
-
},
|
|
596
|
-
activity: {
|
|
597
|
-
type: 'object',
|
|
598
|
-
description: 'Activity data (required for create, update)',
|
|
599
|
-
properties: {
|
|
600
|
-
title: { type: 'string' },
|
|
601
|
-
description: { type: 'string' },
|
|
602
|
-
status: { type: 'string', enum: ['todo', 'in_progress', 'completed', 'blocked'] },
|
|
603
|
-
tags: { type: 'array', items: { type: 'string' } },
|
|
604
|
-
tasks: { type: 'array', items: { type: 'object' } }
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
required: ['action']
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
581
|
];
|
|
612
582
|
|
|
613
583
|
return this.createSuccessResponse(id, { tools });
|
|
@@ -676,9 +646,6 @@ export class MCPServer {
|
|
|
676
646
|
case 'write_file':
|
|
677
647
|
return this.toolWriteFile(args, id);
|
|
678
648
|
|
|
679
|
-
case 'manage_activities':
|
|
680
|
-
return this.toolManageActivities(args, id);
|
|
681
|
-
|
|
682
649
|
default:
|
|
683
650
|
return this.createErrorResponse(id, -32602, 'Unknown tool');
|
|
684
651
|
}
|
|
@@ -1369,119 +1336,6 @@ ${Array.from(this.cntxServer.bundles.entries()).map(([name, bundle]) =>
|
|
|
1369
1336
|
}
|
|
1370
1337
|
}
|
|
1371
1338
|
|
|
1372
|
-
async toolManageActivities(args, id) {
|
|
1373
|
-
const { action, activityId, activity } = args;
|
|
1374
|
-
|
|
1375
|
-
if (!action) {
|
|
1376
|
-
return this.createErrorResponse(id, -32602, 'Action is required');
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
try {
|
|
1380
|
-
const activitiesPath = join(this.cntxServer.CWD, '.cntx', 'activities');
|
|
1381
|
-
const activitiesJsonPath = join(activitiesPath, 'activities.json');
|
|
1382
|
-
|
|
1383
|
-
let activities = [];
|
|
1384
|
-
if (existsSync(activitiesJsonPath)) {
|
|
1385
|
-
activities = JSON.parse(readFileSync(activitiesJsonPath, 'utf8'));
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
let result;
|
|
1389
|
-
|
|
1390
|
-
switch (action) {
|
|
1391
|
-
case 'list':
|
|
1392
|
-
result = { activities: activities.map(a => ({
|
|
1393
|
-
id: a.title.toLowerCase().replace(/[^a-z0-9]/g, '-'),
|
|
1394
|
-
title: a.title,
|
|
1395
|
-
description: a.description,
|
|
1396
|
-
status: a.status,
|
|
1397
|
-
tags: a.tags
|
|
1398
|
-
})) };
|
|
1399
|
-
break;
|
|
1400
|
-
|
|
1401
|
-
case 'get':
|
|
1402
|
-
if (!activityId) {
|
|
1403
|
-
return this.createErrorResponse(id, -32602, 'Activity ID is required for get action');
|
|
1404
|
-
}
|
|
1405
|
-
const found = activities.find(a =>
|
|
1406
|
-
a.title.toLowerCase().replace(/[^a-z0-9]/g, '-') === activityId
|
|
1407
|
-
);
|
|
1408
|
-
if (!found) {
|
|
1409
|
-
return this.createErrorResponse(id, -32602, `Activity not found: ${activityId}`);
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
// Load markdown files
|
|
1413
|
-
const activityDir = join(activitiesPath, 'activities', activityId);
|
|
1414
|
-
const files = {};
|
|
1415
|
-
['README.md', 'progress.md', 'tasks.md', 'notes.md'].forEach(file => {
|
|
1416
|
-
const filePath = join(activityDir, file);
|
|
1417
|
-
files[file.replace('.md', '')] = existsSync(filePath)
|
|
1418
|
-
? readFileSync(filePath, 'utf8')
|
|
1419
|
-
: 'No content available';
|
|
1420
|
-
});
|
|
1421
|
-
|
|
1422
|
-
result = { ...found, files };
|
|
1423
|
-
break;
|
|
1424
|
-
|
|
1425
|
-
case 'create':
|
|
1426
|
-
if (!activity || !activity.title) {
|
|
1427
|
-
return this.createErrorResponse(id, -32602, 'Activity with title is required for create action');
|
|
1428
|
-
}
|
|
1429
|
-
activities.push({
|
|
1430
|
-
title: activity.title,
|
|
1431
|
-
description: activity.description || '',
|
|
1432
|
-
status: activity.status || 'todo',
|
|
1433
|
-
tags: activity.tags || ['general'],
|
|
1434
|
-
tasks: activity.tasks || []
|
|
1435
|
-
});
|
|
1436
|
-
writeFileSync(activitiesJsonPath, JSON.stringify(activities, null, 2));
|
|
1437
|
-
result = { created: true, activityId: activity.title.toLowerCase().replace(/[^a-z0-9]/g, '-') };
|
|
1438
|
-
break;
|
|
1439
|
-
|
|
1440
|
-
case 'update':
|
|
1441
|
-
if (!activityId || !activity) {
|
|
1442
|
-
return this.createErrorResponse(id, -32602, 'Activity ID and activity data are required for update action');
|
|
1443
|
-
}
|
|
1444
|
-
const updateIndex = activities.findIndex(a =>
|
|
1445
|
-
a.title.toLowerCase().replace(/[^a-z0-9]/g, '-') === activityId
|
|
1446
|
-
);
|
|
1447
|
-
if (updateIndex === -1) {
|
|
1448
|
-
return this.createErrorResponse(id, -32602, `Activity not found: ${activityId}`);
|
|
1449
|
-
}
|
|
1450
|
-
activities[updateIndex] = { ...activities[updateIndex], ...activity };
|
|
1451
|
-
writeFileSync(activitiesJsonPath, JSON.stringify(activities, null, 2));
|
|
1452
|
-
result = { updated: true };
|
|
1453
|
-
break;
|
|
1454
|
-
|
|
1455
|
-
case 'delete':
|
|
1456
|
-
if (!activityId) {
|
|
1457
|
-
return this.createErrorResponse(id, -32602, 'Activity ID is required for delete action');
|
|
1458
|
-
}
|
|
1459
|
-
const deleteIndex = activities.findIndex(a =>
|
|
1460
|
-
a.title.toLowerCase().replace(/[^a-z0-9]/g, '-') === activityId
|
|
1461
|
-
);
|
|
1462
|
-
if (deleteIndex === -1) {
|
|
1463
|
-
return this.createErrorResponse(id, -32602, `Activity not found: ${activityId}`);
|
|
1464
|
-
}
|
|
1465
|
-
activities.splice(deleteIndex, 1);
|
|
1466
|
-
writeFileSync(activitiesJsonPath, JSON.stringify(activities, null, 2));
|
|
1467
|
-
result = { deleted: true };
|
|
1468
|
-
break;
|
|
1469
|
-
|
|
1470
|
-
default:
|
|
1471
|
-
return this.createErrorResponse(id, -32602, `Unknown action: ${action}`);
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
return this.createSuccessResponse(id, {
|
|
1475
|
-
content: [{
|
|
1476
|
-
type: 'text',
|
|
1477
|
-
text: JSON.stringify(result, null, 2)
|
|
1478
|
-
}]
|
|
1479
|
-
});
|
|
1480
|
-
} catch (error) {
|
|
1481
|
-
return this.createErrorResponse(id, -32603, 'Failed to manage activities', error.message);
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
1339
|
// Helper methods
|
|
1486
1340
|
getMimeType(filePath) {
|
|
1487
1341
|
const ext = filePath.split('.').pop()?.toLowerCase();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cntx-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.6",
|
|
5
5
|
"description": "Autonomous Repository Intelligence engine with web UI and MCP server. Unified semantic code understanding, local RAG, and agent working memory.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"repository-intelligence",
|