@compose-market/theme 0.0.3 → 0.0.5
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/css/effects.css +197 -0
- package/dist/css/index.css +2 -0
- package/dist/css/index.d.ts +1 -1
- package/dist/css/index.d.ts.map +1 -1
- package/dist/css/index.js +1 -0
- package/dist/css/index.js.map +1 -1
- package/dist/css/shell.css +770 -0
- package/dist/effects/styles.d.ts +8 -0
- package/dist/effects/styles.d.ts.map +1 -0
- package/dist/effects/styles.js +205 -0
- package/dist/effects/styles.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/shell/index.d.ts +114 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +81 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/styles.d.ts +2 -0
- package/dist/shell/styles.d.ts.map +1 -0
- package/dist/shell/styles.js +772 -0
- package/dist/shell/styles.js.map +1 -0
- package/package.json +37 -7
- package/dist/components/RFAComponent.d.ts +0 -10
- package/dist/components/RFAComponent.d.ts.map +0 -1
- package/dist/components/RFAComponent.js +0 -288
- package/dist/components/RFAComponent.js.map +0 -1
- package/dist/components/RFADetails.d.ts +0 -9
- package/dist/components/RFADetails.d.ts.map +0 -1
- package/dist/components/RFADetails.js +0 -407
- package/dist/components/RFADetails.js.map +0 -1
- package/dist/components/agent-card.d.ts +0 -8
- package/dist/components/agent-card.d.ts.map +0 -1
- package/dist/components/agent-card.js +0 -216
- package/dist/components/agent-card.js.map +0 -1
- package/dist/components/backpack.d.ts +0 -21
- package/dist/components/backpack.d.ts.map +0 -1
- package/dist/components/backpack.js +0 -905
- package/dist/components/backpack.js.map +0 -1
- package/dist/components/blur.d.ts +0 -9
- package/dist/components/blur.d.ts.map +0 -1
- package/dist/components/blur.js +0 -60
- package/dist/components/blur.js.map +0 -1
- package/dist/components/brand/Logo.d.ts +0 -25
- package/dist/components/brand/Logo.d.ts.map +0 -1
- package/dist/components/brand/Logo.js +0 -53
- package/dist/components/brand/Logo.js.map +0 -1
- package/dist/components/brand/index.d.ts +0 -2
- package/dist/components/brand/index.d.ts.map +0 -1
- package/dist/components/brand/index.js +0 -2
- package/dist/components/brand/index.js.map +0 -1
- package/dist/components/chat.d.ts +0 -68
- package/dist/components/chat.d.ts.map +0 -1
- package/dist/components/chat.js +0 -618
- package/dist/components/chat.js.map +0 -1
- package/dist/components/compose/index.d.ts +0 -10
- package/dist/components/compose/index.d.ts.map +0 -1
- package/dist/components/compose/index.js +0 -13
- package/dist/components/compose/index.js.map +0 -1
- package/dist/components/compose/nodes/agent-node.d.ts +0 -11
- package/dist/components/compose/nodes/agent-node.d.ts.map +0 -1
- package/dist/components/compose/nodes/agent-node.js +0 -101
- package/dist/components/compose/nodes/agent-node.js.map +0 -1
- package/dist/components/compose/nodes/hook-node.d.ts +0 -11
- package/dist/components/compose/nodes/hook-node.d.ts.map +0 -1
- package/dist/components/compose/nodes/hook-node.js +0 -100
- package/dist/components/compose/nodes/hook-node.js.map +0 -1
- package/dist/components/compose/nodes/index.d.ts +0 -60
- package/dist/components/compose/nodes/index.d.ts.map +0 -1
- package/dist/components/compose/nodes/index.js +0 -22
- package/dist/components/compose/nodes/index.js.map +0 -1
- package/dist/components/compose/nodes/step-node.d.ts +0 -11
- package/dist/components/compose/nodes/step-node.d.ts.map +0 -1
- package/dist/components/compose/nodes/step-node.js +0 -88
- package/dist/components/compose/nodes/step-node.js.map +0 -1
- package/dist/components/compose/nodes/trigger-node.d.ts +0 -11
- package/dist/components/compose/nodes/trigger-node.d.ts.map +0 -1
- package/dist/components/compose/nodes/trigger-node.js +0 -92
- package/dist/components/compose/nodes/trigger-node.js.map +0 -1
- package/dist/components/compose/overlay.d.ts +0 -26
- package/dist/components/compose/overlay.d.ts.map +0 -1
- package/dist/components/compose/overlay.js +0 -48
- package/dist/components/compose/overlay.js.map +0 -1
- package/dist/components/compose/pickers/agents-picker.d.ts +0 -18
- package/dist/components/compose/pickers/agents-picker.d.ts.map +0 -1
- package/dist/components/compose/pickers/agents-picker.js +0 -180
- package/dist/components/compose/pickers/agents-picker.js.map +0 -1
- package/dist/components/compose/pickers/connector-detail.d.ts +0 -16
- package/dist/components/compose/pickers/connector-detail.d.ts.map +0 -1
- package/dist/components/compose/pickers/connector-detail.js +0 -236
- package/dist/components/compose/pickers/connector-detail.js.map +0 -1
- package/dist/components/compose/pickers/connector-picker.d.ts +0 -13
- package/dist/components/compose/pickers/connector-picker.d.ts.map +0 -1
- package/dist/components/compose/pickers/connector-picker.js +0 -101
- package/dist/components/compose/pickers/connector-picker.js.map +0 -1
- package/dist/components/compose/pickers/index.d.ts +0 -10
- package/dist/components/compose/pickers/index.d.ts.map +0 -1
- package/dist/components/compose/pickers/index.js +0 -10
- package/dist/components/compose/pickers/index.js.map +0 -1
- package/dist/components/compose/pickers/trigger-picker.d.ts +0 -13
- package/dist/components/compose/pickers/trigger-picker.d.ts.map +0 -1
- package/dist/components/compose/pickers/trigger-picker.js +0 -110
- package/dist/components/compose/pickers/trigger-picker.js.map +0 -1
- package/dist/components/compose/toolbox.d.ts +0 -24
- package/dist/components/compose/toolbox.d.ts.map +0 -1
- package/dist/components/compose/toolbox.js +0 -183
- package/dist/components/compose/toolbox.js.map +0 -1
- package/dist/components/connector.d.ts +0 -24
- package/dist/components/connector.d.ts.map +0 -1
- package/dist/components/connector.js +0 -263
- package/dist/components/connector.js.map +0 -1
- package/dist/components/dispenser.d.ts +0 -15
- package/dist/components/dispenser.d.ts.map +0 -1
- package/dist/components/dispenser.js +0 -323
- package/dist/components/dispenser.js.map +0 -1
- package/dist/components/layout/AppLayout.d.ts +0 -60
- package/dist/components/layout/AppLayout.d.ts.map +0 -1
- package/dist/components/layout/AppLayout.js +0 -265
- package/dist/components/layout/AppLayout.js.map +0 -1
- package/dist/components/layout/Layout.d.ts +0 -6
- package/dist/components/layout/Layout.d.ts.map +0 -1
- package/dist/components/layout/Layout.js +0 -186
- package/dist/components/layout/Layout.js.map +0 -1
- package/dist/components/layout/Sidebar.d.ts +0 -3
- package/dist/components/layout/Sidebar.d.ts.map +0 -1
- package/dist/components/layout/Sidebar.js +0 -160
- package/dist/components/layout/Sidebar.js.map +0 -1
- package/dist/components/layout/TopBar.d.ts +0 -6
- package/dist/components/layout/TopBar.d.ts.map +0 -1
- package/dist/components/layout/TopBar.js +0 -36
- package/dist/components/layout/TopBar.js.map +0 -1
- package/dist/components/layout/index.d.ts +0 -2
- package/dist/components/layout/index.d.ts.map +0 -1
- package/dist/components/layout/index.js +0 -2
- package/dist/components/layout/index.js.map +0 -1
- package/dist/components/lyria-player.d.ts +0 -23
- package/dist/components/lyria-player.d.ts.map +0 -1
- package/dist/components/lyria-player.js +0 -241
- package/dist/components/lyria-player.js.map +0 -1
- package/dist/components/manowar-card.d.ts +0 -8
- package/dist/components/manowar-card.d.ts.map +0 -1
- package/dist/components/manowar-card.js +0 -349
- package/dist/components/manowar-card.js.map +0 -1
- package/dist/components/mirror-pane.d.ts +0 -55
- package/dist/components/mirror-pane.d.ts.map +0 -1
- package/dist/components/mirror-pane.js +0 -330
- package/dist/components/mirror-pane.js.map +0 -1
- package/dist/components/model-selector.d.ts +0 -12
- package/dist/components/model-selector.d.ts.map +0 -1
- package/dist/components/model-selector.js +0 -148
- package/dist/components/model-selector.js.map +0 -1
- package/dist/components/output.d.ts +0 -26
- package/dist/components/output.d.ts.map +0 -1
- package/dist/components/output.js +0 -259
- package/dist/components/output.js.map +0 -1
- package/dist/components/partners.d.ts +0 -13
- package/dist/components/partners.d.ts.map +0 -1
- package/dist/components/partners.js +0 -210
- package/dist/components/partners.js.map +0 -1
- package/dist/components/plugin-tester.d.ts +0 -13
- package/dist/components/plugin-tester.d.ts.map +0 -1
- package/dist/components/plugin-tester.js +0 -907
- package/dist/components/plugin-tester.js.map +0 -1
- package/dist/components/session/SessionComponents.d.ts +0 -2
- package/dist/components/session/SessionComponents.d.ts.map +0 -1
- package/dist/components/session/SessionComponents.js +0 -2
- package/dist/components/session/SessionComponents.js.map +0 -1
- package/dist/components/session/index.d.ts +0 -2
- package/dist/components/session/index.d.ts.map +0 -1
- package/dist/components/session/index.js +0 -2
- package/dist/components/session/index.js.map +0 -1
- package/dist/components/session.d.ts +0 -58
- package/dist/components/session.d.ts.map +0 -1
- package/dist/components/session.js +0 -580
- package/dist/components/session.js.map +0 -1
- package/dist/components/share-dialog.d.ts +0 -9
- package/dist/components/share-dialog.d.ts.map +0 -1
- package/dist/components/share-dialog.js +0 -49
- package/dist/components/share-dialog.js.map +0 -1
- package/dist/components/ui/accordion.d.ts +0 -6
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -20
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/alert-dialog.d.ts +0 -20
- package/dist/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog.js +0 -29
- package/dist/components/ui/alert-dialog.js.map +0 -1
- package/dist/components/ui/alert.d.ts +0 -5
- package/dist/components/ui/alert.d.ts.map +0 -1
- package/dist/components/ui/alert.js +0 -22
- package/dist/components/ui/alert.js.map +0 -1
- package/dist/components/ui/aspect-ratio.d.ts +0 -3
- package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/components/ui/aspect-ratio.js +0 -4
- package/dist/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/avatar.d.ts +0 -5
- package/dist/components/ui/avatar.d.ts.map +0 -1
- package/dist/components/ui/avatar.js +0 -12
- package/dist/components/ui/avatar.js.map +0 -1
- package/dist/components/ui/badge.d.ts +0 -8
- package/dist/components/ui/badge.d.ts.map +0 -1
- package/dist/components/ui/badge.js +0 -24
- package/dist/components/ui/badge.js.map +0 -1
- package/dist/components/ui/breadcrumb.d.ts +0 -16
- package/dist/components/ui/breadcrumb.d.ts.map +0 -1
- package/dist/components/ui/breadcrumb.js +0 -28
- package/dist/components/ui/breadcrumb.js.map +0 -1
- package/dist/components/ui/button-group.d.ts +0 -10
- package/dist/components/ui/button-group.d.ts.map +0 -1
- package/dist/components/ui/button-group.js +0 -27
- package/dist/components/ui/button-group.js.map +0 -1
- package/dist/components/ui/button.d.ts +0 -11
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -42
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/calendar.d.ts +0 -9
- package/dist/components/ui/calendar.d.ts.map +0 -1
- package/dist/components/ui/calendar.js +0 -78
- package/dist/components/ui/calendar.js.map +0 -1
- package/dist/components/ui/card.d.ts +0 -8
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -17
- package/dist/components/ui/card.js.map +0 -1
- package/dist/components/ui/carousel.d.ts +0 -9
- package/dist/components/ui/carousel.d.ts.map +0 -1
- package/dist/components/ui/carousel.js +0 -110
- package/dist/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/chart.d.ts +0 -28
- package/dist/components/ui/chart.d.ts.map +0 -1
- package/dist/components/ui/chart.js +0 -168
- package/dist/components/ui/chart.js.map +0 -1
- package/dist/components/ui/checkbox.d.ts +0 -3
- package/dist/components/ui/checkbox.d.ts.map +0 -1
- package/dist/components/ui/checkbox.js +0 -12
- package/dist/components/ui/checkbox.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js +0 -7
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/command.d.ts +0 -16
- package/dist/components/ui/command.d.ts.map +0 -1
- package/dist/components/ui/command.js +0 -38
- package/dist/components/ui/command.js.map +0 -1
- package/dist/components/ui/context-menu.d.ts +0 -21
- package/dist/components/ui/context-menu.d.ts.map +0 -1
- package/dist/components/ui/context-menu.js +0 -52
- package/dist/components/ui/context-menu.js.map +0 -1
- package/dist/components/ui/dialog.d.ts +0 -19
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dialog.js +0 -31
- package/dist/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/drawer.d.ts +0 -23
- package/dist/components/ui/drawer.d.ts.map +0 -1
- package/dist/components/ui/drawer.js +0 -28
- package/dist/components/ui/drawer.js.map +0 -1
- package/dist/components/ui/dropdown-menu.d.ts +0 -21
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.js +0 -55
- package/dist/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/empty.d.ts +0 -10
- package/dist/components/ui/empty.d.ts.map +0 -1
- package/dist/components/ui/empty.js +0 -33
- package/dist/components/ui/empty.js.map +0 -1
- package/dist/components/ui/field.d.ts +0 -23
- package/dist/components/ui/field.d.ts.map +0 -1
- package/dist/components/ui/field.js +0 -82
- package/dist/components/ui/field.js.map +0 -1
- package/dist/components/ui/form.d.ts +0 -11
- package/dist/components/ui/form.d.ts.map +0 -1
- package/dist/components/ui/form.js +0 -71
- package/dist/components/ui/form.js.map +0 -1
- package/dist/components/ui/hover-card.d.ts +0 -5
- package/dist/components/ui/hover-card.d.ts.map +0 -1
- package/dist/components/ui/hover-card.js +0 -9
- package/dist/components/ui/hover-card.js.map +0 -1
- package/dist/components/ui/index.d.ts +0 -7
- package/dist/components/ui/index.d.ts.map +0 -1
- package/dist/components/ui/index.js +0 -7
- package/dist/components/ui/index.js.map +0 -1
- package/dist/components/ui/input-group.d.ts +0 -13
- package/dist/components/ui/input-group.d.ts.map +0 -1
- package/dist/components/ui/input-group.js +0 -63
- package/dist/components/ui/input-group.js.map +0 -1
- package/dist/components/ui/input-otp.d.ts +0 -6
- package/dist/components/ui/input-otp.d.ts.map +0 -1
- package/dist/components/ui/input-otp.js +0 -25
- package/dist/components/ui/input-otp.js.map +0 -1
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -8
- package/dist/components/ui/input.js.map +0 -1
- package/dist/components/ui/item.d.ts +0 -19
- package/dist/components/ui/item.d.ts.map +0 -1
- package/dist/components/ui/item.js +0 -67
- package/dist/components/ui/item.js.map +0 -1
- package/dist/components/ui/kbd.d.ts +0 -4
- package/dist/components/ui/kbd.d.ts.map +0 -1
- package/dist/components/ui/kbd.js +0 -9
- package/dist/components/ui/kbd.js.map +0 -1
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -10
- package/dist/components/ui/label.js.map +0 -1
- package/dist/components/ui/menubar.d.ts +0 -23
- package/dist/components/ui/menubar.d.ts.map +0 -1
- package/dist/components/ui/menubar.js +0 -64
- package/dist/components/ui/menubar.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts +0 -11
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js +0 -34
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/network-selector.d.ts +0 -22
- package/dist/components/ui/network-selector.d.ts.map +0 -1
- package/dist/components/ui/network-selector.js +0 -99
- package/dist/components/ui/network-selector.js.map +0 -1
- package/dist/components/ui/pagination.d.ts +0 -29
- package/dist/components/ui/pagination.d.ts.map +0 -1
- package/dist/components/ui/pagination.js +0 -32
- package/dist/components/ui/pagination.js.map +0 -1
- package/dist/components/ui/popover.d.ts +0 -6
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/popover.js +0 -12
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/progress.d.ts +0 -3
- package/dist/components/ui/progress.d.ts.map +0 -1
- package/dist/components/ui/progress.js +0 -10
- package/dist/components/ui/progress.js.map +0 -1
- package/dist/components/ui/radio-group.d.ts +0 -4
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/radio-group.js +0 -18
- package/dist/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/resizable.d.ts +0 -8
- package/dist/components/ui/resizable.d.ts.map +0 -1
- package/dist/components/ui/resizable.js +0 -13
- package/dist/components/ui/resizable.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts +0 -4
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -19
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/select.d.ts +0 -12
- package/dist/components/ui/select.d.ts.map +0 -1
- package/dist/components/ui/select.js +0 -51
- package/dist/components/ui/select.js.map +0 -1
- package/dist/components/ui/separator.d.ts +0 -3
- package/dist/components/ui/separator.d.ts.map +0 -1
- package/dist/components/ui/separator.js +0 -7
- package/dist/components/ui/separator.js.map +0 -1
- package/dist/components/ui/sheet.d.ts +0 -19
- package/dist/components/ui/sheet.d.ts.map +0 -1
- package/dist/components/ui/sheet.js +0 -46
- package/dist/components/ui/sheet.js.map +0 -1
- package/dist/components/ui/sidebar.d.ts +0 -58
- package/dist/components/ui/sidebar.d.ts.map +0 -1
- package/dist/components/ui/sidebar.js +0 -246
- package/dist/components/ui/sidebar.js.map +0 -1
- package/dist/components/ui/skeleton.d.ts +0 -3
- package/dist/components/ui/skeleton.d.ts.map +0 -1
- package/dist/components/ui/skeleton.js +0 -6
- package/dist/components/ui/skeleton.js.map +0 -1
- package/dist/components/ui/slider.d.ts +0 -3
- package/dist/components/ui/slider.d.ts.map +0 -1
- package/dist/components/ui/slider.js +0 -12
- package/dist/components/ui/slider.js.map +0 -1
- package/dist/components/ui/sonner.d.ts +0 -5
- package/dist/components/ui/sonner.d.ts.map +0 -1
- package/dist/components/ui/sonner.js +0 -16
- package/dist/components/ui/sonner.js.map +0 -1
- package/dist/components/ui/spinner.d.ts +0 -3
- package/dist/components/ui/spinner.d.ts.map +0 -1
- package/dist/components/ui/spinner.js +0 -7
- package/dist/components/ui/spinner.js.map +0 -1
- package/dist/components/ui/surface-variant.d.ts +0 -4
- package/dist/components/ui/surface-variant.d.ts.map +0 -1
- package/dist/components/ui/surface-variant.js +0 -10
- package/dist/components/ui/surface-variant.js.map +0 -1
- package/dist/components/ui/switch.d.ts +0 -3
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -9
- package/dist/components/ui/switch.js.map +0 -1
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/table.d.ts.map +0 -1
- package/dist/components/ui/table.js +0 -22
- package/dist/components/ui/table.js.map +0 -1
- package/dist/components/ui/tabs.d.ts +0 -6
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -13
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/textarea.d.ts.map +0 -1
- package/dist/components/ui/textarea.js +0 -8
- package/dist/components/ui/textarea.js.map +0 -1
- package/dist/components/ui/toast.d.ts +0 -12
- package/dist/components/ui/toast.d.ts.map +0 -1
- package/dist/components/ui/toast.js +0 -35
- package/dist/components/ui/toast.js.map +0 -1
- package/dist/components/ui/toaster.d.ts +0 -2
- package/dist/components/ui/toaster.d.ts.map +0 -1
- package/dist/components/ui/toaster.js +0 -19
- package/dist/components/ui/toaster.js.map +0 -1
- package/dist/components/ui/toggle-group.d.ts +0 -4
- package/dist/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -27
- package/dist/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/toggle.d.ts +0 -4
- package/dist/components/ui/toggle.d.ts.map +0 -1
- package/dist/components/ui/toggle.js +0 -25
- package/dist/components/ui/toggle.js.map +0 -1
- package/dist/components/ui/tooltip.d.ts +0 -6
- package/dist/components/ui/tooltip.d.ts.map +0 -1
- package/dist/components/ui/tooltip.js +0 -13
- package/dist/components/ui/tooltip.js.map +0 -1
- package/dist/components/visual/ManowarField.d.ts +0 -9
- package/dist/components/visual/ManowarField.d.ts.map +0 -1
- package/dist/components/visual/ManowarField.js +0 -111
- package/dist/components/visual/ManowarField.js.map +0 -1
- package/dist/components/warp-form.d.ts +0 -22
- package/dist/components/warp-form.d.ts.map +0 -1
- package/dist/components/warp-form.js +0 -743
- package/dist/components/warp-form.js.map +0 -1
- package/dist/hooks/use-agents.d.ts +0 -17
- package/dist/hooks/use-agents.d.ts.map +0 -1
- package/dist/hooks/use-agents.js +0 -64
- package/dist/hooks/use-agents.js.map +0 -1
- package/dist/hooks/use-api.d.ts +0 -28
- package/dist/hooks/use-api.d.ts.map +0 -1
- package/dist/hooks/use-api.js +0 -114
- package/dist/hooks/use-api.js.map +0 -1
- package/dist/hooks/use-chat.d.ts +0 -64
- package/dist/hooks/use-chat.d.ts.map +0 -1
- package/dist/hooks/use-chat.js +0 -350
- package/dist/hooks/use-chat.js.map +0 -1
- package/dist/hooks/use-coordinator.d.ts +0 -41
- package/dist/hooks/use-coordinator.d.ts.map +0 -1
- package/dist/hooks/use-coordinator.js +0 -110
- package/dist/hooks/use-coordinator.js.map +0 -1
- package/dist/hooks/use-dispenser.d.ts +0 -68
- package/dist/hooks/use-dispenser.d.ts.map +0 -1
- package/dist/hooks/use-dispenser.js +0 -113
- package/dist/hooks/use-dispenser.js.map +0 -1
- package/dist/hooks/use-lyria.d.ts +0 -58
- package/dist/hooks/use-lyria.d.ts.map +0 -1
- package/dist/hooks/use-lyria.js +0 -254
- package/dist/hooks/use-lyria.js.map +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -16
- package/dist/hooks/use-mobile.js.map +0 -1
- package/dist/hooks/use-model.d.ts +0 -34
- package/dist/hooks/use-model.d.ts.map +0 -1
- package/dist/hooks/use-model.js +0 -105
- package/dist/hooks/use-model.js.map +0 -1
- package/dist/hooks/use-motion-governor.d.ts +0 -10
- package/dist/hooks/use-motion-governor.d.ts.map +0 -1
- package/dist/hooks/use-motion-governor.js +0 -63
- package/dist/hooks/use-motion-governor.js.map +0 -1
- package/dist/hooks/use-multichain.d.ts +0 -34
- package/dist/hooks/use-multichain.d.ts.map +0 -1
- package/dist/hooks/use-multichain.js +0 -120
- package/dist/hooks/use-multichain.js.map +0 -1
- package/dist/hooks/use-onchain.d.ts +0 -145
- package/dist/hooks/use-onchain.d.ts.map +0 -1
- package/dist/hooks/use-onchain.js +0 -652
- package/dist/hooks/use-onchain.js.map +0 -1
- package/dist/hooks/use-registry.d.ts +0 -140
- package/dist/hooks/use-registry.d.ts.map +0 -1
- package/dist/hooks/use-registry.js +0 -264
- package/dist/hooks/use-registry.js.map +0 -1
- package/dist/hooks/use-services.d.ts +0 -66
- package/dist/hooks/use-services.d.ts.map +0 -1
- package/dist/hooks/use-services.js +0 -216
- package/dist/hooks/use-services.js.map +0 -1
- package/dist/hooks/use-session.d.ts +0 -36
- package/dist/hooks/use-session.d.ts.map +0 -1
- package/dist/hooks/use-session.js +0 -449
- package/dist/hooks/use-session.js.map +0 -1
- package/dist/hooks/use-sse.d.ts +0 -8
- package/dist/hooks/use-sse.d.ts.map +0 -1
- package/dist/hooks/use-sse.js +0 -86
- package/dist/hooks/use-sse.js.map +0 -1
- package/dist/hooks/use-tabs.d.ts +0 -2
- package/dist/hooks/use-tabs.d.ts.map +0 -1
- package/dist/hooks/use-tabs.js +0 -43
- package/dist/hooks/use-tabs.js.map +0 -1
- package/dist/hooks/use-toast.d.ts +0 -41
- package/dist/hooks/use-toast.d.ts.map +0 -1
- package/dist/hooks/use-toast.js +0 -127
- package/dist/hooks/use-toast.js.map +0 -1
- package/dist/hooks/use-triggers.d.ts +0 -51
- package/dist/hooks/use-triggers.d.ts.map +0 -1
- package/dist/hooks/use-triggers.js +0 -212
- package/dist/hooks/use-triggers.js.map +0 -1
- package/dist/hooks/use-warp.d.ts +0 -53
- package/dist/hooks/use-warp.d.ts.map +0 -1
- package/dist/hooks/use-warp.js +0 -231
- package/dist/hooks/use-warp.js.map +0 -1
- package/dist/hooks/use-workflow.d.ts +0 -40
- package/dist/hooks/use-workflow.d.ts.map +0 -1
- package/dist/hooks/use-workflow.js +0 -358
- package/dist/hooks/use-workflow.js.map +0 -1
- package/dist/lib/agents.d.ts +0 -186
- package/dist/lib/agents.d.ts.map +0 -1
- package/dist/lib/agents.js +0 -633
- package/dist/lib/agents.js.map +0 -1
- package/dist/lib/api.d.ts +0 -224
- package/dist/lib/api.d.ts.map +0 -1
- package/dist/lib/api.js +0 -443
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/chains.d.ts +0 -151
- package/dist/lib/chains.d.ts.map +0 -1
- package/dist/lib/chains.js +0 -297
- package/dist/lib/chains.js.map +0 -1
- package/dist/lib/contracts.d.ts +0 -960
- package/dist/lib/contracts.d.ts.map +0 -1
- package/dist/lib/contracts.js +0 -716
- package/dist/lib/contracts.js.map +0 -1
- package/dist/lib/cronos/aa.d.ts +0 -111
- package/dist/lib/cronos/aa.d.ts.map +0 -1
- package/dist/lib/cronos/aa.js +0 -312
- package/dist/lib/cronos/aa.js.map +0 -1
- package/dist/lib/cronos/facilitator.d.ts +0 -87
- package/dist/lib/cronos/facilitator.d.ts.map +0 -1
- package/dist/lib/cronos/facilitator.js +0 -183
- package/dist/lib/cronos/facilitator.js.map +0 -1
- package/dist/lib/evm.d.ts +0 -45
- package/dist/lib/evm.d.ts.map +0 -1
- package/dist/lib/evm.js +0 -78
- package/dist/lib/evm.js.map +0 -1
- package/dist/lib/mockData.d.ts +0 -26
- package/dist/lib/mockData.d.ts.map +0 -1
- package/dist/lib/mockData.js +0 -89
- package/dist/lib/mockData.js.map +0 -1
- package/dist/lib/models.d.ts +0 -122
- package/dist/lib/models.d.ts.map +0 -1
- package/dist/lib/models.js +0 -174
- package/dist/lib/models.js.map +0 -1
- package/dist/lib/multimodal.d.ts +0 -53
- package/dist/lib/multimodal.d.ts.map +0 -1
- package/dist/lib/multimodal.js +0 -204
- package/dist/lib/multimodal.js.map +0 -1
- package/dist/lib/payment.d.ts +0 -67
- package/dist/lib/payment.d.ts.map +0 -1
- package/dist/lib/payment.js +0 -236
- package/dist/lib/payment.js.map +0 -1
- package/dist/lib/pinata.d.ts +0 -140
- package/dist/lib/pinata.d.ts.map +0 -1
- package/dist/lib/pinata.js +0 -209
- package/dist/lib/pinata.js.map +0 -1
- package/dist/lib/queryClient.d.ts +0 -9
- package/dist/lib/queryClient.d.ts.map +0 -1
- package/dist/lib/queryClient.js +0 -42
- package/dist/lib/queryClient.js.map +0 -1
- package/dist/lib/services.d.ts +0 -164
- package/dist/lib/services.d.ts.map +0 -1
- package/dist/lib/services.js +0 -304
- package/dist/lib/services.js.map +0 -1
- package/dist/lib/share.d.ts +0 -12
- package/dist/lib/share.d.ts.map +0 -1
- package/dist/lib/share.js +0 -39
- package/dist/lib/share.js.map +0 -1
- package/dist/lib/triggers.d.ts +0 -128
- package/dist/lib/triggers.d.ts.map +0 -1
- package/dist/lib/triggers.js +0 -305
- package/dist/lib/triggers.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -6
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/visual-system.d.ts +0 -39
- package/dist/lib/visual-system.d.ts.map +0 -1
- package/dist/lib/visual-system.js +0 -129
- package/dist/lib/visual-system.js.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +0 -1
|
@@ -1,652 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks for reading on-chain Manowar protocol data
|
|
3
|
-
* Fetches agents and workflows from deployed contracts
|
|
4
|
-
* Multi-chain: fetches from ALL supported chains
|
|
5
|
-
*/
|
|
6
|
-
import { useQuery } from "@tanstack/react-query";
|
|
7
|
-
import { readContract } from "thirdweb";
|
|
8
|
-
import { getAgentFactoryContract, getManowarContract, getWarpContract, getRFAContract, getAgentFactoryContractForChain, getManowarContractForChain, getWarpContractForChain, formatUsdcPrice, weiToUsdc, } from "@/lib/contracts";
|
|
9
|
-
import { SUPPORTED_CHAINS } from "@/lib/chains";
|
|
10
|
-
import { getIpfsUrl } from "@/lib/pinata";
|
|
11
|
-
// =============================================================================
|
|
12
|
-
// Contract Read Helpers
|
|
13
|
-
// =============================================================================
|
|
14
|
-
async function fetchAgentData(agentId, chainId) {
|
|
15
|
-
try {
|
|
16
|
-
// Use chain-specific contract if chainId provided, otherwise default
|
|
17
|
-
const factoryContract = chainId
|
|
18
|
-
? getAgentFactoryContractForChain(chainId)
|
|
19
|
-
: getAgentFactoryContract();
|
|
20
|
-
const data = await readContract({
|
|
21
|
-
contract: factoryContract,
|
|
22
|
-
method: "function getAgentData(uint256 agentId) view returns ((bytes32 dnaHash, uint256 licenses, uint256 licensesMinted, uint256 licensePrice, address creator, bool cloneable, bool isClone, uint256 parentAgentId, string agentCardUri))",
|
|
23
|
-
params: [BigInt(agentId)],
|
|
24
|
-
});
|
|
25
|
-
const licenses = Number(data.licenses);
|
|
26
|
-
const licensesMinted = Number(data.licensesMinted);
|
|
27
|
-
// Check if this agent was created via warp
|
|
28
|
-
let isWarped = false;
|
|
29
|
-
try {
|
|
30
|
-
const warpContract = chainId
|
|
31
|
-
? getWarpContractForChain(chainId)
|
|
32
|
-
: getWarpContract();
|
|
33
|
-
isWarped = await readContract({
|
|
34
|
-
contract: warpContract,
|
|
35
|
-
method: "function isWarped(uint256 agentId) view returns (bool)",
|
|
36
|
-
params: [BigInt(agentId)],
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
// Warp check failed, assume not warped
|
|
41
|
-
isWarped = false;
|
|
42
|
-
}
|
|
43
|
-
// walletAddress will be populated from IPFS metadata in fetchAgentMetadata
|
|
44
|
-
// chainId comes from metadata.chain field (see AgentCard type)
|
|
45
|
-
return {
|
|
46
|
-
id: agentId,
|
|
47
|
-
dnaHash: data.dnaHash,
|
|
48
|
-
walletAddress: "", // Populated from metadata
|
|
49
|
-
licenses,
|
|
50
|
-
licensesMinted,
|
|
51
|
-
licensesAvailable: licenses === 0 ? Infinity : licenses - licensesMinted,
|
|
52
|
-
licensePrice: weiToUsdc(data.licensePrice),
|
|
53
|
-
licensePriceFormatted: formatUsdcPrice(data.licensePrice),
|
|
54
|
-
creator: data.creator,
|
|
55
|
-
cloneable: data.cloneable,
|
|
56
|
-
isClone: data.isClone,
|
|
57
|
-
parentAgentId: Number(data.parentAgentId),
|
|
58
|
-
agentCardUri: data.agentCardUri,
|
|
59
|
-
isWarped,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.error(`Failed to fetch agent ${agentId} on chain ${chainId}:`, error);
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async function fetchAgentMetadata(agent) {
|
|
68
|
-
if (!agent.agentCardUri || !agent.agentCardUri.startsWith("ipfs://")) {
|
|
69
|
-
return agent;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
const cid = agent.agentCardUri.replace("ipfs://", "");
|
|
73
|
-
// Validate CID format - proper IPFS CIDs start with 'Qm' (v0) or 'bafy/bafk' (v1)
|
|
74
|
-
// Skip fetching if CID looks invalid (e.g., timestamp-based names from old mints)
|
|
75
|
-
if (!cid.startsWith("Qm") && !cid.startsWith("baf")) {
|
|
76
|
-
console.warn(`[use-onchain] Skipping invalid CID for agent ${agent.id}: ${cid}`);
|
|
77
|
-
return agent;
|
|
78
|
-
}
|
|
79
|
-
const url = getIpfsUrl(cid);
|
|
80
|
-
const response = await fetch(url);
|
|
81
|
-
if (!response.ok)
|
|
82
|
-
throw new Error("Failed to fetch metadata");
|
|
83
|
-
const metadata = await response.json();
|
|
84
|
-
// walletAddress comes from IPFS metadata - this is the SINGLE SOURCE OF TRUTH
|
|
85
|
-
// Frontend and backend both read this, neither derives it
|
|
86
|
-
const walletAddress = metadata.walletAddress || agent.walletAddress;
|
|
87
|
-
return { ...agent, metadata, walletAddress };
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
console.error(`Failed to fetch metadata for agent ${agent.id}:`, error);
|
|
91
|
-
return agent;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Find an agent by its wallet address (stored in IPFS metadata)
|
|
96
|
-
* Searches across all supported chains to find the agent
|
|
97
|
-
*/
|
|
98
|
-
export async function fetchAgentByWalletAddress(walletAddress) {
|
|
99
|
-
const normalizedSearch = walletAddress.toLowerCase();
|
|
100
|
-
// Search across all supported chains
|
|
101
|
-
for (const { id: chainId } of SUPPORTED_CHAINS) {
|
|
102
|
-
try {
|
|
103
|
-
const contract = getAgentFactoryContractForChain(chainId);
|
|
104
|
-
// Get total agents count for this chain
|
|
105
|
-
const total = await readContract({
|
|
106
|
-
contract,
|
|
107
|
-
method: "function totalAgents() view returns (uint256)",
|
|
108
|
-
params: [],
|
|
109
|
-
});
|
|
110
|
-
const totalNum = Number(total);
|
|
111
|
-
if (totalNum === 0)
|
|
112
|
-
continue;
|
|
113
|
-
// Search through all agents on this chain (most recent first for efficiency)
|
|
114
|
-
// Agent IDs start at 1, not 0
|
|
115
|
-
for (let i = totalNum; i >= 1; i--) {
|
|
116
|
-
const agent = await fetchAgentData(i, chainId);
|
|
117
|
-
if (!agent)
|
|
118
|
-
continue;
|
|
119
|
-
// Fetch metadata to get the wallet address (source of truth)
|
|
120
|
-
const agentWithMeta = await fetchAgentMetadata(agent);
|
|
121
|
-
if (agentWithMeta.walletAddress && agentWithMeta.walletAddress.toLowerCase() === normalizedSearch) {
|
|
122
|
-
return agentWithMeta;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
console.warn(`Failed to search agents on chain ${chainId}:`, error);
|
|
128
|
-
// Continue to next chain
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
console.error(`Agent with wallet ${walletAddress} not found on any chain`);
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
async function fetchManowarData(manowarId, chainId) {
|
|
135
|
-
try {
|
|
136
|
-
const contract = chainId
|
|
137
|
-
? getManowarContractForChain(chainId)
|
|
138
|
-
: getManowarContract();
|
|
139
|
-
const data = await readContract({
|
|
140
|
-
contract,
|
|
141
|
-
method: "function getManowarData(uint256 manowarId) view returns ((string title, string description, string banner, string manowarCardUri, uint256 totalPrice, uint256 units, uint256 unitsMinted, address creator, bool leaseEnabled, uint256 leaseDuration, uint8 leasePercent, bool hasCoordinator, string coordinatorModel, bool hasActiveRfa, uint256 rfaId))",
|
|
142
|
-
params: [BigInt(manowarId)],
|
|
143
|
-
});
|
|
144
|
-
return {
|
|
145
|
-
id: manowarId,
|
|
146
|
-
title: data.title,
|
|
147
|
-
description: data.description,
|
|
148
|
-
image: data.banner, // Contract still uses 'banner' field name
|
|
149
|
-
manowarCardUri: data.manowarCardUri,
|
|
150
|
-
totalPrice: weiToUsdc(data.totalPrice),
|
|
151
|
-
units: Number(data.units),
|
|
152
|
-
unitsMinted: Number(data.unitsMinted),
|
|
153
|
-
creator: data.creator,
|
|
154
|
-
leaseEnabled: data.leaseEnabled,
|
|
155
|
-
leaseDuration: Number(data.leaseDuration),
|
|
156
|
-
leasePercent: data.leasePercent,
|
|
157
|
-
hasCoordinator: data.hasCoordinator,
|
|
158
|
-
coordinatorModel: data.coordinatorModel,
|
|
159
|
-
hasActiveRfa: data.hasActiveRfa,
|
|
160
|
-
rfaId: Number(data.rfaId),
|
|
161
|
-
chainId,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
console.error(`Failed to fetch manowar ${manowarId} on chain ${chainId}:`, error);
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
async function fetchManowarMetadata(manowar, chainId) {
|
|
170
|
-
try {
|
|
171
|
-
// Fetch metadata via tokenURI (standard ERC721)
|
|
172
|
-
const contract = chainId
|
|
173
|
-
? getManowarContractForChain(chainId)
|
|
174
|
-
: getManowarContract();
|
|
175
|
-
const tokenUri = await readContract({
|
|
176
|
-
contract,
|
|
177
|
-
method: "function tokenURI(uint256 tokenId) view returns (string)",
|
|
178
|
-
params: [BigInt(manowar.id)],
|
|
179
|
-
});
|
|
180
|
-
if (!tokenUri) {
|
|
181
|
-
console.warn(`[use-onchain] No tokenURI for manowar ${manowar.id}`);
|
|
182
|
-
return manowar;
|
|
183
|
-
}
|
|
184
|
-
// Handle IPFS URIs
|
|
185
|
-
let metadataUrl = tokenUri;
|
|
186
|
-
if (tokenUri.startsWith("ipfs://")) {
|
|
187
|
-
const cid = tokenUri.replace("ipfs://", "");
|
|
188
|
-
metadataUrl = getIpfsUrl(cid);
|
|
189
|
-
}
|
|
190
|
-
const response = await fetch(metadataUrl);
|
|
191
|
-
if (!response.ok)
|
|
192
|
-
throw new Error("Failed to fetch metadata");
|
|
193
|
-
const metadata = await response.json();
|
|
194
|
-
// walletAddress and dnaHash come from IPFS metadata - this is the SINGLE SOURCE OF TRUTH
|
|
195
|
-
// Chain info comes from nested agents[0].chain
|
|
196
|
-
return {
|
|
197
|
-
...manowar,
|
|
198
|
-
metadata,
|
|
199
|
-
dnaHash: metadata.dnaHash,
|
|
200
|
-
walletAddress: metadata.walletAddress,
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
console.error(`Failed to fetch metadata for manowar ${manowar.id}:`, error);
|
|
205
|
-
return manowar;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// =============================================================================
|
|
209
|
-
// Hooks
|
|
210
|
-
// =============================================================================
|
|
211
|
-
/**
|
|
212
|
-
* Fetch all on-chain agents from ALL supported chains
|
|
213
|
-
* Each agent's chainId comes from its metadata.chain field
|
|
214
|
-
*/
|
|
215
|
-
export function useOnchainAgents(options) {
|
|
216
|
-
const { includeMetadata = true } = options || {};
|
|
217
|
-
return useQuery({
|
|
218
|
-
queryKey: ["onchain-agents", "all-chains", includeMetadata],
|
|
219
|
-
queryFn: async () => {
|
|
220
|
-
// Fetch from all supported chains in parallel
|
|
221
|
-
const chainPromises = SUPPORTED_CHAINS.map(async ({ id: chainId }) => {
|
|
222
|
-
try {
|
|
223
|
-
const contract = getAgentFactoryContractForChain(chainId);
|
|
224
|
-
// Get total agents count for this chain
|
|
225
|
-
const total = await readContract({
|
|
226
|
-
contract,
|
|
227
|
-
method: "function totalAgents() view returns (uint256)",
|
|
228
|
-
params: [],
|
|
229
|
-
});
|
|
230
|
-
const totalNum = Number(total);
|
|
231
|
-
if (totalNum === 0)
|
|
232
|
-
return [];
|
|
233
|
-
// Fetch all agents from this chain (IDs start at 1)
|
|
234
|
-
const agentPromises = Array.from({ length: totalNum }, (_, i) => fetchAgentData(i + 1, chainId));
|
|
235
|
-
let agents = (await Promise.all(agentPromises)).filter((a) => a !== null);
|
|
236
|
-
// Optionally fetch metadata (which includes the chain field)
|
|
237
|
-
if (includeMetadata) {
|
|
238
|
-
agents = await Promise.all(agents.map(fetchAgentMetadata));
|
|
239
|
-
}
|
|
240
|
-
return agents;
|
|
241
|
-
}
|
|
242
|
-
catch (error) {
|
|
243
|
-
console.warn(`Failed to fetch agents from chain ${chainId}:`, error);
|
|
244
|
-
return [];
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
// Merge all agents from all chains
|
|
248
|
-
const chainsAgents = await Promise.all(chainPromises);
|
|
249
|
-
return chainsAgents.flat();
|
|
250
|
-
},
|
|
251
|
-
staleTime: 30 * 1000,
|
|
252
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes // 30 seconds
|
|
253
|
-
retry: 2,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Fetch a single agent by numeric ID
|
|
258
|
-
*/
|
|
259
|
-
export function useOnchainAgent(agentId) {
|
|
260
|
-
return useQuery({
|
|
261
|
-
queryKey: ["onchain-agent", agentId],
|
|
262
|
-
queryFn: async () => {
|
|
263
|
-
if (!agentId)
|
|
264
|
-
return null;
|
|
265
|
-
const agent = await fetchAgentData(agentId);
|
|
266
|
-
if (!agent)
|
|
267
|
-
return null;
|
|
268
|
-
return fetchAgentMetadata(agent);
|
|
269
|
-
},
|
|
270
|
-
enabled: !!agentId,
|
|
271
|
-
staleTime: 30 * 1000,
|
|
272
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Fetch a single agent by wallet address
|
|
277
|
-
* This is the preferred method since wallet address is the canonical identifier
|
|
278
|
-
*/
|
|
279
|
-
export function useOnchainAgentByWallet(walletAddress) {
|
|
280
|
-
return useQuery({
|
|
281
|
-
queryKey: ["onchain-agent-wallet", walletAddress?.toLowerCase()],
|
|
282
|
-
queryFn: async () => {
|
|
283
|
-
if (!walletAddress)
|
|
284
|
-
return null;
|
|
285
|
-
return fetchAgentByWalletAddress(walletAddress);
|
|
286
|
-
},
|
|
287
|
-
enabled: !!walletAddress && walletAddress.startsWith("0x"),
|
|
288
|
-
staleTime: 30 * 1000,
|
|
289
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Fetch a single agent by either ID or wallet address
|
|
294
|
-
* Automatically detects the identifier type
|
|
295
|
-
*/
|
|
296
|
-
export function useOnchainAgentByIdentifier(identifier) {
|
|
297
|
-
// Determine if identifier is a wallet address (0x...) or numeric ID
|
|
298
|
-
// Wallet address = 0x + 40 hex chars = 42 total
|
|
299
|
-
const isWalletAddress = identifier?.startsWith("0x") && identifier.length === 42;
|
|
300
|
-
const numericId = !isWalletAddress && identifier ? parseInt(identifier) : null;
|
|
301
|
-
const walletAddress = isWalletAddress ? identifier : null;
|
|
302
|
-
const byIdQuery = useOnchainAgent(!isWalletAddress ? numericId : null);
|
|
303
|
-
const byWalletQuery = useOnchainAgentByWallet(isWalletAddress ? walletAddress : null);
|
|
304
|
-
if (isWalletAddress) {
|
|
305
|
-
return byWalletQuery;
|
|
306
|
-
}
|
|
307
|
-
return byIdQuery;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Fetch agents owned by a specific address
|
|
311
|
-
*/
|
|
312
|
-
export function useAgentsByCreator(creator) {
|
|
313
|
-
const { data: allAgents, ...rest } = useOnchainAgents();
|
|
314
|
-
return {
|
|
315
|
-
...rest,
|
|
316
|
-
data: allAgents?.filter(a => a.creator.toLowerCase() === creator?.toLowerCase()),
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Fetch all on-chain manowars from ALL supported chains
|
|
321
|
-
* Chain info comes from nested agents[0].chain in metadata
|
|
322
|
-
*/
|
|
323
|
-
export function useOnchainManowars(options) {
|
|
324
|
-
const { includeRFA = false, onlyComplete = true } = options || {};
|
|
325
|
-
return useQuery({
|
|
326
|
-
queryKey: ["onchain-manowars", "all-chains", includeRFA, onlyComplete],
|
|
327
|
-
queryFn: async () => {
|
|
328
|
-
// Fetch from all supported chains in parallel
|
|
329
|
-
const chainPromises = SUPPORTED_CHAINS.map(async ({ id: chainId }) => {
|
|
330
|
-
try {
|
|
331
|
-
const contract = getManowarContractForChain(chainId);
|
|
332
|
-
// Get total manowars count for this chain
|
|
333
|
-
const total = await readContract({
|
|
334
|
-
contract,
|
|
335
|
-
method: "function totalManowars() view returns (uint256)",
|
|
336
|
-
params: [],
|
|
337
|
-
});
|
|
338
|
-
const totalNum = Number(total);
|
|
339
|
-
if (totalNum === 0)
|
|
340
|
-
return [];
|
|
341
|
-
// Fetch all manowars from this chain (IDs start at 1)
|
|
342
|
-
const manowarPromises = Array.from({ length: totalNum }, (_, i) => fetchManowarData(i + 1, chainId));
|
|
343
|
-
let manowars = (await Promise.all(manowarPromises)).filter((m) => m !== null);
|
|
344
|
-
// Fetch metadata for each manowar (to get walletAddress from IPFS)
|
|
345
|
-
manowars = await Promise.all(manowars.map(m => fetchManowarMetadata(m, chainId)));
|
|
346
|
-
// Filter based on options
|
|
347
|
-
if (onlyComplete && !includeRFA) {
|
|
348
|
-
manowars = manowars.filter(m => !m.hasActiveRfa);
|
|
349
|
-
}
|
|
350
|
-
else if (includeRFA && !onlyComplete) {
|
|
351
|
-
manowars = manowars.filter(m => m.hasActiveRfa);
|
|
352
|
-
}
|
|
353
|
-
return manowars;
|
|
354
|
-
}
|
|
355
|
-
catch (error) {
|
|
356
|
-
console.warn(`Failed to fetch manowars from chain ${chainId}:`, error);
|
|
357
|
-
return [];
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
// Merge all manowars from all chains
|
|
361
|
-
const chainsManowars = await Promise.all(chainPromises);
|
|
362
|
-
return chainsManowars.flat();
|
|
363
|
-
},
|
|
364
|
-
staleTime: 30 * 1000,
|
|
365
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
366
|
-
retry: 2,
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Fetch manowars owned by a specific address
|
|
371
|
-
*/
|
|
372
|
-
export function useManowarsByCreator(creator) {
|
|
373
|
-
const { data: allManowars, ...rest } = useOnchainManowars({ onlyComplete: false });
|
|
374
|
-
return {
|
|
375
|
-
...rest,
|
|
376
|
-
data: allManowars?.filter(m => m.creator.toLowerCase() === creator?.toLowerCase()),
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Fetch manowars with active RFAs (for marketplace RFA tab)
|
|
381
|
-
*/
|
|
382
|
-
export function useManowarsWithRFA() {
|
|
383
|
-
return useOnchainManowars({ includeRFA: true, onlyComplete: false });
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Fetch a single manowar by ID (with IPFS metadata)
|
|
387
|
-
*/
|
|
388
|
-
export function useOnchainManowar(manowarId) {
|
|
389
|
-
return useQuery({
|
|
390
|
-
queryKey: ["onchain-manowar", manowarId],
|
|
391
|
-
queryFn: async () => {
|
|
392
|
-
if (!manowarId)
|
|
393
|
-
return null;
|
|
394
|
-
const manowar = await fetchManowarData(manowarId);
|
|
395
|
-
if (!manowar)
|
|
396
|
-
return null;
|
|
397
|
-
return fetchManowarMetadata(manowar);
|
|
398
|
-
},
|
|
399
|
-
enabled: !!manowarId,
|
|
400
|
-
staleTime: 30 * 1000,
|
|
401
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Find a manowar by its wallet address (stored in IPFS metadata)
|
|
406
|
-
* Searches across all supported chains to find the manowar
|
|
407
|
-
*/
|
|
408
|
-
async function fetchManowarByWalletAddress(walletAddress) {
|
|
409
|
-
const normalizedSearch = walletAddress.toLowerCase();
|
|
410
|
-
// Search across all supported chains
|
|
411
|
-
for (const { id: chainId } of SUPPORTED_CHAINS) {
|
|
412
|
-
try {
|
|
413
|
-
const contract = getManowarContractForChain(chainId);
|
|
414
|
-
// Get total manowars count for this chain
|
|
415
|
-
const total = await readContract({
|
|
416
|
-
contract,
|
|
417
|
-
method: "function totalManowars() view returns (uint256)",
|
|
418
|
-
params: [],
|
|
419
|
-
});
|
|
420
|
-
const totalNum = Number(total);
|
|
421
|
-
if (totalNum === 0)
|
|
422
|
-
continue;
|
|
423
|
-
// Search through all manowars on this chain (most recent first for efficiency)
|
|
424
|
-
// Manowar IDs start at 1, not 0
|
|
425
|
-
for (let i = totalNum; i >= 1; i--) {
|
|
426
|
-
const manowar = await fetchManowarData(i, chainId);
|
|
427
|
-
if (!manowar)
|
|
428
|
-
continue;
|
|
429
|
-
// Fetch metadata to get the wallet address (source of truth)
|
|
430
|
-
const manowarWithMeta = await fetchManowarMetadata(manowar, chainId);
|
|
431
|
-
if (manowarWithMeta.walletAddress && manowarWithMeta.walletAddress.toLowerCase() === normalizedSearch) {
|
|
432
|
-
return manowarWithMeta;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
catch (error) {
|
|
437
|
-
console.warn(`Failed to search manowars on chain ${chainId}:`, error);
|
|
438
|
-
// Continue to next chain
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
console.error(`Manowar with wallet ${walletAddress} not found on any chain`);
|
|
442
|
-
return null;
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Fetch a single manowar by wallet address
|
|
446
|
-
* This is the preferred method since wallet address is the canonical identifier
|
|
447
|
-
*/
|
|
448
|
-
export function useOnchainManowarByWallet(walletAddress) {
|
|
449
|
-
return useQuery({
|
|
450
|
-
queryKey: ["onchain-manowar-wallet", walletAddress?.toLowerCase()],
|
|
451
|
-
queryFn: async () => {
|
|
452
|
-
if (!walletAddress)
|
|
453
|
-
return null;
|
|
454
|
-
return fetchManowarByWalletAddress(walletAddress);
|
|
455
|
-
},
|
|
456
|
-
enabled: !!walletAddress && walletAddress.startsWith("0x"),
|
|
457
|
-
staleTime: 30 * 1000,
|
|
458
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Fetch a single manowar by either ID or wallet address
|
|
463
|
-
* Automatically detects the identifier type
|
|
464
|
-
*/
|
|
465
|
-
export function useOnchainManowarByIdentifier(identifier) {
|
|
466
|
-
// Determine if identifier is a wallet address (0x...) or numeric ID
|
|
467
|
-
// Wallet address = 0x + 40 hex chars = 42 total
|
|
468
|
-
const isWalletAddress = identifier?.startsWith("0x") && identifier.length === 42;
|
|
469
|
-
const numericId = !isWalletAddress && identifier ? parseInt(identifier) : null;
|
|
470
|
-
const walletAddress = isWalletAddress ? identifier : null;
|
|
471
|
-
const byIdQuery = useOnchainManowar(!isWalletAddress ? numericId : null);
|
|
472
|
-
const byWalletQuery = useOnchainManowarByWallet(isWalletAddress ? walletAddress : null);
|
|
473
|
-
if (isWalletAddress) {
|
|
474
|
-
return byWalletQuery;
|
|
475
|
-
}
|
|
476
|
-
return byIdQuery;
|
|
477
|
-
}
|
|
478
|
-
/** Convert status number to enum */
|
|
479
|
-
function parseRFAStatus(status) {
|
|
480
|
-
switch (status) {
|
|
481
|
-
case 1: return 'Open';
|
|
482
|
-
case 2: return 'Fulfilled';
|
|
483
|
-
case 3: return 'Cancelled';
|
|
484
|
-
default: return 'None';
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
/** Parse contract RFA data to typed structure */
|
|
488
|
-
function parseRFAData(id, data) {
|
|
489
|
-
const offerAmount = weiToUsdc(data.offerAmount);
|
|
490
|
-
const offerNum = parseFloat(offerAmount);
|
|
491
|
-
return {
|
|
492
|
-
id,
|
|
493
|
-
manowarId: Number(data.manowarId),
|
|
494
|
-
title: data.title,
|
|
495
|
-
description: data.description,
|
|
496
|
-
requiredSkills: data.requiredSkills.map(s => s), // Keep as hex for now
|
|
497
|
-
offerAmount,
|
|
498
|
-
offerAmountFormatted: offerNum < 0.01 ? `$${offerNum.toFixed(4)}` : `$${offerNum.toFixed(2)}`,
|
|
499
|
-
publisher: data.publisher,
|
|
500
|
-
createdAt: Number(data.createdAt),
|
|
501
|
-
status: parseRFAStatus(data.status),
|
|
502
|
-
fulfilledByAgentId: Number(data.fulfilledByAgentId),
|
|
503
|
-
agentCreator: data.agentCreator,
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
/** Fetch single RFA data by ID */
|
|
507
|
-
async function fetchRFAData(rfaId) {
|
|
508
|
-
try {
|
|
509
|
-
const contract = getRFAContract();
|
|
510
|
-
const data = await readContract({
|
|
511
|
-
contract,
|
|
512
|
-
method: "function getRFAData(uint256 rfaId) view returns ((uint256 manowarId, string title, string description, bytes32[] requiredSkills, uint256 offerAmount, address publisher, uint256 createdAt, uint8 status, uint256 fulfilledByAgentId, address agentCreator))",
|
|
513
|
-
params: [BigInt(rfaId)],
|
|
514
|
-
});
|
|
515
|
-
return parseRFAData(rfaId, data);
|
|
516
|
-
}
|
|
517
|
-
catch (error) {
|
|
518
|
-
console.error(`Failed to fetch RFA ${rfaId}:`, error);
|
|
519
|
-
return null;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
/** Fetch submissions for an RFA */
|
|
523
|
-
async function fetchRFASubmissions(rfaId) {
|
|
524
|
-
try {
|
|
525
|
-
const contract = getRFAContract();
|
|
526
|
-
const submissions = await readContract({
|
|
527
|
-
contract,
|
|
528
|
-
method: "function getSubmissions(uint256 rfaId) view returns ((uint256 agentId, address creator, uint256 submittedAt)[])",
|
|
529
|
-
params: [BigInt(rfaId)],
|
|
530
|
-
});
|
|
531
|
-
return submissions.map(s => ({
|
|
532
|
-
agentId: Number(s.agentId),
|
|
533
|
-
creator: s.creator,
|
|
534
|
-
submittedAt: Number(s.submittedAt),
|
|
535
|
-
}));
|
|
536
|
-
}
|
|
537
|
-
catch (error) {
|
|
538
|
-
console.error(`Failed to fetch submissions for RFA ${rfaId}:`, error);
|
|
539
|
-
return [];
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* Fetch all open RFAs
|
|
544
|
-
*/
|
|
545
|
-
export function useOpenRFAs() {
|
|
546
|
-
return useQuery({
|
|
547
|
-
queryKey: ["rfa", "open"],
|
|
548
|
-
queryFn: async () => {
|
|
549
|
-
const contract = getRFAContract();
|
|
550
|
-
// Get all open RFA IDs
|
|
551
|
-
const rfaIds = await readContract({
|
|
552
|
-
contract,
|
|
553
|
-
method: "function getOpenRFAs() view returns (uint256[])",
|
|
554
|
-
params: [],
|
|
555
|
-
});
|
|
556
|
-
if (rfaIds.length === 0)
|
|
557
|
-
return [];
|
|
558
|
-
// Fetch data for each RFA
|
|
559
|
-
const rfaPromises = rfaIds.map(id => fetchRFAData(Number(id)));
|
|
560
|
-
const rfas = await Promise.all(rfaPromises);
|
|
561
|
-
return rfas.filter((r) => r !== null);
|
|
562
|
-
},
|
|
563
|
-
staleTime: 30 * 1000,
|
|
564
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
565
|
-
retry: 2,
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Fetch a single RFA by ID
|
|
570
|
-
*/
|
|
571
|
-
export function useRFAData(rfaId) {
|
|
572
|
-
return useQuery({
|
|
573
|
-
queryKey: ["rfa", "data", rfaId],
|
|
574
|
-
queryFn: async () => {
|
|
575
|
-
if (!rfaId)
|
|
576
|
-
return null;
|
|
577
|
-
return fetchRFAData(rfaId);
|
|
578
|
-
},
|
|
579
|
-
enabled: !!rfaId && rfaId > 0,
|
|
580
|
-
staleTime: 30 * 1000,
|
|
581
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Fetch submissions for an RFA
|
|
586
|
-
*/
|
|
587
|
-
export function useRFASubmissions(rfaId) {
|
|
588
|
-
return useQuery({
|
|
589
|
-
queryKey: ["rfa", "submissions", rfaId],
|
|
590
|
-
queryFn: async () => {
|
|
591
|
-
if (!rfaId)
|
|
592
|
-
return [];
|
|
593
|
-
return fetchRFASubmissions(rfaId);
|
|
594
|
-
},
|
|
595
|
-
enabled: !!rfaId && rfaId > 0,
|
|
596
|
-
staleTime: 30 * 1000,
|
|
597
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Fetch RFAs published by a specific address
|
|
602
|
-
*/
|
|
603
|
-
export function useRFAsByPublisher(publisher) {
|
|
604
|
-
return useQuery({
|
|
605
|
-
queryKey: ["rfa", "by-publisher", publisher?.toLowerCase()],
|
|
606
|
-
queryFn: async () => {
|
|
607
|
-
if (!publisher)
|
|
608
|
-
return [];
|
|
609
|
-
const contract = getRFAContract();
|
|
610
|
-
const rfaIds = await readContract({
|
|
611
|
-
contract,
|
|
612
|
-
method: "function getRFAsByPublisher(address publisher) view returns (uint256[])",
|
|
613
|
-
params: [publisher],
|
|
614
|
-
});
|
|
615
|
-
if (rfaIds.length === 0)
|
|
616
|
-
return [];
|
|
617
|
-
const rfaPromises = rfaIds.map(id => fetchRFAData(Number(id)));
|
|
618
|
-
const rfas = await Promise.all(rfaPromises);
|
|
619
|
-
return rfas.filter((r) => r !== null);
|
|
620
|
-
},
|
|
621
|
-
enabled: !!publisher,
|
|
622
|
-
staleTime: 30 * 1000,
|
|
623
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
/**
|
|
627
|
-
* Fetch RFAs for a specific Manowar
|
|
628
|
-
*/
|
|
629
|
-
export function useRFAsForManowar(manowarId) {
|
|
630
|
-
return useQuery({
|
|
631
|
-
queryKey: ["rfa", "by-manowar", manowarId],
|
|
632
|
-
queryFn: async () => {
|
|
633
|
-
if (!manowarId)
|
|
634
|
-
return [];
|
|
635
|
-
const contract = getRFAContract();
|
|
636
|
-
const rfaIds = await readContract({
|
|
637
|
-
contract,
|
|
638
|
-
method: "function getRFAsForManowar(uint256 manowarId) view returns (uint256[])",
|
|
639
|
-
params: [BigInt(manowarId)],
|
|
640
|
-
});
|
|
641
|
-
if (rfaIds.length === 0)
|
|
642
|
-
return [];
|
|
643
|
-
const rfaPromises = rfaIds.map(id => fetchRFAData(Number(id)));
|
|
644
|
-
const rfas = await Promise.all(rfaPromises);
|
|
645
|
-
return rfas.filter((r) => r !== null);
|
|
646
|
-
},
|
|
647
|
-
enabled: !!manowarId && manowarId > 0,
|
|
648
|
-
staleTime: 30 * 1000,
|
|
649
|
-
gcTime: 5 * 60 * 1000, // Keep in cache 5 minutes
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
//# sourceMappingURL=use-onchain.js.map
|