agent-ecosystem/src/renderer/components/team/provisioningSteps.ts
iliya 6d441efa97 refactor: enhance team provisioning process and UI updates
- Updated provisioning states to include 'configuring', 'assembling', and 'finalizing' for better tracking of team setup progress.
- Refactored the provisioning progress block to utilize a new display step system, improving clarity in the UI.
- Adjusted the README to include a comprehensive table of contents and updated comparison metrics for multi-agent orchestration tools.
- Enhanced team management UI to reflect new provisioning states and improve user experience during team setup.
2026-03-21 16:47:20 +02:00

32 lines
929 B
TypeScript

import type { TeamProvisioningState } from '@shared/types/team';
/** Display steps for the provisioning stepper (0-indexed). */
export const DISPLAY_STEPS = [
{ key: 'starting', label: 'Starting' },
{ key: 'configuring', label: 'Team setup' },
{ key: 'assembling', label: 'Members joining' },
{ key: 'finalizing', label: 'Finalizing' },
] as const;
/**
* Maps a backend provisioning state to a 0-based display step index.
* Returns DISPLAY_STEPS.length for 'ready' (all steps complete), -1 for terminal/unknown.
*/
export function getDisplayStepIndex(state: Exclude<TeamProvisioningState, 'idle'>): number {
switch (state) {
case 'validating':
case 'spawning':
return 0;
case 'configuring':
return 1;
case 'assembling':
return 2;
case 'finalizing':
case 'verifying':
return 3;
case 'ready':
return DISPLAY_STEPS.length;
default:
return -1;
}
}