feat(cua-driver): cursor style customization and bare binary release artifact - #1412
Conversation
… MCP tool - AgentCursorStyle: add image (NSImage?) field for custom PNG/SVG/PDF cursors - AgentCursorStyle: default parameter values, extract defaultGradientStops, @unchecked Sendable - NSColor(hex:): convenience init for CSS hex strings (#RGB / #RRGGBB / #RRGGBBAA) - AgentCursorRenderer: public style property driven by @observable - AgentCursorView: drawCursor reads from renderer.style; image mode branch on style.image - AgentCursorView: drawFocusRect uses style.bloomColor instead of hardcoded cyan - AgentCursorConfig.Style: persist gradient_colors, bloom_color, image_path to config.json - AgentCursor.setStyle(_:): public method for Swift dep users (Clicky etc.) - AgentCursor.apply(config:): applies persisted style on daemon boot - SetAgentCursorStyleTool: new MCP tool set_agent_cursor_style - ToolRegistry: register set_agent_cursor_style - docs: swift-integration cursor customization section - docs: mcp-tools set_agent_cursor_style reference Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request adds configurable cursor styling to the CUA driver. It introduces a new MCP tool Changes
Sequence DiagramsequenceDiagram
participant Client as MCP Client
participant Tool as SetAgentCursorStyleTool
participant Config as ConfigStore
participant Cursor as AgentCursor
participant Renderer as AgentCursorRenderer
participant View as AgentCursorView
Client->>Tool: set_agent_cursor_style(gradient_colors, bloom_color, image_path)
Tool->>Config: read current style
Config-->>Tool: AgentCursorConfig.Style
Tool->>Tool: merge updates (nil = default)
Tool->>Cursor: applyStyleConfig(updated style)
Cursor->>Cursor: parse hex colors & load image
Cursor->>Renderer: setStyle(AgentCursorStyle)
Renderer->>Renderer: update observable style property
Renderer->>View: render next frame
View->>View: apply bloom color & gradient stops
View-->>Renderer: rendered frame
Tool->>Config: persist updated style
Config-->>Tool: success/failure
Tool-->>Client: result (configured fields or revert to default)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
AgentCursorStylenow acceptsstrokeGradientStops(array ofAgentCursorGradientStop) andbloomColor(NSColor) — change the arrow gradient and glow hue from Swift or via the newset_agent_cursor_styleMCP tool.NSColor(hex:)convenience initializer added for CSS hex strings.AgentCursorStyle.image: NSImage?— when set, replaces the procedural arrow with the provided image (PNG, JPEG, PDF, or SVG viaNSImage(contentsOf:)), drawn atshapeSize × shapeSizepoints and rotated to track the motion heading. Bloom halo still rendered underneath.AgentCursor.shared.setStyle(_:)— one-call style override for Swift dep users (e.g. Clicky) without going through MCP.set_agent_cursor_style—gradient_colors,bloom_color,image_pathfields, all optional. Persists to config across restarts.drawFocusRectnow readsstyle.bloomColorinstead of hardcoded cyan, so focus highlights always match the cursor's theme.AgentCursorConfig.Styleadded toconfig.jsonschema; applied on daemon boot viaapply(config:).cd-swift-cua-driver.ymlpackages the signed innercua-driverMach-O ascua-driver-*-binary.tar.gzfor third-party apps that want to embed and re-sign it under their own bundle identity (stashed locally pendingworkflowscope — see below).set_agent_cursor_style.Context
This unblocks Clicky's integration ask: they want to brand the cursor and avoid double TCC permission prompts by embedding cua-driver as a Swift dep under their own bundle identity.
Test plan
swift build --configuration releasepasses (confirmed locally — Build complete!)AgentCursorRenderer.shared.style = AgentCursorStyle(image: NSImage(...))renders custom imageAgentCursorRenderer.shared.style = AgentCursorStyle(strokeGradientStops: [...], bloomColor: ...)renders custom colorsset_agent_cursor_style '{"gradient_colors": ["#A855F7", "#6366F1"], "bloom_color": "#A855F7"}'applies and persistsset_agent_cursor_style '{"image_path": "~/cursor.png"}'loads and renders imageset_agent_cursor_style '{"gradient_colors": [], "bloom_color": "", "image_path": ""}'reverts to defaultbloomColorNote on bare binary workflow change
The
cd-swift-cua-driver.ymlchange (bare binary artifact) is stashed locally. It needsworkflowscope on the token to push. Rungh auth refresh -s workflowthengit stash pop && git pushto include it in this PR.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation