Skip to content

cursor updates & path extraction utility#77

Merged
backnotprop merged 20 commits into
mainfrom
feat/cursor-updates
Dec 9, 2025
Merged

cursor updates & path extraction utility#77
backnotprop merged 20 commits into
mainfrom
feat/cursor-updates

Conversation

@backnotprop
Copy link
Copy Markdown
Contributor

@backnotprop backnotprop commented Dec 9, 2025

updates per cursor hooks docs

also introduced a parent path extraction utility

removal of unfinished onboard app (we will support a skill instead)

backnotprop and others added 8 commits December 8, 2025 18:33
Cursor now supports project-level hooks at `.cursor/hooks.json` in
addition to user-level hooks at `~/.cursor/hooks.json`.

Changes:
- Update CursorHarness::settings_path() to respect global parameter
- Project init creates .cursor/hooks.json (project-level)
- Global init creates ~/.cursor/hooks.json (user-level)
- Update example scripts to use project-level hooks
- Fix check_appointment_time.py to handle patient_name lookups
- Add tests for cursor init hook locations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tion

New lifecycle events (fire-and-forget):
- afterShellExecution: command, output, duration
- afterMCPExecution: tool_name, tool_input, result_json, duration
- afterAgentResponse: text
- afterAgentThought: text, duration_ms

Schema updates:
- Common fields: model, cursor_version, user_email (all optional)
- Response fields: snake_case (user_message, agent_message)
- beforeSubmitPrompt: user_message on block
- stop: loop_count input field

Stop hook agent looping:
- Block decision returns followup_message
- Cursor submits as next user message (max 5 auto-followups)
- Mirrors Claude Code's block+reason pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Cupcake to align with Cursor's latest hooks documentation and removes the incomplete cupcake-onboard application. The changes focus on implementing new Cursor event types, improving protected path detection, and correcting the hooks configuration approach.

  • Updated Cursor hooks to support project-level configuration (.cursor/hooks.json) in addition to global (~/.cursor/hooks.json)
  • Implemented new Cursor lifecycle events: afterShellExecution, afterMCPExecution, afterAgentResponse, afterAgentThought
  • Enhanced stop hook to support agent loop continuation via followup_message with automatic loop prevention
  • Added command path extraction to detect parent directories affected by shell commands, enabling better protection for paths like .cupcake/
  • Removed incomplete cupcake-onboard TUI application (to be replaced with a skill-based approach)
  • Changed PostgreSQL demo port from 5432 to 15432 to avoid conflicts

Reviewed changes

Copilot reviewed 59 out of 63 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cupcake-core/src/preprocessing/command_path_extractor.rs New module to extract target paths from shell commands for parent directory protection
cupcake-core/src/preprocessing/mod.rs Integration of path extraction with preprocessing pipeline and enriched input capture
cupcake-core/src/harness/events/cursor/*.rs Added 5 new Cursor event types with proper field definitions
cupcake-core/src/harness/response/cursor/*.rs Implemented response builders for new events using snake_case fields
docs/docs/reference/harnesses/cursor.md Comprehensive documentation update for all Cursor hooks and events
fixtures/*/builtins/protected_paths.rego Enhanced policies to protect parent directories from destructive commands
examples/cursor/0_Welcome/setup.sh Updated to create project-level hooks at .cursor/hooks.json
examples/cursor/0_Welcome/mcp_setup.sh Changed PostgreSQL port to 15432 and improved setup flow
cupcake-cli/src/harness_config.rs Fixed to properly support project vs global Cursor hooks
cupcake-onboard/* Removed entire incomplete onboarding application

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/cursor/0_Welcome/mcp_setup.sh
Comment thread cupcake-core/src/preprocessing/command_path_extractor.rs Outdated
Comment thread cupcake-core/Cargo.toml
@backnotprop backnotprop changed the title Feat/cursor updates cursor updates & path extraction utility Dec 9, 2025
@backnotprop backnotprop requested a review from captjt December 9, 2025 07:17
@backnotprop backnotprop merged commit 97cc381 into main Dec 9, 2025
3 checks passed
@backnotprop backnotprop deleted the feat/cursor-updates branch December 9, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants