From fc74a44eff082a24ce3468f765dd1d1726a7c917 Mon Sep 17 00:00:00 2001 From: Ezejaemmanuel <113842626+Ezejaemmanuel@users.noreply.github.com> Date: Sat, 30 Aug 2025 10:46:39 +0100 Subject: [PATCH 1/2] Add/Update cortigpt-monorepo - Cortensor AI Platform --- apps/cortigpt-monorepo/.gitignore | 48 + apps/cortigpt-monorepo/.oxlintrc.json | 142 + apps/cortigpt-monorepo/.sync-metadata.json | 9 + apps/cortigpt-monorepo/COMMUNITY_README.md | 104 + apps/cortigpt-monorepo/PROJECTS_SAMPLE.yml | 32 + apps/cortigpt-monorepo/README.md | 446 + apps/cortigpt-monorepo/RELEASE.md | 117 + apps/cortigpt-monorepo/STATUS.md | 84 + .../apps/extension/.gitignore | 26 + apps/cortigpt-monorepo/apps/extension/.npmrc | 2 + apps/cortigpt-monorepo/apps/extension/LICENSE | 201 + .../apps/extension/README.md | 210 + .../apps/extension/abis/SessionQueueV2.json | 1950 ++ .../apps/extension/abis/SessionV2.json | 2257 ++ .../apps/extension/app.config.ts | 18 + .../apps/extension/assets/react.svg | 1 + .../apps/extension/assets/tailwind.css | 413 + .../apps/extension/components.json | 21 + .../extension/components/MarkdownRenderer.tsx | 251 + .../components/connect-wallet-button.tsx | 130 + .../extension/components/ui/accordion.tsx | 56 + .../extension/components/ui/alert-dialog.tsx | 139 + .../apps/extension/components/ui/alert.tsx | 59 + .../extension/components/ui/aspect-ratio.tsx | 5 + .../apps/extension/components/ui/avatar.tsx | 48 + .../apps/extension/components/ui/badge.tsx | 36 + .../extension/components/ui/breadcrumb.tsx | 115 + .../apps/extension/components/ui/button.tsx | 60 + .../apps/extension/components/ui/calendar.tsx | 64 + .../apps/extension/components/ui/card.tsx | 79 + .../apps/extension/components/ui/carousel.tsx | 261 + .../apps/extension/components/ui/chart.tsx | 363 + .../apps/extension/components/ui/checkbox.tsx | 28 + .../extension/components/ui/collapsible.tsx | 9 + .../apps/extension/components/ui/command.tsx | 153 + .../components/ui/connect-wallet-button.tsx | 172 + .../extension/components/ui/context-menu.tsx | 198 + .../apps/extension/components/ui/credenza.tsx | 174 + .../apps/extension/components/ui/dialog.tsx | 120 + .../apps/extension/components/ui/drawer.tsx | 116 + .../extension/components/ui/dropdown-menu.tsx | 198 + .../apps/extension/components/ui/form.tsx | 176 + .../extension/components/ui/hover-card.tsx | 27 + .../extension/components/ui/input-otp.tsx | 69 + .../apps/extension/components/ui/input.tsx | 22 + .../apps/extension/components/ui/label.tsx | 24 + .../extension/components/ui/markdown-text.tsx | 132 + .../apps/extension/components/ui/menubar.tsx | 234 + .../components/ui/navigation-menu.tsx | 128 + .../components/ui/neural-background.tsx | 100 + .../extension/components/ui/pagination.tsx | 117 + .../apps/extension/components/ui/popover.tsx | 29 + .../apps/extension/components/ui/progress.tsx | 26 + .../extension/components/ui/radio-group.tsx | 42 + .../extension/components/ui/resizable.tsx | 43 + .../extension/components/ui/scroll-area.tsx | 46 + .../apps/extension/components/ui/select.tsx | 158 + .../extension/components/ui/separator.tsx | 29 + .../apps/extension/components/ui/sheet.tsx | 131 + .../apps/extension/components/ui/sidebar.tsx | 761 + .../apps/extension/components/ui/skeleton.tsx | 15 + .../apps/extension/components/ui/slider.tsx | 26 + .../apps/extension/components/ui/sonner.tsx | 29 + .../apps/extension/components/ui/switch.tsx | 27 + .../apps/extension/components/ui/table.tsx | 117 + .../apps/extension/components/ui/tabs.tsx | 53 + .../apps/extension/components/ui/textarea.tsx | 24 + .../extension/components/ui/thread-list.tsx | 66 + .../apps/extension/components/ui/thread.tsx | 398 + .../apps/extension/components/ui/toast.tsx | 127 + .../apps/extension/components/ui/toaster.tsx | 33 + .../extension/components/ui/toggle-group.tsx | 59 + .../apps/extension/components/ui/toggle.tsx | 43 + .../extension/components/ui/tool-fallback.tsx | 42 + .../components/ui/tooltip-icon-button.tsx | 41 + .../apps/extension/components/ui/tooltip.tsx | 28 + .../apps/extension/components/ui/use-toast.ts | 3 + .../apps/extension/entrypoints/background.ts | 168 + .../apps/extension/entrypoints/content.ts | 75 + .../extension/entrypoints/sidepanel/App.tsx | 40 + .../entrypoints/sidepanel/Navbar.tsx | 201 + .../sidepanel/components/Dashboard.tsx | 76 + .../sidepanel/components/ErrorBoundary.tsx | 108 + .../sidepanel/components/SplashScreen.tsx | 147 + .../entrypoints/sidepanel/components/Web2.tsx | 39 + .../entrypoints/sidepanel/components/Web3.tsx | 42 + .../components/components/ChatInterface.tsx | 305 + .../components/components/EventLogger.tsx | 326 + .../components/components/EventMonitor.tsx | 307 + .../components/SessionCreationDialog.tsx | 134 + .../components/components/SessionManager.tsx | 246 + .../components/components/TaskManager.tsx | 443 + .../components/components/TaskResults.tsx | 337 + .../components/hooks/useCortensorSession.ts | 200 + .../components/hooks/useCortensorTasks.ts | 364 + .../sidepanel/components/mainWeb2.tsx | 263 + .../sidepanel/components/mainWeb3.tsx | 486 + .../components/store/useChatStore.ts | 60 + .../components/store/useSessionStore.ts | 121 + .../components/web2Components/ChatHistory.tsx | 162 + .../web2Components/ChatInterface.tsx | 767 + .../entrypoints/sidepanel/index.html | 13 + .../extension/entrypoints/sidepanel/main.tsx | 11 + .../apps/extension/generated.ts | 4851 ++++ .../extension/hooks/use-detected-wallets.ts | 93 + .../apps/extension/hooks/use-mobile.ts | 19 + .../apps/extension/hooks/use-settings.ts | 133 + .../apps/extension/hooks/use-splash-screen.ts | 31 + .../apps/extension/hooks/use-theme.ts | 73 + .../apps/extension/hooks/use-toast.ts | 191 + .../apps/extension/lib/api-config.ts | 28 + .../apps/extension/lib/constants.ts | 61 + .../apps/extension/lib/message-handler.ts | 88 + .../apps/extension/lib/messaging-utils.ts | 216 + .../apps/extension/lib/safeGhostName.ts | 20 + .../apps/extension/lib/selection-storage.ts | 94 + .../apps/extension/lib/selection-utils.ts | 133 + .../apps/extension/lib/text-extractor.ts | 90 + .../apps/extension/lib/utils.ts | 6 + .../apps/extension/lib/wagmiConfig.ts | 19 + .../apps/extension/package.json | 114 + .../apps/extension/postcss.config.js | 7 + .../providers/react-query-provider.tsx | 25 + .../extension/providers/web3-provider.tsx | 32 + .../apps/extension/public/cortigpt-128.png | Bin 0 -> 27272 bytes .../apps/extension/public/cortigpt-16.png | Bin 0 -> 912 bytes .../apps/extension/public/cortigpt-24.png | Bin 0 -> 1662 bytes .../apps/extension/public/cortigpt-256.png | Bin 0 -> 100579 bytes .../apps/extension/public/cortigpt-32.png | Bin 0 -> 2620 bytes .../apps/extension/public/cortigpt-4.png | Bin 0 -> 1066136 bytes .../apps/extension/public/cortigpt-48.png | Bin 0 -> 4999 bytes .../apps/extension/public/cortigpt-64.png | Bin 0 -> 8083 bytes .../apps/extension/public/cortigpt-96.png | Bin 0 -> 16384 bytes .../apps/extension/public/favicon.ico | Bin 0 -> 33310 bytes .../apps/extension/scripts/generate-icons.js | 28 + .../apps/extension/stores/chat-store.ts | 288 + .../apps/extension/stores/useWeb2ChatStore.ts | 305 + .../apps/extension/tailwind.config.js | 151 + .../apps/extension/tsconfig.json | 9 + .../apps/extension/types/messaging.ts | 48 + .../apps/extension/wagmi.config.ts | 26 + .../apps/extension/wxt.config.ts | 43 + apps/cortigpt-monorepo/apps/server/README.md | 340 + .../apps/server/next.config.ts | 22 + .../apps/server/package.json | 25 + .../apps/server/src/app/api/chat/route.ts | 101 + .../apps/server/src/app/layout.tsx | 18 + .../apps/server/src/app/page.tsx | 21 + .../apps/server/tsconfig.json | 33 + apps/cortigpt-monorepo/apps/web/.gitignore | 59 + apps/cortigpt-monorepo/apps/web/README.md | 263 + .../apps/web/abis/SessionQueueV2.json | 1950 ++ .../apps/web/abis/SessionV2.json | 2257 ++ .../apps/web/components.json | 21 + .../apps/web/eslint.config.mjs | 25 + .../cortigpt-monorepo/apps/web/next.config.ts | 19 + apps/cortigpt-monorepo/apps/web/package.json | 126 + .../apps/web/postcss.config.js | 6 + .../apps/web/public/agent-chat-neon.jpg | Bin 0 -> 20972 bytes .../apps/web/public/agent-chat.jpg | Bin 0 -> 21426 bytes .../apps/web/public/agent-truth.jpg | Bin 0 -> 19917 bytes .../apps/web/public/agent-tweets-neon.jpg | Bin 0 -> 17990 bytes .../apps/web/public/agent-tweets.jpg | Bin 0 -> 21577 bytes .../apps/web/public/browserconfig.xml | 21 + .../apps/web/public/cortigpt-4.png | Bin 0 -> 1066136 bytes .../apps/web/public/file.svg | 1 + .../apps/web/public/globe.svg | 1 + .../web/public/hero-neural-globe-neon.jpg | Bin 0 -> 132822 bytes .../apps/web/public/hero-neural-globe.jpg | Bin 0 -> 157375 bytes .../apps/web/public/manifest.json | 68 + .../apps/web/public/next.svg | 1 + .../apps/web/public/robots.txt | 34 + .../apps/web/public/vercel.svg | 1 + .../apps/web/public/window.svg | 1 + .../apps/web/src/app/choose-mode/page.tsx | 225 + .../components/ChatInterface.tsx | 307 + .../cortensorChat/components/EventLogger.tsx | 326 + .../cortensorChat/components/EventMonitor.tsx | 307 + .../components/SessionCreationDialog.tsx | 134 + .../components/SessionManager.tsx | 246 + .../cortensorChat/components/TaskManager.tsx | 443 + .../cortensorChat/components/TaskResults.tsx | 337 + .../hooks/useCortensorSession.ts | 200 + .../cortensorChat/hooks/useCortensorTasks.ts | 365 + .../web/src/app/cortensorChat/mainWeb2.tsx | 262 + .../web/src/app/cortensorChat/mainWeb3.tsx | 497 + .../apps/web/src/app/cortensorChat/page.tsx | 174 + .../app/cortensorChat/store/useChatStore.ts | 60 + .../cortensorChat/store/useSessionStore.ts | 121 + .../cortensorChat/store/useWeb2ChatStore.ts | 295 + .../web2Components/ChatHistory.tsx | 148 + .../web2Components/ChatInterface.tsx | 607 + .../apps/web/src/app/error.tsx | 46 + .../web/src/app/extension-install/page.tsx | 280 + .../apps/web/src/app/globals.css | 394 + .../apps/web/src/app/icon.png | Bin 0 -> 1066136 bytes .../apps/web/src/app/layout.tsx | 144 + .../apps/web/src/app/loading.tsx | 67 + .../apps/web/src/app/not-found.tsx | 36 + .../apps/web/src/app/page.tsx | 50 + .../web/src/components/MarkdownRenderer.tsx | 251 + .../apps/web/src/components/layout/Navbar.tsx | 200 + .../src/components/sections/AgentShowcase.tsx | 116 + .../web/src/components/sections/Footer.tsx | 102 + .../apps/web/src/components/sections/Hero.tsx | 82 + .../src/components/sections/HowItWorksNew.tsx | 496 + .../web/src/components/sections/UseCases.tsx | 118 + .../apps/web/src/components/ui/accordion.tsx | 56 + .../web/src/components/ui/alert-dialog.tsx | 139 + .../apps/web/src/components/ui/alert.tsx | 59 + .../web/src/components/ui/aspect-ratio.tsx | 5 + .../apps/web/src/components/ui/avatar.tsx | 48 + .../apps/web/src/components/ui/badge.tsx | 36 + .../apps/web/src/components/ui/breadcrumb.tsx | 115 + .../apps/web/src/components/ui/button.tsx | 60 + .../apps/web/src/components/ui/calendar.tsx | 64 + .../apps/web/src/components/ui/card.tsx | 79 + .../apps/web/src/components/ui/chart.tsx | 363 + .../apps/web/src/components/ui/checkbox.tsx | 28 + .../web/src/components/ui/collapsible.tsx | 9 + .../apps/web/src/components/ui/command.tsx | 153 + .../components/ui/connect-wallet-button.tsx | 172 + .../web/src/components/ui/context-menu.tsx | 198 + .../apps/web/src/components/ui/credenza.tsx | 174 + .../apps/web/src/components/ui/dialog.tsx | 120 + .../apps/web/src/components/ui/drawer.tsx | 116 + .../web/src/components/ui/dropdown-menu.tsx | 198 + .../apps/web/src/components/ui/form.tsx | 176 + .../apps/web/src/components/ui/hover-card.tsx | 27 + .../apps/web/src/components/ui/input-otp.tsx | 69 + .../apps/web/src/components/ui/input.tsx | 22 + .../apps/web/src/components/ui/label.tsx | 24 + .../web/src/components/ui/markdown-text.tsx | 132 + .../apps/web/src/components/ui/menubar.tsx | 234 + .../web/src/components/ui/navigation-menu.tsx | 128 + .../src/components/ui/neural-background.tsx | 100 + .../src/components/ui/new-intro-splash.tsx | 778 + .../apps/web/src/components/ui/pagination.tsx | 117 + .../apps/web/src/components/ui/popover.tsx | 29 + .../apps/web/src/components/ui/progress.tsx | 26 + .../web/src/components/ui/radio-group.tsx | 42 + .../apps/web/src/components/ui/resizable.tsx | 43 + .../web/src/components/ui/scroll-area.tsx | 46 + .../apps/web/src/components/ui/select.tsx | 158 + .../apps/web/src/components/ui/separator.tsx | 29 + .../apps/web/src/components/ui/sheet.tsx | 131 + .../apps/web/src/components/ui/sidebar.tsx | 761 + .../apps/web/src/components/ui/skeleton.tsx | 15 + .../apps/web/src/components/ui/slider.tsx | 26 + .../apps/web/src/components/ui/sonner.tsx | 30 + .../apps/web/src/components/ui/switch.tsx | 27 + .../apps/web/src/components/ui/table.tsx | 117 + .../apps/web/src/components/ui/tabs.tsx | 53 + .../apps/web/src/components/ui/textarea.tsx | 24 + .../web/src/components/ui/thread-list.tsx | 66 + .../apps/web/src/components/ui/thread.tsx | 398 + .../apps/web/src/components/ui/toast.tsx | 127 + .../apps/web/src/components/ui/toaster.tsx | 33 + .../web/src/components/ui/toggle-group.tsx | 59 + .../apps/web/src/components/ui/toggle.tsx | 43 + .../web/src/components/ui/tool-fallback.tsx | 42 + .../src/components/ui/tooltip-icon-button.tsx | 41 + .../apps/web/src/components/ui/tooltip.tsx | 28 + .../apps/web/src/components/ui/use-toast.ts | 3 + .../apps/web/src/generated.ts | 4851 ++++ .../apps/web/src/hooks/index.ts | 3 + .../apps/web/src/hooks/use-mobile.ts | 19 + .../apps/web/src/hooks/use-mobile.tsx | 19 + .../apps/web/src/hooks/use-toast.ts | 191 + .../apps/web/src/lib/api-config.ts | 28 + .../apps/web/src/lib/constants.ts | 59 + .../apps/web/src/lib/index.ts | 4 + .../apps/web/src/lib/utils.ts | 6 + .../apps/web/src/lib/wagmiConfig.ts | 18 + .../src/providers/react-query-provider.tsx | 25 + .../apps/web/src/providers/web3-provider.tsx | 46 + .../apps/web/tailwind.config.ts | 135 + apps/cortigpt-monorepo/apps/web/tsconfig.json | 43 + .../apps/web/wagmi.config.ts | 26 + apps/cortigpt-monorepo/bts.jsonc | 26 + apps/cortigpt-monorepo/package.json | 40 + apps/cortigpt-monorepo/packages/ai/README.md | 457 + .../packages/ai/package.json | 44 + .../packages/ai/src/client.ts | 0 .../packages/ai/src/constants.ts | 1 + .../packages/ai/src/index.ts | 1 + .../ai/src/mastra/agents/cortigpt-agent.ts | 67 + .../packages/ai/src/mastra/index.ts | 43 + .../packages/ai/src/server.ts | 3 + .../packages/ai/src/types.ts | 0 .../packages/ai/src/utils.ts | 0 .../packages/ai/tsconfig.json | 40 + apps/cortigpt-monorepo/pnpm-lock.yaml | 21031 ++++++++++++++++ apps/cortigpt-monorepo/pnpm-workspace.yaml | 3 + apps/cortigpt-monorepo/railway.json | 12 + apps/cortigpt-monorepo/tsconfig.json | 35 + apps/cortigpt-monorepo/turbo.json | 60 + 297 files changed, 71585 insertions(+) create mode 100644 apps/cortigpt-monorepo/.gitignore create mode 100644 apps/cortigpt-monorepo/.oxlintrc.json create mode 100644 apps/cortigpt-monorepo/.sync-metadata.json create mode 100644 apps/cortigpt-monorepo/COMMUNITY_README.md create mode 100644 apps/cortigpt-monorepo/PROJECTS_SAMPLE.yml create mode 100644 apps/cortigpt-monorepo/README.md create mode 100644 apps/cortigpt-monorepo/RELEASE.md create mode 100644 apps/cortigpt-monorepo/STATUS.md create mode 100644 apps/cortigpt-monorepo/apps/extension/.gitignore create mode 100644 apps/cortigpt-monorepo/apps/extension/.npmrc create mode 100644 apps/cortigpt-monorepo/apps/extension/LICENSE create mode 100644 apps/cortigpt-monorepo/apps/extension/README.md create mode 100644 apps/cortigpt-monorepo/apps/extension/abis/SessionQueueV2.json create mode 100644 apps/cortigpt-monorepo/apps/extension/abis/SessionV2.json create mode 100644 apps/cortigpt-monorepo/apps/extension/app.config.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/assets/react.svg create mode 100644 apps/cortigpt-monorepo/apps/extension/assets/tailwind.css create mode 100644 apps/cortigpt-monorepo/apps/extension/components.json create mode 100644 apps/cortigpt-monorepo/apps/extension/components/MarkdownRenderer.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/connect-wallet-button.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/accordion.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/alert-dialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/alert.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/aspect-ratio.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/avatar.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/badge.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/breadcrumb.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/button.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/calendar.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/card.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/carousel.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/chart.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/checkbox.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/collapsible.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/command.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/connect-wallet-button.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/context-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/credenza.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/dialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/drawer.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/dropdown-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/form.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/hover-card.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/input-otp.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/input.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/label.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/markdown-text.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/menubar.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/navigation-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/neural-background.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/pagination.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/popover.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/progress.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/radio-group.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/resizable.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/scroll-area.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/select.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/separator.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/sheet.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/sidebar.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/skeleton.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/slider.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/sonner.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/switch.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/table.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/tabs.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/textarea.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/thread-list.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/thread.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/toast.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/toaster.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/toggle-group.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/toggle.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/tool-fallback.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/tooltip-icon-button.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/tooltip.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/components/ui/use-toast.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/background.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/content.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/App.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/Navbar.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/Dashboard.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/ErrorBoundary.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/SplashScreen.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/Web2.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/Web3.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/ChatInterface.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/EventLogger.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/EventMonitor.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/SessionCreationDialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/SessionManager.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/TaskManager.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/components/TaskResults.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/hooks/useCortensorSession.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/hooks/useCortensorTasks.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/mainWeb2.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/mainWeb3.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/store/useChatStore.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/store/useSessionStore.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/web2Components/ChatHistory.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/components/web2Components/ChatInterface.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/index.html create mode 100644 apps/cortigpt-monorepo/apps/extension/entrypoints/sidepanel/main.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/generated.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-detected-wallets.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-mobile.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-settings.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-splash-screen.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-theme.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/hooks/use-toast.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/api-config.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/constants.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/message-handler.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/messaging-utils.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/safeGhostName.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/selection-storage.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/selection-utils.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/text-extractor.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/utils.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/lib/wagmiConfig.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/package.json create mode 100644 apps/cortigpt-monorepo/apps/extension/postcss.config.js create mode 100644 apps/cortigpt-monorepo/apps/extension/providers/react-query-provider.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/providers/web3-provider.tsx create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-128.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-16.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-24.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-256.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-32.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-4.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-48.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-64.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/cortigpt-96.png create mode 100644 apps/cortigpt-monorepo/apps/extension/public/favicon.ico create mode 100644 apps/cortigpt-monorepo/apps/extension/scripts/generate-icons.js create mode 100644 apps/cortigpt-monorepo/apps/extension/stores/chat-store.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/stores/useWeb2ChatStore.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/tailwind.config.js create mode 100644 apps/cortigpt-monorepo/apps/extension/tsconfig.json create mode 100644 apps/cortigpt-monorepo/apps/extension/types/messaging.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/wagmi.config.ts create mode 100644 apps/cortigpt-monorepo/apps/extension/wxt.config.ts create mode 100644 apps/cortigpt-monorepo/apps/server/README.md create mode 100644 apps/cortigpt-monorepo/apps/server/next.config.ts create mode 100644 apps/cortigpt-monorepo/apps/server/package.json create mode 100644 apps/cortigpt-monorepo/apps/server/src/app/api/chat/route.ts create mode 100644 apps/cortigpt-monorepo/apps/server/src/app/layout.tsx create mode 100644 apps/cortigpt-monorepo/apps/server/src/app/page.tsx create mode 100644 apps/cortigpt-monorepo/apps/server/tsconfig.json create mode 100644 apps/cortigpt-monorepo/apps/web/.gitignore create mode 100644 apps/cortigpt-monorepo/apps/web/README.md create mode 100644 apps/cortigpt-monorepo/apps/web/abis/SessionQueueV2.json create mode 100644 apps/cortigpt-monorepo/apps/web/abis/SessionV2.json create mode 100644 apps/cortigpt-monorepo/apps/web/components.json create mode 100644 apps/cortigpt-monorepo/apps/web/eslint.config.mjs create mode 100644 apps/cortigpt-monorepo/apps/web/next.config.ts create mode 100644 apps/cortigpt-monorepo/apps/web/package.json create mode 100644 apps/cortigpt-monorepo/apps/web/postcss.config.js create mode 100644 apps/cortigpt-monorepo/apps/web/public/agent-chat-neon.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/agent-chat.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/agent-truth.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/agent-tweets-neon.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/agent-tweets.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/browserconfig.xml create mode 100644 apps/cortigpt-monorepo/apps/web/public/cortigpt-4.png create mode 100644 apps/cortigpt-monorepo/apps/web/public/file.svg create mode 100644 apps/cortigpt-monorepo/apps/web/public/globe.svg create mode 100644 apps/cortigpt-monorepo/apps/web/public/hero-neural-globe-neon.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/hero-neural-globe.jpg create mode 100644 apps/cortigpt-monorepo/apps/web/public/manifest.json create mode 100644 apps/cortigpt-monorepo/apps/web/public/next.svg create mode 100644 apps/cortigpt-monorepo/apps/web/public/robots.txt create mode 100644 apps/cortigpt-monorepo/apps/web/public/vercel.svg create mode 100644 apps/cortigpt-monorepo/apps/web/public/window.svg create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/choose-mode/page.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/ChatInterface.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/EventLogger.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/EventMonitor.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/SessionCreationDialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/SessionManager.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/TaskManager.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/components/TaskResults.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/hooks/useCortensorSession.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/hooks/useCortensorTasks.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/mainWeb2.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/mainWeb3.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/page.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/store/useChatStore.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/store/useSessionStore.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/store/useWeb2ChatStore.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/web2Components/ChatHistory.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/cortensorChat/web2Components/ChatInterface.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/error.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/extension-install/page.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/globals.css create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/icon.png create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/layout.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/loading.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/not-found.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/app/page.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/MarkdownRenderer.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/layout/Navbar.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/sections/AgentShowcase.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/sections/Footer.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/sections/Hero.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/sections/HowItWorksNew.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/sections/UseCases.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/accordion.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/alert-dialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/alert.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/aspect-ratio.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/avatar.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/badge.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/breadcrumb.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/button.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/calendar.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/card.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/chart.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/checkbox.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/collapsible.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/command.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/connect-wallet-button.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/context-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/credenza.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/dialog.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/drawer.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/dropdown-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/form.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/hover-card.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/input-otp.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/input.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/label.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/markdown-text.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/menubar.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/navigation-menu.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/neural-background.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/new-intro-splash.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/pagination.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/popover.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/progress.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/radio-group.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/resizable.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/scroll-area.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/select.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/separator.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/sheet.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/sidebar.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/skeleton.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/slider.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/sonner.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/switch.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/table.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/tabs.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/textarea.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/thread-list.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/thread.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/toast.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/toaster.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/toggle-group.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/toggle.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/tool-fallback.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/tooltip-icon-button.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/tooltip.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/components/ui/use-toast.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/generated.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/hooks/index.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/hooks/use-mobile.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/hooks/use-mobile.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/hooks/use-toast.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/lib/api-config.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/lib/constants.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/lib/index.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/lib/utils.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/lib/wagmiConfig.ts create mode 100644 apps/cortigpt-monorepo/apps/web/src/providers/react-query-provider.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/src/providers/web3-provider.tsx create mode 100644 apps/cortigpt-monorepo/apps/web/tailwind.config.ts create mode 100644 apps/cortigpt-monorepo/apps/web/tsconfig.json create mode 100644 apps/cortigpt-monorepo/apps/web/wagmi.config.ts create mode 100644 apps/cortigpt-monorepo/bts.jsonc create mode 100644 apps/cortigpt-monorepo/package.json create mode 100644 apps/cortigpt-monorepo/packages/ai/README.md create mode 100644 apps/cortigpt-monorepo/packages/ai/package.json create mode 100644 apps/cortigpt-monorepo/packages/ai/src/client.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/constants.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/index.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/mastra/agents/cortigpt-agent.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/mastra/index.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/server.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/types.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/src/utils.ts create mode 100644 apps/cortigpt-monorepo/packages/ai/tsconfig.json create mode 100644 apps/cortigpt-monorepo/pnpm-lock.yaml create mode 100644 apps/cortigpt-monorepo/pnpm-workspace.yaml create mode 100644 apps/cortigpt-monorepo/railway.json create mode 100644 apps/cortigpt-monorepo/tsconfig.json create mode 100644 apps/cortigpt-monorepo/turbo.json diff --git a/apps/cortigpt-monorepo/.gitignore b/apps/cortigpt-monorepo/.gitignore new file mode 100644 index 0000000..aecb2ca --- /dev/null +++ b/apps/cortigpt-monorepo/.gitignore @@ -0,0 +1,48 @@ +node_modules +.turbo +.mastra + +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* +.next +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts +.vscode/settings.json + +sync-to-community-projects.js \ No newline at end of file diff --git a/apps/cortigpt-monorepo/.oxlintrc.json b/apps/cortigpt-monorepo/.oxlintrc.json new file mode 100644 index 0000000..4b7ac59 --- /dev/null +++ b/apps/cortigpt-monorepo/.oxlintrc.json @@ -0,0 +1,142 @@ +{ + "plugins": [ + "unicorn", + "typescript", + "oxc" + ], + "categories": {}, + "rules": { + "for-direction": "warn", + "no-async-promise-executor": "warn", + "no-caller": "warn", + "no-class-assign": "warn", + "no-compare-neg-zero": "warn", + "no-cond-assign": "warn", + "no-const-assign": "warn", + "no-constant-binary-expression": "warn", + "no-constant-condition": "warn", + "no-control-regex": "warn", + "no-debugger": "warn", + "no-delete-var": "warn", + "no-dupe-class-members": "warn", + "no-dupe-else-if": "warn", + "no-dupe-keys": "warn", + "no-duplicate-case": "warn", + "no-empty-character-class": "warn", + "no-empty-pattern": "warn", + "no-empty-static-block": "warn", + "no-eval": "warn", + "no-ex-assign": "warn", + "no-extra-boolean-cast": "warn", + "no-func-assign": "warn", + "no-global-assign": "warn", + "no-import-assign": "warn", + "no-invalid-regexp": "warn", + "no-irregular-whitespace": "warn", + "no-loss-of-precision": "warn", + "no-new-native-nonconstructor": "warn", + "no-nonoctal-decimal-escape": "warn", + "no-obj-calls": "warn", + "no-self-assign": "warn", + "no-setter-return": "warn", + "no-shadow-restricted-names": "warn", + "no-sparse-arrays": "warn", + "no-this-before-super": "warn", + "no-unassigned-vars": "warn", + "no-unsafe-finally": "warn", + "no-unsafe-negation": "warn", + "no-unsafe-optional-chaining": "warn", + "no-unused-labels": "warn", + "no-unused-private-class-members": "warn", + "no-unused-vars": "warn", + "no-useless-backreference": "warn", + "no-useless-catch": "warn", + "no-useless-escape": "warn", + "no-useless-rename": "warn", + "no-with": "warn", + "require-yield": "warn", + "use-isnan": "warn", + "valid-typeof": "warn", + "oxc/bad-array-method-on-arguments": "warn", + "oxc/bad-char-at-comparison": "warn", + "oxc/bad-comparison-sequence": "warn", + "oxc/bad-min-max-func": "warn", + "oxc/bad-object-literal-comparison": "warn", + "oxc/bad-replace-all-arg": "warn", + "oxc/const-comparisons": "warn", + "oxc/double-comparisons": "warn", + "oxc/erasing-op": "warn", + "oxc/missing-throw": "warn", + "oxc/number-arg-out-of-range": "warn", + "oxc/only-used-in-recursion": "warn", + "oxc/uninvoked-array-callback": "warn", + "typescript/await-thenable": "warn", + "typescript/no-array-delete": "warn", + "typescript/no-base-to-string": "warn", + "typescript/no-confusing-void-expression": "warn", + "typescript/no-duplicate-enum-values": "warn", + "typescript/no-duplicate-type-constituents": "warn", + "typescript/no-extra-non-null-assertion": "warn", + "typescript/no-floating-promises": "warn", + "typescript/no-for-in-array": "warn", + "typescript/no-implied-eval": "warn", + "typescript/no-meaningless-void-operator": "warn", + "typescript/no-misused-new": "warn", + "typescript/no-misused-spread": "warn", + "typescript/no-non-null-asserted-optional-chain": "warn", + "typescript/no-redundant-type-constituents": "warn", + "typescript/no-this-alias": "warn", + "typescript/no-unnecessary-parameter-property-assignment": "warn", + "typescript/no-unsafe-declaration-merging": "warn", + "typescript/no-unsafe-unary-minus": "warn", + "typescript/no-useless-empty-export": "warn", + "typescript/no-wrapper-object-types": "warn", + "typescript/prefer-as-const": "warn", + "typescript/require-array-sort-compare": "warn", + "typescript/restrict-template-expressions": "warn", + "typescript/triple-slash-reference": "warn", + "typescript/unbound-method": "warn", + "unicorn/no-await-in-promise-methods": "warn", + "unicorn/no-empty-file": "warn", + "unicorn/no-invalid-fetch-options": "warn", + "unicorn/no-invalid-remove-event-listener": "warn", + "unicorn/no-new-array": "warn", + "unicorn/no-single-promise-in-promise-methods": "warn", + "unicorn/no-thenable": "warn", + "unicorn/no-unnecessary-await": "warn", + "unicorn/no-useless-fallback-in-spread": "warn", + "unicorn/no-useless-length-check": "warn", + "unicorn/no-useless-spread": "warn", + "unicorn/prefer-set-size": "warn", + "unicorn/prefer-string-starts-ends-with": "warn" + }, + "settings": { + "jsx-a11y": { + "polymorphicPropName": null, + "components": {}, + "attributes": {} + }, + "next": { + "rootDir": [] + }, + "react": { + "formComponents": [], + "linkComponents": [] + }, + "jsdoc": { + "ignorePrivate": false, + "ignoreInternal": false, + "ignoreReplacesDocs": true, + "overrideReplacesDocs": true, + "augmentsExtendsReplacesDocs": false, + "implementsReplacesDocs": false, + "exemptDestructuredRootsFromChecks": false, + "tagNamePreference": {} + } + }, + "env": { + "builtin": true + }, + "globals": {}, + "ignorePatterns": [] +} \ No newline at end of file diff --git a/apps/cortigpt-monorepo/.sync-metadata.json b/apps/cortigpt-monorepo/.sync-metadata.json new file mode 100644 index 0000000..7bd54dd --- /dev/null +++ b/apps/cortigpt-monorepo/.sync-metadata.json @@ -0,0 +1,9 @@ +{ + "sourceRepository": "https://github.com/Ezejaemmanuel/cortigpt-monorepo.git", + "lastSync": "2025-08-30T09:46:34.713Z", + "syncedBy": "HP", + "projectName": "cortigpt-monorepo", + "version": "2.0.0", + "syncTool": "Node.js", + "nodeVersion": "v22.14.0" +} diff --git a/apps/cortigpt-monorepo/COMMUNITY_README.md b/apps/cortigpt-monorepo/COMMUNITY_README.md new file mode 100644 index 0000000..e82362f --- /dev/null +++ b/apps/cortigpt-monorepo/COMMUNITY_README.md @@ -0,0 +1,104 @@ +# CortiGPT - Decentralized AI Platform + +> **A comprehensive monorepo for decentralized AI chat and search capabilities powered by the Cortensor network** + +## 🚀 Quick Overview + +CortiGPT is a complete AI platform that combines blockchain technology with AI-powered search and chat capabilities. This project is part of the [Cortensor Community Projects](https://github.com/cortensor/community-projects). + +### What's Included + +- **🌐 Web Application** - Full-featured AI chat interface with Web3 integration +- **🔌 Browser Extension** - Cross-browser AI assistant with sidepanel interface +- **🖥️ API Server** - Scalable backend for AI services and chat management +- **🤖 AI Package** - Shared AI integration library with Mastra framework + +## 🛠️ Tech Stack + +- **Frontend**: Next.js 15, React 19, Tailwind CSS, shadcn/ui +- **AI Integration**: Cortensor OpenAI Provider, Mastra Framework +- **Blockchain**: Wagmi, Viem, RainbowKit +- **Development**: TypeScript, Turborepo, pnpm + +## 🚀 Getting Started + +### Prerequisites +- Node.js 18+ +- pnpm 10.12.3+ +- Git + +### Installation + +1. **Clone and install dependencies** + ```bash + git clone https://github.com/cortensor/community-projects.git + cd community-projects/apps/cortigpt-monorepo + pnpm install + ``` + +2. **Set up environment variables** + ```bash + # Copy environment files for each app + cp apps/web/.env.example apps/web/.env.local + cp apps/extension/.env.example apps/extension/.env.local + cp apps/server/.env.example apps/server/.env.local + ``` + +3. **Configure your API keys** + - Get your Cortensor API key from [Cortensor Network](https://cortensor.network) + - Get Tavily API key for web search + - Set up WalletConnect project ID for Web3 features + +4. **Start development** + ```bash + pnpm dev + ``` + +## 🌐 Live Demo + +- **Website**: [cortigpt.jatique.dev](https://cortigpt.jatique.dev) +- **Original Repository**: [github.com/Ezejaemmanuel/cortigpt-monorepo](https://github.com/Ezejaemmanuel/cortigpt-monorepo) + +## 📱 Applications + +| App | Port | Description | +|-----|------|-------------| +| Web App | 3001 | Main web interface with AI chat | +| API Server | 3002 | Backend API for AI services | +| Extension | - | Browser extension (build and load) | + +## 🔑 Key Features + +- **🤖 Decentralized AI**: Powered by Cortensor network for verifiable intelligence +- **🔗 Web3 Integration**: Full blockchain wallet support +- **🧠 AI Agents**: Intelligent chat assistants with context awareness +- **🌐 Web Search**: Real-time information retrieval +- **📱 Cross-Platform**: Web app and browser extension +- **🎨 Modern UI**: Beautiful, responsive design + +## 📚 Documentation + +For detailed documentation, setup instructions, and API reference, see the main [README.md](./README.md) file. + +## 🤝 Contributing + +This project is actively maintained. For contributions: + +1. Check the [original repository](https://github.com/Ezejaemmanuel/cortigpt-monorepo) for the latest updates +2. Follow the contribution guidelines in the main README +3. Test your changes across all applications + +## 📄 License + +MIT License - see [LICENSE](./LICENSE) for details. + +## 🔗 Links + +- **Original Repository**: [Ezejaemmanuel/cortigpt-monorepo](https://github.com/Ezejaemmanuel/cortigpt-monorepo) +- **Cortensor Network**: [cortensor.network](https://cortensor.network) +- **Documentation**: [docs.cortensor.network](https://docs.cortensor.network) +- **Community Projects**: [cortensor/community-projects](https://github.com/cortensor/community-projects) + +--- + +*This project is part of the Cortensor community ecosystem, bringing decentralized AI to everyone.* diff --git a/apps/cortigpt-monorepo/PROJECTS_SAMPLE.yml b/apps/cortigpt-monorepo/PROJECTS_SAMPLE.yml new file mode 100644 index 0000000..f751b75 --- /dev/null +++ b/apps/cortigpt-monorepo/PROJECTS_SAMPLE.yml @@ -0,0 +1,32 @@ +# Sample PROJECTS.yml entry for CortiGPT Monorepo +# Add this entry to the main PROJECTS.yml file in cortensor/community-projects + +- name: cortigpt-monorepo + category: apps + owner: "@ezejaemmanuel" # Replace with your GitHub username + collaborators: ["@ezejaemmanuel"] + status: active + created: 2025-08-18 # Replace with actual date + version: v1.0.0 + tags: [monorepo, nextjs, react, ai-chat, web3, browser-extension, api-server, cortensor, full-stack] + description: "Complete CortiGPT ecosystem monorepo - decentralized AI platform with web app, browser extension, API server, and AI package. Features modern React 19, Next.js 15, Web3 integration, and comprehensive AI chat capabilities." + repository: "https://github.com/ezejaemmanuel/cortigpt-monorepo" # Replace with your repo URL + demo: "https://cortigpt.jatique.dev" # Replace with your demo URL if available + tech_stack: [nextjs, react, typescript, tailwindcss, wxt, wagmi, viem, cortensor, turborepo, pnpm] + components: + - name: "Web Application" + path: "apps/web" + description: "Modern web interface with AI chat and Web3 integration" + port: 3001 + - name: "Browser Extension" + path: "apps/extension" + port: 3000 + description: "Cross-browser extension with sidepanel AI assistant" + browsers: [chrome, firefox, edge, safari] + - name: "API Server" + path: "apps/server" + description: "RESTful API server for AI interactions" + port: 3002 + - name: "AI Package" + path: "packages/ai" + description: "Shared AI integration and agent management library" diff --git a/apps/cortigpt-monorepo/README.md b/apps/cortigpt-monorepo/README.md new file mode 100644 index 0000000..a504590 --- /dev/null +++ b/apps/cortigpt-monorepo/README.md @@ -0,0 +1,446 @@ +# Cortensor Main Monorepo 🚀 + +> **A comprehensive monorepo containing the complete Cortensor ecosystem - a decentralized AI platform that combines blockchain technology with AI-powered search and chat capabilities.** + +[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/) +[![pnpm](https://img.shields.io/badge/pnpm-10.12.3+-blue.svg)](https://pnpm.io/) +[![Next.js](https://img.shields.io/badge/Next.js-15.4.6-black.svg)](https://nextjs.org/) +[![React](https://img.shields.io/badge/React-19.1.0-blue.svg)](https://react.dev/) +[![TypeScript](https://img.shields.io/badge/TypeScript-5+-blue.svg)](https://www.typescriptlang.org/) +[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) + +## 📖 Table of Contents + +- [Overview](#-overview) +- [Architecture](#️-architecture) +- [Project Structure](#-project-structure) +- [Applications](#-applications) +- [Packages](#-packages) +- [Quick Start](#-quick-start) +- [Development](#-development) +- [Deployment](#-deployment) +- [Environment Variables](#-environment-variables) +- [Available Scripts](#️-available-scripts) +- [Technology Stack](#-technology-stack) +- [Key Features](#-key-features) +- [API Reference](#-api-reference) +- [Contributing](#-contributing) +- [Support](#-support) +- [License](#-license) + +## 🚀 Overview + +**Cortensor** is a decentralized AI platform that provides verifiable, trustless intelligence through a network of distributed miners. This monorepo contains all the components needed to build, deploy, and interact with the Cortensor network. + +### What's Included + +- **🌐 Web Application** - Full-featured AI chat interface with Web3 integration +- **🔌 Browser Extension** - Cross-browser AI assistant with sidepanel interface +- **🖥️ API Server** - Scalable backend for AI services and chat management +- **🤖 AI Package** - Shared AI integration library with Mastra framework + +## 🏗️ Architecture + +This monorepo follows modern monorepo architecture principles using: + +- **📦 Package Manager**: pnpm with workspace support for efficient dependency management +- **⚡ Build System**: Turborepo for optimized, parallel builds across applications +- **🎯 Frontend**: Next.js 15 with React 19 for modern, performant web applications +- **🎨 Styling**: Tailwind CSS with shadcn/ui for consistent, accessible design +- **🤖 AI Integration**: Cortensor OpenAI Provider for decentralized AI capabilities +- **🔗 Blockchain**: Web3 integration with Wagmi and Viem for blockchain interactions + +## 📁 Project Structure + +``` +cortigpt-monorepo/ +├── 📁 apps/ # Application packages +│ ├── 🌐 web/ # Main web application (Next.js 15) +│ │ ├── src/ +│ │ │ ├── app/ # Next.js App Router +│ │ │ ├── components/ # Reusable UI components +│ │ │ ├── hooks/ # Custom React hooks +│ │ │ ├── lib/ # Utility libraries +│ │ │ ├── providers/ # Context providers +│ │ │ └── stores/ # State management +│ │ └── public/ # Static assets +│ ├── 🔌 extension/ # Browser extension (WXT + React) +│ │ ├── entrypoints/ # Extension entry points +│ │ ├── components/ # Extension-specific components +│ │ ├── hooks/ # Extension hooks +│ │ └── public/ # Extension assets +│ └── 🖥️ server/ # API server (Next.js 15) +│ └── src/ +│ └── app/ +│ └── api/ # API routes +├── 📦 packages/ # Shared packages +│ └── 🤖 ai/ # AI integration package +│ ├── src/ +│ │ ├── mastra/ # Mastra AI framework +│ │ │ └── agents/ # AI agent definitions +│ │ └── constants.ts # Shared constants +│ └── package.json +├── 📄 pnpm-workspace.yaml # Workspace configuration +├── ⚡ turbo.json # Turborepo configuration +├── 🚂 railway.json # Railway deployment config +└── 📋 package.json # Root package configuration +``` + +## 🎯 Applications + +### 🌐 Web App (`apps/web`) + +**Port**: 3001 +**Purpose**: Main web interface for CortiGPT with full AI chat capabilities + +**Features**: +- 🤖 **AI Chat Interface**: Complete CortiGPT chat experience with Cortensor AI models +- 🔗 **Web3 Integration**: Full wallet connection with MetaMask, WalletConnect, and more +- 🎨 **Modern UI**: Beautiful, responsive design with Tailwind CSS and shadcn/ui +- 🌓 **Theme System**: Light/dark mode with system preference detection +- 📱 **Responsive Design**: Optimized for desktop, tablet, and mobile devices + +**Tech Stack**: Next.js 15, React 19, Tailwind CSS, shadcn/ui, Framer Motion + +### 🔌 Browser Extension (`apps/extension`) + +**Name**: CortiGPT +**Purpose**: Browser-side AI assistant with modern sidepanel interface + +**Features**: +- 📱 **Sidepanel Interface**: Modern browser sidepanel experience across all browsers +- 🔄 **Dual Mode**: Web2 and Web3 chat interfaces for different use cases +- 🌐 **Cross-Browser**: Full support for Chrome, Firefox, Edge, and Safari +- 🤖 **AI Assistant**: Direct CortiGPT integration with real-time responses +- 💾 **Local Storage**: Persistent settings and chat history + +**Tech Stack**: WXT Framework, React 19, Tailwind CSS, shadcn/ui + +**Browser Support**: +- **Chrome**: Manifest V3 with native sidepanel +- **Edge**: Manifest V3 with native sidepanel +- **Firefox**: Manifest V2 with panel implementation +- **Safari**: Manifest V2 with popover interface + +### 🖥️ API Server (`apps/server`) + +**Port**: 3002 +**Purpose**: Scalable backend API for AI services and chat management + +**Features**: +- 🔌 **Chat API**: `/api/chat` endpoint for AI interactions +- 👥 **Session Management**: User and chat ID handling with authentication +- 🤖 **Cortensor Integration**: Direct AI model access with web search capabilities +- 🔒 **Security**: Input validation, CORS, and rate limiting +- 📊 **Logging**: Comprehensive request and error logging + +**Tech Stack**: Next.js 15, TypeScript, AI SDK integration + +## 📦 Packages + +### 🤖 AI Package (`packages/ai`) + +**Purpose**: Shared AI integration library for all applications + +**Features**: +- 🧠 **Mastra Framework**: AI agent management and orchestration +- 🔌 **Cortensor Provider**: Direct AI model integration with custom configuration +- 🌐 **Web Search**: Tavily integration for real-time information retrieval +- 📝 **Shared Types**: Common TypeScript interfaces across applications +- 🛠️ **Utility Functions**: Reusable AI helpers and constants + +**Exports**: +- `cortiGPTAgent` - Main AI agent instance +- `CHAT_HISTORY_LIMIT` - Chat history management constant +- `mastra` - Mastra framework instance + +## 🚀 Quick Start + +### Prerequisites + +- **Node.js**: 18+ (LTS recommended) +- **pnpm**: 10.12.3+ +- **Git**: Latest version + +### Installation + +1. **Clone the repository** + ```bash + git clone + cd cortigpt-monorepo + ``` + +2. **Install dependencies** + ```bash + pnpm install + ``` + +3. **Set up environment variables** + ```bash + # Copy environment files for each app + cp apps/web/.env.example apps/web/.env.local + cp apps/extension/.env.example apps/extension/.env.local + cp apps/server/.env.example apps/server/.env.local + ``` + +4. **Configure environment variables** (see [Environment Variables](#-environment-variables)) + +5. **Start development** + ```bash + pnpm dev + ``` + +## 🛠️ Development + +### Development Commands + +```bash +# Start all applications +pnpm dev + +# Start specific applications +pnpm dev:web # Web app only (port 3001) +pnpm dev:extension # Extension only +pnpm dev:server # Server only (port 3002) + +# Build all applications +pnpm build + +# Type checking across monorepo +pnpm check-types + +# Mastra development +pnpm mastra:dev # Start Mastra development server +pnpm mastra:build # Build Mastra application +``` + +### Development URLs + +- **Web App**: http://localhost:3001 +- **API Server**: http://localhost:3002 +- **Extension**: Build and load in browser + +### Hot Reload + +All applications support hot reload for development: +- **Web App**: Next.js Fast Refresh +- **Extension**: WXT hot reload +- **Server**: Next.js API route hot reload + +## 🚀 Deployment + +### Railway.app Deployment (`apps/server`) + +The server is configured for easy deployment on Railway.app: + +```bash +# Build and deploy server +pnpm build:server +pnpm deploy:server +``` + +**Railway Configuration** (`railway.json`): +- **Build Command**: `pnpm install --filter=server && SKIP_ENV_VALIDATION=true pnpm build --filter=server` +- **Start Command**: `pnpm start --filter=server` +- **Restart Policy**: On failure with 10 max retries + +### Other Deployment Options + +- **Web App**: Deploy to Vercel, Netlify, or any Next.js-compatible platform +- **Extension**: Package and submit to browser stores +- **Server**: Deploy to Railway, Heroku, or any Node.js platform + +## 🔐 Environment Variables + +### Required Variables + +```bash +# Cortensor AI Platform +CORTENSOR_API_KEY=your_cortensor_api_key +CORTENSOR_BASE_URL=https://api.cortensor.network + +# Web Search (Tavily) +TAVILY_API_KEY=your_tavily_api_key + +# Web3 Configuration +NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id +NEXT_PUBLIC_ARBITRUM_SEPOLIA_RPC_URL=your_arbitrum_sepolia_rpc_url +``` + +### Environment File Structure + +``` +apps/ +├── web/ +│ └── .env.local # Web app environment variables +├── extension/ +│ └── .env.local # Extension environment variables +└── server/ + └── .env.local # Server environment variables +``` + +## 📋 Available Scripts + +| Script | Description | Usage | +|--------|-------------|-------| +| `pnpm dev` | Start all applications in development mode | `pnpm dev` | +| `pnpm build` | Build all applications for production | `pnpm build` | +| `pnpm start` | Start the server application | `pnpm start` | +| `pnpm check-types` | Run TypeScript type checking across all apps | `pnpm check-types` | +| `pnpm dev:web` | Start only the web application | `pnpm dev:web` | +| `pnpm dev:extension` | Start only the extension | `pnpm dev:extension` | +| `pnpm dev:server` | Start only the server | `pnpm dev:server` | +| `pnpm build:server` | Build only the server | `pnpm build:server` | +| `pnpm deploy:server` | Deploy the server | `pnpm deploy:server` | +| `pnpm mastra:dev` | Start Mastra development server | `pnpm mastra:dev` | +| `pnpm mastra:build` | Build Mastra application | `pnpm mastra:build` | + +## 🔧 Technology Stack + +### Frontend & UI +- **React 19** - Latest React with concurrent features and improved performance +- **Next.js 15** - Full-stack React framework with App Router +- **Tailwind CSS** - Utility-first CSS framework for rapid UI development +- **shadcn/ui** - Beautiful, accessible UI components built on Radix UI +- **Framer Motion** - Production-ready animation library for React + +### AI & Backend +- **Cortensor OpenAI Provider** - Decentralized AI model integration +- **Mastra** - AI agent framework for building intelligent applications +- **Vercel AI SDK** - AI development toolkit with streaming support +- **Tavily** - Web search integration for real-time information retrieval + +### Blockchain & Web3 +- **Wagmi** - React hooks for Ethereum with TypeScript support +- **Viem** - TypeScript interface for Ethereum with modern APIs +- **RainbowKit** - Beautiful wallet connection UI for Web3 + +### Development Tools +- **TypeScript** - Type-safe JavaScript for better development experience +- **Turborepo** - High-performance monorepo build system +- **ESLint** - Pluggable JavaScript linting utility +- **Prettier** - Opinionated code formatter for consistent code style + +## 🌟 Key Features + +- **🤖 Decentralized AI**: Powered by the Cortensor network for verifiable intelligence +- **🔗 Web3 Integration**: Full blockchain wallet support and integration +- **🧠 AI Agents**: Intelligent chat assistants with context awareness +- **🌐 Web Search**: Real-time information retrieval from the web +- **📱 Cross-Platform**: Web app and browser extension for all devices +- **🎨 Modern UI**: Beautiful, responsive design with accessibility features +- **🔒 Type Safety**: Full TypeScript support across all applications +- **⚡ Performance**: Optimized builds and fast development experience + +## 📚 API Reference + +### Server API Endpoints + +#### POST `/api/chat` +Main chat interaction endpoint for AI conversations. + +**Request Body**: +```typescript +{ + messages: Array<{ + role: 'user' | 'assistant' | 'system'; + content: string; + }> +} +``` + +**Query Parameters**: +- `userAddress`: User's blockchain address +- `chatId`: Unique chat session identifier + +**Response**: +```typescript +{ + id: string; + role: 'assistant'; + content: Array<{ + type: 'text'; + text: string; + }> +} +``` + +### AI Package Exports + +```typescript +// Main AI agent +import { cortiGPTAgent } from '@repo/ai/server'; + +// Constants +import { CHAT_HISTORY_LIMIT } from '@repo/ai/server'; + +// Mastra framework +import { mastra } from '@repo/ai/server'; +``` + +## 🤝 Contributing + +We welcome contributions from the community! Here's how you can help: + +### Development Setup + +1. **Fork the repository** +2. **Create a feature branch** + ```bash + git checkout -b feature/amazing-feature + ``` +3. **Make your changes** +4. **Run tests and checks** + ```bash + pnpm check-types + pnpm build + ``` +5. **Commit your changes** + ```bash + git commit -m 'Add amazing feature' + ``` +6. **Push to your branch** + ```bash + git push origin feature/amazing-feature + ``` +7. **Open a Pull Request** + +### Contribution Guidelines + +- Follow the existing code style and conventions +- Add TypeScript types for new features +- Update documentation for API changes +- Test your changes across all applications +- Ensure all builds pass before submitting + +## 🆘 Support + +### Getting Help + +- **🐛 Bug Reports**: Open an issue on GitHub with detailed information +- **💡 Feature Requests**: Use GitHub issues to suggest new features +- **📚 Documentation**: Check the documentation in each app's README +- **🔧 Technical Issues**: Review the Cortensor provider documentation + +### Community Resources + +- **GitHub Issues**: [Repository Issues](https://github.com/ezejaemmanuel/cortigpt-monorepo/issues) +- **Discussions**: [GitHub Discussions](https://github.com/ezejaemmanuel/cortigpt-monorepo/discussions) +- **Documentation**: [Cortensor Docs](https://docs.cortensor.network) + +## 📄 License + +This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. + +## 🔗 Links + +- **🌐 Website**: [Cortensor Network](https://cortigpt.jatique.dev) +- **📚 Documentation**: [Cortensor Docs](https://docs.cortensor.network) +- **🔌 Provider**: [Cortensor OpenAI Provider](https://www.npmjs.com/package/cortensor-openai-provider) +- **🐙 Repository**: [GitHub Repository](https://github.com/ezejaemmanuel/cortigpt-monorepo) + +--- + +**Built with ❤️ by [Jatique](https://github.com/ezejaemmanuel) using modern web technologies and decentralized AI principles.** + +*Empowering the future of AI with blockchain technology.* diff --git a/apps/cortigpt-monorepo/RELEASE.md b/apps/cortigpt-monorepo/RELEASE.md new file mode 100644 index 0000000..bf6df4c --- /dev/null +++ b/apps/cortigpt-monorepo/RELEASE.md @@ -0,0 +1,117 @@ +# Cortensor Main Monorepo - Release Notes + +## Version History + +### v1.0.0 - January 2025 🚀 +**Production Release - Complete CortiGPT Ecosystem** + +#### 🎉 What's New +- **Complete Monorepo**: Web app, browser extension, API server, and AI package +- **Modern Stack**: Next.js 15, React 19, TypeScript, Tailwind CSS +- **AI Integration**: Cortensor AI models with web search capabilities +- **Web3 Ready**: Wallet integration with Wagmi and RainbowKit + +#### 🌐 Web Application (`apps/web`) +- **AI Chat Interface**: CortiGPT chat with Cortensor AI models +- **Web3 Integration**: MetaMask, WalletConnect support +- **Modern UI**: Responsive design with shadcn/ui components +- **Port**: 3001 + +#### 🔌 Browser Extension (`apps/extension`) +- **Sidepanel Interface**: Modern browser sidepanel experience +- **Dual Mode**: Web2 and Web3 chat interfaces +- **Cross-Browser**: Chrome, Firefox, Edge, Safari support +- **AI Assistant**: Direct CortiGPT integration + +#### 🖥️ API Server (`apps/server`) +- **Chat API**: `/api/chat` endpoint for AI interactions +- **Session Management**: User and chat ID handling +- **Cortensor Integration**: Direct AI model access +- **Port**: 3002 + +#### 📦 AI Package (`packages/ai`) +- **Mastra Framework**: AI agent management +- **Cortensor Provider**: AI model integration +- **Web Search**: Tavily integration for real-time information + +## Quick Start + +```bash +# Install dependencies +pnpm install + +# Start all apps +pnpm dev + +# Individual development +pnpm dev:web # Web app (port 3001) +pnpm dev:extension # Extension +pnpm dev:server # Server (port 3002) +``` + +## Deployment + +### Railway.app Deployment (`apps/server`) +```bash +# Build and deploy server +pnpm build:server +pnpm deploy:server +``` + +**Railway Configuration** (`railway.json`): +- **Build Command**: `pnpm install --filter=server && SKIP_ENV_VALIDATION=true pnpm build --filter=server` +- **Start Command**: `pnpm start --filter=server` +- **Restart Policy**: On failure with 10 max retries + +### Environment Variables +```bash +# Server (.env.local) +CORTENSOR_API_KEY=your_api_key +TAVILY_API_KEY=your_tavily_key + +# Web App (.env.local) +CORTENSOR_API_KEY=your_api_key +NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id + +# Extension (.env.local) +VITE_CORTENSOR_API_KEY=your_api_key +VITE_WALLETCONNECT_PROJECT_ID=your_project_id +``` + +## Build Commands + +```bash +# Build all applications +pnpm build + +# Build specific apps +pnpm build:server +pnpm build:web +pnpm build:extension + +# Extension packaging +cd apps/extension +pnpm zip +``` + +## Dependencies + +- **Core**: Next.js 15, React 19, TypeScript 5 +- **AI**: Cortensor OpenAI Provider, Mastra Framework +- **Web3**: Wagmi, Viem, RainbowKit +- **UI**: Tailwind CSS, shadcn/ui, Framer Motion +- **Build**: pnpm, Turborepo + +## Browser Support + +- **Chrome**: Manifest V3 with sidepanel +- **Edge**: Manifest V3 with native sidepanel +- **Firefox**: Manifest V2 with panel implementation +- **Safari**: Manifest V2 with popover interface + +--- + +**Next Release**: v1.1.0 (February 2025) +- Extension store launches +- Enhanced AI capabilities +- Performance optimizations diff --git a/apps/cortigpt-monorepo/STATUS.md b/apps/cortigpt-monorepo/STATUS.md new file mode 100644 index 0000000..fca2619 --- /dev/null +++ b/apps/cortigpt-monorepo/STATUS.md @@ -0,0 +1,84 @@ +# Cortensor Main Monorepo - Status + +## Project Status: Active ✅ + +### Current Version: v1.0.0 + +### Development Status +- **Phase**: Production Ready +- **Stability**: Stable +- **Maintenance**: Actively maintained +- **Last Updated**: January 2025 + +## 🏗️ Monorepo Overview + +A comprehensive monorepo containing the complete CortiGPT ecosystem - a decentralized AI platform with blockchain technology and AI-powered search and chat capabilities. + +### Components + +#### 🌐 Web Application (`apps/web`) +- **Status**: ✅ Production Ready +- **Port**: 3001 +- **Purpose**: Main web interface for CortiGPT +- **Tech**: Next.js 15, React 19, Tailwind CSS, Web3 + +#### 🔌 Browser Extension (`apps/extension`) +- **Status**: ✅ Production Ready +- **Purpose**: Browser AI assistant with sidepanel +- **Tech**: WXT, React 19, Web3, Tailwind CSS +- **Browsers**: Chrome, Firefox, Edge, Safari + +#### 🖥️ API Server (`apps/server`) +- **Status**: ✅ Production Ready +- **Port**: 3002 +- **Purpose**: Backend API for AI services +- **Tech**: Next.js 15, Cortensor integration + +#### 📦 AI Package (`packages/ai`) +- **Status**: ✅ Stable +- **Purpose**: AI integration and agent management +- **Features**: Mastra framework, Cortensor provider + +### Features + +#### ✅ Completed +- Complete monorepo setup with pnpm workspace and Turborepo +- AI chat interface with full Cortensor AI integration +- Web3 integration with wallet support (Wagmi, RainbowKit) +- Modern UI with Tailwind CSS and shadcn/ui +- Cross-platform support (web, extension, API) +- Theme management (light/dark mode) +- Full TypeScript coverage + +#### 🚧 In Progress +- Extension store submissions +- Enhanced search capabilities +- Performance optimizations + +### Known Issues + +- Some Cortensor AI agents are not good at tool calling, making it hard to work with tools +- Chrome extension has limitations in getting text available in the current tab + +### Roadmap + +#### Short Term +- Better tool calling support for AI agents +- Enhanced browser text extraction capabilities + +#### Medium Term +- Perplexity-like features for web search and analysis +- Browser automation capabilities (performing actions in the browser) +- Advanced content extraction and interaction + +#### Long Term +- Full browser automation suite +- Advanced AI agent capabilities +- Enterprise features + +--- + +**Monorepo Maintainer**: Jatique +**Last Updated**: August 2025 + +This monorepo represents a complete, production-ready ecosystem for decentralized AI applications, demonstrating best practices for modern web development with AI and Web3 integration. diff --git a/apps/cortigpt-monorepo/apps/extension/.gitignore b/apps/cortigpt-monorepo/apps/extension/.gitignore new file mode 100644 index 0000000..a256953 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/.gitignore @@ -0,0 +1,26 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.output +stats.html +stats-*.json +.wxt +web-ext.config.ts + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/cortigpt-monorepo/apps/extension/.npmrc b/apps/cortigpt-monorepo/apps/extension/.npmrc new file mode 100644 index 0000000..0b5edde --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/.npmrc @@ -0,0 +1,2 @@ +# Disable pnpm-lock.yaml generation +lockfile=false diff --git a/apps/cortigpt-monorepo/apps/extension/LICENSE b/apps/cortigpt-monorepo/apps/extension/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/apps/cortigpt-monorepo/apps/extension/README.md b/apps/cortigpt-monorepo/apps/extension/README.md new file mode 100644 index 0000000..446ad76 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/README.md @@ -0,0 +1,210 @@ +# CortiGPT Browser Extension + +A modern browser extension that brings CortiGPT - the decentralized AI assistant - directly to your browser with sidepanel support, built with WXT + Tailwind CSS + shadcn/ui. + +## Features + +- 🖥️ **Sidepanel Interface** - Click extension icon to open browser sidepanel +- 🤖 **CortiGPT AI Integration** - Direct access to decentralized AI models +- 🔌 **Web3 Wallet Support** - Connect your blockchain wallet +- 🌐 **Web Search Integration** - Real-time information retrieval +- ⚡ **WXT Framework** - Next-generation Web Extension development framework +- ⚛️ **React** - Modern UI framework with TypeScript support +- 🎨 **Tailwind CSS** - Utility-first CSS framework with custom styling +- 🛠️ **shadcn/ui Ready** - Pre-configured for beautiful, accessible React components +- 🌙 **Theme Management** - System/Light/Dark theme support +- 💾 **Local Storage** - Persistent data storage with WXT Storage API +- ⚙️ **Runtime Configuration** - Built-in runtime config system with type safety +- 🔧 **TypeScript** - Full type safety and developer experience +- 🎯 **Modern Development** - Hot reload, modern build tools + +## Overview + +CortiGPT Browser Extension provides instant access to decentralized AI assistance directly in your browser. With a beautiful sidepanel interface, you can: + +- Chat with CortiGPT AI models +- Connect your Web3 wallet +- Search the web for real-time information +- Access AI agents and tools +- Enjoy a seamless, modern user experience + +*Click the extension icon to open the sidepanel interface and start chatting with AI.* + +## Getting Started + +### Prerequisites + +- Node.js 18+ +- pnpm (recommended) or npm + +### Installation + +1. **Clone or use this template** + ```bash + git clone + cd cortigpt-monorepo/apps/extension + ``` + +2. **Install dependencies** + ```bash + pnpm install + ``` + +3. **Start development** + ```bash + pnpm dev + ``` + +4. **Load extension in browser** + - Open `chrome://extensions/` + - Enable "Developer mode" + - Click "Load unpacked extension" + - Select the `.output/chrome-mv3` folder + +### Usage + +1. Click the extension icon in the browser toolbar +2. The sidepanel will open on the right side +3. Start customizing the template for your needs + +## Project Structure + +``` +apps/extension/ +├── entrypoints/ # Extension entry points +│ ├── background.ts # Background script +│ ├── content.ts # Content script (optional) +│ └── sidepanel/ # Sidepanel UI +│ ├── App.tsx # Main React app +│ ├── index.html # HTML template +│ └── main.tsx # React entry point +├── components/ # React components +│ ├── ui/ # shadcn/ui components +│ ├── layout/ # Layout components +│ └── sections/ # Page sections +├── lib/ # Utility functions +│ ├── utils.ts # Common utilities +│ ├── wagmiConfig.ts # Web3 configuration +│ └── api-config.ts # API configuration +├── hooks/ # Custom React hooks +│ ├── use-theme.ts # Theme management hook +│ ├── use-settings.ts # Settings storage hook +│ ├── use-web3.ts # Web3 integration hook +│ └── use-splash-screen.ts # Splash screen hook +├── providers/ # React context providers +│ ├── web3-provider.tsx # Web3 context provider +│ └── react-query-provider.tsx # React Query provider +├── stores/ # State management +│ ├── chat-store.ts # Chat state store +│ └── useWeb2ChatStore.ts # Web2 chat store +├── assets/ # Static assets +├── public/ # Public assets (icons, etc.) +├── app.config.ts # Runtime configuration +├── components.json # shadcn/ui configuration +├── wxt.config.ts # WXT configuration +└── package.json # Dependencies and scripts +``` + +## Adding shadcn/ui Components + +This template is pre-configured for shadcn/ui. To add components: + +```bash +# Example: Add a button component +pnpm dlx shadcn@latest add button + +# Example: Add a dialog component +pnpm dlx shadcn@latest add dialog +``` + +The components will be automatically added to `components/ui/` with proper styling. + +## Development Commands + +```bash +# Development mode with hot reload (Chrome by default) +pnpm dev + +# Development for specific browsers +pnpm dev:chrome +pnpm dev:firefox +pnpm dev:edge +pnpm dev:safari + +# Build for production (Chrome by default) +pnpm build + +# Build for specific browsers +pnpm build:chrome +pnpm build:firefox +pnpm build:edge +pnpm build:safari + +# Create extension zip files +pnpm zip +pnpm zip:chrome +pnpm zip:firefox +pnpm zip:edge +pnpm zip:safari + +# Type checking +pnpm compile +``` + +## Customization + +### Styling + +- Edit `assets/tailwind.css` for global styles +- Modify theme colors in `components.json` +- Tailwind CSS 4.0 configuration in `wxt.config.ts` + +### Extension Configuration + +- Update manifest permissions in `wxt.config.ts` +- Modify extension metadata in `package.json` +- Change icons in `public/icon/` + +### Sidepanel Content + +- Edit `entrypoints/sidepanel/App.tsx` for main UI +- Add new routes/pages as needed +- Extend with additional React components + +## Browser Support + +This extension supports all major browsers through WXT's universal browser compatibility: + +- ✅ **Chrome** (Manifest V3) - `pnpm dev:chrome`, `pnpm build:chrome` +- ✅ **Firefox** (Manifest V2) - `pnpm dev:firefox`, `pnpm build:firefox` +- ✅ **Edge** (Manifest V3) - `pnpm dev:edge`, `pnpm build:edge` +- ✅ **Safari** (Manifest V2) - `pnpm dev:safari`, `pnpm build:safari` +- ✅ **Other Chromium-based browsers** (Opera, Brave, etc.) + +## License + +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. + +## 🤝 Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Submit a pull request + +## 🔗 Related Projects + +- [CortiGPT Web App](../../web/README.md) - Main web interface +- [Cortensor API Server](../../server/README.md) - Backend services +- [AI Package](../../../packages/ai/README.md) - AI integration library +- [Cortensor Provider Documentation](../../../readmeaboutCortensorOpenaiProvider.md) - AI provider details + +--- + +Built with ❤️ using [WXT](https://wxt.dev), [Tailwind CSS](https://tailwindcss.com), and [shadcn/ui](https://ui.shadcn.com) for the Cortensor AI platform. + + + +--- + +Built with ❤️ using [WXT](https://wxt.dev), [Tailwind CSS](https://tailwindcss.com), and [shadcn/ui](https://ui.shadcn.com) diff --git a/apps/cortigpt-monorepo/apps/extension/abis/SessionQueueV2.json b/apps/cortigpt-monorepo/apps/extension/abis/SessionQueueV2.json new file mode 100644 index 0000000..a589daa --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/abis/SessionQueueV2.json @@ -0,0 +1,1950 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "TaskAcked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "miners", + "type": "address[]" + } + ], + "name": "TaskAllCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "miners", + "type": "address[]" + } + ], + "name": "TaskAllPrecommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "miners", + "type": "address[]" + } + ], + "name": "TaskAssigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "TaskCommitEnded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "TaskCommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "miners", + "type": "address[]" + } + ], + "name": "TaskEnded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "TaskPrecommitEnded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "TaskPrecommitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "globalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "taskData", + "type": "string" + } + ], + "name": "TaskQueued", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "ack", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "addrs", + "type": "address[]" + } + ], + "name": "assignTask", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "commit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "forceEnd", + "type": "bool" + } + ], + "name": "end", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "forceEnd", + "type": "bool" + } + ], + "name": "end2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "endAck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "emitAllCommitted", + "type": "bool" + } + ], + "name": "endCommit", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "emitAllPrecommitted", + "type": "bool" + } + ], + "name": "endPrecommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "taskData", + "type": "string" + }, + { + "internalType": "uint256", + "name": "promptType", + "type": "uint256" + }, + { + "internalType": "string", + "name": "promptTemplate", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "llmParams", + "type": "uint256[]" + } + ], + "name": "enqueueTask", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getACLAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getAllTaskResultAckedTimestamps", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getAllTaskResultCommitTimestamps", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getAllTaskResultPrecommitTimestamps", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getAllTaskResults", + "outputs": [ + { + "internalType": "address[][]", + "name": "", + "type": "address[][]" + }, + { + "internalType": "string[][]", + "name": "", + "type": "string[][]" + }, + { + "internalType": "bytes32[][]", + "name": "", + "type": "bytes32[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "getHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getIAMAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getLatestTask", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getNodeId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getNodePoolAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNodeReputationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNodeStatsAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionQueueValidationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionReputationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionStatsAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getTaskCountBySessionId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "sessionIds", + "type": "uint256[]" + } + ], + "name": "getTaskCountBySessionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskData", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecoration", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "promptType", + "type": "uint256" + }, + { + "internalType": "string", + "name": "promptTemplate", + "type": "string" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "temperature", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "topP", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "topK", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "presencePenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "frequencyPenalty", + "type": "uint256" + } + ], + "internalType": "struct SessionQueueV2.TaskDecoration", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationFrequencyPenalty", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationMaxTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationPresencePenalty", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationPromptTemplate", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationPromptType", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationTemperature", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationTopK", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskDecorationTopP", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "getTaskResultCommitTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "getTaskResultData", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskResultHashes", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "miner", + "type": "address" + } + ], + "name": "getTaskResultPrecommitTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getTaskResultState", + "outputs": [ + { + "internalType": "enum SessionQueueV2.TaskState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskResults", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskStatus", + "outputs": [ + { + "internalType": "enum SessionQueueV2.TaskStatus", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getTasksBySessionId", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + }, + { + "internalType": "address[]", + "name": "assignedMiners", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "ended", + "type": "bool" + }, + { + "internalType": "enum SessionQueueV2.TaskStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPrecommitAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastCommitAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "finishedAt", + "type": "uint256" + } + ], + "internalType": "struct SessionQueueV2.Task[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUseSessionStats", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "isAcked", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isOracleNode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isPrimaryModule", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "pop", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "popSpecificTask", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "name": "precommit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessionTaskCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessionTaskDecorations", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "promptType", + "type": "uint256" + }, + { + "internalType": "string", + "name": "promptTemplate", + "type": "string" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "temperature", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "topP", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "topK", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "presencePenalty", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "frequencyPenalty", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessionTaskResults", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "precommitCounter", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "commitCounter", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessionTasks", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + }, + { + "internalType": "bool", + "name": "ended", + "type": "bool" + }, + { + "internalType": "enum SessionQueueV2.TaskStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPrecommitAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastCommitAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "finishedAt", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_aclContract", + "type": "address" + } + ], + "name": "setACL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_iamContract", + "type": "address" + } + ], + "name": "setIAM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nodePoolContract", + "type": "address" + } + ], + "name": "setNodePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nodeReputationContract", + "type": "address" + } + ], + "name": "setNodeReputation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nodeStatsContract", + "type": "address" + } + ], + "name": "setNodeStats", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionQueueValidationContract", + "type": "address" + } + ], + "name": "setSessionQueueValidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionReputationContract", + "type": "address" + } + ], + "name": "setSessionReputation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionStatsContract", + "type": "address" + } + ], + "name": "setSessionStats", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_useSessionStats", + "type": "bool" + } + ], + "name": "setUseSessionStats", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "subversion", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "useSessionStats", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "expectedHash", + "type": "bytes32" + } + ], + "name": "verifyHash", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/abis/SessionV2.json b/apps/cortigpt-monorepo/apps/extension/abis/SessionV2.json new file mode 100644 index 0000000..6ee3671 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/abis/SessionV2.json @@ -0,0 +1,2257 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "AllRoutersRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "DedicatedNodeAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "DedicatedNodeRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "nodeAddresses", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newNodeCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assignmentType", + "type": "uint256" + } + ], + "name": "NewNodeAssignedToSession", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "nodeId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "NodeReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "routerAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "routerInfo", + "type": "string" + } + ], + "name": "RouterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "routerAddress", + "type": "address" + } + ], + "name": "RouterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "routerAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "routerInfo", + "type": "string" + } + ], + "name": "RouterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "miners", + "type": "address[]" + } + ], + "name": "SessionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "deactivator", + "type": "address" + } + ], + "name": "SessionDeactivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "updater", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + } + ], + "name": "SessionUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "nodeIds", + "type": "bytes32[]" + } + ], + "name": "TaskAssigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "taskData", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "clientReference", + "type": "string" + } + ], + "name": "TaskSubmitted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "addDedicatedNode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "routerAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + } + ], + "name": "addRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allNodeAddresses", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "address", + "name": "variableAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "reserveEphemeralNodes", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "name": "create", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "deactivateSession", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "doesSessionExist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getACLAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getActiveSessionsByAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "enum SessionV2.SessionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "ephemeralNodes", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "dedicatedNodes", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "routerMetadatas", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "routerAddresses", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "internalType": "struct SessionV2.Session[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getIAMAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getLatestRouterAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getLatestRouterIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getLatestRouterInfo", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getLatestSessionId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getLatestTaskRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestDate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "completed", + "type": "bool" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "internalType": "struct SessionV2.TaskRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "getNodeAssignedTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getNodeId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getNodePoolAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "getNodeSessionId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRouterAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getRouterCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "routerAddress", + "type": "address" + } + ], + "name": "getRouterIndex", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "routerAddress", + "type": "address" + } + ], + "name": "getRouterInfo", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getRouterMetadatasByAddress", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "sessionIds", + "type": "uint256[]" + } + ], + "name": "getRouterMetadatasBySessionIds", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "getSession", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "enum SessionV2.SessionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "ephemeralNodes", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "dedicatedNodes", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "routerMetadatas", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "routerAddresses", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "internalType": "struct SessionV2.Session", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionAuthAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getSessionCountByAddress", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getSessionIdAndNameAndMetadataByAddress", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "string[]", + "name": "", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "", + "type": "string[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getSessionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionPaymentAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionQueueAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSessionStatsAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getSessionsByAddress", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "enum SessionV2.SessionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "ephemeralNodes", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "dedicatedNodes", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "routerMetadatas", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "routerAddresses", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "internalType": "struct SessionV2.Session[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "getSessionsByAddressByPage", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "enum SessionV2.SessionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "ephemeralNodes", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "dedicatedNodes", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "routerMetadatas", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "routerAddresses", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "internalType": "struct SessionV2.Session[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "userAddr", + "type": "address" + } + ], + "name": "getSessionsIdsByAddress", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskRequset", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestDate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "completed", + "type": "bool" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "internalType": "struct SessionV2.TaskRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "taskId", + "type": "uint256" + } + ], + "name": "getTaskResults", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getUserSessions", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "isNodeAssignedToAnySession", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isNodeInSessions", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isOracleNode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nodeIdToAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nodeToSessionId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "nodeId", + "type": "bytes32" + } + ], + "name": "releaseByNodeId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nodeAddress", + "type": "address" + } + ], + "name": "removeDedicatedNode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "routerAddress", + "type": "address" + } + ], + "name": "removeRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + } + ], + "name": "resetAllRouters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessionTaskRequestCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "sessions", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "sid", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "enum SessionV2.SessionState", + "name": "state", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAt", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sla", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "modelIdentifier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reservePeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTaskExecutionCount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_aclContract", + "type": "address" + } + ], + "name": "setACL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_iamContract", + "type": "address" + } + ], + "name": "setIAM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nodePool", + "type": "address" + } + ], + "name": "setNodePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionAuth", + "type": "address" + } + ], + "name": "setSessionAuth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionPayment", + "type": "address" + } + ], + "name": "setSessionPayment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionQueueContrat", + "type": "address" + } + ], + "name": "setSessionQueue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sessionStats", + "type": "address" + } + ], + "name": "setSessionStats", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "taskData", + "type": "string" + } + ], + "name": "storeTaskRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requestDate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "completed", + "type": "bool" + }, + { + "internalType": "string", + "name": "data", + "type": "string" + } + ], + "internalType": "struct SessionV2.TaskRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nodeType", + "type": "uint256" + }, + { + "internalType": "string", + "name": "taskData", + "type": "string" + }, + { + "internalType": "uint256", + "name": "promptType", + "type": "uint256" + }, + { + "internalType": "string", + "name": "promptTemplate", + "type": "string" + }, + { + "internalType": "uint256[]", + "name": "llmParams", + "type": "uint256[]" + }, + { + "internalType": "string", + "name": "clientReference", + "type": "string" + } + ], + "name": "submit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "taskCountPerNode", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "metadata", + "type": "string" + }, + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxNumOfNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redundant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "numOfValidatorNodes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mode", + "type": "uint256" + } + ], + "name": "update", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "updateOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sessionId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "routerAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "newRouterInfo", + "type": "string" + } + ], + "name": "updateRouter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "userSessions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/app.config.ts b/apps/cortigpt-monorepo/apps/extension/app.config.ts new file mode 100644 index 0000000..ea3c23a --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/app.config.ts @@ -0,0 +1,18 @@ +import { defineAppConfig } from '#imports'; + +// Define types for your config +declare module 'wxt/utils/define-app-config' { + export interface WxtAppConfig { + features?: { + enableChat?: boolean; + maxTokens?: number; + }; + } +} + +export default defineAppConfig({ + features: { + enableChat: import.meta.env.WXT_ENABLE_CHAT === 'true' || true, + maxTokens: parseInt(import.meta.env.WXT_MAX_TOKENS || '1000'), + }, +}); diff --git a/apps/cortigpt-monorepo/apps/extension/assets/react.svg b/apps/cortigpt-monorepo/apps/extension/assets/react.svg new file mode 100644 index 0000000..8e0e0f1 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/assets/react.svg @@ -0,0 +1 @@ + diff --git a/apps/cortigpt-monorepo/apps/extension/assets/tailwind.css b/apps/cortigpt-monorepo/apps/extension/assets/tailwind.css new file mode 100644 index 0000000..9f8b5af --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/assets/tailwind.css @@ -0,0 +1,413 @@ +@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap'); + +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* CortiGPT Dark Futuristic Design System +All colors MUST be HSL for Web3 premium aesthetic. +*/ + +@layer base { + :root { + /* Pure Space Dark Colors */ + --background: 0 0% 0%; + --foreground: 0 0% 98%; + + /* Glass Card Colors */ + --card: 0 0% 2%; + --card-foreground: 0 0% 96%; + --card-glow: 0 0% 4%; + + /* Interactive Elements */ + --popover: 0 0% 2%; + --popover-foreground: 0 0% 96%; + + /* Neon Green Primary */ + --primary: 120 100% 50%; + --primary-foreground: 0 0% 0%; + --primary-glow: 120 100% 70%; + + /* Electric Blue Secondary */ + --secondary: 195 100% 50%; + --secondary-foreground: 0 0% 0%; + --secondary-glow: 195 100% 70%; + + /* Neon Cyan Accent */ + --accent: 180 100% 50%; + --accent-foreground: 0 0% 0%; + --accent-glow: 180 100% 70%; + + /* Muted Elements */ + --muted: 0 0% 8%; + --muted-foreground: 0 0% 64%; + + /* Destructive */ + --destructive: 0 100% 50%; + --destructive-foreground: 0 0% 98%; + + /* Borders and Inputs */ + --border: 0 0% 10%; + --input: 0 0% 8%; + --ring: 195 100% 50%; + + /* Neural Network Colors */ + --neural-primary: 120 100% 50%; + --neural-secondary: 195 100% 50%; + --neural-tertiary: 180 100% 50%; + + /* Space Neon Gradients */ + --gradient-primary: linear-gradient(135deg, hsl(120 100% 50%) 0%, hsl(195 100% 50%) 100%); + --gradient-secondary: linear-gradient(135deg, hsl(195 100% 50%) 0%, hsl(180 100% 50%) 100%); + --gradient-neural: linear-gradient(135deg, hsl(120 100% 20%) 0%, hsl(195 100% 20%) 50%, hsl(180 100% 20%) 100%); + + /* Neon Glows */ + --glow-primary: 0 0 30px hsl(120 100% 50% / 0.6); + --glow-secondary: 0 0 30px hsl(195 100% 50% / 0.6); + --glow-accent: 0 0 30px hsl(180 100% 50% / 0.6); + --shadow-glass: 0 8px 32px hsl(0 0% 0% / 0.8); + + /* Animation Timings */ + --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1); + --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1); + --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1); + + --radius: 0.75rem; + + --sidebar-background: 0 0% 98%; + + --sidebar-foreground: 240 5.3% 26.1%; + + --sidebar-primary: 240 5.9% 10%; + + --sidebar-primary-foreground: 0 0% 98%; + + --sidebar-accent: 240 4.8% 95.9%; + + --sidebar-accent-foreground: 240 5.9% 10%; + + --sidebar-border: 220 13% 91%; + + --sidebar-ring: 217.2 91.2% 59.8%; + } + + /* Dark mode is the only mode for CortiGPT */ +} + +@layer base { + * { + @apply border-border; + } + + body { + @apply bg-background text-foreground font-sans; + overflow-x: hidden; + } + + /* Glassmorphism Base */ + .glass { + background: rgba(255, 255, 255, 0.05); + -webkit-backdrop-filter: blur(10px); /* Safari support */ + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.1); + } + .glow-primary { + box-shadow: var(--glow-primary); + } + + .glow-secondary { + box-shadow: var(--glow-secondary); + } + + .glow-accent { + box-shadow: var(--glow-accent); + } + + /* Clean Modern Background */ + .neural-bg { + background: linear-gradient(135deg, hsl(0 0% 0%) 0%, hsl(0 0% 2%) 100%); + } + + /* Subtle Animated Grid */ + .grid-bg { + position: relative; + background: linear-gradient(135deg, hsl(0 0% 0%) 0%, hsl(0 0% 2%) 100%); + } + + .grid-bg::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-image: + linear-gradient(rgba(0, 255, 127, 0.08) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 255, 127, 0.08) 1px, transparent 1px); + background-size: 40px 40px; + animation: grid-shift 6s ease-in-out infinite; + pointer-events: none; + z-index: 1; + } + + @keyframes grid-shift { + + 0%, + 100% { + background-image: + linear-gradient(rgba(0, 255, 127, 0.08) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 255, 127, 0.08) 1px, transparent 1px); + opacity: 1; + } + + 25% { + background-image: + linear-gradient(rgba(0, 191, 255, 0.07) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 191, 255, 0.07) 1px, transparent 1px); + opacity: 0.8; + } + + 50% { + background-image: + linear-gradient(rgba(0, 255, 255, 0.06) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 255, 255, 0.06) 1px, transparent 1px); + opacity: 0.9; + } + + 75% { + background-image: + linear-gradient(rgba(127, 0, 255, 0.07) 1px, transparent 1px), + linear-gradient(90deg, rgba(127, 0, 255, 0.07) 1px, transparent 1px); + opacity: 0.8; + } + } + + @keyframes flow { + 0% { + transform: translateX(-100px); + opacity: 0; + } + + 50% { + opacity: 1; + } + + 100% { + transform: translateX(calc(100vw + 100px)); + opacity: 0; + } + } + + .animate-flow { + animation: flow 3s ease-in-out infinite; + } + + .animate-float { + animation: float 6s ease-in-out infinite; + } + + /* Animated Gradient Text */ + .gradient-text { + background: var(--gradient-primary); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + animation: gradient-shift 3s ease-in-out infinite; + } + + @keyframes gradient-shift { + + 0%, + 100% { + background: var(--gradient-primary); + -webkit-background-clip: text; + background-clip: text; + } + + 50% { + background: var(--gradient-secondary); + -webkit-background-clip: text; + background-clip: text; + } + } + + /* Particle Animation */ + .particles { + position: absolute; + width: 100%; + height: 100%; + overflow: hidden; + pointer-events: none; + } + + .particle { + position: absolute; + width: 2px; + height: 2px; + background: hsl(120 100% 50%); + border-radius: 50%; + animation: float 6s ease-in-out infinite; + box-shadow: 0 0 10px hsl(120 100% 50% / 0.8); + } + + + + @keyframes float { + + 0%, + 100% { + transform: translateY(0px) translateX(0px); + opacity: 0; + } + + 10% { + opacity: 1; + } + + 90% { + opacity: 1; + } + + 100% { + transform: translateY(-100vh) translateX(50px); + opacity: 0; + } + } +} + +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} + +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} + +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + + /* Animation utilities */ + .animate-in { + animation: fadeIn 0.5s ease-out; + } + + .fade-in-50 { + animation: fadeIn 0.5s ease-out; + } + + @keyframes fadeIn { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + /* Extension-specific optimizations for small screens */ + * { + @apply text-sm; + } + + body { + @apply font-tech text-xs leading-tight; + font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; + } + + h1, h2, h3, h4, h5, h6 { + font-family: 'Orbitron', 'Inter', system-ui, sans-serif; + @apply font-semibold leading-tight; + } + + h1 { @apply text-lg; } + h2 { @apply text-base; } + h3 { @apply text-sm; } + h4 { @apply text-xs; } + h5 { @apply text-xs; } + h6 { @apply text-xs; } + + /* Responsive text scaling for extension sidebar */ + @media (max-width: 400px) { + * { @apply text-xs; } + h1 { @apply text-base; } + h2 { @apply text-sm; } + h3 { @apply text-xs; } + } + + @media (min-width: 401px) and (max-width: 600px) { + * { @apply text-sm; } + h1 { @apply text-lg; } + h2 { @apply text-base; } + } + + @media (min-width: 601px) { + * { @apply text-base; } + h1 { @apply text-xl; } + h2 { @apply text-lg; } + } + + /* Splash screen specific responsive adjustments */ + @media (max-height: 600px) { + .min-h-screen { + min-height: 100vh; + } + + .mb-12 { + margin-bottom: 2rem; + } + + .mb-6 { + margin-bottom: 1rem; + } + } + + @media (max-width: 400px) { + .text-3xl { + font-size: 1.5rem; + } + + .text-lg { + font-size: 0.875rem; + } + + .p-6 { + padding: 1rem; + } + } + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/components.json b/apps/cortigpt-monorepo/apps/extension/components.json new file mode 100644 index 0000000..174c9e5 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "assets/tailwind.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components/ui", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/components/MarkdownRenderer.tsx b/apps/cortigpt-monorepo/apps/extension/components/MarkdownRenderer.tsx new file mode 100644 index 0000000..a408803 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/MarkdownRenderer.tsx @@ -0,0 +1,251 @@ +'use client' + +import { useState } from 'react' +import ReactMarkdown from 'react-markdown' +import remarkGfm from 'remark-gfm' +import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' +import { oneDark, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism' +import { cn } from '@/lib/utils' +import { CheckIcon, CopyIcon, ExternalLink } from 'lucide-react' +import { Button } from '@/components/ui/button' + +interface MarkdownRendererProps { + content: string + className?: string +} + +interface CodeBlockProps { + children: React.ReactNode + className?: string + inline?: boolean +} + +const CodeBlock: React.FC = ({ children, className, inline }) => { + const [copied, setCopied] = useState(false) + const language = className?.replace('language-', '') || 'text' + const codeString = String(children).replace(/\n$/, '') + + const handleCopy = async () => { + await navigator.clipboard.writeText(codeString) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + } + + if (inline) { + return ( + + {children} + + ) + } + + return ( +
+
+ + {language} + + +
+
+ + {codeString} + +
+
+ ) +} + +export const MarkdownRenderer: React.FC = ({ + content, + className +}) => { + const [copiedCode, setCopiedCode] = useState(null); + const [isDarkMode, setIsDarkMode] = useState(true); + + const copyToClipboard = async (text: string) => { + try { + await navigator.clipboard.writeText(text); + setCopiedCode(text); + setTimeout(() => setCopiedCode(null), 2000); + } catch (err) { + console.error('Failed to copy text: ', err); + } + }; + + return ( +
+ ( +

+ {children} +

+ ), + h2: ({ children }) => ( +

+ {children} +

+ ), + h3: ({ children }) => ( +

+ {children} +

+ ), + h4: ({ children }) => ( +

+ {children} +

+ ), + + // Enhanced Paragraphs with better spacing and responsive text + p: ({ children }) => ( +

+ {children} +

+ ), + + // Enhanced Lists with better styling and responsive spacing + ul: ({ children }) => ( +
    + {children} +
+ ), + ol: ({ children }) => ( +
    + {children} +
+ ), + li: ({ children }) => ( +
  • + {children} +
  • + ), + + // Code blocks and inline code + code: ({ children, className, ...props }) => { + const inline = !className + return ( + + {children} + + ) + }, + + // Enhanced Links with better styling + a: ({ children, href }) => ( + + {children} + + + ), + + // Enhanced Blockquotes with responsive spacing + blockquote: ({ children }) => ( +
    +
    + {children} +
    +
    + ), + + // Enhanced Tables with better mobile handling + table: ({ children }) => ( +
    + + {children} +
    +
    + ), + thead: ({ children }) => ( + {children} + ), + th: ({ children }) => ( + + {children} + + ), + td: ({ children }) => ( + + {children} + + ), + + // Enhanced Horizontal rule with responsive spacing + hr: () => ( +
    + ), + + // Enhanced Strong and emphasis + strong: ({ children }) => ( + + {children} + + ), + em: ({ children }) => ( + + {children} + + ), + + // Enhanced task lists + input: ({ type, checked, ...props }) => { + if (type === 'checkbox') { + return ( + + ) + } + return + }, + }} + > + {content} +
    +
    + ) +} + +export default MarkdownRenderer \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/components/connect-wallet-button.tsx b/apps/cortigpt-monorepo/apps/extension/components/connect-wallet-button.tsx new file mode 100644 index 0000000..9dc4539 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/connect-wallet-button.tsx @@ -0,0 +1,130 @@ +"use client"; +import { Button } from "@/components/ui/button"; +import { ConnectButton } from '@rainbow-me/rainbowkit'; + +interface ConnectWalletButtonProps { + onModalOpen?: () => void; + className?: string; + isMobile?: boolean; +} + +export const ConnectWalletButton = ({ onModalOpen, className = "", isMobile = false }: ConnectWalletButtonProps) => { + return ( +
    + + {({ + account, + chain, + openAccountModal, + openChainModal, + openConnectModal, + authenticationStatus, + mounted, + }) => { + const ready = mounted && authenticationStatus !== 'loading'; + const connected = + ready && + account && + chain && + (!authenticationStatus || + authenticationStatus === 'authenticated'); + + return ( +
    + {(() => { + if (!connected) { + return ( + + ); + } + + if (chain.unsupported) { + return ( + + ); + } + + return ( +
    + + + +
    + ); + })()} +
    + ); + }} +
    +
    + ); +}; \ No newline at end of file diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/accordion.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/accordion.tsx new file mode 100644 index 0000000..e6a723d --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/accordion.tsx @@ -0,0 +1,56 @@ +import * as React from "react" +import * as AccordionPrimitive from "@radix-ui/react-accordion" +import { ChevronDown } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Accordion = AccordionPrimitive.Root + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AccordionItem.displayName = "AccordionItem" + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + svg]:rotate-180", + className + )} + {...props} + > + {children} + + + +)) +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
    {children}
    +
    +)) + +AccordionContent.displayName = AccordionPrimitive.Content.displayName + +export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/alert-dialog.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/alert-dialog.tsx new file mode 100644 index 0000000..8722561 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/alert-dialog.tsx @@ -0,0 +1,139 @@ +import * as React from "react" +import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" + +import { cn } from "@/lib/utils" +import { buttonVariants } from "@/components/ui/button" + +const AlertDialog = AlertDialogPrimitive.Root + +const AlertDialogTrigger = AlertDialogPrimitive.Trigger + +const AlertDialogPortal = AlertDialogPrimitive.Portal + +const AlertDialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName + +const AlertDialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + +)) +AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName + +const AlertDialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
    +) +AlertDialogHeader.displayName = "AlertDialogHeader" + +const AlertDialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
    +) +AlertDialogFooter.displayName = "AlertDialogFooter" + +const AlertDialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName + +const AlertDialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogDescription.displayName = + AlertDialogPrimitive.Description.displayName + +const AlertDialogAction = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName + +const AlertDialogCancel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, +} diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/alert.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/alert.tsx new file mode 100644 index 0000000..41fa7e0 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/alert.tsx @@ -0,0 +1,59 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const alertVariants = cva( + "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", + { + variants: { + variant: { + default: "bg-background text-foreground", + destructive: + "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +const Alert = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes & VariantProps +>(({ className, variant, ...props }, ref) => ( +
    +)) +Alert.displayName = "Alert" + +const AlertTitle = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
    +)) +AlertTitle.displayName = "AlertTitle" + +const AlertDescription = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
    +)) +AlertDescription.displayName = "AlertDescription" + +export { Alert, AlertTitle, AlertDescription } diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/aspect-ratio.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/aspect-ratio.tsx new file mode 100644 index 0000000..c4abbf3 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/aspect-ratio.tsx @@ -0,0 +1,5 @@ +import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio" + +const AspectRatio = AspectRatioPrimitive.Root + +export { AspectRatio } diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/avatar.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/avatar.tsx new file mode 100644 index 0000000..991f56e --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/avatar.tsx @@ -0,0 +1,48 @@ +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +Avatar.displayName = AvatarPrimitive.Root.displayName + +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarImage.displayName = AvatarPrimitive.Image.displayName + +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName + +export { Avatar, AvatarImage, AvatarFallback } diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/badge.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/badge.tsx new file mode 100644 index 0000000..f000e3e --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/badge.tsx @@ -0,0 +1,36 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const badgeVariants = cva( + "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return ( +
    + ) +} + +export { Badge, badgeVariants } diff --git a/apps/cortigpt-monorepo/apps/extension/components/ui/breadcrumb.tsx b/apps/cortigpt-monorepo/apps/extension/components/ui/breadcrumb.tsx new file mode 100644 index 0000000..71a5c32 --- /dev/null +++ b/apps/cortigpt-monorepo/apps/extension/components/ui/breadcrumb.tsx @@ -0,0 +1,115 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { ChevronRight, MoreHorizontal } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Breadcrumb = React.forwardRef< + HTMLElement, + React.ComponentPropsWithoutRef<"nav"> & { + separator?: React.ReactNode + } +>(({ ...props }, ref) =>