Skip to content
32 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

An issue being worked on no longer offers Bring your own agent beside the pull request doing it1---
2// How to connect a coding agent to g1t: a tab per agent. Every block on
3// the page switches together, and Starlight remembers the choice
4// (`syncKey`). The snippets live in `src/data/agents.ts`.
5import { Code, TabItem, Tabs } from '@astrojs/starlight/components';
6
7import { AGENTS, AGENTS_WITH_TOKEN } from '../data/agents';
8
9interface Props {
10 /** `token` shows each agent with a bearer token instead of signing in through the browser. */
11 variant?: 'browser' | 'token';
12}
13
14const { variant = 'browser' } = Astro.props;
15const agents = variant === 'token' ? AGENTS_WITH_TOKEN : AGENTS;
16const parts = (text: string) => text.split('`').map((part, index) => ({ part, code: index % 2 === 1 }));
17---
18
19<Tabs syncKey="agent">
20 {
21 agents.map((agent) => (
22 <TabItem label={agent.label}>
23 <Code code={agent.code} lang={agent.lang} title={agent.file ?? undefined} frame={agent.file ? 'code' : 'none'} />
24 {agent.then && (
25 <p>
26 {parts(agent.then).map(({ part, code }) => (code ? <code>{part}</code> : part))}
27 </p>
28 )}
29 </TabItem>
30 ))
31 }
32</Tabs>

This file's history is long; its oldest lines are credited to the oldest commit read.