feat: subagent feature wip

This commit is contained in:
tanzhenxin 2025-09-10 13:41:28 +08:00
parent 549f296eb5
commit 6b09aee32b
30 changed files with 329 additions and 239 deletions

View file

@ -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>
);
}