refactor: split lib/api.ts god module into domain files #1148
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/agent-hooks#1148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As a developer, I want the API client split into focused domain modules, so that files are navigable and changes don't conflict across unrelated areas.
Context
apps/web/src/lib/api.tsis 2419 lines — the largest file in the codebase. It handles agents, tasks, flows, settings, auth, webhooks, and more in a single flat file.Acceptance criteria
Refactor
api.ts(agents, tasks, flows, settings, auth, webhooks, stats, repos)apps/web/src/lib/api/subdirectory (e.g.api/agents.ts,api/tasks.ts,api/flows.ts, etc.)apps/web/src/lib/api/index.tsso existing imports (import { ... } from "@/lib/api") continue to work unchangedlib/api/just qapasses (typecheck + lint)Tests
Out of scope