{"_id":"cursor-agent","_rev":"3-c9fa3f61fca1899415ddfef6a7de227a","name":"cursor-agent","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"cursor-agent","version":"1.0.0","keywords":["cursor","ai","agent","task","sequence"],"author":{"name":"Jacky"},"license":"MIT","_id":"cursor-agent@1.0.0","maintainers":[{"name":"zalab-inc","email":"zalabinc@gmail.com"}],"dist":{"shasum":"7dbcd2c211cded0e725ed975146eea862424e338","tarball":"https://registry.npmjs.org/cursor-agent/-/cursor-agent-1.0.0.tgz","fileCount":4,"integrity":"sha512-2htqo42Cv/DFjlwOSVQBrd0/hT+1AX1qv1lG5IHbKt9zw7dFi+0ot82RlULhOGvIEu2kvW8vq73nJSCukU5keQ==","signatures":[{"sig":"MEUCIQDeKCwvNHTOgqo33chRLGaFU6EEjHHWEmy+3VLIq7f+wQIgXqe82z8D0ruez7Th+TEzojt7GeJ8kGrhDcO17yzHqgw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28266},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"8b3c5c647ce8b04fa7132d774b932dce947396f0","scripts":{"test":"jest","build":"tsc","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"zalab-inc","email":"zalabinc@gmail.com"},"_npmVersion":"10.5.2","description":"Task sequence creator for Cursor AI agents","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cursor-agent":"github:zalab-inc/cursor_agent"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cursor-agent_1.0.0_1736526874179_0.6122801307894397","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"cursor-agent","version":"1.0.1","keywords":["cursor","ai","agent","task","sequence"],"author":{"name":"Jacky"},"license":"MIT","_id":"cursor-agent@1.0.1","maintainers":[{"name":"zalab-inc","email":"zalabinc@gmail.com"}],"dist":{"shasum":"cb8f614bc6852b97cc8f5f427076f9204bf85a41","tarball":"https://registry.npmjs.org/cursor-agent/-/cursor-agent-1.0.1.tgz","fileCount":4,"integrity":"sha512-knli27ohiCvzyiSmrV1F2ld3butZOiGr9DEfqvjwoZrrBUNytawqwqN2G35nrN37f/+8hR7dkvqSH44lBaMDQg==","signatures":[{"sig":"MEQCIDE/roGcVgl6BCupKVWLX8emDWbt4WGsdQ91feUkVbHxAiAaGMFXn4sfjkYGDNaU378XMAYXjfRm1l3tq6R4ZnH/6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28659},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6088721b5833a3313a0793f8909a22d28d8c1575","scripts":{"test":"jest","build":"tsc","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"zalab-inc","email":"zalabinc@gmail.com"},"_npmVersion":"10.5.2","description":"Task sequence creator for Cursor AI agents","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cursor-agent":"github:zalab-inc/cursor_agent"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cursor-agent_1.0.1_1736527026006_0.9780655755222352","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"cursor-agent","version":"1.0.2","keywords":["cursor","ai","agent","task","sequence"],"author":{"name":"Jacky"},"license":"MIT","_id":"cursor-agent@1.0.2","maintainers":[{"name":"zalab-inc","email":"zalabinc@gmail.com"}],"dist":{"shasum":"ffa0e37b58b0b881a58c3d17b1b29d4ef14e1352","tarball":"https://registry.npmjs.org/cursor-agent/-/cursor-agent-1.0.2.tgz","fileCount":4,"integrity":"sha512-aLR4t1Oi5SUdbf7Id3aXPVWDC1F8bvpKv/tojzQXNMG/oi6Lrs9INKTJkZsgzfBug+DAGu2A7H+TppbAZYixNA==","signatures":[{"sig":"MEQCIAchW6XGlcrHn+JayMviKocV66XodhmddrQVG+BaIRZXAiA1s5+7bvlz6GVwP0KNcl29cfGNuyi1XYJptbs6D2IPPA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28776},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"dea37dbeef7a861e84bd371f892c9ef7adcf0208","scripts":{"test":"jest","build":"tsc","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"zalab-inc","email":"zalabinc@gmail.com"},"_npmVersion":"10.5.2","description":"Task sequence creator for Cursor AI agents","directories":{},"_nodeVersion":"22.12.0","dependencies":{"cursor-agent":"github:zalab-inc/cursor_agent"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cursor-agent_1.0.2_1736532589456_0.9844130779309543","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"cursor-agent","version":"1.0.3","description":"Task sequence creator for Cursor AI agents","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","prepublishOnly":"pnpm run build && pnpm test","prepare":"pnpm run build"},"keywords":["cursor","ai","agent","task","sequence"],"author":{"name":"Jacky"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/zalab-inc/cursor_agent.git"},"bugs":{"url":"https://github.com/zalab-inc/cursor_agent/issues"},"homepage":"https://github.com/zalab-inc/cursor_agent#readme","devDependencies":{"@types/jest":"^29.5.14","@types/node":"^20.0.0","jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0"},"peerDependencies":{"typescript":">=4.0.0"},"_id":"cursor-agent@1.0.3","gitHead":"7b60dbd1b64b9f2c956d2e8205b6f7ce68231903","_nodeVersion":"22.12.0","_npmVersion":"10.5.2","dist":{"integrity":"sha512-t+oFBD1CCfMgvW1uLQJMe7L4NJa8GSOf0XTG1vTa00QQspLJyrGhsrhNWxoez14Ba3LhFIECmsduOjL3sFdg0w==","shasum":"7be49c8014bcce1eb4e7193ce5d37af45008ca7a","tarball":"https://registry.npmjs.org/cursor-agent/-/cursor-agent-1.0.3.tgz","fileCount":7,"unpackedSize":35270,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzfrYowUEH8fS68VRcFZrV227a8wfWMLtyhJRNMkDDwAiAwWvdY/CC2FEPmX1xxw+ROmKKeYN8lBIDU0OIWNTMuIw=="}]},"_npmUser":{"name":"zalab-inc","email":"zalabinc@gmail.com"},"directories":{},"maintainers":[{"name":"zalab-inc","email":"zalabinc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cursor-agent_1.0.3_1736536625753_0.04453036706740243"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-10T16:34:34.178Z","modified":"2025-01-10T19:17:06.125Z","1.0.0":"2025-01-10T16:34:34.438Z","1.0.1":"2025-01-10T16:37:06.197Z","1.0.2":"2025-01-10T18:09:49.649Z","1.0.3":"2025-01-10T19:17:05.927Z"},"author":{"name":"Jacky"},"license":"MIT","keywords":["cursor","ai","agent","task","sequence"],"description":"Task sequence creator for Cursor AI agents","maintainers":[{"name":"zalab-inc","email":"zalabinc@gmail.com"}],"readme":"# Cursor Agent\r\n## 🎯 Precision-Engineered AI Workflows\r\n\r\nA TypeScript library for creating structured task sequences for Cursor AI agents. This library provides type-safe builders for creating complex task sequences that can be used with Cursor AI.\r\n\r\n> **Key Advantage**: This package closely mirrors the internal methods used by Cursor AI's system behind the scenes. By utilizing the same task structures and patterns that Cursor AI uses internally (see internal tool structure and detailed documentation), your task sequences will generate highly effective and optimized prompts that align perfectly with Cursor AI's capabilities.\r\n\r\n## 🎥 Quick Demo\r\n\r\n[![Cursor Agent Demo](https://img.youtube.com/vi/-8CYVtsvBkg/0.jpg)](https://www.youtube.com/watch?v=-8CYVtsvBkg)\r\n\r\n![Cursor Agent Demo](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/cursor-agent.gif)\r\n\r\n## Installation\r\n\r\nUsing pnpm:\r\n```bash\r\npnpm add cursor-agent\r\n```\r\n\r\nUsing npm:\r\n```bash\r\nnpm install cursor-agent\r\n```\r\n\r\nUsing yarn:\r\n```bash\r\nyarn add cursor-agent\r\n```\r\n\r\n## Getting Started\r\n\r\n1. Create a task file (e.g., `my-task.ts`):\r\n```typescript\r\nimport type { TaskSequence } from 'cursor-agent';\r\n\r\nexport const task: TaskSequence = {\r\n  tasks: [\r\n    {\r\n      name: \"codebase_search\",\r\n      parameters: {\r\n        query: \"Find React components\",\r\n        explanation: \"Looking for React components in the codebase\",\r\n        target_directories: [\"src/components\"]\r\n      },\r\n      subtasks: [\r\n        {\r\n          name: \"edit_file\",\r\n          parameters: {\r\n            target_file: \"docs/components.md\",\r\n            instructions: \"Document the components\",\r\n            code_edit: \"# Components Documentation\",\r\n            blocking: true\r\n          }\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n};\r\n```\r\n\r\n2. Use with Cursor Composer:\r\n   - Open Cursor IDE\r\n   - Open the Composer (Cmd/Ctrl + Shift + P)\r\n   - Make sure you're in \"Agent\" mode\r\n   - Attach your task file to the conversation\r\n   - Write a simple prompt like: \"please do this @my-task.ts\"\r\n\r\nExample prompts:\r\n```\r\nPlease execute this task @my-task.ts\r\nCan you run this task sequence @my-task.ts\r\nExecute the documentation task @my-task.ts\r\n```\r\n\r\nThe Cursor AI agent will read your task sequence and execute each task in order, including any subtasks.\r\n\r\n## Visual Guide\r\n\r\n### 1. Create Task File\r\nCreate a new TypeScript file with your task sequence:\r\n```\r\nmy-project/\r\n├── src/\r\n└── tasks/\r\n    └── my-task.ts  <- Create your task here\r\n```\r\n\r\n### 2. Visual Examples\r\n![Example 1](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image.png)\r\n  \r\n### 3. Open Cursor Composer\r\nUse Cmd/Ctrl + Shift + B to open the Composer\r\n![Example 2](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image1.png)\r\n\r\n### 4. Switch to Agent Mode\r\nMake sure \"Agent\" mode is selected\r\n![Example 2](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image2.png)\r\n\r\n### 5. Attach Task File\r\n![Example 2](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image3.png)\r\nClick the attachment icon or drag and drop your task file\r\n\r\n### 6. Execute Task\r\n![Example 2](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image4.png)\r\nType your prompt: \"please do this @my-task.ts\"\r\n\r\n\r\n### 7. Done!, Iterate or attach another task\r\n![Example 2](https://raw.githubusercontent.com/zalab-inc/cursor_agent/main/screenshot/image5.png)\r\n\r\n\r\n## Usage\r\n\r\n### Basic Example\r\n\r\n```typescript\r\nimport { \r\n  createCodebaseSearchTask,\r\n  createEditFileTask,\r\n  TaskSequence \r\n} from 'cursor-agent';\r\n\r\n// Create a simple task sequence\r\nconst task: TaskSequence = {\r\n  tasks: [\r\n    createCodebaseSearchTask({\r\n      query: \"Find components\",\r\n      explanation: \"Search for React components\",\r\n      target_directories: [\"src/components\"]\r\n    })\r\n  ]\r\n};\r\n```\r\n\r\n### Task with Subtasks\r\n\r\n```typescript\r\nimport { \r\n  createCodebaseSearchTask,\r\n  createEditFileTask,\r\n  createGrepSearchTask,\r\n  createParallelApplyTask \r\n} from 'cursor-agent';\r\n\r\n// Create a task with subtasks\r\nconst documentationTask = createCodebaseSearchTask(\r\n  {\r\n    query: \"Find NextJS project structure\",\r\n    explanation: \"Identify core components\",\r\n    target_directories: [\"src\", \"app\", \"components\"]\r\n  },\r\n  [\r\n    createEditFileTask({\r\n      target_file: \"docs/architecture.mdx\",\r\n      instructions: \"Create architecture documentation\",\r\n      code_edit: \"# Project Architecture\\n## Components\",\r\n      blocking: true\r\n    })\r\n  ]\r\n);\r\n```\r\n\r\n### Complex Task Sequence\r\n\r\n```typescript\r\nimport { \r\n  createListDirTask,\r\n  createReadFileTask,\r\n  createGrepSearchTask,\r\n  createParallelApplyTask,\r\n  TaskSequence \r\n} from 'cursor-agent';\r\n\r\n// Create a complex task sequence for file processing\r\nconst task: TaskSequence = {\r\n  tasks: [\r\n    createListDirTask(\r\n      {\r\n        relative_workspace_path: \"src\",\r\n        explanation: \"List source files\"\r\n      },\r\n      [\r\n        createReadFileTask({\r\n          relative_workspace_path: \"src/index.ts\",\r\n          should_read_entire_file: true,\r\n          start_line_one_indexed: 1,\r\n          end_line_one_indexed_inclusive: 100,\r\n          explanation: \"Read index file\"\r\n        }),\r\n        createGrepSearchTask({\r\n          query: \"export\",\r\n          include_pattern: \"*.ts\",\r\n          explanation: \"Find exports\"\r\n        })\r\n      ]\r\n    ),\r\n    createParallelApplyTask({\r\n      edit_plan: \"Update exports\",\r\n      edit_regions: [\r\n        {\r\n          relative_workspace_path: \"src/index.ts\",\r\n          start_line: 1,\r\n          end_line: 100\r\n        }\r\n      ]\r\n    })\r\n  ]\r\n};\r\n```\r\n\r\n## Available Task Creators\r\n\r\n### 1. `createCodebaseSearchTask`\r\nSearch through the codebase with semantic queries.\r\n```typescript\r\ncreateCodebaseSearchTask({\r\n  query: string;\r\n  explanation?: string;\r\n  target_directories?: string[];\r\n});\r\n```\r\n\r\n### 2. `createReadFileTask`\r\nRead file contents with line number control.\r\n```typescript\r\ncreateReadFileTask({\r\n  relative_workspace_path: string;\r\n  should_read_entire_file: boolean;\r\n  start_line_one_indexed: number;\r\n  end_line_one_indexed_inclusive: number;\r\n  explanation?: string;\r\n});\r\n```\r\n\r\n### 3. `createRunTerminalCmdTask`\r\nExecute terminal commands safely.\r\n```typescript\r\ncreateRunTerminalCmdTask({\r\n  command: string;\r\n  is_background: boolean;\r\n  require_user_approval: boolean;\r\n  explanation?: string;\r\n});\r\n```\r\n\r\n### 4. `createListDirTask`\r\nList directory contents.\r\n```typescript\r\ncreateListDirTask({\r\n  relative_workspace_path: string;\r\n  explanation?: string;\r\n});\r\n```\r\n\r\n### 5. `createGrepSearchTask`\r\nPerform text-based searches.\r\n```typescript\r\ncreateGrepSearchTask({\r\n  query: string;\r\n  case_sensitive?: boolean;\r\n  include_pattern?: string;\r\n  exclude_pattern?: string;\r\n  explanation?: string;\r\n});\r\n```\r\n\r\n### 6. `createEditFileTask`\r\nModify file contents.\r\n```typescript\r\ncreateEditFileTask({\r\n  target_file: string;\r\n  instructions: string;\r\n  code_edit: string;\r\n  blocking: boolean;\r\n});\r\n```\r\n\r\n### 7. `createFileSearchTask`\r\nSearch for files by name.\r\n```typescript\r\ncreateFileSearchTask({\r\n  query: string;\r\n  explanation: string;\r\n});\r\n```\r\n\r\n### 8. `createDeleteFileTask`\r\nDelete files safely.\r\n```typescript\r\ncreateDeleteFileTask({\r\n  target_file: string;\r\n  explanation?: string;\r\n});\r\n```\r\n\r\n### 9. `createReapplyTask`\r\nReapply changes to a file.\r\n```typescript\r\ncreateReapplyTask({\r\n  target_file: string;\r\n});\r\n```\r\n\r\n### 10. `createParallelApplyTask`\r\nApply changes to multiple files in parallel.\r\n```typescript\r\ncreateParallelApplyTask({\r\n  edit_plan: string;\r\n  edit_regions: Array<{\r\n    relative_workspace_path: string;\r\n    start_line?: number;\r\n    end_line?: number;\r\n  }>;\r\n});\r\n```\r\n\r\n## Type Safety\r\n\r\nAll task creators are fully typed with TypeScript, providing:\r\n- Parameter validation\r\n- Autocomplete suggestions\r\n- Type inference\r\n- Compile-time checks\r\n\r\n## Tool Reference\r\n\r\n### CodebaseSearch\r\n\r\n**Description**: Find snippets of code from the codebase most relevant to the search query.\r\nThis is a semantic search tool, so the query should ask for something semantically matching what is needed.\r\nIf it makes sense to only search in particular directories, please specify them in the target_directories field.\r\nUnless there is a clear reason to use your own search query, please just reuse the user's exact query with their wording.\r\nTheir exact wording/phrasing can often be helpful for the semantic search query. Keeping the same exact question format can also be helpful.\r\n\r\n**Parameters**:\r\n\r\n- `query` (required)\r\n  The search query to find relevant code. You should reuse the user's exact query/most recent message with their wording unless there is a clear reason not to.\r\n- `explanation` (optional)\r\n  One sentence explanation as to why this tool is being used, and how it contributes to the goal.\r\n- `target_directories` (optional)\r\n  Glob patterns for directories to search over.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"codebase_search\",\r\n  \"arguments\": {\r\n    \"query\": \"How to create a new file\",\r\n    \"explanation\": \"Searching the codebase to find examples of file creation.\",\r\n    \"target_directories\": [\"src/*.ts\", \"utils/*.js\"]\r\n  }\r\n}\r\n```\r\n\r\n### ReadFile\r\n\r\n**Description**: Read the contents of a file. The output of this tool call will be the 1-indexed file contents from start_line_one_indexed to end_line_one_indexed_inclusive, together with a summary of the lines outside start_line_one_indexed and end_line_one_indexed_inclusive.\r\nNote that this call can view at most 250 lines at a time.\r\n\r\nWhen using this tool to gather information, it's your responsibility to ensure you have the COMPLETE context. Specifically, each time you call this command you should:\r\n1) Assess if the contents you viewed are sufficient to proceed with your task.\r\n2) Take note of where there are lines not shown.\r\n3) If the file contents you have viewed are insufficient, and you suspect they may be in lines not shown, proactively call the tool again to view those lines.\r\n4) When in doubt, call this tool again to gather more information. Remember that partial file views may miss critical dependencies, imports, or functionality.\r\n\r\nIn some cases, if reading a range of lines is not enough, you may choose to read the entire file.\r\nReading entire files is often wasteful and slow, especially for large files (i.e. more than a few hundred lines). So you should use this option sparingly.\r\nReading the entire file is not allowed in most cases. You are only allowed to read the entire file if it has been edited or manually attached to the conversation by the user.\r\n\r\n**Parameters**:\r\n\r\n- `relative_workspace_path` (required)\r\n  The path of the file to read, relative to the workspace root.\r\n- `start_line_one_indexed` (required)\r\n  The one-indexed line number to start reading from (inclusive).\r\n- `end_line_one_indexed_inclusive` (required)\r\n  The one-indexed line number to end reading at (inclusive).\r\n- `should_read_entire_file` (required)\r\n  Whether to read the entire file. Defaults to false.\r\n- `explanation` (optional)\r\n  One sentence explanation of why this tool is being used and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"read_file\",\r\n  \"arguments\": {\r\n    \"relative_workspace_path\": \"src/main.ts\",\r\n    \"start_line_one_indexed\": 10,\r\n    \"end_line_one_indexed_inclusive\": 25,\r\n    \"should_read_entire_file\": false,\r\n    \"explanation\": \"Reading a section of main.ts to understand the logic around user input handling.\"\r\n  }\r\n}\r\n```\r\n\r\n### RunTerminalCmd\r\n\r\n**Description**: PROPOSE a command to run on behalf of the user.\r\nIf you have this tool, note that you DO have the ability to run commands directly on the USER's system.\r\nNote that the user will have to approve the command before it is executed.\r\nThe user may reject it if it is not to their liking, or may modify the command before approving it. If they do change it, take those changes into account.\r\nThe actual command will NOT execute until the user approves it. The user may not approve it immediately. Do NOT assume the command has started running.\r\nIf the step is WAITING for user approval, it has NOT started running.\r\n\r\nIn using these tools, adhere to the following guidelines:\r\n1. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a different shell.\r\n2. If in a new shell, you should `cd` to the appropriate directory and do necessary setup in addition to running the command.\r\n3. If in the same shell, the state will persist (eg. if you cd in one step, that cwd is persisted next time you invoke this tool).\r\n4. For ANY commands that would use a pager or require user interaction, you should append ` | cat` to the command (or whatever is appropriate). Otherwise, the command will break. You MUST do this for: git, less, head, tail, more, etc.\r\n5. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\r\n6. Dont include any newlines in the command.\r\n\r\n**Parameters**:\r\n\r\n- `command` (required)\r\n  The terminal command to execute.\r\n- `is_background` (required)\r\n  Whether the command should be run in the background.\r\n- `require_user_approval` (required)\r\n  Whether the user must approve the command before it is executed. Only set this to true if the command is safe and if it matches the user's requirements for commands that should be executed automatically.\r\n- `explanation` (optional)\r\n  One sentence explanation as to why this command needs to be run and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"run_terminal_cmd\",\r\n  \"arguments\": {\r\n    \"command\": \"npm install lodash | cat\",\r\n    \"is_background\": false,\r\n    \"require_user_approval\": true,\r\n    \"explanation\": \"Installing the lodash library as it is required for the new feature.\"\r\n  }\r\n}\r\n```\r\n\r\n### ListDir\r\n\r\n**Description**: List the contents of a directory. The quick tool to use for discovery, before using more targeted tools like semantic search or file reading. Useful to try to understand the file structure before diving deeper into specific files. Can be used to explore the codebase.\r\n\r\n**Parameters**:\r\n\r\n- `relative_workspace_path` (required)\r\n  Path to list contents of, relative to the workspace root.\r\n- `explanation` (optional)\r\n  One sentence explanation as to why this tool is being used, and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"list_dir\",\r\n  \"arguments\": {\r\n    \"relative_workspace_path\": \"src/components\",\r\n    \"explanation\": \"Listing the contents of the components directory to understand the current structure.\"\r\n  }\r\n}\r\n```\r\n\r\n### GrepSearch\r\n\r\n**Description**: Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.\r\nResults will be formatted in the style of ripgrep and can be configured to include line numbers and content.\r\nTo avoid overwhelming output, the results are capped at 50 matches.\r\nUse the include or exclude patterns to filter the search scope by file type or specific paths.\r\n\r\nThis is best for finding exact text matches or regex patterns.\r\nMore precise than semantic search for finding specific strings or patterns.\r\nThis is preferred over semantic search when we know the exact symbol/function name/etc. to search in some set of directories/file types.\r\n\r\n**Parameters**:\r\n\r\n- `query` (required)\r\n  The regex pattern to search for.\r\n- `case_sensitive` (optional)\r\n  Whether the search should be case sensitive.\r\n- `include_pattern` (optional)\r\n  Glob pattern for files to include (e.g. '*.ts' for TypeScript files).\r\n- `exclude_pattern` (optional)\r\n  Glob pattern for files to exclude.\r\n- `explanation` (optional)\r\n  One sentence explanation as to why this tool is being used and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"grep_search\",\r\n  \"arguments\": {\r\n    \"query\": \"TODO:.*\",\r\n    \"case_sensitive\": false,\r\n    \"include_pattern\": \"*.ts\",\r\n    \"explanation\": \"Searching for all TODO comments in TypeScript files.\"\r\n  }\r\n}\r\n```\r\n\r\n### EditFile\r\n\r\n**Description**: Use this tool to propose an edit to an existing file.\r\n\r\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\r\nWhen writing the edit, you should specify each edit in sequence, with the special comment `// ... existing code ...` to represent unchanged code in between edited lines.\r\n\r\nFor example:\r\n\r\n```\r\n// ... existing code ...\r\nFIRST_EDIT\r\n// ... existing code ...\r\nSECOND_EDIT\r\n// ... existing code ...\r\nTHIRD_EDIT\r\n// ... existing code ...\r\n```\r\n\r\nYou should still bias towards repeating as few lines of the original file as possible to convey the change.\r\nBut, each edit should contain sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\r\nDO NOT omit spans of pre-existing code without using the `// ... existing code ...` comment to indicate its absence.\r\nMake sure it is clear what the edit should be.\r\n\r\n**Parameters**:\r\n\r\n- `target_file` (required)\r\n  The target file to modify. Always specify the target file as the first argument and use the relative path in the workspace of the file to edit.\r\n- `instructions` (required)\r\n  A single sentence instruction describing what you are going to do for the sketched edit. This is used to assist the less intelligent model in applying the edit. Please use the first person to describe what you are going to do. Dont repeat what you have said previously in normal messages. And use it to disambiguate uncertainty in the edit.\r\n- `code_edit` (required)\r\n  Specify ONLY the precise lines of code that you wish to edit. **NEVER specify or write out unchanged code**. Instead, represent all unchanged code using the comment of the language you're editing in - example: `// ... existing code ...`.\r\n- `blocking` (required)\r\n  Whether this tool call should block the client from making further edits to the file until this call is complete. If true, the client will not be able to make further edits to the file until this call is complete.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"edit_file\",\r\n  \"arguments\": {\r\n    \"target_file\": \"src/utils.ts\",\r\n    \"instructions\": \"I will add a new function to calculate the sum of an array.\",\r\n    \"code_edit\": \"// ... existing code ...\\nexport function sum(arr: number[]): number {\\n  return arr.reduce((a, b) => a + b, 0);\\n}\\n// ... existing code ...\",\r\n    \"blocking\": true\r\n  }\r\n}\r\n```\r\n\r\n### FileSearch\r\n\r\n**Description**: Fast file search based on fuzzy matching against file path. Use if you know part of the file path but don't know where it's located exactly. Response will be capped to 10 results. Make your query more specific if need to filter results further.\r\n\r\n**Parameters**:\r\n\r\n- `query` (required)\r\n  Fuzzy filename to search for.\r\n- `explanation` (required)\r\n  One sentence explanation as to why this tool is being used and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"file_search\",\r\n  \"arguments\": {\r\n    \"query\": \"user.auth\",\r\n    \"explanation\": \"Searching for files related to user authentication.\"\r\n  }\r\n}\r\n```\r\n\r\n### DeleteFile\r\n\r\n**Description**: Deletes a file at the specified path. The operation will fail gracefully if:\r\n    - The file doesn't exist\r\n    - The operation is rejected for security reasons\r\n    - The file cannot be deleted\r\n\r\n**Parameters**:\r\n\r\n- `target_file` (required)\r\n  The path of the file to delete, relative to the workspace root.\r\n- `explanation` (optional)\r\n  One sentence explanation as to why this tool is being used and how it contributes to the goal.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"delete_file\",\r\n  \"arguments\": {\r\n    \"target_file\": \"temp/unused_file.txt\",\r\n    \"explanation\": \"Deleting an unused temporary file.\"\r\n  }\r\n}\r\n```\r\n\r\n### Reapply\r\n\r\n**Description**: Calls a smarter model to apply the last edit to the specified file.\r\nUse this tool immediately after the result of an edit_file tool call ONLY IF the diff is not what you expected, indicating the model applying the changes was not smart enough to follow your instructions.\r\n\r\n**Parameters**:\r\n\r\n- `target_file` (required)\r\n  The relative path to the file to reapply the last edit to.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"reapply\",\r\n  \"arguments\": {\r\n    \"target_file\": \"src/buggy_code.ts\"\r\n  }\r\n}\r\n```\r\n\r\n### ParallelApply\r\n\r\n**Description**: When there are multiple locations that can be edited in parallel, with a similar type of edit, use this tool to sketch out a plan for the edits.\r\nYou should start with the edit_plan which describes what the edits will be.\r\nThen, write out the files that will be edited with the edit_files argument.\r\nYou shouldn't edit more than 50 files at a time.\r\n\r\n**Parameters**:\r\n\r\n- `edit_plan` (required)\r\n  A detailed description of the parallel edits to be applied.\r\n  They should be specified in a way where a model just seeing one of the files and this plan would be able to apply the edits to any of the files.\r\n  It should be in the first person, describing what you will do on another iteration, after seeing the file.\r\n- `edit_regions` (required)\r\n  Array of regions to edit. Each region should include the minimum contents needed to read in addition to the edit_plan to be able to apply the edits. You should add a lot of cushion to make sure the model definitely has the context it needs to edit the file.\r\n\r\nExample usage:\r\n\r\n```json\r\n{\r\n  \"tool_name\": \"parallel_apply\",\r\n  \"arguments\": {\r\n    \"edit_plan\": \"I will add a new parameter 'debug' to the logging functions and set its default value to false.\",\r\n    \"edit_regions\": [\r\n      {\r\n        \"relative_workspace_path\": \"src/logger.ts\",\r\n        \"start_line\": 20,\r\n        \"end_line\": 40\r\n      },\r\n      {\r\n        \"relative_workspace_path\": \"utils/debug.ts\",\r\n        \"start_line\": 5,\r\n        \"end_line\": 15\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Support\r\n\r\nFor support, please open an issue in the GitHub repository.\r\n\r\n---\r\n[View on GitHub](https://github.com/zalab-inc/cursor_agent)","readmeFilename":"README.md","homepage":"https://github.com/zalab-inc/cursor_agent#readme","repository":{"type":"git","url":"git+https://github.com/zalab-inc/cursor_agent.git"},"bugs":{"url":"https://github.com/zalab-inc/cursor_agent/issues"}}