@x-otto/plugin-cursor 0.1.0-alpha.0
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 +33 -0
- package/otto-plugin.json +27 -0
- package/package.json +30 -0
- package/plugin-dist/meta.json +1 -0
- package/plugin-dist/plugin.cjs +53237 -0
- package/plugin.ts +15 -0
- package/src/auth/cursor-oauth.ts +100 -0
- package/src/auth/errors.ts +36 -0
- package/src/auth/local-credentials.ts +74 -0
- package/src/connect-rpc/agent-decode.ts +270 -0
- package/src/connect-rpc/agent-request.ts +53 -0
- package/src/connect-rpc/agent-stream.ts +101 -0
- package/src/connect-rpc/headers.ts +94 -0
- package/src/connect-rpc/protobuf.ts +46 -0
- package/src/cursor-provider.ts +144 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @x-otto/plugin-cursor
|
|
2
|
+
|
|
3
|
+
> Cursor subscription provider plugin (RFC-130).
|
|
4
|
+
|
|
5
|
+
Provides Cursor IDE's AI model access via Connect-RPC + Protobuf over HTTP/2. Supports two authentication modes: local Cursor IDE installation credentials and `CURSOR_ACCESS_TOKEN` environment variable fallback.
|
|
6
|
+
|
|
7
|
+
## How it works
|
|
8
|
+
|
|
9
|
+
This is a **code-based provider** — Cursor's backend uses a custom Connect-RPC protocol that cannot be expressed through the standard `wireApi` schemas (openai-completions, openai-responses, anthropic-messages). The entire protocol encoding/decoding lives within this plugin's `src/connect-rpc/` directory.
|
|
10
|
+
|
|
11
|
+
The OAuth device-flow credentials are declared in `otto-plugin.json` `contributes.oauth`, while the provider factory is wired programmatically via `plugin.ts`.
|
|
12
|
+
|
|
13
|
+
Cursor provider does **not** support tool calling (agent-side tools only, see M131-3 WONT_FIX).
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
otto extension install plugin-cursor
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
otto auth login cursor
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or set `CURSOR_ACCESS_TOKEN` in your environment.
|
|
28
|
+
|
|
29
|
+
## Dependencies
|
|
30
|
+
|
|
31
|
+
- `@x-otto/provider` (workspace)
|
|
32
|
+
- `@x-otto/shared` (workspace)
|
|
33
|
+
- `@x-otto/plugin` (dev, build-time only)
|
package/otto-plugin.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "plugin-cursor",
|
|
3
|
+
"name": "Cursor Provider",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Cursor subscription provider (RFC-130). macOS local import + CURSOR_ACCESS_TOKEN env fallback.",
|
|
6
|
+
"capabilities": ["provider"],
|
|
7
|
+
"contributes": {
|
|
8
|
+
"providers": [
|
|
9
|
+
{
|
|
10
|
+
"id": "cursor",
|
|
11
|
+
"name": "Cursor",
|
|
12
|
+
"catalogOnly": true,
|
|
13
|
+
"preserveProviderId": true,
|
|
14
|
+
"oauthRef": "cursor",
|
|
15
|
+
"envKey": "CURSOR_ACCESS_TOKEN",
|
|
16
|
+
"supportsTools": false,
|
|
17
|
+
"models": [
|
|
18
|
+
{
|
|
19
|
+
"id": "cursor/default",
|
|
20
|
+
"contextWindow": 200000,
|
|
21
|
+
"maxOutput": 8192
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@x-otto/plugin-cursor",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Cursor subscription provider (RFC-130)",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@x-otto/provider": "0.1.0-alpha.1",
|
|
8
|
+
"@x-otto/shared": "0.1.0-alpha.1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@x-otto/plugin": "0.1.0-alpha.1"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"files": [
|
|
15
|
+
"otto-plugin.json",
|
|
16
|
+
"README.md",
|
|
17
|
+
"plugin.ts",
|
|
18
|
+
"src",
|
|
19
|
+
"plugin-dist"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"registry": "https://registry.npmjs.org",
|
|
24
|
+
"tag": "alpha"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"apiVersion":1,"compilerVersion":"0.1.0-alpha.1","sourceHash":"ff4bf89980dcd93e794ffb0b1c53cd33edda56399f111cfd6a55037a420082ad"}
|