feat: Add project lock mechanism for session exclusivity
New MCP tools: - project_lock: Lock a project for exclusive session access - project_unlock: Release a project lock - project_lock_status: Check lock status for project(s) Features: - Automatic lock expiration (default 2h) - Session ownership verification - Force unlock option for emergencies - Lock extension on re-lock by same session Migration 004: project_locks table with expiry tracking Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
23
src/index.ts
23
src/index.ts
@@ -23,6 +23,7 @@ import { taskSimilar, taskContext } from './tools/search.js';
|
||||
import { taskLink, checklistAdd, checklistToggle, taskResolveDuplicate } from './tools/relations.js';
|
||||
import { epicAdd, epicList, epicShow, epicAssign, epicClose } from './tools/epics.js';
|
||||
import { taskDelegations, taskDelegationQuery } from './tools/delegations.js';
|
||||
import { projectLock, projectUnlock, projectLockStatus } from './tools/locks.js';
|
||||
|
||||
// Create MCP server
|
||||
const server = new Server(
|
||||
@@ -163,6 +164,28 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
});
|
||||
break;
|
||||
|
||||
// Project Locks
|
||||
case 'project_lock':
|
||||
result = await projectLock({
|
||||
project: a.project,
|
||||
session_id: a.session_id,
|
||||
duration_minutes: a.duration_minutes,
|
||||
reason: a.reason,
|
||||
});
|
||||
break;
|
||||
case 'project_unlock':
|
||||
result = await projectUnlock({
|
||||
project: a.project,
|
||||
session_id: a.session_id,
|
||||
force: a.force,
|
||||
});
|
||||
break;
|
||||
case 'project_lock_status':
|
||||
result = await projectLockStatus({
|
||||
project: a.project,
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error(`Unknown tool: ${name}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user