(input: BuildApplyCommentPromptInput)
| 330 | } |
| 331 | |
| 332 | export function buildApplyCommentUserPrompt(input: BuildApplyCommentPromptInput): string { |
| 333 | const selectedElementContext = formatUntrustedContext( |
| 334 | 'selected_element', |
| 335 | 'The following DOM metadata and HTML snippet identify the selected element for the requested edit.', |
| 336 | [ |
| 337 | `Selected element tag: <${input.selection.tag}>`, |
| 338 | `Selected element selector: ${input.selection.selector}`, |
| 339 | `Selected element snippet:\n${input.selection.outerHTML || '(empty)'}`, |
| 340 | ].join('\n'), |
| 341 | ); |
| 342 | const parts = [ |
| 343 | 'Revise the design source that is already in the workspace at `App.jsx`.', |
| 344 | 'Keep the overall structure, copy, and layout intact unless the user request requires a broader change.', |
| 345 | 'Prioritize the selected element first and avoid unrelated edits.', |
| 346 | `User request: ${input.comment.trim()}`, |
| 347 | selectedElementContext, |
| 348 | ]; |
| 349 | parts.push( |
| 350 | 'Edit the file with `str_replace_based_edit_tool` using `command: "view"` and `command: "str_replace"` — do NOT paste HTML in chat. When done, call the `done` tool. Keep the reply short; no narration beyond the required ≤15-word tool-call intros.', |
| 351 | ); |
| 352 | return parts.join('\n\n'); |
| 353 | } |
| 354 | |
| 355 | export { composeSystemPrompt } from './prompts/index.js'; |
| 356 |
no test coverage detected