cursor

package
v0.0.0-...-3fe0b2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIServiceGeneration

type AIServiceGeneration struct {
	UnixMs          int64  `json:"unixMs"`
	GenerationUUID  string `json:"generationUUID"`
	Type            string `json:"type"`
	TextDescription string `json:"textDescription"`
	ConversationID  string `json:"conversationId,omitempty"`
	Role            string `json:"role,omitempty"`
}

AIServiceGeneration represents the richer aiService.generations data structure

type AIServicePrompt

type AIServicePrompt struct {
	Text      string    `json:"text"`
	Timestamp int64     `json:"timestamp,omitempty"`
	ID        string    `json:"id,omitempty"`
	Role      string    `json:"role,omitempty"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

AIServicePrompt represents the structure of aiService.prompts data

type ChatData

type ChatData struct {
	Tabs []ChatTab `json:"tabs"`
}

ChatData represents the complete chat data structure from Cursor

type ChatTab

type ChatTab struct {
	ID        string    `json:"id"`
	Title     string    `json:"title,omitempty"`
	Messages  []Message `json:"messages"`
	Timestamp int64     `json:"timestamp"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt,omitempty"`
}

ChatTab represents a single chat conversation in Cursor

func (*ChatTab) ExtractTechnicalConcepts

func (ct *ChatTab) ExtractTechnicalConcepts() []string

ExtractTechnicalConcepts analyzes chat content for technical terms

func (*ChatTab) GetContentPreview

func (ct *ChatTab) GetContentPreview(maxLength int) string

GetContentPreview returns a preview of the chat content

func (*ChatTab) GetDisplayTitle

func (ct *ChatTab) GetDisplayTitle() string

GetDisplayTitle returns a human-readable title for the chat tab

func (*ChatTab) ToMarkdown

func (ct *ChatTab) ToMarkdown() string

ToMarkdown converts the chat tab to markdown format

type ChatTabWithWorkspace

type ChatTabWithWorkspace struct {
	ChatTab
	WorkspacePath string `json:"workspacePath"`
	WorkspaceName string `json:"workspaceName"`
}

ChatTabWithWorkspace extends ChatTab with workspace information

type ComposerData

type ComposerData struct {
	AllComposers []ComposerEntry `json:"allComposers"`
}

ComposerData represents the structure of composer.composerData

type ComposerEntry

type ComposerEntry struct {
	Type              string    `json:"type"`
	ComposerID        string    `json:"composerId"`
	Name              string    `json:"name"` // The actual chat title!
	CreatedAt         int64     `json:"createdAt"`
	UnifiedMode       string    `json:"unifiedMode"`
	ForceMode         string    `json:"forceMode"`
	HasUnreadMessages bool      `json:"hasUnreadMessages"`
	Messages          []Message `json:"messages,omitempty"`
}

type CursorItem

type CursorItem struct {
	Key   string `gorm:"column:key;primaryKey"`
	Value string `gorm:"column:value"`
}

CursorItem represents a key-value item in Cursor's state.vscdb

func (CursorItem) TableName

func (CursorItem) TableName() string

TableName specifies the table name for CursorItem

type Message

type Message struct {
	ID        string    `json:"id,omitempty"`
	Role      string    `json:"role"` // "user" or "assistant"
	Content   string    `json:"content"`
	Timestamp int64     `json:"timestamp"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

Message represents a single message in the chat

type WorkspaceReader

type WorkspaceReader struct {
	StoragePath string
}

WorkspaceReader provides access to Cursor's workspace storage

func NewWorkspaceReader

func NewWorkspaceReader() *WorkspaceReader

NewWorkspaceReader creates a new workspace reader

func NewWorkspaceReaderWithPath

func NewWorkspaceReaderWithPath(path string) *WorkspaceReader

NewWorkspaceReaderWithPath creates a reader with custom storage path

func (*WorkspaceReader) FindWorkspaces

func (wr *WorkspaceReader) FindWorkspaces() ([]string, error)

FindWorkspaces returns all available workspace database paths

func (*WorkspaceReader) GetChatByID

func (wr *WorkspaceReader) GetChatByID(chatID string) (*ChatTab, string, error)

GetChatByID retrieves a specific chat by its ID

func (*WorkspaceReader) GetChatData

func (wr *WorkspaceReader) GetChatData(dbPath string) (*ChatData, error)

GetChatData retrieves and parses chat data from workspace

func (*WorkspaceReader) GetLatestChat

func (wr *WorkspaceReader) GetLatestChat() (*ChatTab, error)

GetLatestChat returns the most recent chat from the latest workspace

func (*WorkspaceReader) GetLatestWorkspace

func (wr *WorkspaceReader) GetLatestWorkspace() (string, error)

GetLatestWorkspace returns the most recently modified workspace

func (*WorkspaceReader) ListAllChats

func (wr *WorkspaceReader) ListAllChats() ([]ChatTabWithWorkspace, error)

ListAllChats returns all chats from all workspaces with workspace info

func (*WorkspaceReader) OpenWorkspaceDB

func (wr *WorkspaceReader) OpenWorkspaceDB(dbPath string) (*gorm.DB, error)

OpenWorkspaceDB opens a GORM connection to a workspace database

func (*WorkspaceReader) SearchChats

func (wr *WorkspaceReader) SearchChats(query string) ([]ChatTabWithWorkspace, error)

SearchChats searches for chats containing specific text

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL