An open-source, faster Devin alternative
TypeScript
refactor(web): drop "v3" from entity naming (keep it only on the wire)
Igor Zalutski49b0b9c81c8c
diff --git a/web/src/api/client.ts b/web/src/api/client.tsindex 024b8185..a0d23cae 100644--- a/web/src/api/client.ts+++ b/web/src/api/client.ts@@ -351,14 +351,14 @@ export const setAutumnAutoTopup = (cfg: {export const getSandboxUsage = (days = 30) =>apiFetch(`/usage/sandboxes?days=${days}`, {}, S.SandboxUsageSchema)-// ── Durable Agent Sessions (/v3) ─────────────────────────────────────────────+// ── Durable Agent Sessions ───────────────────────────────────────────────────// A separate service (sessions-api). Reached through the OC edge under// `/api/dashboard/v3/*`, so these reuse apiFetch (cookie auth, validation, mock).// Org-key management lives server-side at the edge; live event/steer can move to// a browser-direct client-token path later without changing these signatures.// Agents — the reusable definition (prompt, model, runtime, credential).-// /v3 lists wrap rows in { data: [...] }; callers want the array.+// List endpoints wrap rows in { data: [...] }; callers want the array.export const getAgents = () =>apiFetch('/v3/agents', {}, S.AgentListSchema).then((r) => r.data)@@ -472,7 +472,7 @@ export const getSessions = (status?: string) =>export const getSession = (id: string) =>apiFetch(`/v3/sessions/${id}`, {}, S.SessionSchema)-// /v3 wants { agent: <id>, input } (input required). The response is an envelope+// The API wants { agent: <id>, input } (input required). The response is an envelope// { session, client_token } — return the session.export const createSession = (body: { agent: string; input: string },diff --git a/web/src/api/mock.ts b/web/src/api/mock.tsindex 41cca25e..1655cbac 100644--- a/web/src/api/mock.ts+++ b/web/src/api/mock.ts@@ -370,8 +370,8 @@ const orgInvitations = [},]-// ── Durable Agent Sessions (/v3) ─────────────────────────────────────────────-const v3agents = [+// ── Durable Agent Sessions ─────────────────────────────────────────────+const agents = [{id: 'agt_3kf9xz',name: 'PR Reviewer',@@ -395,7 +395,7 @@ const v3agents = []// A connected Slack app for the first agent (the AgentDetail Slack panel).-const v3slack = {+const slackConnection = {id: 'sla_5p6q7r',agent_id: 'agt_3kf9xz',handle: 'PR Reviewer',@@ -410,7 +410,7 @@ const v3slack = {}// START-intent response for the Slack connect wizard (POST …/slack/manifest).-const v3slackManifest = {+const slackManifest = {manifest: {display_information: { name: 'PR Reviewer' },features: {@@ -434,7 +434,7 @@ const v3slackManifest = {status: 'pending',}-const v3credentials = [+const credentials = [{id: 'cred_anth_1',provider: 'anthropic',@@ -453,7 +453,7 @@ const v3credentials = [},]-const v3sessions = [+const sessions = [{id: 'ses_a1b2c3',status: 'running',@@ -497,7 +497,7 @@ const v3sessions = [},]-const v3events = [+const sessionEvents = [{id: 'evt_1',seq: 1,@@ -548,7 +548,7 @@ const v3events = [},]-const v3destinations = [+const destinations = [{id: 'dst_1',url: 'https://acme.dev/hooks/oc',@@ -561,7 +561,7 @@ const v3destinations = [},]-const v3deliveries = [+const deliveries = [{id: 'dlv_1',destination: 'dst_1',@@ -652,16 +652,16 @@ const ROUTES: Array<[RegExp, Handler]> = [[/^\/org\/custom-domain$/, () => ({})],[/^\/org$/, () => org],[/^\/agents$/, () => []],- // Durable Agent Sessions (/v3) — lists return the { data: [...] } envelope.- [/^\/v3\/agents\/[^/]+\/slack$/, () => v3slack],- [/^\/v3\/agents\/[^/]+$/, () => v3agents[0]],- [/^\/v3\/agents$/, () => ({ data: v3agents })],- [/^\/v3\/credentials$/, () => ({ data: v3credentials })],- [/^\/v3\/sessions\/[^/]+\/events/, () => ({ data: v3events })],- [/^\/v3\/sessions\/[^/]+\/destinations$/, () => ({ data: v3destinations })],- [/^\/v3\/sessions\/[^/]+\/deliveries$/, () => ({ data: v3deliveries })],- [/^\/v3\/sessions\/[^/]+$/, () => v3sessions[0]],- [/^\/v3\/sessions(\?.*)?$/, () => ({ data: v3sessions, next_cursor: null })],+ // Durable Agent Sessions — lists return the { data: [...] } envelope.+ [/^\/v3\/agents\/[^/]+\/slack$/, () => slackConnection],+ [/^\/v3\/agents\/[^/]+$/, () => agents[0]],+ [/^\/v3\/agents$/, () => ({ data: agents })],+ [/^\/v3\/credentials$/, () => ({ data: credentials })],+ [/^\/v3\/sessions\/[^/]+\/events/, () => ({ data: sessionEvents })],+ [/^\/v3\/sessions\/[^/]+\/destinations$/, () => ({ data: destinations })],+ [/^\/v3\/sessions\/[^/]+\/deliveries$/, () => ({ data: deliveries })],+ [/^\/v3\/sessions\/[^/]+$/, () => sessions[0]],+ [/^\/v3\/sessions(\?.*)?$/, () => ({ data: sessions, next_cursor: null })],[/^\/webhooks\/[^/]+\/deliveries$/,() => ({ data: sandboxWebhookDeliveries }),@@ -676,8 +676,11 @@ const ROUTES: Array<[RegExp, Handler]> = [// Mutations the preview needs to echo something parseable (e.g. the Slack// wizard's POST …/slack/manifest → manifest+steps). Everything else 204-ish.const POST_ROUTES: [RegExp, () => unknown][] = [- [/^\/v3\/agents\/[^/]+\/slack\/manifest$/, () => v3slackManifest],- [/^\/v3\/agents\/[^/]+\/slack$/, () => ({ ...v3slack, status: 'active' })],+ [/^\/v3\/agents\/[^/]+\/slack\/manifest$/, () => slackManifest],+ [+ /^\/v3\/agents\/[^/]+\/slack$/,+ () => ({ ...slackConnection, status: 'active' }),+ ],]export function mockFetch<T>(path: string, options: RequestInit = {}): T {diff --git a/web/src/api/schemas.ts b/web/src/api/schemas.tsindex a10b55db..ab7e7ac4 100644--- a/web/src/api/schemas.ts+++ b/web/src/api/schemas.ts@@ -268,8 +268,8 @@ export const SandboxWebhookDeliveryListSchema = z.object({data: z.array(SandboxWebhookDeliverySchema),})-// ── Durable Agent Sessions (/v3) ─────────────────────────────────────────────-// Mirrors the sessions-api /v3 contract verbatim (snake_case as the API returns+// ── Durable Agent Sessions ───────────────────────────────────────────────────+// Mirrors the sessions-api contract verbatim (snake_case as the API returns// it) — no transform layer to keep in sync. Reached via the edge proxy; lenient// string fields so a new server enum never fails validation.@@ -284,7 +284,7 @@ export const AgentSchema = z.object({limits: record.nullish(),created_at: z.string(),})-// /v3 list endpoints wrap rows in { data: [...], next_cursor? }.+// List endpoints wrap rows in { data: [...], next_cursor? }.export const AgentListSchema = z.object({data: z.array(AgentSchema),next_cursor: z.string().nullish(),diff --git a/web/src/components/session-webhooks.tsx b/web/src/components/session-webhooks.tsxindex 14418f32..998378d8 100644--- a/web/src/components/session-webhooks.tsx+++ b/web/src/components/session-webhooks.tsx@@ -28,7 +28,7 @@ import { ConfirmDialog } from '@/components/confirm-dialog'import { cn } from '@/lib/utils'// Predefined event types a destination can subscribe to (exact + the error.*-// prefix), from the /v3 event taxonomy. Empty selection = deliver every event.+// prefix), from the event taxonomy. Empty selection = deliver every event.const EVENT_TYPES = [{ value: 'turn.completed', label: 'Turn completed' },{ value: 'turn.started', label: 'Turn started' },@@ -39,7 +39,7 @@ const EVENT_TYPES = [{ value: 'error.*', label: 'Errors' },]-// Webhooks are session-scoped in /v3 (a destination is created per session), so+// Webhooks are session-scoped (a destination is created per session), so// they live on the session detail rather than a global page.export function SessionWebhooks({ sessionId }: { sessionId: string }) {const queryClient = useQueryClient()diff --git a/web/src/pages/AgentDetail.tsx b/web/src/pages/AgentDetail.tsxindex 95c3a83f..b7a256a3 100644--- a/web/src/pages/AgentDetail.tsx+++ b/web/src/pages/AgentDetail.tsx@@ -20,7 +20,7 @@ import { ResourceTable, type Column } from '@/components/resource-table'import { Skeleton } from '@/components/ui/skeleton'import { SlackConnect } from '@/components/slack-connect'-// Mirrors the curated list in Agents.tsx (the create flow). /v3 wants a+// Mirrors the curated list in Agents.tsx (the create flow). The API wants a// provider-prefixed model id.const MODELS = [{ value: 'anthropic/claude-opus-4-8', label: 'Claude Opus 4.8' },@@ -43,7 +43,7 @@ export default function AgentDetail() {enabled: !!agentId,})- // This agent's sessions. /v3 has no per-agent filter, so scope client-side.+ // This agent's sessions. The API has no per-agent filter, so scope client-side.const { data: allSessions, isLoading: loadingSessions } = useQuery({queryKey: ['sessions'],queryFn: () => getSessions(),@@ -159,8 +159,6 @@ export default function AgentDetail() {title={agent.name}description="A reusable definition. Sessions pin a snapshot of it at create time."api={{- method: 'POST',- path: '/v3/sessions',sdk: 'oc.sessions.create()',docs: 'https://docs.opencomputer.dev/agent-sessions/sessions',}}diff --git a/web/src/pages/Agents.tsx b/web/src/pages/Agents.tsxindex 65d2506e..835ada52 100644--- a/web/src/pages/Agents.tsx+++ b/web/src/pages/Agents.tsx@@ -25,7 +25,7 @@ import { Field, Input, Select, Textarea } from '@/components/form'import { EmptyState } from '@/components/empty-state'import { ResourceTable, type Column } from '@/components/resource-table'-// Curated model list. /v3 requires a provider-prefixed id; runtime "claude" ⇒+// Curated model list. The API requires a provider-prefixed id; runtime "claude" ⇒// anthropic/… (codex/openai land when that runtime ships).const MODELS = [{ value: 'anthropic/claude-opus-4-8', label: 'Claude Opus 4.8' },@@ -192,8 +192,6 @@ export default function Agents() {title="Agents"description="Reusable definitions — a prompt, model, and runtime a session runs."api={{- method: 'POST',- path: '/v3/agents',sdk: 'oc.agents.create()',docs: 'https://docs.opencomputer.dev/agent-sessions/agents',}}diff --git a/web/src/pages/Credentials.tsx b/web/src/pages/Credentials.tsxindex 7f7a417e..4ec76b15 100644--- a/web/src/pages/Credentials.tsx+++ b/web/src/pages/Credentials.tsx@@ -265,8 +265,6 @@ export default function Credentials() {title="Credentials"description="Model-provider keys your agents run on. Pick one per agent or set an org default."api={{- method: 'POST',- path: '/v3/credentials',sdk: 'oc.credentials.create()',docs: 'https://docs.opencomputer.dev/agent-sessions/credentials',}}diff --git a/web/src/pages/SandboxWebhooks.tsx b/web/src/pages/SandboxWebhooks.tsxindex 75d9358e..47fea32d 100644--- a/web/src/pages/SandboxWebhooks.tsx+++ b/web/src/pages/SandboxWebhooks.tsx@@ -40,7 +40,7 @@ import { EmptyState } from '@/components/empty-state'import { ConfirmDialog } from '@/components/confirm-dialog'import { cn } from '@/lib/utils'-// The /v3 event taxonomy's sandbox-plane counterpart (pkg/types/webhook.go).+// The event taxonomy's sandbox-plane counterpart (pkg/types/webhook.go).// Empty selection = every event.const SANDBOX_EVENT_TYPES = [{ value: 'sandbox.created', label: 'Created' },diff --git a/web/src/pages/SessionDetail.tsx b/web/src/pages/SessionDetail.tsxindex 6bfbf97d..9440d8d2 100644--- a/web/src/pages/SessionDetail.tsx+++ b/web/src/pages/SessionDetail.tsx@@ -211,8 +211,6 @@ export default function SessionDetail() {</p>) : null}<ApiHint- method="GET"- path="/v3/sessions/:id"sdk="oc.sessions.get()"docs="https://docs.opencomputer.dev/agent-sessions/sessions"/>diff --git a/web/src/pages/Sessions.tsx b/web/src/pages/Sessions.tsxindex 165510d0..7c8b3710 100644--- a/web/src/pages/Sessions.tsx+++ b/web/src/pages/Sessions.tsx@@ -46,7 +46,11 @@ export default function Sessions() {}const startMutation = useMutation({- mutationFn: () => createSession({ agent: agentId, input: message.trim() }, crypto.randomUUID()),+ mutationFn: () =>+ createSession(+ { agent: agentId, input: message.trim() },+ crypto.randomUUID(),+ ),onSuccess: (session) => {setShowStart(false)void queryClient.invalidateQueries({ queryKey: ['sessions'] })@@ -112,8 +116,6 @@ export default function Sessions() {title="Sessions"description="Durable agent runs — an append-only event log you can steer."api={{- method: 'POST',- path: '/v3/sessions',sdk: 'oc.sessions.create()',docs: 'https://docs.opencomputer.dev/agent-sessions/sessions',}}