| 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 | |
| 5 | |
| 6 | @customElement("sketch-tool-card-generic") |
| 7 | export class SketchToolCardGeneric extends LitElement { |
| 8 | @property() toolCall: ToolCall; |
| 9 | @property() open: boolean; |
| 10 | |
| 11 | render() { |
| 12 | return html`<sketch-tool-card .open=${this.open} .toolCall=${this.toolCall}> |
| 13 | <span slot="summary" class="summary-text">${this.toolCall?.input}</span> |
| 14 | <div slot="input"> |
| 15 | Input: |
| 16 | <pre>${this.toolCall?.input}</pre> |
| 17 | </div> |
| 18 | <div slot="result"> |
| 19 | Result: |
| 20 | ${this.toolCall?.result_message?.tool_result |
| 21 | ? html`<pre>${this.toolCall?.result_message.tool_result}</pre>` |
| 22 | : ""} |
| 23 | </div> |
| 24 | </sketch-tool-card>`; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | declare global { |
| 29 | interface HTMLElementTagNameMap { |
| 30 | "sketch-tool-card-generic": SketchToolCardGeneric; |
| 31 | } |
| 32 | } |