Skip to main content

Module provider

Module provider 

Source
Expand description

Implementation of toolpath-convo traits for Cursor sessions.

Cursor’s bubble store is already linear (one bubble per UI message, ordered by fullConversationHeadersOnly), so the mapping per turn is direct:

  • User bubble (type: 1) → Turn with role: User, text from bubble.text.
  • Assistant text/thinking/tool bubble (type: 2) → Turn with role: Assistant. The bubble’s text, allThinkingBlocks, and toolFormerData populate text, thinking, and a single tool_uses[0] respectively (Cursor stores at most one tool call per bubble in observed data; multi-tool turns fan out to multiple bubbles with the same requestId).

File mutations are resolved at view-build time: when a tool bubble carries edit_file_v2 with beforeContentId/afterContentId, the provider looks the content blobs up from CursorSession::content_blobs and emits a FileMutation with before, after, and a unified diff computed via toolpath_convo::unified_diff.

Provider-specific UI metadata (Cursor’s per-bubble checkpointId, requestId, richText, capability flags, the anysphere.cursor-commits checkpoint store, …) is not smuggled through the IR. The IR has no Turn.extra; round-tripping a Cursor session through ConversationView drops those fields by design. The bubble store on disk is the source of truth for anything that needs them.

Structs§

CursorConvo
Provider for Cursor sessions.

Constants§

PROVIDER_ID
The dispatch family used in path.meta.source and ConversationView.provider_id.

Functions§

session_to_view
Convert a Cursor CursorSession into the provider-agnostic ConversationView.
tool_category
Map a Cursor tool to toolpath’s category ontology. tool is the numeric id from toolFormerData.tool; name is the internal tool name. Both are needed because Anysphere has historically renamed tools while keeping ids stable and vice versa. Classify a Cursor tool into ToolCategory.