A desktop coding agent with free access to frontier models.
TypeScript
feat: coding starter cards
ogsamrat96c388fc7093
diff --git a/apps/app/src/components/chat/task-suggestions.tsx b/apps/app/src/components/chat/task-suggestions.tsxindex d7f3f9e2..ce280839 100644--- a/apps/app/src/components/chat/task-suggestions.tsx+++ b/apps/app/src/components/chat/task-suggestions.tsx@@ -10,13 +10,72 @@ import {import { useMessageList } from "@/components/chat/message-list-provider"import { cn } from "@/lib/utils"import { useOrgRestrictions } from "@/react-app/domains/cloud/desktop-config-provider"-import { BoltIcon, CubeIcon, DocumentChartBarIcon, GlobeAltIcon, SparklesIcon } from "@heroicons/react/24/solid"--const CSV_PROMPT =- "Create a sample CSV file with 20 rows of fake customer data (name, email, company, revenue). Then show me a summary of the data."+import {+ ArrowPathIcon,+ BoltIcon,+ BugAntIcon,+ CpuChipIcon,+ RocketLaunchIcon,+ ServerStackIcon,+ SparklesIcon,+ WrenchScrewdriverIcon,+} from "@heroicons/react/24/solid"-const BROWSER_PROMPT =- "Open craigslist.org in the browser and search for couches for sale. Show me the top 5 results with prices."+/**+ * Real coding work in the user's own project, one card per kind of work the+ * quality check values. Clicking puts the template in the composer to fill+ * in; it is never sent on its own.+ */+export const CODING_STARTER_CARDS = [+ {+ id: "hard-bug",+ title: "Fix a hard bug",+ description: "Reproduce it, find the root cause, fix and test",+ prompt: "There's a bug in this project: {describe the symptom}. Reproduce it with a failing test or command first, find the root cause, fix it, and run the tests until they pass.",+ Icon: BugAntIcon,+ iconClass: "text-red-10",+ },+ {+ id: "faster",+ title: "Make it faster",+ description: "Measure, find the bottleneck, show before/after",+ prompt: "{Part} of this project is too slow. Measure it first (benchmark or profiler), find the bottleneck, optimise it, and show before/after numbers.",+ Icon: BoltIcon,+ iconClass: "text-amber-10",+ },+ {+ id: "build",+ title: "Fix the build",+ description: "Get the build, CI or Docker setup passing",+ prompt: "The build/CI/Docker setup for this project is broken or missing: {what}. Get it building from a clean checkout and make the build pass.",+ Icon: WrenchScrewdriverIcon,+ iconClass: "text-blue-10",+ },+ {+ id: "refactor",+ title: "Refactor or migrate",+ description: "Move a module or library, keep behaviour the same",+ prompt: "Migrate {module/library} in this project to {target}. Update every caller, keep behaviour the same, and run the tests after each step.",+ Icon: ArrowPathIcon,+ iconClass: "text-purple-10",+ },+ {+ id: "feature",+ title: "Build a real feature",+ description: "Design, implement across the code, add tests",+ prompt: "Add {feature} to this project end to end: design it, implement it across the code that needs it, add tests, and run them.",+ Icon: RocketLaunchIcon,+ iconClass: "text-green-10",+ },+ {+ id: "systems",+ title: "Systems work",+ description: "Networking, storage, scheduling or concurrency",+ prompt: "Work on {the networking/storage/scheduler/concurrency part} of this project: {goal}. Write tests that exercise it and run them.",+ Icon: ServerStackIcon,+ iconClass: "text-cyan-10",+ },+] as constconst ORGANIZATION_PROMPT_TITLES = ["Organization prompt 1", "Organization prompt 2", "Organization prompt 3"]@@ -104,46 +163,22 @@ export function TaskSuggestions({ className }: TaskSuggestionsProps) {)})) : (- <>- <DescriptiveButton orientation="vertical" onClick={() => setPrompt(CSV_PROMPT)}>- <DescriptiveButtonIcon>- <DocumentChartBarIcon className="size-6 text-green-10" aria-hidden />- </DescriptiveButtonIcon>- <DescriptiveButtonContent>- <DescriptiveButtonTitle>Edit a CSV</DescriptiveButtonTitle>- <DescriptiveButtonDescription>Create a sample spreadsheet</DescriptiveButtonDescription>- </DescriptiveButtonContent>- </DescriptiveButton>-- <DescriptiveButton orientation="vertical" onClick={() => setPrompt(BROWSER_PROMPT)}>- <DescriptiveButtonIcon>- <GlobeAltIcon className="size-6 text-blue-10" aria-hidden />- </DescriptiveButtonIcon>- <DescriptiveButtonContent>- <DescriptiveButtonTitle>Browse the web</DescriptiveButtonTitle>- <DescriptiveButtonDescription>Search Craigslist for couches</DescriptiveButtonDescription>- </DescriptiveButtonContent>- </DescriptiveButton>-+ CODING_STARTER_CARDS.map((card) => (<DescriptiveButton+ key={card.id}orientation="vertical"- onClick={() =>- dispatchAction({- target: "settings",- action: "open",- section: "mcps",- })- }+ data-testid={`starter-card-${card.id}`}+ onClick={() => setPrompt(card.prompt)}><DescriptiveButtonIcon>- <CubeIcon className="size-6 text-amber-10" aria-hidden />+ <card.Icon className={cn("size-6", card.iconClass)} aria-hidden /></DescriptiveButtonIcon><DescriptiveButtonContent>- <DescriptiveButtonTitle>Connect an extension</DescriptiveButtonTitle>- <DescriptiveButtonDescription>Add MCPs and integrations</DescriptiveButtonDescription>+ <DescriptiveButtonTitle>{card.title}</DescriptiveButtonTitle>+ <DescriptiveButtonDescription>{card.description}</DescriptiveButtonDescription></DescriptiveButtonContent></DescriptiveButton>- </>+ )))}</div></div>diff --git a/apps/app/src/react-app/domains/session/chat/session-empty-hero.tsx b/apps/app/src/react-app/domains/session/chat/session-empty-hero.tsxindex f6ca7e6d..8d34b1a3 100644--- a/apps/app/src/react-app/domains/session/chat/session-empty-hero.tsx+++ b/apps/app/src/react-app/domains/session/chat/session-empty-hero.tsx@@ -3,7 +3,7 @@ import { useState } from "react";import { Zap } from "lucide-react";import type { ComposerAttachment } from "@/app/types";-import { resolveOrganizationPromptCardContent } from "@/components/chat/task-suggestions";+import { CODING_STARTER_CARDS, resolveOrganizationPromptCardContent } from "@/components/chat/task-suggestions";import { useCheckDesktopRestriction, useOrgRestrictions } from "@/react-app/domains/cloud/desktop-config-provider";import {NewTaskComposer,@@ -17,28 +17,12 @@ type HeroSuggestion = {prompt: string;};-const DEFAULT_SUGGESTIONS: HeroSuggestion[] = [- {- title: "Summarize my week",- description: "Pull highlights from email and calendar.",- prompt: "Summarize my week: pull the highlights from my connected email and calendar and give me a short digest of what happened and what needs my attention.",- },- {- title: "Clean up a spreadsheet",- description: "Drop in a CSV and describe the result you want.",- prompt: "Create a sample CSV file with 20 rows of fake customer data (name, email, company, revenue). Then show me a summary of the data.",- },- {- title: "Draft a document",- description: "Reports, emails, or briefs from a few bullet points.",- prompt: "Draft a one-page project brief. Ask me for the bullet points you need, then turn them into a clear, well-structured document.",- },- {- title: "Automate a web task",- description: "Use the built-in browser for repetitive steps.",- prompt: "Open craigslist.org in the browser and search for couches for sale. Show me the top 5 results with prices.",- },-];+/** The coding task templates (task-suggestions.tsx): filled in, never sent on their own. */+const DEFAULT_SUGGESTIONS: HeroSuggestion[] = CODING_STARTER_CARDS.map((card) => ({+ title: card.title,+ description: card.description,+ prompt: card.prompt,+}));type TimeGreeting = {title: string;