@seed-ship/mcp-ui-solid 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { createSignal, createEffect, onCleanup, Show, For, Switch, Match } from
3
3
  import { FormFieldRenderer } from "./FormFieldRenderer.js";
4
4
  var _tmpl$ = /* @__PURE__ */ template(`<svg fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M19 9l-7 7-7-7">`), _tmpl$2 = /* @__PURE__ */ template(`<button class="p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"aria-label=Close><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M6 18L18 6M6 6l12 12">`), _tmpl$3 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-100 dark:border-gray-700 flex flex-wrap items-center gap-1.5">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700 space-y-2">`), _tmpl$5 = /* @__PURE__ */ template(`<div class="flex flex-col items-center gap-2 py-4 text-center"><span class=text-2xl>&#128269;</span><p class="text-sm text-gray-500 dark:text-gray-400">No results for these filters</p><button type=button class="px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors">Modify filters`), _tmpl$6 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700">`), _tmpl$7 = /* @__PURE__ */ template(`<p class="text-xs text-red-500 dark:text-red-500 mt-0.5">Code: <!$><!/>`), _tmpl$8 = /* @__PURE__ */ template(`<button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors flex items-center gap-1">&#128260; Retry`), _tmpl$9 = /* @__PURE__ */ template(`<button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">Close`), _tmpl$0 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-red-100 dark:border-red-900/30 bg-red-50 dark:bg-red-900/10"><div class="flex items-start gap-2 text-sm text-red-700 dark:text-red-400"><span class="flex-shrink-0 mt-0.5">⚠️</span><div class=flex-1><p class=font-medium></p><!$><!/></div></div><div class="flex gap-2 mt-2"><!$><!/><!$><!/>`), _tmpl$1 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700"><button type=button class="w-full px-4 py-2.5 text-sm font-semibold rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2"><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>Search`), _tmpl$10 = /* @__PURE__ */ template(`<div style=overflow-y:auto><!$><!/><div class="divide-y divide-gray-100 dark:divide-gray-700"></div><!$><!/><!$><!/><!$><!/><!$><!/>`), _tmpl$11 = /* @__PURE__ */ template(`<div style="animation:scratchpad-slide-down 0.2s ease-out"><div><div class="flex items-center gap-2"><span class=text-base>&#128221;</span><h3 class="text-sm font-semibold text-gray-900 dark:text-white"></h3><!$><!/></div><div class="flex items-center gap-2"><span></span><!$><!/></div></div><!$><!/><style>
5
5
  @keyframes scratchpad-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
6
- `), _tmpl$12 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-300 dark:text-gray-600 flex-shrink-0"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$13 = /* @__PURE__ */ template(`<span class="ml-1 font-normal opacity-75">— <!$><!/>`), _tmpl$14 = /* @__PURE__ */ template(`<span><!$><!/> <!$><!/><!$><!/>`), _tmpl$15 = /* @__PURE__ */ template(`<div><span class="flex-shrink-0 mt-0.5"></span><p>`), _tmpl$16 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 mb-2"><span class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">Preview</span><span class="px-1.5 py-0.5 text-xs font-bold bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded">`), _tmpl$17 = /* @__PURE__ */ template(`<p class="text-sm text-gray-700 dark:text-gray-300">`), _tmpl$18 = /* @__PURE__ */ template(`<div class="mt-2 overflow-x-auto"><table class="min-w-full text-xs"><thead><tr></tr></thead><tbody>`), _tmpl$19 = /* @__PURE__ */ template(`<th class="px-2 py-1 text-left font-medium text-gray-500 dark:text-gray-400">`), _tmpl$20 = /* @__PURE__ */ template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$21 = /* @__PURE__ */ template(`<td class="px-2 py-1 text-gray-700 dark:text-gray-300">`), _tmpl$22 = /* @__PURE__ */ template(`<pre class="text-xs text-gray-500 overflow-auto">`), _tmpl$23 = /* @__PURE__ */ template(`<div class="px-4 py-3"><h4 class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2"></h4><!$><!/>`), _tmpl$24 = /* @__PURE__ */ template(`<div class=space-y-1>`), _tmpl$25 = /* @__PURE__ */ template(`<div class="flex gap-2 text-xs"><span class="text-gray-500 dark:text-gray-400 font-mono min-w-[120px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`), _tmpl$26 = /* @__PURE__ */ template(`<p class="text-xs text-gray-400 italic">No filters`), _tmpl$27 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-1.5"><!$><!/><!$><!/>`), _tmpl$28 = /* @__PURE__ */ template(`<button type=button class="ml-0.5 hover:text-blue-900 dark:hover:text-blue-100">&times;`), _tmpl$29 = /* @__PURE__ */ template(`<span class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full"><button type=button class=hover:underline><span class="text-blue-500 dark:text-blue-400"><!$><!/>:</span> <!$><!/></button><!$><!/>`), _tmpl$30 = /* @__PURE__ */ template(`<div class="max-h-48 overflow-y-auto">`), _tmpl$31 = /* @__PURE__ */ template(`<button type=button class="mt-1 w-full px-2 py-1 text-xs text-gray-500 hover:text-gray-700 text-center">Cancel`), _tmpl$32 = /* @__PURE__ */ template(`<div class="absolute z-50 mt-1 left-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg p-2 min-w-[200px]">`), _tmpl$33 = /* @__PURE__ */ template(`<div class=relative><!$><!/><!$><!/>`), _tmpl$34 = /* @__PURE__ */ template(`<button type=button class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium border border-dashed border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 rounded-full hover:border-blue-400 hover:text-blue-500 transition-colors">+ <!$><!/>`), _tmpl$35 = /* @__PURE__ */ template(`<form class="flex gap-1"><input type=text autofocus class="flex-1 px-2 py-1 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=submit class="px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700">OK</button><button type=button class="px-2 py-1 text-xs text-gray-500 hover:text-gray-700">Cancel`), _tmpl$36 = /* @__PURE__ */ template(`<span class=ml-1>✓`), _tmpl$37 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/>`), _tmpl$38 = /* @__PURE__ */ template(`<form class="flex flex-col gap-3"><!$><!/><div class="flex justify-end"><button type=submit class="px-4 py-2 text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors">`), _tmpl$39 = /* @__PURE__ */ template(`<div class="flex justify-end"><button type=button class="px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors flex items-center gap-1">Next <svg class="w-3.5 h-3.5"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$40 = /* @__PURE__ */ template(`<div class=space-y-3><!$><!/><!$><!/>`), _tmpl$41 = /* @__PURE__ */ template(`<span class="text-xs font-normal text-gray-500 dark:text-gray-400">— <!$><!/>`), _tmpl$42 = /* @__PURE__ */ template(`<div class="mt-2 ml-6">`), _tmpl$43 = /* @__PURE__ */ template(`<div><div><span></span><!$><!/><!$><!/></div><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-2">`), _tmpl$45 = /* @__PURE__ */ template(`<span class=mr-1>`), _tmpl$46 = /* @__PURE__ */ template(`<div class=space-y-2><div class=space-y-1.5></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 text-sm"><span></span><span class="text-gray-900 dark:text-white">`), _tmpl$48 = /* @__PURE__ */ template(`<div class="flex items-start gap-1.5 text-xs text-amber-600 dark:text-amber-400"><span class=flex-shrink-0>⚠️</span><span>`), _tmpl$49 = /* @__PURE__ */ template(`<div class="flex gap-1"><input type=text class="flex-1 px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=button class="px-3 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700">Send`), _tmpl$50 = /* @__PURE__ */ template(`<div class=space-y-3><p class="text-sm text-gray-700 dark:text-gray-300"></p><div class="flex flex-wrap gap-2"></div><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<span>`), _tmpl$52 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 italic">"<!$><!/>"`), _tmpl$53 = /* @__PURE__ */ template(`<div class="mt-2 px-3 py-2 bg-blue-50 dark:bg-blue-900/10 rounded-lg text-sm text-blue-700 dark:text-blue-300"><span class=font-medium>Plan:</span> <!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<button type=button class="text-xs text-blue-600 dark:text-blue-400 hover:underline flex items-center gap-1">&#9998; Modify`), _tmpl$55 = /* @__PURE__ */ template(`<div class=space-y-2><!$><!/><div class=space-y-1></div><!$><!/><!$><!/>`), _tmpl$56 = /* @__PURE__ */ template(`<div class="flex gap-2 text-sm"><span class="text-gray-500 dark:text-gray-400 font-medium min-w-[80px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`);
6
+ `), _tmpl$12 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-300 dark:text-gray-600 flex-shrink-0"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$13 = /* @__PURE__ */ template(`<span class="ml-1 font-normal opacity-75">— <!$><!/>`), _tmpl$14 = /* @__PURE__ */ template(`<span><!$><!/> <!$><!/><!$><!/>`), _tmpl$15 = /* @__PURE__ */ template(`<div><span class="flex-shrink-0 mt-0.5"></span><p>`), _tmpl$16 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 mb-2"><span class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">Preview</span><span class="px-1.5 py-0.5 text-xs font-bold bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded">`), _tmpl$17 = /* @__PURE__ */ template(`<p class="text-sm text-gray-700 dark:text-gray-300">`), _tmpl$18 = /* @__PURE__ */ template(`<div class="mt-2 overflow-x-auto"><table class="min-w-full text-xs"><thead><tr></tr></thead><tbody>`), _tmpl$19 = /* @__PURE__ */ template(`<th class="px-2 py-1 text-left font-medium text-gray-500 dark:text-gray-400">`), _tmpl$20 = /* @__PURE__ */ template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$21 = /* @__PURE__ */ template(`<td class="px-2 py-1 text-gray-700 dark:text-gray-300">`), _tmpl$22 = /* @__PURE__ */ template(`<pre class="text-xs text-gray-500 overflow-auto">`), _tmpl$23 = /* @__PURE__ */ template(`<div class="px-4 py-3"><h4 class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2"></h4><!$><!/>`), _tmpl$24 = /* @__PURE__ */ template(`<div class=space-y-1>`), _tmpl$25 = /* @__PURE__ */ template(`<div class="flex gap-2 text-xs"><span class="text-gray-500 dark:text-gray-400 font-mono min-w-[120px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`), _tmpl$26 = /* @__PURE__ */ template(`<p class="text-xs text-gray-400 italic">No filters`), _tmpl$27 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-1.5"><!$><!/><!$><!/>`), _tmpl$28 = /* @__PURE__ */ template(`<button type=button class="ml-0.5 hover:text-blue-900 dark:hover:text-blue-100">&times;`), _tmpl$29 = /* @__PURE__ */ template(`<span class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full"><button type=button class=hover:underline><span class="text-blue-500 dark:text-blue-400"><!$><!/>:</span> <!$><!/></button><!$><!/>`), _tmpl$30 = /* @__PURE__ */ template(`<div class="max-h-48 overflow-y-auto">`), _tmpl$31 = /* @__PURE__ */ template(`<button type=button class="mt-1 w-full px-2 py-1 text-xs text-gray-500 hover:text-gray-700 text-center">Cancel`), _tmpl$32 = /* @__PURE__ */ template(`<div class="absolute z-50 mt-1 left-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg p-2 min-w-[200px]">`), _tmpl$33 = /* @__PURE__ */ template(`<div class=relative><!$><!/><!$><!/>`), _tmpl$34 = /* @__PURE__ */ template(`<button type=button class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium border border-dashed border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 rounded-full hover:border-blue-400 hover:text-blue-500 transition-colors">+ <!$><!/>`), _tmpl$35 = /* @__PURE__ */ template(`<form class="flex gap-1"><input type=text autofocus class="flex-1 px-2 py-1 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=submit class="px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700">OK</button><button type=button class="px-2 py-1 text-xs text-gray-500 hover:text-gray-700">Cancel`), _tmpl$36 = /* @__PURE__ */ template(`<span class=ml-1>✓`), _tmpl$37 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/>`), _tmpl$38 = /* @__PURE__ */ template(`<form class="flex flex-col gap-3"><!$><!/><div class="flex justify-end"><button type=submit class="px-4 py-2 text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors">`), _tmpl$39 = /* @__PURE__ */ template(`<div class="flex justify-end"><button type=button class="px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors flex items-center gap-1">Next <svg class="w-3.5 h-3.5"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$40 = /* @__PURE__ */ template(`<div class=space-y-3><!$><!/><!$><!/>`), _tmpl$41 = /* @__PURE__ */ template(`<span class="text-xs font-normal text-gray-500 dark:text-gray-400">— <!$><!/>`), _tmpl$42 = /* @__PURE__ */ template(`<div class="mt-2 ml-6">`), _tmpl$43 = /* @__PURE__ */ template(`<div><div><span></span><!$><!/><!$><!/></div><!$><!/>`), _tmpl$44 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-2">`), _tmpl$45 = /* @__PURE__ */ template(`<span class=mr-1>`), _tmpl$46 = /* @__PURE__ */ template(`<div class=space-y-2><div class=space-y-1.5></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 text-sm"><span></span><span class="text-gray-900 dark:text-white">`), _tmpl$48 = /* @__PURE__ */ template(`<div class="flex items-start gap-1.5 text-xs text-amber-600 dark:text-amber-400"><span class=flex-shrink-0>⚠️</span><span>`), _tmpl$49 = /* @__PURE__ */ template(`<div class="flex gap-1"><input type=text class="flex-1 px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=button class="px-3 py-2 text-sm bg-blue-600 text-white rounded-lg hover:bg-blue-700">Send`), _tmpl$50 = /* @__PURE__ */ template(`<div class=space-y-3><p class="text-sm text-gray-700 dark:text-gray-300"></p><div class="flex flex-wrap gap-2"></div><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<span>`), _tmpl$52 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 italic">"<!$><!/>"`), _tmpl$53 = /* @__PURE__ */ template(`<div class="mt-2 px-3 py-2 bg-blue-50 dark:bg-blue-900/10 rounded-lg text-sm text-blue-700 dark:text-blue-300"><span class=font-medium>Plan:</span> <!$><!/>`), _tmpl$54 = /* @__PURE__ */ template(`<button type=button class="text-xs text-blue-600 dark:text-blue-400 hover:underline flex items-center gap-1">&#9998; Modify`), _tmpl$55 = /* @__PURE__ */ template(`<div class=space-y-2><!$><!/><div class=space-y-1></div><!$><!/><!$><!/>`), _tmpl$56 = /* @__PURE__ */ template(`<div class="flex gap-2 text-sm"><span class="text-gray-500 dark:text-gray-400 font-medium min-w-[80px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`), _tmpl$57 = /* @__PURE__ */ template(`<div class="flex items-center gap-1 flex-wrap">`), _tmpl$58 = /* @__PURE__ */ template(`<div class=space-y-2>`), _tmpl$59 = /* @__PURE__ */ template(`<span class="ml-1 text-xs text-gray-500 dark:text-gray-400">— <!$><!/>`), _tmpl$60 = /* @__PURE__ */ template(`<span class="ml-1 text-xs text-gray-400">(<!$><!/>ms)`), _tmpl$61 = /* @__PURE__ */ template(`<div><span class=flex-shrink-0></span><div><span></span><!$><!/><!$><!/>`), _tmpl$62 = /* @__PURE__ */ template(`<span class="text-[10px] opacity-75">`), _tmpl$63 = /* @__PURE__ */ template(`<div><span></span><span></span><!$><!/>`), _tmpl$64 = /* @__PURE__ */ template(`<button type=button>&#128260; <!$><!/>`), _tmpl$65 = /* @__PURE__ */ template(`<button type=button class="px-2 py-1 text-xs opacity-70 hover:opacity-100">&#9654; Details`), _tmpl$66 = /* @__PURE__ */ template(`<pre class="mt-2 text-xs opacity-70 overflow-x-auto">`), _tmpl$67 = /* @__PURE__ */ template(`<div><div class="flex items-start gap-2"><span class=flex-shrink-0></span><div class=flex-1><p></p><div class="flex gap-2 mt-2"><!$><!/><!$><!/></div><!$><!/>`), _tmpl$68 = /* @__PURE__ */ template(`<span class="text-xs font-bold text-blue-600 dark:text-blue-400"><!$><!/> results`), _tmpl$69 = /* @__PURE__ */ template(`<p class="text-[10px] text-gray-400">`), _tmpl$70 = /* @__PURE__ */ template(`<div class="rounded-lg border border-gray-200 dark:border-gray-700 px-3 py-2"><div class="flex items-center justify-between mb-1.5"><span class="text-sm font-medium text-gray-900 dark:text-white"><!$><!/> <!$><!/></span><!$><!/></div><div class="flex flex-wrap gap-1.5 mb-1"></div><!$><!/>`), _tmpl$71 = /* @__PURE__ */ template(`<span><!$><!/> <!$><!/>`), _tmpl$72 = /* @__PURE__ */ template(`<div class=overflow-x-auto><table class="min-w-full text-xs"><thead><tr><th class="px-2 py-1 text-left text-gray-500 dark:text-gray-400"></th><th class="px-2 py-1 text-left font-medium text-blue-600 dark:text-blue-400"></th><th class="px-2 py-1 text-left font-medium text-purple-600 dark:text-purple-400"></th></tr></thead><tbody>`), _tmpl$73 = /* @__PURE__ */ template(`<tr><td class="px-2 py-1 font-mono text-gray-500 dark:text-gray-400"></td><td class="px-2 py-1 text-gray-900 dark:text-white"></td><td class="px-2 py-1 text-gray-900 dark:text-white">`);
7
7
  const STATUS_BADGES = {
8
8
  loading: {
9
9
  label: "Loading...",
@@ -11,7 +11,7 @@ const STATUS_BADGES = {
11
11
  },
12
12
  ready: {
13
13
  label: "Ready",
14
- class: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"
14
+ class: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"
15
15
  },
16
16
  waiting_human: {
17
17
  label: "Your turn",
@@ -33,20 +33,35 @@ const STATUS_BADGES = {
33
33
  const ScratchpadPanel = (props) => {
34
34
  const [collapsed, setCollapsed] = createSignal(false);
35
35
  const [localPreview, setLocalPreview] = createSignal(void 0);
36
+ const [loadingAction, setLoadingAction] = createSignal(null);
36
37
  let previewTimer = null;
37
38
  const badge = () => STATUS_BADGES[props.state.status] || STATUS_BADGES.loading;
38
39
  const isClosable = () => props.closable !== false;
39
40
  const isCollapsible = () => props.collapsible !== false;
40
41
  const preview = () => localPreview() || props.state.preview;
41
42
  const hasFilters = () => Object.keys(props.state.filters || {}).length > 0;
43
+ const CLOSE_ALIASES = /* @__PURE__ */ new Set(["done", "close", "dismiss", "validate", "cancel", "sufficient"]);
44
+ const handleAction = (action, data) => {
45
+ var _a;
46
+ if (props.asyncAction && !CLOSE_ALIASES.has(action)) {
47
+ setLoadingAction(action);
48
+ }
49
+ (_a = props.onAction) == null ? void 0 : _a.call(props, action, data);
50
+ if (CLOSE_ALIASES.has(action) && props.onClose) {
51
+ props.onClose();
52
+ }
53
+ };
42
54
  createEffect(() => {
43
- if (props.state.status === "complete" && props.autoCloseDelay) {
55
+ if (props.state.status === "complete" && props.autoCloseDelay && !props.pinned) {
44
56
  const timer = setTimeout(() => {
45
57
  var _a;
46
58
  return (_a = props.onClose) == null ? void 0 : _a.call(props);
47
59
  }, props.autoCloseDelay);
48
60
  onCleanup(() => clearTimeout(timer));
49
61
  }
62
+ if (props.state.status !== "processing" && loadingAction()) {
63
+ setLoadingAction(null);
64
+ }
50
65
  });
51
66
  createEffect(() => {
52
67
  const endpoint = props.state.previewEndpoint;
@@ -165,9 +180,7 @@ const ScratchpadPanel = (props) => {
165
180
  get onFilterChange() {
166
181
  return props.onFilterChange;
167
182
  },
168
- get onAction() {
169
- return props.onAction;
170
- },
183
+ onAction: handleAction,
171
184
  get onSectionEdit() {
172
185
  return props.onSectionEdit;
173
186
  },
@@ -325,12 +338,9 @@ const ScratchpadPanel = (props) => {
325
338
  },
326
339
  get children() {
327
340
  var _el$39 = getNextElement(_tmpl$1), _el$40 = _el$39.firstChild;
328
- _el$40.$$click = () => {
329
- var _a;
330
- return (_a = props.onAction) == null ? void 0 : _a.call(props, "search", {
331
- filters: props.state.filters
332
- });
333
- };
341
+ _el$40.$$click = () => handleAction("search", {
342
+ filters: props.state.filters
343
+ });
334
344
  runHydrationEvents();
335
345
  return _el$39;
336
346
  }
@@ -487,6 +497,53 @@ const SectionRenderer = (props) => {
487
497
  }
488
498
  });
489
499
  }
500
+ }), createComponent(Match, {
501
+ get when() {
502
+ return props.section.type === "stepper";
503
+ },
504
+ get children() {
505
+ return createComponent(StepperProgressSection, {
506
+ get content() {
507
+ return props.section.content;
508
+ }
509
+ });
510
+ }
511
+ }), createComponent(Match, {
512
+ get when() {
513
+ return props.section.type === "error";
514
+ },
515
+ get children() {
516
+ return createComponent(ErrorSectionRenderer, {
517
+ get content() {
518
+ return props.section.content;
519
+ },
520
+ get onAction() {
521
+ return props.onAction;
522
+ }
523
+ });
524
+ }
525
+ }), createComponent(Match, {
526
+ get when() {
527
+ return props.section.type === "source_card";
528
+ },
529
+ get children() {
530
+ return createComponent(SourceCardSection, {
531
+ get content() {
532
+ return props.section.content;
533
+ }
534
+ });
535
+ }
536
+ }), createComponent(Match, {
537
+ get when() {
538
+ return props.section.type === "diff";
539
+ },
540
+ get children() {
541
+ return createComponent(DiffSection, {
542
+ get content() {
543
+ return props.section.content;
544
+ }
545
+ });
546
+ }
490
547
  }), createComponent(Match, {
491
548
  when: true,
492
549
  get children() {
@@ -1107,6 +1164,281 @@ const PromptSection = (props) => {
1107
1164
  return _el$193;
1108
1165
  })();
1109
1166
  };
1167
+ const StepperProgressSection = (props) => {
1168
+ const data = () => {
1169
+ const c = props.content;
1170
+ return {
1171
+ steps: (c == null ? void 0 : c.steps) || [],
1172
+ orientation: (c == null ? void 0 : c.orientation) || "horizontal"
1173
+ };
1174
+ };
1175
+ const statusIcon = (status) => {
1176
+ switch (status) {
1177
+ case "done":
1178
+ return "✅";
1179
+ case "active":
1180
+ return "🔄";
1181
+ case "error":
1182
+ return "❌";
1183
+ default:
1184
+ return "⏳";
1185
+ }
1186
+ };
1187
+ const isHorizontal = () => data().orientation === "horizontal";
1188
+ return createComponent(Show, {
1189
+ get when() {
1190
+ return isHorizontal();
1191
+ },
1192
+ get fallback() {
1193
+ return (() => {
1194
+ var _el$219 = getNextElement(_tmpl$58);
1195
+ insert(_el$219, createComponent(For, {
1196
+ get each() {
1197
+ return data().steps;
1198
+ },
1199
+ children: (step) => (() => {
1200
+ var _el$220 = getNextElement(_tmpl$61), _el$221 = _el$220.firstChild, _el$222 = _el$221.nextSibling, _el$223 = _el$222.firstChild, _el$233 = _el$223.nextSibling, [_el$234, _co$48] = getNextMarker(_el$233.nextSibling), _el$235 = _el$234.nextSibling, [_el$236, _co$49] = getNextMarker(_el$235.nextSibling);
1201
+ insert(_el$221, () => statusIcon(step.status));
1202
+ insert(_el$223, () => step.label);
1203
+ insert(_el$222, createComponent(Show, {
1204
+ get when() {
1205
+ return step.summary;
1206
+ },
1207
+ get children() {
1208
+ var _el$224 = getNextElement(_tmpl$59), _el$225 = _el$224.firstChild, _el$226 = _el$225.nextSibling, [_el$227, _co$46] = getNextMarker(_el$226.nextSibling);
1209
+ insert(_el$224, () => step.summary, _el$227, _co$46);
1210
+ return _el$224;
1211
+ }
1212
+ }), _el$234, _co$48);
1213
+ insert(_el$222, createComponent(Show, {
1214
+ get when() {
1215
+ return step.duration_ms;
1216
+ },
1217
+ get children() {
1218
+ var _el$228 = getNextElement(_tmpl$60), _el$229 = _el$228.firstChild, _el$231 = _el$229.nextSibling, [_el$232, _co$47] = getNextMarker(_el$231.nextSibling);
1219
+ _el$232.nextSibling;
1220
+ insert(_el$228, () => step.duration_ms, _el$232, _co$47);
1221
+ return _el$228;
1222
+ }
1223
+ }), _el$236, _co$49);
1224
+ effect(() => className(_el$220, `flex items-start gap-2 text-sm ${step.status === "active" ? "font-medium" : ""} ${step.status === "pending" ? "text-gray-400" : "text-gray-700 dark:text-gray-300"}`));
1225
+ return _el$220;
1226
+ })()
1227
+ }));
1228
+ return _el$219;
1229
+ })();
1230
+ },
1231
+ get children() {
1232
+ var _el$218 = getNextElement(_tmpl$57);
1233
+ insert(_el$218, createComponent(For, {
1234
+ get each() {
1235
+ return data().steps;
1236
+ },
1237
+ children: (step, i) => [createComponent(Show, {
1238
+ get when() {
1239
+ return i() > 0;
1240
+ },
1241
+ get children() {
1242
+ return getNextElement(_tmpl$12);
1243
+ }
1244
+ }), (() => {
1245
+ var _el$238 = getNextElement(_tmpl$63), _el$239 = _el$238.firstChild, _el$240 = _el$239.nextSibling, _el$242 = _el$240.nextSibling, [_el$243, _co$50] = getNextMarker(_el$242.nextSibling);
1246
+ insert(_el$239, () => statusIcon(step.status));
1247
+ insert(_el$240, () => step.label);
1248
+ insert(_el$238, createComponent(Show, {
1249
+ get when() {
1250
+ return step.summary;
1251
+ },
1252
+ get children() {
1253
+ var _el$241 = getNextElement(_tmpl$62);
1254
+ insert(_el$241, () => step.summary);
1255
+ return _el$241;
1256
+ }
1257
+ }), _el$243, _co$50);
1258
+ effect(() => className(_el$238, `flex items-center gap-1 px-2 py-1 rounded text-xs ${step.status === "done" ? "bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400" : step.status === "active" ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 font-medium" : step.status === "error" ? "bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400" : "text-gray-400"}`));
1259
+ return _el$238;
1260
+ })()]
1261
+ }));
1262
+ return _el$218;
1263
+ }
1264
+ });
1265
+ };
1266
+ const ErrorSectionRenderer = (props) => {
1267
+ const [showDetails, setShowDetails] = createSignal(false);
1268
+ const data = () => {
1269
+ const c = props.content;
1270
+ return {
1271
+ message: (c == null ? void 0 : c.message) || "Error",
1272
+ severity: (c == null ? void 0 : c.severity) || "error",
1273
+ retryAction: c == null ? void 0 : c.retryAction,
1274
+ retryLabel: (c == null ? void 0 : c.retryLabel) || "Retry",
1275
+ details: c == null ? void 0 : c.details,
1276
+ timestamp: c == null ? void 0 : c.timestamp
1277
+ };
1278
+ };
1279
+ const isWarning = () => data().severity === "warning";
1280
+ return (() => {
1281
+ var _el$244 = getNextElement(_tmpl$67), _el$245 = _el$244.firstChild, _el$246 = _el$245.firstChild, _el$247 = _el$246.nextSibling, _el$248 = _el$247.firstChild, _el$249 = _el$248.nextSibling, _el$255 = _el$249.firstChild, [_el$256, _co$52] = getNextMarker(_el$255.nextSibling), _el$257 = _el$256.nextSibling, [_el$258, _co$53] = getNextMarker(_el$257.nextSibling), _el$260 = _el$249.nextSibling, [_el$261, _co$54] = getNextMarker(_el$260.nextSibling);
1282
+ insert(_el$246, () => isWarning() ? "⚠️" : "❌");
1283
+ insert(_el$248, () => data().message);
1284
+ insert(_el$249, createComponent(Show, {
1285
+ get when() {
1286
+ return data().retryAction;
1287
+ },
1288
+ get children() {
1289
+ var _el$250 = getNextElement(_tmpl$64), _el$251 = _el$250.firstChild, _el$252 = _el$251.nextSibling, [_el$253, _co$51] = getNextMarker(_el$252.nextSibling);
1290
+ _el$250.$$click = () => {
1291
+ var _a;
1292
+ return (_a = props.onAction) == null ? void 0 : _a.call(props, data().retryAction);
1293
+ };
1294
+ insert(_el$250, () => data().retryLabel, _el$253, _co$51);
1295
+ effect(() => className(_el$250, `px-2 py-1 text-xs font-medium rounded ${isWarning() ? "bg-amber-600 text-white hover:bg-amber-700" : "bg-red-600 text-white hover:bg-red-700"} transition-colors`));
1296
+ runHydrationEvents();
1297
+ return _el$250;
1298
+ }
1299
+ }), _el$256, _co$52);
1300
+ insert(_el$249, createComponent(Show, {
1301
+ get when() {
1302
+ return data().details;
1303
+ },
1304
+ get children() {
1305
+ var _el$254 = getNextElement(_tmpl$65);
1306
+ _el$254.$$click = () => setShowDetails(!showDetails());
1307
+ runHydrationEvents();
1308
+ return _el$254;
1309
+ }
1310
+ }), _el$258, _co$53);
1311
+ insert(_el$247, createComponent(Show, {
1312
+ get when() {
1313
+ return memo(() => !!showDetails())() && data().details;
1314
+ },
1315
+ get children() {
1316
+ var _el$259 = getNextElement(_tmpl$66);
1317
+ insert(_el$259, () => data().details);
1318
+ return _el$259;
1319
+ }
1320
+ }), _el$261, _co$54);
1321
+ effect(() => className(_el$244, `rounded-lg px-3 py-2 text-sm ${isWarning() ? "bg-amber-50 dark:bg-amber-900/10 text-amber-700 dark:text-amber-400 border border-amber-200 dark:border-amber-800" : "bg-red-50 dark:bg-red-900/10 text-red-700 dark:text-red-400 border border-red-200 dark:border-red-800"}`));
1322
+ return _el$244;
1323
+ })();
1324
+ };
1325
+ const SourceCardSection = (props) => {
1326
+ const data = () => {
1327
+ const c = props.content;
1328
+ return {
1329
+ name: (c == null ? void 0 : c.name) || "Source",
1330
+ status: (c == null ? void 0 : c.status) || "available",
1331
+ capabilities: (c == null ? void 0 : c.capabilities) || [],
1332
+ latency_ms: c == null ? void 0 : c.latency_ms,
1333
+ freshness: c == null ? void 0 : c.freshness,
1334
+ row_count: c == null ? void 0 : c.row_count
1335
+ };
1336
+ };
1337
+ const statusIcon = () => ({
1338
+ queried: "✅",
1339
+ available: "📦",
1340
+ error: "❌"
1341
+ })[data().status] || "📦";
1342
+ return (() => {
1343
+ var _el$262 = getNextElement(_tmpl$70), _el$263 = _el$262.firstChild, _el$264 = _el$263.firstChild, _el$266 = _el$264.firstChild, [_el$267, _co$55] = getNextMarker(_el$266.nextSibling), _el$265 = _el$267.nextSibling, _el$268 = _el$265.nextSibling, [_el$269, _co$56] = getNextMarker(_el$268.nextSibling), _el$274 = _el$264.nextSibling, [_el$275, _co$58] = getNextMarker(_el$274.nextSibling), _el$276 = _el$263.nextSibling, _el$278 = _el$276.nextSibling, [_el$279, _co$59] = getNextMarker(_el$278.nextSibling);
1344
+ insert(_el$264, statusIcon, _el$267, _co$55);
1345
+ insert(_el$264, () => data().name, _el$269, _co$56);
1346
+ insert(_el$263, createComponent(Show, {
1347
+ get when() {
1348
+ return data().row_count !== void 0;
1349
+ },
1350
+ get children() {
1351
+ var _el$270 = getNextElement(_tmpl$68), _el$272 = _el$270.firstChild, [_el$273, _co$57] = getNextMarker(_el$272.nextSibling);
1352
+ _el$273.nextSibling;
1353
+ insert(_el$270, () => {
1354
+ var _a;
1355
+ return (_a = data().row_count) == null ? void 0 : _a.toLocaleString();
1356
+ }, _el$273, _co$57);
1357
+ return _el$270;
1358
+ }
1359
+ }), _el$275, _co$58);
1360
+ insert(_el$276, createComponent(For, {
1361
+ get each() {
1362
+ return data().capabilities;
1363
+ },
1364
+ children: (cap) => (() => {
1365
+ var _el$280 = getNextElement(_tmpl$71), _el$282 = _el$280.firstChild, [_el$283, _co$60] = getNextMarker(_el$282.nextSibling), _el$281 = _el$283.nextSibling, _el$284 = _el$281.nextSibling, [_el$285, _co$61] = getNextMarker(_el$284.nextSibling);
1366
+ insert(_el$280, () => cap.supported ? "✅" : "❌", _el$283, _co$60);
1367
+ insert(_el$280, () => cap.label, _el$285, _co$61);
1368
+ effect(() => className(_el$280, `text-[10px] px-1.5 py-0.5 rounded ${cap.supported ? "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400" : "bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400"}`));
1369
+ return _el$280;
1370
+ })()
1371
+ }));
1372
+ insert(_el$262, createComponent(Show, {
1373
+ get when() {
1374
+ return data().freshness || data().latency_ms;
1375
+ },
1376
+ get children() {
1377
+ var _el$277 = getNextElement(_tmpl$69);
1378
+ insert(_el$277, () => [data().freshness, data().latency_ms ? `${data().latency_ms}ms` : ""].filter(Boolean).join(" · "));
1379
+ return _el$277;
1380
+ }
1381
+ }), _el$279, _co$59);
1382
+ return _el$262;
1383
+ })();
1384
+ };
1385
+ const DiffSection = (props) => {
1386
+ const data = () => {
1387
+ const c = props.content;
1388
+ return {
1389
+ left: (c == null ? void 0 : c.left) || {
1390
+ label: "A",
1391
+ rows: []
1392
+ },
1393
+ right: (c == null ? void 0 : c.right) || {
1394
+ label: "B",
1395
+ rows: []
1396
+ },
1397
+ highlight: (c == null ? void 0 : c.highlight_columns) || []
1398
+ };
1399
+ };
1400
+ const allKeys = () => {
1401
+ const l = data().left.rows[0] || {};
1402
+ const r = data().right.rows[0] || {};
1403
+ return [.../* @__PURE__ */ new Set([...Object.keys(l), ...Object.keys(r)])];
1404
+ };
1405
+ return (() => {
1406
+ var _el$286 = getNextElement(_tmpl$72), _el$287 = _el$286.firstChild, _el$288 = _el$287.firstChild, _el$289 = _el$288.firstChild, _el$290 = _el$289.firstChild, _el$291 = _el$290.nextSibling, _el$292 = _el$291.nextSibling, _el$293 = _el$288.nextSibling;
1407
+ insert(_el$291, () => data().left.label);
1408
+ insert(_el$292, () => data().right.label);
1409
+ insert(_el$293, createComponent(For, {
1410
+ get each() {
1411
+ return allKeys();
1412
+ },
1413
+ children: (key) => {
1414
+ const lVal = () => {
1415
+ var _a;
1416
+ return (_a = data().left.rows[0]) == null ? void 0 : _a[key];
1417
+ };
1418
+ const rVal = () => {
1419
+ var _a;
1420
+ return (_a = data().right.rows[0]) == null ? void 0 : _a[key];
1421
+ };
1422
+ const isDiff = () => String(lVal()) !== String(rVal()) && data().highlight.includes(key);
1423
+ return (() => {
1424
+ var _el$294 = getNextElement(_tmpl$73), _el$295 = _el$294.firstChild, _el$296 = _el$295.nextSibling, _el$297 = _el$296.nextSibling;
1425
+ insert(_el$295, key);
1426
+ insert(_el$296, (() => {
1427
+ var _c$6 = memo(() => lVal() !== void 0);
1428
+ return () => _c$6() ? String(lVal()) : "—";
1429
+ })());
1430
+ insert(_el$297, (() => {
1431
+ var _c$7 = memo(() => rVal() !== void 0);
1432
+ return () => _c$7() ? String(rVal()) : "—";
1433
+ })());
1434
+ effect(() => className(_el$294, `border-t border-gray-100 dark:border-gray-700 ${isDiff() ? "bg-yellow-50 dark:bg-yellow-900/10" : ""}`));
1435
+ return _el$294;
1436
+ })();
1437
+ }
1438
+ }));
1439
+ return _el$286;
1440
+ })();
1441
+ };
1110
1442
  delegateEvents(["click", "input"]);
1111
1443
  export {
1112
1444
  ScratchpadPanel