|
| 1 | +# TASK-049: WebSearchAgent Config Svelte Component |
| 2 | + |
| 3 | +**Feature**: WebSearchAgent Support in CrewBuilder |
| 4 | +**Spec**: `sdd/specs/crew-websearchagent-support.spec.md` |
| 5 | +**Status**: pending |
| 6 | +**Priority**: high |
| 7 | +**Estimated effort**: M (2-4h) |
| 8 | +**Depends-on**: none |
| 9 | +**Assigned-to**: unassigned |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Context |
| 14 | + |
| 15 | +> This task implements Module 1 from the spec: the WebSearchAgent-specific configuration panel in the CrewBuilder UI. |
| 16 | +
|
| 17 | +When users add a `WebSearchAgent` to their crew in the visual designer, they currently see only the generic agent config. This task creates a specialized configuration component that exposes WebSearchAgent's unique parameters. |
| 18 | + |
| 19 | +**Repository**: `navigator-frontend-next` (NOT ai-parrot) |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Scope |
| 24 | + |
| 25 | +- Create `WebSearchAgentConfig.svelte` component |
| 26 | +- Implement temperature slider (default: 0.0, range: 0.0-1.0) |
| 27 | +- Implement "Enable Contrastive Search" checkbox |
| 28 | + - When checked: show textarea for `contrastive_prompt` |
| 29 | + - Show placeholder hint: "Use $query and $search_results in prompts" |
| 30 | +- Implement "Enable Synthesis" checkbox |
| 31 | + - When checked: show textarea for `synthesize_prompt` |
| 32 | + - Show placeholder hint: "Use $query and $search_results in prompts" |
| 33 | +- Show default prompt examples for reference (per open question decision) |
| 34 | +- Add warning if temperature > 0.3 ("Higher temperature may cause hallucinations in search results") |
| 35 | + |
| 36 | +**NOT in scope**: |
| 37 | +- Agent type detection logic (TASK-050) |
| 38 | +- JSON serialization to store (TASK-051) |
| 39 | +- Backend validation (TASK-052) |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## Files to Create / Modify |
| 44 | + |
| 45 | +| File | Action | Description | |
| 46 | +|---|---|---| |
| 47 | +| `src/lib/components/crew-builder/WebSearchAgentConfig.svelte` | CREATE | Main configuration component | |
| 48 | +| `src/lib/components/crew-builder/index.ts` | MODIFY | Export the new component | |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## Implementation Notes |
| 53 | + |
| 54 | +### Pattern to Follow |
| 55 | + |
| 56 | +Follow the existing pattern in the CrewBuilder for agent configuration panels. Look at how other specialized agents (if any) handle their config. |
| 57 | + |
| 58 | +```svelte |
| 59 | +<script lang="ts"> |
| 60 | + export let agentConfig: AgentDefinition; |
| 61 | +
|
| 62 | + // Reactive bindings to agentConfig.config |
| 63 | + $: temperature = agentConfig.config.temperature ?? 0.0; |
| 64 | + $: contrastiveSearch = agentConfig.config.contrastive_search ?? false; |
| 65 | + $: contrastivePrompt = agentConfig.config.contrastive_prompt ?? ''; |
| 66 | + $: synthesize = agentConfig.config.synthesize ?? false; |
| 67 | + $: synthesizePrompt = agentConfig.config.synthesize_prompt ?? ''; |
| 68 | +</script> |
| 69 | +``` |
| 70 | + |
| 71 | +### Key Constraints |
| 72 | + |
| 73 | +- Use two-way binding to update `agentConfig.config` in real-time |
| 74 | +- Temperature defaults to 0.0 (NOT the usual 0.7) to avoid hallucination |
| 75 | +- Textareas for prompts should only be visible when corresponding checkbox is checked |
| 76 | +- Show default prompt examples inline for user reference |
| 77 | + |
| 78 | +### Default Prompts for Reference |
| 79 | + |
| 80 | +Contrastive: |
| 81 | +``` |
| 82 | +Based on following query: $query |
| 83 | +Below are search results about its COMPETITORS. Analyze ONLY the competitors: |
| 84 | +
|
| 85 | +$search_results |
| 86 | +
|
| 87 | +Structure your response as: |
| 88 | +**Market Category**: [category] |
| 89 | +**Competitors Found**: ... |
| 90 | +``` |
| 91 | + |
| 92 | +Synthesis: |
| 93 | +``` |
| 94 | +Based on the following query: $query |
| 95 | +Analyze and synthesize the following search results into a comprehensive summary: |
| 96 | +
|
| 97 | +$search_results |
| 98 | +
|
| 99 | +Provide: |
| 100 | +- **Key Findings**: Main insights from the results |
| 101 | +- **Analysis**: Critical evaluation of the information |
| 102 | +- **Summary**: Concise synthesis of all findings |
| 103 | +``` |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Acceptance Criteria |
| 108 | + |
| 109 | +- [ ] Component renders temperature slider with default 0.0 |
| 110 | +- [ ] Component renders "Enable Contrastive Search" checkbox |
| 111 | +- [ ] Contrastive prompt textarea appears only when checkbox is checked |
| 112 | +- [ ] Component renders "Enable Synthesis" checkbox |
| 113 | +- [ ] Synthesis prompt textarea appears only when checkbox is checked |
| 114 | +- [ ] Default prompts shown for reference |
| 115 | +- [ ] Warning shown when temperature > 0.3 |
| 116 | +- [ ] Two-way binding works: changes update agentConfig.config |
| 117 | +- [ ] Component exported from index.ts |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Test Specification |
| 122 | + |
| 123 | +```typescript |
| 124 | +// Tests would be in the frontend repo |
| 125 | +describe('WebSearchAgentConfig', () => { |
| 126 | + it('renders with default temperature 0.0', () => { |
| 127 | + // ... |
| 128 | + }); |
| 129 | + |
| 130 | + it('shows contrastive prompt textarea when checkbox checked', () => { |
| 131 | + // ... |
| 132 | + }); |
| 133 | + |
| 134 | + it('shows synthesis prompt textarea when checkbox checked', () => { |
| 135 | + // ... |
| 136 | + }); |
| 137 | + |
| 138 | + it('shows warning when temperature > 0.3', () => { |
| 139 | + // ... |
| 140 | + }); |
| 141 | +}); |
| 142 | +``` |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## Agent Instructions |
| 147 | + |
| 148 | +When you pick up this task: |
| 149 | + |
| 150 | +1. **Read the spec** at the path listed above for full context |
| 151 | +2. **Check dependencies** — verify `Depends-on` tasks are in `tasks/completed/` |
| 152 | +3. **Update status** in `tasks/.index.json` → `"in-progress"` with your session ID |
| 153 | +4. **Implement** following the scope and notes above |
| 154 | +5. **Verify** all acceptance criteria are met |
| 155 | +6. **Move this file** to `tasks/completed/TASK-049-websearchagent-config-component.md` |
| 156 | +7. **Update index** → `"done"` |
| 157 | +8. **Fill in the Completion Note** below |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +## Completion Note |
| 162 | + |
| 163 | +*(Agent fills this in when done)* |
| 164 | + |
| 165 | +**Completed by**: |
| 166 | +**Date**: |
| 167 | +**Notes**: |
| 168 | + |
| 169 | +**Deviations from spec**: none | describe if any |
0 commit comments