Spaces:
Sleeping
Sleeping
fix(tools): prevent selection of non-implemented tool outputs in tool edit form
Browse files
src/routes/tools/ToolEdit.svelte
CHANGED
|
@@ -506,16 +506,19 @@
|
|
| 506 |
{#if api.named_endpoints[editableTool.endpoint].returns.length > 1}
|
| 507 |
<div class="flex flex-row gap-4">
|
| 508 |
{#each api.named_endpoints[editableTool.endpoint].returns as { component }, idx}
|
| 509 |
-
<label>
|
| 510 |
<input
|
| 511 |
type="radio"
|
| 512 |
-
disabled={readonly
|
|
|
|
| 513 |
bind:group={editableTool.outputComponent}
|
| 514 |
value={idx + ";" + component.toLowerCase()}
|
| 515 |
name="outputComponent"
|
| 516 |
/>
|
| 517 |
<span
|
| 518 |
-
class="font-mono
|
|
|
|
|
|
|
| 519 |
class:font-semibold={editableTool?.outputComponent?.split(
|
| 520 |
";"
|
| 521 |
)[1] === component}>{component.toLowerCase()}-{idx}</span
|
|
|
|
| 506 |
{#if api.named_endpoints[editableTool.endpoint].returns.length > 1}
|
| 507 |
<div class="flex flex-row gap-4">
|
| 508 |
{#each api.named_endpoints[editableTool.endpoint].returns as { component }, idx}
|
| 509 |
+
<label class="text-gray-800">
|
| 510 |
<input
|
| 511 |
type="radio"
|
| 512 |
+
disabled={readonly ||
|
| 513 |
+
!ToolOutputComponents.safeParse(component).success}
|
| 514 |
bind:group={editableTool.outputComponent}
|
| 515 |
value={idx + ";" + component.toLowerCase()}
|
| 516 |
name="outputComponent"
|
| 517 |
/>
|
| 518 |
<span
|
| 519 |
+
class="font-mono"
|
| 520 |
+
class:text-gray-400={!ToolOutputComponents.safeParse(component)
|
| 521 |
+
.success}
|
| 522 |
class:font-semibold={editableTool?.outputComponent?.split(
|
| 523 |
";"
|
| 524 |
)[1] === component}>{component.toLowerCase()}-{idx}</span
|