feat: integrate approved MCP tools and recovery for 1.12

This commit is contained in:
Agent Workbench Dev
2026-10-30 20:34:54 +08:00
parent 601f13c4f8
commit 3f6797b8ee
80 changed files with 5141 additions and 70 deletions
+2
View File
@@ -6,6 +6,7 @@ import { inspectProject } from '../project-inspector.mjs';
import { assertChangeSetsResolved, CHANGE_SET_OPEN } from '../../shared/contracts/change-sets.mjs';
import { assertWorkspacesResolved } from '../../shared/contracts/workspaces.mjs';
import { verifyWorkspaceProject } from './git-workspaces.mjs';
import { assertMcpResolved } from '../tools/mcp-contract.mjs';
const at = () => new Date().toISOString();
const conflict = message => Object.assign(new Error(message), { status: 409 });
@@ -80,6 +81,7 @@ export class ChangeSetManager {
}
save(session, set, phase) { this.store.save(session, { type: 'change_set.' + phase, detail: { changeSetId: set.id } }); }
requireIdle(session, { source = 'user', exceptId = null, includePrepared = false } = {}) {
assertMcpResolved(this.store, session.projectId);
if (this.projectActive(session.projectId) || this.projectBusy(session.projectId, source === 'agent' ? session.id : null)) {
throw conflict('同一项目正在执行任务、检查、提交或文件批次,请等待结束后再操作。');
}
+2
View File
@@ -6,6 +6,7 @@ import { inspectProject } from '../project-inspector.mjs';
import { safePath, excludedFromInventory } from '../../server/files.mjs';
import { assertChangeSetsResolved } from '../../shared/contracts/change-sets.mjs';
import { assertWorkspacesResolved, assertWorkspacePath, WORKSPACE_ACTIVE } from '../../shared/contracts/workspaces.mjs';
import { assertMcpResolved } from '../tools/mcp-contract.mjs';
const at = () => new Date().toISOString();
const hash = value => createHash('sha256').update(typeof value === 'string' || Buffer.isBuffer(value) ? value : JSON.stringify(value)).digest('hex');
@@ -120,6 +121,7 @@ export class WorkspaceManager {
}
assertIdle(session, exceptId = null) {
for (const project of this.repositoryProjects(session.projectId)) {
assertMcpResolved(this.store, project.id);
if (this.projectBusy(project.id) || this.projectActive(project.id)) throw conflict('来源或同仓库工作区正在执行任务、检查、提交或工作区操作,请等待结束。');
assertChangeSetsResolved(this.store, project.id, { includePrepared: true });
assertWorkspacesResolved(this.store, project.id, { exceptId });