(iteration: IterationData)
| 134 | }; |
| 135 | |
| 136 | const renderIterationHTML = (iteration: IterationData): string => { |
| 137 | const startTime = formatTimestamp(iteration.startTime); |
| 138 | const duration = iteration.duration ? `${iteration.duration.toFixed(2)}s` : 'N/A'; |
| 139 | |
| 140 | return ` |
| 141 | <div class="iteration ${iteration.hasError ? 'error' : ''}"> |
| 142 | <div class="iteration-header"> |
| 143 | <h3>Iteration #${iteration.sessionIterationNumber}</h3> |
| 144 | <div class="iteration-meta"> |
| 145 | <span>Start: ${startTime}</span> |
| 146 | <span>Duration: ${duration}</span> |
| 147 | ${iteration.hasError ? '<span class="error-indicator">❌ Error</span>' : ''} |
| 148 | </div> |
| 149 | </div> |
| 150 | |
| 151 | <div class="iteration-content"> |
| 152 | <div class="section"> |
| 153 | <h4>📥 Inputs (${iteration.sensors.length} sensors)</h4> |
| 154 | <div class="sensors"> |
| 155 | ${iteration.sensors.map(renderSensorHTML).join('')} |
| 156 | </div> |
| 157 | </div> |
| 158 | |
| 159 | ${iteration.modelPrompt ? ` |
| 160 | <div class="section"> |
| 161 | <h4>💭 Model Prompt</h4> |
| 162 | <pre class="prompt">${iteration.modelPrompt}</pre> |
| 163 | </div> |
| 164 | ` : ''} |
| 165 | |
| 166 | ${iteration.modelImages?.length ? ` |
| 167 | <div class="section"> |
| 168 | <h4>🖼️ Images Sent to Model (${iteration.modelImages.length})</h4> |
| 169 | ${options.includeImages ? |
| 170 | iteration.modelImages.map((img, i) => |
| 171 | `<img src="data:image/png;base64,${img}" alt="Image ${i+1}" style="max-width: 300px; margin: 10px 0;" />` |
| 172 | ).join('') : |
| 173 | '<p>Images excluded from export</p>' |
| 174 | } |
| 175 | </div> |
| 176 | ` : ''} |
| 177 | |
| 178 | ${iteration.modelResponse ? ` |
| 179 | <div class="section"> |
| 180 | <h4>🤖 Model Response</h4> |
| 181 | <div class="response">${iteration.modelResponse}</div> |
| 182 | </div> |
| 183 | ` : ''} |
| 184 | |
| 185 | <div class="section"> |
| 186 | <h4>🔧 Tools (${iteration.tools.length})</h4> |
| 187 | <div class="tools"> |
| 188 | ${iteration.tools.map(renderToolHTML).join('')} |
| 189 | </div> |
| 190 | </div> |
| 191 | </div> |
| 192 | </div> |
| 193 | `; |
nothing calls this directly
no test coverage detected