mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
feat: subagent phase 2 implementation
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Box } from 'ink';
|
||||
import { RadioButtonSelect } from '../shared/RadioButtonSelect.js';
|
||||
import { WizardStepProps } from './types.js';
|
||||
|
||||
interface GenerationOption {
|
||||
label: string;
|
||||
value: 'qwen' | 'manual';
|
||||
}
|
||||
|
||||
const generationOptions: GenerationOption[] = [
|
||||
{
|
||||
label: 'Generate with Qwen Code (Recommended)',
|
||||
value: 'qwen',
|
||||
},
|
||||
{
|
||||
label: 'Manual Creation',
|
||||
value: 'manual',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* Step 2: Generation method selection.
|
||||
*/
|
||||
export function GenerationMethodSelector({
|
||||
state,
|
||||
dispatch,
|
||||
onNext,
|
||||
onPrevious: _onPrevious,
|
||||
}: WizardStepProps) {
|
||||
const handleSelect = (selectedValue: string) => {
|
||||
const method = selectedValue as 'qwen' | 'manual';
|
||||
dispatch({ type: 'SET_GENERATION_METHOD', method });
|
||||
onNext();
|
||||
};
|
||||
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
<RadioButtonSelect
|
||||
items={generationOptions.map((option) => ({
|
||||
label: option.label,
|
||||
value: option.value,
|
||||
}))}
|
||||
initialIndex={generationOptions.findIndex(
|
||||
(opt) => opt.value === state.generationMethod,
|
||||
)}
|
||||
onSelect={handleSelect}
|
||||
isFocused={true}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user