Documentation
¶
Overview ¶
Package cursor runs the Cursor Agent CLI (cursor-agent) as an agent.Backend: a model call loop over a directory, in Cursor's read-only ask mode with its sandbox enabled, whose final message is a JSON document.
cursor-agent has no structured output: the output schema travels in the prompt, and the generate-and-repair loop validates whatever comes back and sends the findings back as a repair. Its read-only guarantees are weaker than the other CLI backends'; ARCHITECTURE.md and SECURITY.md say what is and is not enforced.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// Binary is the executable. Empty looks up cursor-agent on PATH, then
// agent, which is used only when its help says it is the Cursor Agent.
Binary, Model string
// Env are the user's agent variables (agent.WithUserEnv).
Env []string
// contains filtered or unexported fields
}
Backend runs the Cursor Agent CLI over a request's directory, under the user's own Cursor login. It has a single, local profile: the process gets an allowlisted copy of the environment (agent.LocalEnvironment, plus CURSOR_CONFIG_DIR, CURSOR_DATA_DIR and AGENT_CLI_CREDENTIAL_STORE), never a Cursor API key, and a request that names an Endpoint is refused.
The child runs in its own process group, so a terminal's Ctrl-C (SIGINT) does not reach it. A local caller must cancel the context it passes to Run on SIGINT and SIGTERM, for example with signal.NotifyContext, or the CLI keeps running after baum exits. Cancelling kills the group on Unix, and on Windows only the child itself.
func (*Backend) Check ¶
Check resolves the executable and checks that it is the Cursor Agent and lists every option a run passes, as the first Run does, and returns the installed version. A host calls it before assembling anything, so a missing or incompatible installation fails at once instead of as a provider failure retried by the loop. It does not check the login or call a model.