Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Merge upstream/main to resolve AppMessage.tsx conflict (page pane + pin to sidebar)
Bugfixer 25f1dda97b5e6
diff --cc src/components/app/AppMessage.tsxindex 2dbf5828eb,e03cfcc3c4..0b12b4b4dc--- a/src/components/app/AppMessage.tsx+++ b/src/components/app/AppMessage.tsx@@@ -9,7 -9,8 +9,8 @@@ import { AppDocumentError, fetchAppDocuimport { APP_POOL_LIMITS, useAppPoolSlot, type AppPool } from "./app-pool";import { AppDone, AppHeader, AppInfo, AppOpenButton, AppPlaceholder, AppStrip, APP_SURFACE } from "./AppChrome";import { AppFrame, type AppFrameHandle, type AppFrameProblem } from "./AppFrame";- import { PAGE_HEIGHT, PageFullScreen, PageNotes, PageToolbar, usePagePin, usePagePoint, usePageShare, usePageVersion } from "./PageTools";+ import { closePage, onPageOpened, openPage, openPageFor } from "@/lib/open-page";-import { PAGE_HEIGHT, PAGE_PREVIEW_HEIGHT, PageFullScreen, PageNotes, PagePaneContext, PageToolbar, usePagePoint, usePageShare, usePageVersion } from "./PageTools";++import { PAGE_HEIGHT, PAGE_PREVIEW_HEIGHT, PageFullScreen, PageNotes, PagePaneContext, PageToolbar, usePagePin, usePagePoint, usePageShare, usePageVersion } from "./PageTools";const WIDTH = "max-w-[760px]";const DOC_REUSE_MS = 60_000;@@@ -151,11 -156,17 +156,18 @@@ function AppRow({ botId, botName, threaconst current = slot.live ? loaded?.doc : undefined;const point = usePagePoint({frame: () => (fullScreen ? wide.current : frame.current)?.iframe,- threadId, appId: message.id, rev, title: payload.title, picked: () => setFullScreen(false),+ // In the pane the message box stays usable, so the page stays open while the person writes about what they picked.+ threadId, appId: message.id, rev, title: payload.title, picked: () => { if (!pane) setFullScreen(false); },});+ useEffect(() => {+ if (!paneOpen) return;+ openPage(threadId, { appId: message.id, rev });+ const off = onPageOpened(() => { if (openPageFor(threadId)?.appId !== message.id) setFullScreen(false); });+ return () => { off(); closePage(threadId, message.id); };+ }, [paneOpen, threadId, message.id, rev]);const share = usePageShare(threadId, message.id, message.publishedPage);- const tools = { version, point, share, room, ready: Boolean(current), fullScreen: { open: fullScreen, pane: Boolean(pane), toggle: () => { point.stop(); setFullScreen((open) => !open); } } };+ const pin = usePagePin({ botId, threadId, messageId: message.id }, payload.title);- const tools = { version, point, share, room, pin, ready: Boolean(current), fullScreen: { open: fullScreen, toggle: () => { point.stop(); setFullScreen((open) => !open); } } };++ const tools = { version, point, share, room, pin, ready: Boolean(current), fullScreen: { open: fullScreen, pane: Boolean(pane), toggle: () => { point.stop(); setFullScreen((open) => !open); } } };const reloadNow = () => {setProblem(null);diff --cc src/components/app/PageTools.tsxindex 4e4497cef1,f0991cdc7f..9a02746d5d--- a/src/components/app/PageTools.tsx+++ b/src/components/app/PageTools.tsx@@@ -1,7 -1,7 +1,7 @@@// A bot's page in the chat, artifact-style: its version stepper, Point, Share, Open in new tab and Full screen.- import { useCallback, useEffect, useRef, useState, type MutableRefObject, type ReactNode } from "react";+ import { createContext, useCallback, useEffect, useRef, useState, type MutableRefObject, type ReactNode } from "react";import { createPortal } from "react-dom";-import { ArrowUpRight, Check, ChevronLeft, ChevronRight, Copy, Crosshair, Globe, Loader2, Maximize2, Share2, Trash2, X } from "lucide-react";+import { ArrowUpRight, Check, ChevronLeft, ChevronRight, Copy, Crosshair, Globe, Loader2, Maximize2, Pin, PinOff, Share2, Trash2, X } from "lucide-react";import { useStore } from "@/state/store";import { openExternalLink } from "@/lib/app-links";import { cn } from "@/lib/cn";@@@ -133,10 -122,10 +133,11 @@@ export interface PageToolsPropspoint: ReturnType<typeof usePagePoint>;share: ReturnType<typeof usePageShare>;ready: boolean;- fullScreen: { open: boolean; toggle(): void };+ /** pane: the page opens in the chat's page pane, beside a usable message box, instead of covering the window. */+ fullScreen: { open: boolean; toggle(): void; pane?: boolean };/** Shown in a room: view-only, so no Point and no Share. */room?: boolean;+ pin?: ReturnType<typeof usePagePin>;}/** The card's toolbar: ‹ v2 › and Updated on the left; Point, Share, Open in new tab and Full screen on the right. */