diff --git a/src/cli/primitives/AgentPrimitive.tsx b/src/cli/primitives/AgentPrimitive.tsx index dd751454..0845c622 100644 --- a/src/cli/primitives/AgentPrimitive.tsx +++ b/src/cli/primitives/AgentPrimitive.tsx @@ -340,6 +340,7 @@ export class AgentPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/primitives/CredentialPrimitive.tsx b/src/cli/primitives/CredentialPrimitive.tsx index be78f708..48f51845 100644 --- a/src/cli/primitives/CredentialPrimitive.tsx +++ b/src/cli/primitives/CredentialPrimitive.tsx @@ -347,6 +347,7 @@ export class CredentialPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/primitives/EvaluatorPrimitive.ts b/src/cli/primitives/EvaluatorPrimitive.ts index ffd2a440..444e918c 100644 --- a/src/cli/primitives/EvaluatorPrimitive.ts +++ b/src/cli/primitives/EvaluatorPrimitive.ts @@ -324,6 +324,7 @@ export class EvaluatorPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/primitives/MemoryPrimitive.tsx b/src/cli/primitives/MemoryPrimitive.tsx index c808bbac..6a92c7bb 100644 --- a/src/cli/primitives/MemoryPrimitive.tsx +++ b/src/cli/primitives/MemoryPrimitive.tsx @@ -238,6 +238,7 @@ export class MemoryPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/primitives/OnlineEvalConfigPrimitive.ts b/src/cli/primitives/OnlineEvalConfigPrimitive.ts index 03687047..95878025 100644 --- a/src/cli/primitives/OnlineEvalConfigPrimitive.ts +++ b/src/cli/primitives/OnlineEvalConfigPrimitive.ts @@ -179,6 +179,7 @@ export class OnlineEvalConfigPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/primitives/PolicyPrimitive.ts b/src/cli/primitives/PolicyPrimitive.ts index 34465eb5..174c9267 100644 --- a/src/cli/primitives/PolicyPrimitive.ts +++ b/src/cli/primitives/PolicyPrimitive.ts @@ -351,6 +351,7 @@ export class PolicyPrimitive extends BasePrimitive { clear(); unmount(); diff --git a/src/cli/tui/screens/add/AddFlow.tsx b/src/cli/tui/screens/add/AddFlow.tsx index 85da20b0..491d1a72 100644 --- a/src/cli/tui/screens/add/AddFlow.tsx +++ b/src/cli/tui/screens/add/AddFlow.tsx @@ -157,12 +157,37 @@ interface AddFlowProps { onDev?: () => void; /** Called when user selects deploy from success screen */ onDeploy?: () => void; + /** Skip the selection screen and go directly to a specific resource wizard */ + initialResource?: AddResourceType; +} + +function getInitialFlowState(resource?: AddResourceType): FlowState { + switch (resource) { + case 'agent': + return { name: 'agent-wizard' }; + case 'gateway': + return { name: 'gateway-wizard' }; + case 'gateway-target': + return { name: 'tool-wizard' }; + case 'memory': + return { name: 'memory-wizard' }; + case 'credential': + return { name: 'identity-wizard' }; + case 'evaluator': + return { name: 'evaluator-wizard' }; + case 'online-eval': + return { name: 'online-eval-wizard' }; + case 'policy': + return { name: 'policy-wizard' }; + default: + return { name: 'select' }; + } } export function AddFlow(props: AddFlowProps) { const { addAgent, reset: resetAgent } = useAddAgent(); const { agents, refresh: refreshAgents } = useAvailableAgents(); - const [flow, setFlow] = useState({ name: 'select' }); + const [flow, setFlow] = useState(() => getInitialFlowState(props.initialResource)); // In non-interactive mode, exit after success (but not while loading) useEffect(() => {