Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions apps/agent/entrypoints/newtab/index/SearchSuggestions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { useCombobox } from 'downshift'
import { Bot, Search, Sparkles } from 'lucide-react'
import { Search, Sparkles } from 'lucide-react'
import { motion } from 'motion/react'
import type { FC } from 'react'
import { cn } from '@/lib/utils'
Expand Down Expand Up @@ -64,14 +64,8 @@ const SuggestionItemRenderer: FC<{
case 'browseros':
return (
<li className={baseClassName} {...getItemProps({ item, index })}>
{item.mode === 'chat' ? (
<Sparkles className="h-4 w-4 text-muted-foreground" />
) : (
<Bot className="h-4 w-4 text-muted-foreground" />
)}
<span className="font-semibold">
{item.mode === 'chat' ? 'Ask BrowserOS:' : 'Run Agent:'}
</span>
<Sparkles className="h-4 w-4 text-muted-foreground" />
<span className="font-semibold">Ask BrowserOS:</span>
{item.message || 'Type a message...'}
</li>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ export const useBrowserOSSuggestions = ({
}): BrowserOSSuggestion[] => {
return [
{
mode: 'chat',
mode: 'agent',
message: query,
},
// TODO: Temporarily removed agent mode on search suggestions
// {
// mode: 'agent',
// message: query,
// },
]
}
73 changes: 13 additions & 60 deletions apps/agent/entrypoints/onboarding/steps/StepThree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,29 @@ import { ArrowRight, Sparkles, Zap } from 'lucide-react'
import type { FC } from 'react'
import { NavLink } from 'react-router'
import { Button } from '@/components/ui/button'
import { openSidePanel } from '@/lib/browseros/toggleSidePanel'
import { openSidePanelWithSearch } from '@/lib/messaging/sidepanel/openSidepanelWithSearch'
import { type StepDirection, StepTransition } from './StepTransition'

interface StepThreeProps {
direction: StepDirection
}

type ExampleMode = 'chat-mode' | 'agent-mode'

const runExample = async ({
url,
mode,
query,
}: {
url: string
mode: ExampleMode
query: string
}) => {
try {
const newTab = await chrome.tabs.create({
url,
active: true,
})
if (!newTab.id) {
return
}

await new Promise((resolve) => setTimeout(resolve, 1500))

const isChatMode = mode === 'chat-mode'

// TODO: Setup a typesafe messaging system
await chrome.runtime.sendMessage({
type: 'NEWTAB_EXECUTE_QUERY',
tabId: newTab.id,
query: query,
chatMode: isChatMode,
metadata: {
source: 'onboarding',
executionMode: 'dynamic',
},
})

await openSidePanel(newTab.id)

await new Promise((resolve) => setTimeout(resolve, 1500))

return
} catch (error) {
// TODO: Record error to error recording service
// biome-ignore lint/suspicious/noConsole: error recording service not setup yet
console.error('Error running example:', error)
return
}
}

export const StepThree: FC<StepThreeProps> = ({ direction }) => {
const runChatModeExample = () => {
runExample({
url: 'https://news.google.com',
mode: 'chat-mode',
query: "summarize today's news",
const runChatModeExample = async () => {
await chrome.tabs.create({ url: 'https://news.google.com', active: true })
await new Promise((resolve) => setTimeout(resolve, 1500))
openSidePanelWithSearch('open', {
query: 'Summarize this page',
mode: 'chat',
})
}

const runAgentModeExample = () => {
runExample({
url: 'chrome://newtab/',
mode: 'agent-mode',
const runAgentModeExample = async () => {
await chrome.tabs.create({ url: 'about:blank', active: true })
await new Promise((resolve) => setTimeout(resolve, 500))
openSidePanelWithSearch('open', {
query: 'Navigate to amazon.com and order tide pods',
mode: 'agent',
})
}

Expand Down Expand Up @@ -113,7 +66,7 @@ export const StepThree: FC<StepThreeProps> = ({ direction }) => {
</p>
<div className="rounded-md border border-border/50 bg-background/60 p-2.5">
<code className="font-mono text-foreground text-xs">
&quot;summarize today&apos;s news&quot;
&quot;Summarize this page&quot;
</code>
</div>
</div>
Expand Down
21 changes: 15 additions & 6 deletions packages/agent-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,29 @@
"typecheck": "tsc --noEmit",
"prepublishOnly": "bun run build"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.ts",
"module": "./src/index.ts",
"types": "./src/index.ts",
"files": [
"dist"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./api.json": "./dist/api.json"
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./api.json": "./dist/api.json"
}
},
"dependencies": {
"eventsource-parser": "^3.0.6",
"zod-to-json-schema": "^3.24.1"
Expand Down
Loading