| 05-employee-design |
02 |
ui |
| nextjs |
| react |
| tanstack-query |
| react-hook-form |
| shadcn |
| typescript |
|
| phase |
provides |
| 05-01 |
Template backend API (GET /api/portal/templates, POST /api/portal/templates/{id}/deploy), AgentTemplate model, build_system_prompt Python function |
|
|
| Three-option entry screen at /agents/new (Templates, Guided Setup, Advanced) |
| Template gallery at /agents/new/templates with card grid, preview dialog, one-click deploy |
| 5-step wizard at /agents/new/wizard (Role, Persona, Tools, Channels, Escalation + Review) |
| Advanced mode at /agents/new/advanced (existing AgentDesigner in create mode) |
| EmployeeWizard component with stepper and React state management |
| TemplateGallery component with TanStack Query hooks |
| system-prompt-builder.ts mirroring Python build_system_prompt |
| Template and TemplateDeployResponse TypeScript types in api.ts |
| useTemplates and useDeployTemplate TanStack Query hooks |
|
| agent-editing |
| employee-management |
|
| added |
patterns |
|
|
| Three-option creation entry pattern (Templates / Wizard / Advanced) |
| Wizard state in React useState (not URL) — persona text would pollute URL |
| URL step param for stepper position (shareable, router.replace for history hygiene) |
| base-ui Select onValueChange null coercion with ?? '' for TypeScript compatibility |
|
|
| created |
modified |
| packages/portal/app/(dashboard)/agents/new/page.tsx |
| packages/portal/app/(dashboard)/agents/new/advanced/page.tsx |
| packages/portal/app/(dashboard)/agents/new/templates/page.tsx |
| packages/portal/app/(dashboard)/agents/new/wizard/page.tsx |
| packages/portal/components/employee-wizard.tsx |
| packages/portal/components/template-gallery.tsx |
| packages/portal/components/wizard-steps/step-role.tsx |
| packages/portal/components/wizard-steps/step-persona.tsx |
| packages/portal/components/wizard-steps/step-tools.tsx |
| packages/portal/components/wizard-steps/step-channels.tsx |
| packages/portal/components/wizard-steps/step-escalation.tsx |
| packages/portal/components/wizard-steps/step-review.tsx |
| packages/portal/lib/system-prompt-builder.ts |
|
| packages/portal/lib/api.ts |
| packages/portal/lib/queries.ts |
|
|
| Wizard state held in React useState — persona text in URL would be impractical and polluting |
| Channels step is informational in v1 — agent routing is tenant-scoped, not per-agent |
| Template gallery uses Dialog for preview — prevents page navigation, keeps context |
|
| WizardData interface exported from employee-wizard.tsx for use by all step components |
| Step components receive data: Partial<WizardData> and onNext: (updates) => void |
| buildSystemPrompt always appends AI transparency clause — non-negotiable |
|
| EMPL-01 |
| EMPL-02 |
| EMPL-03 |
| EMPL-04 |
| EMPL-05 |
|
5min |
2026-03-25 |