├── next_app ├── public │ ├── CNAME │ ├── favicon.ico │ ├── apple-icon.png │ ├── icon-black.svg │ ├── icon.svg │ └── images │ │ └── chat.svg ├── .eslintrc.json ├── image.png ├── src │ ├── assets │ │ ├── icons │ │ │ ├── wAR.png │ │ │ ├── run.svg │ │ │ ├── loading.svg │ │ │ └── bazar.svg │ │ └── din-bhar-code.png │ ├── components │ │ ├── sidebar │ │ │ ├── components │ │ │ │ ├── packages.tsx │ │ │ │ ├── projects.tsx │ │ │ │ ├── sqlite-explorer.tsx │ │ │ │ ├── files.tsx │ │ │ │ ├── marketplace.tsx │ │ │ │ ├── sam.tsx │ │ │ │ ├── interact.tsx │ │ │ │ ├── ai-chat.tsx │ │ │ │ └── index.ts │ │ │ └── index.tsx │ │ ├── ui │ │ │ ├── icons │ │ │ │ ├── war.tsx │ │ │ │ └── bazar.tsx │ │ │ ├── skeleton.tsx │ │ │ ├── label.tsx │ │ │ ├── textarea.tsx │ │ │ ├── separator.tsx │ │ │ ├── toaster.tsx │ │ │ ├── input.tsx │ │ │ ├── sonner.tsx │ │ │ ├── checkbox.tsx │ │ │ ├── switch.tsx │ │ │ ├── tooltip.tsx │ │ │ ├── popover.tsx │ │ │ ├── custom │ │ │ │ ├── switch.tsx │ │ │ │ ├── error-boundary.tsx │ │ │ │ └── loading.tsx │ │ │ ├── avatar.tsx │ │ │ ├── toggle.tsx │ │ │ ├── radio-group.tsx │ │ │ ├── alert.tsx │ │ │ ├── scroll-area.tsx │ │ │ ├── resizable.tsx │ │ │ ├── toggle-group.tsx │ │ │ ├── button.tsx │ │ │ ├── tabs.tsx │ │ │ ├── card.tsx │ │ │ ├── combo-box.tsx │ │ │ ├── dialog.tsx │ │ │ ├── toast.tsx │ │ │ ├── use-toast.ts │ │ │ └── alert-dialog.tsx │ │ ├── mobile │ │ │ └── index.tsx │ │ ├── theme-provider.tsx │ │ ├── views │ │ │ ├── components │ │ │ │ ├── _template.tsx │ │ │ │ ├── index.ts │ │ │ │ └── editor │ │ │ │ │ └── components │ │ │ │ │ ├── output.tsx │ │ │ │ │ └── history.tsx │ │ │ └── index.tsx │ │ ├── menubar │ │ │ └── components │ │ │ │ ├── all-projects.tsx │ │ │ │ ├── duplicate-project.tsx │ │ │ │ ├── duplicate-file.tsx │ │ │ │ ├── download-file.tsx │ │ │ │ ├── download.tsx │ │ │ │ ├── delete-file.tsx │ │ │ │ ├── delete-project.tsx │ │ │ │ ├── rename-project.tsx │ │ │ │ ├── rename-file.tsx │ │ │ │ └── blueprint.tsx │ │ ├── drawer │ │ │ ├── index.tsx │ │ │ └── components │ │ │ │ ├── index.ts │ │ │ │ ├── marketplace.tsx │ │ │ │ ├── project-list.tsx │ │ │ │ ├── sqlite-explorer.tsx │ │ │ │ └── file-list.tsx │ │ └── layout.tsx │ ├── hooks │ │ ├── index.ts │ │ ├── useUIState.ts │ │ ├── useAIState.ts │ │ ├── profile.ts │ │ ├── useEditorState.ts │ │ └── useGlobalState.ts │ ├── modules │ │ └── ao │ │ │ ├── index.ts │ │ │ ├── test.ts │ │ │ ├── db-admin.ts │ │ │ └── graph.ts │ ├── pages │ │ ├── bounties.tsx │ │ ├── index.tsx │ │ ├── dev.tsx │ │ ├── _document.tsx │ │ ├── _app.tsx │ │ └── import.tsx │ ├── templates │ │ ├── index.ts │ │ └── ao │ │ │ ├── fantasy-llama.ts │ │ │ ├── llama-complainer.ts │ │ │ └── ao-bot.ts │ ├── utils │ │ └── keybinds.ts │ ├── lib │ │ ├── api.ts │ │ ├── ai.ts │ │ └── monaco-completions.ts │ └── styles │ │ └── globals.css ├── backend │ ├── cron.sh │ ├── routes │ │ ├── health │ │ │ └── index.ts │ │ ├── analytics │ │ │ ├── referrers.ts │ │ │ └── post.ts │ │ ├── system │ │ │ └── index.ts │ │ └── chat │ │ │ └── index.ts │ ├── utils │ │ ├── helpers.ts │ │ └── modelConfig.ts │ ├── types.ts │ ├── index.ts │ ├── db │ │ └── database.ts │ ├── inlineSystemPrompt.ts │ └── extract.sh ├── postcss.config.mjs ├── components.json ├── .gitignore ├── tsconfig.json ├── next.config.mjs ├── README.md ├── tailwind.config.ts └── package.json ├── images ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── .gitignore ├── lua └── sharecode.lua ├── .github ├── FUNDING.yml └── workflows │ ├── sync-to-protocol-land.yml │ └── nextjs.yml ├── LICENSE └── README.md /next_app/public/CNAME: -------------------------------------------------------------------------------- 1 | ide.betteridea.dev 2 | -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/images/4.png -------------------------------------------------------------------------------- /next_app/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /next_app/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/next_app/image.png -------------------------------------------------------------------------------- /next_app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/next_app/public/favicon.ico -------------------------------------------------------------------------------- /next_app/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/next_app/public/apple-icon.png -------------------------------------------------------------------------------- /next_app/src/assets/icons/wAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/next_app/src/assets/icons/wAR.png -------------------------------------------------------------------------------- /next_app/src/assets/din-bhar-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/betteridea-dev/ide/HEAD/next_app/src/assets/din-bhar-code.png -------------------------------------------------------------------------------- /next_app/backend/cron.sh: -------------------------------------------------------------------------------- 1 | 2 | # move the analytics.db file to an archive folder every month and rename it to the date span it covers 3 | # TODO -------------------------------------------------------------------------------- /next_app/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /next_app/backend/routes/health/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | 3 | const router = Router(); 4 | 5 | // Health check route 6 | router.get('/', (req, res) => { 7 | res.status(304).redirect("https://ide.betteridea.dev"); 8 | }); 9 | 10 | export default router; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/packages.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { Blocks } from "lucide-react" 3 | 4 | const item:TSidebarItem = { 5 | icon: Blocks, 6 | label: "Packages", 7 | value: "PACKAGES" 8 | } 9 | 10 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/projects.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { FolderIcon } from "lucide-react" 3 | 4 | const item:TSidebarItem = { 5 | icon: FolderIcon, 6 | label: "Projects", 7 | value: "ALL_PROJECTS" 8 | } 9 | 10 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/sqlite-explorer.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { Database } from "lucide-react" 3 | 4 | const item:TSidebarItem = { 5 | icon: Database, 6 | label: "SQLite Explorer", 7 | value: "SQLITE_EXPLORER" 8 | } 9 | 10 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/files.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { Files } from "lucide-react" 3 | import { useGlobalState } from "@/hooks"; 4 | 5 | const item:TSidebarItem = { 6 | icon: Files, 7 | label: "Files", 8 | value: "FILES" 9 | } 10 | 11 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/marketplace.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { Library, LibraryBig, Warehouse } from "lucide-react" 3 | 4 | const item: TSidebarItem = { 5 | icon: LibraryBig, 6 | label: "Template Marketplace", 7 | value: "MARKETPLACE" 8 | } 9 | 10 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/sam.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { SearchCode } from "lucide-react" 3 | import { useGlobalState } from "@/hooks"; 4 | 5 | const item: TSidebarItem = { 6 | icon: SearchCode, 7 | label: "Auditing (beta)", 8 | value: "SAM" 9 | } 10 | 11 | export default item; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/interact.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { Files, FlaskConical } from "lucide-react" 3 | import { useGlobalState } from "@/hooks"; 4 | 5 | const item:TSidebarItem = { 6 | icon: FlaskConical, 7 | label: "Interact", 8 | value: "INTERACT" 9 | } 10 | 11 | export default item; -------------------------------------------------------------------------------- /next_app/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export { useGlobalState } from './useGlobalState'; 2 | export { default as useProjectManager } from './useProjectManager'; 3 | export { default as useProfile } from './profile'; 4 | export { useUIState } from './useUIState'; 5 | export { useEditorState } from './useEditorState'; 6 | export { useAIState } from './useAIState'; 7 | -------------------------------------------------------------------------------- /next_app/src/components/ui/icons/war.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image" 2 | import wARpng from "@/assets/icons/wAR.png" 3 | 4 | export default function WarpedAR({ width = 20, height = 20 }: { width?: number, height?: number }) { 5 | return
6 | war-icon 7 |
8 | } -------------------------------------------------------------------------------- /next_app/src/assets/icons/run.svg: -------------------------------------------------------------------------------- 1 | 2 | New Project 3 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /next_app/src/components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/lib/utils" 2 | 3 | function Skeleton({ 4 | className, 5 | ...props 6 | }: React.HTMLAttributes) { 7 | return ( 8 |
12 | ) 13 | } 14 | 15 | export { Skeleton } 16 | -------------------------------------------------------------------------------- /next_app/src/components/ui/icons/bazar.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image" 2 | import bazarpng from "@/assets/icons/bazar.svg" 3 | 4 | export default function BazarIcon({ width = 20, height = 20 }: { width?: number, height?: number }) { 5 | return
6 | war-icon 7 |
8 | } -------------------------------------------------------------------------------- /next_app/src/components/mobile/index.tsx: -------------------------------------------------------------------------------- 1 | export default function Mobile() { 2 | return
3 | Hi There!
Looks like you are using a mobile device.
Please use a desktop device to access the IDE. 4 |

Thank you!

~The developer 5 |
6 | } -------------------------------------------------------------------------------- /next_app/src/components/theme-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import { ThemeProvider as NextThemesProvider } from "next-themes" 5 | import { type ThemeProviderProps } from "next-themes/dist/types" 6 | 7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 8 | return {children} 9 | } 10 | -------------------------------------------------------------------------------- /next_app/src/components/views/components/_template.tsx: -------------------------------------------------------------------------------- 1 | import { TView } from "." 2 | 3 | 4 | function ViewComponent() { 5 | return
6 | Name 7 |
8 | } 9 | 10 | const viewItem: TView = { 11 | component: ViewComponent, 12 | label: "ViewName", 13 | value: null // udpate this and add to the list in ./index.ts 14 | } 15 | 16 | export default viewItem; -------------------------------------------------------------------------------- /next_app/src/modules/ao/index.ts: -------------------------------------------------------------------------------- 1 | import {name as graphName,src as graphSrc} from "./graph" 2 | import { name as testName, src as testSrc } from "./test" 3 | import { name as dbAdminname, src as dbAdminSrc } from "./db-admin" 4 | 5 | const modules: { 6 | [foo:string]:string 7 | } = { 8 | [graphName]: graphSrc, 9 | [testName]: testSrc, 10 | [dbAdminname]: dbAdminSrc 11 | } 12 | 13 | export default modules -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | dist-* 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | pnpm-debug.log* 12 | lerna-debug.log* 13 | 14 | node_modules 15 | dist 16 | dist-ssr 17 | *.local 18 | 19 | # Editor directories and files 20 | .vscode/* 21 | !.vscode/extensions.json 22 | .idea 23 | .DS_Store 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | 30 | # 31 | -------------------------------------------------------------------------------- /next_app/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "new-york", 4 | "rsc": false, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/styles/globals.css", 9 | "baseColor": "zinc", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils" 16 | } 17 | } -------------------------------------------------------------------------------- /next_app/src/pages/bounties.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | 3 | export default function Bounties() { 4 | useEffect(() => { 5 | window.location.href = "https://betteridea.dev/bounties"; 6 | 7 | }, []) 8 | 9 | return
10 |
Loading Bounties... ⌛️
11 |
12 | } -------------------------------------------------------------------------------- /next_app/src/components/views/index.tsx: -------------------------------------------------------------------------------- 1 | import { useGlobalState } from "@/hooks" 2 | import viewItems from "./components" 3 | 4 | export default function View() { 5 | const globalState = useGlobalState(); 6 | 7 | 8 | return <> 9 | { 10 | viewItems.map((Item, i) => { 11 | return globalState.activeView==Item.value? :null 12 | }) 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /next_app/public/icon-black.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /next_app/public/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /next_app/src/components/menubar/components/all-projects.tsx: -------------------------------------------------------------------------------- 1 | import { Button } from "@/components/ui/button"; 2 | import { useGlobalState } from "@/hooks"; 3 | 4 | export default function AllProjectsBtn() { 5 | const globalState = useGlobalState() 6 | 7 | return 12 | } -------------------------------------------------------------------------------- /next_app/src/components/drawer/index.tsx: -------------------------------------------------------------------------------- 1 | import { useGlobalState } from "@/hooks" 2 | import drawerItems from "./components" 3 | 4 | export default function SidebarDrawer() { 5 | const globalState = useGlobalState() 6 | 7 | return
8 | { 9 | drawerItems.map((item, i) => { 10 | return item.value == globalState.activeSidebarItem ? : null 11 | }) 12 | } 13 |
14 | } -------------------------------------------------------------------------------- /next_app/src/components/views/components/index.ts: -------------------------------------------------------------------------------- 1 | import Home from "./home" 2 | import Editor from "./editor" 3 | import Settings from "./settings" 4 | import AllProjects from "./all-projects" 5 | import Marketplace from "./marketplace" 6 | 7 | const viewItems: TView[] = [Home, Editor, Settings, AllProjects, Marketplace]; 8 | 9 | export default viewItems; 10 | 11 | export type TView = { 12 | component: React.FC; 13 | label: string; 14 | value: TViewOptions; 15 | } 16 | 17 | export type TViewOptions = null | "ALL_PROJECTS" | "EDITOR" | "SETTINGS" | "MARKETPLACE"; -------------------------------------------------------------------------------- /next_app/backend/routes/analytics/referrers.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | import db from '../../db/database'; 3 | 4 | const router = Router(); 5 | 6 | // Get referrers analytics 7 | router.get('/', (req, res) => { 8 | db.all(`SELECT referrer, COUNT(*) as count FROM codecell_loads GROUP BY referrer ORDER BY count DESC`, (err, rows) => { 9 | if (err) { 10 | console.log(err); 11 | res.status(500).send(err); 12 | } else { 13 | res.status(200).send(rows); 14 | } 15 | }); 16 | }); 17 | 18 | export default router; -------------------------------------------------------------------------------- /next_app/src/components/sidebar/components/ai-chat.tsx: -------------------------------------------------------------------------------- 1 | import { TSidebarItem } from "."; 2 | import { BotMessageSquare, MessageCircleHeart } from "lucide-react" 3 | import { useGlobalState } from "@/hooks"; 4 | 5 | const item: TSidebarItem = { 6 | icon: () => ( 7 |
8 | 9 |
10 | NEW 11 |
12 |
) 13 | , 14 | label: "AO Companion", 15 | value: "AI_CHAT" 16 | } 17 | 18 | export default item; -------------------------------------------------------------------------------- /next_app/backend/utils/helpers.ts: -------------------------------------------------------------------------------- 1 | // Helper function to construct prompt 2 | export function constructPrompt({ message, fileContext = "" }: { message: string, fileContext: string }) { 3 | let contextualPrompt = ""; 4 | 5 | if (fileContext) { 6 | contextualPrompt += `File context: ${fileContext}\n`; 7 | } 8 | 9 | contextualPrompt += `\nUser message: ${message}`; 10 | 11 | contextualPrompt += `\n\nrespond as concise as possible`; 12 | return contextualPrompt; 13 | } 14 | 15 | // Helper function to calculate and log token usage 16 | export function calculateCost(tokens: number) { 17 | console.log(`Token usage: ${tokens}`); 18 | } -------------------------------------------------------------------------------- /next_app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | archive/ 4 | dist-* 5 | .env 6 | ao-cookbook/ 7 | 8 | # dependencies 9 | /node_modules 10 | /.pnp 11 | .pnp.js 12 | .yarn/install-state.gz 13 | 14 | # testing 15 | /coverage 16 | 17 | # next.js 18 | /.next/ 19 | /out/ 20 | 21 | # production 22 | /build 23 | 24 | # misc 25 | .DS_Store 26 | *.pem 27 | 28 | # debug 29 | npm-debug.log* 30 | yarn-debug.log* 31 | yarn-error.log* 32 | 33 | # local env files 34 | .env*.local 35 | 36 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | 43 | analytics.db 44 | 45 | test.html -------------------------------------------------------------------------------- /next_app/src/templates/index.ts: -------------------------------------------------------------------------------- 1 | import { source as aoBot } from "@/templates/ao/ao-bot"; 2 | import { source as arInGrid } from "@/templates/ao/ar-in-arena"; 3 | import { source as memeFrame } from "@/templates/ao/memeframe"; 4 | import { source as LlamaComplainer } from "@/templates/ao/llama-complainer"; 5 | import { source as FantasyLlama } from "@/templates/ao/fantasy-llama"; 6 | 7 | export const AOTemplates = { 8 | "": 'print("Hello AO!")', 9 | "Reality Agent - Chatter": FantasyLlama, 10 | "Reality Agent - Complainer": LlamaComplainer, 11 | "Deathmatch Arena": arInGrid, 12 | "Deathmatch Bot": aoBot, 13 | "MemeFrame": memeFrame 14 | } 15 | 16 | -------------------------------------------------------------------------------- /next_app/src/components/drawer/components/index.ts: -------------------------------------------------------------------------------- 1 | import { TSidebarOptions } from "@/components/sidebar/components"; 2 | import FileList from "./file-list"; 3 | import ProjectList from "./project-list"; 4 | import PackageList from "./package-list"; 5 | import SQLite from "./sqlite-explorer" 6 | import Interact from "./interact" 7 | import Sam from "./sam" 8 | import Templates from "./marketplace" 9 | 10 | const drawerItems: TDrawerItem[] = [FileList, ProjectList, PackageList, SQLite, Interact, Sam, Templates]; 11 | 12 | export default drawerItems; 13 | 14 | export type TDrawerItem = { 15 | component: React.FC; 16 | label: string; 17 | value: TSidebarOptions; 18 | } -------------------------------------------------------------------------------- /lua/sharecode.lua: -------------------------------------------------------------------------------- 1 | -- LUA code that handles the share code feature of BetterIDEa. 2 | -- The _BETTERIDEA_SHARE variable is set to a base64 encoded string of the project data json. 3 | -- The handler Get-Better-IDEa-Share is dryrun and loaded into the IDE by upon visiting the share code link. 4 | 5 | _BETTERIDEA_SHARE = 'BASE64_ENCODED_STRING_OF_THE_PROJECT_DATA_JSON' 6 | 7 | Handlers.add( 8 | "Get-Better-IDEa-Share", 9 | Handlers.utils.hasMatchingTag("Action", "Get-BetterIDEa-Share"), 10 | function(msg) 11 | ao.send({ Target = msg.From, Action = "BetterIDEa-Share-Response", Data = _BETTERIDEA_SHARE }) 12 | return _BETTERIDEA_SHARE 13 | end 14 | ) 15 | -------------------------------------------------------------------------------- /next_app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "dom", 5 | "dom.iterable", 6 | "esnext" 7 | ], 8 | "allowJs": true, 9 | "skipLibCheck": true, 10 | "strict": false, 11 | "noEmit": true, 12 | "esModuleInterop": true, 13 | "module": "esnext", 14 | "moduleResolution": "bundler", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "jsx": "preserve", 18 | "incremental": true, 19 | "paths": { 20 | "@/*": [ 21 | "./src/*" 22 | ] 23 | }, 24 | "target": "ES2017" 25 | }, 26 | "include": [ 27 | "next-env.d.ts", 28 | "**/*.ts", 29 | "**/*.tsx", 30 | "backend/index.ts" 31 | ], 32 | "exclude": [ 33 | "node_modules" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /next_app/backend/types.ts: -------------------------------------------------------------------------------- 1 | export type TBody = { 2 | action: "codecell_load" | "codecell_run" 3 | cellId: string 4 | userId: string 5 | appName: string 6 | messageId?: string 7 | referrer: string 8 | geo?: { 9 | country?: string 10 | countryCode?: string 11 | region?: string 12 | regionName?: string 13 | city?: string 14 | zip?: string 15 | lat?: number 16 | lon?: number 17 | timezone?: string 18 | isp?: string 19 | org?: string 20 | as?: string 21 | query?: string 22 | } 23 | } 24 | 25 | export type ChatRequest = { 26 | message: string 27 | fileContext?: string 28 | chat: Array<{ role: string, content: string }> 29 | model: string 30 | } -------------------------------------------------------------------------------- /next_app/public/images/chat.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /next_app/src/components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import * as LabelPrimitive from "@radix-ui/react-label" 3 | import { cva, type VariantProps } from "class-variance-authority" 4 | 5 | import { cn } from "@/lib/utils" 6 | 7 | const labelVariants = cva( 8 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 9 | ) 10 | 11 | const Label = React.forwardRef< 12 | React.ElementRef, 13 | React.ComponentPropsWithoutRef & 14 | VariantProps 15 | >(({ className, ...props }, ref) => ( 16 | 21 | )) 22 | Label.displayName = LabelPrimitive.Root.displayName 23 | 24 | export { Label } 25 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: ankushKun 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | polar: # Replace with a single Polar username 13 | buy_me_a_coffee: # Replace with a single Buy Me a Coffee username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /next_app/next.config.mjs: -------------------------------------------------------------------------------- 1 | import { execSync } from "child_process"; 2 | import packageJson from "./package.json" with { type: "json" }; 3 | import NodePolyfillPlugin from "node-polyfill-webpack-plugin" 4 | 5 | // fetch local gitHash 6 | const gitHash = execSync("git rev-parse --short HEAD").toString().trim(); 7 | 8 | 9 | /** @type {import('next').NextConfig} */ 10 | const nextConfig = { 11 | reactStrictMode: true, 12 | output: "export", 13 | images: { unoptimized: true }, 14 | basePath: "", 15 | env: { 16 | version: packageJson.version, 17 | gitHash: gitHash, 18 | }, 19 | webpack: (config, { isServer }) => { 20 | // Only apply this plugin on the client-side bundle 21 | if (!isServer) { 22 | config.plugins.push(new NodePolyfillPlugin()); 23 | } 24 | return config; 25 | } 26 | }; 27 | 28 | export default nextConfig; 29 | -------------------------------------------------------------------------------- /next_app/src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |