Skip to content

Commit a41fa84

Browse files
docs: address PR 119 review — Google-style sections and doc accuracy
1 parent efd50a0 commit a41fa84

7 files changed

Lines changed: 21 additions & 17 deletions

File tree

api/composers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def list_composers() -> tuple[Response, int] | Response:
126126
except Exception:
127127
_logger.exception("Failed to get composers")
128128
return json_response({"error": "Failed to get composers"}, 500)
129+
130+
129131
@bp.route("/api/composers/<composer_id>")
130132
def get_composer(composer_id: str) -> tuple[Response, int] | Response:
131133
"""Fetch one composer by ID (GET /api/composers/<composer_id>).

api/config_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ def validate_path() -> tuple[Response, int] | Response:
106106
def set_workspace() -> tuple[Response, int] | Response:
107107
"""Persist a validated workspace storage path (POST /api/set-workspace).
108108
109-
Body: ``{"path": "<workspaceStorage root>"}``. Path is canonicalized via
110-
:func:`utils.path_validation.validate_workspace_path` before storing the
111-
thread-safe module override.
109+
Args:
110+
path: Workspace storage root from JSON body ``{"path": "..."}``.
111+
Canonicalized via :func:`utils.path_validation.validate_workspace_path`
112+
before storing the thread-safe module override.
112113
113114
Returns:
114115
``{"success": true, "path": "..."}`` on success. 400 for invalid path or

api/pdf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ def _safe_text(text: str) -> str:
4949
def generate_pdf() -> tuple[Response, int] | Response:
5050
"""Render markdown chat content as a PDF download (POST /api/generate-pdf).
5151
52-
Body (optional): ``{"markdown": "...", "title": "..."}``. Missing keys
53-
default to ``""`` and ``"Chat"`` respectively.
52+
Args:
53+
markdown: Markdown source text (optional; defaults to ``""``).
54+
title: Document title (optional; defaults to ``"Chat"``).
5455
5556
Returns:
5657
``application/pdf`` attachment on success. 500 JSON error on failure.

api/search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727
def search() -> tuple[Response, int] | Response:
2828
"""Search chats, composers, and CLI sessions across Cursor storage.
2929
30-
Query params: ``q`` (required), ``type`` (``all`` | ``chat`` | ``composer``).
30+
Args:
31+
q: Search query string (required; 400 when empty).
32+
type: Filter scope — ``all`` (default), ``chat``, or ``composer``.
3133
3234
Returns:
3335
JSON ``{"results": [...]}`` with optional ``warnings``. 400 when ``q`` is
34-
empty; 500 on unexpected failure.
36+
empty; 500 with ``{"error": ..., "results": []}`` on unexpected failure.
3537
"""
3638
try:
3739
query = request.args.get("q", "").strip()

api/workspaces.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
warn_workspace_json_read,
2525
)
2626
from utils.workspace_descriptor import read_json_file
27-
from services.workspace_resolver import (
28-
infer_workspace_name_from_context,
29-
lookup_workspace_display_name,
30-
)
27+
from services.workspace_resolver import infer_workspace_name_from_context
3128
from services.cli_tabs import get_cli_workspace_tabs
3229
from services.workspace_listing import list_workspace_projects
3330
from services.workspace_tabs import (
@@ -59,7 +56,8 @@ def _request_nocache() -> bool:
5956
def list_workspaces() -> tuple[Response, int] | Response:
6057
"""List workspace projects for the sidebar (GET /api/workspaces).
6158
62-
Honors ``?nocache=1`` to bypass the summary disk cache.
59+
Args:
60+
nocache: When ``1`` or ``true``, bypass the summary disk cache.
6361
6462
Returns:
6563
JSON with ``projects`` and optional ``warnings``. 500 on failure.
@@ -171,9 +169,8 @@ def get_workspace_tabs(workspace_id: str) -> tuple[Response, int] | Response:
171169
Args:
172170
workspace_id: Storage folder name, ``global`` for unassigned chats, or
173171
``cli:<project_id>``.
174-
175-
Query params: ``summary=1`` for lightweight tab headers only; ``nocache=1`` to
176-
bypass cache on summary requests.
172+
summary: When ``1`` or ``true``, return lightweight tab headers only.
173+
nocache: When ``1`` or ``true``, bypass cache on summary requests.
177174
178175
Returns:
179176
Tabs payload from :func:`services.workspace_tabs` helpers (typically

models/cli_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def from_dict(cls, raw: dict[str, Any]) -> "CliSessionMeta":
2727
2828
Raises:
2929
SchemaError: When ``latestRootBlobId`` is missing, falsey (e.g.
30-
empty string or ``None``), or not a string.
30+
empty string or ``None``), or not a string.
3131
"""
3232
raw = require_dict(raw, model="CliSessionMeta", field="meta")
3333
latest = require_truthy(

services/summary_cache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def nocache_enabled(*, request_nocache: bool = False) -> bool:
3232
request_nocache: True when the HTTP request included ``?nocache=1``.
3333
3434
Returns:
35-
True when bypass is requested or ``CURSOR_CHAT_BROWSER_NOCACHE`` is set.
35+
True when bypass is requested or ``CURSOR_CHAT_BROWSER_NOCACHE`` is set
36+
to ``"1"``, ``"true"``, or ``"yes"`` (case-insensitive).
3637
"""
3738
if request_nocache:
3839
return True

0 commit comments

Comments
 (0)