feat(agents): role orchestrateur du contexte global expose et configurable par agent — isOrchestrator distinct des permissions MCP, DTO update_project_orchestrator (terminologie wire legacy conservee), refus idea_context_update explicite avec writer effectif + orientation idea_context_propose, surface AgentsPanel + adaptateurs frontend — #276 (QA verte: cargo fmt/check, tests cibles application/app-tauri/infrastructure/backend, npm typecheck, 69/69 tests frontend agents/adapters)
This commit is contained in:
@ -130,6 +130,8 @@ export interface AgentsViewModel {
|
||||
agentId: string,
|
||||
effort: EffortSelection | null,
|
||||
) => Promise<void>;
|
||||
/** Selects this agent as the single writer of the global project context. */
|
||||
updateProjectOrchestrator: (agentId: string) => Promise<void>;
|
||||
/** Deletes an agent; deselects if it was selected. */
|
||||
deleteAgent: (agentId: string) => Promise<void>;
|
||||
/**
|
||||
@ -453,6 +455,23 @@ export function useAgents(projectId: string): AgentsViewModel {
|
||||
[agent, projectId],
|
||||
);
|
||||
|
||||
const updateProjectOrchestrator = useCallback(
|
||||
async (agentId: string): Promise<void> => {
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
await agent.updateProjectOrchestrator(projectId, agentId);
|
||||
const refreshed = await agent.listAgents(projectId);
|
||||
setAgents(refreshed);
|
||||
} catch (e) {
|
||||
setError(describe(e));
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
},
|
||||
[agent, projectId],
|
||||
);
|
||||
|
||||
const deleteAgent = useCallback(
|
||||
async (agentId: string) => {
|
||||
setBusy(true);
|
||||
@ -571,6 +590,7 @@ export function useAgents(projectId: string): AgentsViewModel {
|
||||
saveContext,
|
||||
changeAgentProfile,
|
||||
updateAgentEffort,
|
||||
updateProjectOrchestrator,
|
||||
deleteAgent,
|
||||
launchAgent,
|
||||
stopAgent,
|
||||
|
||||
Reference in New Issue
Block a user