@seed-ship/mcp-ui-solid 2.11.0 → 2.13.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.
Files changed (40) hide show
  1. package/README.md +4 -5
  2. package/dist/components/FormFieldRenderer.cjs +261 -223
  3. package/dist/components/FormFieldRenderer.cjs.map +1 -1
  4. package/dist/components/FormFieldRenderer.d.ts.map +1 -1
  5. package/dist/components/FormFieldRenderer.js +262 -224
  6. package/dist/components/FormFieldRenderer.js.map +1 -1
  7. package/dist/components/ScratchpadPanel.cjs +130 -13
  8. package/dist/components/ScratchpadPanel.cjs.map +1 -1
  9. package/dist/components/ScratchpadPanel.d.ts.map +1 -1
  10. package/dist/components/ScratchpadPanel.js +130 -13
  11. package/dist/components/ScratchpadPanel.js.map +1 -1
  12. package/dist/index.cjs +1 -0
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +2 -1
  18. package/dist/services/chat-bus.cjs +23 -0
  19. package/dist/services/chat-bus.cjs.map +1 -1
  20. package/dist/services/chat-bus.d.ts +13 -1
  21. package/dist/services/chat-bus.d.ts.map +1 -1
  22. package/dist/services/chat-bus.js +24 -1
  23. package/dist/services/chat-bus.js.map +1 -1
  24. package/dist/services/index.d.ts +1 -1
  25. package/dist/services/index.d.ts.map +1 -1
  26. package/dist/types/chat-bus.d.ts +3 -1
  27. package/dist/types/chat-bus.d.ts.map +1 -1
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types.d.cts +4 -0
  31. package/dist/types.d.ts +4 -0
  32. package/package.json +1 -1
  33. package/src/components/FormFieldRenderer.tsx +25 -3
  34. package/src/components/ScratchpadPanel.tsx +97 -6
  35. package/src/index.ts +1 -0
  36. package/src/services/chat-bus.ts +44 -0
  37. package/src/services/index.ts +1 -1
  38. package/src/types/chat-bus.ts +3 -1
  39. package/src/types/index.ts +6 -0
  40. package/tsconfig.tsbuildinfo +1 -1
@@ -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><!$><!/>`);
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",
@@ -39,6 +39,14 @@ const ScratchpadPanel = (props) => {
39
39
  const isCollapsible = () => props.collapsible !== false;
40
40
  const preview = () => localPreview() || props.state.preview;
41
41
  const hasFilters = () => Object.keys(props.state.filters || {}).length > 0;
42
+ const CLOSE_ALIASES = /* @__PURE__ */ new Set(["done", "close", "dismiss", "validate", "cancel", "sufficient"]);
43
+ const handleAction = (action, data) => {
44
+ var _a;
45
+ (_a = props.onAction) == null ? void 0 : _a.call(props, action, data);
46
+ if (CLOSE_ALIASES.has(action) && props.onClose) {
47
+ props.onClose();
48
+ }
49
+ };
42
50
  createEffect(() => {
43
51
  if (props.state.status === "complete" && props.autoCloseDelay) {
44
52
  const timer = setTimeout(() => {
@@ -165,9 +173,7 @@ const ScratchpadPanel = (props) => {
165
173
  get onFilterChange() {
166
174
  return props.onFilterChange;
167
175
  },
168
- get onAction() {
169
- return props.onAction;
170
- },
176
+ onAction: handleAction,
171
177
  get onSectionEdit() {
172
178
  return props.onSectionEdit;
173
179
  },
@@ -325,12 +331,9 @@ const ScratchpadPanel = (props) => {
325
331
  },
326
332
  get children() {
327
333
  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
- };
334
+ _el$40.$$click = () => handleAction("search", {
335
+ filters: props.state.filters
336
+ });
334
337
  runHydrationEvents();
335
338
  return _el$39;
336
339
  }
@@ -487,6 +490,17 @@ const SectionRenderer = (props) => {
487
490
  }
488
491
  });
489
492
  }
493
+ }), createComponent(Match, {
494
+ get when() {
495
+ return props.section.type === "stepper";
496
+ },
497
+ get children() {
498
+ return createComponent(StepperProgressSection, {
499
+ get content() {
500
+ return props.section.content;
501
+ }
502
+ });
503
+ }
490
504
  }), createComponent(Match, {
491
505
  when: true,
492
506
  get children() {
@@ -745,12 +759,16 @@ const EmbeddedFormSection = (props) => {
745
759
  const handleSubmit = (e) => {
746
760
  var _a;
747
761
  e.preventDefault();
762
+ const values = Object.fromEntries(Object.entries(formData()).filter(([key]) => {
763
+ const field = config().fields.find((f) => f.name === key);
764
+ return (field == null ? void 0 : field.fieldStatus) !== "unsupported";
765
+ }).filter(([, v]) => v !== void 0 && v !== "" && !(Array.isArray(v) && v.length === 0)));
748
766
  if (props.onSubmit) {
749
- props.onSubmit(props.sectionId, formData());
767
+ props.onSubmit(props.sectionId, values);
750
768
  } else {
751
769
  (_a = props.onAction) == null ? void 0 : _a.call(props, "submit_form", {
752
770
  sectionId: props.sectionId,
753
- values: formData()
771
+ values
754
772
  });
755
773
  }
756
774
  };
@@ -1103,6 +1121,105 @@ const PromptSection = (props) => {
1103
1121
  return _el$193;
1104
1122
  })();
1105
1123
  };
1124
+ const StepperProgressSection = (props) => {
1125
+ const data = () => {
1126
+ const c = props.content;
1127
+ return {
1128
+ steps: (c == null ? void 0 : c.steps) || [],
1129
+ orientation: (c == null ? void 0 : c.orientation) || "horizontal"
1130
+ };
1131
+ };
1132
+ const statusIcon = (status) => {
1133
+ switch (status) {
1134
+ case "done":
1135
+ return "✅";
1136
+ case "active":
1137
+ return "🔄";
1138
+ case "error":
1139
+ return "❌";
1140
+ default:
1141
+ return "⏳";
1142
+ }
1143
+ };
1144
+ const isHorizontal = () => data().orientation === "horizontal";
1145
+ return createComponent(Show, {
1146
+ get when() {
1147
+ return isHorizontal();
1148
+ },
1149
+ get fallback() {
1150
+ return (() => {
1151
+ var _el$219 = getNextElement(_tmpl$58);
1152
+ insert(_el$219, createComponent(For, {
1153
+ get each() {
1154
+ return data().steps;
1155
+ },
1156
+ children: (step) => (() => {
1157
+ 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);
1158
+ insert(_el$221, () => statusIcon(step.status));
1159
+ insert(_el$223, () => step.label);
1160
+ insert(_el$222, createComponent(Show, {
1161
+ get when() {
1162
+ return step.summary;
1163
+ },
1164
+ get children() {
1165
+ var _el$224 = getNextElement(_tmpl$59), _el$225 = _el$224.firstChild, _el$226 = _el$225.nextSibling, [_el$227, _co$46] = getNextMarker(_el$226.nextSibling);
1166
+ insert(_el$224, () => step.summary, _el$227, _co$46);
1167
+ return _el$224;
1168
+ }
1169
+ }), _el$234, _co$48);
1170
+ insert(_el$222, createComponent(Show, {
1171
+ get when() {
1172
+ return step.duration_ms;
1173
+ },
1174
+ get children() {
1175
+ var _el$228 = getNextElement(_tmpl$60), _el$229 = _el$228.firstChild, _el$231 = _el$229.nextSibling, [_el$232, _co$47] = getNextMarker(_el$231.nextSibling);
1176
+ _el$232.nextSibling;
1177
+ insert(_el$228, () => step.duration_ms, _el$232, _co$47);
1178
+ return _el$228;
1179
+ }
1180
+ }), _el$236, _co$49);
1181
+ 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"}`));
1182
+ return _el$220;
1183
+ })()
1184
+ }));
1185
+ return _el$219;
1186
+ })();
1187
+ },
1188
+ get children() {
1189
+ var _el$218 = getNextElement(_tmpl$57);
1190
+ insert(_el$218, createComponent(For, {
1191
+ get each() {
1192
+ return data().steps;
1193
+ },
1194
+ children: (step, i) => [createComponent(Show, {
1195
+ get when() {
1196
+ return i() > 0;
1197
+ },
1198
+ get children() {
1199
+ return getNextElement(_tmpl$12);
1200
+ }
1201
+ }), (() => {
1202
+ 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);
1203
+ insert(_el$239, () => statusIcon(step.status));
1204
+ insert(_el$240, () => step.label);
1205
+ insert(_el$238, createComponent(Show, {
1206
+ get when() {
1207
+ return step.summary;
1208
+ },
1209
+ get children() {
1210
+ var _el$241 = getNextElement(_tmpl$62);
1211
+ insert(_el$241, () => step.summary);
1212
+ return _el$241;
1213
+ }
1214
+ }), _el$243, _co$50);
1215
+ 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"}`));
1216
+ return _el$238;
1217
+ })()]
1218
+ }));
1219
+ return _el$218;
1220
+ }
1221
+ });
1222
+ };
1106
1223
  delegateEvents(["click", "input"]);
1107
1224
  export {
1108
1225
  ScratchpadPanel