import { Link } from "../lib/navigation"; import type { ReactNode } from "react"; import { Blocks, Clock3, CookingPot, GraduationCap, Lightbulb, Mail, PanelsTopLeft, Plane, PlayCircleIcon, Scale, Search, } from "lucide-react"; import { linearLogo, slackLogo } from "./new-session-starter-logos"; import { Button } from "../../ui/button"; // Plain editable prompts, not service identifiers or a connector resolver. export const NEW_SESSION_STARTERS = [ { id: "slack", title: "Work with Opengeni from Slack", description: "Install the bot. Start tasks and follow up on the go.", prompt: "Help me install the Opengeni Slack bot so I can ask questions, start work, and follow up from Slack, including on my phone.", }, { id: "github", title: "Connect GitHub and start a fix", description: "Explore a repository and find an improvement to make.", prompt: "Help me connect a GitHub repository. Explain the codebase, suggest a useful improvement, and help me implement it once we agree on the change.", }, { id: "linear", title: "Connect Linear and analyze issues", description: "Find blockers and decide what to tackle next.", prompt: "Help me connect Linear and analyze a project's open issues. Highlight blockers and possible duplicates, then recommend what to tackle next. Don't change any issues yet.", }, { id: "schedule", title: "Schedule a morning brief", description: "Stay up to date without asking every day.", prompt: "Help me schedule a weekday morning brief. Ask what I want to track, which sources to use, my time zone, and where to deliver it. Show me a sample and let me confirm before enabling the schedule.", }, { id: "research", title: "Research a decision", description: "Compare options and get a sourced recommendation.", prompt: "Help me research a decision. Ask what I am deciding and what matters most, compare the options, and recommend a next step with sources.", }, { id: "create", title: "Turn an idea into a first version", description: "Make a presentation, prototype, or shareable page.", prompt: "Help me turn an idea into something real. Ask about the idea and its audience, suggest whether to make a presentation, prototype, or shareable page, then help me build a first version.", }, ] as const; /** * For people who said they want help with everyday things: what they'd ask a * helpful friend, in their words. No services to connect, nothing technical. */ export const EVERYDAY_SESSION_STARTERS = [ { id: "trip", title: "Plan a trip", description: "A simple day-by-day plan for where you're going.", prompt: "Help me plan a trip. Ask where and when I'm going, who's coming and what we enjoy, then suggest a simple day-by-day plan.", Icon: Plane, }, { id: "message", title: "Write a message", description: "An email, a letter or a text that says what you mean.", prompt: "Help me write a message. Ask who it's for and what I want to say, then write a short, friendly draft I can change.", Icon: Mail, }, { id: "explain", title: "Explain something", description: "A letter, a bill or a topic, in plain words.", prompt: "Explain something to me in plain words. First ask what it is, so I can paste or type it in. Then tell me simply what it means and whether I need to do anything.", /** Offered only where this deployment accepts file uploads. */ promptWithPhoto: "Explain something to me in plain words. First ask what it is: I can paste the text or attach a photo. Then tell me simply what it means and whether I need to do anything.", Icon: Lightbulb, }, { id: "decide", title: "Help me decide", description: "Compare a few options and pick one.", prompt: "Help me decide between a few options. Ask what I'm choosing between and what matters most to me, then compare them simply and recommend one.", Icon: Scale, }, { id: "meals", title: "Plan the week's meals", description: "Simple recipes and a shopping list.", prompt: "Help me plan meals for the week. Ask how many people, what we like and anything we avoid, then suggest simple meals and a shopping list.", Icon: CookingPot, }, { id: "learn", title: "Learn to do something", description: "Step by step, at your own pace.", prompt: "Teach me how to do something, step by step. Ask what I want to learn and what I already know, then go one step at a time and check that I'm following.", Icon: GraduationCap, }, ] as const; /** For people who said they build a product: their agent first, then a demo. */ export const ADD_AGENT_STARTER = { id: "add-agent", title: "Add an agent to my product", description: "Tell the agent about your product.", } as const; /** The recorded playground demo, opened in the workspace. */ export const PLAYGROUND_STARTER = { id: "playground", title: "See a demo of an agent in a product", description: "A recorded agent inside a sample app.", } as const; /** The agent asks about the product first. */ export const ADD_AGENT_DEFAULT_PROMPT = "I want to add an AI agent to my product with Opengeni. Ask me what the product is and where it lives (a website, an app, a GitHub repository), propose where an agent fits best, then help me build it."; /** The general starters a builder still needs, after their own two. */ const PRODUCT_GENERAL_IDS = ["github", "create", "research", "schedule"] as const; export type StarterSet = "everyday" | "general" | "product"; /** * A suggestion a host shows under the new-chat composer in place of * Opengeni's own, such as tasks that fit the app the chat sits in. */ export type SessionStarter = Readonly<{ id: string; title: string; description?: string | undefined; /** The text put in the composer, which the person can edit before sending. */ prompt: string; /** A small decorative icon (about 20 px) before the title. */ icon?: ReactNode; }>; const STARTER_CLASS = "h-full min-h-16 justify-start gap-3 whitespace-normal px-3 py-3 text-left hover:bg-surface hover:hover-layer"; /** * Six starters under the new-chat composer. The set follows the signup * answer: people who want help with everyday things get six everyday asks; * people adding agents to a product get their own agent and the playground * demo first; everyone else gets the general six. A host's own starters * replace all of them. */ export function NewSessionStarters({ onSelect, disabled = false, set = "general", hostStarters, workspaceId, fileUploads = false, }: { onSelect: (prompt: string) => void; disabled?: boolean | undefined; set?: StarterSet | undefined; /** The host's suggestions, shown instead of the set's. */ hostStarters?: readonly SessionStarter[] | undefined; /** The deployment accepts attachments, so an everyday ask may offer a photo. */ fileUploads?: boolean | undefined; /** Where the playground demo opens (product set). */ workspaceId?: string | undefined; }) { if (hostStarters) { if (hostStarters.length === 0) return null; return ( {hostStarters.map((starter) => ( ))} ); } if (set === "everyday") { return ( {EVERYDAY_SESSION_STARTERS.map((starter) => ( ))} ); } const general = set === "product" ? PRODUCT_GENERAL_IDS.map((id) => NEW_SESSION_STARTERS.find((starter) => starter.id === id)!) : NEW_SESSION_STARTERS; return ( {set === "product" ? ( <> {workspaceId ? ( ) : null} ) : null} {general.map((starter) => { const Icon = starter.id === "schedule" ? Clock3 : starter.id === "research" ? Search : PanelsTopLeft; const logo = starter.id === "slack" ? slackLogo : starter.id === "linear" ? linearLogo : null; return ( ); })} ); } function StarterSection({ children }: { children: ReactNode }) { return (

Suggestions

{children}
); } function StarterText({ title, description }: { title: string; description?: string | undefined }) { return ( {title} {description ? ( {description} ) : null} ); } // GitHub's vendor mark, inlined as a small SVG so it works offline and inherits // the foreground color in both themes. No remote favicon or base64 module. function GitHubMark() { return ( ); }