Add Cursor agent provider#424
Conversation
…nteractive args, env support, and exports), adds Cursor to the init agent registry/scaffolding with a dedicated Dockerfile and CURSOR_API_KEY env template, and expands tests to cover provider behavior plus scaffold output
|
@dichioniccolo is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel. A member of the Team first needs to authorize it. |
… based on permissions in buildPrintCommand and buildInteractiveArgs. Update tests to reflect changes in command construction and default model. Improve robustness of planner output parsing in templates.
|
@dichioniccolo, same as you, I’d also love to have Cursor support! I asked Cursor to review your PR (using cc: @mattpocock Review Document for PR #424 — Add Cursor Agent ProviderConstructive review. Critical + Major findings are merge-blocking ("request changes"). Minor findings are non-blocking suggestions. Findings verified against Cursor CLI Parameters and Output Format docs. Blocking findings (request changes)1. CRITICAL -- Stream parser assumes Anthropic event shapes, but Cursor's format differsFile: Problem: The Cursor provider reuses
The tool call path is the biggest concern. The test at Ask: Could you verify by running a small 2. MAJOR --
|
|
@oferRounds Really freaking useful, thank you! |
…orce, and update tests to reflect changes in prompt handling and argument limits. Introduce error handling for oversized prompts in print mode and enhance stream line parsing for tool_call events.
|
Thanks for the thorough review, it was really useful.
|
|
Amazing @dichioniccolo! All four blocking findings from the initial review have been addressed. Here's the breakdown: Previously blocking findings -- all resolved1. Stream parser format mismatch (was CRITICAL) -- ResolvedAdded a dedicated 2.
|
…l writeToolCall events and updating the buildPrintCommand test to ensure it includes the --resume flag when resumeSession is set.
|
@oferRounds I’ve implemented point 1. Regarding point 2, I’d like to clarify the preferred direction before proceeding. My initial thought was to extract the shared utility into the main package and expose it, something along the lines of: import { extractPlanIssues } from "@ai-hero/sandcastle/utils";However, I’m not entirely sure if promoting it to a public/shared utility is the right approach here, or if you’d prefer keeping it internal to the templates (or organizing it differently). What do you think is the best place for it? |
|
I've written an ADR and pushed it to main describing this. Essentially, all templates should be self-contained with no shared utilities. |
Hey Matt,
This PR brings Cursor in as a first-class provider which makes Sandcastle a lot more usable for teams that want to use Cursor instead of the current agents setup.
Summary
This PR adds a built-in
cursor()agent provider with full scaffold and runtime support.Out of the box, this gives you:
What’s in here
Provider
cursor()factory that follows the existingAgentProviderinterfaceScaffold
.env.exampleincludes clear auth setup for CursorExports
cursor()is exported from the packageRegistry
Testing
Nothing fancy here—just sticking to the patterns already in the repo and focusing on behavior over implementation details.
Happy to tweak anything if something feels off.