| Pokey Rule | ef58e06 | 2025-05-07 13:32:58 +0100 | [diff] [blame] | 1 | import { LitElement, html } from "lit"; |
| 2 | import { customElement, property } from "lit/decorators.js"; |
| 3 | import { ToolCall } from "../types"; |
| 4 | |
| Pokey Rule | ef58e06 | 2025-05-07 13:32:58 +0100 | [diff] [blame] | 5 | @customElement("sketch-tool-card-generic") |
| 6 | export class SketchToolCardGeneric extends LitElement { |
| 7 | @property() toolCall: ToolCall; |
| 8 | @property() open: boolean; |
| 9 | |
| 10 | render() { |
| 11 | return html`<sketch-tool-card .open=${this.open} .toolCall=${this.toolCall}> |
| 12 | <span slot="summary" class="summary-text">${this.toolCall?.input}</span> |
| 13 | <div slot="input"> |
| 14 | Input: |
| 15 | <pre>${this.toolCall?.input}</pre> |
| 16 | </div> |
| 17 | <div slot="result"> |
| 18 | Result: |
| 19 | ${this.toolCall?.result_message?.tool_result |
| Autoformatter | 47fbca6 | 2025-05-07 12:38:12 +0000 | [diff] [blame^] | 20 | ? html`<pre>${this.toolCall?.result_message.tool_result}</pre>` |
| 21 | : ""} |
| Pokey Rule | ef58e06 | 2025-05-07 13:32:58 +0100 | [diff] [blame] | 22 | </div> |
| 23 | </sketch-tool-card>`; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | declare global { |
| 28 | interface HTMLElementTagNameMap { |
| 29 | "sketch-tool-card-generic": SketchToolCardGeneric; |
| 30 | } |
| 31 | } |