import { apiRequest } from './common.ts' export interface Project { id: string title: string workspaceId: string createdAt: string updatedAt: string deletedAt: string | null } export interface CreateProjectPayload { title: string } /** * List projects in the workspace * @param options - Options object * @param options.limit - Max number of projects to return (default: 10) */ export async function listProjects(options?: { limit?: number }): Promise[]> { const projects = await apiRequest('/project') const limit = options?.limit ?? 10 return projects.slice(0, limit).map(p => ({ id: p.id, title: p.title, workspaceId: p.workspaceId, })) } /** * Create a new project in the workspace */ export async function createProject(payload: CreateProjectPayload): Promise { return apiRequest('/project', { method: 'POST', body: JSON.stringify(payload), }) }