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
7 changes: 7 additions & 0 deletions web/src/components/HarnessIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function HarnessMark({ harness, px }: { harness: Harness; px: number }) {
return mark.dark === mark.light ? img(mark.dark) : <>{img(mark.light, 'dark:hidden')}{img(mark.dark, 'hidden dark:block')}</>
}

/** An agent's own mark, sized by className, for drawing a step that runs that agent. */
export function HarnessGlyph({ harness, className }: { harness: Harness; className?: string }) {
const mark = MARK[harness]
const img = (name: string, cls = '') => <img src={`/harness/${name}.svg`} alt="" aria-hidden draggable={false} className={cn(className, cls)} />
return mark.dark === mark.light ? img(mark.dark) : <>{img(mark.light, 'dark:hidden')}{img(mark.dark, 'hidden dark:block')}</>
}

export function HarnessLabel({ harness }: { harness: Harness }) {
return (
<span className="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap font-medium">
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/GalleryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ const GEM = 'data:image/svg+xml;base64,' + btoa('<svg xmlns="http://www.w3.org/2
const sample = (type: string, body: Record<string, unknown>) => ({ id: 'icon-' + JSON.stringify(body), type, status: 'completed', body, parentItemId: null }) as unknown as Item
const ICON_SAMPLES: [string, Item][] = [
['python3 · pip · uv', sample('command', { command: 'python3 x.py' })],
['claude', sample('command', { command: 'claude -p hi' })],
['codex', sample('command', { command: 'codex review' })],
['git', sample('command', { command: 'git status' })],
['gh', sample('command', { command: 'gh pr view' })],
['go', sample('command', { command: 'go test ./...' })],
Expand Down
4 changes: 3 additions & 1 deletion web/src/session/toolIcons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('program', () => {

describe('toolIcon', () => {
it('draws a command by its program, and a terminal for the rest', () => {
expect(['python3.12 x.py', 'uv run t', 'git diff', 'gh pr view', 'rg -n foo | head', 'kubectl get pods', 'cat x', 'find . -name y', 'until gh pr checks 35; do sleep 5; done', 'make'].map((c) => toolIcon(command(c))?.key)).toEqual([
expect(['python3.12 x.py', 'uv run t', 'git diff', 'gh pr view', 'rg -n foo | head', 'kubectl get pods', 'cat x', 'find . -name y', 'until gh pr checks 35; do sleep 5; done', 'timeout 900 codex review --base main', 'claude -p hi', 'make'].map((c) => toolIcon(command(c))?.key)).toEqual([
'python',
'python',
'git',
Expand All @@ -26,6 +26,8 @@ describe('toolIcon', () => {
'read',
'find',
'wait',
'codex',
'claude',
'terminal',
])
})
Expand Down
5 changes: 5 additions & 0 deletions web/src/session/toolIcons.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ComponentType } from 'react'
import { Clock, Container, Eye, FilePen, FolderSearch, Globe, Package, SquareTerminal, TextSearch, Wrench } from 'lucide-react'
import { siGit, siGithub, siGo, siPython } from 'simple-icons'
import { HarnessGlyph } from '../components/HarnessIcon'
import type { Item } from '../outpost/sessions'

export type IconComponent = ComponentType<{ className?: string }>
Expand All @@ -17,6 +18,8 @@ const brand = (si: { title: string; path: string }): IconComponent =>
)
}

const Claude: IconComponent = ({ className }) => <HarnessGlyph harness="claude" className={className} />
const Codex: IconComponent = ({ className }) => <HarnessGlyph harness="codex" className={className} />
const Python = brand(siPython)
const Git = brand(siGit)
const GitHub = brand(siGithub)
Expand All @@ -29,6 +32,8 @@ const WEB: ToolIcon = { key: 'globe', Icon: Globe }
// What a command is, by the program it runs. Anything not listed is a terminal.
const PROGRAMS: [RegExp, ToolIcon][] = [
[/^(python\d*(\.\d+)?|pip\d*|uv|uvx|pytest|poetry)$/, { key: 'python', Icon: Python }],
[/^claude$/, { key: 'claude', Icon: Claude }],
[/^codex$/, { key: 'codex', Icon: Codex }],
[/^git$/, { key: 'git', Icon: Git }],
[/^gh$/, { key: 'github', Icon: GitHub }],
[/^(grep|egrep|fgrep|rg|ag|sed|awk)$/, SEARCH],
Expand Down
Loading