@molecule/api-agent-transcript-cursor
v1.0.1
Published
Reads Cursor's "Export Chat" Markdown into a normalized agent session
Maintainers
Readme
@molecule/api-agent-transcript-cursor
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Cursor transcript reader for @molecule/api-agent-transcript.
Reads the Markdown file Cursor's "Export Chat" writes (the chat panel's
⋯ menu) into a normalized AgentSession: each **User** block is what
you typed, each **Cursor** block is the reply.
Quick Start
import { readFileSync } from 'node:fs'
import { readTranscript, setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-cursor'
setProvider(provider)
const file = 'cursor_debugging_session.md'
const session = readTranscript({ text: readFileSync(file, 'utf8'), fileName: file })
console.log(session.harnessVersion, session.turns.length)Type
provider
Installation
npm install @molecule/api-agent-transcript-cursor @molecule/api-agent-transcriptAPI
Functions
looksLikeCursorExport(text)
Whether a text is a Cursor chat export.
function looksLikeCursorExport(text: string): booleantext— The file's text.
Returns: True when its header names Cursor and a speaker marker follows.
readCursorExport(text)
Read a Cursor chat export.
function readCursorExport(text: string): AgentSessiontext— The export's text.
Returns: The normalized session.
Constants
provider
Reads Cursor's "Export Chat" Markdown.
const provider: AgentTranscriptReaderCore Interface
Implements @molecule/api-agent-transcript interface.
Bond Wiring
Setup function to register this provider with the core interface:
import { setProvider } from '@molecule/api-agent-transcript'
import { provider } from '@molecule/api-agent-transcript-cursor'
export function setupAgentTranscriptCursor(): void {
setProvider(provider)
}Injection Notes
Requirements
Peer dependencies:
@molecule/api-agent-transcript^1.0.0
Runtime Dependencies
@molecule/api-agent-transcriptThe export names no model and records no file writes — Cursor leaves tool calls out of it — so every turn's
modelis unset andfilesempty.harnessVersionis the Cursor version in the_Exported on … from Cursor (x.y.z)_line. The date on that line is in the exporting machine's locale and is not read.Only a
**User**or**Cursor**line on its own splits turns, and the---rule before each is dropped; a reply's own---rules stay.Detection needs the
# titleline followed by the_Exported on … from Cursor_line, so a hand-written chat with**User**headings is not taken for a Cursor export.Format read off real exports from Cursor 1.1.7, 2.1.46 and 2.3.41 (2026-09-29); Cursor itself is closed source.
