vendor_fabric.cursor

Cursor Connector - HTTP client for Cursor Background Agent API.

This connector provides Python access to the Cursor Background Agent API for managing AI coding agents through shared extended-data connector patterns.

Usage: from vendor_fabric.cursor import CursorConnector

connector = CursorConnector(api_key="...")
agents = connector.list_agents()

agent = connector.launch_agent(
    prompt_text="Implement feature X",
    repository="org/repo",
    ref="main"
)

Reference: https://cursor.com/docs/cloud-agent/api/endpoints

Submodules

Package Contents

Classes

AgentState

Agent execution state.

Agent

Cursor Background Agent representation.

Repository

Repository available for Cursor agents.

ConversationMessage

Single message in agent conversation.

Conversation

Agent conversation history.

LaunchOptions

Options for launching a new agent.

CursorConnector

Cursor Background Agent API connector.

Functions

validate_agent_id

Validate an agent ID to prevent injection attacks.

validate_prompt_text

Validate prompt text.

validate_repository

Validate repository name.

validate_webhook_url

Validate webhook URL to prevent SSRF attacks.

sanitize_error

Sanitize error messages to prevent sensitive data leakage.

Data

API

vendor_fabric.cursor.DEFAULT_BASE_URL = 'https://api.cursor.com/v0'
vendor_fabric.cursor.DEFAULT_TIMEOUT = 60.0
vendor_fabric.cursor.MAX_PROMPT_LENGTH = 100000
vendor_fabric.cursor.MAX_REPO_LENGTH = 200
vendor_fabric.cursor.AGENT_ID_PATTERN = 'compile(...)'
vendor_fabric.cursor.BLOCKED_HOSTNAME_PATTERNS = None
exception vendor_fabric.cursor.CursorError(message: str, status_code: int | None = None)

Bases: Exception

Base exception for Cursor API errors.

Initialization

Initialize self. See help(type(self)) for accurate signature.

add_note()
class args
with_traceback()
exception vendor_fabric.cursor.CursorValidationError(message: str, status_code: int | None = None)

Bases: vendor_fabric.cursor.CursorError

Validation error for Cursor API inputs.

Initialization

Initialize self. See help(type(self)) for accurate signature.

add_note()
class args
with_traceback()
exception vendor_fabric.cursor.CursorAPIError(message: str, status_code: int | None = None)

Bases: vendor_fabric.cursor.CursorError

API error from Cursor service.

Initialization

Initialize self. See help(type(self)) for accurate signature.

add_note()
class args
with_traceback()
class vendor_fabric.cursor.AgentState

Bases: enum.StrEnum

Agent execution state.

Initialization

Initialize self. See help(type(self)) for accurate signature.

PENDING = 'pending'
RUNNING = 'running'
FINISHED = 'finished'
ERRORED = 'errored'
CANCELLED = 'cancelled'
capitalize()
casefold()
center()
count()
encode()
endswith()
expandtabs()
find()
format()
format_map()
index()
isalnum()
isalpha()
isascii()
isdecimal()
isdigit()
isidentifier()
islower()
isnumeric()
isprintable()
isspace()
istitle()
isupper()
join()
ljust()
lower()
lstrip()
partition()
removeprefix()
removesuffix()
replace()
rfind()
rindex()
rjust()
rpartition()
rsplit()
rstrip()
split()
splitlines()
startswith()
strip()
swapcase()
title()
translate()
upper()
zfill()
name()
value()
class vendor_fabric.cursor.Agent(/, **data: Any)

Bases: pydantic.BaseModel

Cursor Background Agent representation.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = 'ConfigDict(...)'
id: str = 'Field(...)'
state: vendor_fabric.cursor.AgentState = 'Field(...)'
task: str | None = 'Field(...)'
repository: str | None = 'Field(...)'
branch: str | None = 'Field(...)'
pr_number: int | None = 'Field(...)'
pr_url: str | None = 'Field(...)'
created_at: datetime.datetime | None = 'Field(...)'
updated_at: datetime.datetime | None = 'Field(...)'
model: str | None = 'Field(...)'
error: str | None = 'Field(...)'
classmethod model_fields() dict[str, pydantic.fields.FieldInfo]
classmethod model_computed_fields() dict[str, pydantic.fields.ComputedFieldInfo]
property model_extra: dict[str, Any] | None
property model_fields_set: set[str]
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
model_copy(*, update: collections.abc.Mapping[str, Any] | None = None, deep: bool = False) typing_extensions.Self
model_dump(*, mode: Literal[json, python] | str = 'python', include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) dict[str, Any]
model_dump_json(*, indent: int | None = None, ensure_ascii: bool = False, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) str
classmethod model_json_schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, schema_generator: type[pydantic.json_schema.GenerateJsonSchema] = GenerateJsonSchema, mode: pydantic.json_schema.JsonSchemaMode = 'validation', *, union_format: Literal[any_of, primitive_type_array] = 'any_of') dict[str, Any]
classmethod model_parametrized_name(params: tuple[type[Any], ...]) str
model_post_init(context: Any, /) None
classmethod model_rebuild(*, force: bool = False, raise_errors: bool = True, _parent_namespace_depth: int = 2, _types_namespace: pydantic._internal._namespace_utils.MappingNamespace | None = None) bool | None
classmethod model_validate(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
dict(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) Dict[str, Any]
json(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Callable[[Any], Any] | None = PydanticUndefined, models_as_dict: bool = PydanticUndefined, **dumps_kwargs: Any) str
classmethod parse_obj(obj: Any) typing_extensions.Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod parse_file(path: str | pathlib.Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod from_orm(obj: Any) typing_extensions.Self
classmethod construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
copy(*, include: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, exclude: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, update: Dict[str, Any] | None = None, deep: bool = False) typing_extensions.Self
classmethod schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE) Dict[str, Any]
classmethod schema_json(*, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any) str
classmethod validate(value: Any) typing_extensions.Self
classmethod update_forward_refs(**localns: Any) None
class vendor_fabric.cursor.Repository(/, **data: Any)

Bases: pydantic.BaseModel

Repository available for Cursor agents.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = 'ConfigDict(...)'
name: str = 'Field(...)'
url: str | None = 'Field(...)'
default_branch: str | None = 'Field(...)'
private: bool | None = 'Field(...)'
classmethod model_fields() dict[str, pydantic.fields.FieldInfo]
classmethod model_computed_fields() dict[str, pydantic.fields.ComputedFieldInfo]
property model_extra: dict[str, Any] | None
property model_fields_set: set[str]
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
model_copy(*, update: collections.abc.Mapping[str, Any] | None = None, deep: bool = False) typing_extensions.Self
model_dump(*, mode: Literal[json, python] | str = 'python', include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) dict[str, Any]
model_dump_json(*, indent: int | None = None, ensure_ascii: bool = False, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) str
classmethod model_json_schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, schema_generator: type[pydantic.json_schema.GenerateJsonSchema] = GenerateJsonSchema, mode: pydantic.json_schema.JsonSchemaMode = 'validation', *, union_format: Literal[any_of, primitive_type_array] = 'any_of') dict[str, Any]
classmethod model_parametrized_name(params: tuple[type[Any], ...]) str
model_post_init(context: Any, /) None
classmethod model_rebuild(*, force: bool = False, raise_errors: bool = True, _parent_namespace_depth: int = 2, _types_namespace: pydantic._internal._namespace_utils.MappingNamespace | None = None) bool | None
classmethod model_validate(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
dict(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) Dict[str, Any]
json(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Callable[[Any], Any] | None = PydanticUndefined, models_as_dict: bool = PydanticUndefined, **dumps_kwargs: Any) str
classmethod parse_obj(obj: Any) typing_extensions.Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod parse_file(path: str | pathlib.Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod from_orm(obj: Any) typing_extensions.Self
classmethod construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
copy(*, include: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, exclude: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, update: Dict[str, Any] | None = None, deep: bool = False) typing_extensions.Self
classmethod schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE) Dict[str, Any]
classmethod schema_json(*, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any) str
classmethod validate(value: Any) typing_extensions.Self
classmethod update_forward_refs(**localns: Any) None
class vendor_fabric.cursor.ConversationMessage(/, **data: Any)

Bases: pydantic.BaseModel

Single message in agent conversation.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = 'ConfigDict(...)'
role: str = 'Field(...)'
content: str = 'Field(...)'
timestamp: datetime.datetime | None = 'Field(...)'
classmethod model_fields() dict[str, pydantic.fields.FieldInfo]
classmethod model_computed_fields() dict[str, pydantic.fields.ComputedFieldInfo]
property model_extra: dict[str, Any] | None
property model_fields_set: set[str]
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
model_copy(*, update: collections.abc.Mapping[str, Any] | None = None, deep: bool = False) typing_extensions.Self
model_dump(*, mode: Literal[json, python] | str = 'python', include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) dict[str, Any]
model_dump_json(*, indent: int | None = None, ensure_ascii: bool = False, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) str
classmethod model_json_schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, schema_generator: type[pydantic.json_schema.GenerateJsonSchema] = GenerateJsonSchema, mode: pydantic.json_schema.JsonSchemaMode = 'validation', *, union_format: Literal[any_of, primitive_type_array] = 'any_of') dict[str, Any]
classmethod model_parametrized_name(params: tuple[type[Any], ...]) str
model_post_init(context: Any, /) None
classmethod model_rebuild(*, force: bool = False, raise_errors: bool = True, _parent_namespace_depth: int = 2, _types_namespace: pydantic._internal._namespace_utils.MappingNamespace | None = None) bool | None
classmethod model_validate(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
dict(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) Dict[str, Any]
json(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Callable[[Any], Any] | None = PydanticUndefined, models_as_dict: bool = PydanticUndefined, **dumps_kwargs: Any) str
classmethod parse_obj(obj: Any) typing_extensions.Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod parse_file(path: str | pathlib.Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod from_orm(obj: Any) typing_extensions.Self
classmethod construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
copy(*, include: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, exclude: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, update: Dict[str, Any] | None = None, deep: bool = False) typing_extensions.Self
classmethod schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE) Dict[str, Any]
classmethod schema_json(*, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any) str
classmethod validate(value: Any) typing_extensions.Self
classmethod update_forward_refs(**localns: Any) None
class vendor_fabric.cursor.Conversation(/, **data: Any)

Bases: pydantic.BaseModel

Agent conversation history.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config = 'ConfigDict(...)'
agent_id: str = 'Field(...)'
messages: list[vendor_fabric.cursor.ConversationMessage] = 'Field(...)'
classmethod model_fields() dict[str, pydantic.fields.FieldInfo]
classmethod model_computed_fields() dict[str, pydantic.fields.ComputedFieldInfo]
property model_extra: dict[str, Any] | None
property model_fields_set: set[str]
classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
model_copy(*, update: collections.abc.Mapping[str, Any] | None = None, deep: bool = False) typing_extensions.Self
model_dump(*, mode: Literal[json, python] | str = 'python', include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) dict[str, Any]
model_dump_json(*, indent: int | None = None, ensure_ascii: bool = False, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal[none, warn, error] = True, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, polymorphic_serialization: bool | None = None) str
classmethod model_json_schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, schema_generator: type[pydantic.json_schema.GenerateJsonSchema] = GenerateJsonSchema, mode: pydantic.json_schema.JsonSchemaMode = 'validation', *, union_format: Literal[any_of, primitive_type_array] = 'any_of') dict[str, Any]
classmethod model_parametrized_name(params: tuple[type[Any], ...]) str
model_post_init(context: Any, /) None
classmethod model_rebuild(*, force: bool = False, raise_errors: bool = True, _parent_namespace_depth: int = 2, _types_namespace: pydantic._internal._namespace_utils.MappingNamespace | None = None) bool | None
classmethod model_validate(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, from_attributes: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_json(json_data: str | bytes | bytearray, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, extra: pydantic.config.ExtraValues | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) typing_extensions.Self
dict(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) Dict[str, Any]
json(*, include: pydantic.main.IncEx | None = None, exclude: pydantic.main.IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Callable[[Any], Any] | None = PydanticUndefined, models_as_dict: bool = PydanticUndefined, **dumps_kwargs: Any) str
classmethod parse_obj(obj: Any) typing_extensions.Self
classmethod parse_raw(b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod parse_file(path: str | pathlib.Path, *, content_type: str | None = None, encoding: str = 'utf8', proto: pydantic.deprecated.parse.Protocol | None = None, allow_pickle: bool = False) typing_extensions.Self
classmethod from_orm(obj: Any) typing_extensions.Self
classmethod construct(_fields_set: set[str] | None = None, **values: Any) typing_extensions.Self
copy(*, include: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, exclude: pydantic._internal._utils.AbstractSetIntStr | pydantic._internal._utils.MappingIntStrAny | None = None, update: Dict[str, Any] | None = None, deep: bool = False) typing_extensions.Self
classmethod schema(by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE) Dict[str, Any]
classmethod schema_json(*, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE, **dumps_kwargs: Any) str
classmethod validate(value: Any) typing_extensions.Self
classmethod update_forward_refs(**localns: Any) None
class vendor_fabric.cursor.LaunchOptions

Options for launching a new agent.

prompt_text: str = None
repository: str = None
ref: str | None = None
images: list[dict[str, Any]] | None = None
auto_create_pr: bool = True
branch_name: str | None = None
open_as_cursor_github_app: bool = True
skip_reviewer_request: bool = False
webhook_url: str | None = None
webhook_secret: str | None = None
vendor_fabric.cursor.validate_agent_id(agent_id: str) None

Validate an agent ID to prevent injection attacks.

Args: agent_id: The agent ID to validate.

Raises: CursorValidationError: If the agent ID is invalid.

vendor_fabric.cursor.validate_prompt_text(text: str) None

Validate prompt text.

Args: text: The prompt text to validate.

Raises: CursorValidationError: If the prompt is invalid.

vendor_fabric.cursor.validate_repository(repository: str) None

Validate repository name.

Args: repository: The repository name to validate.

Raises: CursorValidationError: If the repository is invalid.

vendor_fabric.cursor.validate_webhook_url(url: str) None

Validate webhook URL to prevent SSRF attacks.

Only allows HTTPS URLs to external hosts.

Args: url: The webhook URL to validate.

Raises: CursorValidationError: If the URL is invalid or potentially dangerous.

vendor_fabric.cursor.sanitize_error(error: Any, *, values: collections.abc.Iterable[Any] | None = None) str

Sanitize error messages to prevent sensitive data leakage.

Args: error: The error to sanitize. values: Explicit caller-provided values that must not appear in diagnostics.

Returns: Sanitized error message string.

class vendor_fabric.cursor.CursorConnector(api_key: str | None = None, base_url: str | None = None, timeout: float = DEFAULT_TIMEOUT, logger: extended_data.logging.Logging | None = None, **kwargs: Any)

Bases: vendor_fabric.base.ConnectorBase

Cursor Background Agent API connector.

Provides HTTP client access to Cursor’s agent management API for spawning, monitoring, and coordinating AI coding agents.

Args: api_key: Cursor API key. Defaults to CURSOR_API_KEY env var. base_url: API base URL. Only override for testing. timeout: Request timeout in seconds. Default 60s. logger: Optional logger instance. **kwargs: Additional InputProvider arguments.

Example: >>> connector = CursorConnector() >>> agents = connector.list_agents() >>> for agent in agents: … print(f”{agent.id}: {agent.state}”)

Initialization

Initialize the connector.

Args: api_key: API key (overrides environment variable) base_url: Base URL (overrides class default) timeout: HTTP timeout in seconds logger: Logger instance **kwargs: Passed to InputProvider

API_KEY_ENV = 'CURSOR_API_KEY'
BASE_URL = None
static is_available() bool

Check if API key is available.

Returns: True if CURSOR_API_KEY is set in environment.

list_agents() extended_data.containers.ExtendedList[extended_data.containers.ExtendedDict]

List all agents.

Returns: List of agent payload dictionaries.

Raises: CursorAPIError: If the API request fails.

get_agent_status(agent_id: str) extended_data.containers.ExtendedDict

Get status of a specific agent.

Args: agent_id: The agent identifier.

Returns: Agent payload dictionary with current status.

Raises: CursorValidationError: If agent_id is invalid. CursorAPIError: If the API request fails or returns empty response.

get_agent_conversation(agent_id: str) extended_data.containers.ExtendedDict

Get conversation history for an agent.

Args: agent_id: The agent identifier.

Returns: Conversation payload dictionary with message history.

Raises: CursorValidationError: If agent_id is invalid. CursorAPIError: If the API request fails.

launch_agent(prompt_text: str, repository: str, ref: str | None = None, images: list[dict[str, Any]] | None = None, auto_create_pr: bool = True, branch_name: str | None = None, open_as_cursor_github_app: bool = True, skip_reviewer_request: bool = False, webhook_url: str | None = None, webhook_secret: str | None = None) extended_data.containers.ExtendedDict

Launch a new agent.

Args: prompt_text: The task description for the agent. repository: Repository name (owner/repo) or URL. ref: Git ref (branch/tag/commit). Defaults to default branch. images: Optional list of images with data and dimensions. auto_create_pr: Whether to automatically create a PR. branch_name: Custom branch name for the PR. open_as_cursor_github_app: Open PR as Cursor GitHub App. skip_reviewer_request: Skip reviewer request on PR. webhook_url: Webhook URL for status updates. webhook_secret: Webhook secret for signature verification.

Returns: The launched agent payload dictionary.

Raises: CursorValidationError: If inputs are invalid. CursorAPIError: If the API request fails.

add_followup(agent_id: str, prompt_text: str) None

Send a follow-up message to an agent.

Args: agent_id: The agent identifier. prompt_text: The follow-up message text.

Raises: CursorValidationError: If inputs are invalid. CursorAPIError: If the API request fails.

list_repositories() extended_data.containers.ExtendedList[extended_data.containers.ExtendedDict]

List available repositories.

Returns: List of repository payload dictionaries.

Raises: CursorAPIError: If the API request fails.

list_models() extended_data.containers.ExtendedList[extended_data.containers.ExtendedString]

List available models.

Returns: List of model names.

Raises: CursorAPIError: If the API request fails.

CONNECTOR_CATEGORY: ClassVar[str] = 'external'
CONNECTOR_CAPABILITIES: ClassVar[tuple[str, ...]] = ()
TIMEOUT: ClassVar[float] = 300.0
MIN_REQUEST_INTERVAL: ClassVar[float] = 0.0
MAX_RETRIES: ClassVar[int] = 5
property api_key: str
property client: httpx.Client
close() None
request(method: str, endpoint: str, *, headers: dict[str, str] | None = None, **kwargs: Any) httpx.Response
decode_response(response: httpx.Response, *, suffix: str | None = None, as_extended: bool = True) Any
decode_response_file(response: httpx.Response, *, source: str | None = None, suffix: str | None = None, as_extended: bool = True, metadata: collections.abc.Mapping[str, Any] | None = None) extended_data.io.DataFile
extend_result(value: Any) Any
request_data(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
request_data_file(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.io.DataFile
request_workflow(method: str, endpoint: str, *, headers: dict[str, str] | None = None, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
get(endpoint: str, **kwargs: Any) httpx.Response
get_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
get_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
post(endpoint: str, **kwargs: Any) httpx.Response
post_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
post_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
put(endpoint: str, **kwargs: Any) httpx.Response
put_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
put_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
delete(endpoint: str, **kwargs: Any) httpx.Response
delete_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
delete_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
patch(endpoint: str, **kwargs: Any) httpx.Response
patch_data(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) Any
patch_workflow(endpoint: str, *, suffix: str | None = None, as_extended: bool = True, **kwargs: Any) extended_data.workflows.DataWorkflow
download(url: str, output_path: str) int
vendor_capabilities: ClassVar[dict[str, vendor_fabric.capabilities.CapabilitySpec]] = None
vendor_capability_methods: ClassVar[dict[str, str]] = None
get_input(k: str, default: Any | None = None, required: bool = False, is_bool: bool = False, is_integer: bool = False, is_float: bool = False, is_path: bool = False, is_datetime: bool = False, as_extended: bool = False) Any
decode_input(k: str, default: Any | None = None, required: bool = False, decode_from_json: bool = False, decode_from_yaml: bool = False, decode_from_base64: bool = False, allow_none: bool = True, as_extended: bool = False) Any
freeze_inputs() extended_data.containers.mappings.ExtendedDict
thaw_inputs() extended_data.containers.mappings.ExtendedDict
snapshot_inputs(*, frozen: bool = False) extended_data.containers.mappings.ExtendedDict
replace_inputs(new_inputs: collections.abc.Mapping[str, Any] | None, *, clear_frozen: bool = True) extended_data.containers.mappings.ExtendedDict
merge_inputs(new_inputs: collections.abc.Mapping[str, Any] | None) extended_data.containers.mappings.ExtendedDict
shift_inputs() extended_data.containers.mappings.ExtendedDict