@@ -57,6 +57,13 @@ def _request_nocache() -> bool:
5757
5858@bp .route ("/api/workspaces" )
5959def list_workspaces () -> tuple [Response , int ] | Response :
60+ """List workspace projects for the sidebar (GET /api/workspaces).
61+
62+ Honors ``?nocache=1`` to bypass the summary disk cache.
63+
64+ Returns:
65+ JSON with ``projects`` and optional ``warnings``. 500 on failure.
66+ """
6067 try :
6168 workspace_path = resolve_workspace_path ()
6269 rules = exclusion_rules ()
@@ -76,6 +83,15 @@ def list_workspaces() -> tuple[Response, int] | Response:
7683
7784@bp .route ("/api/workspaces/<workspace_id>" )
7885def get_workspace (workspace_id : str ) -> tuple [Response , int ] | Response :
86+ """Return metadata for one workspace, global bucket, or CLI project.
87+
88+ Args:
89+ workspace_id: Storage folder name, ``global``, or ``cli:<project_id>``.
90+
91+ Returns:
92+ Workspace JSON (id, name, path, folder, lastModified). 404 when not found;
93+ 500 on unexpected failure.
94+ """
7995 try :
8096 if workspace_id == "global" :
8197 return json_response ({
@@ -150,6 +166,17 @@ def get_workspace(workspace_id: str) -> tuple[Response, int] | Response:
150166
151167@bp .route ("/api/workspaces/<workspace_id>/tabs" )
152168def get_workspace_tabs (workspace_id : str ) -> tuple [Response , int ] | Response :
169+ """List conversation tabs for a workspace (GET /api/workspaces/<id>/tabs).
170+
171+ Args:
172+ workspace_id: Storage folder name or ``cli:<project_id>``.
173+
174+ Query params: ``summary=1`` for lightweight tab headers only; ``nocache=1`` to
175+ bypass cache on summary requests.
176+
177+ Returns:
178+ Tabs payload from :func:`services.workspace_tabs` helpers. 500 on failure.
179+ """
153180 if workspace_id .startswith ("cli:" ):
154181 try :
155182 return get_cli_workspace_tabs (workspace_id , exclusion_rules ())
@@ -176,6 +203,16 @@ def get_workspace_tabs(workspace_id: str) -> tuple[Response, int] | Response:
176203
177204@bp .route ("/api/workspaces/<workspace_id>/tabs/<composer_id>" )
178205def get_workspace_tab (workspace_id : str , composer_id : str ) -> tuple [Response , int ] | Response :
206+ """Lazy-load one conversation tab (GET /api/workspaces/<id>/tabs/<composer_id>).
207+
208+ Args:
209+ workspace_id: IDE workspace folder name (CLI workspaces return 400).
210+ composer_id: Composer UUID to load.
211+
212+ Returns:
213+ Single-tab JSON from :func:`services.workspace_tabs.assemble_single_tab`.
214+ 400 for CLI workspaces; 500 on unexpected failure.
215+ """
179216 if workspace_id .startswith ("cli:" ):
180217 return json_response ({"error" : "Per-tab lazy load is not supported for CLI workspaces" }, 400 )
181218 try :
0 commit comments