feat(04-03): add PM and Engineer template selector to NewAgentDialog
- Add AGENT_TEMPLATES const with Project Manager (role:pm) and Engineer options - Add template selector section between Ask PM button and advanced config link - handleTemplateSelect navigates to /agents/new pre-filled with template values - No hire language present in dialog - [nexus] marked all new/changed lines
This commit is contained in:
parent
1827c2bf79
commit
ffc68ebbf2
1 changed files with 30 additions and 0 deletions
|
|
@ -93,6 +93,12 @@ const ADVANCED_ADAPTER_OPTIONS: Array<{
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// [nexus] Predefined agent templates for quick agent creation
|
||||||
|
const AGENT_TEMPLATES = [
|
||||||
|
{ id: "pm", label: "Project Manager", role: "pm" as const, adapterType: "claude_local" as const },
|
||||||
|
{ id: "engineer", label: "Engineer", role: "engineer" as const, adapterType: "claude_local" as const },
|
||||||
|
];
|
||||||
|
|
||||||
export function NewAgentDialog() {
|
export function NewAgentDialog() {
|
||||||
const { newAgentOpen, closeNewAgent, openNewIssue } = useDialog();
|
const { newAgentOpen, closeNewAgent, openNewIssue } = useDialog();
|
||||||
const { selectedCompanyId } = useCompany();
|
const { selectedCompanyId } = useCompany();
|
||||||
|
|
@ -126,6 +132,15 @@ export function NewAgentDialog() {
|
||||||
navigate(`/agents/new?adapterType=${encodeURIComponent(adapterType)}`);
|
navigate(`/agents/new?adapterType=${encodeURIComponent(adapterType)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [nexus] Handle template selection — navigates to creation form pre-filled with template values
|
||||||
|
function handleTemplateSelect(template: typeof AGENT_TEMPLATES[number]) {
|
||||||
|
closeNewAgent();
|
||||||
|
setShowAdvancedCards(false);
|
||||||
|
navigate(
|
||||||
|
`/agents/new?adapterType=${encodeURIComponent(template.adapterType)}&role=${encodeURIComponent(template.role)}&name=${encodeURIComponent(template.label)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={newAgentOpen}
|
open={newAgentOpen}
|
||||||
|
|
@ -176,6 +191,21 @@ export function NewAgentDialog() {
|
||||||
{`Ask the ${VOCAB.ceo} to create a new agent`}
|
{`Ask the ${VOCAB.ceo} to create a new agent`}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
{/* [nexus] Template selector — quick-create PM or Engineer agent */}
|
||||||
|
<div className="space-y-2">
|
||||||
|
<p className="text-sm text-muted-foreground text-center">Or use a template:</p>
|
||||||
|
{AGENT_TEMPLATES.map((template) => (
|
||||||
|
<Button
|
||||||
|
key={template.id}
|
||||||
|
variant="outline"
|
||||||
|
className="w-full justify-start"
|
||||||
|
onClick={() => handleTemplateSelect(template)}
|
||||||
|
>
|
||||||
|
{template.label}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Advanced link */}
|
{/* Advanced link */}
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue