@compose-market/theme 0.0.2 → 0.0.3
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.
- package/dist/components/RFAComponent.d.ts +10 -0
- package/dist/components/RFAComponent.d.ts.map +1 -0
- package/dist/components/RFAComponent.js +288 -0
- package/dist/components/RFAComponent.js.map +1 -0
- package/dist/components/RFADetails.d.ts +9 -0
- package/dist/components/RFADetails.d.ts.map +1 -0
- package/dist/components/RFADetails.js +407 -0
- package/dist/components/RFADetails.js.map +1 -0
- package/dist/components/agent-card.d.ts +8 -0
- package/dist/components/agent-card.d.ts.map +1 -0
- package/dist/components/agent-card.js +216 -0
- package/dist/components/agent-card.js.map +1 -0
- package/dist/components/backpack.d.ts +21 -0
- package/dist/components/backpack.d.ts.map +1 -0
- package/dist/components/backpack.js +905 -0
- package/dist/components/backpack.js.map +1 -0
- package/dist/components/blur.d.ts +9 -0
- package/dist/components/blur.d.ts.map +1 -0
- package/dist/components/blur.js +60 -0
- package/dist/components/blur.js.map +1 -0
- package/dist/components/brand/Logo.d.ts +3 -3
- package/dist/components/brand/Logo.d.ts.map +1 -1
- package/dist/components/brand/Logo.js +37 -4
- package/dist/components/brand/Logo.js.map +1 -1
- package/dist/components/chat.d.ts +68 -0
- package/dist/components/chat.d.ts.map +1 -0
- package/dist/components/chat.js +618 -0
- package/dist/components/chat.js.map +1 -0
- package/dist/components/compose/index.d.ts +10 -0
- package/dist/components/compose/index.d.ts.map +1 -0
- package/dist/components/compose/index.js +13 -0
- package/dist/components/compose/index.js.map +1 -0
- package/dist/components/compose/nodes/agent-node.d.ts +11 -0
- package/dist/components/compose/nodes/agent-node.d.ts.map +1 -0
- package/dist/components/compose/nodes/agent-node.js +101 -0
- package/dist/components/compose/nodes/agent-node.js.map +1 -0
- package/dist/components/compose/nodes/hook-node.d.ts +11 -0
- package/dist/components/compose/nodes/hook-node.d.ts.map +1 -0
- package/dist/components/compose/nodes/hook-node.js +100 -0
- package/dist/components/compose/nodes/hook-node.js.map +1 -0
- package/dist/components/compose/nodes/index.d.ts +60 -0
- package/dist/components/compose/nodes/index.d.ts.map +1 -0
- package/dist/components/compose/nodes/index.js +22 -0
- package/dist/components/compose/nodes/index.js.map +1 -0
- package/dist/components/compose/nodes/step-node.d.ts +11 -0
- package/dist/components/compose/nodes/step-node.d.ts.map +1 -0
- package/dist/components/compose/nodes/step-node.js +88 -0
- package/dist/components/compose/nodes/step-node.js.map +1 -0
- package/dist/components/compose/nodes/trigger-node.d.ts +11 -0
- package/dist/components/compose/nodes/trigger-node.d.ts.map +1 -0
- package/dist/components/compose/nodes/trigger-node.js +92 -0
- package/dist/components/compose/nodes/trigger-node.js.map +1 -0
- package/dist/components/compose/overlay.d.ts +26 -0
- package/dist/components/compose/overlay.d.ts.map +1 -0
- package/dist/components/compose/overlay.js +48 -0
- package/dist/components/compose/overlay.js.map +1 -0
- package/dist/components/compose/pickers/agents-picker.d.ts +18 -0
- package/dist/components/compose/pickers/agents-picker.d.ts.map +1 -0
- package/dist/components/compose/pickers/agents-picker.js +180 -0
- package/dist/components/compose/pickers/agents-picker.js.map +1 -0
- package/dist/components/compose/pickers/connector-detail.d.ts +16 -0
- package/dist/components/compose/pickers/connector-detail.d.ts.map +1 -0
- package/dist/components/compose/pickers/connector-detail.js +236 -0
- package/dist/components/compose/pickers/connector-detail.js.map +1 -0
- package/dist/components/compose/pickers/connector-picker.d.ts +13 -0
- package/dist/components/compose/pickers/connector-picker.d.ts.map +1 -0
- package/dist/components/compose/pickers/connector-picker.js +101 -0
- package/dist/components/compose/pickers/connector-picker.js.map +1 -0
- package/dist/components/compose/pickers/index.d.ts +10 -0
- package/dist/components/compose/pickers/index.d.ts.map +1 -0
- package/dist/components/compose/pickers/index.js +10 -0
- package/dist/components/compose/pickers/index.js.map +1 -0
- package/dist/components/compose/pickers/trigger-picker.d.ts +13 -0
- package/dist/components/compose/pickers/trigger-picker.d.ts.map +1 -0
- package/dist/components/compose/pickers/trigger-picker.js +110 -0
- package/dist/components/compose/pickers/trigger-picker.js.map +1 -0
- package/dist/components/compose/toolbox.d.ts +24 -0
- package/dist/components/compose/toolbox.d.ts.map +1 -0
- package/dist/components/compose/toolbox.js +183 -0
- package/dist/components/compose/toolbox.js.map +1 -0
- package/dist/components/connector.d.ts +24 -0
- package/dist/components/connector.d.ts.map +1 -0
- package/dist/components/connector.js +263 -0
- package/dist/components/connector.js.map +1 -0
- package/dist/components/dispenser.d.ts +15 -0
- package/dist/components/dispenser.d.ts.map +1 -0
- package/dist/components/dispenser.js +323 -0
- package/dist/components/dispenser.js.map +1 -0
- package/dist/components/layout/AppLayout.d.ts +60 -0
- package/dist/components/layout/AppLayout.d.ts.map +1 -0
- package/dist/components/layout/AppLayout.js +265 -0
- package/dist/components/layout/AppLayout.js.map +1 -0
- package/dist/components/layout/Layout.d.ts +6 -0
- package/dist/components/layout/Layout.d.ts.map +1 -0
- package/dist/components/layout/Layout.js +186 -0
- package/dist/components/layout/Layout.js.map +1 -0
- package/dist/components/layout/Sidebar.d.ts +3 -0
- package/dist/components/layout/Sidebar.d.ts.map +1 -0
- package/dist/components/layout/Sidebar.js +160 -0
- package/dist/components/layout/Sidebar.js.map +1 -0
- package/dist/components/layout/TopBar.d.ts +6 -0
- package/dist/components/layout/TopBar.d.ts.map +1 -0
- package/dist/components/layout/TopBar.js +36 -0
- package/dist/components/layout/TopBar.js.map +1 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/layout/index.js +2 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/lyria-player.d.ts +23 -0
- package/dist/components/lyria-player.d.ts.map +1 -0
- package/dist/components/lyria-player.js +241 -0
- package/dist/components/lyria-player.js.map +1 -0
- package/dist/components/manowar-card.d.ts +8 -0
- package/dist/components/manowar-card.d.ts.map +1 -0
- package/dist/components/manowar-card.js +349 -0
- package/dist/components/manowar-card.js.map +1 -0
- package/dist/components/mirror-pane.d.ts +55 -0
- package/dist/components/mirror-pane.d.ts.map +1 -0
- package/dist/components/mirror-pane.js +330 -0
- package/dist/components/mirror-pane.js.map +1 -0
- package/dist/components/model-selector.d.ts +12 -0
- package/dist/components/model-selector.d.ts.map +1 -0
- package/dist/components/model-selector.js +148 -0
- package/dist/components/model-selector.js.map +1 -0
- package/dist/components/output.d.ts +26 -0
- package/dist/components/output.d.ts.map +1 -0
- package/dist/components/output.js +259 -0
- package/dist/components/output.js.map +1 -0
- package/dist/components/partners.d.ts +13 -0
- package/dist/components/partners.d.ts.map +1 -0
- package/dist/components/partners.js +210 -0
- package/dist/components/partners.js.map +1 -0
- package/dist/components/plugin-tester.d.ts +13 -0
- package/dist/components/plugin-tester.d.ts.map +1 -0
- package/dist/components/plugin-tester.js +907 -0
- package/dist/components/plugin-tester.js.map +1 -0
- package/dist/components/session/SessionComponents.d.ts +2 -0
- package/dist/components/session/SessionComponents.d.ts.map +1 -0
- package/dist/components/session/SessionComponents.js +2 -0
- package/dist/components/session/SessionComponents.js.map +1 -0
- package/dist/components/session/index.d.ts +2 -0
- package/dist/components/session/index.d.ts.map +1 -0
- package/dist/components/session/index.js +2 -0
- package/dist/components/session/index.js.map +1 -0
- package/dist/components/session.d.ts +3 -3
- package/dist/components/session.d.ts.map +1 -1
- package/dist/components/session.js +315 -15
- package/dist/components/session.js.map +1 -1
- package/dist/components/share-dialog.d.ts +9 -0
- package/dist/components/share-dialog.d.ts.map +1 -0
- package/dist/components/share-dialog.js +49 -0
- package/dist/components/share-dialog.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +6 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +20 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +29 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +5 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +22 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +5 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +12 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +2 -4
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +16 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +28 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +10 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +27 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +2 -5
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +78 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +6 -11
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +6 -7
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +9 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +110 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +28 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +168 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +12 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +7 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +16 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +38 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +21 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +52 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +10 -11
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +15 -7
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +28 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +15 -22
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +28 -10
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.d.ts +10 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +33 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +23 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +82 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/form.d.ts +11 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +71 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +5 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +9 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +13 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +63 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +6 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +25 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +8 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +19 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +67 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +9 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +10 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +23 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +64 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +11 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +34 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/network-selector.d.ts +22 -0
- package/dist/components/ui/network-selector.d.ts.map +1 -0
- package/dist/components/ui/network-selector.js +99 -0
- package/dist/components/ui/network-selector.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +29 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +32 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +12 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +1 -3
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +3 -2
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +18 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +13 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +19 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +12 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +51 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +7 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +19 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +46 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +58 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +246 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +3 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +12 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +16 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +7 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +9 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +22 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +6 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +13 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +8 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +12 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +35 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +19 -0
- package/dist/components/ui/toaster.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +4 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +27 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +4 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +25 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +6 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +13 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/visual/ManowarField.d.ts +9 -0
- package/dist/components/visual/ManowarField.d.ts.map +1 -0
- package/dist/components/visual/ManowarField.js +111 -0
- package/dist/components/visual/ManowarField.js.map +1 -0
- package/dist/components/warp-form.d.ts +22 -0
- package/dist/components/warp-form.d.ts.map +1 -0
- package/dist/components/warp-form.js +743 -0
- package/dist/components/warp-form.js.map +1 -0
- package/dist/css/dark.css +38 -0
- package/dist/css/index.css +9 -0
- package/dist/css/index.d.ts +16 -0
- package/dist/css/index.d.ts.map +1 -0
- package/dist/css/index.js +96 -0
- package/dist/css/index.js.map +1 -0
- package/dist/css/light.css +70 -0
- package/dist/css/tokens.css +24 -0
- package/dist/hooks/use-agents.d.ts +17 -0
- package/dist/hooks/use-agents.d.ts.map +1 -0
- package/dist/hooks/use-agents.js +64 -0
- package/dist/hooks/use-agents.js.map +1 -0
- package/dist/hooks/use-api.d.ts +28 -0
- package/dist/hooks/use-api.d.ts.map +1 -0
- package/dist/hooks/use-api.js +114 -0
- package/dist/hooks/use-api.js.map +1 -0
- package/dist/hooks/use-chat.d.ts +64 -0
- package/dist/hooks/use-chat.d.ts.map +1 -0
- package/dist/hooks/use-chat.js +350 -0
- package/dist/hooks/use-chat.js.map +1 -0
- package/dist/hooks/use-coordinator.d.ts +41 -0
- package/dist/hooks/use-coordinator.d.ts.map +1 -0
- package/dist/hooks/use-coordinator.js +110 -0
- package/dist/hooks/use-coordinator.js.map +1 -0
- package/dist/hooks/use-dispenser.d.ts +68 -0
- package/dist/hooks/use-dispenser.d.ts.map +1 -0
- package/dist/hooks/use-dispenser.js +113 -0
- package/dist/hooks/use-dispenser.js.map +1 -0
- package/dist/hooks/use-lyria.d.ts +58 -0
- package/dist/hooks/use-lyria.d.ts.map +1 -0
- package/dist/hooks/use-lyria.js +254 -0
- package/dist/hooks/use-lyria.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-model.d.ts +34 -0
- package/dist/hooks/use-model.d.ts.map +1 -0
- package/dist/hooks/use-model.js +105 -0
- package/dist/hooks/use-model.js.map +1 -0
- package/dist/hooks/use-motion-governor.d.ts +10 -0
- package/dist/hooks/use-motion-governor.d.ts.map +1 -0
- package/dist/hooks/use-motion-governor.js +63 -0
- package/dist/hooks/use-motion-governor.js.map +1 -0
- package/dist/hooks/use-multichain.d.ts +34 -0
- package/dist/hooks/use-multichain.d.ts.map +1 -0
- package/dist/hooks/use-multichain.js +120 -0
- package/dist/hooks/use-multichain.js.map +1 -0
- package/dist/hooks/use-onchain.d.ts +145 -0
- package/dist/hooks/use-onchain.d.ts.map +1 -0
- package/dist/hooks/use-onchain.js +652 -0
- package/dist/hooks/use-onchain.js.map +1 -0
- package/dist/hooks/use-registry.d.ts +140 -0
- package/dist/hooks/use-registry.d.ts.map +1 -0
- package/dist/hooks/use-registry.js +264 -0
- package/dist/hooks/use-registry.js.map +1 -0
- package/dist/hooks/use-services.d.ts +66 -0
- package/dist/hooks/use-services.d.ts.map +1 -0
- package/dist/hooks/use-services.js +216 -0
- package/dist/hooks/use-services.js.map +1 -0
- package/dist/hooks/use-session.d.ts +36 -0
- package/dist/hooks/use-session.d.ts.map +1 -0
- package/dist/hooks/use-session.js +449 -0
- package/dist/hooks/use-session.js.map +1 -0
- package/dist/hooks/use-sse.d.ts +8 -0
- package/dist/hooks/use-sse.d.ts.map +1 -0
- package/dist/hooks/use-sse.js +86 -0
- package/dist/hooks/use-sse.js.map +1 -0
- package/dist/hooks/use-tabs.d.ts +2 -0
- package/dist/hooks/use-tabs.d.ts.map +1 -0
- package/dist/hooks/use-tabs.js +43 -0
- package/dist/hooks/use-tabs.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +41 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/hooks/use-triggers.d.ts +51 -0
- package/dist/hooks/use-triggers.d.ts.map +1 -0
- package/dist/hooks/use-triggers.js +212 -0
- package/dist/hooks/use-triggers.js.map +1 -0
- package/dist/hooks/use-warp.d.ts +53 -0
- package/dist/hooks/use-warp.d.ts.map +1 -0
- package/dist/hooks/use-warp.js +231 -0
- package/dist/hooks/use-warp.js.map +1 -0
- package/dist/hooks/use-workflow.d.ts +40 -0
- package/dist/hooks/use-workflow.d.ts.map +1 -0
- package/dist/hooks/use-workflow.js +358 -0
- package/dist/hooks/use-workflow.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/agents.d.ts +186 -0
- package/dist/lib/agents.d.ts.map +1 -0
- package/dist/lib/agents.js +633 -0
- package/dist/lib/agents.js.map +1 -0
- package/dist/lib/api.d.ts +224 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +443 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/chains.d.ts +151 -0
- package/dist/lib/chains.d.ts.map +1 -0
- package/dist/lib/chains.js +297 -0
- package/dist/lib/chains.js.map +1 -0
- package/dist/lib/contracts.d.ts +960 -0
- package/dist/lib/contracts.d.ts.map +1 -0
- package/dist/lib/contracts.js +716 -0
- package/dist/lib/contracts.js.map +1 -0
- package/dist/lib/cronos/aa.d.ts +111 -0
- package/dist/lib/cronos/aa.d.ts.map +1 -0
- package/dist/lib/cronos/aa.js +312 -0
- package/dist/lib/cronos/aa.js.map +1 -0
- package/dist/lib/cronos/facilitator.d.ts +87 -0
- package/dist/lib/cronos/facilitator.d.ts.map +1 -0
- package/dist/lib/cronos/facilitator.js +183 -0
- package/dist/lib/cronos/facilitator.js.map +1 -0
- package/dist/lib/evm.d.ts +45 -0
- package/dist/lib/evm.d.ts.map +1 -0
- package/dist/lib/evm.js +78 -0
- package/dist/lib/evm.js.map +1 -0
- package/dist/lib/mockData.d.ts +26 -0
- package/dist/lib/mockData.d.ts.map +1 -0
- package/dist/lib/mockData.js +89 -0
- package/dist/lib/mockData.js.map +1 -0
- package/dist/lib/models.d.ts +122 -0
- package/dist/lib/models.d.ts.map +1 -0
- package/dist/lib/models.js +174 -0
- package/dist/lib/models.js.map +1 -0
- package/dist/lib/multimodal.d.ts +53 -0
- package/dist/lib/multimodal.d.ts.map +1 -0
- package/dist/lib/multimodal.js +204 -0
- package/dist/lib/multimodal.js.map +1 -0
- package/dist/lib/payment.d.ts +67 -0
- package/dist/lib/payment.d.ts.map +1 -0
- package/dist/lib/payment.js +236 -0
- package/dist/lib/payment.js.map +1 -0
- package/dist/lib/pinata.d.ts +140 -0
- package/dist/lib/pinata.d.ts.map +1 -0
- package/dist/lib/pinata.js +209 -0
- package/dist/lib/pinata.js.map +1 -0
- package/dist/lib/queryClient.d.ts +9 -0
- package/dist/lib/queryClient.d.ts.map +1 -0
- package/dist/lib/queryClient.js +42 -0
- package/dist/lib/queryClient.js.map +1 -0
- package/dist/lib/services.d.ts +164 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/services.js +304 -0
- package/dist/lib/services.js.map +1 -0
- package/dist/lib/share.d.ts +12 -0
- package/dist/lib/share.d.ts.map +1 -0
- package/dist/lib/share.js +39 -0
- package/dist/lib/share.js.map +1 -0
- package/dist/lib/triggers.d.ts +128 -0
- package/dist/lib/triggers.d.ts.map +1 -0
- package/dist/lib/triggers.js +305 -0
- package/dist/lib/triggers.js.map +1 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/tailwind/preset.d.ts +282 -0
- package/dist/tailwind/preset.d.ts.map +1 -0
- package/dist/tailwind/preset.js +144 -0
- package/dist/tailwind/preset.js.map +1 -0
- package/package.json +9 -45
|
@@ -0,0 +1,907 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Tester Component
|
|
3
|
+
*
|
|
4
|
+
* Unified testing interface for GOAT, MCP, and Eliza plugins.
|
|
5
|
+
* Extracts all plugin testing functionality from the playground page.
|
|
6
|
+
*/
|
|
7
|
+
import React, { useState, useEffect, useRef, useCallback, useMemo } from "react";
|
|
8
|
+
import { useActiveWallet, useActiveAccount } from "thirdweb/react";
|
|
9
|
+
import { inferencePriceWei } from "@/lib/chains.js";
|
|
10
|
+
import { createPaymentFetch } from "@/lib/payment";
|
|
11
|
+
import { useChain } from "@/contexts/ChainContext";
|
|
12
|
+
import { useSession } from "@/hooks/use-session";
|
|
13
|
+
import { Button } from "@/components/ui/button";
|
|
14
|
+
import { Badge } from "@/components/ui/badge";
|
|
15
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
|
16
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
17
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
18
|
+
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
|
19
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/components/ui/command";
|
|
20
|
+
import { cn } from "@/lib/utils";
|
|
21
|
+
import { useRegistryServers } from "@/hooks/use-registry";
|
|
22
|
+
import { Loader2, RefreshCw, Trash2, Plug, Play, Terminal, AlertCircle, ExternalLink, ChevronsUpDown, Check, } from "lucide-react";
|
|
23
|
+
const API_BASE = (import.meta.env.VITE_API_URL || "https://api.compose.market").replace(/\/+$/, "");
|
|
24
|
+
const CONNECTOR_URL = (import.meta.env.VITE_CONNECTOR_URL || "https://services.compose.market/connector").replace(/\/+$/, "");
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// Helpers
|
|
27
|
+
// =============================================================================
|
|
28
|
+
function generateDefaultArgs(schema) {
|
|
29
|
+
const result = {};
|
|
30
|
+
const props = schema.properties;
|
|
31
|
+
if (!props)
|
|
32
|
+
return result;
|
|
33
|
+
for (const [key, prop] of Object.entries(props)) {
|
|
34
|
+
if (prop.default !== undefined) {
|
|
35
|
+
result[key] = prop.default;
|
|
36
|
+
}
|
|
37
|
+
else if (prop.type === "string") {
|
|
38
|
+
if (key.toLowerCase().includes("address")) {
|
|
39
|
+
result[key] = "0x...";
|
|
40
|
+
}
|
|
41
|
+
else if (key.toLowerCase().includes("amount")) {
|
|
42
|
+
result[key] = "0";
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
result[key] = "";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (prop.type === "number" || prop.type === "integer") {
|
|
49
|
+
result[key] = 0;
|
|
50
|
+
}
|
|
51
|
+
else if (prop.type === "boolean") {
|
|
52
|
+
result[key] = false;
|
|
53
|
+
}
|
|
54
|
+
else if (prop.type === "array") {
|
|
55
|
+
result[key] = [];
|
|
56
|
+
}
|
|
57
|
+
else if (prop.type === "object") {
|
|
58
|
+
result[key] = {};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
function formatSchemaHint(schema) {
|
|
64
|
+
const props = schema.properties;
|
|
65
|
+
const required = schema.required || [];
|
|
66
|
+
if (!props)
|
|
67
|
+
return "No parameters required";
|
|
68
|
+
const lines = [];
|
|
69
|
+
for (const [key, prop] of Object.entries(props)) {
|
|
70
|
+
const isRequired = required.includes(key);
|
|
71
|
+
const desc = prop.description || "";
|
|
72
|
+
lines.push(`• ${key}${isRequired ? " *" : ""} (${prop.type || "any"}): ${desc}`);
|
|
73
|
+
}
|
|
74
|
+
return lines.join("\n");
|
|
75
|
+
}
|
|
76
|
+
// =============================================================================
|
|
77
|
+
// Component
|
|
78
|
+
// =============================================================================
|
|
79
|
+
export function PluginTester({ sessionActive, budgetRemaining, formatBudget, initialSource = "goat", initialPlugin = "", }) {
|
|
80
|
+
const wallet = useActiveWallet();
|
|
81
|
+
const account = useActiveAccount();
|
|
82
|
+
const { paymentChainId } = useChain();
|
|
83
|
+
const { composeKeyToken, ensureComposeKeyToken } = useSession();
|
|
84
|
+
const resultsEndRef = useRef(null);
|
|
85
|
+
// Common state
|
|
86
|
+
const [pluginSource, setPluginSource] = useState(initialSource);
|
|
87
|
+
const [pluginsLoading, setPluginsLoading] = useState(false);
|
|
88
|
+
const [selectedTool, setSelectedTool] = useState("");
|
|
89
|
+
const [toolArgs, setToolArgs] = useState("{}");
|
|
90
|
+
const [toolSchema, setToolSchema] = useState(null);
|
|
91
|
+
const [pluginResults, setPluginResults] = useState([]);
|
|
92
|
+
const [executingPlugin, setExecutingPlugin] = useState(false);
|
|
93
|
+
const [pluginError, setPluginError] = useState(null);
|
|
94
|
+
// GOAT state
|
|
95
|
+
const [goatStatus, setGoatStatus] = useState(null);
|
|
96
|
+
const [pluginTools, setPluginTools] = useState([]);
|
|
97
|
+
const [selectedPlugin, setSelectedPlugin] = useState(initialSource !== "mcp" ? initialPlugin : "");
|
|
98
|
+
// MCP state - fetched from centralized registry
|
|
99
|
+
const mcpRegistryOptions = useMemo(() => ({ origin: 'mcp', available: true }), []);
|
|
100
|
+
const { data: mcpRegistryData, isLoading: mcpLoading, forceRefresh: forceRefreshMcpRegistry } = useRegistryServers(mcpRegistryOptions);
|
|
101
|
+
const mcpServers = mcpRegistryData?.servers ?? [];
|
|
102
|
+
const [mcpServerSearch, setMcpServerSearch] = useState("");
|
|
103
|
+
const [mcpTools, setMcpTools] = useState([]);
|
|
104
|
+
const [selectedMcpServer, setSelectedMcpServer] = useState(initialSource === "mcp" && initialPlugin ? `mcp:${initialPlugin}` : "");
|
|
105
|
+
// Eliza state
|
|
106
|
+
const [elizaPlugins, setElizaPlugins] = useState([]);
|
|
107
|
+
const [elizaActions, setElizaActions] = useState([]);
|
|
108
|
+
const [selectedElizaPlugin, setSelectedElizaPlugin] = useState(initialSource === "eliza" ? initialPlugin : "");
|
|
109
|
+
const [selectedElizaAction, setSelectedElizaAction] = useState("");
|
|
110
|
+
// Filtered MCP servers
|
|
111
|
+
const MAX_MCP_DROPDOWN_ITEMS = 50;
|
|
112
|
+
const filteredMcpServers = useMemo(() => {
|
|
113
|
+
if (!mcpServerSearch.trim()) {
|
|
114
|
+
return mcpServers.slice(0, MAX_MCP_DROPDOWN_ITEMS);
|
|
115
|
+
}
|
|
116
|
+
const query = mcpServerSearch.toLowerCase().trim();
|
|
117
|
+
return mcpServers
|
|
118
|
+
.filter(s => s.name?.toLowerCase().includes(query) ||
|
|
119
|
+
s.slug?.toLowerCase().includes(query) ||
|
|
120
|
+
s.description?.toLowerCase().includes(query))
|
|
121
|
+
.slice(0, MAX_MCP_DROPDOWN_ITEMS);
|
|
122
|
+
}, [mcpServers, mcpServerSearch]);
|
|
123
|
+
// ==========================================================================
|
|
124
|
+
// GOAT Handlers
|
|
125
|
+
// ==========================================================================
|
|
126
|
+
const fetchPluginStatus = async () => {
|
|
127
|
+
setPluginsLoading(true);
|
|
128
|
+
try {
|
|
129
|
+
const response = await fetch(`${CONNECTOR_URL}/plugins/status`);
|
|
130
|
+
if (!response.ok)
|
|
131
|
+
throw new Error(`Failed to fetch status: ${response.status}`);
|
|
132
|
+
const data = await response.json();
|
|
133
|
+
setGoatStatus(data);
|
|
134
|
+
if (!selectedPlugin && data.plugins?.length > 0) {
|
|
135
|
+
setSelectedPlugin(data.plugins[0].id);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
console.error("Failed to fetch plugin status:", err);
|
|
140
|
+
setPluginError(err instanceof Error ? err.message : "Failed to connect to plugin server");
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
setPluginsLoading(false);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const fetchPluginTools = async (pluginId) => {
|
|
147
|
+
try {
|
|
148
|
+
const response = await fetch(`${CONNECTOR_URL}/plugins/${encodeURIComponent(pluginId)}/tools`);
|
|
149
|
+
if (!response.ok)
|
|
150
|
+
throw new Error(`Failed to fetch tools: ${response.status}`);
|
|
151
|
+
const data = await response.json();
|
|
152
|
+
setPluginTools(data.tools || []);
|
|
153
|
+
if (data.tools?.length > 0) {
|
|
154
|
+
setSelectedTool(data.tools[0].name);
|
|
155
|
+
setToolSchema(data.tools[0].parameters);
|
|
156
|
+
const defaultArgs = data.tools[0].example || generateDefaultArgs(data.tools[0].parameters);
|
|
157
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch (err) {
|
|
161
|
+
console.error("Failed to fetch plugin tools:", err);
|
|
162
|
+
setPluginTools([]);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const currentTool = pluginTools.find(t => t.name === selectedTool);
|
|
166
|
+
const handleToolSelect = useCallback((toolName) => {
|
|
167
|
+
setSelectedTool(toolName);
|
|
168
|
+
const tool = pluginTools.find(t => t.name === toolName);
|
|
169
|
+
if (tool) {
|
|
170
|
+
setToolSchema(tool.parameters);
|
|
171
|
+
const defaultArgs = tool.example || generateDefaultArgs(tool.parameters);
|
|
172
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
173
|
+
}
|
|
174
|
+
}, [pluginTools]);
|
|
175
|
+
const handlePluginChange = useCallback((pluginId) => {
|
|
176
|
+
setSelectedPlugin(pluginId);
|
|
177
|
+
setSelectedTool("");
|
|
178
|
+
setToolSchema(null);
|
|
179
|
+
setToolArgs("{}");
|
|
180
|
+
}, []);
|
|
181
|
+
const handleExecutePlugin = useCallback(async () => {
|
|
182
|
+
if (!selectedPlugin || !selectedTool || executingPlugin)
|
|
183
|
+
return;
|
|
184
|
+
if (!wallet) {
|
|
185
|
+
setPluginError("Connect wallet to execute plugins");
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
let args = {};
|
|
189
|
+
try {
|
|
190
|
+
args = JSON.parse(toolArgs);
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
setPluginError(`Invalid JSON: ${e instanceof Error ? e.message : "Parse error"}`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
setExecutingPlugin(true);
|
|
197
|
+
setPluginError(null);
|
|
198
|
+
try {
|
|
199
|
+
const activeComposeKeyToken = composeKeyToken || await ensureComposeKeyToken();
|
|
200
|
+
// Chain-aware payment: routes to selected chain
|
|
201
|
+
const fetchWithPayment = createPaymentFetch({
|
|
202
|
+
chainId: paymentChainId,
|
|
203
|
+
account: account,
|
|
204
|
+
wallet,
|
|
205
|
+
maxValue: BigInt(inferencePriceWei),
|
|
206
|
+
sessionToken: activeComposeKeyToken || undefined,
|
|
207
|
+
});
|
|
208
|
+
const response = await fetchWithPayment(`${CONNECTOR_URL}/plugins/${encodeURIComponent(selectedPlugin)}/execute`, {
|
|
209
|
+
method: "POST",
|
|
210
|
+
headers: { "Content-Type": "application/json" },
|
|
211
|
+
body: JSON.stringify({ tool: selectedTool, args }),
|
|
212
|
+
});
|
|
213
|
+
const data = await response.json();
|
|
214
|
+
const result = {
|
|
215
|
+
success: data.success ?? response.ok,
|
|
216
|
+
pluginId: selectedPlugin,
|
|
217
|
+
tool: selectedTool,
|
|
218
|
+
result: data.result,
|
|
219
|
+
error: data.error || data.hint,
|
|
220
|
+
txHash: data.txHash,
|
|
221
|
+
explorer: data.explorer,
|
|
222
|
+
executedBy: data.executedBy,
|
|
223
|
+
source: "goat",
|
|
224
|
+
};
|
|
225
|
+
setPluginResults(prev => [...prev, result]);
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
const errorMsg = err instanceof Error ? err.message : "Unknown error";
|
|
229
|
+
setPluginError(errorMsg);
|
|
230
|
+
setPluginResults(prev => [
|
|
231
|
+
...prev,
|
|
232
|
+
{ success: false, pluginId: selectedPlugin, tool: selectedTool, error: errorMsg, source: "goat" },
|
|
233
|
+
]);
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
setExecutingPlugin(false);
|
|
237
|
+
}
|
|
238
|
+
}, [selectedPlugin, selectedTool, toolArgs, executingPlugin, wallet, paymentChainId, account, composeKeyToken, ensureComposeKeyToken]);
|
|
239
|
+
// ==========================================================================
|
|
240
|
+
// MCP Handlers
|
|
241
|
+
// ==========================================================================
|
|
242
|
+
const fetchMcpTools = async (slug) => {
|
|
243
|
+
setPluginsLoading(true);
|
|
244
|
+
try {
|
|
245
|
+
const response = await fetch(`${CONNECTOR_URL}/mcp/servers/${encodeURIComponent(slug)}/tools`);
|
|
246
|
+
if (!response.ok)
|
|
247
|
+
throw new Error(`Failed to fetch MCP tools: ${response.status}`);
|
|
248
|
+
const data = await response.json();
|
|
249
|
+
setMcpTools(data.tools || []);
|
|
250
|
+
if (data.tools?.length > 0) {
|
|
251
|
+
setSelectedTool(data.tools[0].name);
|
|
252
|
+
setToolSchema(data.tools[0].inputSchema);
|
|
253
|
+
const defaultArgs = generateDefaultArgs(data.tools[0].inputSchema);
|
|
254
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
console.error("Failed to fetch MCP tools:", err);
|
|
259
|
+
setMcpTools([]);
|
|
260
|
+
setPluginError(err instanceof Error ? err.message : "Failed to fetch tools");
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
setPluginsLoading(false);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
const handleMcpServerChange = useCallback((registryId) => {
|
|
267
|
+
setSelectedMcpServer(registryId);
|
|
268
|
+
setSelectedTool("");
|
|
269
|
+
setToolSchema(null);
|
|
270
|
+
setToolArgs("{}");
|
|
271
|
+
setMcpTools([]);
|
|
272
|
+
}, []);
|
|
273
|
+
const handleMcpToolSelect = useCallback((toolName) => {
|
|
274
|
+
setSelectedTool(toolName);
|
|
275
|
+
const tool = mcpTools.find(t => t.name === toolName);
|
|
276
|
+
if (tool) {
|
|
277
|
+
setToolSchema(tool.inputSchema);
|
|
278
|
+
const defaultArgs = generateDefaultArgs(tool.inputSchema);
|
|
279
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
280
|
+
}
|
|
281
|
+
}, [mcpTools]);
|
|
282
|
+
const currentMcpTool = mcpTools.find(t => t.name === selectedTool);
|
|
283
|
+
const handleExecuteMcpTool = useCallback(async () => {
|
|
284
|
+
if (!selectedMcpServer || !selectedTool || executingPlugin)
|
|
285
|
+
return;
|
|
286
|
+
if (!wallet) {
|
|
287
|
+
setPluginError("Connect wallet to execute MCP tools");
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
let args = {};
|
|
291
|
+
try {
|
|
292
|
+
args = JSON.parse(toolArgs);
|
|
293
|
+
}
|
|
294
|
+
catch (e) {
|
|
295
|
+
setPluginError(`Invalid JSON: ${e instanceof Error ? e.message : "Parse error"}`);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
setExecutingPlugin(true);
|
|
299
|
+
setPluginError(null);
|
|
300
|
+
try {
|
|
301
|
+
const activeComposeKeyToken = composeKeyToken || await ensureComposeKeyToken();
|
|
302
|
+
// Chain-aware payment: routes to selected chain
|
|
303
|
+
const fetchWithPayment = createPaymentFetch({
|
|
304
|
+
chainId: paymentChainId,
|
|
305
|
+
account: account,
|
|
306
|
+
wallet,
|
|
307
|
+
maxValue: BigInt(inferencePriceWei),
|
|
308
|
+
sessionToken: activeComposeKeyToken || undefined,
|
|
309
|
+
});
|
|
310
|
+
const response = await fetchWithPayment(`${API_BASE}/api/mcp/servers/${encodeURIComponent(selectedMcpServer)}/call`, {
|
|
311
|
+
method: "POST",
|
|
312
|
+
headers: { "Content-Type": "application/json" },
|
|
313
|
+
body: JSON.stringify({ tool: selectedTool, args }),
|
|
314
|
+
});
|
|
315
|
+
const data = await response.json();
|
|
316
|
+
const result = {
|
|
317
|
+
success: data.success ?? response.ok,
|
|
318
|
+
pluginId: selectedMcpServer,
|
|
319
|
+
tool: selectedTool,
|
|
320
|
+
result: data.content,
|
|
321
|
+
error: data.error || data.message,
|
|
322
|
+
source: "mcp",
|
|
323
|
+
};
|
|
324
|
+
setPluginResults(prev => [...prev, result]);
|
|
325
|
+
}
|
|
326
|
+
catch (err) {
|
|
327
|
+
const errorMsg = err instanceof Error ? err.message : "Unknown error";
|
|
328
|
+
setPluginError(errorMsg);
|
|
329
|
+
setPluginResults(prev => [
|
|
330
|
+
...prev,
|
|
331
|
+
{ success: false, pluginId: selectedMcpServer, tool: selectedTool, error: errorMsg, source: "mcp" },
|
|
332
|
+
]);
|
|
333
|
+
}
|
|
334
|
+
finally {
|
|
335
|
+
setExecutingPlugin(false);
|
|
336
|
+
}
|
|
337
|
+
}, [selectedMcpServer, selectedTool, toolArgs, executingPlugin, wallet, paymentChainId, account, composeKeyToken, ensureComposeKeyToken]);
|
|
338
|
+
// ==========================================================================
|
|
339
|
+
// Eliza Handlers
|
|
340
|
+
// ==========================================================================
|
|
341
|
+
const fetchElizaPlugins = async () => {
|
|
342
|
+
setPluginsLoading(true);
|
|
343
|
+
try {
|
|
344
|
+
const response = await fetch(`${CONNECTOR_URL}/eliza/plugins`);
|
|
345
|
+
if (!response.ok)
|
|
346
|
+
throw new Error(`Failed to fetch Eliza plugins: ${response.status}`);
|
|
347
|
+
const data = await response.json();
|
|
348
|
+
setElizaPlugins(data.plugins || []);
|
|
349
|
+
}
|
|
350
|
+
catch (err) {
|
|
351
|
+
console.error("Failed to fetch Eliza plugins:", err);
|
|
352
|
+
setPluginError(err instanceof Error ? err.message : "Failed to fetch Eliza plugins");
|
|
353
|
+
}
|
|
354
|
+
finally {
|
|
355
|
+
setPluginsLoading(false);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
const fetchElizaActions = async (pluginId) => {
|
|
359
|
+
setPluginsLoading(true);
|
|
360
|
+
setElizaActions([]);
|
|
361
|
+
try {
|
|
362
|
+
const response = await fetch(`${CONNECTOR_URL}/eliza/plugins/${encodeURIComponent(pluginId)}/actions`);
|
|
363
|
+
if (!response.ok) {
|
|
364
|
+
const errorData = await response.json().catch(() => ({}));
|
|
365
|
+
throw new Error(errorData.error || `Failed to fetch actions: ${response.status}`);
|
|
366
|
+
}
|
|
367
|
+
const data = await response.json();
|
|
368
|
+
setElizaActions(data.actions || []);
|
|
369
|
+
if (data.actions?.length > 0) {
|
|
370
|
+
handleElizaActionChange(data.actions[0].name);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
console.error("Failed to fetch Eliza actions:", err);
|
|
375
|
+
setPluginError(err instanceof Error ? err.message : "Failed to fetch actions");
|
|
376
|
+
}
|
|
377
|
+
finally {
|
|
378
|
+
setPluginsLoading(false);
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
const handleElizaPluginChange = (pluginId) => {
|
|
382
|
+
setSelectedElizaPlugin(pluginId);
|
|
383
|
+
setSelectedElizaAction("");
|
|
384
|
+
setElizaActions([]);
|
|
385
|
+
setSelectedTool("");
|
|
386
|
+
setToolSchema(null);
|
|
387
|
+
setToolArgs("{}");
|
|
388
|
+
setPluginError(null);
|
|
389
|
+
if (pluginId)
|
|
390
|
+
fetchElizaActions(pluginId);
|
|
391
|
+
};
|
|
392
|
+
const handleElizaActionChange = (actionName) => {
|
|
393
|
+
setSelectedElizaAction(actionName);
|
|
394
|
+
setSelectedTool(actionName);
|
|
395
|
+
setPluginError(null);
|
|
396
|
+
const action = elizaActions.find(a => a.name === actionName);
|
|
397
|
+
if (action) {
|
|
398
|
+
const defaultArgs = {};
|
|
399
|
+
for (const param of action.parameters) {
|
|
400
|
+
if (param.example !== undefined) {
|
|
401
|
+
defaultArgs[param.name] = param.example;
|
|
402
|
+
}
|
|
403
|
+
else if (param.default !== undefined) {
|
|
404
|
+
defaultArgs[param.name] = param.default;
|
|
405
|
+
}
|
|
406
|
+
else if (param.required) {
|
|
407
|
+
switch (param.type) {
|
|
408
|
+
case "string":
|
|
409
|
+
defaultArgs[param.name] = param.enum?.[0] || "";
|
|
410
|
+
break;
|
|
411
|
+
case "number":
|
|
412
|
+
defaultArgs[param.name] = 0;
|
|
413
|
+
break;
|
|
414
|
+
case "boolean":
|
|
415
|
+
defaultArgs[param.name] = false;
|
|
416
|
+
break;
|
|
417
|
+
case "array":
|
|
418
|
+
defaultArgs[param.name] = [];
|
|
419
|
+
break;
|
|
420
|
+
case "object":
|
|
421
|
+
defaultArgs[param.name] = {};
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
427
|
+
setToolSchema({
|
|
428
|
+
properties: action.parameters.reduce((acc, p) => {
|
|
429
|
+
acc[p.name] = { type: p.type, description: p.description, enum: p.enum, default: p.default };
|
|
430
|
+
return acc;
|
|
431
|
+
}, {}),
|
|
432
|
+
required: action.parameters.filter(p => p.required).map(p => p.name),
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
const handleElizaExecution = useCallback(async () => {
|
|
437
|
+
if (!selectedElizaPlugin || !selectedElizaAction || executingPlugin)
|
|
438
|
+
return;
|
|
439
|
+
if (!wallet) {
|
|
440
|
+
setPluginError("Connect wallet to execute Eliza actions");
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
let params = {};
|
|
444
|
+
try {
|
|
445
|
+
params = JSON.parse(toolArgs);
|
|
446
|
+
}
|
|
447
|
+
catch (e) {
|
|
448
|
+
setPluginError(`Invalid JSON: ${e instanceof Error ? e.message : "Parse error"}`);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
setExecutingPlugin(true);
|
|
452
|
+
setPluginError(null);
|
|
453
|
+
try {
|
|
454
|
+
const activeComposeKeyToken = composeKeyToken || await ensureComposeKeyToken();
|
|
455
|
+
// Chain-aware payment: routes to selected chain
|
|
456
|
+
const fetchWithPayment = createPaymentFetch({
|
|
457
|
+
chainId: paymentChainId,
|
|
458
|
+
account: account,
|
|
459
|
+
wallet,
|
|
460
|
+
maxValue: BigInt(inferencePriceWei),
|
|
461
|
+
sessionToken: activeComposeKeyToken || undefined,
|
|
462
|
+
});
|
|
463
|
+
const response = await fetchWithPayment(`${CONNECTOR_URL}/eliza/plugins/${encodeURIComponent(selectedElizaPlugin)}/execute`, {
|
|
464
|
+
method: "POST",
|
|
465
|
+
headers: { "Content-Type": "application/json" },
|
|
466
|
+
body: JSON.stringify({ action: selectedElizaAction, params }),
|
|
467
|
+
});
|
|
468
|
+
const data = await response.json();
|
|
469
|
+
const result = {
|
|
470
|
+
success: data.success ?? response.ok,
|
|
471
|
+
pluginId: selectedElizaPlugin,
|
|
472
|
+
tool: selectedElizaAction,
|
|
473
|
+
result: data.result || data.text,
|
|
474
|
+
error: data.error,
|
|
475
|
+
source: "eliza",
|
|
476
|
+
executionTime: data.executionTime,
|
|
477
|
+
};
|
|
478
|
+
setPluginResults(prev => [...prev, result]);
|
|
479
|
+
}
|
|
480
|
+
catch (err) {
|
|
481
|
+
const errorMsg = err instanceof Error ? err.message : "Unknown error";
|
|
482
|
+
setPluginError(errorMsg);
|
|
483
|
+
setPluginResults(prev => [
|
|
484
|
+
...prev,
|
|
485
|
+
{ success: false, pluginId: selectedElizaPlugin, tool: selectedElizaAction, error: errorMsg, source: "eliza" },
|
|
486
|
+
]);
|
|
487
|
+
}
|
|
488
|
+
finally {
|
|
489
|
+
setExecutingPlugin(false);
|
|
490
|
+
}
|
|
491
|
+
}, [selectedElizaPlugin, selectedElizaAction, toolArgs, executingPlugin, wallet, paymentChainId, account, composeKeyToken, ensureComposeKeyToken]);
|
|
492
|
+
// ==========================================================================
|
|
493
|
+
// Source Change Handler
|
|
494
|
+
// ==========================================================================
|
|
495
|
+
const handleSourceChange = useCallback((source) => {
|
|
496
|
+
setPluginSource(source);
|
|
497
|
+
setSelectedTool("");
|
|
498
|
+
setToolSchema(null);
|
|
499
|
+
setToolArgs("{}");
|
|
500
|
+
setPluginError(null);
|
|
501
|
+
if (source !== "goat")
|
|
502
|
+
setSelectedPlugin("");
|
|
503
|
+
if (source !== "mcp")
|
|
504
|
+
setSelectedMcpServer("");
|
|
505
|
+
if (source !== "eliza") {
|
|
506
|
+
setSelectedElizaPlugin("");
|
|
507
|
+
setSelectedElizaAction("");
|
|
508
|
+
}
|
|
509
|
+
}, []);
|
|
510
|
+
const handleClearResults = useCallback(() => {
|
|
511
|
+
setPluginResults([]);
|
|
512
|
+
setPluginError(null);
|
|
513
|
+
}, []);
|
|
514
|
+
// ==========================================================================
|
|
515
|
+
// Effects
|
|
516
|
+
// ==========================================================================
|
|
517
|
+
useEffect(() => {
|
|
518
|
+
if (pluginSource === "goat" && !goatStatus) {
|
|
519
|
+
fetchPluginStatus();
|
|
520
|
+
}
|
|
521
|
+
else if (pluginSource === "eliza" && elizaPlugins.length === 0) {
|
|
522
|
+
fetchElizaPlugins();
|
|
523
|
+
}
|
|
524
|
+
}, [pluginSource, goatStatus, elizaPlugins.length]);
|
|
525
|
+
useEffect(() => {
|
|
526
|
+
if (selectedMcpServer && pluginSource === "mcp") {
|
|
527
|
+
const slug = selectedMcpServer.replace(/^mcp:/, '');
|
|
528
|
+
if (slug)
|
|
529
|
+
fetchMcpTools(slug);
|
|
530
|
+
}
|
|
531
|
+
}, [selectedMcpServer, pluginSource]);
|
|
532
|
+
useEffect(() => {
|
|
533
|
+
if (selectedPlugin && pluginSource === "goat") {
|
|
534
|
+
fetchPluginTools(selectedPlugin);
|
|
535
|
+
}
|
|
536
|
+
}, [selectedPlugin, pluginSource]);
|
|
537
|
+
useEffect(() => {
|
|
538
|
+
if (selectedElizaPlugin && pluginSource === "eliza") {
|
|
539
|
+
fetchElizaActions(selectedElizaPlugin);
|
|
540
|
+
}
|
|
541
|
+
}, [selectedElizaPlugin, pluginSource]);
|
|
542
|
+
useEffect(() => {
|
|
543
|
+
resultsEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
544
|
+
}, [pluginResults]);
|
|
545
|
+
// ==========================================================================
|
|
546
|
+
// Render
|
|
547
|
+
// ==========================================================================
|
|
548
|
+
return (<div className="flex flex-col h-full">
|
|
549
|
+
{/* Header: Source and Plugin/Server selectors */}
|
|
550
|
+
<div className="shrink-0 p-3 lg:p-4 border-b border-zinc-800">
|
|
551
|
+
<div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 flex-wrap">
|
|
552
|
+
{/* Source selector */}
|
|
553
|
+
<Select value={pluginSource} onValueChange={(v) => handleSourceChange(v)}>
|
|
554
|
+
<SelectTrigger className="w-full sm:w-28 lg:w-32 bg-zinc-900 border-zinc-700 h-9">
|
|
555
|
+
<SelectValue />
|
|
556
|
+
</SelectTrigger>
|
|
557
|
+
<SelectContent className="bg-zinc-900 border-zinc-700">
|
|
558
|
+
<SelectItem value="goat">
|
|
559
|
+
<div className="flex items-center gap-2">
|
|
560
|
+
<Badge className="bg-green-500/20 text-green-400 border-green-500/40 text-[10px] px-1.5">GOAT</Badge>
|
|
561
|
+
<span className="text-[10px] text-zinc-500">DeFi</span>
|
|
562
|
+
</div>
|
|
563
|
+
</SelectItem>
|
|
564
|
+
<SelectItem value="mcp">
|
|
565
|
+
<div className="flex items-center gap-2">
|
|
566
|
+
<Badge className="bg-purple-500/20 text-purple-400 border-purple-500/40 text-[10px] px-1.5">MCP</Badge>
|
|
567
|
+
<span className="text-[10px] text-zinc-500">Servers</span>
|
|
568
|
+
</div>
|
|
569
|
+
</SelectItem>
|
|
570
|
+
<SelectItem value="eliza">
|
|
571
|
+
<div className="flex items-center gap-2">
|
|
572
|
+
<Badge className="bg-fuchsia-500/20 text-fuchsia-400 border-fuchsia-500/40 text-[10px] px-1.5">Eliza</Badge>
|
|
573
|
+
<span className="text-[10px] text-zinc-500">AI Agents</span>
|
|
574
|
+
</div>
|
|
575
|
+
</SelectItem>
|
|
576
|
+
</SelectContent>
|
|
577
|
+
</Select>
|
|
578
|
+
|
|
579
|
+
{/* GOAT Plugin selector */}
|
|
580
|
+
{pluginSource === "goat" && (<>
|
|
581
|
+
<Select value={selectedPlugin} onValueChange={handlePluginChange} disabled={!goatStatus?.plugins?.length}>
|
|
582
|
+
<SelectTrigger className="w-full sm:w-40 lg:w-52 bg-zinc-900 border-zinc-700 h-9">
|
|
583
|
+
<SelectValue placeholder={pluginsLoading ? "Loading..." : "Select plugin"}/>
|
|
584
|
+
</SelectTrigger>
|
|
585
|
+
<SelectContent className="bg-zinc-900 border-zinc-700 max-h-80">
|
|
586
|
+
{!goatStatus?.plugins?.length ? (<div className="p-2 text-zinc-500 text-sm">No plugins available</div>) : (goatStatus.plugins.map((plugin) => (<SelectItem key={plugin.id} value={plugin.id}>
|
|
587
|
+
<div className="flex items-center gap-2">
|
|
588
|
+
<span className="font-mono text-xs">{plugin.name}</span>
|
|
589
|
+
<Badge variant="outline" className="text-[9px] px-1 py-0">{plugin.toolCount}</Badge>
|
|
590
|
+
</div>
|
|
591
|
+
</SelectItem>)))}
|
|
592
|
+
</SelectContent>
|
|
593
|
+
</Select>
|
|
594
|
+
|
|
595
|
+
<Select value={selectedTool} onValueChange={handleToolSelect} disabled={pluginTools.length === 0}>
|
|
596
|
+
<SelectTrigger className="w-full sm:flex-1 lg:w-56 xl:w-72 bg-zinc-900 border-zinc-700 h-9">
|
|
597
|
+
<SelectValue placeholder={pluginTools.length === 0 ? "Select plugin first" : "Select tool"}/>
|
|
598
|
+
</SelectTrigger>
|
|
599
|
+
<SelectContent className="bg-zinc-900 border-zinc-700 max-h-96">
|
|
600
|
+
{pluginTools.length === 0 ? (<div className="p-2 text-zinc-500 text-sm">No tools available</div>) : (pluginTools.map((tool) => (<SelectItem key={tool.name} value={tool.name}>
|
|
601
|
+
<div className="flex flex-col py-0.5">
|
|
602
|
+
<span className="font-mono text-xs">{tool.name}</span>
|
|
603
|
+
<span className="text-[10px] text-zinc-500 truncate max-w-64">{tool.description}</span>
|
|
604
|
+
</div>
|
|
605
|
+
</SelectItem>)))}
|
|
606
|
+
</SelectContent>
|
|
607
|
+
</Select>
|
|
608
|
+
|
|
609
|
+
{goatStatus && (<div className="flex items-center gap-2 text-xs">
|
|
610
|
+
<div className={cn("w-2 h-2 rounded-full", goatStatus.initialized ? "bg-emerald-500" : "bg-red-500")}/>
|
|
611
|
+
<span className="text-zinc-500">
|
|
612
|
+
{goatStatus.initialized ? `${goatStatus.totalTools} tools • ${goatStatus.chain}` : "Offline"}
|
|
613
|
+
</span>
|
|
614
|
+
</div>)}
|
|
615
|
+
</>)}
|
|
616
|
+
|
|
617
|
+
{/* MCP Server selector */}
|
|
618
|
+
{pluginSource === "mcp" && (<>
|
|
619
|
+
<Popover>
|
|
620
|
+
<PopoverTrigger asChild>
|
|
621
|
+
<Button variant="outline" role="combobox" className="w-full sm:w-40 lg:w-52 bg-zinc-900 border-zinc-700 h-9 justify-between text-left font-normal">
|
|
622
|
+
<span className="truncate font-mono text-xs">
|
|
623
|
+
{mcpLoading
|
|
624
|
+
? "Loading..."
|
|
625
|
+
: selectedMcpServer
|
|
626
|
+
? mcpServers.find(s => s.registryId === selectedMcpServer)?.name || selectedMcpServer.replace(/^mcp:/, '')
|
|
627
|
+
: "Select server..."}
|
|
628
|
+
</span>
|
|
629
|
+
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50"/>
|
|
630
|
+
</Button>
|
|
631
|
+
</PopoverTrigger>
|
|
632
|
+
<PopoverContent className="w-[300px] p-0 bg-zinc-900 border-zinc-700" align="start">
|
|
633
|
+
<Command className="bg-zinc-900" shouldFilter={false}>
|
|
634
|
+
<CommandInput placeholder="Search servers..." className="h-9" value={mcpServerSearch} onValueChange={setMcpServerSearch}/>
|
|
635
|
+
<CommandList className="max-h-[300px]">
|
|
636
|
+
{mcpLoading ? (<div className="p-4 text-center text-zinc-500">
|
|
637
|
+
<Loader2 className="h-4 w-4 animate-spin mx-auto mb-2"/>
|
|
638
|
+
Loading servers...
|
|
639
|
+
</div>) : filteredMcpServers.length === 0 ? (<CommandEmpty>No servers match "{mcpServerSearch}"</CommandEmpty>) : (<CommandGroup heading={mcpServerSearch ? `${filteredMcpServers.length} matches` : `Showing ${filteredMcpServers.length} of ${mcpServers.length.toLocaleString()}`}>
|
|
640
|
+
{filteredMcpServers.map((server) => (<CommandItem key={server.registryId} value={server.registryId} onSelect={() => {
|
|
641
|
+
handleMcpServerChange(server.registryId);
|
|
642
|
+
setMcpServerSearch("");
|
|
643
|
+
}} className="cursor-pointer">
|
|
644
|
+
<div className="flex items-center gap-2 w-full">
|
|
645
|
+
<Check className={cn("h-4 w-4 shrink-0", selectedMcpServer === server.registryId ? "opacity-100" : "opacity-0")}/>
|
|
646
|
+
<div className="flex flex-col min-w-0 flex-1">
|
|
647
|
+
<span className="font-mono text-xs truncate">{server.name || server.slug}</span>
|
|
648
|
+
<span className="text-[10px] text-zinc-500 truncate">{server.description || "No description"}</span>
|
|
649
|
+
</div>
|
|
650
|
+
{server.transport === 'http' && (<Badge variant="outline" className="text-[9px] px-1 py-0 border-cyan-500/50 text-cyan-400 shrink-0">remote</Badge>)}
|
|
651
|
+
</div>
|
|
652
|
+
</CommandItem>))}
|
|
653
|
+
</CommandGroup>)}
|
|
654
|
+
</CommandList>
|
|
655
|
+
</Command>
|
|
656
|
+
</PopoverContent>
|
|
657
|
+
</Popover>
|
|
658
|
+
|
|
659
|
+
<Select value={selectedTool} onValueChange={handleMcpToolSelect} disabled={mcpTools.length === 0}>
|
|
660
|
+
<SelectTrigger className="w-full sm:flex-1 lg:w-56 xl:w-72 bg-zinc-900 border-zinc-700 h-9">
|
|
661
|
+
<SelectValue placeholder={mcpTools.length === 0 ? "Select server first" : "Select tool"}/>
|
|
662
|
+
</SelectTrigger>
|
|
663
|
+
<SelectContent className="bg-zinc-900 border-zinc-700 max-h-96">
|
|
664
|
+
{mcpTools.length === 0 ? (<div className="p-2 text-zinc-500 text-sm">No tools available</div>) : (mcpTools.map((tool) => (<SelectItem key={tool.name} value={tool.name}>
|
|
665
|
+
<div className="flex flex-col py-0.5">
|
|
666
|
+
<span className="font-mono text-xs">{tool.name}</span>
|
|
667
|
+
<span className="text-[10px] text-zinc-500 truncate max-w-48 sm:max-w-64">{tool.description || "No description"}</span>
|
|
668
|
+
</div>
|
|
669
|
+
</SelectItem>)))}
|
|
670
|
+
</SelectContent>
|
|
671
|
+
</Select>
|
|
672
|
+
|
|
673
|
+
<div className="flex items-center gap-2 text-[10px] sm:text-xs shrink-0">
|
|
674
|
+
<div className={cn("w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full", mcpServers.length > 0 ? "bg-purple-500" : "bg-zinc-500")}/>
|
|
675
|
+
<span className="text-zinc-500">
|
|
676
|
+
{mcpServers.length > 0 ? `${mcpServers.length.toLocaleString()} servers` : "Loading..."}
|
|
677
|
+
</span>
|
|
678
|
+
</div>
|
|
679
|
+
</>)}
|
|
680
|
+
|
|
681
|
+
{/* Eliza Plugin selector */}
|
|
682
|
+
{pluginSource === "eliza" && (<>
|
|
683
|
+
<Select value={selectedElizaPlugin} onValueChange={handleElizaPluginChange} disabled={elizaPlugins.length === 0}>
|
|
684
|
+
<SelectTrigger className="w-full sm:w-40 lg:w-52 bg-zinc-900 border-zinc-700 h-9">
|
|
685
|
+
<SelectValue placeholder={pluginsLoading ? "Loading..." : "Select plugin"}/>
|
|
686
|
+
</SelectTrigger>
|
|
687
|
+
<SelectContent className="bg-zinc-900 border-zinc-700 max-h-80">
|
|
688
|
+
{elizaPlugins.length === 0 ? (<div className="p-2 text-zinc-500 text-sm">No plugins available</div>) : (elizaPlugins.map((plugin) => (<SelectItem key={plugin.id} value={plugin.id}>
|
|
689
|
+
<div className="flex items-center gap-2">
|
|
690
|
+
<span className="font-mono text-xs truncate max-w-24 sm:max-w-40">{plugin.id}</span>
|
|
691
|
+
{plugin.version && (<Badge variant="outline" className="text-[9px] px-1 py-0 text-zinc-500 hidden sm:flex">{plugin.version}</Badge>)}
|
|
692
|
+
</div>
|
|
693
|
+
</SelectItem>)))}
|
|
694
|
+
</SelectContent>
|
|
695
|
+
</Select>
|
|
696
|
+
|
|
697
|
+
<Select value={selectedElizaAction} onValueChange={handleElizaActionChange} disabled={elizaActions.length === 0}>
|
|
698
|
+
<SelectTrigger className="w-full sm:flex-1 lg:w-56 xl:w-72 bg-zinc-900 border-zinc-700 h-9">
|
|
699
|
+
<SelectValue placeholder={elizaActions.length === 0 ? "Select plugin first" : "Select action"}/>
|
|
700
|
+
</SelectTrigger>
|
|
701
|
+
<SelectContent className="bg-zinc-900 border-zinc-700 max-h-96">
|
|
702
|
+
{elizaActions.length === 0 ? (<div className="p-2 text-zinc-500 text-sm">No actions available</div>) : (elizaActions.map((action) => (<SelectItem key={action.name} value={action.name}>
|
|
703
|
+
<div className="flex flex-col py-0.5">
|
|
704
|
+
<span className="font-mono text-xs">{action.name}</span>
|
|
705
|
+
<span className="text-[10px] text-zinc-500 truncate max-w-48 sm:max-w-64">{action.description}</span>
|
|
706
|
+
</div>
|
|
707
|
+
</SelectItem>)))}
|
|
708
|
+
</SelectContent>
|
|
709
|
+
</Select>
|
|
710
|
+
|
|
711
|
+
<div className="flex items-center gap-2 text-[10px] sm:text-xs shrink-0">
|
|
712
|
+
<div className={cn("w-1.5 h-1.5 sm:w-2 sm:h-2 rounded-full", elizaPlugins.length > 0 ? "bg-fuchsia-500" : "bg-zinc-500")}/>
|
|
713
|
+
<span className="text-zinc-500">
|
|
714
|
+
{elizaPlugins.length > 0 ? `${elizaPlugins.length} plugins` : "Loading..."}
|
|
715
|
+
</span>
|
|
716
|
+
</div>
|
|
717
|
+
</>)}
|
|
718
|
+
|
|
719
|
+
<Button variant="ghost" size="icon" onClick={pluginSource === "goat" ? fetchPluginStatus : pluginSource === "eliza" ? fetchElizaPlugins : () => forceRefreshMcpRegistry()} disabled={pluginsLoading || mcpLoading} className="text-zinc-400 hover:text-white shrink-0 h-8 w-8 sm:h-9 sm:w-9" title="Refresh">
|
|
720
|
+
<RefreshCw className={cn("h-3.5 w-3.5 sm:h-4 sm:w-4", (pluginsLoading || mcpLoading) && "animate-spin")}/>
|
|
721
|
+
</Button>
|
|
722
|
+
</div>
|
|
723
|
+
</div>
|
|
724
|
+
|
|
725
|
+
{/* Results Area */}
|
|
726
|
+
<ScrollArea className="flex-1 p-4 min-h-0">
|
|
727
|
+
<div className="space-y-4 max-w-4xl mx-auto">
|
|
728
|
+
{pluginResults.length === 0 ? (<div className="text-center py-8 text-zinc-500">
|
|
729
|
+
<Plug className="h-12 w-12 mx-auto mb-4 opacity-50"/>
|
|
730
|
+
<p className="text-lg">
|
|
731
|
+
Test {pluginSource === "goat" ? "GOAT DeFi" : pluginSource === "mcp" ? "MCP Server" : "Eliza AI"} Actions
|
|
732
|
+
</p>
|
|
733
|
+
<p className="text-sm mt-2">
|
|
734
|
+
{sessionActive
|
|
735
|
+
? `Budget: ${formatBudget(budgetRemaining)} • Select a ${pluginSource === "goat" ? "plugin" : pluginSource === "mcp" ? "server" : "plugin"} and ${pluginSource === "eliza" ? "action" : "tool"} to execute`
|
|
736
|
+
: "Start a session to begin"}
|
|
737
|
+
</p>
|
|
738
|
+
|
|
739
|
+
{pluginSource === "goat" && goatStatus?.plugins && goatStatus.plugins.length > 0 && (<div className="mt-6 text-left max-w-2xl mx-auto">
|
|
740
|
+
<p className="text-xs text-zinc-600 uppercase tracking-wider mb-3">
|
|
741
|
+
{goatStatus.plugins.length} Plugins • {goatStatus.totalTools} Tools
|
|
742
|
+
</p>
|
|
743
|
+
<div className="grid grid-cols-2 gap-2 text-xs">
|
|
744
|
+
{goatStatus.plugins.map((plugin) => (<button key={plugin.id} onClick={() => handlePluginChange(plugin.id)} className={cn("bg-zinc-900 rounded-lg p-3 border text-left transition-colors", selectedPlugin === plugin.id
|
|
745
|
+
? "border-green-500/50 bg-green-950/20"
|
|
746
|
+
: "border-zinc-800 hover:border-zinc-700")}>
|
|
747
|
+
<div className="flex items-center justify-between mb-1">
|
|
748
|
+
<span className="text-green-400 font-mono text-xs">{plugin.name}</span>
|
|
749
|
+
<Badge variant="outline" className="text-[9px]">{plugin.toolCount}</Badge>
|
|
750
|
+
</div>
|
|
751
|
+
<p className="text-zinc-500 text-[10px] line-clamp-2">{plugin.description}</p>
|
|
752
|
+
</button>))}
|
|
753
|
+
</div>
|
|
754
|
+
</div>)}
|
|
755
|
+
|
|
756
|
+
{pluginSource === "mcp" && mcpServers.length > 0 && (<div className="mt-6 text-left max-w-md mx-auto">
|
|
757
|
+
<p className="text-xs text-zinc-600 uppercase tracking-wider mb-3 text-center">
|
|
758
|
+
{mcpServers.length.toLocaleString()} MCP Servers Available
|
|
759
|
+
</p>
|
|
760
|
+
<p className="text-zinc-500 text-sm text-center">
|
|
761
|
+
Use the <span className="text-purple-400 font-mono">Select server</span> dropdown above to search and select from all available servers.
|
|
762
|
+
</p>
|
|
763
|
+
</div>)}
|
|
764
|
+
|
|
765
|
+
{pluginSource === "eliza" && elizaPlugins.length > 0 && (<div className="mt-6 text-left max-w-2xl mx-auto">
|
|
766
|
+
<p className="text-xs text-zinc-600 uppercase tracking-wider mb-3">
|
|
767
|
+
{elizaPlugins.length} ElizaOS Plugins Available
|
|
768
|
+
</p>
|
|
769
|
+
<div className="grid grid-cols-2 gap-2 text-xs">
|
|
770
|
+
{elizaPlugins.slice(0, 8).map((plugin) => (<button key={plugin.id} onClick={() => handleElizaPluginChange(plugin.id)} className={cn("bg-zinc-900 rounded-lg p-3 border text-left transition-colors", selectedElizaPlugin === plugin.id
|
|
771
|
+
? "border-fuchsia-500/50 bg-fuchsia-950/20"
|
|
772
|
+
: "border-zinc-800 hover:border-zinc-700")}>
|
|
773
|
+
<div className="flex items-center justify-between mb-1">
|
|
774
|
+
<span className="text-fuchsia-400 font-mono text-xs">{plugin.id}</span>
|
|
775
|
+
{plugin.version && (<Badge variant="outline" className="text-[9px] text-zinc-500">{plugin.version}</Badge>)}
|
|
776
|
+
</div>
|
|
777
|
+
<p className="text-zinc-500 text-[10px] line-clamp-2">{plugin.description || "No description"}</p>
|
|
778
|
+
</button>))}
|
|
779
|
+
</div>
|
|
780
|
+
</div>)}
|
|
781
|
+
|
|
782
|
+
{pluginsLoading && (<div className="mt-6">
|
|
783
|
+
<Loader2 className="h-5 w-5 animate-spin mx-auto text-cyan-400"/>
|
|
784
|
+
<p className="mt-2 text-sm">
|
|
785
|
+
Loading {pluginSource === "goat" ? "plugins" : pluginSource === "mcp" ? "servers" : "plugins"}...
|
|
786
|
+
</p>
|
|
787
|
+
</div>)}
|
|
788
|
+
</div>) : (pluginResults.map((result, index) => (<div key={index} className={cn("rounded-lg p-4 border", result.success
|
|
789
|
+
? "bg-emerald-950/30 border-emerald-800"
|
|
790
|
+
: "bg-red-950/30 border-red-800")}>
|
|
791
|
+
<div className="flex items-center gap-2 mb-2 flex-wrap">
|
|
792
|
+
<Terminal className="h-4 w-4 text-zinc-400"/>
|
|
793
|
+
<Badge className={cn("text-[10px] px-1.5", result.source === "mcp"
|
|
794
|
+
? "bg-purple-500/20 text-purple-400 border-purple-500/40"
|
|
795
|
+
: result.source === "eliza"
|
|
796
|
+
? "bg-fuchsia-500/20 text-fuchsia-400 border-fuchsia-500/40"
|
|
797
|
+
: "bg-green-500/20 text-green-400 border-green-500/40")}>
|
|
798
|
+
{result.source === "mcp" ? "MCP" : result.source === "eliza" ? "Eliza" : "GOAT"}
|
|
799
|
+
</Badge>
|
|
800
|
+
<span className="font-mono text-sm text-zinc-300">
|
|
801
|
+
{result.pluginId}/{result.tool}
|
|
802
|
+
</span>
|
|
803
|
+
<Badge variant={result.success ? "default" : "destructive"} className="text-xs">
|
|
804
|
+
{result.success ? "Success" : "Failed"}
|
|
805
|
+
</Badge>
|
|
806
|
+
{result.explorer && (<a href={result.explorer} target="_blank" rel="noopener noreferrer" className="text-xs text-cyan-400 hover:underline flex items-center gap-1">
|
|
807
|
+
View TX <ExternalLink className="h-3 w-3"/>
|
|
808
|
+
</a>)}
|
|
809
|
+
{result.executedBy && (<span className="text-[10px] text-zinc-600">
|
|
810
|
+
by {result.executedBy.slice(0, 6)}...{result.executedBy.slice(-4)}
|
|
811
|
+
</span>)}
|
|
812
|
+
</div>
|
|
813
|
+
<pre className="text-xs text-zinc-400 overflow-auto max-h-48 font-mono bg-zinc-900/50 rounded p-2">
|
|
814
|
+
{result.error || JSON.stringify(result.result, null, 2)}
|
|
815
|
+
</pre>
|
|
816
|
+
</div>)))}
|
|
817
|
+
<div ref={resultsEndRef}/>
|
|
818
|
+
</div>
|
|
819
|
+
</ScrollArea>
|
|
820
|
+
|
|
821
|
+
{/* Input with schema hints */}
|
|
822
|
+
<div className="shrink-0 border-t border-zinc-800 p-4">
|
|
823
|
+
<div className="max-w-4xl mx-auto space-y-3">
|
|
824
|
+
{/* Tool/Action description & schema hint */}
|
|
825
|
+
{(pluginSource === "goat" ? currentTool : pluginSource === "mcp" ? currentMcpTool : elizaActions.find(a => a.name === selectedElizaAction)) && (<div className="bg-zinc-900/50 rounded-lg p-3 border border-zinc-800">
|
|
826
|
+
<div className="flex items-center gap-2 mb-2">
|
|
827
|
+
<Terminal className={cn("h-4 w-4", pluginSource === "goat" ? "text-green-400" : pluginSource === "mcp" ? "text-purple-400" : "text-fuchsia-400")}/>
|
|
828
|
+
<Badge className={cn("text-[10px] px-1.5", pluginSource === "goat"
|
|
829
|
+
? "bg-green-500/20 text-green-400 border-green-500/40"
|
|
830
|
+
: pluginSource === "mcp"
|
|
831
|
+
? "bg-purple-500/20 text-purple-400 border-purple-500/40"
|
|
832
|
+
: "bg-fuchsia-500/20 text-fuchsia-400 border-fuchsia-500/40")}>
|
|
833
|
+
{pluginSource === "goat" ? "GOAT" : pluginSource === "mcp" ? "MCP" : "Eliza"}
|
|
834
|
+
</Badge>
|
|
835
|
+
<span className={cn("font-mono text-sm", pluginSource === "goat" ? "text-green-400" : pluginSource === "mcp" ? "text-purple-400" : "text-fuchsia-400")}>
|
|
836
|
+
{pluginSource === "goat"
|
|
837
|
+
? currentTool?.name
|
|
838
|
+
: pluginSource === "mcp"
|
|
839
|
+
? currentMcpTool?.name
|
|
840
|
+
: elizaActions.find(a => a.name === selectedElizaAction)?.name}
|
|
841
|
+
</span>
|
|
842
|
+
</div>
|
|
843
|
+
<p className="text-xs text-zinc-400 mb-2">
|
|
844
|
+
{pluginSource === "goat"
|
|
845
|
+
? currentTool?.description
|
|
846
|
+
: pluginSource === "mcp"
|
|
847
|
+
? (currentMcpTool?.description || "No description available")
|
|
848
|
+
: (elizaActions.find(a => a.name === selectedElizaAction)?.description || "No description available")}
|
|
849
|
+
</p>
|
|
850
|
+
{toolSchema && (<div className="mt-2 pt-2 border-t border-zinc-800">
|
|
851
|
+
<p className="text-[10px] text-zinc-500 uppercase mb-1">Parameters (* = required)</p>
|
|
852
|
+
<pre className="text-[10px] text-zinc-500 font-mono whitespace-pre-wrap">
|
|
853
|
+
{formatSchemaHint(toolSchema)}
|
|
854
|
+
</pre>
|
|
855
|
+
</div>)}
|
|
856
|
+
</div>)}
|
|
857
|
+
|
|
858
|
+
<div className="flex gap-2">
|
|
859
|
+
<Button variant="ghost" size="icon" onClick={handleClearResults} className="text-zinc-400 hover:text-white shrink-0" title="Clear results">
|
|
860
|
+
<Trash2 className="h-4 w-4"/>
|
|
861
|
+
</Button>
|
|
862
|
+
<div className="flex-1 relative">
|
|
863
|
+
<Textarea value={toolArgs} onChange={(e) => setToolArgs(e.target.value)} placeholder='{"key": "value"}' className="bg-zinc-900 border-zinc-700 font-mono text-sm min-h-20 pr-20"/>
|
|
864
|
+
<div className="absolute right-2 top-2 flex gap-1">
|
|
865
|
+
<Button variant="ghost" size="sm" onClick={() => {
|
|
866
|
+
if (pluginSource === "goat" && currentTool) {
|
|
867
|
+
const defaultArgs = currentTool.example || generateDefaultArgs(currentTool.parameters);
|
|
868
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
869
|
+
}
|
|
870
|
+
else if (pluginSource === "mcp" && currentMcpTool) {
|
|
871
|
+
const defaultArgs = generateDefaultArgs(currentMcpTool.inputSchema);
|
|
872
|
+
setToolArgs(JSON.stringify(defaultArgs, null, 2));
|
|
873
|
+
}
|
|
874
|
+
}} className="h-6 px-2 text-[10px] text-zinc-500 hover:text-white" title="Reset to defaults">
|
|
875
|
+
Reset
|
|
876
|
+
</Button>
|
|
877
|
+
</div>
|
|
878
|
+
</div>
|
|
879
|
+
<Button onClick={pluginSource === "goat"
|
|
880
|
+
? handleExecutePlugin
|
|
881
|
+
: pluginSource === "mcp"
|
|
882
|
+
? handleExecuteMcpTool
|
|
883
|
+
: handleElizaExecution} disabled={!sessionActive ||
|
|
884
|
+
executingPlugin ||
|
|
885
|
+
!selectedTool ||
|
|
886
|
+
(pluginSource === "goat" ? !selectedPlugin : pluginSource === "mcp" ? !selectedMcpServer : !selectedElizaPlugin)} className={cn("h-auto px-6", pluginSource === "goat"
|
|
887
|
+
? "bg-green-600 hover:bg-green-700"
|
|
888
|
+
: pluginSource === "mcp"
|
|
889
|
+
? "bg-purple-600 hover:bg-purple-700"
|
|
890
|
+
: "bg-fuchsia-600 hover:bg-fuchsia-700")}>
|
|
891
|
+
{executingPlugin ? (<Loader2 className="h-4 w-4 animate-spin"/>) : (<>
|
|
892
|
+
<Play className="h-4 w-4 mr-2"/>
|
|
893
|
+
Execute
|
|
894
|
+
</>)}
|
|
895
|
+
</Button>
|
|
896
|
+
</div>
|
|
897
|
+
{pluginError && (<div className="p-3 rounded-lg bg-red-950/30 border border-red-800">
|
|
898
|
+
<p className="text-red-400 text-sm flex items-start gap-2">
|
|
899
|
+
<AlertCircle className="h-4 w-4 mt-0.5 shrink-0"/>
|
|
900
|
+
{pluginError}
|
|
901
|
+
</p>
|
|
902
|
+
</div>)}
|
|
903
|
+
</div>
|
|
904
|
+
</div>
|
|
905
|
+
</div>);
|
|
906
|
+
}
|
|
907
|
+
//# sourceMappingURL=plugin-tester.js.map
|