@mastra/cursor 0.3.1-alpha.0 → 0.3.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -58
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
# @mastra/cursor
|
|
2
2
|
|
|
3
|
-
`@mastra/cursor` connects Mastra to the Cursor SDK. Use it when you want
|
|
3
|
+
`@mastra/cursor` connects Mastra to the Cursor Agent SDK. Use it when you want Cursor's coding-agent runtime and repository tools while exposing the agent through Mastra-compatible `generate()` and `stream()` methods.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @mastra/cursor
|
|
8
|
+
npm install @mastra/cursor
|
|
9
|
+
npm install @cursor/sdk
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
+
## Usage
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`CursorSDKAgent` keeps the Cursor SDK run loop in charge. Mastra receives compatible outputs, usage data, and tracing data for the run.
|
|
16
|
-
|
|
17
|
-
## Create a Cursor SDK agent
|
|
18
|
-
|
|
19
|
-
Pass Cursor SDK configuration through `sdkOptions`. `CursorSDKAgent` creates the Cursor SDK agent on first use.
|
|
14
|
+
Set `CURSOR_API_KEY` before creating the agent.
|
|
20
15
|
|
|
21
16
|
```typescript
|
|
22
17
|
import { CursorSDKAgent } from '@mastra/cursor';
|
|
18
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
23
19
|
|
|
24
20
|
export const cursorAgent = new CursorSDKAgent({
|
|
25
21
|
id: 'cursor-sdk-agent',
|
|
@@ -33,61 +29,20 @@ export const cursorAgent = new CursorSDKAgent({
|
|
|
33
29
|
},
|
|
34
30
|
},
|
|
35
31
|
});
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
You can also pass an existing Cursor SDK agent when your app already creates or owns it.
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
import { Agent as CursorAgent } from '@cursor/sdk';
|
|
42
|
-
import { CursorSDKAgent } from '@mastra/cursor';
|
|
43
|
-
|
|
44
|
-
export const cursorAgent = new CursorSDKAgent({
|
|
45
|
-
id: 'cursor-sdk-agent',
|
|
46
|
-
description: 'Use Cursor Agent SDK through Mastra.',
|
|
47
|
-
agent: CursorAgent.create({
|
|
48
|
-
apiKey: process.env.CURSOR_API_KEY,
|
|
49
|
-
model: { id: process.env.CURSOR_MODEL_ID! },
|
|
50
|
-
local: {
|
|
51
|
-
cwd: process.cwd(),
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
You can register the wrapper anywhere Mastra accepts an `Agent`.
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
import { Mastra } from '@mastra/core/mastra';
|
|
61
32
|
|
|
62
33
|
export const mastra = new Mastra({
|
|
63
|
-
agents: {
|
|
64
|
-
cursorAgent,
|
|
65
|
-
},
|
|
34
|
+
agents: { cursorAgent },
|
|
66
35
|
});
|
|
67
36
|
```
|
|
68
37
|
|
|
69
|
-
##
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
const result = await cursorAgent.generate('Find and explain the failing test.', {
|
|
73
|
-
runId: 'cursor-run',
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
console.log(result.text);
|
|
77
|
-
```
|
|
38
|
+
## Documentation
|
|
78
39
|
|
|
79
|
-
|
|
80
|
-
const stream = await cursorAgent.stream('Inspect this repository and suggest the smallest fix.');
|
|
40
|
+
- [Cursor Agent SDK integration](https://mastra.ai/docs/connections/sdk-agents#cursor-agent-sdk)
|
|
81
41
|
|
|
82
|
-
|
|
83
|
-
if (chunk.type === 'text-delta') {
|
|
84
|
-
process.stdout.write(chunk.payload.text);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
42
|
+
## Changelog
|
|
88
43
|
|
|
89
|
-
|
|
44
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/agent-sdks/cursor/CHANGELOG.md) for version history and release notes.
|
|
90
45
|
|
|
91
|
-
|
|
46
|
+
## Support
|
|
92
47
|
|
|
93
|
-
|
|
48
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/dist/docs/SKILL.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/cursor",
|
|
3
|
-
"version": "0.3.1-alpha.
|
|
3
|
+
"version": "0.3.1-alpha.1",
|
|
4
4
|
"description": "Cursor SDK package for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"typescript": "^7.0.2",
|
|
36
36
|
"vitest": "4.1.10",
|
|
37
37
|
"@internal/types-builder": "0.0.104",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@mastra/core": "1.64.0-alpha.7",
|
|
39
|
+
"@internal/lint": "0.0.129"
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://mastra.ai",
|
|
42
42
|
"repository": {
|